From 025b91e31ca2dff02a403ef484150c8258178c98 Mon Sep 17 00:00:00 2001 From: Victor Costan Date: Thu, 20 Jul 2017 18:43:42 +0000 Subject: [PATCH] sqlite: strip trailing space and CR from src/ and patches. Getting the whitespace removed will make SQLite patch management easier. This CL was generated using the following commands. cd third_party/sqlite find src/ -type f -not -iname "*.db" -not -iname "*.eps" -not -iname "*.ico" \ -not -iname "*.jpg" -not -iname "*.pfx" -not -iname "*.tiff" \ -not -iname "*.vsix" -exec sed --in-place 's/[[:space:]]\+$//' {} \+ find patches/ -type f -exec sed --in-place 's/[[:space:]]\+$//' {} \+ ./google_generate_amalgamation.sh Bug: 746653 Change-Id: I933ab436d5a1be05074821d92e818dd6bf72009f Reviewed-on: https://chromium-review.googlesource.com/578677 Reviewed-by: Joshua Bell Commit-Queue: Victor Costan Cr-Commit-Position: refs/heads/master@{#488326} --- third_party/sqlite/amalgamation/sqlite3.c | 12885 +++++---- third_party/sqlite/amalgamation/sqlite3.h | 1158 +- ...test-SQLite-tests-compiling-on-Linux.patch | 32 +- ...e-cache-pools-for-each-sqlite-connec.patch | 2 +- ...y-default-VFS-to-support-WebDatabase.patch | 22 +- ...pporting-recovery-of-corrupted-datab.patch | 10 +- ...-helpers-to-load-Chromium-s-ICU-data.patch | 10 +- ...fts3-Disable-fts3_tokenizer-and-fts4.patch | 8 +- ...3-Interior-node-corruption-detection.patch | 4 +- ...t-variable-in-fts3EvalDeferredPhrase.patch | 6 +- ...-_CRT_RAND_S-conflict-in-sqliteInt.h.patch | 4 +- ...defined-symbol-in-intrinsic-on-clang.patch | 2 +- ...llow-auto-vacuum-to-work-with-chunks.patch | 12 +- third_party/sqlite/src/Makefile.in | 34 +- third_party/sqlite/src/Makefile.linux-gcc | 12 +- third_party/sqlite/src/aclocal.m4 | 2 +- third_party/sqlite/src/autoconf/configure.ac | 22 +- .../sqlite/src/autoconf/tea/Makefile.in | 2 +- .../sqlite/src/autoconf/tea/win/makefile.vc | 6 +- .../sqlite/src/autoconf/tea/win/nmakehlp.c | 24 +- third_party/sqlite/src/configure.ac | 42 +- third_party/sqlite/src/doc/lemon.html | 32 +- .../sqlite/src/doc/pager-invariants.txt | 32 +- third_party/sqlite/src/doc/vfs-shm.txt | 12 +- third_party/sqlite/src/ext/async/README.txt | 48 +- .../sqlite/src/ext/async/sqlite3async.c | 228 +- .../sqlite/src/ext/async/sqlite3async.h | 56 +- third_party/sqlite/src/ext/fts1/ft_hash.c | 10 +- third_party/sqlite/src/ext/fts1/ft_hash.h | 6 +- third_party/sqlite/src/ext/fts1/fts1.c | 42 +- third_party/sqlite/src/ext/fts1/fts1_hash.c | 12 +- third_party/sqlite/src/ext/fts1/fts1_hash.h | 6 +- third_party/sqlite/src/ext/fts1/fts1_porter.c | 18 +- .../sqlite/src/ext/fts1/fts1_tokenizer1.c | 2 +- third_party/sqlite/src/ext/fts1/fulltext.c | 12 +- .../sqlite/src/ext/fts2/README.tokenizers | 42 +- third_party/sqlite/src/ext/fts2/fts2.c | 38 +- third_party/sqlite/src/ext/fts2/fts2_hash.c | 12 +- third_party/sqlite/src/ext/fts2/fts2_hash.h | 6 +- third_party/sqlite/src/ext/fts2/fts2_icu.c | 6 +- third_party/sqlite/src/ext/fts2/fts2_porter.c | 18 +- .../sqlite/src/ext/fts2/fts2_tokenizer.c | 28 +- .../sqlite/src/ext/fts2/fts2_tokenizer.h | 12 +- .../sqlite/src/ext/fts2/fts2_tokenizer1.c | 2 +- .../sqlite/src/ext/fts2/mkfts2amal.tcl | 6 +- .../sqlite/src/ext/fts3/README.content | 28 +- third_party/sqlite/src/ext/fts3/README.syntax | 36 +- .../sqlite/src/ext/fts3/README.tokenizers | 42 +- third_party/sqlite/src/ext/fts3/fts3.c | 478 +- third_party/sqlite/src/ext/fts3/fts3Int.h | 60 +- third_party/sqlite/src/ext/fts3/fts3_aux.c | 22 +- third_party/sqlite/src/ext/fts3/fts3_expr.c | 104 +- third_party/sqlite/src/ext/fts3/fts3_hash.c | 18 +- third_party/sqlite/src/ext/fts3/fts3_hash.h | 6 +- third_party/sqlite/src/ext/fts3/fts3_icu.c | 4 +- third_party/sqlite/src/ext/fts3/fts3_porter.c | 20 +- .../sqlite/src/ext/fts3/fts3_snippet.c | 112 +- third_party/sqlite/src/ext/fts3/fts3_term.c | 10 +- third_party/sqlite/src/ext/fts3/fts3_test.c | 18 +- .../sqlite/src/ext/fts3/fts3_tokenize_vtab.c | 16 +- .../sqlite/src/ext/fts3/fts3_tokenizer.c | 30 +- .../sqlite/src/ext/fts3/fts3_tokenizer.h | 14 +- .../sqlite/src/ext/fts3/fts3_tokenizer1.c | 2 +- .../sqlite/src/ext/fts3/fts3_unicode.c | 16 +- .../sqlite/src/ext/fts3/fts3_unicode2.c | 76 +- third_party/sqlite/src/ext/fts3/fts3_write.c | 478 +- third_party/sqlite/src/ext/fts3/fts3speed.tcl | 2 +- .../sqlite/src/ext/fts3/mkfts3amal.tcl | 6 +- .../sqlite/src/ext/fts3/tool/fts3view.c | 16 +- .../src/ext/fts3/unicode/CaseFolding.txt | 2 +- .../sqlite/src/ext/fts3/unicode/mkunicode.tcl | 28 +- .../src/ext/fts3/unicode/parseunicode.tcl | 2 +- .../sqlite/src/ext/fts5/extract_api_docs.tcl | 14 +- third_party/sqlite/src/ext/fts5/fts5.h | 104 +- third_party/sqlite/src/ext/fts5/fts5Int.h | 78 +- third_party/sqlite/src/ext/fts5/fts5_aux.c | 32 +- third_party/sqlite/src/ext/fts5/fts5_buffer.c | 46 +- third_party/sqlite/src/ext/fts5/fts5_config.c | 70 +- third_party/sqlite/src/ext/fts5/fts5_expr.c | 160 +- third_party/sqlite/src/ext/fts5/fts5_hash.c | 18 +- third_party/sqlite/src/ext/fts5/fts5_index.c | 422 +- third_party/sqlite/src/ext/fts5/fts5_main.c | 246 +- .../sqlite/src/ext/fts5/fts5_storage.c | 90 +- third_party/sqlite/src/ext/fts5/fts5_tcl.c | 48 +- .../sqlite/src/ext/fts5/fts5_test_mi.c | 40 +- .../sqlite/src/ext/fts5/fts5_test_tok.c | 22 +- .../sqlite/src/ext/fts5/fts5_tokenize.c | 196 +- .../sqlite/src/ext/fts5/fts5_unicode2.c | 76 +- third_party/sqlite/src/ext/fts5/fts5_varint.c | 2 +- third_party/sqlite/src/ext/fts5/fts5_vocab.c | 36 +- third_party/sqlite/src/ext/fts5/fts5parse.y | 24 +- .../sqlite/src/ext/fts5/mkportersteps.tcl | 96 +- .../sqlite/src/ext/fts5/test/fts5_common.tcl | 30 +- .../sqlite/src/ext/fts5/test/fts5aa.test | 8 +- .../sqlite/src/ext/fts5/test/fts5ab.test | 6 +- .../sqlite/src/ext/fts5/test/fts5ac.test | 4 +- .../sqlite/src/ext/fts5/test/fts5ad.test | 16 +- .../sqlite/src/ext/fts5/test/fts5ae.test | 24 +- .../sqlite/src/ext/fts5/test/fts5af.test | 10 +- .../sqlite/src/ext/fts5/test/fts5ag.test | 2 +- .../sqlite/src/ext/fts5/test/fts5ah.test | 6 +- .../sqlite/src/ext/fts5/test/fts5aj.test | 6 +- .../sqlite/src/ext/fts5/test/fts5ak.test | 2 +- .../sqlite/src/ext/fts5/test/fts5al.test | 36 +- .../sqlite/src/ext/fts5/test/fts5auto.test | 312 +- .../sqlite/src/ext/fts5/test/fts5aux.test | 14 +- .../sqlite/src/ext/fts5/test/fts5auxdata.test | 6 +- .../src/ext/fts5/test/fts5columnsize.test | 8 +- .../sqlite/src/ext/fts5/test/fts5config.test | 14 +- .../src/ext/fts5/test/fts5conflict.test | 4 +- .../sqlite/src/ext/fts5/test/fts5content.test | 12 +- .../sqlite/src/ext/fts5/test/fts5corrupt.test | 2 +- .../src/ext/fts5/test/fts5corrupt2.test | 32 +- .../src/ext/fts5/test/fts5corrupt3.test | 32 +- .../sqlite/src/ext/fts5/test/fts5detail.test | 6 +- .../src/ext/fts5/test/fts5determin.test | 2 +- .../sqlite/src/ext/fts5/test/fts5dlidx.test | 26 +- .../sqlite/src/ext/fts5/test/fts5doclist.test | 2 +- .../sqlite/src/ext/fts5/test/fts5ea.test | 4 +- .../sqlite/src/ext/fts5/test/fts5fault1.test | 16 +- .../sqlite/src/ext/fts5/test/fts5fault2.test | 14 +- .../sqlite/src/ext/fts5/test/fts5fault3.test | 2 +- .../sqlite/src/ext/fts5/test/fts5fault4.test | 22 +- .../sqlite/src/ext/fts5/test/fts5fault5.test | 6 +- .../sqlite/src/ext/fts5/test/fts5fault6.test | 12 +- .../sqlite/src/ext/fts5/test/fts5fault8.test | 8 +- .../sqlite/src/ext/fts5/test/fts5fault9.test | 2 +- .../sqlite/src/ext/fts5/test/fts5faultA.test | 10 +- .../sqlite/src/ext/fts5/test/fts5faultB.test | 8 +- .../sqlite/src/ext/fts5/test/fts5full.test | 2 +- .../sqlite/src/ext/fts5/test/fts5hash.test | 14 +- .../src/ext/fts5/test/fts5integrity.test | 20 +- .../src/ext/fts5/test/fts5matchinfo.test | 42 +- .../sqlite/src/ext/fts5/test/fts5merge.test | 4 +- .../sqlite/src/ext/fts5/test/fts5near.test | 4 +- .../sqlite/src/ext/fts5/test/fts5onepass.test | 10 +- .../sqlite/src/ext/fts5/test/fts5phrase.test | 6 +- .../sqlite/src/ext/fts5/test/fts5plan.test | 4 +- .../sqlite/src/ext/fts5/test/fts5porter.test | 23526 ++++++++-------- .../sqlite/src/ext/fts5/test/fts5prefix.test | 10 +- .../sqlite/src/ext/fts5/test/fts5rank.test | 6 +- .../sqlite/src/ext/fts5/test/fts5restart.test | 4 +- .../sqlite/src/ext/fts5/test/fts5rowid.test | 4 +- .../sqlite/src/ext/fts5/test/fts5simple.test | 16 +- .../sqlite/src/ext/fts5/test/fts5simple2.test | 6 +- .../sqlite/src/ext/fts5/test/fts5simple3.test | 6 +- .../sqlite/src/ext/fts5/test/fts5synonym.test | 18 +- .../src/ext/fts5/test/fts5synonym2.test | 6 +- .../sqlite/src/ext/fts5/test/fts5tok1.test | 12 +- .../src/ext/fts5/test/fts5tokenizer.test | 18 +- .../src/ext/fts5/test/fts5unicode2.test | 74 +- .../src/ext/fts5/test/fts5unicode3.test | 4 +- .../sqlite/src/ext/fts5/test/fts5update.test | 18 +- .../sqlite/src/ext/fts5/test/fts5version.test | 2 +- .../sqlite/src/ext/fts5/test/fts5vocab.test | 36 +- .../sqlite/src/ext/fts5/tool/fts5speed.tcl | 2 +- .../sqlite/src/ext/fts5/tool/fts5txt2db.tcl | 24 +- .../sqlite/src/ext/fts5/tool/loadfts5.tcl | 2 +- .../sqlite/src/ext/fts5/tool/mkfts5c.tcl | 12 +- third_party/sqlite/src/ext/icu/README.txt | 28 +- third_party/sqlite/src/ext/icu/icu.c | 48 +- third_party/sqlite/src/ext/misc/amatch.c | 76 +- third_party/sqlite/src/ext/misc/carray.c | 10 +- third_party/sqlite/src/ext/misc/closure.c | 30 +- third_party/sqlite/src/ext/misc/compress.c | 4 +- third_party/sqlite/src/ext/misc/csv.c | 22 +- third_party/sqlite/src/ext/misc/eval.c | 6 +- third_party/sqlite/src/ext/misc/fileio.c | 4 +- third_party/sqlite/src/ext/misc/fuzzer.c | 64 +- third_party/sqlite/src/ext/misc/ieee754.c | 4 +- third_party/sqlite/src/ext/misc/json1.c | 24 +- third_party/sqlite/src/ext/misc/memvfs.c | 34 +- third_party/sqlite/src/ext/misc/nextchar.c | 14 +- third_party/sqlite/src/ext/misc/percentile.c | 4 +- third_party/sqlite/src/ext/misc/regexp.c | 20 +- third_party/sqlite/src/ext/misc/remember.c | 4 +- third_party/sqlite/src/ext/misc/rot13.c | 8 +- third_party/sqlite/src/ext/misc/scrub.c | 24 +- third_party/sqlite/src/ext/misc/series.c | 14 +- third_party/sqlite/src/ext/misc/showauth.c | 4 +- third_party/sqlite/src/ext/misc/spellfix.c | 50 +- third_party/sqlite/src/ext/misc/vfslog.c | 34 +- third_party/sqlite/src/ext/misc/vfsstat.c | 40 +- third_party/sqlite/src/ext/misc/wholenumber.c | 8 +- third_party/sqlite/src/ext/rbu/rbu.c | 4 +- third_party/sqlite/src/ext/rbu/rbu1.test | 104 +- third_party/sqlite/src/ext/rbu/rbu10.test | 14 +- third_party/sqlite/src/ext/rbu/rbu11.test | 10 +- third_party/sqlite/src/ext/rbu/rbu12.test | 28 +- third_party/sqlite/src/ext/rbu/rbu14.test | 4 +- third_party/sqlite/src/ext/rbu/rbu3.test | 6 +- third_party/sqlite/src/ext/rbu/rbu5.test | 22 +- third_party/sqlite/src/ext/rbu/rbu6.test | 2 +- third_party/sqlite/src/ext/rbu/rbu7.test | 4 +- third_party/sqlite/src/ext/rbu/rbu9.test | 14 +- third_party/sqlite/src/ext/rbu/rbuB.test | 2 +- third_party/sqlite/src/ext/rbu/rbuC.test | 16 +- third_party/sqlite/src/ext/rbu/rbucrash.test | 6 +- third_party/sqlite/src/ext/rbu/rbudiff.test | 16 +- third_party/sqlite/src/ext/rbu/rbudor.test | 4 +- third_party/sqlite/src/ext/rbu/rbufault.test | 28 +- third_party/sqlite/src/ext/rbu/rbufault2.test | 6 +- third_party/sqlite/src/ext/rbu/rbufault3.test | 20 +- third_party/sqlite/src/ext/rbu/rbufault4.test | 2 +- third_party/sqlite/src/ext/rbu/rbufts.test | 8 +- .../sqlite/src/ext/rbu/rbuprogress.test | 64 +- third_party/sqlite/src/ext/rbu/rburesume.test | 16 +- third_party/sqlite/src/ext/rbu/rbusave.test | 4 +- third_party/sqlite/src/ext/rbu/rbuvacuum.test | 8 +- .../sqlite/src/ext/rbu/rbuvacuum2.test | 26 +- third_party/sqlite/src/ext/rbu/sqlite3rbu.c | 470 +- third_party/sqlite/src/ext/rbu/sqlite3rbu.h | 186 +- third_party/sqlite/src/ext/rbu/test_rbu.c | 4 +- third_party/sqlite/src/ext/rtree/README | 26 +- third_party/sqlite/src/ext/rtree/rtree.c | 240 +- third_party/sqlite/src/ext/rtree/rtree1.test | 38 +- third_party/sqlite/src/ext/rtree/rtree2.test | 22 +- third_party/sqlite/src/ext/rtree/rtree3.test | 14 +- third_party/sqlite/src/ext/rtree/rtree4.test | 14 +- third_party/sqlite/src/ext/rtree/rtree5.test | 36 +- third_party/sqlite/src/ext/rtree/rtree6.test | 62 +- third_party/sqlite/src/ext/rtree/rtree7.test | 8 +- third_party/sqlite/src/ext/rtree/rtree8.test | 34 +- third_party/sqlite/src/ext/rtree/rtree9.test | 10 +- third_party/sqlite/src/ext/rtree/rtreeA.test | 12 +- third_party/sqlite/src/ext/rtree/rtreeB.test | 6 +- third_party/sqlite/src/ext/rtree/rtreeC.test | 52 +- third_party/sqlite/src/ext/rtree/rtreeD.test | 4 +- third_party/sqlite/src/ext/rtree/rtreeE.test | 6 +- third_party/sqlite/src/ext/rtree/rtreeF.test | 12 +- third_party/sqlite/src/ext/rtree/rtreeG.test | 2 +- .../sqlite/src/ext/rtree/rtree_util.tcl | 20 +- .../sqlite/src/ext/rtree/sqlite3rtree.h | 4 +- third_party/sqlite/src/ext/rtree/tkt3363.test | 4 +- .../sqlite/src/ext/rtree/viewrtree.tcl | 4 +- .../sqlite/src/ext/session/changeset.c | 4 +- .../sqlite/src/ext/session/session1.test | 54 +- .../sqlite/src/ext/session/session2.test | 64 +- .../sqlite/src/ext/session/session3.test | 20 +- .../sqlite/src/ext/session/session4.test | 6 +- .../sqlite/src/ext/session/session5.test | 24 +- .../sqlite/src/ext/session/session6.test | 2 +- .../sqlite/src/ext/session/session8.test | 4 +- .../sqlite/src/ext/session/session9.test | 22 +- .../sqlite/src/ext/session/sessionA.test | 12 +- .../sqlite/src/ext/session/sessionB.test | 44 +- .../sqlite/src/ext/session/sessionC.test | 6 +- .../sqlite/src/ext/session/sessionD.test | 16 +- .../sqlite/src/ext/session/sessionE.test | 2 +- .../sqlite/src/ext/session/sessionF.test | 56 +- .../sqlite/src/ext/session/sessionG.test | 2 +- .../sqlite/src/ext/session/session_common.tcl | 14 +- .../src/ext/session/session_speed_test.c | 18 +- .../sqlite/src/ext/session/sessionat.test | 10 +- .../sqlite/src/ext/session/sessionfault.test | 40 +- .../sqlite/src/ext/session/sessionfault2.test | 2 +- .../sqlite/src/ext/session/sessionwor.test | 2 +- .../sqlite/src/ext/session/sqlite3session.c | 300 +- .../sqlite/src/ext/session/sqlite3session.h | 322 +- .../sqlite/src/ext/session/test_session.c | 44 +- .../sqlite/src/ext/userauth/sqlite3userauth.h | 2 +- .../sqlite/src/ext/userauth/user-auth.txt | 16 +- .../sqlite/src/ext/userauth/userauth.c | 6 +- third_party/sqlite/src/install-sh | 16 +- third_party/sqlite/src/magic.txt | 6 +- third_party/sqlite/src/main.mk | 26 +- third_party/sqlite/src/mptest/crash02.subtest | 2 +- third_party/sqlite/src/mptest/mptest.c | 10 +- third_party/sqlite/src/sqlite3.1 | 8 +- third_party/sqlite/src/src/alter.c | 82 +- third_party/sqlite/src/src/analyze.c | 118 +- third_party/sqlite/src/src/attach.c | 16 +- third_party/sqlite/src/src/auth.c | 6 +- third_party/sqlite/src/src/backup.c | 78 +- third_party/sqlite/src/src/bitvec.c | 20 +- third_party/sqlite/src/src/btmutex.c | 6 +- third_party/sqlite/src/src/btree.c | 650 +- third_party/sqlite/src/src/btree.h | 10 +- third_party/sqlite/src/src/btreeInt.h | 42 +- third_party/sqlite/src/src/build.c | 180 +- third_party/sqlite/src/src/callback.c | 22 +- third_party/sqlite/src/src/complete.c | 2 +- third_party/sqlite/src/src/ctime.c | 2 +- third_party/sqlite/src/src/date.c | 26 +- third_party/sqlite/src/src/dbstat.c | 28 +- third_party/sqlite/src/src/delete.c | 78 +- third_party/sqlite/src/src/expr.c | 244 +- third_party/sqlite/src/src/fault.c | 10 +- third_party/sqlite/src/src/fkey.c | 222 +- third_party/sqlite/src/src/func.c | 62 +- third_party/sqlite/src/src/global.c | 8 +- third_party/sqlite/src/src/hash.c | 6 +- third_party/sqlite/src/src/hash.h | 4 +- third_party/sqlite/src/src/hwtime.h | 2 +- third_party/sqlite/src/src/in-operator.md | 8 +- third_party/sqlite/src/src/insert.c | 88 +- third_party/sqlite/src/src/legacy.c | 2 +- third_party/sqlite/src/src/loadext.c | 16 +- third_party/sqlite/src/src/main.c | 206 +- third_party/sqlite/src/src/malloc.c | 22 +- third_party/sqlite/src/src/mem1.c | 6 +- third_party/sqlite/src/src/mem2.c | 24 +- third_party/sqlite/src/src/mem3.c | 42 +- third_party/sqlite/src/src/mem5.c | 26 +- third_party/sqlite/src/src/memjournal.c | 26 +- third_party/sqlite/src/src/mutex.c | 6 +- third_party/sqlite/src/src/mutex.h | 4 +- third_party/sqlite/src/src/mutex_noop.c | 6 +- third_party/sqlite/src/src/mutex_unix.c | 8 +- third_party/sqlite/src/src/notify.c | 28 +- third_party/sqlite/src/src/os.h | 24 +- third_party/sqlite/src/src/os_unix.c | 686 +- third_party/sqlite/src/src/pager.c | 1070 +- third_party/sqlite/src/src/pager.h | 18 +- third_party/sqlite/src/src/parse.y | 58 +- third_party/sqlite/src/src/pcache.c | 46 +- third_party/sqlite/src/src/pcache.h | 6 +- third_party/sqlite/src/src/pcache1.c | 92 +- third_party/sqlite/src/src/pragma.c | 80 +- third_party/sqlite/src/src/pragma.h | 68 +- third_party/sqlite/src/src/prepare.c | 32 +- third_party/sqlite/src/src/printf.c | 8 +- third_party/sqlite/src/src/resolve.c | 60 +- third_party/sqlite/src/src/rowset.c | 12 +- third_party/sqlite/src/src/select.c | 254 +- third_party/sqlite/src/src/shell.c | 20 +- third_party/sqlite/src/src/sqlite.h.in | 728 +- third_party/sqlite/src/src/sqlite3ext.h | 6 +- third_party/sqlite/src/src/sqliteInt.h | 4 +- third_party/sqlite/src/src/sqliteLimit.h | 18 +- third_party/sqlite/src/src/status.c | 6 +- third_party/sqlite/src/src/table.c | 2 +- third_party/sqlite/src/src/tclsqlite.c | 2 +- third_party/sqlite/src/src/test1.c | 372 +- third_party/sqlite/src/src/test2.c | 4 +- third_party/sqlite/src/src/test3.c | 12 +- third_party/sqlite/src/src/test4.c | 4 +- third_party/sqlite/src/src/test5.c | 2 +- third_party/sqlite/src/src/test6.c | 96 +- third_party/sqlite/src/src/test7.c | 12 +- third_party/sqlite/src/src/test8.c | 112 +- third_party/sqlite/src/src/test9.c | 2 +- third_party/sqlite/src/src/test_async.c | 4 +- third_party/sqlite/src/src/test_autoext.c | 12 +- third_party/sqlite/src/src/test_backup.c | 8 +- third_party/sqlite/src/src/test_bestindex.c | 32 +- third_party/sqlite/src/src/test_blob.c | 24 +- third_party/sqlite/src/src/test_config.c | 20 +- third_party/sqlite/src/src/test_delete.c | 10 +- third_party/sqlite/src/src/test_demovfs.c | 62 +- third_party/sqlite/src/src/test_devsym.c | 40 +- third_party/sqlite/src/src/test_fs.c | 28 +- third_party/sqlite/src/src/test_func.c | 44 +- third_party/sqlite/src/src/test_hexio.c | 2 +- third_party/sqlite/src/src/test_init.c | 26 +- third_party/sqlite/src/src/test_intarray.c | 4 +- third_party/sqlite/src/src/test_journal.c | 88 +- third_party/sqlite/src/src/test_loadext.c | 10 +- third_party/sqlite/src/src/test_malloc.c | 46 +- third_party/sqlite/src/src/test_multiplex.c | 78 +- third_party/sqlite/src/src/test_multiplex.h | 22 +- third_party/sqlite/src/src/test_mutex.c | 8 +- third_party/sqlite/src/src/test_onefile.c | 66 +- third_party/sqlite/src/src/test_osinst.c | 60 +- third_party/sqlite/src/src/test_pcache.c | 12 +- third_party/sqlite/src/src/test_quota.h | 6 +- third_party/sqlite/src/src/test_rtree.c | 36 +- third_party/sqlite/src/src/test_schema.c | 12 +- third_party/sqlite/src/src/test_server.c | 14 +- third_party/sqlite/src/src/test_sqllog.c | 42 +- third_party/sqlite/src/src/test_superlock.c | 14 +- third_party/sqlite/src/src/test_syscall.c | 50 +- third_party/sqlite/src/src/test_tclvar.c | 22 +- third_party/sqlite/src/src/test_thread.c | 40 +- third_party/sqlite/src/src/test_vfs.c | 94 +- third_party/sqlite/src/src/test_vfstrace.c | 52 +- third_party/sqlite/src/src/test_wsd.c | 2 +- third_party/sqlite/src/src/threads.c | 10 +- third_party/sqlite/src/src/tokenize.c | 16 +- third_party/sqlite/src/src/treeview.c | 6 +- third_party/sqlite/src/src/trigger.c | 90 +- third_party/sqlite/src/src/update.c | 70 +- third_party/sqlite/src/src/utf.c | 20 +- third_party/sqlite/src/src/util.c | 40 +- third_party/sqlite/src/src/vacuum.c | 6 +- third_party/sqlite/src/src/vdbe.c | 456 +- third_party/sqlite/src/src/vdbe.h | 4 +- third_party/sqlite/src/src/vdbeInt.h | 12 +- third_party/sqlite/src/src/vdbeapi.c | 156 +- third_party/sqlite/src/src/vdbeaux.c | 288 +- third_party/sqlite/src/src/vdbeblob.c | 54 +- third_party/sqlite/src/src/vdbemem.c | 52 +- third_party/sqlite/src/src/vdbesort.c | 204 +- third_party/sqlite/src/src/vdbetrace.c | 8 +- third_party/sqlite/src/src/vtab.c | 82 +- third_party/sqlite/src/src/wal.c | 280 +- third_party/sqlite/src/src/wal.h | 14 +- third_party/sqlite/src/src/walker.c | 8 +- third_party/sqlite/src/src/where.c | 304 +- third_party/sqlite/src/src/whereInt.h | 8 +- third_party/sqlite/src/src/wherecode.c | 134 +- third_party/sqlite/src/src/whereexpr.c | 48 +- third_party/sqlite/src/test/8_3_names.test | 2 +- third_party/sqlite/src/test/affinity3.test | 8 +- third_party/sqlite/src/test/aggnested.test | 10 +- third_party/sqlite/src/test/all.test | 36 +- third_party/sqlite/src/test/alter.test | 42 +- third_party/sqlite/src/test/alter2.test | 42 +- third_party/sqlite/src/test/alter3.test | 18 +- third_party/sqlite/src/test/alter4.test | 18 +- third_party/sqlite/src/test/altermalloc.test | 2 +- third_party/sqlite/src/test/analyze.test | 2 +- third_party/sqlite/src/test/analyze3.test | 30 +- third_party/sqlite/src/test/analyze4.test | 8 +- third_party/sqlite/src/test/analyze5.test | 12 +- third_party/sqlite/src/test/analyze8.test | 4 +- third_party/sqlite/src/test/analyze9.test | 94 +- third_party/sqlite/src/test/analyzeA.test | 28 +- third_party/sqlite/src/test/analyzeB.test | 18 +- third_party/sqlite/src/test/analyzeD.test | 4 +- third_party/sqlite/src/test/async.test | 6 +- third_party/sqlite/src/test/async2.test | 8 +- third_party/sqlite/src/test/async4.test | 2 +- third_party/sqlite/src/test/atof1.test | 2 +- third_party/sqlite/src/test/attach.test | 8 +- third_party/sqlite/src/test/attach2.test | 12 +- third_party/sqlite/src/test/attach3.test | 8 +- third_party/sqlite/src/test/attach4.test | 2 +- third_party/sqlite/src/test/auth.test | 26 +- third_party/sqlite/src/test/auth3.test | 6 +- third_party/sqlite/src/test/autoinc.test | 16 +- third_party/sqlite/src/test/autoindex1.test | 54 +- third_party/sqlite/src/test/autoindex2.test | 6 +- third_party/sqlite/src/test/autoindex3.test | 2 +- third_party/sqlite/src/test/autoindex4.test | 6 +- third_party/sqlite/src/test/autoindex5.test | 14 +- third_party/sqlite/src/test/autovacuum.test | 22 +- .../sqlite/src/test/autovacuum_ioerr2.test | 10 +- third_party/sqlite/src/test/avtrans.test | 30 +- third_party/sqlite/src/test/backcompat.test | 64 +- third_party/sqlite/src/test/backup.test | 80 +- third_party/sqlite/src/test/backup2.test | 2 +- third_party/sqlite/src/test/backup4.test | 6 +- third_party/sqlite/src/test/backup_ioerr.test | 22 +- .../sqlite/src/test/backup_malloc.test | 10 +- third_party/sqlite/src/test/badutf.test | 2 +- third_party/sqlite/src/test/badutf2.test | 4 +- third_party/sqlite/src/test/bestindex1.test | 22 +- third_party/sqlite/src/test/bestindex2.test | 18 +- third_party/sqlite/src/test/bestindex3.test | 12 +- third_party/sqlite/src/test/bestindex4.test | 4 +- third_party/sqlite/src/test/between.test | 2 +- third_party/sqlite/src/test/bigfile2.test | 4 +- third_party/sqlite/src/test/bigsort.test | 6 +- third_party/sqlite/src/test/bind.test | 4 +- third_party/sqlite/src/test/bitvec.test | 2 +- third_party/sqlite/src/test/boundary1.tcl | 16 +- third_party/sqlite/src/test/boundary2.tcl | 28 +- third_party/sqlite/src/test/boundary3.tcl | 12 +- third_party/sqlite/src/test/btree02.test | 4 +- third_party/sqlite/src/test/btreefault.test | 4 +- third_party/sqlite/src/test/cache.test | 12 +- third_party/sqlite/src/test/cacheflush.test | 36 +- third_party/sqlite/src/test/capi2.test | 10 +- third_party/sqlite/src/test/capi3.test | 50 +- third_party/sqlite/src/test/capi3c.test | 52 +- third_party/sqlite/src/test/capi3d.test | 4 +- third_party/sqlite/src/test/capi3e.test | 2 +- third_party/sqlite/src/test/cast.test | 2 +- third_party/sqlite/src/test/cffault.test | 4 +- third_party/sqlite/src/test/check.test | 12 +- third_party/sqlite/src/test/closure01.test | 8 +- third_party/sqlite/src/test/collate1.test | 40 +- third_party/sqlite/src/test/collate2.test | 56 +- third_party/sqlite/src/test/collate3.test | 60 +- third_party/sqlite/src/test/collate4.test | 38 +- third_party/sqlite/src/test/collate5.test | 16 +- third_party/sqlite/src/test/collate6.test | 14 +- third_party/sqlite/src/test/collate9.test | 26 +- third_party/sqlite/src/test/colmeta.test | 4 +- third_party/sqlite/src/test/colname.test | 8 +- third_party/sqlite/src/test/conflict.test | 20 +- third_party/sqlite/src/test/conflict2.test | 24 +- third_party/sqlite/src/test/conflict3.test | 16 +- third_party/sqlite/src/test/contrib01.test | 8 +- third_party/sqlite/src/test/corrupt.test | 24 +- third_party/sqlite/src/test/corrupt2.test | 42 +- third_party/sqlite/src/test/corrupt5.test | 2 +- third_party/sqlite/src/test/corrupt7.test | 6 +- third_party/sqlite/src/test/corrupt9.test | 2 +- third_party/sqlite/src/test/corruptA.test | 16 +- third_party/sqlite/src/test/corruptB.test | 2 +- third_party/sqlite/src/test/corruptC.test | 22 +- third_party/sqlite/src/test/corruptD.test | 16 +- third_party/sqlite/src/test/corruptF.test | 28 +- third_party/sqlite/src/test/corruptH.test | 30 +- third_party/sqlite/src/test/corruptI.test | 12 +- third_party/sqlite/src/test/cost.test | 30 +- third_party/sqlite/src/test/count.test | 8 +- third_party/sqlite/src/test/coveridxscan.test | 2 +- third_party/sqlite/src/test/crash.test | 28 +- third_party/sqlite/src/test/crash2.test | 4 +- third_party/sqlite/src/test/crash3.test | 32 +- third_party/sqlite/src/test/crash4.test | 2 +- third_party/sqlite/src/test/crash5.test | 20 +- third_party/sqlite/src/test/crash6.test | 8 +- third_party/sqlite/src/test/crash7.test | 28 +- third_party/sqlite/src/test/crash8.test | 40 +- third_party/sqlite/src/test/crashtest1.c | 4 +- third_party/sqlite/src/test/createtab.test | 16 +- third_party/sqlite/src/test/cse.test | 6 +- third_party/sqlite/src/test/csv01.test | 2 +- third_party/sqlite/src/test/ctime.test | 2 +- third_party/sqlite/src/test/cursorhint2.test | 4 +- third_party/sqlite/src/test/date.test | 10 +- third_party/sqlite/src/test/dbfuzz.c | 4 +- third_party/sqlite/src/test/dbselftest.c | 14 +- third_party/sqlite/src/test/dbstatus.test | 60 +- third_party/sqlite/src/test/dbstatus2.test | 16 +- third_party/sqlite/src/test/default.test | 6 +- third_party/sqlite/src/test/delete.test | 8 +- third_party/sqlite/src/test/delete3.test | 2 +- third_party/sqlite/src/test/delete4.test | 4 +- third_party/sqlite/src/test/delete_db.test | 22 +- third_party/sqlite/src/test/descidx1.test | 6 +- third_party/sqlite/src/test/descidx2.test | 4 +- third_party/sqlite/src/test/descidx3.test | 6 +- third_party/sqlite/src/test/diskfull.test | 8 +- third_party/sqlite/src/test/distinct.test | 14 +- third_party/sqlite/src/test/e_blobbytes.test | 2 +- third_party/sqlite/src/test/e_blobclose.test | 18 +- third_party/sqlite/src/test/e_blobopen.test | 2 +- third_party/sqlite/src/test/e_blobwrite.test | 4 +- third_party/sqlite/src/test/e_changes.test | 14 +- .../sqlite/src/test/e_createtable.test | 262 +- third_party/sqlite/src/test/e_delete.test | 16 +- .../sqlite/src/test/e_droptrigger.test | 20 +- third_party/sqlite/src/test/e_dropview.test | 10 +- third_party/sqlite/src/test/e_expr.test | 208 +- third_party/sqlite/src/test/e_fkey.test | 224 +- third_party/sqlite/src/test/e_fts3.test | 102 +- third_party/sqlite/src/test/e_insert.test | 18 +- third_party/sqlite/src/test/e_reindex.test | 4 +- third_party/sqlite/src/test/e_resolve.test | 4 +- third_party/sqlite/src/test/e_select.test | 376 +- third_party/sqlite/src/test/e_select2.test | 22 +- .../sqlite/src/test/e_totalchanges.test | 8 +- third_party/sqlite/src/test/e_update.test | 24 +- third_party/sqlite/src/test/e_uri.test | 10 +- third_party/sqlite/src/test/e_vacuum.test | 30 +- third_party/sqlite/src/test/e_wal.test | 2 +- third_party/sqlite/src/test/e_walauto.test | 8 +- third_party/sqlite/src/test/e_walckpt.test | 34 +- third_party/sqlite/src/test/e_walhook.test | 6 +- third_party/sqlite/src/test/enc.test | 6 +- third_party/sqlite/src/test/enc2.test | 10 +- third_party/sqlite/src/test/enc3.test | 2 +- third_party/sqlite/src/test/enc4.test | 6 +- third_party/sqlite/src/test/eqp.test | 130 +- third_party/sqlite/src/test/errmsg.test | 8 +- third_party/sqlite/src/test/eval.test | 2 +- third_party/sqlite/src/test/exclusive.test | 32 +- third_party/sqlite/src/test/exclusive2.test | 12 +- third_party/sqlite/src/test/expr.test | 6 +- third_party/sqlite/src/test/extension01.test | 2 +- third_party/sqlite/src/test/fallocate.test | 20 +- third_party/sqlite/src/test/filefmt.test | 14 +- third_party/sqlite/src/test/fkey1.test | 6 +- third_party/sqlite/src/test/fkey2.test | 140 +- third_party/sqlite/src/test/fkey3.test | 16 +- third_party/sqlite/src/test/fkey5.test | 2 +- third_party/sqlite/src/test/fkey6.test | 2 +- third_party/sqlite/src/test/fkey7.test | 4 +- third_party/sqlite/src/test/fkey_malloc.test | 6 +- third_party/sqlite/src/test/fordelete.test | 20 +- .../sqlite/src/test/fts-9fd058691.test | 2 +- third_party/sqlite/src/test/fts1b.test | 2 +- third_party/sqlite/src/test/fts1c.test | 358 +- third_party/sqlite/src/test/fts1d.test | 4 +- third_party/sqlite/src/test/fts1o.test | 2 +- third_party/sqlite/src/test/fts1porter.test | 2 +- third_party/sqlite/src/test/fts2b.test | 2 +- third_party/sqlite/src/test/fts2c.test | 358 +- third_party/sqlite/src/test/fts2d.test | 4 +- third_party/sqlite/src/test/fts2o.test | 4 +- third_party/sqlite/src/test/fts2token.test | 12 +- third_party/sqlite/src/test/fts3_common.tcl | 36 +- third_party/sqlite/src/test/fts3ab.test | 2 +- third_party/sqlite/src/test/fts3ac.test | 350 +- third_party/sqlite/src/test/fts3ad.test | 4 +- third_party/sqlite/src/test/fts3ah.test | 2 +- third_party/sqlite/src/test/fts3al.test | 2 +- third_party/sqlite/src/test/fts3ao.test | 6 +- third_party/sqlite/src/test/fts3atoken.test | 12 +- third_party/sqlite/src/test/fts3auto.test | 40 +- third_party/sqlite/src/test/fts3aux1.test | 126 +- third_party/sqlite/src/test/fts3aux2.test | 58 +- third_party/sqlite/src/test/fts3b.test | 2 +- third_party/sqlite/src/test/fts3comp1.test | 16 +- third_party/sqlite/src/test/fts3conf.test | 22 +- third_party/sqlite/src/test/fts3corrupt.test | 4 +- third_party/sqlite/src/test/fts3cov.test | 44 +- third_party/sqlite/src/test/fts3d.test | 4 +- third_party/sqlite/src/test/fts3defer.test | 60 +- third_party/sqlite/src/test/fts3defer2.test | 10 +- third_party/sqlite/src/test/fts3defer3.test | 8 +- third_party/sqlite/src/test/fts3expr.test | 16 +- third_party/sqlite/src/test/fts3expr2.test | 16 +- third_party/sqlite/src/test/fts3expr3.test | 20 +- third_party/sqlite/src/test/fts3fault.test | 46 +- third_party/sqlite/src/test/fts3fault2.test | 2 +- third_party/sqlite/src/test/fts3first.test | 6 +- third_party/sqlite/src/test/fts3join.test | 4 +- third_party/sqlite/src/test/fts3malloc.test | 56 +- .../sqlite/src/test/fts3matchinfo.test | 54 +- third_party/sqlite/src/test/fts3near.test | 14 +- third_party/sqlite/src/test/fts3offsets.test | 12 +- third_party/sqlite/src/test/fts3prefix.test | 8 +- third_party/sqlite/src/test/fts3prefix2.test | 2 +- third_party/sqlite/src/test/fts3query.test | 42 +- third_party/sqlite/src/test/fts3rnd.test | 48 +- third_party/sqlite/src/test/fts3shared.test | 20 +- third_party/sqlite/src/test/fts3snippet.test | 58 +- third_party/sqlite/src/test/fts3sort.test | 32 +- third_party/sqlite/src/test/fts3tok1.test | 16 +- third_party/sqlite/src/test/fts3tok_err.test | 8 +- third_party/sqlite/src/test/fts3varint.test | 24 +- third_party/sqlite/src/test/fts4aa.test | 2 +- third_party/sqlite/src/test/fts4check.test | 6 +- third_party/sqlite/src/test/fts4content.test | 56 +- third_party/sqlite/src/test/fts4docid.test | 4 +- third_party/sqlite/src/test/fts4growth.test | 44 +- third_party/sqlite/src/test/fts4growth2.test | 14 +- third_party/sqlite/src/test/fts4incr.test | 4 +- third_party/sqlite/src/test/fts4langid.test | 22 +- third_party/sqlite/src/test/fts4merge.test | 124 +- third_party/sqlite/src/test/fts4merge2.test | 4 +- third_party/sqlite/src/test/fts4merge3.test | 26 +- third_party/sqlite/src/test/fts4merge4.test | 6 +- third_party/sqlite/src/test/fts4noti.test | 24 +- third_party/sqlite/src/test/fts4onepass.test | 10 +- third_party/sqlite/src/test/fts4opt.test | 36 +- third_party/sqlite/src/test/fts4unicode.test | 68 +- third_party/sqlite/src/test/func.test | 24 +- third_party/sqlite/src/test/func3.test | 4 +- third_party/sqlite/src/test/func5.test | 2 +- third_party/sqlite/src/test/fuzz-oss1.test | 2 +- third_party/sqlite/src/test/fuzz.test | 32 +- third_party/sqlite/src/test/fuzz2.test | 8 +- third_party/sqlite/src/test/fuzz3.test | 28 +- third_party/sqlite/src/test/fuzz_common.tcl | 46 +- third_party/sqlite/src/test/fuzz_malloc.test | 8 +- third_party/sqlite/src/test/fuzzcheck.c | 26 +- third_party/sqlite/src/test/fuzzer1.test | 74 +- third_party/sqlite/src/test/fuzzer2.test | 10 +- third_party/sqlite/src/test/fuzzerfault.test | 10 +- third_party/sqlite/src/test/gcfault.test | 2 +- third_party/sqlite/src/test/hidden.test | 8 +- third_party/sqlite/src/test/hook.test | 50 +- third_party/sqlite/src/test/hook2.test | 16 +- third_party/sqlite/src/test/icu.test | 20 +- third_party/sqlite/src/test/ieee754.test | 2 +- third_party/sqlite/src/test/in.test | 30 +- third_party/sqlite/src/test/in2.test | 8 +- third_party/sqlite/src/test/in3.test | 26 +- third_party/sqlite/src/test/in4.test | 6 +- third_party/sqlite/src/test/incrblob.test | 54 +- third_party/sqlite/src/test/incrblob2.test | 30 +- third_party/sqlite/src/test/incrblob3.test | 8 +- third_party/sqlite/src/test/incrblob4.test | 10 +- third_party/sqlite/src/test/incrblob_err.test | 18 +- third_party/sqlite/src/test/incrvacuum.test | 20 +- third_party/sqlite/src/test/incrvacuum2.test | 8 +- third_party/sqlite/src/test/incrvacuum3.test | 34 +- .../sqlite/src/test/incrvacuum_ioerr.test | 24 +- third_party/sqlite/src/test/index.test | 14 +- third_party/sqlite/src/test/index3.test | 8 +- third_party/sqlite/src/test/index4.test | 10 +- third_party/sqlite/src/test/index5.test | 6 +- third_party/sqlite/src/test/index6.test | 8 +- third_party/sqlite/src/test/indexedby.test | 62 +- third_party/sqlite/src/test/indexexpr1.test | 2 +- third_party/sqlite/src/test/indexfault.test | 42 +- third_party/sqlite/src/test/init.test | 2 +- third_party/sqlite/src/test/insert.test | 12 +- third_party/sqlite/src/test/insert2.test | 30 +- third_party/sqlite/src/test/insert3.test | 6 +- third_party/sqlite/src/test/insert4.test | 20 +- third_party/sqlite/src/test/insert5.test | 36 +- third_party/sqlite/src/test/instrfault.test | 2 +- third_party/sqlite/src/test/interrupt2.test | 12 +- third_party/sqlite/src/test/io.test | 44 +- third_party/sqlite/src/test/ioerr.test | 44 +- third_party/sqlite/src/test/ioerr2.test | 10 +- third_party/sqlite/src/test/ioerr5.test | 18 +- third_party/sqlite/src/test/join.test | 16 +- third_party/sqlite/src/test/join2.test | 6 +- third_party/sqlite/src/test/join4.test | 4 +- third_party/sqlite/src/test/join6.test | 8 +- third_party/sqlite/src/test/journal2.test | 10 +- third_party/sqlite/src/test/journal3.test | 4 +- third_party/sqlite/src/test/jrnlmode.test | 52 +- third_party/sqlite/src/test/jrnlmode2.test | 6 +- third_party/sqlite/src/test/jrnlmode3.test | 2 +- third_party/sqlite/src/test/json101.test | 2 +- third_party/sqlite/src/test/json102.test | 2 +- third_party/sqlite/src/test/json103.test | 2 +- third_party/sqlite/src/test/keyword1.test | 2 +- third_party/sqlite/src/test/kvtest.c | 10 +- third_party/sqlite/src/test/lastinsert.test | 2 +- .../sqlite/src/test/laststmtchanges.test | 4 +- third_party/sqlite/src/test/like.test | 6 +- third_party/sqlite/src/test/limit.test | 6 +- third_party/sqlite/src/test/loadext.test | 4 +- third_party/sqlite/src/test/lock.test | 8 +- third_party/sqlite/src/test/lock2.test | 4 +- third_party/sqlite/src/test/lock4.test | 12 +- third_party/sqlite/src/test/lock5.test | 2 +- third_party/sqlite/src/test/lock6.test | 16 +- third_party/sqlite/src/test/lock_common.tcl | 14 +- third_party/sqlite/src/test/lookaside.test | 2 +- third_party/sqlite/src/test/main.test | 18 +- third_party/sqlite/src/test/malloc.test | 84 +- third_party/sqlite/src/test/malloc3.test | 32 +- third_party/sqlite/src/test/malloc5.test | 46 +- third_party/sqlite/src/test/malloc6.test | 2 +- third_party/sqlite/src/test/malloc7.test | 2 +- third_party/sqlite/src/test/malloc8.test | 14 +- third_party/sqlite/src/test/mallocA.test | 6 +- third_party/sqlite/src/test/mallocC.test | 6 +- third_party/sqlite/src/test/mallocD.test | 4 +- third_party/sqlite/src/test/mallocE.test | 8 +- third_party/sqlite/src/test/mallocF.test | 2 +- third_party/sqlite/src/test/mallocG.test | 2 +- third_party/sqlite/src/test/mallocH.test | 2 +- third_party/sqlite/src/test/mallocI.test | 2 +- third_party/sqlite/src/test/mallocJ.test | 4 +- third_party/sqlite/src/test/mallocK.test | 6 +- third_party/sqlite/src/test/mallocL.test | 8 +- third_party/sqlite/src/test/malloc_common.tcl | 60 +- third_party/sqlite/src/test/manydb.test | 2 +- third_party/sqlite/src/test/mem5.test | 2 +- third_party/sqlite/src/test/memdb.test | 8 +- third_party/sqlite/src/test/memleak.test | 4 +- third_party/sqlite/src/test/memsubsys2.test | 4 +- third_party/sqlite/src/test/minmax3.test | 2 +- third_party/sqlite/src/test/minmax4.test | 4 +- third_party/sqlite/src/test/misc1.test | 8 +- third_party/sqlite/src/test/misc2.test | 16 +- third_party/sqlite/src/test/misc4.test | 16 +- third_party/sqlite/src/test/misc5.test | 56 +- third_party/sqlite/src/test/misc7.test | 62 +- third_party/sqlite/src/test/misc8.test | 18 +- third_party/sqlite/src/test/misuse.test | 2 +- third_party/sqlite/src/test/mmap1.test | 2 +- third_party/sqlite/src/test/mmap2.test | 16 +- third_party/sqlite/src/test/mmap4.test | 12 +- third_party/sqlite/src/test/mmapfault.test | 6 +- third_party/sqlite/src/test/multiplex.test | 46 +- third_party/sqlite/src/test/multiplex2.test | 2 +- third_party/sqlite/src/test/multiplex3.test | 6 +- third_party/sqlite/src/test/mutex2.test | 2 +- third_party/sqlite/src/test/nan.test | 4 +- third_party/sqlite/src/test/nolock.test | 2 +- third_party/sqlite/src/test/notify1.test | 40 +- third_party/sqlite/src/test/notify2.test | 22 +- third_party/sqlite/src/test/notify3.test | 30 +- third_party/sqlite/src/test/null.test | 2 +- third_party/sqlite/src/test/numcast.test | 2 +- third_party/sqlite/src/test/offset1.test | 2 +- third_party/sqlite/src/test/orderby1.test | 10 +- third_party/sqlite/src/test/orderby2.test | 4 +- third_party/sqlite/src/test/orderby3.test | 6 +- third_party/sqlite/src/test/orderby7.test | 2 +- third_party/sqlite/src/test/orderby9.test | 4 +- third_party/sqlite/src/test/oserror.test | 24 +- third_party/sqlite/src/test/pager1.test | 212 +- third_party/sqlite/src/test/pager2.test | 34 +- third_party/sqlite/src/test/pagerfault.test | 98 +- third_party/sqlite/src/test/pagerfault2.test | 8 +- third_party/sqlite/src/test/pagerfault3.test | 8 +- third_party/sqlite/src/test/pageropt.test | 2 +- third_party/sqlite/src/test/pagesize.test | 2 +- third_party/sqlite/src/test/parser1.test | 2 +- third_party/sqlite/src/test/pcache.test | 14 +- third_party/sqlite/src/test/percentile.test | 4 +- third_party/sqlite/src/test/permutations.test | 98 +- third_party/sqlite/src/test/pragma.test | 104 +- third_party/sqlite/src/test/pragma2.test | 4 +- third_party/sqlite/src/test/pragma3.test | 2 +- third_party/sqlite/src/test/progress.test | 4 +- third_party/sqlite/src/test/ptrchng.test | 2 +- third_party/sqlite/src/test/quota.test | 22 +- third_party/sqlite/src/test/quota2.test | 4 +- third_party/sqlite/src/test/quote.test | 2 +- third_party/sqlite/src/test/randexpr1.tcl | 2 +- third_party/sqlite/src/test/rdonly.test | 2 +- third_party/sqlite/src/test/regexp1.test | 4 +- third_party/sqlite/src/test/regexp2.test | 4 +- third_party/sqlite/src/test/releasetest.tcl | 2 +- third_party/sqlite/src/test/resolver01.test | 2 +- third_party/sqlite/src/test/rollback.test | 8 +- third_party/sqlite/src/test/rollback2.test | 2 +- .../sqlite/src/test/rollbackfault.test | 14 +- third_party/sqlite/src/test/rowallock.test | 6 +- third_party/sqlite/src/test/rowid.test | 6 +- third_party/sqlite/src/test/rowvalue.test | 8 +- third_party/sqlite/src/test/rowvalue2.test | 4 +- third_party/sqlite/src/test/rowvalue3.test | 18 +- third_party/sqlite/src/test/rowvalue4.test | 18 +- third_party/sqlite/src/test/rowvalue6.test | 2 +- third_party/sqlite/src/test/rowvalue9.test | 28 +- .../sqlite/src/test/rowvaluefault.test | 24 +- third_party/sqlite/src/test/savepoint.test | 70 +- third_party/sqlite/src/test/savepoint2.test | 16 +- third_party/sqlite/src/test/savepoint6.test | 18 +- .../sqlite/src/test/savepointfault.test | 16 +- third_party/sqlite/src/test/scanstatus.test | 66 +- third_party/sqlite/src/test/schema.test | 12 +- third_party/sqlite/src/test/schema2.test | 8 +- third_party/sqlite/src/test/schema3.test | 4 +- third_party/sqlite/src/test/schema4.test | 10 +- third_party/sqlite/src/test/schema5.test | 2 +- third_party/sqlite/src/test/securedel2.test | 6 +- third_party/sqlite/src/test/select1.test | 36 +- third_party/sqlite/src/test/select3.test | 28 +- third_party/sqlite/src/test/select4.test | 26 +- third_party/sqlite/src/test/select5.test | 16 +- third_party/sqlite/src/test/select6.test | 30 +- third_party/sqlite/src/test/select7.test | 16 +- third_party/sqlite/src/test/select8.test | 26 +- third_party/sqlite/src/test/select9.test | 60 +- third_party/sqlite/src/test/selectA.test | 12 +- third_party/sqlite/src/test/selectB.test | 92 +- third_party/sqlite/src/test/selectC.test | 10 +- third_party/sqlite/src/test/selectD.test | 6 +- third_party/sqlite/src/test/selectE.test | 12 +- third_party/sqlite/src/test/selectF.test | 10 +- third_party/sqlite/src/test/selectG.test | 2 +- third_party/sqlite/src/test/server1.test | 2 +- third_party/sqlite/src/test/shared.test | 114 +- third_party/sqlite/src/test/shared2.test | 8 +- third_party/sqlite/src/test/shared6.test | 8 +- third_party/sqlite/src/test/shared8.test | 4 +- third_party/sqlite/src/test/shared9.test | 10 +- third_party/sqlite/src/test/sharedA.test | 14 +- third_party/sqlite/src/test/sharedB.test | 2 +- third_party/sqlite/src/test/shared_err.test | 52 +- third_party/sqlite/src/test/sharedlock.test | 4 +- third_party/sqlite/src/test/shell2.test | 8 +- third_party/sqlite/src/test/shell5.test | 4 +- third_party/sqlite/src/test/shell7.test | 10 +- third_party/sqlite/src/test/skipscan1.test | 2 +- third_party/sqlite/src/test/skipscan2.test | 4 +- third_party/sqlite/src/test/skipscan3.test | 2 +- third_party/sqlite/src/test/skipscan5.test | 8 +- third_party/sqlite/src/test/skipscan6.test | 8 +- third_party/sqlite/src/test/snapshot.test | 14 +- .../sqlite/src/test/snapshot_fault.test | 40 +- third_party/sqlite/src/test/soak.test | 10 +- third_party/sqlite/src/test/softheap1.test | 2 +- third_party/sqlite/src/test/sort.test | 6 +- third_party/sqlite/src/test/sort2.test | 12 +- third_party/sqlite/src/test/sort3.test | 18 +- third_party/sqlite/src/test/sort4.test | 20 +- third_party/sqlite/src/test/sort5.test | 4 +- third_party/sqlite/src/test/sortfault.test | 24 +- third_party/sqlite/src/test/speed1.test | 2 +- third_party/sqlite/src/test/speed1p.explain | 4 +- third_party/sqlite/src/test/speed1p.test | 4 +- third_party/sqlite/src/test/speed2.test | 2 +- third_party/sqlite/src/test/speed3.test | 10 +- third_party/sqlite/src/test/speed4.test | 4 +- third_party/sqlite/src/test/speed4p.explain | 8 +- third_party/sqlite/src/test/speed4p.test | 4 +- third_party/sqlite/src/test/speedtest1.c | 22 +- third_party/sqlite/src/test/spellfix.test | 20 +- third_party/sqlite/src/test/spellfix2.test | 12 +- third_party/sqlite/src/test/sqllimits1.test | 30 +- third_party/sqlite/src/test/stat.test | 14 +- third_party/sqlite/src/test/statfault.test | 2 +- third_party/sqlite/src/test/stmt.test | 6 +- third_party/sqlite/src/test/subquery.test | 12 +- third_party/sqlite/src/test/subquery2.test | 12 +- third_party/sqlite/src/test/subselect.test | 4 +- third_party/sqlite/src/test/substr.test | 4 +- third_party/sqlite/src/test/superlock.test | 32 +- third_party/sqlite/src/test/symlink.test | 2 +- third_party/sqlite/src/test/syscall.test | 42 +- third_party/sqlite/src/test/sysfault.test | 20 +- third_party/sqlite/src/test/tabfunc01.test | 2 +- third_party/sqlite/src/test/table.test | 20 +- third_party/sqlite/src/test/tableopts.test | 2 +- third_party/sqlite/src/test/tclsqlite.test | 8 +- third_party/sqlite/src/test/tempdb2.test | 2 +- third_party/sqlite/src/test/tempfault.test | 6 +- third_party/sqlite/src/test/temptable2.test | 12 +- third_party/sqlite/src/test/temptrigger.test | 36 +- third_party/sqlite/src/test/tester.tcl | 16 +- third_party/sqlite/src/test/thread001.test | 26 +- third_party/sqlite/src/test/thread002.test | 6 +- third_party/sqlite/src/test/thread003.test | 36 +- third_party/sqlite/src/test/thread004.test | 6 +- third_party/sqlite/src/test/thread005.test | 16 +- third_party/sqlite/src/test/thread1.test | 4 +- third_party/sqlite/src/test/thread2.test | 2 +- third_party/sqlite/src/test/thread_common.tcl | 10 +- third_party/sqlite/src/test/threadtest1.c | 10 +- third_party/sqlite/src/test/threadtest2.c | 6 +- third_party/sqlite/src/test/threadtest3.c | 36 +- third_party/sqlite/src/test/threadtest4.c | 4 +- .../sqlite/src/test/tkt-02a8e81d44.test | 2 +- .../sqlite/src/test/tkt-2a5629202f.test | 2 +- .../sqlite/src/test/tkt-2d1a5c67d.test | 2 +- .../sqlite/src/test/tkt-2ea2425d34.test | 2 +- .../sqlite/src/test/tkt-31338dca7e.test | 26 +- .../sqlite/src/test/tkt-313723c356.test | 2 +- .../sqlite/src/test/tkt-385a5b56b9.test | 4 +- .../sqlite/src/test/tkt-3a77c9714e.test | 8 +- .../sqlite/src/test/tkt-3fe897352e.test | 4 +- .../sqlite/src/test/tkt-4a03edc4c8.test | 2 +- .../sqlite/src/test/tkt-4dd95f6943.test | 20 +- .../sqlite/src/test/tkt-54844eea3f.test | 4 +- .../sqlite/src/test/tkt-5d863f876e.test | 4 +- .../sqlite/src/test/tkt-5ee23731f.test | 2 +- .../sqlite/src/test/tkt-6bfb98dfc0.test | 2 +- .../sqlite/src/test/tkt-752e1646fc.test | 8 +- .../sqlite/src/test/tkt-7bbfb7d442.test | 30 +- .../sqlite/src/test/tkt-80ba201079.test | 4 +- .../sqlite/src/test/tkt-868145d012.test | 8 +- .../sqlite/src/test/tkt-8c63ff0ec.test | 6 +- .../sqlite/src/test/tkt-91e2e8ba6f.test | 4 +- third_party/sqlite/src/test/tkt-9d68c883.test | 4 +- .../sqlite/src/test/tkt-9f2eb3abac.test | 4 +- .../sqlite/src/test/tkt-a8a0d2996a.test | 2 +- third_party/sqlite/src/test/tkt-b72787b1.test | 2 +- .../sqlite/src/test/tkt-b75a9ca6b0.test | 6 +- .../sqlite/src/test/tkt-ba7cbfaedc.test | 4 +- .../sqlite/src/test/tkt-bd484a090c.test | 2 +- .../sqlite/src/test/tkt-bdc6bbbb38.test | 6 +- .../sqlite/src/test/tkt-cbd054fa6b.test | 22 +- .../sqlite/src/test/tkt-d82e3f3721.test | 2 +- .../sqlite/src/test/tkt-f3e5abed55.test | 4 +- .../sqlite/src/test/tkt-f777251dc7a.test | 4 +- third_party/sqlite/src/test/tkt-f7b4edec.test | 4 +- .../sqlite/src/test/tkt-f973c7ac31.test | 44 +- third_party/sqlite/src/test/tkt-fa7bf5ec.test | 6 +- .../sqlite/src/test/tkt-fc62af4523.test | 2 +- .../sqlite/src/test/tkt-fc7bd6358f.test | 4 +- third_party/sqlite/src/test/tkt1435.test | 20 +- third_party/sqlite/src/test/tkt1443.test | 18 +- third_party/sqlite/src/test/tkt1444.test | 4 +- third_party/sqlite/src/test/tkt1449.test | 32 +- third_party/sqlite/src/test/tkt1473.test | 4 +- third_party/sqlite/src/test/tkt1501.test | 2 +- third_party/sqlite/src/test/tkt1512.test | 2 +- third_party/sqlite/src/test/tkt1514.test | 2 +- third_party/sqlite/src/test/tkt1536.test | 4 +- third_party/sqlite/src/test/tkt1537.test | 4 +- third_party/sqlite/src/test/tkt1567.test | 2 +- third_party/sqlite/src/test/tkt1644.test | 4 +- third_party/sqlite/src/test/tkt1667.test | 4 +- third_party/sqlite/src/test/tkt1873.test | 2 +- third_party/sqlite/src/test/tkt2141.test | 2 +- third_party/sqlite/src/test/tkt2192.test | 26 +- third_party/sqlite/src/test/tkt2213.test | 2 +- third_party/sqlite/src/test/tkt2285.test | 2 +- third_party/sqlite/src/test/tkt2339.test | 4 +- third_party/sqlite/src/test/tkt2391.test | 2 +- third_party/sqlite/src/test/tkt2565.test | 4 +- third_party/sqlite/src/test/tkt2640.test | 2 +- third_party/sqlite/src/test/tkt2686.test | 4 +- third_party/sqlite/src/test/tkt2817.test | 6 +- third_party/sqlite/src/test/tkt2820.test | 2 +- third_party/sqlite/src/test/tkt2822.test | 50 +- third_party/sqlite/src/test/tkt2832.test | 4 +- third_party/sqlite/src/test/tkt2854.test | 8 +- third_party/sqlite/src/test/tkt2927.test | 32 +- third_party/sqlite/src/test/tkt2942.test | 2 +- third_party/sqlite/src/test/tkt3080.test | 2 +- third_party/sqlite/src/test/tkt3201.test | 2 +- third_party/sqlite/src/test/tkt3292.test | 2 +- third_party/sqlite/src/test/tkt3298.test | 2 +- third_party/sqlite/src/test/tkt3334.test | 2 +- third_party/sqlite/src/test/tkt3346.test | 2 +- third_party/sqlite/src/test/tkt3357.test | 6 +- third_party/sqlite/src/test/tkt3419.test | 8 +- third_party/sqlite/src/test/tkt3424.test | 4 +- third_party/sqlite/src/test/tkt3442.test | 6 +- third_party/sqlite/src/test/tkt3457.test | 10 +- third_party/sqlite/src/test/tkt3461.test | 16 +- third_party/sqlite/src/test/tkt3493.test | 34 +- third_party/sqlite/src/test/tkt3508.test | 2 +- third_party/sqlite/src/test/tkt3527.test | 14 +- third_party/sqlite/src/test/tkt3554.test | 14 +- third_party/sqlite/src/test/tkt3581.test | 2 +- third_party/sqlite/src/test/tkt35xx.test | 2 +- third_party/sqlite/src/test/tkt3630.test | 2 +- third_party/sqlite/src/test/tkt3718.test | 20 +- third_party/sqlite/src/test/tkt3731.test | 2 +- third_party/sqlite/src/test/tkt3762.test | 2 +- third_party/sqlite/src/test/tkt3793.test | 16 +- third_party/sqlite/src/test/tkt3824.test | 2 +- third_party/sqlite/src/test/tkt3832.test | 2 +- third_party/sqlite/src/test/tkt3841.test | 2 +- third_party/sqlite/src/test/tkt3871.test | 2 +- third_party/sqlite/src/test/tkt3879.test | 2 +- third_party/sqlite/src/test/tkt3918.test | 2 +- third_party/sqlite/src/test/tkt3922.test | 10 +- third_party/sqlite/src/test/tkt3992.test | 2 +- third_party/sqlite/src/test/tkt3997.test | 28 +- third_party/sqlite/src/test/tkt4018.test | 6 +- third_party/sqlite/src/test/tpch01.test | 4 +- third_party/sqlite/src/test/trace.test | 6 +- third_party/sqlite/src/test/trace2.test | 46 +- third_party/sqlite/src/test/trans.test | 28 +- third_party/sqlite/src/test/transitive1.test | 8 +- third_party/sqlite/src/test/trigger1.test | 16 +- third_party/sqlite/src/test/trigger2.test | 146 +- third_party/sqlite/src/test/trigger3.test | 16 +- third_party/sqlite/src/test/trigger8.test | 2 +- third_party/sqlite/src/test/trigger9.test | 8 +- third_party/sqlite/src/test/triggerA.test | 4 +- third_party/sqlite/src/test/triggerB.test | 2 +- third_party/sqlite/src/test/triggerC.test | 100 +- third_party/sqlite/src/test/triggerD.test | 6 +- third_party/sqlite/src/test/triggerE.test | 10 +- third_party/sqlite/src/test/triggerF.test | 8 +- third_party/sqlite/src/test/tt3_checkpoint.c | 20 +- third_party/sqlite/src/test/tt3_index.c | 4 +- third_party/sqlite/src/test/tt3_lookaside1.c | 4 +- third_party/sqlite/src/test/tt3_stress.c | 8 +- third_party/sqlite/src/test/tt3_vacuum.c | 6 +- third_party/sqlite/src/test/types.test | 6 +- third_party/sqlite/src/test/types2.test | 22 +- third_party/sqlite/src/test/unixexcl.test | 18 +- third_party/sqlite/src/test/unordered.test | 4 +- third_party/sqlite/src/test/update.test | 2 +- third_party/sqlite/src/test/update2.test | 4 +- third_party/sqlite/src/test/uri.test | 30 +- third_party/sqlite/src/test/userauth01.test | 10 +- third_party/sqlite/src/test/utf16align.test | 2 +- third_party/sqlite/src/test/vacuum.test | 6 +- third_party/sqlite/src/test/vacuum2.test | 8 +- third_party/sqlite/src/test/vacuum3.test | 66 +- third_party/sqlite/src/test/vacuum4.test | 2 +- third_party/sqlite/src/test/vacuum5.test | 6 +- third_party/sqlite/src/test/vacuummem.test | 6 +- third_party/sqlite/src/test/view.test | 8 +- third_party/sqlite/src/test/vtab1.test | 86 +- third_party/sqlite/src/test/vtab2.test | 4 +- third_party/sqlite/src/test/vtab3.test | 6 +- third_party/sqlite/src/test/vtab5.test | 2 +- third_party/sqlite/src/test/vtab6.test | 20 +- third_party/sqlite/src/test/vtab7.test | 8 +- third_party/sqlite/src/test/vtabF.test | 2 +- third_party/sqlite/src/test/vtabI.test | 24 +- third_party/sqlite/src/test/vtab_alter.test | 8 +- third_party/sqlite/src/test/vtab_err.test | 4 +- third_party/sqlite/src/test/vtab_shared.test | 36 +- third_party/sqlite/src/test/wal.test | 108 +- third_party/sqlite/src/test/wal2.test | 84 +- third_party/sqlite/src/test/wal3.test | 48 +- third_party/sqlite/src/test/wal4.test | 6 +- third_party/sqlite/src/test/wal5.test | 28 +- third_party/sqlite/src/test/wal6.test | 36 +- third_party/sqlite/src/test/wal64k.test | 2 +- third_party/sqlite/src/test/wal9.test | 24 +- third_party/sqlite/src/test/wal_common.tcl | 2 +- third_party/sqlite/src/test/walbak.test | 24 +- third_party/sqlite/src/test/walblock.test | 18 +- third_party/sqlite/src/test/walcksum.test | 30 +- third_party/sqlite/src/test/walcrash.test | 22 +- third_party/sqlite/src/test/walcrash2.test | 12 +- third_party/sqlite/src/test/walcrash3.test | 10 +- third_party/sqlite/src/test/walcrash4.test | 14 +- third_party/sqlite/src/test/walfault.test | 38 +- third_party/sqlite/src/test/walhook.test | 8 +- third_party/sqlite/src/test/walmode.test | 20 +- third_party/sqlite/src/test/walnoshm.test | 16 +- third_party/sqlite/src/test/waloverwrite.test | 20 +- third_party/sqlite/src/test/walpersist.test | 8 +- third_party/sqlite/src/test/walprotocol.test | 8 +- third_party/sqlite/src/test/walro.test | 40 +- third_party/sqlite/src/test/walslow.test | 14 +- third_party/sqlite/src/test/walthread.test | 20 +- third_party/sqlite/src/test/where.test | 56 +- third_party/sqlite/src/test/where2.test | 6 +- third_party/sqlite/src/test/where3.test | 68 +- third_party/sqlite/src/test/where4.test | 4 +- third_party/sqlite/src/test/where6.test | 2 +- third_party/sqlite/src/test/where7.test | 12 +- third_party/sqlite/src/test/where8.test | 66 +- third_party/sqlite/src/test/where9.test | 28 +- third_party/sqlite/src/test/whereD.test | 70 +- third_party/sqlite/src/test/whereE.test | 2 +- third_party/sqlite/src/test/whereF.test | 8 +- third_party/sqlite/src/test/whereG.test | 4 +- third_party/sqlite/src/test/whereH.test | 2 +- third_party/sqlite/src/test/whereI.test | 6 +- third_party/sqlite/src/test/whereJ.test | 10 +- third_party/sqlite/src/test/wherefault.test | 4 +- third_party/sqlite/src/test/wild001.test | 8 +- third_party/sqlite/src/test/with1.test | 98 +- third_party/sqlite/src/test/with2.test | 68 +- third_party/sqlite/src/test/with3.test | 18 +- third_party/sqlite/src/test/withM.test | 10 +- .../sqlite/src/test/without_rowid1.test | 10 +- .../sqlite/src/test/without_rowid3.test | 134 +- .../sqlite/src/test/without_rowid4.test | 146 +- .../sqlite/src/test/without_rowid5.test | 4 +- third_party/sqlite/src/test/wordcount.c | 38 +- third_party/sqlite/src/test/zeroblob.test | 56 +- third_party/sqlite/src/test/zerodamage.test | 2 +- third_party/sqlite/src/tool/addopcodes.tcl | 2 +- third_party/sqlite/src/tool/dbhash.c | 10 +- third_party/sqlite/src/tool/fast_vacuum.c | 2 +- third_party/sqlite/src/tool/fragck.tcl | 16 +- third_party/sqlite/src/tool/fuzzershell.c | 20 +- third_party/sqlite/src/tool/genfkey.README | 28 +- third_party/sqlite/src/tool/genfkey.test | 20 +- third_party/sqlite/src/tool/lemon.c | 48 +- third_party/sqlite/src/tool/lempar.c | 36 +- third_party/sqlite/src/tool/loadfts.c | 10 +- third_party/sqlite/src/tool/logest.c | 2 +- third_party/sqlite/src/tool/max-limits.c | 2 +- third_party/sqlite/src/tool/mkautoconfamal.sh | 8 +- third_party/sqlite/src/tool/mkkeywordhash.c | 8 +- third_party/sqlite/src/tool/mkopcodeh.tcl | 4 +- third_party/sqlite/src/tool/mkpragmatab.tcl | 2 +- third_party/sqlite/src/tool/mkspeedsql.tcl | 2 +- .../sqlite/src/tool/mksqlite3internalh.tcl | 8 +- third_party/sqlite/src/tool/mkvsix.tcl | 24 +- third_party/sqlite/src/tool/offsets.c | 2 +- third_party/sqlite/src/tool/omittest.tcl | 20 +- third_party/sqlite/src/tool/pagesig.c | 2 +- third_party/sqlite/src/tool/restore_jrnl.tcl | 4 +- third_party/sqlite/src/tool/rollback-test.c | 4 +- third_party/sqlite/src/tool/run-speed-test.sh | 2 +- third_party/sqlite/src/tool/showdb.c | 8 +- third_party/sqlite/src/tool/showlocks.c | 2 +- third_party/sqlite/src/tool/showwal.c | 4 +- third_party/sqlite/src/tool/spaceanal.tcl | 38 +- third_party/sqlite/src/tool/speed-check.sh | 2 +- third_party/sqlite/src/tool/speedtest16.c | 8 +- third_party/sqlite/src/tool/speedtest8.c | 28 +- third_party/sqlite/src/tool/speedtest8inst1.c | 6 +- third_party/sqlite/src/tool/sqldiff.c | 60 +- third_party/sqlite/src/tool/srcck1.c | 8 +- third_party/sqlite/src/tool/stack_usage.tcl | 2 +- third_party/sqlite/src/tool/varint.c | 6 +- third_party/sqlite/src/tool/vdbe_profile.tcl | 2 +- third_party/sqlite/src/tool/warnings-clang.sh | 2 +- third_party/sqlite/src/tool/warnings.sh | 2 +- third_party/sqlite/src/vsixtest/vsixtest.tcl | 24 +- 1155 files changed, 35451 insertions(+), 35456 deletions(-) diff --git a/third_party/sqlite/amalgamation/sqlite3.c b/third_party/sqlite/amalgamation/sqlite3.c index 68fd260459c28..edd203be544e5 100644 --- a/third_party/sqlite/amalgamation/sqlite3.c +++ b/third_party/sqlite/amalgamation/sqlite3.c @@ -60,10 +60,10 @@ ** ** PREVENTS-HARMLESS-OVERREAD - This branch prevents a buffer overread ** that would be harmless and undetectable -** if it did occur. +** if it did occur. ** ** In all cases, the special comment must be enclosed in the usual -** slash-asterisk...asterisk-slash comment marks, with no spaces between the +** slash-asterisk...asterisk-slash comment marks, with no spaces between the ** asterisks and the comment text. */ @@ -387,7 +387,7 @@ extern "C" { ** be held constant and Z will be incremented or else Y will be incremented ** and Z will be reset to zero. ** -** Since [version 3.6.18] ([dateof:3.6.18]), +** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the ** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to @@ -428,8 +428,8 @@ extern "C" { ** function is provided for use in DLLs since DLL users usually do not have ** direct access to string constants within the DLL. ^The ** sqlite3_libversion_number() function returns an integer equal to -** [SQLITE_VERSION_NUMBER]. ^The sqlite3_sourceid() function returns -** a pointer to a string constant whose value is the same as the +** [SQLITE_VERSION_NUMBER]. ^The sqlite3_sourceid() function returns +** a pointer to a string constant whose value is the same as the ** [SQLITE_SOURCE_ID] C preprocessor macro. ** ** See also: [sqlite_version()] and [sqlite_source_id()]. @@ -442,20 +442,20 @@ SQLITE_API int sqlite3_libversion_number(void); /* ** CAPI3REF: Run-Time Library Compilation Options Diagnostics ** -** ^The sqlite3_compileoption_used() function returns 0 or 1 -** indicating whether the specified option was defined at -** compile time. ^The SQLITE_ prefix may be omitted from the -** option name passed to sqlite3_compileoption_used(). +** ^The sqlite3_compileoption_used() function returns 0 or 1 +** indicating whether the specified option was defined at +** compile time. ^The SQLITE_ prefix may be omitted from the +** option name passed to sqlite3_compileoption_used(). ** ** ^The sqlite3_compileoption_get() function allows iterating ** over the list of options that were defined at compile time by ** returning the N-th compile time option string. ^If N is out of range, -** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_ -** prefix is omitted from any strings returned by +** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_ +** prefix is omitted from any strings returned by ** sqlite3_compileoption_get(). ** ** ^Support for the diagnostic functions sqlite3_compileoption_used() -** and sqlite3_compileoption_get() may be omitted by specifying the +** and sqlite3_compileoption_get() may be omitted by specifying the ** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time. ** ** See also: SQL functions [sqlite_compileoption_used()] and @@ -476,7 +476,7 @@ SQLITE_API const char *sqlite3_compileoption_get(int N); ** SQLite can be compiled with or without mutexes. When ** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes ** are enabled and SQLite is threadsafe. When the -** [SQLITE_THREADSAFE] macro is 0, +** [SQLITE_THREADSAFE] macro is 0, ** the mutexes are omitted. Without the mutexes, it is not safe ** to use SQLite concurrently from more than one thread. ** @@ -533,14 +533,14 @@ typedef struct sqlite3 sqlite3; ** ** ^The sqlite3_int64 and sqlite_int64 types can store integer values ** between -9223372036854775808 and +9223372036854775807 inclusive. ^The -** sqlite3_uint64 and sqlite_uint64 types can store integer values +** sqlite3_uint64 and sqlite_uint64 types can store integer values ** between 0 and +18446744073709551615 inclusive. */ #ifdef SQLITE_INT64_TYPE typedef SQLITE_INT64_TYPE sqlite_int64; # ifdef SQLITE_UINT64_TYPE typedef SQLITE_UINT64_TYPE sqlite_uint64; -# else +# else typedef unsigned SQLITE_INT64_TYPE sqlite_uint64; # endif #elif defined(_MSC_VER) || defined(__BORLANDC__) @@ -583,7 +583,7 @@ typedef sqlite_uint64 sqlite3_uint64; ** destructors are called is arbitrary. ** ** Applications should [sqlite3_finalize | finalize] all [prepared statements], -** [sqlite3_blob_close | close] all [BLOB handles], and +** [sqlite3_blob_close | close] all [BLOB handles], and ** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated ** with the [sqlite3] object prior to attempting to close the object. ^If ** sqlite3_close_v2() is called on a [database connection] that still has @@ -620,7 +620,7 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**); ** The sqlite3_exec() interface is a convenience wrapper around ** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()], ** that allows an application to run multiple statements of SQL -** without having to use a lot of C code. +** without having to use a lot of C code. ** ** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded, ** semicolon-separate SQL statements passed into its 2nd argument, @@ -660,7 +660,7 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**); ** from [sqlite3_column_name()]. ** ** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer -** to an empty string, or a pointer that contains only whitespace and/or +** to an empty string, or a pointer that contains only whitespace and/or ** SQL comments, then no SQL statements are evaluated and the database ** is not changed. ** @@ -921,7 +921,7 @@ SQLITE_API int sqlite3_exec( /* ** CAPI3REF: OS Interface Open File Handle ** -** An [sqlite3_file] object represents an open file in the +** An [sqlite3_file] object represents an open file in the ** [sqlite3_vfs | OS interface layer]. Individual OS interface ** implementations will ** want to subclass this object by appending additional fields @@ -943,7 +943,7 @@ struct sqlite3_file { ** This object defines the methods used to perform various operations ** against the open file represented by the [sqlite3_file] object. ** -** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element +** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element ** to a non-NULL pointer, then the sqlite3_io_methods.xClose method ** may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed. The ** only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen] @@ -1083,7 +1083,7 @@ struct sqlite3_io_methods { **
  • [[SQLITE_FCNTL_CHUNK_SIZE]] ** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS ** extends and truncates the database file in chunks of a size specified -** by the user. The fourth argument to [sqlite3_file_control()] should +** by the user. The fourth argument to [sqlite3_file_control()] should ** point to an integer (type int) containing the new chunk-size to use ** for the nominated database. Allocating database file space in large ** chunks (say 1MB at a time), may reduce file-system fragmentation and @@ -1106,24 +1106,24 @@ struct sqlite3_io_methods { **
  • [[SQLITE_FCNTL_SYNC]] ** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and ** sent to the VFS immediately before the xSync method is invoked on a -** database file descriptor. Or, if the xSync method is not invoked -** because the user has configured SQLite with -** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place +** database file descriptor. Or, if the xSync method is not invoked +** because the user has configured SQLite with +** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place ** of the xSync method. In most cases, the pointer argument passed with ** this file-control is NULL. However, if the database file is being synced ** as part of a multi-database commit, the argument points to a nul-terminated -** string containing the transactions master-journal file name. VFSes that -** do not need this signal should silently ignore this opcode. Applications -** should not call [sqlite3_file_control()] with this opcode as doing so may -** disrupt the operation of the specialized VFSes that do require it. +** string containing the transactions master-journal file name. VFSes that +** do not need this signal should silently ignore this opcode. Applications +** should not call [sqlite3_file_control()] with this opcode as doing so may +** disrupt the operation of the specialized VFSes that do require it. ** **
  • [[SQLITE_FCNTL_COMMIT_PHASETWO]] ** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite ** and sent to the VFS after a transaction has been committed immediately ** but before the database is unlocked. VFSes that do not need this signal ** should silently ignore this opcode. Applications should not call -** [sqlite3_file_control()] with this opcode as doing so may disrupt the -** operation of the specialized VFSes that do require it. +** [sqlite3_file_control()] with this opcode as doing so may disrupt the +** operation of the specialized VFSes that do require it. ** **
  • [[SQLITE_FCNTL_WIN32_AV_RETRY]] ** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic @@ -1170,13 +1170,13 @@ struct sqlite3_io_methods { **
  • [[SQLITE_FCNTL_OVERWRITE]] ** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening ** a write transaction to indicate that, unless it is rolled back for some -** reason, the entire database file will be overwritten by the current +** reason, the entire database file will be overwritten by the current ** transaction. This is used by VACUUM operations. ** **
  • [[SQLITE_FCNTL_VFSNAME]] ** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of ** all [VFSes] in the VFS stack. The names are of all VFS shims and the -** final bottom-level VFS are written into memory obtained from +** final bottom-level VFS are written into memory obtained from ** [sqlite3_malloc()] and the result is stored in the char* variable ** that the fourth parameter of [sqlite3_file_control()] points to. ** The caller is responsible for freeing the memory when done. As with @@ -1195,7 +1195,7 @@ struct sqlite3_io_methods { ** upper-most shim only. ** **
  • [[SQLITE_FCNTL_PRAGMA]] -** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] +** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] ** file control is sent to the open [sqlite3_file] object corresponding ** to the database file to which the pragma statement refers. ^The argument ** to the [SQLITE_FCNTL_PRAGMA] file control is an array of @@ -1206,7 +1206,7 @@ struct sqlite3_io_methods { ** of the char** argument point to a string obtained from [sqlite3_mprintf()] ** or the equivalent and that string will become the result of the pragma or ** the error message if the pragma fails. ^If the -** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal +** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal ** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] ** file control returns [SQLITE_OK], then the parser assumes that the ** VFS has handled the PRAGMA itself and the parser generates a no-op @@ -1246,7 +1246,7 @@ struct sqlite3_io_methods { ** The argument is a pointer to a value of type sqlite3_int64 that ** is an advisory maximum number of bytes in the file to memory map. The ** pointer is overwritten with the old value. The limit is not changed if -** the value originally pointed to is negative, and so the current limit +** the value originally pointed to is negative, and so the current limit ** can be queried by passing in a pointer to a negative number. This ** file-control is used internally to implement [PRAGMA mmap_size]. ** @@ -1290,7 +1290,7 @@ struct sqlite3_io_methods { **
  • [[SQLITE_FCNTL_RBU]] ** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by ** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for -** this opcode. +** this opcode. ** */ #define SQLITE_FCNTL_LOCKSTATE 1 @@ -1399,14 +1399,14 @@ typedef struct sqlite3_api_routines sqlite3_api_routines; ** the [sqlite3_file] can safely store a pointer to the ** filename if it needs to remember the filename for some reason. ** If the zFilename parameter to xOpen is a NULL pointer then xOpen -** must invent its own temporary name for the file. ^Whenever the +** must invent its own temporary name for the file. ^Whenever the ** xFilename parameter is NULL it will also be the case that the ** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE]. ** ** The flags argument to xOpen() includes all bits set in ** the flags argument to [sqlite3_open_v2()]. Or if [sqlite3_open()] ** or [sqlite3_open16()] is used, then flags includes at least -** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. +** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. ** If xOpen() opens a file read-only then it sets *pOutFlags to ** include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be set. ** @@ -1448,10 +1448,10 @@ typedef struct sqlite3_api_routines sqlite3_api_routines; ** ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction ** with the [SQLITE_OPEN_CREATE] flag, which are both directly ** analogous to the O_EXCL and O_CREAT flags of the POSIX open() -** API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the +** API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the ** SQLITE_OPEN_CREATE, is used to indicate that file should always ** be created, and that it is an error if it already exists. -** It is not used to indicate the file should be opened +** It is not used to indicate the file should be opened ** for exclusive access. ** ** ^At least szOsFile bytes of memory are allocated by SQLite @@ -1489,16 +1489,16 @@ typedef struct sqlite3_api_routines sqlite3_api_routines; ** method returns a Julian Day Number for the current date and time as ** a floating point value. ** ^The xCurrentTimeInt64() method returns, as an integer, the Julian -** Day Number multiplied by 86400000 (the number of milliseconds in -** a 24-hour day). +** Day Number multiplied by 86400000 (the number of milliseconds in +** a 24-hour day). ** ^SQLite will use the xCurrentTimeInt64() method to get the current -** date and time if that method is available (if iVersion is 2 or +** date and time if that method is available (if iVersion is 2 or ** greater and the function pointer is not NULL) and will fall back ** to xCurrentTime() if xCurrentTimeInt64() is unavailable. ** ** ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces ** are not used by the SQLite core. These optional interfaces are provided -** by some VFSes to facilitate testing of the VFS code. By overriding +** by some VFSes to facilitate testing of the VFS code. By overriding ** system calls with functions under its control, a test program can ** simulate faults and error conditions that would otherwise be difficult ** or impossible to induce. The set of system calls that can be overridden @@ -1545,7 +1545,7 @@ struct sqlite3_vfs { /* ** The methods above are in versions 1 through 3 of the sqlite_vfs object. ** New fields may be appended in future versions. The iVersion - ** value will increment whenever this happens. + ** value will increment whenever this happens. */ }; @@ -1589,7 +1589,7 @@ struct sqlite3_vfs { ** ** ** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as -** was given on the corresponding lock. +** was given on the corresponding lock. ** ** The xShmLock method can transition between unlocked and SHARED or ** between unlocked and EXCLUSIVE. It cannot transition between SHARED @@ -1734,7 +1734,7 @@ SQLITE_API int sqlite3_config(int, ...); ** [database connection] (specified in the first argument). ** ** The second argument to sqlite3_db_config(D,V,...) is the -** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code +** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code ** that indicates what aspect of the [database connection] is being configured. ** Subsequent arguments vary depending on the configuration verb. ** @@ -1752,7 +1752,7 @@ SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...); ** This object is used in only one place in the SQLite interface. ** A pointer to an instance of this object is the argument to ** [sqlite3_config()] when the configuration option is -** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC]. +** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC]. ** By creating an instance of this object ** and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC]) ** during configuration, an application can specify an alternative @@ -1782,7 +1782,7 @@ SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...); ** allocators round up memory allocations at least to the next multiple ** of 8. Some allocators round up to a larger multiple or to a power of 2. ** Every memory allocation request coming in through [sqlite3_malloc()] -** or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0, +** or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0, ** that causes the corresponding memory allocation to fail. ** ** The xInit method initializes the memory allocator. For example, @@ -1840,7 +1840,7 @@ struct sqlite3_mem_methods { ** by a single thread. ^If SQLite is compiled with ** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then ** it is not possible to change the [threading mode] from its default -** value of Single-thread and so [sqlite3_config()] will return +** value of Single-thread and so [sqlite3_config()] will return ** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD ** configuration option. ** @@ -1875,7 +1875,7 @@ struct sqlite3_mem_methods { ** SQLITE_CONFIG_SERIALIZED configuration option. ** ** [[SQLITE_CONFIG_MALLOC]]
    SQLITE_CONFIG_MALLOC
    -**
    ^(The SQLITE_CONFIG_MALLOC option takes a single argument which is +**
    ^(The SQLITE_CONFIG_MALLOC option takes a single argument which is ** a pointer to an instance of the [sqlite3_mem_methods] structure. ** The argument specifies ** alternative low-level memory allocation routines to be used in place of @@ -1921,7 +1921,7 @@ struct sqlite3_mem_methods { ** ^SQLite will never request a scratch buffer that is more than 6 ** times the database page size. ** ^If SQLite needs needs additional -** scratch memory beyond what is provided by this configuration option, then +** scratch memory beyond what is provided by this configuration option, then ** [sqlite3_malloc()] will be used to obtain the memory needed.

    ** ^When the application provides any amount of scratch memory using ** SQLITE_CONFIG_SCRATCH, SQLite avoids unnecessary large @@ -1933,7 +1933,7 @@ struct sqlite3_mem_methods { ** [[SQLITE_CONFIG_PAGECACHE]]

    SQLITE_CONFIG_PAGECACHE
    **
    ^The SQLITE_CONFIG_PAGECACHE option specifies a memory pool ** that SQLite can use for the database page cache with the default page -** cache implementation. +** cache implementation. ** This configuration option is a no-op if an application-define page ** cache implementation is loaded using the [SQLITE_CONFIG_PCACHE2]. ** ^There are three arguments to SQLITE_CONFIG_PAGECACHE: A pointer to @@ -1961,7 +1961,7 @@ struct sqlite3_mem_methods { ** additional cache line.
    ** ** [[SQLITE_CONFIG_HEAP]]
    SQLITE_CONFIG_HEAP
    -**
    ^The SQLITE_CONFIG_HEAP option specifies a static memory buffer +**
    ^The SQLITE_CONFIG_HEAP option specifies a static memory buffer ** that SQLite will use for all of its dynamic memory allocation needs ** beyond those provided for by [SQLITE_CONFIG_SCRATCH] and ** [SQLITE_CONFIG_PAGECACHE]. @@ -2017,7 +2017,7 @@ struct sqlite3_mem_methods { ** configuration on individual connections.)^
    ** ** [[SQLITE_CONFIG_PCACHE2]]
    SQLITE_CONFIG_PCACHE2
    -**
    ^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is +**
    ^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is ** a pointer to an [sqlite3_pcache_methods2] object. This object specifies ** the interface to a custom page cache implementation.)^ ** ^SQLite makes a copy of the [sqlite3_pcache_methods2] object.
    @@ -2031,7 +2031,7 @@ struct sqlite3_mem_methods { **
    The SQLITE_CONFIG_LOG option is used to configure the SQLite ** global [error log]. ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a -** function with a call signature of void(*)(void*,int,const char*), +** function with a call signature of void(*)(void*,int,const char*), ** and a pointer to void. ^If the function pointer is not NULL, it is ** invoked by [sqlite3_log()] to process each logging event. ^If the ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op. @@ -2140,7 +2140,7 @@ struct sqlite3_mem_methods { ** [[SQLITE_CONFIG_STMTJRNL_SPILL]] **
    SQLITE_CONFIG_STMTJRNL_SPILL **
    ^The SQLITE_CONFIG_STMTJRNL_SPILL option takes a single parameter which -** becomes the [statement journal] spill-to-disk threshold. +** becomes the [statement journal] spill-to-disk threshold. ** [Statement journals] are held in memory until their size (in bytes) ** exceeds this threshold, at which point they are written to disk. ** Or if the threshold is -1, statement journals are always held @@ -2163,7 +2163,7 @@ struct sqlite3_mem_methods { #define SQLITE_CONFIG_MEMSTATUS 9 /* boolean */ #define SQLITE_CONFIG_MUTEX 10 /* sqlite3_mutex_methods* */ #define SQLITE_CONFIG_GETMUTEX 11 /* sqlite3_mutex_methods* */ -/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ +/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ #define SQLITE_CONFIG_LOOKASIDE 13 /* int int */ #define SQLITE_CONFIG_PCACHE 14 /* no-op */ #define SQLITE_CONFIG_GETPCACHE 15 /* no-op */ @@ -2194,7 +2194,7 @@ struct sqlite3_mem_methods { ** **
    **
    SQLITE_DBCONFIG_LOOKASIDE
    -**
    ^This option takes three additional arguments that determine the +**
    ^This option takes three additional arguments that determine the ** [lookaside memory allocator] configuration for the [database connection]. ** ^The first argument (the third parameter to [sqlite3_db_config()] is a ** pointer to a memory buffer to use for lookaside memory. @@ -2212,7 +2212,7 @@ struct sqlite3_mem_methods { ** when the "current value" returned by ** [sqlite3_db_status](D,[SQLITE_CONFIG_LOOKASIDE],...) is zero. ** Any attempt to change the lookaside memory configuration when lookaside -** memory is in use leaves the configuration unchanged and returns +** memory is in use leaves the configuration unchanged and returns ** [SQLITE_BUSY].)^
    ** **
    SQLITE_DBCONFIG_ENABLE_FKEY
    @@ -2275,9 +2275,9 @@ struct sqlite3_mem_methods { **
    ** **
    SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
    -**
    Usually, when a database in wal mode is closed or detached from a -** database handle, SQLite checks if this will mean that there are now no -** connections at all to the database. If so, it performs a checkpoint +**
    Usually, when a database in wal mode is closed or detached from a +** database handle, SQLite checks if this will mean that there are now no +** connections at all to the database. If so, it performs a checkpoint ** operation before closing the connection. This option may be used to ** override this behaviour. The first parameter passed to this operation ** is an integer - non-zero to disable checkpoints-on-close, or zero (the @@ -2319,18 +2319,18 @@ SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff); ** the table has a column of type [INTEGER PRIMARY KEY] then that column ** is another alias for the rowid. ** -** ^The sqlite3_last_insert_rowid(D) interface returns the [rowid] of the +** ^The sqlite3_last_insert_rowid(D) interface returns the [rowid] of the ** most recent successful [INSERT] into a rowid table or [virtual table] ** on database connection D. ** ^Inserts into [WITHOUT ROWID] tables are not recorded. ** ^If no successful [INSERT]s into rowid tables -** have ever occurred on the database connection D, +** have ever occurred on the database connection D, ** then sqlite3_last_insert_rowid(D) returns zero. ** ** ^(If an [INSERT] occurs within a trigger or within a [virtual table] ** method, then this routine will return the [rowid] of the inserted ** row as long as the trigger or virtual table method is running. -** But once the trigger or virtual table method ends, the value returned +** But once the trigger or virtual table method ends, the value returned ** by this routine reverts to what it was before the trigger or virtual ** table method began.)^ ** @@ -2370,37 +2370,37 @@ SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); ** returned by this function. ** ** ^Only changes made directly by the INSERT, UPDATE or DELETE statement are -** considered - auxiliary changes caused by [CREATE TRIGGER | triggers], +** considered - auxiliary changes caused by [CREATE TRIGGER | triggers], ** [foreign key actions] or [REPLACE] constraint resolution are not counted. -** -** Changes to a view that are intercepted by -** [INSTEAD OF trigger | INSTEAD OF triggers] are not counted. ^The value -** returned by sqlite3_changes() immediately after an INSERT, UPDATE or -** DELETE statement run on a view is always zero. Only changes made to real +** +** Changes to a view that are intercepted by +** [INSTEAD OF trigger | INSTEAD OF triggers] are not counted. ^The value +** returned by sqlite3_changes() immediately after an INSERT, UPDATE or +** DELETE statement run on a view is always zero. Only changes made to real ** tables are counted. ** ** Things are more complicated if the sqlite3_changes() function is ** executed while a trigger program is running. This may happen if the ** program uses the [changes() SQL function], or if some other callback ** function invokes sqlite3_changes() directly. Essentially: -** +** **
      **
    • ^(Before entering a trigger program the value returned by -** sqlite3_changes() function is saved. After the trigger program +** sqlite3_changes() function is saved. After the trigger program ** has finished, the original value is restored.)^ -** -**
    • ^(Within a trigger program each INSERT, UPDATE and DELETE -** statement sets the value returned by sqlite3_changes() -** upon completion as normal. Of course, this value will not include -** any changes performed by sub-triggers, as the sqlite3_changes() +** +**
    • ^(Within a trigger program each INSERT, UPDATE and DELETE +** statement sets the value returned by sqlite3_changes() +** upon completion as normal. Of course, this value will not include +** any changes performed by sub-triggers, as the sqlite3_changes() ** value will be saved and restored after each sub-trigger has run.)^ **
    -** +** ** ^This means that if the changes() SQL function (or similar) is used -** by the first INSERT, UPDATE or DELETE statement within a trigger, it +** by the first INSERT, UPDATE or DELETE statement within a trigger, it ** returns the value as set when the calling statement began executing. -** ^If it is used by the second or subsequent such statement within a trigger -** program, the value returned reflects the number of rows modified by the +** ^If it is used by the second or subsequent such statement within a trigger +** program, the value returned reflects the number of rows modified by the ** previous INSERT, UPDATE or DELETE statement within the same trigger. ** ** See also the [sqlite3_total_changes()] interface, the @@ -2421,12 +2421,12 @@ SQLITE_API int sqlite3_changes(sqlite3*); ** since the database connection was opened, including those executed as ** part of trigger programs. ^Executing any other type of SQL statement ** does not affect the value returned by sqlite3_total_changes(). -** +** ** ^Changes made as part of [foreign key actions] are included in the ** count, but those made as part of REPLACE constraint resolution are -** not. ^Changes to a view that are intercepted by INSTEAD OF triggers +** not. ^Changes to a view that are intercepted by INSTEAD OF triggers ** are not counted. -** +** ** See also the [sqlite3_changes()] interface, the ** [count_changes pragma], and the [total_changes() SQL function]. ** @@ -2462,7 +2462,7 @@ SQLITE_API int sqlite3_total_changes(sqlite3*); ** ** ^The sqlite3_interrupt(D) call is in effect until all currently running ** SQL statements on [database connection] D complete. ^Any new SQL statements -** that are started after the sqlite3_interrupt() call and before the +** that are started after the sqlite3_interrupt() call and before the ** running statements reaches zero are interrupted as if they had been ** running prior to the sqlite3_interrupt() call. ^New SQL statements ** that are started after the running statement count reaches zero are @@ -2497,7 +2497,7 @@ SQLITE_API void sqlite3_interrupt(sqlite3*); ** ^These routines do not parse the SQL statements thus ** will not detect syntactically incorrect SQL. ** -** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior +** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior ** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked ** automatically by sqlite3_complete16(). If that initialization fails, ** then the return value from sqlite3_complete16() will be non-zero @@ -2542,7 +2542,7 @@ SQLITE_API int sqlite3_complete16(const void *sql); ** The presence of a busy handler does not guarantee that it will be invoked ** when there is lock contention. ^If SQLite determines that invoking the busy ** handler could result in a deadlock, it will go ahead and return [SQLITE_BUSY] -** to the application instead of invoking the +** to the application instead of invoking the ** busy handler. ** Consider a scenario where one process is holding a read lock that ** it is trying to promote to a reserved lock and @@ -2567,7 +2567,7 @@ SQLITE_API int sqlite3_complete16(const void *sql); ** database connection that invoked the busy handler. In other words, ** the busy handler is not reentrant. Any such actions ** result in undefined behavior. -** +** ** A busy handler must not close the database connection ** or [prepared statement] that invoked the busy handler. */ @@ -2956,7 +2956,7 @@ SQLITE_API void sqlite3_randomness(int N, void *P); ** requested is ok. ^When the callback returns [SQLITE_DENY], the ** [sqlite3_prepare_v2()] or equivalent call that triggered the ** authorizer will fail with an error message explaining that -** access is denied. +** access is denied. ** ** ^The first parameter to the authorizer callback is a copy of the third ** parameter to the sqlite3_set_authorizer() interface. ^The second parameter @@ -3003,7 +3003,7 @@ SQLITE_API void sqlite3_randomness(int N, void *P); ** database connections for the meaning of "modify" in this paragraph. ** ** ^When [sqlite3_prepare_v2()] is used to prepare a statement, the -** statement might be re-prepared during [sqlite3_step()] due to a +** statement might be re-prepared during [sqlite3_step()] due to a ** schema change. Hence, the application should ensure that the ** correct authorizer callback remains in place during the [sqlite3_step()]. ** @@ -3151,7 +3151,7 @@ SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, ** execution of the prepared statement, such as at the start of each ** trigger subprogram. ^The P argument is a pointer to the ** [prepared statement]. ^The X argument is a pointer to a string which -** is the unexpanded SQL text of the prepared statement or an SQL comment +** is the unexpanded SQL text of the prepared statement or an SQL comment ** that indicates the invocation of a trigger. ^The callback can compute ** the same text that would have been returned by the legacy [sqlite3_trace()] ** interface by using the X argument when X begins with "--" and invoking @@ -3167,7 +3167,7 @@ SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, ** ** [[SQLITE_TRACE_ROW]]
    SQLITE_TRACE_ROW
    **
    ^An SQLITE_TRACE_ROW callback is invoked whenever a prepared -** statement generates a single row of result. +** statement generates a single row of result. ** ^The P argument is a pointer to the [prepared statement] and the ** X argument is unused. ** @@ -3194,10 +3194,10 @@ SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, ** M argument should be the bitwise OR-ed combination of ** zero or more [SQLITE_TRACE] constants. ** -** ^Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides +** ^Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides ** (cancels) any prior calls to sqlite3_trace() or sqlite3_trace_v2(). ** -** ^The X callback is invoked whenever any of the events identified by +** ^The X callback is invoked whenever any of the events identified by ** mask M occur. ^The integer return value from the callback is currently ** ignored, though this may change in future releases. Callback ** implementations should return zero to ensure future compatibility. @@ -3229,8 +3229,8 @@ SQLITE_API int sqlite3_trace_v2( ** database connection D. An example use for this ** interface is to keep a GUI updated during a large query. ** -** ^The parameter P is passed through as the only parameter to the -** callback function X. ^The parameter N is the approximate number of +** ^The parameter P is passed through as the only parameter to the +** callback function X. ^The parameter N is the approximate number of ** [virtual machine instructions] that are evaluated between successive ** invocations of the callback X. ^If N is less than one then the progress ** handler is disabled. @@ -3257,7 +3257,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** CAPI3REF: Opening A New Database Connection ** CONSTRUCTOR: sqlite3 ** -** ^These routines open an SQLite database file as specified by the +** ^These routines open an SQLite database file as specified by the ** filename argument. ^The filename argument is interpreted as UTF-8 for ** sqlite3_open() and sqlite3_open_v2() and as UTF-16 in the native byte ** order for sqlite3_open16(). ^(A [database connection] handle is usually @@ -3282,7 +3282,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** except that it accepts two additional parameters for additional control ** over the new database connection. ^(The flags parameter to ** sqlite3_open_v2() can take one of -** the following three values, optionally combined with the +** the following three values, optionally combined with the ** [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], [SQLITE_OPEN_SHAREDCACHE], ** [SQLITE_OPEN_PRIVATECACHE], and/or [SQLITE_OPEN_URI] flags:)^ ** @@ -3350,17 +3350,17 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** information. ** ** URI filenames are parsed according to RFC 3986. ^If the URI contains an -** authority, then it must be either an empty string or the string -** "localhost". ^If the authority is not an empty string or "localhost", an -** error is returned to the caller. ^The fragment component of a URI, if +** authority, then it must be either an empty string or the string +** "localhost". ^If the authority is not an empty string or "localhost", an +** error is returned to the caller. ^The fragment component of a URI, if ** present, is ignored. ** ** ^SQLite uses the path component of the URI as the name of the disk file -** which contains the database. ^If the path begins with a '/' character, -** then it is interpreted as an absolute path. ^If the path does not begin +** which contains the database. ^If the path begins with a '/' character, +** then it is interpreted as an absolute path. ^If the path does not begin ** with a '/' (meaning that the authority section is omitted from the URI) -** then the path is interpreted as a relative path. -** ^(On windows, the first component of an absolute path +** then the path is interpreted as a relative path. +** ^(On windows, the first component of an absolute path ** is a drive specification (e.g. "C:").)^ ** ** [[core URI query parameters]] @@ -3380,13 +3380,13 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** **
  • mode: ^(The mode parameter may be set to either "ro", "rw", ** "rwc", or "memory". Attempting to set it to any other value is -** an error)^. -** ^If "ro" is specified, then the database is opened for read-only -** access, just as if the [SQLITE_OPEN_READONLY] flag had been set in the -** third argument to sqlite3_open_v2(). ^If the mode option is set to -** "rw", then the database is opened for read-write (but not create) -** access, as if SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had -** been set. ^Value "rwc" is equivalent to setting both +** an error)^. +** ^If "ro" is specified, then the database is opened for read-only +** access, just as if the [SQLITE_OPEN_READONLY] flag had been set in the +** third argument to sqlite3_open_v2(). ^If the mode option is set to +** "rw", then the database is opened for read-write (but not create) +** access, as if SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had +** been set. ^Value "rwc" is equivalent to setting both ** SQLITE_OPEN_READWRITE and SQLITE_OPEN_CREATE. ^If the mode option is ** set to "memory" then a pure [in-memory database] that never reads ** or writes from disk is used. ^It is an error to specify a value for @@ -3396,7 +3396,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); **
  • cache: ^The cache parameter may be set to either "shared" or ** "private". ^Setting it to "shared" is equivalent to setting the ** SQLITE_OPEN_SHAREDCACHE bit in the flags argument passed to -** sqlite3_open_v2(). ^Setting the cache parameter to "private" is +** sqlite3_open_v2(). ^Setting the cache parameter to "private" is ** equivalent to setting the SQLITE_OPEN_PRIVATECACHE bit. ** ^If sqlite3_open_v2() is used and the "cache" parameter is present in ** a URI filename, its value overrides any behavior requested by setting @@ -3422,7 +3422,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** property on a database file that does in fact change can result ** in incorrect query results and/or [SQLITE_CORRUPT] errors. ** See also: [SQLITE_IOCAP_IMMUTABLE]. -** +** ** ** ** ^Specifying an unknown parameter in the query component of a URI is not an @@ -3434,36 +3434,36 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** ** **
    URI filenames Results -**
    file:data.db +**
    file:data.db ** Open the file "data.db" in the current directory. **
    file:/home/fred/data.db
    -** file:///home/fred/data.db
    -** file://localhost/home/fred/data.db
    +** file:///home/fred/data.db
    +** file://localhost/home/fred/data.db
    ** Open the database file "/home/fred/data.db". -**
    file://darkstar/home/fred/data.db +**
    file://darkstar/home/fred/data.db ** An error. "darkstar" is not a recognized authority. -**
    +**
    ** file:///C:/Documents%20and%20Settings/fred/Desktop/data.db ** Windows only: Open the file "data.db" on fred's desktop on drive -** C:. Note that the %20 escaping in this example is not strictly +** C:. Note that the %20 escaping in this example is not strictly ** necessary - space characters can be used literally ** in URI filenames. -**
    file:data.db?mode=ro&cache=private +**
    file:data.db?mode=ro&cache=private ** Open file "data.db" in the current directory for read-only access. ** Regardless of whether or not shared-cache mode is enabled by ** default, use a private cache. **
    file:/home/fred/data.db?vfs=unix-dotfile ** Open file "/home/fred/data.db". Use the special VFS "unix-dotfile" ** that uses dot-files in place of posix advisory locking. -**
    file:data.db?mode=readonly +**
    file:data.db?mode=readonly ** An error. "readonly" is not a valid option for the "mode" parameter. **
    ** ** ^URI hexadecimal escape sequences (%HH) are supported within the path and ** query components of a URI. A hexadecimal escape sequence consists of a -** percent sign - "%" - followed by exactly two hexadecimal digits +** percent sign - "%" - followed by exactly two hexadecimal digits ** specifying an octet value. ^Before the path or query components of a -** URI filename are interpreted, they are encoded using UTF-8 and all +** URI filename are interpreted, they are encoded using UTF-8 and all ** hexadecimal escape sequences replaced by a single byte containing the ** corresponding octet. If this process generates an invalid UTF-8 encoding, ** the results are undefined. @@ -3499,15 +3499,15 @@ SQLITE_API int sqlite3_open_v2( ** CAPI3REF: Obtain Values For URI Parameters ** ** These are utility routines, useful to VFS implementations, that check -** to see if a database file was a URI that contained a specific query +** to see if a database file was a URI that contained a specific query ** parameter, and if so obtains the value of that query parameter. ** -** If F is the database filename pointer passed into the xOpen() method of -** a VFS implementation when the flags parameter to xOpen() has one or +** If F is the database filename pointer passed into the xOpen() method of +** a VFS implementation when the flags parameter to xOpen() has one or ** more of the [SQLITE_OPEN_URI] or [SQLITE_OPEN_MAIN_DB] bits set and ** P is the name of the query parameter, then ** sqlite3_uri_parameter(F,P) returns the value of the P -** parameter if it exists or a NULL pointer if P does not appear as a +** parameter if it exists or a NULL pointer if P does not appear as a ** query parameter on F. If P is a query parameter of F ** has no explicit value, then sqlite3_uri_parameter(F,P) returns ** a pointer to an empty string. @@ -3516,7 +3516,7 @@ SQLITE_API int sqlite3_open_v2( ** parameter and returns true (1) or false (0) according to the value ** of P. The sqlite3_uri_boolean(F,P,B) routine returns true (1) if the ** value of query parameter P is one of "yes", "true", or "on" in any -** case or if the value begins with a non-zero number. The +** case or if the value begins with a non-zero number. The ** sqlite3_uri_boolean(F,P,B) routines returns false (0) if the value of ** query parameter P is one of "no", "false", or "off" in any case or ** if the value begins with a numeric zero. If P is not a query @@ -3527,7 +3527,7 @@ SQLITE_API int sqlite3_open_v2( ** 64-bit signed integer and returns that integer, or D if P does not ** exist. If the value of P is something other than an integer, then ** zero is returned. -** +** ** If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and ** is not a database file pathname pointer that SQLite passed into the xOpen @@ -3543,14 +3543,14 @@ SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int ** CAPI3REF: Error Codes And Messages ** METHOD: sqlite3 ** -** ^If the most recent sqlite3_* API call associated with +** ^If the most recent sqlite3_* API call associated with ** [database connection] D failed, then the sqlite3_errcode(D) interface ** returns the numeric [result code] or [extended result code] for that ** API call. ** If the most recent API call was successful, ** then the return value from sqlite3_errcode() is undefined. ** ^The sqlite3_extended_errcode() -** interface is the same except that it always returns the +** interface is the same except that it always returns the ** [extended result code] even when extended result codes are ** disabled. ** @@ -3594,7 +3594,7 @@ SQLITE_API const char *sqlite3_errstr(int); ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The -** original SQL text is source code. A prepared statement object +** original SQL text is source code. A prepared statement object ** is the compiled object code. All SQL must be converted into a ** prepared statement before it can be run. ** @@ -3624,7 +3624,7 @@ typedef struct sqlite3_stmt sqlite3_stmt; ** new limit for that construct.)^ ** ** ^If the new limit is a negative number, the limit is unchanged. -** ^(For each limit category SQLITE_LIMIT_NAME there is a +** ^(For each limit category SQLITE_LIMIT_NAME there is a ** [limits | hard upper bound] ** set at compile-time by a C preprocessor macro called ** [limits | SQLITE_MAX_NAME]. @@ -3632,7 +3632,7 @@ typedef struct sqlite3_stmt sqlite3_stmt; ** ^Attempts to increase a limit above its hard upper bound are ** silently truncated to the hard upper bound. ** -** ^Regardless of whether or not the limit was changed, the +** ^Regardless of whether or not the limit was changed, the ** [sqlite3_limit()] interface returns the prior value of the limit. ** ^Hence, to find the current value of a limit without changing it, ** simply invoke this interface with the third parameter set to -1. @@ -3792,12 +3792,12 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); **
  • ** **
  • -** ^If the specific value bound to [parameter | host parameter] in the +** ^If the specific value bound to [parameter | host parameter] in the ** WHERE clause might influence the choice of query plan for a statement, -** then the statement will be automatically recompiled, as if there had been +** then the statement will be automatically recompiled, as if there had been ** a schema change, on the first [sqlite3_step()] call following any change -** to the [sqlite3_bind_text | bindings] of that [parameter]. -** ^The specific value of WHERE-clause [parameter] might influence the +** to the [sqlite3_bind_text | bindings] of that [parameter]. +** ^The specific value of WHERE-clause [parameter] might influence the ** choice of query plan if the parameter is the left-hand side of a [LIKE] ** or [GLOB] operator or if the parameter is compared to an indexed column ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled. @@ -3876,8 +3876,8 @@ SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt); ** the content of the database file. ** ** Note that [application-defined SQL functions] or -** [virtual tables] might change the database indirectly as a side effect. -** ^(For example, if an application defines a function "eval()" that +** [virtual tables] might change the database indirectly as a side effect. +** ^(For example, if an application defines a function "eval()" that ** calls [sqlite3_exec()], then the following SQL statement would ** change the database file through side-effects: ** @@ -3891,10 +3891,10 @@ SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt); ** ^Transaction control statements such as [BEGIN], [COMMIT], [ROLLBACK], ** [SAVEPOINT], and [RELEASE] cause sqlite3_stmt_readonly() to return true, ** since the statements themselves do not actually modify the database but -** rather they control the timing of when other statements modify the +** rather they control the timing of when other statements modify the ** database. ^The [ATTACH] and [DETACH] statements also cause ** sqlite3_stmt_readonly() to return true since, while those statements -** change the configuration of a database connection, they do not make +** change the configuration of a database connection, they do not make ** changes to the content of the database files on disk. ** ^The sqlite3_stmt_readonly() interface returns true for [BEGIN] since ** [BEGIN] merely sets internal flags, but the [BEGIN|BEGIN IMMEDIATE] and @@ -3908,18 +3908,18 @@ SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); ** METHOD: sqlite3_stmt ** ** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the -** [prepared statement] S has been stepped at least once using +** [prepared statement] S has been stepped at least once using ** [sqlite3_step(S)] but has neither run to completion (returned ** [SQLITE_DONE] from [sqlite3_step(S)]) nor ** been reset using [sqlite3_reset(S)]. ^The sqlite3_stmt_busy(S) -** interface returns false if S is a NULL pointer. If S is not a +** interface returns false if S is a NULL pointer. If S is not a ** NULL pointer and is not a pointer to a valid [prepared statement] ** object, then the behavior is undefined and probably undesirable. ** ** This interface can be used in combination [sqlite3_next_stmt()] -** to locate all prepared statements associated with a database +** to locate all prepared statements associated with a database ** connection that are in need of being reset. This can be used, -** for example, in diagnostic routines to search for prepared +** for example, in diagnostic routines to search for prepared ** statements that are holding a transaction open. */ SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*); @@ -3938,7 +3938,7 @@ SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*); ** will accept either a protected or an unprotected sqlite3_value. ** Every interface that accepts sqlite3_value arguments specifies ** whether or not it requires a protected sqlite3_value. The -** [sqlite3_value_dup()] interface can be used to construct a new +** [sqlite3_value_dup()] interface can be used to construct a new ** protected sqlite3_value from an unprotected sqlite3_value. ** ** The terms "protected" and "unprotected" refer to whether or not @@ -3946,7 +3946,7 @@ SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*); ** sqlite3_value object but no mutex is held for an unprotected ** sqlite3_value object. If SQLite is compiled to be single-threaded ** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0) -** or if SQLite is run in one of reduced mutex modes +** or if SQLite is run in one of reduced mutex modes ** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD] ** then there is no distinction between protected and unprotected ** sqlite3_value objects and they can be used interchangeably. However, @@ -4033,7 +4033,7 @@ typedef struct sqlite3_context sqlite3_context; ** or sqlite3_bind_text16() or sqlite3_bind_text64() then ** that parameter must be the byte offset ** where the NUL terminator would occur assuming the string were NUL -** terminated. If any NUL characters occur at byte offsets less than +** terminated. If any NUL characters occur at byte offsets less than ** the value of the fourth parameter then the resulting string value will ** contain embedded NULs. The result of expressions involving strings ** with embedded NULs is undefined. @@ -4192,7 +4192,7 @@ SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*); ** METHOD: sqlite3_stmt ** ** ^Return the number of columns in the result set returned by the -** [prepared statement]. ^If this routine returns 0, that means the +** [prepared statement]. ^If this routine returns 0, that means the ** [prepared statement] returns no data (for example an [UPDATE]). ** ^However, just because this routine returns a positive number does not ** mean that one or more rows of data will be returned. ^A SELECT statement @@ -4376,7 +4376,7 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); ** For all versions of SQLite up to and including 3.6.23.1, a call to ** [sqlite3_reset()] was required after sqlite3_step() returned anything ** other than [SQLITE_ROW] before any subsequent invocation of -** sqlite3_step(). Failure to reset the prepared statement using +** sqlite3_step(). Failure to reset the prepared statement using ** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from ** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1], ** sqlite3_step() began @@ -4507,7 +4507,7 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** the number of bytes in that string. ** ^If the result is NULL, then sqlite3_column_bytes16() returns zero. ** -** ^The values returned by [sqlite3_column_bytes()] and +** ^The values returned by [sqlite3_column_bytes()] and ** [sqlite3_column_bytes16()] do not include the zero terminators at the end ** of the string. ^For clarity: the values returned by ** [sqlite3_column_bytes()] and [sqlite3_column_bytes16()] are the number of @@ -4698,7 +4698,7 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); ** ^The second parameter is the name of the SQL function to be created or ** redefined. ^The length of the name is limited to 255 bytes in a UTF-8 ** representation, exclusive of the zero-terminator. ^Note that the name -** length limit is in UTF-8 bytes, not characters nor UTF-16 bytes. +** length limit is in UTF-8 bytes, not characters nor UTF-16 bytes. ** ^Any attempt to create a function with a longer name ** will result in [SQLITE_MISUSE] being returned. ** @@ -4713,7 +4713,7 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); ** ^The fourth parameter, eTextRep, specifies what ** [SQLITE_UTF8 | text encoding] this SQL function prefers for ** its parameters. The application should set this parameter to -** [SQLITE_UTF16LE] if the function implementation invokes +** [SQLITE_UTF16LE] if the function implementation invokes ** [sqlite3_value_text16le()] on an input, or [SQLITE_UTF16BE] if the ** implementation invokes [sqlite3_value_text16be()] on an input, or ** [SQLITE_UTF16] if [sqlite3_value_text16()] is used, or [SQLITE_UTF8] @@ -4744,13 +4744,13 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); ** callbacks. ** ** ^(If the ninth parameter to sqlite3_create_function_v2() is not NULL, -** then it is destructor for the application data pointer. +** then it is destructor for the application data pointer. ** The destructor is invoked when the function is deleted, either by being ** overloaded or when the database connection closes.)^ ** ^The destructor is also invoked if the call to ** sqlite3_create_function_v2() fails. ** ^When the destructor callback of the tenth parameter is invoked, it -** is passed a single argument which is a copy of the application data +** is passed a single argument which is a copy of the application data ** pointer which was the fifth parameter to sqlite3_create_function_v2(). ** ** ^It is permitted to register multiple implementations of the same @@ -4761,7 +4761,7 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); ** nArg parameter is a better match than a function implementation with ** a negative nArg. ^A function where the preferred text encoding ** matches the database encoding is a better -** match than a function where the encoding is different. +** match than a function where the encoding is different. ** ^A function where the encoding difference is between UTF16le and UTF16be ** is a closer match than a function where the encoding difference is ** between UTF8 and UTF16. @@ -4821,7 +4821,7 @@ SQLITE_API int sqlite3_create_function_v2( /* ** CAPI3REF: Function Flags ** -** These constants may be ORed together with the +** These constants may be ORed together with the ** [SQLITE_UTF8 | preferred text encoding] as the fourth argument ** to [sqlite3_create_function()], [sqlite3_create_function16()], or ** [sqlite3_create_function_v2()]. @@ -4833,7 +4833,7 @@ SQLITE_API int sqlite3_create_function_v2( ** DEPRECATED ** ** These functions are [deprecated]. In order to maintain -** backwards compatibility with older code, these functions continue +** backwards compatibility with older code, these functions continue ** to be supported. However, new applications should avoid ** the use of these functions. To encourage programmers to avoid ** these functions, we will not explain what they do. @@ -4854,7 +4854,7 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6 ** ** The C-language implementation of SQL functions and aggregates uses ** this set of interface routines to access the parameter values on -** the function or aggregate. +** the function or aggregate. ** ** The xFunc (for scalar functions) or xStep (for aggregates) parameters ** to [sqlite3_create_function()] and [sqlite3_create_function16()] @@ -4949,7 +4949,7 @@ SQLITE_API void sqlite3_value_free(sqlite3_value*); ** Implementations of aggregate SQL functions use this ** routine to allocate memory for storing their state. ** -** ^The first time the sqlite3_aggregate_context(C,N) routine is called +** ^The first time the sqlite3_aggregate_context(C,N) routine is called ** for a particular aggregate function, SQLite ** allocates N of memory, zeroes out that memory, and returns a pointer ** to the new memory. ^On second and subsequent calls to @@ -4962,7 +4962,7 @@ SQLITE_API void sqlite3_value_free(sqlite3_value*); ** In those cases, sqlite3_aggregate_context() might be called for the ** first time from within xFinal().)^ ** -** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer +** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer ** when first called if N is less than or equal to zero or if a memory ** allocate error occurs. ** @@ -4971,10 +4971,10 @@ SQLITE_API void sqlite3_value_free(sqlite3_value*); ** value of N in subsequent call to sqlite3_aggregate_context() within ** the same aggregate function instance will not resize the memory ** allocation.)^ Within the xFinal callback, it is customary to set -** N=0 in calls to sqlite3_aggregate_context(C,N) so that no +** N=0 in calls to sqlite3_aggregate_context(C,N) so that no ** pointless memory allocations occur. ** -** ^SQLite automatically frees the memory allocated by +** ^SQLite automatically frees the memory allocated by ** sqlite3_aggregate_context() when the aggregate query concludes. ** ** The first parameter must be a copy of the @@ -5024,7 +5024,7 @@ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*); ** some circumstances the associated metadata may be preserved. An example ** of where this might be useful is in a regular-expression matching ** function. The compiled version of the regular expression can be stored as -** metadata associated with the pattern string. +** metadata associated with the pattern string. ** Then as long as the pattern string remains the same, ** the compiled regular expression can be reused on multiple ** invocations of the same function. @@ -5049,10 +5049,10 @@ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*); ** SQL statement)^, or **
  • ^(when sqlite3_set_auxdata() is invoked again on the same ** parameter)^, or -**
  • ^(during the original sqlite3_set_auxdata() call when a memory +**
  • ^(during the original sqlite3_set_auxdata() call when a memory ** allocation error occurs.)^ ** -** Note the last bullet in particular. The destructor X in +** Note the last bullet in particular. The destructor X in ** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the ** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata() ** should be called near the end of the function implementation and the @@ -5240,8 +5240,8 @@ SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); ** METHOD: sqlite3_context ** ** The sqlite3_result_subtype(C,T) function causes the subtype of -** the result from the [application-defined SQL function] with -** [sqlite3_context] C to be the value T. Only the lower 8 bits +** the result from the [application-defined SQL function] with +** [sqlite3_context] C to be the value T. Only the lower 8 bits ** of the subtype T are preserved in current versions of SQLite; ** higher order bits are discarded. ** The number of subtype bytes preserved by SQLite might increase @@ -5288,7 +5288,7 @@ SQLITE_API void sqlite3_result_subtype(sqlite3_context*,unsigned int); ** deleted. ^When all collating functions having the same name are deleted, ** that collation is no longer usable. ** -** ^The collating function callback is invoked with a copy of the pArg +** ^The collating function callback is invoked with a copy of the pArg ** application data pointer and with two strings in the encoding specified ** by the eTextRep argument. The collating function must return an ** integer that is negative, zero, or positive @@ -5318,36 +5318,36 @@ SQLITE_API void sqlite3_result_subtype(sqlite3_context*,unsigned int); ** calls to the collation creation functions or when the ** [database connection] is closed using [sqlite3_close()]. ** -** ^The xDestroy callback is not called if the +** ^The xDestroy callback is not called if the ** sqlite3_create_collation_v2() function fails. Applications that invoke -** sqlite3_create_collation_v2() with a non-NULL xDestroy argument should +** sqlite3_create_collation_v2() with a non-NULL xDestroy argument should ** check the return code and dispose of the application data pointer ** themselves rather than expecting SQLite to deal with it for them. -** This is different from every other SQLite interface. The inconsistency -** is unfortunate but cannot be changed without breaking backwards +** This is different from every other SQLite interface. The inconsistency +** is unfortunate but cannot be changed without breaking backwards ** compatibility. ** ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. */ SQLITE_API int sqlite3_create_collation( - sqlite3*, - const char *zName, - int eTextRep, + sqlite3*, + const char *zName, + int eTextRep, void *pArg, int(*xCompare)(void*,int,const void*,int,const void*) ); SQLITE_API int sqlite3_create_collation_v2( - sqlite3*, - const char *zName, - int eTextRep, + sqlite3*, + const char *zName, + int eTextRep, void *pArg, int(*xCompare)(void*,int,const void*,int,const void*), void(*xDestroy)(void*) ); SQLITE_API int sqlite3_create_collation16( - sqlite3*, + sqlite3*, const void *zName, - int eTextRep, + int eTextRep, void *pArg, int(*xCompare)(void*,int,const void*,int,const void*) ); @@ -5380,12 +5380,12 @@ SQLITE_API int sqlite3_create_collation16( ** [sqlite3_create_collation_v2()]. */ SQLITE_API int sqlite3_collation_needed( - sqlite3*, - void*, + sqlite3*, + void*, void(*)(void*,sqlite3*,int eTextRep,const char*) ); SQLITE_API int sqlite3_collation_needed16( - sqlite3*, + sqlite3*, void*, void(*)(void*,sqlite3*,int eTextRep,const void*) ); @@ -5427,7 +5427,7 @@ SQLITE_API int sqlite3_rekey_v2( ); /* -** Specify the activation key for a SEE database. Unless +** Specify the activation key for a SEE database. Unless ** activated, none of the SEE routines will work. */ SQLITE_API void sqlite3_activate_see( @@ -5437,7 +5437,7 @@ SQLITE_API void sqlite3_activate_see( #ifdef SQLITE_ENABLE_CEROD /* -** Specify the activation key for a CEROD database. Unless +** Specify the activation key for a CEROD database. Unless ** activated, none of the CEROD routines will work. */ SQLITE_API void sqlite3_activate_cerod( @@ -5493,7 +5493,7 @@ SQLITE_API int sqlite3_sleep(int); ** ^The [temp_store_directory pragma] may modify this variable and cause ** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, ** the [temp_store_directory pragma] always assumes that any string -** that this variable points to is held in memory obtained from +** that this variable points to is held in memory obtained from ** [sqlite3_malloc] and the pragma may attempt to free that memory ** using [sqlite3_free]. ** Hence, if this variable is modified directly, either it should be @@ -5550,7 +5550,7 @@ SQLITE_API char *sqlite3_temp_directory; ** ^The [data_store_directory pragma] may modify this variable and cause ** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, ** the [data_store_directory pragma] always assumes that any string -** that this variable points to is held in memory obtained from +** that this variable points to is held in memory obtained from ** [sqlite3_malloc] and the pragma may attempt to free that memory ** using [sqlite3_free]. ** Hence, if this variable is modified directly, either it should be @@ -5739,7 +5739,7 @@ SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); ** and [sqlite3_preupdate_hook()] interfaces. */ SQLITE_API void *sqlite3_update_hook( - sqlite3*, + sqlite3*, void(*)(void *,int ,char const *,char const *,sqlite3_int64), void* ); @@ -5753,7 +5753,7 @@ SQLITE_API void *sqlite3_update_hook( ** and disabled if the argument is false.)^ ** ** ^Cache sharing is enabled and disabled for an entire process. -** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]). +** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]). ** In prior versions of SQLite, ** sharing was enabled or disabled for each thread separately. ** @@ -5770,8 +5770,8 @@ SQLITE_API void *sqlite3_update_hook( ** cache setting should set it explicitly. ** ** Note: This method is disabled on MacOS X 10.7 and iOS version 5.0 -** and will always return SQLITE_MISUSE. On those systems, -** shared cache mode should be enabled per-database connection via +** and will always return SQLITE_MISUSE. On those systems, +** shared cache mode should be enabled per-database connection via ** [sqlite3_open_v2()] with [SQLITE_OPEN_SHAREDCACHE]. ** ** This interface is threadsafe on processors where writing a @@ -5821,7 +5821,7 @@ SQLITE_API int sqlite3_db_release_memory(sqlite3*); ** as heap memory usages approaches the limit. ** ^The soft heap limit is "soft" because even though SQLite strives to stay ** below the limit, it will exceed the limit rather than generate -** an [SQLITE_NOMEM] error. In other words, the soft heap limit +** an [SQLITE_NOMEM] error. In other words, the soft heap limit ** is advisory only. ** ** ^The return value from sqlite3_soft_heap_limit64() is the size of @@ -5848,7 +5848,7 @@ SQLITE_API int sqlite3_db_release_memory(sqlite3*); ** from the heap. ** )^ ** -** Beginning with SQLite [version 3.7.3] ([dateof:3.7.3]), +** Beginning with SQLite [version 3.7.3] ([dateof:3.7.3]), ** the soft heap limit is enforced ** regardless of whether or not the [SQLITE_ENABLE_MEMORY_MANAGEMENT] ** compile-time option is invoked. With [SQLITE_ENABLE_MEMORY_MANAGEMENT], @@ -5924,7 +5924,7 @@ SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N); ** ** ^If the specified table is actually a view, an [error code] is returned. ** -** ^If the specified column is "rowid", "oid" or "_rowid_" and the table +** ^If the specified column is "rowid", "oid" or "_rowid_" and the table ** is not a [WITHOUT ROWID] table and an ** [INTEGER PRIMARY KEY] column has been explicitly declared, then the output ** parameters are set for the explicitly declared column. ^(If there is no @@ -5990,7 +5990,7 @@ SQLITE_API int sqlite3_table_column_metadata( ** prior to calling this API, ** otherwise an error will be returned. ** -** Security warning: It is recommended that the +** Security warning: It is recommended that the ** [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method be used to enable only this ** interface. The use of the [sqlite3_enable_load_extension()] interface ** should be avoided. This will keep the SQL function [load_extension()] @@ -6077,7 +6077,7 @@ SQLITE_API int sqlite3_auto_extension(void(*xEntryPoint)(void)); ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the ** initialization routine X that was registered using a prior call to ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)] -** routine returns 1 if initialization routine X was successfully +** routine returns 1 if initialization routine X was successfully ** unregistered and it returns 0 if X was not on the list of initialization ** routines. */ @@ -6112,8 +6112,8 @@ typedef struct sqlite3_module sqlite3_module; ** CAPI3REF: Virtual Table Object ** KEYWORDS: sqlite3_module {virtual table module} ** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual tables]. +** This structure, sometimes called a "virtual table module", +** defines the implementation of a [virtual tables]. ** This structure consists mostly of methods for the module. ** ** ^A virtual table module is created by filling in a persistent @@ -6152,7 +6152,7 @@ struct sqlite3_module { void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), void **ppArg); int (*xRename)(sqlite3_vtab *pVtab, const char *zNew); - /* The methods above are in version 1 of the sqlite_module object. Those + /* The methods above are in version 1 of the sqlite_module object. Those ** below are for version 2 and greater. */ int (*xSavepoint)(sqlite3_vtab *pVTab, int); int (*xRelease)(sqlite3_vtab *pVTab, int); @@ -6199,7 +6199,7 @@ struct sqlite3_module { ** required by SQLite. If the table has at least 64 columns and any column ** to the right of the first 63 is required, then bit 63 of colUsed is also ** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to +** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to ** non-zero. ** ** The [xBestIndex] method must fill aConstraintUsage[] with information @@ -6220,17 +6220,17 @@ struct sqlite3_module { ** ** ^The estimatedCost value is an estimate of the cost of a particular ** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) +** to a linear scan of an SQLite table with N rows. A cost of log(N) ** indicates that the expense of the operation is similar to that of a ** binary search on a unique indexed field of an SQLite table with N rows. ** ** ^The estimatedRows value is an estimate of the number of rows that ** will be returned by the strategy. ** -** The xBestIndex method may optionally populate the idxFlags field with a +** The xBestIndex method may optionally populate the idxFlags field with a ** mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag - ** SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite -** assumes that the strategy may visit at most one row. +** assumes that the strategy may visit at most one row. ** ** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then ** SQLite also assumes that if a call to the xUpdate() method is made as @@ -6243,14 +6243,14 @@ struct sqlite3_module { ** the xUpdate method are automatically rolled back by SQLite. ** ** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). +** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). ** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely +** used with an SQLite version earlier than 3.8.2, the results of attempting +** to read or write the estimatedRows field are undefined (but are likely ** to included crashing the application). The estimatedRows field should ** therefore only be used if [sqlite3_libversion_number()] returns a ** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). +** was added for [version 3.9.0] ([dateof:3.9.0]). ** It may therefore only be used if ** sqlite3_libversion_number() returns a value greater than or equal to ** 3009000. @@ -6320,7 +6320,7 @@ struct sqlite3_index_info { ** preexisting [virtual table] for the module. ** ** ^The module name is registered on the [database connection] specified -** by the first parameter. ^The name of the module is given by the +** by the first parameter. ^The name of the module is given by the ** second parameter. ^The third parameter is a pointer to ** the implementation of the [virtual table module]. ^The fourth ** parameter is an arbitrary client data pointer that is passed through @@ -6412,7 +6412,7 @@ SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL); ** METHOD: sqlite3 ** ** ^(Virtual tables can provide alternative implementations of functions -** using the [xFindFunction] method of the [virtual table module]. +** using the [xFindFunction] method of the [virtual table module]. ** But global versions of those functions ** must exist in order to be overloaded.)^ ** @@ -6463,7 +6463,7 @@ typedef struct sqlite3_blob sqlite3_blob; ** SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow; ** )^ ** -** ^(Parameter zDb is not the filename that contains the database, but +** ^(Parameter zDb is not the filename that contains the database, but ** rather the symbolic name of the database. For attached databases, this is ** the name that appears after the AS keyword in the [ATTACH] statement. ** For the main database file, the database name is "main". For TEMP @@ -6476,28 +6476,28 @@ typedef struct sqlite3_blob sqlite3_blob; ** ^(On success, [SQLITE_OK] is returned and the new [BLOB handle] is stored ** in *ppBlob. Otherwise an [error code] is returned and, unless the error ** code is SQLITE_MISUSE, *ppBlob is set to NULL.)^ ^This means that, provided -** the API is not misused, it is always safe to call [sqlite3_blob_close()] +** the API is not misused, it is always safe to call [sqlite3_blob_close()] ** on *ppBlob after this function it returns. ** ** This function fails with SQLITE_ERROR if any of the following are true: **
      -**
    • ^(Database zDb does not exist)^, -**
    • ^(Table zTable does not exist within database zDb)^, -**
    • ^(Table zTable is a WITHOUT ROWID table)^, +**
    • ^(Database zDb does not exist)^, +**
    • ^(Table zTable does not exist within database zDb)^, +**
    • ^(Table zTable is a WITHOUT ROWID table)^, **
    • ^(Column zColumn does not exist)^, **
    • ^(Row iRow is not present in the table)^, **
    • ^(The specified column of row iRow contains a value that is not ** a TEXT or BLOB value)^, -**
    • ^(Column zColumn is part of an index, PRIMARY KEY or UNIQUE +**
    • ^(Column zColumn is part of an index, PRIMARY KEY or UNIQUE ** constraint and the blob is being opened for read/write access)^, -**
    • ^([foreign key constraints | Foreign key constraints] are enabled, +**
    • ^([foreign key constraints | Foreign key constraints] are enabled, ** column zColumn is part of a [child key] definition and the blob is ** being opened for read/write access)^. **
    ** -** ^Unless it returns SQLITE_MISUSE, this function sets the -** [database connection] error code and message accessible via -** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. +** ^Unless it returns SQLITE_MISUSE, this function sets the +** [database connection] error code and message accessible via +** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. ** ** A BLOB referenced by sqlite3_blob_open() may be read using the ** [sqlite3_blob_read()] interface and modified by using @@ -6523,7 +6523,7 @@ typedef struct sqlite3_blob sqlite3_blob; ** blob. ** ** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces -** and the built-in [zeroblob] SQL function may be used to create a +** and the built-in [zeroblob] SQL function may be used to create a ** zero-filled blob to read or write using the incremental-blob interface. ** ** To avoid a resource leak, every open [BLOB handle] should eventually @@ -6573,7 +6573,7 @@ SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); ** DESTRUCTOR: sqlite3_blob ** ** ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed -** unconditionally. Even if this routine returns an error code, the +** unconditionally. Even if this routine returns an error code, the ** handle is still closed.)^ ** ** ^If the blob handle being closed was opened for read-write access, and if @@ -6583,10 +6583,10 @@ SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); ** code is returned and the transaction rolled back. ** ** Calling this function with an argument that is not a NULL pointer or an -** open blob handle results in undefined behaviour. ^Calling this routine -** with a null pointer (such as would be returned by a failed call to +** open blob handle results in undefined behaviour. ^Calling this routine +** with a null pointer (such as would be returned by a failed call to ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function -** is passed a valid open blob handle, the values returned by the +** is passed a valid open blob handle, the values returned by the ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning. */ SQLITE_API int sqlite3_blob_close(sqlite3_blob *); @@ -6595,7 +6595,7 @@ SQLITE_API int sqlite3_blob_close(sqlite3_blob *); ** CAPI3REF: Return The Size Of An Open BLOB ** METHOD: sqlite3_blob ** -** ^Returns the size in bytes of the BLOB accessible via the +** ^Returns the size in bytes of the BLOB accessible via the ** successfully opened [BLOB handle] in its only argument. ^The ** incremental blob I/O routines can only read or overwriting existing ** blob content; they cannot change the size of a blob. @@ -6646,9 +6646,9 @@ SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); ** ** ^(On success, sqlite3_blob_write() returns SQLITE_OK. ** Otherwise, an [error code] or an [extended error code] is returned.)^ -** ^Unless SQLITE_MISUSE is returned, this function sets the -** [database connection] error code and message accessible via -** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. +** ^Unless SQLITE_MISUSE is returned, this function sets the +** [database connection] error code and message accessible via +** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. ** ** ^If the [BLOB handle] passed as the first argument was not opened for ** writing (the flags parameter to [sqlite3_blob_open()] was zero), @@ -6657,9 +6657,9 @@ SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); ** This function may only modify the contents of the BLOB; it is ** not possible to increase the size of a BLOB using this API. ** ^If offset iOffset is less than N bytes from the end of the BLOB, -** [SQLITE_ERROR] is returned and no data is written. The size of the -** BLOB (and hence the maximum value of N+iOffset) can be determined -** using the [sqlite3_blob_bytes()] interface. ^If N or iOffset are less +** [SQLITE_ERROR] is returned and no data is written. The size of the +** BLOB (and hence the maximum value of N+iOffset) can be determined +** using the [sqlite3_blob_bytes()] interface. ^If N or iOffset are less ** than zero [SQLITE_ERROR] is returned and no data is written. ** ** ^An attempt to write to an expired [BLOB handle] fails with an @@ -6811,7 +6811,7 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); ** ^(Some systems (for example, Windows 95) do not support the operation ** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try() ** will always return SQLITE_BUSY. The SQLite core only ever uses -** sqlite3_mutex_try() as an optimization so this is acceptable +** sqlite3_mutex_try() as an optimization so this is acceptable ** behavior.)^ ** ** ^The sqlite3_mutex_leave() routine exits a mutex that was @@ -6974,7 +6974,7 @@ SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*); ** CAPI3REF: Retrieve the mutex for a database connection ** METHOD: sqlite3 ** -** ^This interface returns a pointer the [sqlite3_mutex] object that +** ^This interface returns a pointer the [sqlite3_mutex] object that ** serializes access to the [database connection] given in the argument ** when the [threading mode] is Serialized. ** ^If the [threading mode] is Single-thread or Multi-thread then this @@ -7129,7 +7129,7 @@ SQLITE_API int sqlite3_status64( **
    This parameter records the largest memory allocation request ** handed to [sqlite3_malloc()] or [sqlite3_realloc()] (or their ** internal equivalents). Only the value returned in the -** *pHighwater parameter to [sqlite3_status()] is of interest. +** *pHighwater parameter to [sqlite3_status()] is of interest. ** The value written into the *pCurrent parameter is undefined.
    )^ ** ** [[SQLITE_STATUS_MALLOC_COUNT]] ^(
    SQLITE_STATUS_MALLOC_COUNT
    @@ -7138,11 +7138,11 @@ SQLITE_API int sqlite3_status64( ** ** [[SQLITE_STATUS_PAGECACHE_USED]] ^(
    SQLITE_STATUS_PAGECACHE_USED
    **
    This parameter returns the number of pages used out of the -** [pagecache memory allocator] that was configured using +** [pagecache memory allocator] that was configured using ** [SQLITE_CONFIG_PAGECACHE]. The ** value returned is in pages, not in bytes.
    )^ ** -** [[SQLITE_STATUS_PAGECACHE_OVERFLOW]] +** [[SQLITE_STATUS_PAGECACHE_OVERFLOW]] ** ^(
    SQLITE_STATUS_PAGECACHE_OVERFLOW
    **
    This parameter returns the number of bytes of page cache ** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] @@ -7155,7 +7155,7 @@ SQLITE_API int sqlite3_status64( ** [[SQLITE_STATUS_PAGECACHE_SIZE]] ^(
    SQLITE_STATUS_PAGECACHE_SIZE
    **
    This parameter records the largest memory allocation request ** handed to [pagecache memory allocator]. Only the value returned in the -** *pHighwater parameter to [sqlite3_status()] is of interest. +** *pHighwater parameter to [sqlite3_status()] is of interest. ** The value written into the *pCurrent parameter is undefined.
    )^ ** ** [[SQLITE_STATUS_SCRATCH_USED]] ^(
    SQLITE_STATUS_SCRATCH_USED
    @@ -7179,11 +7179,11 @@ SQLITE_API int sqlite3_status64( ** [[SQLITE_STATUS_SCRATCH_SIZE]] ^(
    SQLITE_STATUS_SCRATCH_SIZE
    **
    This parameter records the largest memory allocation request ** handed to [scratch memory allocator]. Only the value returned in the -** *pHighwater parameter to [sqlite3_status()] is of interest. +** *pHighwater parameter to [sqlite3_status()] is of interest. ** The value written into the *pCurrent parameter is undefined.
    )^ ** ** [[SQLITE_STATUS_PARSER_STACK]] ^(
    SQLITE_STATUS_PARSER_STACK
    -**
    The *pHighwater parameter records the deepest parser stack. +**
    The *pHighwater parameter records the deepest parser stack. ** The *pCurrent value is undefined. The *pHighwater value is only ** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].
    )^ ** @@ -7205,12 +7205,12 @@ SQLITE_API int sqlite3_status64( ** CAPI3REF: Database Connection Status ** METHOD: sqlite3 ** -** ^This interface is used to retrieve runtime status information +** ^This interface is used to retrieve runtime status information ** about a single [database connection]. ^The first argument is the ** database connection object to be interrogated. ^The second argument ** is an integer constant, taken from the set of ** [SQLITE_DBSTATUS options], that -** determines the parameter to interrogate. The set of +** determines the parameter to interrogate. The set of ** [SQLITE_DBSTATUS options] is likely ** to grow in future releases of SQLite. ** @@ -7245,7 +7245,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** checked out.
  • )^ ** ** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(
    SQLITE_DBSTATUS_LOOKASIDE_HIT
    -**
    This parameter returns the number malloc attempts that were +**
    This parameter returns the number malloc attempts that were ** satisfied using lookaside memory. Only the high-water value is meaningful; ** the current value is always zero.)^ ** @@ -7270,7 +7270,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** memory used by all pager caches associated with the database connection.)^ ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. ** -** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] +** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] ** ^(
    SQLITE_DBSTATUS_CACHE_USED_SHARED
    **
    This parameter is similar to DBSTATUS_CACHE_USED, except that if a ** pager cache is shared between two or more connections the bytes of heap @@ -7285,7 +7285,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(
    SQLITE_DBSTATUS_SCHEMA_USED
    **
    This parameter returns the approximate number of bytes of heap ** memory used to store the schema for all databases associated -** with the connection - main, temp, and any [ATTACH]-ed databases.)^ +** with the connection - main, temp, and any [ATTACH]-ed databases.)^ ** ^The full amount of memory used by the schemas is reported, even if the ** schema memory is shared with other database connections due to ** [shared cache mode] being enabled. @@ -7300,13 +7300,13 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** ** [[SQLITE_DBSTATUS_CACHE_HIT]] ^(
    SQLITE_DBSTATUS_CACHE_HIT
    **
    This parameter returns the number of pager cache hits that have -** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT +** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT ** is always 0. **
    ** ** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(
    SQLITE_DBSTATUS_CACHE_MISS
    **
    This parameter returns the number of pager cache misses that have -** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS +** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS ** is always 0. **
    ** @@ -7354,7 +7354,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** statements. For example, if the number of table steps greatly exceeds ** the number of table searches or result rows, that would tend to indicate ** that the prepared statement is using a full table scan rather than -** an index. +** an index. ** ** ^(This interface is used to retrieve and reset counter values from ** a [prepared statement]. The first argument is the prepared statement @@ -7381,7 +7381,7 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** [[SQLITE_STMTSTATUS_FULLSCAN_STEP]]
    SQLITE_STMTSTATUS_FULLSCAN_STEP
    **
    ^This is the number of times that SQLite has stepped forward in ** a table as part of a full table scan. Large numbers for this counter -** may indicate opportunities for performance improvement through +** may indicate opportunities for performance improvement through ** careful use of indices.
    ** ** [[SQLITE_STMTSTATUS_SORT]]
    SQLITE_STMTSTATUS_SORT
    @@ -7399,7 +7399,7 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** [[SQLITE_STMTSTATUS_VM_STEP]]
    SQLITE_STMTSTATUS_VM_STEP
    **
    ^This is the number of virtual machine operations executed ** by the prepared statement if that number is less than or equal -** to 2147483647. The number of virtual machine operations can be +** to 2147483647. The number of virtual machine operations can be ** used as a proxy for the total work done by the prepared statement. ** If the number of virtual machine operations exceeds 2147483647 ** then the value returned by this statement status code is undefined. @@ -7445,15 +7445,15 @@ struct sqlite3_pcache_page { ** KEYWORDS: {page cache} ** ** ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE2], ...) interface can -** register an alternative page cache implementation by passing in an +** register an alternative page cache implementation by passing in an ** instance of the sqlite3_pcache_methods2 structure.)^ -** In many applications, most of the heap memory allocated by +** In many applications, most of the heap memory allocated by ** SQLite is used for the page cache. -** By implementing a +** By implementing a ** custom page cache using this API, an application can better control -** the amount of memory consumed by SQLite, the way in which -** that memory is allocated and released, and the policies used to -** determine exactly which parts of a database file are cached and for +** the amount of memory consumed by SQLite, the way in which +** that memory is allocated and released, and the policies used to +** determine exactly which parts of a database file are cached and for ** how long. ** ** The alternative page cache mechanism is an @@ -7466,19 +7466,19 @@ struct sqlite3_pcache_page { ** [sqlite3_config()] returns.)^ ** ** [[the xInit() page cache method]] -** ^(The xInit() method is called once for each effective +** ^(The xInit() method is called once for each effective ** call to [sqlite3_initialize()])^ ** (usually only once during the lifetime of the process). ^(The xInit() ** method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^ -** The intent of the xInit() method is to set up global data structures -** required by the custom page cache implementation. -** ^(If the xInit() method is NULL, then the +** The intent of the xInit() method is to set up global data structures +** required by the custom page cache implementation. +** ^(If the xInit() method is NULL, then the ** built-in default page cache is used instead of the application defined ** page cache.)^ ** ** [[the xShutdown() page cache method]] ** ^The xShutdown() method is called by [sqlite3_shutdown()]. -** It can be used to clean up +** It can be used to clean up ** any outstanding resources before process shutdown, if required. ** ^The xShutdown() method may be NULL. ** @@ -7497,7 +7497,7 @@ struct sqlite3_pcache_page { ** though this is not guaranteed. ^The ** first parameter, szPage, is the size in bytes of the pages that must ** be allocated by the cache. ^szPage will always a power of two. ^The -** second parameter szExtra is a number of bytes of extra storage +** second parameter szExtra is a number of bytes of extra storage ** associated with each page cache entry. ^The szExtra parameter will ** a number less than 250. SQLite will use the ** extra szExtra bytes on each page to store metadata about the underlying @@ -7510,7 +7510,7 @@ struct sqlite3_pcache_page { ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will ** never invoke xUnpin() except to deliberately delete a page. ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to -** false will always have the "discard" flag set to true. +** false will always have the "discard" flag set to true. ** ^Hence, a cache created with bPurgeable false will ** never contain any unpinned pages. ** @@ -7525,12 +7525,12 @@ struct sqlite3_pcache_page { ** [[the xPagecount() page cache methods]] ** The xPagecount() method must return the number of pages currently ** stored in the cache, both pinned and unpinned. -** +** ** [[the xFetch() page cache methods]] -** The xFetch() method locates a page in the cache and returns a pointer to +** The xFetch() method locates a page in the cache and returns a pointer to ** an sqlite3_pcache_page object associated with that page, or a NULL pointer. ** The pBuf element of the returned sqlite3_pcache_page object will be a -** pointer to a buffer of szPage bytes used to store the content of a +** pointer to a buffer of szPage bytes used to store the content of a ** single database page. The pExtra element of sqlite3_pcache_page will be ** a pointer to the szExtra bytes of extra storage that SQLite has requested ** for each entry in the page cache. @@ -7569,8 +7569,8 @@ struct sqlite3_pcache_page { ** page cache implementation. ^The page cache implementation ** may choose to evict unpinned pages at any time. ** -** The cache must not perform any reference counting. A single -** call to xUnpin() unpins the page regardless of the number of prior calls +** The cache must not perform any reference counting. A single +** call to xUnpin() unpins the page regardless of the number of prior calls ** to xFetch(). ** ** [[the xRekey() page cache methods]] @@ -7610,7 +7610,7 @@ struct sqlite3_pcache_methods2 { int (*xPagecount)(sqlite3_pcache*); sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); - void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, + void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, unsigned oldKey, unsigned newKey); void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); void (*xDestroy)(sqlite3_pcache*); @@ -7655,7 +7655,7 @@ typedef struct sqlite3_backup sqlite3_backup; ** ** The backup API copies the content of one database into another. ** It is useful either for creating backups of databases or -** for copying in-memory databases to or from persistent files. +** for copying in-memory databases to or from persistent files. ** ** See Also: [Using the SQLite Online Backup API] ** @@ -7666,36 +7666,36 @@ typedef struct sqlite3_backup sqlite3_backup; ** ^Thus, the backup may be performed on a live source database without ** preventing other database connections from ** reading or writing to the source database while the backup is underway. -** -** ^(To perform a backup operation: +** +** ^(To perform a backup operation: **
      **
    1. sqlite3_backup_init() is called once to initialize the -** backup, -**
    2. sqlite3_backup_step() is called one or more times to transfer +** backup, +**
    3. sqlite3_backup_step() is called one or more times to transfer ** the data between the two databases, and finally -**
    4. sqlite3_backup_finish() is called to release all resources -** associated with the backup operation. +**
    5. sqlite3_backup_finish() is called to release all resources +** associated with the backup operation. **
    )^ ** There should be exactly one call to sqlite3_backup_finish() for each ** successful call to sqlite3_backup_init(). ** ** [[sqlite3_backup_init()]] sqlite3_backup_init() ** -** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the -** [database connection] associated with the destination database +** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the +** [database connection] associated with the destination database ** and the database name, respectively. ** ^The database name is "main" for the main database, "temp" for the ** temporary database, or the name specified after the AS keyword in ** an [ATTACH] statement for an attached database. -** ^The S and M arguments passed to +** ^The S and M arguments passed to ** sqlite3_backup_init(D,N,S,M) identify the [database connection] ** and database name of the source database, respectively. ** ^The source and destination [database connections] (parameters S and D) ** must be different or else sqlite3_backup_init(D,N,S,M) will fail with ** an error. ** -** ^A call to sqlite3_backup_init() will fail, returning NULL, if -** there is already a read or read-write transaction open on the +** ^A call to sqlite3_backup_init() will fail, returning NULL, if +** there is already a read or read-write transaction open on the ** destination database. ** ** ^If an error occurs within sqlite3_backup_init(D,N,S,M), then NULL is @@ -7707,14 +7707,14 @@ typedef struct sqlite3_backup sqlite3_backup; ** ^A successful call to sqlite3_backup_init() returns a pointer to an ** [sqlite3_backup] object. ** ^The [sqlite3_backup] object may be used with the sqlite3_backup_step() and -** sqlite3_backup_finish() functions to perform the specified backup +** sqlite3_backup_finish() functions to perform the specified backup ** operation. ** ** [[sqlite3_backup_step()]] sqlite3_backup_step() ** -** ^Function sqlite3_backup_step(B,N) will copy up to N pages between +** ^Function sqlite3_backup_step(B,N) will copy up to N pages between ** the source and destination databases specified by [sqlite3_backup] object B. -** ^If N is negative, all remaining source pages are copied. +** ^If N is negative, all remaining source pages are copied. ** ^If sqlite3_backup_step(B,N) successfully copies N pages and there ** are still more pages to be copied, then the function returns [SQLITE_OK]. ** ^If sqlite3_backup_step(B,N) successfully finishes copying all pages @@ -7736,8 +7736,8 @@ typedef struct sqlite3_backup sqlite3_backup; ** ** ^If sqlite3_backup_step() cannot obtain a required file-system lock, then ** the [sqlite3_busy_handler | busy-handler function] -** is invoked (if one is specified). ^If the -** busy-handler returns non-zero before the lock is available, then +** is invoked (if one is specified). ^If the +** busy-handler returns non-zero before the lock is available, then ** [SQLITE_BUSY] is returned to the caller. ^In this case the call to ** sqlite3_backup_step() can be retried later. ^If the source ** [database connection] @@ -7745,15 +7745,15 @@ typedef struct sqlite3_backup sqlite3_backup; ** is called, then [SQLITE_LOCKED] is returned immediately. ^Again, in this ** case the call to sqlite3_backup_step() can be retried later on. ^(If ** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX], [SQLITE_NOMEM], or -** [SQLITE_READONLY] is returned, then -** there is no point in retrying the call to sqlite3_backup_step(). These -** errors are considered fatal.)^ The application must accept -** that the backup operation has failed and pass the backup operation handle +** [SQLITE_READONLY] is returned, then +** there is no point in retrying the call to sqlite3_backup_step(). These +** errors are considered fatal.)^ The application must accept +** that the backup operation has failed and pass the backup operation handle ** to the sqlite3_backup_finish() to release associated resources. ** ** ^The first call to sqlite3_backup_step() obtains an exclusive lock -** on the destination file. ^The exclusive lock is not released until either -** sqlite3_backup_finish() is called or the backup operation is complete +** on the destination file. ^The exclusive lock is not released until either +** sqlite3_backup_finish() is called or the backup operation is complete ** and sqlite3_backup_step() returns [SQLITE_DONE]. ^Every call to ** sqlite3_backup_step() obtains a [shared lock] on the source database that ** lasts for the duration of the sqlite3_backup_step() call. @@ -7762,18 +7762,18 @@ typedef struct sqlite3_backup sqlite3_backup; ** through the backup process. ^If the source database is modified by an ** external process or via a database connection other than the one being ** used by the backup operation, then the backup will be automatically -** restarted by the next call to sqlite3_backup_step(). ^If the source +** restarted by the next call to sqlite3_backup_step(). ^If the source ** database is modified by the using the same database connection as is used ** by the backup operation, then the backup database is automatically ** updated at the same time. ** ** [[sqlite3_backup_finish()]] sqlite3_backup_finish() ** -** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the +** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the ** application wishes to abandon the backup operation, the application ** should destroy the [sqlite3_backup] by passing it to sqlite3_backup_finish(). ** ^The sqlite3_backup_finish() interfaces releases all -** resources associated with the [sqlite3_backup] object. +** resources associated with the [sqlite3_backup] object. ** ^If sqlite3_backup_step() has not yet returned [SQLITE_DONE], then any ** active write-transaction on the destination database is rolled back. ** The [sqlite3_backup] object is invalid @@ -7813,8 +7813,8 @@ typedef struct sqlite3_backup sqlite3_backup; ** connections, then the source database connection may be used concurrently ** from within other threads. ** -** However, the application must guarantee that the destination -** [database connection] is not passed to any other API (by any thread) after +** However, the application must guarantee that the destination +** [database connection] is not passed to any other API (by any thread) after ** sqlite3_backup_init() is called and before the corresponding call to ** sqlite3_backup_finish(). SQLite does not currently check to see ** if the application incorrectly accesses the destination [database connection] @@ -7825,11 +7825,11 @@ typedef struct sqlite3_backup sqlite3_backup; ** If running in [shared cache mode], the application must ** guarantee that the shared cache used by the destination database ** is not accessed while the backup is running. In practice this means -** that the application must guarantee that the disk file being +** that the application must guarantee that the disk file being ** backed up to is not accessed by any connection within the process, ** not just the specific connection that was passed to sqlite3_backup_init(). ** -** The [sqlite3_backup] object itself is partially threadsafe. Multiple +** The [sqlite3_backup] object itself is partially threadsafe. Multiple ** threads may safely make multiple concurrent calls to sqlite3_backup_step(). ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() ** APIs are not strictly speaking threadsafe. If they are invoked at the @@ -7854,8 +7854,8 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** ^When running in shared-cache mode, a database operation may fail with ** an [SQLITE_LOCKED] error if the required locks on the shared-cache or ** individual tables within the shared-cache cannot be obtained. See -** [SQLite Shared-Cache Mode] for a description of shared-cache locking. -** ^This API may be used to register a callback that SQLite will invoke +** [SQLite Shared-Cache Mode] for a description of shared-cache locking. +** ^This API may be used to register a callback that SQLite will invoke ** when the connection currently holding the required lock relinquishes it. ** ^This API is only available if the library was compiled with the ** [SQLITE_ENABLE_UNLOCK_NOTIFY] C-preprocessor symbol defined. @@ -7863,14 +7863,14 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** See Also: [Using the SQLite Unlock Notification Feature]. ** ** ^Shared-cache locks are released when a database connection concludes -** its current transaction, either by committing it or rolling it back. +** its current transaction, either by committing it or rolling it back. ** ** ^When a connection (known as the blocked connection) fails to obtain a ** shared-cache lock and SQLITE_LOCKED is returned to the caller, the ** identity of the database connection (the blocking connection) that -** has locked the required resource is stored internally. ^After an +** has locked the required resource is stored internally. ^After an ** application receives an SQLITE_LOCKED error, it may call the -** sqlite3_unlock_notify() method with the blocked connection handle as +** sqlite3_unlock_notify() method with the blocked connection handle as ** the first argument to register for a callback that will be invoked ** when the blocking connections current transaction is concluded. ^The ** callback is invoked from within the [sqlite3_step] or [sqlite3_close] @@ -7884,15 +7884,15 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** ** ^If the blocked connection is attempting to obtain a write-lock on a ** shared-cache table, and more than one other connection currently holds -** a read-lock on the same table, then SQLite arbitrarily selects one of +** a read-lock on the same table, then SQLite arbitrarily selects one of ** the other connections to use as the blocking connection. ** -** ^(There may be at most one unlock-notify callback registered by a +** ^(There may be at most one unlock-notify callback registered by a ** blocked connection. If sqlite3_unlock_notify() is called when the ** blocked connection already has a registered unlock-notify callback, ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is ** called with a NULL pointer as its second argument, then any existing -** unlock-notify callback is canceled. ^The blocked connections +** unlock-notify callback is canceled. ^The blocked connections ** unlock-notify callback may also be canceled by closing the blocked ** connection using [sqlite3_close()]. ** @@ -7905,7 +7905,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** ** Callback Invocation Details ** -** When an unlock-notify callback is registered, the application provides a +** When an unlock-notify callback is registered, the application provides a ** single void* pointer that is passed to the callback when it is invoked. ** However, the signature of the callback function allows SQLite to pass ** it an array of void* context pointers. The first argument passed to @@ -7918,12 +7918,12 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** same callback function, then instead of invoking the callback function ** multiple times, it is invoked once with the set of void* context pointers ** specified by the blocked connections bundled together into an array. -** This gives the application an opportunity to prioritize any actions +** This gives the application an opportunity to prioritize any actions ** related to the set of unblocked database connections. ** ** Deadlock Detection ** -** Assuming that after registering for an unlock-notify callback a +** Assuming that after registering for an unlock-notify callback a ** database waits for the callback to be issued before taking any further ** action (a reasonable assumption), then using this API may cause the ** application to deadlock. For example, if connection X is waiting for @@ -7946,7 +7946,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** ** The "DROP TABLE" Exception ** -** When a call to [sqlite3_step()] returns SQLITE_LOCKED, it is almost +** When a call to [sqlite3_step()] returns SQLITE_LOCKED, it is almost ** always appropriate to call sqlite3_unlock_notify(). There is however, ** one exception. When executing a "DROP TABLE" or "DROP INDEX" statement, ** SQLite checks if there are any currently executing SELECT statements @@ -7959,7 +7959,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** One way around this problem is to check the extended error code returned ** by an sqlite3_step() call. ^(If there is a blocking connection, then the ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in -** the special "DROP TABLE/INDEX" case, the extended error code is just +** the special "DROP TABLE/INDEX" case, the extended error code is just ** SQLITE_LOCKED.)^ */ SQLITE_API int sqlite3_unlock_notify( @@ -8073,8 +8073,8 @@ SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); ** ^The [sqlite3_wal_hook()] function is used to register a callback that ** is invoked each time data is committed to a database in wal mode. ** -** ^(The callback is invoked by SQLite after the commit has taken place and -** the associated write-lock on the database released)^, so the implementation +** ^(The callback is invoked by SQLite after the commit has taken place and +** the associated write-lock on the database released)^, so the implementation ** may read, write or [checkpoint] the database as required. ** ** ^The first parameter passed to the callback function when it is invoked @@ -8093,7 +8093,7 @@ SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); ** that does not correspond to any valid SQLite error code, the results ** are undefined. ** -** A single database handle may have at most a single write-ahead log callback +** A single database handle may have at most a single write-ahead log callback ** registered at one time. ^Calling [sqlite3_wal_hook()] replaces any ** previously registered write-ahead log callback. ^Note that the ** [sqlite3_wal_autocheckpoint()] interface and the @@ -8101,7 +8101,7 @@ SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); ** overwrite any prior [sqlite3_wal_hook()] settings. */ SQLITE_API void *sqlite3_wal_hook( - sqlite3*, + sqlite3*, int(*)(void *,sqlite3*,const char*,int), void* ); @@ -8114,7 +8114,7 @@ SQLITE_API void *sqlite3_wal_hook( ** [sqlite3_wal_hook()] that causes any database on [database connection] D ** to automatically [checkpoint] ** after committing a transaction if there are N or -** more frames in the [write-ahead log] file. ^Passing zero or +** more frames in the [write-ahead log] file. ^Passing zero or ** a negative value as the nFrame parameter disables automatic ** checkpoints entirely. ** @@ -8144,7 +8144,7 @@ SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N); ** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to ** [sqlite3_wal_checkpoint_v2](D,X,[SQLITE_CHECKPOINT_PASSIVE],0,0).)^ ** -** In brief, sqlite3_wal_checkpoint(D,X) causes the content in the +** In brief, sqlite3_wal_checkpoint(D,X) causes the content in the ** [write-ahead log] for database X on [database connection] D to be ** transferred into the database file and for the write-ahead log to ** be reset. See the [checkpointing] documentation for addition @@ -8170,10 +8170,10 @@ SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); ** **
    **
    SQLITE_CHECKPOINT_PASSIVE
    -** ^Checkpoint as many frames as possible without waiting for any database -** readers or writers to finish, then sync the database file if all frames +** ^Checkpoint as many frames as possible without waiting for any database +** readers or writers to finish, then sync the database file if all frames ** in the log were checkpointed. ^The [busy-handler callback] -** is never invoked in the SQLITE_CHECKPOINT_PASSIVE mode. +** is never invoked in the SQLITE_CHECKPOINT_PASSIVE mode. ** ^On the other hand, passive mode might leave the checkpoint unfinished ** if there are concurrent readers or writers. ** @@ -8187,9 +8187,9 @@ SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); ** **
    SQLITE_CHECKPOINT_RESTART
    ** ^This mode works the same way as SQLITE_CHECKPOINT_FULL with the addition -** that after checkpointing the log file it blocks (calls the +** that after checkpointing the log file it blocks (calls the ** [busy-handler callback]) -** until all readers are reading from the database file only. ^This ensures +** until all readers are reading from the database file only. ^This ensures ** that the next writer will restart the log file from the beginning. ** ^Like SQLITE_CHECKPOINT_FULL, this mode blocks new ** database writer attempts while it is pending, but does not impede readers. @@ -8211,31 +8211,31 @@ SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); ** truncated to zero bytes and so both *pnLog and *pnCkpt will be set to zero. ** ** ^All calls obtain an exclusive "checkpoint" lock on the database file. ^If -** any other process is running a checkpoint operation at the same time, the -** lock cannot be obtained and SQLITE_BUSY is returned. ^Even if there is a +** any other process is running a checkpoint operation at the same time, the +** lock cannot be obtained and SQLITE_BUSY is returned. ^Even if there is a ** busy-handler configured, it will not be invoked in this case. ** -** ^The SQLITE_CHECKPOINT_FULL, RESTART and TRUNCATE modes also obtain the +** ^The SQLITE_CHECKPOINT_FULL, RESTART and TRUNCATE modes also obtain the ** exclusive "writer" lock on the database file. ^If the writer lock cannot be ** obtained immediately, and a busy-handler is configured, it is invoked and ** the writer lock retried until either the busy-handler returns 0 or the lock ** is successfully obtained. ^The busy-handler is also invoked while waiting for ** database readers as described above. ^If the busy-handler returns 0 before ** the writer lock is obtained or while waiting for database readers, the -** checkpoint operation proceeds from that point in the same way as -** SQLITE_CHECKPOINT_PASSIVE - checkpointing as many frames as possible +** checkpoint operation proceeds from that point in the same way as +** SQLITE_CHECKPOINT_PASSIVE - checkpointing as many frames as possible ** without blocking any further. ^SQLITE_BUSY is returned in this case. ** ** ^If parameter zDb is NULL or points to a zero length string, then the -** specified operation is attempted on all WAL databases [attached] to +** specified operation is attempted on all WAL databases [attached] to ** [database connection] db. In this case the -** values written to output parameters *pnLog and *pnCkpt are undefined. ^If -** an SQLITE_BUSY error is encountered when processing one or more of the -** attached WAL databases, the operation is still attempted on any remaining -** attached databases and SQLITE_BUSY is returned at the end. ^If any other -** error occurs while processing an attached database, processing is abandoned -** and the error code is returned to the caller immediately. ^If no error -** (SQLITE_BUSY or otherwise) is encountered while processing the attached +** values written to output parameters *pnLog and *pnCkpt are undefined. ^If +** an SQLITE_BUSY error is encountered when processing one or more of the +** attached WAL databases, the operation is still attempted on any remaining +** attached databases and SQLITE_BUSY is returned at the end. ^If any other +** error occurs while processing an attached database, processing is abandoned +** and the error code is returned to the caller immediately. ^If no error +** (SQLITE_BUSY or otherwise) is encountered while processing the attached ** databases, SQLITE_OK is returned. ** ** ^If database zDb is the name of an attached database that is not in WAL @@ -8311,20 +8311,20 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** If X is non-zero, then the virtual table implementation guarantees ** that if [xUpdate] returns [SQLITE_CONSTRAINT], it will do so before ** any modifications to internal or persistent data structures have been made. -** If the [ON CONFLICT] mode is ABORT, FAIL, IGNORE or ROLLBACK, SQLite +** If the [ON CONFLICT] mode is ABORT, FAIL, IGNORE or ROLLBACK, SQLite ** is able to roll back a statement or database transaction, and abandon -** or continue processing the current SQL statement as appropriate. +** or continue processing the current SQL statement as appropriate. ** If the ON CONFLICT mode is REPLACE and the [xUpdate] method returns ** [SQLITE_CONSTRAINT], SQLite handles this as if the ON CONFLICT mode ** had been ABORT. ** ** Virtual table implementations that are required to handle OR REPLACE -** must do so within the [xUpdate] method. If a call to the -** [sqlite3_vtab_on_conflict()] function indicates that the current ON -** CONFLICT policy is REPLACE, the virtual table implementation should +** must do so within the [xUpdate] method. If a call to the +** [sqlite3_vtab_on_conflict()] function indicates that the current ON +** CONFLICT policy is REPLACE, the virtual table implementation should ** silently replace the appropriate rows within the xUpdate callback and ** return SQLITE_OK. Or, if this is not possible, it may return -** SQLITE_CONSTRAINT, in which case SQLite falls back to OR ABORT +** SQLITE_CONSTRAINT, in which case SQLite falls back to OR ABORT ** constraint handling. **
    */ @@ -8450,7 +8450,7 @@ SQLITE_API int sqlite3_stmt_scanstatus( int idx, /* Index of loop to report on */ int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ void *pOut /* Result written here */ -); +); /* ** CAPI3REF: Zero Scan-Status Counters @@ -8468,15 +8468,15 @@ SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); ** ** ^If a write-transaction is open on [database connection] D when the ** [sqlite3_db_cacheflush(D)] interface invoked, any dirty -** pages in the pager-cache that are not currently in use are written out +** pages in the pager-cache that are not currently in use are written out ** to disk. A dirty page may be in use if a database cursor created by an ** active SQL statement is reading from it, or if it is page 1 of a database ** file (page 1 is always "in use"). ^The [sqlite3_db_cacheflush(D)] ** interface flushes caches for all schemas - "main", "temp", and ** any [attached] databases. ** -** ^If this function needs to obtain extra database locks before dirty pages -** can be flushed to disk, it does so. ^If those locks cannot be obtained +** ^If this function needs to obtain extra database locks before dirty pages +** can be flushed to disk, it does so. ^If those locks cannot be obtained ** immediately and there is a busy-handler callback configured, it is invoked ** in the usual manner. ^If the required lock still cannot be obtained, then ** the database is skipped and an attempt made to flush any dirty pages @@ -8523,16 +8523,16 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); ** kind of update operation that is about to occur. ** ^(The fourth parameter to the preupdate callback is the name of the ** database within the database connection that is being modified. This -** will be "main" for the main database or "temp" for TEMP tables or +** will be "main" for the main database or "temp" for TEMP tables or ** the name given after the AS keyword in the [ATTACH] statement for attached ** databases.)^ ** ^The fifth parameter to the preupdate callback is the name of the ** table that is being modified. ** ** For an UPDATE or DELETE operation on a [rowid table], the sixth -** parameter passed to the preupdate callback is the initial [rowid] of the +** parameter passed to the preupdate callback is the initial [rowid] of the ** row being modified or deleted. For an INSERT operation on a rowid table, -** or any operation on a WITHOUT ROWID table, the value of the sixth +** or any operation on a WITHOUT ROWID table, the value of the sixth ** parameter is undefined. For an INSERT or UPDATE on a rowid table the ** seventh parameter is the final rowid value of the row being inserted ** or updated. The value of the seventh parameter passed to the callback @@ -8571,7 +8571,7 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); ** ** ^The [sqlite3_preupdate_depth(D)] interface returns 0 if the preupdate ** callback was invoked as a result of a direct insert, update, or delete -** operation; or 1 for inserts, updates, or deletes invoked by top-level +** operation; or 1 for inserts, updates, or deletes invoked by top-level ** triggers; or 2 for changes resulting from triggers called by top-level ** triggers; and so forth. ** @@ -8605,7 +8605,7 @@ SQLITE_API int sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); ** The return value is OS-dependent. For example, on unix systems, after ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be ** called to get back the underlying "errno" that caused the problem, such -** as ENOSPC, EAUTH, EISDIR, and so forth. +** as ENOSPC, EAUTH, EISDIR, and so forth. */ SQLITE_API int sqlite3_system_errno(sqlite3*); @@ -8632,7 +8632,7 @@ SQLITE_API int sqlite3_system_errno(sqlite3*); ** ** The constructor for this object is [sqlite3_snapshot_get()]. The ** [sqlite3_snapshot_open()] method causes a fresh read transaction to refer -** to an historical snapshot (if possible). The destructor for +** to an historical snapshot (if possible). The destructor for ** sqlite3_snapshot objects is [sqlite3_snapshot_free()]. */ typedef struct sqlite3_snapshot { @@ -8649,12 +8649,12 @@ typedef struct sqlite3_snapshot { ** [sqlite3_snapshot_get(D,S,P)] interface writes a pointer to the newly ** created [sqlite3_snapshot] object into *P and returns SQLITE_OK. ** If there is not already a read-transaction open on schema S when -** this function is called, one is opened automatically. +** this function is called, one is opened automatically. ** ** The following must be true for this function to succeed. If any of ** the following statements are false when sqlite3_snapshot_get() is ** called, SQLITE_ERROR is returned. The final value of *P is undefined -** in this case. +** in this case. ** **
      **
    • The database handle must be in [autocommit mode]. @@ -8666,13 +8666,13 @@ typedef struct sqlite3_snapshot { ** **
    • One or more transactions must have been written to the current wal ** file since it was created on disk (by any connection). This means -** that a snapshot cannot be taken on a wal mode database with no wal +** that a snapshot cannot be taken on a wal mode database with no wal ** file immediately after it is first opened. At least one transaction ** must be written to it first. **
    ** ** This function may also return SQLITE_NOMEM. If it is called with the -** database handle in autocommit mode but fails for some other reason, +** database handle in autocommit mode but fails for some other reason, ** whether or not a read transaction is opened on schema S is undefined. ** ** The [sqlite3_snapshot] object returned from a successful call to @@ -8712,7 +8712,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_get( ** database connection D does not know that the database file for ** schema S is in [WAL mode]. A database connection might not know ** that the database file is in [WAL mode] if there has been no prior -** I/O on that database connection, or if the database entered [WAL mode] +** I/O on that database connection, or if the database entered [WAL mode] ** after the most recent I/O on the database connection.)^ ** (Hint: Run "[PRAGMA application_id]" against a newly opened ** database connection in order to make it ready to use snapshots.) @@ -8744,17 +8744,17 @@ SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_snapshot_free(sqlite3_snapshot*); ** EXPERIMENTAL ** ** The sqlite3_snapshot_cmp(P1, P2) interface is used to compare the ages -** of two valid snapshot handles. +** of two valid snapshot handles. ** -** If the two snapshot handles are not associated with the same database -** file, the result of the comparison is undefined. +** If the two snapshot handles are not associated with the same database +** file, the result of the comparison is undefined. ** ** Additionally, the result of the comparison is only valid if both of the ** snapshot handles were obtained by calling sqlite3_snapshot_get() since the ** last time the wal file was deleted. The wal file is deleted when the ** database is changed back to rollback mode or when the number of database -** clients drops to zero. If either snapshot handle was obtained before the -** wal file was last deleted, the value returned by this function +** clients drops to zero. If either snapshot handle was obtained before the +** wal file was last deleted, the value returned by this function ** is undefined. ** ** Otherwise, this API returns a negative value if P1 refers to an older @@ -8862,7 +8862,7 @@ struct sqlite3_rtree_geometry { }; /* -** Register a 2nd-generation geometry callback named zScore that can be +** Register a 2nd-generation geometry callback named zScore that can be ** used as part of an R-Tree geometry query as follows: ** ** SELECT ... FROM WHERE MATCH $zQueryFunc(... params ...) @@ -8877,7 +8877,7 @@ SQLITE_API int sqlite3_rtree_query_callback( /* -** A pointer to a structure of the following type is passed as the +** A pointer to a structure of the following type is passed as the ** argument to scored geometry callback registered using ** sqlite3_rtree_query_callback(). ** @@ -8965,7 +8965,7 @@ typedef struct sqlite3_changeset_iter sqlite3_changeset_iter; ** is not possible for an application to register a pre-update hook on a ** database handle that has one or more session objects attached. Nor is ** it possible to create a session object attached to a database handle for -** which a pre-update hook is already defined. The results of attempting +** which a pre-update hook is already defined. The results of attempting ** either of these things are undefined. ** ** The session object will be used to create changesets for tables in @@ -8982,13 +8982,13 @@ SQLITE_API int sqlite3session_create( /* ** CAPI3REF: Delete A Session Object ** -** Delete a session object previously allocated using +** Delete a session object previously allocated using ** [sqlite3session_create()]. Once a session object has been deleted, the ** results of attempting to use pSession with any other session module ** function are undefined. ** ** Session objects must be deleted before the database handle to which they -** are attached is closed. Refer to the documentation for +** are attached is closed. Refer to the documentation for ** [sqlite3session_create()] for details. */ SQLITE_API void sqlite3session_delete(sqlite3_session *pSession); @@ -9005,10 +9005,10 @@ SQLITE_API void sqlite3session_delete(sqlite3_session *pSession); ** the eventual changesets. ** ** Passing zero to this function disables the session. Passing a value -** greater than zero enables it. Passing a value less than zero is a +** greater than zero enables it. Passing a value less than zero is a ** no-op, and may be used to query the current state of the session. ** -** The return value indicates the final state of the session object: 0 if +** The return value indicates the final state of the session object: 0 if ** the session is disabled, or 1 if it is enabled. */ SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable); @@ -9022,7 +9022,7 @@ SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable); **
      **
    • The session object "indirect" flag is set when the change is ** made, or -**
    • The change is made by an SQL trigger or foreign key action +**
    • The change is made by an SQL trigger or foreign key action ** instead of directly as a result of a users SQL statement. **
    ** @@ -9034,10 +9034,10 @@ SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable); ** flag. If the second argument passed to this function is zero, then the ** indirect flag is cleared. If it is greater than zero, the indirect flag ** is set. Passing a value less than zero does not modify the current value -** of the indirect flag, and may be used to query the current state of the +** of the indirect flag, and may be used to query the current state of the ** indirect flag for the specified session object. ** -** The return value indicates the final state of the indirect flag: 0 if +** The return value indicates the final state of the indirect flag: 0 if ** it is clear, or 1 if it is set. */ SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect); @@ -9046,20 +9046,20 @@ SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect) ** CAPI3REF: Attach A Table To A Session Object ** ** If argument zTab is not NULL, then it is the name of a table to attach -** to the session object passed as the first argument. All subsequent changes -** made to the table while the session object is enabled will be recorded. See +** to the session object passed as the first argument. All subsequent changes +** made to the table while the session object is enabled will be recorded. See ** documentation for [sqlite3session_changeset()] for further details. ** ** Or, if argument zTab is NULL, then changes are recorded for all tables -** in the database. If additional tables are added to the database (by -** executing "CREATE TABLE" statements) after this call is made, changes for +** in the database. If additional tables are added to the database (by +** executing "CREATE TABLE" statements) after this call is made, changes for ** the new tables are also recorded. ** ** Changes can only be recorded for tables that have a PRIMARY KEY explicitly -** defined as part of their CREATE TABLE statement. It does not matter if the +** defined as part of their CREATE TABLE statement. It does not matter if the ** PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias) or not. The PRIMARY ** KEY may consist of a single column, or may be a composite key. -** +** ** It is not an error if the named table does not exist in the database. Nor ** is it an error if the named table does not have a PRIMARY KEY. However, ** no changes will be recorded in either of these scenarios. @@ -9067,7 +9067,7 @@ SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect) ** Changes are not recorded for individual rows that have NULL values stored ** in one or more of their PRIMARY KEY columns. ** -** SQLITE_OK is returned if the call completes without error. Or, if an error +** SQLITE_OK is returned if the call completes without error. Or, if an error ** occurs, an SQLite error code (e.g. SQLITE_NOMEM) is returned. */ SQLITE_API int sqlite3session_attach( @@ -9078,10 +9078,10 @@ SQLITE_API int sqlite3session_attach( /* ** CAPI3REF: Set a table filter on a Session Object. ** -** The second argument (xFilter) is the "filter callback". For changes to rows +** The second argument (xFilter) is the "filter callback". For changes to rows ** in tables that are not attached to the Session object, the filter is called -** to determine whether changes to the table's rows should be tracked or not. -** If xFilter returns 0, changes is not tracked. Note that once a table is +** to determine whether changes to the table's rows should be tracked or not. +** If xFilter returns 0, changes is not tracked. Note that once a table is ** attached, xFilter will not be called again. */ SQLITE_API void sqlite3session_table_filter( @@ -9096,9 +9096,9 @@ SQLITE_API void sqlite3session_table_filter( /* ** CAPI3REF: Generate A Changeset From A Session Object ** -** Obtain a changeset containing changes to the tables attached to the -** session object passed as the first argument. If successful, -** set *ppChangeset to point to a buffer containing the changeset +** Obtain a changeset containing changes to the tables attached to the +** session object passed as the first argument. If successful, +** set *ppChangeset to point to a buffer containing the changeset ** and *pnChangeset to the size of the changeset in bytes before returning ** SQLITE_OK. If an error occurs, set both *ppChangeset and *pnChangeset to ** zero and return an SQLite error code. @@ -9113,7 +9113,7 @@ SQLITE_API void sqlite3session_table_filter( ** modifies the values of primary key columns. If such a change is made, it ** is represented in a changeset as a DELETE followed by an INSERT. ** -** Changes are not recorded for rows that have NULL values stored in one or +** Changes are not recorded for rows that have NULL values stored in one or ** more of their PRIMARY KEY columns. If such a row is inserted or deleted, ** no corresponding change is present in the changesets returned by this ** function. If an existing row with one or more NULL values stored in @@ -9166,14 +9166,14 @@ SQLITE_API void sqlite3session_table_filter( **
      **
    • For each record generated by an insert, the database is queried ** for a row with a matching primary key. If one is found, an INSERT -** change is added to the changeset. If no such row is found, no change +** change is added to the changeset. If no such row is found, no change ** is added to the changeset. ** -**
    • For each record generated by an update or delete, the database is +**
    • For each record generated by an update or delete, the database is ** queried for a row with a matching primary key. If such a row is ** found and one or more of the non-primary key fields have been -** modified from their original values, an UPDATE change is added to -** the changeset. Or, if no such row is found in the table, a DELETE +** modified from their original values, an UPDATE change is added to +** the changeset. Or, if no such row is found in the table, a DELETE ** change is added to the changeset. If there is a row with a matching ** primary key in the database, but all fields contain their original ** values, no change is added to the changeset. @@ -9181,7 +9181,7 @@ SQLITE_API void sqlite3session_table_filter( ** ** This means, amongst other things, that if a row is inserted and then later ** deleted while a session object is active, neither the insert nor the delete -** will be present in the changeset. Or if a row is deleted and then later a +** will be present in the changeset. Or if a row is deleted and then later a ** row with the same primary key values inserted while a session object is ** active, the resulting changeset will contain an UPDATE change instead of ** a DELETE and an INSERT. @@ -9190,10 +9190,10 @@ SQLITE_API void sqlite3session_table_filter( ** it does not accumulate records when rows are inserted, updated or deleted. ** This may appear to have some counter-intuitive effects if a single row ** is written to more than once during a session. For example, if a row -** is inserted while a session object is enabled, then later deleted while +** is inserted while a session object is enabled, then later deleted while ** the same session object is disabled, no INSERT record will appear in the ** changeset, even though the delete took place while the session was disabled. -** Or, if one field of a row is updated while a session is disabled, and +** Or, if one field of a row is updated while a session is disabled, and ** another field of the same row is updated while the session is enabled, the ** resulting changeset will contain an UPDATE change that updates both fields. */ @@ -9204,7 +9204,7 @@ SQLITE_API int sqlite3session_changeset( ); /* -** CAPI3REF: Load The Difference Between Tables Into A Session +** CAPI3REF: Load The Difference Between Tables Into A Session ** ** If it is not already attached to the session object passed as the first ** argument, this function attaches table zTbl in the same manner as the @@ -9213,7 +9213,7 @@ SQLITE_API int sqlite3session_changeset( ** an error). ** ** Argument zFromDb must be the name of a database ("main", "temp" etc.) -** attached to the same database handle as the session object that contains +** attached to the same database handle as the session object that contains ** a table compatible with the table attached to the session by this function. ** A table is considered compatible if it: ** @@ -9229,25 +9229,25 @@ SQLITE_API int sqlite3session_changeset( ** APIs, tables without PRIMARY KEYs are simply ignored. ** ** This function adds a set of changes to the session object that could be -** used to update the table in database zFrom (call this the "from-table") -** so that its content is the same as the table attached to the session +** used to update the table in database zFrom (call this the "from-table") +** so that its content is the same as the table attached to the session ** object (call this the "to-table"). Specifically: ** **
        -**
      • For each row (primary key) that exists in the to-table but not in +**
      • For each row (primary key) that exists in the to-table but not in ** the from-table, an INSERT record is added to the session object. ** -**
      • For each row (primary key) that exists in the to-table but not in +**
      • For each row (primary key) that exists in the to-table but not in ** the from-table, a DELETE record is added to the session object. ** -**
      • For each row (primary key) that exists in both tables, but features +**
      • For each row (primary key) that exists in both tables, but features ** different non-PK values in each, an UPDATE record is added to the -** session. +** session. **
      ** ** To clarify, if this function is called and then a changeset constructed -** using [sqlite3session_changeset()], then after applying that changeset to -** database zFrom the contents of the two compatible tables would be +** using [sqlite3session_changeset()], then after applying that changeset to +** database zFrom the contents of the two compatible tables would be ** identical. ** ** It an error if database zFrom does not exist or does not contain the @@ -9255,7 +9255,7 @@ SQLITE_API int sqlite3session_changeset( ** ** If the operation successful, SQLITE_OK is returned. Otherwise, an SQLite ** error code. In this case, if argument pzErrMsg is not NULL, *pzErrMsg -** may be set to point to a buffer containing an English language error +** may be set to point to a buffer containing an English language error ** message. It is the responsibility of the caller to free this buffer using ** sqlite3_free(). */ @@ -9273,19 +9273,19 @@ SQLITE_API int sqlite3session_diff( ** The differences between a patchset and a changeset are that: ** **
        -**
      • DELETE records consist of the primary key fields only. The +**
      • DELETE records consist of the primary key fields only. The ** original values of other fields are omitted. -**
      • The original values of any modified fields are omitted from +**
      • The original values of any modified fields are omitted from ** UPDATE records. **
      ** -** A patchset blob may be used with up to date versions of all -** sqlite3changeset_xxx API functions except for sqlite3changeset_invert(), +** A patchset blob may be used with up to date versions of all +** sqlite3changeset_xxx API functions except for sqlite3changeset_invert(), ** which returns SQLITE_CORRUPT if it is passed a patchset. Similarly, ** attempting to use a patchset blob with old versions of the -** sqlite3changeset_xxx APIs also provokes an SQLITE_CORRUPT error. +** sqlite3changeset_xxx APIs also provokes an SQLITE_CORRUPT error. ** -** Because the non-primary key "old.*" fields are omitted, no +** Because the non-primary key "old.*" fields are omitted, no ** SQLITE_CHANGESET_DATA conflicts can be detected or reported if a patchset ** is passed to the sqlite3changeset_apply() API. Other conflict types work ** in the same way as for changesets. @@ -9304,29 +9304,29 @@ SQLITE_API int sqlite3session_patchset( /* ** CAPI3REF: Test if a changeset has recorded any changes. ** -** Return non-zero if no changes to attached tables have been recorded by -** the session object passed as the first argument. Otherwise, if one or +** Return non-zero if no changes to attached tables have been recorded by +** the session object passed as the first argument. Otherwise, if one or ** more changes have been recorded, return zero. ** ** Even if this function returns zero, it is possible that calling ** [sqlite3session_changeset()] on the session handle may still return a -** changeset that contains no changes. This can happen when a row in -** an attached table is modified and then later on the original values +** changeset that contains no changes. This can happen when a row in +** an attached table is modified and then later on the original values ** are restored. However, if this function returns non-zero, then it is -** guaranteed that a call to sqlite3session_changeset() will return a +** guaranteed that a call to sqlite3session_changeset() will return a ** changeset containing zero changes. */ SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession); /* -** CAPI3REF: Create An Iterator To Traverse A Changeset +** CAPI3REF: Create An Iterator To Traverse A Changeset ** ** Create an iterator used to iterate through the contents of a changeset. ** If successful, *pp is set to point to the iterator handle and SQLITE_OK ** is returned. Otherwise, if an error occurs, *pp is set to zero and an ** SQLite error code is returned. ** -** The following functions can be used to advance and query a changeset +** The following functions can be used to advance and query a changeset ** iterator created by this function: ** **
        @@ -9343,12 +9343,12 @@ SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession); ** ** Assuming the changeset blob was created by one of the ** [sqlite3session_changeset()], [sqlite3changeset_concat()] or -** [sqlite3changeset_invert()] functions, all changes within the changeset -** that apply to a single table are grouped together. This means that when -** an application iterates through a changeset using an iterator created by -** this function, all changes that relate to a single table are visited -** consecutively. There is no chance that the iterator will visit a change -** the applies to table X, then one for table Y, and then later on visit +** [sqlite3changeset_invert()] functions, all changes within the changeset +** that apply to a single table are grouped together. This means that when +** an application iterates through a changeset using an iterator created by +** this function, all changes that relate to a single table are visited +** consecutively. There is no chance that the iterator will visit a change +** the applies to table X, then one for table Y, and then later on visit ** another change for table X. */ SQLITE_API int sqlite3changeset_start( @@ -9372,12 +9372,12 @@ SQLITE_API int sqlite3changeset_start( ** point to the first change in the changeset. Each subsequent call advances ** the iterator to point to the next change in the changeset (if any). If ** no error occurs and the iterator points to a valid change after a call -** to sqlite3changeset_next() has advanced it, SQLITE_ROW is returned. +** to sqlite3changeset_next() has advanced it, SQLITE_ROW is returned. ** Otherwise, if all changes in the changeset have already been visited, ** SQLITE_DONE is returned. ** -** If an error occurs, an SQLite error code is returned. Possible error -** codes include SQLITE_CORRUPT (if the changeset buffer is corrupt) or +** If an error occurs, an SQLite error code is returned. Possible error +** codes include SQLITE_CORRUPT (if the changeset buffer is corrupt) or ** SQLITE_NOMEM. */ SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *pIter); @@ -9394,14 +9394,14 @@ SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *pIter); ** If argument pzTab is not NULL, then *pzTab is set to point to a ** nul-terminated utf-8 encoded string containing the name of the table ** affected by the current change. The buffer remains valid until either -** sqlite3changeset_next() is called on the iterator or until the -** conflict-handler function returns. If pnCol is not NULL, then *pnCol is +** sqlite3changeset_next() is called on the iterator or until the +** conflict-handler function returns. If pnCol is not NULL, then *pnCol is ** set to the number of columns in the table affected by the change. If ** pbIncorrect is not NULL, then *pbIndirect is set to true (1) if the change ** is an indirect change, or false (0) otherwise. See the documentation for ** [sqlite3session_indirect()] for a description of direct and indirect -** changes. Finally, if pOp is not NULL, then *pOp is set to one of -** [SQLITE_INSERT], [SQLITE_DELETE] or [SQLITE_UPDATE], depending on the +** changes. Finally, if pOp is not NULL, then *pOp is set to one of +** [SQLITE_INSERT], [SQLITE_DELETE] or [SQLITE_UPDATE], depending on the ** type of change that the iterator currently points to. ** ** If no error occurs, SQLITE_OK is returned. If an error does occur, an @@ -9453,7 +9453,7 @@ SQLITE_API int sqlite3changeset_pk( ** The pIter argument passed to this function may either be an iterator ** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator ** created by [sqlite3changeset_start()]. In the latter case, the most recent -** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. +** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. ** Furthermore, it may only be called if the type of change that the iterator ** currently points to is either [SQLITE_DELETE] or [SQLITE_UPDATE]. Otherwise, ** this function returns [SQLITE_MISUSE] and sets *ppValue to NULL. @@ -9463,9 +9463,9 @@ SQLITE_API int sqlite3changeset_pk( ** [SQLITE_RANGE] is returned and *ppValue is set to NULL. ** ** If successful, this function sets *ppValue to point to a protected -** sqlite3_value object containing the iVal'th value from the vector of +** sqlite3_value object containing the iVal'th value from the vector of ** original row values stored as part of the UPDATE or DELETE change and -** returns SQLITE_OK. The name of the function comes from the fact that this +** returns SQLITE_OK. The name of the function comes from the fact that this ** is similar to the "old.*" columns available to update or delete triggers. ** ** If some other error occurs (e.g. an OOM condition), an SQLite error code @@ -9483,7 +9483,7 @@ SQLITE_API int sqlite3changeset_old( ** The pIter argument passed to this function may either be an iterator ** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator ** created by [sqlite3changeset_start()]. In the latter case, the most recent -** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. +** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. ** Furthermore, it may only be called if the type of change that the iterator ** currently points to is either [SQLITE_UPDATE] or [SQLITE_INSERT]. Otherwise, ** this function returns [SQLITE_MISUSE] and sets *ppValue to NULL. @@ -9493,12 +9493,12 @@ SQLITE_API int sqlite3changeset_old( ** [SQLITE_RANGE] is returned and *ppValue is set to NULL. ** ** If successful, this function sets *ppValue to point to a protected -** sqlite3_value object containing the iVal'th value from the vector of +** sqlite3_value object containing the iVal'th value from the vector of ** new row values stored as part of the UPDATE or INSERT change and ** returns SQLITE_OK. If the change is an UPDATE and does not include -** a new value for the requested column, *ppValue is set to NULL and -** SQLITE_OK returned. The name of the function comes from the fact that -** this is similar to the "new.*" columns available to update or delete +** a new value for the requested column, *ppValue is set to NULL and +** SQLITE_OK returned. The name of the function comes from the fact that +** this is similar to the "new.*" columns available to update or delete ** triggers. ** ** If some other error occurs (e.g. an OOM condition), an SQLite error code @@ -9524,7 +9524,7 @@ SQLITE_API int sqlite3changeset_new( ** [SQLITE_RANGE] is returned and *ppValue is set to NULL. ** ** If successful, this function sets *ppValue to point to a protected -** sqlite3_value object containing the iVal'th value from the +** sqlite3_value object containing the iVal'th value from the ** "conflicting row" associated with the current conflict-handler callback ** and returns SQLITE_OK. ** @@ -9566,7 +9566,7 @@ SQLITE_API int sqlite3changeset_fk_conflicts( ** call has no effect. ** ** If an error was encountered within a call to an sqlite3changeset_xxx() -** function (for example an [SQLITE_CORRUPT] in [sqlite3changeset_next()] or an +** function (for example an [SQLITE_CORRUPT] in [sqlite3changeset_next()] or an ** [SQLITE_NOMEM] in [sqlite3changeset_new()]) then an error code corresponding ** to that error is returned by this function. Otherwise, SQLITE_OK is ** returned. This is to allow the following pattern (pseudo-code): @@ -9577,7 +9577,7 @@ SQLITE_API int sqlite3changeset_fk_conflicts( ** } ** rc = sqlite3changeset_finalize(); ** if( rc!=SQLITE_OK ){ -** // An error has occurred +** // An error has occurred ** } */ SQLITE_API int sqlite3changeset_finalize(sqlite3_changeset_iter *pIter); @@ -9604,7 +9604,7 @@ SQLITE_API int sqlite3changeset_finalize(sqlite3_changeset_iter *pIter); ** zeroed and an SQLite error code returned. ** ** It is the responsibility of the caller to eventually call sqlite3_free() -** on the *ppOut pointer to free the buffer allocation following a successful +** on the *ppOut pointer to free the buffer allocation following a successful ** call to this function. ** ** WARNING/TODO: This function currently assumes that the input is a valid @@ -9618,11 +9618,11 @@ SQLITE_API int sqlite3changeset_invert( /* ** CAPI3REF: Concatenate Two Changeset Objects ** -** This function is used to concatenate two changesets, A and B, into a +** This function is used to concatenate two changesets, A and B, into a ** single changeset. The result is a changeset equivalent to applying -** changeset A followed by changeset B. +** changeset A followed by changeset B. ** -** This function combines the two input changesets using an +** This function combines the two input changesets using an ** sqlite3_changegroup object. Calling it produces similar results as the ** following code fragment: ** @@ -9664,7 +9664,7 @@ typedef struct sqlite3_changegroup sqlite3_changegroup; ** ** If successful, this function returns SQLITE_OK and populates (*pp) with ** a pointer to a new sqlite3_changegroup object before returning. The caller -** should eventually free the returned object using a call to +** should eventually free the returned object using a call to ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL. ** @@ -9676,7 +9676,7 @@ typedef struct sqlite3_changegroup sqlite3_changegroup; **
      • Zero or more changesets (or patchsets) are added to the object ** by calling sqlite3changegroup_add(). ** -**
      • The result of combining all input changesets together is obtained +**
      • The result of combining all input changesets together is obtained ** by the application via a call to sqlite3changegroup_output(). ** **
      • The object is deleted using a call to sqlite3changegroup_delete(). @@ -9685,7 +9685,7 @@ typedef struct sqlite3_changegroup sqlite3_changegroup; ** Any number of calls to add() and output() may be made between the calls to ** new() and delete(), and in any order. ** -** As well as the regular sqlite3changegroup_add() and +** As well as the regular sqlite3changegroup_add() and ** sqlite3changegroup_output() functions, also available are the streaming ** versions sqlite3changegroup_add_strm() and sqlite3changegroup_output_strm(). */ @@ -9695,7 +9695,7 @@ int sqlite3changegroup_new(sqlite3_changegroup **pp); ** CAPI3REF: Add A Changeset To A Changegroup ** ** Add all changes within the changeset (or patchset) in buffer pData (size -** nData bytes) to the changegroup. +** nData bytes) to the changegroup. ** ** If the buffer contains a patchset, then all prior calls to this function ** on the same changegroup object must also have specified patchsets. Or, if @@ -9722,7 +9722,7 @@ int sqlite3changegroup_new(sqlite3_changegroup **pp); ** changeset was recorded immediately after the changesets already ** added to the changegroup. ** INSERT UPDATE -** The INSERT change remains in the changegroup. The values in the +** The INSERT change remains in the changegroup. The values in the ** INSERT change are modified as if the row was inserted by the ** existing change and then updated according to the new change. ** INSERT DELETE @@ -9733,17 +9733,17 @@ int sqlite3changegroup_new(sqlite3_changegroup **pp); ** changeset was recorded immediately after the changesets already ** added to the changegroup. ** UPDATE UPDATE -** The existing UPDATE remains within the changegroup. It is amended -** so that the accompanying values are as if the row was updated once +** The existing UPDATE remains within the changegroup. It is amended +** so that the accompanying values are as if the row was updated once ** by the existing change and then again by the new change. ** UPDATE DELETE ** The existing UPDATE is replaced by the new DELETE within the ** changegroup. ** DELETE INSERT ** If one or more of the column values in the row inserted by the -** new change differ from those in the row deleted by the existing +** new change differ from those in the row deleted by the existing ** change, the existing DELETE is replaced by an UPDATE within the -** changegroup. Otherwise, if the inserted row is exactly the same +** changegroup. Otherwise, if the inserted row is exactly the same ** as the deleted row, the existing DELETE is simply discarded. ** DELETE UPDATE ** The new change is ignored. This case does not occur if the new @@ -9787,7 +9787,7 @@ int sqlite3changegroup_add(sqlite3_changegroup*, int nData, void *pData); ** ** If an error occurs, an SQLite error code is returned and the output ** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK -** is returned and the output variables are set to the size of and a +** is returned and the output variables are set to the size of and a ** pointer to the output buffer, respectively. In this case it is the ** responsibility of the caller to eventually free the buffer using a ** call to sqlite3_free(). @@ -9815,21 +9815,21 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** change in the changeset, the filter callback is invoked with ** the table name as the second argument, and a copy of the context pointer ** passed as the sixth argument to this function as the first. If the "filter -** callback" returns zero, then no attempt is made to apply any changes to +** callback" returns zero, then no attempt is made to apply any changes to ** the table. Otherwise, if the return value is non-zero or the xFilter ** argument to this function is NULL, all changes related to the table are ** attempted. ** -** For each table that is not excluded by the filter callback, this function -** tests that the target database contains a compatible table. A table is +** For each table that is not excluded by the filter callback, this function +** tests that the target database contains a compatible table. A table is ** considered compatible if all of the following are true: ** **
          -**
        • The table has the same name as the name recorded in the +**
        • The table has the same name as the name recorded in the ** changeset, and -**
        • The table has at least as many columns as recorded in the +**
        • The table has at least as many columns as recorded in the ** changeset, and -**
        • The table has primary key columns in the same position as +**
        • The table has primary key columns in the same position as ** recorded in the changeset. **
        ** @@ -9838,11 +9838,11 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** via the sqlite3_log() mechanism with the error code SQLITE_SCHEMA. At most ** one such warning is issued for each table in the changeset. ** -** For each change for which there is a compatible table, an attempt is made -** to modify the table contents according to the UPDATE, INSERT or DELETE -** change. If a change cannot be applied cleanly, the conflict handler -** function passed as the fifth argument to sqlite3changeset_apply() may be -** invoked. A description of exactly when the conflict handler is invoked for +** For each change for which there is a compatible table, an attempt is made +** to modify the table contents according to the UPDATE, INSERT or DELETE +** change. If a change cannot be applied cleanly, the conflict handler +** function passed as the fifth argument to sqlite3changeset_apply() may be +** invoked. A description of exactly when the conflict handler is invoked for ** each type of change is below. ** ** Unlike the xFilter argument, xConflict may not be passed NULL. The results @@ -9850,23 +9850,23 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** argument are undefined. ** ** Each time the conflict handler function is invoked, it must return one -** of [SQLITE_CHANGESET_OMIT], [SQLITE_CHANGESET_ABORT] or +** of [SQLITE_CHANGESET_OMIT], [SQLITE_CHANGESET_ABORT] or ** [SQLITE_CHANGESET_REPLACE]. SQLITE_CHANGESET_REPLACE may only be returned ** if the second argument passed to the conflict handler is either ** SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT. If the conflict-handler ** returns an illegal value, any changes already made are rolled back and -** the call to sqlite3changeset_apply() returns SQLITE_MISUSE. Different +** the call to sqlite3changeset_apply() returns SQLITE_MISUSE. Different ** actions are taken by sqlite3changeset_apply() depending on the value ** returned by each invocation of the conflict-handler function. Refer to -** the documentation for the three +** the documentation for the three ** [SQLITE_CHANGESET_OMIT|available return values] for details. ** **
        **
        DELETE Changes
        -** For each DELETE change, this function checks if the target database -** contains a row with the same primary key value (or values) as the -** original row values stored in the changeset. If it does, and the values -** stored in all non-primary key columns also match the values stored in +** For each DELETE change, this function checks if the target database +** contains a row with the same primary key value (or values) as the +** original row values stored in the changeset. If it does, and the values +** stored in all non-primary key columns also match the values stored in ** the changeset the row is deleted from the target database. ** ** If a row with matching primary key values is found, but one or more of @@ -9895,22 +9895,22 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** database table, the trailing fields are populated with their default ** values. ** -** If the attempt to insert the row fails because the database already +** If the attempt to insert the row fails because the database already ** contains a row with the same primary key values, the conflict handler -** function is invoked with the second argument set to +** function is invoked with the second argument set to ** [SQLITE_CHANGESET_CONFLICT]. ** ** If the attempt to insert the row fails because of some other constraint -** violation (e.g. NOT NULL or UNIQUE), the conflict handler function is +** violation (e.g. NOT NULL or UNIQUE), the conflict handler function is ** invoked with the second argument set to [SQLITE_CHANGESET_CONSTRAINT]. -** This includes the case where the INSERT operation is re-attempted because -** an earlier call to the conflict handler function returned +** This includes the case where the INSERT operation is re-attempted because +** an earlier call to the conflict handler function returned ** [SQLITE_CHANGESET_REPLACE]. ** **
        UPDATE Changes
        -** For each UPDATE change, this function checks if the target database -** contains a row with the same primary key value (or values) as the -** original row values stored in the changeset. If it does, and the values +** For each UPDATE change, this function checks if the target database +** contains a row with the same primary key value (or values) as the +** original row values stored in the changeset. If it does, and the values ** stored in all modified non-primary key columns also match the values ** stored in the changeset the row is updated within the target database. ** @@ -9926,12 +9926,12 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** the conflict-handler function is invoked with [SQLITE_CHANGESET_NOTFOUND] ** passed as the second argument. ** -** If the UPDATE operation is attempted, but SQLite returns -** SQLITE_CONSTRAINT, the conflict-handler function is invoked with +** If the UPDATE operation is attempted, but SQLite returns +** SQLITE_CONSTRAINT, the conflict-handler function is invoked with ** [SQLITE_CHANGESET_CONSTRAINT] passed as the second argument. -** This includes the case where the UPDATE operation is attempted after +** This includes the case where the UPDATE operation is attempted after ** an earlier call to the conflict handler function returned -** [SQLITE_CHANGESET_REPLACE]. +** [SQLITE_CHANGESET_REPLACE]. **
        ** ** It is safe to execute SQL statements, including those that write to the @@ -9942,7 +9942,7 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** All changes made by this function are enclosed in a savepoint transaction. ** If any other error (aside from a constraint failure when attempting to ** write to the target database) occurs, then the savepoint transaction is -** rolled back, restoring the target database to its original state, and an +** rolled back, restoring the target database to its original state, and an ** SQLite error code returned. */ SQLITE_API int sqlite3changeset_apply( @@ -9961,7 +9961,7 @@ SQLITE_API int sqlite3changeset_apply( void *pCtx /* First argument passed to xConflict */ ); -/* +/* ** CAPI3REF: Constants Passed To The Conflict Handler ** ** Values that may be passed as the second argument to a conflict-handler. @@ -9970,32 +9970,32 @@ SQLITE_API int sqlite3changeset_apply( **
        SQLITE_CHANGESET_DATA
        ** The conflict handler is invoked with CHANGESET_DATA as the second argument ** when processing a DELETE or UPDATE change if a row with the required -** PRIMARY KEY fields is present in the database, but one or more other -** (non primary-key) fields modified by the update do not contain the +** PRIMARY KEY fields is present in the database, but one or more other +** (non primary-key) fields modified by the update do not contain the ** expected "before" values. -** +** ** The conflicting row, in this case, is the database row with the matching ** primary key. -** +** **
        SQLITE_CHANGESET_NOTFOUND
        ** The conflict handler is invoked with CHANGESET_NOTFOUND as the second ** argument when processing a DELETE or UPDATE change if a row with the ** required PRIMARY KEY fields is not present in the database. -** +** ** There is no conflicting row in this case. The results of invoking the ** sqlite3changeset_conflict() API are undefined. -** +** **
        SQLITE_CHANGESET_CONFLICT
        ** CHANGESET_CONFLICT is passed as the second argument to the conflict -** handler while processing an INSERT change if the operation would result +** handler while processing an INSERT change if the operation would result ** in duplicate primary key values. -** +** ** The conflicting row in this case is the database row with the matching ** primary key. ** **
        SQLITE_CHANGESET_FOREIGN_KEY
        ** If foreign key handling is enabled, and applying a changeset leaves the -** database in a state containing foreign key violations, the conflict +** database in a state containing foreign key violations, the conflict ** handler is invoked with CHANGESET_FOREIGN_KEY as the second argument ** exactly once before the changeset is committed. If the conflict handler ** returns CHANGESET_OMIT, the changes, including those that caused the @@ -10005,12 +10005,12 @@ SQLITE_API int sqlite3changeset_apply( ** No current or conflicting row information is provided. The only function ** it is possible to call on the supplied sqlite3_changeset_iter handle ** is sqlite3changeset_fk_conflicts(). -** +** **
        SQLITE_CHANGESET_CONSTRAINT
        -** If any other constraint violation occurs while applying a change (i.e. -** a UNIQUE, CHECK or NOT NULL constraint), the conflict handler is +** If any other constraint violation occurs while applying a change (i.e. +** a UNIQUE, CHECK or NOT NULL constraint), the conflict handler is ** invoked with CHANGESET_CONSTRAINT as the second argument. -** +** ** There is no conflicting row in this case. The results of invoking the ** sqlite3changeset_conflict() API are undefined. ** @@ -10022,7 +10022,7 @@ SQLITE_API int sqlite3changeset_apply( #define SQLITE_CHANGESET_CONSTRAINT 4 #define SQLITE_CHANGESET_FOREIGN_KEY 5 -/* +/* ** CAPI3REF: Constants Returned By The Conflict Handler ** ** A conflict handler callback must return one of the following three values. @@ -10030,13 +10030,13 @@ SQLITE_API int sqlite3changeset_apply( **
        **
        SQLITE_CHANGESET_OMIT
        ** If a conflict handler returns this value no special action is taken. The -** change that caused the conflict is not applied. The session module +** change that caused the conflict is not applied. The session module ** continues to the next change in the changeset. ** **
        SQLITE_CHANGESET_REPLACE
        ** This value may only be returned if the second argument to the conflict ** handler was SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT. If this -** is not the case, any changes applied so far are rolled back and the +** is not the case, any changes applied so far are rolled back and the ** call to sqlite3changeset_apply() returns SQLITE_MISUSE. ** ** If CHANGESET_REPLACE is returned by an SQLITE_CHANGESET_DATA conflict @@ -10049,7 +10049,7 @@ SQLITE_API int sqlite3changeset_apply( ** the original row is restored to the database before continuing. ** **
        SQLITE_CHANGESET_ABORT
        -** If this value is returned, any changes applied so far are rolled back +** If this value is returned, any changes applied so far are rolled back ** and the call to sqlite3changeset_apply() returns SQLITE_ABORT. **
        */ @@ -10060,24 +10060,24 @@ SQLITE_API int sqlite3changeset_apply( /* ** CAPI3REF: Streaming Versions of API functions. ** -** The six streaming API xxx_strm() functions serve similar purposes to the +** The six streaming API xxx_strm() functions serve similar purposes to the ** corresponding non-streaming API functions: ** ** ** -**
        Streaming functionNon-streaming equivalent
        sqlite3changeset_apply_str[sqlite3changeset_apply] -**
        sqlite3changeset_concat_str[sqlite3changeset_concat] -**
        sqlite3changeset_invert_str[sqlite3changeset_invert] -**
        sqlite3changeset_start_str[sqlite3changeset_start] -**
        sqlite3session_changeset_str[sqlite3session_changeset] -**
        sqlite3session_patchset_str[sqlite3session_patchset] +**
        sqlite3changeset_apply_str[sqlite3changeset_apply] +**
        sqlite3changeset_concat_str[sqlite3changeset_concat] +**
        sqlite3changeset_invert_str[sqlite3changeset_invert] +**
        sqlite3changeset_start_str[sqlite3changeset_start] +**
        sqlite3session_changeset_str[sqlite3session_changeset] +**
        sqlite3session_patchset_str[sqlite3session_patchset] **
        ** ** Non-streaming functions that accept changesets (or patchsets) as input -** require that the entire changeset be stored in a single buffer in memory. -** Similarly, those that return a changeset or patchset do so by returning -** a pointer to a single large buffer allocated using sqlite3_malloc(). -** Normally this is convenient. However, if an application running in a +** require that the entire changeset be stored in a single buffer in memory. +** Similarly, those that return a changeset or patchset do so by returning +** a pointer to a single large buffer allocated using sqlite3_malloc(). +** Normally this is convenient. However, if an application running in a ** low-memory environment is required to handle very large changesets, the ** large contiguous memory allocations required can become onerous. ** @@ -10099,12 +10099,12 @@ SQLITE_API int sqlite3changeset_apply( ** ** ** Each time the xInput callback is invoked by the sessions module, the first -** argument passed is a copy of the supplied pIn context pointer. The second -** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no -** error occurs the xInput method should copy up to (*pnData) bytes of data -** into the buffer and set (*pnData) to the actual number of bytes copied -** before returning SQLITE_OK. If the input is completely exhausted, (*pnData) -** should be set to zero to indicate this. Or, if an error occurs, an SQLite +** argument passed is a copy of the supplied pIn context pointer. The second +** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no +** error occurs the xInput method should copy up to (*pnData) bytes of data +** into the buffer and set (*pnData) to the actual number of bytes copied +** before returning SQLITE_OK. If the input is completely exhausted, (*pnData) +** should be set to zero to indicate this. Or, if an error occurs, an SQLite ** error code should be returned. In all cases, if an xInput callback returns ** an error, all processing is abandoned and the streaming API function ** returns a copy of the error code to the caller. @@ -10112,7 +10112,7 @@ SQLITE_API int sqlite3changeset_apply( ** In the case of sqlite3changeset_start_strm(), the xInput callback may be ** invoked by the sessions module at any point during the lifetime of the ** iterator. If such an xInput callback returns an error, the iterator enters -** an error state, whereby all subsequent calls to iterator functions +** an error state, whereby all subsequent calls to iterator functions ** immediately fail with the same error code as returned by xInput. ** ** Similarly, streaming API functions that return changesets (or patchsets) @@ -10142,7 +10142,7 @@ SQLITE_API int sqlite3changeset_apply( ** is immediately abandoned and the streaming API function returns a copy ** of the xOutput error code to the application. ** -** The sessions module never invokes an xOutput callback with the third +** The sessions module never invokes an xOutput callback with the third ** parameter set to a value less than or equal to zero. Other than this, ** no guarantees are made as to the size of the chunks of data returned. */ @@ -10190,12 +10190,12 @@ SQLITE_API int sqlite3session_patchset_strm( int (*xOutput)(void *pOut, const void *pData, int nData), void *pOut ); -int sqlite3changegroup_add_strm(sqlite3_changegroup*, +int sqlite3changegroup_add_strm(sqlite3_changegroup*, int (*xInput)(void *pIn, void *pData, int *pnData), void *pIn ); int sqlite3changegroup_output_strm(sqlite3_changegroup*, - int (*xOutput)(void *pOut, const void *pData, int nData), + int (*xOutput)(void *pOut, const void *pData, int nData), void *pOut ); @@ -10223,7 +10223,7 @@ int sqlite3changegroup_output_strm(sqlite3_changegroup*, ** ****************************************************************************** ** -** Interfaces to extend FTS5. Using the interfaces defined in this file, +** Interfaces to extend FTS5. Using the interfaces defined in this file, ** FTS5 may be extended with: ** ** * custom tokenizers, and @@ -10267,19 +10267,19 @@ struct Fts5PhraseIter { ** EXTENSION API FUNCTIONS ** ** xUserData(pFts): -** Return a copy of the context pointer the extension function was +** Return a copy of the context pointer the extension function was ** registered with. ** ** xColumnTotalSize(pFts, iCol, pnToken): ** If parameter iCol is less than zero, set output variable *pnToken ** to the total number of tokens in the FTS5 table. Or, if iCol is ** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in +** the total number of tokens in column iCol, considering all rows in ** the FTS5 table. ** ** If parameter iCol is greater than or equal to the number of columns ** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is +** an OOM condition or IO error), an appropriate SQLite error code is ** returned. ** ** xColumnCount(pFts): @@ -10293,7 +10293,7 @@ struct Fts5PhraseIter { ** ** If parameter iCol is greater than or equal to the number of columns ** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is +** an OOM condition or IO error), an appropriate SQLite error code is ** returned. ** ** This function may be quite inefficient if used with an FTS5 table @@ -10320,8 +10320,8 @@ struct Fts5PhraseIter { ** an error code (i.e. SQLITE_NOMEM) if an error occurs. ** ** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option +** "detail=none" or "detail=column" option. If the FTS5 table is created +** with either "detail=none" or "detail=column" and "content=" option ** (i.e. if it is a contentless table), then this API always returns 0. ** ** xInst: @@ -10336,11 +10336,11 @@ struct Fts5PhraseIter { ** with the offsets=0 option specified. In this case *piOff is always ** set to -1. ** -** Returns SQLITE_OK if successful, or an error code (i.e. SQLITE_NOMEM) +** Returns SQLITE_OK if successful, or an error code (i.e. SQLITE_NOMEM) ** if an error occurs. ** ** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. +** "detail=none" or "detail=column" option. ** ** xRowid: ** Returns the rowid of the current row. @@ -10356,11 +10356,11 @@ struct Fts5PhraseIter { ** ** with $p set to a phrase equivalent to the phrase iPhrase of the ** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback +** phrase iPhrase of the current query is included in $p. For each +** row visited, the callback function passed as the fourth argument +** is invoked. The context and API objects passed to the callback ** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as +** Invoking Api.xUserData() returns a copy of the pointer passed as ** the third argument to pUserData. ** ** If the callback function returns any value other than SQLITE_OK, the @@ -10375,14 +10375,14 @@ struct Fts5PhraseIter { ** ** xSetAuxdata(pFts5, pAux, xDelete) ** -** Save the pointer passed as the second argument as the extension functions +** Save the pointer passed as the second argument as the extension functions ** "auxiliary data". The pointer may then be retrieved by the current or any ** future invocation of the same fts5 extension function made as part of ** of the same MATCH query using the xGetAuxdata() API. ** ** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a +** each FTS query (MATCH expression). If the extension function is invoked +** more than once for a single FTS query, then all invocations share a ** single auxiliary data context. ** ** If there is already an auxiliary data pointer when this function is @@ -10401,7 +10401,7 @@ struct Fts5PhraseIter { ** ** xGetAuxdata(pFts5, bClear) ** -** Returns the current auxiliary data pointer for the fts5 extension +** Returns the current auxiliary data pointer for the fts5 extension ** function. See the xSetAuxdata() method for details. ** ** If the bClear argument is non-zero, then the auxiliary data is cleared @@ -10421,7 +10421,7 @@ struct Fts5PhraseIter { ** method, to iterate through all instances of a single query phrase within ** the current row. This is the same information as is accessible via the ** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate +** to use, this API may be faster under some circumstances. To iterate ** through instances of phrase iPhrase, use the following code: ** ** Fts5PhraseIter iter; @@ -10439,8 +10439,8 @@ struct Fts5PhraseIter { ** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). ** ** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option +** "detail=none" or "detail=column" option. If the FTS5 table is created +** with either "detail=none" or "detail=column" and "content=" option ** (i.e. if it is a contentless table), then this API always iterates ** through an empty set (all calls to xPhraseFirst() set iCol to -1). ** @@ -10464,16 +10464,16 @@ struct Fts5PhraseIter { ** } ** ** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to +** "detail=none" option. If the FTS5 table is created with either +** "detail=none" "content=" option (i.e. if it is a contentless table), +** then this API always iterates through an empty set (all calls to ** xPhraseFirstColumn() set iCol to -1). ** ** The information accessed using this API and its companion ** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext ** (or xInst/xInstCount). The chief advantage of this API is that it is ** significantly more efficient than those alternatives when used with -** "detail=column" tables. +** "detail=column" tables. ** ** xPhraseNextColumn() ** See xPhraseFirstColumn above. @@ -10487,7 +10487,7 @@ struct Fts5ExtensionApi { int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken); - int (*xTokenize)(Fts5Context*, + int (*xTokenize)(Fts5Context*, const char *pText, int nText, /* Text to tokenize */ void *pCtx, /* Context passed to xToken() */ int (*xToken)(void*, int, const char*, int, int, int) /* Callback */ @@ -10516,15 +10516,15 @@ struct Fts5ExtensionApi { void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); }; -/* +/* ** CUSTOM AUXILIARY FUNCTIONS *************************************************************************/ /************************************************************************* ** CUSTOM TOKENIZERS ** -** Applications may also register custom tokenizer types. A tokenizer -** is registered by providing fts5 with a populated instance of the +** Applications may also register custom tokenizer types. A tokenizer +** is registered by providing fts5 with a populated instance of the ** following structure. All structure methods must be defined, setting ** any member of the fts5_tokenizer struct to NULL leads to undefined ** behaviour. The structure methods are expected to function as follows: @@ -10535,16 +10535,16 @@ struct Fts5ExtensionApi { ** ** The first argument passed to this function is a copy of the (void*) ** pointer provided by the application when the fts5_tokenizer object -** was registered with FTS5 (the third argument to xCreateTokenizer()). +** was registered with FTS5 (the third argument to xCreateTokenizer()). ** The second and third arguments are an array of nul-terminated strings ** containing the tokenizer arguments, if any, specified following the ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used ** to create the FTS5 table. ** -** The final argument is an output variable. If successful, (*ppOut) +** The final argument is an output variable. If successful, (*ppOut) ** should be set to point to the new tokenizer handle and SQLITE_OK ** returned. If an error occurs, some value other than SQLITE_OK should -** be returned. In this case, fts5 assumes that the final value of *ppOut +** be returned. In this case, fts5 assumes that the final value of *ppOut ** is undefined. ** ** xDelete: @@ -10553,7 +10553,7 @@ struct Fts5ExtensionApi { ** be invoked exactly once for each successful call to xCreate(). ** ** xTokenize: -** This function is expected to tokenize the nText byte string indicated +** This function is expected to tokenize the nText byte string indicated ** by argument pText. pText may or may not be nul-terminated. The first ** argument passed to this function is a pointer to an Fts5Tokenizer object ** returned by an earlier call to xCreate(). @@ -10567,8 +10567,8 @@ struct Fts5ExtensionApi { ** determine the set of tokens to add to (or delete from) the ** FTS index. ** -**
      • FTS5_TOKENIZE_QUERY - A MATCH query is being executed -** against the FTS index. The tokenizer is being called to tokenize +**
      • FTS5_TOKENIZE_QUERY - A MATCH query is being executed +** against the FTS index. The tokenizer is being called to tokenize ** a bareword or quoted string specified as part of the query. ** **
      • (FTS5_TOKENIZE_QUERY | FTS5_TOKENIZE_PREFIX) - Same as @@ -10576,10 +10576,10 @@ struct Fts5ExtensionApi { ** followed by a "*" character, indicating that the last token ** returned by the tokenizer will be treated as a token prefix. ** -**
      • FTS5_TOKENIZE_AUX - The tokenizer is being invoked to +**
      • FTS5_TOKENIZE_AUX - The tokenizer is being invoked to ** satisfy an fts5_api.xTokenize() request made by an auxiliary ** function. Or an fts5_api.xColumnSize() request made by the same -** on a columnsize=0 database. +** on a columnsize=0 database. **
      ** ** For each token in the input string, the supplied callback xToken() must @@ -10591,10 +10591,10 @@ struct Fts5ExtensionApi { ** which the token is derived within the input. ** ** The second argument passed to the xToken() callback ("tflags") should -** normally be set to 0. The exception is if the tokenizer supports +** normally be set to 0. The exception is if the tokenizer supports ** synonyms. In this case see the discussion below for details. ** -** FTS5 assumes the xToken() callback is invoked for each token in the +** FTS5 assumes the xToken() callback is invoked for each token in the ** order that they occur within the input text. ** ** If an xToken() callback returns any value other than SQLITE_OK, then @@ -10608,7 +10608,7 @@ struct Fts5ExtensionApi { ** SYNONYM SUPPORT ** ** Custom tokenizers may also support synonyms. Consider a case in which a -** user wishes to query for a phrase such as "first place". Using the +** user wishes to query for a phrase such as "first place". Using the ** built-in tokenizers, the FTS5 query 'first + place' will match instances ** of "first place" within the document set, but not alternative forms ** such as "1st place". In some applications, it would be better to match @@ -10617,7 +10617,7 @@ struct Fts5ExtensionApi { ** ** There are several ways to approach this in FTS5: ** -**
      1. By mapping all synonyms to a single token. In this case, the +**
        1. By mapping all synonyms to a single token. In this case, the ** In the above example, this means that the tokenizer returns the ** same token for inputs "first" and "1st". Say that token is in ** fact "first", so that when the user inserts the document "I won @@ -10627,7 +10627,7 @@ struct Fts5ExtensionApi { ** as expected. ** **
        2. By adding multiple synonyms for a single term to the FTS index. -** In this case, when tokenizing query text, the tokenizer may +** In this case, when tokenizing query text, the tokenizer may ** provide multiple synonyms for a single term within the document. ** FTS5 then queries the index for each synonym individually. For ** example, faced with the query: @@ -10636,26 +10636,26 @@ struct Fts5ExtensionApi { ** ... MATCH 'first place' ** ** the tokenizer offers both "1st" and "first" as synonyms for the -** first token in the MATCH query and FTS5 effectively runs a query +** first token in the MATCH query and FTS5 effectively runs a query ** similar to: ** ** ** ... MATCH '(first OR 1st) place' ** ** except that, for the purposes of auxiliary functions, the query -** still appears to contain just two phrases - "(first OR 1st)" +** still appears to contain just two phrases - "(first OR 1st)" ** being treated as a single phrase. ** **
        3. By adding multiple synonyms for a single term to the FTS index. ** Using this method, when tokenizing document text, the tokenizer -** provides multiple synonyms for each token. So that when a +** provides multiple synonyms for each token. So that when a ** document such as "I won first place" is tokenized, entries are ** added to the FTS index for "i", "won", "first", "1st" and ** "place". ** ** This way, even if the tokenizer does not provide synonyms ** when tokenizing query text (it should not - to do would be -** inefficient), it doesn't matter if the user queries for +** inefficient), it doesn't matter if the user queries for ** 'first + place' or '1st + place', as there are entires in the ** FTS index corresponding to both forms of the first token. **
        @@ -10676,11 +10676,11 @@ struct Fts5ExtensionApi { ** ** It is an error to specify the FTS5_TOKEN_COLOCATED flag the first time ** xToken() is called. Multiple synonyms may be specified for a single token -** by making multiple calls to xToken(FTS5_TOKEN_COLOCATED) in sequence. +** by making multiple calls to xToken(FTS5_TOKEN_COLOCATED) in sequence. ** There is no limit to the number of synonyms that may be provided for a ** single token. ** -** In many cases, method (1) above is the best approach. It does not add +** In many cases, method (1) above is the best approach. It does not add ** extra data to the FTS index or require FTS5 to query for multiple terms, ** so it is efficient in terms of disk space and query speed. However, it ** does not support prefix queries very well. If, as suggested above, the @@ -10692,18 +10692,18 @@ struct Fts5ExtensionApi { ** will not match documents that contain the token "1st" (as the tokenizer ** will probably not map "1s" to any prefix of "first"). ** -** For full prefix support, method (3) may be preferred. In this case, +** For full prefix support, method (3) may be preferred. In this case, ** because the index contains entries for both "first" and "1st", prefix ** queries such as 'fi*' or '1s*' will match correctly. However, because ** extra entries are added to the FTS index, this method uses more space ** within the database. ** ** Method (2) offers a midpoint between (1) and (3). Using this method, -** a query such as '1s*' will match documents that contain the literal +** a query such as '1s*' will match documents that contain the literal ** token "1st", but not "first" (assuming the tokenizer is not able to ** provide synonyms for prefixes). However, a non-prefix query like '1st' ** will match against "1st" and "first". This method does not require -** extra disk space, as no extra entries are added to the FTS index. +** extra disk space, as no extra entries are added to the FTS index. ** On the other hand, it may require more CPU cycles to run MATCH queries, ** as separate queries of the FTS index are required for each synonym. ** @@ -10717,10 +10717,10 @@ typedef struct fts5_tokenizer fts5_tokenizer; struct fts5_tokenizer { int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); void (*xDelete)(Fts5Tokenizer*); - int (*xTokenize)(Fts5Tokenizer*, + int (*xTokenize)(Fts5Tokenizer*, void *pCtx, int flags, /* Mask of FTS5_TOKENIZE_* flags */ - const char *pText, int nText, + const char *pText, int nText, int (*xToken)( void *pCtx, /* Copy of 2nd argument to xTokenize() */ int tflags, /* Mask of FTS5_TOKEN_* flags */ @@ -10816,7 +10816,7 @@ struct fts5_api { ** May you share freely, never taking more than you give. ** ************************************************************************* -** +** ** This file defines various limits of what SQLite can process. */ @@ -10864,9 +10864,9 @@ struct fts5_api { #endif /* -** The maximum depth of an expression tree. This is limited to -** some extent by SQLITE_MAX_SQL_LENGTH. But sometime you might -** want to place more severe limits on the complexity of an +** The maximum depth of an expression tree. This is limited to +** some extent by SQLITE_MAX_SQL_LENGTH. But sometime you might +** want to place more severe limits on the complexity of an ** expression. ** ** A value of 0 used to mean that the limit was not enforced. @@ -10948,10 +10948,10 @@ struct fts5_api { ** ** Earlier versions of SQLite allowed the user to change this value at ** compile time. This is no longer permitted, on the grounds that it creates -** a library that is technically incompatible with an SQLite library -** compiled with a different limit. If a process operating on a database -** with a page-size of 65536 bytes crashes, then an instance of SQLite -** compiled with the default page-size limit will not be able to rollback +** a library that is technically incompatible with an SQLite library +** compiled with a different limit. If a process operating on a database +** with a page-size of 65536 bytes crashes, then an instance of SQLite +** compiled with the default page-size limit will not be able to rollback ** the aborted transaction. This could lead to database corruption. */ #ifdef SQLITE_MAX_PAGE_SIZE @@ -11010,7 +11010,7 @@ struct fts5_api { ** Maximum depth of recursion for triggers. ** ** A value of 1 means that a trigger program will not be able to itself -** fire any triggers. A value of 0 means that no trigger programs at all +** fire any triggers. A value of 0 means that no trigger programs at all ** may be executed. */ #ifndef SQLITE_MAX_TRIGGER_DEPTH @@ -11388,7 +11388,7 @@ typedef struct HashElem HashElem; ** element pointed to plus the next _ht.count-1 elements in the list. ** ** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the +** by a linear search of the global list. For small tables, the ** Hash.ht table is never allocated because if there are few elements ** in the table, it is faster to do a linear search than to manage ** the hash table. @@ -11403,7 +11403,7 @@ struct Hash { } *ht; }; -/* Each element in the hash table is an instance of the following +/* Each element in the hash table is an instance of the following ** structure. All elements are stored on a single doubly-linked list. ** ** Again, this structure is intended to be opaque, but it can't really @@ -12337,7 +12337,7 @@ SQLITE_PRIVATE int sqlite3BtreeNewDb(Btree *p); /* ** The second parameter to sqlite3BtreeGetMeta or sqlite3BtreeUpdateMeta -** should be one of the following values. The integer values are assigned +** should be one of the following values. The integer values are assigned ** to constants so that the offset of the corresponding field in an ** SQLite database header may be found using the following formula: ** @@ -12408,7 +12408,7 @@ SQLITE_PRIVATE int sqlite3BtreeNewDb(Btree *p); #define BTREE_BULKLOAD 0x00000001 /* Used to full index in sorted order */ #define BTREE_SEEK_EQ 0x00000002 /* EQ seeks only - no range seeks */ -/* +/* ** Flags passed as the third argument to sqlite3BtreeCursor(). ** ** For read-only cursors the wrFlag argument is always zero. For read-write @@ -12473,13 +12473,13 @@ SQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor*, u8 flags); ** key and pData,nData,nZero set to zero. ** ** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. +** the key and passed in the nKey field. The pKey field is zero. ** pData,nData hold the content of the new entry. nZero extra zero bytes ** are appended to the end of the content when constructing the entry. ** ** This object is used to pass information into sqlite3BtreeInsert(). The ** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more +** the information into this object helps to keep the interface more ** organized and understandable, and it also helps the resulting code to ** run a little faster by using fewer registers for parameter passing. */ @@ -12549,7 +12549,7 @@ SQLITE_PRIVATE int sqlite3BtreeSharable(Btree*); SQLITE_PRIVATE void sqlite3BtreeEnterCursor(BtCursor*); SQLITE_PRIVATE int sqlite3BtreeConnectionCount(Btree*); #else -# define sqlite3BtreeEnter(X) +# define sqlite3BtreeEnter(X) # define sqlite3BtreeEnterAll(X) # define sqlite3BtreeSharable(X) 0 # define sqlite3BtreeEnterCursor(X) @@ -12718,7 +12718,7 @@ typedef struct VdbeOpList VdbeOpList; #define P5_ConstraintFK 4 /* -** The Vdbe.aColName array contains 5n Mem structures, where n is the +** The Vdbe.aColName array contains 5n Mem structures, where n is the ** number of columns of data returned by the statement. */ #define COLNAME_NAME 0 @@ -12738,7 +12738,7 @@ typedef struct VdbeOpList VdbeOpList; /* ** The following macro converts a relative address in the p2 field -** of a VdbeOp structure into a negative number so that +** of a VdbeOp structure into a negative number so that ** sqlite3VdbeAddOpList() knows that the address is relative. Calling ** the macro again restores the address. */ @@ -13130,8 +13130,8 @@ SQLITE_PRIVATE void sqlite3VdbeScanStatus(Vdbe*, int, int, int, LogEst, const ch #define SQLITE_PAGER_H /* -** Default maximum size for persistent journal files. A negative -** value means no limit. This value may be overridden using the +** Default maximum size for persistent journal files. A negative +** value means no limit. This value may be overridden using the ** sqlite3PagerJournalSizeLimit() API. See also "PRAGMA journal_size_limit". */ #ifndef SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT @@ -13157,9 +13157,9 @@ typedef struct PgHdr DbPage; /* ** Page number PAGER_MJ_PGNO is never used in an SQLite database (it is ** reserved for working around a windows/posix incompatibility). It is -** used in the journal to signify that the remainder of the journal file +** used in the journal to signify that the remainder of the journal file ** is devoted to storing a master journal name - there are no more pages to -** roll back. See comments for function writeMasterJournal() in pager.c +** roll back. See comments for function writeMasterJournal() in pager.c ** for details. */ #define PAGER_MJ_PGNO(x) ((Pgno)((PENDING_BYTE/((x)->pageSize))+1)) @@ -13220,11 +13220,11 @@ typedef struct PgHdr DbPage; /* ** The remainder of this file contains the declarations of the functions -** that make up the Pager sub-system API. See source code comments for +** that make up the Pager sub-system API. See source code comments for ** a detailed description of each routine. */ -/* Open and close a Pager connection. */ +/* Open and close a Pager connection. */ SQLITE_PRIVATE int sqlite3PagerOpen( sqlite3_vfs*, Pager **ppPager, @@ -13257,7 +13257,7 @@ SQLITE_PRIVATE i64 sqlite3PagerJournalSizeLimit(Pager *, i64); SQLITE_PRIVATE sqlite3_backup **sqlite3PagerBackupPtr(Pager*); SQLITE_PRIVATE int sqlite3PagerFlush(Pager*); -/* Functions used to obtain and release page references. */ +/* Functions used to obtain and release page references. */ SQLITE_PRIVATE int sqlite3PagerGet(Pager *pPager, Pgno pgno, DbPage **ppPage, int clrFlag); SQLITE_PRIVATE DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno); SQLITE_PRIVATE void sqlite3PagerRef(DbPage*); @@ -13269,8 +13269,8 @@ SQLITE_PRIVATE int sqlite3PagerWrite(DbPage*); SQLITE_PRIVATE void sqlite3PagerDontWrite(DbPage*); SQLITE_PRIVATE int sqlite3PagerMovepage(Pager*,DbPage*,Pgno,int); SQLITE_PRIVATE int sqlite3PagerPageRefcount(DbPage*); -SQLITE_PRIVATE void *sqlite3PagerGetData(DbPage *); -SQLITE_PRIVATE void *sqlite3PagerGetExtra(DbPage *); +SQLITE_PRIVATE void *sqlite3PagerGetData(DbPage *); +SQLITE_PRIVATE void *sqlite3PagerGetExtra(DbPage *); /* Functions used to manage pager transactions and savepoints. */ SQLITE_PRIVATE void sqlite3PagerPagecount(Pager*, int*); @@ -13366,7 +13366,7 @@ SQLITE_PRIVATE void sqlite3PagerRefdump(Pager*); ** ************************************************************************* ** This header file defines the interface that the sqlite page cache -** subsystem. +** subsystem. */ #ifndef _PCACHE_H_ @@ -13443,7 +13443,7 @@ SQLITE_PRIVATE int sqlite3PcacheSetPageSize(PCache *, int); SQLITE_PRIVATE int sqlite3PcacheSize(void); /* One release per successful fetch. Page is pinned until released. -** Reference counted. +** Reference counted. */ SQLITE_PRIVATE sqlite3_pcache_page *sqlite3PcacheFetch(PCache*, Pgno, int createFlag); SQLITE_PRIVATE int sqlite3PcacheFetchStress(PCache*, Pgno, sqlite3_pcache_page**); @@ -13487,7 +13487,7 @@ SQLITE_PRIVATE int sqlite3PcachePagecount(PCache*); #if defined(SQLITE_CHECK_PAGES) || defined(SQLITE_DEBUG) /* Iterate through all dirty pages currently stored in the cache. This -** interface is only available if SQLITE_CHECK_PAGES is defined when the +** interface is only available if SQLITE_CHECK_PAGES is defined when the ** library is built. */ SQLITE_PRIVATE void sqlite3PcacheIterateDirty(PCache *pCache, void (*xIter)(PgHdr *)); @@ -13658,10 +13658,10 @@ SQLITE_PRIVATE int sqlite3PCachePercentDirty(PCache*); ** 2006-10-31: The default prefix used to be "sqlite_". But then ** Mcafee started using SQLite in their anti-virus product and it ** started putting files with the "sqlite" name in the c:/temp folder. -** This annoyed many windows users. Those users would then do a +** This annoyed many windows users. Those users would then do a ** Google search for "sqlite", find the telephone numbers of the ** developers and call to wake them up at night and complain. -** For this reason, the default name prefix is changed to be "sqlite" +** For this reason, the default name prefix is changed to be "sqlite" ** spelled backwards. So the temp files are still identified, but ** anybody smart enough to figure out the code is also likely smart ** enough to know that calling the developer will not help get rid @@ -13702,9 +13702,9 @@ SQLITE_PRIVATE int sqlite3PCachePercentDirty(PCache*); ** UnlockFile(). ** ** LockFile() prevents not just writing but also reading by other processes. -** A SHARED_LOCK is obtained by locking a single randomly-chosen -** byte out of a specific range of bytes. The lock byte is obtained at -** random so two separate readers can probably access the file at the +** A SHARED_LOCK is obtained by locking a single randomly-chosen +** byte out of a specific range of bytes. The lock byte is obtained at +** random so two separate readers can probably access the file at the ** same time, unless they are unlucky and choose the same lock byte. ** An EXCLUSIVE_LOCK is obtained by locking all bytes in the range. ** There can only be one writer. A RESERVED_LOCK is obtained by locking @@ -13723,7 +13723,7 @@ SQLITE_PRIVATE int sqlite3PCachePercentDirty(PCache*); ** The following #defines specify the range of bytes used for locking. ** SHARED_SIZE is the number of bytes available in the pool from which ** a random byte is selected for a shared lock. The pool of bytes for -** shared locks begins at SHARED_FIRST. +** shared locks begins at SHARED_FIRST. ** ** The same locking strategy and ** byte ranges are used for Unix. This leaves open the possibility of having @@ -13739,7 +13739,7 @@ SQLITE_PRIVATE int sqlite3PCachePercentDirty(PCache*); ** that all locks will fit on a single page even at the minimum page size. ** PENDING_BYTE defines the beginning of the locks. By default PENDING_BYTE ** is set high so that we don't have to allocate an unused page except -** for very large databases. But one should test the page skipping logic +** for very large databases. But one should test the page skipping logic ** by setting PENDING_BYTE low and running the entire regression suite. ** ** Changing the value of PENDING_BYTE results in a subtly incompatible @@ -13763,8 +13763,8 @@ SQLITE_PRIVATE int sqlite3PCachePercentDirty(PCache*); */ SQLITE_PRIVATE int sqlite3OsInit(void); -/* -** Functions for accessing sqlite3_file methods +/* +** Functions for accessing sqlite3_file methods */ SQLITE_PRIVATE void sqlite3OsClose(sqlite3_file*); SQLITE_PRIVATE int sqlite3OsRead(sqlite3_file*, void*, int amt, i64 offset); @@ -13788,8 +13788,8 @@ SQLITE_PRIVATE int sqlite3OsFetch(sqlite3_file *id, i64, int, void **); SQLITE_PRIVATE int sqlite3OsUnfetch(sqlite3_file *, i64, void *); -/* -** Functions for accessing sqlite3_vfs methods +/* +** Functions for accessing sqlite3_vfs methods */ SQLITE_PRIVATE int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *); SQLITE_PRIVATE int sqlite3OsDelete(sqlite3_vfs *, const char *, int); @@ -13807,7 +13807,7 @@ SQLITE_PRIVATE int sqlite3OsGetLastError(sqlite3_vfs*); SQLITE_PRIVATE int sqlite3OsCurrentTimeInt64(sqlite3_vfs *, sqlite3_int64*); /* -** Convenience functions for opening and closing files using +** Convenience functions for opening and closing files using ** sqlite3_malloc() to obtain space for the file-handle structure. */ SQLITE_PRIVATE int sqlite3OsOpenMalloc(sqlite3_vfs *, const char *, sqlite3_file **, int,int*); @@ -13877,9 +13877,9 @@ SQLITE_PRIVATE void sqlite3OsCloseFree(sqlite3_file *); */ #define sqlite3_mutex_alloc(X) ((sqlite3_mutex*)8) #define sqlite3_mutex_free(X) -#define sqlite3_mutex_enter(X) +#define sqlite3_mutex_enter(X) #define sqlite3_mutex_try(X) SQLITE_OK -#define sqlite3_mutex_leave(X) +#define sqlite3_mutex_leave(X) #define sqlite3_mutex_held(X) ((void)(X),1) #define sqlite3_mutex_notheld(X) ((void)(X),1) #define sqlite3MutexAlloc(X) ((sqlite3_mutex*)8) @@ -17164,7 +17164,7 @@ SQLITE_PRIVATE void sqlite3VectorErrorMsg(Parse*, Expr*); /* #include "sqliteInt.h" */ /* An array to map all upper-case characters into their corresponding -** lower-case character. +** lower-case character. ** ** SQLite only considers US-ASCII (or EBCDIC) characters. We do not ** handle case conversions for the UTF character set since the tables @@ -17231,7 +17231,7 @@ SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[] = { ** The equivalent of tolower() is implemented using the sqlite3UpperToLower[] ** array. tolower() is used more often than toupper() by SQLite. ** -** Bit 0x40 is set if the character is non-alphanumeric and can be used in an +** Bit 0x40 is set if the character is non-alphanumeric and can be used in an ** SQLite identifier. Identifiers are alphanumerics, "_", "$", and any ** non-ASCII UTF character. Hence the test for whether or not a character is ** part of an identifier is 0x46. @@ -17314,7 +17314,7 @@ SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[256] = { ** if journal_mode=MEMORY or if temp_store=MEMORY, regardless of this ** setting.) */ -#ifndef SQLITE_STMTJRNL_SPILL +#ifndef SQLITE_STMTJRNL_SPILL # define SQLITE_STMTJRNL_SPILL (64*1024) #endif @@ -17430,7 +17430,7 @@ SQLITE_PRIVATE int sqlite3PendingByte = 0x40000000; ** Properties of opcodes. The OPFLG_INITIALIZER macro is ** created by mkopcodeh.awk during compilation. Data is obtained ** from the comments following the "case OP_xxxx:" statements in -** the vdbe.c file. +** the vdbe.c file. */ SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER; @@ -17462,7 +17462,7 @@ SQLITE_PRIVATE const char sqlite3StrBINARY[] = "BINARY"; /* #include "sqliteInt.h" */ /* -** An array of names of all compile-time options. This array should +** An array of names of all compile-time options. This array should ** be sorted A-Z. ** ** This array looks large, but in a typical installation actually uses @@ -18060,7 +18060,7 @@ struct VdbeCursor { ** When a sub-program is executed (OP_Program), a structure of this type ** is allocated to store the current value of the program counter, as ** well as the current memory cell array and various other frame specific -** values stored in the Vdbe struct. When the sub-program is finished, +** values stored in the Vdbe struct. When the sub-program is finished, ** these values are copied back to the Vdbe from the VdbeFrame structure, ** restoring the state of the VM to as it was before the sub-program ** began executing. @@ -18147,7 +18147,7 @@ struct Mem { ** If the MEM_Str flag is set then Mem.z points at a string representation. ** Usually this is encoded in the same unicode encoding as the main ** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real +** set, then the string is nul terminated. The MEM_Int and MEM_Real ** flags may coexist with the MEM_Str flag. */ #define MEM_Null 0x0001 /* Value is NULL */ @@ -18201,7 +18201,7 @@ struct Mem { #endif /* -** Each auxiliary data pointer stored by a user defined function +** Each auxiliary data pointer stored by a user defined function ** implementation calling sqlite3_set_auxdata() is stored in an instance ** of this structure. All such structures associated with a single VM ** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed @@ -18340,7 +18340,7 @@ struct Vdbe { #define VDBE_MAGIC_DEAD 0x5606c3c8 /* The VDBE has been deallocated */ /* -** Structure used to store the context required by the +** Structure used to store the context required by the ** sqlite3_preupdate_*() API functions. */ struct PreUpdate { @@ -18355,7 +18355,7 @@ struct PreUpdate { i64 iKey1; /* First key value passed to hook */ i64 iKey2; /* Second key value passed to hook */ Mem *aNew; /* Array of new.* values */ - Table *pTab; /* Schema object being upated */ + Table *pTab; /* Schema object being upated */ Index *pPk; /* PK index if pTab is WITHOUT ROWID */ }; @@ -18433,7 +18433,7 @@ SQLITE_PRIVATE int sqlite3VdbeSorterRewind(const VdbeCursor *, int *); SQLITE_PRIVATE int sqlite3VdbeSorterWrite(const VdbeCursor *, Mem *); SQLITE_PRIVATE int sqlite3VdbeSorterCompare(const VdbeCursor *, Mem *, int, int *); -#if !defined(SQLITE_OMIT_SHARED_CACHE) +#if !defined(SQLITE_OMIT_SHARED_CACHE) SQLITE_PRIVATE void sqlite3VdbeEnter(Vdbe*); #else # define sqlite3VdbeEnter(X) @@ -18674,7 +18674,7 @@ SQLITE_API int sqlite3_db_status( break; } - /* + /* ** Return an approximation for the amount of memory currently used ** by all pagers associated with the given database connection. The ** highwater mark is meaningless and is returned as zero. @@ -18718,7 +18718,7 @@ SQLITE_API int sqlite3_db_status( HashElem *p; nByte += sqlite3GlobalConfig.m.xRoundup(sizeof(HashElem)) * ( - pSchema->tblHash.count + pSchema->tblHash.count + pSchema->trigHash.count + pSchema->idxHash.count + pSchema->fkeyHash.count @@ -18768,7 +18768,7 @@ SQLITE_API int sqlite3_db_status( /* ** Set *pCurrent to the total cache hits or misses encountered by all - ** pagers the database handle is connected to. *pHighwater is always set + ** pagers the database handle is connected to. *pHighwater is always set ** to zero. */ case SQLITE_DBSTATUS_CACHE_HIT: @@ -18824,7 +18824,7 @@ SQLITE_API int sqlite3_db_status( ** ************************************************************************* ** This file contains the C functions that implement date and time -** functions for SQLite. +** functions for SQLite. ** ** There is only one exported symbol in this file - the function ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file. @@ -18833,7 +18833,7 @@ SQLITE_API int sqlite3_db_status( ** SQLite processes all times and dates as julian day numbers. The ** dates and times are stored as the number of days since noon ** in Greenwich on November 24, 4714 B.C. according to the Gregorian -** calendar system. +** calendar system. ** ** 1970-01-01 00:00:00 is JD 2440587.5 ** 2000-01-01 00:00:00 is JD 2451544.5 @@ -19181,7 +19181,7 @@ static void setRawDateNumber(DateTime *p, double r){ ** The following are acceptable forms for the input string: ** ** YYYY-MM-DD HH:MM:SS.FFF +/-HH:MM -** DDDD.DD +** DDDD.DD ** now ** ** In the first form, the +/-HH:MM is always optional. The fractional @@ -19191,8 +19191,8 @@ static void setRawDateNumber(DateTime *p, double r){ ** as there is a year and date. */ static int parseDateOrTime( - sqlite3_context *context, - const char *zDate, + sqlite3_context *context, + const char *zDate, DateTime *p ){ double r; @@ -19213,7 +19213,7 @@ static int parseDateOrTime( ** Multiplying this by 86400000 gives 464269060799999 as the maximum value ** for DateTime.iJD. ** -** But some older compilers (ex: gcc 4.2.1 on older Macs) cannot deal with +** But some older compilers (ex: gcc 4.2.1 on older Macs) cannot deal with ** such a large integer literal, so we have to encode it. */ #define INT_464269060799999 ((((i64)0x1a640)<<32)|0x1072fdff) @@ -19293,14 +19293,14 @@ static void clearYMD_HMS_TZ(DateTime *p){ #ifndef SQLITE_OMIT_LOCALTIME /* ** On recent Windows platforms, the localtime_s() function is available -** as part of the "Secure CRT". It is essentially equivalent to -** localtime_r() available under most POSIX platforms, except that the +** as part of the "Secure CRT". It is essentially equivalent to +** localtime_r() available under most POSIX platforms, except that the ** order of the parameters is reversed. ** ** See http://msdn.microsoft.com/en-us/library/a442x3ye(VS.80).aspx. ** ** If the user has not indicated to use localtime_r() or localtime_s() -** already, check for an MSVC build environment that provides +** already, check for an MSVC build environment that provides ** localtime_s(). */ #if !HAVE_LOCALTIME_R && !HAVE_LOCALTIME_S \ @@ -19356,7 +19356,7 @@ static int osLocaltime(time_t *t, struct tm *pTm){ /* ** Compute the difference (in milliseconds) between localtime and UTC ** (a.k.a. GMT) for the time value p where p is in UTC. If no error occurs, -** return this value and set *pRc to SQLITE_OK. +** return this value and set *pRc to SQLITE_OK. ** ** Or, if an error does occur, set *pRc to SQLITE_ERROR. The returned value ** is undefined in this case. @@ -19682,9 +19682,9 @@ static int parseModifier( ** then assume a default value of "now" for argv[0]. */ static int isDate( - sqlite3_context *context, - int argc, - sqlite3_value **argv, + sqlite3_context *context, + int argc, + sqlite3_value **argv, DateTime *p ){ int i, n; @@ -20491,17 +20491,17 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs *pVfs){ ** ************************************************************************* ** -** This file contains code to support the concept of "benign" +** This file contains code to support the concept of "benign" ** malloc failures (when the xMalloc() or xRealloc() method of the ** sqlite3_mem_methods structure fails to allocate a block of memory -** and returns 0). +** and returns 0). ** ** Most malloc failures are non-benign. After they occur, SQLite ** abandons the current operation and returns an error code (usually ** SQLITE_NOMEM) to the user. However, sometimes a fault is not necessarily -** fatal. For example, if a malloc fails while resizing a hash table, this -** is completely recoverable simply by not carrying out the resize. The -** hash table will continue to function normally. So a malloc failure +** fatal. For example, if a malloc fails while resizing a hash table, this +** is completely recoverable simply by not carrying out the resize. The +** hash table will continue to function normally. So a malloc failure ** during a hash table resize is a benign fault. */ @@ -20701,7 +20701,7 @@ static malloc_zone_t* _sqliteZone_; #else /* if not __APPLE__ */ /* -** Use standard C library malloc and free on non-Apple systems. +** Use standard C library malloc and free on non-Apple systems. ** Also used by Apple systems if SQLITE_WITHOUT_ZONEMALLOC is defined. */ #define SQLITE_MALLOC(x) malloc(x) @@ -20881,13 +20881,13 @@ static int sqlite3MemInit(void *NotUsed){ /* defer MT decisions to system malloc */ _sqliteZone_ = malloc_default_zone(); }else{ - /* only 1 core, use our own zone to contention over global locks, + /* only 1 core, use our own zone to contention over global locks, ** e.g. we have our own dedicated locks */ bool success; malloc_zone_t* newzone = malloc_create_zone(4096, 0); malloc_set_zone_name(newzone, "Sqlite_Heap"); do{ - success = OSAtomicCompareAndSwapPtrBarrier(NULL, newzone, + success = OSAtomicCompareAndSwapPtrBarrier(NULL, newzone, (void * volatile *)&_sqliteZone_); }while(!_sqliteZone_); if( !success ){ @@ -21014,7 +21014,7 @@ struct MemBlockHdr { ** when this module is combined with other in the amalgamation. */ static struct { - + /* ** Mutex to control access to the memory allocation subsystem. */ @@ -21025,7 +21025,7 @@ static struct { */ struct MemBlockHdr *pFirst; struct MemBlockHdr *pLast; - + /* ** The number of levels of backtrace to save in new allocations. */ @@ -21038,7 +21038,7 @@ static struct { int nTitle; /* Bytes of zTitle to save. Includes '\0' and padding */ char zTitle[100]; /* The title text */ - /* + /* ** sqlite3MallocDisallow() increments the following counter. ** sqlite3MallocAllow() decrements it. */ @@ -21097,7 +21097,7 @@ static struct MemBlockHdr *sqlite3MemsysGetHeader(void *pAllocation){ pU8 = (u8*)pAllocation; assert( pInt[nReserve/sizeof(int)]==(int)REARGUARD ); /* This checks any of the "extra" bytes allocated due - ** to rounding up to an 8 byte boundary to ensure + ** to rounding up to an 8 byte boundary to ensure ** they haven't been overwritten. */ while( nReserve-- > p->iSize ) assert( pU8[nReserve]==0x65 ); @@ -21226,7 +21226,7 @@ static void *sqlite3MemMalloc(int nByte){ p = (void*)pInt; } sqlite3_mutex_leave(mem.mutex); - return p; + return p; } /* @@ -21236,7 +21236,7 @@ static void sqlite3MemFree(void *pPrior){ struct MemBlockHdr *pHdr; void **pBt; char *z; - assert( sqlite3GlobalConfig.bMemstat || sqlite3GlobalConfig.bCoreMutex==0 + assert( sqlite3GlobalConfig.bMemstat || sqlite3GlobalConfig.bCoreMutex==0 || mem.mutex!=0 ); pHdr = sqlite3MemsysGetHeader(pPrior); pBt = (void**)pHdr; @@ -21262,15 +21262,15 @@ static void sqlite3MemFree(void *pPrior){ randomFill(z, sizeof(void*)*pHdr->nBacktraceSlots + sizeof(*pHdr) + (int)pHdr->iSize + sizeof(int) + pHdr->nTitle); free(z); - sqlite3_mutex_leave(mem.mutex); + sqlite3_mutex_leave(mem.mutex); } /* ** Change the size of an existing memory allocation. ** ** For this debugging implementation, we *always* make a copy of the -** allocation into a new place in memory. In this way, if the -** higher level code is using pointer to the old allocation, it is +** allocation into a new place in memory. In this way, if the +** higher level code is using pointer to the old allocation, it is ** much more likely to break and we are much more liking to find ** the error. */ @@ -21404,7 +21404,7 @@ SQLITE_PRIVATE void sqlite3MemdebugSync(){ } /* -** Open the file indicated and write a log of all unfreed memory +** Open the file indicated and write a log of all unfreed memory ** allocations into that log. */ SQLITE_PRIVATE void sqlite3MemdebugDump(const char *zFilename){ @@ -21421,7 +21421,7 @@ SQLITE_PRIVATE void sqlite3MemdebugDump(const char *zFilename){ for(pHdr=mem.pFirst; pHdr; pHdr=pHdr->pNext){ char *z = (char*)pHdr; z -= pHdr->nBacktraceSlots*sizeof(void*) + pHdr->nTitle; - fprintf(out, "**** %lld bytes at %p from %s ****\n", + fprintf(out, "**** %lld bytes at %p from %s ****\n", pHdr->iSize, &pHdr[1], pHdr->nTitle ? z : "???"); if( pHdr->nBacktrace ){ fflush(out); @@ -21434,7 +21434,7 @@ SQLITE_PRIVATE void sqlite3MemdebugDump(const char *zFilename){ fprintf(out, "COUNTS:\n"); for(i=0; i= M*(1 + log2(n)/2) - n + 1 @@ -22206,7 +22206,7 @@ SQLITE_PRIVATE const sqlite3_mem_methods *sqlite3MemGetMemsys3(void){ /* #include "sqliteInt.h" */ /* -** This version of the memory allocator is used only when +** This version of the memory allocator is used only when ** SQLITE_ENABLE_MEMSYS5 is defined. */ #ifdef SQLITE_ENABLE_MEMSYS5 @@ -22251,7 +22251,7 @@ static SQLITE_WSD struct Mem5Global { int szAtom; /* Smallest possible allocation in bytes */ int nBlock; /* Number of szAtom sized blocks in zPool */ u8 *zPool; /* Memory available to be allocated */ - + /* ** Mutex to control access to the memory allocation subsystem. */ @@ -22270,7 +22270,7 @@ static SQLITE_WSD struct Mem5Global { u32 maxCount; /* Maximum instantaneous currentCount */ u32 maxRequest; /* Largest allocation (exclusive of internal frag) */ #endif - + /* ** Lists of free blocks. aiFreelist[0] is a list of free blocks of ** size mem5.szAtom. aiFreelist[1] holds blocks of size szAtom*2. @@ -22446,7 +22446,7 @@ static void memsys5FreeUnsafe(void *pOld){ u32 size, iLogsize; int iBlock; - /* Set iBlock to the index of the block pointed to by pOld in + /* Set iBlock to the index of the block pointed to by pOld in ** the array of mem5.szAtom byte blocks pointed to by mem5.zPool. */ iBlock = (int)(((u8 *)pOld-mem5.zPool)/mem5.szAtom); @@ -22515,7 +22515,7 @@ static void *memsys5Malloc(int nBytes){ p = memsys5MallocUnsafe(nBytes); memsys5Leave(); } - return (void*)p; + return (void*)p; } /* @@ -22528,14 +22528,14 @@ static void memsys5Free(void *pPrior){ assert( pPrior!=0 ); memsys5Enter(); memsys5FreeUnsafe(pPrior); - memsys5Leave(); + memsys5Leave(); } /* ** Change the size of an existing memory allocation. ** ** The outer layer memory allocator prevents this routine from -** being called with pPrior==0. +** being called with pPrior==0. ** ** nBytes is always a value obtained from a prior call to ** memsys5Round(). Hence nBytes is always a non-negative power @@ -22668,7 +22668,7 @@ static void memsys5Shutdown(void *NotUsed){ #ifdef SQLITE_TEST /* -** Open the file indicated and write a log of all unfreed memory +** Open the file indicated and write a log of all unfreed memory ** allocations into that log. */ SQLITE_PRIVATE void sqlite3Memsys5Dump(const char *zFilename){ @@ -22710,7 +22710,7 @@ SQLITE_PRIVATE void sqlite3Memsys5Dump(const char *zFilename){ #endif /* -** This routine is the only routine in this file with external +** This routine is the only routine in this file with external ** linkage. It returns a pointer to a static sqlite3_mem_methods ** struct populated with the memsys5 methods. */ @@ -22763,11 +22763,11 @@ static SQLITE_WSD int mutexIsInit = 0; /* ** Initialize the mutex system. */ -SQLITE_PRIVATE int sqlite3MutexInit(void){ +SQLITE_PRIVATE int sqlite3MutexInit(void){ int rc = SQLITE_OK; if( !sqlite3GlobalConfig.mutex.xMutexAlloc ){ /* If the xMutexAlloc method has not been set, then the user did not - ** install a mutex implementation via sqlite3_config() prior to + ** install a mutex implementation via sqlite3_config() prior to ** sqlite3_initialize() being called. This block copies pointers to ** the default implementation into the sqlite3GlobalConfig structure. */ @@ -22874,7 +22874,7 @@ SQLITE_API int sqlite3_mutex_try(sqlite3_mutex *p){ /* ** The sqlite3_mutex_leave() routine exits a mutex that was previously -** entered by the same thread. The behavior is undefined if the mutex +** entered by the same thread. The behavior is undefined if the mutex ** is not currently entered. If a NULL pointer is passed as an argument ** this function is a no-op. */ @@ -22943,9 +22943,9 @@ SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex *p){ */ static int noopMutexInit(void){ return SQLITE_OK; } static int noopMutexEnd(void){ return SQLITE_OK; } -static sqlite3_mutex *noopMutexAlloc(int id){ +static sqlite3_mutex *noopMutexAlloc(int id){ UNUSED_PARAMETER(id); - return (sqlite3_mutex*)8; + return (sqlite3_mutex*)8; } static void noopMutexFree(sqlite3_mutex *p){ UNUSED_PARAMETER(p); return; } static void noopMutexEnter(sqlite3_mutex *p){ UNUSED_PARAMETER(p); return; } @@ -23010,7 +23010,7 @@ static int debugMutexEnd(void){ return SQLITE_OK; } /* ** The sqlite3_mutex_alloc() routine allocates a new ** mutex and returns a pointer to it. If it returns NULL -** that means that a mutex could not be allocated. +** that means that a mutex could not be allocated. */ static sqlite3_mutex *debugMutexAlloc(int id){ static sqlite3_debug_mutex aStatic[SQLITE_MUTEX_STATIC_VFS3 - 1]; @@ -23187,7 +23187,7 @@ struct sqlite3_mutex { ** there might be race conditions that can cause these routines to ** deliver incorrect results. In particular, if pthread_equal() is ** not an atomic operation, then these routines might delivery -** incorrect results. On most platforms, pthread_equal() is a +** incorrect results. On most platforms, pthread_equal() is a ** comparison of two integers and is therefore atomic. But we are ** told that HPUX is not such a platform. If so, then these routines ** will not always work correctly on HPUX. @@ -23269,7 +23269,7 @@ static int pthreadMutexEnd(void){ return SQLITE_OK; } ** ** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() -** returns a different mutex on every call. But for the static +** returns a different mutex on every call. But for the static ** mutex types, the same mutex is returned on every call that has ** the same type number. */ @@ -23374,7 +23374,7 @@ static void pthreadMutexEnter(sqlite3_mutex *p){ ** is atomic - that it cannot be deceived into thinking self ** and p->owner are equal if p->owner changes between two values ** that are not equal to self while the comparison is taking place. - ** This implementation also assumes a coherent cache - that + ** This implementation also assumes a coherent cache - that ** separate processes cannot read different values from the same ** address at the same time. If either of these two conditions ** are not met, then the mutexes will fail and problems will result. @@ -23417,7 +23417,7 @@ static int pthreadMutexTry(sqlite3_mutex *p){ ** is atomic - that it cannot be deceived into thinking self ** and p->owner are equal if p->owner changes between two values ** that are not equal to self while the comparison is taking place. - ** This implementation also assumes a coherent cache - that + ** This implementation also assumes a coherent cache - that ** separate processes cannot read different values from the same ** address at the same time. If either of these two conditions ** are not met, then the mutexes will fail and problems will result. @@ -23629,7 +23629,7 @@ SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void){ __asm__ __volatile__ ("rdtsc" : "=A" (val)); return val; } - + #elif (defined(__GNUC__) && defined(__ppc__)) __inline__ sqlite_uint64 sqlite3Hwtime(void){ @@ -24298,7 +24298,7 @@ SQLITE_API int sqlite3_memory_alarm( #endif /* -** Set the soft heap-size limit for the library. Passing a zero or +** Set the soft heap-size limit for the library. Passing a zero or ** negative value indicates no limit. */ SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 n){ @@ -24410,7 +24410,7 @@ SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag){ } /* -** Trigger the alarm +** Trigger the alarm */ static void sqlite3MallocAlarm(int nByte){ if( mem0.alarmThreshold<=0 ) return; @@ -24732,7 +24732,7 @@ SQLITE_PRIVATE void *sqlite3Realloc(void *pOld, u64 nBytes){ sqlite3_mutex_enter(mem0.mutex); sqlite3StatusHighwater(SQLITE_STATUS_MALLOC_SIZE, (int)nBytes); nDiff = nNew - nOld; - if( nDiff>0 && sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >= + if( nDiff>0 && sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >= mem0.alarmThreshold-nDiff ){ sqlite3MallocAlarm(nDiff); } @@ -24774,7 +24774,7 @@ SQLITE_API void *sqlite3_realloc64(void *pOld, sqlite3_uint64 n){ /* ** Allocate and zero memory. -*/ +*/ SQLITE_PRIVATE void *sqlite3MallocZero(u64 n){ void *p = sqlite3Malloc(n); if( p ){ @@ -24804,13 +24804,13 @@ static SQLITE_NOINLINE void *dbMallocRawFinish(sqlite3 *db, u64 n){ assert( db!=0 ); p = sqlite3Malloc(n); if( !p ) sqlite3OomFault(db); - sqlite3MemdebugSetType(p, + sqlite3MemdebugSetType(p, (db->lookaside.bDisable==0) ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP); return p; } /* -** Allocate memory, either lookaside (if possible) or heap. +** Allocate memory, either lookaside (if possible) or heap. ** If the allocation fails, set the mallocFailed flag in ** the connection pointer. ** @@ -24927,9 +24927,9 @@ SQLITE_PRIVATE void *sqlite3DbReallocOrFree(sqlite3 *db, void *p, u64 n){ } /* -** Make a copy of a string in memory obtained from sqliteMalloc(). These +** Make a copy of a string in memory obtained from sqliteMalloc(). These ** functions call sqlite3MallocRaw() directly instead of sqliteMalloc(). This -** is because when memory debugging is turned on, these two functions are +** is because when memory debugging is turned on, these two functions are ** called via macros that record the current file and line number in the ** ThreadData structure. */ @@ -25011,20 +25011,20 @@ static SQLITE_NOINLINE int apiOomError(sqlite3 *db){ } /* -** This function must be called before exiting any API function (i.e. +** This function must be called before exiting any API function (i.e. ** returning control to the user) that has called sqlite3_malloc or ** sqlite3_realloc. ** ** The returned value is normally a copy of the second argument to this ** function. However, if a malloc() failure has occurred since the previous -** invocation SQLITE_NOMEM is returned instead. +** invocation SQLITE_NOMEM is returned instead. ** ** If an OOM as occurred, then the connection error-code (the value ** returned by sqlite3_errcode()) is set to SQLITE_NOMEM. */ SQLITE_PRIVATE int sqlite3ApiExit(sqlite3* db, int rc){ /* If the db handle must hold the connection handle mutex here. - ** Otherwise the read (and possible write) of db->mallocFailed + ** Otherwise the read (and possible write) of db->mallocFailed ** is unsafe, as is the call to sqlite3Error(). */ assert( db!=0 ); @@ -25039,7 +25039,7 @@ SQLITE_PRIVATE int sqlite3ApiExit(sqlite3* db, int rc){ /************** Begin file printf.c ******************************************/ /* ** The "printf" code that follows dates from the 1980's. It is in -** the public domain. +** the public domain. ** ************************************************************************** ** @@ -25268,7 +25268,7 @@ SQLITE_PRIVATE void sqlite3VXPrintf( break; } /* Find out what flags are present */ - flag_leftjustify = flag_plussign = flag_blanksign = + flag_leftjustify = flag_plussign = flag_blanksign = flag_alternateform = flag_altform2 = flag_zeropad = 0; done = 0; do{ @@ -25550,7 +25550,7 @@ SQLITE_PRIVATE void sqlite3VXPrintf( e2 = exp; } if( MAX(e2,0)+(i64)precision+(i64)width > etBUFSIZE - 15 ){ - bufpt = zExtra + bufpt = zExtra = sqlite3Malloc( MAX(e2,0)+(i64)precision+(i64)width+15 ); if( bufpt==0 ){ setStrAccumError(pAccum, STRACCUM_NOMEM); @@ -26001,7 +26001,7 @@ SQLITE_API char *sqlite3_vmprintf(const char *zFormat, va_list ap){ char zBase[SQLITE_PRINT_BUF_SIZE]; StrAccum acc; -#ifdef SQLITE_ENABLE_API_ARMOR +#ifdef SQLITE_ENABLE_API_ARMOR if( zFormat==0 ){ (void)SQLITE_MISUSE_BKPT; return 0; @@ -26153,7 +26153,7 @@ SQLITE_PRIVATE void sqlite3XPrintf(StrAccum *p, const char *zFormat, ...){ ** ** This file contains C code to implement the TreeView debugging routines. ** These routines print a parse tree to standard output for debugging and -** analysis. +** analysis. ** ** The interfaces in this file is only available when compiling ** with SQLITE_DEBUG. @@ -26318,7 +26318,7 @@ SQLITE_PRIVATE void sqlite3TreeViewSelect(TreeView *pView, const Select *p, u8 m sqlite3XPrintf(&x, " LEFT-JOIN"); } sqlite3StrAccumFinish(&x); - sqlite3TreeViewItem(pView, zLine, ipSrc->nSrc-1); + sqlite3TreeViewItem(pView, zLine, ipSrc->nSrc-1); if( pItem->pSelect ){ sqlite3TreeViewSelect(pView, pItem->pSelect, 0); } @@ -26564,7 +26564,7 @@ SQLITE_PRIVATE void sqlite3TreeViewExpr(TreeView *pView, const Expr *pExpr, u8 m ** is set to the column of the pseudo-table to read, or to -1 to ** read the rowid field. */ - sqlite3TreeViewLine(pView, "%s(%d)", + sqlite3TreeViewLine(pView, "%s(%d)", pExpr->iTable ? "NEW" : "OLD", pExpr->iColumn); break; } @@ -26865,13 +26865,13 @@ SQLITE_PRIVATE int sqlite3ThreadCreate( memset(p, 0, sizeof(*p)); p->xTask = xTask; p->pIn = pIn; - /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a + /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a ** function that returns SQLITE_ERROR when passed the argument 200, that - ** forces worker threads to run sequentially and deterministically + ** forces worker threads to run sequentially and deterministically ** for testing purposes. */ if( sqlite3FaultSim(200) ){ rc = 1; - }else{ + }else{ rc = pthread_create(&p->tid, 0, xTask, pIn); } if( rc ){ @@ -26953,9 +26953,9 @@ SQLITE_PRIVATE int sqlite3ThreadCreate( *ppThread = 0; p = sqlite3Malloc(sizeof(*p)); if( p==0 ) return SQLITE_NOMEM_BKPT; - /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a + /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a ** function that returns SQLITE_ERROR when passed the argument 200, that - ** forces worker threads to run sequentially and deterministically + ** forces worker threads to run sequentially and deterministically ** (via the sqlite3FaultSim() term of the conditional) for testing ** purposes. */ if( sqlite3GlobalConfig.bCoreMutex==0 || sqlite3FaultSim(200) ){ @@ -27084,7 +27084,7 @@ SQLITE_PRIVATE int sqlite3ThreadJoin(SQLiteThread *p, void **ppOut){ ** May you share freely, never taking more than you give. ** ************************************************************************* -** This file contains routines used to translate between UTF-8, +** This file contains routines used to translate between UTF-8, ** UTF-16, UTF-16BE, and UTF-16LE. ** ** Notes on UTF-8: @@ -27265,7 +27265,7 @@ SQLITE_PRIVATE u32 sqlite3Utf8Read( /* ** If the TRANSLATE_TRACE macro is defined, the value of each Mem is ** printed on stderr on the way into and out of sqlite3VdbeMemTranslate(). -*/ +*/ /* #define TRANSLATE_TRACE 1 */ #ifndef SQLITE_OMIT_UTF16 @@ -27296,7 +27296,7 @@ SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desired } #endif - /* If the translation is between UTF-16 little and big endian, then + /* If the translation is between UTF-16 little and big endian, then ** all that is required is to swap the byte order. This case is handled ** differently from the others. */ @@ -27374,13 +27374,13 @@ SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desired if( pMem->enc==SQLITE_UTF16LE ){ /* UTF-16 Little-endian -> UTF-8 */ while( zIn UTF-8 */ while( zIn=zEnd ) goto do_atof_calc; /*PREVENTS-HARMLESS-OVERREAD*/ @@ -28103,7 +28103,7 @@ do_atof_calc: } } }else{ - /* 1.0e+22 is the largest power of 10 than can be + /* 1.0e+22 is the largest power of 10 than can be ** represented exactly. */ while( e%22 ) { scale *= 1.0e+1; e -= 1; } while( e>0 ) { scale *= 1.0e+22; e -= 22; } @@ -28161,11 +28161,11 @@ static int compare2pow63(const char *zNum, int incr){ ** Convert zNum to a 64-bit signed integer. zNum must be decimal. This ** routine does *not* accept hexadecimal notation. ** -** If the zNum value is representable as a 64-bit twos-complement +** If the zNum value is representable as a 64-bit twos-complement ** integer, then write that value into *pNum and return 0. ** ** If zNum is exactly 9223372036854775808, return 2. This special -** case is broken out because while 9223372036854775808 cannot be a +** case is broken out because while 9223372036854775808 cannot be a ** signed 64-bit integer, its negative -9223372036854775808 can be. ** ** If zNum is too big for a 64-bit integer and is not @@ -28396,7 +28396,7 @@ static int SQLITE_NOINLINE putVarint64(unsigned char *p, u64 v){ v >>= 7; } return 9; - } + } n = 0; do{ buf[n++] = (u8)((v & 0x7f) | 0x80); @@ -28606,8 +28606,8 @@ SQLITE_PRIVATE u8 sqlite3GetVarint(const unsigned char *p, u64 *v){ ** If the varint stored in p[0] is larger than can fit in a 32-bit unsigned ** integer, then set *v to 0xffffffff. ** -** A MACRO version, getVarint32, is provided which inlines the -** single-byte case. All code should use the MACRO version as +** A MACRO version, getVarint32, is provided which inlines the +** single-byte case. All code should use the MACRO version as ** this function assumes the single-byte case has already been handled. */ SQLITE_PRIVATE u8 sqlite3GetVarint32(const unsigned char *p, u32 *v){ @@ -28825,7 +28825,7 @@ SQLITE_PRIVATE void *sqlite3HexToBlob(sqlite3 *db, const char *z, int n){ ** argument. The zType is a word like "NULL" or "closed" or "invalid". */ static void logBadConnection(const char *zType){ - sqlite3_log(SQLITE_MISUSE, + sqlite3_log(SQLITE_MISUSE, "API call with %s database connection pointer", zType ); @@ -28899,7 +28899,7 @@ SQLITE_PRIVATE int sqlite3AddInt64(i64 *pA, i64 iB){ if( iA<0 && -(iA + LARGEST_INT64) > iB + 1 ) return 1; } *pA += iB; - return 0; + return 0; #endif } SQLITE_PRIVATE int sqlite3SubInt64(i64 *pA, i64 iB){ @@ -28945,7 +28945,7 @@ SQLITE_PRIVATE int sqlite3MulInt64(i64 *pA, i64 iB){ } /* -** Compute the absolute value of a 32-bit signed integer, of possible. Or +** Compute the absolute value of a 32-bit signed integer, of possible. Or ** if the integer has a value of -2147483648, return +2147483647 */ SQLITE_PRIVATE int sqlite3AbsInt32(int x){ @@ -28985,11 +28985,11 @@ SQLITE_PRIVATE void sqlite3FileSuffix3(const char *zBaseFilename, char *z){ } #endif -/* +/* ** Find (an approximate) sum of two LogEst values. This computation is ** not a simple "+" operator because LogEst is stored as a logarithmic ** value. -** +** */ SQLITE_PRIVATE LogEst sqlite3LogEstAdd(LogEst a, LogEst b){ static const unsigned char x[] = { @@ -29097,8 +29097,8 @@ SQLITE_PRIVATE u64 sqlite3LogEstToInt(LogEst x){ ** Conceptually: ** ** struct VList { -** int nAlloc; // Number of allocated slots -** int nUsed; // Number of used slots +** int nAlloc; // Number of allocated slots +** int nUsed; // Number of used slots ** struct VListEntry { ** int iValue; // Value for this entry ** int nSlot; // Slots used by this entry @@ -29107,7 +29107,7 @@ SQLITE_PRIVATE u64 sqlite3LogEstToInt(LogEst x){ ** } ** ** During code generation, pointers to the variable names within the -** VList are taken. When that happens, nAlloc is set to zero as an +** VList are taken. When that happens, nAlloc is set to zero as an ** indication that the VList may never again be enlarged, since the ** accompanying realloc() would invalidate the pointers. */ @@ -29298,7 +29298,7 @@ static int rehash(Hash *pH, unsigned int new_size){ /* The inability to allocates space for a larger hash table is ** a performance hit but it is not a fatal error. So mark the - ** allocation as a benign. Use sqlite3Malloc()/memset(0) instead of + ** allocation as a benign. Use sqlite3Malloc()/memset(0) instead of ** sqlite3MallocZero() to make the allocation, as sqlite3MallocZero() ** only zeroes the requested number of bytes whereas this module will ** use the actual amount of space allocated for the hash table (which @@ -29348,7 +29348,7 @@ static HashElem *findElementWithHash( *pHash = h; while( count-- ){ assert( elem!=0 ); - if( sqlite3StrICmp(elem->pKey,pKey)==0 ){ + if( sqlite3StrICmp(elem->pKey,pKey)==0 ){ return elem; } elem = elem->next; @@ -29366,7 +29366,7 @@ static void removeElementGivenHash( ){ struct _ht *pEntry; if( elem->prev ){ - elem->prev->next = elem->next; + elem->prev->next = elem->next; }else{ pH->first = elem->next; } @@ -29698,7 +29698,7 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ ** Styles 4, 5, and 7 are only available of SQLITE_ENABLE_LOCKING_STYLE ** is defined to 1. The SQLITE_ENABLE_LOCKING_STYLE also enables automatic ** selection of the appropriate locking style based on the filesystem -** where the database is located. +** where the database is located. */ #if !defined(SQLITE_ENABLE_LOCKING_STYLE) # if defined(__APPLE__) @@ -29809,7 +29809,7 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ #define osGetpid(X) (pid_t)getpid() /* -** Only set the lastErrno if the error code is a real error and not +** Only set the lastErrno if the error code is a real error and not ** a normal expected return code of SQLITE_BUSY or SQLITE_OK */ #define IS_LOCK_ERROR(x) ((x != SQLITE_OK) && (x != SQLITE_BUSY)) @@ -29876,7 +29876,7 @@ struct unixFile { ** whenever any part of the database changes. An assertion fault will ** occur if a file is updated without also updating the transaction ** counter. This test is made to avoid new problems similar to the - ** one described by ticket #3584. + ** one described by ticket #3584. */ unsigned char transCntrChng; /* True if the transaction counter changed */ unsigned char dbUpdate; /* True if any part of database file changed */ @@ -29885,7 +29885,7 @@ struct unixFile { #endif #ifdef SQLITE_TEST - /* In test mode, increase the size of this structure a bit so that + /* In test mode, increase the size of this structure a bit so that ** it is larger than the struct CrashFile defined in test6.c. */ char aPadding[32]; @@ -30015,7 +30015,7 @@ static pid_t randomnessPid = 0; __asm__ __volatile__ ("rdtsc" : "=A" (val)); return val; } - + #elif (defined(__GNUC__) && defined(__ppc__)) __inline__ sqlite_uint64 sqlite3Hwtime(void){ @@ -30214,7 +30214,7 @@ static struct unix_syscall { #ifdef __DJGPP__ { "fstat", 0, 0 }, #define osFstat(a,b,c) 0 -#else +#else { "fstat", (sqlite3_syscall_ptr)fstat, 0 }, #define osFstat ((int(*)(int,struct stat*))aSyscall[5].pCurrent) #endif @@ -30436,7 +30436,7 @@ static const char *unixNextSystemCall(sqlite3_vfs *p, const char *zName){ /* ** Do not accept any file descriptor less than this value, in order to avoid -** opening database file using file descriptors that are commonly used for +** opening database file using file descriptors that are commonly used for ** standard input, output, and error. */ #ifndef SQLITE_MINIMUM_FILE_DESCRIPTOR @@ -30475,7 +30475,7 @@ static int robust_open(const char *z, int f, mode_t m){ } if( fd>=SQLITE_MINIMUM_FILE_DESCRIPTOR ) break; osClose(fd); - sqlite3_log(SQLITE_WARNING, + sqlite3_log(SQLITE_WARNING, "attempt to open \"%s\" as file descriptor %d", z, fd); fd = -1; if( osOpen("/dev/null", f, m)<0 ) break; @@ -30483,9 +30483,9 @@ static int robust_open(const char *z, int f, mode_t m){ if( fd>=0 ){ if( m!=0 ){ struct stat statbuf; - if( osFstat(fd, &statbuf)==0 + if( osFstat(fd, &statbuf)==0 && statbuf.st_size==0 - && (statbuf.st_mode&0777)!=m + && (statbuf.st_mode&0777)!=m ){ osFchmod(fd, m); } @@ -30500,11 +30500,11 @@ static int robust_open(const char *z, int f, mode_t m){ /* ** Helper functions to obtain and relinquish the global mutex. The ** global mutex is used to protect the unixInodeInfo and -** vxworksFileId objects used by this file, all of which may be +** vxworksFileId objects used by this file, all of which may be ** shared by multiple threads. ** -** Function unixMutexHeld() is used to assert() that the global mutex -** is held when required. This function is only used as part of assert() +** Function unixMutexHeld() is used to assert() that the global mutex +** is held when required. This function is only used as part of assert() ** statements. e.g. ** ** unixEnterMutex() @@ -30612,7 +30612,7 @@ static int lockTrace(int fd, int op, struct flock *p){ static int robust_ftruncate(int h, sqlite3_int64 sz){ int rc; #ifdef __ANDROID__ - /* On Android, ftruncate() always uses 32-bit offsets, even if + /* On Android, ftruncate() always uses 32-bit offsets, even if ** _FILE_OFFSET_BITS=64 is defined. This means it is unsafe to attempt to ** truncate a file to any size larger than 2GiB. Silently ignore any ** such attempts. */ @@ -30628,32 +30628,32 @@ static int robust_ftruncate(int h, sqlite3_int64 sz){ ** This routine translates a standard POSIX errno code into something ** useful to the clients of the sqlite3 functions. Specifically, it is ** intended to translate a variety of "try again" errors into SQLITE_BUSY -** and a variety of "please close the file descriptor NOW" errors into +** and a variety of "please close the file descriptor NOW" errors into ** SQLITE_IOERR -** +** ** Errors during initialization of locks, or file system support for locks, ** should handle ENOLCK, ENOTSUP, EOPNOTSUPP separately. */ static int sqliteErrorFromPosixError(int posixError, int sqliteIOErr) { - assert( (sqliteIOErr == SQLITE_IOERR_LOCK) || - (sqliteIOErr == SQLITE_IOERR_UNLOCK) || + assert( (sqliteIOErr == SQLITE_IOERR_LOCK) || + (sqliteIOErr == SQLITE_IOERR_UNLOCK) || (sqliteIOErr == SQLITE_IOERR_RDLOCK) || (sqliteIOErr == SQLITE_IOERR_CHECKRESERVEDLOCK) ); switch (posixError) { - case EACCES: + case EACCES: case EAGAIN: case ETIMEDOUT: case EBUSY: case EINTR: - case ENOLCK: - /* random NFS retry error, unless during file system support + case ENOLCK: + /* random NFS retry error, unless during file system support * introspection, in which it actually means what it says */ return SQLITE_BUSY; - - case EPERM: + + case EPERM: return SQLITE_PERM; - - default: + + default: return sqliteIOErr; } } @@ -30668,7 +30668,7 @@ static int sqliteErrorFromPosixError(int posixError, int sqliteIOErr) { ** ** A pointer to an instance of the following structure can be used as a ** unique file ID in VxWorks. Each instance of this structure contains -** a copy of the canonical filename. There is also a reference count. +** a copy of the canonical filename. There is also a reference count. ** The structure is reclaimed when the number of pointers to it drops to ** zero. ** @@ -30684,7 +30684,7 @@ struct vxworksFileId { }; #if OS_VXWORKS -/* +/* ** All unique filenames are held on a linked list headed by this ** variable: */ @@ -30756,7 +30756,7 @@ static struct vxworksFileId *vxworksFindFileId(const char *zAbsoluteName){ */ unixEnterMutex(); for(pCandidate=vxworksFileList; pCandidate; pCandidate=pCandidate->pNext){ - if( pCandidate->nName==n + if( pCandidate->nName==n && memcmp(pCandidate->zCanonicalName, pNew->zCanonicalName, n)==0 ){ sqlite3_free(pNew); @@ -30849,7 +30849,7 @@ static void vxworksReleaseFileId(struct vxworksFileId *pId){ ** cnt>0 means there are cnt shared locks on the file. ** ** Any attempt to lock or unlock a file first checks the locking -** structure. The fcntl() system call is only invoked to set a +** structure. The fcntl() system call is only invoked to set a ** POSIX lock if the internal lock structure transitions between ** a locked and an unlocked state. ** @@ -30882,7 +30882,7 @@ static void vxworksReleaseFileId(struct vxworksFileId *pId){ ** ** SQLite used to support LinuxThreads. But support for LinuxThreads ** was dropped beginning with version 3.7.0. SQLite will still work with -** LinuxThreads provided that (1) there is no more than one connection +** LinuxThreads provided that (1) there is no more than one connection ** per database file in the same process and (2) database connections ** do not move across threads. */ @@ -30899,7 +30899,7 @@ struct unixFileId { /* We are told that some versions of Android contain a bug that ** sizes ino_t at only 32-bits instead of 64-bits. (See ** https://android-review.googlesource.com/#/c/115351/3/dist/sqlite3.c) - ** To work around this, always allocate 64-bits for the inode number. + ** To work around this, always allocate 64-bits for the inode number. ** On small machines that only have 32-bit inodes, this wastes 4 bytes, ** but that should not be a big deal. */ /* WAS: ino_t ino; */ @@ -30952,7 +30952,7 @@ static unixInodeInfo *inodeList = 0; ** strerror_r(). ** ** The first argument passed to the macro should be the error code that -** will be returned to SQLite (e.g. SQLITE_IOERR_DELETE, SQLITE_CANTOPEN). +** will be returned to SQLite (e.g. SQLITE_IOERR_DELETE, SQLITE_CANTOPEN). ** The two subsequent arguments should be the name of the OS function that ** failed (e.g. "unlink", "open") and the associated file-system path, ** if any. @@ -30970,7 +30970,7 @@ static int unixLogErrorAtLine( /* If this is not a threadsafe build (SQLITE_THREADSAFE==0), then use ** the strerror() function to obtain the human-readable error message ** equivalent to errno. Otherwise, use strerror_r(). - */ + */ #if SQLITE_THREADSAFE && defined(HAVE_STRERROR_R) char aErr[80]; memset(aErr, 0, sizeof(aErr)); @@ -30978,18 +30978,18 @@ static int unixLogErrorAtLine( /* If STRERROR_R_CHAR_P (set by autoconf scripts) or __USE_GNU is defined, ** assume that the system provides the GNU version of strerror_r() that - ** returns a pointer to a buffer containing the error message. That pointer - ** may point to aErr[], or it may point to some static storage somewhere. - ** Otherwise, assume that the system provides the POSIX version of + ** returns a pointer to a buffer containing the error message. That pointer + ** may point to aErr[], or it may point to some static storage somewhere. + ** Otherwise, assume that the system provides the POSIX version of ** strerror_r(), which always writes an error message into aErr[]. ** ** If the code incorrectly assumes that it is the POSIX version that is ** available, the error message will often be an empty string. Not a - ** huge problem. Incorrectly concluding that the GNU version is available + ** huge problem. Incorrectly concluding that the GNU version is available ** could lead to a segfault though. */ #if defined(STRERROR_R_CHAR_P) || defined(__USE_GNU) - zErr = + zErr = # endif strerror_r(iErrno, aErr, sizeof(aErr)-1); @@ -31040,7 +31040,7 @@ static void storeLastErrno(unixFile *pFile, int error){ /* ** Close all file descriptors accumuated in the unixInodeInfo->pUnused list. -*/ +*/ static void closePendingFds(unixFile *pFile){ unixInodeInfo *pInode = pFile->pInode; UnixUnusedFd *p; @@ -31188,7 +31188,7 @@ static int fileHasMoved(unixFile *pFile){ return 0; return pFile->pInode!=0 && - (osStat(pFile->zPath, &buf)!=0 + (osStat(pFile->zPath, &buf)!=0 || (u64)buf.st_ino!=pFile->pInode->fileId.ino); #endif } @@ -31269,7 +31269,7 @@ static int unixCheckReservedLock(sqlite3_file *id, int *pResOut){ } } #endif - + unixLeaveMutex(); OSTRACE(("TEST WR-LOCK %d %d %d (unix)\n", pFile->h, rc, reserved)); @@ -31278,7 +31278,7 @@ static int unixCheckReservedLock(sqlite3_file *id, int *pResOut){ } /* -** Attempt to set a system-lock on the file pFile. The lock is +** Attempt to set a system-lock on the file pFile. The lock is ** described by pLock. ** ** If the pFile was opened read/write from unix-excl, then the only lock @@ -31370,7 +31370,7 @@ static int unixLock(sqlite3_file *id, int eFileLock){ ** ** A process may only obtain a RESERVED lock after it has a SHARED lock. ** A RESERVED lock is implemented by grabbing a write-lock on the - ** 'reserved byte'. + ** 'reserved byte'. ** ** A process may only obtain a PENDING lock after it has obtained a ** SHARED lock. A PENDING lock is implemented by obtaining a write-lock @@ -31384,7 +31384,7 @@ static int unixLock(sqlite3_file *id, int eFileLock){ ** implemented by obtaining a write-lock on the entire 'shared byte ** range'. Since all other locks require a read-lock on one of the bytes ** within this range, this ensures that no other locks are held on the - ** database. + ** database. */ int rc = SQLITE_OK; unixFile *pFile = (unixFile*)id; @@ -31425,7 +31425,7 @@ static int unixLock(sqlite3_file *id, int eFileLock){ /* If some thread using this PID has a lock via a different unixFile* ** handle that precludes the requested lock, return BUSY. */ - if( (pFile->eFileLock!=pInode->eFileLock && + if( (pFile->eFileLock!=pInode->eFileLock && (pInode->eFileLock>=PENDING_LOCK || eFileLock>SHARED_LOCK)) ){ rc = SQLITE_BUSY; @@ -31436,7 +31436,7 @@ static int unixLock(sqlite3_file *id, int eFileLock){ ** has a SHARED or RESERVED lock, then increment reference counts and ** return SQLITE_OK. */ - if( eFileLock==SHARED_LOCK && + if( eFileLock==SHARED_LOCK && (pInode->eFileLock==SHARED_LOCK || pInode->eFileLock==RESERVED_LOCK) ){ assert( eFileLock==SHARED_LOCK ); assert( pFile->eFileLock==0 ); @@ -31454,7 +31454,7 @@ static int unixLock(sqlite3_file *id, int eFileLock){ */ lock.l_len = 1L; lock.l_whence = SEEK_SET; - if( eFileLock==SHARED_LOCK + if( eFileLock==SHARED_LOCK || (eFileLock==EXCLUSIVE_LOCK && pFile->eFileLockh, azFileLock(eFileLock), + OSTRACE(("LOCK %d %s %s (unix)\n", pFile->h, azFileLock(eFileLock), rc==SQLITE_OK ? "ok" : "failed")); return rc; } @@ -31588,11 +31588,11 @@ static void setPendingFd(unixFile *pFile){ ** ** If the locking level of the file descriptor is already at or below ** the requested locking level, this routine is a no-op. -** +** ** If handleNFSUnlock is true, then on downgrading an EXCLUSIVE_LOCK to SHARED ** the byte range is divided into 2 parts and the first part is unlocked then -** set to a read lock, then the other part is simply unlocked. This works -** around a bug in BSD NFS lockd (also seen on MacOSX 10.3+) that fails to +** set to a read lock, then the other part is simply unlocked. This works +** around a bug in BSD NFS lockd (also seen on MacOSX 10.3+) that fails to ** remove the write lock on a region when a read lock is set. */ static int posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnlock){ @@ -31630,7 +31630,7 @@ static int posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnlock){ /* downgrading to a shared lock on NFS involves clearing the write lock ** before establishing the readlock - to avoid a race condition we downgrade - ** the lock in 2 blocks, so that part of the range will be covered by a + ** the lock in 2 blocks, so that part of the range will be covered by a ** write lock until the rest is covered by a read lock: ** 1: [WWWWW] ** 2: [....W] @@ -31646,7 +31646,7 @@ static int posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnlock){ if( handleNFSUnlock ){ int tErrno; /* Error code from system call errors */ off_t divSize = SHARED_SIZE - 1; - + lock.l_type = F_UNLCK; lock.l_whence = SEEK_SET; lock.l_start = SHARED_FIRST; @@ -31688,11 +31688,11 @@ static int posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnlock){ lock.l_len = SHARED_SIZE; if( unixFileLock(pFile, &lock) ){ /* In theory, the call to unixFileLock() cannot fail because another - ** process is holding an incompatible lock. If it does, this + ** process is holding an incompatible lock. If it does, this ** indicates that the other process is not following the locking ** protocol. If this happens, return SQLITE_IOERR_RDLOCK. Returning - ** SQLITE_BUSY would confuse the upper layer (in practice it causes - ** an assert to fail). */ + ** SQLITE_BUSY would confuse the upper layer (in practice it causes + ** an assert to fail). */ rc = SQLITE_IOERR_RDLOCK; storeLastErrno(pFile, errno); goto end_unlock; @@ -31768,7 +31768,7 @@ static void unixUnmapfile(unixFile *pFd); #endif /* -** This function performs the parts of the "close file" operation +** This function performs the parts of the "close file" operation ** common to all locking schemes. It closes the directory and file ** handles, if they are valid, and sets all fields of the unixFile ** structure to 0. @@ -31826,7 +31826,7 @@ static int unixClose(sqlite3_file *id){ if( ALWAYS(pFile->pInode) && pFile->pInode->nLock ){ /* If there are outstanding locks, do not actually close the file just ** yet because that would clear those locks. Instead, add the file - ** descriptor to pInode->pUnused list. It will be automatically closed + ** descriptor to pInode->pUnused list. It will be automatically closed ** when the last lock is cleared. */ setPendingFd(pFile); @@ -31925,7 +31925,7 @@ static int dotlockCheckReservedLock(sqlite3_file *id, int *pResOut) { unixFile *pFile = (unixFile*)id; SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); - + assert( pFile ); reserved = osAccess((const char*)pFile->lockingContext, 0)==0; OSTRACE(("TEST WR-LOCK %d %d %d (dotlock)\n", pFile->h, rc, reserved)); @@ -31979,7 +31979,7 @@ static int dotlockLock(sqlite3_file *id, int eFileLock) { #endif return SQLITE_OK; } - + /* grab an exclusive lock */ rc = osMkdir(zLockFile, 0777); if( rc<0 ){ @@ -31994,8 +31994,8 @@ static int dotlockLock(sqlite3_file *id, int eFileLock) { } } return rc; - } - + } + /* got it, set the type and return ok */ pFile->eFileLock = eFileLock; return rc; @@ -32019,7 +32019,7 @@ static int dotlockUnlock(sqlite3_file *id, int eFileLock) { OSTRACE(("UNLOCK %d %d was %d pid=%d (dotlock)\n", pFile->h, eFileLock, pFile->eFileLock, osGetpid(0))); assert( eFileLock<=SHARED_LOCK ); - + /* no-op if possible */ if( pFile->eFileLock==eFileLock ){ return SQLITE_OK; @@ -32032,7 +32032,7 @@ static int dotlockUnlock(sqlite3_file *id, int eFileLock) { pFile->eFileLock = SHARED_LOCK; return SQLITE_OK; } - + /* To fully unlock the database, delete the lock file */ assert( eFileLock==NO_LOCK ); rc = osRmdir(zLockFile); @@ -32044,7 +32044,7 @@ static int dotlockUnlock(sqlite3_file *id, int eFileLock) { rc = SQLITE_IOERR_UNLOCK; storeLastErrno(pFile, tErrno); } - return rc; + return rc; } pFile->eFileLock = NO_LOCK; return SQLITE_OK; @@ -32091,7 +32091,7 @@ static int robust_flock(int fd, int op){ #else # define robust_flock(a,b) flock(a,b) #endif - + /* ** This routine checks if there is a RESERVED lock held on the specified @@ -32103,16 +32103,16 @@ static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){ int rc = SQLITE_OK; int reserved = 0; unixFile *pFile = (unixFile*)id; - + SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); - + assert( pFile ); - + /* Check if a thread in this process holds such a lock */ if( pFile->eFileLock>SHARED_LOCK ){ reserved = 1; } - + /* Otherwise see if some other process holds it. */ if( !reserved ){ /* attempt to get the lock */ @@ -32123,7 +32123,7 @@ static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){ if ( lrc ) { int tErrno = errno; /* unlock failed with an error */ - lrc = SQLITE_IOERR_UNLOCK; + lrc = SQLITE_IOERR_UNLOCK; storeLastErrno(pFile, tErrno); rc = lrc; } @@ -32131,7 +32131,7 @@ static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){ int tErrno = errno; reserved = 1; /* someone else might have it reserved */ - lrc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_LOCK); + lrc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_LOCK); if( IS_LOCK_ERROR(lrc) ){ storeLastErrno(pFile, tErrno); rc = lrc; @@ -32185,15 +32185,15 @@ static int flockLock(sqlite3_file *id, int eFileLock) { assert( pFile ); - /* if we already have a lock, it is exclusive. + /* if we already have a lock, it is exclusive. ** Just adjust level and punt on outta here. */ if (pFile->eFileLock > NO_LOCK) { pFile->eFileLock = eFileLock; return SQLITE_OK; } - + /* grab an exclusive lock */ - + if (robust_flock(pFile->h, LOCK_EX | LOCK_NB)) { int tErrno = errno; /* didn't get, must be busy */ @@ -32205,7 +32205,7 @@ static int flockLock(sqlite3_file *id, int eFileLock) { /* got it, set the type and return ok */ pFile->eFileLock = eFileLock; } - OSTRACE(("LOCK %d %s %s (flock)\n", pFile->h, azFileLock(eFileLock), + OSTRACE(("LOCK %d %s %s (flock)\n", pFile->h, azFileLock(eFileLock), rc==SQLITE_OK ? "ok" : "failed")); #ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS if( (rc & SQLITE_IOERR) == SQLITE_IOERR ){ @@ -32225,23 +32225,23 @@ static int flockLock(sqlite3_file *id, int eFileLock) { */ static int flockUnlock(sqlite3_file *id, int eFileLock) { unixFile *pFile = (unixFile*)id; - + assert( pFile ); OSTRACE(("UNLOCK %d %d was %d pid=%d (flock)\n", pFile->h, eFileLock, pFile->eFileLock, osGetpid(0))); assert( eFileLock<=SHARED_LOCK ); - + /* no-op if possible */ if( pFile->eFileLock==eFileLock ){ return SQLITE_OK; } - + /* shared can just be set because we always have an exclusive */ if (eFileLock==SHARED_LOCK) { pFile->eFileLock = eFileLock; return SQLITE_OK; } - + /* no, really, unlock. */ if( robust_flock(pFile->h, LOCK_UN) ){ #ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS @@ -32292,14 +32292,14 @@ static int semXCheckReservedLock(sqlite3_file *id, int *pResOut) { unixFile *pFile = (unixFile*)id; SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); - + assert( pFile ); /* Check if a thread in this process holds such a lock */ if( pFile->eFileLock>SHARED_LOCK ){ reserved = 1; } - + /* Otherwise see if some other process holds it. */ if( !reserved ){ sem_t *pSem = pFile->pInode->pSem; @@ -32358,14 +32358,14 @@ static int semXLock(sqlite3_file *id, int eFileLock) { sem_t *pSem = pFile->pInode->pSem; int rc = SQLITE_OK; - /* if we already have a lock, it is exclusive. + /* if we already have a lock, it is exclusive. ** Just adjust level and punt on outta here. */ if (pFile->eFileLock > NO_LOCK) { pFile->eFileLock = eFileLock; rc = SQLITE_OK; goto sem_end_lock; } - + /* lock semaphore now but bail out when already locked. */ if( sem_trywait(pSem)==-1 ){ rc = SQLITE_BUSY; @@ -32395,18 +32395,18 @@ static int semXUnlock(sqlite3_file *id, int eFileLock) { OSTRACE(("UNLOCK %d %d was %d pid=%d (sem)\n", pFile->h, eFileLock, pFile->eFileLock, osGetpid(0))); assert( eFileLock<=SHARED_LOCK ); - + /* no-op if possible */ if( pFile->eFileLock==eFileLock ){ return SQLITE_OK; } - + /* shared can just be set because we always have an exclusive */ if (eFileLock==SHARED_LOCK) { pFile->eFileLock = eFileLock; return SQLITE_OK; } - + /* no, really unlock. */ if ( sem_post(pSem)==-1 ) { int rc, tErrno = errno; @@ -32414,7 +32414,7 @@ static int semXUnlock(sqlite3_file *id, int eFileLock) { if( IS_LOCK_ERROR(rc) ){ storeLastErrno(pFile, tErrno); } - return rc; + return rc; } pFile->eFileLock = NO_LOCK; return SQLITE_OK; @@ -32479,7 +32479,7 @@ struct ByteRangeLockPB2 /* ** This is a utility for setting or clearing a bit-range lock on an ** AFP filesystem. -** +** ** Return SQLITE_OK on success, SQLITE_BUSY on failure. */ static int afpSetLock( @@ -32491,14 +32491,14 @@ static int afpSetLock( ){ struct ByteRangeLockPB2 pb; int err; - + pb.unLockFlag = setLockFlag ? 0 : 1; pb.startEndFlag = 0; pb.offset = offset; - pb.length = length; + pb.length = length; pb.fd = pFile->h; - - OSTRACE(("AFPSETLOCK [%s] for %d%s in range %llx:%llx\n", + + OSTRACE(("AFPSETLOCK [%s] for %d%s in range %llx:%llx\n", (setLockFlag?"ON":"OFF"), pFile->h, (pb.fd==-1?"[testval-1]":""), offset, length)); err = fsctl(path, afpfsByteRangeLock2FSCTL, &pb, 0); @@ -32533,9 +32533,9 @@ static int afpCheckReservedLock(sqlite3_file *id, int *pResOut){ int reserved = 0; unixFile *pFile = (unixFile*)id; afpLockingContext *context; - + SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); - + assert( pFile ); context = (afpLockingContext *) pFile->lockingContext; if( context->reserved ){ @@ -32543,17 +32543,17 @@ static int afpCheckReservedLock(sqlite3_file *id, int *pResOut){ return SQLITE_OK; } unixEnterMutex(); /* Because pFile->pInode is shared across threads */ - + /* Check if a thread in this process holds such a lock */ if( pFile->pInode->eFileLock>SHARED_LOCK ){ reserved = 1; } - + /* Otherwise see if some other process holds it. */ if( !reserved ){ /* lock the RESERVED byte */ - int lrc = afpSetLock(context->dbPath, pFile, RESERVED_BYTE, 1,1); + int lrc = afpSetLock(context->dbPath, pFile, RESERVED_BYTE, 1,1); if( SQLITE_OK==lrc ){ /* if we succeeded in taking the reserved lock, unlock it to restore ** the original state */ @@ -32566,10 +32566,10 @@ static int afpCheckReservedLock(sqlite3_file *id, int *pResOut){ rc=lrc; } } - + unixLeaveMutex(); OSTRACE(("TEST WR-LOCK %d %d %d (afp)\n", pFile->h, rc, reserved)); - + *pResOut = reserved; return rc; } @@ -32603,7 +32603,7 @@ static int afpLock(sqlite3_file *id, int eFileLock){ unixFile *pFile = (unixFile*)id; unixInodeInfo *pInode = pFile->pInode; afpLockingContext *context = (afpLockingContext *) pFile->lockingContext; - + assert( pFile ); OSTRACE(("LOCK %d %s was %s(%s,%d) pid=%d (afp)\n", pFile->h, azFileLock(eFileLock), azFileLock(pFile->eFileLock), @@ -32627,7 +32627,7 @@ static int afpLock(sqlite3_file *id, int eFileLock){ assert( pFile->eFileLock!=NO_LOCK || eFileLock==SHARED_LOCK ); assert( eFileLock!=PENDING_LOCK ); assert( eFileLock!=RESERVED_LOCK || pFile->eFileLock==SHARED_LOCK ); - + /* This mutex is needed because pFile->pInode is shared across threads */ unixEnterMutex(); @@ -32636,18 +32636,18 @@ static int afpLock(sqlite3_file *id, int eFileLock){ /* If some thread using this PID has a lock via a different unixFile* ** handle that precludes the requested lock, return BUSY. */ - if( (pFile->eFileLock!=pInode->eFileLock && + if( (pFile->eFileLock!=pInode->eFileLock && (pInode->eFileLock>=PENDING_LOCK || eFileLock>SHARED_LOCK)) ){ rc = SQLITE_BUSY; goto afp_end_lock; } - + /* If a SHARED lock is requested, and some thread using this PID already ** has a SHARED or RESERVED lock, then increment reference counts and ** return SQLITE_OK. */ - if( eFileLock==SHARED_LOCK && + if( eFileLock==SHARED_LOCK && (pInode->eFileLock==SHARED_LOCK || pInode->eFileLock==RESERVED_LOCK) ){ assert( eFileLock==SHARED_LOCK ); assert( pFile->eFileLock==0 ); @@ -32657,12 +32657,12 @@ static int afpLock(sqlite3_file *id, int eFileLock){ pInode->nLock++; goto afp_end_lock; } - + /* A PENDING lock is needed before acquiring a SHARED lock and before ** acquiring an EXCLUSIVE lock. For the SHARED lock, the PENDING will ** be released. */ - if( eFileLock==SHARED_LOCK + if( eFileLock==SHARED_LOCK || (eFileLock==EXCLUSIVE_LOCK && pFile->eFileLocknShared==0 ); assert( pInode->eFileLock==0 ); - + mask = (sizeof(long)==8) ? LARGEST_INT64 : 0x7fffffff; /* Now get the read-lock SHARED_LOCK */ /* note that the quality of the randomness doesn't matter that much */ - lk = random(); + lk = random(); pInode->sharedByte = (lk & mask)%(SHARED_SIZE - 1); - lrc1 = afpSetLock(context->dbPath, pFile, + lrc1 = afpSetLock(context->dbPath, pFile, SHARED_FIRST+pInode->sharedByte, 1, 1); if( IS_LOCK_ERROR(lrc1) ){ lrc1Errno = pFile->lastErrno; } /* Drop the temporary PENDING lock */ lrc2 = afpSetLock(context->dbPath, pFile, PENDING_BYTE, 1, 0); - + if( IS_LOCK_ERROR(lrc1) ) { storeLastErrno(pFile, lrc1Errno); rc = lrc1; @@ -32730,34 +32730,34 @@ static int afpLock(sqlite3_file *id, int eFileLock){ } if (!failed && eFileLock == EXCLUSIVE_LOCK) { /* Acquire an EXCLUSIVE lock */ - - /* Remove the shared lock before trying the range. we'll need to + + /* Remove the shared lock before trying the range. we'll need to ** reestablish the shared lock if we can't get the afpUnlock */ if( !(failed = afpSetLock(context->dbPath, pFile, SHARED_FIRST + pInode->sharedByte, 1, 0)) ){ int failed2 = SQLITE_OK; /* now attemmpt to get the exclusive lock range */ - failed = afpSetLock(context->dbPath, pFile, SHARED_FIRST, + failed = afpSetLock(context->dbPath, pFile, SHARED_FIRST, SHARED_SIZE, 1); - if( failed && (failed2 = afpSetLock(context->dbPath, pFile, + if( failed && (failed2 = afpSetLock(context->dbPath, pFile, SHARED_FIRST + pInode->sharedByte, 1, 1)) ){ /* Can't reestablish the shared lock. Sqlite can't deal, this is ** a critical I/O error */ - rc = ((failed & SQLITE_IOERR) == SQLITE_IOERR) ? failed2 : + rc = ((failed & SQLITE_IOERR) == SQLITE_IOERR) ? failed2 : SQLITE_IOERR_LOCK; goto afp_end_lock; - } + } }else{ - rc = failed; + rc = failed; } } if( failed ){ rc = failed; } } - + if( rc==SQLITE_OK ){ pFile->eFileLock = eFileLock; pInode->eFileLock = eFileLock; @@ -32765,10 +32765,10 @@ static int afpLock(sqlite3_file *id, int eFileLock){ pFile->eFileLock = PENDING_LOCK; pInode->eFileLock = PENDING_LOCK; } - + afp_end_lock: unixLeaveMutex(); - OSTRACE(("LOCK %d %s %s (afp)\n", pFile->h, azFileLock(eFileLock), + OSTRACE(("LOCK %d %s %s (afp)\n", pFile->h, azFileLock(eFileLock), rc==SQLITE_OK ? "ok" : "failed")); return rc; } @@ -32807,7 +32807,7 @@ static int afpUnlock(sqlite3_file *id, int eFileLock) { SimulateIOErrorBenign(1); SimulateIOError( h=(-1) ) SimulateIOErrorBenign(0); - + #ifdef SQLITE_DEBUG /* When reducing a lock such that other processes can start ** reading the database file again, make sure that the @@ -32822,7 +32822,7 @@ static int afpUnlock(sqlite3_file *id, int eFileLock) { || pFile->transCntrChng==1 ); pFile->inNormalWrite = 0; #endif - + if( pFile->eFileLock==EXCLUSIVE_LOCK ){ rc = afpSetLock(context->dbPath, pFile, SHARED_FIRST, SHARED_SIZE, 0); if( rc==SQLITE_OK && (eFileLock==SHARED_LOCK || pInode->nShared>1) ){ @@ -32835,11 +32835,11 @@ static int afpUnlock(sqlite3_file *id, int eFileLock) { } if( rc==SQLITE_OK && pFile->eFileLock>=PENDING_LOCK ){ rc = afpSetLock(context->dbPath, pFile, PENDING_BYTE, 1, 0); - } + } if( rc==SQLITE_OK && pFile->eFileLock>=RESERVED_LOCK && context->reserved ){ rc = afpSetLock(context->dbPath, pFile, RESERVED_BYTE, 1, 0); - if( !rc ){ - context->reserved = 0; + if( !rc ){ + context->reserved = 0; } } if( rc==SQLITE_OK && (eFileLock==SHARED_LOCK || pInode->nShared>1)){ @@ -32874,14 +32874,14 @@ static int afpUnlock(sqlite3_file *id, int eFileLock) { } } } - + unixLeaveMutex(); if( rc==SQLITE_OK ) pFile->eFileLock = eFileLock; return rc; } /* -** Close a file & cleanup AFP specific locking context +** Close a file & cleanup AFP specific locking context */ static int afpClose(sqlite3_file *id) { int rc = SQLITE_OK; @@ -32933,7 +32933,7 @@ static int nfsUnlock(sqlite3_file *id, int eFileLock){ /* ** The code above is the NFS lock implementation. The code is specific ** to MacOSX and does not work on other unix platforms. No alternative -** is available. +** is available. ** ********************* End of the NFS lock implementation ********************** ******************************************************************************/ @@ -32941,7 +32941,7 @@ static int nfsUnlock(sqlite3_file *id, int eFileLock){ /****************************************************************************** **************** Non-locking sqlite3_file methods ***************************** ** -** The next division contains implementations for all methods of the +** The next division contains implementations for all methods of the ** sqlite3_file object other than the locking methods. The locking ** methods were defined in divisions above (one locking method per ** division). Those methods that are common to all locking modes @@ -32949,7 +32949,7 @@ static int nfsUnlock(sqlite3_file *id, int eFileLock){ */ /* -** Seek to the offset passed as the second argument, then read cnt +** Seek to the offset passed as the second argument, then read cnt ** bytes into pBuf. Return the number of bytes actually read. ** ** NB: If you define USE_PREAD or USE_PREAD64, then it might also @@ -33011,8 +33011,8 @@ static int seekAndRead(unixFile *id, sqlite3_int64 offset, void *pBuf, int cnt){ ** wrong. */ static int unixRead( - sqlite3_file *id, - void *pBuf, + sqlite3_file *id, + void *pBuf, int amt, sqlite3_int64 offset ){ @@ -33027,7 +33027,7 @@ static int unixRead( #if 0 assert( pFile->pUnused==0 || offset>=PENDING_BYTE+512 - || offset+amt<=PENDING_BYTE + || offset+amt<=PENDING_BYTE ); #endif @@ -33065,7 +33065,7 @@ static int unixRead( /* ** Attempt to seek the file-descriptor passed as the first argument to ** absolute offset iOff, then attempt to write nBuf bytes of data from -** pBuf to it. If an error occurs, return -1 and set *piErrno. Otherwise, +** pBuf to it. If an error occurs, return -1 and set *piErrno. Otherwise, ** return the actual number of bytes written (which may be less than ** nBuf). */ @@ -33125,10 +33125,10 @@ static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){ ** or some other error code on failure. */ static int unixWrite( - sqlite3_file *id, - const void *pBuf, + sqlite3_file *id, + const void *pBuf, int amt, - sqlite3_int64 offset + sqlite3_int64 offset ){ unixFile *pFile = (unixFile*)id; int wrote = 0; @@ -33140,7 +33140,7 @@ static int unixWrite( #if 0 assert( pFile->pUnused==0 || offset>=PENDING_BYTE+512 - || offset+amt<=PENDING_BYTE + || offset+amt<=PENDING_BYTE ); #endif @@ -33182,7 +33182,7 @@ static int unixWrite( } } #endif - + while( (wrote = seekAndWrite(pFile, offset, pBuf, amt))0 ){ amt -= wrote; offset += wrote; @@ -33248,8 +33248,8 @@ SQLITE_API int sqlite3_fullsync_count = 0; ** ** SQLite sets the dataOnly flag if the size of the file is unchanged. ** The idea behind dataOnly is that it should only write the file content -** to disk, not the inode. We only set dataOnly if the file size is -** unchanged since the file size is part of the inode. However, +** to disk, not the inode. We only set dataOnly if the file size is +** unchanged since the file size is part of the inode. However, ** Ted Ts'o tells us that fdatasync() will also write the inode if the ** file size has changed. The only real difference between fdatasync() ** and fsync(), Ted tells us, is that fdatasync() will not flush the @@ -33263,7 +33263,7 @@ static int full_fsync(int fd, int fullSync, int dataOnly){ int rc; /* The following "ifdef/elif/else/" block has the same structure as - ** the one below. It is replicated here solely to avoid cluttering + ** the one below. It is replicated here solely to avoid cluttering ** up the real code with the UNUSED_PARAMETER() macros. */ #ifdef SQLITE_NO_SYNC @@ -33277,7 +33277,7 @@ static int full_fsync(int fd, int fullSync, int dataOnly){ UNUSED_PARAMETER(dataOnly); #endif - /* Record the number of times that we do a normal fsync() and + /* Record the number of times that we do a normal fsync() and ** FULLSYNC. This is used during testing to verify that this procedure ** gets called with the correct arguments. */ @@ -33303,11 +33303,11 @@ static int full_fsync(int fd, int fullSync, int dataOnly){ rc = 1; } /* If the FULLFSYNC failed, fall back to attempting an fsync(). - ** It shouldn't be possible for fullfsync to fail on the local + ** It shouldn't be possible for fullfsync to fail on the local ** file system (on OSX), so failure indicates that FULLFSYNC - ** isn't supported for this file system. So, attempt an fsync - ** and (for now) ignore the overhead of a superfluous fcntl call. - ** It'd be better to detect fullfsync support once and avoid + ** isn't supported for this file system. So, attempt an fsync + ** and (for now) ignore the overhead of a superfluous fcntl call. + ** It'd be better to detect fullfsync support once and avoid ** the fcntl call every time sync is called. */ if( rc ) rc = fsync(fd); @@ -33317,7 +33317,7 @@ static int full_fsync(int fd, int fullSync, int dataOnly){ ** so currently we default to the macro that redefines fdatasync to fsync */ rc = fsync(fd); -#else +#else rc = fdatasync(fd); #if OS_VXWORKS if( rc==-1 && errno==ENOTSUP ){ @@ -33478,7 +33478,7 @@ static int unixTruncate(sqlite3_file *id, i64 nByte){ #if SQLITE_MAX_MMAP_SIZE>0 /* If the file was just truncated to a size smaller than the currently ** mapped region, reduce the effective mapping size as well. SQLite will - ** use read() and write() to access data beyond this point from now on. + ** use read() and write() to access data beyond this point from now on. */ if( nBytemmapSize ){ pFile->mmapSize = nByte; @@ -33524,8 +33524,8 @@ static int unixFileSize(sqlite3_file *id, i64 *pSize){ static int proxyFileControl(sqlite3_file*,int,void*); #endif -/* -** This function is called to handle the SQLITE_FCNTL_SIZE_HINT +/* +** This function is called to handle the SQLITE_FCNTL_SIZE_HINT ** file-control operation. Enlarge the database to nBytes in size ** (rounded up to the next chunk-size). If the database is already ** nBytes or larger, this routine is a no-op. @@ -33534,7 +33534,7 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){ if( pFile->szChunk>0 ){ i64 nSize; /* Required file size */ struct stat buf; /* Used to hold return values of fstat() */ - + if( osFstat(pFile->h, &buf) ){ return SQLITE_IOERR_FSTAT; } @@ -33543,8 +33543,8 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){ if( nSize>(i64)buf.st_size ){ #if defined(HAVE_POSIX_FALLOCATE) && HAVE_POSIX_FALLOCATE - /* The code below is handling the return value of osFallocate() - ** correctly. posix_fallocate() is defined to "returns zero on success, + /* The code below is handling the return value of osFallocate() + ** correctly. posix_fallocate() is defined to "returns zero on success, ** or an error number on failure". See the manpage for details. */ int err; do{ @@ -33552,7 +33552,7 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){ }while( err==EINTR ); if( err ) return SQLITE_IOERR_WRITE; #else - /* If the OS does not have posix_fallocate(), fake it. Write a + /* If the OS does not have posix_fallocate(), fake it. Write a ** single byte to the last byte in each block that falls entirely ** within the extended region. Then, if required, a single byte ** at offset (nSize-1), to set the size of the file correctly. @@ -33710,7 +33710,7 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){ ** a database and its journal file) that the sector size will be the ** same for both. */ -#ifndef __QNXNTO__ +#ifndef __QNXNTO__ static int unixSectorSize(sqlite3_file *NotUsed){ UNUSED_PARAMETER(NotUsed); return SQLITE_DEFAULT_SECTOR_SIZE; @@ -33727,7 +33727,7 @@ static int unixSectorSize(sqlite3_file *id){ unixFile *pFile = (unixFile*)id; if( pFile->sectorSize == 0 ){ struct statvfs fsInfo; - + /* Set defaults for non-supported filesystems */ pFile->sectorSize = SQLITE_DEFAULT_SECTOR_SIZE; pFile->deviceCharacteristics = 0; @@ -33828,7 +33828,7 @@ static int unixDeviceCharacteristics(sqlite3_file *id){ /* ** Return the system page size. ** -** This function should not be called directly by other code in this file. +** This function should not be called directly by other code in this file. ** Instead, it should be called via macro osGetpagesize(). */ static int unixGetpagesize(void){ @@ -33846,7 +33846,7 @@ static int unixGetpagesize(void){ #ifndef SQLITE_OMIT_WAL /* -** Object used to represent an shared memory buffer. +** Object used to represent an shared memory buffer. ** ** When multiple threads all reference the same wal-index, each thread ** has its own unixShm object, but they all point to a single instance @@ -33866,7 +33866,7 @@ static int unixGetpagesize(void){ ** nRef ** ** The following fields are read-only after the object is created: -** +** ** fid ** zFilename ** @@ -33993,7 +33993,7 @@ static int unixShmSystemLock( } #endif - return rc; + return rc; } /* @@ -34045,20 +34045,20 @@ static void unixShmPurge(unixFile *pFd){ } /* -** Open a shared-memory area associated with open database file pDbFd. +** Open a shared-memory area associated with open database file pDbFd. ** This particular implementation uses mmapped files. ** ** The file used to implement shared-memory is in the same directory ** as the open database file and has the same name as the open database ** file with the "-shm" suffix added. For example, if the database file ** is "/home/user1/config.db" then the file that is created and mmapped -** for shared memory will be called "/home/user1/config.db-shm". +** for shared memory will be called "/home/user1/config.db-shm". ** ** Another approach to is to use files in /dev/shm or /dev/tmp or an ** some other tmpfs mount. But if a file in a different directory ** from the database file is used, then differing access permissions ** or a chroot() might cause two different processes on the same -** database to end up using different files for shared memory - +** database to end up using different files for shared memory - ** meaning that their memory would not really be shared - resulting ** in database corruption. Nevertheless, this tmpfs file usage ** can be enabled at compile-time using -DSQLITE_SHM_DIRECTORY="/dev/shm" @@ -34127,7 +34127,7 @@ static int unixOpenSharedMemory(unixFile *pDbFd){ memset(pShmNode, 0, sizeof(*pShmNode)+nShmFilename); zShmFilename = pShmNode->zFilename = (char*)&pShmNode[1]; #ifdef SQLITE_SHM_DIRECTORY - sqlite3_snprintf(nShmFilename, zShmFilename, + sqlite3_snprintf(nShmFilename, zShmFilename, SQLITE_SHM_DIRECTORY "/sqlite-shm-%x-%x", (u32)sStat.st_ino, (u32)sStat.st_dev); #else @@ -34162,9 +34162,9 @@ static int unixOpenSharedMemory(unixFile *pDbFd){ ** the original owner will not be able to connect. */ robustFchown(pShmNode->h, sStat.st_uid, sStat.st_gid); - + /* Check to see if another process is holding the dead-man switch. - ** If not, truncate the file to zero length. + ** If not, truncate the file to zero length. */ rc = SQLITE_OK; if( unixShmSystemLock(pDbFd, F_WRLCK, UNIX_SHM_DMS, 1)==SQLITE_OK ){ @@ -34192,7 +34192,7 @@ static int unixOpenSharedMemory(unixFile *pDbFd){ ** the cover of the unixEnterMutex() mutex and the pointer from the ** new (struct unixShm) object to the pShmNode has been set. All that is ** left to do is to link the new object into the linked list starting - ** at pShmNode->pFirst. This must be done while holding the pShmNode->mutex + ** at pShmNode->pFirst. This must be done while holding the pShmNode->mutex ** mutex. */ sqlite3_mutex_enter(pShmNode->mutex); @@ -34210,22 +34210,22 @@ shm_open_err: } /* -** This function is called to obtain a pointer to region iRegion of the -** shared-memory associated with the database file fd. Shared-memory regions -** are numbered starting from zero. Each shared-memory region is szRegion +** This function is called to obtain a pointer to region iRegion of the +** shared-memory associated with the database file fd. Shared-memory regions +** are numbered starting from zero. Each shared-memory region is szRegion ** bytes in size. ** ** If an error occurs, an error code is returned and *pp is set to NULL. ** ** Otherwise, if the bExtend parameter is 0 and the requested shared-memory ** region has not been allocated (by any client, including one running in a -** separate process), then *pp is set to NULL and SQLITE_OK returned. If -** bExtend is non-zero and the requested shared-memory region has not yet +** separate process), then *pp is set to NULL and SQLITE_OK returned. If +** bExtend is non-zero and the requested shared-memory region has not yet ** been allocated, it is allocated by this function. ** ** If the shared-memory region has already been allocated or is allocated by -** this call as described above, then it is mapped into this processes -** address space (if it is not already), *pp is set to point to the mapped +** this call as described above, then it is mapped into this processes +** address space (if it is not already), *pp is set to point to the mapped ** memory and SQLITE_OK returned. */ static int unixShmMap( @@ -34275,7 +34275,7 @@ static int unixShmMap( rc = SQLITE_IOERR_SHMSIZE; goto shmpage_out; } - + if( sStat.st_sizeh>=0 ){ pMem = osMmap(0, nMap, - pShmNode->isReadonly ? PROT_READ : PROT_READ|PROT_WRITE, + pShmNode->isReadonly ? PROT_READ : PROT_READ|PROT_WRITE, MAP_SHARED, pShmNode->h, szRegion*(i64)pShmNode->nRegion ); if( pMem==MAP_FAILED ){ @@ -34415,7 +34415,7 @@ static int unixShmLock( if( rc==SQLITE_OK ){ p->exclMask &= ~mask; p->sharedMask &= ~mask; - } + } }else if( flags & SQLITE_SHM_SHARED ){ u16 allShared = 0; /* Union of locks held by connections other than "p" */ @@ -34454,7 +34454,7 @@ static int unixShmLock( break; } } - + /* Get the exclusive locks at the system level. Then if successful ** also mark the local connection as being locked. */ @@ -34473,7 +34473,7 @@ static int unixShmLock( } /* -** Implement a memory barrier or memory fence on shared memory. +** Implement a memory barrier or memory fence on shared memory. ** ** All loads and stores begun before the barrier must complete before ** any load or store begun after the barrier. @@ -34488,7 +34488,7 @@ static void unixShmBarrier( } /* -** Close a connection to shared-memory. Delete the underlying +** Close a connection to shared-memory. Delete the underlying ** storage if deleteFlag is true. ** ** If there is no shared memory associated with the connection then this @@ -34561,7 +34561,7 @@ static void unixUnmapfile(unixFile *pFd){ } /* -** Attempt to set the size of the memory mapping maintained by file +** Attempt to set the size of the memory mapping maintained by file ** descriptor pFd to nNew bytes. Any existing mapping is discarded. ** ** If successful, this function sets the following variables: @@ -34653,14 +34653,14 @@ static void unixRemapfile( /* ** Memory map or remap the file opened by file-descriptor pFd (if the file -** is already mapped, the existing mapping is replaced by the new). Or, if -** there already exists a mapping for this file, and there are still +** is already mapped, the existing mapping is replaced by the new). Or, if +** there already exists a mapping for this file, and there are still ** outstanding xFetch() references to it, this function is a no-op. ** -** If parameter nByte is non-negative, then it is the requested size of -** the mapping to create. Otherwise, if nByte is less than zero, then the +** If parameter nByte is non-negative, then it is the requested size of +** the mapping to create. Otherwise, if nByte is less than zero, then the ** requested size is the size of the file on disk. The actual size of the -** created mapping is either the requested size or the value configured +** created mapping is either the requested size or the value configured ** using SQLITE_FCNTL_MMAP_LIMIT, whichever is smaller. ** ** SQLITE_OK is returned if no error occurs (even if the mapping is not @@ -34701,7 +34701,7 @@ static int unixMapfile(unixFile *pFd, i64 nMap){ ** Finally, if an error does occur, return an SQLite error code. The final ** value of *pp is undefined in this case. ** -** If this function does return a pointer, the caller must eventually +** If this function does return a pointer, the caller must eventually ** release the reference by calling unixUnfetch(). */ static int unixFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){ @@ -34726,13 +34726,13 @@ static int unixFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){ } /* -** If the third argument is non-NULL, then this function releases a +** If the third argument is non-NULL, then this function releases a ** reference obtained by an earlier call to unixFetch(). The second ** argument passed to this function must be the same as the corresponding -** argument that was passed to the unixFetch() invocation. +** argument that was passed to the unixFetch() invocation. ** -** Or, if the third argument is NULL, then this function is being called -** to inform the VFS layer that, according to POSIX, any existing mapping +** Or, if the third argument is NULL, then this function is being called +** to inform the VFS layer that, according to POSIX, any existing mapping ** may now be invalid and should be unmapped. */ static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){ @@ -34740,7 +34740,7 @@ static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){ unixFile *pFd = (unixFile *)fd; /* The underlying database file */ UNUSED_PARAMETER(iOff); - /* If p==0 (unmap the entire file) then there must be no outstanding + /* If p==0 (unmap the entire file) then there must be no outstanding ** xFetch references. Or, if p!=0 (meaning it is an xFetch reference), ** then there must be at least one outstanding. */ assert( (p==0)==(pFd->nFetchOut==0) ); @@ -34948,8 +34948,8 @@ IOMETHODS( #endif #if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE -/* -** This "finder" function attempts to determine the best locking strategy +/* +** This "finder" function attempts to determine the best locking strategy ** for the database file "filePath". It then returns the sqlite3_io_methods ** object that implements that strategy. ** @@ -34991,8 +34991,8 @@ static const sqlite3_io_methods *autolockIoFinderImpl( } /* Default case. Handles, amongst others, "nfs". - ** Test byte-range lock using fcntl(). If the call succeeds, - ** assume that the file-system supports POSIX style locks. + ** Test byte-range lock using fcntl(). If the call succeeds, + ** assume that the file-system supports POSIX style locks. */ lockInfo.l_len = 1; lockInfo.l_start = 0; @@ -35008,7 +35008,7 @@ static const sqlite3_io_methods *autolockIoFinderImpl( return &dotlockIoMethods; } } -static const sqlite3_io_methods +static const sqlite3_io_methods *(*const autolockIoFinder)(const char*,unixFile*) = autolockIoFinderImpl; #endif /* defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE */ @@ -35044,7 +35044,7 @@ static const sqlite3_io_methods *vxworksIoFinderImpl( return &semIoMethods; } } -static const sqlite3_io_methods +static const sqlite3_io_methods *(*const vxworksIoFinder)(const char*,unixFile*) = vxworksIoFinderImpl; #endif /* OS_VXWORKS */ @@ -35083,7 +35083,7 @@ static int fillInUnixFile( ** include the special Apple locking styles. */ #if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE - assert( zFilename==0 || zFilename[0]=='/' + assert( zFilename==0 || zFilename[0]=='/' || pVfs->pAppData==(void*)&autolockIoFinder ); #else assert( zFilename==0 || zFilename[0]=='/' ); @@ -35183,14 +35183,14 @@ static int fillInUnixFile( robust_close(pNew, h, __LINE__); h = -1; } - unixLeaveMutex(); + unixLeaveMutex(); } } #endif else if( pLockingStyle == &dotlockIoMethods ){ /* Dotfile locking uses the file path so it needs to be included in - ** the dotlockLockingContext + ** the dotlockLockingContext */ char *zLockFile; int nFilename; @@ -35228,7 +35228,7 @@ static int fillInUnixFile( unixLeaveMutex(); } #endif - + storeLastErrno(pNew, 0); #if OS_VXWORKS if( rc!=SQLITE_OK ){ @@ -35292,7 +35292,7 @@ static int unixGetTempname(int nBuf, char *zBuf){ /* It's odd to simulate an io-error here, but really this is just ** using the io-error infrastructure to test that SQLite handles this - ** function failing. + ** function failing. */ zBuf[0] = 0; SimulateIOError( return SQLITE_IOERR ); @@ -35321,7 +35321,7 @@ static int proxyTransformUnixFile(unixFile*, const char*); #endif /* -** Search for an unused file descriptor that was opened on the database +** Search for an unused file descriptor that was opened on the database ** file (not a journal or master-journal file) identified by pathname ** zPath with SQLITE_OPEN_XXX flags matching those passed as the second ** argument to this function. @@ -35330,7 +35330,7 @@ static int proxyTransformUnixFile(unixFile*, const char*); ** but the associated file descriptor could not be closed because some ** other file descriptor open on the same file is holding a file-lock. ** Refer to comments in the unixClose() function and the lengthy comment -** describing "Posix Advisory Locking" at the start of this file for +** describing "Posix Advisory Locking" at the start of this file for ** further details. Also, ticket #4018. ** ** If a suitable file descriptor is found, then it is returned. If no @@ -35341,8 +35341,8 @@ static UnixUnusedFd *findReusableFd(const char *zPath, int flags){ /* Do not search for an unused file descriptor on vxworks. Not because ** vxworks would not benefit from the change (it might, we're not sure), - ** but because no way to test it is currently available. It is better - ** not to risk breaking vxworks support for the sake of such an obscure + ** but because no way to test it is currently available. It is better + ** not to risk breaking vxworks support for the sake of such an obscure ** feature. */ #if !OS_VXWORKS struct stat sStat; /* Results of stat() call */ @@ -35379,7 +35379,7 @@ static UnixUnusedFd *findReusableFd(const char *zPath, int flags){ } /* -** Find the mode, uid and gid of file zFile. +** Find the mode, uid and gid of file zFile. */ static int getFileMode( const char *zFile, /* File name */ @@ -35403,16 +35403,16 @@ static int getFileMode( ** This function is called by unixOpen() to determine the unix permissions ** to create new files with. If no error occurs, then SQLITE_OK is returned ** and a value suitable for passing as the third argument to open(2) is -** written to *pMode. If an IO error occurs, an SQLite error code is +** written to *pMode. If an IO error occurs, an SQLite error code is ** returned and the value of *pMode is not modified. ** ** In most cases, this routine sets *pMode to 0, which will become ** an indication to robust_open() to create the file using ** SQLITE_DEFAULT_FILE_PERMISSIONS adjusted by the umask. -** But if the file being opened is a WAL or regular journal file, then -** this function queries the file-system for the permissions on the -** corresponding database file and sets *pMode to this value. Whenever -** possible, WAL and journal files are created using the same permissions +** But if the file being opened is a WAL or regular journal file, then +** this function queries the file-system for the permissions on the +** corresponding database file and sets *pMode to this value. Whenever +** possible, WAL and journal files are created using the same permissions ** as the associated database file. ** ** If the SQLITE_ENABLE_8_3_NAMES option is enabled, then the @@ -35444,10 +35444,10 @@ static int findCreateFileMode( ** "-journalNN" ** "-walNN" ** - ** where NN is a decimal number. The NN naming schemes are + ** where NN is a decimal number. The NN naming schemes are ** used by the test_multiplex.c module. */ - nDb = sqlite3Strlen30(zPath) - 1; + nDb = sqlite3Strlen30(zPath) - 1; while( zPath[nDb]!='-' ){ #ifndef SQLITE_ENABLE_8_3_NAMES /* In the normal case (8+3 filenames disabled) the journal filename @@ -35520,7 +35520,7 @@ int chromium_sqlite3_fill_in_unix_sqlite3_file(sqlite3_vfs* pVfs, /* ** Open the file zPath. -** +** ** Previously, the SQLite OS layer used three functions in place of this ** one: ** @@ -35531,13 +35531,13 @@ int chromium_sqlite3_fill_in_unix_sqlite3_file(sqlite3_vfs* pVfs, ** These calls correspond to the following combinations of flags: ** ** ReadWrite() -> (READWRITE | CREATE) -** ReadOnly() -> (READONLY) +** ReadOnly() -> (READONLY) ** OpenExclusive() -> (READWRITE | CREATE | EXCLUSIVE) ** ** The old OpenExclusive() accepted a boolean argument - "delFlag". If ** true, the file was configured to be automatically deleted when the -** file handle closed. To achieve the same effect using this new -** interface, add the DELETEONCLOSE flag to those specified above for +** file handle closed. To achieve the same effect using this new +** interface, add the DELETEONCLOSE flag to those specified above for ** OpenExclusive(). */ static int unixOpen( @@ -35572,8 +35572,8 @@ static int unixOpen( ** is called the directory file descriptor will be fsync()ed and close()d. */ int syncDir = (isCreate && ( - eType==SQLITE_OPEN_MASTER_JOURNAL - || eType==SQLITE_OPEN_MAIN_JOURNAL + eType==SQLITE_OPEN_MASTER_JOURNAL + || eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_WAL )); @@ -35583,9 +35583,9 @@ static int unixOpen( char zTmpname[MAX_PATHNAME+2]; const char *zName = zPath; - /* Check the following statements are true: + /* Check the following statements are true: ** - ** (a) Exactly one of the READWRITE and READONLY flags must be set, and + ** (a) Exactly one of the READWRITE and READONLY flags must be set, and ** (b) if CREATE is set, then READWRITE must also be set, and ** (c) if EXCLUSIVE is set, then CREATE must also be set. ** (d) if DELETEONCLOSE is set, then CREATE must also be set. @@ -35595,7 +35595,7 @@ static int unixOpen( assert(isExclusive==0 || isCreate); assert(isDelete==0 || isCreate); - /* The main DB, main journal, WAL file and master journal are never + /* The main DB, main journal, WAL file and master journal are never ** automatically deleted. Nor are they ever temporary files. */ assert( (!isDelete && zName) || eType!=SQLITE_OPEN_MAIN_DB ); assert( (!isDelete && zName) || eType!=SQLITE_OPEN_MAIN_JOURNAL ); @@ -35603,9 +35603,9 @@ static int unixOpen( assert( (!isDelete && zName) || eType!=SQLITE_OPEN_WAL ); /* Assert that the upper layer has set one of the "file-type" flags. */ - assert( eType==SQLITE_OPEN_MAIN_DB || eType==SQLITE_OPEN_TEMP_DB - || eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_TEMP_JOURNAL - || eType==SQLITE_OPEN_SUBJOURNAL || eType==SQLITE_OPEN_MASTER_JOURNAL + assert( eType==SQLITE_OPEN_MAIN_DB || eType==SQLITE_OPEN_TEMP_DB + || eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_TEMP_JOURNAL + || eType==SQLITE_OPEN_SUBJOURNAL || eType==SQLITE_OPEN_MASTER_JOURNAL || eType==SQLITE_OPEN_TRANSIENT_DB || eType==SQLITE_OPEN_WAL ); @@ -35657,7 +35657,7 @@ static int unixOpen( /* Determine the value of the flags parameter passed to POSIX function ** open(). These must be calculated even if open() is not called, as - ** they may be stored as part of the file handle and used by the + ** they may be stored as part of the file handle and used by the ** 'conch file' locking functions later on. */ if( isReadonly ) openFlags |= O_RDONLY; if( isReadWrite ) openFlags |= O_RDWR; @@ -35729,7 +35729,7 @@ static int unixOpen( p->openFlags = openFlags; } #endif - + #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE if( fstatfs(fd, &fsInfo) == -1 ){ storeLastErrno(p, errno); @@ -35760,7 +35760,7 @@ static int unixOpen( char *envforce = getenv("SQLITE_FORCE_PROXY_LOCKING"); int useProxy = 0; - /* SQLITE_FORCE_PROXY_LOCKING==1 means force always use proxy, 0 means + /* SQLITE_FORCE_PROXY_LOCKING==1 means force always use proxy, 0 means ** never use proxy, NULL means use proxy for non-local files only. */ if( envforce!=NULL ){ useProxy = atoi(envforce)>0; @@ -35772,9 +35772,9 @@ static int unixOpen( if( rc==SQLITE_OK ){ rc = proxyTransformUnixFile((unixFile*)pFile, ":auto:"); if( rc!=SQLITE_OK ){ - /* Use unixClose to clean up the resources added in fillInUnixFile - ** and clear all the structure's references. Specifically, - ** pFile->pMethods will be NULL so sqlite3OsClose will be a no-op + /* Use unixClose to clean up the resources added in fillInUnixFile + ** and clear all the structure's references. Specifically, + ** pFile->pMethods will be NULL so sqlite3OsClose will be a no-op */ unixClose(pFile); return rc; @@ -35784,7 +35784,7 @@ static int unixOpen( } } #endif - + /* Duplicated in chromium_sqlite3_fill_in_unix_sqlite3_file(). */ rc = fillInUnixFile(pVfs, fd, pFile, zPath, ctrlFlags); @@ -35902,9 +35902,9 @@ static int mkFullPathname( /* ** Turn a relative pathname into a full pathname. The relative path ** is stored as a nul-terminated string in the buffer pointed to by -** zPath. +** zPath. ** -** zOut points to a buffer of at least sqlite3_vfs.mxPathname bytes +** zOut points to a buffer of at least sqlite3_vfs.mxPathname bytes ** (in this case, MAX_PATHNAME bytes). The full-path is written to ** this buffer before returning. */ @@ -36021,7 +36021,7 @@ static void unixDlError(sqlite3_vfs *NotUsed, int nBuf, char *zBufOut){ unixLeaveMutex(); } static void (*unixDlSym(sqlite3_vfs *NotUsed, void *p, const char*zSym))(void){ - /* + /* ** GCC with -pedantic-errors says that C90 does not allow a void* to be ** cast into a pointer to a function. And yet the library dlsym() routine ** returns a void* which is really a pointer to a function. So how do we @@ -36031,7 +36031,7 @@ static void (*unixDlSym(sqlite3_vfs *NotUsed, void *p, const char*zSym))(void){ ** parameters void* and const char* and returning a pointer to a function. ** We initialize x by assigning it a pointer to the dlsym() function. ** (That assignment requires a cast.) Then we call the function that - ** x points to. + ** x points to. ** ** This work-around is unlikely to work correctly on any system where ** you really cannot cast a function pointer into void*. But then, on the @@ -36074,7 +36074,7 @@ static int unixRandomness(sqlite3_vfs *NotUsed, int nBuf, char *zBuf){ ** tests repeatable. */ memset(zBuf, 0, nBuf); - randomnessPid = osGetpid(0); + randomnessPid = osGetpid(0); #if !defined(SQLITE_TEST) && !defined(SQLITE_OMIT_RANDOMNESS) { int fd, got; @@ -36141,7 +36141,7 @@ SQLITE_API int sqlite3_current_time = 0; /* Fake system time in seconds since 1 ** epoch of noon in Greenwich on November 24, 4714 B.C according to the ** proleptic Gregorian calendar. ** -** On success, return SQLITE_OK. Return SQLITE_ERROR if the time and date +** On success, return SQLITE_OK. Return SQLITE_ERROR if the time and date ** cannot be found. */ static int unixCurrentTimeInt64(sqlite3_vfs *NotUsed, sqlite3_int64 *piNow){ @@ -36248,7 +36248,7 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ ** To address the performance and cache coherency issues, proxy file locking ** changes the way database access is controlled by limiting access to a ** single host at a time and moving file locks off of the database file -** and onto a proxy file on the local file system. +** and onto a proxy file on the local file system. ** ** ** Using proxy locks @@ -36274,19 +36274,19 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ ** actual proxy file name is generated from the name and path of the ** database file. For example: ** -** For database path "/Users/me/foo.db" +** For database path "/Users/me/foo.db" ** The lock path will be "/sqliteplocks/_Users_me_foo.db:auto:") ** ** Once a lock proxy is configured for a database connection, it can not ** be removed, however it may be switched to a different proxy path via ** the above APIs (assuming the conch file is not being held by another -** connection or process). +** connection or process). ** ** ** How proxy locking works ** ----------------------- ** -** Proxy file locking relies primarily on two new supporting files: +** Proxy file locking relies primarily on two new supporting files: ** ** * conch file to limit access to the database file to a single host ** at a time @@ -36313,11 +36313,11 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ ** host (the conch ensures that they all use the same local lock file). ** ** Requesting the lock proxy does not immediately take the conch, it is -** only taken when the first request to lock database file is made. +** only taken when the first request to lock database file is made. ** This matches the semantics of the traditional locking behavior, where ** opening a connection to a database file does not take a lock on it. -** The shared lock and an open file descriptor are maintained until -** the connection to the database is closed. +** The shared lock and an open file descriptor are maintained until +** the connection to the database is closed. ** ** The proxy file and the lock file are never deleted so they only need ** to be created the first time they are used. @@ -36331,7 +36331,7 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ ** automatically configured for proxy locking, lock files are ** named automatically using the same logic as ** PRAGMA lock_proxy_file=":auto:" -** +** ** SQLITE_PROXY_DEBUG ** ** Enables the logging of error messages during host id file @@ -36346,8 +36346,8 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ ** ** Permissions to use when creating a directory for storing the ** lock proxy files, only used when LOCKPROXYDIR is not set. -** -** +** +** ** As mentioned above, when compiled with SQLITE_PREFER_PROXY_LOCKING, ** setting the environment variable SQLITE_FORCE_PROXY_LOCKING to 1 will ** force proxy locking to be used for every database file opened, and 0 @@ -36357,12 +36357,12 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ */ /* -** Proxy locking is only available on MacOSX +** Proxy locking is only available on MacOSX */ #if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE /* -** The proxyLockingContext has the path and file structures for the remote +** The proxyLockingContext has the path and file structures for the remote ** and local proxy files in it */ typedef struct proxyLockingContext proxyLockingContext; @@ -36378,10 +36378,10 @@ struct proxyLockingContext { sqlite3_io_methods const *pOldMethod; /* Original I/O methods for close */ }; -/* -** The proxy lock file path for the database at dbPath is written into lPath, +/* +** The proxy lock file path for the database at dbPath is written into lPath, ** which must point to valid, writable memory large enough for a maxLen length -** file path. +** file path. */ static int proxyGetLockPath(const char *dbPath, char *lPath, size_t maxLen){ int len; @@ -36398,7 +36398,7 @@ static int proxyGetLockPath(const char *dbPath, char *lPath, size_t maxLen){ lPath, errno, osGetpid(0))); return SQLITE_IOERR_LOCK; } - len = strlcat(lPath, "sqliteplocks", maxLen); + len = strlcat(lPath, "sqliteplocks", maxLen); } # else len = strlcpy(lPath, "/tmp/", maxLen); @@ -36408,7 +36408,7 @@ static int proxyGetLockPath(const char *dbPath, char *lPath, size_t maxLen){ if( lPath[len-1]!='/' ){ len = strlcat(lPath, "/", maxLen); } - + /* transform the db path to a unique cache name */ dbLen = (int)strlen(dbPath); for( i=0; i 0) ){ /* only mkdir if leaf dir != "." or "/" or ".." */ - if( i-start>2 || (i-start==1 && buf[start] != '.' && buf[start] != '/') + if( i-start>2 || (i-start==1 && buf[start] != '.' && buf[start] != '/') || (i-start==2 && buf[start] != '.' && buf[start+1] != '.') ){ buf[i]='\0'; if( osMkdir(buf, SQLITE_DEFAULT_PROXYDIR_PERMISSIONS) ){ @@ -36513,13 +36513,13 @@ static int proxyCreateUnixFile( switch (terrno) { case EACCES: return SQLITE_PERM; - case EIO: + case EIO: return SQLITE_IOERR_LOCK; /* even though it is the conch */ default: return SQLITE_CANTOPEN_BKPT; } } - + pNew = (unixFile *)sqlite3_malloc64(sizeof(*pNew)); if( pNew==NULL ){ rc = SQLITE_NOMEM_BKPT; @@ -36533,13 +36533,13 @@ static int proxyCreateUnixFile( pUnused->fd = fd; pUnused->flags = openFlags; pNew->pUnused = pUnused; - + rc = fillInUnixFile(&dummyVfs, fd, (sqlite3_file*)pNew, path, 0); if( rc==SQLITE_OK ){ *ppFile = pNew; return SQLITE_OK; } -end_create_proxy: +end_create_proxy: robust_close(pNew, fd, __LINE__); sqlite3_free(pNew); sqlite3_free(pUnused); @@ -36558,7 +36558,7 @@ SQLITE_API int sqlite3_hostid_num = 0; extern int gethostuuid(uuid_t id, const struct timespec *wait); #endif -/* get the host ID via gethostuuid(), pHostID must point to PROXY_HOSTIDLEN +/* get the host ID via gethostuuid(), pHostID must point to PROXY_HOSTIDLEN ** bytes of writable memory. */ static int proxyGetHostID(unsigned char *pHostID, int *pError){ @@ -36584,7 +36584,7 @@ static int proxyGetHostID(unsigned char *pHostID, int *pError){ pHostID[0] = (char)(pHostID[0] + (char)(sqlite3_hostid_num & 0xFF)); } #endif - + return SQLITE_OK; } @@ -36595,14 +36595,14 @@ static int proxyGetHostID(unsigned char *pHostID, int *pError){ #define PROXY_PATHINDEX (PROXY_HEADERLEN+PROXY_HOSTIDLEN) #define PROXY_MAXCONCHLEN (PROXY_HEADERLEN+PROXY_HOSTIDLEN+MAXPATHLEN) -/* -** Takes an open conch file, copies the contents to a new path and then moves +/* +** Takes an open conch file, copies the contents to a new path and then moves ** it back. The newly created file's file descriptor is assigned to the -** conch file structure and finally the original conch file descriptor is +** conch file structure and finally the original conch file descriptor is ** closed. Returns zero if successful. */ static int proxyBreakConchLock(unixFile *pFile, uuid_t myHostID){ - proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; + proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; unixFile *conchFile = pCtx->conchFile; char tPath[MAXPATHLEN]; char buf[PROXY_MAXCONCHLEN]; @@ -36616,7 +36616,7 @@ static int proxyBreakConchLock(unixFile *pFile, uuid_t myHostID){ /* create a new path by replace the trailing '-conch' with '-break' */ pathLen = strlcpy(tPath, cPath, MAXPATHLEN); - if( pathLen>MAXPATHLEN || pathLen<6 || + if( pathLen>MAXPATHLEN || pathLen<6 || (strlcpy(&tPath[pathLen-5], "break", 6) != 5) ){ sqlite3_snprintf(sizeof(errmsg),errmsg,"path error (len %d)",(int)pathLen); goto end_breaklock; @@ -36658,24 +36658,24 @@ end_breaklock: return rc; } -/* Take the requested lock on the conch file and break a stale lock if the +/* Take the requested lock on the conch file and break a stale lock if the ** host id matches. */ static int proxyConchLock(unixFile *pFile, uuid_t myHostID, int lockType){ - proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; + proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; unixFile *conchFile = pCtx->conchFile; int rc = SQLITE_OK; int nTries = 0; struct timespec conchModTime; - + memset(&conchModTime, 0, sizeof(conchModTime)); do { rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, lockType); nTries ++; if( rc==SQLITE_BUSY ){ /* If the lock failed (busy): - * 1st try: get the mod time of the conch, wait 0.5s and try again. - * 2nd try: fail if the mod time changed or host id is different, wait + * 1st try: get the mod time of the conch, wait 0.5s and try again. + * 2nd try: fail if the mod time changed or host id is different, wait * 10 sec and try again * 3rd try: break the lock unless the mod time has changed. */ @@ -36684,20 +36684,20 @@ static int proxyConchLock(unixFile *pFile, uuid_t myHostID, int lockType){ storeLastErrno(pFile, errno); return SQLITE_IOERR_LOCK; } - + if( nTries==1 ){ conchModTime = buf.st_mtimespec; usleep(500000); /* wait 0.5 sec and try the lock again*/ - continue; + continue; } assert( nTries>1 ); - if( conchModTime.tv_sec != buf.st_mtimespec.tv_sec || + if( conchModTime.tv_sec != buf.st_mtimespec.tv_sec || conchModTime.tv_nsec != buf.st_mtimespec.tv_nsec ){ return SQLITE_BUSY; } - - if( nTries==2 ){ + + if( nTries==2 ){ char tBuf[PROXY_MAXCONCHLEN]; int len = osPread(conchFile->h, tBuf, PROXY_MAXCONCHLEN, 0); if( len<0 ){ @@ -36714,9 +36714,9 @@ static int proxyConchLock(unixFile *pFile, uuid_t myHostID, int lockType){ return SQLITE_BUSY; } usleep(10000000); /* wait 10 sec and try the lock again */ - continue; + continue; } - + assert( nTries==3 ); if( 0==proxyBreakConchLock(pFile, myHostID) ){ rc = SQLITE_OK; @@ -36729,19 +36729,19 @@ static int proxyConchLock(unixFile *pFile, uuid_t myHostID, int lockType){ } } } while( rc==SQLITE_BUSY && nTries<3 ); - + return rc; } -/* Takes the conch by taking a shared lock and read the contents conch, if -** lockPath is non-NULL, the host ID and lock file path must match. A NULL -** lockPath means that the lockPath in the conch file will be used if the -** host IDs match, or a new lock path will be generated automatically +/* Takes the conch by taking a shared lock and read the contents conch, if +** lockPath is non-NULL, the host ID and lock file path must match. A NULL +** lockPath means that the lockPath in the conch file will be used if the +** host IDs match, or a new lock path will be generated automatically ** and written to the conch file. */ static int proxyTakeConch(unixFile *pFile){ - proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; - + proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; + if( pCtx->conchHeld!=0 ){ return SQLITE_OK; }else{ @@ -36757,7 +36757,7 @@ static int proxyTakeConch(unixFile *pFile){ int readLen = 0; int tryOldLockPath = 0; int forceNewLockPath = 0; - + OSTRACE(("TAKECONCH %d for %s pid=%d\n", conchFile->h, (pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"), osGetpid(0))); @@ -36778,21 +36778,21 @@ static int proxyTakeConch(unixFile *pFile){ storeLastErrno(pFile, conchFile->lastErrno); rc = SQLITE_IOERR_READ; goto end_takeconch; - }else if( readLen<=(PROXY_HEADERLEN+PROXY_HOSTIDLEN) || + }else if( readLen<=(PROXY_HEADERLEN+PROXY_HOSTIDLEN) || readBuf[0]!=(char)PROXY_CONCHVERSION ){ - /* a short read or version format mismatch means we need to create a new - ** conch file. + /* a short read or version format mismatch means we need to create a new + ** conch file. */ createConch = 1; } /* if the host id matches and the lock path already exists in the conch - ** we'll try to use the path there, if we can't open that path, we'll - ** retry with a new auto-generated path + ** we'll try to use the path there, if we can't open that path, we'll + ** retry with a new auto-generated path */ do { /* in case we need to try again for an :auto: named lock file */ if( !createConch && !forceNewLockPath ){ - hostIdMatch = !memcmp(&readBuf[PROXY_HEADERLEN], myHostID, + hostIdMatch = !memcmp(&readBuf[PROXY_HEADERLEN], myHostID, PROXY_HOSTIDLEN); /* if the conch has data compare the contents */ if( !pCtx->lockProxyPath ){ @@ -36801,7 +36801,7 @@ static int proxyTakeConch(unixFile *pFile){ */ if( hostIdMatch ){ size_t pathLen = (readLen - PROXY_PATHINDEX); - + if( pathLen>=MAXPATHLEN ){ pathLen=MAXPATHLEN-1; } @@ -36817,23 +36817,23 @@ static int proxyTakeConch(unixFile *pFile){ readLen-PROXY_PATHINDEX) ){ /* conch host and lock path match */ - goto end_takeconch; + goto end_takeconch; } } - + /* if the conch isn't writable and doesn't match, we can't take it */ if( (conchFile->openFlags&O_RDWR) == 0 ){ rc = SQLITE_BUSY; goto end_takeconch; } - + /* either the conch didn't match or we need to create a new one */ if( !pCtx->lockProxyPath ){ proxyGetLockPath(pCtx->dbPath, lockPath, MAXPATHLEN); tempLockPath = lockPath; /* create a copy of the lock path _only_ if the conch is taken */ } - + /* update conch with host and path (this will fail if other process ** has a shared lock already), if the host id matches, use the big ** stick. @@ -36844,7 +36844,7 @@ static int proxyTakeConch(unixFile *pFile){ /* We are trying for an exclusive lock but another thread in this ** same process is still holding a shared lock. */ rc = SQLITE_BUSY; - } else { + } else { rc = proxyConchLock(pFile, myHostID, EXCLUSIVE_LOCK); } }else{ @@ -36853,7 +36853,7 @@ static int proxyTakeConch(unixFile *pFile){ if( rc==SQLITE_OK ){ char writeBuffer[PROXY_MAXCONCHLEN]; int writeSize = 0; - + writeBuffer[0] = (char)PROXY_CONCHVERSION; memcpy(&writeBuffer[PROXY_HEADERLEN], myHostID, PROXY_HOSTIDLEN); if( pCtx->lockProxyPath!=NULL ){ @@ -36866,8 +36866,8 @@ static int proxyTakeConch(unixFile *pFile){ robust_ftruncate(conchFile->h, writeSize); rc = unixWrite((sqlite3_file *)conchFile, writeBuffer, writeSize, 0); full_fsync(conchFile->h,0,0); - /* If we created a new conch file (not just updated the contents of a - ** valid conch file), try to match the permissions of the database + /* If we created a new conch file (not just updated the contents of a + ** valid conch file), try to match the permissions of the database */ if( rc==SQLITE_OK && createConch ){ struct stat buf; @@ -36891,14 +36891,14 @@ static int proxyTakeConch(unixFile *pFile){ } }else{ int code = errno; - fprintf(stderr, "STAT FAILED[%d] with %d %s\n", + fprintf(stderr, "STAT FAILED[%d] with %d %s\n", err, code, strerror(code)); #endif } } } conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, SHARED_LOCK); - + end_takeconch: OSTRACE(("TRANSPROXY: CLOSE %d\n", pFile->h)); if( rc==SQLITE_OK && pFile->openFlags ){ @@ -36921,7 +36921,7 @@ static int proxyTakeConch(unixFile *pFile){ rc = proxyCreateUnixFile(path, &pCtx->lockProxy, 1); if( rc!=SQLITE_OK && rc!=SQLITE_NOMEM && tryOldLockPath ){ /* we couldn't create the proxy lock file with the old lock file path - ** so try again via auto-naming + ** so try again via auto-naming */ forceNewLockPath = 1; tryOldLockPath = 0; @@ -36941,7 +36941,7 @@ static int proxyTakeConch(unixFile *pFile){ } if( rc==SQLITE_OK ){ pCtx->conchHeld = 1; - + if( pCtx->lockProxy->pMethod == &afpIoMethods ){ afpLockingContext *afpCtx; afpCtx = (afpLockingContext *)pCtx->lockProxy->lockingContext; @@ -36953,7 +36953,7 @@ static int proxyTakeConch(unixFile *pFile){ OSTRACE(("TAKECONCH %d %s\n", conchFile->h, rc==SQLITE_OK?"ok":"failed")); return rc; - } while (1); /* in case we need to retry the :auto: lock file - + } while (1); /* in case we need to retry the :auto: lock file - ** we should never get here except via the 'continue' call. */ } } @@ -36969,7 +36969,7 @@ static int proxyReleaseConch(unixFile *pFile){ pCtx = (proxyLockingContext *)pFile->lockingContext; conchFile = pCtx->conchFile; OSTRACE(("RELEASECONCH %d for %s pid=%d\n", conchFile->h, - (pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"), + (pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"), osGetpid(0))); if( pCtx->conchHeld>0 ){ rc = conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, NO_LOCK); @@ -36997,13 +36997,13 @@ static int proxyCreateConchPathname(char *dbPath, char **pConchPath){ char *conchPath; /* buffer in which to construct conch name */ /* Allocate space for the conch filename and initialize the name to - ** the name of the original database file. */ + ** the name of the original database file. */ *pConchPath = conchPath = (char *)sqlite3_malloc64(len + 8); if( conchPath==0 ){ return SQLITE_NOMEM_BKPT; } memcpy(conchPath, dbPath, len+1); - + /* now insert a "." before the last / character */ for( i=(len-1); i>=0; i-- ){ if( conchPath[i]=='/' ){ @@ -37026,7 +37026,7 @@ static int proxyCreateConchPathname(char *dbPath, char **pConchPath){ /* Takes a fully configured proxy locking-style unix file and switches -** the local lock file path +** the local lock file path */ static int switchLockProxyPath(unixFile *pFile, const char *path) { proxyLockingContext *pCtx = (proxyLockingContext*)pFile->lockingContext; @@ -37035,7 +37035,7 @@ static int switchLockProxyPath(unixFile *pFile, const char *path) { if( pFile->eFileLock!=NO_LOCK ){ return SQLITE_BUSY; - } + } /* nothing to do if the path is NULL, :auto: or matches the existing path */ if( !path || path[0]=='\0' || !strcmp(path, ":auto:") || @@ -37053,7 +37053,7 @@ static int switchLockProxyPath(unixFile *pFile, const char *path) { sqlite3_free(oldPath); pCtx->lockProxyPath = sqlite3DbStrDup(0, path); } - + return rc; } @@ -37067,7 +37067,7 @@ static int switchLockProxyPath(unixFile *pFile, const char *path) { static int proxyGetDbPathForUnixFile(unixFile *pFile, char *dbPath){ #if defined(__APPLE__) if( pFile->pMethod == &afpIoMethods ){ - /* afp style keeps a reference to the db path in the filePath field + /* afp style keeps a reference to the db path in the filePath field ** of the struct */ assert( (int)strlen((char*)pFile->lockingContext)<=MAXPATHLEN ); strlcpy(dbPath, ((afpLockingContext *)pFile->lockingContext)->dbPath, @@ -37088,9 +37088,9 @@ static int proxyGetDbPathForUnixFile(unixFile *pFile, char *dbPath){ } /* -** Takes an already filled in unix file and alters it so all file locking +** Takes an already filled in unix file and alters it so all file locking ** will be performed on the local proxy lock file. The following fields -** are preserved in the locking context so that they can be restored and +** are preserved in the locking context so that they can be restored and ** the unix structure properly cleaned up at close time: ** ->lockingContext ** ->pMethod @@ -37100,7 +37100,7 @@ static int proxyTransformUnixFile(unixFile *pFile, const char *path) { char dbPath[MAXPATHLEN+1]; /* Name of the database file */ char *lockPath=NULL; int rc = SQLITE_OK; - + if( pFile->eFileLock!=NO_LOCK ){ return SQLITE_BUSY; } @@ -37110,7 +37110,7 @@ static int proxyTransformUnixFile(unixFile *pFile, const char *path) { }else{ lockPath=(char *)path; } - + OSTRACE(("TRANSPROXY %d for %s pid=%d\n", pFile->h, (lockPath ? lockPath : ":auto:"), osGetpid(0))); @@ -37144,7 +37144,7 @@ static int proxyTransformUnixFile(unixFile *pFile, const char *path) { rc = SQLITE_OK; } } - } + } if( rc==SQLITE_OK && lockPath ){ pCtx->lockProxyPath = sqlite3DbStrDup(0, lockPath); } @@ -37156,7 +37156,7 @@ static int proxyTransformUnixFile(unixFile *pFile, const char *path) { } } if( rc==SQLITE_OK ){ - /* all memory is allocated, proxys are created and assigned, + /* all memory is allocated, proxys are created and assigned, ** switch the locking context and pMethod then return. */ pCtx->oldLockingContext = pFile->lockingContext; @@ -37164,12 +37164,12 @@ static int proxyTransformUnixFile(unixFile *pFile, const char *path) { pCtx->pOldMethod = pFile->pMethod; pFile->pMethod = &proxyIoMethods; }else{ - if( pCtx->conchFile ){ + if( pCtx->conchFile ){ pCtx->conchFile->pMethod->xClose((sqlite3_file *)pCtx->conchFile); sqlite3_free(pCtx->conchFile); } sqlite3DbFree(0, pCtx->lockProxyPath); - sqlite3_free(pCtx->conchFilePath); + sqlite3_free(pCtx->conchFilePath); sqlite3_free(pCtx); } OSTRACE(("TRANSPROXY %d %s\n", pFile->h, @@ -37207,7 +37207,7 @@ static int proxyFileControl(sqlite3_file *id, int op, void *pArg){ if( isProxyStyle ){ /* turn off proxy locking - not supported. If support is added for ** switching proxy locking mode off then it will need to fail if - ** the journal mode is WAL mode. + ** the journal mode is WAL mode. */ rc = SQLITE_ERROR /*SQLITE_PROTOCOL? SQLITE_MISUSE?*/; }else{ @@ -37217,9 +37217,9 @@ static int proxyFileControl(sqlite3_file *id, int op, void *pArg){ }else{ const char *proxyPath = (const char *)pArg; if( isProxyStyle ){ - proxyLockingContext *pCtx = + proxyLockingContext *pCtx = (proxyLockingContext*)pFile->lockingContext; - if( !strcmp(pArg, ":auto:") + if( !strcmp(pArg, ":auto:") || (pCtx->lockProxyPath && !strncmp(pCtx->lockProxyPath, proxyPath, MAXPATHLEN)) ){ @@ -37344,7 +37344,7 @@ static int proxyClose(sqlite3_file *id) { unixFile *lockProxy = pCtx->lockProxy; unixFile *conchFile = pCtx->conchFile; int rc = SQLITE_OK; - + if( lockProxy ){ rc = lockProxy->pMethod->xUnlock((sqlite3_file*)lockProxy, NO_LOCK); if( rc ) return rc; @@ -37381,7 +37381,7 @@ static int proxyClose(sqlite3_file *id) { ** The proxy locking style is intended for use with AFP filesystems. ** And since AFP is only supported on MacOSX, the proxy locking is also ** restricted to MacOSX. -** +** ** ******************* End of the proxy lock implementation ********************** ******************************************************************************/ @@ -37399,8 +37399,8 @@ static int proxyClose(sqlite3_file *id) { ** necessarily been initialized when this routine is called, and so they ** should not be used. */ -SQLITE_API int sqlite3_os_init(void){ - /* +SQLITE_API int sqlite3_os_init(void){ + /* ** The following macro defines an initializer for an sqlite3_vfs object. ** The name of the VFS is NAME. The pAppData is a pointer to a pointer ** to the "finder" function. (pAppData is a pointer to a pointer because @@ -37416,7 +37416,7 @@ SQLITE_API int sqlite3_os_init(void){ ** ** Most finders simply return a pointer to a fixed sqlite3_io_methods ** object. But the "autolockIoFinder" available on MacOSX does a little - ** more than that; it looks at the filesystem type that hosts the + ** more than that; it looks at the filesystem type that hosts the ** database file and tries to choose an locking method appropriate for ** that filesystem time. */ @@ -37488,7 +37488,7 @@ SQLITE_API int sqlite3_os_init(void){ for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){ sqlite3_vfs_register(&aVfs[i], i==0); } - return SQLITE_OK; + return SQLITE_OK; } /* @@ -37498,10 +37498,10 @@ SQLITE_API int sqlite3_os_init(void){ ** to release dynamically allocated objects. But not on unix. ** This routine is a no-op for unix. */ -SQLITE_API int sqlite3_os_end(void){ - return SQLITE_OK; +SQLITE_API int sqlite3_os_end(void){ + return SQLITE_OK; } - + #endif /* SQLITE_OS_UNIX */ /************** End of os_unix.c *********************************************/ @@ -37624,7 +37624,7 @@ SQLITE_API int sqlite3_os_end(void){ __asm__ __volatile__ ("rdtsc" : "=A" (val)); return val; } - + #elif (defined(__GNUC__) && defined(__ppc__)) __inline__ sqlite_uint64 sqlite3Hwtime(void){ @@ -43697,8 +43697,8 @@ void chromium_sqlite3_initialize_win_sqlite3_file(sqlite3_file* file, HANDLE han ** property. Usually only a few pages are meet either condition. ** So the bitmap is usually sparse and has low cardinality. ** But sometimes (for example when during a DROP of a large table) most -** or all of the pages in a database can get journalled. In those cases, -** the bitmap becomes dense with high cardinality. The algorithm needs +** or all of the pages in a database can get journalled. In those cases, +** the bitmap becomes dense with high cardinality. The algorithm needs ** to handle both cases well. ** ** The size of the bitmap is fixed when the object is created. @@ -43719,13 +43719,13 @@ void chromium_sqlite3_initialize_win_sqlite3_file(sqlite3_file* file, HANDLE han /* Size of the Bitvec structure in bytes. */ #define BITVEC_SZ 512 -/* Round the union size down to the nearest pointer boundary, since that's how +/* Round the union size down to the nearest pointer boundary, since that's how ** it will be aligned within the Bitvec struct. */ #define BITVEC_USIZE \ (((BITVEC_SZ-(3*sizeof(u32)))/sizeof(Bitvec*))*sizeof(Bitvec*)) -/* Type of the array "element" for the bitmap representation. -** Should be a power of 2, and ideally, evenly divide into BITVEC_USIZE. +/* Type of the array "element" for the bitmap representation. +** Should be a power of 2, and ideally, evenly divide into BITVEC_USIZE. ** Setting this to the "natural word" size of your CPU may improve ** performance. */ #define BITVEC_TELEM u8 @@ -43738,12 +43738,12 @@ void chromium_sqlite3_initialize_win_sqlite3_file(sqlite3_file* file, HANDLE han /* Number of u32 values in hash table. */ #define BITVEC_NINT (BITVEC_USIZE/sizeof(u32)) -/* Maximum number of entries in hash table before +/* Maximum number of entries in hash table before ** sub-dividing and re-hashing. */ #define BITVEC_MXHASH (BITVEC_NINT/2) /* Hashing function for the aHash representation. -** Empirical testing showed that the *37 multiplier -** (an arbitrary prime)in the hash function provided +** Empirical testing showed that the *37 multiplier +** (an arbitrary prime)in the hash function provided ** no fewer collisions than the no-op *1. */ #define BITVEC_HASH(X) (((X)*1)%BITVEC_NINT) @@ -43789,7 +43789,7 @@ struct Bitvec { /* ** Create a new bitmap object able to handle bits between 0 and iSize, -** inclusive. Return a pointer to the new object. Return NULL if +** inclusive. Return a pointer to the new object. Return NULL if ** malloc fails. */ SQLITE_PRIVATE Bitvec *sqlite3BitvecCreate(u32 iSize){ @@ -44045,7 +44045,7 @@ SQLITE_PRIVATE int sqlite3BitvecBuiltinTest(int sz, int *aOp){ break; } case 3: - case 4: + case 4: default: { nx = 2; sqlite3_randomness(sizeof(i), &i); @@ -44125,7 +44125,7 @@ bitvec_end: ** ** The PCache.pSynced variable is used to optimize searching for a dirty ** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. +** a page that does not require a journal sync than one that does. ** Therefore, pSynced is maintained to that it *almost* always points ** to either the oldest page in the pDirty/pDirtyTail list that has a ** clear PGHDR_NEED_SYNC flag or to a page that is older than this one @@ -44166,7 +44166,7 @@ struct PCache { sqlite3_pcache_page *pLower; PgHdr *pPg; unsigned char *a; - + if( sqlite3PcacheTrace<2 ) return; if( pCache->pCache==0 ) return; N = sqlite3PcachePagecount(pCache); @@ -44258,12 +44258,12 @@ static void pcacheManageDirtyList(PgHdr *pPage, u8 addRemove){ if( addRemove & PCACHE_DIRTYLIST_REMOVE ){ assert( pPage->pDirtyNext || pPage==p->pDirtyTail ); assert( pPage->pDirtyPrev || pPage==p->pDirty ); - + /* Update the PCache1.pSynced variable if necessary. */ if( p->pSynced==pPage ){ p->pSynced = pPage->pDirtyPrev; } - + if( pPage->pDirtyNext ){ pPage->pDirtyNext->pDirtyPrev = pPage->pDirtyPrev; }else{ @@ -44273,7 +44273,7 @@ static void pcacheManageDirtyList(PgHdr *pPage, u8 addRemove){ if( pPage->pDirtyPrev ){ pPage->pDirtyPrev->pDirtyNext = pPage->pDirtyNext; }else{ - /* If there are now no dirty pages in the cache, set eCreate to 2. + /* If there are now no dirty pages in the cache, set eCreate to 2. ** This is an optimization that allows sqlite3PcacheFetch() to skip ** searching for a dirty page to eject from the cache when it might ** otherwise have to. */ @@ -44290,7 +44290,7 @@ static void pcacheManageDirtyList(PgHdr *pPage, u8 addRemove){ } if( addRemove & PCACHE_DIRTYLIST_ADD ){ assert( pPage->pDirtyNext==0 && pPage->pDirtyPrev==0 && p->pDirty!=pPage ); - + pPage->pDirtyNext = p->pDirty; if( pPage->pDirtyNext ){ assert( pPage->pDirtyNext->pDirtyPrev==0 ); @@ -44305,11 +44305,11 @@ static void pcacheManageDirtyList(PgHdr *pPage, u8 addRemove){ p->pDirty = pPage; /* If pSynced is NULL and this page has a clear NEED_SYNC flag, set - ** pSynced to point to it. Checking the NEED_SYNC flag is an + ** pSynced to point to it. Checking the NEED_SYNC flag is an ** optimization, as if pSynced points to a page with the NEED_SYNC - ** flag set sqlite3PcacheFetchStress() searches through all newer + ** flag set sqlite3PcacheFetchStress() searches through all newer ** entries of the dirty-list for a page with NEED_SYNC clear anyway. */ - if( !p->pSynced + if( !p->pSynced && 0==(pPage->flags&PGHDR_NEED_SYNC) /*OPTIMIZATION-IF-FALSE*/ ){ p->pSynced = pPage; @@ -44349,7 +44349,7 @@ static int numberOfCachePages(PCache *p){ /*************************************************** General Interfaces ****** ** -** Initialize and shutdown the page cache subsystem. Neither of these +** Initialize and shutdown the page cache subsystem. Neither of these ** functions are threadsafe. */ SQLITE_PRIVATE int sqlite3PcacheInitialize(void){ @@ -44375,8 +44375,8 @@ SQLITE_PRIVATE int sqlite3PcacheSize(void){ return sizeof(PCache); } /* ** Create a new PCache object. Storage space to hold the object -** has already been allocated and is passed in as the p pointer. -** The caller discovers how much space needs to be allocated by +** has already been allocated and is passed in as the p pointer. +** The caller discovers how much space needs to be allocated by ** calling sqlite3PcacheSize(). ** ** szExtra is some extra space allocated for each page. The first @@ -44488,7 +44488,7 @@ SQLITE_PRIVATE sqlite3_pcache_page *sqlite3PcacheFetch( /* ** If the sqlite3PcacheFetch() routine is unable to allocate a new ** page because no clean pages are available for reuse and the cache -** size limit has been reached, then this routine can be invoked to +** size limit has been reached, then this routine can be invoked to ** try harder to allocate a page. This routine might invoke the stress ** callback to spill dirty pages to the journal. It will then try to ** allocate the new page and will only fail to allocate a new page on @@ -44505,17 +44505,17 @@ SQLITE_PRIVATE int sqlite3PcacheFetchStress( if( pCache->eCreate==2 ) return 0; if( sqlite3PcachePagecount(pCache)>pCache->szSpill ){ - /* Find a dirty page to write-out and recycle. First try to find a + /* Find a dirty page to write-out and recycle. First try to find a ** page that does not require a journal-sync (one with PGHDR_NEED_SYNC - ** cleared), but if that is not possible settle for any other + ** cleared), but if that is not possible settle for any other ** unreferenced dirty page. ** ** If the LRU page in the dirty list that has a clear PGHDR_NEED_SYNC ** flag is currently referenced, then the following may leave pSynced ** set incorrectly (pointing to other than the LRU page with NEED_SYNC ** cleared). This is Ok, as pSynced is just an optimization. */ - for(pPg=pCache->pSynced; - pPg && (pPg->nRef || (pPg->flags&PGHDR_NEED_SYNC)); + for(pPg=pCache->pSynced; + pPg && (pPg->nRef || (pPg->flags&PGHDR_NEED_SYNC)); pPg=pPg->pDirtyPrev ); pCache->pSynced = pPg; @@ -44525,7 +44525,7 @@ SQLITE_PRIVATE int sqlite3PcacheFetchStress( if( pPg ){ int rc; #ifdef SQLITE_LOG_CACHE_SPILL - sqlite3_log(SQLITE_FULL, + sqlite3_log(SQLITE_FULL, "spill page %d making room for %d - cache used: %d/%d", pPg->pgno, pgno, sqlite3GlobalConfig.pcache.xPagecount(pCache->pCache), @@ -44715,7 +44715,7 @@ SQLITE_PRIVATE void sqlite3PcacheClearSyncFlags(PCache *pCache){ } /* -** Change the page number of page p to newPgno. +** Change the page number of page p to newPgno. */ SQLITE_PRIVATE void sqlite3PcacheMove(PgHdr *p, Pgno newPgno){ PCache *pCache = p->pCache; @@ -44778,7 +44778,7 @@ SQLITE_PRIVATE void sqlite3PcacheClose(PCache *pCache){ sqlite3GlobalConfig.pcache2.xDestroy(pCache->pCache); } -/* +/* ** Discard the contents of the cache. */ SQLITE_PRIVATE void sqlite3PcacheClear(PCache *pCache){ @@ -44869,7 +44869,7 @@ SQLITE_PRIVATE PgHdr *sqlite3PcacheDirtyList(PCache *pCache){ return pcacheSortDirtyList(pCache->pDirty); } -/* +/* ** Return the total number of references to all pages held by the cache. ** ** This is not the total number of pages referenced, but the sum of the @@ -44886,7 +44886,7 @@ SQLITE_PRIVATE int sqlite3PcachePageRefcount(PgHdr *p){ return p->nRef; } -/* +/* ** Return the total number of pages in the cache. */ SQLITE_PRIVATE int sqlite3PcachePagecount(PCache *pCache){ @@ -44928,7 +44928,7 @@ SQLITE_PRIVATE int sqlite3PcacheSetSpillsize(PCache *p, int mxPage){ p->szSpill = mxPage; } res = numberOfCachePages(p); - if( resszSpill ) res = p->szSpill; + if( resszSpill ) res = p->szSpill; return res; } @@ -45039,7 +45039,7 @@ SQLITE_PRIVATE void sqlite3PcacheIterateDirty(PCache *pCache, void (*xIter)(PgHd ** ** The third case is a chunk of heap memory (defaulting to 100 pages worth) ** that is allocated when the page cache is created. The size of the local -** bulk allocation can be adjusted using +** bulk allocation can be adjusted using ** ** sqlite3_config(SQLITE_CONFIG_PAGECACHE, (void*)0, 0, N). ** @@ -45064,9 +45064,9 @@ typedef struct PgFreeslot PgFreeslot; typedef struct PGroup PGroup; /* -** Each cache entry is represented by an instance of the following +** Each cache entry is represented by an instance of the following ** structure. Unless SQLITE_PCACHE_SEPARATE_HEADER is defined, a buffer of -** PgHdr1.pCache->szPage bytes is allocated directly before this structure +** PgHdr1.pCache->szPage bytes is allocated directly before this structure ** in memory. */ struct PgHdr1 { @@ -45081,7 +45081,7 @@ struct PgHdr1 { PgHdr1 *pLruPrev; /* Previous in LRU list of unpinned pages */ }; -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set +/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set ** of one or more PCaches that are able to recycle each other's unpinned ** pages when they are under memory pressure. A PGroup is an instance of ** the following object. @@ -45117,12 +45117,12 @@ struct PGroup { ** temporary or transient database) has a single page cache which ** is an instance of this object. ** -** Pointers to structures of this type are cast and returned as +** Pointers to structures of this type are cast and returned as ** opaque sqlite3_pcache* handles. */ struct PCache1 { /* Cache configuration parameters. Page size (szPage) and the purgeable - ** flag (bPurgeable) are set when the cache is created. nMax may be + ** flag (bPurgeable) are set when the cache is created. nMax may be ** modified at any time by a call to the pcache1Cachesize() method. ** The PGroup mutex must be held when accessing nMax. */ @@ -45168,7 +45168,7 @@ static SQLITE_WSD struct PCacheGlobal { */ int isInit; /* True if initialized */ int separateCache; /* Use a new PGroup for each PCache */ - int nInitPage; /* Initial bulk allocation size */ + int nInitPage; /* Initial bulk allocation size */ int szSlot; /* Size of each free slot */ int nSlot; /* The number of pcache slots */ int nReserve; /* Try to keep nFreeSlot above this */ @@ -45209,7 +45209,7 @@ static SQLITE_WSD struct PCacheGlobal { /* -** This function is called during initialization if a static buffer is +** This function is called during initialization if a static buffer is ** supplied to use for the page-cache by passing the SQLITE_CONFIG_PAGECACHE ** verb to sqlite3_config(). Parameter pBuf points to an allocation large ** enough to contain 'n' buffers of 'sz' bytes each. @@ -45278,8 +45278,8 @@ static int pcache1InitBulk(PCache1 *pCache){ /* ** Malloc function used within this file to allocate space from the buffer -** configured using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no -** such buffer exists or there is no space left in it, this function falls +** configured using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no +** such buffer exists or there is no space left in it, this function falls ** back to sqlite3Malloc(). ** ** Multiple threads can run this routine at the same time. Global variables @@ -45385,7 +45385,7 @@ static PgHdr1 *pcache1AllocPage(PCache1 *pCache, int benignMalloc){ }else{ #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT /* The group mutex must be released before pcache1Alloc() is called. This - ** is because it might call sqlite3_release_memory(), which assumes that + ** is because it might call sqlite3_release_memory(), which assumes that ** this mutex is not held. */ assert( pcache1.separateCache==0 ); assert( pCache->pGroup==&pcache1.grp ); @@ -45527,7 +45527,7 @@ static void pcache1ResizeHash(PCache1 *p){ } /* -** This function is used internally to remove the page pPage from the +** This function is used internally to remove the page pPage from the ** PGroup LRU list, if is part of it. If pPage is not part of the PGroup ** LRU list, then this function is a no-op. ** @@ -45555,7 +45555,7 @@ static PgHdr1 *pcache1PinPage(PgHdr1 *pPage){ /* -** Remove the page supplied as an argument from the hash table +** Remove the page supplied as an argument from the hash table ** (PCache1.apHash structure) that it is currently stored in. ** Also free the page if freePage is true. ** @@ -45598,8 +45598,8 @@ static void pcache1EnforceMaxPage(PCache1 *pCache){ } /* -** Discard all pages from cache pCache with a page number (key value) -** greater than or equal to iLimit. Any pinned pages that meet this +** Discard all pages from cache pCache with a page number (key value) +** greater than or equal to iLimit. Any pinned pages that meet this ** criteria are unpinned before they are discarded. ** ** The PCache mutex must be held when this function is called. @@ -45631,7 +45631,7 @@ static void pcache1TruncateUnsafe( PgHdr1 **pp; PgHdr1 *pPage; assert( hnHash ); - pp = &pCache->apHash[h]; + pp = &pCache->apHash[h]; while( (pPage = *pp)!=0 ){ if( pPage->iKey>=iLimit ){ pCache->nPage--; @@ -45672,7 +45672,7 @@ static int pcache1Init(void *NotUsed){ ** ** * Use a unified cache in single-threaded applications that have ** configured a start-time buffer for use as page-cache memory using - ** sqlite3_config(SQLITE_CONFIG_PAGECACHE, pBuf, sz, N) with non-NULL + ** sqlite3_config(SQLITE_CONFIG_PAGECACHE, pBuf, sz, N) with non-NULL ** pBuf argument. ** ** * Otherwise use separate caches (mode-1) @@ -45709,7 +45709,7 @@ static int pcache1Init(void *NotUsed){ /* ** Implementation of the sqlite3_pcache.xShutdown method. -** Note that the static mutex allocated in xInit does +** Note that the static mutex allocated in xInit does ** not need to be freed. */ static void pcache1Shutdown(void *NotUsed){ @@ -45769,7 +45769,7 @@ static sqlite3_pcache *pcache1Create(int szPage, int szExtra, int bPurgeable){ } /* -** Implementation of the sqlite3_pcache.xCachesize method. +** Implementation of the sqlite3_pcache.xCachesize method. ** ** Configure the cache_size limit for a cache. */ @@ -45788,7 +45788,7 @@ static void pcache1Cachesize(sqlite3_pcache *p, int nMax){ } /* -** Implementation of the sqlite3_pcache.xShrink method. +** Implementation of the sqlite3_pcache.xShrink method. ** ** Free up as much memory as possible. */ @@ -45807,7 +45807,7 @@ static void pcache1Shrink(sqlite3_pcache *p){ } /* -** Implementation of the sqlite3_pcache.xPagecount method. +** Implementation of the sqlite3_pcache.xPagecount method. */ static int pcache1Pagecount(sqlite3_pcache *p){ int n; @@ -45828,8 +45828,8 @@ static int pcache1Pagecount(sqlite3_pcache *p){ ** for these steps, the main pcache1Fetch() procedure can run faster. */ static SQLITE_NOINLINE PgHdr1 *pcache1FetchStage2( - PCache1 *pCache, - unsigned int iKey, + PCache1 *pCache, + unsigned int iKey, int createFlag ){ unsigned int nPinned; @@ -45871,8 +45871,8 @@ static SQLITE_NOINLINE PgHdr1 *pcache1FetchStage2( } } - /* Step 5. If a usable page buffer has still not been found, - ** attempt to allocate a new one. + /* Step 5. If a usable page buffer has still not been found, + ** attempt to allocate a new one. */ if( !pPage ){ pPage = pcache1AllocPage(pCache, createFlag==1); @@ -45897,13 +45897,13 @@ static SQLITE_NOINLINE PgHdr1 *pcache1FetchStage2( } /* -** Implementation of the sqlite3_pcache.xFetch method. +** Implementation of the sqlite3_pcache.xFetch method. ** ** Fetch a page by key value. ** ** Whether or not a new page may be allocated by this function depends on ** the value of the createFlag argument. 0 means do not allocate a new -** page. 1 means allocate a new page if space is easily available. 2 +** page. 1 means allocate a new page if space is easily available. 2 ** means to try really hard to allocate a new page. ** ** For a non-purgeable cache (a cache used as the storage for an in-memory @@ -45914,7 +45914,7 @@ static SQLITE_NOINLINE PgHdr1 *pcache1FetchStage2( ** There are three different approaches to obtaining space for a page, ** depending on the value of parameter createFlag (which may be 0, 1 or 2). ** -** 1. Regardless of the value of createFlag, the cache is searched for a +** 1. Regardless of the value of createFlag, the cache is searched for a ** copy of the requested page. If one is found, it is returned. ** ** 2. If createFlag==0 and the page is not already in the cache, NULL is @@ -45928,13 +45928,13 @@ static SQLITE_NOINLINE PgHdr1 *pcache1FetchStage2( ** PCache1.nMax, or ** ** (b) the number of pages pinned by the cache is greater than -** the sum of nMax for all purgeable caches, less the sum of +** the sum of nMax for all purgeable caches, less the sum of ** nMin for all other purgeable caches, or ** ** 4. If none of the first three conditions apply and the cache is marked ** as purgeable, and if one of the following is true: ** -** (a) The number of pages allocated for the cache is already +** (a) The number of pages allocated for the cache is already ** PCache1.nMax, or ** ** (b) The number of pages allocated for all purgeable caches is @@ -45946,7 +45946,7 @@ static SQLITE_NOINLINE PgHdr1 *pcache1FetchStage2( ** ** then attempt to recycle a page from the LRU list. If it is the right ** size, return the recycled buffer. Otherwise, free the buffer and -** proceed to step 5. +** proceed to step 5. ** ** 5. Otherwise, allocate and return a new page buffer. ** @@ -45956,8 +45956,8 @@ static SQLITE_NOINLINE PgHdr1 *pcache1FetchStage2( ** invokes the appropriate routine. */ static PgHdr1 *pcache1FetchNoMutex( - sqlite3_pcache *p, - unsigned int iKey, + sqlite3_pcache *p, + unsigned int iKey, int createFlag ){ PCache1 *pCache = (PCache1 *)p; @@ -45986,8 +45986,8 @@ static PgHdr1 *pcache1FetchNoMutex( } #if PCACHE1_MIGHT_USE_GROUP_MUTEX static PgHdr1 *pcache1FetchWithMutex( - sqlite3_pcache *p, - unsigned int iKey, + sqlite3_pcache *p, + unsigned int iKey, int createFlag ){ PCache1 *pCache = (PCache1 *)p; @@ -46001,8 +46001,8 @@ static PgHdr1 *pcache1FetchWithMutex( } #endif static sqlite3_pcache_page *pcache1Fetch( - sqlite3_pcache *p, - unsigned int iKey, + sqlite3_pcache *p, + unsigned int iKey, int createFlag ){ #if PCACHE1_MIGHT_USE_GROUP_MUTEX || defined(SQLITE_DEBUG) @@ -46032,18 +46032,18 @@ static sqlite3_pcache_page *pcache1Fetch( ** Mark a page as unpinned (eligible for asynchronous recycling). */ static void pcache1Unpin( - sqlite3_pcache *p, - sqlite3_pcache_page *pPg, + sqlite3_pcache *p, + sqlite3_pcache_page *pPg, int reuseUnlikely ){ PCache1 *pCache = (PCache1 *)p; PgHdr1 *pPage = (PgHdr1 *)pPg; PGroup *pGroup = pCache->pGroup; - + assert( pPage->pCache==pCache ); pcache1EnterMutex(pGroup); - /* It is an error to call this function if the page is already + /* It is an error to call this function if the page is already ** part of the PGroup LRU list. */ assert( pPage->pLruPrev==0 && pPage->pLruNext==0 ); @@ -46065,7 +46065,7 @@ static void pcache1Unpin( } /* -** Implementation of the sqlite3_pcache.xRekey method. +** Implementation of the sqlite3_pcache.xRekey method. */ static void pcache1Rekey( sqlite3_pcache *p, @@ -46076,7 +46076,7 @@ static void pcache1Rekey( PCache1 *pCache = (PCache1 *)p; PgHdr1 *pPage = (PgHdr1 *)pPg; PgHdr1 **pp; - unsigned int h; + unsigned int h; assert( pPage->iKey==iOld ); assert( pPage->pCache==pCache ); @@ -46101,7 +46101,7 @@ static void pcache1Rekey( } /* -** Implementation of the sqlite3_pcache.xTruncate method. +** Implementation of the sqlite3_pcache.xTruncate method. ** ** Discard all unpinned pages in the cache with a page number equal to ** or greater than parameter iLimit. Any pinned pages with a page number @@ -46118,7 +46118,7 @@ static void pcache1Truncate(sqlite3_pcache *p, unsigned int iLimit){ } /* -** Implementation of the sqlite3_pcache.xDestroy method. +** Implementation of the sqlite3_pcache.xDestroy method. ** ** Destroy a cache allocated using pcache1Create(). */ @@ -46184,7 +46184,7 @@ SQLITE_PRIVATE sqlite3_mutex *sqlite3Pcache1Mutex(void){ ** by the current thread may be sqlite3_free()ed. ** ** nReq is the number of bytes of memory required. Once this much has -** been released, the function returns. The return value is the total number +** been released, the function returns. The return value is the total number ** of bytes of memory released. */ SQLITE_PRIVATE int sqlite3PcacheReleaseMemory(int nReq){ @@ -46275,7 +46275,7 @@ SQLITE_PRIVATE void sqlite3PcacheStats( ** extracts the least value from the RowSet. ** ** The INSERT primitive might allocate additional memory. Memory is -** allocated in chunks so most INSERTs do no allocation. There is an +** allocated in chunks so most INSERTs do no allocation. There is an ** upper bound on the size of allocated memory. No memory is freed ** until DESTROY. ** @@ -46323,7 +46323,7 @@ SQLITE_PRIVATE void sqlite3PcacheStats( ** 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 { +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) */ @@ -46371,7 +46371,7 @@ struct RowSet { ** ** It must be the case that N is sufficient to make a Rowset. If not ** an assertion fault occurs. -** +** ** If N is larger than the minimum, use the surplus as an initial ** allocation of entries available to be filled. */ @@ -46471,7 +46471,7 @@ SQLITE_PRIVATE void sqlite3RowSetInsert(RowSet *p, i64 rowid){ /* ** Merge two lists of RowSetEntry objects. Remove duplicates. ** -** The input lists are connected via pRight pointers and are +** The input lists are connected via pRight pointers and are ** assumed to each already be in sorted order. */ static struct RowSetEntry *rowSetEntryMerge( @@ -46508,7 +46508,7 @@ static struct RowSetEntry *rowSetEntryMerge( /* ** Sort all elements on the list of RowSetEntry objects into order of ** increasing v. -*/ +*/ static struct RowSetEntry *rowSetEntrySort(struct RowSetEntry *pIn){ unsigned int i; struct RowSetEntry *pNext, *aBucket[40]; @@ -46581,7 +46581,7 @@ static struct RowSetEntry *rowSetNDeepTree( struct RowSetEntry *pLeft; /* Left subtree */ if( *ppList==0 ){ /*OPTIMIZATION-IF-TRUE*/ /* Prevent unnecessary deep recursion when we run out of entries */ - return 0; + return 0; } if( iDepth>1 ){ /*OPTIMIZATION-IF-TRUE*/ /* This branch causes a *balanced* tree to be generated. A valid tree @@ -46751,7 +46751,7 @@ SQLITE_PRIVATE int sqlite3RowSetTest(RowSet *pRowSet, int iBatch, sqlite3_int64 ** ************************************************************************* ** This is the implementation of the page cache subsystem or "pager". -** +** ** The pager is used to access a database disk file. It implements ** atomic commit and rollback through the use of a journal file that ** is separate from the database file. The pager also implements file @@ -46774,8 +46774,8 @@ SQLITE_PRIVATE int sqlite3RowSetTest(RowSet *pRowSet, int iBatch, sqlite3_int64 ** May you share freely, never taking more than you give. ** ************************************************************************* -** This header file defines the interface to the write-ahead logging -** system. Refer to the comments below and the header comment attached to +** This header file defines the interface to the write-ahead logging +** system. Refer to the comments below and the header comment attached to ** the implementation of each function in log.c for further details. */ @@ -46814,8 +46814,8 @@ SQLITE_PRIVATE int sqlite3RowSetTest(RowSet *pRowSet, int iBatch, sqlite3_int64 #define WAL_SAVEPOINT_NDATA 4 -/* Connection to a write-ahead log (WAL) file. -** There is one object of this type for each pager. +/* Connection to a write-ahead log (WAL) file. +** There is one object of this type for each pager. */ typedef struct Wal Wal; @@ -46826,7 +46826,7 @@ SQLITE_PRIVATE int sqlite3WalClose(Wal *pWal, sqlite3*, int sync_flags, int, u8 /* Set the limiting size of a WAL file. */ SQLITE_PRIVATE void sqlite3WalLimit(Wal*, i64); -/* Used by readers to open (lock) and close (unlock) a snapshot. A +/* Used by readers to open (lock) and close (unlock) a snapshot. A ** snapshot is like a read-transaction. It is the state of the database ** at an instant in time. sqlite3WalOpenSnapshot gets a read lock and ** preserves the current state even if the other threads or processes @@ -46861,7 +46861,7 @@ SQLITE_PRIVATE int sqlite3WalSavepointUndo(Wal *pWal, u32 *aWalData); /* Write a frame or frames to the log. */ SQLITE_PRIVATE int sqlite3WalFrames(Wal *pWal, int, PgHdr *, Pgno, int, int); -/* Copy pages from the log to the database file */ +/* Copy pages from the log to the database file */ SQLITE_PRIVATE int sqlite3WalCheckpoint( Wal *pWal, /* Write-ahead log connection */ sqlite3 *db, /* Check this handle's interrupt flag */ @@ -46889,7 +46889,7 @@ SQLITE_PRIVATE int sqlite3WalExclusiveMode(Wal *pWal, int op); /* Return true if the argument is non-NULL and the WAL module is using ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the -** WAL module is using shared-memory, return false. +** WAL module is using shared-memory, return false. */ SQLITE_PRIVATE int sqlite3WalHeapMemory(Wal *pWal); @@ -46929,60 +46929,60 @@ SQLITE_PRIVATE sqlite3_file *sqlite3WalFile(Wal *pWal); ** ** Definition: A page of the database file is said to be "overwriteable" if ** one or more of the following are true about the page: -** +** ** (a) The original content of the page as it was at the beginning of ** the transaction has been written into the rollback journal and ** synced. -** +** ** (b) The page was a freelist leaf page at the start of the transaction. -** +** ** (c) The page number is greater than the largest page that existed in ** the database file at the start of the transaction. -** +** ** (1) A page of the database file is never overwritten unless one of the ** following are true: -** +** ** (a) The page and all other pages on the same sector are overwriteable. -** +** ** (b) The atomic page write optimization is enabled, and the entire ** transaction other than the update of the transaction sequence ** number consists of a single page change. -** +** ** (2) The content of a page written into the rollback journal exactly matches ** both the content in the database when the rollback journal was written ** and the content in the database at the beginning of the current ** transaction. -** +** ** (3) Writes to the database file are an integer multiple of the page size ** in length and are aligned on a page boundary. -** +** ** (4) Reads from the database file are either aligned on a page boundary and ** an integer multiple of the page size in length or are taken from the ** first 100 bytes of the database file. -** +** ** (5) All writes to the database file are synced prior to the rollback journal ** being deleted, truncated, or zeroed. -** +** ** (6) If a master journal file is used, then all writes to the database file ** are synced prior to the master journal being deleted. -** +** ** Definition: Two databases (or the same database at two points it time) ** are said to be "logically equivalent" if they give the same answer to ** all queries. Note in particular the content of freelist leaf ** pages can be changed arbitrarily without affecting the logical equivalence ** of the database. -** +** ** (7) At any time, if any subset, including the empty set and the total set, -** of the unsynced changes to a rollback journal are removed and the +** of the unsynced changes to a rollback journal are removed and the ** journal is rolled back, the resulting database file will be logically ** equivalent to the database file at the beginning of the transaction. -** +** ** (8) When a transaction is rolled back, the xTruncate method of the VFS ** is called to restore the database file to the same size it was at ** the beginning of the transaction. (In some VFSes, the xTruncate ** method is a no-op, but that does not change the fact the SQLite will ** invoke it.) -** +** ** (9) Whenever the database file is modified, at least one bit in the range ** of bytes from 24 through 39 inclusive will be changed prior to releasing ** the EXCLUSIVE lock, thus signaling other connections on the same @@ -47015,7 +47015,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ /* ** The following two macros are used within the PAGERTRACE() macros above -** to print out file-descriptors. +** to print out file-descriptors. ** ** PAGERID() takes a pointer to a Pager struct as its argument. The ** associated file-descriptor is returned. FILEHANDLEID() takes an sqlite3_file @@ -47036,7 +47036,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** | | | ** | V | ** |<-------WRITER_LOCKED------> ERROR -** | | ^ +** | | ^ ** | V | ** |<------WRITER_CACHEMOD-------->| ** | | | @@ -47048,7 +47048,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** ** ** List of state transitions and the C [function] that performs each: -** +** ** OPEN -> READER [sqlite3PagerSharedLock] ** READER -> OPEN [pager_unlock] ** @@ -47060,7 +47060,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** ** WRITER_*** -> ERROR [pager_error] ** ERROR -> OPEN [pager_unlock] -** +** ** ** OPEN: ** @@ -47074,9 +47074,9 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** ** READER: ** -** In this state all the requirements for reading the database in +** In this state all the requirements for reading the database in ** rollback (non-WAL) mode are met. Unless the pager is (or recently -** was) in exclusive-locking mode, a user-level read transaction is +** was) in exclusive-locking mode, a user-level read transaction is ** open. The database size is known in this state. ** ** A connection running with locking_mode=normal enters this state when @@ -47086,28 +47086,28 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** this state even after the read-transaction is closed. The only way ** a locking_mode=exclusive connection can transition from READER to OPEN ** is via the ERROR state (see below). -** +** ** * A read transaction may be active (but a write-transaction cannot). ** * A SHARED or greater lock is held on the database file. -** * The dbSize variable may be trusted (even if a user-level read +** * The dbSize variable may be trusted (even if a user-level read ** transaction is not active). The dbOrigSize and dbFileSize variables ** may not be trusted at this point. ** * If the database is a WAL database, then the WAL connection is open. -** * Even if a read-transaction is not open, it is guaranteed that +** * Even if a read-transaction is not open, it is guaranteed that ** there is no hot-journal in the file-system. ** ** WRITER_LOCKED: ** ** The pager moves to this state from READER when a write-transaction -** is first opened on the database. In WRITER_LOCKED state, all locks -** required to start a write-transaction are held, but no actual +** is first opened on the database. In WRITER_LOCKED state, all locks +** required to start a write-transaction are held, but no actual ** modifications to the cache or database have taken place. ** -** In rollback mode, a RESERVED or (if the transaction was opened with +** In rollback mode, a RESERVED or (if the transaction was opened with ** BEGIN EXCLUSIVE) EXCLUSIVE lock is obtained on the database file when -** moving to this state, but the journal file is not written to or opened -** to in this state. If the transaction is committed or rolled back while -** in WRITER_LOCKED state, all that is required is to unlock the database +** moving to this state, but the journal file is not written to or opened +** to in this state. If the transaction is committed or rolled back while +** in WRITER_LOCKED state, all that is required is to unlock the database ** file. ** ** IN WAL mode, WalBeginWriteTransaction() is called to lock the log file. @@ -47115,7 +47115,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** is made to obtain an EXCLUSIVE lock on the database file. ** ** * A write transaction is active. -** * If the connection is open in rollback-mode, a RESERVED or greater +** * If the connection is open in rollback-mode, a RESERVED or greater ** lock is held on the database file. ** * If the connection is open in WAL-mode, a WAL write transaction ** is open (i.e. sqlite3WalBeginWriteTransaction() has been successfully @@ -47134,7 +47134,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** ** * A write transaction is active. ** * A RESERVED or greater lock is held on the database file. -** * The journal file is open and the first header has been written +** * The journal file is open and the first header has been written ** to it, but the header has not been synced to disk. ** * The contents of the page cache have been modified. ** @@ -47147,7 +47147,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** ** * A write transaction is active. ** * An EXCLUSIVE or greater lock is held on the database file. -** * The journal file is open and the first header has been written +** * The journal file is open and the first header has been written ** and synced to disk. ** * The contents of the page cache have been modified (and possibly ** written to disk). @@ -47159,8 +47159,8 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** A rollback-mode pager changes to WRITER_FINISHED state from WRITER_DBMOD ** state after the entire transaction has been successfully written into the ** database file. In this state the transaction may be committed simply -** by finalizing the journal file. Once in WRITER_FINISHED state, it is -** not possible to modify the database further. At this point, the upper +** by finalizing the journal file. Once in WRITER_FINISHED state, it is +** not possible to modify the database further. At this point, the upper ** layer must either commit or rollback the transaction. ** ** * A write transaction is active. @@ -47168,19 +47168,19 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** * All writing and syncing of journal and database data has finished. ** If no error occurred, all that remains is to finalize the journal to ** commit the transaction. If an error did occur, the caller will need -** to rollback the transaction. +** to rollback the transaction. ** ** ERROR: ** ** The ERROR state is entered when an IO or disk-full error (including -** SQLITE_IOERR_NOMEM) occurs at a point in the code that makes it -** difficult to be sure that the in-memory pager state (cache contents, +** SQLITE_IOERR_NOMEM) occurs at a point in the code that makes it +** difficult to be sure that the in-memory pager state (cache contents, ** db size etc.) are consistent with the contents of the file-system. ** ** Temporary pager files may enter the ERROR state, but in-memory pagers ** cannot. ** -** For example, if an IO error occurs while performing a rollback, +** For example, if an IO error occurs while performing a rollback, ** the contents of the page-cache may be left in an inconsistent state. ** At this point it would be dangerous to change back to READER state ** (as usually happens after a rollback). Any subsequent readers might @@ -47190,13 +47190,13 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** instead of READER following such an error. ** ** Once it has entered the ERROR state, any attempt to use the pager -** to read or write data returns an error. Eventually, once all +** to read or write data returns an error. Eventually, once all ** outstanding transactions have been abandoned, the pager is able to -** transition back to OPEN state, discarding the contents of the +** transition back to OPEN state, discarding the contents of the ** page-cache and any other in-memory state at the same time. Everything ** is reloaded from disk (and, if necessary, hot-journal rollback peformed) ** when a read-transaction is next opened on the pager (transitioning -** the pager into READER state). At that point the system has recovered +** the pager into READER state). At that point the system has recovered ** from the error. ** ** Specifically, the pager jumps into the ERROR state if: @@ -47212,21 +47212,21 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** memory. ** ** In other cases, the error is returned to the b-tree layer. The b-tree -** layer then attempts a rollback operation. If the error condition +** layer then attempts a rollback operation. If the error condition ** persists, the pager enters the ERROR state via condition (1) above. ** ** Condition (3) is necessary because it can be triggered by a read-only ** statement executed within a transaction. In this case, if the error ** code were simply returned to the user, the b-tree layer would not ** automatically attempt a rollback, as it assumes that an error in a -** read-only statement cannot leave the pager in an internally inconsistent +** read-only statement cannot leave the pager in an internally inconsistent ** state. ** ** * The Pager.errCode variable is set to something other than SQLITE_OK. ** * There are one or more outstanding references to pages (after the ** last reference is dropped the pager should move back to OPEN state). ** * The pager is not an in-memory pager. -** +** ** ** Notes: ** @@ -47236,7 +47236,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** ** * Normally, a connection open in exclusive mode is never in PAGER_OPEN ** state. There are two exceptions: immediately after exclusive-mode has -** been turned on (and before any read or write transactions are +** been turned on (and before any read or write transactions are ** executed), and when the pager is leaving the "error state". ** ** * See also: assert_pager_state(). @@ -47250,7 +47250,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ #define PAGER_ERROR 6 /* -** The Pager.eLock variable is almost always set to one of the +** The Pager.eLock variable is almost always set to one of the ** following locking-states, according to the lock currently held on ** the database file: NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. ** This variable is kept up to date as locks are taken and released by @@ -47265,20 +47265,20 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** to a less exclusive (lower) value than the lock that is actually held ** at the system level, but it is never set to a more exclusive value. ** -** This is usually safe. If an xUnlock fails or appears to fail, there may +** This is usually safe. If an xUnlock fails or appears to fail, there may ** be a few redundant xLock() calls or a lock may be held for longer than ** required, but nothing really goes wrong. ** ** The exception is when the database file is unlocked as the pager moves -** from ERROR to OPEN state. At this point there may be a hot-journal file +** from ERROR to OPEN state. At this point there may be a hot-journal file ** in the file-system that needs to be rolled back (as part of an OPEN->SHARED ** transition, by the same pager or any other). If the call to xUnlock() ** fails at this point and the pager is left holding an EXCLUSIVE lock, this ** can confuse the call to xCheckReservedLock() call made later as part ** of hot-journal detection. ** -** xCheckReservedLock() is defined as returning true "if there is a RESERVED -** lock held by this process or any others". So xCheckReservedLock may +** xCheckReservedLock() is defined as returning true "if there is a RESERVED +** lock held by this process or any others". So xCheckReservedLock may ** return true because the caller itself is holding an EXCLUSIVE lock (but ** doesn't know it because of a previous error in xUnlock). If this happens ** a hot-journal may be mistaken for a journal being created by an active @@ -47289,12 +47289,12 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** database in the ERROR state, Pager.eLock is set to UNKNOWN_LOCK. It ** is only changed back to a real locking state after a successful call ** to xLock(EXCLUSIVE). Also, the code to do the OPEN->SHARED state transition -** omits the check for a hot-journal if Pager.eLock is set to UNKNOWN_LOCK +** omits the check for a hot-journal if Pager.eLock is set to UNKNOWN_LOCK ** lock. Instead, it assumes a hot-journal exists and obtains an EXCLUSIVE ** lock on the database file before attempting to roll it back. See function ** PagerSharedLock() for more detail. ** -** Pager.eLock may only be set to UNKNOWN_LOCK when the pager is in +** Pager.eLock may only be set to UNKNOWN_LOCK when the pager is in ** PAGER_OPEN state. */ #define UNKNOWN_LOCK (EXCLUSIVE_LOCK+1) @@ -47314,7 +47314,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ #endif /* -** The maximum allowed sector size. 64KiB. If the xSectorsize() method +** The maximum allowed sector size. 64KiB. If the xSectorsize() method ** returns a value larger than this, then MAX_SECTOR_SIZE is used instead. ** This could conceivably cause corruption following a power failure on ** such a system. This is currently an undocumented limit. @@ -47330,7 +47330,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** ** When a savepoint is created, the PagerSavepoint.iHdrOffset field is ** set to 0. If a journal-header is written into the main journal while -** the savepoint is active, then iHdrOffset is set to the byte offset +** the savepoint is active, then iHdrOffset is set to the byte offset ** immediately following the last journal record written into the main ** journal before the journal-header. This is required during savepoint ** rollback (see pagerPlaybackSavepoint()). @@ -47380,34 +47380,34 @@ struct PagerSavepoint { ** ** changeCountDone ** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. +** This boolean variable is used to make sure that the change-counter +** (the 4-byte header field at byte offset 24 of the database file) is +** not updated more often than necessary. ** -** It is set to true when the change-counter field is updated, which +** It is set to true when the change-counter field is updated, which ** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is +** It is cleared (set to false) whenever an exclusive lock is ** relinquished on the database file. Each time a transaction is committed, ** The changeCountDone flag is inspected. If it is true, the work of ** updating the change-counter is omitted for the current transaction. ** -** This mechanism means that when running in exclusive mode, a connection +** This mechanism means that when running in exclusive mode, a connection ** need only update the change-counter once, for the first transaction ** committed. ** ** setMaster ** ** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a master-journal name to be written into the +** (or may not) specify a master-journal name to be written into the ** journal file before it is synced to disk. ** -** Whether or not a journal file contains a master-journal pointer affects -** the way in which the journal file is finalized after the transaction is +** Whether or not a journal file contains a master-journal pointer affects +** the way in which the journal file is finalized after the transaction is ** committed or rolled back when running in "journal_mode=PERSIST" mode. ** If a journal file does not contain a master-journal pointer, it is ** finalized by overwriting the first journal header with zeroes. If -** it does contain a master-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were +** it does contain a master-journal pointer the journal file is finalized +** by truncating it to zero bytes, just as if the connection were ** running in "journal_mode=truncate" mode. ** ** Journal files that contain master journal pointers cannot be finalized @@ -47433,12 +47433,12 @@ struct PagerSavepoint { ** to allocate a new page to prevent the journal file from being written ** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF ** case is a user preference. -** +** ** If the SPILLFLAG_NOSYNC bit is set, writing to the database from ** pagerStress() is permitted, but syncing the journal file is not. ** This flag is set by sqlite3PagerWrite() when the file-system sector-size ** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. +** from happening in between the journalling of two pages on the same sector. ** ** subjInMemory ** @@ -47446,16 +47446,16 @@ struct PagerSavepoint { ** is opened as an in-memory journal file. If false, then in-memory ** sub-journals are only used for in-memory pager files. ** -** This variable is updated by the upper layer each time a new +** This variable is updated by the upper layer each time a new ** write-transaction is opened. ** ** dbSize, dbOrigSize, dbFileSize ** ** Variable dbSize is set to the number of pages in the database file. ** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). +** OPEN and ERROR). ** -** dbSize is set based on the size of the database file, which may be +** dbSize is set based on the size of the database file, which may be ** larger than the size of the database (the value stored at offset ** 28 of the database header by the btree). If the size of the file ** is not an integer multiple of the page-size, the value stored in @@ -47466,10 +47466,10 @@ struct PagerSavepoint { ** ** During a write-transaction, if pages with page-numbers greater than ** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), +** Similarly, if the database is truncated using PagerTruncateImage(), ** dbSize is updated. ** -** Variables dbOrigSize and dbFileSize are valid in states +** Variables dbOrigSize and dbFileSize are valid in states ** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize ** variable at the start of the transaction. It is used during rollback, ** and to determine whether or not pages need to be journalled before @@ -47478,12 +47478,12 @@ struct PagerSavepoint { ** Throughout a write-transaction, dbFileSize contains the size of ** the file on disk in pages. It is set to a copy of dbSize when the ** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. +** to write or truncate the database file on disk. ** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), +** The only reason the dbFileSize variable is required is to suppress +** unnecessary calls to xTruncate() after committing a transaction. If, +** when a transaction is committed, the dbFileSize variable indicates +** that the database file is larger than the database image (Pager.dbSize), ** pager_truncate() is called. The pager_truncate() call uses xFilesize() ** to measure the database file on disk, and then truncates it if required. ** dbFileSize is not used when rolling back a transaction. In this case @@ -47494,20 +47494,20 @@ struct PagerSavepoint { ** dbHintSize ** ** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. +** the VFS xFileControl(FCNTL_SIZE_HINT) method. ** ** dbHintSize is set to a copy of the dbSize variable when a ** write-transaction is opened (at the same time as dbFileSize and ** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, ** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for +** size-hint passed to the method call. See pager_write_pagelist() for ** details. ** ** errCode ** ** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX +** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode +** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX ** sub-codes. */ struct Pager { @@ -47603,7 +47603,7 @@ struct Pager { /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains -** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS +** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS ** or CACHE_WRITE to sqlite3_db_status(). */ #define PAGER_STAT_HIT 0 @@ -47660,7 +47660,7 @@ static const unsigned char aJournalMagic[] = { #define JOURNAL_PG_SZ(pPager) ((pPager->pageSize) + 8) /* -** The journal header size for this pager. This is usually the same +** The journal header size for this pager. This is usually the same ** size as a single disk sector. See also setSectorSize(). */ #define JOURNAL_HDR_SZ(pPager) (pPager->sectorSize) @@ -47729,7 +47729,7 @@ SQLITE_PRIVATE int sqlite3PagerUseWal(Pager *pPager, Pgno pgno){ # define pagerBeginReadTransaction(z) SQLITE_OK #endif -#ifndef NDEBUG +#ifndef NDEBUG /* ** Usage: ** @@ -47758,25 +47758,25 @@ static int assert_pager_state(Pager *p){ assert( p->tempFile==0 || p->eLock==EXCLUSIVE_LOCK ); assert( p->tempFile==0 || pPager->changeCountDone ); - /* If the useJournal flag is clear, the journal-mode must be "OFF". + /* If the useJournal flag is clear, the journal-mode must be "OFF". ** And if the journal-mode is "OFF", the journal file must not be open. */ assert( p->journalMode==PAGER_JOURNALMODE_OFF || p->useJournal ); assert( p->journalMode!=PAGER_JOURNALMODE_OFF || !isOpen(p->jfd) ); - /* Check that MEMDB implies noSync. And an in-memory journal. Since - ** this means an in-memory pager performs no IO at all, it cannot encounter - ** either SQLITE_IOERR or SQLITE_FULL during rollback or while finalizing - ** a journal file. (although the in-memory journal implementation may - ** return SQLITE_IOERR_NOMEM while the journal file is being written). It - ** is therefore not possible for an in-memory pager to enter the ERROR + /* Check that MEMDB implies noSync. And an in-memory journal. Since + ** this means an in-memory pager performs no IO at all, it cannot encounter + ** either SQLITE_IOERR or SQLITE_FULL during rollback or while finalizing + ** a journal file. (although the in-memory journal implementation may + ** return SQLITE_IOERR_NOMEM while the journal file is being written). It + ** is therefore not possible for an in-memory pager to enter the ERROR ** state. */ if( MEMDB ){ assert( !isOpen(p->fd) ); assert( p->noSync ); - assert( p->journalMode==PAGER_JOURNALMODE_OFF - || p->journalMode==PAGER_JOURNALMODE_MEMORY + assert( p->journalMode==PAGER_JOURNALMODE_OFF + || p->journalMode==PAGER_JOURNALMODE_MEMORY ); assert( p->eState!=PAGER_ERROR && p->eState!=PAGER_OPEN ); assert( pagerUseWal(p)==0 ); @@ -47823,9 +47823,9 @@ static int assert_pager_state(Pager *p){ ** to journal_mode=wal. */ assert( p->eLock>=RESERVED_LOCK ); - assert( isOpen(p->jfd) - || p->journalMode==PAGER_JOURNALMODE_OFF - || p->journalMode==PAGER_JOURNALMODE_WAL + assert( isOpen(p->jfd) + || p->journalMode==PAGER_JOURNALMODE_OFF + || p->journalMode==PAGER_JOURNALMODE_WAL ); } assert( pPager->dbOrigSize==pPager->dbFileSize ); @@ -47837,9 +47837,9 @@ static int assert_pager_state(Pager *p){ assert( pPager->errCode==SQLITE_OK ); assert( !pagerUseWal(pPager) ); assert( p->eLock>=EXCLUSIVE_LOCK ); - assert( isOpen(p->jfd) - || p->journalMode==PAGER_JOURNALMODE_OFF - || p->journalMode==PAGER_JOURNALMODE_WAL + assert( isOpen(p->jfd) + || p->journalMode==PAGER_JOURNALMODE_OFF + || p->journalMode==PAGER_JOURNALMODE_WAL ); assert( pPager->dbOrigSize<=pPager->dbHintSize ); break; @@ -47848,9 +47848,9 @@ static int assert_pager_state(Pager *p){ assert( p->eLock==EXCLUSIVE_LOCK ); assert( pPager->errCode==SQLITE_OK ); assert( !pagerUseWal(pPager) ); - assert( isOpen(p->jfd) - || p->journalMode==PAGER_JOURNALMODE_OFF - || p->journalMode==PAGER_JOURNALMODE_WAL + assert( isOpen(p->jfd) + || p->journalMode==PAGER_JOURNALMODE_OFF + || p->journalMode==PAGER_JOURNALMODE_WAL ); break; @@ -47868,7 +47868,7 @@ static int assert_pager_state(Pager *p){ } #endif /* ifndef NDEBUG */ -#ifdef SQLITE_DEBUG +#ifdef SQLITE_DEBUG /* ** Return a pointer to a human readable string in a static buffer ** containing the state of the Pager object passed as an argument. This @@ -48016,7 +48016,7 @@ static int write32bits(sqlite3_file *fd, i64 offset, u32 val){ ** succeeds, set the Pager.eLock variable to match the (attempted) new lock. ** ** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is -** called, do not modify it. See the comment above the #define of +** called, do not modify it. See the comment above the #define of ** UNKNOWN_LOCK for an explanation of this. */ static int pagerUnlockDb(Pager *pPager, int eLock){ @@ -48039,11 +48039,11 @@ static int pagerUnlockDb(Pager *pPager, int eLock){ /* ** Lock the database file to level eLock, which must be either SHARED_LOCK, ** RESERVED_LOCK or EXCLUSIVE_LOCK. If the caller is successful, set the -** Pager.eLock variable to the new locking state. +** Pager.eLock variable to the new locking state. ** -** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is -** called, do not modify it unless the new locking state is EXCLUSIVE_LOCK. -** See the comment above the #define of UNKNOWN_LOCK for an explanation +** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is +** called, do not modify it unless the new locking state is EXCLUSIVE_LOCK. +** See the comment above the #define of UNKNOWN_LOCK for an explanation ** of this. */ static int pagerLockDb(Pager *pPager, int eLock){ @@ -48148,8 +48148,8 @@ static void checkPage(PgHdr *pPg){ /* ** When this is called the journal file for pager pPager must be open. -** This function attempts to read a master journal file name from the -** end of the file and, if successful, copies it into memory supplied +** This function attempts to read a master journal file name from the +** end of the file and, if successful, copies it into memory supplied ** by the caller. See comments above writeMasterJournal() for the format ** used to store a master journal file name at the end of a journal file. ** @@ -48165,7 +48165,7 @@ static void checkPage(PgHdr *pPg){ ** nul-terminator byte is appended to the buffer following the master ** journal file name. ** -** If it is determined that no master journal file name is present +** If it is determined that no master journal file name is present ** zMaster[0] is set to 0 and SQLITE_OK returned. ** ** If an error occurs while reading from the journal file, an SQLite @@ -48183,8 +48183,8 @@ static int readMasterJournal(sqlite3_file *pJrnl, char *zMaster, u32 nMaster){ if( SQLITE_OK!=(rc = sqlite3OsFileSize(pJrnl, &szJ)) || szJ<16 || SQLITE_OK!=(rc = read32bits(pJrnl, szJ-16, &len)) - || len>=nMaster - || len==0 + || len>=nMaster + || len==0 || SQLITE_OK!=(rc = read32bits(pJrnl, szJ-12, &cksum)) || SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, aMagic, 8, szJ-8)) || memcmp(aMagic, aJournalMagic, 8) @@ -48206,13 +48206,13 @@ static int readMasterJournal(sqlite3_file *pJrnl, char *zMaster, u32 nMaster){ len = 0; } zMaster[len] = '\0'; - + return SQLITE_OK; } /* -** Return the offset of the sector boundary at or immediately -** following the value in pPager->journalOff, assuming a sector +** Return the offset of the sector boundary at or immediately +** following the value in pPager->journalOff, assuming a sector ** size of pPager->sectorSize bytes. ** ** i.e for a sector size of 512: @@ -48223,7 +48223,7 @@ static int readMasterJournal(sqlite3_file *pJrnl, char *zMaster, u32 nMaster){ ** 512 512 ** 100 512 ** 2000 2048 -** +** */ static i64 journalHdrOffset(Pager *pPager){ i64 offset = 0; @@ -48245,12 +48245,12 @@ static i64 journalHdrOffset(Pager *pPager){ ** ** If doTruncate is non-zero or the Pager.journalSizeLimit variable is ** set to 0, then truncate the journal file to zero bytes in size. Otherwise, -** zero the 28-byte header at the start of the journal file. In either case, -** if the pager is not in no-sync mode, sync the journal file immediately +** zero the 28-byte header at the start of the journal file. In either case, +** if the pager is not in no-sync mode, sync the journal file immediately ** after writing or truncating it. ** ** If Pager.journalSizeLimit is set to a positive, non-zero value, and -** following the truncation or zeroing described above the size of the +** following the truncation or zeroing described above the size of the ** journal file in bytes is larger than this value, then truncate the ** journal file to Pager.journalSizeLimit bytes. The journal file does ** not need to be synced following this operation. @@ -48276,8 +48276,8 @@ static int zeroJournalHdr(Pager *pPager, int doTruncate){ rc = sqlite3OsSync(pPager->jfd, SQLITE_SYNC_DATAONLY|pPager->syncFlags); } - /* At this point the transaction is committed but the write lock - ** is still held on the file. If there is a size limit configured for + /* At this point the transaction is committed but the write lock + ** is still held on the file. If there is a size limit configured for ** the persistent journal and the journal file currently consumes more ** space than that limit allows for, truncate it now. There is no need ** to sync the file following this operation. @@ -48305,7 +48305,7 @@ static int zeroJournalHdr(Pager *pPager, int doTruncate){ ** - 4 bytes: Initial database page count. ** - 4 bytes: Sector size used by the process that wrote this journal. ** - 4 bytes: Database page size. -** +** ** Followed by (JOURNAL_HDR_SZ - 28) bytes of unused space. */ static int writeJournalHdr(Pager *pPager){ @@ -48321,8 +48321,8 @@ static int writeJournalHdr(Pager *pPager){ nHeader = JOURNAL_HDR_SZ(pPager); } - /* If there are active savepoints and any of them were created - ** since the most recent journal header was written, update the + /* If there are active savepoints and any of them were created + ** since the most recent journal header was written, update the ** PagerSavepoint.iHdrOffset fields now. */ for(ii=0; iinSavepoint; ii++){ @@ -48333,10 +48333,10 @@ static int writeJournalHdr(Pager *pPager){ pPager->journalHdr = pPager->journalOff = journalHdrOffset(pPager); - /* + /* ** Write the nRec Field - the number of page records that follow this ** journal header. Normally, zero is written to this value at this time. - ** After the records are added to the journal (and the journal synced, + ** After the records are added to the journal (and the journal synced, ** if in full-sync mode), the zero is overwritten with the true number ** of records (see syncJournal()). ** @@ -48355,7 +48355,7 @@ static int writeJournalHdr(Pager *pPager){ */ assert( isOpen(pPager->fd) || pPager->noSync ); if( pPager->noSync || (pPager->journalMode==PAGER_JOURNALMODE_MEMORY) - || (sqlite3OsDeviceCharacteristics(pPager->fd)&SQLITE_IOCAP_SAFE_APPEND) + || (sqlite3OsDeviceCharacteristics(pPager->fd)&SQLITE_IOCAP_SAFE_APPEND) ){ memcpy(zHeader, aJournalMagic, sizeof(aJournalMagic)); put32bits(&zHeader[sizeof(aJournalMagic)], 0xffffffff); @@ -48363,7 +48363,7 @@ static int writeJournalHdr(Pager *pPager){ memset(zHeader, 0, sizeof(aJournalMagic)+4); } - /* The random check-hash initializer */ + /* The random check-hash initializer */ sqlite3_randomness(sizeof(pPager->cksumInit), &pPager->cksumInit); put32bits(&zHeader[sizeof(aJournalMagic)+4], pPager->cksumInit); /* The initial database size */ @@ -48382,23 +48382,23 @@ static int writeJournalHdr(Pager *pPager){ memset(&zHeader[sizeof(aJournalMagic)+20], 0, nHeader-(sizeof(aJournalMagic)+20)); - /* In theory, it is only necessary to write the 28 bytes that the - ** journal header consumes to the journal file here. Then increment the - ** Pager.journalOff variable by JOURNAL_HDR_SZ so that the next + /* In theory, it is only necessary to write the 28 bytes that the + ** journal header consumes to the journal file here. Then increment the + ** Pager.journalOff variable by JOURNAL_HDR_SZ so that the next ** record is written to the following sector (leaving a gap in the file ** that will be implicitly filled in by the OS). ** - ** However it has been discovered that on some systems this pattern can + ** However it has been discovered that on some systems this pattern can ** be significantly slower than contiguously writing data to the file, - ** even if that means explicitly writing data to the block of + ** even if that means explicitly writing data to the block of ** (JOURNAL_HDR_SZ - 28) bytes that will not be used. So that is what - ** is done. + ** is done. ** - ** The loop is required here in case the sector-size is larger than the + ** The loop is required here in case the sector-size is larger than the ** database page size. Since the zHeader buffer is only Pager.pageSize ** bytes in size, more than one call to sqlite3OsWrite() may be required ** to populate the entire journal header sector. - */ + */ for(nWrite=0; rc==SQLITE_OK&&nWritejournalHdr, nHeader)) rc = sqlite3OsWrite(pPager->jfd, zHeader, nHeader, pPager->journalOff); @@ -48496,29 +48496,29 @@ static int readJournalHdr( /* Check that the values read from the page-size and sector-size fields ** are within range. To be 'in range', both values need to be a power - ** of two greater than or equal to 512 or 32, and not greater than their + ** of two greater than or equal to 512 or 32, and not greater than their ** respective compile time maximum limits. */ if( iPageSize<512 || iSectorSize<32 || iPageSize>SQLITE_MAX_PAGE_SIZE || iSectorSize>MAX_SECTOR_SIZE - || ((iPageSize-1)&iPageSize)!=0 || ((iSectorSize-1)&iSectorSize)!=0 + || ((iPageSize-1)&iPageSize)!=0 || ((iSectorSize-1)&iSectorSize)!=0 ){ - /* If the either the page-size or sector-size in the journal-header is - ** invalid, then the process that wrote the journal-header must have - ** crashed before the header was synced. In this case stop reading + /* If the either the page-size or sector-size in the journal-header is + ** invalid, then the process that wrote the journal-header must have + ** crashed before the header was synced. In this case stop reading ** the journal file here. */ return SQLITE_DONE; } - /* Update the page-size to match the value read from the journal. - ** Use a testcase() macro to make sure that malloc failure within + /* Update the page-size to match the value read from the journal. + ** Use a testcase() macro to make sure that malloc failure within ** PagerSetPagesize() is tested. */ rc = sqlite3PagerSetPagesize(pPager, &iPageSize, -1); testcase( rc!=SQLITE_OK ); - /* Update the assumed sector-size to match the value used by + /* Update the assumed sector-size to match the value used by ** the process that created this journal. If this journal was ** created by a process other than this one, then this routine ** is being called from within pager_playback(). The local value @@ -48548,7 +48548,7 @@ static int readJournalHdr( ** The master journal page checksum is the sum of the bytes in the master ** journal name, where each byte is interpreted as a signed 8-bit integer. ** -** If zMaster is a NULL pointer (occurs for a single database transaction), +** If zMaster is a NULL pointer (occurs for a single database transaction), ** this call is a no-op. */ static int writeMasterJournal(Pager *pPager, const char *zMaster){ @@ -48561,8 +48561,8 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){ assert( pPager->setMaster==0 ); assert( !pagerUseWal(pPager) ); - if( !zMaster - || pPager->journalMode==PAGER_JOURNALMODE_MEMORY + if( !zMaster + || pPager->journalMode==PAGER_JOURNALMODE_MEMORY || !isOpen(pPager->jfd) ){ return SQLITE_OK; @@ -48598,16 +48598,16 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){ } pPager->journalOff += (nMaster+20); - /* If the pager is in peristent-journal mode, then the physical + /* If the pager is in peristent-journal mode, then the physical ** journal-file may extend past the end of the master-journal name - ** and 8 bytes of magic data just written to the file. This is + ** and 8 bytes of magic data just written to the file. This is ** dangerous because the code to rollback a hot-journal file - ** will not be able to find the master-journal name to determine - ** whether or not the journal is hot. + ** will not be able to find the master-journal name to determine + ** whether or not the journal is hot. ** - ** Easiest thing to do in this scenario is to truncate the journal + ** Easiest thing to do in this scenario is to truncate the journal ** file to the required size. - */ + */ if( SQLITE_OK==(rc = sqlite3OsFileSize(pPager->jfd, &jrnlSize)) && jrnlSize>pPager->journalOff ){ @@ -48653,7 +48653,7 @@ static void releaseAllSavepoints(Pager *pPager){ } /* -** Set the bit number pgno in the PagerSavepoint.pInSavepoint +** Set the bit number pgno in the PagerSavepoint.pInSavepoint ** bitvecs of all open savepoints. Return SQLITE_OK if successful ** or SQLITE_NOMEM if a malloc failure occurs. */ @@ -48682,8 +48682,8 @@ static int addToSavepointBitvecs(Pager *pPager, Pgno pgno){ ** not exhibit the UNDELETABLE_WHEN_OPEN property, the journal file is ** closed (if it is open). ** -** If the pager is in ERROR state when this function is called, the -** contents of the pager cache are discarded before switching back to +** If the pager is in ERROR state when this function is called, the +** contents of the pager cache are discarded before switching back to ** the OPEN state. Regardless of whether the pager is in exclusive-mode ** or not, any journal file left in the file-system will be treated ** as a hot-journal and rolled back the next time a read-transaction @@ -48691,9 +48691,9 @@ static int addToSavepointBitvecs(Pager *pPager, Pgno pgno){ */ static void pager_unlock(Pager *pPager){ - assert( pPager->eState==PAGER_READER - || pPager->eState==PAGER_OPEN - || pPager->eState==PAGER_ERROR + assert( pPager->eState==PAGER_READER + || pPager->eState==PAGER_OPEN + || pPager->eState==PAGER_ERROR ); sqlite3BitvecDestroy(pPager->pInJournal); @@ -48771,17 +48771,17 @@ static void pager_unlock(Pager *pPager){ /* ** This function is called whenever an IOERR or FULL error that requires ** the pager to transition into the ERROR state may ahve occurred. -** The first argument is a pointer to the pager structure, the second -** the error-code about to be returned by a pager API function. The -** value returned is a copy of the second argument to this function. +** The first argument is a pointer to the pager structure, the second +** the error-code about to be returned by a pager API function. The +** value returned is a copy of the second argument to this function. ** ** If the second argument is SQLITE_FULL, SQLITE_IOERR or one of the ** IOERR sub-codes, the pager enters the ERROR state and the error code ** is stored in Pager.errCode. While the pager remains in the ERROR state, ** all major API calls on the Pager will immediately return Pager.errCode. ** -** The ERROR state indicates that the contents of the pager-cache -** cannot be trusted. This state can be cleared by completely discarding +** The ERROR state indicates that the contents of the pager-cache +** cannot be trusted. This state can be cleared by completely discarding ** the contents of the pager-cache. If a transaction was active when ** the persistent error occurred, then the rollback journal may need ** to be replayed to restore the contents of the database file (as if @@ -48829,27 +48829,27 @@ static int pagerFlushOnCommit(Pager *pPager, int bCommit){ } /* -** This routine ends a transaction. A transaction is usually ended by -** either a COMMIT or a ROLLBACK operation. This routine may be called +** This routine ends a transaction. A transaction is usually ended by +** either a COMMIT or a ROLLBACK operation. This routine may be called ** after rollback of a hot-journal, or if an error occurs while opening ** the journal file or writing the very first journal-header of a ** database transaction. -** +** ** This routine is never called in PAGER_ERROR state. If it is called ** in PAGER_NONE or PAGER_SHARED state and the lock held is less ** exclusive than a RESERVED lock, it is a no-op. ** ** Otherwise, any active savepoints are released. ** -** If the journal file is open, then it is "finalized". Once a journal -** file has been finalized it is not possible to use it to roll back a +** If the journal file is open, then it is "finalized". Once a journal +** file has been finalized it is not possible to use it to roll back a ** transaction. Nor will it be considered to be a hot-journal by this ** or any other database connection. Exactly how a journal is finalized ** depends on whether or not the pager is running in exclusive mode and ** the current journal-mode (Pager.journalMode value), as follows: ** ** journalMode==MEMORY -** Journal file descriptor is simply closed. This destroys an +** Journal file descriptor is simply closed. This destroys an ** in-memory journal. ** ** journalMode==TRUNCATE @@ -48869,12 +48869,12 @@ static int pagerFlushOnCommit(Pager *pPager, int bCommit){ ** journalMode==PERSIST is used instead. ** ** After the journal is finalized, the pager moves to PAGER_READER state. -** If running in non-exclusive rollback mode, the lock on the file is +** If running in non-exclusive rollback mode, the lock on the file is ** downgraded to a SHARED_LOCK. ** ** SQLITE_OK is returned if no error occurs. If an error occurs during ** any of the IO operations to finalize the journal file or unlock the -** database then the IO error code is returned to the user. If the +** database then the IO error code is returned to the user. If the ** operation to finalize the journal file fails, then the code still ** tries to unlock the database file if not in exclusive mode. If the ** unlock operation fails as well, then the first error code related @@ -48893,9 +48893,9 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){ ** 1. After a successful hot-journal rollback, it is called with ** eState==PAGER_NONE and eLock==EXCLUSIVE_LOCK. ** - ** 2. If a connection with locking_mode=exclusive holding an EXCLUSIVE + ** 2. If a connection with locking_mode=exclusive holding an EXCLUSIVE ** lock switches back to locking_mode=normal and then executes a - ** read-transaction, this function is called with eState==PAGER_READER + ** read-transaction, this function is called with eState==PAGER_READER ** and eLock==EXCLUSIVE_LOCK when the read-transaction is closed. */ assert( assert_pager_state(pPager) ); @@ -48941,9 +48941,9 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){ */ int bDelete = !pPager->tempFile; assert( sqlite3JournalIsInMemory(pPager->jfd)==0 ); - assert( pPager->journalMode==PAGER_JOURNALMODE_DELETE - || pPager->journalMode==PAGER_JOURNALMODE_MEMORY - || pPager->journalMode==PAGER_JOURNALMODE_WAL + assert( pPager->journalMode==PAGER_JOURNALMODE_DELETE + || pPager->journalMode==PAGER_JOURNALMODE_MEMORY + || pPager->journalMode==PAGER_JOURNALMODE_WAL ); sqlite3OsClose(pPager->jfd); if( bDelete ){ @@ -48976,8 +48976,8 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){ } if( pagerUseWal(pPager) ){ - /* Drop the WAL write-lock, if any. Also, if the connection was in - ** locking_mode=exclusive mode but is no longer, drop the EXCLUSIVE + /* Drop the WAL write-lock, if any. Also, if the connection was in + ** locking_mode=exclusive mode but is no longer, drop the EXCLUSIVE ** lock held on the database file. */ rc2 = sqlite3WalEndWriteTransaction(pPager->pWal); @@ -48985,7 +48985,7 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){ }else if( rc==SQLITE_OK && bCommit && pPager->dbFileSize>pPager->dbSize ){ /* This branch is taken when committing a transaction in rollback-journal ** mode if the database file on disk is larger than the database image. - ** At this point the journal has been finalized and the transaction + ** At this point the journal has been finalized and the transaction ** successfully committed, but the EXCLUSIVE lock is still held on the ** file. So it is safe to truncate the database file to its minimum ** required size. */ @@ -48998,7 +48998,7 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){ if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK; } - if( !pPager->exclusiveMode + if( !pPager->exclusiveMode && (!pagerUseWal(pPager) || sqlite3WalExclusiveMode(pPager->pWal, 0)) ){ rc2 = pagerUnlockDb(pPager, SHARED_LOCK); @@ -49011,19 +49011,19 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){ } /* -** Execute a rollback if a transaction is active and unlock the -** database file. +** Execute a rollback if a transaction is active and unlock the +** database file. ** -** If the pager has already entered the ERROR state, do not attempt +** If the pager has already entered the ERROR state, do not attempt ** the rollback at this time. Instead, pager_unlock() is called. The ** call to pager_unlock() will discard all in-memory pages, unlock -** the database file and move the pager back to OPEN state. If this -** means that there is a hot-journal left in the file-system, the next -** connection to obtain a shared lock on the pager (which may be this one) +** the database file and move the pager back to OPEN state. If this +** means that there is a hot-journal left in the file-system, the next +** connection to obtain a shared lock on the pager (which may be this one) ** will roll it back. ** ** If the pager has not already entered the ERROR state, but an IO or -** malloc error occurs during a rollback, then this will itself cause +** malloc error occurs during a rollback, then this will itself cause ** the pager to enter the ERROR state. Which will be cleared by the ** call to pager_unlock(), as described above. */ @@ -49044,10 +49044,10 @@ static void pagerUnlockAndRollback(Pager *pPager){ /* ** Parameter aData must point to a buffer of pPager->pageSize bytes -** of data. Compute and return a checksum based ont the contents of the +** of data. Compute and return a checksum based ont the contents of the ** page of data and the current value of pPager->cksumInit. ** -** This is not a real checksum. It is really just the sum of the +** This is not a real checksum. It is really just the sum of the ** random initial value (pPager->cksumInit) and every 200th byte ** of the page data, starting with byte offset (pPager->pageSize%200). ** Each byte is interpreted as an 8-bit unsigned integer. @@ -49055,8 +49055,8 @@ static void pagerUnlockAndRollback(Pager *pPager){ ** Changing the formula used to compute this checksum results in an ** incompatible journal file format. ** -** If journal corruption occurs due to a power failure, the most likely -** scenario is that one end or the other of the record will be changed. +** If journal corruption occurs due to a power failure, the most likely +** scenario is that one end or the other of the record will be changed. ** It is much less likely that the two ends of the journal record will be ** correct and the middle be corrupt. Thus, this "checksum" scheme, ** though fast and simple, catches the mostly likely kind of corruption. @@ -49106,7 +49106,7 @@ SQLITE_PRIVATE void sqlite3PagerAlignReserve(Pager *pDest, Pager *pSrc){ ** The page begins at offset *pOffset into the file. The *pOffset ** value is increased to the start of the next page in the journal. ** -** The main rollback journal uses checksums - the statement journal does +** The main rollback journal uses checksums - the statement journal does ** not. ** ** If the page number of the page record read from the (sub-)journal file @@ -49126,7 +49126,7 @@ SQLITE_PRIVATE void sqlite3PagerAlignReserve(Pager *pDest, Pager *pSrc){ ** is successfully read from the (sub-)journal file but appears to be ** corrupted, SQLITE_DONE is returned. Data is considered corrupted in ** two circumstances: -** +** ** * If the record page-number is illegal (0 or PAGER_MJ_PGNO), or ** * If the record is being rolled back from the main journal file ** and the checksum field does not match the record content. @@ -49161,7 +49161,7 @@ static int pager_playback_one_page( assert( aData ); /* Temp storage must have already been allocated */ assert( pagerUseWal(pPager)==0 || (!isMainJrnl && isSavepnt) ); - /* Either the state is greater than PAGER_WRITER_CACHEMOD (a transaction + /* Either the state is greater than PAGER_WRITER_CACHEMOD (a transaction ** or savepoint rollback done at the request of the caller) or this is ** a hot-journal rollback. If it is a hot-journal rollback, the pager ** is in state OPEN and holds an EXCLUSIVE lock. Hot-journal rollback @@ -49228,7 +49228,7 @@ static int pager_playback_one_page( ** assert()able. ** ** If in WRITER_DBMOD, WRITER_FINISHED or OPEN state, then we update the - ** pager cache if it exists and the main file. The page is then marked + ** pager cache if it exists and the main file. The page is then marked ** not dirty. Since this code is only executed in PAGER_OPEN state for ** a hot-journal rollback, it is guaranteed that the page-cache is empty ** if the pager is in OPEN state. @@ -49286,18 +49286,18 @@ static int pager_playback_one_page( }else if( !isMainJrnl && pPg==0 ){ /* If this is a rollback of a savepoint and data was not written to ** the database and the page is not in-memory, there is a potential - ** problem. When the page is next fetched by the b-tree layer, it - ** will be read from the database file, which may or may not be - ** current. + ** problem. When the page is next fetched by the b-tree layer, it + ** will be read from the database file, which may or may not be + ** current. ** ** There are a couple of different ways this can happen. All are quite - ** obscure. When running in synchronous mode, this can only happen + ** obscure. When running in synchronous mode, this can only happen ** if the page is on the free-list at the start of the transaction, then ** populated, then moved using sqlite3PagerMovepage(). ** ** The solution is to add an in-memory page to the cache containing - ** the data just read from the sub-journal. Mark the page as dirty - ** and if the pager requires a journal-sync, then mark the page as + ** the data just read from the sub-journal. Mark the page as dirty + ** and if the pager requires a journal-sync, then mark the page as ** requiring a journal-sync before it is written. */ assert( isSavepnt ); @@ -49345,26 +49345,26 @@ static int pager_playback_one_page( ** This routine checks if it is possible to delete the master journal file, ** and does so if it is. ** -** Argument zMaster may point to Pager.pTmpSpace. So that buffer is not +** Argument zMaster may point to Pager.pTmpSpace. So that buffer is not ** available for use within this function. ** -** When a master journal file is created, it is populated with the names -** of all of its child journals, one after another, formatted as utf-8 -** encoded text. The end of each child journal file is marked with a +** When a master journal file is created, it is populated with the names +** of all of its child journals, one after another, formatted as utf-8 +** encoded text. The end of each child journal file is marked with a ** nul-terminator byte (0x00). i.e. the entire contents of a master journal ** file for a transaction involving two databases might be: ** ** "/home/bill/a.db-journal\x00/home/bill/b.db-journal\x00" ** -** A master journal file may only be deleted once all of its child +** A master journal file may only be deleted once all of its child ** journals have been rolled back. ** -** This function reads the contents of the master-journal file into +** This function reads the contents of the master-journal file into ** memory and loops through each of the child journal names. For ** each child journal, it checks if: ** ** * if the child journal exists, and if so -** * if the child journal contains a reference to master journal +** * if the child journal contains a reference to master journal ** file zMaster ** ** If a child journal can be found that matches both of the criteria @@ -49374,12 +49374,12 @@ static int pager_playback_one_page( ** ** If an IO error within this function, an error code is returned. This ** function allocates memory by calling sqlite3Malloc(). If an allocation -** fails, SQLITE_NOMEM is returned. Otherwise, if no IO or malloc errors +** fails, SQLITE_NOMEM is returned. Otherwise, if no IO or malloc errors ** occur, SQLITE_OK is returned. ** ** TODO: This function allocates a single block of memory to load ** the entire contents of the master journal file. This could be -** a couple of kilobytes or so - potentially larger than the page +** a couple of kilobytes or so - potentially larger than the page ** size. */ static int pager_delmaster(Pager *pPager, const char *zMaster){ @@ -49457,7 +49457,7 @@ static int pager_delmaster(Pager *pPager, const char *zMaster){ } zJournal += (sqlite3Strlen30(zJournal)+1); } - + sqlite3OsClose(pMaster); rc = sqlite3OsDelete(pVfs, zMaster, 0); @@ -49473,20 +49473,20 @@ delmaster_out: /* -** This function is used to change the actual size of the database +** This function is used to change the actual size of the database ** file in the file-system. This only happens when committing a transaction, ** or rolling back a transaction (including rolling back a hot-journal). ** ** If the main database file is not open, or the pager is not in either -** DBMOD or OPEN state, this function is a no-op. Otherwise, the size -** of the file is changed to nPage pages (nPage*pPager->pageSize bytes). +** DBMOD or OPEN state, this function is a no-op. Otherwise, the size +** of the file is changed to nPage pages (nPage*pPager->pageSize bytes). ** If the file on disk is currently larger than nPage pages, then use the VFS ** xTruncate() method to truncate it. ** -** Or, it might be the case that the file on disk is smaller than -** nPage pages. Some operating system implementations can get confused if -** you try to truncate a file to some size that is larger than it -** currently is, so detect this case and write a single zero byte to +** Or, it might be the case that the file on disk is smaller than +** nPage pages. Some operating system implementations can get confused if +** you try to truncate a file to some size that is larger than it +** currently is, so detect this case and write a single zero byte to ** the end of the new file instead. ** ** If successful, return SQLITE_OK. If an IO error occurs while modifying @@ -49496,9 +49496,9 @@ static int pager_truncate(Pager *pPager, Pgno nPage){ int rc = SQLITE_OK; assert( pPager->eState!=PAGER_ERROR ); assert( pPager->eState!=PAGER_READER ); - - if( isOpen(pPager->fd) - && (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) + + if( isOpen(pPager->fd) + && (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) ){ i64 currentSize, newSize; int szPage = pPager->pageSize; @@ -49542,8 +49542,8 @@ SQLITE_PRIVATE int sqlite3SectorSize(sqlite3_file *pFile){ /* ** Set the value of the Pager.sectorSize variable for the given ** pager based on the value returned by the xSectorSize method -** of the open database file. The sector size will be used -** to determine the size and alignment of journal header and +** of the open database file. The sector size will be used +** to determine the size and alignment of journal header and ** master journal pointers within created journal files. ** ** For temporary files the effective sector size is always 512 bytes. @@ -49566,7 +49566,7 @@ static void setSectorSize(Pager *pPager){ assert( isOpen(pPager->fd) || pPager->tempFile ); if( pPager->tempFile - || (sqlite3OsDeviceCharacteristics(pPager->fd) & + || (sqlite3OsDeviceCharacteristics(pPager->fd) & SQLITE_IOCAP_POWERSAFE_OVERWRITE)!=0 ){ /* Sector size doesn't matter for temporary files. Also, the file @@ -49580,15 +49580,15 @@ static void setSectorSize(Pager *pPager){ /* ** Playback the journal and thus restore the database file to -** the state it was in before we started making changes. +** the state it was in before we started making changes. ** -** The journal file format is as follows: +** The journal file format is as follows: ** ** (1) 8 byte prefix. A copy of aJournalMagic[]. ** (2) 4 byte big-endian integer which is the number of valid page records ** in the journal. If this value is 0xffffffff, then compute the ** number of page records from the journal size. -** (3) 4 byte big-endian integer which is the initial value for the +** (3) 4 byte big-endian integer which is the initial value for the ** sanity checksum. ** (4) 4 byte integer which is the number of pages to truncate the ** database to during a rollback. @@ -49617,7 +49617,7 @@ static void setSectorSize(Pager *pPager){ ** from the file size. This value is used when the user selects the ** no-sync option for the journal. A power failure could lead to corruption ** in this case. But for things like temporary table (which will be -** deleted when the power is restored) we don't care. +** deleted when the power is restored) we don't care. ** ** If the file opened as the journal file is not a well-formed ** journal file then all pages up to the first corrupted page are rolled @@ -49629,7 +49629,7 @@ static void setSectorSize(Pager *pPager){ ** and an error code is returned. ** ** The isHot parameter indicates that we are trying to rollback a journal -** that might be a hot journal. Or, it could be that the journal is +** that might be a hot journal. Or, it could be that the journal is ** preserved because of JOURNALMODE_PERSIST or JOURNALMODE_TRUNCATE. ** If the journal really is hot, reset the pager cache prior rolling ** back any content. If the journal is merely persistent, no reset is @@ -49679,9 +49679,9 @@ static int pager_playback(Pager *pPager, int isHot){ pPager->journalOff = 0; needPagerReset = isHot; - /* This loop terminates either when a readJournalHdr() or - ** pager_playback_one_page() call returns SQLITE_DONE or an IO error - ** occurs. + /* This loop terminates either when a readJournalHdr() or + ** pager_playback_one_page() call returns SQLITE_DONE or an IO error + ** occurs. */ while( 1 ){ /* Read the next journal header from the journal file. If there are @@ -49690,7 +49690,7 @@ static int pager_playback(Pager *pPager, int isHot){ ** This indicates nothing more needs to be rolled back. */ rc = readJournalHdr(pPager, isHot, szJ, &nRec, &mxPg); - if( rc!=SQLITE_OK ){ + if( rc!=SQLITE_OK ){ if( rc==SQLITE_DONE ){ rc = SQLITE_OK; } @@ -49718,7 +49718,7 @@ static int pager_playback(Pager *pPager, int isHot){ ** chunk of the journal contains zero pages to be rolled back. But ** when doing a ROLLBACK and the nRec==0 chunk is the last chunk in ** the journal, it means that the journal might contain additional - ** pages that need to be rolled back and that the number of pages + ** pages that need to be rolled back and that the number of pages ** should be computed based on the journal file size. */ if( nRec==0 && !isHot && @@ -49737,7 +49737,7 @@ static int pager_playback(Pager *pPager, int isHot){ pPager->dbSize = mxPg; } - /* Copy original pages out of the journal and back into the + /* Copy original pages out of the journal and back into the ** database file and/or page cache. */ for(u=0; upData. A shared lock or greater must be held on the database ** file before this function is called. ** @@ -49921,15 +49921,15 @@ static void pager_write_changecounter(PgHdr *pPg){ #ifndef SQLITE_OMIT_WAL /* -** This function is invoked once for each page that has already been +** This function is invoked once for each page that has already been ** written into the log file when a WAL transaction is rolled back. -** Parameter iPg is the page number of said page. The pCtx argument +** Parameter iPg is the page number of said page. The pCtx argument ** is actually a pointer to the Pager structure. ** ** If page iPg is present in the cache, and has no outstanding references, ** it is discarded. Otherwise, if there are one or more outstanding ** references, the page content is reloaded from the database. If the -** attempt to reload content from the database is required and fails, +** attempt to reload content from the database is required and fails, ** return an SQLite error code. Otherwise, SQLITE_OK. */ static int pagerUndoCallback(void *pCtx, Pgno iPg){ @@ -49959,7 +49959,7 @@ static int pagerUndoCallback(void *pCtx, Pgno iPg){ ** updated as data is copied out of the rollback journal and into the ** database. This is not generally possible with a WAL database, as ** rollback involves simply truncating the log file. Therefore, if one - ** or more frames have already been written to the log (and therefore + ** or more frames have already been written to the log (and therefore ** also copied into the backup databases) as part of this transaction, ** the backups must be restarted. */ @@ -49976,7 +49976,7 @@ static int pagerRollbackWal(Pager *pPager){ PgHdr *pList; /* List of dirty pages to revert */ /* For all pages in the cache that are currently dirty or have already - ** been written (but not committed) to the log file, do one of the + ** been written (but not committed) to the log file, do one of the ** following: ** ** + Discard the cached page (if refcount==0), or @@ -49998,11 +49998,11 @@ static int pagerRollbackWal(Pager *pPager){ ** This function is a wrapper around sqlite3WalFrames(). As well as logging ** the contents of the list of pages headed by pList (connected by pDirty), ** this function notifies any active backup processes that the pages have -** changed. +** changed. ** ** The list of pages passed into this routine is always sorted by page number. ** Hence, if page 1 appears anywhere on the list, it will be the first page. -*/ +*/ static int pagerWalFrames( Pager *pPager, /* Pager object */ PgHdr *pList, /* List of frames to log */ @@ -50043,7 +50043,7 @@ static int pagerWalFrames( pPager->aStat[PAGER_STAT_WRITE] += nList; if( pList->pgno==1 ) pager_write_changecounter(pList); - rc = sqlite3WalFrames(pPager->pWal, + rc = sqlite3WalFrames(pPager->pWal, pPager->pageSize, pList, nTruncate, isCommit, pPager->walSyncFlags ); if( rc==SQLITE_OK && pPager->pBackup ){ @@ -50158,9 +50158,9 @@ static int pagerPagecount(Pager *pPager, Pgno *pnPage){ ** Return SQLITE_OK or an error code. ** ** The caller must hold a SHARED lock on the database file to call this -** function. Because an EXCLUSIVE lock on the db file is required to delete -** a WAL on a none-empty database, this ensures there is no race condition -** between the xAccess() below and an xDelete() being executed by some +** function. Because an EXCLUSIVE lock on the db file is required to delete +** a WAL on a none-empty database, this ensures there is no race condition +** between the xAccess() below and an xDelete() being executed by some ** other connection. */ static int pagerOpenWalIfPresent(Pager *pPager){ @@ -50198,21 +50198,21 @@ static int pagerOpenWalIfPresent(Pager *pPager){ /* ** Playback savepoint pSavepoint. Or, if pSavepoint==NULL, then playback -** the entire master journal file. The case pSavepoint==NULL occurs when -** a ROLLBACK TO command is invoked on a SAVEPOINT that is a transaction +** the entire master journal file. The case pSavepoint==NULL occurs when +** a ROLLBACK TO command is invoked on a SAVEPOINT that is a transaction ** savepoint. ** -** When pSavepoint is not NULL (meaning a non-transaction savepoint is +** When pSavepoint is not NULL (meaning a non-transaction savepoint is ** being rolled back), then the rollback consists of up to three stages, ** performed in the order specified: ** ** * Pages are played back from the main journal starting at byte -** offset PagerSavepoint.iOffset and continuing to +** offset PagerSavepoint.iOffset and continuing to ** PagerSavepoint.iHdrOffset, or to the end of the main journal ** file if PagerSavepoint.iHdrOffset is zero. ** ** * If PagerSavepoint.iHdrOffset is not zero, then pages are played -** back starting from the journal header immediately following +** back starting from the journal header immediately following ** PagerSavepoint.iHdrOffset to the end of the main journal file. ** ** * Pages are then played back from the sub-journal file, starting @@ -50228,7 +50228,7 @@ static int pagerOpenWalIfPresent(Pager *pPager){ ** journal file. There is no need for a bitvec in this case. ** ** In either case, before playback commences the Pager.dbSize variable -** is reset to the value that it held at the start of the savepoint +** is reset to the value that it held at the start of the savepoint ** (or transaction). No page with a page-number greater than this value ** is played back. If one is encountered it is simply skipped. */ @@ -50249,7 +50249,7 @@ static int pagerPlaybackSavepoint(Pager *pPager, PagerSavepoint *pSavepoint){ } } - /* Set the database size back to the value it was before the savepoint + /* Set the database size back to the value it was before the savepoint ** being reverted was opened. */ pPager->dbSize = pSavepoint ? pSavepoint->nOrig : pPager->dbOrigSize; @@ -50302,7 +50302,7 @@ static int pagerPlaybackSavepoint(Pager *pPager, PagerSavepoint *pSavepoint){ ** test is related to ticket #2565. See the discussion in the ** pager_playback() function for additional information. */ - if( nJRec==0 + if( nJRec==0 && pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff ){ nJRec = (u32)((szJ - pPager->journalOff)/JOURNAL_PG_SZ(pPager)); @@ -50481,7 +50481,7 @@ SQLITE_PRIVATE void sqlite3PagerSetFlags( /* ** The following global variable is incremented whenever the library ** attempts to open a temporary file. This information is used for -** testing and analysis only. +** testing and analysis only. */ #ifdef SQLITE_TEST SQLITE_API int sqlite3_opentemp_count = 0; @@ -50490,8 +50490,8 @@ SQLITE_API int sqlite3_opentemp_count = 0; /* ** Open a temporary file. ** -** Write the file descriptor into *pFile. Return SQLITE_OK on success -** or some other error code if we fail. The OS will automatically +** Write the file descriptor into *pFile. Return SQLITE_OK on success +** or some other error code if we fail. The OS will automatically ** delete the temporary file when it is closed. ** ** The flags passed to the VFS layer xOpen() call are those specified @@ -50523,9 +50523,9 @@ static int pagerOpentemp( /* ** Set the busy handler function. ** -** The pager invokes the busy-handler if sqlite3OsLock() returns +** The pager invokes the busy-handler if sqlite3OsLock() returns ** SQLITE_BUSY when trying to upgrade from no-lock to a SHARED lock, -** or when trying to upgrade from a RESERVED lock to an EXCLUSIVE +** or when trying to upgrade from a RESERVED lock to an EXCLUSIVE ** lock. It does *not* invoke the busy handler when upgrading from ** SHARED to RESERVED, or when upgrading from SHARED to EXCLUSIVE ** (which occurs during hot-journal rollback). Summary: @@ -50537,7 +50537,7 @@ static int pagerOpentemp( ** SHARED_LOCK -> EXCLUSIVE_LOCK | No ** RESERVED_LOCK -> EXCLUSIVE_LOCK | Yes ** -** If the busy-handler callback returns non-zero, the lock is +** If the busy-handler callback returns non-zero, the lock is ** retried. If it returns zero, then the SQLITE_BUSY error is ** returned to the caller of the pager API function. */ @@ -50558,16 +50558,16 @@ SQLITE_PRIVATE void sqlite3PagerSetBusyhandler( } /* -** Change the page size used by the Pager object. The new page size +** Change the page size used by the Pager object. The new page size ** is passed in *pPageSize. ** ** If the pager is in the error state when this function is called, it -** is a no-op. The value returned is the error state error code (i.e. +** is a no-op. The value returned is the error state error code (i.e. ** one of SQLITE_IOERR, an SQLITE_IOERR_xxx sub-code or SQLITE_FULL). ** ** Otherwise, if all of the following are true: ** -** * the new page size (value of *pPageSize) is valid (a power +** * the new page size (value of *pPageSize) is valid (a power ** of two between 512 and SQLITE_MAX_PAGE_SIZE, inclusive), and ** ** * there are no outstanding page references, and @@ -50577,14 +50577,14 @@ SQLITE_PRIVATE void sqlite3PagerSetBusyhandler( ** ** then the pager object page size is set to *pPageSize. ** -** If the page size is changed, then this function uses sqlite3PagerMalloc() -** to obtain a new Pager.pTmpSpace buffer. If this allocation attempt -** fails, SQLITE_NOMEM is returned and the page size remains unchanged. +** If the page size is changed, then this function uses sqlite3PagerMalloc() +** to obtain a new Pager.pTmpSpace buffer. If this allocation attempt +** fails, SQLITE_NOMEM is returned and the page size remains unchanged. ** In all other cases, SQLITE_OK is returned. ** ** If the page size is not changed, either because one of the enumerated ** conditions above is not true, the pager was in error state when this -** function was called, or because the memory allocation attempt failed, +** function was called, or because the memory allocation attempt failed, ** then *pPageSize is set to the old, retained page size before returning. */ SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager *pPager, u32 *pPageSize, int nReserve){ @@ -50594,7 +50594,7 @@ SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager *pPager, u32 *pPageSize, int nR ** function may be called from within PagerOpen(), before the state ** of the Pager object is internally consistent. ** - ** At one point this function returned an error if the pager was in + ** At one point this function returned an error if the pager was in ** PAGER_ERROR state. But since PAGER_ERROR state guarantees that ** there is at least one outstanding page reference, this function ** is a no-op for that case anyhow. @@ -50603,8 +50603,8 @@ SQLITE_PRIVATE int sqlite3PagerSetPagesize(Pager *pPager, u32 *pPageSize, int nR u32 pageSize = *pPageSize; assert( pageSize==0 || (pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE) ); if( (pPager->memDb==0 || pPager->dbSize==0) - && sqlite3PcacheRefCount(pPager->pPCache)==0 - && pageSize && pageSize!=(u32)pPager->pageSize + && sqlite3PcacheRefCount(pPager->pPCache)==0 + && pageSize && pageSize!=(u32)pPager->pageSize ){ char *pNew = NULL; /* New temp space */ i64 nByte = 0; @@ -50655,7 +50655,7 @@ SQLITE_PRIVATE void *sqlite3PagerTempSpace(Pager *pPager){ } /* -** Attempt to set the maximum database page count if mxPage is positive. +** Attempt to set the maximum database page count if mxPage is positive. ** Make no changes if mxPage is zero or negative. And never reduce the ** maximum page count below the current size of the database. ** @@ -50696,11 +50696,11 @@ void enable_simulated_io_errors(void){ /* ** Read the first N bytes from the beginning of the file into memory -** that pDest points to. +** that pDest points to. ** ** If the pager was opened on a transient file (zFilename==""), or ** opened on a file less than N bytes in size, the output buffer is -** zeroed and SQLITE_OK returned. The rationale for this is that this +** zeroed and SQLITE_OK returned. The rationale for this is that this ** function is used to read database headers, and a new transient or ** zero sized database has a header than consists entirely of zeroes. ** @@ -50733,7 +50733,7 @@ SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager *pPager, int N, unsigned cha ** This function may only be called when a read-transaction is open on ** the pager. It returns the total number of pages in the database. ** -** However, if the file is between 1 and bytes in size, then +** However, if the file is between 1 and bytes in size, then ** this is considered a 1 page file. */ SQLITE_PRIVATE void sqlite3PagerPagecount(Pager *pPager, int *pnPage){ @@ -50748,19 +50748,19 @@ SQLITE_PRIVATE void sqlite3PagerPagecount(Pager *pPager, int *pnPage){ ** a similar or greater lock is already held, this function is a no-op ** (returning SQLITE_OK immediately). ** -** Otherwise, attempt to obtain the lock using sqlite3OsLock(). Invoke -** the busy callback if the lock is currently not available. Repeat -** until the busy callback returns false or until the attempt to +** Otherwise, attempt to obtain the lock using sqlite3OsLock(). Invoke +** the busy callback if the lock is currently not available. Repeat +** until the busy callback returns false or until the attempt to ** obtain the lock succeeds. ** ** Return SQLITE_OK on success and an error code if we cannot obtain -** the lock. If the lock is obtained successfully, set the Pager.state +** the lock. If the lock is obtained successfully, set the Pager.state ** variable to locktype before returning. */ static int pager_wait_on_lock(Pager *pPager, int locktype){ int rc; /* Return code */ - /* Check that this is either a no-op (because the requested lock is + /* Check that this is either a no-op (because the requested lock is ** already held), or one of the transitions that the busy-handler ** may be invoked during, according to the comment above ** sqlite3PagerSetBusyhandler(). @@ -50777,10 +50777,10 @@ static int pager_wait_on_lock(Pager *pPager, int locktype){ } /* -** Function assertTruncateConstraint(pPager) checks that one of the +** Function assertTruncateConstraint(pPager) checks that one of the ** following is true for all dirty pages currently in the page-cache: ** -** a) The page number is less than or equal to the size of the +** a) The page number is less than or equal to the size of the ** current database image, in pages, OR ** ** b) if the page content were written at this time, it would not @@ -50793,9 +50793,9 @@ static int pager_wait_on_lock(Pager *pPager, int locktype){ ** the database file. If a savepoint transaction were rolled back after ** this happened, the correct behavior would be to restore the current ** content of the page. However, since this content is not present in either -** the database file or the portion of the rollback journal and +** the database file or the portion of the rollback journal and ** sub-journal rolled back the content could not be restored and the -** database image would become corrupt. It is therefore fortunate that +** database image would become corrupt. It is therefore fortunate that ** this circumstance cannot arise. */ #if defined(SQLITE_DEBUG) @@ -50811,9 +50811,9 @@ static void assertTruncateConstraint(Pager *pPager){ #endif /* -** Truncate the in-memory database file image to nPage pages. This -** function does not actually modify the database file on disk. It -** just sets the internal state of the pager object so that the +** Truncate the in-memory database file image to nPage pages. This +** function does not actually modify the database file on disk. It +** just sets the internal state of the pager object so that the ** truncation will be done when the current transaction is committed. ** ** This function is only called right before committing a transaction. @@ -50828,11 +50828,11 @@ SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager *pPager, Pgno nPage){ /* At one point the code here called assertTruncateConstraint() to ** ensure that all pages being truncated away by this operation are, - ** if one or more savepoints are open, present in the savepoint + ** if one or more savepoints are open, present in the savepoint ** journal so that they can be restored if the savepoint is rolled ** back. This is no longer necessary as this function is now only - ** called right before committing a transaction. So although the - ** Pager object may still have open savepoints (Pager.nSavepoint!=0), + ** called right before committing a transaction. So although the + ** Pager object may still have open savepoints (Pager.nSavepoint!=0), ** they cannot be rolled back. So the assertTruncateConstraint() call ** is no longer correct. */ } @@ -50844,12 +50844,12 @@ SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager *pPager, Pgno nPage){ ** size of the journal file so that the pager_playback() routine knows ** that the entire journal file has been synced. ** -** Syncing a hot-journal to disk before attempting to roll it back ensures +** Syncing a hot-journal to disk before attempting to roll it back ensures ** that if a power-failure occurs during the rollback, the process that ** attempts rollback following system recovery sees the same journal ** content as this process. ** -** If everything goes as planned, SQLITE_OK is returned. Otherwise, +** If everything goes as planned, SQLITE_OK is returned. Otherwise, ** an SQLite error code. */ static int pagerSyncHotJournal(Pager *pPager){ @@ -50865,7 +50865,7 @@ static int pagerSyncHotJournal(Pager *pPager){ #if SQLITE_MAX_MMAP_SIZE>0 /* -** Obtain a reference to a memory mapped page object for page number pgno. +** Obtain a reference to a memory mapped page object for page number pgno. ** The new object will use the pointer pData, obtained from xFetch(). ** If successful, set *ppPage to point to the new page reference ** and return SQLITE_OK. Otherwise, return an SQLite error code and set @@ -50881,7 +50881,7 @@ static int pagerAcquireMapPage( PgHdr **ppPage /* OUT: Acquired page object */ ){ PgHdr *p; /* Memory mapped page to return */ - + if( pPager->pMmapFreelist ){ *ppPage = p = pPager->pMmapFreelist; pPager->pMmapFreelist = p->pDirty; @@ -50915,7 +50915,7 @@ static int pagerAcquireMapPage( #endif /* -** Release a reference to page pPg. pPg must have been returned by an +** Release a reference to page pPg. pPg must have been returned by an ** earlier call to pagerAcquireMapPage(). */ static void pagerReleaseMapPage(PgHdr *pPg){ @@ -50951,7 +50951,7 @@ static void pagerFreeMapHdrs(Pager *pPager){ ** result in a coredump. ** ** This function always succeeds. If a transaction is active an attempt -** is made to roll it back. If an error occurs during the rollback +** is made to roll it back. If an error occurs during the rollback ** a hot journal may be left in the filesystem but no error is returned ** to the caller. */ @@ -50977,8 +50977,8 @@ SQLITE_PRIVATE int sqlite3PagerClose(Pager *pPager, sqlite3 *db){ pager_unlock(pPager); }else{ /* If it is open, sync the journal file before calling UnlockAndRollback. - ** If this is not done, then an unsynced portion of the open journal - ** file may be played back into the database. If a power failure occurs + ** If this is not done, then an unsynced portion of the open journal + ** file may be played back into the database. If a power failure occurs ** while this is happening, the database could become corrupt. ** ** If an error occurs while trying to sync the journal, shift the pager @@ -51034,7 +51034,7 @@ SQLITE_PRIVATE void sqlite3PagerRef(DbPage *pPg){ ** disk and can be restored in the event of a hot-journal rollback. ** ** If the Pager.noSync flag is set, then this function is a no-op. -** Otherwise, the actions required depend on the journal-mode and the +** Otherwise, the actions required depend on the journal-mode and the ** device characteristics of the file-system, as follows: ** ** * If the journal file is an in-memory journal file, no action need @@ -51046,7 +51046,7 @@ SQLITE_PRIVATE void sqlite3PagerRef(DbPage *pPg){ ** been written following it. If the pager is operating in full-sync ** mode, then the journal file is synced before this field is updated. ** -** * If the device does not support the SEQUENTIAL property, then +** * If the device does not support the SEQUENTIAL property, then ** journal file is synced. ** ** Or, in pseudo-code: @@ -51055,11 +51055,11 @@ SQLITE_PRIVATE void sqlite3PagerRef(DbPage *pPg){ ** if( NOT SAFE_APPEND ){ ** if( ) xSync(); ** -** } +** } ** if( NOT SEQUENTIAL ) xSync(); ** } ** -** If successful, this routine clears the PGHDR_NEED_SYNC flag of every +** If successful, this routine clears the PGHDR_NEED_SYNC flag of every ** page currently held in memory before returning SQLITE_OK. If an IO ** error is encountered, then the IO error code is returned to the caller. */ @@ -51087,10 +51087,10 @@ static int syncJournal(Pager *pPager, int newHdr){ ** mode, then the journal file may at this point actually be larger ** than Pager.journalOff bytes. If the next thing in the journal ** file happens to be a journal-header (written as part of the - ** previous connection's transaction), and a crash or power-failure - ** occurs after nRec is updated but before this connection writes - ** anything else to the journal file (or commits/rolls back its - ** transaction), then SQLite may become confused when doing the + ** previous connection's transaction), and a crash or power-failure + ** occurs after nRec is updated but before this connection writes + ** anything else to the journal file (or commits/rolls back its + ** transaction), then SQLite may become confused when doing the ** hot-journal rollback following recovery. It may roll back all ** of this connections data, then proceed to rolling back the old, ** out-of-date data that follows it. Database corruption. @@ -51100,7 +51100,7 @@ static int syncJournal(Pager *pPager, int newHdr){ ** byte to the start of it to prevent it from being recognized. ** ** Variable iNextHdrOffset is set to the offset at which this - ** problematic header will occur, if it exists. aMagic is used + ** problematic header will occur, if it exists. aMagic is used ** as a temporary buffer to inspect the first couple of bytes of ** the potential journal header. */ @@ -51127,7 +51127,7 @@ static int syncJournal(Pager *pPager, int newHdr){ ** it as a candidate for rollback. ** ** This is not required if the persistent media supports the - ** SAFE_APPEND property. Because in this case it is not possible + ** SAFE_APPEND property. Because in this case it is not possible ** for garbage data to be appended to the file, the nRec field ** is populated with 0xFFFFFFFF when the journal header is written ** and never needs to be updated. @@ -51147,7 +51147,7 @@ static int syncJournal(Pager *pPager, int newHdr){ if( 0==(iDc&SQLITE_IOCAP_SEQUENTIAL) ){ PAGERTRACE(("SYNC journal of %d\n", PAGERID(pPager))); IOTRACE(("JSYNC %p\n", pPager)) - rc = sqlite3OsSync(pPager->jfd, pPager->syncFlags| + rc = sqlite3OsSync(pPager->jfd, pPager->syncFlags| (pPager->syncFlags==SQLITE_SYNC_FULL?SQLITE_SYNC_DATAONLY:0) ); if( rc!=SQLITE_OK ) return rc; @@ -51164,8 +51164,8 @@ static int syncJournal(Pager *pPager, int newHdr){ } } - /* Unless the pager is in noSync mode, the journal file was just - ** successfully synced. Either way, clear the PGHDR_NEED_SYNC flag on + /* Unless the pager is in noSync mode, the journal file was just + ** successfully synced. Either way, clear the PGHDR_NEED_SYNC flag on ** all pages. */ sqlite3PcacheClearSyncFlags(pPager->pPCache); @@ -51185,9 +51185,9 @@ static int syncJournal(Pager *pPager, int newHdr){ ** is called. Before writing anything to the database file, this lock ** is upgraded to an EXCLUSIVE lock. If the lock cannot be obtained, ** SQLITE_BUSY is returned and no data is written to the database file. -** +** ** If the pager is a temp-file pager and the actual file-system file -** is not yet open, it is created and opened before any data is +** is not yet open, it is created and opened before any data is ** written out. ** ** Once the lock has been upgraded and, if necessary, the file opened, @@ -51202,7 +51202,7 @@ static int syncJournal(Pager *pPager, int newHdr){ ** in Pager.dbFileVers[] is updated to match the new value stored in ** the database file. ** -** If everything is successful, SQLITE_OK is returned. If an IO error +** If everything is successful, SQLITE_OK is returned. If an IO error ** occurs, an IO error code is returned. Or, if the EXCLUSIVE lock cannot ** be obtained, SQLITE_BUSY is returned. */ @@ -51228,7 +51228,7 @@ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){ ** file size will be. */ assert( rc!=SQLITE_OK || isOpen(pPager->fd) ); - if( rc==SQLITE_OK + if( rc==SQLITE_OK && pPager->dbHintSizedbSize && (pList->pDirty || pList->pgno>pPager->dbHintSize) ){ @@ -51250,7 +51250,7 @@ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){ */ if( pgno<=pPager->dbSize && 0==(pList->flags&PGHDR_DONT_WRITE) ){ i64 offset = (pgno-1)*(i64)pPager->pageSize; /* Offset to write */ - char *pData; /* Data to write */ + char *pData; /* Data to write */ assert( (pList->flags&PGHDR_NEED_SYNC)==0 ); if( pList->pgno==1 ) pager_write_changecounter(pList); @@ -51262,8 +51262,8 @@ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){ rc = sqlite3OsWrite(pPager->fd, pData, pPager->pageSize, offset); /* If page 1 was just written, update Pager.dbFileVers to match - ** the value now stored in the database file. If writing this - ** page caused the database file to grow, update dbFileSize. + ** the value now stored in the database file. If writing this + ** page caused the database file to grow, update dbFileSize. */ if( pgno==1 ){ memcpy(&pPager->dbFileVers, &pData[24], sizeof(pPager->dbFileVers)); @@ -51291,18 +51291,18 @@ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){ } /* -** Ensure that the sub-journal file is open. If it is already open, this +** Ensure that the sub-journal file is open. If it is already open, this ** function is a no-op. ** -** SQLITE_OK is returned if everything goes according to plan. An -** SQLITE_IOERR_XXX error code is returned if a call to sqlite3OsOpen() +** SQLITE_OK is returned if everything goes according to plan. An +** SQLITE_IOERR_XXX error code is returned if a call to sqlite3OsOpen() ** fails. */ static int openSubJournal(Pager *pPager){ int rc = SQLITE_OK; if( !isOpen(pPager->sjfd) ){ - const int flags = SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_READWRITE - | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE + const int flags = SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_READWRITE + | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE; int nStmtSpill = sqlite3Config.nStmtSpill; if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->subjInMemory ){ @@ -51314,13 +51314,13 @@ static int openSubJournal(Pager *pPager){ } /* -** Append a record of the current state of page pPg to the sub-journal. +** Append a record of the current state of page pPg to the sub-journal. ** ** If successful, set the bit corresponding to pPg->pgno in the bitvecs ** for all open savepoints before returning. ** ** This function returns SQLITE_OK if everything is successful, an IO -** error code if the attempt to write to the sub-journal fails, or +** error code if the attempt to write to the sub-journal fails, or ** SQLITE_NOMEM if a malloc fails while setting a bit in a savepoint ** bitvec. */ @@ -51333,9 +51333,9 @@ static int subjournalPage(PgHdr *pPg){ assert( pPager->useJournal ); assert( isOpen(pPager->jfd) || pagerUseWal(pPager) ); assert( isOpen(pPager->sjfd) || pPager->nSubRec==0 ); - assert( pagerUseWal(pPager) - || pageInJournal(pPager, pPg) - || pPg->pgno>pPager->dbOrigSize + assert( pagerUseWal(pPager) + || pageInJournal(pPager, pPg) + || pPg->pgno>pPager->dbOrigSize ); rc = openSubJournal(pPager); @@ -51345,7 +51345,7 @@ static int subjournalPage(PgHdr *pPg){ void *pData = pPg->pData; i64 offset = (i64)pPager->nSubRec*(4+pPager->pageSize); char *pData2; - + CODEC2(pPager, pData, pPg->pgno, 7, return SQLITE_NOMEM_BKPT, pData2); PAGERTRACE(("STMT-JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno)); rc = write32bits(pPager->sjfd, offset, pPg->pgno); @@ -51373,14 +51373,14 @@ static int subjournalPageIfRequired(PgHdr *pPg){ ** This function is called by the pcache layer when it has reached some ** soft memory limit. The first argument is a pointer to a Pager object ** (cast as a void*). The pager is always 'purgeable' (not an in-memory -** database). The second argument is a reference to a page that is +** database). The second argument is a reference to a page that is ** currently dirty but has no outstanding references. The page -** is always associated with the Pager object passed as the first +** is always associated with the Pager object passed as the first ** argument. ** ** The job of this function is to make pPg clean by writing its contents ** out to the database file, if possible. This may involve syncing the -** journal file. +** journal file. ** ** If successful, sqlite3PcacheMakeClean() is called on the page and ** SQLITE_OK returned. If an IO error occurs while trying to make the @@ -51405,7 +51405,7 @@ static int pagerStress(void *p, PgHdr *pPg){ ** a rollback or by user request, respectively. ** ** Spilling is also prohibited when in an error state since that could - ** lead to database corruption. In the current implementation it + ** lead to database corruption. In the current implementation it ** is impossible for sqlite3PcacheFetch() to be called with createFlag==3 ** while in the error state, hence it is impossible for this routine to ** be called in the error state. Nevertheless, we include a NEVER() @@ -51425,19 +51425,19 @@ static int pagerStress(void *p, PgHdr *pPg){ pPg->pDirty = 0; if( pagerUseWal(pPager) ){ /* Write a single frame for this page to the log. */ - rc = subjournalPageIfRequired(pPg); + rc = subjournalPageIfRequired(pPg); if( rc==SQLITE_OK ){ rc = pagerWalFrames(pPager, pPg, 0, 0); } }else{ - + /* Sync the journal file if required. */ - if( pPg->flags&PGHDR_NEED_SYNC + if( pPg->flags&PGHDR_NEED_SYNC || pPager->eState==PAGER_WRITER_CACHEMOD ){ rc = syncJournal(pPager, 1); } - + /* Write the contents of the page out to the database file. */ if( rc==SQLITE_OK ){ assert( (pPg->flags&PGHDR_NEED_SYNC)==0 ); @@ -51451,7 +51451,7 @@ static int pagerStress(void *p, PgHdr *pPg){ sqlite3PcacheMakeClean(pPg); } - return pager_error(pPager, rc); + return pager_error(pPager, rc); } /* @@ -51482,8 +51482,8 @@ SQLITE_PRIVATE int sqlite3PagerFlush(Pager *pPager){ ** The zFilename argument is the path to the database file to open. ** If zFilename is NULL then a randomly-named temporary file is created ** and used as the file to be cached. Temporary files are be deleted -** automatically when they are closed. If zFilename is ":memory:" then -** all information is held in cache. It is never written to disk. +** automatically when they are closed. If zFilename is ":memory:" then +** all information is held in cache. It is never written to disk. ** This can be used to implement an in-memory database. ** ** The nExtra parameter specifies the number of bytes of space allocated @@ -51497,13 +51497,13 @@ SQLITE_PRIVATE int sqlite3PagerFlush(Pager *pPager){ ** of the PAGER_* flags. ** ** The vfsFlags parameter is a bitmask to pass to the flags parameter -** of the xOpen() method of the supplied VFS when opening files. +** of the xOpen() method of the supplied VFS when opening files. ** -** If the pager object is allocated and the specified file opened +** If the pager object is allocated and the specified file opened ** successfully, SQLITE_OK is returned and *ppPager set to point to ** the new pager object. If an error occurs, *ppPager is set to NULL ** and error code returned. This function may return SQLITE_NOMEM -** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or +** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or ** various SQLITE_IO_XXX errors. */ SQLITE_PRIVATE int sqlite3PagerOpen( @@ -51586,7 +51586,7 @@ SQLITE_PRIVATE int sqlite3PagerOpen( } /* Allocate memory for the Pager structure, PCache object, the - ** three file descriptors, the database file name and the journal + ** three file descriptors, the database file name and the journal ** file name. The layout in memory is as follows: ** ** Pager object (sizeof(Pager) bytes) @@ -51601,7 +51601,7 @@ SQLITE_PRIVATE int sqlite3PagerOpen( ROUND8(sizeof(*pPager)) + /* Pager structure */ ROUND8(pcacheSize) + /* PCache object */ ROUND8(pVfs->szOsFile) + /* The main db file */ - journalFileSize * 2 + /* The two journal files */ + journalFileSize * 2 + /* The two journal files */ nPathname + 1 + nUri + /* zFilename */ nPathname + 8 + 2 /* zJournal */ #ifndef SQLITE_OMIT_WAL @@ -51700,7 +51700,7 @@ SQLITE_PRIVATE int sqlite3PagerOpen( ** disk and uses an in-memory rollback journal. ** ** This branch also runs for files marked as immutable. - */ + */ act_like_temp_file: tempFile = 1; pPager->eState = PAGER_READER; /* Pretend we already have a lock */ @@ -51709,7 +51709,7 @@ act_like_temp_file: readOnly = (vfsFlags&SQLITE_OPEN_READONLY); } - /* The following call to PagerSetPagesize() serves to set the value of + /* The following call to PagerSetPagesize() serves to set the value of ** Pager.pageSize and to allocate the Pager.pTmpSpace buffer. */ if( rc==SQLITE_OK ){ @@ -51749,10 +51749,10 @@ act_like_temp_file: /* pPager->state = PAGER_UNLOCK; */ /* pPager->errMask = 0; */ pPager->tempFile = (u8)tempFile; - assert( tempFile==PAGER_LOCKINGMODE_NORMAL + assert( tempFile==PAGER_LOCKINGMODE_NORMAL || tempFile==PAGER_LOCKINGMODE_EXCLUSIVE ); assert( PAGER_LOCKINGMODE_EXCLUSIVE==1 ); - pPager->exclusiveMode = (u8)tempFile; + pPager->exclusiveMode = (u8)tempFile; pPager->changeCountDone = pPager->tempFile; pPager->memDb = (u8)memDb; pPager->readOnly = (u8)readOnly; @@ -51823,7 +51823,7 @@ static int databaseIsUnmoved(Pager *pPager){ /* ** This function is called after transitioning from PAGER_UNLOCK to ** PAGER_SHARED state. It tests if there is a hot journal present in -** the file-system for the given pager. A hot journal is one that +** the file-system for the given pager. A hot journal is one that ** needs to be played back. According to this function, a hot-journal ** file exists if the following criteria are met: ** @@ -51842,10 +51842,10 @@ static int databaseIsUnmoved(Pager *pPager){ ** at the end of the file. If there is, and that master journal file ** does not exist, then the journal file is not really hot. In this ** case this routine will return a false-positive. The pager_playback() -** routine will discover that the journal file is not really hot and -** will not roll it back. +** routine will discover that the journal file is not really hot and +** will not roll it back. ** -** If a hot-journal file is found to exist, *pExists is set to 1 and +** If a hot-journal file is found to exist, *pExists is set to 1 and ** SQLITE_OK returned. If no hot-journal file is present, *pExists is ** set to 0 and SQLITE_OK returned. If an IO error occurs while trying ** to determine whether or not a hot-journal file exists, the IO error @@ -51873,7 +51873,7 @@ static int hasHotJournal(Pager *pPager, int *pExists){ int locked = 0; /* True if some process holds a RESERVED lock */ /* Race condition here: Another process might have been holding the - ** the RESERVED lock and have a journal open at the sqlite3OsAccess() + ** the RESERVED lock and have a journal open at the sqlite3OsAccess() ** call above, but then delete the journal and drop the lock before ** we get to the following sqlite3OsCheckReservedLock() call. If that ** is the case, this routine might think there is a hot journal when @@ -51906,7 +51906,7 @@ static int hasHotJournal(Pager *pPager, int *pExists){ /* The journal file exists and no other connection has a reserved ** or greater lock on the database file. Now check that there is ** at least one non-zero bytes at the start of the journal file. - ** If there is, then we consider this journal to be hot. If not, + ** If there is, then we consider this journal to be hot. If not, ** it can be ignored. */ if( !jrnlOpen ){ @@ -51956,7 +51956,7 @@ static int hasHotJournal(Pager *pPager, int *pExists){ ** on the database file), then an attempt is made to obtain a ** SHARED lock on the database file. Immediately after obtaining ** the SHARED lock, the file-system is checked for a hot-journal, -** which is played back if present. Following any hot-journal +** which is played back if present. Following any hot-journal ** rollback, the contents of the cache are validated by checking ** the 'change-counter' field of the database file header and ** discarded if they are found to be invalid. @@ -51967,8 +51967,8 @@ static int hasHotJournal(Pager *pPager, int *pExists){ ** the contents of the page cache and rolling back any open journal ** file. ** -** If everything is successful, SQLITE_OK is returned. If an IO error -** occurs while locking the database, checking for a hot-journal file or +** If everything is successful, SQLITE_OK is returned. If an IO error +** occurs while locking the database, checking for a hot-journal file or ** rolling back a journal file, the IO error code is returned. */ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){ @@ -51976,7 +51976,7 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){ /* This routine is only called from b-tree and only when there are no ** outstanding pages. This implies that the pager state should either - ** be OPEN or READER. READER is only possible if the pager is or was in + ** be OPEN or READER. READER is only possible if the pager is or was in ** exclusive access mode. */ assert( sqlite3PcacheRefCount(pPager->pPCache)==0 ); assert( assert_pager_state(pPager) ); @@ -52014,12 +52014,12 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){ ** important that a RESERVED lock is not obtained on the way to the ** EXCLUSIVE lock. If it were, another process might open the ** database file, detect the RESERVED lock, and conclude that the - ** database is safe to read while this process is still rolling the + ** database is safe to read while this process is still rolling the ** hot-journal back. - ** + ** ** Because the intermediate RESERVED lock is not requested, any - ** other process attempting to access the database file will get to - ** this point in the code and fail to obtain its own EXCLUSIVE lock + ** other process attempting to access the database file will get to + ** this point in the code and fail to obtain its own EXCLUSIVE lock ** on the database file. ** ** Unless the pager is in locking_mode=exclusive mode, the lock is @@ -52029,17 +52029,17 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){ if( rc!=SQLITE_OK ){ goto failed; } - - /* If it is not already open and the file exists on disk, open the - ** journal for read/write access. Write access is required because - ** in exclusive-access mode the file descriptor will be kept open - ** and possibly used for a transaction later on. Also, write-access - ** is usually required to finalize the journal in journal_mode=persist + + /* If it is not already open and the file exists on disk, open the + ** journal for read/write access. Write access is required because + ** in exclusive-access mode the file descriptor will be kept open + ** and possibly used for a transaction later on. Also, write-access + ** is usually required to finalize the journal in journal_mode=persist ** mode (and also for journal_mode=truncate on some systems). ** - ** If the journal does not exist, it usually means that some - ** other connection managed to get in and roll it back before - ** this connection obtained the exclusive lock above. Or, it + ** If the journal does not exist, it usually means that some + ** other connection managed to get in and roll it back before + ** this connection obtained the exclusive lock above. Or, it ** may mean that the pager was in the error-state when this ** function was called and the journal file does not exist. */ @@ -52060,7 +52060,7 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){ } } } - + /* Playback and delete the journal. Drop the database write ** lock and reacquire the read lock. Purge the cache before ** playing back the hot-journal so that we don't end up with @@ -52085,8 +52085,8 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){ ** or roll back a hot-journal while holding an EXCLUSIVE lock. The ** pager_unlock() routine will be called before returning to unlock ** the file. If the unlock attempt fails, then Pager.eLock must be - ** set to UNKNOWN_LOCK (see the comment above the #define for - ** UNKNOWN_LOCK above for an explanation). + ** set to UNKNOWN_LOCK (see the comment above the #define for + ** UNKNOWN_LOCK above for an explanation). ** ** In order to get pager_unlock() to do this, set Pager.eState to ** PAGER_ERROR now. This is not actually counted as a transition @@ -52094,7 +52094,7 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){ ** since we know that the same call to pager_unlock() will very ** shortly transition the pager object to the OPEN state. Calling ** assert_pager_state() would fail now, as it should not be possible - ** to be in ERROR state when there are zero outstanding page + ** to be in ERROR state when there are zero outstanding page ** references. */ pager_error(pPager, rc); @@ -52119,8 +52119,8 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){ ** a 32-bit counter that is incremented with each change. The ** other bytes change randomly with each file change when ** a codec is in use. - ** - ** There is a vanishingly small chance that a change will not be + ** + ** There is a vanishingly small chance that a change will not be ** detected. The chance of an undetected change is so small that ** it can be neglected. */ @@ -52192,7 +52192,7 @@ SQLITE_PRIVATE int sqlite3PagerSharedLock(Pager *pPager){ ** Except, in locking_mode=EXCLUSIVE when there is nothing to in ** the rollback journal, the unlock is not performed and there is ** nothing to rollback, so this routine is a no-op. -*/ +*/ static void pagerUnlockIfUnused(Pager *pPager){ if( pPager->nMmapOut==0 && (sqlite3PcacheRefCount(pPager->pPCache)==0) ){ pagerUnlockAndRollback(pPager); @@ -52201,7 +52201,7 @@ static void pagerUnlockIfUnused(Pager *pPager){ /* ** The page getter methods each try to acquire a reference to a -** page with page number pgno. If the requested reference is +** page with page number pgno. If the requested reference is ** successfully obtained, it is copied to *ppPage and SQLITE_OK returned. ** ** There are different implementations of the getter method depending @@ -52211,22 +52211,22 @@ static void pagerUnlockIfUnused(Pager *pPager){ ** getPageError() -- Used if the pager is in an error state ** getPageMmap() -- Used if memory-mapped I/O is enabled ** -** If the requested page is already in the cache, it is returned. +** If the requested page is already in the cache, it is returned. ** Otherwise, a new page object is allocated and populated with data ** read from the database file. In some cases, the pcache module may ** choose not to allocate a new page object and may reuse an existing ** object with no outstanding references. ** -** The extra data appended to a page is always initialized to zeros the -** first time a page is loaded into memory. If the page requested is +** The extra data appended to a page is always initialized to zeros the +** first time a page is loaded into memory. If the page requested is ** already in the cache when this function is called, then the extra ** data is left as it was when the page object was last used. ** -** If the database image is smaller than the requested page or if -** the flags parameter contains the PAGER_GET_NOCONTENT bit and the -** requested page is not already stored in the cache, then no -** actual disk read occurs. In this case the memory image of the -** page is initialized to all zeros. +** If the database image is smaller than the requested page or if +** the flags parameter contains the PAGER_GET_NOCONTENT bit and the +** requested page is not already stored in the cache, then no +** actual disk read occurs. In this case the memory image of the +** page is initialized to all zeros. ** ** If PAGER_GET_NOCONTENT is true, it means that we do not care about ** the contents of the page. This occurs in two scenarios: @@ -52297,7 +52297,7 @@ static int getPageNormal( return SQLITE_OK; }else{ - /* The pager cache has created a new page. Its content needs to + /* The pager cache has created a new page. Its content needs to ** be initialized. But first some error checks: ** ** (1) The maximum page number is 2^31 @@ -52318,9 +52318,9 @@ static int getPageNormal( } if( noContent ){ /* Failure to set the bits in the InJournal bit-vectors is benign. - ** It merely means that we might do some extra work to journal a - ** page that does not need to be journaled. Nevertheless, be sure - ** to test the case where a malloc error occurs while trying to set + ** It merely means that we might do some extra work to journal a + ** page that does not need to be journaled. Nevertheless, be sure + ** to test the case where a malloc error occurs while trying to set ** a bit in a bit vector. */ sqlite3BeginBenignMalloc(); @@ -52375,7 +52375,7 @@ static int getPageMMap( /* It is acceptable to use a read-only (mmap) page for any page except ** page 1 if there is no write-transaction open or the ACQUIRE_READONLY - ** flag was specified by the caller. And so long as the db is not a + ** flag was specified by the caller. And so long as the db is not a ** temporary or in-memory database. */ const int bMmapOk = (pgno>1 && (pPager->eState==PAGER_READER || (flags & PAGER_GET_READONLY)) @@ -52407,7 +52407,7 @@ static int getPageMMap( } if( bMmapOk && iFrame==0 ){ void *pData = 0; - rc = sqlite3OsFetch(pPager->fd, + rc = sqlite3OsFetch(pPager->fd, (i64)(pgno-1) * pPager->pageSize, pPager->pageSize, &pData ); if( rc==SQLITE_OK && pData ){ @@ -52463,12 +52463,12 @@ SQLITE_PRIVATE int sqlite3PagerGet( /* ** Acquire a page if it is already in the in-memory cache. Do ** not read the page from disk. Return a pointer to the page, -** or 0 if the page is not in cache. +** or 0 if the page is not in cache. ** ** See also sqlite3PagerGet(). The difference between this routine ** and sqlite3PagerGet() is that _get() will go to the disk and read ** in the page if the page is not already in cache. This routine -** returns NULL if the page is not in cache or if a disk I/O error +** returns NULL if the page is not in cache or if a disk I/O error ** has ever happened. */ SQLITE_PRIVATE DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno){ @@ -52507,24 +52507,24 @@ SQLITE_PRIVATE void sqlite3PagerUnref(DbPage *pPg){ /* ** This function is called at the start of every write transaction. -** There must already be a RESERVED or EXCLUSIVE lock on the database +** There must already be a RESERVED or EXCLUSIVE lock on the database ** file when this routine is called. ** ** Open the journal file for pager pPager and write a journal header ** to the start of it. If there are active savepoints, open the sub-journal -** as well. This function is only used when the journal file is being -** opened to write a rollback log for a transaction. It is not used +** as well. This function is only used when the journal file is being +** opened to write a rollback log for a transaction. It is not used ** when opening a hot journal file to roll it back. ** ** If the journal file is already open (as it may be in exclusive mode), ** then this function just writes a journal header to the start of the -** already open file. +** already open file. ** ** Whether or not the journal file is opened by this function, the ** Pager.pInJournal bitvec structure is allocated. ** -** Return SQLITE_OK if everything is successful. Otherwise, return -** SQLITE_NOMEM if the attempt to allocate Pager.pInJournal fails, or +** Return SQLITE_OK if everything is successful. Otherwise, return +** SQLITE_NOMEM if the attempt to allocate Pager.pInJournal fails, or ** an IO error code if opening or writing the journal file fails. */ static int pager_open_journal(Pager *pPager){ @@ -52534,7 +52534,7 @@ static int pager_open_journal(Pager *pPager){ assert( pPager->eState==PAGER_WRITER_LOCKED ); assert( assert_pager_state(pPager) ); assert( pPager->pInJournal==0 ); - + /* If already in the error state, this function is a no-op. But on ** the other hand, this routine is never called if we are already in ** an error state. */ @@ -52545,7 +52545,7 @@ static int pager_open_journal(Pager *pPager){ if( pPager->pInJournal==0 ){ return SQLITE_NOMEM_BKPT; } - + /* Open the journal file if it is not already open. */ if( !isOpen(pPager->jfd) ){ if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY ){ @@ -52561,7 +52561,7 @@ static int pager_open_journal(Pager *pPager){ flags |= SQLITE_OPEN_MAIN_JOURNAL; nSpill = jrnlBufferSize(pPager); } - + /* Verify that the database still has the same name as it did when ** it was originally opened. */ rc = databaseIsUnmoved(pPager); @@ -52573,9 +52573,9 @@ static int pager_open_journal(Pager *pPager){ } assert( rc!=SQLITE_OK || isOpen(pPager->jfd) ); } - - - /* Write the first journal header to the journal file and open + + + /* Write the first journal header to the journal file and open ** the sub-journal if necessary. */ if( rc==SQLITE_OK ){ @@ -52600,12 +52600,12 @@ static int pager_open_journal(Pager *pPager){ } /* -** Begin a write-transaction on the specified pager object. If a +** Begin a write-transaction on the specified pager object. If a ** write-transaction has already been opened, this function is a no-op. ** ** If the exFlag argument is false, then acquire at least a RESERVED ** lock on the database file. If exFlag is true, then acquire at least -** an EXCLUSIVE lock. If such a lock is already held, no locking +** an EXCLUSIVE lock. If such a lock is already held, no locking ** functions need be called. ** ** If the subjInMemory argument is non-zero, then any sub-journal opened @@ -52613,7 +52613,7 @@ static int pager_open_journal(Pager *pPager){ ** has no effect if the sub-journal is already opened (as it may be when ** running in exclusive mode) or if the transaction does not require a ** sub-journal. If the subjInMemory argument is zero, then any required -** sub-journal is implemented in-memory if pPager is an in-memory database, +** sub-journal is implemented in-memory if pPager is an in-memory database, ** or using a temporary file otherwise. */ SQLITE_PRIVATE int sqlite3PagerBegin(Pager *pPager, int exFlag, int subjInMemory){ @@ -52661,9 +52661,9 @@ SQLITE_PRIVATE int sqlite3PagerBegin(Pager *pPager, int exFlag, int subjInMemory ** ** WAL mode sets Pager.eState to PAGER_WRITER_LOCKED or CACHEMOD ** when it has an open transaction, but never to DBMOD or FINISHED. - ** This is because in those states the code to roll back savepoint - ** transactions may copy data from the sub-journal into the database - ** file as well as into the page cache. Which would be incorrect in + ** This is because in those states the code to roll back savepoint + ** transactions may copy data from the sub-journal into the database + ** file as well as into the page cache. Which would be incorrect in ** WAL mode. */ pPager->eState = PAGER_WRITER_LOCKED; @@ -52717,11 +52717,11 @@ static SQLITE_NOINLINE int pagerAddPageToRollbackJournal(PgHdr *pPg){ rc = write32bits(pPager->jfd, iOff+pPager->pageSize+4, cksum); if( rc!=SQLITE_OK ) return rc; - IOTRACE(("JOUT %p %d %lld %d\n", pPager, pPg->pgno, + IOTRACE(("JOUT %p %d %lld %d\n", pPager, pPg->pgno, pPager->journalOff, pPager->pageSize)); PAGER_INCR(sqlite3_pager_writej_count); PAGERTRACE(("JOURNAL %d page %d needSync=%d hash(%08x)\n", - PAGERID(pPager), pPg->pgno, + PAGERID(pPager), pPg->pgno, ((pPg->flags&PGHDR_NEED_SYNC)?1:0), pager_pagehash(pPg))); pPager->journalOff += 8 + pPager->pageSize; @@ -52736,9 +52736,9 @@ static SQLITE_NOINLINE int pagerAddPageToRollbackJournal(PgHdr *pPg){ } /* -** Mark a single data page as writeable. The page is written into the +** Mark a single data page as writeable. The page is written into the ** main journal or sub-journal as required. If the page is written into -** one of the journals, the corresponding bit is set in the +** one of the journals, the corresponding bit is set in the ** Pager.pInJournal bitvec and the PagerSavepoint.pInSavepoint bitvecs ** of any open savepoints as appropriate. */ @@ -52746,7 +52746,7 @@ static int pager_write(PgHdr *pPg){ Pager *pPager = pPg->pPager; int rc = SQLITE_OK; - /* This routine is not called unless a write-transaction has already + /* This routine is not called unless a write-transaction has already ** been started. The journal file may or may not be open at this point. ** It is never called in the ERROR state. */ @@ -52763,7 +52763,7 @@ static int pager_write(PgHdr *pPg){ ** obtained the necessary locks to begin the write-transaction, but the ** rollback journal might not yet be open. Open it now if this is the case. ** - ** This is done before calling sqlite3PcacheMakeDirty() on the page. + ** This is done before calling sqlite3PcacheMakeDirty() on the page. ** Otherwise, if it were done after calling sqlite3PcacheMakeDirty(), then ** an error might occur and the pager would end up in WRITER_LOCKED state ** with pages marked as dirty in the cache. @@ -52808,7 +52808,7 @@ static int pager_write(PgHdr *pPg){ ** PGHDR_WRITEABLE bit that indicates that the page can be safely modified. */ pPg->flags |= PGHDR_WRITEABLE; - + /* If the statement journal is open and the page is not in it, ** then write the page into the statement journal. */ @@ -52892,7 +52892,7 @@ static SQLITE_NOINLINE int pagerWriteLargeSector(PgHdr *pPg){ } } - /* If the PGHDR_NEED_SYNC flag is set for any of the nPage pages + /* If the PGHDR_NEED_SYNC flag is set for any of the nPage pages ** starting at pg1, then it needs to be set for all of them. Because ** writing to any of these nPage pages may damage the others, the ** journal file must contain sync()ed copies of all of them @@ -52915,9 +52915,9 @@ static SQLITE_NOINLINE int pagerWriteLargeSector(PgHdr *pPg){ } /* -** Mark a data page as writeable. This routine must be called before -** making changes to a page. The caller must check the return value -** of this function and be careful not to change any page data unless +** Mark a data page as writeable. This routine must be called before +** making changes to a page. The caller must check the return value +** of this function and be careful not to change any page data unless ** this routine returns SQLITE_OK. ** ** The difference between this function and pager_write() is that this @@ -52968,13 +52968,13 @@ SQLITE_PRIVATE int sqlite3PagerIswriteable(DbPage *pPg){ ** on the given page is unused. The pager marks the page as clean so ** that it does not get written to disk. ** -** Tests show that this optimization can quadruple the speed of large +** Tests show that this optimization can quadruple the speed of large ** DELETE operations. ** ** This optimization cannot be used with a temp-file, as the page may ** have been dirty at the start of the transaction. In that case, if -** memory pressure forces page pPg out of the cache, the data does need -** to be written out to disk so that it may be read back in if the +** memory pressure forces page pPg out of the cache, the data does need +** to be written out to disk so that it may be read back in if the ** current transaction is rolled back. */ SQLITE_PRIVATE void sqlite3PagerDontWrite(PgHdr *pPg){ @@ -52990,17 +52990,17 @@ SQLITE_PRIVATE void sqlite3PagerDontWrite(PgHdr *pPg){ } /* -** This routine is called to increment the value of the database file -** change-counter, stored as a 4-byte big-endian integer starting at +** This routine is called to increment the value of the database file +** change-counter, stored as a 4-byte big-endian integer starting at ** byte offset 24 of the pager file. The secondary change counter at ** 92 is also updated, as is the SQLite version number at offset 96. ** ** But this only happens if the pPager->changeCountDone flag is false. ** To avoid excess churning of page 1, the update only happens once. -** See also the pager_write_changecounter() routine that does an +** See also the pager_write_changecounter() routine that does an ** unconditional update of the change counters. ** -** If the isDirectMode flag is zero, then this is done by calling +** If the isDirectMode flag is zero, then this is done by calling ** sqlite3PagerWrite() on page 1, then modifying the contents of the ** page data. In this case the file will be updated when the current ** transaction is committed. @@ -53008,7 +53008,7 @@ SQLITE_PRIVATE void sqlite3PagerDontWrite(PgHdr *pPg){ ** The isDirectMode flag may only be non-zero if the library was compiled ** with the SQLITE_ENABLE_ATOMIC_WRITE macro defined. In this case, ** if isDirect is non-zero, then the database file is updated directly -** by writing an updated version of page 1 using a call to the +** by writing an updated version of page 1 using a call to the ** sqlite3OsWrite() function. */ static int pager_incr_changecounter(Pager *pPager, int isDirectMode){ @@ -53047,7 +53047,7 @@ static int pager_incr_changecounter(Pager *pPager, int isDirectMode){ assert( pPgHdr==0 || rc==SQLITE_OK ); /* If page one was fetched successfully, and this function is not - ** operating in direct-mode, make page 1 writable. When not in + ** operating in direct-mode, make page 1 writable. When not in ** direct mode, page 1 is always held in cache and hence the PagerGet() ** above is always successful - hence the ALWAYS on rc==SQLITE_OK. */ @@ -53111,22 +53111,22 @@ SQLITE_PRIVATE int sqlite3PagerSync(Pager *pPager, const char *zMaster){ /* ** This function may only be called while a write-transaction is active in -** rollback. If the connection is in WAL mode, this call is a no-op. -** Otherwise, if the connection does not already have an EXCLUSIVE lock on +** rollback. If the connection is in WAL mode, this call is a no-op. +** Otherwise, if the connection does not already have an EXCLUSIVE lock on ** the database file, an attempt is made to obtain one. ** ** If the EXCLUSIVE lock is already held or the attempt to obtain it is ** successful, or the connection is in WAL mode, SQLITE_OK is returned. -** Otherwise, either SQLITE_BUSY or an SQLITE_IOERR_XXX error code is +** Otherwise, either SQLITE_BUSY or an SQLITE_IOERR_XXX error code is ** returned. */ SQLITE_PRIVATE int sqlite3PagerExclusiveLock(Pager *pPager){ int rc = pPager->errCode; assert( assert_pager_state(pPager) ); if( rc==SQLITE_OK ){ - assert( pPager->eState==PAGER_WRITER_CACHEMOD - || pPager->eState==PAGER_WRITER_DBMOD - || pPager->eState==PAGER_WRITER_LOCKED + assert( pPager->eState==PAGER_WRITER_CACHEMOD + || pPager->eState==PAGER_WRITER_DBMOD + || pPager->eState==PAGER_WRITER_LOCKED ); assert( assert_pager_state(pPager) ); if( 0==pagerUseWal(pPager) ){ @@ -53146,12 +53146,12 @@ SQLITE_PRIVATE int sqlite3PagerExclusiveLock(Pager *pPager){ ** ** * The database file change-counter is updated, ** * the journal is synced (unless the atomic-write optimization is used), -** * all dirty pages are written to the database file, +** * all dirty pages are written to the database file, ** * the database file is truncated (if required), and -** * the database file synced. +** * the database file synced. ** -** The only thing that remains to commit the transaction is to finalize -** (delete, truncate or zero the first part of) the journal file (or +** The only thing that remains to commit the transaction is to finalize +** (delete, truncate or zero the first part of) the journal file (or ** delete the master journal file if specified). ** ** Note that if zMaster==NULL, this does not overwrite a previous value @@ -53182,7 +53182,7 @@ SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne( /* Provide the ability to easily simulate an I/O error during testing */ if( sqlite3FaultSim(400) ) return SQLITE_IOERR; - PAGERTRACE(("DATABASE SYNC: File=%s zMaster=%s nSize=%d\n", + PAGERTRACE(("DATABASE SYNC: File=%s zMaster=%s nSize=%d\n", pPager->zFilename, zMaster, pPager->dbSize)); /* If no database changes have been made, return early. */ @@ -53217,11 +53217,11 @@ SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne( }else{ /* The following block updates the change-counter. Exactly how it ** does this depends on whether or not the atomic-update optimization - ** was enabled at compile time, and if this transaction meets the - ** runtime criteria to use the operation: + ** was enabled at compile time, and if this transaction meets the + ** runtime criteria to use the operation: ** ** * The file-system supports the atomic-write property for - ** blocks of size page-size, and + ** blocks of size page-size, and ** * This commit is not part of a multi-file transaction, and ** * Exactly one page has been modified and store in the journal file. ** @@ -53231,7 +53231,7 @@ SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne( ** is not applicable to this transaction, call sqlite3JournalCreate() ** to make sure the journal file has actually been created, then call ** pager_incr_changecounter() to update the change-counter in indirect - ** mode. + ** mode. ** ** Otherwise, if the optimization is both enabled and applicable, ** then call pager_incr_changecounter() to update the change-counter @@ -53240,19 +53240,19 @@ SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne( */ #ifdef SQLITE_ENABLE_ATOMIC_WRITE PgHdr *pPg; - assert( isOpen(pPager->jfd) - || pPager->journalMode==PAGER_JOURNALMODE_OFF - || pPager->journalMode==PAGER_JOURNALMODE_WAL + assert( isOpen(pPager->jfd) + || pPager->journalMode==PAGER_JOURNALMODE_OFF + || pPager->journalMode==PAGER_JOURNALMODE_WAL ); - if( !zMaster && isOpen(pPager->jfd) - && pPager->journalOff==jrnlBufferSize(pPager) + if( !zMaster && isOpen(pPager->jfd) + && pPager->journalOff==jrnlBufferSize(pPager) && pPager->dbSize>=pPager->dbOrigSize && (0==(pPg = sqlite3PcacheDirtyList(pPager->pPCache)) || 0==pPg->pDirty) ){ - /* Update the db file change counter via the direct-write method. The - ** following call will modify the in-memory representation of page 1 - ** to include the updated change counter and then write page 1 - ** directly to the database file. Because of the atomic-write + /* Update the db file change counter via the direct-write method. The + ** following call will modify the in-memory representation of page 1 + ** to include the updated change counter and then write page 1 + ** directly to the database file. Because of the atomic-write ** property of the host file-system, this is safe. */ rc = pager_incr_changecounter(pPager, 1); @@ -53266,28 +53266,28 @@ SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne( rc = pager_incr_changecounter(pPager, 0); #endif if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - - /* Write the master journal name into the journal file. If a master - ** journal file name has already been written to the journal file, + + /* Write the master journal name into the journal file. If a master + ** journal file name has already been written to the journal file, ** or if zMaster is NULL (no master journal), then this call is a no-op. */ rc = writeMasterJournal(pPager, zMaster); if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - + /* Sync the journal file and write all dirty pages to the database. - ** If the atomic-update optimization is being used, this sync will not + ** If the atomic-update optimization is being used, this sync will not ** create the journal file or perform any real IO. ** ** Because the change-counter page was just modified, unless the ** atomic-update optimization is used it is almost certain that the ** journal requires a sync here. However, in locking_mode=exclusive - ** on a system under memory pressure it is just possible that this is + ** on a system under memory pressure it is just possible that this is ** not the case. In this case it is likely enough that the redundant - ** xSync() call will be changed to a no-op by the OS anyhow. + ** xSync() call will be changed to a no-op by the OS anyhow. */ rc = syncJournal(pPager, 0); if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - + rc = pager_write_pagelist(pPager,sqlite3PcacheDirtyList(pPager->pPCache)); if( rc!=SQLITE_OK ){ assert( rc!=SQLITE_IOERR_BLOCKED ); @@ -53295,7 +53295,7 @@ SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne( } sqlite3PcacheCleanAll(pPager->pPCache); - /* If the file on disk is smaller than the database image, use + /* If the file on disk is smaller than the database image, use ** pager_truncate to grow the file here. This can happen if the database ** image was extended as part of the current transaction and then the ** last page in the db image moved to the free-list. In this case the @@ -53307,7 +53307,7 @@ SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne( rc = pager_truncate(pPager, nNew); if( rc!=SQLITE_OK ) goto commit_phase_one_exit; } - + /* Finally, sync the database file. */ if( !noSync ){ rc = sqlite3PagerSync(pPager, zMaster); @@ -53327,12 +53327,12 @@ commit_phase_one_exit: /* ** When this function is called, the database file has been completely ** updated to reflect the changes made by the current transaction and -** synced to disk. The journal file still exists in the file-system +** synced to disk. The journal file still exists in the file-system ** though, and if a failure occurs at this point it will eventually ** be used as a hot-journal and the current transaction rolled back. ** -** This function finalizes the journal file, either by deleting, -** truncating or partially zeroing it, so that it cannot be used +** This function finalizes the journal file, either by deleting, +** truncating or partially zeroing it, so that it cannot be used ** for hot-journal rollback. Once this is done the transaction is ** irrevocably committed. ** @@ -53357,15 +53357,15 @@ SQLITE_PRIVATE int sqlite3PagerCommitPhaseTwo(Pager *pPager){ ** this transaction, the pager is running in exclusive-mode and is ** using persistent journals, then this function is a no-op. ** - ** The start of the journal file currently contains a single journal + ** The start of the journal file currently contains a single journal ** header with the nRec field set to 0. If such a journal is used as ** a hot-journal during hot-journal rollback, 0 changes will be made - ** to the database file. So there is no need to zero the journal + ** to the database file. So there is no need to zero the journal ** header. Since the pager is in exclusive mode, there is no need ** to drop any locks either. */ - if( pPager->eState==PAGER_WRITER_LOCKED - && pPager->exclusiveMode + if( pPager->eState==PAGER_WRITER_LOCKED + && pPager->exclusiveMode && pPager->journalMode==PAGER_JOURNALMODE_PERSIST ){ assert( pPager->journalOff==JOURNAL_HDR_SZ(pPager) || !pPager->journalOff ); @@ -53380,7 +53380,7 @@ SQLITE_PRIVATE int sqlite3PagerCommitPhaseTwo(Pager *pPager){ } /* -** If a write transaction is open, then all changes made within the +** If a write transaction is open, then all changes made within the ** transaction are reverted and the current write-transaction is closed. ** The pager falls back to PAGER_READER state if successful, or PAGER_ERROR ** state if an error occurs. @@ -53390,14 +53390,14 @@ SQLITE_PRIVATE int sqlite3PagerCommitPhaseTwo(Pager *pPager){ ** ** Otherwise, in rollback mode, this function performs two functions: ** -** 1) It rolls back the journal file, restoring all database file and +** 1) It rolls back the journal file, restoring all database file and ** in-memory cache pages to the state they were in when the transaction ** was opened, and ** ** 2) It finalizes the journal file, so that it is not used for hot ** rollback at any point in the future. ** -** Finalization of the journal file (task 2) is only performed if the +** Finalization of the journal file (task 2) is only performed if the ** rollback is successful. ** ** In WAL mode, all cache-entries containing data modified within the @@ -53410,7 +53410,7 @@ SQLITE_PRIVATE int sqlite3PagerRollback(Pager *pPager){ PAGERTRACE(("ROLLBACK %d\n", PAGERID(pPager))); /* PagerRollback() is a no-op if called in READER or OPEN state. If - ** the pager is already in the ERROR state, the rollback is not + ** the pager is already in the ERROR state, the rollback is not ** attempted here. Instead, the error code is returned to the caller. */ assert( assert_pager_state(pPager) ); @@ -53426,7 +53426,7 @@ SQLITE_PRIVATE int sqlite3PagerRollback(Pager *pPager){ int eState = pPager->eState; rc = pager_end_transaction(pPager, 0, 0); if( !MEMDB && eState>PAGER_WRITER_LOCKED ){ - /* This can happen using journal_mode=off. Move the pager to the error + /* This can happen using journal_mode=off. Move the pager to the error ** state to indicate that the contents of the cache may not be trusted. ** Any active readers will get SQLITE_ABORT. */ @@ -53441,7 +53441,7 @@ SQLITE_PRIVATE int sqlite3PagerRollback(Pager *pPager){ assert( pPager->eState==PAGER_READER || rc!=SQLITE_OK ); assert( rc==SQLITE_OK || rc==SQLITE_FULL || rc==SQLITE_CORRUPT - || rc==SQLITE_NOMEM || (rc&0xFF)==SQLITE_IOERR + || rc==SQLITE_NOMEM || (rc&0xFF)==SQLITE_IOERR || rc==SQLITE_CANTOPEN ); @@ -53511,8 +53511,8 @@ SQLITE_PRIVATE int *sqlite3PagerStats(Pager *pPager){ /* ** Parameter eStat must be either SQLITE_DBSTATUS_CACHE_HIT or ** SQLITE_DBSTATUS_CACHE_MISS. Before returning, *pnVal is incremented by the -** current cache hit or miss count, according to the value of eStat. If the -** reset parameter is non-zero, the cache hit or miss count is zeroed before +** current cache hit or miss count, according to the value of eStat. If the +** reset parameter is non-zero, the cache hit or miss count is zeroed before ** returning. */ SQLITE_PRIVATE void sqlite3PagerCacheStat(Pager *pPager, int eStat, int reset, int *pnVal){ @@ -53545,7 +53545,7 @@ SQLITE_PRIVATE int sqlite3PagerIsMemdb(Pager *pPager){ ** to make up the difference. If the number of savepoints is already ** equal to nSavepoint, then this function is a no-op. ** -** If a memory allocation fails, SQLITE_NOMEM is returned. If an error +** If a memory allocation fails, SQLITE_NOMEM is returned. If an error ** occurs while opening the sub-journal file, then an IO error code is ** returned. Otherwise, SQLITE_OK. */ @@ -53560,7 +53560,7 @@ static SQLITE_NOINLINE int pagerOpenSavepoint(Pager *pPager, int nSavepoint){ assert( nSavepoint>nCurrent && pPager->useJournal ); /* Grow the Pager.aSavepoint array using realloc(). Return SQLITE_NOMEM - ** if the allocation fails. Otherwise, zero the new portion in case a + ** if the allocation fails. Otherwise, zero the new portion in case a ** malloc failure occurs while populating it in the for(...) loop below. */ aNew = (PagerSavepoint *)sqlite3Realloc( @@ -53608,7 +53608,7 @@ SQLITE_PRIVATE int sqlite3PagerOpenSavepoint(Pager *pPager, int nSavepoint){ /* ** This function is called to rollback or release (commit) a savepoint. -** The savepoint to release or rollback need not be the most recently +** The savepoint to release or rollback need not be the most recently ** created savepoint. ** ** Parameter op is always either SAVEPOINT_ROLLBACK or SAVEPOINT_RELEASE. @@ -53616,29 +53616,29 @@ SQLITE_PRIVATE int sqlite3PagerOpenSavepoint(Pager *pPager, int nSavepoint){ ** index iSavepoint. If it is SAVEPOINT_ROLLBACK, then rollback all changes ** that have occurred since the specified savepoint was created. ** -** The savepoint to rollback or release is identified by parameter +** The savepoint to rollback or release is identified by parameter ** iSavepoint. A value of 0 means to operate on the outermost savepoint ** (the first created). A value of (Pager.nSavepoint-1) means operate ** on the most recently created savepoint. If iSavepoint is greater than ** (Pager.nSavepoint-1), then this function is a no-op. ** ** If a negative value is passed to this function, then the current -** transaction is rolled back. This is different to calling +** transaction is rolled back. This is different to calling ** sqlite3PagerRollback() because this function does not terminate -** the transaction or unlock the database, it just restores the -** contents of the database to its original state. +** the transaction or unlock the database, it just restores the +** contents of the database to its original state. ** -** In any case, all savepoints with an index greater than iSavepoint +** In any case, all savepoints with an index greater than iSavepoint ** are destroyed. If this is a release operation (op==SAVEPOINT_RELEASE), ** then savepoint iSavepoint is also destroyed. ** ** This function may return SQLITE_NOMEM if a memory allocation fails, -** or an IO error code if an IO error occurs while rolling back a +** or an IO error code if an IO error occurs while rolling back a ** savepoint. If no errors occur, SQLITE_OK is returned. -*/ +*/ SQLITE_PRIVATE int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){ int rc = pPager->errCode; - + #ifdef SQLITE_ENABLE_ZIPVFS if( op==SAVEPOINT_RELEASE ) rc = SQLITE_OK; #endif @@ -53651,7 +53651,7 @@ SQLITE_PRIVATE int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){ int nNew; /* Number of remaining savepoints after this op. */ /* Figure out how many savepoints will still be active after this - ** operation. Store this value in nNew. Then free resources associated + ** operation. Store this value in nNew. Then free resources associated ** with any savepoints that are destroyed by this operation. */ nNew = iSavepoint + (( op==SAVEPOINT_RELEASE ) ? 0 : 1); @@ -53660,7 +53660,7 @@ SQLITE_PRIVATE int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){ } pPager->nSavepoint = nNew; - /* If this is a release of the outermost savepoint, truncate + /* If this is a release of the outermost savepoint, truncate ** the sub-journal to zero bytes in size. */ if( op==SAVEPOINT_RELEASE ){ if( nNew==0 && isOpen(pPager->sjfd) ){ @@ -53682,14 +53682,14 @@ SQLITE_PRIVATE int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){ rc = pagerPlaybackSavepoint(pPager, pSavepoint); assert(rc!=SQLITE_DONE); } - + #ifdef SQLITE_ENABLE_ZIPVFS - /* If the cache has been modified but the savepoint cannot be rolled + /* If the cache has been modified but the savepoint cannot be rolled ** back journal_mode=off, put the pager in the error state. This way, ** if the VFS used by this pager includes ZipVFS, the entire transaction ** can be rolled back at the ZipVFS level. */ - else if( - pPager->journalMode==PAGER_JOURNALMODE_OFF + else if( + pPager->journalMode==PAGER_JOURNALMODE_OFF && pPager->eState>=PAGER_WRITER_CACHEMOD ){ pPager->errCode = SQLITE_ABORT; @@ -53814,8 +53814,8 @@ SQLITE_PRIVATE int sqlite3PagerState(Pager *pPager){ ** transaction is active). ** ** If the fourth argument, isCommit, is non-zero, then this page is being -** moved as part of a database reorganization just before the transaction -** is being committed. In this case, it is guaranteed that the database page +** moved as part of a database reorganization just before the transaction +** is being committed. In this case, it is guaranteed that the database page ** pPg refers to will not be written to again within this transaction. ** ** This function may return SQLITE_NOMEM or an IO error code if an error @@ -53843,7 +53843,7 @@ SQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, i } /* If the page being moved is dirty and has not been saved by the latest - ** savepoint, then save the current contents of the page into the + ** savepoint, then save the current contents of the page into the ** sub-journal now. This is required to handle the following scenario: ** ** BEGIN; @@ -53866,7 +53866,7 @@ SQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, i return rc; } - PAGERTRACE(("MOVE %d page %d (needSync=%d) moves to %d\n", + PAGERTRACE(("MOVE %d page %d (needSync=%d) moves to %d\n", PAGERID(pPager), pPg->pgno, (pPg->flags&PGHDR_NEED_SYNC)?1:0, pgno)); IOTRACE(("MOVE %p %d %d\n", pPager, pPg->pgno, pgno)) @@ -53874,7 +53874,7 @@ SQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, i ** be written to, store pPg->pgno in local variable needSyncPgno. ** ** If the isCommit flag is set, there is no need to remember that - ** the journal needs to be sync()ed before database page pPg->pgno + ** the journal needs to be sync()ed before database page pPg->pgno ** can be written to. The caller has already promised not to write to it. */ if( (pPg->flags&PGHDR_NEED_SYNC) && !isCommit ){ @@ -53885,8 +53885,8 @@ SQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, i } /* If the cache contains a page with page-number pgno, remove it - ** from its hash chain. Also, if the PGHDR_NEED_SYNC flag was set for - ** page pgno before the 'move' operation, it needs to be retained + ** from its hash chain. Also, if the PGHDR_NEED_SYNC flag was set for + ** page pgno before the 'move' operation, it needs to be retained ** for the page moved there. */ pPg->flags &= ~PGHDR_NEED_SYNC; @@ -53917,9 +53917,9 @@ SQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, i } if( needSyncPgno ){ - /* If needSyncPgno is non-zero, then the journal file needs to be + /* If needSyncPgno is non-zero, then the journal file needs to be ** sync()ed before any data is written to database file page needSyncPgno. - ** Currently, no such page exists in the page-cache and the + ** Currently, no such page exists in the page-cache and the ** "is journaled" bitvec flag has been set. This needs to be remedied by ** loading the page into the pager-cache and setting the PGHDR_NEED_SYNC ** flag. @@ -53950,9 +53950,9 @@ SQLITE_PRIVATE int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, i #endif /* -** The page handle passed as the first argument refers to a dirty page -** with a page number other than iNew. This function changes the page's -** page number to iNew and sets the value of the PgHdr.flags field to +** The page handle passed as the first argument refers to a dirty page +** with a page number other than iNew. This function changes the page's +** page number to iNew and sets the value of the PgHdr.flags field to ** the value passed as the third parameter. */ SQLITE_PRIVATE void sqlite3PagerRekey(DbPage *pPg, Pgno iNew, u16 flags){ @@ -53970,7 +53970,7 @@ SQLITE_PRIVATE void *sqlite3PagerGetData(DbPage *pPg){ } /* -** Return a pointer to the Pager.nExtra bytes of "extra" space +** Return a pointer to the Pager.nExtra bytes of "extra" space ** allocated along with the specified page. */ SQLITE_PRIVATE void *sqlite3PagerGetExtra(DbPage *pPg){ @@ -53979,7 +53979,7 @@ SQLITE_PRIVATE void *sqlite3PagerGetExtra(DbPage *pPg){ /* ** Get/set the locking-mode for this pager. Parameter eMode must be one -** of PAGER_LOCKINGMODE_QUERY, PAGER_LOCKINGMODE_NORMAL or +** of PAGER_LOCKINGMODE_QUERY, PAGER_LOCKINGMODE_NORMAL or ** PAGER_LOCKINGMODE_EXCLUSIVE. If the parameter is not _QUERY, then ** the locking-mode is set to the value specified. ** @@ -54034,8 +54034,8 @@ SQLITE_PRIVATE int sqlite3PagerSetJournalMode(Pager *pPager, int eMode){ assert( eMode==PAGER_JOURNALMODE_DELETE || eMode==PAGER_JOURNALMODE_TRUNCATE || eMode==PAGER_JOURNALMODE_PERSIST - || eMode==PAGER_JOURNALMODE_OFF - || eMode==PAGER_JOURNALMODE_WAL + || eMode==PAGER_JOURNALMODE_OFF + || eMode==PAGER_JOURNALMODE_WAL || eMode==PAGER_JOURNALMODE_MEMORY ); /* This routine is only called from the OP_JournalMode opcode, and @@ -54220,7 +54220,7 @@ static int pagerExclusiveLock(Pager *pPager){ assert( pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK ); rc = pagerLockDb(pPager, EXCLUSIVE_LOCK); if( rc!=SQLITE_OK ){ - /* If the attempt to grab the exclusive lock failed, release the + /* If the attempt to grab the exclusive lock failed, release the ** pending lock that may have been obtained instead. */ pagerUnlockDb(pPager, SHARED_LOCK); } @@ -54229,7 +54229,7 @@ static int pagerExclusiveLock(Pager *pPager){ } /* -** Call sqlite3WalOpen() to open the WAL handle. If the pager is in +** Call sqlite3WalOpen() to open the WAL handle. If the pager is in ** exclusive-locking mode when this function is called, take an EXCLUSIVE ** lock on the database file and use heap-memory to store the wal-index ** in. Otherwise, use the normal shared-memory. @@ -54240,8 +54240,8 @@ static int pagerOpenWal(Pager *pPager){ assert( pPager->pWal==0 && pPager->tempFile==0 ); assert( pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK ); - /* If the pager is already in exclusive-mode, the WAL module will use - ** heap-memory for the wal-index instead of the VFS shared-memory + /* If the pager is already in exclusive-mode, the WAL module will use + ** heap-memory for the wal-index instead of the VFS shared-memory ** implementation. Take the exclusive lock now, before opening the WAL ** file, to make sure this is safe. */ @@ -54249,7 +54249,7 @@ static int pagerOpenWal(Pager *pPager){ rc = pagerExclusiveLock(pPager); } - /* Open the connection to the log file. If this operation fails, + /* Open the connection to the log file. If this operation fails, ** (e.g. due to malloc() failure), return an error code. */ if( rc==SQLITE_OK ){ @@ -54271,7 +54271,7 @@ static int pagerOpenWal(Pager *pPager){ ** If the pager passed as the first argument is open on a real database ** file (not a temp file or an in-memory database), and the WAL file ** is not already open, make an attempt to open it now. If successful, -** return SQLITE_OK. If an error occurs or the VFS used by the pager does +** return SQLITE_OK. If an error occurs or the VFS used by the pager does ** not support the xShmXXX() methods, return an error code. *pbOpen is ** not modified in either case. ** @@ -54313,7 +54313,7 @@ SQLITE_PRIVATE int sqlite3PagerOpenWal( ** This function is called to close the connection to the log file prior ** to switching from WAL to rollback mode. ** -** Before closing the log file, this function attempts to take an +** Before closing the log file, this function attempts to take an ** EXCLUSIVE lock on the database file. If this cannot be obtained, an ** error (SQLITE_BUSY) is returned and the log connection is not closed. ** If successful, the EXCLUSIVE lock is not released before returning. @@ -54339,7 +54339,7 @@ SQLITE_PRIVATE int sqlite3PagerCloseWal(Pager *pPager, sqlite3 *db){ rc = pagerOpenWal(pPager); } } - + /* Checkpoint and close the log. Because an EXCLUSIVE lock is held on ** the database file, the log and log-summary files will be deleted. */ @@ -54371,7 +54371,7 @@ SQLITE_PRIVATE int sqlite3PagerSnapshotGet(Pager *pPager, sqlite3_snapshot **ppS /* ** If this is a WAL database, store a pointer to pSnapshot. Next time a -** read transaction is opened, attempt to read from the snapshot it +** read transaction is opened, attempt to read from the snapshot it ** identifies. If this is not a WAL database, return an error. */ SQLITE_PRIVATE int sqlite3PagerSnapshotOpen(Pager *pPager, sqlite3_snapshot *pSnapshot){ @@ -54385,7 +54385,7 @@ SQLITE_PRIVATE int sqlite3PagerSnapshotOpen(Pager *pPager, sqlite3_snapshot *pSn } /* -** If this is a WAL database, call sqlite3WalSnapshotRecover(). If this +** If this is a WAL database, call sqlite3WalSnapshotRecover(). If this ** is not a WAL database, return an error. */ SQLITE_PRIVATE int sqlite3PagerSnapshotRecover(Pager *pPager){ @@ -54430,7 +54430,7 @@ SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){ ** ************************************************************************* ** -** This file contains the implementation of a write-ahead log (WAL) used in +** This file contains the implementation of a write-ahead log (WAL) used in ** "journal_mode=WAL" mode. ** ** WRITE-AHEAD LOG (WAL) FILE FORMAT @@ -54439,7 +54439,7 @@ SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){ ** Each frame records the revised content of a single page from the ** database file. All changes to the database are recorded by writing ** frames into the WAL. Transactions commit when a frame is written that -** contains a commit marker. A single WAL can and usually does record +** contains a commit marker. A single WAL can and usually does record ** multiple transactions. Periodically, the content of the WAL is ** transferred back into the database file in an operation called a ** "checkpoint". @@ -54465,11 +54465,11 @@ SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){ ** ** Immediately following the wal-header are zero or more frames. Each ** frame consists of a 24-byte frame-header followed by a bytes -** of page data. The frame-header is six big-endian 32-bit unsigned +** of page data. The frame-header is six big-endian 32-bit unsigned ** integer values, as follows: ** ** 0: Page number. -** 4: For commit records, the size of the database image in pages +** 4: For commit records, the size of the database image in pages ** after the commit. For all other records, zero. ** 8: Salt-1 (copied from the header) ** 12: Salt-2 (copied from the header) @@ -54495,7 +54495,7 @@ SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){ ** the checksum. The checksum is computed by interpreting the input as ** an even number of unsigned 32-bit integers: x[0] through x[N]. The ** algorithm used for the checksum is as follows: -** +** ** for i from 0 to n-1 step 2: ** s0 += x[i] + s1; ** s1 += x[i+1] + s0; @@ -54503,7 +54503,7 @@ SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){ ** ** Note that s0 and s1 are both weighted checksums using fibonacci weights ** in reverse order (the largest fibonacci weight occurs on the first element -** of the sequence being summed.) The s1 value spans all 32-bit +** of the sequence being summed.) The s1 value spans all 32-bit ** terms of the sequence whereas s0 omits the final term. ** ** On a checkpoint, the WAL is first VFS.xSync-ed, then valid content of the @@ -54536,19 +54536,19 @@ SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){ ** multiple concurrent readers to view different versions of the database ** content simultaneously. ** -** The reader algorithm in the previous paragraphs works correctly, but +** The reader algorithm in the previous paragraphs works correctly, but ** because frames for page P can appear anywhere within the WAL, the ** reader has to scan the entire WAL looking for page P frames. If the ** WAL is large (multiple megabytes is typical) that scan can be slow, ** and read performance suffers. To overcome this problem, a separate ** data structure called the wal-index is maintained to expedite the ** search for frames of a particular page. -** +** ** WAL-INDEX FORMAT ** ** Conceptually, the wal-index is shared memory, though VFS implementations ** might choose to implement the wal-index using a mmapped file. Because -** the wal-index is shared memory, SQLite does not support journal_mode=WAL +** the wal-index is shared memory, SQLite does not support journal_mode=WAL ** on a network filesystem. All users of the database must be able to ** share memory. ** @@ -54562,28 +54562,28 @@ SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){ ** byte order of the host computer. ** ** The purpose of the wal-index is to answer this question quickly: Given -** a page number P and a maximum frame index M, return the index of the +** a page number P and a maximum frame index M, return the index of the ** last frame in the wal before frame M for page P in the WAL, or return ** NULL if there are no frames for page P in the WAL prior to M. ** ** The wal-index consists of a header region, followed by an one or -** more index blocks. +** more index blocks. ** ** The wal-index header contains the total number of frames within the WAL ** in the mxFrame field. ** -** Each index block except for the first contains information on +** Each index block except for the first contains information on ** HASHTABLE_NPAGE frames. The first index block contains information on -** HASHTABLE_NPAGE_ONE frames. The values of HASHTABLE_NPAGE_ONE and +** HASHTABLE_NPAGE_ONE frames. The values of HASHTABLE_NPAGE_ONE and ** HASHTABLE_NPAGE are selected so that together the wal-index header and ** first index block are the same size as all other index blocks in the ** wal-index. ** ** Each index block contains two sections, a page-mapping that contains the -** database page number associated with each wal frame, and a hash-table +** database page number associated with each wal frame, and a hash-table ** that allows readers to query an index block for a specific page number. ** The page-mapping is an array of HASHTABLE_NPAGE (or HASHTABLE_NPAGE_ONE -** for the first index block) 32-bit page numbers. The first entry in the +** for the first index block) 32-bit page numbers. The first entry in the ** first index-block contains the database page number corresponding to the ** first frame in the WAL file. The first entry in the second index block ** in the WAL file corresponds to the (HASHTABLE_NPAGE_ONE+1)th frame in @@ -54604,8 +54604,8 @@ SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){ ** ** The hash table consists of HASHTABLE_NSLOT 16-bit unsigned integers. ** HASHTABLE_NSLOT = 2*HASHTABLE_NPAGE, and there is one entry in the -** hash table for each page number in the mapping section, so the hash -** table is never more than half full. The expected number of collisions +** hash table for each page number in the mapping section, so the hash +** table is never more than half full. The expected number of collisions ** prior to finding a match is 1. Each entry of the hash table is an ** 1-based index of an entry in the mapping section of the same ** index block. Let K be the 1-based index of the largest entry in @@ -54624,12 +54624,12 @@ SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){ ** reached) until an unused hash slot is found. Let the first unused slot ** be at index iUnused. (iUnused might be less than iKey if there was ** wrap-around.) Because the hash table is never more than half full, -** the search is guaranteed to eventually hit an unused entry. Let +** the search is guaranteed to eventually hit an unused entry. Let ** iMax be the value between iKey and iUnused, closest to iUnused, ** where aHash[iMax]==P. If there is no iMax entry (if there exists ** no hash slot such that aHash[i]==p) then page P is not in the ** current index block. Otherwise the iMax-th mapping entry of the -** current index block corresponds to the last entry that references +** current index block corresponds to the last entry that references ** page P. ** ** A hash search begins with the last index block and moves toward the @@ -54654,7 +54654,7 @@ SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){ ** if no values greater than K0 had ever been inserted into the hash table ** in the first place - which is what reader one wants. Meanwhile, the ** second reader using K1 will see additional values that were inserted -** later, which is exactly what reader two wants. +** later, which is exactly what reader two wants. ** ** When a rollback occurs, the value of K is decreased. Hash table entries ** that correspond to frames greater than the new K value are removed @@ -54682,7 +54682,7 @@ SQLITE_PRIVATE int sqlite3WalTrace = 0; ** values in the wal-header are correct and (b) the version field is not ** WAL_MAX_VERSION, recovery fails and SQLite returns SQLITE_CANTOPEN. ** -** Similarly, if a client successfully reads a wal-index header (i.e. the +** Similarly, if a client successfully reads a wal-index header (i.e. the ** checksum test is successful) and finds that the version field is not ** WALINDEX_MAX_VERSION, then no read-transaction is opened and SQLite ** returns SQLITE_CANTOPEN. @@ -54720,7 +54720,7 @@ typedef struct WalCkptInfo WalCkptInfo; ** ** The szPage value can be any power of 2 between 512 and 32768, inclusive. ** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. +** added in 3.7.1 when support for 64K pages was added. */ struct WalIndexHdr { u32 iVersion; /* Wal-index version */ @@ -54762,7 +54762,7 @@ struct WalIndexHdr { ** There is one entry in aReadMark[] for each reader lock. If a reader ** holds read-lock K, then the value in aReadMark[K] is no greater than ** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is +** for any aReadMark[] means that entry is unused. aReadMark[0] is ** a special case; its value is never used and it exists as a place-holder ** to avoid having to offset aReadMark[] indexs by one. Readers holding ** WAL_READ_LOCK(0) always ignore the entire WAL and read all content @@ -54782,7 +54782,7 @@ struct WalIndexHdr { ** previous sentence is when nBackfill equals mxFrame (meaning that everything ** in the WAL has been backfilled into the database) then new readers ** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore +** get all their all content directly from the database file and ignore ** the WAL. ** ** Writers normally append new frames to the end of the WAL. However, @@ -54825,14 +54825,14 @@ struct WalCkptInfo { ** big-endian format in the first 4 bytes of a WAL file. ** ** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting +** file are calculated by treating all data as an array of 32-bit +** big-endian words. Otherwise, they are calculated by interpreting ** all data as 32-bit little-endian words. */ #define WAL_MAGIC 0x377f0682 /* -** Return the offset of frame iFrame in the write-ahead log file, +** Return the offset of frame iFrame in the write-ahead log file, ** assuming a database page size of szPage bytes. The offset returned ** is to the start of the write-ahead log frame-header. */ @@ -54880,7 +54880,7 @@ struct Wal { ** Candidate values for Wal.exclusiveMode. */ #define WAL_NORMAL_MODE 0 -#define WAL_EXCLUSIVE_MODE 1 +#define WAL_EXCLUSIVE_MODE 1 #define WAL_HEAPMEMORY_MODE 2 /* @@ -54899,7 +54899,7 @@ typedef u16 ht_slot; /* ** This structure is used to implement an iterator that loops through ** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the +** correspond to the same database page, the iterator visits only the ** frame most recently written to the WAL (in other words, the frame with ** the largest index). ** @@ -54935,7 +54935,7 @@ struct WalIterator { #define HASHTABLE_HASH_1 383 /* Should be prime */ #define HASHTABLE_NSLOT (HASHTABLE_NPAGE*2) /* Must be a power of 2 */ -/* +/* ** The block of page numbers associated with the first hash-table in a ** wal-index is smaller than usual. This is so that there is a complete ** hash-table on each aligned 32KB page of the wal-index. @@ -54980,7 +54980,7 @@ static int walIndexPage(Wal *pWal, int iPage, volatile u32 **ppPage){ pWal->apWiData[iPage] = (u32 volatile *)sqlite3MallocZero(WALINDEX_PGSZ); if( !pWal->apWiData[iPage] ) rc = SQLITE_NOMEM_BKPT; }else{ - rc = sqlite3OsShmMap(pWal->pDbFd, iPage, WALINDEX_PGSZ, + rc = sqlite3OsShmMap(pWal->pDbFd, iPage, WALINDEX_PGSZ, pWal->writeLock, (void volatile **)&pWal->apWiData[iPage] ); if( rc==SQLITE_READONLY ){ @@ -55024,7 +55024,7 @@ static volatile WalIndexHdr *walIndexHdr(Wal *pWal){ ) /* -** Generate or extend an 8 byte checksum based on the data in +** Generate or extend an 8 byte checksum based on the data in ** array aByte[] and the initial values of aIn[0] and aIn[1] (or ** initial values of 0 and 0 if aIn==NULL). ** @@ -55096,11 +55096,11 @@ static void walIndexWriteHdr(Wal *pWal){ /* ** This function encodes a single frame header and writes it to a buffer -** supplied by the caller. A frame-header is made up of a series of +** supplied by the caller. A frame-header is made up of a series of ** 4-byte big-endian integers, as follows: ** ** 0: Page number. -** 4: For commit records, the size of the database image in pages +** 4: For commit records, the size of the database image in pages ** after the commit. For all other records, zero. ** 8: Salt-1 (copied from the wal-header) ** 12: Salt-2 (copied from the wal-header) @@ -55151,7 +55151,7 @@ static int walDecodeFrame( assert( WAL_FRAME_HDRSIZE==24 ); /* A frame is only valid if the salt values in the frame-header - ** match the salt values in the wal-header. + ** match the salt values in the wal-header. */ if( memcmp(&pWal->hdr.aSalt, &aFrame[8], 8)!=0 ){ return 0; @@ -55165,15 +55165,15 @@ static int walDecodeFrame( } /* A frame is only valid if a checksum of the WAL header, - ** all prior frams, the first 16 bytes of this frame-header, - ** and the frame-data matches the checksum in the last 8 + ** all prior frams, the first 16 bytes of this frame-header, + ** and the frame-data matches the checksum in the last 8 ** bytes of this frame-header. */ nativeCksum = (pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN); walChecksumBytes(nativeCksum, aFrame, 8, aCksum, aCksum); walChecksumBytes(nativeCksum, aData, pWal->szPage, aCksum, aCksum); - if( aCksum[0]!=sqlite3Get4byte(&aFrame[16]) - || aCksum[1]!=sqlite3Get4byte(&aFrame[20]) + if( aCksum[0]!=sqlite3Get4byte(&aFrame[16]) + || aCksum[1]!=sqlite3Get4byte(&aFrame[20]) ){ /* Checksum failed. */ return 0; @@ -55208,7 +55208,7 @@ static const char *walLockName(int lockIdx){ } } #endif /*defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */ - + /* ** Set or release locks on the WAL. Locks are either shared or exclusive. @@ -55265,15 +55265,15 @@ static int walNextHash(int iPriorHash){ return (iPriorHash+1)&(HASHTABLE_NSLOT-1); } -/* +/* ** Return pointers to the hash table and page number array stored on ** page iHash of the wal-index. The wal-index is broken into 32KB pages ** numbered starting from 0. ** ** Set output variable *paHash to point to the start of the hash table -** in the wal-index file. Set *piZero to one less than the frame +** in the wal-index file. Set *piZero to one less than the frame ** number of the first frame indexed by this hash table. If a -** slot in the hash table is set to N, it refers to frame number +** slot in the hash table is set to N, it refers to frame number ** (*piZero+N) in the log. ** ** Finally, set *paPgno so that *paPgno[1] is the page number of the @@ -55303,7 +55303,7 @@ static int walHashGet( }else{ iZero = HASHTABLE_NPAGE_ONE + (iHash-1)*HASHTABLE_NPAGE; } - + *paPgno = &aPgno[-1]; *paHash = aHash; *piZero = iZero; @@ -55314,7 +55314,7 @@ static int walHashGet( /* ** Return the number of the wal-index page that contains the hash-table ** and page-number array that contain entries corresponding to WAL frame -** iFrame. The wal-index is broken up into 32KB pages. Wal-index pages +** iFrame. The wal-index is broken up into 32KB pages. Wal-index pages ** are numbered starting from 0. */ static int walFramePage(u32 iFrame){ @@ -55366,7 +55366,7 @@ static void walCleanupHash(Wal *pWal){ if( pWal->hdr.mxFrame==0 ) return; - /* Obtain pointers to the hash-table and page-number array containing + /* Obtain pointers to the hash-table and page-number array containing ** the entry that corresponds to frame pWal->hdr.mxFrame. It is guaranteed ** that the page said hash-table and array reside on is already mapped. */ @@ -55384,9 +55384,9 @@ static void walCleanupHash(Wal *pWal){ aHash[i] = 0; } } - + /* Zero the entries in the aPgno array that correspond to frames with - ** frame numbers greater than pWal->hdr.mxFrame. + ** frame numbers greater than pWal->hdr.mxFrame. */ nByte = (int)((char *)aHash - (char *)&aPgno[iLimit+1]); memset((void *)&aPgno[iLimit+1], 0, nByte); @@ -55431,9 +55431,9 @@ static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){ idx = iFrame - iZero; assert( idx <= HASHTABLE_NSLOT/2 + 1 ); - + /* If this is the first entry to be added to this hash-table, zero the - ** entire hash table and aPgno[] array before proceeding. + ** entire hash table and aPgno[] array before proceeding. */ if( idx==1 ){ int nByte = (int)((u8 *)&aHash[HASHTABLE_NSLOT] - (u8 *)&aPgno[1]); @@ -55442,8 +55442,8 @@ static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){ /* If the entry in aPgno[] is already set, then the previous writer ** must have exited unexpectedly in the middle of a transaction (after - ** writing one or more dirty pages to the WAL to free up memory). - ** Remove the remnants of that writers uncommitted transaction from + ** writing one or more dirty pages to the WAL to free up memory). + ** Remove the remnants of that writers uncommitted transaction from ** the hash-table before writing any new entries. */ if( aPgno[idx] ){ @@ -55493,7 +55493,7 @@ static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){ /* -** Recover the wal-index by reading the write-ahead log file. +** Recover the wal-index by reading the write-ahead log file. ** ** This routine first tries to establish an exclusive lock on the ** wal-index to prevent other threads/processes from doing anything @@ -55553,16 +55553,16 @@ static int walIndexRecover(Wal *pWal){ } /* If the database page size is not a power of two, or is greater than - ** SQLITE_MAX_PAGE_SIZE, conclude that the WAL file contains no valid + ** SQLITE_MAX_PAGE_SIZE, conclude that the WAL file contains no valid ** data. Similarly, if the 'magic' value is invalid, ignore the whole ** WAL file. */ magic = sqlite3Get4byte(&aBuf[0]); szPage = sqlite3Get4byte(&aBuf[8]); - if( (magic&0xFFFFFFFE)!=WAL_MAGIC - || szPage&(szPage-1) - || szPage>SQLITE_MAX_PAGE_SIZE - || szPage<512 + if( (magic&0xFFFFFFFE)!=WAL_MAGIC + || szPage&(szPage-1) + || szPage>SQLITE_MAX_PAGE_SIZE + || szPage<512 ){ goto finished; } @@ -55572,7 +55572,7 @@ static int walIndexRecover(Wal *pWal){ memcpy(&pWal->hdr.aSalt, &aBuf[16], 8); /* Verify that the WAL header checksum is correct */ - walChecksumBytes(pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN, + walChecksumBytes(pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN, aBuf, WAL_HDRSIZE-2*4, 0, pWal->hdr.aFrameCksum ); if( pWal->hdr.aFrameCksum[0]!=sqlite3Get4byte(&aBuf[24]) @@ -55636,7 +55636,7 @@ finished: pWal->hdr.aFrameCksum[1] = aFrameCksum[1]; walIndexWriteHdr(pWal); - /* Reset the checkpoint-header. This is safe because this thread is + /* Reset the checkpoint-header. This is safe because this thread is ** currently holding locks that exclude all other readers, writers and ** checkpointers. */ @@ -55681,8 +55681,8 @@ static void walIndexClose(Wal *pWal, int isDelete){ } } -/* -** Open a connection to the WAL file zWalName. The database file must +/* +** Open a connection to the WAL file zWalName. The database file must ** already be opened on connection pDbFd. The buffer that zWalName points ** to must remain valid for the lifetime of the returned Wal* handle. ** @@ -55692,7 +55692,7 @@ static void walIndexClose(Wal *pWal, int isDelete){ ** were to do this just after this client opened one of these files, the ** system would be badly broken. ** -** If the log file is successfully opened, SQLITE_OK is returned and +** If the log file is successfully opened, SQLITE_OK is returned and ** *ppWal is set to point to a new WAL handle. If an error occurs, ** an SQLite error code is returned and *ppWal is left unmodified. */ @@ -55856,7 +55856,7 @@ static void walMerge( ht_slot logpage; Pgno dbpage; - if( (iLeft=nRight || aContent[aLeft[iLeft]]aSegment[p->nSegment])[iZero]; iZero++; - + for(j=0; jaReadMark[i]; if( mxSafeFrame>y ){ @@ -56282,8 +56282,8 @@ static int walCheckpoint( } /* If this is an SQLITE_CHECKPOINT_RESTART or TRUNCATE operation, and the - ** entire wal file has been copied into the database file, then block - ** until all readers have finished using the wal file. This ensures that + ** entire wal file has been copied into the database file, then block + ** until all readers have finished using the wal file. This ensures that ** the next process to write to the database restarts the wal file. */ if( rc==SQLITE_OK && eMode!=SQLITE_CHECKPOINT_PASSIVE ){ @@ -56307,7 +56307,7 @@ static int walCheckpoint( ** writer clients should see that the entire log file has been ** checkpointed and behave accordingly. This seems unsafe though, ** as it would leave the system in a state where the contents of - ** the wal-index header do not match the contents of the + ** the wal-index header do not match the contents of the ** file-system. To avoid this, update the wal-index header to ** indicate that the log file contains zero valid frames. */ walRestartHdr(pWal, salt1); @@ -56369,7 +56369,7 @@ SQLITE_PRIVATE int sqlite3WalClose( if( pWal->exclusiveMode==WAL_NORMAL_MODE ){ pWal->exclusiveMode = WAL_EXCLUSIVE_MODE; } - rc = sqlite3WalCheckpoint(pWal, db, + rc = sqlite3WalCheckpoint(pWal, db, SQLITE_CHECKPOINT_PASSIVE, 0, 0, sync_flags, nBuf, zBuf, 0, 0 ); if( rc==SQLITE_OK ){ @@ -56450,7 +56450,7 @@ static int walIndexTryHdr(Wal *pWal, int *pChanged){ if( memcmp(&h1, &h2, sizeof(h1))!=0 ){ return 1; /* Dirty read */ - } + } if( h1.isInit==0 ){ return 1; /* Malformed header - probably all zeros */ } @@ -56480,7 +56480,7 @@ static int walIndexTryHdr(Wal *pWal, int *pChanged){ ** changed by this operation. If pWal->hdr is unchanged, set *pChanged ** to 0. ** -** If the wal-index header is successfully read, return SQLITE_OK. +** If the wal-index header is successfully read, return SQLITE_OK. ** Otherwise an SQLite error code. */ static int walIndexReadHdr(Wal *pWal, int *pChanged){ @@ -56488,7 +56488,7 @@ static int walIndexReadHdr(Wal *pWal, int *pChanged){ int badHdr; /* True if a header read failed */ volatile u32 *page0; /* Chunk of wal-index containing header */ - /* Ensure that page 0 of the wal-index (the page that contains the + /* Ensure that page 0 of the wal-index (the page that contains the ** wal-index header) is mapped. Return early if an error occurs here. */ assert( pChanged ); @@ -56500,7 +56500,7 @@ static int walIndexReadHdr(Wal *pWal, int *pChanged){ /* If the first page of the wal-index has been mapped, try to read the ** wal-index header immediately, without holding any lock. This usually - ** works, but may fail if the wal-index header is corrupt or currently + ** works, but may fail if the wal-index header is corrupt or currently ** being modified by another thread or process. */ badHdr = (page0 ? walIndexTryHdr(pWal, pChanged) : 1); @@ -56561,10 +56561,10 @@ static int walIndexReadHdr(Wal *pWal, int *pChanged){ ** ** The useWal parameter is true to force the use of the WAL and disable ** the case where the WAL is bypassed because it has been completely -** checkpointed. If useWal==0 then this routine calls walIndexReadHdr() -** to make a copy of the wal-index header into pWal->hdr. If the -** wal-index header has changed, *pChanged is set to 1 (as an indication -** to the caller that the local paget cache is obsolete and needs to be +** checkpointed. If useWal==0 then this routine calls walIndexReadHdr() +** to make a copy of the wal-index header into pWal->hdr. If the +** wal-index header has changed, *pChanged is set to 1 (as an indication +** to the caller that the local paget cache is obsolete and needs to be ** flushed.) When useWal==1, the wal-index header is assumed to already ** be loaded and the pChanged parameter is unused. ** @@ -56579,7 +56579,7 @@ static int walIndexReadHdr(Wal *pWal, int *pChanged){ ** bad luck when there is lots of contention for the wal-index, but that ** possibility is so small that it can be safely neglected, we believe. ** -** On success, this routine obtains a read lock on +** On success, this routine obtains a read lock on ** WAL_READ_LOCK(pWal->readLock). The pWal->readLock integer is ** in the range 0 <= pWal->readLock < WAL_NREADER. If pWal->readLock==(-1) ** that means the Wal does not hold any read lock. The reader must not @@ -56614,16 +56614,16 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ ** ** Circumstances that cause a RETRY should only last for the briefest ** instances of time. No I/O or other system calls are done while the - ** locks are held, so the locks should not be held for very long. But + ** locks are held, so the locks should not be held for very long. But ** if we are unlucky, another process that is holding a lock might get - ** paged out or take a page-fault that is time-consuming to resolve, + ** paged out or take a page-fault that is time-consuming to resolve, ** during the few nanoseconds that it is holding the lock. In that case, ** it might take longer than normal for the lock to free. ** ** After 5 RETRYs, we begin calling sqlite3OsSleep(). The first few ** calls to sqlite3OsSleep() have a delay of 1 microsecond. Really this ** is more of a scheduler yield than an actual delay. But on the 10th - ** an subsequent retries, the delays start becoming longer and longer, + ** an subsequent retries, the delays start becoming longer and longer, ** so that on the 100th (and last) RETRY we delay for 323 milliseconds. ** The total delay time before giving up is less than 10 seconds. */ @@ -56651,9 +56651,9 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ if( pWal->apWiData[0]==0 ){ /* This branch is taken when the xShmMap() method returns SQLITE_BUSY. ** We assume this is a transient condition, so return WAL_RETRY. The - ** xShmMap() implementation used by the default unix and win32 VFS - ** modules may return SQLITE_BUSY due to a race condition in the - ** code that determines whether or not the shared-memory region + ** xShmMap() implementation used by the default unix and win32 VFS + ** modules may return SQLITE_BUSY due to a race condition in the + ** code that determines whether or not the shared-memory region ** must be zeroed before the requested page is returned. */ rc = WAL_RETRY; @@ -56670,7 +56670,7 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ } pInfo = walCkptInfo(pWal); - if( !useWal && pInfo->nBackfill==pWal->hdr.mxFrame + if( !useWal && pInfo->nBackfill==pWal->hdr.mxFrame #ifdef SQLITE_ENABLE_SNAPSHOT && (pWal->pSnapshot==0 || pWal->hdr.mxFrame==0 || 0==memcmp(&pWal->hdr, pWal->pSnapshot, sizeof(WalIndexHdr))) @@ -56690,7 +56690,7 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ ** snapshot. Since holding READ_LOCK(0) prevents a checkpoint from ** happening, this is usually correct. ** - ** However, if frames have been appended to the log (or if the log + ** However, if frames have been appended to the log (or if the log ** is wrapped and written for that matter) before the READ_LOCK(0) ** is obtained, that is not necessarily true. A checkpointer may ** have started to backfill the appended frames but crashed before @@ -56771,9 +56771,9 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ ** to read any frames earlier than minFrame from the wal file - they ** can be safely read directly from the database file. ** - ** Because a ShmBarrier() call is made between taking the copy of + ** Because a ShmBarrier() call is made between taking the copy of ** nBackfill and checking that the wal-header in shared-memory still - ** matches the one cached in pWal->hdr, it is guaranteed that the + ** matches the one cached in pWal->hdr, it is guaranteed that the ** checkpointer that set nBackfill was not working with a wal-index ** header newer than that cached in pWal->hdr. If it were, that could ** cause a problem. The checkpointer could omit to checkpoint @@ -56801,15 +56801,15 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ #ifdef SQLITE_ENABLE_SNAPSHOT /* -** Attempt to reduce the value of the WalCkptInfo.nBackfillAttempted +** Attempt to reduce the value of the WalCkptInfo.nBackfillAttempted ** variable so that older snapshots can be accessed. To do this, loop -** through all wal frames from nBackfillAttempted to (nBackfill+1), +** through all wal frames from nBackfillAttempted to (nBackfill+1), ** comparing their content to the corresponding page with the database ** file, if any. Set nBackfillAttempted to the frame number of the ** first frame for which the wal file content matches the db file. ** -** This is only really safe if the file-system is such that any page -** writes made by earlier checkpointers were atomic operations, which +** This is only really safe if the file-system is such that any page +** writes made by earlier checkpointers were atomic operations, which ** is not always true. It is also possible that nBackfillAttempted ** may be left set to a value larger than expected, if a wal frame ** contains content that duplicate of an earlier version of the same @@ -56932,14 +56932,14 @@ SQLITE_PRIVATE int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){ assert( pWal->readLock>0 || pWal->hdr.mxFrame==0 ); assert( pInfo->aReadMark[pWal->readLock]<=pSnapshot->mxFrame ); - /* It is possible that there is a checkpointer thread running + /* It is possible that there is a checkpointer thread running ** concurrent with this code. If this is the case, it may be that the - ** checkpointer has already determined that it will checkpoint - ** snapshot X, where X is later in the wal file than pSnapshot, but - ** has not yet set the pInfo->nBackfillAttempted variable to indicate + ** checkpointer has already determined that it will checkpoint + ** snapshot X, where X is later in the wal file than pSnapshot, but + ** has not yet set the pInfo->nBackfillAttempted variable to indicate ** its intent. To avoid the race condition this leads to, ensure that - ** there is no checkpointer process by taking a shared CKPT lock - ** before checking pInfo->nBackfillAttempted. + ** there is no checkpointer process by taking a shared CKPT lock + ** before checking pInfo->nBackfillAttempted. ** ** TODO: Does the aReadMark[] lock prevent a checkpointer from doing ** this already? @@ -57012,8 +57012,8 @@ SQLITE_PRIVATE int sqlite3WalFindFrame( /* If the "last page" field of the wal-index header snapshot is 0, then ** no data will be read from the wal under any circumstances. Return early - ** in this case as an optimization. Likewise, if pWal->readLock==0, - ** then the WAL is ignored by the reader so return early, as if the + ** in this case as an optimization. Likewise, if pWal->readLock==0, + ** then the WAL is ignored by the reader so return early, as if the ** WAL were empty. */ if( iLast==0 || pWal->readLock==0 ){ @@ -57026,9 +57026,9 @@ SQLITE_PRIVATE int sqlite3WalFindFrame( ** hash table (each hash table indexes up to HASHTABLE_NPAGE frames). ** ** This code might run concurrently to the code in walIndexAppend() - ** that adds entries to the wal-index (and possibly to this hash - ** table). This means the value just read from the hash - ** slot (aHash[iKey]) may have been added before or after the + ** that adds entries to the wal-index (and possibly to this hash + ** table). This means the value just read from the hash + ** slot (aHash[iKey]) may have been added before or after the ** current read transaction was opened. Values added after the ** read transaction was opened may have been written incorrectly - ** i.e. these slots may contain garbage data. However, we assume @@ -57036,13 +57036,13 @@ SQLITE_PRIVATE int sqlite3WalFindFrame( ** opened remain unmodified. ** ** For the reasons above, the if(...) condition featured in the inner - ** loop of the following block is more stringent that would be required + ** loop of the following block is more stringent that would be required ** if we had exclusive access to the hash-table: ** - ** (aPgno[iFrame]==pgno): + ** (aPgno[iFrame]==pgno): ** This condition filters out normal hash-table collisions. ** - ** (iFrame<=iLast): + ** (iFrame<=iLast): ** This condition filters out entries that were added to the hash ** table after the current read-transaction had started. */ @@ -57116,7 +57116,7 @@ SQLITE_PRIVATE int sqlite3WalReadFrame( return sqlite3OsRead(pWal->pWalFd, pOut, (nOut>sz ? sz : nOut), iOffset); } -/* +/* ** Return the size of the database in pages (or zero, if unknown). */ SQLITE_PRIVATE Pgno sqlite3WalDbsize(Wal *pWal){ @@ -57127,7 +57127,7 @@ SQLITE_PRIVATE Pgno sqlite3WalDbsize(Wal *pWal){ } -/* +/* ** This function starts a write transaction on the WAL. ** ** A read transaction must have already been started by a prior call @@ -57205,18 +57205,18 @@ SQLITE_PRIVATE int sqlite3WalUndo(Wal *pWal, int (*xUndo)(void *, Pgno), void *p if( ALWAYS(pWal->writeLock) ){ Pgno iMax = pWal->hdr.mxFrame; Pgno iFrame; - + /* Restore the clients cache of the wal-index header to the state it - ** was in before the client began writing to the database. + ** was in before the client began writing to the database. */ memcpy(&pWal->hdr, (void *)walIndexHdr(pWal), sizeof(WalIndexHdr)); - for(iFrame=pWal->hdr.mxFrame+1; - ALWAYS(rc==SQLITE_OK) && iFrame<=iMax; + for(iFrame=pWal->hdr.mxFrame+1; + ALWAYS(rc==SQLITE_OK) && iFrame<=iMax; iFrame++ ){ /* This call cannot fail. Unless the page for which the page number - ** is passed as the second argument is (a) in the cache and + ** is passed as the second argument is (a) in the cache and ** (b) has an outstanding reference, then xUndo is either a no-op ** (if (a) is false) or simply expels the page from the cache (if (b) ** is false). @@ -57234,10 +57234,10 @@ SQLITE_PRIVATE int sqlite3WalUndo(Wal *pWal, int (*xUndo)(void *, Pgno), void *p return rc; } -/* -** Argument aWalData must point to an array of WAL_SAVEPOINT_NDATA u32 -** values. This function populates the array with values required to -** "rollback" the write position of the WAL handle back to the current +/* +** Argument aWalData must point to an array of WAL_SAVEPOINT_NDATA u32 +** values. This function populates the array with values required to +** "rollback" the write position of the WAL handle back to the current ** point in the event of a savepoint rollback (via WalSavepointUndo()). */ SQLITE_PRIVATE void sqlite3WalSavepoint(Wal *pWal, u32 *aWalData){ @@ -57248,7 +57248,7 @@ SQLITE_PRIVATE void sqlite3WalSavepoint(Wal *pWal, u32 *aWalData){ aWalData[3] = pWal->nCkpt; } -/* +/* ** Move the write position of the WAL back to the point identified by ** the values in the aWalData[] array. aWalData must point to an array ** of WAL_SAVEPOINT_NDATA u32 values that has been previously populated @@ -57454,7 +57454,7 @@ static int walRewriteChecksums(Wal *pWal, u32 iLast){ return rc; } -/* +/* ** Write a set of frames to the log. The caller must hold the write-lock ** on the log file (obtained using sqlite3WalBeginWriteTransaction()). */ @@ -57521,7 +57521,7 @@ SQLITE_PRIVATE int sqlite3WalFrames( walChecksumBytes(1, aWalHdr, WAL_HDRSIZE-2*4, 0, aCksum); sqlite3Put4byte(&aWalHdr[24], aCksum[0]); sqlite3Put4byte(&aWalHdr[28], aCksum[1]); - + pWal->szPage = szPage; pWal->hdr.bigEndCksum = SQLITE_BIGENDIAN; pWal->hdr.aFrameCksum[0] = aCksum[0]; @@ -57563,7 +57563,7 @@ SQLITE_PRIVATE int sqlite3WalFrames( /* Check if this page has already been written into the wal file by ** the current transaction. If so, overwrite the existing frame and - ** set Wal.writeLock to WAL_WRITELOCK_RECKSUM - indicating that + ** set Wal.writeLock to WAL_WRITELOCK_RECKSUM - indicating that ** checksums must be recomputed when the transaction is committed. */ if( iFirst && (p->pDirty || isCommit==0) ){ u32 iWrite = 0; @@ -57650,7 +57650,7 @@ SQLITE_PRIVATE int sqlite3WalFrames( pWal->truncateOnCommit = 0; } - /* Append data to the wal-index. It is not necessary to lock the + /* Append data to the wal-index. It is not necessary to lock the ** wal-index to do this as the SQLITE_SHM_WRITE lock held on the wal-index ** guarantees that there are no other writers, and no data that may ** be in use by existing readers is being overwritten. @@ -57688,7 +57688,7 @@ SQLITE_PRIVATE int sqlite3WalFrames( return rc; } -/* +/* ** This routine is called to implement sqlite3_wal_checkpoint() and ** related interfaces. ** @@ -57725,7 +57725,7 @@ SQLITE_PRIVATE int sqlite3WalCheckpoint( if( pWal->readOnly ) return SQLITE_READONLY; WALTRACE(("WAL%p: checkpoint begins\n", pWal)); - /* IMPLEMENTATION-OF: R-62028-47212 All calls obtain an exclusive + /* IMPLEMENTATION-OF: R-62028-47212 All calls obtain an exclusive ** "checkpoint" lock on the database file. */ rc = walLockExclusive(pWal, WAL_CKPT_LOCK, 1); if( rc ){ @@ -57786,7 +57786,7 @@ SQLITE_PRIVATE int sqlite3WalCheckpoint( } if( isChanged ){ - /* If a new wal-index header was loaded before the checkpoint was + /* If a new wal-index header was loaded before the checkpoint was ** performed, then the pager-cache associated with pWal is now ** out of date. So zero the cached wal-index header to ensure that ** next time the pager opens a snapshot on this database it knows that @@ -57829,7 +57829,7 @@ SQLITE_PRIVATE int sqlite3WalCallback(Wal *pWal){ ** operation must occur while the pager is still holding the exclusive ** lock on the main database file. ** -** If op is one, then change from locking_mode=NORMAL into +** If op is one, then change from locking_mode=NORMAL into ** locking_mode=EXCLUSIVE. This means that the pWal->readLock must ** be released. Return 1 if the transition is made and 0 if the ** WAL is already in exclusive-locking mode - meaning that this @@ -57846,8 +57846,8 @@ SQLITE_PRIVATE int sqlite3WalExclusiveMode(Wal *pWal, int op){ assert( pWal->writeLock==0 ); assert( pWal->exclusiveMode!=WAL_HEAPMEMORY_MODE || op==-1 ); - /* pWal->readLock is usually set, but might be -1 if there was a - ** prior error while attempting to acquire are read-lock. This cannot + /* pWal->readLock is usually set, but might be -1 if there was a + ** prior error while attempting to acquire are read-lock. This cannot ** happen if the connection is actually in exclusive mode (as no xShmLock ** locks are taken in this case). Nor should the pager attempt to ** upgrade to exclusive-mode following such an error. @@ -57878,10 +57878,10 @@ SQLITE_PRIVATE int sqlite3WalExclusiveMode(Wal *pWal, int op){ return rc; } -/* +/* ** Return true if the argument is non-NULL and the WAL module is using ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the -** WAL module is using shared-memory, return false. +** WAL module is using shared-memory, return false. */ SQLITE_PRIVATE int sqlite3WalHeapMemory(Wal *pWal){ return (pWal && pWal->exclusiveMode==WAL_HEAPMEMORY_MODE ); @@ -57920,7 +57920,7 @@ SQLITE_PRIVATE void sqlite3WalSnapshotOpen(Wal *pWal, sqlite3_snapshot *pSnapsho pWal->pSnapshot = (WalIndexHdr*)pSnapshot; } -/* +/* ** Return a +ve value if snapshot p1 is newer than p2. A -ve value if ** p1 is older than p2 and zero if p1 and p2 are the same snapshot. */ @@ -58010,16 +58010,16 @@ SQLITE_PRIVATE sqlite3_file *sqlite3WalFile(Wal *pWal){ ** on Ptr(N) and its subpages have values greater than Key(N-1). And ** so forth. ** -** Finding a particular key requires reading O(log(M)) pages from the +** Finding a particular key requires reading O(log(M)) pages from the ** disk where M is the number of entries in the tree. ** -** In this implementation, a single file can hold one or more separate +** In this implementation, a single file can hold one or more separate ** BTrees. Each BTree is identified by the index of its root page. The ** key and data for any entry are combined to form the "payload". A ** fixed amount of payload can be carried directly on the database ** page. If the payload is larger than the preset amount then surplus ** bytes are stored on overflow pages. The payload for an entry -** and the preceding pointer are combined to form a "Cell". Each +** and the preceding pointer are combined to form a "Cell". Each ** page has a small header which contains the Ptr(N) pointer and other ** information such as the size of key and data. ** @@ -58149,7 +58149,7 @@ SQLITE_PRIVATE sqlite3_file *sqlite3WalFile(Wal *pWal){ ** contiguous or in order, but cell pointers are contiguous and in order. ** ** Cell content makes use of variable length integers. A variable -** length integer is 1 to 9 bytes where the lower 7 bits of each +** length integer is 1 to 9 bytes where the lower 7 bits of each ** byte are used. The integer consists of all bytes that have bit 8 set and ** the first byte with bit 8 clear. The most significant byte of the integer ** appears first. A variable-length integer may not be more than 9 bytes long. @@ -58222,7 +58222,7 @@ typedef struct CellInfo CellInfo; ** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The ** header must be exactly 16 bytes including the zero-terminator so ** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read +** the header, then your custom library will not be able to read ** databases generated by the standard tools and the standard tools ** will not be able to read databases created by your custom library. */ @@ -58285,7 +58285,7 @@ struct MemPage { /* ** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor +** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor ** is opened on the table with root page BtShared.iTable. Locks are removed ** from this list when a transaction is committed or rolled back, or when ** a btree handle is closed. @@ -58309,7 +58309,7 @@ struct BtLock { ** see the internals of this structure and only deals with pointers to ** this structure. ** -** For some database files, the same underlying database cache might be +** For some database files, the same underlying database cache might be ** shared between multiple connections. In that case, each connection ** has it own instance of this object. But each instance of this object ** points to the same BtShared object. The database cache and the @@ -58317,7 +58317,7 @@ struct BtLock { ** the BtShared object. ** ** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors +** The pBt pointer itself may not be changed while there exists cursors ** in the referenced BtShared that point back to this Btree since those ** cursors have to go through this Btree to find their BtShared and ** they often do so without holding sqlite3.mutex. @@ -58352,7 +58352,7 @@ struct Btree { /* ** An instance of this object represents a single database file. -** +** ** A single database file can be in use at the same time by two ** or more database connections. When two or more connections are ** sharing the same database file, each connection has it own @@ -58471,7 +58471,7 @@ struct CellInfo { ** particular database connection identified BtCursor.pBtree.db. ** ** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. +** found at self->pBt->mutex. ** ** skipNext meaning: ** eState==SKIPNEXT && skipNext>0: Next sqlite3BtreeNext() is no-op. @@ -58519,7 +58519,7 @@ struct BtCursor { ** Potential values for BtCursor.eState. ** ** CURSOR_INVALID: -** Cursor does not point to a valid entry. This can happen (for example) +** Cursor does not point to a valid entry. This can happen (for example) ** because the table is empty or because BtreeCursorFirst() has not been ** called. ** @@ -58532,9 +58532,9 @@ struct BtCursor { ** operation should be a no-op. ** ** CURSOR_REQUIRESEEK: -** The table that this cursor was opened on still exists, but has been +** The table that this cursor was opened on still exists, but has been ** modified since the cursor was last used. The cursor position is saved -** in variables BtCursor.pKey and BtCursor.nKey. When a cursor is in +** in variables BtCursor.pKey and BtCursor.nKey. When a cursor is in ** this state, restoreCursorPosition() can be called to attempt to ** seek the cursor to the saved position. ** @@ -58551,13 +58551,13 @@ struct BtCursor { #define CURSOR_REQUIRESEEK 3 #define CURSOR_FAULT 4 -/* +/* ** The database page the PENDING_BYTE occupies. This page is never used. */ # define PENDING_BYTE_PAGE(pBt) PAGER_MJ_PGNO(pBt) /* -** These macros define the location of the pointer-map entry for a +** These macros define the location of the pointer-map entry for a ** database page. The first argument to each is the number of usable ** bytes on each page of the database (often 1024). The second is the ** page number to look up in the pointer map. @@ -58592,10 +58592,10 @@ struct BtCursor { ** PTRMAP_ROOTPAGE: The database page is a root-page. The page-number is not ** used in this case. ** -** PTRMAP_FREEPAGE: The database page is an unused (free) page. The page-number +** PTRMAP_FREEPAGE: The database page is an unused (free) page. The page-number ** is not used in this case. ** -** PTRMAP_OVERFLOW1: The database page is the first page in a list of +** PTRMAP_OVERFLOW1: The database page is the first page in a list of ** overflow pages. The page number identifies the page that ** contains the cell with a pointer to this overflow page. ** @@ -58617,13 +58617,13 @@ struct BtCursor { */ #define btreeIntegrity(p) \ assert( p->pBt->inTransaction!=TRANS_NONE || p->pBt->nTransaction==0 ); \ - assert( p->pBt->inTransaction>=p->inTrans ); + assert( p->pBt->inTransaction>=p->inTrans ); /* ** The ISAUTOVACUUM macro is used within balance_nonroot() to determine ** if the database supports auto-vacuum or not. Because it is used -** within an expression that is an argument to another macro +** within an expression that is an argument to another macro ** (sqliteMallocRaw), it is not possible to use conditional compilation. ** So, this macro is defined instead. */ @@ -58640,8 +58640,8 @@ struct BtCursor { ** ** 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 +** 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; @@ -58957,10 +58957,10 @@ SQLITE_PRIVATE void sqlite3BtreeEnterAll(sqlite3 *db){ #ifndef SQLITE_OMIT_INCRBLOB /* -** Enter a mutex on a Btree given a cursor owned by that Btree. +** Enter a mutex on a Btree given a cursor owned by that Btree. ** -** These entry points are used by incremental I/O only. Enter() is required -** any time OMIT_SHARED_CACHE is not defined, regardless of whether or not +** These entry points are used by incremental I/O only. Enter() is required +** any time OMIT_SHARED_CACHE is not defined, regardless of whether or not ** the build is threadsafe. Leave() is only required by threadsafe builds. */ SQLITE_PRIVATE void sqlite3BtreeEnterCursor(BtCursor *pCur){ @@ -59030,7 +59030,7 @@ int sqlite3BtreeTrace=1; /* True to enable tracing */ #define BTALLOC_LE 2 /* Allocate any page <= the parameter */ /* -** Macro IfNotOmitAV(x) returns (x) if SQLITE_OMIT_AUTOVACUUM is not +** Macro IfNotOmitAV(x) returns (x) if SQLITE_OMIT_AUTOVACUUM is not ** defined, or 0 if it is. For example: ** ** bIncrVacuum = IfNotOmitAV(pBtShared->incrVacuum); @@ -59045,7 +59045,7 @@ int sqlite3BtreeTrace=1; /* True to enable tracing */ /* ** A list of BtShared objects that are eligible for participation ** in shared cache. This variable has file scope during normal builds, -** but the test harness needs to access it so we make it global for +** but the test harness needs to access it so we make it global for ** test builds. ** ** Access to this variable is protected by SQLITE_MUTEX_STATIC_MASTER. @@ -59080,7 +59080,7 @@ SQLITE_API int sqlite3_enable_shared_cache(int enable){ ** manipulate entries in the BtShared.pLock linked list used to store ** shared-cache table level locks. If the library is compiled with the ** shared-cache feature disabled, then there is only ever one user - ** of each BtShared structure and so this locking is not necessary. + ** of each BtShared structure and so this locking is not necessary. ** So define the lock related functions as no-ops. */ #define querySharedCacheTableLock(a,b,c) SQLITE_OK @@ -59097,15 +59097,15 @@ SQLITE_API int sqlite3_enable_shared_cache(int enable){ /* **** This function is only used as part of an assert() statement. *** ** -** Check to see if pBtree holds the required locks to read or write to the +** Check to see if pBtree holds the required locks to read or write to the ** table with root page iRoot. Return 1 if it does and 0 if not. ** -** For example, when writing to a table with root-page iRoot via +** For example, when writing to a table with root-page iRoot via ** Btree connection pBtree: ** ** assert( hasSharedCacheTableLock(pBtree, iRoot, 0, WRITE_LOCK) ); ** -** When writing to an index that resides in a sharable database, the +** When writing to an index that resides in a sharable database, the ** caller should have first obtained a lock specifying the root page of ** the corresponding table. This makes things a bit more complicated, ** as this module treats each table as a separate structure. To determine @@ -59127,7 +59127,7 @@ static int hasSharedCacheTableLock( BtLock *pLock; /* If this database is not shareable, or if the client is reading - ** and has the read-uncommitted flag set, then no lock is required. + ** and has the read-uncommitted flag set, then no lock is required. ** Return true immediately. */ if( (pBtree->sharable==0) @@ -59167,13 +59167,13 @@ static int hasSharedCacheTableLock( iTab = iRoot; } - /* Search for the required lock. Either a write-lock on root-page iTab, a + /* Search for the required lock. Either a write-lock on root-page iTab, a ** write-lock on the schema table, or (if the client is reading) a ** read-lock on iTab will suffice. Return 1 if any of these are found. */ for(pLock=pBtree->pBt->pLock; pLock; pLock=pLock->pNext){ - if( pLock->pBtree==pBtree + if( pLock->pBtree==pBtree && (pLock->iTable==iTab || (pLock->eLock==WRITE_LOCK && pLock->iTable==1)) - && pLock->eLock>=eLockType + && pLock->eLock>=eLockType ){ return 1; } @@ -59206,7 +59206,7 @@ static int hasSharedCacheTableLock( static int hasReadConflicts(Btree *pBtree, Pgno iRoot){ BtCursor *p; for(p=pBtree->pBt->pCursor; p; p=p->pNext){ - if( p->pgnoRoot==iRoot + if( p->pgnoRoot==iRoot && p->pBtree!=pBtree && 0==(p->pBtree->db->flags & SQLITE_ReadUncommitted) ){ @@ -59218,7 +59218,7 @@ static int hasReadConflicts(Btree *pBtree, Pgno iRoot){ #endif /* #ifdef SQLITE_DEBUG */ /* -** Query to see if Btree handle p may obtain a lock of type eLock +** Query to see if Btree handle p may obtain a lock of type eLock ** (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return ** SQLITE_OK if the lock may be obtained (by calling ** setSharedCacheTableLock()), or SQLITE_LOCKED if not. @@ -59231,14 +59231,14 @@ static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){ assert( eLock==READ_LOCK || eLock==WRITE_LOCK ); assert( p->db!=0 ); assert( !(p->db->flags&SQLITE_ReadUncommitted)||eLock==WRITE_LOCK||iTab==1 ); - + /* If requesting a write-lock, then the Btree must have an open write - ** transaction on this file. And, obviously, for this to be so there + ** transaction on this file. And, obviously, for this to be so there ** must be an open write transaction on the file itself. */ assert( eLock==READ_LOCK || (p==pBt->pWriter && p->inTrans==TRANS_WRITE) ); assert( eLock==READ_LOCK || pBt->inTransaction==TRANS_WRITE ); - + /* This routine is a no-op if the shared-cache is not enabled */ if( !p->sharable ){ return SQLITE_OK; @@ -59253,7 +59253,7 @@ static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){ } for(pIter=pBt->pLock; pIter; pIter=pIter->pNext){ - /* The condition (pIter->eLock!=eLock) in the following if(...) + /* The condition (pIter->eLock!=eLock) in the following if(...) ** statement is a simplification of: ** ** (eLock==WRITE_LOCK || pIter->eLock==WRITE_LOCK) @@ -59280,7 +59280,7 @@ static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){ #ifndef SQLITE_OMIT_SHARED_CACHE /* ** Add a lock on the table with root-page iTable to the shared-btree used -** by Btree handle p. Parameter eLock must be either READ_LOCK or +** by Btree handle p. Parameter eLock must be either READ_LOCK or ** WRITE_LOCK. ** ** This function assumes the following: @@ -59292,7 +59292,7 @@ static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){ ** with the requested lock (i.e. querySharedCacheTableLock() has ** already been called and returned SQLITE_OK). ** -** SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM +** SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM ** is returned if a malloc attempt fails. */ static int setSharedCacheTableLock(Btree *p, Pgno iTable, u8 eLock){ @@ -59306,11 +59306,11 @@ static int setSharedCacheTableLock(Btree *p, Pgno iTable, u8 eLock){ /* A connection with the read-uncommitted flag set will never try to ** obtain a read-lock using this function. The only read-lock obtained - ** by a connection in read-uncommitted mode is on the sqlite_master + ** by a connection in read-uncommitted mode is on the sqlite_master ** table, and that lock is obtained in BtreeBeginTrans(). */ assert( 0==(p->db->flags&SQLITE_ReadUncommitted) || eLock==WRITE_LOCK ); - /* This function should only be called on a sharable b-tree after it + /* This function should only be called on a sharable b-tree after it ** has been determined that no other b-tree holds a conflicting lock. */ assert( p->sharable ); assert( SQLITE_OK==querySharedCacheTableLock(p, iTable, eLock) ); @@ -59355,7 +59355,7 @@ static int setSharedCacheTableLock(Btree *p, Pgno iTable, u8 eLock){ ** Release all the table locks (locks obtained via calls to ** the setSharedCacheTableLock() procedure) held by Btree object p. ** -** This function assumes that Btree p has an open read or write +** This function assumes that Btree p has an open read or write ** transaction. If it does not, then the BTS_PENDING flag ** may be incorrectly cleared. */ @@ -59387,7 +59387,7 @@ static void clearAllSharedCacheTableLocks(Btree *p){ pBt->pWriter = 0; pBt->btsFlags &= ~(BTS_EXCLUSIVE|BTS_PENDING); }else if( pBt->nTransaction==2 ){ - /* This function is called when Btree p is concluding its + /* This function is called when Btree p is concluding its ** transaction. If there currently exists a writer, and p is not ** that writer, then the number of locks held by connections other ** than the writer must be about to drop to zero. In this case @@ -59431,7 +59431,7 @@ static int cursorHoldsMutex(BtCursor *p){ } /* Verify that the cursor and the BtShared agree about what is the current -** database connetion. This is important in shared-cache mode. If the database +** database connetion. This is important in shared-cache mode. If the database ** connection pointers get out-of-sync, it is possible for routines like ** btreeInitPage() to reference an stale connection pointer that references a ** a connection that has already closed. This routine is used inside assert() @@ -59501,8 +59501,8 @@ static void invalidateIncrblobCursors( #endif /* SQLITE_OMIT_INCRBLOB */ /* -** Set bit pgno of the BtShared.pHasContent bitvec. This is called -** when a page that previously contained data becomes a free-list leaf +** Set bit pgno of the BtShared.pHasContent bitvec. This is called +** when a page that previously contained data becomes a free-list leaf ** page. ** ** The BtShared.pHasContent bitvec exists to work around an obscure @@ -59528,7 +59528,7 @@ static void invalidateIncrblobCursors( ** may be lost. In the event of a rollback, it may not be possible ** to restore the database to its original configuration. ** -** The solution is the BtShared.pHasContent bitvec. Whenever a page is +** The solution is the BtShared.pHasContent bitvec. Whenever a page is ** moved to become a free-list leaf page, the corresponding bit is ** set in the bitvec. Whenever a leaf page is extracted from the free-list, ** optimization 2 above is omitted if the corresponding bit is already @@ -59587,13 +59587,13 @@ static void btreeReleaseAllCursorPages(BtCursor *pCur){ ** The cursor passed as the only argument must point to a valid entry ** when this function is called (i.e. have eState==CURSOR_VALID). This ** function saves the current cursor key in variables pCur->nKey and -** pCur->pKey. SQLITE_OK is returned if successful or an SQLite error +** pCur->pKey. SQLITE_OK is returned if successful or an SQLite error ** code otherwise. ** ** If the cursor is open on an intkey table, then the integer key ** (the rowid) is stored in pCur->nKey and pCur->pKey is left set to -** NULL. If the cursor is open on a non-intkey table, then pCur->pKey is -** set to point to a malloced buffer pCur->nKey bytes in size containing +** NULL. If the cursor is open on a non-intkey table, then pCur->pKey is +** set to point to a malloced buffer pCur->nKey bytes in size containing ** the key. */ static int saveCursorKey(BtCursor *pCur){ @@ -59626,11 +59626,11 @@ static int saveCursorKey(BtCursor *pCur){ } /* -** Save the current cursor position in the variables BtCursor.nKey +** Save the current cursor position in the variables BtCursor.nKey ** and BtCursor.pKey. The cursor's state is set to CURSOR_REQUIRESEEK. ** ** The caller must ensure that the cursor is valid (has eState==CURSOR_VALID) -** prior to calling this routine. +** prior to calling this routine. */ static int saveCursorPosition(BtCursor *pCur){ int rc; @@ -59666,7 +59666,7 @@ static int SQLITE_NOINLINE saveCursorsOnList(BtCursor*,Pgno,BtCursor*); ** routine is called just before cursor pExcept is used to modify the ** table, for example in BtreeDelete() or BtreeInsert(). ** -** If there are two or more cursors on the same btree, then all such +** If there are two or more cursors on the same btree, then all such ** cursors should have their BTCF_Multiple flag set. The btreeCursor() ** routine enforces that rule. This routine only needs to be called in ** the uncommon case when pExpect has the BTCF_Multiple flag set. @@ -59765,9 +59765,9 @@ moveto_done: /* ** Restore the cursor to the position it was in (or as close to as possible) -** when saveCursorPosition() was called. Note that this call deletes the +** when saveCursorPosition() was called. Note that this call deletes the ** saved position info stored by saveCursorPosition(), so there can be -** at most one effective restoreCursorPosition() call after each +** at most one effective restoreCursorPosition() call after each ** saveCursorPosition(). */ static int btreeRestoreCursorPosition(BtCursor *pCur){ @@ -59816,7 +59816,7 @@ SQLITE_PRIVATE int sqlite3BtreeCursorHasMoved(BtCursor *pCur){ /* ** This routine restores a cursor back to its original position after it ** has been moved by some outside activity (such as a btree rebalance or -** a row having been deleted out from under the cursor). +** a row having been deleted out from under the cursor). ** ** On success, the *pDifferentRow parameter is false if the cursor is left ** pointing at exactly the same row. *pDifferntRow is the row the cursor @@ -59882,7 +59882,7 @@ static Pgno ptrmapPageno(BtShared *pBt, Pgno pgno){ if( pgno<2 ) return 0; nPagesPerMapPage = (pBt->usableSize/5)+1; iPtrMap = (pgno-2)/nPagesPerMapPage; - ret = (iPtrMap*nPagesPerMapPage) + 2; + ret = (iPtrMap*nPagesPerMapPage) + 2; if( ret==PENDING_BYTE_PAGE(pBt) ){ ret++; } @@ -60221,7 +60221,7 @@ static u16 cellSizePtr(MemPage *pPage, u8 *pCell){ } pIter++; if( pPage->intKey ){ - /* pIter now points at the 64-bit integer key value, a variable length + /* pIter now points at the 64-bit integer key value, a variable length ** integer. The following block moves pIter to point at the first byte ** past the end of the key value. */ pEnd = &pIter[9]; @@ -60465,7 +60465,7 @@ static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){ int top; /* First byte of cell content area */ int rc = SQLITE_OK; /* Integer return code */ int gap; /* First byte of gap between cell pointers and cell content */ - + assert( sqlite3PagerIswriteable(pPage->pDbPage) ); assert( pPage->pBt ); assert( sqlite3_mutex_held(pPage->pBt->mutex) ); @@ -60573,7 +60573,7 @@ static int freeSpace(MemPage *pPage, u16 iStart, u16 iSize){ memset(&data[iStart], 0, iSize); } - /* The list of freeblocks must be in ascending order. Find the + /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = pPage->hdrOffset; @@ -60590,7 +60590,7 @@ static int freeSpace(MemPage *pPage, u16 iStart, u16 iSize){ } if( iFreeBlk>iLast ) return SQLITE_CORRUPT_BKPT; assert( iFreeBlk>iPtr || iFreeBlk==0 ); - + /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none ** iPtr: The address of a pointer to iFreeBlk @@ -60605,7 +60605,7 @@ static int freeSpace(MemPage *pPage, u16 iStart, u16 iSize){ iSize = iEnd - iStart; iFreeBlk = get2byte(&data[iFreeBlk]); } - + /* If iPtr is another freeblock (that is, if iPtr is not the freelist ** pointer in the page header) then check to see if iStart should be ** coalesced onto the end of iPtr. @@ -60704,7 +60704,7 @@ static int decodeFlags(MemPage *pPage, int flagByte){ ** Initialize the auxiliary information for a disk block. ** ** Return SQLITE_OK on success. If we see that the page does -** not contain a well-formed database page, then return +** not contain a well-formed database page, then return ** SQLITE_CORRUPT. Note that a return of SQLITE_OK does not ** guarantee that the page is well-formed. It only shows that ** we failed to detect any corruption. @@ -60764,10 +60764,10 @@ static int btreeInitPage(MemPage *pPage){ assert( pPage->nCell>0 || top==usableSize || CORRUPT_DB ); /* A malformed database page might cause us to read past the end - ** of page when parsing a cell. + ** of page when parsing a cell. ** ** The following block of code checks early to see if a cell extends - ** past the end of a page boundary and causes SQLITE_CORRUPT to be + ** past the end of a page boundary and causes SQLITE_CORRUPT to be ** returned if it does. */ iCellFirst = cellOffset + 2*pPage->nCell; @@ -60791,7 +60791,7 @@ static int btreeInitPage(MemPage *pPage){ } } if( !pPage->leaf ) iCellLast++; - } + } /* Compute the total free space on the page ** EVIDENCE-OF: R-23588-34450 The two-byte integer at offset 1 gives the @@ -60805,7 +60805,7 @@ static int btreeInitPage(MemPage *pPage){ /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return SQLITE_CORRUPT_BKPT; + return SQLITE_CORRUPT_BKPT; } while( 1 ){ if( pc>iCellLast ){ @@ -60833,7 +60833,7 @@ static int btreeInitPage(MemPage *pPage){ ** area, according to the page header, lies within the page. */ if( nFree>usableSize ){ - return SQLITE_CORRUPT_BKPT; + return SQLITE_CORRUPT_BKPT; } pPage->nFree = (u16)(nFree - iCellFirst); pPage->isInit = 1; @@ -60892,7 +60892,7 @@ static MemPage *btreePageFromDbPage(DbPage *pDbPage, Pgno pgno, BtShared *pBt){ pPage->hdrOffset = pgno==1 ? 100 : 0; } assert( pPage->aData==sqlite3PagerGetData(pDbPage) ); - return pPage; + return pPage; } /* @@ -61100,11 +61100,11 @@ static int btreeInvokeBusyHandler(void *pArg){ /* ** Open a database file. -** +** ** zFilename is the name of the database file. If zFilename is NULL ** then an ephemeral database is created. The ephemeral database might ** be exclusively in memory, or it might use a disk-based memory cache. -** Either way, the ephemeral database will be automatically deleted +** Either way, the ephemeral database will be automatically deleted ** when sqlite3BtreeClose() is called. ** ** If zFilename is ":memory:" then an in-memory database is created @@ -61137,7 +61137,7 @@ SQLITE_PRIVATE int sqlite3BtreeOpen( /* True if opening an ephemeral, temporary database */ const int isTempDb = zFilename==0 || zFilename[0]==0; - /* Set the variable isMemdb to true for an in-memory database, or + /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ #ifdef SQLITE_OMIT_MEMORYDB @@ -61256,7 +61256,7 @@ SQLITE_PRIVATE int sqlite3BtreeOpen( assert( sizeof(u32)==4 ); assert( sizeof(u16)==2 ); assert( sizeof(Pgno)==4 ); - + pBt = sqlite3MallocZero( sizeof(*pBt) ); if( pBt==0 ){ rc = SQLITE_NOMEM_BKPT; @@ -61275,7 +61275,7 @@ SQLITE_PRIVATE int sqlite3BtreeOpen( pBt->db = db; sqlite3PagerSetBusyhandler(pBt->pPager, btreeInvokeBusyHandler, pBt); p->pBt = pBt; - + pBt->pCursor = 0; pBt->pPage1 = 0; if( sqlite3PagerIsreadonly(pBt->pPager) ) pBt->btsFlags |= BTS_READ_ONLY; @@ -61317,7 +61317,7 @@ SQLITE_PRIVATE int sqlite3BtreeOpen( if( rc ) goto btree_open_out; pBt->usableSize = pBt->pageSize - nReserve; assert( (pBt->pageSize & 7)==0 ); /* 8-byte alignment of pageSize */ - + #if !defined(SQLITE_OMIT_SHARED_CACHE) && !defined(SQLITE_OMIT_DISKIO) /* Add the new BtShared object to the linked list sharable BtShareds. */ @@ -61446,7 +61446,7 @@ static int removeFromSharingList(BtShared *pBt){ } /* -** Make sure pBt->pTmpSpace points to an allocation of +** Make sure pBt->pTmpSpace points to an allocation of ** MX_CELL_SIZE(pBt) bytes with a 4-byte prefix for a left-child ** pointer. */ @@ -61461,7 +61461,7 @@ static void allocateTempSpace(BtShared *pBt){ ** can mean that fillInCell() only initializes the first 2 or 3 ** bytes of pTmpSpace, but that the first 4 bytes are copied from ** it into a database page. This is not actually a problem, but it - ** does cause a valgrind error when the 1 or 2 bytes of unitialized + ** does cause a valgrind error when the 1 or 2 bytes of unitialized ** data is passed to system call write(). So to avoid this error, ** zero the first 4 bytes of temp space here. ** @@ -61514,7 +61514,7 @@ SQLITE_PRIVATE int sqlite3BtreeClose(Btree *p){ sqlite3BtreeLeave(p); /* If there are still other outstanding references to the shared-btree - ** structure, return now. The remainder of this procedure cleans + ** structure, return now. The remainder of this procedure cleans ** up the shared-btree. */ assert( p->wantToLock==0 && p->locked==0 ); @@ -61620,7 +61620,7 @@ SQLITE_PRIVATE int sqlite3BtreeSetPagerFlags( /* ** Change the default pages size and the number of reserved bytes per page. -** Or, if the page size has already been fixed, return SQLITE_READONLY +** Or, if the page size has already been fixed, return SQLITE_READONLY ** without changing anything. ** ** The page size must be a power of 2 between 512 and 65536. If the page @@ -61681,7 +61681,7 @@ SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree *p){ ** held. ** ** This is useful in one special case in the backup API code where it is -** known that the shared b-tree mutex is held, but the mutex on the +** known that the shared b-tree mutex is held, but the mutex on the ** database handle that owns *p is not. In this case if sqlite3BtreeEnter() ** were to be called, it might collide with some other operation on the ** database handle that owns *p, causing undefined behavior. @@ -61739,7 +61739,7 @@ SQLITE_PRIVATE int sqlite3BtreeSecureDelete(Btree *p, int newFlag){ if( newFlag>=0 ){ p->pBt->btsFlags &= ~BTS_SECURE_DELETE; if( newFlag ) p->pBt->btsFlags |= BTS_SECURE_DELETE; - } + } b = (p->pBt->btsFlags & BTS_SECURE_DELETE)!=0; sqlite3BtreeLeave(p); return b; @@ -61748,7 +61748,7 @@ SQLITE_PRIVATE int sqlite3BtreeSecureDelete(Btree *p, int newFlag){ /* ** Change the 'auto-vacuum' property of the database. If the 'autoVacuum' ** parameter is non-zero, then auto-vacuum mode is enabled. If zero, it -** is disabled. The default value for the auto-vacuum property is +** is disabled. The default value for the auto-vacuum property is ** determined by the SQLITE_DEFAULT_AUTOVACUUM macro. */ SQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *p, int autoVacuum){ @@ -61772,7 +61772,7 @@ SQLITE_PRIVATE int sqlite3BtreeSetAutoVacuum(Btree *p, int autoVacuum){ } /* -** Return the value of the 'auto-vacuum' property. If auto-vacuum is +** Return the value of the 'auto-vacuum' property. If auto-vacuum is ** enabled 1 is returned. Otherwise 0. */ SQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *p){ @@ -61839,7 +61839,7 @@ SQLITE_PRIVATE int sqlite3BtreeGetAutoVacuumSlackPages(Btree *p){ ** SQLITE_OK is returned on success. If the file is not a ** well-formed database file, then SQLITE_CORRUPT is returned. ** SQLITE_BUSY is returned if the database is locked. SQLITE_NOMEM -** is returned if we run out of memory. +** is returned if we run out of memory. */ static int lockBtree(BtShared *pBt){ int rc; /* Result code from subfunctions */ @@ -61856,7 +61856,7 @@ static int lockBtree(BtShared *pBt){ if( rc!=SQLITE_OK ) return rc; /* Do some checking to help insure the file we opened really is - ** a valid database file. + ** a valid database file. */ nPage = nPageHeader = get4byte(28+(u8*)pPage1->aData); sqlite3PagerPagecount(pBt->pPager, &nPageFile); @@ -61891,7 +61891,7 @@ static int lockBtree(BtShared *pBt){ } /* If the write version is set to 2, this database should be accessed - ** in WAL mode. If the log is not already open, open it now. Then + ** in WAL mode. If the log is not already open, open it now. Then ** return SQLITE_OK and return without populating BtShared.pPage1. ** The caller detects this and calls this function again. This is ** required as the version of page 1 currently in the page1 buffer @@ -61943,15 +61943,15 @@ static int lockBtree(BtShared *pBt){ /* EVIDENCE-OF: R-25008-21688 The size of a page is a power of two ** between 512 and 65536 inclusive. */ if( ((pageSize-1)&pageSize)!=0 - || pageSize>SQLITE_MAX_PAGE_SIZE - || pageSize<=256 + || pageSize>SQLITE_MAX_PAGE_SIZE + || pageSize<=256 ){ goto page1_init_failed; } assert( (pageSize & 7)==0 ); /* EVIDENCE-OF: R-59310-51205 The "reserved space" size in the 1-byte ** integer at offset 20 is the number of bytes of space at the end of - ** each page to reserve for extensions. + ** each page to reserve for extensions. ** ** EVIDENCE-OF: R-37497-42412 The size of the reserved region is ** determined by the one-byte unsigned integer found at an offset of 20 @@ -62041,7 +62041,7 @@ static int countValidCursors(BtShared *pBt, int wrOnly){ int r = 0; for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){ if( (wrOnly==0 || (pCur->curFlags & BTCF_WriteFlag)!=0) - && pCur->eState!=CURSOR_FAULT ) r++; + && pCur->eState!=CURSOR_FAULT ) r++; } return r; } @@ -62050,7 +62050,7 @@ static int countValidCursors(BtShared *pBt, int wrOnly){ /* ** If there are no outstanding cursors and we are not in the middle ** of a transaction but there is a read lock on the database, then -** this routine unrefs the first page of the database file which +** this routine unrefs the first page of the database file which ** has the effect of releasing the read lock. ** ** If there is a transaction in progress, this routine is a no-op. @@ -62134,8 +62134,8 @@ SQLITE_PRIVATE int sqlite3BtreeNewDb(Btree *p){ ** upgraded to exclusive by calling this routine a second time - the ** exclusivity flag only works for a new transaction. ** -** A write-transaction must be started before attempting any -** changes to the database. None of the following routines +** A write-transaction must be started before attempting any +** changes to the database. None of the following routines ** will work unless a transaction is started first: ** ** sqlite3BtreeCreateTable() @@ -62149,7 +62149,7 @@ SQLITE_PRIVATE int sqlite3BtreeNewDb(Btree *p){ ** If an initial attempt to acquire the lock fails because of lock contention ** and the database was previously unlocked, then invoke the busy handler ** if there is one. But if there was previously a read-lock, do not -** invoke the busy handler - just return SQLITE_BUSY. SQLITE_BUSY is +** invoke the busy handler - just return SQLITE_BUSY. SQLITE_BUSY is ** returned when there is already a read-lock in order to avoid a deadlock. ** ** Suppose there are two processes A and B. A has a read lock and B has @@ -62185,7 +62185,7 @@ SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag){ #ifndef SQLITE_OMIT_SHARED_CACHE { sqlite3 *pBlock = 0; - /* If another database handle has already opened a write transaction + /* If another database handle has already opened a write transaction ** on this shared-btree structure and a second write transaction is ** requested, return SQLITE_LOCKED. */ @@ -62210,8 +62210,8 @@ SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag){ } #endif - /* Any read-only or read-write transaction implies a read-lock on - ** page 1. So if some other shared-cache client already has a write-lock + /* Any read-only or read-write transaction implies a read-lock on + ** page 1. So if some other shared-cache client already has a write-lock ** on page 1, the transaction cannot be opened. */ rc = querySharedCacheTableLock(p, MASTER_ROOT, READ_LOCK); if( SQLITE_OK!=rc ) goto trans_begun; @@ -62222,7 +62222,7 @@ SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag){ /* Call lockBtree() until either pBt->pPage1 is populated or ** lockBtree() returns something other than SQLITE_OK. lockBtree() ** may return SQLITE_OK but leave pBt->pPage1 set to 0 if after - ** reading page 1 it discovers that the page-size of the database + ** reading page 1 it discovers that the page-size of the database ** file is not pBt->pageSize. In this case lockBtree() will update ** pBt->pageSize to the page-size of the file on disk. */ @@ -62238,7 +62238,7 @@ SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag){ } } } - + if( rc!=SQLITE_OK ){ unlockBtreeIfUnused(pBt); } @@ -62272,7 +62272,7 @@ SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag){ /* If the db-size header field is incorrect (as it may be if an old ** client has been writing the database file), update it now. Doing - ** this sooner rather than later means the database size can safely + ** this sooner rather than later means the database size can safely ** re-read the database size from page 1 if a savepoint or transaction ** rollback occurs within the transaction. */ @@ -62343,7 +62343,7 @@ static int setChildPtrmaps(MemPage *pPage){ ** that it points to iTo. Parameter eType describes the type of pointer to ** be modified, as follows: ** -** PTRMAP_BTREE: pPage is a btree-page. The pointer points at a child +** PTRMAP_BTREE: pPage is a btree-page. The pointer points at a child ** page of pPage. ** ** PTRMAP_OVERFLOW1: pPage is a btree-page. The pointer points at an overflow @@ -62391,9 +62391,9 @@ static int modifyPagePointer(MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eType){ } } } - + if( i==nCell ){ - if( eType!=PTRMAP_BTREE || + if( eType!=PTRMAP_BTREE || get4byte(&pPage->aData[pPage->hdrOffset+8])!=iFrom ){ return SQLITE_CORRUPT_BKPT; } @@ -62405,11 +62405,11 @@ static int modifyPagePointer(MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eType){ /* -** Move the open database page pDbPage to location iFreePage in the +** Move the open database page pDbPage to location iFreePage in the ** database. The pDbPage reference remains valid. ** ** The isCommit flag indicates that there is no need to remember that -** the journal needs to be sync()ed before database page pDbPage->pgno +** the journal needs to be sync()ed before database page pDbPage->pgno ** can be written to. The caller has already promised not to write to that ** page. */ @@ -62426,13 +62426,13 @@ static int relocatePage( Pager *pPager = pBt->pPager; int rc; - assert( eType==PTRMAP_OVERFLOW2 || eType==PTRMAP_OVERFLOW1 || + assert( eType==PTRMAP_OVERFLOW2 || eType==PTRMAP_OVERFLOW1 || eType==PTRMAP_BTREE || eType==PTRMAP_ROOTPAGE ); assert( sqlite3_mutex_held(pBt->mutex) ); assert( pDbPage->pBt==pBt ); /* Move page iDbPage from its current location to page number iFreePage */ - TRACE(("AUTOVACUUM: Moving %d to free page %d (ptr page %d type %d)\n", + TRACE(("AUTOVACUUM: Moving %d to free page %d (ptr page %d type %d)\n", iDbPage, iFreePage, iPtrPage, eType)); rc = sqlite3PagerMovepage(pPager, pDbPage->pDbPage, iFreePage, isCommit); if( rc!=SQLITE_OK ){ @@ -62491,19 +62491,19 @@ static int allocateBtreePage(BtShared *, MemPage **, Pgno *, Pgno, u8); /* ** Perform a single step of an incremental-vacuum. If successful, return -** SQLITE_OK. If there is no work to do (and therefore no point in -** calling this function again), return SQLITE_DONE. Or, if an error +** SQLITE_OK. If there is no work to do (and therefore no point in +** calling this function again), return SQLITE_DONE. Or, if an error ** occurs, return some other error code. ** -** More specifically, this function attempts to re-organize the database so +** More specifically, this function attempts to re-organize the database so ** that the last page of the file currently in use is no longer in use. ** ** Parameter nFin is the number of pages that this database would contain ** were this function called until it returns SQLITE_DONE. ** -** If the bCommit parameter is non-zero, this function assumes that the -** caller will keep calling incrVacuumStep() until it returns SQLITE_DONE -** or an error. bCommit is passed true for an auto-vacuum-on-commit +** If the bCommit parameter is non-zero, this function assumes that the +** caller will keep calling incrVacuumStep() until it returns SQLITE_DONE +** or an error. bCommit is passed true for an auto-vacuum-on-commit ** operation, or false for an incremental vacuum. */ static int incrVacuumStep(BtShared *pBt, Pgno nFin, Pgno iLastPg, int bCommit){ @@ -62534,7 +62534,7 @@ static int incrVacuumStep(BtShared *pBt, Pgno nFin, Pgno iLastPg, int bCommit){ if( bCommit==0 ){ /* Remove the page from the files free-list. This is not required ** if bCommit is non-zero. In that case, the free-list will be - ** truncated to zero after this function returns, so it doesn't + ** truncated to zero after this function returns, so it doesn't ** matter if it still contains some garbage entries. */ Pgno iFreePg; @@ -62578,7 +62578,7 @@ static int incrVacuumStep(BtShared *pBt, Pgno nFin, Pgno iLastPg, int bCommit){ releasePage(pFreePg); }while( bCommit && iFreePg>nFin ); assert( iFreePginTrans = TRANS_READ; }else{ - /* If the handle had any kind of transaction open, decrement the - ** transaction count of the shared btree. If the transaction count + /* If the handle had any kind of transaction open, decrement the + ** transaction count of the shared btree. If the transaction count ** reaches 0, set the shared state to TRANS_NONE. The unlockBtreeIfUnused() ** call below will unlock the pager. */ if( p->inTrans!=TRANS_NONE ){ @@ -62817,7 +62817,7 @@ static void btreeEndTransaction(Btree *p){ } } - /* Set the current transaction state to TRANS_NONE and unlock the + /* Set the current transaction state to TRANS_NONE and unlock the ** pager if this call closed the only read or write transaction. */ p->inTrans = TRANS_NONE; unlockBtreeIfUnused(pBt); @@ -62838,12 +62838,12 @@ static void btreeEndTransaction(Btree *p){ ** the rollback journal (which causes the transaction to commit) and ** drop locks. ** -** Normally, if an error occurs while the pager layer is attempting to +** Normally, if an error occurs while the pager layer is attempting to ** finalize the underlying journal file, this function returns an error and ** the upper layer will attempt a rollback. However, if the second argument -** is non-zero then this b-tree transaction is part of a multi-file -** transaction. In this case, the transaction has already been committed -** (by deleting a master journal file) and the caller will ignore this +** is non-zero then this b-tree transaction is part of a multi-file +** transaction. In this case, the transaction has already been committed +** (by deleting a master journal file) and the caller will ignore this ** functions return code. So, even if an error occurs in the pager layer, ** reset the b-tree objects internal state to indicate that the write ** transaction has been closed. This is quite safe, as the pager will have @@ -62858,7 +62858,7 @@ SQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree *p, int bCleanup){ sqlite3BtreeEnter(p); btreeIntegrity(p); - /* If the handle has a write-transaction open, commit the shared-btrees + /* If the handle has a write-transaction open, commit the shared-btrees ** transaction and set the shared state to TRANS_READ. */ if( p->inTrans==TRANS_WRITE ){ @@ -62907,15 +62907,15 @@ SQLITE_PRIVATE int sqlite3BtreeCommit(Btree *p){ ** ** This routine gets called when a rollback occurs. If the writeOnly ** flag is true, then only write-cursors need be tripped - read-only -** cursors save their current positions so that they may continue -** following the rollback. Or, if writeOnly is false, all cursors are +** cursors save their current positions so that they may continue +** following the rollback. Or, if writeOnly is false, all cursors are ** tripped. In general, writeOnly is false if the transaction being ** rolled back modified the database schema. In this case b-tree root ** pages may be moved or deleted from the database altogether, making ** it unsafe for read cursors to continue. ** -** If the writeOnly flag is true and an error is encountered while -** saving the current position of a read-only cursor, all cursors, +** If the writeOnly flag is true and an error is encountered while +** saving the current position of a read-only cursor, all cursors, ** including all read-cursors are tripped. ** ** SQLITE_OK is returned if successful, or if an error occurs while @@ -63017,8 +63017,8 @@ SQLITE_PRIVATE int sqlite3BtreeRollback(Btree *p, int tripCode, int writeOnly){ /* ** Start a statement subtransaction. The subtransaction can be rolled -** back independently of the main transaction. You must start a transaction -** before starting a subtransaction. The subtransaction is ended automatically +** back independently of the main transaction. You must start a transaction +** before starting a subtransaction. The subtransaction is ended automatically ** if the main transaction commits or rolls back. ** ** Statement subtransactions are used around individual SQL statements @@ -63055,11 +63055,11 @@ SQLITE_PRIVATE int sqlite3BtreeBeginStmt(Btree *p, int iStatement){ /* ** The second argument to this function, op, is always SAVEPOINT_ROLLBACK ** or SAVEPOINT_RELEASE. This function either releases or rolls back the -** savepoint identified by parameter iSavepoint, depending on the value +** savepoint identified by parameter iSavepoint, depending on the value ** of op. ** ** Normally, iSavepoint is greater than or equal to zero. However, if op is -** SAVEPOINT_ROLLBACK, then iSavepoint may also be -1. In this case the +** SAVEPOINT_ROLLBACK, then iSavepoint may also be -1. In this case the ** contents of the entire transaction are rolled back. This is different ** from a normal transaction rollback, as no locks are released and the ** transaction remains open. @@ -63123,10 +63123,10 @@ SQLITE_PRIVATE int sqlite3BtreeSavepoint(Btree *p, int op, int iSavepoint){ ** is set. If FORDELETE is set, that is a hint to the implementation that ** this cursor will only be used to seek to and delete entries of an index ** as part of a larger DELETE statement. The FORDELETE hint is not used by -** this implementation. But in a hypothetical alternative storage engine +** this implementation. But in a hypothetical alternative storage engine ** in which index entries are automatically deleted when corresponding table ** rows are deleted, the FORDELETE flag is a hint that all SEEK and DELETE -** operations on this cursor can be no-ops and all READ operations can +** operations on this cursor can be no-ops and all READ operations can ** return a null row (2-bytes: 0x01 0x00). ** ** No checking is done to make sure that page iTable really is the @@ -63147,14 +63147,14 @@ static int btreeCursor( BtCursor *pX; /* Looping over other all cursors */ assert( sqlite3BtreeHoldsMutex(p) ); - assert( wrFlag==0 - || wrFlag==BTREE_WRCSR - || wrFlag==(BTREE_WRCSR|BTREE_FORDELETE) + assert( wrFlag==0 + || wrFlag==BTREE_WRCSR + || wrFlag==(BTREE_WRCSR|BTREE_FORDELETE) ); - /* The following assert statements verify that if this is a sharable - ** b-tree database, the connection is holding the required table locks, - ** and that no other connection has any open cursor that conflicts with + /* The following assert statements verify that if this is a sharable + ** b-tree database, the connection is holding the required table locks, + ** and that no other connection has any open cursor that conflicts with ** this lock. */ assert( hasSharedCacheTableLock(p, iTable, pKeyInfo!=0, (wrFlag?2:1)) ); assert( wrFlag==0 || !hasReadConflicts(p, iTable) ); @@ -63349,15 +63349,15 @@ SQLITE_PRIVATE u32 sqlite3BtreePayloadSize(BtCursor *pCur){ /* ** Given the page number of an overflow page in the database (parameter -** ovfl), this function finds the page number of the next page in the +** ovfl), this function finds the page number of the next page in the ** linked list of overflow pages. If possible, it uses the auto-vacuum -** pointer-map data instead of reading the content of page ovfl to do so. +** pointer-map data instead of reading the content of page ovfl to do so. ** ** If an error occurs an SQLite error code is returned. Otherwise: ** -** The page number of the next overflow page in the linked list is -** written to *pPgnoNext. If page ovfl is the last page in its linked -** list, *pPgnoNext is set to zero. +** The page number of the next overflow page in the linked list is +** written to *pPgnoNext. If page ovfl is the last page in its linked +** list, *pPgnoNext is set to zero. ** ** If ppPage is not NULL, and a reference to the MemPage object corresponding ** to page number pOvfl was obtained, then *ppPage is set to point to that @@ -63381,9 +63381,9 @@ static int getOverflowPage( #ifndef SQLITE_OMIT_AUTOVACUUM /* Try to find the next page in the overflow list using the - ** autovacuum pointer-map pages. Guess that the next page in - ** the overflow list is page number (ovfl+1). If that guess turns - ** out to be wrong, fall back to loading the data of page + ** autovacuum pointer-map pages. Guess that the next page in + ** the overflow list is page number (ovfl+1). If that guess turns + ** out to be wrong, fall back to loading the data of page ** number ovfl to determine the next page number. */ if( pBt->autoVacuum ){ @@ -63471,8 +63471,8 @@ static int copyPayload( ** ** If the current cursor entry uses one or more overflow pages ** this function may allocate space for and lazily populate -** the overflow page-list cache array (BtCursor.aOverflow). -** Subsequent calls use this cache to make seeking to the supplied offset +** the overflow page-list cache array (BtCursor.aOverflow). +** Subsequent calls use this cache to make seeking to the supplied offset ** more efficient. ** ** Once an overflow page-list cache has been allocated, it must be @@ -63488,7 +63488,7 @@ static int accessPayload( BtCursor *pCur, /* Cursor pointing to entry to read from */ u32 offset, /* Begin reading this far into payload */ u32 amt, /* Read this many bytes */ - unsigned char *pBuf, /* Write the bytes into this buffer */ + unsigned char *pBuf, /* Write the bytes into this buffer */ int eOp /* zero to read. non-zero to write. */ ){ unsigned char *aPayload; @@ -63613,12 +63613,12 @@ static int accessPayload( #ifdef SQLITE_DIRECT_OVERFLOW_READ /* If all the following are true: ** - ** 1) this is a read operation, and + ** 1) this is a read operation, and ** 2) data is required from the start of this overflow page, and ** 3) there is no open write-transaction, and ** 4) the database is file-backed, and ** 5) the page is not in the WAL file - ** 6) at least 4 bytes have already been read into the output buffer + ** 6) at least 4 bytes have already been read into the output buffer ** ** then data can be read directly from the database file into the ** output buffer, bypassing the page-cache altogether. This speeds @@ -63725,7 +63725,7 @@ SQLITE_PRIVATE int sqlite3BtreePayloadChecked(BtCursor *pCur, u32 offset, u32 am #endif /* SQLITE_OMIT_INCRBLOB */ /* -** Return a pointer to payload information from the entry that the +** Return a pointer to payload information from the entry that the ** pCur cursor is pointing to. The pointer is to the beginning of ** the key if index btrees (pPage->intKey==0) and is the data for ** table btrees (pPage->intKey==1). The number of bytes of available @@ -63811,7 +63811,7 @@ static int moveToChild(BtCursor *pCur, u32 newPgno){ #if SQLITE_DEBUG /* -** Page pParent is an internal (non-leaf) tree page. This function +** Page pParent is an internal (non-leaf) tree page. This function ** asserts that page number iChild is the left-child if the iIdx'th ** cell in page pParent. Or, if iIdx is equal to the total number of ** cells in pParent, that page number iChild is the right-child of @@ -63828,7 +63828,7 @@ static void assertParentIndex(MemPage *pParent, int iIdx, Pgno iChild){ } } #else -# define assertParentIndex(x,y,z) +# define assertParentIndex(x,y,z) #endif /* @@ -63845,8 +63845,8 @@ static void moveToParent(BtCursor *pCur){ assert( pCur->iPage>0 ); assert( pCur->apPage[pCur->iPage] ); assertParentIndex( - pCur->apPage[pCur->iPage-1], - pCur->aiIdx[pCur->iPage-1], + pCur->apPage[pCur->iPage-1], + pCur->aiIdx[pCur->iPage-1], pCur->apPage[pCur->iPage]->pgno ); testcase( pCur->aiIdx[pCur->iPage-1] > pCur->apPage[pCur->iPage-1]->nCell ); @@ -63860,19 +63860,19 @@ static void moveToParent(BtCursor *pCur){ ** ** If the table has a virtual root page, then the cursor is moved to point ** to the virtual root page instead of the actual root page. A table has a -** virtual root page when the actual root page contains no cells and a +** virtual root page when the actual root page contains no cells and a ** single child page. This can only happen with the table rooted at page 1. ** -** If the b-tree structure is empty, the cursor state is set to +** If the b-tree structure is empty, the cursor state is set to ** CURSOR_INVALID. Otherwise, the cursor is set to point to the first ** cell located on the root (or virtual root) page and the cursor state ** is set to CURSOR_VALID. ** ** If this function returns successfully, it may be assumed that the -** page-header flags indicate that the [virtual] root-page is the expected +** page-header flags indicate that the [virtual] root-page is the expected ** kind of b-tree page (i.e. if when opening the cursor the caller did not ** specify a KeyInfo structure the flags byte is set to 0x05 or 0x0D, -** indicating a table b-tree, or if the caller did specify a KeyInfo +** indicating a table b-tree, or if the caller did specify a KeyInfo ** structure the flags byte is set to 0x02 or 0x0A, indicating an index ** b-tree). */ @@ -63920,19 +63920,19 @@ static int moveToRoot(BtCursor *pCur){ /* If pCur->pKeyInfo is not NULL, then the caller that opened this cursor ** expected to open it on an index b-tree. Otherwise, if pKeyInfo is ** NULL, the caller expects a table b-tree. If this is not the case, - ** return an SQLITE_CORRUPT error. + ** return an SQLITE_CORRUPT error. ** ** Earlier versions of SQLite assumed that this test could not fail ** if the root page was already loaded when this function was called (i.e. - ** if pCur->iPage>=0). But this is not so if the database is corrupted - ** in such a way that page pRoot is linked into a second b-tree table + ** if pCur->iPage>=0). But this is not so if the database is corrupted + ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ assert( pRoot->intKey==1 || pRoot->intKey==0 ); if( pRoot->isInit==0 || (pCur->pKeyInfo==0)!=pRoot->intKey ){ return SQLITE_CORRUPT_BKPT; } -skip_init: +skip_init: pCur->aiIdx[0] = 0; pCur->info.nSize = 0; pCur->curFlags &= ~(BTCF_AtLast|BTCF_ValidNKey|BTCF_ValidOvfl); @@ -64032,14 +64032,14 @@ SQLITE_PRIVATE int sqlite3BtreeFirst(BtCursor *pCur, int *pRes){ */ SQLITE_PRIVATE int sqlite3BtreeLast(BtCursor *pCur, int *pRes){ int rc; - + assert( cursorOwnsBtShared(pCur) ); assert( sqlite3_mutex_held(pCur->pBtree->db->mutex) ); /* If the cursor already points to the last entry, this is a no-op. */ if( CURSOR_VALID==pCur->eState && (pCur->curFlags & BTCF_AtLast)!=0 ){ #ifdef SQLITE_DEBUG - /* This block serves to assert() that the cursor really does point + /* This block serves to assert() that the cursor really does point ** to the last entry in the b-tree. */ int ii; for(ii=0; iiiPage; ii++){ @@ -64065,16 +64065,16 @@ SQLITE_PRIVATE int sqlite3BtreeLast(BtCursor *pCur, int *pRes){ }else{ pCur->curFlags &= ~BTCF_AtLast; } - + } } return rc; } -/* Move the cursor so that it points to an entry near the key +/* Move the cursor so that it points to an entry near the key ** specified by pIdxKey or intKey. Return a success code. ** -** For INTKEY tables, the intKey parameter is used. pIdxKey +** For INTKEY tables, the intKey parameter is used. pIdxKey ** must be NULL. For index tables, pIdxKey is used and intKey ** is ignored. ** @@ -64084,7 +64084,7 @@ SQLITE_PRIVATE int sqlite3BtreeLast(BtCursor *pCur, int *pRes){ ** before or after the key. ** ** An integer is written into *pRes which is the result of -** comparing the key with the entry to which the cursor is +** comparing the key with the entry to which the cursor is ** pointing. The meaning of the integer written into ** *pRes is as follows: ** @@ -64099,7 +64099,7 @@ SQLITE_PRIVATE int sqlite3BtreeLast(BtCursor *pCur, int *pRes){ ** is larger than intKey/pIdxKey. ** ** For index tables, the pIdxKey->eqSeen field is set to 1 if there -** exists an entry in the table that exactly matches pIdxKey. +** exists an entry in the table that exactly matches pIdxKey. */ SQLITE_PRIVATE int sqlite3BtreeMovetoUnpacked( BtCursor *pCur, /* The cursor to be moved */ @@ -64152,8 +64152,8 @@ SQLITE_PRIVATE int sqlite3BtreeMovetoUnpacked( if( pIdxKey ){ xRecordCompare = sqlite3VdbeFindCompare(pIdxKey); pIdxKey->errCode = 0; - assert( pIdxKey->default_rc==1 - || pIdxKey->default_rc==0 + assert( pIdxKey->default_rc==1 + || pIdxKey->default_rc==0 || pIdxKey->default_rc==-1 ); }else{ @@ -64234,9 +64234,9 @@ SQLITE_PRIVATE int sqlite3BtreeMovetoUnpacked( /* The maximum supported page-size is 65536 bytes. This means that ** the maximum number of record bytes stored on an index B-Tree ** page is less than 16384 bytes and may be stored as a 2-byte - ** varint. This information is used to attempt to avoid parsing - ** the entire cell by checking for the cases where the record is - ** stored entirely within the b-tree page by inspecting the first + ** varint. This information is used to attempt to avoid parsing + ** the entire cell by checking for the cases where the record is + ** stored entirely within the b-tree page by inspecting the first ** 2 bytes of the cell. */ nCell = pCell[0]; @@ -64246,10 +64246,10 @@ SQLITE_PRIVATE int sqlite3BtreeMovetoUnpacked( ** b-tree page. */ testcase( pCell+nCell+1==pPage->aDataEnd ); c = xRecordCompare(nCell, (void*)&pCell[1], pIdxKey); - }else if( !(pCell[1] & 0x80) + }else if( !(pCell[1] & 0x80) && (nCell = ((nCell&0x7f)<<7) + pCell[1])<=pPage->maxLocal ){ - /* The record-size field is a 2 byte varint and the record + /* The record-size field is a 2 byte varint and the record ** fits entirely on the main b-tree page. */ testcase( pCell+nCell+2==pPage->aDataEnd ); c = xRecordCompare(nCell, (void*)&pCell[2], pIdxKey); @@ -64257,10 +64257,10 @@ SQLITE_PRIVATE int sqlite3BtreeMovetoUnpacked( /* The record flows over onto one or more overflow pages. In ** this case the whole cell needs to be parsed, a buffer allocated ** and accessPayload() used to retrieve the record into the - ** buffer before VdbeRecordCompare() can be called. + ** buffer before VdbeRecordCompare() can be called. ** ** If the record is corrupt, the xRecordCompare routine may read - ** up to two varints past the end of the buffer. An extra 18 + ** up to two varints past the end of the buffer. An extra 18 ** bytes of padding is allocated at the end of the buffer in ** case this happens. */ void *pCellKey; @@ -64290,7 +64290,7 @@ SQLITE_PRIVATE int sqlite3BtreeMovetoUnpacked( c = xRecordCompare(nCell, pCellKey, pIdxKey); sqlite3_free(pCellKey); } - assert( + assert( (pIdxKey->errCode!=SQLITE_CORRUPT || c==0) && (pIdxKey->errCode!=SQLITE_NOMEM || pCur->pBtree->db->mallocFailed) ); @@ -64406,7 +64406,7 @@ static SQLITE_NOINLINE int btreeNext(BtCursor *pCur, int *pRes){ idx = ++pCur->aiIdx[pCur->iPage]; assert( pPage->isInit ); - /* If the database file is corrupt, it is possible for the value of idx + /* If the database file is corrupt, it is possible for the value of idx ** to be invalid here. This can only occur if a second cursor modifies ** the page while cursor pCur is holding a reference to it. Which can ** only happen if the database is corrupt in such a way as to link the @@ -64571,7 +64571,7 @@ SQLITE_PRIVATE int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){ ** SQLITE_OK is returned on success. Any other return value indicates ** an error. *ppPage is set to NULL in the event of an error. ** -** If the "nearby" parameter is not 0, then an effort is made to +** If the "nearby" parameter is not 0, then an effort is made to ** locate a page close to the page number "nearby". This can be used in an ** attempt to keep related pages close to each other in the database file, ** which in turn can make database access faster. @@ -64613,7 +64613,7 @@ static int allocateBtreePage( Pgno iTrunk; u8 searchList = 0; /* If the free-list must be searched for 'nearby' */ u32 nSearch = 0; /* Count of the number of search attempts */ - + /* If eMode==BTALLOC_EXACT and a query of the pointer-map ** shows that the page 'nearby' is somewhere on the free-list, then ** the entire-list will be searched for that page. @@ -64676,8 +64676,8 @@ static int allocateBtreePage( ** is the number of leaf page pointers to follow. */ k = get4byte(&pTrunk->aData[4]); if( k==0 && !searchList ){ - /* The trunk has no leaves and the list is not being searched. - ** So extract the trunk page itself and use it as the newly + /* The trunk has no leaves and the list is not being searched. + ** So extract the trunk page itself and use it as the newly ** allocated page */ assert( pPrevTrunk==0 ); rc = sqlite3PagerWrite(pTrunk->pDbPage); @@ -64694,8 +64694,8 @@ static int allocateBtreePage( rc = SQLITE_CORRUPT_BKPT; goto end_allocate_page; #ifndef SQLITE_OMIT_AUTOVACUUM - }else if( searchList - && (nearby==iTrunk || (iTrunkaData[0], &pTrunk->aData[0], 4); } }else{ - /* The trunk page is required by the caller but it contains + /* The trunk page is required by the caller but it contains ** pointers to free-list leaves. The first leaf becomes a trunk ** page in this case. */ MemPage *pNewTrunk; Pgno iNewTrunk = get4byte(&pTrunk->aData[8]); - if( iNewTrunk>mxPage ){ + if( iNewTrunk>mxPage ){ rc = SQLITE_CORRUPT_BKPT; goto end_allocate_page; } @@ -64794,8 +64794,8 @@ static int allocateBtreePage( goto end_allocate_page; } testcase( iPage==mxPage ); - if( !searchList - || (iPage==nearby || (iPagepPage1; /* Local reference to page 1 */ MemPage *pPage; /* Page being freed. May be NULL. */ int rc; /* Return Code */ @@ -65008,7 +65008,7 @@ static int freePage2(BtShared *pBt, MemPage *pMemPage, Pgno iPage){ /* If control flows to this point, then it was not possible to add the ** the page being freed as a leaf page of the first trunk in the free-list. - ** Possibly because the free-list is empty, or possibly because the + ** Possibly because the free-list is empty, or possibly because the ** first trunk in the free-list is full. Either way, the page being freed ** will become the new first trunk page in the free-list. */ @@ -65066,15 +65066,15 @@ static int clearCell( assert( pBt->usableSize > 4 ); ovflPageSize = pBt->usableSize - 4; nOvfl = (pInfo->nPayload - pInfo->nLocal + ovflPageSize - 1)/ovflPageSize; - assert( nOvfl>0 || + assert( nOvfl>0 || (CORRUPT_DB && (pInfo->nPayload + ovflPageSize)btreePagecount(pBt) ){ - /* 0 is not a legal page number and page 1 cannot be an - ** overflow page. Therefore if ovflPgno<2 or past the end of the + /* 0 is not a legal page number and page 1 cannot be an + ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ return SQLITE_CORRUPT_BKPT; } @@ -65086,11 +65086,11 @@ static int clearCell( if( ( pOvfl || ((pOvfl = btreePageLookup(pBt, ovflPgno))!=0) ) && sqlite3PagerPageRefcount(pOvfl->pDbPage)!=1 ){ - /* There is no reason any cursor should have an outstanding reference + /* There is no reason any cursor should have an outstanding reference ** to an overflow page belonging to a cell that is being deleted/updated. - ** So if there exists more than one reference to this page, then it - ** must not really be an overflow page and the database must be corrupt. - ** It is helpful to detect this before calling freePage2(), as + ** So if there exists more than one reference to this page, then it + ** must not really be an overflow page and the database must be corrupt. + ** It is helpful to detect this before calling freePage2(), as ** freePage2() may zero the page contents if secure-delete mode is ** enabled. If this 'overflow' page happens to be a page that the ** caller is iterating through or using in some other way, this @@ -65162,7 +65162,7 @@ static int fillInCell( pSrc = pX->pKey; nHeader += putVarint32(&pCell[nHeader], nPayload); } - + /* Fill in the payload */ if( nPayload<=pPage->maxLocal ){ n = nHeader + nPayload; @@ -65215,8 +65215,8 @@ static int fillInCell( if( pBt->autoVacuum ){ do{ pgnoOvfl++; - } while( - PTRMAP_ISPAGE(pBt, pgnoOvfl) || pgnoOvfl==PENDING_BYTE_PAGE(pBt) + } while( + PTRMAP_ISPAGE(pBt, pgnoOvfl) || pgnoOvfl==PENDING_BYTE_PAGE(pBt) ); } #endif @@ -65224,9 +65224,9 @@ static int fillInCell( #ifndef SQLITE_OMIT_AUTOVACUUM /* If the database supports auto-vacuum, and the second or subsequent ** overflow page is being allocated, add an entry to the pointer-map - ** for that page now. + ** for that page now. ** - ** If this is the first overflow page, then write a partial entry + ** If this is the first overflow page, then write a partial entry ** to the pointer-map. If we write nothing to this pointer-map slot, ** then the optimistic overflow chain processing in clearCell() ** may misinterpret the uninitialized values and delete the @@ -65348,8 +65348,8 @@ static void dropCell(MemPage *pPage, int idx, int sz, int *pRC){ ** will not fit, then make a copy of the cell content into pTemp if ** pTemp is not null. Regardless of pTemp, allocate a new entry ** in pPage->apOvfl[] and make it point to the cell content (either -** in pTemp or the original pCell) and also record its index. -** Allocating a new entry in pPage->aCell[] implies that +** in pTemp or the original pCell) and also record its index. +** Allocating a new entry in pPage->aCell[] implies that ** pPage->nOverflow is incremented. ** ** *pRC must be SQLITE_OK when this routine is called. @@ -65490,16 +65490,16 @@ static u16 cachedCellSize(CellArray *p, int N){ } /* -** Array apCell[] contains pointers to nCell b-tree page cells. The +** Array apCell[] contains pointers to nCell b-tree page cells. The ** szCell[] array contains the size in bytes of each cell. This function ** replaces the current contents of page pPg with the contents of the cell ** array. ** ** Some of the cells in apCell[] may currently be stored in pPg. This -** function works around problems caused by this by making a copy of any +** function works around problems caused by this by making a copy of any ** such cells before overwriting the page data. ** -** The MemPage.nFree field is invalidated by this function. It is the +** The MemPage.nFree field is invalidated by this function. It is the ** responsibility of the caller to set it correctly. */ static int rebuildPage( @@ -65548,8 +65548,8 @@ static int rebuildPage( /* ** Array apCell[] contains nCell pointers to b-tree cells. Array szCell -** contains the size in bytes of each such cell. This function attempts to -** add the cells stored in the array to page pPg. If it cannot (because +** contains the size in bytes of each such cell. This function attempts to +** add the cells stored in the array to page pPg. If it cannot (because ** the page needs to be defragmented before the cells will fit), non-zero ** is returned. Otherwise, if the cells are added successfully, zero is ** returned. @@ -65560,7 +65560,7 @@ static int rebuildPage( ** cell in the array. It is the responsibility of the caller to ensure ** that it is safe to overwrite this part of the cell-pointer array. ** -** When this function is called, *ppData points to the start of the +** When this function is called, *ppData points to the start of the ** content area on page pPg. If the size of the content area is extended, ** *ppData is updated to point to the new start of the content area ** before returning. @@ -65609,9 +65609,9 @@ static int pageInsertArray( } /* -** Array apCell[] contains nCell pointers to b-tree cells. Array szCell +** Array apCell[] contains nCell pointers to b-tree cells. Array szCell ** contains the size in bytes of each such cell. This function adds the -** space associated with each cell in the array that is currently stored +** space associated with each cell in the array that is currently stored ** within the body of pPg to the pPg free-list. The cell-pointers and other ** fields of the page are not updated. ** @@ -65821,7 +65821,7 @@ static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){ /* This error condition is now caught prior to reaching this function */ if( NEVER(pPage->nCell==0) ) return SQLITE_CORRUPT_BKPT; - /* Allocate a new page. This page will become the right-sibling of + /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell ** may be inserted. If both these operations are successful, proceed. */ @@ -65842,7 +65842,7 @@ static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){ pNew->nFree = pBt->usableSize - pNew->cellOffset - 2 - szCell; /* If this is an auto-vacuum database, update the pointer map - ** with entries for the new page, and any pointer from the + ** with entries for the new page, and any pointer from the ** cell on the page to an overflow page. If either of these ** operations fails, the return code is set, but the contents ** of the parent page are still manipulated by thh code below. @@ -65856,14 +65856,14 @@ static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){ ptrmapPutOvflPtr(pNew, pCell, &rc); } } - + /* Create a divider cell to insert into pParent. The divider cell ** consists of a 4-byte page number (the page number of pPage) and ** a variable length key value (which must be the same value as the ** largest key on pPage). ** - ** To find the largest key value on pPage, first find the right-most - ** cell on pPage. The first two fields of this cell are the + ** To find the largest key value on pPage, first find the right-most + ** cell on pPage. The first two fields of this cell are the ** record-length (a variable length integer at most 32-bits in size) ** and the key value (a variable length integer, may have any value). ** The first of the while(...) loops below skips over the record-length @@ -65884,7 +65884,7 @@ static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){ /* Set the right-child pointer of pParent to point to the new page. */ put4byte(&pParent->aData[pParent->hdrOffset+8], pgnoNew); - + /* Release the reference to the new page. */ releasePage(pNew); } @@ -65896,7 +65896,7 @@ static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){ #if 0 /* ** This function does not contribute anything to the operation of SQLite. -** it is sometimes activated temporarily while debugging code responsible +** it is sometimes activated temporarily while debugging code responsible ** for setting pointer-map entries. */ static int ptrmapCheckPages(MemPage **apPage, int nPage){ @@ -65911,7 +65911,7 @@ static int ptrmapCheckPages(MemPage **apPage, int nPage){ for(j=0; jnCell; j++){ CellInfo info; u8 *z; - + z = findCell(pPage, j); pPage->xParseCell(pPage, z, &info); if( info.nLocalpgno==1) ? 100 : 0); int rc; int iData; - - + + assert( pFrom->isInit ); assert( pFrom->nFree>=iToHdr ); assert( get2byte(&aFrom[iFromHdr+5]) <= (int)pBt->usableSize ); - + /* Copy the b-tree node content from page pFrom to page pTo. */ iData = get2byte(&aFrom[iFromHdr+5]); memcpy(&aTo[iData], &aFrom[iData], pBt->usableSize-iData); memcpy(&aTo[iToHdr], &aFrom[iFromHdr], pFrom->cellOffset + 2*pFrom->nCell); - + /* Reinitialize page pTo so that the contents of the MemPage structure ** match the new data. The initialization of pTo can actually fail under - ** fairly obscure circumstances, even though it is a copy of initialized + ** fairly obscure circumstances, even though it is a copy of initialized ** page pFrom. */ pTo->isInit = 0; @@ -65983,7 +65983,7 @@ static void copyNodeContent(MemPage *pFrom, MemPage *pTo, int *pRC){ *pRC = rc; return; } - + /* If this is an auto-vacuum database, update the pointer-map entries ** for any b-tree or overflow pages that pTo now contains the pointers to. */ @@ -65998,13 +65998,13 @@ static void copyNodeContent(MemPage *pFrom, MemPage *pTo, int *pRC){ ** (hereafter "the page") and up to 2 siblings so that all pages have about the ** same amount of free space. Usually a single sibling on either side of the ** page are used in the balancing, though both siblings might come from one -** side if the page is the first or last child of its parent. If the page +** side if the page is the first or last child of its parent. If the page ** has fewer than 2 siblings (something which can only happen if the page ** is a root page or a child of a root page) then all available siblings ** participate in the balancing. ** -** The number of siblings of the page might be increased or decreased by -** one or two in an effort to keep pages nearly full but not over full. +** The number of siblings of the page might be increased or decreased by +** one or two in an effort to keep pages nearly full but not over full. ** ** Note that when this routine is called, some of the cells on the page ** might not actually be stored in MemPage.aData[]. This can happen @@ -66015,7 +66015,7 @@ static void copyNodeContent(MemPage *pFrom, MemPage *pTo, int *pRC){ ** inserted into or removed from the parent page (pParent). Doing so ** may cause the parent page to become overfull or underfull. If this ** happens, it is the responsibility of the caller to invoke the correct -** balancing routine to fix this problem (see the balance() routine). +** balancing routine to fix this problem (see the balance() routine). ** ** If this routine fails for any reason, it might leave the database ** in a corrupted state. So if this routine fails, the database should @@ -66030,7 +66030,7 @@ static void copyNodeContent(MemPage *pFrom, MemPage *pTo, int *pRC){ ** of the page-size, the aOvflSpace[] buffer is guaranteed to be large ** enough for all overflow cells. ** -** If aOvflSpace is set to a null pointer, this function returns +** If aOvflSpace is set to a null pointer, this function returns ** SQLITE_NOMEM. */ static int balance_nonroot( @@ -66081,7 +66081,7 @@ static int balance_nonroot( #endif /* At this point pParent may have at most one overflow cell. And if - ** this overflow cell is present, it must be the cell with + ** this overflow cell is present, it must be the cell with ** index iParentIdx. This scenario comes about when this function ** is called (indirectly) from sqlite3BtreeDelete(). */ @@ -66092,11 +66092,11 @@ static int balance_nonroot( return SQLITE_NOMEM_BKPT; } - /* Find the sibling pages to balance. Also locate the cells in pParent - ** that divide the siblings. An attempt is made to find NN siblings on - ** either side of pPage. More siblings are taken from one side, however, + /* Find the sibling pages to balance. Also locate the cells in pParent + ** that divide the siblings. An attempt is made to find NN siblings on + ** either side of pPage. More siblings are taken from one side, however, ** if there are fewer than NN siblings on the other side. If pParent - ** has NB or fewer children then all children of pParent are taken. + ** has NB or fewer children then all children of pParent are taken. ** ** This loop also drops the divider cells from the parent page. This ** way, the remainder of the function does not have to deal with any @@ -66108,7 +66108,7 @@ static int balance_nonroot( nxDiv = 0; }else{ assert( bBulk==0 || bBulk==1 ); - if( iParentIdx==0 ){ + if( iParentIdx==0 ){ nxDiv = 0; }else if( iParentIdx==i ){ nxDiv = i-2+bBulk; @@ -66148,7 +66148,7 @@ static int balance_nonroot( ** This is safe because dropping a cell only overwrites the first ** four bytes of it, and this function does not need the first ** four bytes of the divider cell. So the pointer is safe to use - ** later on. + ** later on. ** ** But not if we are in secure-delete mode. In secure-delete mode, ** the dropCell() routine will overwrite the entire cell with zeroes. @@ -66187,7 +66187,7 @@ static int balance_nonroot( /* EVIDENCE-OF: R-28375-38319 SQLite will never request a scratch buffer ** that is more than 6 times the database page size. */ assert( szScratch<=6*(int)pBt->pageSize ); - b.apCell = sqlite3ScratchMalloc( szScratch ); + b.apCell = sqlite3ScratchMalloc( szScratch ); if( b.apCell==0 ){ rc = SQLITE_NOMEM_BKPT; goto balance_cleanup; @@ -66309,7 +66309,7 @@ static int balance_nonroot( ** Figure out the number of pages needed to hold all b.nCell cells. ** Store this number in "k". Also compute szNew[] which is the total ** size of all cells on the i-th page and cntNew[] which is the index - ** in b.apCell[] of the cell that divides page i from page i+1. + ** in b.apCell[] of the cell that divides page i from page i+1. ** cntNew[k] should equal b.nCell. ** ** Values computed by this block: @@ -66319,7 +66319,7 @@ static int balance_nonroot( ** cntNew[i]: Index in b.apCell[] and b.szCell[] for the first cell to ** the right of the i-th sibling page. ** usableSpace: Number of bytes of space available on each sibling. - ** + ** */ usableSpace = pBt->usableSize - 12 + leafCorrection; for(i=0; ipgno); /* If the sibling pages are not leaves, ensure that the right-child pointer - ** of the right-most new sibling page is set to the value that was + ** of the right-most new sibling page is set to the value that was ** originally in the same field of the right-most old sibling page. */ if( (pageFlags & PTF_LEAF)==0 && nOld!=nNew ){ MemPage *pOld = (nNew>nOld ? apNew : apOld)[nOld-1]; memcpy(&apNew[nNew-1]->aData[8], &pOld->aData[8], 4); } - /* Make any required updates to pointer map entries associated with + /* Make any required updates to pointer map entries associated with ** cells stored on sibling pages following the balance operation. Pointer ** map entries associated with divider cells are set by the insertCell() ** routine. The associated pointer map entries are: @@ -66541,9 +66541,9 @@ static int balance_nonroot( ** b) if the sibling pages are not leaves, the child page associated ** with the cell. ** - ** If the sibling pages are not leaves, then the pointer map entry - ** associated with the right-child of each sibling may also need to be - ** updated. This happens below, after the sibling pages have been + ** If the sibling pages are not leaves, then the pointer map entry + ** associated with the right-child of each sibling may also need to be + ** updated. This happens below, after the sibling pages have been ** populated, not here. */ if( ISAUTOVACUUM ){ @@ -66567,7 +66567,7 @@ static int balance_nonroot( } /* Cell pCell is destined for new sibling page pNew. Originally, it - ** was either part of sibling page iOld (possibly an overflow cell), + ** was either part of sibling page iOld (possibly an overflow cell), ** or else the divider cell to the left of sibling page iOld. So, ** if sibling page iOld had the same page number as pNew, and if ** pCell really was a part of sibling page iOld (not a divider or @@ -66603,9 +66603,9 @@ static int balance_nonroot( if( !pNew->leaf ){ memcpy(&pNew->aData[8], pCell, 4); }else if( leafData ){ - /* If the tree is a leaf-data tree, and the siblings are leaves, - ** then there is no divider cell in b.apCell[]. Instead, the divider - ** cell consists of the integer key for the right-most cell of + /* If the tree is a leaf-data tree, and the siblings are leaves, + ** then there is no divider cell in b.apCell[]. Instead, the divider + ** cell consists of the integer key for the right-most cell of ** the sibling-page assembled above only. */ CellInfo info; @@ -66618,9 +66618,9 @@ static int balance_nonroot( pCell -= 4; /* Obscure case for non-leaf-data trees: If the cell at pCell was ** previously stored on a leaf node, and its reported size was 4 - ** bytes, then it may actually be smaller than this + ** bytes, then it may actually be smaller than this ** (see btreeParseCellPtr(), 4 bytes is the minimum size of - ** any cell). But it is important to pass the correct size to + ** any cell). But it is important to pass the correct size to ** insertCell(), so reparse the cell now. ** ** This can only happen for b-trees used to evaluate "IN (SELECT ...)" @@ -66712,8 +66712,8 @@ static int balance_nonroot( ** b-tree structure by one. This is described as the "balance-shallower" ** sub-algorithm in some documentation. ** - ** If this is an auto-vacuum database, the call to copyNodeContent() - ** sets all pointer-map entries corresponding to database image pages + ** If this is an auto-vacuum database, the call to copyNodeContent() + ** sets all pointer-map entries corresponding to database image pages ** for which the pointer is stored within the content being copied. ** ** It is critical that the child page be defragmented before being @@ -66724,7 +66724,7 @@ static int balance_nonroot( assert( nNew==1 || CORRUPT_DB ); rc = defragmentPage(apNew[0]); testcase( rc!=SQLITE_OK ); - assert( apNew[0]->nFree == + assert( apNew[0]->nFree == (get2byte(&apNew[0]->aData[5])-apNew[0]->cellOffset-apNew[0]->nCell*2) || rc!=SQLITE_OK ); @@ -66753,7 +66753,7 @@ static int balance_nonroot( #if 0 if( ISAUTOVACUUM && rc==SQLITE_OK && apNew[0]->isInit ){ /* The ptrmapCheckPages() contains assert() statements that verify that - ** all pointer map pages are set correctly. This is helpful while + ** all pointer map pages are set correctly. This is helpful while ** debugging. This is usually disabled because a corrupt database may ** cause an assert() statement to fail. */ ptrmapCheckPages(apNew, nNew); @@ -66783,15 +66783,15 @@ balance_cleanup: ** ** A new child page is allocated and the contents of the current root ** page, including overflow cells, are copied into the child. The root -** page is then overwritten to make it an empty page with the right-child +** page is then overwritten to make it an empty page with the right-child ** pointer pointing to the new page. ** -** Before returning, all pointer-map entries corresponding to pages +** Before returning, all pointer-map entries corresponding to pages ** that the new child-page now contains pointers to are updated. The ** entry corresponding to the new right-child pointer of the root ** page is also updated. ** -** If successful, *ppChild is set to contain a reference to the child +** If successful, *ppChild is set to contain a reference to the child ** page and SQLITE_OK is returned. In this case the caller is required ** to call releasePage() on *ppChild exactly once. If an error occurs, ** an error code is returned and *ppChild is set to 0. @@ -66805,7 +66805,7 @@ static int balance_deeper(MemPage *pRoot, MemPage **ppChild){ assert( pRoot->nOverflow>0 ); assert( sqlite3_mutex_held(pBt->mutex) ); - /* Make pRoot, the root page of the b-tree, writable. Allocate a new + /* Make pRoot, the root page of the b-tree, writable. Allocate a new ** page that will become the new right-child of pPage. Copy the contents ** of the node stored on pRoot into the new child page. */ @@ -66846,7 +66846,7 @@ static int balance_deeper(MemPage *pRoot, MemPage **ppChild){ /* ** The page that pCur currently points to has just been modified in ** some way. This function figures out if this modification means the -** tree needs to be balanced, and if so calls the appropriate balancing +** tree needs to be balanced, and if so calls the appropriate balancing ** routine. Balancing routines are: ** ** balance_quick() @@ -66872,7 +66872,7 @@ static int balance(BtCursor *pCur){ ** balance_deeper() function to create a new child for the root-page ** and copy the current contents of the root-page to it. The ** next iteration of the do-loop will balance the child page. - */ + */ assert( balance_deeper_called==0 ); VVA_ONLY( balance_deeper_called++ ); rc = balance_deeper(pPage, &pCur->apPage[1]); @@ -66903,17 +66903,17 @@ static int balance(BtCursor *pCur){ /* Call balance_quick() to create a new sibling of pPage on which ** to store the overflow cell. balance_quick() inserts a new cell ** into pParent, which may cause pParent overflow. If this - ** happens, the next iteration of the do-loop will balance pParent + ** happens, the next iteration of the do-loop will balance pParent ** use either balance_nonroot() or balance_deeper(). Until this ** happens, the overflow cell is stored in the aBalanceQuickSpace[] - ** buffer. + ** buffer. ** ** The purpose of the following assert() is to check that only a ** single call to balance_quick() is made for each call to this ** function. If this were not verified, a subtle bug involving reuse ** of the aBalanceQuickSpace[] might sneak in. */ - assert( balance_quick_called==0 ); + assert( balance_quick_called==0 ); VVA_ONLY( balance_quick_called++ ); rc = balance_quick(pParent, pPage, aBalanceQuickSpace); }else @@ -66924,15 +66924,15 @@ static int balance(BtCursor *pCur){ ** modifying the contents of pParent, which may cause pParent to ** become overfull or underfull. The next iteration of the do-loop ** will balance the parent page to correct this. - ** + ** ** If the parent page becomes overfull, the overflow cell or cells - ** are stored in the pSpace buffer allocated immediately below. + ** are stored in the pSpace buffer allocated immediately below. ** A subsequent iteration of the do-loop will deal with this by ** calling balance_nonroot() (balance_deeper() may be called first, ** but it doesn't deal with overflow cells - just moves them to a - ** different page). Once this subsequent call to balance_nonroot() + ** different page). Once this subsequent call to balance_nonroot() ** has completed, it is safe to release the pSpace buffer used by - ** the previous call, as the overflow cell data will have been + ** the previous call, as the overflow cell data will have been ** copied either into the body of a database page or into the new ** pSpace buffer passed to the latter call to balance_nonroot(). */ @@ -66940,9 +66940,9 @@ static int balance(BtCursor *pCur){ rc = balance_nonroot(pParent, iIdx, pSpace, iPage==1, pCur->hints&BTREE_BULKLOAD); if( pFree ){ - /* If pFree is not NULL, it points to the pSpace buffer used + /* If pFree is not NULL, it points to the pSpace buffer used ** by a previous call to balance_nonroot(). Its contents are - ** now stored either on real database pages or within the + ** now stored either on real database pages or within the ** new pSpace buffer, so it may be safely freed here. */ sqlite3PageFree(pFree); } @@ -66982,7 +66982,7 @@ static int balance(BtCursor *pCur){ ** hold the content of the row. ** ** For an index btree (used for indexes and WITHOUT ROWID tables), the -** key is an arbitrary byte sequence stored in pX.pKey,nKey. The +** key is an arbitrary byte sequence stored in pX.pKey,nKey. The ** pX.pData,nData,nZero fields must be zero. ** ** If the seekResult parameter is non-zero, then a successful call to @@ -67040,8 +67040,8 @@ SQLITE_PRIVATE int sqlite3BtreeInsert( ** ** In some cases, the call to btreeMoveto() below is a no-op. For ** example, when inserting data into a table with auto-generated integer - ** keys, the VDBE layer invokes sqlite3BtreeLast() to figure out the - ** integer key to use. It then calls this function to actually insert the + ** keys, the VDBE layer invokes sqlite3BtreeLast() to figure out the + ** integer key to use. It then calls this function to actually insert the ** data into the intkey B-Tree. In this case btreeMoveto() recognizes ** that the cursor is already where it needs to be and returns without ** doing any work. To avoid thwarting these optimizations, it is important @@ -67054,13 +67054,13 @@ SQLITE_PRIVATE int sqlite3BtreeInsert( if( pCur->pKeyInfo==0 ){ assert( pX->pKey==0 ); - /* If this is an insert into a table b-tree, invalidate any incrblob + /* If this is an insert into a table b-tree, invalidate any incrblob ** cursors open on the row being replaced */ invalidateIncrblobCursors(p, pX->nKey, 0); - /* If BTREE_SAVEPOSITION is set, the cursor must already be pointing + /* If BTREE_SAVEPOSITION is set, the cursor must already be pointing ** to a row with the same key as the new entry being inserted. */ - assert( (flags & BTREE_SAVEPOSITION)==0 || + assert( (flags & BTREE_SAVEPOSITION)==0 || ((pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey) ); /* If the cursor is currently on the last row and we are appending a @@ -67144,7 +67144,7 @@ SQLITE_PRIVATE int sqlite3BtreeInsert( assert( pPage->nOverflow==0 || rc==SQLITE_OK ); assert( rc!=SQLITE_OK || pPage->nCell>0 || pPage->nOverflow>0 ); - /* If no error has occurred and pPage has an overflow cell, call balance() + /* If no error has occurred and pPage has an overflow cell, call balance() ** to redistribute the cells within the tree. Since balance() may move ** the cursor, zero the BtCursor.info.nSize and BTCF_ValidNKey ** variables. @@ -67171,7 +67171,7 @@ SQLITE_PRIVATE int sqlite3BtreeInsert( rc = balance(pCur); /* Must make sure nOverflow is reset to zero even if the balance() - ** fails. Internal data structure corruption will result otherwise. + ** fails. Internal data structure corruption will result otherwise. ** Also, set the cursor state to invalid. This stops saveCursorPosition() ** from trying to save the current position of the cursor. */ pCur->apPage[pCur->iPage]->nOverflow = 0; @@ -67198,7 +67198,7 @@ end_insert: } /* -** Delete the entry that the cursor is pointing to. +** Delete the entry that the cursor is pointing to. ** ** If the BTREE_SAVEPOSITION bit of the flags parameter is zero, then ** the cursor is left pointing at an arbitrary location after the delete. @@ -67216,12 +67216,12 @@ end_insert: */ SQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){ Btree *p = pCur->pBtree; - BtShared *pBt = p->pBt; + BtShared *pBt = p->pBt; int rc; /* Return code */ MemPage *pPage; /* Page to delete cell from */ unsigned char *pCell; /* Pointer to cell to delete */ int iCellIdx; /* Index of cell to delete */ - int iCellDepth; /* Depth of node containing pCell */ + int iCellDepth; /* Depth of node containing pCell */ CellInfo info; /* Size of the cell being deleted */ int bSkipnext = 0; /* Leaf cursor in SKIPNEXT state */ u8 bPreserve = flags & BTREE_SAVEPOSITION; /* Keep cursor valid */ @@ -67244,14 +67244,14 @@ SQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){ /* If the bPreserve flag is set to true, then the cursor position must ** be preserved following this delete operation. If the current delete ** will cause a b-tree rebalance, then this is done by saving the cursor - ** key and leaving the cursor in CURSOR_REQUIRESEEK state before - ** returning. + ** key and leaving the cursor in CURSOR_REQUIRESEEK state before + ** returning. ** ** Or, if the current delete will not cause a rebalance, then the cursor ** will be left in CURSOR_SKIPNEXT state pointing to the entry immediately ** before or after the deleted entry. In this case set bSkipnext to true. */ if( bPreserve ){ - if( !pPage->leaf + if( !pPage->leaf || (pPage->nFree+cellSizePtr(pPage,pCell)+2)>(int)(pBt->usableSize*2/3) ){ /* A b-tree rebalance will be required after deleting this entry. @@ -67336,7 +67336,7 @@ SQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){ ** on the leaf node first. If the balance proceeds far enough up the ** tree that we can be sure that any problem in the internal node has ** been corrected, so be it. Otherwise, after balancing the leaf node, - ** walk the cursor up the tree to the internal node and balance it as + ** walk the cursor up the tree to the internal node and balance it as ** well. */ rc = balance(pCur); if( rc==SQLITE_OK && pCur->iPage>iCellDepth ){ @@ -67485,7 +67485,7 @@ static int btreeCreateTable(Btree *p, int *piTable, int createTabFlags){ } }else{ pRoot = pPageMove; - } + } /* Update the pointer-map and meta-data with the new root-page number. */ ptrmapPut(pBt, pgnoRoot, PTRMAP_ROOTPAGE, 0, &rc); @@ -67638,12 +67638,12 @@ SQLITE_PRIVATE int sqlite3BtreeClearTableOfCursor(BtCursor *pCur){ ** cursors on the table. ** ** If AUTOVACUUM is enabled and the page at iTable is not the last -** root page in the database file, then the last root page +** root page in the database file, then the last root page ** in the database file is moved into the slot formerly occupied by ** iTable and that last slot formerly occupied by the last root page ** is added to the freelist instead of iTable. In this say, all ** root pages are kept at the beginning of the database file, which -** is necessary for AUTOVACUUM to work right. *piMoved is set to the +** is necessary for AUTOVACUUM to work right. *piMoved is set to the ** page number that used to be the last root page in the file before ** the move. If no page gets moved, *piMoved is set to 0. ** The last root page is recorded in meta[3] and the value of @@ -67678,7 +67678,7 @@ static int btreeDropTable(Btree *p, Pgno iTable, int *piMoved){ if( iTable==maxRootPgno ){ /* If the table being dropped is the table with the largest root-page - ** number in the database, put the root page on the free list. + ** number in the database, put the root page on the free list. */ freePage(pPage, &rc); releasePage(pPage); @@ -67687,7 +67687,7 @@ static int btreeDropTable(Btree *p, Pgno iTable, int *piMoved){ } }else{ /* The table being dropped does not have the largest root-page - ** number in the database. So move the page that does into the + ** number in the database. So move the page that does into the ** gap left by the deleted root-page. */ MemPage *pMove; @@ -67729,7 +67729,7 @@ static int btreeDropTable(Btree *p, Pgno iTable, int *piMoved){ releasePage(pPage); } #endif - return rc; + return rc; } SQLITE_PRIVATE int sqlite3BtreeDropTable(Btree *p, int iTable, int *piMoved){ int rc; @@ -67748,7 +67748,7 @@ SQLITE_PRIVATE int sqlite3BtreeDropTable(Btree *p, int iTable, int *piMoved){ ** is the number of free pages currently in the database. Meta[1] ** through meta[15] are available for use by higher layers. Meta[0] ** is read-only, the others are read/write. -** +** ** The schema layer numbers meta values differently. At the schema ** layer (and the SetCookie and ReadCookie opcodes) the number of ** free pages is not visible. So Cookie[0] is the same as Meta[1]. @@ -67819,7 +67819,7 @@ SQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree *p, int idx, u32 iMeta){ ** The first argument, pCur, is a cursor opened on some b-tree. Count the ** number of entries in the b-tree and write the result to *pnEntry. ** -** SQLITE_OK is returned if the operation is successfully executed. +** SQLITE_OK is returned if the operation is successfully executed. ** Otherwise, if an error is encountered (i.e. an IO error or database ** corruption) an SQLite error code is returned. */ @@ -67834,13 +67834,13 @@ SQLITE_PRIVATE int sqlite3BtreeCount(BtCursor *pCur, i64 *pnEntry){ rc = moveToRoot(pCur); /* Unless an error occurs, the following loop runs one iteration for each - ** page in the B-Tree structure (not including overflow pages). + ** page in the B-Tree structure (not including overflow pages). */ while( rc==SQLITE_OK ){ int iIdx; /* Index of child node in parent */ MemPage *pPage; /* Current page of the b-tree */ - /* If this is a leaf page or the tree is not an int-key tree, then + /* If this is a leaf page or the tree is not an int-key tree, then ** this page contains countable entries. Increment the entry counter ** accordingly. */ @@ -67849,7 +67849,7 @@ SQLITE_PRIVATE int sqlite3BtreeCount(BtCursor *pCur, i64 *pnEntry){ nEntry += pPage->nCell; } - /* pPage is a leaf node. This loop navigates the cursor so that it + /* pPage is a leaf node. This loop navigates the cursor so that it ** points to the first interior cell that it points to the parent of ** the next page in the tree that has not yet been visited. The ** pCur->aiIdx[pCur->iPage] value is set to the index of the parent cell @@ -67873,7 +67873,7 @@ SQLITE_PRIVATE int sqlite3BtreeCount(BtCursor *pCur, i64 *pnEntry){ pPage = pCur->apPage[pCur->iPage]; } - /* Descend to the child node of the cell that the cursor currently + /* Descend to the child node of the cell that the cursor currently ** points at. This is the right-child if (iIdx==pPage->nCell). */ iIdx = pCur->aiIdx[pCur->iPage]; @@ -67969,7 +67969,7 @@ static int checkRef(IntegrityCk *pCheck, Pgno iPage){ #ifndef SQLITE_OMIT_AUTOVACUUM /* -** Check that the entry in the pointer-map for page iChild maps to +** Check that the entry in the pointer-map for page iChild maps to ** page iParent, pointer type ptrType. If not, append an error message ** to pCheck. */ @@ -67992,7 +67992,7 @@ static void checkPtrmap( if( ePtrmapType!=eType || iPtrmapParent!=iParent ){ checkAppendMsg(pCheck, - "Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)", + "Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)", iChild, eType, iParent, ePtrmapType, iPtrmapParent); } } @@ -68090,7 +68090,7 @@ static void checkList( ** property. ** ** This heap is used for cell overlap and coverage testing. Each u32 -** entry represents the span of a cell or freeblock on a btree page. +** entry represents the span of a cell or freeblock on a btree page. ** The upper 16 bits are the index of the first byte of a range and the ** lower 16 bits are the index of the last byte of that range. */ @@ -68120,7 +68120,7 @@ static int btreeHeapPull(u32 *aHeap, u32 *pOut){ aHeap[j] = x; i = j; } - return 1; + return 1; } #ifndef SQLITE_OMIT_INTEGRITY_CHECK @@ -68128,7 +68128,7 @@ static int btreeHeapPull(u32 *aHeap, u32 *pOut){ ** Do various sanity checks on a single page of a tree. Return ** the tree depth. Root pages return 0. Parents of root pages ** return 1, and so forth. -** +** ** These checks are done: ** ** 1. Make sure that cells and freeblocks do not overlap @@ -68320,7 +68320,7 @@ static int checkTreePage( ** ** EVIDENCE-OF: R-20690-50594 The second field of the b-tree page header ** is the offset of the first freeblock, or zero if there are no - ** freeblocks on the page. + ** freeblocks on the page. */ i = get2byte(&data[hdr+1]); while( i>0 ){ @@ -68340,13 +68340,13 @@ static int checkTreePage( assert( (u32)j<=usableSize-4 ); /* Enforced by btreeInitPage() */ i = j; } - /* Analyze the min-heap looking for overlap between cells and/or + /* Analyze the min-heap looking for overlap between cells and/or ** freeblocks, and counting the number of untracked bytes in nFrag. - ** + ** ** Each min-heap entry is of the form: (start_address<<16)|end_address. ** There is an implied first entry the covers the page header, the cell ** pointer index, and the gap between the cell pointer index and the start - ** of cell content. + ** of cell content. ** ** The loop below pulls entries from the min-heap in order and compares ** the start_address against the previous end_address. If there is an @@ -68485,11 +68485,11 @@ SQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck( /* If the database supports auto-vacuum, make sure no tables contain ** references to pointer-map pages. */ - if( getPageReferenced(&sCheck, i)==0 && + if( getPageReferenced(&sCheck, i)==0 && (PTRMAP_PAGENO(pBt, i)!=i || !pBt->autoVacuum) ){ checkAppendMsg(&sCheck, "Page %d is never used", i); } - if( getPageReferenced(&sCheck, i)!=0 && + if( getPageReferenced(&sCheck, i)!=0 && (PTRMAP_PAGENO(pBt, i)==i && pBt->autoVacuum) ){ checkAppendMsg(&sCheck, "Pointer map page %d is referenced", i); } @@ -68551,7 +68551,7 @@ SQLITE_PRIVATE int sqlite3BtreeIsInTrans(Btree *p){ /* ** Run a checkpoint on the Btree passed as the first argument. ** -** Return SQLITE_LOCKED if this or any other connection has an open +** Return SQLITE_LOCKED if this or any other connection has an open ** transaction on the shared-cache the argument Btree is connected to. ** ** Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART. @@ -68590,20 +68590,20 @@ SQLITE_PRIVATE int sqlite3BtreeIsInBackup(Btree *p){ /* ** This function returns a pointer to a blob of memory associated with ** a single shared-btree. The memory is used by client code for its own -** purposes (for example, to store a high-level schema associated with +** purposes (for example, to store a high-level schema associated with ** the shared-btree). The btree layer manages reference counting issues. ** ** The first time this is called on a shared-btree, nBytes bytes of memory -** are allocated, zeroed, and returned to the caller. For each subsequent +** are allocated, zeroed, and returned to the caller. For each subsequent ** call the nBytes parameter is ignored and a pointer to the same blob -** of memory returned. +** of memory returned. ** ** If the nBytes parameter is 0 and the blob of memory has not yet been ** allocated, a null pointer is returned. If the blob has already been ** allocated, it is returned as normal. ** -** Just before the shared-btree is closed, the function passed as the -** xFree argument when the memory allocation was made is invoked on the +** Just before the shared-btree is closed, the function passed as the +** xFree argument when the memory allocation was made is invoked on the ** blob of allocated memory. The xFree function should not call sqlite3_free() ** on the memory, the btree layer does that. */ @@ -68619,8 +68619,8 @@ SQLITE_PRIVATE void *sqlite3BtreeSchema(Btree *p, int nBytes, void(*xFree)(void } /* -** Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared -** btree as the argument handle holds an exclusive lock on the +** Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared +** btree as the argument handle holds an exclusive lock on the ** sqlite_master table. Otherwise SQLITE_OK. */ SQLITE_PRIVATE int sqlite3BtreeSchemaLocked(Btree *p){ @@ -68661,11 +68661,11 @@ SQLITE_PRIVATE int sqlite3BtreeLockTable(Btree *p, int iTab, u8 isWriteLock){ #ifndef SQLITE_OMIT_INCRBLOB /* -** Argument pCsr must be a cursor opened for writing on an -** INTKEY table currently pointing at a valid table entry. +** Argument pCsr must be a cursor opened for writing on an +** INTKEY table currently pointing at a valid table entry. ** This function modifies the data stored as part of that entry. ** -** Only the data content may only be modified, it is not possible to +** Only the data content may only be modified, it is not possible to ** change the length of the data stored. If this function is called with ** parameters that attempt to write past the end of the existing data, ** no modifications are made and SQLITE_CORRUPT is returned. @@ -68696,7 +68696,7 @@ SQLITE_PRIVATE int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, void VVA_ONLY(rc =) saveAllCursors(pCsr->pBt, pCsr->pgnoRoot, pCsr); assert( rc==SQLITE_OK ); - /* Check some assumptions: + /* Check some assumptions: ** (a) the cursor is open for writing, ** (b) there is a read/write transaction open, ** (c) the connection holds a write-lock on the table (if required), @@ -68715,7 +68715,7 @@ SQLITE_PRIVATE int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, void return accessPayload(pCsr, offset, amt, (unsigned char *)z, 1); } -/* +/* ** Mark this cursor as an incremental blob cursor. */ SQLITE_PRIVATE void sqlite3BtreeIncrblobCursor(BtCursor *pCur){ @@ -68725,14 +68725,14 @@ SQLITE_PRIVATE void sqlite3BtreeIncrblobCursor(BtCursor *pCur){ #endif /* -** Set both the "read version" (single byte at byte offset 18) and +** Set both the "read version" (single byte at byte offset 18) and ** "write version" (single byte at byte offset 19) fields in the database ** header to iVersion. */ SQLITE_PRIVATE int sqlite3BtreeSetVersion(Btree *pBtree, int iVersion){ BtShared *pBt = pBtree->pBt; int rc; /* Return code */ - + assert( iVersion==1 || iVersion==2 ); /* If setting the version fields to 1, do not automatically open the @@ -68790,7 +68790,7 @@ SQLITE_PRIVATE int sqlite3BtreeSharable(Btree *p){ /* ** Return the number of connections to the BtShared object accessed by -** the Btree handle passed as the only argument. For private caches +** the Btree handle passed as the only argument. For private caches ** this is always 1. For shared caches it may be 1 or greater. */ SQLITE_PRIVATE int sqlite3BtreeConnectionCount(Btree *p){ @@ -68812,7 +68812,7 @@ SQLITE_PRIVATE int sqlite3BtreeConnectionCount(Btree *p){ ** May you share freely, never taking more than you give. ** ************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() +** This file contains the implementation of the sqlite3_backup_XXX() ** API functions and the related features. */ /* #include "sqliteInt.h" */ @@ -68849,15 +68849,15 @@ struct sqlite3_backup { ** Once it has been created using backup_init(), a single sqlite3_backup ** structure may be accessed via two groups of thread-safe entry points: ** -** * Via the sqlite3_backup_XXX() API function backup_step() and +** * Via the sqlite3_backup_XXX() API function backup_step() and ** backup_finish(). Both these functions obtain the source database -** handle mutex and the mutex associated with the source BtShared +** handle mutex and the mutex associated with the source BtShared ** structure, in that order. ** ** * Via the BackupUpdate() and BackupRestart() functions, which are ** invoked by the pager layer to report various state changes in ** the page cache associated with the source database. The mutex -** associated with the source database BtShared structure will always +** associated with the source database BtShared structure will always ** be held when either of these functions are invoked. ** ** The other sqlite3_backup_XXX() API functions, backup_remaining() and @@ -68878,8 +68878,8 @@ struct sqlite3_backup { ** in connection handle pDb. If such a database cannot be found, return ** a NULL pointer and write an error message to pErrorDb. ** -** If the "temp" database is requested, it may need to be opened by this -** function. If an error occurs while doing so, return 0 and write an +** If the "temp" database is requested, it may need to be opened by this +** function. If an error occurs while doing so, return 0 and write an ** error message to pErrorDb. */ static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){ @@ -68922,7 +68922,7 @@ static int setDestPgsz(sqlite3_backup *p){ /* ** Check that there is no open read-transaction on the b-tree passed as the ** second argument. If there is not, return SQLITE_OK. Otherwise, if there -** is an open read-transaction, return SQLITE_ERROR and leave an error +** is an open read-transaction, return SQLITE_ERROR and leave an error ** message in database handle db. */ static int checkReadTransaction(sqlite3 *db, Btree *p){ @@ -68992,13 +68992,13 @@ SQLITE_API sqlite3_backup *sqlite3_backup_init( p->iNext = 1; p->isAttached = 0; - if( 0==p->pSrc || 0==p->pDest - || checkReadTransaction(pDestDb, p->pDest)!=SQLITE_OK + if( 0==p->pSrc || 0==p->pDest + || checkReadTransaction(pDestDb, p->pDest)!=SQLITE_OK ){ /* One (or both) of the named databases did not exist or an OOM ** error was hit. Or there is a transaction open on the destination - ** database. The error has already been written into the pDestDb - ** handle. All that is left to do here is free the sqlite3_backup + ** database. The error has already been written into the pDestDb + ** handle. All that is left to do here is free the sqlite3_backup ** structure. */ sqlite3_free(p); p = 0; @@ -69014,7 +69014,7 @@ SQLITE_API sqlite3_backup *sqlite3_backup_init( } /* -** Argument rc is an SQLite error code. Return true if this error is +** Argument rc is an SQLite error code. Return true if this error is ** considered fatal if encountered during a backup operation. All errors ** are considered fatal except for SQLITE_BUSY and SQLITE_LOCKED. */ @@ -69023,8 +69023,8 @@ static int isFatalError(int rc){ } /* -** Parameter zSrcData points to a buffer containing the data for -** page iSrcPg from the source database. Copy this data into the +** Parameter zSrcData points to a buffer containing the data for +** page iSrcPg from the source database. Copy this data into the ** destination database. */ static int backupOnePage( @@ -69055,7 +69055,7 @@ static int backupOnePage( assert( zSrcData ); /* Catch the case where the destination is an in-memory database and the - ** page sizes of the source and destination differ. + ** page sizes of the source and destination differ. */ if( nSrcPgsz!=nDestPgsz && sqlite3PagerIsMemdb(pDestPager) ){ rc = SQLITE_READONLY; @@ -69081,7 +69081,7 @@ static int backupOnePage( } #endif - /* This loop runs once for each destination page spanned by the source + /* This loop runs once for each destination page spanned by the source ** page. For each iteration, variable iOff is set to the byte offset ** of the destination page. */ @@ -69100,7 +69100,7 @@ static int backupOnePage( ** Then clear the Btree layer MemPage.isInit flag. Both this module ** and the pager code use this trick (clearing the first byte ** of the page 'extra' space to invalidate the Btree layers - ** cached parse of the page). MemPage.isInit is marked + ** cached parse of the page). MemPage.isInit is marked ** "MUST BE FIRST" for this purpose. */ memcpy(zOut, zIn, nCopy); @@ -69120,7 +69120,7 @@ static int backupOnePage( ** exactly iSize bytes. If pFile is not larger than iSize bytes, then ** this function is a no-op. ** -** Return SQLITE_OK if everything is successful, or an SQLite error +** Return SQLITE_OK if everything is successful, or an SQLite error ** code if an error occurs. */ static int backupTruncateFile(sqlite3_file *pFile, i64 iSize){ @@ -69201,7 +69201,7 @@ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){ /* Lock the destination database, if it is not locked already. */ if( SQLITE_OK==rc && p->bDestLocked==0 - && SQLITE_OK==(rc = sqlite3BtreeBeginTrans(p->pDest, 2)) + && SQLITE_OK==(rc = sqlite3BtreeBeginTrans(p->pDest, 2)) ){ p->bDestLocked = 1; sqlite3BtreeGetMeta(p->pDest, BTREE_SCHEMA_VERSION, &p->iDestSchema); @@ -69215,7 +69215,7 @@ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){ if( SQLITE_OK==rc && destMode==PAGER_JOURNALMODE_WAL && pgszSrc!=pgszDest ){ rc = SQLITE_READONLY; } - + /* Now that there is a read-lock on the source database, query the ** source pager for the number of pages in the database. */ @@ -69242,7 +69242,7 @@ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){ attachBackupObject(p); } } - + /* Update the schema version field in the destination database. This ** is to make sure that the schema-version really does change in ** the case where the source and destination databases have the @@ -69268,12 +69268,12 @@ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){ int nDestTruncate; /* Set nDestTruncate to the final number of pages in the destination ** database. The complication here is that the destination page - ** size may be different to the source page size. + ** size may be different to the source page size. ** - ** If the source page size is smaller than the destination page size, + ** If the source page size is smaller than the destination page size, ** round up. In this case the call to sqlite3OsTruncate() below will ** fix the size of the file. However it is important to call - ** sqlite3PagerTruncateImage() here so that any pages in the + ** sqlite3PagerTruncateImage() here so that any pages in the ** destination file that lie beyond the nDestTruncate page mark are ** journalled by PagerCommitPhaseOne() before they are destroyed ** by the file truncation. @@ -69297,7 +69297,7 @@ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){ ** ** * The destination may need to be truncated, and ** - ** * Data stored on the pages immediately following the + ** * Data stored on the pages immediately following the ** pending-byte page in the source database may need to be ** copied into the destination database. */ @@ -69309,7 +69309,7 @@ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){ i64 iEnd; assert( pFile ); - assert( nDestTruncate==0 + assert( nDestTruncate==0 || (i64)nDestTruncate*(i64)pgszDest >= iSize || ( nDestTruncate==(int)(PENDING_BYTE_PAGE(p->pDest->pBt)-1) && iSize>=PENDING_BYTE && iSize<=PENDING_BYTE+pgszDest @@ -69319,7 +69319,7 @@ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){ ** database has been stored in the journal for pDestPager and the ** journal synced to disk. So at this point we may safely modify ** the database file in any way, knowing that if a power failure - ** occurs, the original database will be reconstructed from the + ** occurs, the original database will be reconstructed from the ** journal file. */ sqlite3PagerPagecount(pDestPager, &nDstPage); for(iPg=nDestTruncate; rc==SQLITE_OK && iPg<=(Pgno)nDstPage; iPg++){ @@ -69339,8 +69339,8 @@ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){ /* Write the extra pages and truncate the database file as required */ iEnd = MIN(PENDING_BYTE + pgszDest, iSize); for( - iOff=PENDING_BYTE+pgszSrc; - rc==SQLITE_OK && iOffpDest, 0)) @@ -69373,7 +69373,7 @@ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){ } } } - + /* If bCloseTrans is true, then this function opened a read transaction ** on the source database. Close the read transaction here. There is ** no need to check the return values of the btree methods here, as @@ -69385,7 +69385,7 @@ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){ TESTONLY( rc2 |= ) sqlite3BtreeCommitPhaseTwo(p->pSrc, 0); assert( rc2==SQLITE_OK ); } - + if( rc==SQLITE_IOERR_NOMEM ){ rc = SQLITE_NOMEM_BKPT; } @@ -69465,7 +69465,7 @@ SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p){ } /* -** Return the total number of pages in the source database as of the most +** Return the total number of pages in the source database as of the most ** recent call to sqlite3_backup_step(). */ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p){ @@ -69480,7 +69480,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p){ /* ** This function is called after the contents of page iPage of the -** source database have been modified. If page iPage has already been +** source database have been modified. If page iPage has already been ** copied into the destination database, then the data written to the ** destination is now invalidated. The destination copy of iPage needs ** to be updated with the new data before the backup operation is @@ -69523,7 +69523,7 @@ SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *pBackup, Pgno iPage, con ** Restart the backup process. This is called when the pager layer ** detects that the database has been modified by an external database ** connection. In this case there is no way of knowing which of the -** pages that have been copied into the destination database are still +** pages that have been copied into the destination database are still ** valid and which are not, so the entire process needs to be restarted. ** ** It is assumed that the mutex associated with the BtShared object @@ -69543,8 +69543,8 @@ SQLITE_PRIVATE void sqlite3BackupRestart(sqlite3_backup *pBackup){ ** Copy the complete content of pBtFrom into pBtTo. A transaction ** must be active for both files. ** -** The size of file pTo may be reduced by this operation. If anything -** goes wrong, the transaction on pTo is rolled back. If successful, the +** The size of file pTo may be reduced by this operation. If anything +** goes wrong, the transaction on pTo is rolled back. If successful, the ** transaction is committed before returning. */ SQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){ @@ -69580,9 +69580,9 @@ SQLITE_PRIVATE int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){ /* 0x7FFFFFFF is the hard limit for the number of pages in a database ** file. By passing this as the number of pages to copy to - ** sqlite3_backup_step(), we can guarantee that the copy finishes + ** sqlite3_backup_step(), we can guarantee that the copy finishes ** within a single call (unless an error occurs). The assert() statement - ** checks this assumption - (p->rc) should be set to either SQLITE_DONE + ** checks this assumption - (p->rc) should be set to either SQLITE_DONE ** or an error code. */ sqlite3_backup_step(&b, 0x7FFFFFFF); assert( b.rc!=SQLITE_OK ); @@ -69632,7 +69632,7 @@ copy_finished: ** this: assert( sqlite3VdbeCheckMemInvariants(pMem) ); */ SQLITE_PRIVATE int sqlite3VdbeCheckMemInvariants(Mem *p){ - /* If MEM_Dyn is set then Mem.xDel!=0. + /* If MEM_Dyn is set then Mem.xDel!=0. ** Mem.xDel is might not be initialized if MEM_Dyn is clear. */ assert( (p->flags & MEM_Dyn)==0 || p->xDel!=0 ); @@ -69659,7 +69659,7 @@ SQLITE_PRIVATE int sqlite3VdbeCheckMemInvariants(Mem *p){ ** (4) A static string or blob */ if( (p->flags & (MEM_Str|MEM_Blob)) && p->n>0 ){ - assert( + assert( ((p->szMalloc>0 && p->z==p->zMalloc)? 1 : 0) + ((p->flags&MEM_Dyn)!=0 ? 1 : 0) + ((p->flags&MEM_Ephem)!=0 ? 1 : 0) + @@ -69711,7 +69711,7 @@ SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){ } /* -** Make sure pMem->z points to a writable allocation of at least +** Make sure pMem->z points to a writable allocation of at least ** min(n,32) bytes. ** ** If the bPreserve argument is true, then copy of the content of @@ -69906,7 +69906,7 @@ SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem *pMem, u8 enc, u8 bForce){ /* For a Real or Integer, use sqlite3_snprintf() to produce the UTF-8 ** string representation of the value. Then, if the required encoding ** is UTF-16le or UTF-16be do a translation. - ** + ** ** FIX ME: It would be better if sqlite3_snprintf() could do UTF-16. */ if( fg & MEM_Int ){ @@ -70262,7 +70262,7 @@ SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem *pMem){ } } SQLITE_PRIVATE void sqlite3ValueSetNull(sqlite3_value *p){ - sqlite3VdbeMemSetNull((Mem*)p); + sqlite3VdbeMemSetNull((Mem*)p); } /* @@ -70363,7 +70363,7 @@ SQLITE_PRIVATE int sqlite3VdbeMemTooBig(Mem *p){ } return n>p->db->aLimit[SQLITE_LIMIT_LENGTH]; } - return 0; + return 0; } #ifdef SQLITE_DEBUG @@ -70454,8 +70454,8 @@ SQLITE_PRIVATE void sqlite3VdbeMemMove(Mem *pTo, Mem *pFrom){ ** Change the value of a Mem to be a string or a BLOB. ** ** The memory management strategy depends on the value of the xDel -** parameter. If the value passed is SQLITE_TRANSIENT, then the -** string is copied into a (possibly existing) buffer managed by the +** parameter. If the value passed is SQLITE_TRANSIENT, then the +** string is copied into a (possibly existing) buffer managed by the ** Mem structure. Otherwise, any existing buffer is freed and the ** pointer copied. ** @@ -70598,7 +70598,7 @@ SQLITE_PRIVATE int sqlite3VdbeMemFromBtree( assert( sqlite3BtreeCursorIsValid(pCur) ); assert( !VdbeMemDynamic(pMem) ); - /* Note: the calls to BtreeKeyFetch() and DataFetch() below assert() + /* Note: the calls to BtreeKeyFetch() and DataFetch() below assert() ** that both the BtShared and database handle mutexes are held. */ assert( (pMem->flags & MEM_RowSet)==0 ); zData = (char *)sqlite3BtreePayloadFetch(pCur, &available); @@ -70689,7 +70689,7 @@ SQLITE_PRIVATE sqlite3_value *sqlite3ValueNew(sqlite3 *db){ } /* -** Context object passed by sqlite3Stat4ProbeSetValue() through to +** Context object passed by sqlite3Stat4ProbeSetValue() through to ** valueNew(). See comments above valueNew() for details. */ struct ValueNewStat4Ctx { @@ -70704,9 +70704,9 @@ struct ValueNewStat4Ctx { ** the second argument to this function is NULL, the object is allocated ** by calling sqlite3ValueNew(). ** -** Otherwise, if the second argument is non-zero, then this function is +** Otherwise, if the second argument is non-zero, then this function is ** being called indirectly by sqlite3Stat4ProbeSetValue(). If it has not -** already been allocated, allocate the UnpackedRecord structure that +** already been allocated, allocate the UnpackedRecord structure that ** that function will return to its caller here. Then return a pointer to ** an sqlite3_value within the UnpackedRecord.a[] array. */ @@ -70720,7 +70720,7 @@ static sqlite3_value *valueNew(sqlite3 *db, struct ValueNewStat4Ctx *p){ int nByte; /* Bytes of space to allocate */ int i; /* Counter variable */ int nCol = pIdx->nColumn; /* Number of index columns including rowid */ - + nByte = sizeof(Mem) * nCol + ROUND8(sizeof(UnpackedRecord)); pRec = (UnpackedRecord*)sqlite3DbMallocZero(db, nByte); if( pRec ){ @@ -70741,7 +70741,7 @@ static sqlite3_value *valueNew(sqlite3 *db, struct ValueNewStat4Ctx *p){ if( pRec==0 ) return 0; p->ppRec[0] = pRec; } - + pRec->nField = p->iVal+1; return &pRec->aMem[p->iVal]; } @@ -70760,11 +70760,11 @@ static sqlite3_value *valueNew(sqlite3 *db, struct ValueNewStat4Ctx *p){ ** * the SQLITE_FUNC_NEEDCOLL function flag is not set, ** ** then this routine attempts to invoke the SQL function. Assuming no -** error occurs, output parameter (*ppVal) is set to point to a value +** error occurs, output parameter (*ppVal) is set to point to a value ** object containing the result before returning SQLITE_OK. ** ** Affinity aff is applied to the result of the function before returning. -** If the result is a text value, the sqlite3_value object uses encoding +** If the result is a text value, the sqlite3_value object uses encoding ** enc. ** ** If the conditions above are not met, this function returns SQLITE_OK @@ -70795,7 +70795,7 @@ static int valueFromFunction( if( pList ) nVal = pList->nExpr; pFunc = sqlite3FindFunction(db, p->u.zToken, nVal, enc, 0); assert( pFunc ); - if( (pFunc->funcFlags & (SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG))==0 + if( (pFunc->funcFlags & (SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG))==0 || (pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL) ){ return SQLITE_OK; @@ -70934,7 +70934,7 @@ static int valueFromExpr( } }else if( op==TK_UMINUS ) { /* This branch happens for multiple negative signs. Ex: -(-5) */ - if( SQLITE_OK==sqlite3ValueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal) + if( SQLITE_OK==sqlite3ValueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal) && pVal!=0 ){ sqlite3VdbeMemNumerify(pVal); @@ -71012,7 +71012,7 @@ SQLITE_PRIVATE int sqlite3ValueFromExpr( #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 /* ** The implementation of the sqlite_record() function. This function accepts -** a single argument of any type. The return value is a formatted database +** a single argument of any type. The return value is a formatted database ** record (a blob) containing the argument value. ** ** This is used to convert the value stored in the 'sample' column of the @@ -71122,8 +71122,8 @@ static int stat4ValueFromExpr( } /* -** This function is used to allocate and populate UnpackedRecord -** structures intended to be compared against sample index keys stored +** This function is used to allocate and populate UnpackedRecord +** structures intended to be compared against sample index keys stored ** in the sqlite_stat4 table. ** ** A single call to this function populates zero or more fields of the @@ -71134,14 +71134,14 @@ static int stat4ValueFromExpr( ** ** * The expression is a bound variable, and this is a reprepare, or ** -** * The sqlite3ValueFromExpr() function is able to extract a value +** * The sqlite3ValueFromExpr() function is able to extract a value ** from the expression (i.e. the expression is a literal value). ** ** Or, if pExpr is a TK_VECTOR, one field is populated for each of the ** vector components that match either of the two latter criteria listed ** above. ** -** Before any value is appended to the record, the affinity of the +** Before any value is appended to the record, the affinity of the ** corresponding column within index pIdx is applied to it. Before ** this function returns, output parameter *pnExtract is set to the ** number of values appended to the record. @@ -71192,9 +71192,9 @@ SQLITE_PRIVATE int sqlite3Stat4ProbeSetValue( /* ** Attempt to extract a value from expression pExpr using the methods -** as described for sqlite3Stat4ProbeSetValue() above. +** as described for sqlite3Stat4ProbeSetValue() above. ** -** If successful, set *ppVal to point to a new value object and return +** If successful, set *ppVal to point to a new value object and return ** SQLITE_OK. If no value can be extracted, but no other error occurs ** (e.g. OOM), return SQLITE_OK and set *ppVal to NULL. Or, if an error ** does occur, return an SQLite error code. The final value of *ppVal @@ -71214,7 +71214,7 @@ SQLITE_PRIVATE int sqlite3Stat4ValueFromExpr( ** the column value into *ppVal. If *ppVal is initially NULL then a new ** sqlite3_value object is allocated. ** -** If *ppVal is initially NULL then the caller is responsible for +** If *ppVal is initially NULL then the caller is responsible for ** ensuring that the value written into *ppVal is eventually freed. */ SQLITE_PRIVATE int sqlite3Stat4Column( @@ -71338,7 +71338,7 @@ SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){ ** ************************************************************************* ** This file contains code used for creating, destroying, and populating -** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.) +** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.) */ /* #include "sqliteInt.h" */ /* #include "vdbeInt.h" */ @@ -71416,13 +71416,13 @@ SQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe *pA, Vdbe *pB){ } /* -** Resize the Vdbe.aOp array so that it is at least nOp elements larger +** Resize the Vdbe.aOp array so that it is at least nOp elements larger ** than its current size. nOp is guaranteed to be less than or equal ** to 1024/sizeof(Op). ** ** If an out-of-memory error occurs while resizing the array, return -** SQLITE_NOMEM. In this case Vdbe.aOp and Parse.nOpAlloc remain -** unchanged (this is so that any opcodes already allocated can be +** SQLITE_NOMEM. In this case Vdbe.aOp and Parse.nOpAlloc remain +** unchanged (this is so that any opcodes already allocated can be ** correctly deallocated along with the rest of the Vdbe). */ static int growOpArray(Vdbe *v, int nOp){ @@ -71430,7 +71430,7 @@ static int growOpArray(Vdbe *v, int nOp){ Parse *p = v->pParse; /* The SQLITE_TEST_REALLOC_STRESS compile-time option is designed to force - ** more frequent reallocs and hence provide more opportunities for + ** more frequent reallocs and hence provide more opportunities for ** simulated OOM faults. SQLITE_TEST_REALLOC_STRESS is generally used ** during testing only. With SQLITE_TEST_REALLOC_STRESS grow the op array ** by the minimum* amount required until the size reaches 512. Normal @@ -71683,7 +71683,7 @@ SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe *v){ int i = p->nLabel++; assert( v->magic==VDBE_MAGIC_INIT ); if( (i & (i-1))==0 ){ - p->aLabel = sqlite3DbReallocOrFree(p->db, p->aLabel, + p->aLabel = sqlite3DbReallocOrFree(p->db, p->aLabel, (i*2+1)*sizeof(p->aLabel[0])); } if( p->aLabel ){ @@ -71726,19 +71726,19 @@ SQLITE_PRIVATE void sqlite3VdbeReusable(Vdbe *p){ /* ** The following type and function are used to iterate through all opcodes -** in a Vdbe main program and each of the sub-programs (triggers) it may +** in a Vdbe main program and each of the sub-programs (triggers) it may ** invoke directly or indirectly. It should be used as follows: ** ** Op *pOp; ** VdbeOpIter sIter; ** ** memset(&sIter, 0, sizeof(sIter)); -** sIter.v = v; // v is of type Vdbe* +** sIter.v = v; // v is of type Vdbe* ** while( (pOp = opIterNext(&sIter)) ){ ** // Do something with pOp ** } ** sqlite3DbFree(v->db, sIter.apSub); -** +** */ typedef struct VdbeOpIter VdbeOpIter; struct VdbeOpIter { @@ -71771,7 +71771,7 @@ static Op *opIterNext(VdbeOpIter *p){ p->iSub++; p->iAddr = 0; } - + if( pRet->p4type==P4_SUBPROGRAM ){ int nByte = (p->nSub+1)*sizeof(SubProgram*); int j; @@ -71825,8 +71825,8 @@ SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){ while( (pOp = opIterNext(&sIter))!=0 ){ int opcode = pOp->opcode; - if( opcode==OP_Destroy || opcode==OP_VUpdate || opcode==OP_VRename - || ((opcode==OP_Halt || opcode==OP_HaltIfNull) + if( opcode==OP_Destroy || opcode==OP_VUpdate || opcode==OP_VRename + || ((opcode==OP_Halt || opcode==OP_HaltIfNull) && ((pOp->p1&0xff)==SQLITE_CONSTRAINT && pOp->p2==OE_Abort)) ){ hasAbort = 1; @@ -71995,12 +71995,12 @@ SQLITE_PRIVATE void sqlite3VdbeVerifyNoResultRow(Vdbe *p){ /* ** This function returns a pointer to the array of opcodes associated with ** the Vdbe passed as the first argument. It is the callers responsibility -** to arrange for the returned array to be eventually freed using the +** to arrange for the returned array to be eventually freed using the ** vdbeFreeOpArray() function. ** ** Before returning, *pnOp is set to the number of entries in the returned -** array. Also, *pnMaxArg is set to the larger of its current value and -** the number of entries in the Vdbe.apArg[] array required to execute the +** array. Also, *pnMaxArg is set to the larger of its current value and +** the number of entries in the Vdbe.apArg[] array required to execute the ** returned program. */ SQLITE_PRIVATE VdbeOp *sqlite3VdbeTakeOpArray(Vdbe *p, int *pnOp, int *pnMaxArg){ @@ -72074,7 +72074,7 @@ SQLITE_PRIVATE VdbeOp *sqlite3VdbeAddOpList( SQLITE_PRIVATE void sqlite3VdbeScanStatus( Vdbe *p, /* VM to add scanstatus() to */ int addrExplain, /* Address of OP_Explain (or 0) */ - int addrLoop, /* Address of loop counter */ + int addrLoop, /* Address of loop counter */ int addrVisit, /* Address of rows visited counter */ LogEst nEst, /* Estimated number of output rows */ const char *zName /* Name of table or index being scanned */ @@ -72193,8 +72193,8 @@ static void freeP4(sqlite3 *db, int p4type, void *p4){ /* ** Free the space allocated for aOp and any p4 values allocated for the -** opcodes contained within. If aOp is not NULL it is assumed to contain -** nOp entries. +** opcodes contained within. If aOp is not NULL it is assumed to contain +** nOp entries. */ static void vdbeFreeOpArray(sqlite3 *db, Op *aOp, int nOp){ if( aOp ){ @@ -72203,7 +72203,7 @@ static void vdbeFreeOpArray(sqlite3 *db, Op *aOp, int nOp){ if( pOp->p4type ) freeP4(db, pOp->p4type, pOp->p4.p); #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS sqlite3DbFree(db, pOp->zComment); -#endif +#endif } } sqlite3DbFree(db, aOp); @@ -72256,7 +72256,7 @@ SQLITE_PRIVATE int sqlite3VdbeDeletePriorOpcode(Vdbe *p, u8 op){ ** the string is made into memory obtained from sqlite3_malloc(). ** A value of n==0 means copy bytes of zP4 up to and including the ** first null byte. If n>0 then copy n+1 bytes of zP4. -** +** ** Other values of n (P4_STATIC, P4_COLLSEQ etc.) indicate that zP4 points ** to a string or structure that is guaranteed to exist for the lifetime of ** the Vdbe. In these cases we can just copy the pointer. @@ -72317,7 +72317,7 @@ SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe *p, int addr, const char *zP4, int } /* -** Change the P4 operand of the most recently coded instruction +** Change the P4 operand of the most recently coded instruction ** to the value defined by the arguments. This is a high-speed ** version of sqlite3VdbeChangeP4(). ** @@ -72406,7 +72406,7 @@ SQLITE_PRIVATE void sqlite3VdbeSetLineNumber(Vdbe *v, int iLine){ ** routine, then a pointer to a dummy VdbeOp will be returned. That opcode ** is readable but not writable, though it is cast to a writable value. ** The return of a dummy opcode allows the call to continue functioning -** after an OOM fault without having to check to see if the return from +** after an OOM fault without having to check to see if the return from ** this routine is a valid pointer. But because the dummy.opcode is 0, ** dummy will never be written to. This is verified by code inspection and ** by running with Valgrind. @@ -72748,13 +72748,13 @@ SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe *p, int i){ ** ** If SQLite is not threadsafe but does support shared-cache mode, then ** sqlite3BtreeEnter() is invoked to set the BtShared.db variables -** of all of BtShared structures accessible via the database handle +** of all of BtShared structures accessible via the database handle ** associated with the VM. ** ** If SQLite is not threadsafe and does not support shared-cache mode, this ** function is a no-op. ** -** The p->btreeMask field is a bitmask of all btrees that the prepared +** The p->btreeMask field is a bitmask of all btrees that the prepared ** statement p will ever use. Let N be the number of bits in p->btreeMask ** corresponding to btrees that use shared cache. Then the runtime of ** this routine is N*N. But as N is rarely more than 1, this should not @@ -72820,7 +72820,7 @@ SQLITE_PRIVATE void sqlite3VdbePrintOp(FILE *pOut, int pc, Op *pOp){ /* NB: The sqlite3OpcodeName() function is implemented by code created ** by the mkopcodeh.awk and mkopcodec.awk scripts which extract the ** information from the vdbe.c source text */ - fprintf(pOut, zFormat1, pc, + fprintf(pOut, zFormat1, pc, sqlite3OpcodeName(pOp->opcode), pOp->p1, pOp->p2, pOp->p3, zP4, pOp->p5, zCom ); @@ -72861,15 +72861,15 @@ static void releaseMemArray(Mem *p, int N){ assert( sqlite3VdbeCheckMemInvariants(p) ); /* This block is really an inlined version of sqlite3VdbeMemRelease() - ** that takes advantage of the fact that the memory cell value is + ** that takes advantage of the fact that the memory cell value is ** being set to NULL after releasing any dynamic resources. ** - ** The justification for duplicating code is that according to - ** callgrind, this causes a certain test case to hit the CPU 4.7 - ** percent less (x86 linux, gcc version 4.1.2, -O6) than if + ** The justification for duplicating code is that according to + ** callgrind, this causes a certain test case to hit the CPU 4.7 + ** percent less (x86 linux, gcc version 4.1.2, -O6) than if ** sqlite3MemRelease() were called from here. With -O2, this jumps - ** to 6.6 percent. The test case is inserting 1000 rows into a table - ** with no indexes using a single prepared INSERT statement, bind() + ** to 6.6 percent. The test case is inserting 1000 rows into a table + ** with no indexes using a single prepared INSERT statement, bind() ** and reset(). Inserts are grouped into a transaction. */ testcase( p->flags & MEM_Agg ); @@ -73007,7 +73007,7 @@ SQLITE_PRIVATE int sqlite3VdbeList( pMem->flags = MEM_Int; pMem->u.i = i; /* Program counter */ pMem++; - + pMem->flags = MEM_Static|MEM_Str|MEM_Term; pMem->z = (char*)sqlite3OpcodeName(pOp->opcode); /* Opcode */ assert( pMem->z!=0 ); @@ -73073,7 +73073,7 @@ SQLITE_PRIVATE int sqlite3VdbeList( sqlite3_snprintf(3, pMem->z, "%.2x", pOp->p5); /* P5 */ pMem->enc = SQLITE_UTF8; pMem++; - + #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS if( sqlite3VdbeMemClearAndResize(pMem, 500) ){ assert( p->db->mallocFailed ); @@ -73232,11 +73232,11 @@ SQLITE_PRIVATE void sqlite3VdbeRewind(Vdbe *p){ ** creating the virtual machine. This involves things such ** as allocating registers and initializing the program counter. ** After the VDBE has be prepped, it can be executed by one or more -** calls to sqlite3VdbeExec(). +** calls to sqlite3VdbeExec(). ** ** This function may be called exactly once on each virtual machine. ** After this routine is called the VM has been "packaged" and is ready -** to run. After this routine is called, further calls to +** to run. After this routine is called, further calls to ** sqlite3VdbeAddOp() functions are prohibited. This routine disconnects ** the Vdbe from the Parse object that helped generate it so that the ** the Vdbe becomes an independent entity and the Parse object can be @@ -73268,7 +73268,7 @@ SQLITE_PRIVATE void sqlite3VdbeMakeReady( nMem = pParse->nMem; nCursor = pParse->nTab; nArg = pParse->nMaxArg; - + /* Each cursor uses a memory cell. The first cursor (cursor 0) can ** use aMem[0] which is not otherwise used by the VDBE program. Allocate ** space at the end of aMem[] for cursors 1 and greater. @@ -73296,10 +73296,10 @@ SQLITE_PRIVATE void sqlite3VdbeMakeReady( p->expired = 0; /* Memory for registers, parameters, cursor, etc, is allocated in one or two - ** passes. On the first pass, we try to reuse unused memory at the + ** passes. On the first pass, we try to reuse unused memory at the ** end of the opcode array. If we are unable to satisfy all memory ** requirements by reusing the opcode array tail, then the second - ** pass will fill in the remainder using a fresh memory allocation. + ** pass will fill in the remainder using a fresh memory allocation. ** ** This two-pass approach that reuses as much memory as possible from ** the leftover memory at the end of the opcode array. This can significantly @@ -73341,7 +73341,7 @@ SQLITE_PRIVATE void sqlite3VdbeMakeReady( } /* -** Close a VDBE cursor and release all the resources that cursor +** Close a VDBE cursor and release all the resources that cursor ** happens to hold. */ SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *p, VdbeCursor *pCx){ @@ -73423,7 +73423,7 @@ SQLITE_PRIVATE int sqlite3VdbeFrameRestore(VdbeFrame *pFrame){ /* ** Close all cursors. ** -** Also release any dynamic memory held by the VM in the Vdbe.aMem memory +** Also release any dynamic memory held by the VM in the Vdbe.aMem memory ** cell array. This is necessary as the memory cell array may contain ** pointers to VdbeFrame objects, which may in turn contain pointers to ** open cursors. @@ -73459,7 +73459,7 @@ static void Cleanup(Vdbe *p){ sqlite3 *db = p->db; #ifdef SQLITE_DEBUG - /* Execute assert() statements to ensure that the Vdbe.apCsr[] and + /* Execute assert() statements to ensure that the Vdbe.apCsr[] and ** Vdbe.aMem[] arrays have already been cleaned up. */ int i; if( p->apCsr ) for(i=0; inCursor; i++) assert( p->apCsr[i]==0 ); @@ -73540,27 +73540,27 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ int needXcommit = 0; #ifdef SQLITE_OMIT_VIRTUALTABLE - /* With this option, sqlite3VtabSync() is defined to be simply - ** SQLITE_OK so p is not used. + /* With this option, sqlite3VtabSync() is defined to be simply + ** SQLITE_OK so p is not used. */ UNUSED_PARAMETER(p); #endif /* Before doing anything else, call the xSync() callback for any ** virtual module tables written in this transaction. This has to - ** be done before determining whether a master journal file is + ** be done before determining whether a master journal file is ** required, as an xSync() callback may add an attached database ** to the transaction. */ rc = sqlite3VtabSync(db, p); /* This loop determines (a) if the commit hook should be invoked and - ** (b) how many database files have open write transactions, not - ** including the temp database. (b) is important because if more than + ** (b) how many database files have open write transactions, not + ** including the temp database. (b) is important because if more than ** one database file has an open write transaction, a master journal ** file is required for an atomic commit. - */ - for(i=0; rc==SQLITE_OK && inDb; i++){ + */ + for(i=0; rc==SQLITE_OK && inDb; i++){ Btree *pBt = db->aDb[i].pBt; if( sqlite3BtreeIsInTrans(pBt) ){ /* Whether or not a database might need a master journal depends upon @@ -73580,7 +73580,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ pPager = sqlite3BtreePager(pBt); if( db->aDb[i].safety_level!=PAGER_SYNCHRONOUS_OFF && aMJNeeded[sqlite3PagerGetJournalMode(pPager)] - ){ + ){ assert( i!=1 ); nTrans++; } @@ -73605,8 +73605,8 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ ** master-journal. ** ** If the return value of sqlite3BtreeGetFilename() is a zero length - ** string, it means the main database is :memory: or a temp file. In - ** that case we do not support atomic multi-file commits, so use the + ** string, it means the main database is :memory: or a temp file. In + ** that case we do not support atomic multi-file commits, so use the ** simple case then too. */ if( 0==sqlite3Strlen30(sqlite3BtreeGetFilename(db->aDb[0].pBt)) @@ -73619,7 +73619,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ } } - /* Do the commit only if all databases successfully complete phase 1. + /* Do the commit only if all databases successfully complete phase 1. ** If one of the BtreeCommitPhaseOne() calls fails, this indicates an ** IO error while deleting or truncating a journal file. It is unlikely, ** but could happen. In this case abandon processing and return the error. @@ -73677,7 +73677,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ }while( rc==SQLITE_OK && res ); if( rc==SQLITE_OK ){ /* Open the master journal. */ - rc = sqlite3OsOpenMalloc(pVfs, zMaster, &pMaster, + rc = sqlite3OsOpenMalloc(pVfs, zMaster, &pMaster, SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE| SQLITE_OPEN_EXCLUSIVE|SQLITE_OPEN_MASTER_JOURNAL, 0 ); @@ -73686,7 +73686,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ sqlite3DbFree(db, zMaster); return rc; } - + /* Write the name of each database file in the transaction into the new ** master journal file. If an error occurs at this point close ** and delete the master journal file. All the individual journal files @@ -73734,7 +73734,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ ** in case the master journal file name was written into the journal ** file before the failure occurred. */ - for(i=0; rc==SQLITE_OK && inDb; i++){ + for(i=0; rc==SQLITE_OK && inDb; i++){ Btree *pBt = db->aDb[i].pBt; if( pBt ){ rc = sqlite3BtreeCommitPhaseOne(pBt, zMaster); @@ -73767,7 +73767,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ */ disable_simulated_io_errors(); sqlite3BeginBenignMalloc(); - for(i=0; inDb; i++){ + for(i=0; inDb; i++){ Btree *pBt = db->aDb[i].pBt; if( pBt ){ sqlite3BtreeCommitPhaseTwo(pBt, 1); @@ -73783,7 +73783,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ return rc; } -/* +/* ** This routine checks that the sqlite3.nVdbeActive count variable ** matches the number of vdbe's in the list sqlite3.pVdbe that are ** currently active. An assertion fails if the two counts do not match. @@ -73819,10 +73819,10 @@ static void checkActiveVdbeCnt(sqlite3 *db){ ** If the Vdbe passed as the first argument opened a statement-transaction, ** close it now. Argument eOp must be either SAVEPOINT_ROLLBACK or ** SAVEPOINT_RELEASE. If it is SAVEPOINT_ROLLBACK, then the statement -** transaction is rolled back. If eOp is SAVEPOINT_RELEASE, then the +** transaction is rolled back. If eOp is SAVEPOINT_RELEASE, then the ** statement transaction is committed. ** -** If an IO error occurs, an SQLITE_IOERR_XXX error code is returned. +** If an IO error occurs, an SQLITE_IOERR_XXX error code is returned. ** Otherwise SQLITE_OK. */ static SQLITE_NOINLINE int vdbeCloseStatement(Vdbe *p, int eOp){ @@ -73835,7 +73835,7 @@ static SQLITE_NOINLINE int vdbeCloseStatement(Vdbe *p, int eOp){ assert( db->nStatement>0 ); assert( p->iStatement==(db->nStatement+db->nSavepoint) ); - for(i=0; inDb; i++){ + for(i=0; inDb; i++){ int rc2 = SQLITE_OK; Btree *pBt = db->aDb[i].pBt; if( pBt ){ @@ -73862,8 +73862,8 @@ static SQLITE_NOINLINE int vdbeCloseStatement(Vdbe *p, int eOp){ } } - /* If the statement transaction is being rolled back, also restore the - ** database handles deferred constraint counter to the value it had when + /* If the statement transaction is being rolled back, also restore the + ** database handles deferred constraint counter to the value it had when ** the statement transaction was opened. */ if( eOp==SAVEPOINT_ROLLBACK ){ db->nDeferredCons = p->nStmtDefCons; @@ -73880,20 +73880,20 @@ SQLITE_PRIVATE int sqlite3VdbeCloseStatement(Vdbe *p, int eOp){ /* -** This function is called when a transaction opened by the database -** handle associated with the VM passed as an argument is about to be +** This function is called when a transaction opened by the database +** handle associated with the VM passed as an argument is about to be ** committed. If there are outstanding deferred foreign key constraint ** violations, return SQLITE_ERROR. Otherwise, SQLITE_OK. ** -** If there are outstanding FK violations and this function returns +** If there are outstanding FK violations and this function returns ** SQLITE_ERROR, set the result of the VM to SQLITE_CONSTRAINT_FOREIGNKEY ** and write an error message to it. Then return SQLITE_ERROR. */ #ifndef SQLITE_OMIT_FOREIGN_KEY SQLITE_PRIVATE int sqlite3VdbeCheckFk(Vdbe *p, int deferred){ sqlite3 *db = p->db; - if( (deferred && (db->nDeferredCons+db->nDeferredImmCons)>0) - || (!deferred && p->nFkConstraint>0) + if( (deferred && (db->nDeferredCons+db->nDeferredImmCons)>0) + || (!deferred && p->nFkConstraint>0) ){ p->rc = SQLITE_CONSTRAINT_FOREIGNKEY; p->errorAction = OE_Abort; @@ -73923,7 +73923,7 @@ SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){ /* This function contains the logic that determines if a statement or ** transaction will be committed or rolled back as a result of the - ** execution of this virtual machine. + ** execution of this virtual machine. ** ** If any of the following errors occur: ** @@ -73961,16 +73961,16 @@ SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){ isSpecialError = mrc==SQLITE_NOMEM || mrc==SQLITE_IOERR || mrc==SQLITE_INTERRUPT || mrc==SQLITE_FULL; if( isSpecialError ){ - /* If the query was read-only and the error code is SQLITE_INTERRUPT, - ** no rollback is necessary. Otherwise, at least a savepoint - ** transaction must be rolled back to restore the database to a + /* If the query was read-only and the error code is SQLITE_INTERRUPT, + ** no rollback is necessary. Otherwise, at least a savepoint + ** transaction must be rolled back to restore the database to a ** consistent state. ** ** Even if the statement is read-only, it is important to perform - ** a statement or transaction rollback operation. If the error + ** a statement or transaction rollback operation. If the error ** occurred while writing to the journal, sub-journal or database ** file as part of an effort to free up cache space (see function - ** pagerStress() in pager.c), the rollback is required to restore + ** pagerStress() in pager.c), the rollback is required to restore ** the pager to a consistent state. */ if( !p->readOnly || mrc!=SQLITE_INTERRUPT ){ @@ -73992,16 +73992,16 @@ SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){ if( p->rc==SQLITE_OK ){ sqlite3VdbeCheckFk(p, 0); } - - /* If the auto-commit flag is set and this is the only active writer - ** VM, then we do either a commit or rollback of the current transaction. + + /* If the auto-commit flag is set and this is the only active writer + ** VM, then we do either a commit or rollback of the current transaction. ** - ** Note: This block also runs if one of the special errors handled - ** above has occurred. + ** Note: This block also runs if one of the special errors handled + ** above has occurred. */ - if( !sqlite3VtabInSync(db) - && db->autoCommit - && db->nVdbeWrite==(p->readOnly==0) + if( !sqlite3VtabInSync(db) + && db->autoCommit + && db->nVdbeWrite==(p->readOnly==0) ){ if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){ rc = sqlite3VdbeCheckFk(p, 1); @@ -74011,10 +74011,10 @@ SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){ return SQLITE_ERROR; } rc = SQLITE_CONSTRAINT_FOREIGNKEY; - }else{ - /* The auto-commit flag is true, the vdbe program was successful + }else{ + /* The auto-commit flag is true, the vdbe program was successful ** or hit an 'OR FAIL' constraint and there are no deferred foreign - ** key constraints to hold up the transaction. This means a commit + ** key constraints to hold up the transaction. This means a commit ** is required. */ rc = vdbeCommit(db, p); } @@ -74048,7 +74048,7 @@ SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){ p->nChange = 0; } } - + /* If eStatementOp is non-zero, then a statement transaction needs to ** be committed or rolled back. Call sqlite3VdbeCloseStatement() to ** do so. If this operation returns an error, and the current statement @@ -74069,9 +74069,9 @@ SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){ p->nChange = 0; } } - + /* If this was an INSERT, UPDATE or DELETE and no statement transaction - ** has been rolled back, update the database connection change-counter. + ** has been rolled back, update the database connection change-counter. */ if( p->changeCntOn ){ if( eStatementOp!=SAVEPOINT_ROLLBACK ){ @@ -74102,7 +74102,7 @@ SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){ } /* If the auto-commit flag is set to true, then any locks that were held - ** by connection db have now been released. Call sqlite3ConnectionUnlocked() + ** by connection db have now been released. Call sqlite3ConnectionUnlocked() ** to invoke any required unlock-notify callbacks. */ if( db->autoCommit ){ @@ -74124,7 +74124,7 @@ SQLITE_PRIVATE void sqlite3VdbeResetStepResult(Vdbe *p){ /* ** Copy the error code and error message belonging to the VDBE passed -** as the first argument to its database handle (so that they will be +** as the first argument to its database handle (so that they will be ** returned by calls to sqlite3_errcode() and sqlite3_errmsg()). ** ** This function does not clear the VDBE error code or message, just @@ -74149,7 +74149,7 @@ SQLITE_PRIVATE int sqlite3VdbeTransferError(Vdbe *p){ #ifdef SQLITE_ENABLE_SQLLOG /* -** If an SQLITE_CONFIG_SQLLOG hook is registered and the VM has been run, +** If an SQLITE_CONFIG_SQLLOG hook is registered and the VM has been run, ** invoke it. */ static void vdbeInvokeSqllog(Vdbe *v){ @@ -74254,7 +74254,7 @@ SQLITE_PRIVATE int sqlite3VdbeReset(Vdbe *p){ p->magic = VDBE_MAGIC_RESET; return p->rc & db->errMask; } - + /* ** Clean up and delete a VDBE after execution. Return an integer which is ** the result code. Write any error message text into *pzErrMsg. @@ -74275,8 +74275,8 @@ SQLITE_PRIVATE int sqlite3VdbeFinalize(Vdbe *p){ ** the first argument. ** ** Or, if iOp is greater than or equal to zero, then the destructor is -** only invoked for those auxiliary data pointers created by the user -** function invoked by the OP_Function opcode at instruction iOp of +** only invoked for those auxiliary data pointers created by the user +** function invoked by the OP_Function opcode at instruction iOp of ** VM pVdbe, and only then if: ** ** * the associated function parameter is the 32nd or later (counting @@ -74547,7 +74547,7 @@ SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem *pMem, int file_format, u32 *pLen){ ** The sizes for serial types less than 128 */ static const u8 sqlite3SmallTypeSizes[] = { - /* 0 1 2 3 4 5 6 7 8 9 */ + /* 0 1 2 3 4 5 6 7 8 9 */ /* 0 */ 0, 1, 2, 3, 4, 6, 8, 8, 0, 0, /* 10 */ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, /* 20 */ 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, @@ -74570,19 +74570,19 @@ SQLITE_PRIVATE u32 sqlite3VdbeSerialTypeLen(u32 serial_type){ if( serial_type>=128 ){ return (serial_type-12)/2; }else{ - assert( serial_type<12 + assert( serial_type<12 || sqlite3SmallTypeSizes[serial_type]==(serial_type - 12)/2 ); return sqlite3SmallTypeSizes[serial_type]; } } SQLITE_PRIVATE u8 sqlite3VdbeOneByteSerialTypeLen(u8 serial_type){ assert( serial_type<128 ); - return sqlite3SmallTypeSizes[serial_type]; + return sqlite3SmallTypeSizes[serial_type]; } /* -** If we are on an architecture with mixed-endian floating -** points (ex: ARM7) then swap the lower 4 bytes with the +** If we are on an architecture with mixed-endian floating +** points (ex: ARM7) then swap the lower 4 bytes with the ** upper 4 bytes. Return the result. ** ** For most architectures, this is a no-op. @@ -74604,7 +74604,7 @@ SQLITE_PRIVATE u8 sqlite3VdbeOneByteSerialTypeLen(u8 serial_type){ ** (2007-08-30) Frank van Vugt has studied this problem closely ** and has send his findings to the SQLite developers. Frank ** writes that some Linux kernels offer floating point hardware -** emulation that uses only 32-bit mantissas instead of a full +** emulation that uses only 32-bit mantissas instead of a full ** 48-bits as required by the IEEE standard. (This is the ** CONFIG_FPE_FASTFPE option.) On such systems, floating point ** byte swapping becomes very complicated. To avoid problems, @@ -74634,7 +74634,7 @@ static u64 floatSwap(u64 in){ #endif /* -** Write the serialized data blob for the value stored in pMem into +** Write the serialized data blob for the value stored in pMem into ** buf. It is assumed that the caller has allocated sufficient space. ** Return the number of bytes written. ** @@ -74645,7 +74645,7 @@ static u64 floatSwap(u64 in){ ** Return the number of bytes actually written into buf[]. The number ** of bytes in the zero-filled tail is included in the return value only ** if those bytes were zeroed in buf[]. -*/ +*/ SQLITE_PRIVATE u32 sqlite3VdbeSerialPut(u8 *buf, Mem *pMem, u32 serial_type){ u32 len; @@ -74699,7 +74699,7 @@ SQLITE_PRIVATE u32 sqlite3VdbeSerialPut(u8 *buf, Mem *pMem, u32 serial_type){ ** The few cases that require local variables are broken out into a separate ** routine so that in most cases the overhead of moving the stack pointer ** is avoided. -*/ +*/ static u32 SQLITE_NOINLINE serialGet( const unsigned char *buf, /* Buffer to deserialize from */ u32 serial_type, /* Serial type to deserialize */ @@ -74777,7 +74777,7 @@ SQLITE_PRIVATE u32 sqlite3VdbeSerialGet( /* EVIDENCE-OF: R-01849-26079 Value is a big-endian 32-bit ** twos-complement integer. */ pMem->u.i = FOUR_BYTE_INT(buf); -#ifdef __HP_cc +#ifdef __HP_cc /* Work around a sign-extension bug in the HP compiler for HP/UX */ if( buf[0]&0x80 ) pMem->u.i |= 0xffffffff80000000LL; #endif @@ -74829,7 +74829,7 @@ SQLITE_PRIVATE u32 sqlite3VdbeSerialGet( ** The space is either allocated using sqlite3DbMallocRaw() or from within ** the unaligned buffer passed via the second and third arguments (presumably ** stack space). If the former, then *ppFree is set to a pointer that should -** be eventually freed by the caller using sqlite3DbFree(). Or, if the +** be eventually freed by the caller using sqlite3DbFree(). Or, if the ** allocation comes from the pSpace/szSpace buffer, *ppFree is set to NULL ** before returning. ** @@ -74851,10 +74851,10 @@ SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord( } /* -** Given the nKey-byte encoding of a record in pKey[], populate the +** Given the nKey-byte encoding of a record in pKey[], populate the ** UnpackedRecord structure indicated by the fourth argument with the ** contents of the decoded record. -*/ +*/ SQLITE_PRIVATE void sqlite3VdbeRecordUnpack( KeyInfo *pKeyInfo, /* Information about the record format */ int nKey, /* Size of the binary record */ @@ -74862,7 +74862,7 @@ SQLITE_PRIVATE void sqlite3VdbeRecordUnpack( UnpackedRecord *p /* Populate this structure before returning. */ ){ const unsigned char *aKey = (const unsigned char *)pKey; - int d; + int d; u32 idx; /* Offset in aKey[] to read from */ u16 u; /* Unsigned loop counter */ u32 szHdr; @@ -74925,13 +74925,13 @@ static int vdbeRecordCompareDebug( /* Compilers may complain that mem1.u.i is potentially uninitialized. ** We could initialize it, as shown here, to silence those complaints. - ** But in fact, mem1.u.i will never actually be used uninitialized, and doing + ** But in fact, mem1.u.i will never actually be used uninitialized, and doing ** the unnecessary initialization has a measurable negative performance ** impact, since this routine is a very high runner. And so, we choose ** to ignore the compiler warnings and leave this variable uninitialized. */ /* mem1.u.i = 0; // not needed, here to silence compiler warning */ - + idx1 = getVarint32(aKey1, szHdr1); if( szHdr1>98307 ) return SQLITE_CORRUPT; d1 = szHdr1; @@ -74952,7 +74952,7 @@ static int vdbeRecordCompareDebug( ** sqlite3VdbeSerialTypeLen() in the common case. */ if( d1+serial_type1+2>(u32)nKey1 - && d1+sqlite3VdbeSerialTypeLen(serial_type1)>(u32)nKey1 + && d1+sqlite3VdbeSerialTypeLen(serial_type1)>(u32)nKey1 ){ break; } @@ -75008,7 +75008,7 @@ debugCompareEnd: ** incorrectly. */ static void vdbeAssertFieldCountWithinLimits( - int nKey, const void *pKey, /* The record to verify */ + int nKey, const void *pKey, /* The record to verify */ const KeyInfo *pKeyInfo /* Compare size with this KeyInfo */ ){ int nField = 0; @@ -75034,7 +75034,7 @@ static void vdbeAssertFieldCountWithinLimits( /* ** Both *pMem1 and *pMem2 contain string values. Compare the two values ** using the collation sequence pColl. As usual, return a negative , zero -** or positive value if *pMem1 is less than, equal to or greater than +** or positive value if *pMem1 is less than, equal to or greater than ** *pMem2, respectively. Similar in spirit to "rc = (*pMem1) - (*pMem2);". */ static int vdbeCompareMemString( @@ -75160,7 +75160,7 @@ SQLITE_PRIVATE int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const C f2 = pMem2->flags; combined_flags = f1|f2; assert( (combined_flags & MEM_RowSet)==0 ); - + /* If one value is NULL, it is less than the other. If both values ** are NULL, return 0. */ @@ -75210,7 +75210,7 @@ SQLITE_PRIVATE int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const C } assert( pMem1->enc==pMem2->enc || pMem1->db->mallocFailed ); - assert( pMem1->enc==SQLITE_UTF8 || + assert( pMem1->enc==SQLITE_UTF8 || pMem1->enc==SQLITE_UTF16LE || pMem1->enc==SQLITE_UTF16BE ); /* The collation sequence must be defined at this point, even if @@ -75225,7 +75225,7 @@ SQLITE_PRIVATE int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const C /* If a NULL pointer was passed as the collate function, fall through ** to the blob case and use memcmp(). */ } - + /* Both values must be blobs. Compare using memcmp(). */ return sqlite3BlobCompare(pMem1, pMem2); } @@ -75233,7 +75233,7 @@ SQLITE_PRIVATE int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const C /* ** The first argument passed to this function is a serial-type that -** corresponds to an integer - all values between 1 and 9 inclusive +** corresponds to an integer - all values between 1 and 9 inclusive ** except 7. The second points to a buffer containing an integer value ** serialized according to serial_type. This function deserializes ** and returns the value. @@ -75275,7 +75275,7 @@ static i64 vdbeRecordDecodeInt(u32 serial_type, const u8 *aKey){ /* ** This function compares the two table rows or index records ** specified by {nKey1, pKey1} and pPKey2. It returns a negative, zero -** or positive integer if key1 is less than, equal to or +** or positive integer if key1 is less than, equal to or ** greater than key2. The {nKey1, pKey1} key must be a blob ** created by the OP_MakeRecord opcode of the VDBE. The pPKey2 ** key must be a parsed key such as obtained from @@ -75284,12 +75284,12 @@ static i64 vdbeRecordDecodeInt(u32 serial_type, const u8 *aKey){ ** If argument bSkip is non-zero, it is assumed that the caller has already ** determined that the first fields of the keys are equal. ** -** Key1 and Key2 do not have to contain the same number of fields. If all -** fields that appear in both keys are equal, then pPKey2->default_rc is +** Key1 and Key2 do not have to contain the same number of fields. If all +** fields that appear in both keys are equal, then pPKey2->default_rc is ** returned. ** -** If database corruption is discovered, set pPKey2->errCode to -** SQLITE_CORRUPT and return 0. If an OOM error is encountered, +** If database corruption is discovered, set pPKey2->errCode to +** SQLITE_CORRUPT and return 0. If an OOM error is encountered, ** pPKey2->errCode is set to SQLITE_NOMEM and, if it is not NULL, the ** malloc-failed flag set on database handle (pPKey2->pKeyInfo->db). */ @@ -75321,7 +75321,7 @@ SQLITE_PRIVATE int sqlite3VdbeRecordCompareWithSkip( }else{ idx1 = getVarint32(aKey1, szHdr1); d1 = szHdr1; - if( d1>(unsigned)nKey1 ){ + if( d1>(unsigned)nKey1 ){ pPKey2->errCode = (u8)SQLITE_CORRUPT_BKPT; return 0; /* Corruption */ } @@ -75329,7 +75329,7 @@ SQLITE_PRIVATE int sqlite3VdbeRecordCompareWithSkip( } VVA_ONLY( mem1.szMalloc = 0; ) /* Only needed by assert() statements */ - assert( pPKey2->pKeyInfo->nField+pPKey2->pKeyInfo->nXField>=pPKey2->nField + assert( pPKey2->pKeyInfo->nField+pPKey2->pKeyInfo->nXField>=pPKey2->nField || CORRUPT_DB ); assert( pPKey2->pKeyInfo->aSortOrder!=0 ); assert( pPKey2->pKeyInfo->nField>0 ); @@ -75364,7 +75364,7 @@ SQLITE_PRIVATE int sqlite3VdbeRecordCompareWithSkip( serial_type = aKey1[idx1]; if( serial_type>=10 ){ /* Serial types 12 or greater are strings and blobs (greater than - ** numbers). Types 10 and 11 are currently "reserved for future + ** numbers). Types 10 and 11 are currently "reserved for future ** use", so it doesn't really matter what the results of comparing ** them to numberic values are. */ rc = +1; @@ -75410,7 +75410,7 @@ SQLITE_PRIVATE int sqlite3VdbeRecordCompareWithSkip( }else{ int nCmp = MIN(mem1.n, pRhs->n); rc = memcmp(&aKey1[d1], pRhs->z, nCmp); - if( rc==0 ) rc = mem1.n - pRhs->n; + if( rc==0 ) rc = mem1.n - pRhs->n; } } } @@ -75472,8 +75472,8 @@ SQLITE_PRIVATE int sqlite3VdbeRecordCompareWithSkip( /* rc==0 here means that one or both of the keys ran out of fields and ** all the fields up to that point were equal. Return the default_rc ** value. */ - assert( CORRUPT_DB - || vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, pPKey2->default_rc) + assert( CORRUPT_DB + || vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, pPKey2->default_rc) || pKeyInfo->db->mallocFailed ); pPKey2->eqSeen = 1; @@ -75488,8 +75488,8 @@ SQLITE_PRIVATE int sqlite3VdbeRecordCompare( /* -** This function is an optimized version of sqlite3VdbeRecordCompare() -** that (a) the first field of pPKey2 is an integer, and (b) the +** This function is an optimized version of sqlite3VdbeRecordCompare() +** that (a) the first field of pPKey2 is an integer, and (b) the ** size-of-header varint at the start of (pKey1/nKey1) fits in a single ** byte (i.e. is less than 128). ** @@ -75544,7 +75544,7 @@ static int vdbeRecordCompareInt( testcase( lhs<0 ); break; } - case 8: + case 8: lhs = 0; break; case 9: @@ -75552,11 +75552,11 @@ static int vdbeRecordCompareInt( break; /* This case could be removed without changing the results of running - ** this code. Including it causes gcc to generate a faster switch + ** this code. Including it causes gcc to generate a faster switch ** statement (since the range of switch targets now starts at zero and ** is contiguous) but does not cause any duplicate code to be generated - ** (as gcc is clever enough to combine the two like cases). Other - ** compilers might be similar. */ + ** (as gcc is clever enough to combine the two like cases). Other + ** compilers might be similar. */ case 0: case 7: return sqlite3VdbeRecordCompare(nKey1, pKey1, pPKey2); @@ -75570,7 +75570,7 @@ static int vdbeRecordCompareInt( }else if( vr2; }else if( pPKey2->nField>1 ){ - /* The first fields of the two keys are equal. Compare the trailing + /* The first fields of the two keys are equal. Compare the trailing ** fields. */ res = sqlite3VdbeRecordCompareWithSkip(nKey1, pKey1, pPKey2, 1); }else{ @@ -75585,9 +75585,9 @@ static int vdbeRecordCompareInt( } /* -** This function is an optimized version of sqlite3VdbeRecordCompare() +** This function is an optimized version of sqlite3VdbeRecordCompare() ** that (a) the first field of pPKey2 is a string, that (b) the first field -** uses the collation sequence BINARY and (c) that the size-of-header varint +** uses the collation sequence BINARY and (c) that the size-of-header varint ** at the start of (pKey1/nKey1) fits in a single byte. */ static int vdbeRecordCompareString( @@ -75603,7 +75603,7 @@ static int vdbeRecordCompareString( getVarint32(&aKey1[1], serial_type); if( serial_type<12 ){ res = pPKey2->r1; /* (pKey1/nKey1) is a number or a null */ - }else if( !(serial_type & 0x01) ){ + }else if( !(serial_type & 0x01) ){ res = pPKey2->r2; /* (pKey1/nKey1) is a blob */ }else{ int nCmp; @@ -75655,7 +75655,7 @@ SQLITE_PRIVATE RecordCompare sqlite3VdbeFindCompare(UnpackedRecord *p){ /* varintRecordCompareInt() and varintRecordCompareString() both assume ** that the size-of-header varint that occurs at the start of each record ** fits in a single byte (i.e. is 127 or less). varintRecordCompareInt() - ** also assumes that it is safe to overread a buffer by at least the + ** also assumes that it is safe to overread a buffer by at least the ** maximum possible legal header size plus 8 bytes. Because there is ** guaranteed to be at least 74 (but not 136) bytes of padding following each ** buffer passed to varintRecordCompareInt() this makes it convenient to @@ -75708,7 +75708,7 @@ SQLITE_PRIVATE int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 *rowid){ /* Get the size of the index entry. Only indices entries of less ** than 2GiB are support - anything large must be database corruption. ** Any corruption is detected in sqlite3BtreeParseCellPtr(), though, so - ** this code can safely assume that nCellKey is 32-bits + ** this code can safely assume that nCellKey is 32-bits */ assert( sqlite3BtreeCursorIsValid(pCur) ); nCellKey = sqlite3BtreePayloadSize(pCur); @@ -75771,7 +75771,7 @@ idx_rowid_corruption: ** ** pUnpacked is either created without a rowid or is truncated so that it ** omits the rowid at the end. The rowid at the end of the index entry -** is ignored as well. Hence, this routine only compares the prefixes +** is ignored as well. Hence, this routine only compares the prefixes ** of the keys prior to the final rowid, not the entire key. */ SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare( @@ -75807,7 +75807,7 @@ SQLITE_PRIVATE int sqlite3VdbeIdxKeyCompare( /* ** This routine sets the value to be returned by subsequent calls to -** sqlite3_changes() on the database handle 'db'. +** sqlite3_changes() on the database handle 'db'. */ SQLITE_PRIVATE void sqlite3VdbeSetChanges(sqlite3 *db, int nChange){ assert( sqlite3_mutex_held(db->mutex) ); @@ -75849,7 +75849,7 @@ SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe *v){ /* ** Return a pointer to an sqlite3_value structure containing the value bound -** parameter iVar of VM v. Except, if the value is an SQL NULL, return +** parameter iVar of VM v. Except, if the value is an SQL NULL, return ** 0 instead. Unless it is NULL, apply affinity aff (one of the SQLITE_AFF_* ** constants) to the value before returning it. ** @@ -75905,7 +75905,7 @@ SQLITE_PRIVATE void sqlite3VtabImportErrmsg(Vdbe *p, sqlite3_vtab *pVtab){ #ifdef SQLITE_ENABLE_PREUPDATE_HOOK /* -** If the second argument is not NULL, release any allocations associated +** If the second argument is not NULL, release any allocations associated ** with the memory cells in the p->aMem[] array. Also free the UnpackedRecord ** structure itself, using sqlite3DbFree(). ** @@ -75959,7 +75959,7 @@ SQLITE_PRIVATE void sqlite3VdbePreUpdateHook( } } - assert( pCsr->nField==pTab->nCol + assert( pCsr->nField==pTab->nCol || (pCsr->nField==pTab->nCol+1 && op==SQLITE_DELETE && iReg==-1) ); @@ -76285,7 +76285,7 @@ SQLITE_API sqlite3_value *sqlite3_value_dup(const sqlite3_value *pOrig){ SQLITE_API void sqlite3_value_free(sqlite3_value *pOld){ sqlite3ValueFree(pOld); } - + /**************************** sqlite3_result_ ******************************* ** The following routines are used by user-defined functions to specify @@ -76326,9 +76326,9 @@ static int invokeValueDestructor( return SQLITE_TOOBIG; } SQLITE_API void sqlite3_result_blob( - sqlite3_context *pCtx, - const void *z, - int n, + sqlite3_context *pCtx, + const void *z, + int n, void (*xDel)(void *) ){ assert( n>=0 ); @@ -76336,8 +76336,8 @@ SQLITE_API void sqlite3_result_blob( setResultStrOrError(pCtx, z, n, 0, xDel); } SQLITE_API void sqlite3_result_blob64( - sqlite3_context *pCtx, - const void *z, + sqlite3_context *pCtx, + const void *z, sqlite3_uint64 n, void (*xDel)(void *) ){ @@ -76392,8 +76392,8 @@ SQLITE_API void sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubt pOut->flags |= MEM_Subtype; } SQLITE_API void sqlite3_result_text( - sqlite3_context *pCtx, - const char *z, + sqlite3_context *pCtx, + const char *z, int n, void (*xDel)(void *) ){ @@ -76401,8 +76401,8 @@ SQLITE_API void sqlite3_result_text( setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel); } SQLITE_API void sqlite3_result_text64( - sqlite3_context *pCtx, - const char *z, + sqlite3_context *pCtx, + const char *z, sqlite3_uint64 n, void (*xDel)(void *), unsigned char enc @@ -76418,27 +76418,27 @@ SQLITE_API void sqlite3_result_text64( } #ifndef SQLITE_OMIT_UTF16 SQLITE_API void sqlite3_result_text16( - sqlite3_context *pCtx, - const void *z, - int n, + sqlite3_context *pCtx, + const void *z, + int n, void (*xDel)(void *) ){ assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel); } SQLITE_API void sqlite3_result_text16be( - sqlite3_context *pCtx, - const void *z, - int n, + sqlite3_context *pCtx, + const void *z, + int n, void (*xDel)(void *) ){ assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel); } SQLITE_API void sqlite3_result_text16le( - sqlite3_context *pCtx, - const void *z, - int n, + sqlite3_context *pCtx, + const void *z, + int n, void (*xDel)(void *) ){ assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); @@ -76469,7 +76469,7 @@ SQLITE_API void sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){ if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode; #endif if( pCtx->pOut->flags & MEM_Null ){ - sqlite3VdbeMemSetStr(pCtx->pOut, sqlite3ErrStr(errCode), -1, + sqlite3VdbeMemSetStr(pCtx->pOut, sqlite3ErrStr(errCode), -1, SQLITE_UTF8, SQLITE_STATIC); } } @@ -76479,7 +76479,7 @@ SQLITE_API void sqlite3_result_error_toobig(sqlite3_context *pCtx){ assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); pCtx->isError = SQLITE_TOOBIG; pCtx->fErrorOrAux = 1; - sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1, + sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1, SQLITE_UTF8, SQLITE_STATIC); } @@ -76493,7 +76493,7 @@ SQLITE_API void sqlite3_result_error_nomem(sqlite3_context *pCtx){ } /* -** This function is called after a transaction has been committed. It +** This function is called after a transaction has been committed. It ** invokes callbacks registered with sqlite3_wal_hook() as required. */ static int doWalCallbacks(sqlite3 *db){ @@ -76522,7 +76522,7 @@ static int doWalCallbacks(sqlite3 *db){ ** statement is completely executed or an error occurs. ** ** This routine implements the bulk of the logic behind the sqlite_step() -** API. The only thing omitted is the automatic recompile if a +** API. The only thing omitted is the automatic recompile if a ** schema change has occurred. That detail is handled by the ** outer sqlite3_step() wrapper procedure. */ @@ -76536,15 +76536,15 @@ static int sqlite3Step(Vdbe *p){ ** sqlite3_step() after any error or after SQLITE_DONE. But beginning ** with version 3.7.0, we changed this so that sqlite3_reset() would ** be called automatically instead of throwing the SQLITE_MISUSE error. - ** This "automatic-reset" change is not technically an incompatibility, + ** This "automatic-reset" change is not technically an incompatibility, ** since any application that receives an SQLITE_MISUSE is broken by ** definition. ** ** Nevertheless, some published applications that were originally written - ** for version 3.6.23 or earlier do in fact depend on SQLITE_MISUSE + ** for version 3.6.23 or earlier do in fact depend on SQLITE_MISUSE ** returns, and those were broken by the automatic-reset change. As a ** a work-around, the SQLITE_OMIT_AUTORESET compile-time restores the - ** legacy behavior of returning SQLITE_MISUSE for cases where the + ** legacy behavior of returning SQLITE_MISUSE for cases where the ** previous sqlite3_step() returned something other than a SQLITE_LOCKED ** or SQLITE_BUSY error. */ @@ -76580,7 +76580,7 @@ static int sqlite3Step(Vdbe *p){ db->u1.isInterrupted = 0; } - assert( db->nVdbeWrite>0 || db->autoCommit==0 + assert( db->nVdbeWrite>0 || db->autoCommit==0 || (db->nDeferredCons==0 && db->nDeferredImmCons==0) ); @@ -76630,14 +76630,14 @@ static int sqlite3Step(Vdbe *p){ p->rc = SQLITE_NOMEM_BKPT; } end_of_step: - /* At this point local variable rc holds the value that should be - ** returned if this statement was compiled using the legacy + /* At this point local variable rc holds the value that should be + ** returned if this statement was compiled using the legacy ** sqlite3_prepare() interface. According to the docs, this can only - ** be one of the values in the first assert() below. Variable p->rc - ** contains the value that would be returned if sqlite3_finalize() + ** be one of the values in the first assert() below. Variable p->rc + ** contains the value that would be returned if sqlite3_finalize() ** were called on statement p. */ - assert( rc==SQLITE_ROW || rc==SQLITE_DONE || rc==SQLITE_ERROR + assert( rc==SQLITE_ROW || rc==SQLITE_DONE || rc==SQLITE_ERROR || (rc&0xff)==SQLITE_BUSY || rc==SQLITE_MISUSE ); assert( (p->rc!=SQLITE_ROW && p->rc!=SQLITE_DONE) || p->rc==p->rcApp ); @@ -76645,7 +76645,7 @@ end_of_step: /* If this statement was prepared using sqlite3_prepare_v2(), and an ** error has occurred, then return the error code in p->rc to the ** caller. Set the error code in the database handle to the same value. - */ + */ rc = sqlite3VdbeTransferError(p); } return (rc&db->errMask); @@ -76679,15 +76679,15 @@ SQLITE_API int sqlite3_step(sqlite3_stmt *pStmt){ assert( v->expired==0 ); } if( rc2!=SQLITE_OK ){ - /* This case occurs after failing to recompile an sql statement. - ** The error message from the SQL compiler has already been loaded - ** into the database handle. This block copies the error message + /* This case occurs after failing to recompile an sql statement. + ** The error message from the SQL compiler has already been loaded + ** into the database handle. This block copies the error message ** from the database handle into the statement and sets the statement - ** program counter to 0 to ensure that when the statement is + ** program counter to 0 to ensure that when the statement is ** finalized or reset the parser error message is available via ** sqlite3_errmsg() and sqlite3_errcode(). */ - const char *zErr = (const char *)sqlite3_value_text(db->pErr); + const char *zErr = (const char *)sqlite3_value_text(db->pErr); sqlite3DbFree(db, v->zErrMsg); if( !db->mallocFailed ){ v->zErrMsg = sqlite3DbStrDup(db, zErr); @@ -76835,9 +76835,9 @@ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ ** deleted by calling the delete function specified when it was set. */ SQLITE_API void sqlite3_set_auxdata( - sqlite3_context *pCtx, - int iArg, - void *pAux, + sqlite3_context *pCtx, + int iArg, + void *pAux, void (*xDelete)(void*) ){ AuxData *pAuxData; @@ -76881,7 +76881,7 @@ failed: #ifndef SQLITE_OMIT_DEPRECATED /* -** Return the number of times the Step function of an aggregate has been +** Return the number of times the Step function of an aggregate has been ** called. ** ** This function is deprecated. Do not use it for new code. It is @@ -76926,9 +76926,9 @@ static const Mem *columnNullValue(void){ ** these assert()s from failing, when building with SQLITE_DEBUG defined ** using gcc, we force nullMem to be 8-byte aligned using the magical ** __attribute__((aligned(8))) macro. */ - static const Mem nullMem + static const Mem nullMem #if defined(SQLITE_DEBUG) && defined(__GNUC__) - __attribute__((aligned(8))) + __attribute__((aligned(8))) #endif = { /* .u = */ {0}, @@ -76974,9 +76974,9 @@ static Mem *columnMem(sqlite3_stmt *pStmt, int i){ } /* -** This function is called after invoking an sqlite3_value_XXX function on a +** This function is called after invoking an sqlite3_value_XXX function on a ** column value (i.e. a value returned by evaluating an SQL expression in the -** select list of a SELECT statement) that may cause a malloc() failure. If +** select list of a SELECT statement) that may cause a malloc() failure. If ** malloc() has failed, the threads mallocFailed flag is cleared and the result ** code of statement pStmt set to SQLITE_NOMEM. ** @@ -77015,8 +77015,8 @@ SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt *pStmt, int i){ const void *val; val = sqlite3_value_blob( columnMem(pStmt,i) ); /* Even though there is no encoding conversion, value_blob() might - ** need to call malloc() to expand the result of a zeroblob() - ** expression. + ** need to call malloc() to expand the result of a zeroblob() + ** expression. */ columnMallocFailure(pStmt); return val; @@ -77220,11 +77220,11 @@ SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){ /******************************* sqlite3_bind_ *************************** -** +** ** Routines used to attach values to wildcards in a compiled SQL statement. */ /* -** Unbind the value bound to variable i in virtual machine p. This is the +** Unbind the value bound to variable i in virtual machine p. This is the ** the same as binding a NULL value to the column. If the "i" parameter is ** out of range, then SQLITE_RANGE is returned. Othewise SQLITE_OK. ** @@ -77243,7 +77243,7 @@ static int vdbeUnbind(Vdbe *p, int i){ if( p->magic!=VDBE_MAGIC_RUN || p->pc>=0 ){ sqlite3Error(p->db, SQLITE_MISUSE); sqlite3_mutex_leave(p->db->mutex); - sqlite3_log(SQLITE_MISUSE, + sqlite3_log(SQLITE_MISUSE, "bind on a busy prepared statement: [%s]", p->zSql); return SQLITE_MISUSE_BKPT; } @@ -77258,7 +77258,7 @@ static int vdbeUnbind(Vdbe *p, int i){ pVar->flags = MEM_Null; sqlite3Error(p->db, SQLITE_OK); - /* If the bit corresponding to this variable in Vdbe.expmask is set, then + /* If the bit corresponding to this variable in Vdbe.expmask is set, then ** binding a new value to this variable invalidates the current query plan. ** ** IMPLEMENTATION-OF: R-48440-37595 If the specific value bound to host @@ -77313,10 +77313,10 @@ static int bindText( ** Bind a blob value to an SQL statement variable. */ SQLITE_API int sqlite3_bind_blob( - sqlite3_stmt *pStmt, - int i, - const void *zData, - int nData, + sqlite3_stmt *pStmt, + int i, + const void *zData, + int nData, void (*xDel)(void*) ){ #ifdef SQLITE_ENABLE_API_ARMOR @@ -77325,10 +77325,10 @@ SQLITE_API int sqlite3_bind_blob( return bindText(pStmt, i, zData, nData, xDel, 0); } SQLITE_API int sqlite3_bind_blob64( - sqlite3_stmt *pStmt, - int i, - const void *zData, - sqlite3_uint64 nData, + sqlite3_stmt *pStmt, + int i, + const void *zData, + sqlite3_uint64 nData, void (*xDel)(void*) ){ assert( xDel!=SQLITE_DYNAMIC ); @@ -77380,20 +77380,20 @@ SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt *pStmt, int i, void *pPtr){ } return rc; } -SQLITE_API int sqlite3_bind_text( - sqlite3_stmt *pStmt, - int i, - const char *zData, - int nData, +SQLITE_API int sqlite3_bind_text( + sqlite3_stmt *pStmt, + int i, + const char *zData, + int nData, void (*xDel)(void*) ){ return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8); } -SQLITE_API int sqlite3_bind_text64( - sqlite3_stmt *pStmt, - int i, - const char *zData, - sqlite3_uint64 nData, +SQLITE_API int sqlite3_bind_text64( + sqlite3_stmt *pStmt, + int i, + const char *zData, + sqlite3_uint64 nData, void (*xDel)(void*), unsigned char enc ){ @@ -77407,10 +77407,10 @@ SQLITE_API int sqlite3_bind_text64( } #ifndef SQLITE_OMIT_UTF16 SQLITE_API int sqlite3_bind_text16( - sqlite3_stmt *pStmt, - int i, - const void *zData, - int nData, + sqlite3_stmt *pStmt, + int i, + const void *zData, + int nData, void (*xDel)(void*) ){ return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE); @@ -77474,7 +77474,7 @@ SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint6 /* ** Return the number of wildcards that can be potentially bound to. -** This routine is added to support DBD::SQLite. +** This routine is added to support DBD::SQLite. */ SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){ Vdbe *p = (Vdbe*)pStmt; @@ -77659,8 +77659,8 @@ SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt){ ** if successful, or a NULL pointer if an OOM error is encountered. */ static UnpackedRecord *vdbeUnpackRecord( - KeyInfo *pKeyInfo, - int nKey, + KeyInfo *pKeyInfo, + int nKey, const void *pKey ){ UnpackedRecord *pRet; /* Return value */ @@ -77750,7 +77750,7 @@ SQLITE_API int sqlite3_preupdate_count(sqlite3 *db){ ** only. It returns zero if the change that caused the callback was made ** immediately by a user SQL statement. Or, if the change was made by a ** trigger program, it returns the number of trigger programs currently -** on the stack (1 for a top-level trigger, 2 for a trigger fired by a +** on the stack (1 for a top-level trigger, 2 for a trigger fired by a ** top-level trigger etc.). ** ** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL @@ -77959,8 +77959,8 @@ static int findNextHostParameter(const char *zSql, int *pnToken){ /* ** This function returns a pointer to a nul-terminated string in memory ** obtained from sqlite3DbMalloc(). If sqlite3.nVdbeExec is 1, then the -** string contains a copy of zRawSql but with host parameters expanded to -** their current bindings. Or, if sqlite3.nVdbeExec is greater than 1, +** string contains a copy of zRawSql but with host parameters expanded to +** their current bindings. Or, if sqlite3.nVdbeExec is greater than 1, ** then the returned string holds a copy of zRawSql with "-- " prepended ** to each line of text. ** @@ -77998,7 +77998,7 @@ SQLITE_PRIVATE char *sqlite3VdbeExpandSql( char zBase[100]; /* Initial working space */ db = p->db; - sqlite3StrAccumInit(&out, 0, zBase, sizeof(zBase), + sqlite3StrAccumInit(&out, 0, zBase, sizeof(zBase), db->aLimit[SQLITE_LIMIT_LENGTH]); if( db->nVdbeExec>1 ){ while( *zRawSql ){ @@ -78066,7 +78066,7 @@ SQLITE_PRIVATE char *sqlite3VdbeExpandSql( nOut = SQLITE_TRACE_SIZE_LIMIT; while( nOutn && (pVar->z[nOut]&0xc0)==0x80 ){ nOut++; } } -#endif +#endif sqlite3XPrintf(&out, "'%.*q'", nOut, pVar->z); #ifdef SQLITE_TRACE_SIZE_LIMIT if( nOutn ){ @@ -78248,7 +78248,7 @@ SQLITE_API int sqlite3_found_count = 0; static void vdbeTakeBranch(int iSrcLine, u8 I, u8 M){ if( iSrcLine<=2 && ALWAYS(iSrcLine>0) ){ M = iSrcLine; - /* Assert the truth of VdbeCoverageAlwaysTaken() and + /* Assert the truth of VdbeCoverageAlwaysTaken() and ** VdbeCoverageNeverTaken() */ assert( (M & I)==I ); }else{ @@ -78297,7 +78297,7 @@ static VdbeCursor *allocateCursor( u8 eCurType /* Type of the new cursor */ ){ /* Find the memory cell that will be used to store the blob of memory - ** required for this VdbeCursor structure. It is convenient to use a + ** required for this VdbeCursor structure. It is convenient to use a ** vdbe memory cell to manage the memory allocation required for a ** VdbeCursor structure for the following reasons: ** @@ -78318,8 +78318,8 @@ static VdbeCursor *allocateCursor( int nByte; VdbeCursor *pCx = 0; - nByte = - ROUND8(sizeof(VdbeCursor)) + 2*sizeof(u32)*nField + + nByte = + ROUND8(sizeof(VdbeCursor)) + 2*sizeof(u32)*nField + (eCurType==CURTYPE_BTREE?sqlite3BtreeCursorSize():0); assert( iCur>=0 && iCurnCursor ); @@ -78380,7 +78380,7 @@ static void applyNumericAffinity(Mem *pRec, int bTryForInt){ ** SQLITE_AFF_INTEGER: ** SQLITE_AFF_REAL: ** SQLITE_AFF_NUMERIC: -** Try to convert pRec to an integer representation or a +** Try to convert pRec to an integer representation or a ** floating-point representation if an integer representation ** is not possible. Note that the integer representation is ** always preferred, even if the affinity is REAL, because @@ -78410,7 +78410,7 @@ static void applyAffinity( }else if( affinity==SQLITE_AFF_TEXT ){ /* Only attempt the conversion to TEXT if there is an integer or real ** representation (blob and NULL do not get converted) but no string - ** representation. It would be harmless to repeat the conversion if + ** representation. It would be harmless to repeat the conversion if ** there is already a string rep, but it is pointless to waste those ** CPU cycles. */ if( 0==(pRec->flags&MEM_Str) ){ /*OPTIMIZATION-IF-FALSE*/ @@ -78439,12 +78439,12 @@ SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *pVal){ } /* -** Exported version of applyAffinity(). This one works on sqlite3_value*, +** Exported version of applyAffinity(). This one works on sqlite3_value*, ** not the internal Mem* type. */ SQLITE_PRIVATE void sqlite3ValueApplyAffinity( - sqlite3_value *pVal, - u8 affinity, + sqlite3_value *pVal, + u8 affinity, u8 enc ){ applyAffinity((Mem *)pVal, affinity, enc); @@ -78470,7 +78470,7 @@ static u16 SQLITE_NOINLINE computeNumericType(Mem *pMem){ /* ** Return the numeric type for pMem, either MEM_Int or MEM_Real or both or -** none. +** none. ** ** Unlike applyNumericAffinity(), this routine does not modify pMem->flags. ** But it does set pMem->u.r and pMem->u.i appropriately. @@ -78610,8 +78610,8 @@ static void registerTrace(int iReg, Mem *p){ #ifdef VDBE_PROFILE -/* -** hwtime.h contains inline assembler code for implementing +/* +** hwtime.h contains inline assembler code for implementing ** high-performance timing routines. */ /************** Include hwtime.h in the middle of vdbe.c *********************/ @@ -78669,7 +78669,7 @@ static void registerTrace(int iReg, Mem *p){ __asm__ __volatile__ ("rdtsc" : "=A" (val)); return val; } - + #elif (defined(__GNUC__) && defined(__ppc__)) __inline__ sqlite_uint64 sqlite3Hwtime(void){ @@ -78711,9 +78711,9 @@ SQLITE_PRIVATE sqlite_uint64 sqlite3Hwtime(void){ return ((sqlite_uint64)0); } /* ** This function is only called from within an assert() expression. It ** checks that the sqlite3.nTransaction variable is correctly set to -** the number of non-transaction savepoints currently in the +** the number of non-transaction savepoints currently in the ** linked list starting at sqlite3.pSavepoint. -** +** ** Usage: ** ** assert( checkSavepointCount(db) ); @@ -78753,7 +78753,7 @@ static Mem *out2Prerelease(Vdbe *p, VdbeOp *pOp){ /* ** Execute as much of a VDBE program as we can. -** This is the core of sqlite3_step(). +** This is the core of sqlite3_step(). */ SQLITE_PRIVATE int sqlite3VdbeExec( Vdbe *p /* The VDBE */ @@ -78855,7 +78855,7 @@ SQLITE_PRIVATE int sqlite3VdbeExec( sqlite3VdbePrintOp(stdout, (int)(pOp - aOp), pOp); } #endif - + /* Check to see if we need to simulate an interrupt. This only happens ** if we have a special test build. @@ -78909,7 +78909,7 @@ SQLITE_PRIVATE int sqlite3VdbeExec( #if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE) pOrigOp = pOp; #endif - + switch( pOp->opcode ){ /***************************************************************************** @@ -78950,7 +78950,7 @@ SQLITE_PRIVATE int sqlite3VdbeExec( /* Opcode: Goto * P2 * * * ** ** An unconditional jump to address P2. -** The next instruction executed will be +** The next instruction executed will be ** the one at index P2 from the beginning of ** the program. ** @@ -78966,7 +78966,7 @@ jump_to_p2_and_check_for_interrupt: /* Opcodes that are used as the bottom of a loop (OP_Next, OP_Prev, ** OP_VNext, OP_RowSetNext, or OP_SorterNext) all jump here upon ** completion. Check to see if sqlite3_interrupt() has been called - ** or if the progress callback needs to be invoked. + ** or if the progress callback needs to be invoked. ** ** This code uses unstructured "goto" statements and does not look clean. ** But that is not due to sloppy coding habits. The code is written this @@ -78991,7 +78991,7 @@ check_for_interrupt: } } #endif - + break; } @@ -79123,7 +79123,7 @@ case OP_HaltIfNull: { /* in3 */ ** whether or not to rollback the current transaction. Do not rollback ** if P2==OE_Fail. Do the rollback if P2==OE_Rollback. If P2==OE_Abort, ** then back out all changes that have occurred during this execution of the -** VDBE, but do not rollback the transaction. +** VDBE, but do not rollback the transaction. ** ** If P4 is not null then it is an error message string. ** @@ -79155,7 +79155,7 @@ case OP_Halt: { sqlite3VdbeSetChanges(db, p->nChange); pcx = sqlite3VdbeFrameRestore(pFrame); if( pOp->p2==OE_Ignore ){ - /* Instruction pcx is the OP_Program that invoked the sub-program + /* Instruction pcx is the OP_Program that invoked the sub-program ** currently being halted. If the p2 instruction of this OP_Halt ** instruction is set to OE_Ignore, then the sub-program is throwing ** an IGNORE exception. In this case jump to the address specified @@ -79243,7 +79243,7 @@ case OP_Real: { /* same as TK_FLOAT, out2 */ /* Opcode: String8 * P2 * P4 * ** Synopsis: r[P2]='P4' ** -** P4 points to a nul terminated UTF-8 string. This opcode is transformed +** P4 points to a nul terminated UTF-8 string. This opcode is transformed ** into a String opcode before it is executed for the first time. During ** this transformation, the length of string P4 is computed and stored ** as the P1 parameter. @@ -79278,7 +79278,7 @@ case OP_String8: { /* same as TK_STRING, out2 */ assert( rc==SQLITE_OK ); /* Fall through to the next case, OP_String */ } - + /* Opcode: String P1 P2 P3 P4 P5 ** Synopsis: r[P2]='P4' (len=P1) ** @@ -79541,8 +79541,8 @@ case OP_ResultRow: { goto abort_due_to_error; } - /* If the SQLITE_CountRows flag is set in sqlite3.flags mask, then - ** DML statements invoke this opcode to return the number of rows + /* If the SQLITE_CountRows flag is set in sqlite3.flags mask, then + ** DML statements invoke this opcode to return the number of rows ** modified to the user. This is the only way that a VM that ** opens a statement transaction may invoke this opcode. ** @@ -79663,15 +79663,15 @@ case OP_Concat: { /* same as TK_CONCAT, in1, in2, out3 */ ** Synopsis: r[P3]=r[P2]/r[P1] ** ** Divide the value in register P1 by the value in register P2 -** and store the result in register P3 (P3=P2/P1). If the value in -** register P1 is zero, then the result is NULL. If either input is +** and store the result in register P3 (P3=P2/P1). If the value in +** register P1 is zero, then the result is NULL. If either input is ** NULL, the result is NULL. */ /* Opcode: Remainder P1 P2 P3 * * ** Synopsis: r[P3]=r[P2]%r[P1] ** -** Compute the remainder after integer register P2 is divided by -** register P1 and store the result in register P3. +** Compute the remainder after integer register P2 is divided by +** register P1 and store the result in register P3. ** If the value in register P1 is zero the result is NULL. ** If either operand is NULL, the result is NULL. */ @@ -79795,7 +79795,7 @@ case OP_CollSeq: { ** successors. The result of the function is stored in register P3. ** Register P3 must not be one of the function inputs. ** -** P1 is a 32-bit bitmask indicating whether or not each argument to the +** P1 is a 32-bit bitmask indicating whether or not each argument to the ** function was determined to be constant at compile time. If the first ** argument was constant then bit 0 of P1 is set. This is used to determine ** whether meta data associated with a user function argument using the @@ -79812,7 +79812,7 @@ case OP_CollSeq: { ** from register P2 and successors. The result of the function is stored ** in register P3. Register P3 must not be one of the function inputs. ** -** P1 is a 32-bit bitmask indicating whether or not each argument to the +** P1 is a 32-bit bitmask indicating whether or not each argument to the ** function was determined to be constant at compile time. If the first ** argument was constant then bit 0 of P1 is set. This is used to determine ** whether meta data associated with a user function argument using the @@ -79982,7 +79982,7 @@ case OP_ShiftRight: { /* same as TK_RSHIFT, in1, in2, out3 */ /* Opcode: AddImm P1 P2 * * * ** Synopsis: r[P1]=r[P1]+P2 -** +** ** Add the constant P2 to the value in register P1. ** The result is always an integer. ** @@ -79997,7 +79997,7 @@ case OP_AddImm: { /* in1 */ } /* Opcode: MustBeInt P1 P2 * * * -** +** ** Force the value in register P1 to be an integer. If the value ** in P1 is not an integer and cannot be converted into an integer ** without data loss, then jump immediately to P2, or if P2==0 @@ -80045,7 +80045,7 @@ case OP_RealAffinity: { /* in1 */ ** Synopsis: affinity(r[P1]) ** ** Force the value in register P1 to be the type defined by P2. -** +** **
          **
        • TEXT **
        • BLOB @@ -80081,14 +80081,14 @@ case OP_Cast: { /* in1 */ ** store the result of comparison in register P2. ** ** The SQLITE_AFF_MASK portion of P5 must be an affinity character - -** SQLITE_AFF_TEXT, SQLITE_AFF_INTEGER, and so forth. An attempt is made +** SQLITE_AFF_TEXT, SQLITE_AFF_INTEGER, and so forth. An attempt is made ** to coerce both inputs according to this affinity before the ** comparison is made. If the SQLITE_AFF_MASK is 0x00, then numeric ** affinity is used. Note that the affinity conversions are stored ** back into the input registers P1 and P3. So this opcode can cause ** persistent changes to registers P1 and P3. ** -** Once any conversions have taken place, and neither value is NULL, +** Once any conversions have taken place, and neither value is NULL, ** the values are compared. If both values are blobs then memcmp() is ** used to determine the results of the comparison. If both values ** are text, then the appropriate collating function specified in @@ -80127,18 +80127,18 @@ case OP_Cast: { /* in1 */ ** the result of comparison (0 or 1 or NULL) into register P2. ** ** If the SQLITE_JUMPIFNULL bit of P5 is set and either reg(P1) or -** reg(P3) is NULL then the take the jump. If the SQLITE_JUMPIFNULL +** reg(P3) is NULL then the take the jump. If the SQLITE_JUMPIFNULL ** bit is clear then fall through if either operand is NULL. ** ** The SQLITE_AFF_MASK portion of P5 must be an affinity character - -** SQLITE_AFF_TEXT, SQLITE_AFF_INTEGER, and so forth. An attempt is made +** SQLITE_AFF_TEXT, SQLITE_AFF_INTEGER, and so forth. An attempt is made ** to coerce both inputs according to this affinity before the ** comparison is made. If the SQLITE_AFF_MASK is 0x00, then numeric ** affinity is used. Note that the affinity conversions are stored ** back into the input registers P1 and P3. So this opcode can cause ** persistent changes to registers P1 and P3. ** -** Once any conversions have taken place, and neither value is NULL, +** Once any conversions have taken place, and neither value is NULL, ** the values are compared. If both values are blobs then memcmp() is ** used to determine the results of the comparison. If both values ** are text, then the appropriate collating function specified in @@ -80315,7 +80315,7 @@ compare_op: ** ** This opcode must immediately follow an OP_Lt or OP_Gt comparison operator. ** If result of an OP_Eq comparison on the same two operands -** would have be NULL or false (0), then then jump to P2. +** would have be NULL or false (0), then then jump to P2. ** If the result of an OP_Eq comparison on the two previous operands ** would have been true (1), then fall through. */ @@ -80335,7 +80335,7 @@ case OP_ElseNotEq: { /* same as TK_ESCAPE, jump */ ** instruction. The permutation is stored in the P4 operand. ** ** The permutation is only valid until the next OP_Compare that has -** the OPFLAG_PERMUTE bit set in P5. Typically the OP_Permutation should +** the OPFLAG_PERMUTE bit set in P5. Typically the OP_Permutation should ** occur immediately prior to the OP_Compare. ** ** The first integer in the P4 integer array is the length of the array @@ -80499,7 +80499,7 @@ case OP_Or: { /* same as TK_OR, in1, in2, out3 */ ** Synopsis: r[P2]= !r[P1] ** ** Interpret the value in register P1 as a boolean value. Store the -** boolean complement in register P2. If the value in register P1 is +** boolean complement in register P2. If the value in register P1 is ** NULL, then a NULL is stored in P2. */ case OP_Not: { /* same as TK_NOT, in1, out2 */ @@ -80599,7 +80599,7 @@ case OP_IsNull: { /* same as TK_ISNULL, jump, in1 */ /* Opcode: NotNull P1 P2 * * * ** Synopsis: if r[P1]!=NULL goto P2 ** -** Jump to P2 if the value in register P1 is not NULL. +** Jump to P2 if the value in register P1 is not NULL. */ case OP_NotNull: { /* same as TK_NOTNULL, jump, in1 */ pIn1 = &aMem[pOp->p1]; @@ -80616,7 +80616,7 @@ case OP_NotNull: { /* same as TK_NOTNULL, jump, in1 */ ** Interpret the data that cursor P1 points to as a structure built using ** the MakeRecord instruction. (See the MakeRecord opcode for additional ** information about the format of the data.) Extract the P2-th column -** from this record. If there are less that (P2+1) +** from this record. If there are less that (P2+1) ** values in the record, extract a NULL. ** ** The value extracted is stored in register P3. @@ -80743,7 +80743,7 @@ case OP_Column: { */ if( pC->nHdrParsed<=p2 ){ /* If there is more header available for parsing in the record, try - ** to extract additional fields up through the p2+1-th field + ** to extract additional fields up through the p2+1-th field */ if( pC->iHdrOffsetaRow; } - + /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ op_column_read_header: i = pC->nHdrParsed; @@ -80939,13 +80939,13 @@ case OP_MakeRecord: { ** like this: ** ** ------------------------------------------------------------------------ - ** | hdr-size | type 0 | type 1 | ... | type N-1 | data0 | ... | data N-1 | + ** | hdr-size | type 0 | type 1 | ... | type N-1 | data0 | ... | data N-1 | ** ------------------------------------------------------------------------ ** ** Data(0) is taken from register P1. Data(1) comes from register P1+1 ** and so forth. ** - ** Each type field is a varint representing the serial type of the + ** Each type field is a varint representing the serial type of the ** corresponding data element (see sqlite3VdbeSerialType()). The ** hdr-size field is also a varint which is the offset from the beginning ** of the record to data0. @@ -81034,7 +81034,7 @@ case OP_MakeRecord: { goto too_big; } - /* Make sure the output register has a buffer large enough to store + /* Make sure the output register has a buffer large enough to store ** the new record. The output register (pOp->p3) is not allowed to ** be one of the input registers (because the following call to ** sqlite3VdbeMemClearAndResize() could clobber the value before it is used). @@ -81077,7 +81077,7 @@ case OP_MakeRecord: { /* Opcode: Count P1 P2 * * * ** Synopsis: r[P2]=count() ** -** Store the number of entries (an integer value) in the table or index +** Store the number of entries (an integer value) in the table or index ** opened by cursor P1 in register P2 */ #ifndef SQLITE_OMIT_BTREECOUNT @@ -81117,7 +81117,7 @@ case OP_Savepoint: { zName = pOp->p4.z; /* Assert that the p1 parameter is valid. Also that if there is no open - ** transaction, then there cannot be any savepoints. + ** transaction, then there cannot be any savepoints. */ assert( db->pSavepoint==0 || db->autoCommit==0 ); assert( p1==SAVEPOINT_BEGIN||p1==SAVEPOINT_RELEASE||p1==SAVEPOINT_ROLLBACK ); @@ -81127,7 +81127,7 @@ case OP_Savepoint: { if( p1==SAVEPOINT_BEGIN ){ if( db->nVdbeWrite>0 ){ - /* A new savepoint cannot be created if there are active write + /* A new savepoint cannot be created if there are active write ** statements (i.e. open read/write incremental blob handles). */ sqlite3VdbeError(p, "cannot open savepoint - SQL statements in progress"); @@ -81151,7 +81151,7 @@ case OP_Savepoint: { if( pNew ){ pNew->zName = (char *)&pNew[1]; memcpy(pNew->zName, zName, nName+1); - + /* If there is no open transaction, then mark this as a special ** "transaction savepoint". */ if( db->autoCommit ){ @@ -81174,7 +81174,7 @@ case OP_Savepoint: { /* Find the named savepoint. If there is no such savepoint, then an ** an error is returned to the user. */ for( - pSavepoint = db->pSavepoint; + pSavepoint = db->pSavepoint; pSavepoint && sqlite3StrICmp(pSavepoint->zName, zName); pSavepoint = pSavepoint->pNext ){ @@ -81184,7 +81184,7 @@ case OP_Savepoint: { sqlite3VdbeError(p, "no such savepoint: %s", zName); rc = SQLITE_ERROR; }else if( db->nVdbeWrite>0 && p1==SAVEPOINT_RELEASE ){ - /* It is not possible to release (commit) a savepoint if there are + /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ sqlite3VdbeError(p, "cannot release savepoint - " @@ -81193,8 +81193,8 @@ case OP_Savepoint: { }else{ /* Determine whether or not this is a transaction savepoint. If so, - ** and this is a RELEASE command, then the current transaction - ** is committed. + ** and this is a RELEASE command, then the current transaction + ** is committed. */ int isTransaction = pSavepoint->pNext==0 && db->isTransactionSavepoint; if( isTransaction && p1==SAVEPOINT_RELEASE ){ @@ -81236,8 +81236,8 @@ case OP_Savepoint: { db->flags = (db->flags | SQLITE_InternChanges); } } - - /* Regardless of whether this is a RELEASE or ROLLBACK, destroy all + + /* Regardless of whether this is a RELEASE or ROLLBACK, destroy all ** savepoints nested inside of the savepoint being operated on. */ while( db->pSavepoint!=pSavepoint ){ pTmp = db->pSavepoint; @@ -81246,8 +81246,8 @@ case OP_Savepoint: { db->nSavepoint--; } - /* If it is a RELEASE, then destroy the savepoint being operated on - ** too. If it is a ROLLBACK TO, then set the number of deferred + /* If it is a RELEASE, then destroy the savepoint being operated on + ** too. If it is a ROLLBACK TO, then set the number of deferred ** constraint violations present in the database to the value stored ** when the savepoint was created. */ if( p1==SAVEPOINT_RELEASE ){ @@ -81300,7 +81300,7 @@ case OP_AutoCommit: { db->autoCommit = 1; }else if( desiredAutoCommit && db->nVdbeWrite>0 ){ /* If this instruction implements a COMMIT and other VMs are writing - ** return an error indicating that the other VMs must complete first. + ** return an error indicating that the other VMs must complete first. */ sqlite3VdbeError(p, "cannot commit transaction - " "SQL statements in progress"); @@ -81330,7 +81330,7 @@ case OP_AutoCommit: { (!desiredAutoCommit)?"cannot start a transaction within a transaction":( (iRollback)?"cannot rollback - no transaction is active": "cannot commit - no transaction is active")); - + rc = SQLITE_ERROR; goto abort_due_to_error; } @@ -81341,7 +81341,7 @@ case OP_AutoCommit: { ** ** Begin a transaction on database P1 if a transaction is not already ** active. -** If P2 is non-zero, then a write-transaction is started, or if a +** If P2 is non-zero, then a write-transaction is started, or if a ** read-transaction is already active, it is upgraded to a write-transaction. ** If P2 is zero, then a read-transaction is started. ** @@ -81399,13 +81399,13 @@ case OP_Transaction: { goto abort_due_to_error; } - if( pOp->p2 && p->usesStmtJournal - && (db->autoCommit==0 || db->nVdbeRead>1) + if( pOp->p2 && p->usesStmtJournal + && (db->autoCommit==0 || db->nVdbeRead>1) ){ assert( sqlite3BtreeIsInTrans(pBt) ); if( p->iStatement==0 ){ assert( db->nStatement>=0 && db->nSavepoint>=0 ); - db->nStatement++; + db->nStatement++; p->iStatement = db->nSavepoint + db->nStatement; } @@ -81435,7 +81435,7 @@ case OP_Transaction: { if( pOp->p5 && (iMeta!=pOp->p3 || iGen!=pOp->p4.i) ){ sqlite3DbFree(db, p->zErrMsg); p->zErrMsg = sqlite3DbStrDup(db, "database schema has changed"); - /* If the schema-cookie from the database file matches the cookie + /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. ** @@ -81445,7 +81445,7 @@ case OP_Transaction: { ** prepared queries. If such a query is out-of-date, we do not want to ** discard the database schema, as the user code implementing the ** v-table would have to be ready for the sqlite3_vtab structure itself - ** to be invalidated whenever sqlite3_step() is called from within + ** to be invalidated whenever sqlite3_step() is called from within ** a v-table method. */ if( db->aDb[pOp->p1].pSchema->schema_cookie!=iMeta ){ @@ -81493,8 +81493,8 @@ case OP_ReadCookie: { /* out2 */ ** ** Write the integer value P3 into cookie number P2 of database P1. ** P2==1 is the schema version. P2==2 is the database format. -** P2==3 is the recommended pager cache -** size, and so forth. P1==0 is the main database file and P1==1 is the +** P2==3 is the recommended pager cache +** size, and so forth. P1==0 is the main database file and P1==1 is the ** database file used to store temporary tables. ** ** A transaction must be started before executing this opcode. @@ -81532,8 +81532,8 @@ case OP_SetCookie: { ** Synopsis: root=P2 iDb=P3 ** ** Open a read-only cursor for the database table whose root page is -** P2 in a database file. The database file is determined by P3. -** P3==0 means the main database, P3==1 means the database used for +** P2 in a database file. The database file is determined by P3. +** P3==0 means the main database, P3==1 means the database used for ** temporary tables, and P3>1 means used the corresponding attached ** database. Give the new cursor an identifier of P1. The P1 ** values need not be contiguous but all P1 values should be small integers. @@ -81552,9 +81552,9 @@ case OP_SetCookie: { ** SQLITE_BUSY error code. ** ** The P4 value may be either an integer (P4_INT32) or a pointer to -** a KeyInfo structure (P4_KEYINFO). If it is a pointer to a KeyInfo -** structure, then said structure defines the content and collating -** sequence of the index being opened. Otherwise, if P4 is an integer +** a KeyInfo structure (P4_KEYINFO). If it is a pointer to a KeyInfo +** structure, then said structure defines the content and collating +** sequence of the index being opened. Otherwise, if P4 is an integer ** value, it is set to the number of columns in the table. ** ** See also: OpenWrite, ReopenIdx @@ -81581,9 +81581,9 @@ case OP_SetCookie: { ** root page. ** ** The P4 value may be either an integer (P4_INT32) or a pointer to -** a KeyInfo structure (P4_KEYINFO). If it is a pointer to a KeyInfo -** structure, then said structure defines the content and collating -** sequence of the index being opened. Otherwise, if P4 is an integer +** a KeyInfo structure (P4_KEYINFO). If it is a pointer to a KeyInfo +** structure, then said structure defines the content and collating +** sequence of the index being opened. Otherwise, if P4 is an integer ** value, it is set to the number of columns in the table, or to the ** largest index of any column of the table that is actually used. ** @@ -81682,7 +81682,7 @@ case OP_OpenWrite: /* Set the VdbeCursor.isTable variable. Previous versions of ** SQLite used to check if the root-page flags were sane at this point ** and report database corruption if they were not, but this check has - ** since moved into the btree layer. */ + ** since moved into the btree layer. */ pCur->isTable = pOp->p4type!=P4_KEYINFO; open_cursor_set_hints: @@ -81702,7 +81702,7 @@ open_cursor_set_hints: ** Synopsis: nColumn=P2 ** ** Open a new cursor P1 to a transient table. -** The cursor is always opened read/write even if +** The cursor is always opened read/write even if ** the main database is read-only. The ephemeral ** table is deleted automatically when the cursor is closed. ** @@ -81724,12 +81724,12 @@ open_cursor_set_hints: ** by this opcode will be used for automatically created transient ** indices in joins. */ -case OP_OpenAutoindex: +case OP_OpenAutoindex: case OP_OpenEphemeral: { VdbeCursor *pCx; KeyInfo *pKeyInfo; - static const int vfsFlags = + static const int vfsFlags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | @@ -81741,7 +81741,7 @@ case OP_OpenEphemeral: { if( pCx==0 ) goto no_mem; pCx->nullRow = 1; pCx->isEphemeral = 1; - rc = sqlite3BtreeOpen(db->pVfs, 0, db, &pCx->pBtx, + rc = sqlite3BtreeOpen(db->pVfs, 0, db, &pCx->pBtx, BTREE_OMIT_JOURNAL | BTREE_SINGLE | pOp->p5, vfsFlags); if( rc==SQLITE_OK ){ rc = sqlite3BtreeBeginTrans(pCx->pBtx, 1); @@ -81755,7 +81755,7 @@ case OP_OpenEphemeral: { if( (pCx->pKeyInfo = pKeyInfo = pOp->p4.pKeyInfo)!=0 ){ int pgno; assert( pOp->p4type==P4_KEYINFO ); - rc = sqlite3BtreeCreateTable(pCx->pBtx, &pgno, BTREE_BLOBKEY | pOp->p5); + rc = sqlite3BtreeCreateTable(pCx->pBtx, &pgno, BTREE_BLOBKEY | pOp->p5); if( rc==SQLITE_OK ){ assert( pgno==MASTER_ROOT+1 ); assert( pKeyInfo->db==db ); @@ -81823,7 +81823,7 @@ case OP_SequenceTest: { ** ** Open a new cursor that points to a fake table that contains a single ** row of data. The content of that one row is the content of memory -** register P2. In other words, cursor P1 becomes an alias for the +** register P2. In other words, cursor P1 becomes an alias for the ** MEM_Blob content contained in register P2. ** ** A pseudo-table created by this opcode is used to hold a single @@ -81883,13 +81883,13 @@ case OP_ColumnsUsed: { /* Opcode: SeekGE P1 P2 P3 P4 * ** Synopsis: key=r[P3@P4] ** -** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), -** use the value in register P3 as the key. If cursor P1 refers -** to an SQL index, then P3 is the first in an array of P4 registers -** that are used as an unpacked index key. +** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), +** use the value in register P3 as the key. If cursor P1 refers +** to an SQL index, then P3 is the first in an array of P4 registers +** that are used as an unpacked index key. ** -** Reposition cursor P1 so that it points to the smallest entry that -** is greater than or equal to the key value. If there are no records +** Reposition cursor P1 so that it points to the smallest entry that +** is greater than or equal to the key value. If there are no records ** greater than or equal to the key and P2 is not zero, then jump to P2. ** ** If the cursor P1 was opened using the OPFLAG_SEEKEQ flag, then this @@ -81908,13 +81908,13 @@ case OP_ColumnsUsed: { /* Opcode: SeekGT P1 P2 P3 P4 * ** Synopsis: key=r[P3@P4] ** -** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), -** use the value in register P3 as a key. If cursor P1 refers -** to an SQL index, then P3 is the first in an array of P4 registers -** that are used as an unpacked index key. +** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), +** use the value in register P3 as a key. If cursor P1 refers +** to an SQL index, then P3 is the first in an array of P4 registers +** that are used as an unpacked index key. ** -** Reposition cursor P1 so that it points to the smallest entry that -** is greater than the key value. If there are no records greater than +** Reposition cursor P1 so that it points to the smallest entry that +** is greater than the key value. If there are no records greater than ** the key and P2 is not zero, then jump to P2. ** ** This opcode leaves the cursor configured to move in forward order, @@ -81923,16 +81923,16 @@ case OP_ColumnsUsed: { ** ** See also: Found, NotFound, SeekLt, SeekGe, SeekLe */ -/* Opcode: SeekLT P1 P2 P3 P4 * +/* Opcode: SeekLT P1 P2 P3 P4 * ** Synopsis: key=r[P3@P4] ** -** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), -** use the value in register P3 as a key. If cursor P1 refers -** to an SQL index, then P3 is the first in an array of P4 registers -** that are used as an unpacked index key. +** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), +** use the value in register P3 as a key. If cursor P1 refers +** to an SQL index, then P3 is the first in an array of P4 registers +** that are used as an unpacked index key. ** -** Reposition cursor P1 so that it points to the largest entry that -** is less than the key value. If there are no records less than +** Reposition cursor P1 so that it points to the largest entry that +** is less than the key value. If there are no records less than ** the key and P2 is not zero, then jump to P2. ** ** This opcode leaves the cursor configured to move in reverse order, @@ -81944,13 +81944,13 @@ case OP_ColumnsUsed: { /* Opcode: SeekLE P1 P2 P3 P4 * ** Synopsis: key=r[P3@P4] ** -** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), -** use the value in register P3 as a key. If cursor P1 refers -** to an SQL index, then P3 is the first in an array of P4 registers -** that are used as an unpacked index key. +** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), +** use the value in register P3 as a key. If cursor P1 refers +** to an SQL index, then P3 is the first in an array of P4 registers +** that are used as an unpacked index key. ** -** Reposition cursor P1 so that it points to the largest entry that -** is less than or equal to the key value. If there are no records +** Reposition cursor P1 so that it points to the largest entry that +** is less than or equal to the key value. If there are no records ** less than or equal to the key and P2 is not zero, then jump to P2. ** ** This opcode leaves the cursor configured to move in reverse order, @@ -82041,7 +82041,7 @@ case OP_SeekGT: { /* jump, in3 */ assert( (OP_SeekLT & 0x0001)==(OP_SeekGE & 0x0001) ); if( (oc & 0x0001)==(OP_SeekLT & 0x0001) ) oc++; } - } + } rc = sqlite3BtreeMovetoUnpacked(pC->uc.pCursor, 0, (u64)iKey, 0, &res); pC->movetoTarget = iKey; /* Used by OP_Delete */ if( rc!=SQLITE_OK ){ @@ -82156,9 +82156,9 @@ seek_not_found: ** If P4==0 then register P3 holds a blob constructed by MakeRecord. If ** P4>0 then register P3 is the first of P4 registers that form an unpacked ** record. -** +** ** Cursor P1 is on an index btree. If the record identified by P3 and P4 -** is not the prefix of any entry in P1 then a jump is made to P2. If P1 +** is not the prefix of any entry in P1 then a jump is made to P2. If P1 ** does contain an entry whose prefix matches the P3/P4 record then control ** falls through to the next instruction and P1 is left pointing at the ** matching entry. @@ -82175,7 +82175,7 @@ seek_not_found: ** If P4==0 then register P3 holds a blob constructed by MakeRecord. If ** P4>0 then register P3 is the first of P4 registers that form an unpacked ** record. -** +** ** Cursor P1 is on an index btree. If the record identified by P3 and P4 ** contains any NULL value, jump immediately to P2. If all terms of the ** record are not-NULL then a check is done to determine if any row in the @@ -82277,9 +82277,9 @@ case OP_Found: { /* jump, in3 */ ** ** P1 is the index of a cursor open on an SQL table btree (with integer ** keys). If register P3 does not contain an integer or if P1 does not -** contain a record with rowid P3 then jump immediately to P2. +** contain a record with rowid P3 then jump immediately to P2. ** Or, if P2 is 0, raise an SQLITE_CORRUPT error. If P1 does contain -** a record with rowid P3 then +** a record with rowid P3 then ** leave the cursor pointing at that record and fall through to the next ** instruction. ** @@ -82302,7 +82302,7 @@ case OP_Found: { /* jump, in3 */ ** P1 is the index of a cursor open on an SQL table btree (with integer ** keys). P3 is an integer rowid. If P1 does not contain a record with ** rowid P3 then jump immediately to P2. Or, if P2 is 0, raise an -** SQLITE_CORRUPT error. If P1 does contain a record with rowid P3 then +** SQLITE_CORRUPT error. If P1 does contain a record with rowid P3 then ** leave the cursor pointing at that record and fall through to the next ** instruction. ** @@ -82372,7 +82372,7 @@ case OP_NotExists: /* jump, in3 */ ** Find the next available sequence number for cursor P1. ** Write the sequence number into register P2. ** The sequence number on the cursor is incremented after this -** instruction. +** instruction. */ case OP_Sequence: { /* out2 */ assert( pOp->p1>=0 && pOp->p1nCursor ); @@ -82392,9 +82392,9 @@ case OP_Sequence: { /* out2 */ ** table that cursor P1 points to. The new record number is written ** written to register P2. ** -** If P3>0 then P3 is a register in the root frame of this VDBE that holds +** If P3>0 then P3 is a register in the root frame of this VDBE that holds ** the largest previously generated record number. No new record numbers are -** allowed to be less than this value. When this value reaches its maximum, +** allowed to be less than this value. When this value reaches its maximum, ** an SQLITE_FULL error is generated. The P3 register is updated with the ' ** generated record number. This P3 mechanism is used to help implement the ** AUTOINCREMENT feature. @@ -82542,8 +82542,8 @@ case OP_NewRowid: { /* out2 */ ** is part of an INSERT operation. The difference is only important to ** the update hook. ** -** Parameter P4 may point to a Table structure, or may be NULL. If it is -** not NULL, then the update-hook (sqlite3.xUpdateCallback) is invoked +** Parameter P4 may point to a Table structure, or may be NULL. If it is +** not NULL, then the update-hook (sqlite3.xUpdateCallback) is invoked ** following a successful insert. ** ** (WARNING/TODO: If P1 is a pseudo-cursor and P2 is dynamically @@ -82561,7 +82561,7 @@ case OP_NewRowid: { /* out2 */ ** This works exactly like OP_Insert except that the key is the ** integer value P3, not the value of the integer stored in register P3. */ -case OP_Insert: +case OP_Insert: case OP_InsertInt: { Mem *pData; /* MEM cell holding data for the record to be inserted */ Mem *pKey; /* MEM cell holding key for the record */ @@ -82608,7 +82608,7 @@ case OP_InsertInt: { #ifdef SQLITE_ENABLE_PREUPDATE_HOOK /* Invoke the pre-update hook, if any */ - if( db->xPreUpdateCallback + if( db->xPreUpdateCallback && pOp->p4type==P4_TABLE && !(pOp->p5 & OPFLAG_ISUPDATE) ){ @@ -82656,7 +82656,7 @@ case OP_InsertInt: { ** the cursor will be left pointing at either the next or the previous ** record in the table. If it is left pointing at the next record, then ** the next Next instruction will be a no-op. As a result, in this case -** it is ok to delete a record from within a Next loop. If +** it is ok to delete a record from within a Next loop. If ** OPFLAG_SAVEPOSITION bit of P5 is clear, then the cursor will be ** left in an undefined state. ** @@ -82672,11 +82672,11 @@ case OP_InsertInt: { ** P1 must not be pseudo-table. It has to be a real table with ** multiple rows. ** -** If P4 is not NULL then it points to a Table object. In this case either +** If P4 is not NULL then it points to a Table object. In this case either ** the update or pre-update hook, or both, may be invoked. The P1 cursor must -** have been positioned using OP_NotFound prior to invoking this opcode in -** this case. Specifically, if one is configured, the pre-update hook is -** invoked if P4 is not NULL. The update-hook is invoked if one is configured, +** have been positioned using OP_NotFound prior to invoking this opcode in +** this case. Specifically, if one is configured, the pre-update hook is +** invoked if P4 is not NULL. The update-hook is invoked if one is configured, ** P4 is not NULL, and the OPFLAG_NCHANGE flag is set in P2. ** ** If the OPFLAG_ISUPDATE flag is set in P2, then P3 contains the address @@ -82710,7 +82710,7 @@ case OP_Delete: { /* If the update-hook or pre-update-hook will be invoked, set zDb to ** the name of the db to pass as to it. Also set local pTab to a copy ** of p4.pTab. Finally, if p5 is true, indicating that this cursor was - ** last moved with OP_Next or OP_Prev, not Seek or NotFound, set + ** last moved with OP_Next or OP_Prev, not Seek or NotFound, set ** VdbeCursor.movetoTarget to the current rowid. */ if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){ assert( pC->iDb>=0 ); @@ -82728,20 +82728,20 @@ case OP_Delete: { #ifdef SQLITE_ENABLE_PREUPDATE_HOOK /* Invoke the pre-update-hook if required. */ if( db->xPreUpdateCallback && pOp->p4.pTab ){ - assert( !(opflags & OPFLAG_ISUPDATE) - || HasRowid(pTab)==0 - || (aMem[pOp->p3].flags & MEM_Int) + assert( !(opflags & OPFLAG_ISUPDATE) + || HasRowid(pTab)==0 + || (aMem[pOp->p3].flags & MEM_Int) ); sqlite3VdbePreUpdateHook(p, pC, - (opflags & OPFLAG_ISUPDATE) ? SQLITE_UPDATE : SQLITE_DELETE, + (opflags & OPFLAG_ISUPDATE) ? SQLITE_UPDATE : SQLITE_DELETE, zDb, pTab, pC->movetoTarget, pOp->p3 ); } if( opflags & OPFLAG_ISNOOP ) break; #endif - - /* Only flags that can be set are SAVEPOISTION and AUXDELETE */ + + /* Only flags that can be set are SAVEPOISTION and AUXDELETE */ assert( (pOp->p5 & ~(OPFLAG_SAVEPOSITION|OPFLAG_AUXDELETE))==0 ); assert( OPFLAG_SAVEPOSITION==BTREE_SAVEPOSITION ); assert( OPFLAG_AUXDELETE==BTREE_AUXDELETE ); @@ -82794,7 +82794,7 @@ case OP_ResetCount: { ** Synopsis: if key(P1)!=trim(r[P3],P4) goto P2 ** ** P1 is a sorter cursor. This instruction compares a prefix of the -** record blob in register P3 against a prefix of the entry that +** record blob in register P3 against a prefix of the entry that ** the sorter cursor currently points to. Only the first P4 fields ** of r[P3] and the sorter record are compared. ** @@ -82852,10 +82852,10 @@ case OP_SorterData: { /* Opcode: RowData P1 P2 P3 * * ** Synopsis: r[P2]=data ** -** Write into register P2 the complete row content for the row at +** Write into register P2 the complete row content for the row at ** which cursor P1 is currently pointing. -** There is no interpretation of the data. -** It is just copied onto the P2 register exactly as +** There is no interpretation of the data. +** It is just copied onto the P2 register exactly as ** it is found in the database file. ** ** If cursor P1 is an index, then the content is the key of the row. @@ -82995,7 +82995,7 @@ case OP_NullRow: { /* Opcode: Last P1 P2 P3 * * ** -** The next use of the Rowid or Column or Prev instruction for P1 +** The next use of the Rowid or Column or Prev instruction for P1 ** will refer to the last entry in the database table or index. ** If the table or index is empty and P2>0, then jump immediately to P2. ** If P2 is 0 or if the table or index is not empty, fall through @@ -83077,10 +83077,10 @@ case OP_Sort: { /* jump */ } /* Opcode: Rewind P1 P2 * * * ** -** The next use of the Rowid or Column or Next instruction for P1 +** The next use of the Rowid or Column or Next instruction for P1 ** will refer to the first entry in the database table or index. ** If the table or index is empty, jump immediately to P2. -** If the table or index is not empty, fall through to the following +** If the table or index is not empty, fall through to the following ** instruction. ** ** This opcode leaves the cursor configured to move in forward order, @@ -83267,7 +83267,7 @@ next_tail: ** run faster by avoiding an unnecessary seek on cursor P1. However, ** the OPFLAG_USESEEKRESULT flag must only be set if there have been no prior ** seeks on the cursor or if the most recent seek used a key equivalent -** to P2. +** to P2. ** ** This instruction only works for indices. The equivalent instruction ** for tables is OP_Insert. @@ -83303,7 +83303,7 @@ case OP_IdxInsert: { /* in2 */ x.aMem = aMem + pOp->p3; x.nMem = (u16)pOp->p4.i; rc = sqlite3BtreeInsert(pC->uc.pCursor, &x, - (pOp->p5 & (OPFLAG_APPEND|OPFLAG_SAVEPOSITION)), + (pOp->p5 & (OPFLAG_APPEND|OPFLAG_SAVEPOSITION)), ((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0) ); assert( pC->deferredMoveto==0 ); @@ -83317,7 +83317,7 @@ case OP_IdxInsert: { /* in2 */ ** Synopsis: key=r[P2@P3] ** ** The content of P3 registers starting at register P2 form -** an unpacked index key. This opcode removes that entry from the +** an unpacked index key. This opcode removes that entry from the ** index opened by cursor P1. */ case OP_IdxDelete: { @@ -83364,8 +83364,8 @@ case OP_IdxDelete: { ** ** P4 may be an array of integers (type P4_INTARRAY) containing ** one entry for each column in the P3 table. If array entry a(i) -** is non-zero, then reading column a(i)-1 from cursor P3 is -** equivalent to performing the deferred seek and then reading column i +** is non-zero, then reading column a(i)-1 from cursor P3 is +** equivalent to performing the deferred seek and then reading column i ** from P1. This information is stored in P3 and used to redirect ** reads against P3 over to P1, thus possibly avoiding the need to ** seek and read cursor P3. @@ -83436,9 +83436,9 @@ case OP_IdxRowid: { /* out2 */ /* Opcode: IdxGE P1 P2 P3 P4 P5 ** Synopsis: key=r[P3@P4] ** -** The P4 register values beginning with P3 form an unpacked index -** key that omits the PRIMARY KEY. Compare this key value against the index -** that P1 is currently pointing to, ignoring the PRIMARY KEY or ROWID +** The P4 register values beginning with P3 form an unpacked index +** key that omits the PRIMARY KEY. Compare this key value against the index +** that P1 is currently pointing to, ignoring the PRIMARY KEY or ROWID ** fields at the end. ** ** If the P1 index entry is greater than or equal to the key value @@ -83447,9 +83447,9 @@ case OP_IdxRowid: { /* out2 */ /* Opcode: IdxGT P1 P2 P3 P4 P5 ** Synopsis: key=r[P3@P4] ** -** The P4 register values beginning with P3 form an unpacked index -** key that omits the PRIMARY KEY. Compare this key value against the index -** that P1 is currently pointing to, ignoring the PRIMARY KEY or ROWID +** The P4 register values beginning with P3 form an unpacked index +** key that omits the PRIMARY KEY. Compare this key value against the index +** that P1 is currently pointing to, ignoring the PRIMARY KEY or ROWID ** fields at the end. ** ** If the P1 index entry is greater than the key value @@ -83458,7 +83458,7 @@ case OP_IdxRowid: { /* out2 */ /* Opcode: IdxLT P1 P2 P3 P4 P5 ** Synopsis: key=r[P3@P4] ** -** The P4 register values beginning with P3 form an unpacked index +** The P4 register values beginning with P3 form an unpacked index ** key that omits the PRIMARY KEY or ROWID. Compare this key value against ** the index that P1 is currently pointing to, ignoring the PRIMARY KEY or ** ROWID on the P1 index. @@ -83469,7 +83469,7 @@ case OP_IdxRowid: { /* out2 */ /* Opcode: IdxLE P1 P2 P3 P4 P5 ** Synopsis: key=r[P3@P4] ** -** The P4 register values beginning with P3 form an unpacked index +** The P4 register values beginning with P3 form an unpacked index ** key that omits the PRIMARY KEY or ROWID. Compare this key value against ** the index that P1 is currently pointing to, ignoring the PRIMARY KEY or ** ROWID on the P1 index. @@ -83536,8 +83536,8 @@ case OP_IdxGE: { /* jump */ ** might be moved into the newly deleted root page in order to keep all ** root pages contiguous at the beginning of the database. The former ** value of the root page that moved - its value before the move occurred - -** is stored in register P2. If no page -** movement was required (because the table being dropped was already +** is stored in register P2. If no page +** movement was required (because the table being dropped was already ** the last one in the database) then a zero is stored in register P2. ** If AUTOVACUUM is disabled then a zero is stored in register P2. ** @@ -83586,8 +83586,8 @@ case OP_Destroy: { /* out2 */ ** that is used to store tables create using CREATE TEMPORARY TABLE. ** ** If the P3 value is non-zero, then the table referred to must be an -** intkey table (an SQL table, not an index). In this case the row change -** count is incremented by the number of rows in the table being cleared. +** intkey table (an SQL table, not an index). In this case the row change +** count is incremented by the number of rows in the table being cleared. ** If P3 is greater than zero, then the value stored in register P3 is ** also incremented by the number of rows in the table being cleared. ** @@ -83595,7 +83595,7 @@ case OP_Destroy: { /* out2 */ */ case OP_Clear: { int nChange; - + nChange = 0; assert( p->readOnly==0 ); assert( DbMaskTest(p->btreeMask, pOp->p2) ); @@ -83624,7 +83624,7 @@ case OP_Clear: { */ case OP_ResetSorter: { VdbeCursor *pC; - + assert( pOp->p1>=0 && pOp->p1nCursor ); pC = p->apCsr[pOp->p1]; assert( pC!=0 ); @@ -83691,7 +83691,7 @@ case OP_CreateTable: { /* out2 */ /* Opcode: ParseSchema P1 * * P4 * ** ** Read and parse all entries from the SQLITE_MASTER table of database P1 -** that match the WHERE clause P4. +** that match the WHERE clause P4. ** ** This opcode invokes the parser to create a new virtual machine, ** then runs the new virtual machine. It is thus a re-entrant opcode. @@ -83703,7 +83703,7 @@ case OP_ParseSchema: { InitData initData; /* Any prepared statement that invokes this opcode will hold mutexes - ** on every btree. This is a prerequisite for invoking + ** on every btree. This is a prerequisite for invoking ** sqlite3InitCallback(). */ #ifdef SQLITE_DEBUG @@ -83743,7 +83743,7 @@ case OP_ParseSchema: { } goto abort_due_to_error; } - break; + break; } #if !defined(SQLITE_OMIT_ANALYZE) @@ -83757,7 +83757,7 @@ case OP_LoadAnalysis: { assert( pOp->p1>=0 && pOp->p1nDb ); rc = sqlite3AnalysisLoad(db, pOp->p1); if( rc ) goto abort_due_to_error; - break; + break; } #endif /* !defined(SQLITE_OMIT_ANALYZE) */ @@ -83765,7 +83765,7 @@ case OP_LoadAnalysis: { ** ** Remove the internal (in-memory) data structures that describe ** the table named P4 in database P1. This is called after a table -** is dropped from disk (using the Destroy opcode) in order to keep +** is dropped from disk (using the Destroy opcode) in order to keep ** the internal representation of the ** schema consistent with what is on disk. */ @@ -83791,7 +83791,7 @@ case OP_DropIndex: { ** ** Remove the internal (in-memory) data structures that describe ** the trigger named P4 in database P1. This is called after a trigger -** is dropped from disk (using the Destroy opcode) in order to keep +** is dropped from disk (using the Destroy opcode) in order to keep ** the internal representation of the ** schema consistent with what is on disk. */ @@ -83810,7 +83810,7 @@ case OP_DropTrigger: { ** ** The register P3 contains the maximum number of allowed errors. ** At most reg(P3) errors will be reported. -** In other words, the analysis stops as soon as reg(P1) errors are +** In other words, the analysis stops as soon as reg(P1) errors are ** seen. Reg(P1) is updated with the number of errors remaining. ** ** The root page numbers of all tables in the database are integers @@ -83888,7 +83888,7 @@ case OP_RowSetRead: { /* jump, in1, out3 */ i64 val; pIn1 = &aMem[pOp->p1]; - if( (pIn1->flags & MEM_RowSet)==0 + if( (pIn1->flags & MEM_RowSet)==0 || sqlite3RowSetNext(pIn1->u.pRowSet, &val)==0 ){ /* The boolean index is empty */ @@ -83962,13 +83962,13 @@ case OP_RowSetTest: { /* jump, in1, in3 */ /* Opcode: Program P1 P2 P3 P4 P5 ** -** Execute the trigger program passed as P4 (type P4_SUBPROGRAM). +** Execute the trigger program passed as P4 (type P4_SUBPROGRAM). ** -** P1 contains the address of the memory cell that contains the first memory -** cell in an array of values used as arguments to the sub-program. P2 -** contains the address to jump to if the sub-program throws an IGNORE -** exception using the RAISE() function. Register P3 contains the address -** of a memory cell in this (the parent) VM that is used to allocate the +** P1 contains the address of the memory cell that contains the first memory +** cell in an array of values used as arguments to the sub-program. P2 +** contains the address to jump to if the sub-program throws an IGNORE +** exception using the RAISE() function. Register P3 contains the address +** of a memory cell in this (the parent) VM that is used to allocate the ** memory required by the sub-vdbe at runtime. ** ** P4 is a pointer to the VM containing the trigger program. @@ -83988,17 +83988,17 @@ case OP_Program: { /* jump */ pProgram = pOp->p4.pProgram; pRt = &aMem[pOp->p3]; assert( pProgram->nOp>0 ); - - /* If the p5 flag is clear, then recursive invocation of triggers is + + /* If the p5 flag is clear, then recursive invocation of triggers is ** disabled for backwards compatibility (p5 is set if this sub-program ** is really a trigger, not a foreign key action, and the flag set ** and cleared by the "PRAGMA recursive_triggers" command is clear). - ** - ** It is recursive invocation of triggers, at the SQL level, that is - ** disabled. In some cases a single trigger may generate more than one - ** SubProgram (if the trigger may be executed with more than one different + ** + ** It is recursive invocation of triggers, at the SQL level, that is + ** disabled. In some cases a single trigger may generate more than one + ** SubProgram (if the trigger may be executed with more than one different ** ON CONFLICT algorithm). SubProgram structures associated with a - ** single trigger all have the same value for the SubProgram.token + ** single trigger all have the same value for the SubProgram.token ** variable. */ if( pOp->p5 ){ t = pProgram->token; @@ -84014,10 +84014,10 @@ case OP_Program: { /* jump */ /* Register pRt is used to store the memory required to save the state ** of the current program, and the memory required at runtime to execute - ** the trigger program. If this trigger has been fired before, then pRt + ** the trigger program. If this trigger has been fired before, then pRt ** is already allocated. Otherwise, it must be initialized. */ if( (pRt->flags&MEM_Frame)==0 ){ - /* SubProgram.nMem is set to the number of memory cells used by the + /* SubProgram.nMem is set to the number of memory cells used by the ** program stored in SubProgram.aOp. As well as these, one memory ** cell is required for each cursor used by the program. Set local ** variable nMem (and later, VdbeFrame.nChildMem) to this value. @@ -84058,7 +84058,7 @@ case OP_Program: { /* jump */ } }else{ pFrame = pRt->u.pFrame; - assert( pProgram->nMem+pProgram->nCsr==pFrame->nChildMem + assert( pProgram->nMem+pProgram->nCsr==pFrame->nChildMem || (pProgram->nCsr==0 && pProgram->nMem+1==pFrame->nChildMem) ); assert( pProgram->nCsr==pFrame->nChildCsr ); assert( (int)(pOp - aOp)==pFrame->pc ); @@ -84090,10 +84090,10 @@ case OP_Program: { /* jump */ /* Opcode: Param P1 P2 * * * ** -** This opcode is only ever present in sub-programs called via the -** OP_Program instruction. Copy a value currently stored in a memory -** cell of the calling (parent) frame to cell P2 in the current frames -** address space. This is used by trigger programs to access the new.* +** This opcode is only ever present in sub-programs called via the +** OP_Program instruction. Copy a value currently stored in a memory +** cell of the calling (parent) frame to cell P2 in the current frames +** address space. This is used by trigger programs to access the new.* ** and old.* values. ** ** The address of the cell in the parent frame is determined by adding @@ -84105,7 +84105,7 @@ case OP_Param: { /* out2 */ Mem *pIn; pOut = out2Prerelease(p, pOp); pFrame = p->pFrame; - pIn = &pFrame->aMem[pOp->p1 + pFrame->aOp[pFrame->pc].p1]; + pIn = &pFrame->aMem[pOp->p1 + pFrame->aOp[pFrame->pc].p1]; sqlite3VdbeMemShallowCopy(pOut, pIn, MEM_Ephem); break; } @@ -84117,8 +84117,8 @@ case OP_Param: { /* out2 */ ** Synopsis: fkctr[P1]+=P2 ** ** Increment a "constraint counter" by P2 (P2 may be negative or positive). -** If P1 is non-zero, the database constraint counter is incremented -** (deferred foreign key constraints). Otherwise, if P1 is zero, the +** If P1 is non-zero, the database constraint counter is incremented +** (deferred foreign key constraints). Otherwise, if P1 is zero, the ** statement counter is incremented (immediate foreign key constraints). */ case OP_FkCounter: { @@ -84136,7 +84136,7 @@ case OP_FkCounter: { ** Synopsis: if fkctr[P1]==0 goto P2 ** ** This opcode tests if a foreign key constraint-counter is currently zero. -** If so, jump to instruction P2. Otherwise, fall through to the next +** If so, jump to instruction P2. Otherwise, fall through to the next ** instruction. ** ** If P1 is non-zero, then the jump is taken if the database constraint-counter @@ -84162,7 +84162,7 @@ case OP_FkIfZero: { /* jump */ ** ** P1 is a register in the root frame of this VM (the root frame is ** different from the current frame if this instruction is being executed -** within a sub-program). Set the value of register P1 to the maximum of +** within a sub-program). Set the value of register P1 to the maximum of ** its current value and the value in register P2. ** ** This instruction throws an error if the memory cell is not initially @@ -84222,7 +84222,7 @@ case OP_IfPos: { /* jump, in1 */ ** and r[P2] is set to be the value of the LIMIT, r[P1]. ** ** if r[P1] is zero or negative, that means there is no LIMIT -** and r[P2] is set to -1. +** and r[P2] is set to -1. ** ** Otherwise, r[P2] is set to the sum of r[P1] and r[P3]. */ @@ -84254,7 +84254,7 @@ case OP_OffsetLimit: { /* in1, out2, in3 */ ** ** Register P1 must contain an integer. If the content of register P1 is ** initially greater than zero, then decrement the value in register P1. -** If it is non-zero (negative or positive) and then also jump to P2. +** If it is non-zero (negative or positive) and then also jump to P2. ** If register P1 is initially zero, leave it unchanged and fall through. */ case OP_IfNotZero: { /* jump, in1 */ @@ -84447,9 +84447,9 @@ case OP_Checkpoint: { } for(i=0, pMem = &aMem[pOp->p3]; i<3; i++, pMem++){ sqlite3VdbeMemSetInt64(pMem, (i64)aRes[i]); - } + } break; -}; +}; #endif #ifndef SQLITE_OMIT_PRAGMA @@ -84475,9 +84475,9 @@ case OP_JournalMode: { /* out2 */ pOut = out2Prerelease(p, pOp); eNew = pOp->p3; - assert( eNew==PAGER_JOURNALMODE_DELETE - || eNew==PAGER_JOURNALMODE_TRUNCATE - || eNew==PAGER_JOURNALMODE_PERSIST + assert( eNew==PAGER_JOURNALMODE_DELETE + || eNew==PAGER_JOURNALMODE_TRUNCATE + || eNew==PAGER_JOURNALMODE_PERSIST || eNew==PAGER_JOURNALMODE_OFF || eNew==PAGER_JOURNALMODE_MEMORY || eNew==PAGER_JOURNALMODE_WAL @@ -84496,7 +84496,7 @@ case OP_JournalMode: { /* out2 */ zFilename = sqlite3PagerFilename(pPager, 1); /* Do not allow a transition to journal_mode=WAL for a database - ** in temporary storage or if the VFS does not support shared memory + ** in temporary storage or if the VFS does not support shared memory */ if( eNew==PAGER_JOURNALMODE_WAL && (sqlite3Strlen30(zFilename)==0 /* Temp file */ @@ -84516,12 +84516,12 @@ case OP_JournalMode: { /* out2 */ ); goto abort_due_to_error; }else{ - + if( eOld==PAGER_JOURNALMODE_WAL ){ /* If leaving WAL mode, close the log file. If successful, the call - ** to PagerCloseWal() checkpoints and deletes the write-ahead-log - ** file. An EXCLUSIVE lock may still be held on the database file - ** after a successful return. + ** to PagerCloseWal() checkpoints and deletes the write-ahead-log + ** file. An EXCLUSIVE lock may still be held on the database file + ** after a successful return. */ rc = sqlite3PagerCloseWal(pPager, db); if( rc==SQLITE_OK ){ @@ -84532,7 +84532,7 @@ case OP_JournalMode: { /* out2 */ ** as an intermediate */ sqlite3PagerSetJournalMode(pPager, PAGER_JOURNALMODE_OFF); } - + /* Open a transaction on the database file. Regardless of the journal ** mode, this transaction always uses a rollback journal. */ @@ -84602,7 +84602,7 @@ case OP_IncrVacuum: { /* jump */ ** is executed using sqlite3_step() it will either automatically ** reprepare itself (if it was originally created using sqlite3_prepare_v2()) ** or it will fail with SQLITE_SCHEMA. -** +** ** If P1 is 0, then all SQL statements become expired. If P1 is non-zero, ** then only the currently executing statement is expired. */ @@ -84620,7 +84620,7 @@ case OP_Expire: { ** Synopsis: iDb=P1 root=P2 write=P3 ** ** Obtain a lock on a particular table. This instruction is only used when -** the shared-cache feature is enabled. +** the shared-cache feature is enabled. ** ** P1 is the index of the database in sqlite3.aDb[] of the database ** on which the lock is acquired. A readlock is obtained if P3==0 or @@ -84634,7 +84634,7 @@ case OP_Expire: { case OP_TableLock: { u8 isWriteLock = (u8)pOp->p3; if( isWriteLock || 0==(db->flags&SQLITE_ReadUncommitted) ){ - int p1 = pOp->p1; + int p1 = pOp->p1; assert( p1>=0 && p1nDb ); assert( DbMaskTest(p->btreeMask, p1) ); assert( isWriteLock==0 || isWriteLock==1 ); @@ -84654,7 +84654,7 @@ case OP_TableLock: { #ifndef SQLITE_OMIT_VIRTUALTABLE /* Opcode: VBegin * * * P4 * ** -** P4 may be a pointer to an sqlite3_vtab structure. If so, call the +** P4 may be a pointer to an sqlite3_vtab structure. If so, call the ** xBegin method for that table. ** ** Also, whether or not P4 is set, check that this is not being called from @@ -84674,7 +84674,7 @@ case OP_VBegin: { #ifndef SQLITE_OMIT_VIRTUALTABLE /* Opcode: VCreate P1 P2 * * * ** -** P2 is a register that holds the name of a virtual table in database +** P2 is a register that holds the name of a virtual table in database ** P1. Call the xCreate method for that table. */ case OP_VCreate: { @@ -84828,7 +84828,7 @@ case OP_VFilter: { /* jump */ ** Synopsis: r[P3]=vcolumn(P2) ** ** Store the value of the P2-th column of -** the row of the virtual-table that the +** the row of the virtual-table that the ** P1 cursor is pointing to into register P3. */ case OP_VColumn: { @@ -84894,7 +84894,7 @@ case OP_VNext: { /* jump */ /* Invoke the xNext() method of the module. There is no way for the ** underlying implementation to return an error if one occurs during - ** xNext(). Instead, if an error occurs, true is returned (indicating that + ** xNext(). Instead, if an error occurs, true is returned (indicating that ** data is available) and the error code returned when xColumn or ** some other method is next invoked on the save virtual table cursor. */ @@ -84948,23 +84948,23 @@ case OP_VRename: { ** ** P4 is a pointer to a virtual table object, an sqlite3_vtab structure. ** This opcode invokes the corresponding xUpdate method. P2 values -** are contiguous memory cells starting at P3 to pass to the xUpdate -** invocation. The value in register (P3+P2-1) corresponds to the +** are contiguous memory cells starting at P3 to pass to the xUpdate +** invocation. The value in register (P3+P2-1) corresponds to the ** p2th element of the argv array passed to xUpdate. ** ** The xUpdate method will do a DELETE or an INSERT or both. ** The argv[0] element (which corresponds to memory cell P3) -** is the rowid of a row to delete. If argv[0] is NULL then no -** deletion occurs. The argv[1] element is the rowid of the new -** row. This can be NULL to have the virtual table select the new -** rowid for itself. The subsequent elements in the array are +** is the rowid of a row to delete. If argv[0] is NULL then no +** deletion occurs. The argv[1] element is the rowid of the new +** row. This can be NULL to have the virtual table select the new +** rowid for itself. The subsequent elements in the array are ** the values of columns in the new row. ** ** If P2==1 then no insert is performed. argv[0] is the rowid of ** a row to delete. ** ** P1 is a boolean flag. If it is set to true and the xUpdate call -** is successful, then the value returned by sqlite3_last_insert_rowid() +** is successful, then the value returned by sqlite3_last_insert_rowid() ** is set to the value of the rowid for the row just inserted. ** ** P5 is the error actions (OE_Replace, OE_Fail, OE_Ignore, etc) to @@ -84979,7 +84979,7 @@ case OP_VUpdate: { Mem **apArg; Mem *pX; - assert( pOp->p2==1 || pOp->p5==OE_Fail || pOp->p5==OE_Rollback + assert( pOp->p2==1 || pOp->p5==OE_Fail || pOp->p5==OE_Rollback || pOp->p5==OE_Abort || pOp->p5==OE_Ignore || pOp->p5==OE_Replace ); assert( p->readOnly==0 ); @@ -85230,7 +85230,7 @@ abort_due_to_error: p->rc = rc; sqlite3SystemError(db, rc); testcase( sqlite3GlobalConfig.xLog!=0 ); - sqlite3_log(rc, "statement aborts at %d: [%s] %s", + sqlite3_log(rc, "statement aborts at %d: [%s] %s", (int)(pOp - aOp), p->zSql, p->zErrMsg); sqlite3VdbeHalt(p); if( rc==SQLITE_IOERR_NOMEM ) sqlite3OomFault(db); @@ -85246,8 +85246,8 @@ vdbe_return: testcase( nVmStep>0 ); p->aCounter[SQLITE_STMTSTATUS_VM_STEP] += (int)nVmStep; sqlite3VdbeLeave(p); - assert( rc!=SQLITE_OK || nExtraDelete==0 - || sqlite3_strlike("DELETE%",p->zSql,0)!=0 + assert( rc!=SQLITE_OK || nExtraDelete==0 + || sqlite3_strlike("DELETE%",p->zSql,0)!=0 ); return rc; @@ -85331,7 +85331,7 @@ struct Incrblob { ** sqlite3DbFree(). ** ** If an error does occur, then the b-tree cursor is closed. All subsequent -** calls to sqlite3_blob_read(), blob_write() or blob_reopen() will +** calls to sqlite3_blob_read(), blob_write() or blob_reopen() will ** immediately return SQLITE_ABORT. */ static int blobSeekToRow(Incrblob *p, sqlite3_int64 iRow, char **pzErr){ @@ -85339,7 +85339,7 @@ static int blobSeekToRow(Incrblob *p, sqlite3_int64 iRow, char **pzErr){ char *zErr = 0; /* Error message */ Vdbe *v = (Vdbe *)p->pStmt; - /* Set the value of register r[1] in the SQL statement to integer iRow. + /* Set the value of register r[1] in the SQL statement to integer iRow. ** This is done directly as a performance optimization */ v->aMem[1].flags = MEM_Int; @@ -85485,7 +85485,7 @@ SQLITE_API int sqlite3_blob_open( } /* If the value is being opened for writing, check that the - ** column is not indexed, and that it is not part of a foreign key. + ** column is not indexed, and that it is not part of a foreign key. */ if( wrFlag ){ const char *zFault = 0; @@ -85494,7 +85494,7 @@ SQLITE_API int sqlite3_blob_open( if( db->flags&SQLITE_ForeignKeys ){ /* Check that the column is not part of an FK child key definition. It ** is not necessary to check if it is part of a parent key, as parent - ** key columns must be indexed. The check below will pick up this + ** key columns must be indexed. The check below will pick up this ** case. */ FKey *pFKey; for(pFKey=pTab->pFKey; pFKey; pFKey=pFKey->pNextFrom){ @@ -85528,8 +85528,8 @@ SQLITE_API int sqlite3_blob_open( pBlob->pStmt = (sqlite3_stmt *)sqlite3VdbeCreate(pParse); assert( pBlob->pStmt || db->mallocFailed ); if( pBlob->pStmt ){ - - /* This VDBE program seeks a btree cursor to the identified + + /* This VDBE program seeks a btree cursor to the identified ** db/table/row entry. The reason for using a vdbe program instead ** of writing code to use the b-tree layer directly is that the ** vdbe program will take advantage of the various transaction, @@ -85537,11 +85537,11 @@ SQLITE_API int sqlite3_blob_open( ** ** After seeking the cursor, the vdbe executes an OP_ResultRow. ** Code external to the Vdbe then "borrows" the b-tree cursor and - ** uses it to implement the blob_read(), blob_write() and + ** uses it to implement the blob_read(), blob_write() and ** blob_bytes() functions. ** ** The sqlite3_blob_close() function finalizes the vdbe program, - ** which closes the b-tree cursor and (possibly) commits the + ** which closes the b-tree cursor and (possibly) commits the ** transaction. */ static const int iLn = VDBE_OFFSET_LINENO(2); @@ -85558,14 +85558,14 @@ SQLITE_API int sqlite3_blob_open( int iDb = sqlite3SchemaToIndex(db, pTab->pSchema); VdbeOp *aOp; - sqlite3VdbeAddOp4Int(v, OP_Transaction, iDb, wrFlag, + sqlite3VdbeAddOp4Int(v, OP_Transaction, iDb, wrFlag, pTab->pSchema->schema_cookie, pTab->pSchema->iGeneration); - sqlite3VdbeChangeP5(v, 1); + sqlite3VdbeChangeP5(v, 1); aOp = sqlite3VdbeAddOpList(v, ArraySize(openBlob), openBlob, iLn); /* Make sure a mutex is held on the table to be accessed */ - sqlite3VdbeUsesBtree(v, iDb); + sqlite3VdbeUsesBtree(v, iDb); if( db->mallocFailed==0 ){ assert( aOp!=0 ); @@ -85581,17 +85581,17 @@ SQLITE_API int sqlite3_blob_open( if( db->mallocFailed==0 ){ #endif - /* Remove either the OP_OpenWrite or OpenRead. Set the P2 + /* Remove either the OP_OpenWrite or OpenRead. Set the P2 ** parameter of the other to pTab->tnum. */ if( wrFlag ) aOp[1].opcode = OP_OpenWrite; aOp[1].p2 = pTab->tnum; - aOp[1].p3 = iDb; + aOp[1].p3 = iDb; /* Configure the number of columns. Configure the cursor to ** think that the table has one more column than it really ** does. An OP_Column to retrieve this imaginary column will ** always return an SQL NULL. This is useful because it means - ** we can invoke OP_Column to fill in the vdbe cursors type + ** we can invoke OP_Column to fill in the vdbe cursors type ** and offset cache without causing any IO. */ aOp[1].p4type = P4_INT32; @@ -85604,7 +85604,7 @@ SQLITE_API int sqlite3_blob_open( sqlite3VdbeMakeReady(v, pParse); } } - + pBlob->iCol = iCol; pBlob->db = db; sqlite3BtreeLeaveAll(db); @@ -85655,10 +85655,10 @@ SQLITE_API int sqlite3_blob_close(sqlite3_blob *pBlob){ ** Perform a read or write operation on a blob */ static int blobReadWrite( - sqlite3_blob *pBlob, - void *z, - int n, - int iOffset, + sqlite3_blob *pBlob, + void *z, + int n, + int iOffset, int (*xCall)(BtCursor*, u32, u32, void*) ){ int rc; @@ -85688,14 +85688,14 @@ static int blobReadWrite( #ifdef SQLITE_ENABLE_PREUPDATE_HOOK if( xCall==sqlite3BtreePutData && db->xPreUpdateCallback ){ - /* If a pre-update hook is registered and this is a write cursor, - ** invoke it here. - ** + /* If a pre-update hook is registered and this is a write cursor, + ** invoke it here. + ** ** TODO: The preupdate-hook is passed SQLITE_DELETE, even though this ** operation should really be an SQLITE_UPDATE. This is probably - ** incorrect, but is convenient because at this point the new.* values - ** are not easily obtainable. And for the sessions module, an - ** SQLITE_UPDATE where the PK columns do not change is handled in the + ** incorrect, but is convenient because at this point the new.* values + ** are not easily obtainable. And for the sessions module, an + ** SQLITE_UPDATE where the PK columns do not change is handled in the ** same way as an SQLITE_DELETE (the SQLITE_DELETE code is actually ** slightly more efficient). Since you cannot write to a PK column ** using the incremental-blob API, this works. For the sessions module @@ -85755,8 +85755,8 @@ SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *pBlob){ ** ** If an error occurs, or if the specified row does not exist or does not ** contain a blob or text value, then an error code is returned and the -** database handle error code and message set. If this happens, then all -** subsequent calls to sqlite3_blob_xxx() functions (except blob_close()) +** database handle error code and message set. If this happens, then all +** subsequent calls to sqlite3_blob_xxx() functions (except blob_close()) ** immediately return SQLITE_ABORT. */ SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){ @@ -85850,7 +85850,7 @@ SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){ ** is like Close() followed by Init() only ** much faster. ** -** The interfaces above must be called in a particular order. Write() can +** The interfaces above must be called in a particular order. Write() can ** only occur in between Init()/Reset() and Rewind(). Next(), Rowkey(), and ** Compare() can only occur in between Rewind() and Close()/Reset(). i.e. ** @@ -85858,16 +85858,16 @@ SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){ ** for each record: Write() ** Rewind() ** Rowkey()/Compare() -** Next() +** Next() ** Close() ** ** Algorithm: ** -** Records passed to the sorter via calls to Write() are initially held +** Records passed to the sorter via calls to Write() are initially held ** unsorted in main memory. Assuming the amount of memory used never exceeds ** a threshold, when Rewind() is called the set of records is sorted using ** an in-memory merge sort. In this case, no temporary files are required -** and subsequent calls to Rowkey(), Next() and Compare() read records +** and subsequent calls to Rowkey(), Next() and Compare() read records ** directly from main memory. ** ** If the amount of space used to store records in main memory exceeds the @@ -85877,10 +85877,10 @@ SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){ ** of PMAs may be created by merging existing PMAs together - for example ** merging two or more level-0 PMAs together creates a level-1 PMA. ** -** The threshold for the amount of main memory to use before flushing +** The threshold for the amount of main memory to use before flushing ** records to a PMA is roughly the same as the limit configured for the -** page-cache of the main database. Specifically, the threshold is set to -** the value returned by "PRAGMA main.page_size" multipled by +** page-cache of the main database. Specifically, the threshold is set to +** the value returned by "PRAGMA main.page_size" multipled by ** that returned by "PRAGMA main.cache_size", in bytes. ** ** If the sorter is running in single-threaded mode, then all PMAs generated @@ -85897,7 +85897,7 @@ SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){ ** than zero, and (b) worker threads have been enabled at runtime by calling ** "PRAGMA threads=N" with some value of N greater than 0. ** -** When Rewind() is called, any data remaining in memory is flushed to a +** When Rewind() is called, any data remaining in memory is flushed to a ** final PMA. So at this point the data is stored in some number of sorted ** PMAs within temporary files on disk. ** @@ -85909,16 +85909,16 @@ SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){ ** ** Or, if running in multi-threaded mode, then a background thread is ** launched to merge the existing PMAs. Once the background thread has -** merged T bytes of data into a single sorted PMA, the main thread +** merged T bytes of data into a single sorted PMA, the main thread ** begins reading keys from that PMA while the background thread proceeds ** with merging the next T bytes of data. And so on. ** -** Parameter T is set to half the value of the memory threshold used +** Parameter T is set to half the value of the memory threshold used ** by Write() above to determine when to create a new PMA. ** -** If there are more than SORTER_MAX_MERGE_COUNT PMAs in total when -** Rewind() is called, then a hierarchy of incremental-merges is used. -** First, T bytes of data from the first SORTER_MAX_MERGE_COUNT PMAs on +** If there are more than SORTER_MAX_MERGE_COUNT PMAs in total when +** Rewind() is called, then a hierarchy of incremental-merges is used. +** First, T bytes of data from the first SORTER_MAX_MERGE_COUNT PMAs on ** disk are merged together. Then T bytes of data from the second set, and ** so on, such that no operation ever merges more than SORTER_MAX_MERGE_COUNT ** PMAs at a time. This done is to improve locality. @@ -85933,7 +85933,7 @@ SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){ /* #include "sqliteInt.h" */ /* #include "vdbeInt.h" */ -/* +/* ** If SQLITE_DEBUG_SORTER_THREADS is defined, this module outputs various ** messages to stderr that may be helpful in understanding the performance ** characteristics of the sorter in multi-threaded mode. @@ -85962,7 +85962,7 @@ typedef struct SorterList SorterList; /* In-memory list of records */ typedef struct IncrMerger IncrMerger; /* Read & merge multiple PMAs */ /* -** A container for a temp file handle and the current amount of data +** A container for a temp file handle and the current amount of data ** stored in the file. */ struct SorterFile { @@ -86002,17 +86002,17 @@ struct SorterList { ** the MergeEngine.nTree variable. ** ** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of +** pairs of PMA keys together. Element i contains the result of ** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. +** aTree element is set to the index of it. ** ** For the purposes of this comparison, EOF is considered greater than any ** other key value. If the keys are equal (only possible with two EOF ** values), it doesn't matter which index is stored. ** -** The (N/4) elements of aTree[] that precede the final (N/2) described +** The (N/4) elements of aTree[] that precede the final (N/2) described ** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that +** And so on. So that aTree[1] contains the index of the PmaReader that ** currently points to the smallest key value. aTree[0] is unused. ** ** Example: @@ -86028,7 +86028,7 @@ struct SorterList { ** ** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } ** -** The current element is "Apple" (the value of the key indicated by +** The current element is "Apple" (the value of the key indicated by ** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will ** be advanced to the next key in its segment. Say the next key is ** "Eggplant": @@ -86069,8 +86069,8 @@ struct MergeEngine { ** each thread requries its own UnpackedRecord object to unpack records in ** as part of comparison operations. ** -** Before a background thread is launched, variable bDone is set to 0. Then, -** right before it exits, the thread itself sets bDone to 1. This is used for +** Before a background thread is launched, variable bDone is set to 0. Then, +** right before it exits, the thread itself sets bDone to 1. This is used for ** two purposes: ** ** 1. When flushing the contents of memory to a level-0 PMA on disk, to @@ -86101,7 +86101,7 @@ struct SortSubtask { /* -** Main sorter structure. A single instance of this is allocated for each +** Main sorter structure. A single instance of this is allocated for each ** sorter cursor created by the VDBE. ** ** mxKeysize: @@ -86157,21 +86157,21 @@ struct PmaReader { }; /* -** Normally, a PmaReader object iterates through an existing PMA stored +** Normally, a PmaReader object iterates through an existing PMA stored ** within a temp file. However, if the PmaReader.pIncr variable points to ** an object of the following type, it may be used to iterate/merge through ** multiple PMAs simultaneously. ** -** There are two types of IncrMerger object - single (bUseThread==0) and -** multi-threaded (bUseThread==1). +** There are two types of IncrMerger object - single (bUseThread==0) and +** multi-threaded (bUseThread==1). ** -** A multi-threaded IncrMerger object uses two temporary files - aFile[0] -** and aFile[1]. Neither file is allowed to grow to more than mxSz bytes in -** size. When the IncrMerger is initialized, it reads enough data from -** pMerger to populate aFile[0]. It then sets variables within the -** corresponding PmaReader object to read from that file and kicks off -** a background thread to populate aFile[1] with the next mxSz bytes of -** sorted record data from pMerger. +** A multi-threaded IncrMerger object uses two temporary files - aFile[0] +** and aFile[1]. Neither file is allowed to grow to more than mxSz bytes in +** size. When the IncrMerger is initialized, it reads enough data from +** pMerger to populate aFile[0]. It then sets variables within the +** corresponding PmaReader object to read from that file and kicks off +** a background thread to populate aFile[1] with the next mxSz bytes of +** sorted record data from pMerger. ** ** When the PmaReader reaches the end of aFile[0], it blocks until the ** background thread has finished populating aFile[1]. It then exchanges @@ -86182,7 +86182,7 @@ struct PmaReader { ** ** A single-threaded IncrMerger does not open any temporary files of its ** own. Instead, it has exclusive access to mxSz bytes of space beginning -** at offset iStartOff of file pTask->file2. And instead of using a +** at offset iStartOff of file pTask->file2. And instead of using a ** background thread to prepare data for the PmaReader, with a single ** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with ** keys from pMerger by the calling thread whenever the PmaReader runs out @@ -86294,7 +86294,7 @@ static int vdbePmaReadBlob( assert( p->aBuffer ); - /* If there is no more data to be read from the buffer, read the next + /* If there is no more data to be read from the buffer, read the next ** p->nBuffer bytes of data from the file into it. Or, if there are less ** than p->nBuffer bytes remaining in the PMA, read all remaining data. */ iBuf = p->iReadOff % p->nBuffer; @@ -86315,11 +86315,11 @@ static int vdbePmaReadBlob( assert( rc!=SQLITE_IOERR_SHORT_READ ); if( rc!=SQLITE_OK ) return rc; } - nAvail = p->nBuffer - iBuf; + nAvail = p->nBuffer - iBuf; if( nByte<=nAvail ){ /* The requested data is available in the in-memory buffer. In this - ** case there is no need to make a copy of the data, just return a + ** case there is no need to make a copy of the data, just return a ** pointer into the buffer to the caller. */ *ppOut = &p->aBuffer[iBuf]; p->iReadOff += nByte; @@ -86398,7 +86398,7 @@ static int vdbePmaReadVarint(PmaReader *p, u64 *pnOut){ /* ** Attempt to memory map file pFile. If successful, set *pp to point to the -** new mapping and return SQLITE_OK. If the mapping is not attempted +** new mapping and return SQLITE_OK. If the mapping is not attempted ** (because the file is too large or the VFS layer is configured not to use ** mmap), return SQLITE_OK and set *pp to NULL. ** @@ -86419,7 +86419,7 @@ static int vdbeSorterMapFile(SortSubtask *pTask, SorterFile *pFile, u8 **pp){ /* ** Attach PmaReader pReadr to file pFile (if it is not already attached to -** that file) and seek it to offset iOff within the file. Return SQLITE_OK +** that file) and seek it to offset iOff within the file. Return SQLITE_OK ** if successful, or an SQLite error code if an error occurs. */ static int vdbePmaReaderSeek( @@ -86509,11 +86509,11 @@ static int vdbePmaReaderNext(PmaReader *pReadr){ /* ** Initialize PmaReader pReadr to scan through the PMA stored in file pFile -** starting at offset iStart and ending at offset iEof-1. This function -** leaves the PmaReader pointing to the first key in the PMA (or EOF if the +** starting at offset iStart and ending at offset iEof-1. This function +** leaves the PmaReader pointing to the first key in the PMA (or EOF if the ** PMA is empty). ** -** If the pnByte parameter is NULL, then it is assumed that the file +** If the pnByte parameter is NULL, then it is assumed that the file ** contains a single PMA, and that that PMA omits the initial length varint. */ static int vdbePmaReaderInit( @@ -86546,7 +86546,7 @@ static int vdbePmaReaderInit( /* ** A version of vdbeSorterCompare() that assumes that it has already been -** determined that the first field of key1 is equal to the first field of +** determined that the first field of key1 is equal to the first field of ** key2. */ static int vdbeSorterCompareTail( @@ -86564,7 +86564,7 @@ static int vdbeSorterCompareTail( } /* -** Compare key1 (buffer pKey1, size nKey1 bytes) with key2 (buffer pKey2, +** Compare key1 (buffer pKey1, size nKey1 bytes) with key2 (buffer pKey2, ** size nKey2 bytes). Use (pTask->pKeyInfo) for the collation sequences ** used by the comparison. Return the result of the comparison. ** @@ -86709,7 +86709,7 @@ static int vdbeSorterCompareInt( ** is non-zero and the sorter is able to guarantee a stable sort, nField ** is used instead. This is used when sorting records for a CREATE INDEX ** statement. In this case, keys are always delivered to the sorter in -** order of the primary key, which happens to be make up the final part +** order of the primary key, which happens to be make up the final part ** of the records being sorted. So if the sort is stable, there is never ** any reason to compare PK fields and they can be ignored for a small ** performance boost. @@ -86809,7 +86809,7 @@ SQLITE_PRIVATE int sqlite3VdbeSorterInit( } } - if( (pKeyInfo->nField+pKeyInfo->nXField)<13 + if( (pKeyInfo->nField+pKeyInfo->nXField)<13 && (pKeyInfo->aColl[0]==0 || pKeyInfo->aColl[0]==db->pDfltColl) ){ pSorter->typeMask = SORTER_TYPE_INTEGER | SORTER_TYPE_TEXT; @@ -86833,7 +86833,7 @@ static void vdbeSorterRecordFree(sqlite3 *db, SorterRecord *pRecord){ } /* -** Free all resources owned by the object indicated by argument pTask. All +** Free all resources owned by the object indicated by argument pTask. All ** fields of *pTask are zeroed before returning. */ static void vdbeSortSubtaskCleanup(sqlite3 *db, SortSubtask *pTask){ @@ -86932,7 +86932,7 @@ static int vdbeSorterCreateThread( } /* -** Join all outstanding threads launched by SorterWrite() to create +** Join all outstanding threads launched by SorterWrite() to create ** level-0 PMAs. */ static int vdbeSorterJoinAll(VdbeSorter *pSorter, int rcin){ @@ -86941,10 +86941,10 @@ static int vdbeSorterJoinAll(VdbeSorter *pSorter, int rcin){ /* This function is always called by the main user thread. ** - ** If this function is being called after SorterRewind() has been called, + ** If this function is being called after SorterRewind() has been called, ** it is possible that thread pSorter->aTask[pSorter->nTask-1].pThread ** is currently attempt to join one of the other threads. To avoid a race - ** condition where this thread also attempts to join the same object, join + ** condition where this thread also attempts to join the same object, join ** thread pSorter->aTask[pSorter->nTask-1].pThread first. */ for(i=pSorter->nTask-1; i>=0; i--){ SortSubtask *pTask = &pSorter->aTask[i]; @@ -87116,8 +87116,8 @@ static int vdbeSorterOpenTempFile( } /* -** If it has not already been allocated, allocate the UnpackedRecord -** structure at pTask->pUnpacked. Return SQLITE_OK if successful (or +** If it has not already been allocated, allocate the UnpackedRecord +** structure at pTask->pUnpacked. Return SQLITE_OK if successful (or ** if no allocation was required), or SQLITE_NOMEM otherwise. */ static int vdbeSortAllocUnpacked(SortSubtask *pTask){ @@ -87180,14 +87180,14 @@ static SorterCompare vdbeSorterGetCompare(VdbeSorter *p){ if( p->typeMask==SORTER_TYPE_INTEGER ){ return vdbeSorterCompareInt; }else if( p->typeMask==SORTER_TYPE_TEXT ){ - return vdbeSorterCompareText; + return vdbeSorterCompareText; } return vdbeSorterCompare; } /* -** Sort the linked list of records headed at pTask->pList. Return -** SQLITE_OK if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if +** Sort the linked list of records headed at pTask->pList. Return +** SQLITE_OK if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if ** an error occurs. */ static int vdbeSorterSort(SortSubtask *pTask, SorterList *pList){ @@ -87237,8 +87237,8 @@ static int vdbeSorterSort(SortSubtask *pTask, SorterList *pList){ pList->pList = p; sqlite3_free(aSlot); - assert( pTask->pUnpacked->errCode==SQLITE_OK - || pTask->pUnpacked->errCode==SQLITE_NOMEM + assert( pTask->pUnpacked->errCode==SQLITE_OK + || pTask->pUnpacked->errCode==SQLITE_NOMEM ); return pTask->pUnpacked->errCode; } @@ -87279,8 +87279,8 @@ static void vdbePmaWriteBlob(PmaWriter *p, u8 *pData, int nData){ memcpy(&p->aBuffer[p->iBufEnd], &pData[nData-nRem], nCopy); p->iBufEnd += nCopy; if( p->iBufEnd==p->nBuffer ){ - p->eFWErr = sqlite3OsWrite(p->pFd, - &p->aBuffer[p->iBufStart], p->iBufEnd - p->iBufStart, + p->eFWErr = sqlite3OsWrite(p->pFd, + &p->aBuffer[p->iBufStart], p->iBufEnd - p->iBufStart, p->iWriteOff + p->iBufStart ); p->iBufStart = p->iBufEnd = 0; @@ -87295,7 +87295,7 @@ static void vdbePmaWriteBlob(PmaWriter *p, u8 *pData, int nData){ /* ** Flush any buffered data to disk and clean up the PMA-writer object. ** The results of using the PMA-writer after this call are undefined. -** Return SQLITE_OK if flushing the buffered data succeeds or is not +** Return SQLITE_OK if flushing the buffered data succeeds or is not ** required. Otherwise, return an SQLite error code. ** ** Before returning, set *piEof to the offset immediately following the @@ -87304,8 +87304,8 @@ static void vdbePmaWriteBlob(PmaWriter *p, u8 *pData, int nData){ static int vdbePmaWriterFinish(PmaWriter *p, i64 *piEof){ int rc; if( p->eFWErr==0 && ALWAYS(p->aBuffer) && p->iBufEnd>p->iBufStart ){ - p->eFWErr = sqlite3OsWrite(p->pFd, - &p->aBuffer[p->iBufStart], p->iBufEnd - p->iBufStart, + p->eFWErr = sqlite3OsWrite(p->pFd, + &p->aBuffer[p->iBufStart], p->iBufEnd - p->iBufStart, p->iWriteOff + p->iBufStart ); } @@ -87317,11 +87317,11 @@ static int vdbePmaWriterFinish(PmaWriter *p, i64 *piEof){ } /* -** Write value iVal encoded as a varint to the PMA. Return +** Write value iVal encoded as a varint to the PMA. Return ** SQLITE_OK if successful, or an SQLite error code if an error occurs. */ static void vdbePmaWriteVarint(PmaWriter *p, u64 iVal){ - int nByte; + int nByte; u8 aByte[10]; nByte = sqlite3PutVarint(aByte, iVal); vdbePmaWriteBlob(p, aByte, nByte); @@ -87329,7 +87329,7 @@ static void vdbePmaWriteVarint(PmaWriter *p, u64 iVal){ /* ** Write the current contents of in-memory linked-list pList to a level-0 -** PMA in the temp file belonging to sub-task pTask. Return SQLITE_OK if +** PMA in the temp file belonging to sub-task pTask. Return SQLITE_OK if ** successful, or an SQLite error code otherwise. ** ** The format of a PMA is: @@ -87337,8 +87337,8 @@ static void vdbePmaWriteVarint(PmaWriter *p, u64 iVal){ ** * A varint. This varint contains the total number of bytes of content ** in the PMA (not including the varint itself). ** -** * One or more records packed end-to-end in order of ascending keys. -** Each record consists of a varint followed by a blob of data (the +** * One or more records packed end-to-end in order of ascending keys. +** Each record consists of a varint followed by a blob of data (the ** key). The varint is the number of bytes in the blob of data. */ static int vdbeSorterListToPMA(SortSubtask *pTask, SorterList *pList){ @@ -87347,7 +87347,7 @@ static int vdbeSorterListToPMA(SortSubtask *pTask, SorterList *pList){ PmaWriter writer; /* Object used to write to the file */ #ifdef SQLITE_DEBUG - /* Set iSz to the expected size of file pTask->file after writing the PMA. + /* Set iSz to the expected size of file pTask->file after writing the PMA. ** This is used by an assert() statement at the end of this function. */ i64 iSz = pList->szPMA + sqlite3VarintLen(pList->szPMA) + pTask->file.iEof; #endif @@ -87500,7 +87500,7 @@ static int vdbeSorterFlushPMA(VdbeSorter *pSorter){ SortSubtask *pTask = 0; /* Thread context used to create new PMA */ int nWorker = (pSorter->nTask-1); - /* Set the flag to indicate that at least one PMA has been written. + /* Set the flag to indicate that at least one PMA has been written. ** Or will be, anyhow. */ pSorter->bUsePMA = 1; @@ -87510,7 +87510,7 @@ static int vdbeSorterFlushPMA(VdbeSorter *pSorter){ ** the background thread from a sub-tasks previous turn is still running, ** skip it. If the first (pSorter->nTask-1) sub-tasks are all still busy, ** fall back to using the final sub-task. The first (pSorter->nTask-1) - ** sub-tasks are prefered as they use background threads - the final + ** sub-tasks are prefered as they use background threads - the final ** sub-task uses the main thread. */ for(i=0; iiPrev + i + 1) % nWorker; @@ -87588,14 +87588,14 @@ SQLITE_PRIVATE int sqlite3VdbeSorterWrite( ** If using the single large allocation mode (pSorter->aMemory!=0), then ** flush the contents of memory to a new PMA if (a) at least one value is ** already in memory and (b) the new value will not fit in memory. - ** + ** ** Or, if using separate allocations for each record, flush the contents ** of memory to a PMA if either of the following are true: ** - ** * The total memory allocated for the in-memory list is greater + ** * The total memory allocated for the in-memory list is greater ** than (page-size * cache-size), or ** - ** * The total memory allocated for the in-memory list is greater + ** * The total memory allocated for the in-memory list is greater ** than (page-size * 10) and sqlite3HeapNearlyFull() returns true. */ nReq = pVal->n + sizeof(SorterRecord); @@ -87730,11 +87730,11 @@ static int vdbeIncrBgPopulate(IncrMerger *pIncr){ ** aFile[0] such that the PmaReader should start rereading it from the ** beginning. ** -** For single-threaded objects, this is accomplished by literally reading -** keys from pIncr->pMerger and repopulating aFile[0]. +** For single-threaded objects, this is accomplished by literally reading +** keys from pIncr->pMerger and repopulating aFile[0]. ** -** For multi-threaded objects, all that is required is to wait until the -** background thread is finished (if it is not already) and then swap +** For multi-threaded objects, all that is required is to wait until the +** background thread is finished (if it is not already) and then swap ** aFile[0] and aFile[1] in place. If the contents of pMerger have not ** been exhausted, this function also launches a new background thread ** to populate the new aFile[1]. @@ -87874,7 +87874,7 @@ static void vdbeMergeEngineCompare( #define INCRINIT_TASK 1 #define INCRINIT_ROOT 2 -/* +/* ** Forward reference required as the vdbeIncrMergeInit() and ** vdbePmaReaderIncrInit() routines are called mutually recursively when ** building a merge tree. @@ -87883,7 +87883,7 @@ static int vdbePmaReaderIncrInit(PmaReader *pReadr, int eMode); /* ** Initialize the MergeEngine object passed as the second argument. Once this -** function returns, the first key of merged data may be read from the +** function returns, the first key of merged data may be read from the ** MergeEngine object in the usual fashion. ** ** If argument eMode is INCRINIT_ROOT, then it is assumed that any IncrMerge @@ -87893,8 +87893,8 @@ static int vdbePmaReaderIncrInit(PmaReader *pReadr, int eMode); ** required is to call vdbePmaReaderNext() on each PmaReader to point it at ** its first key. ** -** Otherwise, if eMode is any value other than INCRINIT_ROOT, then use -** vdbePmaReaderIncrMergeInit() to initialize each PmaReader that feeds data +** Otherwise, if eMode is any value other than INCRINIT_ROOT, then use +** vdbePmaReaderIncrMergeInit() to initialize each PmaReader that feeds data ** to pMerger. ** ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. @@ -87944,19 +87944,19 @@ static int vdbeMergeEngineInit( ** object at (pReadr->pIncr). ** ** If argument eMode is set to INCRINIT_NORMAL, then all PmaReaders -** in the sub-tree headed by pReadr are also initialized. Data is then -** loaded into the buffers belonging to pReadr and it is set to point to +** in the sub-tree headed by pReadr are also initialized. Data is then +** loaded into the buffers belonging to pReadr and it is set to point to ** the first key in its range. ** ** If argument eMode is set to INCRINIT_TASK, then pReadr is guaranteed ** to be a multi-threaded PmaReader and this function is being called in a -** background thread. In this case all PmaReaders in the sub-tree are +** background thread. In this case all PmaReaders in the sub-tree are ** initialized as for INCRINIT_NORMAL and the aFile[1] buffer belonging to ** pReadr is populated. However, pReadr itself is not set up to point ** to its first key. A call to vdbePmaReaderNext() is still required to do -** that. +** that. ** -** The reason this function does not call vdbePmaReaderNext() immediately +** The reason this function does not call vdbePmaReaderNext() immediately ** in the INCRINIT_TASK case is that vdbePmaReaderNext() assumes that it has ** to block on thread (pTask->thread) before accessing aFile[1]. But, since ** this entire function is being run by thread (pTask->thread), that will @@ -88012,12 +88012,12 @@ static int vdbePmaReaderIncrMergeInit(PmaReader *pReadr, int eMode){ if( rc==SQLITE_OK && pIncr->bUseThread ){ /* Use the current thread to populate aFile[1], even though this ** PmaReader is multi-threaded. If this is an INCRINIT_TASK object, - ** then this function is already running in background thread - ** pIncr->pTask->thread. + ** then this function is already running in background thread + ** pIncr->pTask->thread. ** - ** If this is the INCRINIT_ROOT object, then it is running in the + ** If this is the INCRINIT_ROOT object, then it is running in the ** main VDBE thread. But that is Ok, as that thread cannot return - ** control to the VDBE or proceed with anything useful until the + ** control to the VDBE or proceed with anything useful until the ** first results are ready from this merger object anyway. */ assert( eMode==INCRINIT_ROOT || eMode==INCRINIT_TASK ); @@ -88034,7 +88034,7 @@ static int vdbePmaReaderIncrMergeInit(PmaReader *pReadr, int eMode){ #if SQLITE_MAX_WORKER_THREADS>0 /* -** The main routine for vdbePmaReaderIncrMergeInit() operations run in +** The main routine for vdbePmaReaderIncrMergeInit() operations run in ** background threads. */ static void *vdbePmaReaderBgIncrInit(void *pCtx){ @@ -88052,8 +88052,8 @@ static void *vdbePmaReaderBgIncrInit(void *pCtx){ ** (if pReadr->pIncr==0), then this function is a no-op. Otherwise, it invokes ** the vdbePmaReaderIncrMergeInit() function with the parameters passed to ** this routine to initialize the incremental merge. -** -** If the IncrMerger object is multi-threaded (IncrMerger.bUseThread==1), +** +** If the IncrMerger object is multi-threaded (IncrMerger.bUseThread==1), ** then a background thread is launched to call vdbePmaReaderIncrMergeInit(). ** Or, if the IncrMerger is single threaded, the same function is called ** using the current thread. @@ -88083,7 +88083,7 @@ static int vdbePmaReaderIncrInit(PmaReader *pReadr, int eMode){ ** to NULL and return an SQLite error code. ** ** When this function is called, *piOffset is set to the offset of the -** first PMA to read from pTask->file. Assuming no error occurs, it is +** first PMA to read from pTask->file. Assuming no error occurs, it is ** set to the offset immediately following the last byte of the last ** PMA before returning. If an error does occur, then the final value of ** *piOffset is undefined. @@ -88193,12 +88193,12 @@ static int vdbeSorterAddToTree( /* ** This function is called as part of a SorterRewind() operation on a sorter ** that has already written two or more level-0 PMAs to one or more temp -** files. It builds a tree of MergeEngine/IncrMerger/PmaReader objects that +** files. It builds a tree of MergeEngine/IncrMerger/PmaReader objects that ** can be used to incrementally merge all PMAs on disk. ** ** If successful, SQLITE_OK is returned and *ppOut set to point to the ** MergeEngine object at the root of the tree before returning. Or, if an -** error occurs, an SQLite error code is returned and the final value +** error occurs, an SQLite error code is returned and the final value ** of *ppOut is undefined. */ static int vdbeSorterMergeTreeBuild( @@ -88210,8 +88210,8 @@ static int vdbeSorterMergeTreeBuild( int iTask; #if SQLITE_MAX_WORKER_THREADS>0 - /* If the sorter uses more than one task, then create the top-level - ** MergeEngine here. This MergeEngine will read data from exactly + /* If the sorter uses more than one task, then create the top-level + ** MergeEngine here. This MergeEngine will read data from exactly ** one PmaReader per sub-task. */ assert( pSorter->bUseThreads || pSorter->nTask==1 ); if( pSorter->nTask>1 ){ @@ -88320,7 +88320,7 @@ static int vdbeSorterSetupMerge(VdbeSorter *pSorter){ } for(iTask=0; rc==SQLITE_OK && iTasknTask; iTask++){ /* Check that: - ** + ** ** a) The incremental merge object is configured to use the ** right task, and ** b) If it is using task (nTask-1), it is configured to run @@ -88383,7 +88383,7 @@ SQLITE_PRIVATE int sqlite3VdbeSorterRewind(const VdbeCursor *pCsr, int *pbEof){ return rc; } - /* Write the current in-memory list to a PMA. When the VdbeSorterWrite() + /* Write the current in-memory list to a PMA. When the VdbeSorterWrite() ** function flushes the contents of memory to disk, it immediately always ** creates a new list consisting of a single key immediately afterwards. ** So the list is never empty at this point. */ @@ -88395,7 +88395,7 @@ SQLITE_PRIVATE int sqlite3VdbeSorterRewind(const VdbeCursor *pCsr, int *pbEof){ vdbeSorterRewindDebug("rewind"); - /* Assuming no errors have occurred, set up a merger structure to + /* Assuming no errors have occurred, set up a merger structure to ** incrementally read and merge all remaining PMAs. */ assert( pSorter->pReader==0 ); if( rc==SQLITE_OK ){ @@ -88444,7 +88444,7 @@ SQLITE_PRIVATE int sqlite3VdbeSorterNext(sqlite3 *db, const VdbeCursor *pCsr, in } /* -** Return a pointer to a buffer owned by the sorter that contains the +** Return a pointer to a buffer owned by the sorter that contains the ** current key. */ static void *vdbeSorterRowkey( @@ -88653,7 +88653,7 @@ static int memjrnlRead( assert( p->readpoint.iOffset==0 || p->readpoint.pChunk!=0 ); if( p->readpoint.iOffset!=iOfst || iOfst==0 ){ sqlite3_int64 iOff = 0; - for(pChunk=p->pFirst; + for(pChunk=p->pFirst; ALWAYS(pChunk) && (iOff+p->nChunkSize)<=iOfst; pChunk=pChunk->pNext ){ @@ -88688,7 +88688,7 @@ static void memjrnlFreeChunks(MemJournal *p){ for(pIter=p->pFirst; pIter; pIter=pNext){ pNext = pIter->pNext; sqlite3_free(pIter); - } + } p->pFirst = 0; } @@ -88760,7 +88760,7 @@ static int memjrnlWrite( ** access writes are not required. The only exception to this is when ** the in-memory journal is being used by a connection using the ** atomic-write optimization. In this case the first 28 bytes of the - ** journal file may be written as part of committing the transaction. */ + ** journal file may be written as part of committing the transaction. */ assert( iOfst==p->endpoint.iOffset || iOfst==0 ); #ifdef SQLITE_ENABLE_ATOMIC_WRITE if( iOfst==0 && p->pFirst ){ @@ -88810,7 +88810,7 @@ static int memjrnlWrite( ** ** If the journal file is already on disk, truncate it there. Or, if it ** is still in main memory but is being truncated to zero bytes in size, -** ignore +** ignore */ static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){ MemJournal *p = (MemJournal *)pJfd; @@ -88837,8 +88837,8 @@ static int memjrnlClose(sqlite3_file *pJfd){ /* ** Sync the file. ** -** If the real file has been created, call its xSync method. Otherwise, -** syncing an in-memory journal is a no-op. +** If the real file has been created, call its xSync method. Otherwise, +** syncing an in-memory journal is a no-op. */ static int memjrnlSync(sqlite3_file *pJfd, int flags){ UNUSED_PARAMETER2(pJfd, flags); @@ -88879,11 +88879,11 @@ static const struct sqlite3_io_methods MemJournalMethods = { 0 /* xUnfetch */ }; -/* -** Open a journal file. +/* +** Open a journal file. ** -** The behaviour of the journal file depends on the value of parameter -** nSpill. If nSpill is 0, then the journal file is always create and +** The behaviour of the journal file depends on the value of parameter +** nSpill. If nSpill is 0, then the journal file is always create and ** accessed using the underlying VFS. If nSpill is less than zero, then ** all content is always stored in main-memory. Finally, if nSpill is a ** positive value, then the journal file is initially created in-memory @@ -88933,9 +88933,9 @@ SQLITE_PRIVATE void sqlite3MemJournalOpen(sqlite3_file *pJfd){ #ifdef SQLITE_ENABLE_ATOMIC_WRITE /* -** If the argument p points to a MemJournal structure that is not an +** If the argument p points to a MemJournal structure that is not an ** in-memory-only journal file (i.e. is one that was opened with a +ve -** nSpill parameter), and the underlying file has not yet been created, +** nSpill parameter), and the underlying file has not yet been created, ** create it now. */ SQLITE_PRIVATE int sqlite3JournalCreate(sqlite3_file *p){ @@ -88956,7 +88956,7 @@ SQLITE_PRIVATE int sqlite3JournalIsInMemory(sqlite3_file *p){ return p->pMethods==&MemJournalMethods; } -/* +/* ** Return the number of bytes required to store a JournalFile that uses vfs ** pVfs to create the underlying on-disk files. */ @@ -89061,7 +89061,7 @@ SQLITE_PRIVATE int sqlite3WalkSelectExpr(Walker *pWalker, Select *p){ ** Walk the parse trees associated with all subqueries in the ** FROM clause of SELECT statement p. Do not invoke the select ** callback on p, but do invoke it on each FROM clause subquery -** and on any subqueries further down in the tree. Return +** and on any subqueries further down in the tree. Return ** WRC_Abort or WRC_Continue; */ SQLITE_PRIVATE int sqlite3WalkSelectFrom(Walker *pWalker, Select *p){ @@ -89083,16 +89083,16 @@ SQLITE_PRIVATE int sqlite3WalkSelectFrom(Walker *pWalker, Select *p){ } } return WRC_Continue; -} +} /* ** Call sqlite3WalkExpr() for every expression in Select statement p. ** Invoke sqlite3WalkSelect() for subqueries in the FROM clause and -** on the compound select chain, p->pPrior. +** on the compound select chain, p->pPrior. ** ** If it is not NULL, the xSelectCallback() callback is invoked before ** the walk of the expressions and FROM clause. The xSelectCallback2() -** method, if it is not NULL, is invoked following the walk of the +** method, if it is not NULL, is invoked following the walk of the ** expressions and FROM clause. ** ** Return WRC_Continue under normal conditions. Return WRC_Abort if @@ -89214,7 +89214,7 @@ static void resolveAlias( } ExprSetProperty(pDup, EP_Alias); - /* Before calling sqlite3ExprDelete(), set the EP_Static flag. This + /* Before calling sqlite3ExprDelete(), set the EP_Static flag. This ** prevents ExprDelete() from deleting the Expr structure itself, ** allowing it to be repopulated by the memcpy() on the following line. ** The pExpr->u.zToken might point into memory that will be freed by the @@ -89281,7 +89281,7 @@ SQLITE_PRIVATE int sqlite3MatchSpanName( /* ** Given the name of a column of the form X.Y.Z or Y.Z or just Z, look up -** that name in the set of source tables in pSrcList and make the pExpr +** that name in the set of source tables in pSrcList and make the pExpr ** expression node refer back to that source column. The following changes ** are made to pExpr: ** @@ -89400,7 +89400,7 @@ static int lookupName( for(j=0, pCol=pTab->aCol; jnCol; j++, pCol++){ if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ /* If there has been exactly one prior match and this match - ** is for the right-hand table of a NATURAL JOIN or is in a + ** is for the right-hand table of a NATURAL JOIN or is in a ** USING clause, then skip this match. */ if( cnt==1 ){ @@ -89428,7 +89428,7 @@ static int lookupName( } /* if( pSrcList ) */ #ifndef SQLITE_OMIT_TRIGGER - /* If we have not already resolved the name, then maybe + /* If we have not already resolved the name, then maybe ** it is a new.* or old.* trigger argument reference */ if( zDb==0 && zTab!=0 && cntTab==0 && pParse->pTriggerTab!=0 ){ @@ -89444,7 +89444,7 @@ static int lookupName( pTab = 0; } - if( pTab ){ + if( pTab ){ int iCol; pSchema = pTab->pSchema; cntTab++; @@ -89540,7 +89540,7 @@ static int lookupName( assert( zTab==0 && zDb==0 ); goto lookupname_end; } - } + } } /* Advance to the next name context. The loop will exit when either @@ -89729,7 +89729,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ SrcList *pSrcList = pNC->pSrcList; struct SrcList_item *pItem; assert( pSrcList && pSrcList->nSrc==1 ); - pItem = pSrcList->a; + pItem = pSrcList->a; pExpr->op = TK_COLUMN; pExpr->pTab = pItem->pTab; pExpr->iTable = pItem->iCursor; @@ -89745,7 +89745,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ case TK_ID: { return lookupName(pParse, 0, 0, pExpr->u.zToken, pNC, pExpr); } - + /* A table name and column name: ID.ID ** Or a database, table and column: ID.ID.ID */ @@ -89818,7 +89818,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ ** to likelihood(X,0.9375). */ /* TUNING: unlikely() probability is 0.0625. likely() is 0.9375 */ pExpr->iTable = pDef->zName[0]=='u' ? 8388608 : 125829120; - } + } } #ifndef SQLITE_OMIT_AUTHORIZATION { @@ -89884,7 +89884,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ pNC->ncFlags |= NC_AllowAgg; } /* FIX ME: Compute pExpr->affinity based on the expected return - ** type of the function + ** type of the function */ return WRC_Prune; } @@ -89944,7 +89944,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ testcase( pExpr->op==TK_BETWEEN ); sqlite3ErrorMsg(pParse, "row value misused"); } - break; + break; } } return (pParse->nErr || pParse->db->mallocFailed) ? WRC_Abort : WRC_Continue; @@ -90054,7 +90054,7 @@ static void resolveOutOfRangeError( int i, /* The index (1-based) of the term out of range */ int mx /* Largest permissible value of i */ ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "%r %s BY term out of range - should be " "between 1 and %d", i, zType, mx); } @@ -90291,7 +90291,7 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ ExprList *pGroupBy; /* The GROUP BY clause */ Select *pLeftmost; /* Left-most of SELECT of a compound */ sqlite3 *db; /* Database connection */ - + assert( p!=0 ); if( p->selFlags & SF_Resolved ){ @@ -90345,7 +90345,7 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ pSub->pOrderBy = p->pOrderBy; p->pOrderBy = 0; } - + /* Recursively resolve names in all subqueries */ for(i=0; ipSrc->nSrc; i++){ @@ -90372,18 +90372,18 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ pItem->fg.isCorrelated = (nRef!=0); } } - + /* Set up the local name-context to pass to sqlite3ResolveExprNames() to ** resolve the result-set expression list. */ sNC.ncFlags = NC_AllowAgg; sNC.pSrcList = p->pSrc; sNC.pNext = pOuterNC; - + /* Resolve names in the result set. */ if( sqlite3ResolveExprListNames(&sNC, p->pEList) ) return WRC_Abort; - - /* If there are no aggregate functions in the result-set, and no GROUP BY + + /* If there are no aggregate functions in the result-set, and no GROUP BY ** expression, do not allow aggregates in any of the other expressions. */ assert( (p->selFlags & SF_Aggregate)==0 ); @@ -90394,14 +90394,14 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ }else{ sNC.ncFlags &= ~NC_AllowAgg; } - + /* If a HAVING clause is present, then there must be a GROUP BY clause. */ if( p->pHaving && !pGroupBy ){ sqlite3ErrorMsg(pParse, "a GROUP BY clause is required before HAVING"); return WRC_Abort; } - + /* Add the output column list to the name-context before parsing the ** other expressions in the SELECT statement. This is so that ** expressions in the WHERE clause (etc.) can refer to expressions by @@ -90418,19 +90418,19 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ for(i=0; ipSrc->nSrc; i++){ struct SrcList_item *pItem = &p->pSrc->a[i]; if( pItem->fg.isTabFunc - && sqlite3ResolveExprListNames(&sNC, pItem->u1.pFuncArg) + && sqlite3ResolveExprListNames(&sNC, pItem->u1.pFuncArg) ){ return WRC_Abort; } } /* The ORDER BY and GROUP BY clauses may not refer to terms in - ** outer queries + ** outer queries */ sNC.pNext = 0; sNC.ncFlags |= NC_AllowAgg; - /* If this is a converted compound query, move the ORDER BY clause from + /* If this is a converted compound query, move the ORDER BY clause from ** the sub-query back to the parent query. At this point each term ** within the ORDER BY clause has been transformed to an integer value. ** These integers will be replaced by copies of the corresponding result @@ -90459,13 +90459,13 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ if( db->mallocFailed ){ return WRC_Abort; } - - /* Resolve the GROUP BY clause. At the same time, make sure + + /* Resolve the GROUP BY clause. At the same time, make sure ** the GROUP BY clause does not contain aggregate functions. */ if( pGroupBy ){ struct ExprList_item *pItem; - + if( resolveOrderGroupBy(&sNC, p, pGroupBy, "GROUP") || db->mallocFailed ){ return WRC_Abort; } @@ -90507,7 +90507,7 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ ** checking on function usage and set a flag if any aggregate functions ** are seen. ** -** To resolve table columns references we look for nodes (or subtrees) of the +** To resolve table columns references we look for nodes (or subtrees) of the ** form X.Y.Z or Y.Z or just Z where ** ** X: The name of a database. Ex: "main" or "temp" or @@ -90539,7 +90539,7 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ ** ** SELECT a+b AS x, c+d AS y FROM t1 ORDER BY a+b; ** -** Function calls are checked to make sure that the function is +** Function calls are checked to make sure that the function is ** defined and that the correct number of arguments are specified. ** If the function is an aggregate function, then the NC_HasAgg flag is ** set and the opcode is changed from TK_FUNCTION to TK_AGG_FUNCTION. @@ -90549,7 +90549,7 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ ** An error message is left in pParse if anything is amiss. The number ** if errors is returned. */ -SQLITE_PRIVATE int sqlite3ResolveExprNames( +SQLITE_PRIVATE int sqlite3ResolveExprNames( NameContext *pNC, /* Namespace to resolve expressions in. */ Expr *pExpr /* The expression to be analyzed. */ ){ @@ -90594,7 +90594,7 @@ SQLITE_PRIVATE int sqlite3ResolveExprNames( ** just like sqlite3ResolveExprNames() except that it works for an expression ** list rather than a single expression. */ -SQLITE_PRIVATE int sqlite3ResolveExprListNames( +SQLITE_PRIVATE int sqlite3ResolveExprListNames( NameContext *pNC, /* Namespace to resolve expressions in. */ ExprList *pList /* The expression list to be analyzed. */ ){ @@ -90704,7 +90704,7 @@ SQLITE_PRIVATE char sqlite3TableColumnAffinity(Table *pTab, int iCol){ ** Return the 'affinity' of the expression pExpr if any. ** ** If pExpr is a column, a reference to a column via an 'AS' alias, -** or a sub-select with a column as the return value, then the +** or a sub-select with a column as the return value, then the ** affinity of that column is returned. Otherwise, 0x00 is returned, ** indicating no affinity for the expression. ** @@ -90790,7 +90790,7 @@ SQLITE_PRIVATE Expr *sqlite3ExprSkipCollate(Expr *pExpr){ assert( pExpr->op==TK_COLLATE ); pExpr = pExpr->pLeft; } - } + } return pExpr; } @@ -90856,7 +90856,7 @@ SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){ break; } } - if( sqlite3CheckCollSeq(pParse, pColl) ){ + if( sqlite3CheckCollSeq(pParse, pColl) ){ pColl = 0; } return pColl; @@ -90952,8 +90952,8 @@ static u8 binaryCompareP5(Expr *pExpr1, Expr *pExpr2, int jumpIfNull){ ** it is not considered. */ SQLITE_PRIVATE CollSeq *sqlite3BinaryCompareCollSeq( - Parse *pParse, - Expr *pLeft, + Parse *pParse, + Expr *pLeft, Expr *pRight ){ CollSeq *pColl; @@ -91009,7 +91009,7 @@ SQLITE_PRIVATE int sqlite3ExprIsVector(Expr *pExpr){ } /* -** If the expression passed as the only argument is of type TK_VECTOR +** If the expression passed as the only argument is of type TK_VECTOR ** return the number of expressions in the vector. Or, if the expression ** is a sub-select, return the number of columns in the sub-select. For ** any other type of expression, return 1. @@ -91062,7 +91062,7 @@ SQLITE_PRIVATE Expr *sqlite3VectorFieldSubexpr(Expr *pVector, int i){ ** sqlite3ExprCode() will generate all necessary code to compute ** the iField-th column of the vector expression pVector. ** -** It is ok for pVector to be a scalar (as long as iField==0). +** It is ok for pVector to be a scalar (as long as iField==0). ** In that case, this routine works like sqlite3ExprDup(). ** ** The caller owns the returned Expr object and is responsible for @@ -91118,7 +91118,7 @@ SQLITE_PRIVATE Expr *sqlite3ExprForVectorField( /* ** If expression pExpr is of type TK_SELECT, generate code to evaluate -** it. Return the register in which the result is stored (or, if the +** it. Return the register in which the result is stored (or, if the ** sub-select returns more than one column, the first in an array ** of registers in which the result is stored). ** @@ -91140,10 +91140,10 @@ static int exprCodeSubselect(Parse *pParse, Expr *pExpr){ ** the register number of a register that contains the value of ** element iField of the vector. ** -** If pVector is a TK_SELECT expression, then code for it must have +** If pVector is a TK_SELECT expression, then code for it must have ** already been generated using the exprCodeSubselect() routine. In this ** case parameter regSelect should be the first in an array of registers -** containing the results of the sub-select. +** containing the results of the sub-select. ** ** If pVector is of type TK_VECTOR, then code for the requested field ** is generated. In this case (*pRegFree) may be set to the number of @@ -91206,10 +91206,10 @@ static void codeVectorCompare( sqlite3ErrorMsg(pParse, "row value misused"); return; } - assert( pExpr->op==TK_EQ || pExpr->op==TK_NE - || pExpr->op==TK_IS || pExpr->op==TK_ISNOT - || pExpr->op==TK_LT || pExpr->op==TK_GT - || pExpr->op==TK_LE || pExpr->op==TK_GE + assert( pExpr->op==TK_EQ || pExpr->op==TK_NE + || pExpr->op==TK_IS || pExpr->op==TK_ISNOT + || pExpr->op==TK_LT || pExpr->op==TK_GT + || pExpr->op==TK_LE || pExpr->op==TK_GE ); assert( pExpr->op==op || (pExpr->op==TK_IS && op==TK_EQ) || (pExpr->op==TK_ISNOT && op==TK_NE) ); @@ -91225,7 +91225,7 @@ static void codeVectorCompare( for(i=0; 1 /*Loop exits by "break"*/; i++){ int regFree1 = 0, regFree2 = 0; - Expr *pL, *pR; + Expr *pL, *pR; int r1, r2; assert( i>=0 && i0 ) sqlite3ExprCachePush(pParse); @@ -91273,7 +91273,7 @@ SQLITE_PRIVATE int sqlite3ExprCheckHeight(Parse *pParse, int nHeight){ int rc = SQLITE_OK; int mxHeight = pParse->db->aLimit[SQLITE_LIMIT_EXPR_DEPTH]; if( nHeight>mxHeight ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "Expression tree is too large (maximum depth %d)", mxHeight ); rc = SQLITE_ERROR; @@ -91319,10 +91319,10 @@ static void heightOfSelect(Select *p, int *pnHeight){ } /* -** Set the Expr.nHeight variable in the structure passed as an -** argument. An expression with no children, Expr.pList or +** Set the Expr.nHeight variable in the structure passed as an +** argument. An expression with no children, Expr.pList or ** Expr.pSelect member has a height of 1. Any other expression -** has a height equal to the maximum height of any other +** has a height equal to the maximum height of any other ** referenced Expr plus one. ** ** Also propagate EP_Propagate flags up from Expr.x.pList to Expr.flags, @@ -91347,7 +91347,7 @@ static void exprSetHeight(Expr *p){ ** leave an error in pParse. ** ** Also propagate all EP_Propagate flags from the Expr.x.pList into -** Expr.flags. +** Expr.flags. */ SQLITE_PRIVATE void sqlite3ExprSetHeightAndFlags(Parse *pParse, Expr *p){ if( pParse->nErr ) return; @@ -91367,7 +91367,7 @@ SQLITE_PRIVATE int sqlite3SelectExprHeight(Select *p){ #else /* ABOVE: Height enforcement enabled. BELOW: Height enforcement off */ /* ** Propagate all EP_Propagate flags from the Expr.x.pList into -** Expr.flags. +** Expr.flags. */ SQLITE_PRIVATE void sqlite3ExprSetHeightAndFlags(Parse *pParse, Expr *p){ if( p && p->x.pList && !ExprHasProperty(p, EP_xIsSelect) ){ @@ -91437,7 +91437,7 @@ SQLITE_PRIVATE Expr *sqlite3ExprAlloc( } #if SQLITE_MAX_EXPR_DEPTH>0 pNew->nHeight = 1; -#endif +#endif } return pNew; } @@ -91606,7 +91606,7 @@ SQLITE_PRIVATE Expr *sqlite3ExprFunction(Parse *pParse, ExprList *pList, Token * /* ** Assign a variable number to an expression that encodes a wildcard -** in the original SQL statement. +** in the original SQL statement. ** ** Wildcards consisting of a single "?" are assigned the next sequential ** variable number. @@ -91720,7 +91720,7 @@ SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3 *db, Expr *p){ } /* -** Return the number of bytes allocated for the expression structure +** Return the number of bytes allocated for the expression structure ** passed as the first argument. This is always one of EXPR_FULLSIZE, ** EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE. */ @@ -91735,14 +91735,14 @@ static int exprStructSize(Expr *p){ ** to store a copy of an expression or expression tree. They differ in ** how much of the tree is measured. ** -** dupedExprStructSize() Size of only the Expr structure +** dupedExprStructSize() Size of only the Expr structure ** dupedExprNodeSize() Size of Expr + space for token ** dupedExprSize() Expr + token + subtree components ** *************************************************************************** ** -** The dupedExprStructSize() function returns two values OR-ed together: -** (1) the space required for a copy of the Expr structure only and +** The dupedExprStructSize() function returns two values OR-ed together: +** (1) the space required for a copy of the Expr structure only and ** (2) the EP_xxx flags that indicate what the structure size should be. ** The return values is always one of: ** @@ -91773,7 +91773,7 @@ static int dupedExprStructSize(Expr *p, int flags){ nSize = EXPR_FULLSIZE; }else{ assert( !ExprHasProperty(p, EP_TokenOnly|EP_Reduced) ); - assert( !ExprHasProperty(p, EP_FromJoin) ); + assert( !ExprHasProperty(p, EP_FromJoin) ); assert( !ExprHasProperty(p, EP_MemToken) ); assert( !ExprHasProperty(p, EP_NoReduce) ); if( p->pLeft || p->x.pList ){ @@ -91787,7 +91787,7 @@ static int dupedExprStructSize(Expr *p, int flags){ } /* -** This function returns the space in bytes required to store the copy +** This function returns the space in bytes required to store the copy ** of the Expr structure and a copy of the Expr.u.zToken string (if that ** string is defined.) */ @@ -91800,16 +91800,16 @@ static int dupedExprNodeSize(Expr *p, int flags){ } /* -** Return the number of bytes required to create a duplicate of the +** Return the number of bytes required to create a duplicate of the ** expression passed as the first argument. The second argument is a ** mask containing EXPRDUP_XXX flags. ** ** The value returned includes space to create a copy of the Expr struct ** itself and the buffer referred to by Expr.u.zToken, if any. ** -** If the EXPRDUP_REDUCE flag is set, then the return value includes -** space to duplicate all Expr nodes in the tree formed by Expr.pLeft -** and Expr.pRight variables (but not for any structures pointed to or +** If the EXPRDUP_REDUCE flag is set, then the return value includes +** space to duplicate all Expr nodes in the tree formed by Expr.pLeft +** and Expr.pRight variables (but not for any structures pointed to or ** descended from the Expr.x.pList or Expr.x.pSelect variables). */ static int dupedExprSize(Expr *p, int flags){ @@ -91824,8 +91824,8 @@ static int dupedExprSize(Expr *p, int flags){ } /* -** This function is similar to sqlite3ExprDup(), except that if pzBuffer -** is not NULL then *pzBuffer is assumed to point to a buffer large enough +** This function is similar to sqlite3ExprDup(), except that if pzBuffer +** is not NULL then *pzBuffer is assumed to point to a buffer large enough ** to store the copy of expression p, the copies of p->u.zToken ** (if applicable), and the copies of the p->pLeft and p->pRight expressions, ** if any. Before returning, *pzBuffer is set to the first byte past the @@ -91871,7 +91871,7 @@ static Expr *exprDup(sqlite3 *db, Expr *p, int dupFlags, u8 **pzBuffer){ }else{ u32 nSize = (u32)exprStructSize(p); memcpy(zAlloc, p, nSize); - if( nSizemallocFailed flag set. */ @@ -91958,7 +91958,7 @@ static With *withDup(sqlite3 *db, With *p){ ** without effecting the originals. ** ** The expression list, ID, and source lists return by sqlite3ExprListDup(), -** sqlite3IdListDup(), and sqlite3SrcListDup() can not be further expanded +** sqlite3IdListDup(), and sqlite3SrcListDup() can not be further expanded ** by subsequent calls to sqlite*ListAppend() routines. ** ** Any tables that the SrcList might point to are not duplicated. @@ -91987,15 +91987,15 @@ SQLITE_PRIVATE ExprList *sqlite3ExprListDup(sqlite3 *db, ExprList *p, int flags) if( pItem==0 ){ sqlite3DbFree(db, pNew); return 0; - } + } pOldItem = p->a; for(i=0; inExpr; i++, pItem++, pOldItem++){ Expr *pOldExpr = pOldItem->pExpr; Expr *pNewExpr; pItem->pExpr = sqlite3ExprDup(db, pOldExpr, flags); - if( pOldExpr + if( pOldExpr && pOldExpr->op==TK_SELECT_COLUMN - && (pNewExpr = pItem->pExpr)!=0 + && (pNewExpr = pItem->pExpr)!=0 ){ assert( pNewExpr->iColumn==0 || i>0 ); if( pNewExpr->iColumn==0 ){ @@ -92021,7 +92021,7 @@ SQLITE_PRIVATE ExprList *sqlite3ExprListDup(sqlite3 *db, ExprList *p, int flags) /* ** If cursors, triggers, views and subqueries are all omitted from -** the build, then none of the following routines, except for +** the build, then none of the following routines, except for ** sqlite3SelectDup(), can be called. sqlite3SelectDup() is sometimes ** called with a NULL argument. */ @@ -92054,7 +92054,7 @@ SQLITE_PRIVATE SrcList *sqlite3SrcListDup(sqlite3 *db, SrcList *p, int flags){ } pNewItem->pIBIndex = pOldItem->pIBIndex; if( pNewItem->fg.isTabFunc ){ - pNewItem->u1.pFuncArg = + pNewItem->u1.pFuncArg = sqlite3ExprListDup(db, pOldItem->u1.pFuncArg, flags); } pTab = pNewItem->pTab = pOldItem->pTab; @@ -92176,7 +92176,7 @@ SQLITE_PRIVATE ExprList *sqlite3ExprListAppend( } return pList; -no_mem: +no_mem: /* Avoid leaking memory if malloc has failed. */ sqlite3ExprDelete(db, pExpr); sqlite3ExprListDelete(db, pList); @@ -92209,8 +92209,8 @@ SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector( if( NEVER(pColumns==0) ) goto vector_append_error; if( pExpr==0 ) goto vector_append_error; - /* If the RHS is a vector, then we can immediately check to see that - ** the size of the RHS and LHS match. But if the RHS is a SELECT, + /* If the RHS is a vector, then we can immediately check to see that + ** the size of the RHS and LHS match. But if the RHS is a SELECT, ** wildcards ("*") in the result set of the SELECT must be expanded before ** we can do the size check, so defer the size check until code generation. */ @@ -92234,7 +92234,7 @@ SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector( if( pList && pList->a[iFirst].pExpr ){ Expr *pFirst = pList->a[iFirst].pExpr; assert( pFirst->op==TK_SELECT_COLUMN ); - + /* Store the SELECT statement in pRight so it will be deleted when ** sqlite3ExprListDelete() is called */ pFirst->pRight = pExpr; @@ -92389,7 +92389,7 @@ SQLITE_PRIVATE u32 sqlite3ExprListFlags(const ExprList *pList){ ** in a CREATE TABLE statement. The Walker.eCode value is 5 when parsing ** an existing schema and 4 when processing a new statement. A bound ** parameter raises an error for new statements, but is silently converted -** to NULL for existing schemas. This allows sqlite_master tables that +** to NULL for existing schemas. This allows sqlite_master tables that ** contain a bound parameter because they were generated by older versions ** of SQLite to be parsed by newer versions of SQLite without raising a ** malformed schema error. @@ -92567,7 +92567,7 @@ SQLITE_PRIVATE int sqlite3ExprIsInteger(Expr *p, int *pValue){ ** Return FALSE if there is no chance that the expression can be NULL. ** ** If the expression might be NULL or if the expression is too complex -** to tell return TRUE. +** to tell return TRUE. ** ** This routine is used as an optimization, to skip OP_IsNull opcodes ** when we know that a value cannot be NULL. Hence, a false positive @@ -92648,7 +92648,7 @@ SQLITE_PRIVATE int sqlite3IsRowid(const char *z){ } /* -** pX is the RHS of an IN operator. If pX is a SELECT statement +** pX is the RHS of an IN operator. If pX is a SELECT statement ** that can be simplified to a direct table access, then return ** a pointer to the SELECT statement. If pX is not a SELECT statement, ** or if the SELECT statement needs to be manifested into a transient @@ -92715,7 +92715,7 @@ static void sqlite3SetHasNullFlag(Vdbe *v, int iCur, int regHasNull){ #ifndef SQLITE_OMIT_SUBQUERY /* -** The argument is an IN operator with a list (not a subquery) on the +** The argument is an IN operator with a list (not a subquery) on the ** right-hand side. Return TRUE if that list is constant. */ static int sqlite3InRhsIsConstant(Expr *pIn){ @@ -92775,9 +92775,9 @@ static int sqlite3InRhsIsConstant(Expr *pIn){ ** to be unique - either because it is an INTEGER PRIMARY KEY or due to ** a UNIQUE constraint or index. ** -** When IN_INDEX_MEMBERSHIP is used (and the b-tree will be used -** for fast set membership tests) then an epheremal table must -** be used unless is a single INTEGER PRIMARY KEY column or an +** When IN_INDEX_MEMBERSHIP is used (and the b-tree will be used +** for fast set membership tests) then an epheremal table must +** be used unless is a single INTEGER PRIMARY KEY column or an ** index can be found with the specified as its left-most. ** ** If the IN_INDEX_NOOP_OK and IN_INDEX_MEMBERSHIP are both set and @@ -92789,7 +92789,7 @@ static int sqlite3InRhsIsConstant(Expr *pIn){ ** ** When the b-tree is being used for membership tests, the calling function ** might need to know whether or not the RHS side of the IN operator -** contains a NULL. If prRhsHasNull is not a NULL pointer and +** contains a NULL. If prRhsHasNull is not a NULL pointer and ** if there is any chance that the (...) might contain a NULL value at ** runtime, then a register is allocated and the register number written ** to *prRhsHasNull. If there is no chance that the (...) contains a @@ -92828,9 +92828,9 @@ SQLITE_PRIVATE int sqlite3FindInIndex( assert( pX->op==TK_IN ); mustBeUnique = (inFlags & IN_INDEX_LOOP)!=0; - /* If the RHS of this IN(...) operator is a SELECT, and if it matters + /* If the RHS of this IN(...) operator is a SELECT, and if it matters ** whether or not the SELECT result contains NULL values, check whether - ** or not NULL is actually possible (it may not be, for example, due + ** or not NULL is actually possible (it may not be, for example, due ** to NOT NULL constraints in the schema). If no NULL values are possible, ** set prRhsHasNull to 0 before continuing. */ if( prRhsHasNull && (pX->flags & EP_xIsSelect) ){ @@ -92845,7 +92845,7 @@ SQLITE_PRIVATE int sqlite3FindInIndex( } /* Check to see if an existing table or index can be used to - ** satisfy the query. This is preferable to generating a new + ** satisfy the query. This is preferable to generating a new ** ephemeral table. */ if( pParse->nErr==0 && (p = isCandidateForInOpt(pX))!=0 ){ sqlite3 *db = pParse->db; /* Database connection */ @@ -92879,7 +92879,7 @@ SQLITE_PRIVATE int sqlite3FindInIndex( int affinity_ok = 1; int i; - /* Check that the affinity that will be used to perform each + /* Check that the affinity that will be used to perform each ** comparison is the same as the affinity of each column in table ** on the RHS of the IN operator. If it not, it is not possible to ** use any index of the RHS table. */ @@ -92923,14 +92923,14 @@ SQLITE_PRIVATE int sqlite3FindInIndex( continue; /* This index is not unique over the IN RHS columns */ } } - + colUsed = 0; /* Columns of index used so far */ for(i=0; ipLeft, i); Expr *pRhs = pEList->a[i].pExpr; CollSeq *pReq = sqlite3BinaryCompareCollSeq(pParse, pLhs, pRhs); int j; - + assert( pReq!=0 || pRhs->iColumn==XN_ROWID || pParse->nErr ); for(j=0; jaiColumn[j]!=pRhs->iColumn ) continue; @@ -92946,7 +92946,7 @@ SQLITE_PRIVATE int sqlite3FindInIndex( colUsed |= mCol; if( aiMap ) aiMap[i] = j; } - + assert( i==nExpr || colUsed!=(MASKBIT(nExpr)-1) ); if( colUsed==(MASKBIT(nExpr)-1) ){ /* If we reach this point, that means the index pIdx is usable */ @@ -92961,11 +92961,11 @@ SQLITE_PRIVATE int sqlite3FindInIndex( VdbeComment((v, "%s", pIdx->zName)); assert( IN_INDEX_INDEX_DESC == IN_INDEX_INDEX_ASC+1 ); eType = IN_INDEX_INDEX_ASC + pIdx->aSortOrder[0]; - + if( prRhsHasNull ){ #ifdef SQLITE_ENABLE_COLUMN_USED_MASK i64 mask = (1<nMem; @@ -93027,8 +93027,8 @@ SQLITE_PRIVATE int sqlite3FindInIndex( #ifndef SQLITE_OMIT_SUBQUERY /* -** Argument pExpr is an (?, ?...) IN(...) expression. This -** function allocates and returns a nul-terminated string containing +** Argument pExpr is an (?, ?...) IN(...) expression. This +** function allocates and returns a nul-terminated string containing ** the affinities to be used for each column of the comparison. ** ** It is the responsibility of the caller to ensure that the returned @@ -93061,11 +93061,11 @@ static char *exprINAffinity(Parse *pParse, Expr *pExpr){ #ifndef SQLITE_OMIT_SUBQUERY /* -** Load the Parse object passed as the first argument with an error +** Load the Parse object passed as the first argument with an error ** message of the form: ** ** "sub-select returns N columns - expected M" -*/ +*/ SQLITE_PRIVATE void sqlite3SubselectError(Parse *pParse, int nActual, int nExpect){ const char *zFmt = "sub-select returns %d columns - expected %d"; sqlite3ErrorMsg(pParse, zFmt, nActual, nExpect); @@ -93074,7 +93074,7 @@ SQLITE_PRIVATE void sqlite3SubselectError(Parse *pParse, int nActual, int nExpec /* ** Expression pExpr is a vector that has been used in a context where -** it is not permitted. If pExpr is a sub-select vector, this routine +** it is not permitted. If pExpr is a sub-select vector, this routine ** loads the Parse object with a message of the form: ** ** "sub-select returns N columns - expected 1" @@ -93082,7 +93082,7 @@ SQLITE_PRIVATE void sqlite3SubselectError(Parse *pParse, int nActual, int nExpec ** Or, if it is a regular scalar vector: ** ** "row value misused" -*/ +*/ SQLITE_PRIVATE void sqlite3VectorErrorMsg(Parse *pParse, Expr *pExpr){ #ifndef SQLITE_OMIT_SUBQUERY if( pExpr->flags & EP_xIsSelect ){ @@ -93167,13 +93167,13 @@ SQLITE_PRIVATE int sqlite3CodeSubselect( Expr *pLeft = pExpr->pLeft; /* the LHS of the IN operator */ KeyInfo *pKeyInfo = 0; /* Key information */ int nVal; /* Size of vector pLeft */ - + nVal = sqlite3ExprVectorSize(pLeft); assert( !isRowid || nVal==1 ); /* Whether this is an 'x IN(SELECT...)' or an 'x IN()' - ** expression it is handled the same way. An ephemeral table is - ** filled with index keys representing the results from the + ** expression it is handled the same way. An ephemeral table is + ** filled with index keys representing the results from the ** SELECT or the . ** ** If the 'x' expression is a column value, or the SELECT... @@ -93185,7 +93185,7 @@ SQLITE_PRIVATE int sqlite3CodeSubselect( ** is used. */ pExpr->iTable = pParse->nTab++; - addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, + addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pExpr->iTable, (isRowid?0:nVal)); pKeyInfo = isRowid ? 0 : sqlite3KeyInfoAlloc(pParse->db, nVal, 1); @@ -93307,7 +93307,7 @@ SQLITE_PRIVATE int sqlite3CodeSubselect( ** If this is an EXISTS, write an integer 0 (not exists) or 1 (exists) ** into a register and return that register number. ** - ** In both cases, the query is augmented with "LIMIT 1". Any + ** In both cases, the query is augmented with "LIMIT 1". Any ** preexisting limit is discarded in place of the new LIMIT 1. */ Select *pSel; /* SELECT statement to encode */ @@ -93363,9 +93363,9 @@ SQLITE_PRIVATE int sqlite3CodeSubselect( #ifndef SQLITE_OMIT_SUBQUERY /* -** Expr pIn is an IN(...) expression. This function checks that the -** sub-select on the RHS of the IN() operator has the same number of -** columns as the vector on the LHS. Or, if the RHS of the IN() is not +** Expr pIn is an IN(...) expression. This function checks that the +** sub-select on the RHS of the IN() operator has the same number of +** columns as the vector on the LHS. Or, if the RHS of the IN() is not ** a sub-query, that the LHS is a vector of size 1. */ SQLITE_PRIVATE int sqlite3ExprCheckIN(Parse *pParse, Expr *pIn){ @@ -93390,18 +93390,18 @@ SQLITE_PRIVATE int sqlite3ExprCheckIN(Parse *pParse, Expr *pIn){ ** x IN (SELECT ...) ** x IN (value, value, ...) ** -** The left-hand side (LHS) is a scalar or vector expression. The +** The left-hand side (LHS) is a scalar or vector expression. The ** right-hand side (RHS) is an array of zero or more scalar values, or a ** subquery. If the RHS is a subquery, the number of result columns must ** match the number of columns in the vector on the LHS. If the RHS is -** a list of values, the LHS must be a scalar. +** a list of values, the LHS must be a scalar. ** ** The IN operator is true if the LHS value is contained within the RHS. -** The result is false if the LHS is definitely not in the RHS. The -** result is NULL if the presence of the LHS in the RHS cannot be +** The result is false if the LHS is definitely not in the RHS. The +** result is NULL if the presence of the LHS in the RHS cannot be ** determined due to NULLs. ** -** This routine generates code that jumps to destIfFalse if the LHS is not +** This routine generates code that jumps to destIfFalse if the LHS is not ** contained within the RHS. If due to NULLs we cannot determine if the LHS ** is contained in the RHS then jump to destIfNull. If the LHS is contained ** within the RHS then fall through. @@ -93430,7 +93430,7 @@ static void sqlite3ExprCodeIN( int destStep6 = 0; /* Start of code for Step 6 */ int addrTruthOp; /* Address of opcode that determines the IN is true */ int destNotNull; /* Jump here if a comparison is not true in step 6 */ - int addrTop; /* Top of the step-6 loop */ + int addrTop; /* Top of the step-6 loop */ pLeft = pExpr->pLeft; if( sqlite3ExprCheckIN(pParse, pExpr) ) return; @@ -93442,7 +93442,7 @@ static void sqlite3ExprCodeIN( if( pParse->db->mallocFailed ) goto sqlite3ExprCodeIN_oom_error; /* Attempt to compute the RHS. After this step, if anything other than - ** IN_INDEX_NOOP is returned, the table opened ith cursor pExpr->iTable + ** IN_INDEX_NOOP is returned, the table opened ith cursor pExpr->iTable ** contains the values that make up the RHS. If IN_INDEX_NOOP is returned, ** the RHS has not yet been coded. */ v = pParse->pVdbe; @@ -93453,7 +93453,7 @@ static void sqlite3ExprCodeIN( destIfFalse==destIfNull ? 0 : &rRhsHasNull, aiMap); assert( pParse->nErr || nVector==1 || eType==IN_INDEX_EPH - || eType==IN_INDEX_INDEX_ASC || eType==IN_INDEX_INDEX_DESC + || eType==IN_INDEX_INDEX_ASC || eType==IN_INDEX_INDEX_DESC ); #ifdef SQLITE_DEBUG /* Confirm that aiMap[] contains nVector integer values between 0 and @@ -93465,8 +93465,8 @@ static void sqlite3ExprCodeIN( } #endif - /* Code the LHS, the from " IN (...)". If the LHS is a - ** vector, then it is stored in an array of nVector registers starting + /* Code the LHS, the from " IN (...)". If the LHS is a + ** vector, then it is stored in an array of nVector registers starting ** at r1. ** ** sqlite3FindInIndex() might have reordered the fields of the LHS vector @@ -93584,7 +93584,7 @@ static void sqlite3ExprCodeIN( } /* Step 5. If we do not care about the difference between NULL and - ** FALSE, then just return false. + ** FALSE, then just return false. */ if( destIfFalse==destIfNull ) sqlite3VdbeGoto(v, destIfFalse); @@ -93646,7 +93646,7 @@ sqlite3ExprCodeIN_oom_error: ** Generate an instruction that will put the floating point ** value described by z[0..n-1] into register iMem. ** -** The z[] string will probably not be zero-terminated. But the +** The z[] string will probably not be zero-terminated. But the ** z[n] character is guaranteed to be something that does not look ** like the continuation of the number. */ @@ -93890,7 +93890,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeGetColumnOfTable( /* ** Generate code that will extract the iColumn-th column from -** table pTab and store the column value in a register. +** table pTab and store the column value in a register. ** ** An effort is made to store the column value in register iReg. This ** is not garanteeed for GetColumn() - the result can be stored in @@ -93918,12 +93918,12 @@ SQLITE_PRIVATE int sqlite3ExprCodeGetColumn( sqlite3ExprCachePinRegister(pParse, p->iReg); return p->iReg; } - } + } assert( v!=0 ); sqlite3ExprCodeGetColumnOfTable(v, pTab, iTable, iColumn, iReg); if( p5 ){ sqlite3VdbeChangeP5(v, p5); - }else{ + }else{ sqlite3ExprCacheStore(pParse, iTable, iColumn, iReg); } return iReg; @@ -94212,7 +94212,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) case TK_BITOR: case TK_SLASH: case TK_LSHIFT: - case TK_RSHIFT: + case TK_RSHIFT: case TK_CONCAT: { assert( TK_AND==OP_And ); testcase( op==TK_AND ); assert( TK_OR==OP_Or ); testcase( op==TK_OR ); @@ -94363,7 +94363,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) char aff; assert( nFarg==1 ); aff = sqlite3ExprAffinity(pFarg->a[0].pExpr); - sqlite3VdbeLoadString(v, target, + sqlite3VdbeLoadString(v, target, aff ? azAff[aff-SQLITE_AFF_BLOB] : "none"); return target; } @@ -94400,7 +94400,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) assert( SQLITE_FUNC_LENGTH==OPFLAG_LENGTHARG ); assert( SQLITE_FUNC_TYPEOF==OPFLAG_TYPEOFARG ); testcase( pDef->funcFlags & OPFLAG_LENGTHARG ); - pFarg->a[0].pExpr->op2 = + pFarg->a[0].pExpr->op2 = pDef->funcFlags & (OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG); } } @@ -94421,7 +94421,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) ** see if it is a column in a virtual table. This is done because ** the left operand of infix functions (the operand we want to ** control overloading) ends up as the second argument to the - ** function. The expression "A glob B" is equivalent to + ** function. The expression "A glob B" is equivalent to ** "glob(B,A). We want to use the A in "A glob B" to test ** for function overloading. But we use the B term in "glob(B,A)". */ @@ -94432,7 +94432,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) } #endif if( pDef->funcFlags & SQLITE_FUNC_NEEDCOLL ){ - if( !pColl ) pColl = db->pDfltColl; + if( !pColl ) pColl = db->pDfltColl; sqlite3VdbeAddOp4(v, OP_CollSeq, 0, 0, 0, (char *)pColl, P4_COLLSEQ); } sqlite3VdbeAddOp4(v, OP_Function0, constMask, r1, target, @@ -94463,7 +94463,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) } assert( pExpr->iTable==0 || pExpr->pLeft->op==TK_SELECT ); if( pExpr->iTable - && pExpr->iTable!=(n = sqlite3ExprVectorSize(pExpr->pLeft)) + && pExpr->iTable!=(n = sqlite3ExprVectorSize(pExpr->pLeft)) ){ sqlite3ErrorMsg(pParse, "%d columns assigned %d values", pExpr->iTable, n); @@ -94500,7 +94500,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) return target; } case TK_SPAN: - case TK_COLLATE: + case TK_COLLATE: case TK_UPLUS: { return sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); } @@ -94515,7 +94515,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) ** ** The expression is implemented using an OP_Param opcode. The p1 ** parameter is set to 0 for an old.rowid reference, or to (i+1) - ** to reference another column of the old.* pseudo-table, where + ** to reference another column of the old.* pseudo-table, where ** i is the index of the column. For a new.rowid reference, p1 is ** set to (n+1), where n is the number of columns in each pseudo-table. ** For a reference to any other column in the new.* pseudo-table, p1 @@ -94529,7 +94529,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) ** ** p1==0 -> old.rowid p1==3 -> new.rowid ** p1==1 -> old.a p1==4 -> new.a - ** p1==2 -> old.b p1==5 -> new.b + ** p1==2 -> old.b p1==5 -> new.b */ Table *pTab = pExpr->pTab; int p1 = pExpr->iTable * (pTab->nCol+1) + 1 + pExpr->iColumn; @@ -94552,7 +94552,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) ** ** EVIDENCE-OF: R-60985-57662 SQLite will convert the value back to ** floating point when extracting it from the record. */ - if( pExpr->iColumn>=0 + if( pExpr->iColumn>=0 && pTab->aCol[pExpr->iColumn].affinity==SQLITE_AFF_REAL ){ sqlite3VdbeAddOp1(v, OP_RealAffinity, target); @@ -94644,14 +94644,14 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) }else{ sqlite3VdbeAddOp2(v, OP_Null, 0, target); } - assert( pParse->db->mallocFailed || pParse->nErr>0 + assert( pParse->db->mallocFailed || pParse->nErr>0 || pParse->iCacheLevel==iCacheLevel ); sqlite3VdbeResolveLabel(v, endLabel); break; } #ifndef SQLITE_OMIT_TRIGGER case TK_RAISE: { - assert( pExpr->affinity==OE_Rollback + assert( pExpr->affinity==OE_Rollback || pExpr->affinity==OE_Abort || pExpr->affinity==OE_Fail || pExpr->affinity==OE_Ignore @@ -94687,8 +94687,8 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target) ** Factor out the code of the given expression to initialization time. ** ** If regDest>=0 then the result is always stored in that register and the -** result is not reusable. If regDest<0 then this routine is free to -** store the value whereever it wants. The register where the expression +** result is not reusable. If regDest<0 then this routine is free to +** store the value whereever it wants. The register where the expression ** is stored is returned. When regDest<0, two identical expressions will ** code to the same register. */ @@ -94810,7 +94810,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeFactorable(Parse *pParse, Expr *pExpr, int ta ** and modify the expression so that the next time it is evaluated, ** the result is a copy of the cache register. ** -** This routine is used for expressions that are used multiple +** This routine is used for expressions that are used multiple ** times. They are evaluated once and the results of the expression ** are reused. */ @@ -94893,7 +94893,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeExprList( ** ** x BETWEEN y AND z ** -** The above is equivalent to +** The above is equivalent to ** ** x>=y AND x<=z ** @@ -95088,7 +95088,7 @@ SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int } } sqlite3ReleaseTempReg(pParse, regFree1); - sqlite3ReleaseTempReg(pParse, regFree2); + sqlite3ReleaseTempReg(pParse, regFree2); } /* @@ -95226,7 +95226,7 @@ SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int } #endif default: { - default_expr: + default_expr: if( exprAlwaysFalse(pExpr) ){ sqlite3VdbeGoto(v, dest); }else if( exprAlwaysTrue(pExpr) ){ @@ -95318,7 +95318,7 @@ SQLITE_PRIVATE int sqlite3ExprCompare(Expr *pA, Expr *pB, int iTab){ if( sqlite3ExprListCompare(pA->x.pList, pB->x.pList, iTab) ) return 2; if( ALWAYS((combinedFlags & EP_Reduced)==0) && pA->op!=TK_STRING ){ if( pA->iColumn!=pB->iColumn ) return 2; - if( pA->iTable!=pB->iTable + if( pA->iTable!=pB->iTable && (pA->iTable!=iTab || NEVER(pB->iTable>=0)) ) return 2; } } @@ -95326,7 +95326,7 @@ SQLITE_PRIVATE int sqlite3ExprCompare(Expr *pA, Expr *pB, int iTab){ } /* -** Compare two ExprList objects. Return 0 if they are identical and +** Compare two ExprList objects. Return 0 if they are identical and ** non-zero if they differ in any way. ** ** If any subelement of pB has Expr.iTable==(-1) then it is allowed @@ -95405,7 +95405,7 @@ struct IdxCover { }; /* -** Check to see if there are references to columns in table +** Check to see if there are references to columns in table ** pWalker->u.pIdxCover->iCur can be satisfied using the index ** pWalker->u.pIdxCover->pIdx. */ @@ -95449,7 +95449,7 @@ SQLITE_PRIVATE int sqlite3ExprCoveredByIndex( /* ** An instance of the following structure is used by the tree walker -** to count references to table columns in the arguments of an +** to count references to table columns in the arguments of an ** aggregate function, in order to implement the ** sqlite3FunctionThisSrc() routine. */ @@ -95519,7 +95519,7 @@ static int addAggInfoColumn(sqlite3 *db, AggInfo *pInfo){ &i ); return i; -} +} /* ** Add a new element to the pAggInfo->aFunc[] array. Return the index of @@ -95528,14 +95528,14 @@ static int addAggInfoColumn(sqlite3 *db, AggInfo *pInfo){ static int addAggInfoFunc(sqlite3 *db, AggInfo *pInfo){ int i; pInfo->aFunc = sqlite3ArrayAllocate( - db, + db, pInfo->aFunc, sizeof(pInfo->aFunc[0]), &pInfo->nFunc, &i ); return i; -} +} /* ** This is the xExprCallback for a tree walker. It is used to @@ -95563,7 +95563,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){ assert( !ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced) ); if( pExpr->iTable==pItem->iCursor ){ /* If we reach this point, it means that pExpr refers to a table - ** that is in the FROM clause of the aggregate query. + ** that is in the FROM clause of the aggregate query. ** ** Make an entry for the column in pAggInfo->aCol[] if there ** is not an entry there already. @@ -95577,7 +95577,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){ } } if( (k>=pAggInfo->nColumn) - && (k = addAggInfoColumn(pParse->db, pAggInfo))>=0 + && (k = addAggInfoColumn(pParse->db, pAggInfo))>=0 ){ pCol = &pAggInfo->aCol[k]; pCol->pTab = pExpr->pTab; @@ -95623,7 +95623,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){ if( (pNC->ncFlags & NC_InAggFunc)==0 && pWalker->walkerDepth==pExpr->op2 ){ - /* Check to see if pExpr is a duplicate of another aggregate + /* Check to see if pExpr is a duplicate of another aggregate ** function that is already in the pAggInfo structure */ struct AggInfo_func *pItem = pAggInfo->aFunc; @@ -95644,7 +95644,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){ pItem->iMem = ++pParse->nMem; assert( !ExprHasProperty(pExpr, EP_IntValue) ); pItem->pFunc = sqlite3FindFunction(pParse->db, - pExpr->u.zToken, + pExpr->u.zToken, pExpr->x.pList ? pExpr->x.pList->nExpr : 0, enc, 0); if( pExpr->flags & EP_Distinct ){ pItem->iDistinct = pParse->nTab++; @@ -95827,9 +95827,9 @@ SQLITE_PRIVATE int sqlite3NoTempsInRange(Parse *pParse, int iFirst, int iLast){ /* -** This function is used by SQL generated to implement the +** This function is used by SQL generated to implement the ** ALTER TABLE command. The first argument is the text of a CREATE TABLE or -** CREATE INDEX command. The second is a table name. The table name in +** CREATE INDEX command. The second is a table name. The table name in ** the CREATE TABLE or CREATE INDEX statement is replaced with the third ** argument and the result returned. Examples: ** @@ -95857,7 +95857,7 @@ static void renameTableFunc( UNUSED_PARAMETER(NotUsed); - /* The principle used to locate the table name in the CREATE TABLE + /* The principle used to locate the table name in the CREATE TABLE ** statement is that the table name is the first non-space token that ** is immediately followed by a TK_LP or TK_USING token. */ @@ -95891,7 +95891,7 @@ static void renameTableFunc( /* ** This C function implements an SQL user function that is used by SQL code ** generated by the ALTER TABLE ... RENAME command to modify the definition -** of any foreign key constraints that use the table being renamed as the +** of any foreign key constraints that use the table being renamed as the ** parent table. It is passed three arguments: ** ** 1) The complete text of the CREATE TABLE statement being modified, @@ -95936,7 +95936,7 @@ static void renameParentFunc( if( zParent==0 ) break; sqlite3Dequote(zParent); if( 0==sqlite3StrICmp((const char *)zOld, zParent) ){ - char *zOut = sqlite3MPrintf(db, "%s%.*s\"%w\"", + char *zOut = sqlite3MPrintf(db, "%s%.*s\"%w\"", (zOutput?zOutput:""), (int)(z-zInput), zInput, (const char *)zNew ); sqlite3DbFree(db, zOutput); @@ -95947,7 +95947,7 @@ static void renameParentFunc( } } - zResult = sqlite3MPrintf(db, "%s%s", (zOutput?zOutput:""), zInput), + zResult = sqlite3MPrintf(db, "%s%s", (zOutput?zOutput:""), zInput), sqlite3_result_text(context, zResult, -1, SQLITE_DYNAMIC); sqlite3DbFree(db, zOutput); } @@ -95955,9 +95955,9 @@ static void renameParentFunc( #ifndef SQLITE_OMIT_TRIGGER /* This function is used by SQL generated to implement the -** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER -** statement. The second is a table name. The table name in the CREATE -** TRIGGER statement is replaced with the third argument and the result +** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER +** statement. The second is a table name. The table name in the CREATE +** TRIGGER statement is replaced with the third argument and the result ** returned. This is analagous to renameTableFunc() above, except for CREATE ** TRIGGER, not CREATE INDEX and CREATE TABLE. */ @@ -95979,7 +95979,7 @@ static void renameTriggerFunc( UNUSED_PARAMETER(NotUsed); - /* The principle used to locate the table name in the CREATE TRIGGER + /* The principle used to locate the table name in the CREATE TRIGGER ** statement is that the table name is the first token that is immediately ** preceded by either TK_ON or TK_DOT and immediately followed by one ** of TK_WHEN, TK_BEGIN or TK_FOR. @@ -96006,12 +96006,12 @@ static void renameTriggerFunc( assert( len>0 ); /* Variable 'dist' stores the number of tokens read since the most - ** recent TK_DOT or TK_ON. This means that when a WHEN, FOR or BEGIN + ** recent TK_DOT or TK_ON. This means that when a WHEN, FOR or BEGIN ** token is read and 'dist' equals 2, the condition stated above ** to be met. ** ** Note that ON cannot be a database, table or column name, so - ** there is no need to worry about syntax like + ** there is no need to worry about syntax like ** "CREATE TRIGGER ... ON ON.ON BEGIN ..." etc. */ dist++; @@ -96051,16 +96051,16 @@ SQLITE_PRIVATE void sqlite3AlterFunctions(void){ ** ** name= OR name= OR ... ** -** If argument zWhere is NULL, then a pointer string containing the text +** If argument zWhere is NULL, then a pointer string containing the text ** "name=" is returned, where is the quoted version ** of the string passed as argument zConstant. The returned buffer is ** allocated using sqlite3DbMalloc(). It is the responsibility of the ** caller to ensure that it is eventually freed. ** -** If argument zWhere is not NULL, then the string returned is +** If argument zWhere is not NULL, then the string returned is ** " OR name=", where is the contents of zWhere. ** In this case zWhere is passed to sqlite3DbFree() before returning. -** +** */ static char *whereOrName(sqlite3 *db, char *zWhere, char *zConstant){ char *zNew; @@ -96093,7 +96093,7 @@ static char *whereForeignKeys(Parse *pParse, Table *pTab){ /* ** Generate the text of a WHERE expression which can be used to select all ** temporary triggers on table pTab from the sqlite_temp_master table. If -** table pTab has no temporary triggers, or is itself stored in the +** table pTab has no temporary triggers, or is itself stored in the ** temporary database, NULL is returned. */ static char *whereTempTriggers(Parse *pParse, Table *pTab){ @@ -96101,9 +96101,9 @@ static char *whereTempTriggers(Parse *pParse, Table *pTab){ char *zWhere = 0; const Schema *pTempSchema = pParse->db->aDb[1].pSchema; /* Temp db schema */ - /* If the table is not located in the temp-db (in which case NULL is + /* If the table is not located in the temp-db (in which case NULL is ** returned, loop through the tables list of triggers. For each trigger - ** that is not part of the temp-db schema, add a clause to the WHERE + ** that is not part of the temp-db schema, add a clause to the WHERE ** expression being built up in zWhere. */ if( pTab->pSchema!=pTempSchema ){ @@ -96127,7 +96127,7 @@ static char *whereTempTriggers(Parse *pParse, Table *pTab){ ** pTab from the database, including triggers and temporary triggers. ** Argument zName is the name of the table in the database schema at ** the time the generated code is executed. This can be different from -** pTab->zName if this function is being called to code part of an +** pTab->zName if this function is being called to code part of an ** "ALTER TABLE RENAME TO" statement. */ static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){ @@ -96162,8 +96162,8 @@ static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){ sqlite3VdbeAddParseSchemaOp(v, iDb, zWhere); #ifndef SQLITE_OMIT_TRIGGER - /* Now, if the table is not stored in the temp database, reload any temp - ** triggers. Don't use IN(...) in case SQLITE_OMIT_SUBQUERY is defined. + /* Now, if the table is not stored in the temp database, reload any temp + ** triggers. Don't use IN(...) in case SQLITE_OMIT_SUBQUERY is defined. */ if( (zWhere=whereTempTriggers(pParse, pTab))!=0 ){ sqlite3VdbeAddParseSchemaOp(v, 1, zWhere); @@ -96188,8 +96188,8 @@ static int isSystemTable(Parse *pParse, const char *zName){ } /* -** Generate code to implement the "ALTER TABLE xxx RENAME TO yyy" -** command. +** Generate code to implement the "ALTER TABLE xxx RENAME TO yyy" +** command. */ SQLITE_PRIVATE void sqlite3AlterRenameTable( Parse *pParse, /* Parser context. */ @@ -96199,7 +96199,7 @@ SQLITE_PRIVATE void sqlite3AlterRenameTable( int iDb; /* Database that contains the table */ char *zDb; /* Name of database iDb */ Table *pTab; /* Table being renamed */ - char *zName = 0; /* NULL-terminated version of pName */ + char *zName = 0; /* NULL-terminated version of pName */ sqlite3 *db = pParse->db; /* Database connection */ int nTabName; /* Number of UTF-8 characters in zTabName */ const char *zTabName; /* Original name of the table */ @@ -96210,7 +96210,7 @@ SQLITE_PRIVATE void sqlite3AlterRenameTable( VTable *pVTab = 0; /* Non-zero if this is a v-tab with an xRename() */ int savedDbFlags; /* Saved value of db->flags */ - savedDbFlags = db->flags; + savedDbFlags = db->flags; if( NEVER(db->mallocFailed) ) goto exit_rename_table; assert( pSrc->nSrc==1 ); assert( sqlite3BtreeHoldsAllMutexes(pParse->db) ); @@ -96229,7 +96229,7 @@ SQLITE_PRIVATE void sqlite3AlterRenameTable( ** in database iDb. If so, this is an error. */ if( sqlite3FindTable(db, zName, zDb) || sqlite3FindIndex(db, zName, zDb) ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "there is already another table or index with this name: %s", zName); goto exit_rename_table; } @@ -96270,7 +96270,7 @@ SQLITE_PRIVATE void sqlite3AlterRenameTable( } #endif - /* Begin a transaction for database iDb. + /* Begin a transaction for database iDb. ** Then modify the schema cookie (since the ALTER TABLE modifies the ** schema). Open a statement transaction if the table is a virtual ** table. @@ -96302,11 +96302,11 @@ SQLITE_PRIVATE void sqlite3AlterRenameTable( #if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER) if( db->flags&SQLITE_ForeignKeys ){ - /* If foreign-key support is enabled, rewrite the CREATE TABLE + /* If foreign-key support is enabled, rewrite the CREATE TABLE ** statements corresponding to all child tables of foreign key constraints ** for which the renamed table is the parent table. */ if( (zWhere=whereForeignKeys(pParse, pTab))!=0 ){ - sqlite3NestedParse(pParse, + sqlite3NestedParse(pParse, "UPDATE \"%w\".%s SET " "sql = sqlite_rename_parent(sql, %Q, %Q) " "WHERE %s;", zDb, MASTER_NAME, zTabName, zName, zWhere); @@ -96332,8 +96332,8 @@ SQLITE_PRIVATE void sqlite3AlterRenameTable( "'sqlite_autoindex_' || %Q || substr(name,%d+18) " "ELSE name END " "WHERE tbl_name=%Q COLLATE nocase AND " - "(type='table' OR type='index' OR type='trigger');", - zDb, MASTER_NAME, zName, zName, zName, + "(type='table' OR type='index' OR type='trigger');", + zDb, MASTER_NAME, zName, zName, zName, #ifndef SQLITE_OMIT_TRIGGER zName, #endif @@ -96341,7 +96341,7 @@ SQLITE_PRIVATE void sqlite3AlterRenameTable( ); #ifndef SQLITE_OMIT_AUTOINCREMENT - /* If the sqlite_sequence table exists in this database, then update + /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ if( sqlite3FindTable(db, "sqlite_sequence", zDb) ){ @@ -96357,7 +96357,7 @@ SQLITE_PRIVATE void sqlite3AlterRenameTable( ** the temp database. */ if( (zWhere=whereTempTriggers(pParse, pTab))!=0 ){ - sqlite3NestedParse(pParse, + sqlite3NestedParse(pParse, "UPDATE sqlite_temp_master SET " "sql = sqlite_rename_trigger(sql, %Q), " "tbl_name = %Q " @@ -96430,7 +96430,7 @@ SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ } #endif - /* If the default value for the new column was specified with a + /* If the default value for the new column was specified with a ** literal NULL, then set pDflt to 0. This simplifies checking ** for an SQL NULL default below. */ @@ -96452,12 +96452,12 @@ SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ return; } if( (db->flags&SQLITE_ForeignKeys) && pNew->pFKey && pDflt ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "Cannot add a REFERENCES column with non-NULL default value"); return; } if( pCol->notNull && !pDflt ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "Cannot add a NOT NULL column with default value NULL"); return; } @@ -96490,10 +96490,10 @@ SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ *zEnd-- = '\0'; } db->flags |= SQLITE_PreferBuiltin; - sqlite3NestedParse(pParse, + sqlite3NestedParse(pParse, "UPDATE \"%w\".%s SET " "sql = substr(sql,1,%d) || ', ' || %Q || substr(sql,%d) " - "WHERE type = 'table' AND name = %Q", + "WHERE type = 'table' AND name = %Q", zDb, MASTER_NAME, pNew->addColOffset, zCol, pNew->addColOffset+1, zTab ); @@ -96520,14 +96520,14 @@ SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ /* ** This function is called by the parser after the table-name in -** an "ALTER TABLE ADD" statement is parsed. Argument +** an "ALTER TABLE ADD" statement is parsed. Argument ** pSrc is the full-name of the table being altered. ** ** This routine makes a (partial) copy of the Table structure ** for the table being altered and sets Parse.pNewTable to point ** to it. Routines called by the parser as the column definition -** is parsed (i.e. sqlite3AddColumn()) add the new Column data to -** the copy. The copy of the Table structure is deleted by tokenize.c +** is parsed (i.e. sqlite3AddColumn()) add the new Column data to +** the copy. The copy of the Table structure is deleted by tokenize.c ** after parsing is finished. ** ** Routine sqlite3AlterFinishAddColumn() will be called to complete @@ -96665,7 +96665,7 @@ exit_begin_add_column: ** integer is the average number of rows in the index that have the same ** value in the first column of the index. The third integer is the average ** number of rows in the index that have the same value for the first two -** columns. The N-th integer (for N>1) is the average number of rows in +** columns. The N-th integer (for N>1) is the average number of rows in ** the index which have the same value for the first N-1 columns. For ** a K-column index, there will be K+1 integers in the stat column. If ** the index is unique, then the last integer will be 1. @@ -96675,7 +96675,7 @@ exit_begin_add_column: ** must be separated from the last integer by a single space. If the ** "unordered" keyword is present, then the query planner assumes that ** the index is unordered and will not use the index for a range query. -** +** ** If the sqlite_stat1.idx column is NULL, then the sqlite_stat1.stat ** column contains a single integer which is the (estimated) number of ** rows in the table identified by sqlite_stat1.tbl. @@ -96733,9 +96733,9 @@ exit_begin_add_column: ** number of entries that are strictly less than the sample. The first ** integer in nLt contains the number of entries in the index where the ** left-most column is less than the left-most column of the sample. -** The K-th integer in the nLt entry is the number of index entries +** The K-th integer in the nLt entry is the number of index entries ** where the first K columns are less than the first K columns of the -** sample. The nDLt column is like nLt except that it contains the +** sample. The nDLt column is like nLt except that it contains the ** number of distinct entries in the index that are less than the ** sample. ** @@ -96828,9 +96828,9 @@ static void openStatTable( Table *pStat; if( (pStat = sqlite3FindTable(db, zTab, pDb->zDbSName))==0 ){ if( aTable[i].zCols ){ - /* The sqlite_statN table does not exist. Create it. Note that a - ** side-effect of the CREATE TABLE statement is to leave the rootpage - ** of the new table in register pParse->regRoot. This is important + /* The sqlite_statN table does not exist. Create it. Note that a + ** side-effect of the CREATE TABLE statement is to leave the rootpage + ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ sqlite3NestedParse(pParse, "CREATE TABLE %Q.%s(%s)", pDb->zDbSName, zTab, aTable[i].zCols @@ -96839,7 +96839,7 @@ static void openStatTable( aCreateTbl[i] = OPFLAG_P2ISREG; } }else{ - /* The table already exists. If zWhere is not NULL, delete all entries + /* The table already exists. If zWhere is not NULL, delete all entries ** associated with the table zWhere. If zWhere is NULL, delete the ** entire contents of the table. */ aRoot[i] = pStat->tnum; @@ -96894,7 +96894,7 @@ struct Stat4Sample { int iCol; /* If !isPSample, the reason for inclusion */ u32 iHash; /* Tiebreaker hash */ #endif -}; +}; struct Stat4Accum { tRowcnt nRow; /* Number of rows in the entire table */ tRowcnt nPSample; /* How often to do a periodic sample */ @@ -97002,7 +97002,7 @@ static void stat4Destructor(void *pOld){ ** PRIMARY KEY of the table. The covering index that implements the ** original WITHOUT ROWID table as N==K as a special case. ** -** This routine allocates the Stat4Accum object in heap memory. The return +** This routine allocates the Stat4Accum object in heap memory. The return ** value is a pointer to the Stat4Accum object. The datatype of the ** return value is BLOB, but it is really just a pointer to the Stat4Accum ** object. @@ -97032,7 +97032,7 @@ static void statInit( assert( nKeyCol>0 ); /* Allocate the space required for the Stat4Accum object */ - n = sizeof(*p) + n = sizeof(*p) + sizeof(tRowcnt)*nColUp /* Stat4Accum.anEq */ + sizeof(tRowcnt)*nColUp /* Stat4Accum.anDLt */ #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 @@ -97065,7 +97065,7 @@ static void statInit( p->nPSample = (tRowcnt)(sqlite3_value_int64(argv[2])/(mxSample/3+1) + 1); p->current.anLt = &p->current.anEq[nColUp]; p->iPrn = 0x689e962d*(u32)nCol ^ 0xd0944565*(u32)sqlite3_value_int(argv[2]); - + /* Set up the Stat4Accum.a[] and aBest[] arrays */ p->a = (struct Stat4Sample*)&p->current.anLt[nColUp]; p->aBest = &p->a[mxSample]; @@ -97076,7 +97076,7 @@ static void statInit( p->a[i].anDLt = (tRowcnt *)pSpace; pSpace += (sizeof(tRowcnt) * nColUp); } assert( (pSpace - (u8*)p)==n ); - + for(i=0; iaBest[i].iCol = i; } @@ -97102,19 +97102,19 @@ static const FuncDef statInitFuncdef = { #ifdef SQLITE_ENABLE_STAT4 /* -** pNew and pOld are both candidate non-periodic samples selected for -** the same column (pNew->iCol==pOld->iCol). Ignoring this column and +** pNew and pOld are both candidate non-periodic samples selected for +** the same column (pNew->iCol==pOld->iCol). Ignoring this column and ** considering only any trailing columns and the sample hash value, this ** function returns true if sample pNew is to be preferred over pOld. ** In other words, if we assume that the cardinalities of the selected ** column for pNew and pOld are equal, is pNew to be preferred over pOld. ** ** This function assumes that for each argument sample, the contents of -** the anEq[] array from pSample->anEq[pSample->iCol+1] onwards are valid. +** the anEq[] array from pSample->anEq[pSample->iCol+1] onwards are valid. */ static int sampleIsBetterPost( - Stat4Accum *pAccum, - Stat4Sample *pNew, + Stat4Accum *pAccum, + Stat4Sample *pNew, Stat4Sample *pOld ){ int nCol = pAccum->nCol; @@ -97134,11 +97134,11 @@ static int sampleIsBetterPost( ** Return true if pNew is to be preferred over pOld. ** ** This function assumes that for each argument sample, the contents of -** the anEq[] array from pSample->anEq[pSample->iCol] onwards are valid. +** the anEq[] array from pSample->anEq[pSample->iCol] onwards are valid. */ static int sampleIsBetter( - Stat4Accum *pAccum, - Stat4Sample *pNew, + Stat4Accum *pAccum, + Stat4Sample *pNew, Stat4Sample *pOld ){ tRowcnt nEqNew = pNew->anEq[pNew->iCol]; @@ -97174,7 +97174,7 @@ static void sampleInsert(Stat4Accum *p, Stat4Sample *pNew, int nEqZero){ Stat4Sample *pUpgrade = 0; assert( pNew->anEq[pNew->iCol]>0 ); - /* This sample is being added because the prefix that ends in column + /* This sample is being added because the prefix that ends in column ** iCol occurs many times in the table. However, if we have already ** added a sample that shares this prefix, there is no need to add ** this one. Instead, upgrade the priority of the highest priority @@ -97218,7 +97218,7 @@ static void sampleInsert(Stat4Accum *p, Stat4Sample *pNew, int nEqZero){ ** for the last sample in the p->a[] array. Otherwise, the samples would ** be out of order. */ #ifdef SQLITE_ENABLE_STAT4 - assert( p->nSample==0 + assert( p->nSample==0 || pNew->anLt[p->nCol-1] > p->a[p->nSample-1].anLt[p->nCol-1] ); #endif @@ -97286,11 +97286,11 @@ static void samplePushPrevious(Stat4Accum *p, int iChng){ p->current.isPSample = 1; sampleInsert(p, &p->current, 0); p->current.isPSample = 0; - }else + }else /* Or if it is a non-periodic sample. Add it in this case too. */ - if( p->nSamplemxSample - || sampleIsBetter(p, &p->current, &p->a[p->iMin]) + if( p->nSamplemxSample + || sampleIsBetter(p, &p->current, &p->a[p->iMin]) ){ sampleInsert(p, &p->current, 0); } @@ -97434,9 +97434,9 @@ static void statGet( /* STAT3 and STAT4 have a parameter on this routine. */ int eCall = sqlite3_value_int(argv[1]); assert( argc==2 ); - assert( eCall==STAT_GET_STAT1 || eCall==STAT_GET_NEQ + assert( eCall==STAT_GET_STAT1 || eCall==STAT_GET_NEQ || eCall==STAT_GET_ROWID || eCall==STAT_GET_NLT - || eCall==STAT_GET_NDLT + || eCall==STAT_GET_NDLT ); if( eCall==STAT_GET_STAT1 ) #else @@ -97446,20 +97446,20 @@ static void statGet( /* Return the value to store in the "stat" column of the sqlite_stat1 ** table for this index. ** - ** The value is a string composed of a list of integers describing - ** the index. The first integer in the list is the total number of - ** entries in the index. There is one additional integer in the list + ** The value is a string composed of a list of integers describing + ** the index. The first integer in the list is the total number of + ** entries in the index. There is one additional integer in the list ** for each indexed column. This additional integer is an estimate of ** the number of rows matched by a stabbing query on the index using ** a key with the corresponding number of fields. In other words, - ** if the index is on columns (a,b) and the sqlite_stat1 value is + ** if the index is on columns (a,b) and the sqlite_stat1 value is ** "100 10 2", then SQLite estimates that: ** ** * the index contains 100 rows, ** * "WHERE a=?" matches 10 rows, and ** * "WHERE a=? AND b=?" matches 2 rows. ** - ** If D is the count of distinct values and K is the total number of + ** If D is the count of distinct values and K is the total number of ** rows, then each estimate is computed as: ** ** I = (K+D-1)/D @@ -97509,7 +97509,7 @@ static void statGet( case STAT_GET_NEQ: aCnt = p->a[p->iGet].anEq; break; case STAT_GET_NLT: aCnt = p->a[p->iGet].anLt; break; default: { - aCnt = p->a[p->iGet].anDLt; + aCnt = p->a[p->iGet].anDLt; p->iGet++; break; } @@ -97621,7 +97621,7 @@ static void analyzeOneTable( } #endif - /* Establish a read-lock on the table at the shared-cache level. + /* Establish a read-lock on the table at the shared-cache level. ** Open a read-only cursor on the table. Also allocate a cursor number ** to use for scanning indexes (iIdxCur). No index cursor is opened at ** this time though. */ @@ -97687,9 +97687,9 @@ static void analyzeOneTable( ** end_of_scan: */ - /* Make sure there are enough memory cells allocated to accommodate + /* Make sure there are enough memory cells allocated to accommodate ** the regPrev array and a trailing rowid (the rowid slot is required - ** when building a record to insert into the sample column of + ** when building a record to insert into the sample column of ** the sqlite_stat4 table. */ pParse->nMem = MAX(pParse->nMem, regPrev+nColTest); @@ -97700,7 +97700,7 @@ static void analyzeOneTable( VdbeComment((v, "%s", pIdx->zName)); /* Invoke the stat_init() function. The arguments are: - ** + ** ** (1) the number of columns in the index including the rowid ** (or for a WITHOUT ROWID table, the number of PK columns), ** (2) the number of columns in the key without the rowid/pk @@ -97751,7 +97751,7 @@ static void analyzeOneTable( addrNextRow = sqlite3VdbeCurrentAddr(v); if( nColTest==1 && pIdx->nKeyCol==1 && IsUniqueIndex(pIdx) ){ /* For a single-column UNIQUE index, once we have found a non-NULL - ** row, we know that all the rest will be distinct, so skip + ** row, we know that all the rest will be distinct, so skip ** subsequent distinctness tests. */ sqlite3VdbeAddOp2(v, OP_NotNull, regPrev, endDistinctTest); VdbeCoverage(v); @@ -97760,15 +97760,15 @@ static void analyzeOneTable( char *pColl = (char*)sqlite3LocateCollSeq(pParse, pIdx->azColl[i]); sqlite3VdbeAddOp2(v, OP_Integer, i, regChng); sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regTemp); - aGotoChng[i] = + aGotoChng[i] = sqlite3VdbeAddOp4(v, OP_Ne, regTemp, 0, regPrev+i, pColl, P4_COLLSEQ); sqlite3VdbeChangeP5(v, SQLITE_NULLEQ); VdbeCoverage(v); } sqlite3VdbeAddOp2(v, OP_Integer, nColTest, regChng); sqlite3VdbeGoto(v, endDistinctTest); - - + + /* ** chng_addr_0: ** regPrev(0) = idx(0) @@ -97784,7 +97784,7 @@ static void analyzeOneTable( sqlite3VdbeResolveLabel(v, endDistinctTest); sqlite3DbFree(db, aGotoChng); } - + /* ** chng_addr_N: ** regRowid = idx(rowid) // STAT34 only @@ -98016,7 +98016,7 @@ SQLITE_PRIVATE void sqlite3Analyze(Parse *pParse, Token *pName1, Token *pName2){ } sqlite3DbFree(db, z); } - } + } } v = sqlite3GetVdbe(pParse); if( v ) sqlite3VdbeAddOp0(v, OP_Expire); @@ -98099,7 +98099,7 @@ static void decodeIntArray( /* ** This callback is invoked once for each index when reading the -** sqlite_stat1 table. +** sqlite_stat1 table. ** ** argv[0] = name of the table ** argv[1] = name of the index (might be NULL) @@ -98137,7 +98137,7 @@ static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){ tRowcnt *aiRowEst = 0; int nCol = pIndex->nKeyCol+1; #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 - /* Index.aiRowEst may already be set here if there are duplicate + /* Index.aiRowEst may already be set here if there are duplicate ** sqlite_stat1 entries for this index. In that case just clobber ** the old data with the new instead of allocating a new array. */ if( pIndex->aiRowEst==0 ){ @@ -98189,7 +98189,7 @@ SQLITE_PRIVATE void sqlite3DeleteIndexSamples(sqlite3 *db, Index *pIdx){ #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 /* ** Populate the pIdx->aAvgEq[] array based on the samples currently -** stored in pIdx->aSample[]. +** stored in pIdx->aSample[]. */ static void initAvgEq(Index *pIdx){ if( pIdx ){ @@ -98225,12 +98225,12 @@ static void initAvgEq(Index *pIdx){ pIdx->nRowEst0 = nRow; /* Set nSum to the number of distinct (iCol+1) field prefixes that - ** occur in the stat4 table for this index. Set sumEq to the sum of - ** the nEq values for column iCol for the same set (adding the value + ** occur in the stat4 table for this index. Set sumEq to the sum of + ** the nEq values for column iCol for the same set (adding the value ** only once where there exist duplicate prefixes). */ for(i=0; inSample-1) - || aSample[i].anDLt[iCol]!=aSample[i+1].anDLt[iCol] + || aSample[i].anDLt[iCol]!=aSample[i+1].anDLt[iCol] ){ sumEq += aSample[i].anEq[iCol]; nSum100 += 100; @@ -98264,7 +98264,7 @@ static Index *findIndexOrPrimaryKey( } /* -** Load the content from either the sqlite_stat4 or sqlite_stat3 table +** Load the content from either the sqlite_stat4 or sqlite_stat3 table ** into the relevant Index.aSample[] arrays. ** ** Arguments zSql1 and zSql2 must point to SQL statements that return @@ -98363,7 +98363,7 @@ static int loadStatTbl( if( zIndex==0 ) continue; pIdx = findIndexOrPrimaryKey(db, zIndex, zDb); if( pIdx==0 ) continue; - /* This next condition is true if data has already been loaded from + /* This next condition is true if data has already been loaded from ** the sqlite_stat4 table. In this case ignore stat3 data. */ nCol = pIdx->nSampleCol; if( bStat3 && nCol>1 ) continue; @@ -98399,7 +98399,7 @@ static int loadStatTbl( } /* -** Load content from the sqlite_stat4 and sqlite_stat3 tables into +** Load content from the sqlite_stat4 and sqlite_stat3 tables into ** the Index.aSample[] arrays of all indices. */ static int loadStat4(sqlite3 *db, const char *zDb){ @@ -98408,7 +98408,7 @@ static int loadStat4(sqlite3 *db, const char *zDb){ assert( db->lookaside.bDisable ); if( sqlite3FindTable(db, "sqlite_stat4", zDb) ){ rc = loadStatTbl(db, 0, - "SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx", + "SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx", "SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4", zDb ); @@ -98416,7 +98416,7 @@ static int loadStat4(sqlite3 *db, const char *zDb){ if( rc==SQLITE_OK && sqlite3FindTable(db, "sqlite_stat3", zDb) ){ rc = loadStatTbl(db, 1, - "SELECT idx,count(*) FROM %Q.sqlite_stat3 GROUP BY idx", + "SELECT idx,count(*) FROM %Q.sqlite_stat3 GROUP BY idx", "SELECT idx,neq,nlt,ndlt,sqlite_record(sample) FROM %Q.sqlite_stat3", zDb ); @@ -98433,11 +98433,11 @@ static int loadStat4(sqlite3 *db, const char *zDb){ ** Index.aSample[] arrays. ** ** If the sqlite_stat1 table is not present in the database, SQLITE_ERROR -** is returned. In this case, even if SQLITE_ENABLE_STAT3/4 was defined -** during compilation and the sqlite_stat3/4 table is present, no data is +** is returned. In this case, even if SQLITE_ENABLE_STAT3/4 was defined +** during compilation and the sqlite_stat3/4 table is present, no data is ** read from it. ** -** If SQLITE_ENABLE_STAT3/4 was defined during compilation and the +** If SQLITE_ENABLE_STAT3/4 was defined during compilation and the ** sqlite_stat4 table is not present in the database, SQLITE_ERROR is ** returned. However, in this case, data is read from the sqlite_stat1 ** table (if it is present) before returning. @@ -98470,7 +98470,7 @@ SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){ sInfo.db = db; sInfo.zDatabase = db->aDb[iDb].zDbSName; if( sqlite3FindTable(db, "sqlite_stat1", sInfo.zDatabase)!=0 ){ - zSql = sqlite3MPrintf(db, + zSql = sqlite3MPrintf(db, "SELECT tbl,idx,stat FROM %Q.sqlite_stat1", sInfo.zDatabase); if( zSql==0 ){ rc = SQLITE_NOMEM_BKPT; @@ -98601,7 +98601,7 @@ static void attachFunc( ** * Specified database name already being used. */ if( db->nDb>=db->aLimit[SQLITE_LIMIT_ATTACHED]+2 ){ - zErrDyn = sqlite3MPrintf(db, "too many attached databases - max %d", + zErrDyn = sqlite3MPrintf(db, "too many attached databases - max %d", db->aLimit[SQLITE_LIMIT_ATTACHED] ); goto attach_error; @@ -98661,7 +98661,7 @@ static void attachFunc( if( !aNew->pSchema ){ rc = SQLITE_NOMEM_BKPT; }else if( aNew->pSchema->file_format && aNew->pSchema->enc!=ENC(db) ){ - zErrDyn = sqlite3MPrintf(db, + zErrDyn = sqlite3MPrintf(db, "attached databases must use the same text encoding as main database"); rc = SQLITE_ERROR; } @@ -98696,7 +98696,7 @@ static void attachFunc( zErrDyn = sqlite3DbStrDup(db, "Invalid key value"); rc = SQLITE_ERROR; break; - + case SQLITE_TEXT: case SQLITE_BLOB: nKey = sqlite3_value_bytes(argv[2]); @@ -98716,7 +98716,7 @@ static void attachFunc( #endif /* If the file was opened successfully, read the schema for the new database. - ** If this fails, or if opening the file failed, then close the file and + ** If this fails, or if opening the file failed, then close the file and ** remove the entry from the db->aDb[] array. i.e. put everything back the way ** we found it. */ @@ -98753,7 +98753,7 @@ static void attachFunc( } goto attach_error; } - + return; attach_error: @@ -98844,7 +98844,7 @@ static void codeAttach( memset(&sName, 0, sizeof(NameContext)); sName.pParse = pParse; - if( + if( SQLITE_OK!=(rc = resolveAttachExpr(&sName, pFilename)) || SQLITE_OK!=(rc = resolveAttachExpr(&sName, pDbname)) || SQLITE_OK!=(rc = resolveAttachExpr(&sName, pKey)) @@ -98880,14 +98880,14 @@ static void codeAttach( (char *)pFunc, P4_FUNCDEF); assert( pFunc->nArg==-1 || (pFunc->nArg&0xff)==pFunc->nArg ); sqlite3VdbeChangeP5(v, (u8)(pFunc->nArg)); - + /* Code an OP_Expire. For an ATTACH statement, set P1 to true (expire this ** statement only). For DETACH, set it to false (expire all existing ** statements). */ sqlite3VdbeAddOp1(v, OP_Expire, (type==SQLITE_ATTACH)); } - + attach_end: sqlite3ExprDelete(db, pFilename); sqlite3ExprDelete(db, pDbname); @@ -99232,10 +99232,10 @@ SQLITE_PRIVATE int sqlite3AuthReadCol( /* ** The pExpr should be a TK_COLUMN expression. The table referred to -** is in pTabList or else it is the NEW or OLD table of a trigger. +** is in pTabList or else it is the NEW or OLD table of a trigger. ** Check to see if it is OK to read this particular column. ** -** If the auth function returns SQLITE_IGNORE, change the TK_COLUMN +** If the auth function returns SQLITE_IGNORE, change the TK_COLUMN ** instruction into a TK_NULL. If the auth function returns SQLITE_DENY, ** then generate an error. */ @@ -99338,7 +99338,7 @@ SQLITE_PRIVATE int sqlite3AuthCheck( */ SQLITE_PRIVATE void sqlite3AuthContextPush( Parse *pParse, - AuthContext *pContext, + AuthContext *pContext, const char *zContext ){ assert( pParse ); @@ -99401,7 +99401,7 @@ struct TableLock { }; /* -** Record the fact that we want to lock a table at run-time. +** Record the fact that we want to lock a table at run-time. ** ** The table to be locked has root page iTab and is found in database iDb. ** A read or a write lock can be taken depending on isWritelock. @@ -99454,7 +99454,7 @@ SQLITE_PRIVATE void sqlite3TableLock( */ static void codeTableLocks(Parse *pParse){ int i; - Vdbe *pVdbe; + Vdbe *pVdbe; pVdbe = sqlite3GetVdbe(pParse); assert( pVdbe!=0 ); /* sqlite3GetVdbe cannot fail: VDBE already allocated */ @@ -99509,7 +99509,7 @@ SQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse){ ** vdbe program */ v = sqlite3GetVdbe(pParse); - assert( !pParse->isMultiWrite + assert( !pParse->isMultiWrite || sqlite3VdbeAssertMayAbort(v, pParse->mayAbort)); if( v ){ sqlite3VdbeAddOp0(v, OP_Halt); @@ -99531,7 +99531,7 @@ SQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse){ ** transaction on each used database and to verify the schema cookie ** on each used database. */ - if( db->mallocFailed==0 + if( db->mallocFailed==0 && (DbMaskNonZero(pParse->cookieMask) || pParse->pConstExpr) ){ int iDb, i; @@ -99561,8 +99561,8 @@ SQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse){ pParse->nVtabLock = 0; #endif - /* Once all the cookies have been verified and transactions opened, - ** obtain the required table-locks. This is a no-op unless the + /* Once all the cookies have been verified and transactions opened, + ** obtain the required table-locks. This is a no-op unless the ** shared-cache feature is enabled. */ codeTableLocks(pParse); @@ -99754,7 +99754,7 @@ SQLITE_PRIVATE Table *sqlite3LocateTable( ** sqlite3FixSrcList() for details. */ SQLITE_PRIVATE Table *sqlite3LocateTableItem( - Parse *pParse, + Parse *pParse, u32 flags, struct SrcList_item *p ){ @@ -99770,7 +99770,7 @@ SQLITE_PRIVATE Table *sqlite3LocateTableItem( } /* -** Locate the in-memory structure that describes +** Locate the in-memory structure that describes ** a particular index given the name of that index ** and the name of the database that contains the index. ** Return NULL if not found. @@ -99952,10 +99952,10 @@ SQLITE_PRIVATE void sqlite3DeleteColumnNames(sqlite3 *db, Table *pTable){ ** ** This routine just deletes the data structure. It does not unlink ** the table data structure from the hash table. But it does destroy -** memory structures of the indices and foreign keys associated with +** memory structures of the indices and foreign keys associated with ** the table. ** -** The db parameter is optional. It is needed if the Table object +** The db parameter is optional. It is needed if the Table object ** contains lookaside memory. (Table objects in the schema do not use ** lookaside memory, but some ephemeral Table objects do.) Or the ** db parameter can be used with db->pnBytesFreed to measure the memory @@ -99977,7 +99977,7 @@ static void SQLITE_NOINLINE deleteTable(sqlite3 *db, Table *pTable){ assert( pIndex->pSchema==pTable->pSchema || (IsVirtual(pTable) && pIndex->idxType!=SQLITE_IDXTYPE_APPDEF) ); if( (db==0 || db->pnBytesFreed==0) && !IsVirtual(pTable) ){ - char *zName = pIndex->zName; + char *zName = pIndex->zName; TESTONLY ( Index *pOld = ) sqlite3HashInsert( &pIndex->pSchema->idxHash, zName, 0 ); @@ -100092,7 +100092,7 @@ SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *db, const char *zName){ /* ** The token *pName contains the name of a database (either "main" or ** "temp" or the name of an attached db). This routine returns the -** index of the named database in db->aDb[], or -1 if the named db +** index of the named database in db->aDb[], or -1 if the named db ** does not exist. */ SQLITE_PRIVATE int sqlite3FindDb(sqlite3 *db, Token *pName){ @@ -100108,7 +100108,7 @@ SQLITE_PRIVATE int sqlite3FindDb(sqlite3 *db, Token *pName){ ** pName1 and pName2. If the table name was fully qualified, for example: ** ** CREATE TABLE xxx.yyy (...); -** +** ** Then pName1 is set to "xxx" and pName2 "yyy". On the other hand if ** the table name is not fully qualified, i.e.: ** @@ -100157,7 +100157,7 @@ SQLITE_PRIVATE int sqlite3TwoPartName( ** is reserved for internal use. */ SQLITE_PRIVATE int sqlite3CheckObjectName(Parse *pParse, const char *zName){ - if( !pParse->db->init.busy && pParse->nested==0 + if( !pParse->db->init.busy && pParse->nested==0 && (pParse->db->flags & SQLITE_WriteSchema)==0 && 0==sqlite3StrNICmp(zName, "sqlite_", 7) ){ sqlite3ErrorMsg(pParse, "object name reserved for internal use: %s", zName); @@ -100229,7 +100229,7 @@ SQLITE_PRIVATE void sqlite3StartTable( iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName); if( iDb<0 ) return; if( !OMIT_TEMPDB && isTemp && pName2->n>0 && iDb!=1 ){ - /* If creating a temp table, the name may not be qualified. Unless + /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ sqlite3ErrorMsg(pParse, "temporary table name must be unqualified"); return; @@ -100322,7 +100322,7 @@ SQLITE_PRIVATE void sqlite3StartTable( ** the SQLITE_MASTER table. Note in particular that we must go ahead ** and allocate the record number for the table entry now. Before any ** PRIMARY KEY or UNIQUE keywords are parsed. Those keywords will cause - ** indices to be created and the table record must come before the + ** indices to be created and the table record must come before the ** indices. Hence, the record number for the table must be allocated ** now. */ @@ -100340,7 +100340,7 @@ SQLITE_PRIVATE void sqlite3StartTable( } #endif - /* If the file format and encoding in the database have not been set, + /* If the file format and encoding in the database have not been set, ** set them now. */ reg1 = pParse->regRowid = ++pParse->nMem; @@ -100450,7 +100450,7 @@ SQLITE_PRIVATE void sqlite3AddColumn(Parse *pParse, Token *pName, Token *pType){ memset(pCol, 0, sizeof(p->aCol[0])); pCol->zName = z; sqlite3ColumnPropertiesFromName(p, pCol); - + if( pType->n==0 ){ /* If there is no type specified, columns have the default affinity ** 'BLOB'. */ @@ -100485,11 +100485,11 @@ SQLITE_PRIVATE void sqlite3AddNotNull(Parse *pParse, int onError){ ** Scan the column type name zType (length nType) and return the ** associated affinity type. ** -** This routine does a case-independent search of zType for the +** This routine does a case-independent search of zType for the ** substrings in the following table. If one of the substrings is ** found, the corresponding affinity is returned. If zType contains -** more than one of the substrings, entries toward the top of -** the table take priority. For example, if zType is 'BLOBINT', +** more than one of the substrings, entries toward the top of +** the table take priority. For example, if zType is 'BLOBINT', ** SQLITE_AFF_INTEGER is returned. ** ** Substring | Affinity @@ -100610,7 +100610,7 @@ SQLITE_PRIVATE void sqlite3AddDefaultValue(Parse *pParse, ExprSpan *pSpan){ /* ** Backwards Compatibility Hack: -** +** ** Historical versions of SQLite accepted strings as column names in ** indexes and PRIMARY KEY constraints and in UNIQUE constraints. Example: ** @@ -100633,7 +100633,7 @@ static void sqlite3StringToId(Expr *p){ } /* -** Designate the PRIMARY KEY for the table. pList is a list of names +** Designate the PRIMARY KEY for the table. pList is a list of names ** of columns that form the primary key. If pList is NULL, then the ** most recently added column of the table is the primary key. ** @@ -100663,7 +100663,7 @@ SQLITE_PRIVATE void sqlite3AddPrimaryKey( int nTerm; if( pTab==0 ) goto primary_key_exit; if( pTab->tabFlags & TF_HasPrimaryKey ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "table \"%s\" has more than one primary key", pTab->zName); goto primary_key_exit; } @@ -100761,7 +100761,7 @@ SQLITE_PRIVATE void sqlite3AddCollateType(Parse *pParse, Token *pToken){ Index *pIdx; sqlite3DbFree(db, p->aCol[i].zColl); p->aCol[i].zColl = zColl; - + /* If the column is declared as " PRIMARY KEY COLLATE ", ** then an index may have been created on this column before the ** collation type was added. Correct this if it is the case. @@ -100835,7 +100835,7 @@ SQLITE_PRIVATE void sqlite3ChangeCookie(Parse *pParse, int iDb){ sqlite3 *db = pParse->db; Vdbe *v = pParse->pVdbe; assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); - sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_SCHEMA_VERSION, + sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_SCHEMA_VERSION, db->aDb[iDb].pSchema->schema_cookie+1); } @@ -100856,13 +100856,13 @@ static int identLength(const char *z){ } /* -** The first parameter is a pointer to an output buffer. The second +** The first parameter is a pointer to an output buffer. The second ** parameter is a pointer to an integer that contains the offset at ** which to write into the output buffer. This function copies the ** nul-terminated string pointed to by the third parameter, zSignedIdent, ** to the specified offset in the buffer and updates *pIdx to refer ** to the first byte after the last byte written before returning. -** +** ** If the string zSignedIdent consists entirely of alpha-numeric ** characters, does not begin with a digit and is not an SQL keyword, ** then it is copied to the output buffer exactly as it is. Otherwise, @@ -100906,7 +100906,7 @@ static char *createTableStmt(sqlite3 *db, Table *p){ n += identLength(pCol->zName) + 5; } n += identLength(p->zName); - if( n<50 ){ + if( n<50 ){ zSep = ""; zSep2 = ","; zEnd = ")"; @@ -100947,10 +100947,10 @@ static char *createTableStmt(sqlite3 *db, Table *p){ testcase( pCol->affinity==SQLITE_AFF_NUMERIC ); testcase( pCol->affinity==SQLITE_AFF_INTEGER ); testcase( pCol->affinity==SQLITE_AFF_REAL ); - + zType = azType[pCol->affinity - SQLITE_AFF_BLOB]; len = sqlite3Strlen30(zType); - assert( pCol->affinity==SQLITE_AFF_BLOB + assert( pCol->affinity==SQLITE_AFF_BLOB || pCol->affinity==sqlite3AffinityType(zType, 0) ); memcpy(&zStmt[k], zType, len); k += len; @@ -101078,13 +101078,13 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){ } /* Locate the PRIMARY KEY index. Or, if this table was originally - ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. + ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. */ if( pTab->iPKey>=0 ){ ExprList *pList; Token ipkToken; sqlite3TokenInit(&ipkToken, pTab->aCol[pTab->iPKey].zName); - pList = sqlite3ExprListAppend(pParse, 0, + pList = sqlite3ExprListAppend(pParse, 0, sqlite3ExprAlloc(db, TK_ID, &ipkToken, 0)); if( pList==0 ) return; pList->a[0].sortOrder = pParse->iPkSortOrder; @@ -101189,7 +101189,7 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){ ** the sqlite_master table. We do not want to create it again. ** ** If the pSelect argument is not NULL, it means that this routine -** was called to create a table generated from a +** was called to create a table generated from a ** "CREATE TABLE ... AS SELECT ..." statement. The column names of ** the new table will match the result set of the SELECT. */ @@ -101277,7 +101277,7 @@ SQLITE_PRIVATE void sqlite3EndTable( sqlite3VdbeAddOp1(v, OP_Close, 0); - /* + /* ** Initialize zType for the new view or table. */ if( p->pSelect==0 ){ @@ -101355,12 +101355,12 @@ SQLITE_PRIVATE void sqlite3EndTable( Token *pEnd2 = tabOpts ? &pParse->sLastToken : pEnd; n = (int)(pEnd2->z - pParse->sNameToken.z); if( pEnd2->z[0]!=';' ) n += pEnd2->n; - zStmt = sqlite3MPrintf(db, + zStmt = sqlite3MPrintf(db, "CREATE %s %.*s", zType2, n, pParse->sNameToken.z ); } - /* A slot for the record has already been allocated in the + /* A slot for the record has already been allocated in the ** SQLITE_MASTER table. We just need to update that slot with all ** the information we've collected. */ @@ -101542,7 +101542,7 @@ SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){ ** Actually, the error above is now caught prior to reaching this point. ** But the following test is still important as it does come up ** in the following: - ** + ** ** CREATE TABLE main.ex1(a); ** CREATE TEMP VIEW ex1 AS SELECT a FROM ex1; ** SELECT * FROM temp.ex1; @@ -101583,9 +101583,9 @@ SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){ ** normally holds CHECK constraints on an ordinary table, but for ** a VIEW it holds the list of column names. */ - sqlite3ColumnsFromExprList(pParse, pTable->pCheck, + sqlite3ColumnsFromExprList(pParse, pTable->pCheck, &pTable->nCol, &pTable->aCol); - if( db->mallocFailed==0 + if( db->mallocFailed==0 && pParse->nErr==0 && pTable->nCol==pSel->pEList->nExpr ){ @@ -101613,7 +101613,7 @@ SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){ } pTable->pSchema->schemaFlags |= DB_UnresetViews; #endif /* SQLITE_OMIT_VIEW */ - return nErr; + return nErr; } #endif /* !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE) */ @@ -101649,7 +101649,7 @@ static void sqliteViewResetAll(sqlite3 *db, int idx){ ** on tables and/or indices that are the process of being deleted. ** If you are unlucky, one of those deleted indices or tables might ** have the same rootpage number as the real table or index that is -** being moved. So we cannot stop searching after the first match +** being moved. So we cannot stop searching after the first match ** because the first match might be for one of the deleted indices ** or tables and not the table/index that is actually being moved. ** We must continue looping until all tables and indices with @@ -101686,7 +101686,7 @@ SQLITE_PRIVATE void sqlite3RootPageMoved(sqlite3 *db, int iDb, int iFrom, int iT ** Also write code to modify the sqlite_master table and internal schema ** if a root-page of another table is moved by the btree-layer whilst ** erasing iTable (this can happen with an auto-vacuum database). -*/ +*/ static void destroyRootPage(Parse *pParse, int iTable, int iDb){ Vdbe *v = sqlite3GetVdbe(pParse); int r1 = sqlite3GetTempReg(pParse); @@ -101703,7 +101703,7 @@ static void destroyRootPage(Parse *pParse, int iTable, int iDb){ ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - sqlite3NestedParse(pParse, + sqlite3NestedParse(pParse, "UPDATE %Q.%s SET rootpage=%d WHERE #%d AND rootpage=#%d", pParse->db->aDb[iDb].zDbSName, MASTER_NAME, iTable, r1, r1); #endif @@ -101727,7 +101727,7 @@ static void destroyTable(Parse *pParse, Table *pTab){ #else /* If the database may be auto-vacuum capable (if SQLITE_OMIT_AUTOVACUUM ** is not defined), then it is important to call OP_Destroy on the - ** table and index root-pages in order, starting with the numerically + ** table and index root-pages in order, starting with the numerically ** largest root-page number. This guarantees that none of the root-pages ** to be destroyed is relocated by an earlier OP_Destroy. i.e. if the ** following were coded: @@ -101737,7 +101737,7 @@ static void destroyTable(Parse *pParse, Table *pTab){ ** OP_Destroy 5 0 ** ** and root page 5 happened to be the largest root-page number in the - ** database, then root page 5 would be moved to page 4 by the + ** database, then root page 5 would be moved to page 4 by the ** "OP_Destroy 4 0" opcode. The subsequent "OP_Destroy 5 0" would hit ** a free-list page. */ @@ -101819,7 +101819,7 @@ SQLITE_PRIVATE void sqlite3CodeDropTable(Parse *pParse, Table *pTab, int iDb, in */ pTrigger = sqlite3TriggerList(pParse, pTab); while( pTrigger ){ - assert( pTrigger->pSchema==pTab->pSchema || + assert( pTrigger->pSchema==pTab->pSchema || pTrigger->pSchema==db->aDb[1].pSchema ); sqlite3DropTriggerPtr(pParse, pTrigger); pTrigger = pTrigger->pNext; @@ -101846,7 +101846,7 @@ SQLITE_PRIVATE void sqlite3CodeDropTable(Parse *pParse, Table *pTab, int iDb, in ** created in the temp database that refers to a table in another ** database. */ - sqlite3NestedParse(pParse, + sqlite3NestedParse(pParse, "DELETE FROM %Q.%s WHERE tbl_name=%Q and type!='trigger'", pDb->zDbSName, MASTER_NAME, pTab->zName); if( !isView && !IsVirtual(pTab) ){ @@ -101933,7 +101933,7 @@ SQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, } } #endif - if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 + if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 && sqlite3StrNICmp(pTab->zName, "sqlite_stat", 11)!=0 ){ sqlite3ErrorMsg(pParse, "table %s may not be dropped", pTab->zName); goto exit_drop_table; @@ -102052,8 +102052,8 @@ SQLITE_PRIVATE void sqlite3CreateForeignKey( } } if( j>=p->nCol ){ - sqlite3ErrorMsg(pParse, - "unknown column \"%s\" in foreign key definition", + sqlite3ErrorMsg(pParse, + "unknown column \"%s\" in foreign key definition", pFromCol->a[i].zName); goto fk_end; } @@ -102073,7 +102073,7 @@ SQLITE_PRIVATE void sqlite3CreateForeignKey( pFKey->aAction[1] = (u8)((flags >> 8 ) & 0xff); /* ON UPDATE action */ assert( sqlite3SchemaMutexHeld(db, 0, p->pSchema) ); - pNextTo = (FKey *)sqlite3HashInsert(&p->pSchema->fkeyHash, + pNextTo = (FKey *)sqlite3HashInsert(&p->pSchema->fkeyHash, pFKey->zTo, (void *)pFKey ); if( pNextTo==pFKey ){ @@ -102178,7 +102178,7 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){ sqlite3VdbeAddOp2(v, OP_Next, iTab, addr1+1); VdbeCoverage(v); sqlite3VdbeJumpHere(v, addr1); if( memRootPage<0 ) sqlite3VdbeAddOp2(v, OP_Clear, tnum, iDb); - sqlite3VdbeAddOp4(v, OP_OpenWrite, iIdx, tnum, iDb, + sqlite3VdbeAddOp4(v, OP_OpenWrite, iIdx, tnum, iDb, (char *)pKey, P4_KEYINFO); sqlite3VdbeChangeP5(v, OPFLAG_BULKCSR|((memRootPage>=0)?OPFLAG_P2ISREG:0)); @@ -102242,8 +102242,8 @@ SQLITE_PRIVATE Index *sqlite3AllocateIndexObject( } /* -** Create a new index for an SQL table. pName1.pName2 is the name of the index -** and pTblList is the name of the table that is to be indexed. Both will +** Create a new index for an SQL table. pName1.pName2 is the name of the index +** and pTblList is the name of the table that is to be indexed. Both will ** be NULL for a primary key or an index that is created to satisfy a ** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable ** as the table to be indexed. pParse->pNewTable is a table that is @@ -102251,7 +102251,7 @@ SQLITE_PRIVATE Index *sqlite3AllocateIndexObject( ** ** pList is a list of columns to be indexed. pList will be NULL if this ** is a primary key or unique-constraint on the most recent column added -** to the table currently under construction. +** to the table currently under construction. */ SQLITE_PRIVATE void sqlite3CreateIndex( Parse *pParse, /* All information about this parse */ @@ -102298,7 +102298,7 @@ SQLITE_PRIVATE void sqlite3CreateIndex( */ if( pTblName!=0 ){ - /* Use the two-part index name to determine the database + /* Use the two-part index name to determine the database ** to search for the table. 'Fix' the table name to this db ** before looking up the table. */ @@ -102330,7 +102330,7 @@ SQLITE_PRIVATE void sqlite3CreateIndex( assert( db->mallocFailed==0 || pTab==0 ); if( pTab==0 ) goto exit_create_index; if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "cannot create a TEMP index on non-TEMP table \"%s\"", pTab->zName); goto exit_create_index; @@ -102347,7 +102347,7 @@ SQLITE_PRIVATE void sqlite3CreateIndex( assert( pTab!=0 ); assert( pParse->nErr==0 ); - if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 + if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 && db->init.busy==0 #if SQLITE_USER_AUTHENTICATION && sqlite3UserAuthTable(pTab->zName)==0 @@ -102371,7 +102371,7 @@ SQLITE_PRIVATE void sqlite3CreateIndex( /* ** Find the name of the index. Make sure there is not already another - ** index or table with the same name. + ** index or table with the same name. ** ** Exception: If we are reading the names of permanent indices from the ** sqlite_master table (because some other process changed the schema) and @@ -102464,8 +102464,8 @@ SQLITE_PRIVATE void sqlite3CreateIndex( } } - /* - ** Allocate the index structure. + /* + ** Allocate the index structure. */ nName = sqlite3Strlen30(zName); nExtraCol = pPk ? pPk->nKeyCol : 1; @@ -102576,7 +102576,7 @@ SQLITE_PRIVATE void sqlite3CreateIndex( int x = pPk->aiColumn[j]; assert( x>=0 ); if( hasColumn(pIndex->aiColumn, pIndex->nKeyCol, x) ){ - pIndex->nColumn--; + pIndex->nColumn--; }else{ pIndex->aiColumn[i] = x; pIndex->azColl[i] = pPk->azColl[j]; @@ -102594,7 +102594,7 @@ SQLITE_PRIVATE void sqlite3CreateIndex( /* If this index contains every column of its table, then mark ** it as a covering index */ - assert( HasRowid(pTab) + assert( HasRowid(pTab) || pTab->iPKey<0 || sqlite3ColumnOfIndex(pIndex, pTab->iPKey)>=0 ); if( pTblName!=0 && pIndex->nColumn>=pTab->nCol ){ pIndex->isCovering = 1; @@ -102649,13 +102649,13 @@ SQLITE_PRIVATE void sqlite3CreateIndex( if( pIdx->onError!=pIndex->onError ){ /* This constraint creates the same index as a previous ** constraint specified somewhere in the CREATE TABLE statement. - ** However the ON CONFLICT clauses are different. If both this + ** However the ON CONFLICT clauses are different. If both this ** constraint and the previous equivalent constraint have explicit ** ON CONFLICT clauses this is an error. Otherwise, use the ** explicitly specified behavior for the index. */ if( !(pIdx->onError==OE_Default || pIndex->onError==OE_Default) ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "conflicting ON CONFLICT clauses specified", 0); } if( pIdx->onError==OE_Default ){ @@ -102669,14 +102669,14 @@ SQLITE_PRIVATE void sqlite3CreateIndex( } /* Link the new Index structure to its table and to the other - ** in-memory database structures. + ** in-memory database structures. */ assert( pParse->nErr==0 ); if( db->init.busy ){ Index *p; assert( !IN_DECLARE_VTAB ); assert( sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) ); - p = sqlite3HashInsert(&pIndex->pSchema->idxHash, + p = sqlite3HashInsert(&pIndex->pSchema->idxHash, pIndex->zName, pIndex); if( p ){ assert( p==pIndex ); /* Malloc must have failed */ @@ -102713,9 +102713,9 @@ SQLITE_PRIVATE void sqlite3CreateIndex( sqlite3BeginWriteOperation(pParse, 1, iDb); /* Create the rootpage for the index using CreateIndex. But before - ** doing so, code a Noop instruction and store its address in - ** Index.tnum. This is required in case this index is actually a - ** PRIMARY KEY and the table is actually a WITHOUT ROWID table. In + ** doing so, code a Noop instruction and store its address in + ** Index.tnum. This is required in case this index is actually a + ** PRIMARY KEY and the table is actually a WITHOUT ROWID table. In ** that case the convertToWithoutRowidTable() routine will replace ** the Noop with a Goto to jump over the VDBE code generated below. */ pIndex->tnum = sqlite3VdbeAddOp0(v, OP_Noop); @@ -102738,7 +102738,7 @@ SQLITE_PRIVATE void sqlite3CreateIndex( /* Add an entry in sqlite_master for this index */ - sqlite3NestedParse(pParse, + sqlite3NestedParse(pParse, "INSERT INTO %Q.%s VALUES('index',%Q,%Q,#%d,%Q);", db->aDb[iDb].zDbSName, MASTER_NAME, pIndex->zName, @@ -102766,7 +102766,7 @@ SQLITE_PRIVATE void sqlite3CreateIndex( ** sure all indices labeled OE_Replace come after all those labeled ** OE_Ignore. This is necessary for the correct constraint check ** processing (in sqlite3GenerateConstraintChecks()) as part of - ** UPDATE and INSERT statements. + ** UPDATE and INSERT statements. */ if( db->init.busy || pTblName==0 ){ if( onError!=OE_Replace || pTab->pIndex==0 @@ -102818,7 +102818,7 @@ SQLITE_PRIVATE void sqlite3DefaultRowEst(Index *pIdx){ int nCopy = MIN(ArraySize(aVal), pIdx->nKeyCol); int i; - /* Set the first entry (number of rows in the index) to the estimated + /* Set the first entry (number of rows in the index) to the estimated ** number of rows in the table, or half the number of rows in the table ** for a partial index. But do not let the estimate drop below 10. */ a[0] = pIdx->pTable->nRowLogEst; @@ -103079,7 +103079,7 @@ SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge( ** database name prefix. Like this: "database.table". The pDatabase ** points to the table name and the pTable points to the database name. ** The SrcList.a[].zName field is filled with the table name which might -** come from pTable (if pDatabase is NULL) or from pDatabase. +** come from pTable (if pDatabase is NULL) or from pDatabase. ** SrcList.a[].zDatabase is filled with the database name from pTable, ** or with NULL if no database is specified. ** @@ -103205,7 +103205,7 @@ SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm( struct SrcList_item *pItem; sqlite3 *db = pParse->db; if( !p && (pOn || pUsing) ){ - sqlite3ErrorMsg(pParse, "a JOIN clause is required before %s", + sqlite3ErrorMsg(pParse, "a JOIN clause is required before %s", (pOn ? "ON" : "USING") ); goto append_from_error; @@ -103233,7 +103233,7 @@ SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm( } /* -** Add an INDEXED BY or NOT INDEXED clause to the most recently added +** Add an INDEXED BY or NOT INDEXED clause to the most recently added ** element of the source-list passed as the second argument. */ SQLITE_PRIVATE void sqlite3SrcListIndexedBy(Parse *pParse, SrcList *p, Token *pIndexedBy){ @@ -103244,7 +103244,7 @@ SQLITE_PRIVATE void sqlite3SrcListIndexedBy(Parse *pParse, SrcList *p, Token *pI assert( pItem->fg.isIndexedBy==0 ); assert( pItem->fg.isTabFunc==0 ); if( pIndexedBy->n==1 && !pIndexedBy->z ){ - /* A "NOT INDEXED" clause was supplied. See parse.y + /* A "NOT INDEXED" clause was supplied. See parse.y ** construct "indexed_opt" for details. */ pItem->fg.notIndexed = 1; }else{ @@ -103357,7 +103357,7 @@ SQLITE_PRIVATE void sqlite3RollbackTransaction(Parse *pParse){ /* ** This function is called by the parser when it parses a command to create, -** release or rollback an SQL savepoint. +** release or rollback an SQL savepoint. */ SQLITE_PRIVATE void sqlite3Savepoint(Parse *pParse, int op, Token *pName){ char *zName = sqlite3NameFromToken(pParse->db, pName); @@ -103384,7 +103384,7 @@ SQLITE_PRIVATE int sqlite3OpenTempDatabase(Parse *pParse){ if( db->aDb[1].pBt==0 && !pParse->explain ){ int rc; Btree *pBt; - static const int flags = + static const int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | @@ -103430,7 +103430,7 @@ SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse *pParse, int iDb){ } /* -** If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each +** If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each ** attached database. Otherwise, invoke it for the database named zDb only. */ SQLITE_PRIVATE void sqlite3CodeVerifyNamedSchema(Parse *pParse, const char *zDb){ @@ -103476,9 +103476,9 @@ SQLITE_PRIVATE void sqlite3MultiWrite(Parse *pParse){ pToplevel->isMultiWrite = 1; } -/* +/* ** The code generator calls this routine if is discovers that it is -** possible to abort a statement prior to completion. In order to +** possible to abort a statement prior to completion. In order to ** perform this abort without corrupting the database, we need to make ** sure that the statement is protected by a statement transaction. ** @@ -103487,7 +103487,7 @@ SQLITE_PRIVATE void sqlite3MultiWrite(Parse *pParse){ ** such that the abort must occur after the multiwrite. This makes ** some statements involving the REPLACE conflict resolution algorithm ** go a little faster. But taking advantage of this time dependency -** makes it more difficult to prove that the code is correct (in +** makes it more difficult to prove that the code is correct (in ** particular, it prevents us from writing an effective ** implementation of sqlite3AssertMayAbort()) and so we have chosen ** to take the safe route and skip the optimization. @@ -103545,8 +103545,8 @@ SQLITE_PRIVATE void sqlite3UniqueConstraint( } } zErr = sqlite3StrAccumFinish(&errMsg); - sqlite3HaltConstraint(pParse, - IsPrimaryKeyIndex(pIdx) ? SQLITE_CONSTRAINT_PRIMARYKEY + sqlite3HaltConstraint(pParse, + IsPrimaryKeyIndex(pIdx) ? SQLITE_CONSTRAINT_PRIMARYKEY : SQLITE_CONSTRAINT_UNIQUE, onError, zErr, P4_DYNAMIC, P5_ConstraintUnique); } @@ -103558,7 +103558,7 @@ SQLITE_PRIVATE void sqlite3UniqueConstraint( SQLITE_PRIVATE void sqlite3RowidConstraint( Parse *pParse, /* Parsing context */ int onError, /* Conflict resolution algorithm */ - Table *pTab /* The table with the non-unique rowid */ + Table *pTab /* The table with the non-unique rowid */ ){ char *zMsg; int rc; @@ -103737,9 +103737,9 @@ SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoOfIndex(Parse *pParse, Index *pIdx){ } #ifndef SQLITE_OMIT_CTE -/* -** This routine is invoked once per CTE by the parser while parsing a -** WITH clause. +/* +** This routine is invoked once per CTE by the parser while parsing a +** WITH clause. */ SQLITE_PRIVATE With *sqlite3WithAdd( Parse *pParse, /* Parsing context */ @@ -103808,7 +103808,7 @@ SQLITE_PRIVATE void sqlite3WithDelete(sqlite3 *db, With *pWith){ /************** End of build.c ***********************************************/ /************** Begin file callback.c ****************************************/ /* -** 2005 May 23 +** 2005 May 23 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: @@ -103878,8 +103878,8 @@ static int synthCollSeq(sqlite3 *db, CollSeq *pColl){ ** This function is responsible for invoking the collation factory callback ** or substituting a collation sequence of a different encoding when the ** requested collation sequence is not available in the desired encoding. -** -** If it is not NULL, then pColl must point to the database native encoding +** +** If it is not NULL, then pColl must point to the database native encoding ** collation sequence with name zName, length nName. ** ** The return value is either the collation sequence to be used in database @@ -103925,7 +103925,7 @@ SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq( ** that have not been defined by sqlite3_create_collation() etc. ** ** If required, this routine calls the 'collation needed' callback to -** request a definition of the collating sequence. If this doesn't work, +** request a definition of the collating sequence. If this doesn't work, ** an equivalent collating sequence that uses a text encoding different ** from the main database is substituted, if one is available. */ @@ -103980,7 +103980,7 @@ static CollSeq *findCollSeqEntry( pColl[0].zName[nName] = 0; pDel = sqlite3HashInsert(&db->aCollSeq, pColl[0].zName, pColl); - /* If a malloc() failure occurred in sqlite3HashInsert(), it will + /* If a malloc() failure occurred in sqlite3HashInsert(), it will ** return the pColl pointer to be deleted (because it wasn't added ** to the hash table). */ @@ -104038,7 +104038,7 @@ SQLITE_PRIVATE CollSeq *sqlite3FindCollSeq( ** 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 +** 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 ** @@ -104130,8 +104130,8 @@ SQLITE_PRIVATE void sqlite3InsertBuiltinFuncs( } } } - - + + /* ** Locate a user function given a name, a number of arguments and a flag @@ -104192,7 +104192,7 @@ SQLITE_PRIVATE FuncDef *sqlite3FindFunction( ** have fields overwritten with new information appropriate for the ** new function. But the FuncDefs for built-in functions are read-only. ** So we must not search for built-ins when creating a new function. - */ + */ if( !createFlag && (pBest==0 || (db->flags & SQLITE_PreferBuiltin)!=0) ){ bestScore = 0; h = (sqlite3UpperToLower[(u8)zName[0]] + nName) % SQLITE_FUNC_HASH_SZ; @@ -104211,7 +104211,7 @@ SQLITE_PRIVATE FuncDef *sqlite3FindFunction( ** exact match for the name, number of arguments and encoding, then add a ** new entry to the hash table and return it. */ - if( createFlag && bestScorezName = (const char*)&pBest[1]; @@ -104236,7 +104236,7 @@ SQLITE_PRIVATE FuncDef *sqlite3FindFunction( /* ** Free all resources held by the schema structure. The void* argument points -** at a Schema struct. This function does not call sqlite3DbFree(db, ) on the +** at a Schema struct. This function does not call sqlite3DbFree(db, ) on the ** pointer itself, it just cleans up subsidiary resources (i.e. the contents ** of the schema hash tables). ** @@ -104316,7 +104316,7 @@ SQLITE_PRIVATE Schema *sqlite3SchemaGet(sqlite3 *db, Btree *pBt){ ** (as in the FROM clause of a SELECT statement) in this case it contains ** the name of a single table, as one might find in an INSERT, DELETE, ** or UPDATE statement. Look up that table in the symbol table and -** return a pointer. Set an error message and return NULL if the table +** return a pointer. Set an error message and return NULL if the table ** name is not found or if any other error occurs. ** ** The following fields are initialized appropriate in pSrc: @@ -104352,12 +104352,12 @@ SQLITE_PRIVATE int sqlite3IsReadOnly(Parse *pParse, Table *pTab, int viewOk){ ** 1) It is a virtual table and no implementation of the xUpdate method ** has been provided, or ** 2) It is a system table (i.e. sqlite_master), this call is not - ** part of a nested parse and writable_schema pragma has not + ** part of a nested parse and writable_schema pragma has not ** been specified. ** ** In either case leave an error message in pParse and return non-zero. */ - if( ( IsVirtual(pTab) + if( ( IsVirtual(pTab) && sqlite3GetVTable(pParse->db, pTab)->pMod->pModule->xUpdate==0 ) || ( (pTab->tabFlags & TF_Readonly)!=0 && (pParse->db->flags & SQLITE_WriteSchema)==0 @@ -104403,7 +104403,7 @@ SQLITE_PRIVATE void sqlite3MaterializeView( assert( pFrom->a[0].pOn==0 ); assert( pFrom->a[0].pUsing==0 ); } - pSel = sqlite3SelectNew(pParse, 0, pFrom, pWhere, 0, 0, 0, + pSel = sqlite3SelectNew(pParse, 0, pFrom, pWhere, 0, 0, 0, SF_IncludeHidden, 0, 0); sqlite3SelectDestInit(&dest, SRT_EphemTab, iCur); sqlite3Select(pParse, pSel, &dest); @@ -104452,11 +104452,11 @@ SQLITE_PRIVATE Expr *sqlite3LimitWhere( return pWhere; } - /* Generate a select expression tree to enforce the limit/offset + /* Generate a select expression tree to enforce the limit/offset ** term for the DELETE or UPDATE statement. For example: ** DELETE FROM table_a WHERE col1=1 ORDER BY col2 LIMIT 1 OFFSET 1 ** becomes: - ** DELETE FROM table_a WHERE rowid IN ( + ** DELETE FROM table_a WHERE rowid IN ( ** SELECT rowid FROM table_a WHERE col1=1 ORDER BY col2 LIMIT 1 OFFSET 1 ** ); */ @@ -104537,7 +104537,7 @@ SQLITE_PRIVATE void sqlite3DeleteFrom( int addrEphOpen = 0; /* Instruction to open the Ephemeral table */ int bComplex; /* True if there are triggers or FKs or ** subqueries in the WHERE clause */ - + #ifndef SQLITE_OMIT_TRIGGER int isView; /* True if attempting to delete from a view */ Trigger *pTrigger; /* List of table triggers, if required */ @@ -104585,7 +104585,7 @@ SQLITE_PRIVATE void sqlite3DeleteFrom( } iDb = sqlite3SchemaToIndex(db, pTab->pSchema); assert( iDbnDb ); - rcauth = sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, + rcauth = sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, db->aDb[iDb].zDbSName); assert( rcauth==SQLITE_OK || rcauth==SQLITE_DENY || rcauth==SQLITE_IGNORE ); if( rcauth==SQLITE_DENY ){ @@ -104646,7 +104646,7 @@ SQLITE_PRIVATE void sqlite3DeleteFrom( #ifndef SQLITE_OMIT_TRUNCATE_OPTIMIZATION /* Special case: A DELETE without a WHERE clause deletes everything. ** It is easier just to erase the whole table. Prior to version 3.6.5, - ** this optimization caused the row change count (the value returned by + ** this optimization caused the row change count (the value returned by ** API function sqlite3_count_changes) to be set incorrectly. */ if( rcauth==SQLITE_OK && pWhere==0 @@ -104690,7 +104690,7 @@ SQLITE_PRIVATE void sqlite3DeleteFrom( addrEphOpen = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, iEphCur, nPk); sqlite3VdbeSetP4KeyInfo(pParse, pPk); } - + /* Construct a query to find the rowid or primary key for every row ** to be deleted, based on the WHERE clause. Set variable eOnePass ** to indicate the strategy used to implement this delete: @@ -104704,12 +104704,12 @@ SQLITE_PRIVATE void sqlite3DeleteFrom( eOnePass = sqlite3WhereOkOnePass(pWInfo, aiCurOnePass); assert( IsVirtual(pTab)==0 || eOnePass!=ONEPASS_MULTI ); assert( IsVirtual(pTab) || bComplex || eOnePass!=ONEPASS_OFF ); - + /* Keep track of the number of rows to be deleted */ if( db->flags & SQLITE_CountRows ){ sqlite3VdbeAddOp2(v, OP_AddImm, memCnt, 1); } - + /* Extract the rowid or primary key for the current row */ if( pPk ){ for(i=0; ipParse->nMem ) pParse->nMem = iKey; } - + if( eOnePass!=ONEPASS_OFF ){ /* For ONEPASS, no need to store the rowid/primary-key. There is only ** one, so just keep it in its register(s) and fall through to the @@ -104753,18 +104753,18 @@ SQLITE_PRIVATE void sqlite3DeleteFrom( sqlite3VdbeAddOp2(v, OP_RowSetAdd, iRowSet, iKey); } } - - /* If this DELETE cannot use the ONEPASS strategy, this is the + + /* If this DELETE cannot use the ONEPASS strategy, this is the ** end of the WHERE loop */ if( eOnePass!=ONEPASS_OFF ){ addrBypass = sqlite3VdbeMakeLabel(v); }else{ sqlite3WhereEnd(pWInfo); } - - /* Unless this is a view, open cursors for the table we are + + /* Unless this is a view, open cursors for the table we are ** deleting from and all its indices. If this is a view, then the - ** only effect this statement has is to fire the INSTEAD OF + ** only effect this statement has is to fire the INSTEAD OF ** triggers. */ if( !isView ){ @@ -104779,7 +104779,7 @@ SQLITE_PRIVATE void sqlite3DeleteFrom( assert( pPk || IsVirtual(pTab) || iIdxCur==iDataCur+1 ); if( eOnePass==ONEPASS_MULTI ) sqlite3VdbeJumpHere(v, iAddrOnce); } - + /* Set up a loop over the rowids/primary-keys that were found in the ** where-clause loop above. */ @@ -104798,8 +104798,8 @@ SQLITE_PRIVATE void sqlite3DeleteFrom( addrLoop = sqlite3VdbeAddOp3(v, OP_RowSetRead, iRowSet, 0, iKey); VdbeCoverage(v); assert( nKey==1 ); - } - + } + /* Delete the row */ #ifndef SQLITE_OMIT_VIRTUALTABLE if( IsVirtual(pTab) ){ @@ -104819,7 +104819,7 @@ SQLITE_PRIVATE void sqlite3DeleteFrom( sqlite3GenerateRowDelete(pParse, pTab, pTrigger, iDataCur, iIdxCur, iKey, nKey, count, OE_Default, eOnePass, aiCurOnePass[1]); } - + /* End of the loop over all rowids/primary-keys. */ if( eOnePass!=ONEPASS_OFF ){ sqlite3VdbeResolveLabel(v, addrBypass); @@ -104830,7 +104830,7 @@ SQLITE_PRIVATE void sqlite3DeleteFrom( }else{ sqlite3VdbeGoto(v, addrLoop); sqlite3VdbeJumpHere(v, addrLoop); - } + } } /* End non-truncate path */ /* Update the sqlite_sequence table by storing the content of the @@ -104841,7 +104841,7 @@ SQLITE_PRIVATE void sqlite3DeleteFrom( sqlite3AutoincrementEnd(pParse); } - /* Return the number of rows that were deleted. If this routine is + /* Return the number of rows that were deleted. If this routine is ** generating code because of a call to sqlite3NestedParse(), do not ** invoke the callback function. */ @@ -104896,7 +104896,7 @@ delete_from_cleanup: ** and nPk before reading from it. ** ** If eMode is ONEPASS_MULTI, then this call is being made as part -** of a ONEPASS delete that affects multiple rows. In this case, if +** of a ONEPASS delete that affects multiple rows. In this case, if ** iIdxNoSeek is a valid cursor number (>=0) and is not the same as ** iDataCur, then its position should be preserved following the delete ** operation. Or, if iIdxNoSeek is not a valid cursor number, the @@ -104932,7 +104932,7 @@ SQLITE_PRIVATE void sqlite3GenerateRowDelete( VdbeModuleComment((v, "BEGIN: GenRowDel(%d,%d,%d,%d)", iDataCur, iIdxCur, iPk, (int)nPk)); - /* Seek cursor iCur to the row to delete. If this row no longer exists + /* Seek cursor iCur to the row to delete. If this row no longer exists ** (this can happen if a trigger program has already deleted it), do ** not attempt to delete it or fire any DELETE triggers. */ iLabel = sqlite3VdbeMakeLabel(v); @@ -104942,7 +104942,7 @@ SQLITE_PRIVATE void sqlite3GenerateRowDelete( VdbeCoverageIf(v, opSeek==OP_NotExists); VdbeCoverageIf(v, opSeek==OP_NotFound); } - + /* If there are any triggers to fire, allocate a range of registers to ** use for the old.* references in the triggers. */ if( sqlite3FkRequired(pParse, pTab, 0, 0) || pTrigger ){ @@ -104959,7 +104959,7 @@ SQLITE_PRIVATE void sqlite3GenerateRowDelete( iOld = pParse->nMem+1; pParse->nMem += (1 + pTab->nCol); - /* Populate the OLD.* pseudo-table register array. These values will be + /* Populate the OLD.* pseudo-table register array. These values will be ** used by any BEFORE and AFTER triggers that exist. */ sqlite3VdbeAddOp2(v, OP_Copy, iPk, iOld); for(iCol=0; iColnCol; iCol++){ @@ -104972,11 +104972,11 @@ SQLITE_PRIVATE void sqlite3GenerateRowDelete( /* Invoke BEFORE DELETE trigger programs. */ addrStart = sqlite3VdbeCurrentAddr(v); - sqlite3CodeRowTrigger(pParse, pTrigger, + sqlite3CodeRowTrigger(pParse, pTrigger, TK_DELETE, 0, TRIGGER_BEFORE, pTab, iOld, onconf, iLabel ); - /* If any BEFORE triggers were coded, then seek the cursor to the + /* If any BEFORE triggers were coded, then seek the cursor to the ** row to be deleted again. It may be that the BEFORE triggers moved ** the cursor or already deleted the row that the cursor was ** pointing to. @@ -104993,21 +104993,21 @@ SQLITE_PRIVATE void sqlite3GenerateRowDelete( } /* Do FK processing. This call checks that any FK constraints that - ** refer to this table (i.e. constraints attached to other tables) + ** refer to this table (i.e. constraints attached to other tables) ** are not violated by deleting this row. */ sqlite3FkCheck(pParse, pTab, iOld, 0, 0, 0); } /* Delete the index and table entries. Skip this step if pTab is really ** a view (in which case the only effect of the DELETE statement is to - ** fire the INSTEAD OF triggers). + ** fire the INSTEAD OF triggers). ** ** If variable 'count' is non-zero, then this OP_Delete instruction should ** invoke the update-hook. The pre-update-hook, on the other hand should ** be invoked unless table pTab is a system table. The difference is that - ** the update-hook is not invoked for rows removed by REPLACE, but the + ** the update-hook is not invoked for rows removed by REPLACE, but the ** pre-update-hook is. - */ + */ if( pTab->pSelect==0 ){ u8 p5 = 0; sqlite3GenerateRowIndexDelete(pParse, pTab, iDataCur, iIdxCur,0,iIdxNoSeek); @@ -105027,16 +105027,16 @@ SQLITE_PRIVATE void sqlite3GenerateRowDelete( /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key - ** to the row just deleted. */ + ** to the row just deleted. */ sqlite3FkActions(pParse, pTab, 0, iOld, 0, 0); /* Invoke AFTER DELETE trigger programs. */ - sqlite3CodeRowTrigger(pParse, pTrigger, + sqlite3CodeRowTrigger(pParse, pTrigger, TK_DELETE, 0, TRIGGER_AFTER, pTab, iOld, onconf, iLabel ); /* Jump here if the row had already been deleted before any BEFORE - ** trigger programs were invoked. Or if a trigger program throws a + ** trigger programs were invoked. Or if a trigger program throws a ** RAISE(IGNORE) exception. */ sqlite3VdbeResolveLabel(v, iLabel); VdbeModuleComment((v, "END: GenRowDel()")); @@ -105120,7 +105120,7 @@ SQLITE_PRIVATE void sqlite3GenerateRowIndexDelete( ** its key into the same sequence of registers and if pPrior and pIdx share ** a column in common, then the register corresponding to that column already ** holds the correct value and the loading of that register is skipped. -** This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK +** This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK ** on a table with multiple indices, and especially with the ROWID or ** PRIMARY KEY columns of the index. */ @@ -105144,7 +105144,7 @@ SQLITE_PRIVATE int sqlite3GenerateIndexKey( *piPartIdxLabel = sqlite3VdbeMakeLabel(v); pParse->iSelfTab = iDataCur; sqlite3ExprCachePush(pParse); - sqlite3ExprIfFalseDup(pParse, pIdx->pPartIdxWhere, *piPartIdxLabel, + sqlite3ExprIfFalseDup(pParse, pIdx->pPartIdxWhere, *piPartIdxLabel, SQLITE_JUMPIFNULL); }else{ *piPartIdxLabel = 0; @@ -105327,7 +105327,7 @@ static void lengthFunc( ** Implementation of the abs() function. ** ** IMP: R-23979-26855 The abs(X) function returns the absolute value of -** the numeric argument X. +** the numeric argument X. */ static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ assert( argc==1 ); @@ -105344,7 +105344,7 @@ static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ return; } iVal = -iVal; - } + } sqlite3_result_int64(context, iVal); break; } @@ -105668,7 +105668,7 @@ static void lowerFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ #define noopFunc versionFunc /* Substitute function - never called */ /* -** Implementation of random(). Return a random integer. +** Implementation of random(). Return a random integer. */ static void randomFunc( sqlite3_context *context, @@ -105679,11 +105679,11 @@ static void randomFunc( UNUSED_PARAMETER2(NotUsed, NotUsed2); sqlite3_randomness(sizeof(r), &r); if( r<0 ){ - /* We need to prevent a random number of 0x8000000000000000 + /* We need to prevent a random number of 0x8000000000000000 ** (or -9223372036854775808) since when you do abs() of that ** number of you get the same value back again. To do this ** in a way that is testable, mask the sign bit off of negative - ** values, resulting in a positive value. Then take the + ** values, resulting in a positive value. Then take the ** 2s complement of that positive value. The end result can ** therefore be no less than -9223372036854775807. */ @@ -105721,8 +105721,8 @@ static void randomBlob( ** value is the same as the sqlite3_last_insert_rowid() API function. */ static void last_insert_rowid( - sqlite3_context *context, - int NotUsed, + sqlite3_context *context, + int NotUsed, sqlite3_value **NotUsed2 ){ sqlite3 *db = sqlite3_context_db_handle(context); @@ -105830,7 +105830,7 @@ static const struct compareInfo likeInfoAlt = { '%', '_', 0, 0 }; ** it the last character in the list. ** ** Like matching rules: -** +** ** '%' Matches any sequence of zero or more characters ** *** '_' Matches any one character @@ -105853,7 +105853,7 @@ static int patternCompare( u32 matchAll = pInfo->matchAll; /* "*" or "%" */ u8 noCase = pInfo->noCase; /* True if uppercase==lowercase */ const u8 *zEscaped = 0; /* One past the last escaped input char */ - + while( (c = Utf8Read(zPattern))!=0 ){ if( c==matchAll ){ /* Match "*" */ /* Skip over multiple "*" characters in the pattern. If there @@ -106005,8 +106005,8 @@ SQLITE_API int sqlite3_like_count = 0; ** the GLOB operator. */ static void likeFunc( - sqlite3_context *context, - int argc, + sqlite3_context *context, + int argc, sqlite3_value **argv ){ const unsigned char *zA, *zB; @@ -106048,7 +106048,7 @@ static void likeFunc( const unsigned char *zEsc = sqlite3_value_text(argv[2]); if( zEsc==0 ) return; if( sqlite3Utf8CharLen((char*)zEsc, -1)!=1 ){ - sqlite3_result_error(context, + sqlite3_result_error(context, "ESCAPE expression must be a single character", -1); return; } @@ -106152,8 +106152,8 @@ static void compileoptionusedFunc( #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ /* -** Implementation of the sqlite_compileoption_get() function. -** The result is a string that identifies the compiler options +** Implementation of the sqlite_compileoption_get() function. +** The result is a string that identifies the compiler options ** used to build SQLite. */ #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS @@ -106177,7 +106177,7 @@ static void compileoptiongetFunc( ** digits. */ static const char hexdigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' + '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; /* @@ -106212,7 +106212,7 @@ static void quoteFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ char const *zBlob = sqlite3_value_blob(argv[0]); int nBlob = sqlite3_value_bytes(argv[0]); assert( zBlob==sqlite3_value_blob(argv[0]) ); /* No encoding change */ - zText = (char *)contextMalloc(context, (2*(i64)nBlob)+4); + zText = (char *)contextMalloc(context, (2*(i64)nBlob)+4); if( zText ){ int i; for(i=0; in>0x7fffffff || p->n==sqlite3_aggregate_count(context) ); #endif -} +} static void countFinalize(sqlite3_context *context){ CountCtx *p; p = sqlite3_aggregate_context(context, 0); @@ -106755,8 +106755,8 @@ static void countFinalize(sqlite3_context *context){ ** Routines to implement min() and max() aggregate functions. */ static void minmaxStep( - sqlite3_context *context, - int NotUsed, + sqlite3_context *context, + int NotUsed, sqlite3_value **argv ){ Mem *pArg = (Mem *)argv[0]; @@ -106846,8 +106846,8 @@ static void groupConcatFinalize(sqlite3_context *context){ sqlite3_result_error_toobig(context); }else if( pAccum->accError==STRACCUM_NOMEM ){ sqlite3_result_error_nomem(context); - }else{ - sqlite3_result_text(context, sqlite3StrAccumFinish(pAccum), -1, + }else{ + sqlite3_result_text(context, sqlite3StrAccumFinish(pAccum), -1, sqlite3_free); } } @@ -106891,10 +106891,10 @@ SQLITE_PRIVATE void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive) } sqlite3CreateFunc(db, "like", 2, SQLITE_UTF8, pInfo, likeFunc, 0, 0, 0); sqlite3CreateFunc(db, "like", 3, SQLITE_UTF8, pInfo, likeFunc, 0, 0, 0); - sqlite3CreateFunc(db, "glob", 2, SQLITE_UTF8, + sqlite3CreateFunc(db, "glob", 2, SQLITE_UTF8, (struct compareInfo*)&globInfo, likeFunc, 0, 0, 0); setLikeOptFlag(db, "glob", SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE); - setLikeOptFlag(db, "like", + setLikeOptFlag(db, "like", caseSensitive ? (SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE) : SQLITE_FUNC_LIKE); } @@ -106912,8 +106912,8 @@ SQLITE_PRIVATE void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive) */ SQLITE_PRIVATE int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){ FuncDef *pDef; - if( pExpr->op!=TK_FUNCTION - || !pExpr->x.pList + if( pExpr->op!=TK_FUNCTION + || !pExpr->x.pList || pExpr->x.pList->nExpr!=2 ){ return 0; @@ -107026,7 +107026,7 @@ SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void){ AGGREGATE(count, 1, 0, 0, countStep, countFinalize ), AGGREGATE(group_concat, 1, 0, 0, groupConcatStep, groupConcatFinalize), AGGREGATE(group_concat, 2, 0, 0, groupConcatStep, groupConcatFinalize), - + LIKEFUNC(glob, 2, &globInfo, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE), #ifdef SQLITE_CASE_SENSITIVE_LIKE LIKEFUNC(like, 2, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE), @@ -107095,25 +107095,25 @@ SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void){ ** Foreign keys in SQLite come in two flavours: deferred and immediate. ** If an immediate foreign key constraint is violated, ** SQLITE_CONSTRAINT_FOREIGNKEY is returned and the current -** statement transaction rolled back. If a -** deferred foreign key constraint is violated, no action is taken -** immediately. However if the application attempts to commit the +** statement transaction rolled back. If a +** deferred foreign key constraint is violated, no action is taken +** immediately. However if the application attempts to commit the ** transaction before fixing the constraint violation, the attempt fails. ** ** Deferred constraints are implemented using a simple counter associated -** with the database handle. The counter is set to zero each time a -** database transaction is opened. Each time a statement is executed +** with the database handle. The counter is set to zero each time a +** database transaction is opened. Each time a statement is executed ** that causes a foreign key violation, the counter is incremented. Each ** time a statement is executed that removes an existing violation from ** the database, the counter is decremented. When the transaction is ** committed, the commit fails if the current value of the counter is ** greater than zero. This scheme has two big drawbacks: ** -** * When a commit fails due to a deferred foreign key constraint, +** * When a commit fails due to a deferred foreign key constraint, ** there is no way to tell which foreign constraint is not satisfied, ** or which row it is not satisfied for. ** -** * If the database contains foreign key violations when the +** * If the database contains foreign key violations when the ** transaction is opened, this may cause the mechanism to malfunction. ** ** Despite these problems, this approach is adopted as it seems simpler @@ -107125,26 +107125,26 @@ SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void){ ** the parent table for a match. If none is found increment the ** constraint counter. ** -** I.2) For each FK for which the table is the parent table, +** I.2) For each FK for which the table is the parent table, ** search the child table for rows that correspond to the new ** row in the parent table. Decrement the counter for each row ** found (as the constraint is now satisfied). ** ** DELETE operations: ** -** D.1) For each FK for which the table is the child table, -** search the parent table for a row that corresponds to the -** deleted row in the child table. If such a row is not found, +** D.1) For each FK for which the table is the child table, +** search the parent table for a row that corresponds to the +** deleted row in the child table. If such a row is not found, ** decrement the counter. ** -** D.2) For each FK for which the table is the parent table, search -** the child table for rows that correspond to the deleted row +** D.2) For each FK for which the table is the parent table, search +** the child table for rows that correspond to the deleted row ** in the parent table. For each found increment the counter. ** ** UPDATE operations: ** ** An UPDATE command requires that all 4 steps above are taken, but only -** for FK constraints for which the affected columns are actually +** for FK constraints for which the affected columns are actually ** modified (values must be compared at runtime). ** ** Note that I.1 and D.1 are very similar operations, as are I.2 and D.2. @@ -107153,10 +107153,10 @@ SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void){ ** For the purposes of immediate FK constraints, the OR REPLACE conflict ** resolution is considered to delete rows before the new row is inserted. ** If a delete caused by OR REPLACE violates an FK constraint, an exception -** is thrown, even if the FK constraint would be satisfied after the new +** is thrown, even if the FK constraint would be satisfied after the new ** row is inserted. ** -** Immediate constraints are usually handled similarly. The only difference +** Immediate constraints are usually handled similarly. The only difference ** is that the counter used is stored as part of each individual statement ** object (struct Vdbe). If, after the statement has run, its immediate ** constraint counter is greater than zero, @@ -107167,7 +107167,7 @@ SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void){ ** INSERT violates a foreign key constraint. This is necessary as such ** an INSERT does not open a statement transaction. ** -** TODO: How should dropping a table be handled? How should renaming a +** TODO: How should dropping a table be handled? How should renaming a ** table be handled? ** ** @@ -107178,7 +107178,7 @@ SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void){ ** for those two operations needs to know whether or not the operation ** requires any FK processing and, if so, which columns of the original ** row are required by the FK processing VDBE code (i.e. if FKs were -** implemented using triggers, which of the old.* columns would be +** implemented using triggers, which of the old.* columns would be ** accessed). No information is required by the code-generator before ** coding an INSERT operation. The functions used by the UPDATE/DELETE ** generation code to query for this information are: @@ -107215,13 +107215,13 @@ SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void){ /* ** A foreign key constraint requires that the key columns in the parent ** table are collectively subject to a UNIQUE or PRIMARY KEY constraint. -** Given that pParent is the parent table for foreign key constraint pFKey, -** search the schema for a unique index on the parent key columns. +** Given that pParent is the parent table for foreign key constraint pFKey, +** search the schema for a unique index on the parent key columns. +** +** If successful, zero is returned. If the parent key is an INTEGER PRIMARY +** KEY column, then output variable *ppIdx is set to NULL. Otherwise, *ppIdx +** is set to point to the unique index. ** -** If successful, zero is returned. If the parent key is an INTEGER PRIMARY -** KEY column, then output variable *ppIdx is set to NULL. Otherwise, *ppIdx -** is set to point to the unique index. -** ** If the parent key consists of a single column (the foreign key constraint ** is not a composite foreign key), output variable *paiCol is set to NULL. ** Otherwise, it is set to point to an allocated array of size N, where @@ -107244,8 +107244,8 @@ SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void){ ** PRIMARY KEY, or ** ** 4) No parent key columns were provided explicitly as part of the -** foreign key definition, and the PRIMARY KEY of the parent table -** consists of a different number of columns to the child key in +** foreign key definition, and the PRIMARY KEY of the parent table +** consists of a different number of columns to the child key in ** the child table. ** ** then non-zero is returned, and a "foreign key mismatch" error loaded @@ -107269,9 +107269,9 @@ SQLITE_PRIVATE int sqlite3FkLocateIndex( assert( !paiCol || *paiCol==0 ); assert( pParse ); - /* If this is a non-composite (single column) foreign key, check if it - ** maps to the INTEGER PRIMARY KEY of table pParent. If so, leave *ppIdx - ** and *paiCol set to zero and return early. + /* If this is a non-composite (single column) foreign key, check if it + ** maps to the INTEGER PRIMARY KEY of table pParent. If so, leave *ppIdx + ** and *paiCol set to zero and return early. ** ** Otherwise, for a composite foreign key (more than one column), allocate ** space for the aiCol array (returned via output parameter *paiCol). @@ -107280,7 +107280,7 @@ SQLITE_PRIVATE int sqlite3FkLocateIndex( if( nCol==1 ){ /* The FK maps to the IPK if any of the following are true: ** - ** 1) There is an INTEGER PRIMARY KEY column and the FK is implicitly + ** 1) There is an INTEGER PRIMARY KEY column and the FK is implicitly ** mapped to the primary key of table pParent, or ** 2) The FK is explicitly mapped to a column declared as INTEGER ** PRIMARY KEY. @@ -107297,14 +107297,14 @@ SQLITE_PRIVATE int sqlite3FkLocateIndex( } for(pIdx=pParent->pIndex; pIdx; pIdx=pIdx->pNext){ - if( pIdx->nKeyCol==nCol && IsUniqueIndex(pIdx) && pIdx->pPartIdxWhere==0 ){ + if( pIdx->nKeyCol==nCol && IsUniqueIndex(pIdx) && pIdx->pPartIdxWhere==0 ){ /* pIdx is a UNIQUE index (or a PRIMARY KEY) and has the right number ** of columns. If each indexed column corresponds to a foreign key ** column of pFKey, then this index is a winner. */ if( zKey==0 ){ - /* If zKey is NULL, then this foreign key is implicitly mapped to - ** the PRIMARY KEY of table pParent. The PRIMARY KEY index may be + /* If zKey is NULL, then this foreign key is implicitly mapped to + ** the PRIMARY KEY of table pParent. The PRIMARY KEY index may be ** identified by the test. */ if( IsPrimaryKeyIndex(pIdx) ){ if( aiCol ){ @@ -107362,15 +107362,15 @@ SQLITE_PRIVATE int sqlite3FkLocateIndex( } /* -** This function is called when a row is inserted into or deleted from the -** child table of foreign key constraint pFKey. If an SQL UPDATE is executed +** This function is called when a row is inserted into or deleted from the +** child table of foreign key constraint pFKey. If an SQL UPDATE is executed ** on the child table of pFKey, this function is invoked twice for each row ** affected - once to "delete" the old row, and then again to "insert" the ** new row. ** ** Each time it is called, this function generates VDBE code to locate the -** row in the parent table that corresponds to the row being inserted into -** or deleted from the child table. If the parent row can be found, no +** row in the parent table that corresponds to the row being inserted into +** or deleted from the child table. If the parent row can be found, no ** special action is taken. Otherwise, if the parent row can *not* be ** found in the parent table: ** @@ -107384,7 +107384,7 @@ SQLITE_PRIVATE int sqlite3FkLocateIndex( ** ** DELETE deferred Decrement the "deferred constraint counter". ** -** These operations are identified in the comment at the top of this file +** These operations are identified in the comment at the top of this file ** (fkey.c) as "I.1" and "D.1". */ static void fkLookupParent( @@ -107407,8 +107407,8 @@ static void fkLookupParent( ** outstanding constraints to resolve. If there are not, there is no need ** to check if deleting this row resolves any outstanding violations. ** - ** Check if any of the key columns in the child table row are NULL. If - ** any are, then the constraint is considered satisfied. No need to + ** Check if any of the key columns in the child table row are NULL. If + ** any are, then the constraint is considered satisfied. No need to ** search for a matching row in the parent table. */ if( nIncr<0 ){ sqlite3VdbeAddOp2(v, OP_FkIfZero, pFKey->isDeferred, iOk); @@ -107425,8 +107425,8 @@ static void fkLookupParent( ** column of the parent table (table pTab). */ int iMustBeInt; /* Address of MustBeInt instruction */ int regTemp = sqlite3GetTempReg(pParse); - - /* Invoke MustBeInt to coerce the child key value to an integer (i.e. + + /* Invoke MustBeInt to coerce the child key value to an integer (i.e. ** apply the affinity of the parent key). If this fails, then there ** is no matching parent key. Before using MustBeInt, make a copy of ** the value. Otherwise, the value inserted into the child key column @@ -107434,7 +107434,7 @@ static void fkLookupParent( sqlite3VdbeAddOp2(v, OP_SCopy, aiCol[0]+1+regData, regTemp); iMustBeInt = sqlite3VdbeAddOp2(v, OP_MustBeInt, regTemp, 0); VdbeCoverage(v); - + /* If the parent table is the same as the child table, and we are about ** to increment the constraint-counter (i.e. this is an INSERT operation), ** then check if the row being inserted matches itself. If so, do not @@ -107443,7 +107443,7 @@ static void fkLookupParent( sqlite3VdbeAddOp3(v, OP_Eq, regData, iOk, regTemp); VdbeCoverage(v); sqlite3VdbeChangeP5(v, SQLITE_NOTNULL); } - + sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenRead); sqlite3VdbeAddOp3(v, OP_NotExists, iCur, 0, regTemp); VdbeCoverage(v); sqlite3VdbeGoto(v, iOk); @@ -107454,19 +107454,19 @@ static void fkLookupParent( int nCol = pFKey->nCol; int regTemp = sqlite3GetTempRange(pParse, nCol); int regRec = sqlite3GetTempReg(pParse); - + sqlite3VdbeAddOp3(v, OP_OpenRead, iCur, pIdx->tnum, iDb); sqlite3VdbeSetP4KeyInfo(pParse, pIdx); for(i=0; idb,pIdx), nCol); sqlite3VdbeAddOp4Int(v, OP_Found, iCur, iOk, regRec, 0); VdbeCoverage(v); - + sqlite3ReleaseTempReg(pParse, regRec); sqlite3ReleaseTempRange(pParse, regTemp, nCol); } } if( !pFKey->isDeferred && !(pParse->db->flags & SQLITE_DeferFKs) - && !pParse->pToplevel - && !pParse->isMultiWrite + && !pParse->pToplevel + && !pParse->isMultiWrite ){ /* Special case: If this is an INSERT statement that will insert exactly ** one row into the table, raise a constraint immediately instead of @@ -107577,7 +107577,7 @@ static Expr *exprTableColumn( /* ** This function is called to generate code executed when a row is deleted -** from the parent table of foreign key constraint pFKey and, if pFKey is +** from the parent table of foreign key constraint pFKey and, if pFKey is ** deferred, when a row is inserted into the same table. When generating ** code for an SQL UPDATE operation, this function may be called twice - ** once to "delete" the old row and once to "insert" the new row. @@ -107604,7 +107604,7 @@ static Expr *exprTableColumn( ** ** INSERT deferred Decrement the "deferred constraint counter". ** -** These operations are identified in the comment at the top of this file +** These operations are identified in the comment at the top of this file ** (fkey.c) as "I.2" and "D.2". */ static void fkScanChildren( @@ -107647,7 +107647,7 @@ static void fkScanChildren( Expr *pLeft; /* Value from parent table row */ Expr *pRight; /* Column ref to child table */ Expr *pEq; /* Expression (pLeft = pRight) */ - i16 iCol; /* Index of column in child table */ + i16 iCol; /* Index of column in child table */ const char *zCol; /* Name of column in child table */ iCol = pIdx ? pIdx->aiColumn[i] : -1; @@ -107737,7 +107737,7 @@ SQLITE_PRIVATE FKey *sqlite3FkReferences(Table *pTab){ } /* -** The second argument is a Trigger structure allocated by the +** The second argument is a Trigger structure allocated by the ** fkActionTrigger() routine. This function deletes the Trigger structure ** and all of its sub-components. ** @@ -107765,7 +107765,7 @@ static void fkTriggerDelete(sqlite3 *dbMem, Trigger *p){ ** ** (a) The table is the parent table of a FK constraint, or ** (b) The table is the child table of a deferred FK constraint and it is -** determined at runtime that there are outstanding deferred FK +** determined at runtime that there are outstanding deferred FK ** constraint violations in the database, ** ** then the equivalent of "DELETE FROM " is executed before dropping @@ -107781,7 +107781,7 @@ SQLITE_PRIVATE void sqlite3FkDropTable(Parse *pParse, SrcList *pName, Table *pTa assert( v ); /* VDBE has already been allocated */ if( sqlite3FkReferences(pTab)==0 ){ /* Search for a deferred foreign key constraint for which this table - ** is the child table. If one cannot be found, return without + ** is the child table. If one cannot be found, return without ** generating any VDBE code. If one can be found, then jump over ** the entire DELETE if there are no outstanding deferred constraints ** when this statement is run. */ @@ -107798,10 +107798,10 @@ SQLITE_PRIVATE void sqlite3FkDropTable(Parse *pParse, SrcList *pName, Table *pTa sqlite3DeleteFrom(pParse, sqlite3SrcListDup(db, pName, 0), 0); pParse->disableTriggers = 0; - /* If the DELETE has generated immediate foreign key constraint + /* If the DELETE has generated immediate foreign key constraint ** violations, halt the VDBE and return an error at this point, before ** any modifications to the schema are made. This is because statement - ** transactions are not able to rollback schema changes. + ** transactions are not able to rollback schema changes. ** ** If the SQLITE_DeferFKs flag is set, then this is not required, as ** the statement transaction will not be rolled back even if FK @@ -107824,7 +107824,7 @@ SQLITE_PRIVATE void sqlite3FkDropTable(Parse *pParse, SrcList *pName, Table *pTa /* ** The second argument points to an FKey object representing a foreign key ** for which pTab is the child table. An UPDATE statement against pTab -** is currently being processed. For each column of the table that is +** is currently being processed. For each column of the table that is ** actually updated, the corresponding element in the aChange[] array ** is zero or greater (if a column is unmodified the corresponding element ** is set to -1). If the rowid column is modified by the UPDATE statement @@ -107851,7 +107851,7 @@ static int fkChildIsModified( /* ** The second argument points to an FKey object representing a foreign key ** for which pTab is the parent table. An UPDATE statement against pTab -** is currently being processed. For each column of the table that is +** is currently being processed. For each column of the table that is ** actually updated, the corresponding element in the aChange[] array ** is zero or greater (if a column is unmodified the corresponding element ** is set to -1). If the rowid column is modified by the UPDATE statement @@ -107861,9 +107861,9 @@ static int fkChildIsModified( ** parent key for FK constraint *p are modified. */ static int fkParentIsModified( - Table *pTab, - FKey *p, - int *aChange, + Table *pTab, + FKey *p, + int *aChange, int bChngRowid ){ int i; @@ -107904,7 +107904,7 @@ static int isSetNullAction(Parse *pParse, FKey *pFKey){ /* ** This function is called when inserting, deleting or updating a row of -** table pTab to generate VDBE code to perform foreign key constraint +** table pTab to generate VDBE code to perform foreign key constraint ** processing for the operation. ** ** For a DELETE operation, parameter regOld is passed the index of the @@ -107920,11 +107920,11 @@ static int isSetNullAction(Parse *pParse, FKey *pFKey){ ** For an UPDATE operation, this function is called twice. Once before ** the original record is deleted from the table using the calling convention ** described for DELETE. Then again after the original record is deleted -** but before the new record is inserted using the INSERT convention. +** but before the new record is inserted using the INSERT convention. */ SQLITE_PRIVATE void sqlite3FkCheck( Parse *pParse, /* Parse context */ - Table *pTab, /* Row is being deleted from this table */ + Table *pTab, /* Row is being deleted from this table */ int regOld, /* Previous row data is stored here */ int regNew, /* New row data is stored here */ int *aChange, /* Array indicating UPDATEd columns (or 0) */ @@ -107956,16 +107956,16 @@ SQLITE_PRIVATE void sqlite3FkCheck( int i; int bIgnore = 0; - if( aChange + if( aChange && sqlite3_stricmp(pTab->zName, pFKey->zTo)!=0 - && fkChildIsModified(pTab, pFKey, aChange, bChngRowid)==0 + && fkChildIsModified(pTab, pFKey, aChange, bChngRowid)==0 ){ continue; } - /* Find the parent table of this foreign key. Also find a unique index - ** on the parent key columns in the parent table. If either of these - ** schema items cannot be located, set an error in pParse and return + /* Find the parent table of this foreign key. Also find a unique index + ** on the parent key columns in the parent table. If either of these + ** schema items cannot be located, set an error in pParse and return ** early. */ if( pParse->disableTriggers ){ pTo = sqlite3FindTable(db, pFKey->zTo, zDb); @@ -108007,7 +108007,7 @@ SQLITE_PRIVATE void sqlite3FkCheck( } assert( pIdx==0 || pIdx->aiColumn[i]>=0 ); #ifndef SQLITE_OMIT_AUTHORIZATION - /* Request permission to read the parent key columns. If the + /* Request permission to read the parent key columns. If the ** authorization callback returns SQLITE_IGNORE, behave as if any ** values read from the parent table are NULL. */ if( db->xAuth ){ @@ -108019,24 +108019,24 @@ SQLITE_PRIVATE void sqlite3FkCheck( #endif } - /* Take a shared-cache advisory read-lock on the parent table. Allocate - ** a cursor to use to search the unique index on the parent key columns + /* Take a shared-cache advisory read-lock on the parent table. Allocate + ** a cursor to use to search the unique index on the parent key columns ** in the parent table. */ sqlite3TableLock(pParse, iDb, pTo->tnum, 0, pTo->zName); pParse->nTab++; if( regOld!=0 ){ /* A row is being removed from the child table. Search for the parent. - ** If the parent does not exist, removing the child row resolves an + ** If the parent does not exist, removing the child row resolves an ** outstanding foreign key constraint violation. */ fkLookupParent(pParse, iDb, pTo, pIdx, pFKey, aiCol, regOld, -1, bIgnore); } if( regNew!=0 && !isSetNullAction(pParse, pFKey) ){ /* A row is being added to the child table. If a parent row cannot - ** be found, adding the child row has violated the FK constraint. + ** be found, adding the child row has violated the FK constraint. ** ** If this operation is being performed as part of a trigger program - ** that is actually a "SET NULL" action belonging to this very + ** that is actually a "SET NULL" action belonging to this very ** foreign key, then omit this scan altogether. As all child key ** values are guaranteed to be NULL, it is not possible for adding ** this row to cause an FK violation. */ @@ -108057,8 +108057,8 @@ SQLITE_PRIVATE void sqlite3FkCheck( continue; } - if( !pFKey->isDeferred && !(db->flags & SQLITE_DeferFKs) - && !pParse->pToplevel && !pParse->isMultiWrite + if( !pFKey->isDeferred && !(db->flags & SQLITE_DeferFKs) + && !pParse->pToplevel && !pParse->isMultiWrite ){ assert( regOld==0 && regNew!=0 ); /* Inserting a single row into a parent table cannot cause (or fix) @@ -108081,7 +108081,7 @@ SQLITE_PRIVATE void sqlite3FkCheck( pItem->zName = pFKey->pFrom->zName; pItem->pTab->nTabRef++; pItem->iCursor = pParse->nTab++; - + if( regNew!=0 ){ fkScanChildren(pParse, pSrc, pTab, pIdx, pFKey, aiCol, regNew, -1); } @@ -108100,10 +108100,10 @@ SQLITE_PRIVATE void sqlite3FkCheck( ** ** Note 2: At first glance it may seem like SQLite could simply omit ** all OP_FkCounter related scans when either CASCADE or SET NULL - ** applies. The trouble starts if the CASCADE or SET NULL action - ** trigger causes other triggers or action rules attached to the + ** applies. The trouble starts if the CASCADE or SET NULL action + ** trigger causes other triggers or action rules attached to the ** child table to fire. In these cases the fk constraint counters - ** might be set incorrectly if any OP_FkCounter related scans are + ** might be set incorrectly if any OP_FkCounter related scans are ** omitted. */ if( !pFKey->isDeferred && eAction!=OE_Cascade && eAction!=OE_SetNull ){ sqlite3MayAbort(pParse); @@ -108119,7 +108119,7 @@ SQLITE_PRIVATE void sqlite3FkCheck( #define COLUMN_MASK(x) (((x)>31) ? 0xffffffff : ((u32)1<<(x))) /* -** This function is called before generating code to update or delete a +** This function is called before generating code to update or delete a ** row contained in table pTab. */ SQLITE_PRIVATE u32 sqlite3FkOldmask( @@ -108149,17 +108149,17 @@ SQLITE_PRIVATE u32 sqlite3FkOldmask( /* -** This function is called before generating code to update or delete a +** This function is called before generating code to update or delete a ** row contained in table pTab. If the operation is a DELETE, then ** parameter aChange is passed a NULL value. For an UPDATE, aChange points ** to an array of size N, where N is the number of columns in table pTab. -** If the i'th column is not modified by the UPDATE, then the corresponding +** If the i'th column is not modified by the UPDATE, then the corresponding ** entry in the aChange[] array is set to -1. If the column is modified, ** the value is 0 or greater. Parameter chngRowid is set to true if the ** UPDATE statement modifies the rowid fields of the table. ** ** If any foreign key processing will be required, this function returns -** true. If there is no foreign key related processing, this function +** true. If there is no foreign key related processing, this function ** returns false. */ SQLITE_PRIVATE int sqlite3FkRequired( @@ -108170,8 +108170,8 @@ SQLITE_PRIVATE int sqlite3FkRequired( ){ if( pParse->db->flags&SQLITE_ForeignKeys ){ if( !aChange ){ - /* A DELETE operation. Foreign key processing is required if the - ** table in question is either the child or parent table for any + /* A DELETE operation. Foreign key processing is required if the + ** table in question is either the child or parent table for any ** foreign key constraint. */ return (sqlite3FkReferences(pTab) || pTab->pFKey); }else{ @@ -108194,7 +108194,7 @@ SQLITE_PRIVATE int sqlite3FkRequired( } /* -** This function is called when an UPDATE or DELETE operation is being +** This function is called when an UPDATE or DELETE operation is being ** compiled on table pTab, which is the parent table of foreign-key pFKey. ** If the current operation is an UPDATE, then the pChanges parameter is ** passed a pointer to the list of columns being modified. If it is a @@ -108206,7 +108206,7 @@ SQLITE_PRIVATE int sqlite3FkRequired( ** returned (these actions require no special handling by the triggers ** sub-system, code for them is created by fkScanChildren()). ** -** For example, if pFKey is the foreign key and pTab is table "p" in +** For example, if pFKey is the foreign key and pTab is table "p" in ** the following schema: ** ** CREATE TABLE p(pk PRIMARY KEY); @@ -108219,7 +108219,7 @@ SQLITE_PRIVATE int sqlite3FkRequired( ** END; ** ** The returned pointer is cached as part of the foreign key object. It -** is eventually freed along with the rest of the foreign key object by +** is eventually freed along with the rest of the foreign key object by ** sqlite3FkDelete(). */ static Trigger *fkActionTrigger( @@ -108275,7 +108275,7 @@ static Trigger *fkActionTrigger( ** that the affinity and collation sequence associated with the ** parent table are used for the comparison. */ pEq = sqlite3PExpr(pParse, TK_EQ, - sqlite3PExpr(pParse, TK_DOT, + sqlite3PExpr(pParse, TK_DOT, sqlite3ExprAlloc(db, TK_ID, &tOld, 0), sqlite3ExprAlloc(db, TK_ID, &tToCol, 0)), sqlite3ExprAlloc(db, TK_ID, &tFromCol, 0) @@ -108289,20 +108289,20 @@ static Trigger *fkActionTrigger( */ if( pChanges ){ pEq = sqlite3PExpr(pParse, TK_IS, - sqlite3PExpr(pParse, TK_DOT, + sqlite3PExpr(pParse, TK_DOT, sqlite3ExprAlloc(db, TK_ID, &tOld, 0), sqlite3ExprAlloc(db, TK_ID, &tToCol, 0)), - sqlite3PExpr(pParse, TK_DOT, + sqlite3PExpr(pParse, TK_DOT, sqlite3ExprAlloc(db, TK_ID, &tNew, 0), sqlite3ExprAlloc(db, TK_ID, &tToCol, 0)) ); pWhen = sqlite3ExprAnd(db, pWhen, pEq); } - + if( action!=OE_Restrict && (action!=OE_Cascade || pChanges) ){ Expr *pNew; if( action==OE_Cascade ){ - pNew = sqlite3PExpr(pParse, TK_DOT, + pNew = sqlite3PExpr(pParse, TK_DOT, sqlite3ExprAlloc(db, TK_ID, &tNew, 0), sqlite3ExprAlloc(db, TK_ID, &tToCol, 0)); }else if( action==OE_SetDflt ){ @@ -108326,7 +108326,7 @@ static Trigger *fkActionTrigger( if( action==OE_Restrict ){ Token tFrom; - Expr *pRaise; + Expr *pRaise; tFrom.z = zFrom; tFrom.n = nFrom; @@ -108334,7 +108334,7 @@ static Trigger *fkActionTrigger( if( pRaise ){ pRaise->affinity = OE_Abort; } - pSelect = sqlite3SelectNew(pParse, + pSelect = sqlite3SelectNew(pParse, sqlite3ExprListAppend(pParse, 0, pRaise), sqlite3SrcListAppend(db, 0, &tFrom, 0), pWhere, @@ -108346,7 +108346,7 @@ static Trigger *fkActionTrigger( /* Disable lookaside memory allocation */ db->lookaside.bDisable++; - pTrigger = (Trigger *)sqlite3DbMallocZero(db, + pTrigger = (Trigger *)sqlite3DbMallocZero(db, sizeof(Trigger) + /* struct Trigger */ sizeof(TriggerStep) + /* Single step in trigger program */ nFrom + 1 /* Space for pStep->zTarget */ @@ -108355,7 +108355,7 @@ static Trigger *fkActionTrigger( pStep = pTrigger->step_list = (TriggerStep *)&pTrigger[1]; pStep->zTarget = (char *)&pStep[1]; memcpy((char *)pStep->zTarget, zFrom, nFrom); - + pStep->pWhere = sqlite3ExprDup(db, pWhere, EXPRDUP_REDUCE); pStep->pExprList = sqlite3ExprListDup(db, pList, EXPRDUP_REDUCE); pStep->pSelect = sqlite3SelectDup(db, pSelect, EXPRDUP_REDUCE); @@ -108380,12 +108380,12 @@ static Trigger *fkActionTrigger( switch( action ){ case OE_Restrict: - pStep->op = TK_SELECT; + pStep->op = TK_SELECT; break; - case OE_Cascade: - if( !pChanges ){ - pStep->op = TK_DELETE; - break; + case OE_Cascade: + if( !pChanges ){ + pStep->op = TK_DELETE; + break; } default: pStep->op = TK_UPDATE; @@ -108412,9 +108412,9 @@ SQLITE_PRIVATE void sqlite3FkActions( int *aChange, /* Array indicating UPDATEd columns (or 0) */ int bChngRowid /* True if rowid is UPDATEd */ ){ - /* If foreign-key support is enabled, iterate through all FKs that - ** refer to table pTab. If there is an action associated with the FK - ** for this operation (either update or delete), invoke the associated + /* If foreign-key support is enabled, iterate through all FKs that + ** refer to table pTab. If there is an action associated with the FK + ** for this operation (either update or delete), invoke the associated ** trigger sub-program. */ if( pParse->db->flags&SQLITE_ForeignKeys ){ FKey *pFKey; /* Iterator variable */ @@ -108494,7 +108494,7 @@ SQLITE_PRIVATE void sqlite3FkDelete(sqlite3 *db, Table *pTab){ /* #include "sqliteInt.h" */ /* -** Generate code that will +** Generate code that will ** ** (1) acquire a lock for table pTab then ** (2) open pTab as cursor iCur. @@ -108513,7 +108513,7 @@ SQLITE_PRIVATE void sqlite3OpenTable( assert( !IsVirtual(pTab) ); v = sqlite3GetVdbe(pParse); assert( opcode==OP_OpenWrite || opcode==OP_OpenRead ); - sqlite3TableLock(pParse, iDb, pTab->tnum, + sqlite3TableLock(pParse, iDb, pTab->tnum, (opcode==OP_OpenWrite)?1:0, pTab->zName); if( HasRowid(pTab) ){ sqlite3VdbeAddOp4Int(v, opcode, iCur, pTab->tnum, iDb, pTab->nCol); @@ -108530,7 +108530,7 @@ SQLITE_PRIVATE void sqlite3OpenTable( /* ** Return a pointer to the column affinity string associated with index -** pIdx. A column affinity string has one character for each column in +** pIdx. A column affinity string has one character for each column in ** the table, according to the affinity of the column: ** ** Character Column affinity @@ -108582,7 +108582,7 @@ SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(sqlite3 *db, Index *pIdx){ } pIdx->zColAff[n] = 0; } - + return pIdx->zColAff; } @@ -108637,9 +108637,9 @@ SQLITE_PRIVATE void sqlite3TableAffinity(Vdbe *v, Table *pTab, int iReg){ /* ** Return non-zero if the table pTab in database iDb or any of its indices -** have been opened at any point in the VDBE program. This is used to see if -** a statement of the form "INSERT INTO SELECT ..." can -** run without using a temporary table for the results of the SELECT. +** have been opened at any point in the VDBE program. This is used to see if +** a statement of the form "INSERT INTO SELECT ..." can +** run without using a temporary table for the results of the SELECT. */ static int readsTable(Parse *p, int iDb, Table *pTab){ Vdbe *v = sqlite3GetVdbe(p); @@ -108730,7 +108730,7 @@ static int autoIncBegin( /* ** This routine generates code that will initialize all of the -** register used by the autoincrement tracker. +** register used by the autoincrement tracker. */ SQLITE_PRIVATE void sqlite3AutoincrementBegin(Parse *pParse){ AutoincInfo *p; /* Information about an AUTOINCREMENT */ @@ -108757,7 +108757,7 @@ SQLITE_PRIVATE void sqlite3AutoincrementBegin(Parse *pParse){ /* 6 */ {OP_Goto, 0, 9, 0}, /* 7 */ {OP_Next, 0, 2, 0}, /* 8 */ {OP_Integer, 0, 0, 0}, - /* 9 */ {OP_Close, 0, 0, 0} + /* 9 */ {OP_Close, 0, 0, 0} }; VdbeOp *aOp; pDb = &db->aDb[p->iDb]; @@ -109104,7 +109104,7 @@ SQLITE_PRIVATE void sqlite3Insert( regData = regRowid+1; /* If the INSERT statement included an IDLIST term, then make sure - ** all elements of the IDLIST really are columns of the table and + ** all elements of the IDLIST really are columns of the table and ** remember the column indices. ** ** If the table has an INTEGER PRIMARY KEY column and that column @@ -109176,7 +109176,7 @@ SQLITE_PRIVATE void sqlite3Insert( ** the destination table (template 3). ** ** A temp table must be used if the table being updated is also one - ** of the tables being read by the SELECT statement. Also use a + ** of the tables being read by the SELECT statement. Also use a ** temp table in the case of row triggers. */ if( pTrigger || readsTable(pParse, iDb, pTab) ){ @@ -109212,7 +109212,7 @@ SQLITE_PRIVATE void sqlite3Insert( sqlite3ReleaseTempReg(pParse, regTempRowid); } }else{ - /* This is the case if the data for the INSERT is coming from a + /* This is the case if the data for the INSERT is coming from a ** single-row VALUES clause */ NameContext sNC; @@ -109231,7 +109231,7 @@ SQLITE_PRIVATE void sqlite3Insert( } /* If there is no IDLIST term but the table has an integer primary - ** key, the set the ipkColumn variable to the integer primary key + ** key, the set the ipkColumn variable to the integer primary key ** column index in the original table definition. */ if( pColumn==0 && nColumn>0 ){ @@ -109245,7 +109245,7 @@ SQLITE_PRIVATE void sqlite3Insert( nHidden += (IsHiddenColumn(&pTab->aCol[i]) ? 1 : 0); } if( pColumn==0 && nColumn && nColumn!=(pTab->nCol-nHidden) ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "table %S has %d columns but %d values were supplied", pTabList, 0, pTab->nCol-nHidden, nColumn); goto insert_cleanup; @@ -109254,7 +109254,7 @@ SQLITE_PRIVATE void sqlite3Insert( sqlite3ErrorMsg(pParse, "%d values for %d columns", nColumn, pColumn->nId); goto insert_cleanup; } - + /* Initialize the count of rows to be inserted */ if( db->flags & SQLITE_CountRows ){ @@ -109350,7 +109350,7 @@ SQLITE_PRIVATE void sqlite3Insert( || (pColumn==0 && IsOrdinaryHiddenColumn(&pTab->aCol[i])) ){ sqlite3ExprCode(pParse, pTab->aCol[i].pDflt, regCols+i+1); }else if( useTempTable ){ - sqlite3VdbeAddOp3(v, OP_Column, srcTab, j, regCols+i+1); + sqlite3VdbeAddOp3(v, OP_Column, srcTab, j, regCols+i+1); }else{ assert( pSelect==0 ); /* Otherwise useTempTable is true */ sqlite3ExprCodeAndCache(pParse, pList->a[j].pExpr, regCols+i+1); @@ -109368,7 +109368,7 @@ SQLITE_PRIVATE void sqlite3Insert( } /* Fire BEFORE or INSTEAD OF triggers */ - sqlite3CodeRowTrigger(pParse, pTrigger, TK_INSERT, 0, TRIGGER_BEFORE, + sqlite3CodeRowTrigger(pParse, pTrigger, TK_INSERT, 0, TRIGGER_BEFORE, pTab, regCols-pTab->nCol-1, onError, endOfLoop); sqlite3ReleaseTempRange(pParse, regCols, pTab->nCol+1); @@ -109452,7 +109452,7 @@ SQLITE_PRIVATE void sqlite3Insert( if( j<0 || nColumn==0 || (pColumn && j>=pColumn->nId) ){ sqlite3ExprCodeFactorable(pParse, pTab->aCol[i].pDflt, iRegStore); }else if( useTempTable ){ - sqlite3VdbeAddOp3(v, OP_Column, srcTab, j, iRegStore); + sqlite3VdbeAddOp3(v, OP_Column, srcTab, j, iRegStore); }else if( pSelect ){ if( regFromSelect!=regData ){ sqlite3VdbeAddOp2(v, OP_SCopy, regFromSelect+j, iRegStore); @@ -109486,7 +109486,7 @@ SQLITE_PRIVATE void sqlite3Insert( ** constraints or (b) there are no triggers and this table is not a ** parent table in a foreign key constraint. It is safe to set the ** flag in the second case as if any REPLACE constraint is hit, an - ** OP_Delete or OP_IdxDelete instruction will be executed on each + ** OP_Delete or OP_IdxDelete instruction will be executed on each ** cursor that is disturbed. And these instructions both clear the ** VdbeCursor.seekResult variable, disabling the OPFLAG_USESEEKRESULT ** functionality. */ @@ -109507,7 +109507,7 @@ SQLITE_PRIVATE void sqlite3Insert( if( pTrigger ){ /* Code AFTER triggers */ - sqlite3CodeRowTrigger(pParse, pTrigger, TK_INSERT, 0, TRIGGER_AFTER, + sqlite3CodeRowTrigger(pParse, pTrigger, TK_INSERT, 0, TRIGGER_AFTER, pTab, regData-2-pTab->nCol, onError, endOfLoop); } @@ -109534,7 +109534,7 @@ insert_end: } /* - ** Return the number of rows inserted. If this routine is + ** Return the number of rows inserted. If this routine is ** generating code because of a call to sqlite3NestedParse(), do not ** invoke the callback function. */ @@ -109737,9 +109737,9 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( assert( v!=0 ); assert( pTab->pSelect==0 ); /* This table is not a VIEW */ nCol = pTab->nCol; - + /* pPk is the PRIMARY KEY index for WITHOUT ROWID tables and NULL for - ** normal rowid tables. nPkField is the number of key fields in the + ** normal rowid tables. nPkField is the number of key fields in the ** pPk index or 1 for a rowid table. In other words, nPkField is the ** number of fields in the true primary key of the table. */ if( HasRowid(pTab) ){ @@ -109896,10 +109896,10 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( ** the triggers and remove both the table and index b-tree entries. ** ** Otherwise, if there are no triggers or the recursive-triggers - ** flag is not set, but the table has one or more indexes, call - ** GenerateRowIndexDelete(). This removes the index b-tree entries - ** only. The table b-tree entry will be replaced by the new entry - ** when it is inserted. + ** flag is not set, but the table has one or more indexes, call + ** GenerateRowIndexDelete(). This removes the index b-tree entries + ** only. The table b-tree entry will be replaced by the new entry + ** when it is inserted. ** ** If either GenerateRowDelete() or GenerateRowIndexDelete() is called, ** also invoke MultiWrite() to indicate that this VDBE may require @@ -110007,7 +110007,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( sqlite3VdbeAddOp3(v, OP_MakeRecord, regIdx, pIdx->nColumn, aRegIdx[ix]); VdbeComment((v, "for %s", pIdx->zName)); - /* In an UPDATE operation, if this index is the PRIMARY KEY index + /* In an UPDATE operation, if this index is the PRIMARY KEY index ** of a WITHOUT ROWID table and there has been no change the ** primary key, then no collision is possible. The collision detection ** logic below can all be skipped. */ @@ -110018,7 +110018,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( /* Find out what action to take in case there is a uniqueness conflict */ onError = pIdx->onError; - if( onError==OE_None ){ + if( onError==OE_None ){ sqlite3VdbeResolveLabel(v, addrUniqueOk); continue; /* pIdx is not a UNIQUE index */ } @@ -110034,7 +110034,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( ** (3) There are no secondary indexes on the table ** (4) No delete triggers need to be fired if there is a conflict ** (5) No FK constraint counters need to be updated if a conflict occurs. - */ + */ if( (ix==0 && pIdx->pNext==0) /* Condition 3 */ && pPk==pIdx /* Condition 2 */ && onError==OE_Replace /* Condition 1 */ @@ -110077,7 +110077,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( } } if( isUpdate ){ - /* If currently processing the PRIMARY KEY of a WITHOUT ROWID + /* If currently processing the PRIMARY KEY of a WITHOUT ROWID ** table, only conflict if the new PRIMARY KEY values are actually ** different from the old. ** @@ -110087,7 +110087,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( int addrJump = sqlite3VdbeCurrentAddr(v)+pPk->nKeyCol; int op = OP_Ne; int regCmp = (IsPrimaryKeyIndex(pIdx) ? regIdx : regR); - + for(i=0; inKeyCol; i++){ char *p4 = (char*)sqlite3LocateCollSeq(pParse, pPk->azColl[i]); x = pPk->aiColumn[i]; @@ -110096,7 +110096,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( addrJump = addrUniqueOk; op = OP_Eq; } - sqlite3VdbeAddOp4(v, op, + sqlite3VdbeAddOp4(v, op, regOldData+1+x, addrJump, regCmp+i, p4, P4_COLLSEQ ); sqlite3VdbeChangeP5(v, SQLITE_NOTNULL); @@ -110142,7 +110142,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( sqlite3VdbeGoto(v, ipkTop+1); sqlite3VdbeJumpHere(v, ipkBottom); } - + *pbMayReplace = seenReplace; VdbeModuleComment((v, "END: GenCnstCks(%d)", seenReplace)); } @@ -110216,7 +110216,7 @@ SQLITE_PRIVATE void sqlite3CompleteInsertion( pik_flags |= (update_flags & OPFLAG_SAVEPOSITION); #ifdef SQLITE_ENABLE_PREUPDATE_HOOK if( update_flags==0 ){ - sqlite3VdbeAddOp4(v, OP_InsertInt, + sqlite3VdbeAddOp4(v, OP_InsertInt, iIdxCur+i, aRegIdx[i], 0, (char*)pTab, P4_TABLE ); sqlite3VdbeChangeP5(v, OPFLAG_ISNOOP); @@ -110396,7 +110396,7 @@ static int xferCompatibleIndex(Index *pDest, Index *pSrc){ ** ** INSERT INTO tab1 SELECT * FROM tab2; ** -** The xfer optimization transfers raw records from tab2 over to tab1. +** The xfer optimization transfers raw records from tab2 over to tab1. ** Columns are not decoded and reassembled, which greatly improves ** performance. Raw index records are transferred in the same way. ** @@ -110531,8 +110531,8 @@ static int xferOptimization( Column *pDestCol = &pDest->aCol[i]; Column *pSrcCol = &pSrc->aCol[i]; #ifdef SQLITE_ENABLE_HIDDEN_COLUMNS - if( (db->flags & SQLITE_Vacuum)==0 - && (pDestCol->colFlags | pSrcCol->colFlags) & COLFLAG_HIDDEN + if( (db->flags & SQLITE_Vacuum)==0 + && (pDestCol->colFlags | pSrcCol->colFlags) & COLFLAG_HIDDEN ){ return 0; /* Neither table may have __hidden__ columns */ } @@ -110550,7 +110550,7 @@ static int xferOptimization( if( i>0 ){ assert( pDestCol->pDflt==0 || pDestCol->pDflt->op==TK_SPAN ); assert( pSrcCol->pDflt==0 || pSrcCol->pDflt->op==TK_SPAN ); - if( (pDestCol->pDflt==0)!=(pSrcCol->pDflt==0) + if( (pDestCol->pDflt==0)!=(pSrcCol->pDflt==0) || (pDestCol->pDflt && strcmp(pDestCol->pDflt->u.zToken, pSrcCol->pDflt->u.zToken)!=0) ){ @@ -110577,7 +110577,7 @@ static int xferOptimization( #ifndef SQLITE_OMIT_FOREIGN_KEY /* Disallow the transfer optimization if the destination table constains ** any foreign key constraints. This is more restrictive than necessary. - ** But the main beneficiary of the transfer optimization is the VACUUM + ** But the main beneficiary of the transfer optimization is the VACUUM ** command, and the VACUUM command disables foreign key constraints. So ** the extra complication to make this rule less restrictive is probably ** not worth the effort. Ticket [6284df89debdfa61db8073e062908af0c9b6118e] @@ -110624,7 +110624,7 @@ static int xferOptimization( ** (If the destination is not initially empty, the rowid fields ** of index entries might need to change.) ** - ** (2) The destination has a unique index. (The xfer optimization + ** (2) The destination has a unique index. (The xfer optimization ** is unable to test uniqueness.) ** ** (3) onError is something other than OE_Abort and OE_Rollback. @@ -110687,14 +110687,14 @@ static int xferOptimization( /* This INSERT command is part of a VACUUM operation, which guarantees ** that the destination table is empty. If all indexed columns use ** collation sequence BINARY, then it can also be assumed that the - ** index will be populated by inserting keys in strictly sorted + ** index will be populated by inserting keys in strictly sorted ** order. In this case, instead of seeking within the b-tree as part ** of every OP_IdxInsert opcode, an OP_Last is added before the - ** OP_IdxInsert to seek to the point within the b-tree where each key + ** OP_IdxInsert to seek to the point within the b-tree where each key ** should be inserted. This is faster. ** ** If any of the indexed columns use a collation sequence other than - ** BINARY, this optimization is disabled. This is because the user + ** BINARY, this optimization is disabled. This is because the user ** might change the definition of a collation sequence and then run ** a VACUUM command. In that case keys may not be written in strictly ** sorted order. */ @@ -110807,7 +110807,7 @@ SQLITE_API int sqlite3_exec( rc = sqlite3_step(pStmt); /* Invoke the callback function if required */ - if( xCallback && (SQLITE_ROW==rc || + if( xCallback && (SQLITE_ROW==rc || (SQLITE_DONE==rc && !callbackIsInit && db->flags&SQLITE_NullCallback)) ){ if( !callbackIsInit ){ @@ -110917,7 +110917,7 @@ exec_out: ** This header file defines the SQLite interface for use by ** shared libraries that want to be imported as extensions into ** an SQLite instance. Shared libraries that intend to be loaded -** as extensions by SQLite should #include this file instead of +** as extensions by SQLite should #include this file instead of ** sqlite3.h. */ #ifndef SQLITE3EXT_H @@ -111448,14 +111448,14 @@ typedef int (*sqlite3_loadext_entry)( #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */ #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) - /* This case when the file really is being compiled as a loadable + /* This case when the file really is being compiled as a loadable ** extension */ # define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0; # define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v; # define SQLITE_EXTENSION_INIT3 \ extern const sqlite3_api_routines *sqlite3_api; #else - /* This case when the file is being statically linked into the + /* This case when the file is being statically linked into the ** application */ # define SQLITE_EXTENSION_INIT1 /*no-op*/ # define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */ @@ -111745,8 +111745,8 @@ static const sqlite3_api_routines sqlite3Apis = { sqlite3_memory_highwater, sqlite3_memory_used, #ifdef SQLITE_MUTEX_OMIT - 0, - 0, + 0, + 0, 0, 0, 0, @@ -111881,7 +111881,7 @@ static const sqlite3_api_routines sqlite3Apis = { ** ** Return SQLITE_OK on success and SQLITE_ERROR if something goes wrong. ** -** If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with +** If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with ** error message text. The calling function should free this memory ** by calling sqlite3DbFree(db, ). */ @@ -111905,7 +111905,7 @@ static int sqlite3LoadExtension( /* Shared library endings to try if zFile cannot be loaded as written */ static const char *azEndings[] = { #if SQLITE_OS_WIN - "dll" + "dll" #elif defined(__APPLE__) "dylib" #else @@ -111945,7 +111945,7 @@ static int sqlite3LoadExtension( if( pzErrMsg ){ *pzErrMsg = zErrmsg = sqlite3_malloc64(nMsg); if( zErrmsg ){ - sqlite3_snprintf(nMsg, zErrmsg, + sqlite3_snprintf(nMsg, zErrmsg, "unable to open shared library [%s]", zFile); sqlite3OsDlError(pVfs, nMsg-1, zErrmsg); } @@ -111957,9 +111957,9 @@ static int sqlite3LoadExtension( /* If no entry point was specified and the default legacy ** entry point name "sqlite3_extension_init" was not found, then ** construct an entry point name "sqlite3_X_init" where the X is - ** replaced by the lowercase value of every ASCII alphabetic + ** replaced by the lowercase value of every ASCII alphabetic ** character in the filename after the last "/" upto the first ".", - ** and eliding the first three characters if they are "lib". + ** and eliding the first three characters if they are "lib". ** Examples: ** ** /usr/local/lib/libExample5.4.3.so ==> sqlite3_example_init @@ -112079,7 +112079,7 @@ SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff){ */ typedef struct sqlite3AutoExtList sqlite3AutoExtList; static SQLITE_WSD struct sqlite3AutoExtList { - u32 nExt; /* Number of entries in aExt[] */ + u32 nExt; /* Number of entries in aExt[] */ void (**aExt)(void); /* Pointers to the extension init functions */ } sqlite3Autoext = { 0, 0 }; @@ -112266,7 +112266,7 @@ SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3 *db){ ** that includes the PragType_XXXX macro definitions and the aPragmaName[] ** object. This ensures that the aPragmaName[] table is arranged in ** lexicographical order to facility a binary search of the pragma name. -** Do not edit pragma.h directly. Edit and rerun the script in at +** Do not edit pragma.h directly. Edit and rerun the script in at ** ../tool/mkpragmatab.tcl. */ /************** Include pragma.h in the middle of pragma.c *******************/ /************** Begin file pragma.h ******************************************/ @@ -112339,52 +112339,52 @@ SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3 *db){ static const char *const pragCName[] = { /* 0 */ "cache_size", /* Used by: default_cache_size */ /* 1 */ "cid", /* Used by: table_info */ - /* 2 */ "name", - /* 3 */ "type", - /* 4 */ "notnull", - /* 5 */ "dflt_value", - /* 6 */ "pk", + /* 2 */ "name", + /* 3 */ "type", + /* 4 */ "notnull", + /* 5 */ "dflt_value", + /* 6 */ "pk", /* 7 */ "table", /* Used by: stats */ - /* 8 */ "index", - /* 9 */ "width", - /* 10 */ "height", + /* 8 */ "index", + /* 9 */ "width", + /* 10 */ "height", /* 11 */ "seqno", /* Used by: index_info */ - /* 12 */ "cid", - /* 13 */ "name", + /* 12 */ "cid", + /* 13 */ "name", /* 14 */ "seqno", /* Used by: index_xinfo */ - /* 15 */ "cid", - /* 16 */ "name", - /* 17 */ "desc", - /* 18 */ "coll", - /* 19 */ "key", + /* 15 */ "cid", + /* 16 */ "name", + /* 17 */ "desc", + /* 18 */ "coll", + /* 19 */ "key", /* 20 */ "seq", /* Used by: index_list */ - /* 21 */ "name", - /* 22 */ "unique", - /* 23 */ "origin", - /* 24 */ "partial", + /* 21 */ "name", + /* 22 */ "unique", + /* 23 */ "origin", + /* 24 */ "partial", /* 25 */ "seq", /* Used by: database_list */ - /* 26 */ "name", - /* 27 */ "file", + /* 26 */ "name", + /* 27 */ "file", /* 28 */ "seq", /* Used by: collation_list */ - /* 29 */ "name", + /* 29 */ "name", /* 30 */ "id", /* Used by: foreign_key_list */ - /* 31 */ "seq", - /* 32 */ "table", - /* 33 */ "from", - /* 34 */ "to", - /* 35 */ "on_update", - /* 36 */ "on_delete", - /* 37 */ "match", + /* 31 */ "seq", + /* 32 */ "table", + /* 33 */ "from", + /* 34 */ "to", + /* 35 */ "on_update", + /* 36 */ "on_delete", + /* 37 */ "match", /* 38 */ "table", /* Used by: foreign_key_check */ - /* 39 */ "rowid", - /* 40 */ "parent", - /* 41 */ "fkid", + /* 39 */ "rowid", + /* 40 */ "parent", + /* 41 */ "fkid", /* 42 */ "busy", /* Used by: wal_checkpoint */ - /* 43 */ "log", + /* 43 */ "log", /* 44 */ "checkpointed", /* 45 */ "timeout", /* Used by: busy_timeout */ /* 46 */ "database", /* Used by: lock_status */ - /* 47 */ "status", + /* 47 */ "status", }; /* Definitions of all built-in pragmas */ @@ -112891,7 +112891,7 @@ static const PragmaName aPragmaName[] = { /* ** Interpret the given string as a safety level. Return 0 for OFF, -** 1 for ON or NORMAL, 2 for FULL, and 3 for EXTRA. Return 1 for an empty or +** 1 for ON or NORMAL, 2 for FULL, and 3 for EXTRA. Return 1 for an empty or ** unrecognized string argument. The FULL and EXTRA option is disallowed ** if the omitFull parameter it 1. ** @@ -112950,7 +112950,7 @@ static int getLockingMode(const char *z){ /* ** Interpret the given string as an auto-vacuum mode value. ** -** The following strings, "none", "full" and "incremental" are +** The following strings, "none", "full" and "incremental" are ** acceptable, as are their numeric equivalents: 0, 1 and 2 respectively. */ static int getAutoVacuum(const char *z){ @@ -113102,7 +113102,7 @@ static const char *actionName(u8 action){ case OE_SetDflt: zName = "SET DEFAULT"; break; case OE_Cascade: zName = "CASCADE"; break; case OE_Restrict: zName = "RESTRICT"; break; - default: zName = "NO ACTION"; + default: zName = "NO ACTION"; assert( action==OE_None ); break; } return zName; @@ -113155,7 +113155,7 @@ static const PragmaName *pragmaLocate(const char *zName){ } /* -** Process a pragma statement. +** Process a pragma statement. ** ** Pragmas are of this form: ** @@ -113170,7 +113170,7 @@ static const PragmaName *pragmaLocate(const char *zName){ ** id and pId2 is any empty string. */ SQLITE_PRIVATE void sqlite3Pragma( - Parse *pParse, + Parse *pParse, Token *pId1, /* First part of [schema.]id field */ Token *pId2, /* Second part of [schema.]id field, or NULL */ Token *pValue, /* Token for , or NULL */ @@ -113198,8 +113198,8 @@ SQLITE_PRIVATE void sqlite3Pragma( if( iDb<0 ) return; pDb = &db->aDb[iDb]; - /* If the temp database has been explicitly named as part of the - ** pragma, make sure it is open. + /* If the temp database has been explicitly named as part of the + ** pragma, make sure it is open. */ if( iDb==1 && sqlite3OpenTempDatabase(pParse) ){ return; @@ -113267,7 +113267,7 @@ SQLITE_PRIVATE void sqlite3Pragma( } /* Register the result column names for pragmas that return results */ - if( (pPragma->mPragFlg & PragFlg_NoColumns)==0 + if( (pPragma->mPragFlg & PragFlg_NoColumns)==0 && ((pPragma->mPragFlg & PragFlg_NoColumns1)==0 || zRight==0) ){ setPragmaResultColumnNames(v, pPragma); @@ -113275,7 +113275,7 @@ SQLITE_PRIVATE void sqlite3Pragma( /* Jump to the appropriate pragma handler */ switch( pPragma->ePragTyp ){ - + #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED) /* ** PRAGMA [schema.]default_cache_size @@ -113387,7 +113387,7 @@ SQLITE_PRIVATE void sqlite3Pragma( ** PRAGMA [schema.]max_page_count=N ** ** The first form reports the current setting for the - ** maximum number of pages in the database file. The + ** maximum number of pages in the database file. The ** second form attempts to change this setting. Both ** forms return the current setting. ** @@ -113406,7 +113406,7 @@ SQLITE_PRIVATE void sqlite3Pragma( if( sqlite3Tolower(zLeft[0])=='p' ){ sqlite3VdbeAddOp2(v, OP_Pagecount, iDb, iReg); }else{ - sqlite3VdbeAddOp3(v, OP_MaxPgcnt, iDb, iReg, + sqlite3VdbeAddOp3(v, OP_MaxPgcnt, iDb, iReg, sqlite3AbsInt32(sqlite3Atoi(zRight))); } sqlite3VdbeAddOp2(v, OP_ResultRow, iReg, 1); @@ -113543,7 +113543,7 @@ SQLITE_PRIVATE void sqlite3Pragma( */ rc = sqlite3BtreeSetAutoVacuum(pBt, eAuto); if( rc==SQLITE_OK && (eAuto==1 || eAuto==2) ){ - /* When setting the auto_vacuum mode to either "full" or + /* When setting the auto_vacuum mode to either "full" or ** "incremental", write the value of meta[6] in the database ** file. Before writing to meta[6], check that meta[3] indicates ** that this really is an auto-vacuum capable database. @@ -113666,7 +113666,7 @@ SQLITE_PRIVATE void sqlite3Pragma( assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); if( !zRight ){ returnSingleInt(v, - (db->flags & SQLITE_CacheSpill)==0 ? 0 : + (db->flags & SQLITE_CacheSpill)==0 ? 0 : sqlite3BtreeSetSpillSize(pDb->pBt,0)); }else{ int size = 1; @@ -113840,7 +113840,7 @@ SQLITE_PRIVATE void sqlite3Pragma( Pager *pPager = sqlite3BtreePager(pDb->pBt); char *proxy_file_path = NULL; sqlite3_file *pFile = sqlite3PagerFile(pPager); - sqlite3OsFileControlHint(pFile, SQLITE_GET_LOCKPROXYFILE, + sqlite3OsFileControlHint(pFile, SQLITE_GET_LOCKPROXYFILE, &proxy_file_path); returnSingleText(v, proxy_file_path); }else{ @@ -113848,10 +113848,10 @@ SQLITE_PRIVATE void sqlite3Pragma( sqlite3_file *pFile = sqlite3PagerFile(pPager); int res; if( zRight[0] ){ - res=sqlite3OsFileControl(pFile, SQLITE_SET_LOCKPROXYFILE, + res=sqlite3OsFileControl(pFile, SQLITE_SET_LOCKPROXYFILE, zRight); } else { - res=sqlite3OsFileControl(pFile, SQLITE_SET_LOCKPROXYFILE, + res=sqlite3OsFileControl(pFile, SQLITE_SET_LOCKPROXYFILE, NULL); } if( res!=SQLITE_OK ){ @@ -113861,8 +113861,8 @@ SQLITE_PRIVATE void sqlite3Pragma( } break; } -#endif /* SQLITE_ENABLE_LOCKING_STYLE */ - +#endif /* SQLITE_ENABLE_LOCKING_STYLE */ + /* ** PRAGMA [schema.]synchronous ** PRAGMA [schema.]synchronous=OFF|ON|NORMAL|FULL|EXTRA @@ -113877,7 +113877,7 @@ SQLITE_PRIVATE void sqlite3Pragma( returnSingleInt(v, pDb->safety_level-1); }else{ if( !db->autoCommit ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "Safety level may not be changed inside a transaction"); }else{ int iLevel = (getSafetyLevel(zRight,0,1)+1) & PAGER_SYNCHRONOUS_MASK; @@ -113917,7 +113917,7 @@ SQLITE_PRIVATE void sqlite3Pragma( if( mask==SQLITE_DeferFKs ) db->nDeferredImmCons = 0; } - /* Many of the flag-pragmas modify the code generated by the SQL + /* Many of the flag-pragmas modify the code generated by the SQL ** compiler (eg. count_changes). So add an opcode to expire all ** compiled SQL statements after modifying a pragma value. */ @@ -114095,7 +114095,7 @@ SQLITE_PRIVATE void sqlite3Pragma( if( pTab ){ pFK = pTab->pFKey; if( pFK ){ - int i = 0; + int i = 0; pParse->nMem = 8; sqlite3CodeVerifySchema(pParse, iDb); while(pFK){ @@ -114257,7 +114257,7 @@ SQLITE_PRIVATE void sqlite3Pragma( #endif #ifndef SQLITE_OMIT_INTEGRITY_CHECK - /* Pragma "quick_check" is reduced version of + /* Pragma "quick_check" is reduced version of ** integrity_check designed to detect most database corruption ** without most of the overhead of a full integrity-check. */ @@ -114465,7 +114465,7 @@ SQLITE_PRIVATE void sqlite3Pragma( sqlite3VdbeAddOp2(v, OP_ResultRow, 7, 1); } #endif /* SQLITE_OMIT_BTREECOUNT */ - } + } } { static const int iLn = VDBE_OFFSET_LINENO(2); @@ -114501,7 +114501,7 @@ SQLITE_PRIVATE void sqlite3Pragma( ** encoding that will be used for the main database file if a new file ** is created. If an existing main database file is opened, then the ** default text encoding for the existing database is used. - ** + ** ** In all cases new databases created using the ATTACH command are ** created to use the same default text encoding as the main database. If ** the main database has not been initialized and/or created when ATTACH @@ -114539,9 +114539,9 @@ SQLITE_PRIVATE void sqlite3Pragma( ** will be overwritten when the schema is next loaded. If it does not ** already exists, it will be created to use the new encoding value. */ - if( - !(DbHasProperty(db, 0, DB_SchemaLoaded)) || - DbHasProperty(db, 0, DB_Empty) + if( + !(DbHasProperty(db, 0, DB_SchemaLoaded)) || + DbHasProperty(db, 0, DB_Empty) ){ for(pEnc=&encnames[0]; pEnc->zName; pEnc++){ if( 0==sqlite3StrICmp(zRight, pEnc->zName) ){ @@ -114685,8 +114685,8 @@ SQLITE_PRIVATE void sqlite3Pragma( if( zRight ){ sqlite3_wal_autocheckpoint(db, sqlite3Atoi(zRight)); } - returnSingleInt(v, - db->xWalCallback==sqlite3WalDefaultHook ? + returnSingleInt(v, + db->xWalCallback==sqlite3WalDefaultHook ? SQLITE_PTR_TO_INT(db->pWalArg) : 0); } break; @@ -114779,7 +114779,7 @@ SQLITE_PRIVATE void sqlite3Pragma( pBt = db->aDb[i].pBt; if( pBt==0 || sqlite3BtreePager(pBt)==0 ){ zState = "closed"; - }else if( sqlite3_file_control(db, i ? db->aDb[i].zDbSName : 0, + }else if( sqlite3_file_control(db, i ? db->aDb[i].zDbSName : 0, SQLITE_FCNTL_LOCKSTATE, &j)==SQLITE_OK ){ zState = azLockName[j]; } @@ -114838,7 +114838,7 @@ SQLITE_PRIVATE void sqlite3Pragma( /* The following block is a no-op unless SQLITE_DEBUG is defined. Its only ** purpose is to execute assert() statements to verify that if the ** PragFlg_NoColumns1 flag is set and the caller specified an argument - ** to the PRAGMA, the implementation has not added any OP_ResultRow + ** to the PRAGMA, the implementation has not added any OP_ResultRow ** instructions to the VM. */ if( (pPragma->mPragFlg & PragFlg_NoColumns1) && zRight ){ sqlite3VdbeVerifyNoResultRow(v); @@ -114869,7 +114869,7 @@ struct PragmaVtabCursor { char *azArg[2]; /* Value of the argument and schema */ }; -/* +/* ** Pragma virtual table module xConnect method. */ static int pragmaVtabConnect( @@ -114932,7 +114932,7 @@ static int pragmaVtabConnect( return rc; } -/* +/* ** Pragma virtual table module xDisconnect method. */ static int pragmaVtabDisconnect(sqlite3_vtab *pVtab){ @@ -115030,11 +115030,11 @@ static int pragmaVtabNext(sqlite3_vtab_cursor *pVtabCursor){ return rc; } -/* +/* ** Pragma virtual table module xFilter method. */ static int pragmaVtabFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -115085,11 +115085,11 @@ static int pragmaVtabEof(sqlite3_vtab_cursor *pVtabCursor){ } /* The xColumn method simply returns the corresponding column from -** the PRAGMA. +** the PRAGMA. */ static int pragmaVtabColumn( - sqlite3_vtab_cursor *pVtabCursor, - sqlite3_context *ctx, + sqlite3_vtab_cursor *pVtabCursor, + sqlite3_context *ctx, int i ){ PragmaVtabCursor *pCsr = (PragmaVtabCursor*)pVtabCursor; @@ -115102,7 +115102,7 @@ static int pragmaVtabColumn( return SQLITE_OK; } -/* +/* ** Pragma virtual table module xRowid method. */ static int pragmaVtabRowid(sqlite3_vtab_cursor *pVtabCursor, sqlite_int64 *p){ @@ -115342,7 +115342,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){ } /* If there is not already a read-only (or read-write) transaction opened - ** on the b-tree database, open one now. If a transaction is opened, it + ** on the b-tree database, open one now. If a transaction is opened, it ** will be closed before this function returns. */ sqlite3BtreeEnter(pDb->pBt); if( !sqlite3BtreeIsInReadTrans(pDb->pBt) ){ @@ -115447,7 +115447,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){ assert( db->init.busy ); { char *zSql; - zSql = sqlite3MPrintf(db, + zSql = sqlite3MPrintf(db, "SELECT name, rootpage, sql FROM \"%w\".%s ORDER BY rowid", db->aDb[iDb].zDbSName, zMasterName); #ifndef SQLITE_OMIT_AUTHORIZATION @@ -115475,7 +115475,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){ } if( rc==SQLITE_OK || (db->flags&SQLITE_RecoveryMode)){ /* Black magic: If the SQLITE_RecoveryMode flag is set, then consider - ** the schema loaded, even if errors occurred. In this situation the + ** the schema loaded, even if errors occurred. In this situation the ** current sqlite3_prepare() operation will fail, but the following one ** will attempt to compile the supplied statement against whatever subset ** of the schema was loaded before the error occurred. The primary @@ -115516,7 +115516,7 @@ error_out: SQLITE_PRIVATE int sqlite3Init(sqlite3 *db, char **pzErrMsg){ int i, rc; int commit_internal = !(db->flags&SQLITE_InternChanges); - + assert( sqlite3_mutex_held(db->mutex) ); assert( sqlite3BtreeHoldsMutex(db->aDb[0].pBt) ); assert( db->init.busy==0 ); @@ -115550,7 +115550,7 @@ SQLITE_PRIVATE int sqlite3Init(sqlite3 *db, char **pzErrMsg){ sqlite3CommitInternalChanges(db); } - return rc; + return rc; } /* @@ -115591,7 +115591,7 @@ static void schemaIsValid(Parse *pParse){ if( pBt==0 ) continue; /* If there is not already a read-only (or read-write) transaction opened - ** on the b-tree database, open one now. If a transaction is opened, it + ** on the b-tree database, open one now. If a transaction is opened, it ** will be closed immediately after reading the meta-value. */ if( !sqlite3BtreeIsInReadTrans(pBt) ){ rc = sqlite3BtreeBeginTrans(pBt, 0); @@ -115602,7 +115602,7 @@ static void schemaIsValid(Parse *pParse){ openedTransaction = 1; } - /* Read the schema cookie from the database. If it does not match the + /* Read the schema cookie from the database. If it does not match the ** value stored as part of the in-memory schema representation, ** set Parse.rc to SQLITE_SCHEMA. */ sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&cookie); @@ -115629,13 +115629,13 @@ static void schemaIsValid(Parse *pParse){ SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){ int i = -1000000; - /* If pSchema is NULL, then return -1000000. This happens when code in + /* If pSchema is NULL, then return -1000000. This happens when code in ** expr.c is trying to resolve a reference to a transient table (i.e. one - ** created by a sub-select). In this case the return value of this + ** created by a sub-select). In this case the return value of this ** function should never be used. ** ** We return -1000000 instead of the more usual -1 simply because using - ** -1000000 as the incorrect index into db->aDb[] is much + ** -1000000 as the incorrect index into db->aDb[] is much ** more likely to cause a segfault than -1 (of course there are assert() ** statements too, but it never hurts to play the odds). */ @@ -115706,8 +115706,8 @@ static int sqlite3Prepare( ** This thread is currently holding mutexes on all Btrees (because ** of the sqlite3BtreeEnterAll() in sqlite3LockAndPrepare()) so it ** is not possible for another thread to start a new schema change - ** while this routine is running. Hence, we do not need to hold - ** locks on the schema, we just need to make sure nobody else is + ** while this routine is running. Hence, we do not need to hold + ** locks on the schema, we just need to make sure nobody else is ** holding them. ** ** Note that setting READ_UNCOMMITTED overrides most lock detection, @@ -115928,7 +115928,7 @@ SQLITE_API int sqlite3_prepare_v2( ** Compile the UTF-16 encoded SQL statement zSql into a statement handle. */ static int sqlite3Prepare16( - sqlite3 *db, /* Database handle. */ + sqlite3 *db, /* Database handle. */ const void *zSql, /* UTF-16 encoded SQL statement. */ int nBytes, /* Length of zSql in bytes. */ int saveSqlFlag, /* True to save SQL text into the sqlite3_stmt */ @@ -115971,7 +115971,7 @@ static int sqlite3Prepare16( int chars_parsed = sqlite3Utf8CharLen(zSql8, (int)(zTail8-zSql8)); *pzTail = (u8 *)zSql + sqlite3Utf16ByteLen(zSql, chars_parsed); } - sqlite3DbFree(db, zSql8); + sqlite3DbFree(db, zSql8); rc = sqlite3ApiExit(db, rc); sqlite3_mutex_leave(db->mutex); return rc; @@ -115986,7 +115986,7 @@ static int sqlite3Prepare16( ** occurs. */ SQLITE_API int sqlite3_prepare16( - sqlite3 *db, /* Database handle. */ + sqlite3 *db, /* Database handle. */ const void *zSql, /* UTF-16 encoded SQL statement. */ int nBytes, /* Length of zSql in bytes. */ sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ @@ -115998,7 +115998,7 @@ SQLITE_API int sqlite3_prepare16( return rc; } SQLITE_API int sqlite3_prepare16_v2( - sqlite3 *db, /* Database handle. */ + sqlite3 *db, /* Database handle. */ const void *zSql, /* UTF-16 encoded SQL statement. */ int nBytes, /* Length of zSql in bytes. */ sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ @@ -116240,7 +116240,7 @@ SQLITE_PRIVATE int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *p for(i=0; i<3 && apAll[i]; i++){ p = apAll[i]; for(j=0; jn==aKeyword[j].nChar + if( p->n==aKeyword[j].nChar && sqlite3StrNICmp((char*)p->z, &zKeyText[aKeyword[j].i], p->n)==0 ){ jointype |= aKeyword[j].code; break; @@ -116262,9 +116262,9 @@ SQLITE_PRIVATE int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *p sqlite3ErrorMsg(pParse, "unknown or unsupported join type: " "%T %T%s%T", pA, pB, zSp, pC); jointype = JT_INNER; - }else if( (jointype & JT_OUTER)!=0 + }else if( (jointype & JT_OUTER)!=0 && (jointype & (JT_LEFT|JT_RIGHT))!=JT_LEFT ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "RIGHT and FULL OUTER JOINs are not currently supported"); jointype = JT_INNER; } @@ -116285,7 +116285,7 @@ static int columnIndex(Table *pTab, const char *zCol){ /* ** Search the first N tables in pSrc, from left to right, looking for a -** table that has a column named zCol. +** table that has a column named zCol. ** ** When found, set *piTab and *piCol to the table index and column index ** of the matching column and return TRUE. @@ -116323,7 +116323,7 @@ static int tableAndColumnIndex( ** ** (tab1.col1 = tab2.col2) ** -** where tab1 is the iSrc'th table in SrcList pSrc and tab2 is the +** where tab1 is the iSrc'th table in SrcList pSrc and tab2 is the ** (iSrc+1)'th. Column col1 is column iColLeft of tab1, and col2 is ** column iColRight of tab2. */ @@ -116400,7 +116400,7 @@ static void setJoinExpr(Expr *p, int iTable){ } setJoinExpr(p->pLeft, iTable); p = p->pRight; - } + } } /* @@ -116474,7 +116474,7 @@ static int sqliteProcessJoin(Parse *pParse, Select *p){ } /* Create extra terms on the WHERE clause for each column named - ** in the USING clause. Example: If the two tables to be joined are + ** in the USING clause. Example: If the two tables to be joined are ** A and B and the USING clause names X, Y, and Z, then add this ** to the WHERE clause: A.X=B.X AND A.Y=B.Y AND A.Z=B.Z ** Report an error if any column mentioned in the USING clause is @@ -116569,7 +116569,7 @@ static void pushOntoSorter( pParse->nMem += pSort->nOBSat; nKey = nExpr - pSort->nOBSat + bSeq; if( bSeq ){ - addrFirst = sqlite3VdbeAddOp1(v, OP_IfNot, regBase+nExpr); + addrFirst = sqlite3VdbeAddOp1(v, OP_IfNot, regBase+nExpr); }else{ addrFirst = sqlite3VdbeAddOp1(v, OP_SequenceTest, pSort->iECursor); } @@ -116683,7 +116683,7 @@ static void codeDistinct( ** ** If srcTab is negative, then the pEList expressions ** are evaluated in order to get the data for this row. If srcTab is -** zero or more, then data is pulled from srcTab and pEList is used only +** zero or more, then data is pulled from srcTab and pEList is used only ** to get the number of columns and the collation sequence for each column. */ static void selectInnerLoop( @@ -116761,8 +116761,8 @@ static void selectInnerLoop( } if( pSort && hasDistinct==0 && eDest!=SRT_EphemTab && eDest!=SRT_Table ){ /* For each expression in pEList that is a copy of an expression in - ** the ORDER BY clause (pSort->pOrderBy), set the associated - ** iOrderByCol value to one more than the index of the ORDER BY + ** the ORDER BY clause (pSort->pOrderBy), set the associated + ** iOrderByCol value to one more than the index of the ORDER BY ** expression within the sort-key that pushOntoSorter() will generate. ** This allows the pEList field to be omitted from the sorted record, ** saving space and CPU cycles. */ @@ -116774,7 +116774,7 @@ static void selectInnerLoop( } } regOrig = 0; - assert( eDest==SRT_Set || eDest==SRT_Mem + assert( eDest==SRT_Set || eDest==SRT_Mem || eDest==SRT_Coroutine || eDest==SRT_Output ); } nResultCol = sqlite3ExprCodeExprList(pParse,pEList,regResult,0,ecelFlags); @@ -116921,7 +116921,7 @@ static void selectInnerLoop( }else{ int r1 = sqlite3GetTempReg(pParse); assert( sqlite3Strlen30(pDest->zAffSdst)==nResultCol ); - sqlite3VdbeAddOp4(v, OP_MakeRecord, regResult, nResultCol, + sqlite3VdbeAddOp4(v, OP_MakeRecord, regResult, nResultCol, r1, pDest->zAffSdst, nResultCol); sqlite3ExprCacheAffinityChange(pParse, regResult, nResultCol); sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iParm, r1, regResult, nResultCol); @@ -116939,7 +116939,7 @@ static void selectInnerLoop( } /* If this is a scalar select that is part of an expression, then - ** store the results in the appropriate memory cell or array of + ** store the results in the appropriate memory cell or array of ** memory cells and break out of the scan loop. */ case SRT_Mem: { @@ -116995,7 +116995,7 @@ static void selectInnerLoop( /* If the destination is DistQueue, then cursor (iParm+1) is open ** on a second ephemeral index that holds all values every previously ** added to the queue. */ - addrTest = sqlite3VdbeAddOp4Int(v, OP_Found, iParm+1, 0, + addrTest = sqlite3VdbeAddOp4Int(v, OP_Found, iParm+1, 0, regResult, nResultCol); VdbeCoverage(v); } @@ -117197,7 +117197,7 @@ static void explainTempTable(Parse *pParse, const char *zUsage){ ** where iSub1 and iSub2 are the integers passed as the corresponding ** function parameters, and op is the text representation of the parameter ** of the same name. The parameter "op" must be one of TK_UNION, TK_EXCEPT, -** TK_INTERSECT or TK_ALL. The first form is used if argument bUseTmp is +** TK_INTERSECT or TK_ALL. The first form is used if argument bUseTmp is ** false, or the second form if it is true. */ static void explainComposite( @@ -117323,7 +117323,7 @@ static void generateSortTail( } #endif default: { - assert( eDest==SRT_Output || eDest==SRT_Coroutine ); + assert( eDest==SRT_Output || eDest==SRT_Coroutine ); testcase( eDest==SRT_Output ); testcase( eDest==SRT_Coroutine ); if( eDest==SRT_Output ){ @@ -117366,14 +117366,14 @@ static void generateSortTail( ** original CREATE TABLE statement if the expression is a column. The ** declaration type for a ROWID field is INTEGER. Exactly when an expression ** is considered a column can be complex in the presence of subqueries. The -** result-set expression in all of the following SELECT statements is +** result-set expression in all of the following SELECT statements is ** considered a column by this function. ** ** SELECT col FROM tbl; ** SELECT (SELECT col FROM tbl; ** SELECT (SELECT col FROM tbl); ** SELECT abc FROM (SELECT col AS abc FROM tbl); -** +** ** The declaration type for any expression other than a column is NULL. ** ** This routine has either 3 or 6 parameters depending on whether or not @@ -117385,7 +117385,7 @@ static void generateSortTail( # define columnType(A,B,C,D,E,F) columnTypeImpl(A,B,F) #endif static const char *columnTypeImpl( - NameContext *pNC, + NameContext *pNC, Expr *pExpr, #ifdef SQLITE_ENABLE_COLUMN_METADATA const char **pzOrigDb, @@ -117431,19 +117431,19 @@ static const char *columnTypeImpl( if( pTab==0 ){ /* At one time, code such as "SELECT new.x" within a trigger would ** cause this condition to run. Since then, we have restructured how - ** trigger code is generated and so this condition is no longer + ** trigger code is generated and so this condition is no longer ** possible. However, it can still be true for statements like ** the following: ** ** CREATE TABLE t1(col INTEGER); ** SELECT (SELECT t1.col) FROM FROM t1; ** - ** when columnType() is called on the expression "t1.col" in the + ** when columnType() is called on the expression "t1.col" in the ** sub-select. In this case, set the column type to NULL, even ** though it should really be "INTEGER". ** ** This is not a problem, as the column type of "t1.col" is never - ** used. When columnType() is called on the expression + ** used. When columnType() is called on the expression ** "(SELECT t1.col)", the correct type is returned (see the TK_SELECT ** branch below. */ break; @@ -117457,7 +117457,7 @@ static const char *columnTypeImpl( */ if( iCol>=0 && ALWAYS(iColpEList->nExpr) ){ /* If iCol is less than zero, then the expression requests the - ** rowid of the sub-select or view. This expression is legal (see + ** rowid of the sub-select or view. This expression is legal (see ** test case misc2.2.2) - it always evaluates to NULL. ** ** The ALWAYS() is because iCol>=pS->pEList->nExpr will have been @@ -117468,7 +117468,7 @@ static const char *columnTypeImpl( sNC.pSrcList = pS->pSrc; sNC.pNext = pNC; sNC.pParse = pNC->pParse; - zType = columnType(&sNC, p,&zOrigDb,&zOrigTab,&zOrigCol, &estWidth); + zType = columnType(&sNC, p,&zOrigDb,&zOrigTab,&zOrigCol, &estWidth); } }else if( pTab->pSchema ){ /* A real table */ @@ -117513,13 +117513,13 @@ static const char *columnTypeImpl( sNC.pSrcList = pS->pSrc; sNC.pNext = pNC; sNC.pParse = pNC->pParse; - zType = columnType(&sNC, p, &zOrigDb, &zOrigTab, &zOrigCol, &estWidth); + zType = columnType(&sNC, p, &zOrigDb, &zOrigTab, &zOrigCol, &estWidth); break; } #endif } -#ifdef SQLITE_ENABLE_COLUMN_METADATA +#ifdef SQLITE_ENABLE_COLUMN_METADATA if( pzOrigDb ){ assert( pzOrigTab && pzOrigCol ); *pzOrigDb = zOrigDb; @@ -117555,7 +117555,7 @@ static void generateColumnTypes( const char *zOrigCol = 0; zType = columnType(&sNC, p, &zOrigDb, &zOrigTab, &zOrigCol, 0); - /* The vdbe must make its own copy of the column-type and other + /* The vdbe must make its own copy of the column-type and other ** column specific strings, in case the schema is reset before this ** virtual machine is deleted. */ @@ -117623,7 +117623,7 @@ static void generateColumnNames( zCol = pTab->aCol[iCol].zName; } if( !shortNames && !fullNames ){ - sqlite3VdbeSetColName(v, i, COLNAME_NAME, + sqlite3VdbeSetColName(v, i, COLNAME_NAME, sqlite3DbStrDup(db, pEList->a[i].zSpan), SQLITE_DYNAMIC); }else if( fullNames ){ char *zName = 0; @@ -117747,7 +117747,7 @@ SQLITE_PRIVATE int sqlite3ColumnsFromExprList( /* ** Add type and collation information to a column list based on ** a SELECT statement. -** +** ** The column list presumably came from selectColumnNamesFromExprList(). ** The column list has only names, not types or collations. This ** routine goes through and adds the types and collations. @@ -117860,9 +117860,9 @@ SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse *pParse){ ** Compute the iLimit and iOffset fields of the SELECT based on the ** pLimit and pOffset expressions. pLimit and pOffset hold the expressions ** that appear in the original SQL statement after the LIMIT and OFFSET -** keywords. Or NULL if those keywords are omitted. iLimit and iOffset -** are the integer memory register numbers for counters used to compute -** the limit and offset. If there is no limit and/or offset, then +** keywords. Or NULL if those keywords are omitted. iLimit and iOffset +** are the integer memory register numbers for counters used to compute +** the limit and offset. If there is no limit and/or offset, then ** iLimit and iOffset are negative. ** ** This routine changes the values of iLimit and iOffset only if @@ -117886,7 +117886,7 @@ static void computeLimitRegisters(Parse *pParse, Select *p, int iBreak){ int n; if( p->iLimit ) return; - /* + /* ** "LIMIT -1" always shows all rows. There is some ** controversy about what the correct behavior should be. ** The current implementation interprets "LIMIT 0" to mean @@ -118014,7 +118014,7 @@ static KeyInfo *multiSelectOrderByKeyInfo(Parse *pParse, Select *p, int nExtra){ ** inserted into the Queue table. The iDistinct table keeps a copy of all rows ** that have ever been inserted into Queue and causes duplicates to be ** discarded. If the operator is UNION ALL, then duplicates are allowed. -** +** ** If the query has an ORDER BY, then entries in the Queue table are kept in ** ORDER BY order and the first entry is extracted for each cycle. Without ** an ORDER BY, the Queue table is just a FIFO. @@ -118215,7 +118215,7 @@ static int multiSelectValues( ** ** "p" points to the right-most of the two queries. the query on the ** left is p->pPrior. The left query could also be a compound query -** in which case this routine will be called recursively. +** in which case this routine will be called recursively. ** ** The results of the total query are to be written into a destination ** of type eDest with parameter iParm. @@ -118349,7 +118349,7 @@ static int multiSelect( p->nSelectRow = sqlite3LogEstAdd(p->nSelectRow, pPrior->nSelectRow); if( pPrior->pLimit && sqlite3ExprIsInteger(pPrior->pLimit, &nLimit) - && nLimit>0 && p->nSelectRow > sqlite3LogEst((u64)nLimit) + && nLimit>0 && p->nSelectRow > sqlite3LogEst((u64)nLimit) ){ p->nSelectRow = sqlite3LogEst((u64)nLimit); } @@ -118540,7 +118540,7 @@ static int multiSelect( explainComposite(pParse, p->op, iSub1, iSub2, p->op!=TK_ALL); - /* Compute collating sequences used by + /* Compute collating sequences used by ** temporary tables needed to implement the compound select. ** Attach the KeyInfo structure to all temporary tables. ** @@ -118646,7 +118646,7 @@ static int generateOutputSubroutine( addr = sqlite3VdbeCurrentAddr(v); iContinue = sqlite3VdbeMakeLabel(v); - /* Suppress duplicates for UNION, EXCEPT, and INTERSECT + /* Suppress duplicates for UNION, EXCEPT, and INTERSECT */ if( regPrev ){ int addr1, addr2; @@ -118688,7 +118688,7 @@ static int generateOutputSubroutine( int r1; testcase( pIn->nSdst>1 ); r1 = sqlite3GetTempReg(pParse); - sqlite3VdbeAddOp4(v, OP_MakeRecord, pIn->iSdst, pIn->nSdst, + sqlite3VdbeAddOp4(v, OP_MakeRecord, pIn->iSdst, pIn->nSdst, r1, pDest->zAffSdst, pIn->nSdst); sqlite3ExprCacheAffinityChange(pParse, pIn->iSdst, pIn->nSdst); sqlite3VdbeAddOp4Int(v, OP_IdxInsert, pDest->iSDParm, r1, @@ -118726,7 +118726,7 @@ static int generateOutputSubroutine( ** SRT_Output. This routine is never called with any other ** destination other than the ones handled above or SRT_Output. ** - ** For SRT_Output, results are stored in a sequence of registers. + ** For SRT_Output, results are stored in a sequence of registers. ** Then the OP_ResultRow opcode is used to cause sqlite3_step() to ** return the next row of result. */ @@ -118784,7 +118784,7 @@ static int generateOutputSubroutine( ** ** EofB: Called when data is exhausted from selectB. ** -** The implementation of the latter five subroutines depend on which +** The implementation of the latter five subroutines depend on which ** is used: ** ** @@ -118893,7 +118893,7 @@ static int multiSelectOrderBy( /* Patch up the ORDER BY clause */ - op = p->op; + op = p->op; pPrior = p->pPrior; assert( pPrior->pOrderBy==0 ); pOrderBy = p->pOrderBy; @@ -118969,7 +118969,7 @@ static int multiSelectOrderBy( } } } - + /* Separate the left and the right query from one another */ p->pPrior = 0; @@ -119014,7 +119014,7 @@ static int multiSelectOrderBy( sqlite3VdbeEndCoroutine(v, regAddrA); sqlite3VdbeJumpHere(v, addr1); - /* Generate a coroutine to evaluate the SELECT statement on + /* Generate a coroutine to evaluate the SELECT statement on ** the right - the "B" select */ addrSelectB = sqlite3VdbeCurrentAddr(v) + 1; @@ -119023,7 +119023,7 @@ static int multiSelectOrderBy( savedLimit = p->iLimit; savedOffset = p->iOffset; p->iLimit = regLimitB; - p->iOffset = 0; + p->iOffset = 0; explainSetInteger(iSub2, pParse->iNextSelectId); sqlite3Select(pParse, p, &destB); p->iLimit = savedLimit; @@ -119037,7 +119037,7 @@ static int multiSelectOrderBy( addrOutA = generateOutputSubroutine(pParse, p, &destA, pDest, regOutA, regPrev, pKeyDup, labelEnd); - + /* Generate a subroutine that outputs the current row of the B ** select as the next output row of the compound select. */ @@ -119054,7 +119054,7 @@ static int multiSelectOrderBy( */ if( op==TK_EXCEPT || op==TK_INTERSECT ){ addrEofA_noB = addrEofA = labelEnd; - }else{ + }else{ VdbeNoopComment((v, "eof-A subroutine")); addrEofA = sqlite3VdbeAddOp2(v, OP_Gosub, regOutB, addrOutB); addrEofA_noB = sqlite3VdbeAddOp2(v, OP_Yield, regAddrB, labelEnd); @@ -119069,7 +119069,7 @@ static int multiSelectOrderBy( if( op==TK_INTERSECT ){ addrEofB = addrEofA; if( p->nSelectRow > pPrior->nSelectRow ) p->nSelectRow = pPrior->nSelectRow; - }else{ + }else{ VdbeNoopComment((v, "eof-B subroutine")); addrEofB = sqlite3VdbeAddOp2(v, OP_Gosub, regOutA, addrOutA); sqlite3VdbeAddOp2(v, OP_Yield, regAddrA, labelEnd); VdbeCoverage(v); @@ -119157,13 +119157,13 @@ static void substSelect(Parse*, Select *, int, ExprList*, int); /* ** Scan through the expression pExpr. Replace every reference to ** a column in table number iTable with a copy of the iColumn-th -** entry in pEList. (But leave references to the ROWID column +** entry in pEList. (But leave references to the ROWID column ** unchanged.) ** ** This routine is part of the flattening procedure. A subquery ** whose result set is defined by pEList appears as entry in the ** FROM clause of a SELECT such that the VDBE cursor assigned to that -** FORM clause entry is iTable. This routine make the necessary +** FORM clause entry is iTable. This routine make the necessary ** changes to pExpr so that it refers directly to the source table ** of the subquery rather the result set of the subquery. */ @@ -119270,7 +119270,7 @@ static void substSelect( ** SELECT x+y AS a FROM t1 WHERE z<100 AND a>5 ** ** The code generated for this simplification gives the same result -** but only has to scan the data once. And because indices might +** but only has to scan the data once. And because indices might ** exist on the table t1, a complete scan of the data might be ** avoided. ** @@ -119289,7 +119289,7 @@ static void substSelect( ** (4) The subquery is not DISTINCT. ** ** (**) At one point restrictions (4) and (5) defined a subset of DISTINCT -** sub-queries that were excluded from this optimization. Restriction +** sub-queries that were excluded from this optimization. Restriction ** (4) has since been expanded to exclude all DISTINCT subqueries. ** ** (6) The subquery does not use aggregates or the outer query is not @@ -119307,7 +119307,7 @@ static void substSelect( ** ** (**) Restriction (10) was removed from the code on 2005-02-05 but we ** accidently carried the comment forward until 2014-09-15. Original -** text: "The subquery does not use aggregates or the outer query +** text: "The subquery does not use aggregates or the outer query ** does not use LIMIT." ** ** (11) The subquery and the outer query do not both have ORDER BY clauses. @@ -119325,10 +119325,10 @@ static void substSelect( ** ** (16) The outer query is not an aggregate or the subquery does ** not contain ORDER BY. (Ticket #2942) This used to not matter -** until we introduced the group_concat() function. +** until we introduced the group_concat() function. ** -** (17) The sub-query is not a compound select, or it is a UNION ALL -** compound clause made up entirely of non-aggregate queries, and +** (17) The sub-query is not a compound select, or it is a UNION ALL +** compound clause made up entirely of non-aggregate queries, and ** the parent query: ** ** * is not itself part of a compound select, @@ -119349,7 +119349,7 @@ static void substSelect( ** syntax error and return a detailed message. ** ** (18) If the sub-query is a compound select, then all terms of the -** ORDER by clause of the parent must be simple references to +** ORDER by clause of the parent must be simple references to ** columns of the sub-query. ** ** (19) The subquery does not use LIMIT or the outer query does not @@ -119371,7 +119371,7 @@ static void substSelect( ** parent to a compound query confuses the code that handles ** recursive queries in multiSelect(). ** -** (24) The subquery is not an aggregate that uses the built-in min() or +** (24) The subquery is not an aggregate that uses the built-in min() or ** or max() functions. (Without this restriction, a query like: ** "SELECT x FROM (SELECT max(y), x FROM t1)" would not necessarily ** return the value X for which Y was maximal.) @@ -119428,7 +119428,7 @@ static int flattenSubquery( return 0; /* Restriction (2b) */ } } - + pSubSrc = pSub->pSrc; assert( pSubSrc ); /* Prior to version 3.1.2, when LIMIT and OFFSET had to be simple constants, @@ -119467,7 +119467,7 @@ static int flattenSubquery( } /* OBSOLETE COMMENT 1: - ** Restriction 3: If the subquery is a join, make sure the subquery is + ** Restriction 3: If the subquery is a join, make sure the subquery is ** not used as the right operand of an outer join. Examples of why this ** is not allowed: ** @@ -119520,7 +119520,7 @@ static int flattenSubquery( assert( pSub->pSrc!=0 ); assert( pSub->pEList->nExpr==pSub1->pEList->nExpr ); if( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))!=0 - || (pSub1->pPrior && pSub1->op!=TK_ALL) + || (pSub1->pPrior && pSub1->op!=TK_ALL) || pSub1->pSrc->nSrc<1 ){ return 0; @@ -119548,13 +119548,13 @@ static int flattenSubquery( pParse->zAuthContext = zSavedAuthContext; /* If the sub-query is a compound SELECT statement, then (by restrictions - ** 17 and 18 above) it must be a UNION ALL and the parent query must + ** 17 and 18 above) it must be a UNION ALL and the parent query must ** be of the form: ** - ** SELECT FROM () + ** SELECT FROM () ** ** followed by any ORDER BY, LIMIT and/or OFFSET clauses. This block - ** creates N-1 copies of the parent query without any ORDER BY, LIMIT or + ** creates N-1 copies of the parent query without any ORDER BY, LIMIT or ** OFFSET clauses and joins them to the left-hand-side of the original ** using UNION ALL operators. In this case N is the number of simple ** select statements in the compound sub-query. @@ -119612,7 +119612,7 @@ static int flattenSubquery( if( db->mallocFailed ) return 1; } - /* Begin flattening the iFrom-th entry of the FROM clause + /* Begin flattening the iFrom-th entry of the FROM clause ** in the outer query. */ pSub = pSub1 = pSubitem->pSelect; @@ -119711,10 +119711,10 @@ static int flattenSubquery( memset(&pSubSrc->a[i], 0, sizeof(pSubSrc->a[i])); } pSrc->a[iFrom].fg.jointype = jointype; - - /* Now begin substituting subquery result set expressions for + + /* Now begin substituting subquery result set expressions for ** references to the iParent in the outer query. - ** + ** ** Example: ** ** SELECT a+5, b*10 FROM (SELECT x*3 AS a, y+10 AS b FROM t1) WHERE a>b; @@ -119757,7 +119757,7 @@ static int flattenSubquery( assert( pParent->pHaving==0 ); pParent->pHaving = pParent->pWhere; pParent->pWhere = pWhere; - pParent->pHaving = sqlite3ExprAnd(db, + pParent->pHaving = sqlite3ExprAnd(db, sqlite3ExprDup(db, pSub->pHaving, 0), pParent->pHaving ); assert( pParent->pGroupBy==0 ); @@ -119766,12 +119766,12 @@ static int flattenSubquery( pParent->pWhere = sqlite3ExprAnd(db, pWhere, pParent->pWhere); } substSelect(pParse, pParent, iParent, pSub->pEList, 0); - + /* The flattened query is distinct if either the inner or the - ** outer query is distinct. + ** outer query is distinct. */ pParent->selFlags |= pSub->selFlags & SF_Distinct; - + /* ** SELECT ... FROM (SELECT ... LIMIT a OFFSET b) LIMIT x OFFSET y; ** @@ -119886,7 +119886,7 @@ static int pushDownWhereTerms( ** * the argument to the aggregate function is a column value. ** ** If all of the above are true, then WHERE_ORDERBY_MIN or WHERE_ORDERBY_MAX -** is returned as appropriate. Also, *ppMinMax is set to point to the +** is returned as appropriate. Also, *ppMinMax is set to point to the ** list of arguments passed to the aggregate before returning. ** ** Or, if the conditions above are not met, *ppMinMax is set to 0 and @@ -119919,7 +119919,7 @@ static u8 minMaxQuery(AggInfo *pAggInfo, ExprList **ppMinMax){ /* ** The select statement passed as the first argument is an aggregate query. -** The second argument is the associated aggregate-info object. This +** The second argument is the associated aggregate-info object. This ** function tests if the SELECT is of the form: ** ** SELECT count(*) FROM @@ -119934,7 +119934,7 @@ static Table *isSimpleCount(Select *p, AggInfo *pAggInfo){ assert( !p->pGroupBy ); - if( p->pWhere || p->pEList->nExpr!=1 + if( p->pWhere || p->pEList->nExpr!=1 || p->pSrc->nSrc!=1 || p->pSrc->a[0].pSelect ){ return 0; @@ -119955,8 +119955,8 @@ static Table *isSimpleCount(Select *p, AggInfo *pAggInfo){ /* ** If the source-list item passed as an argument was augmented with an ** INDEXED BY clause, then try to locate the specified index. If there -** was such a clause and the named index cannot be found, return -** SQLITE_ERROR and leave an error in pParse. Otherwise, populate +** was such a clause and the named index cannot be found, return +** SQLITE_ERROR and leave an error in pParse. Otherwise, populate ** pFrom->pIndex and return SQLITE_OK. */ SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *pParse, struct SrcList_item *pFrom){ @@ -119964,8 +119964,8 @@ SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *pParse, struct SrcList_item *pF Table *pTab = pFrom->pTab; char *zIndexedBy = pFrom->u1.zIndexedBy; Index *pIdx; - for(pIdx=pTab->pIndex; - pIdx && sqlite3StrICmp(pIdx->zName, zIndexedBy); + for(pIdx=pTab->pIndex; + pIdx && sqlite3StrICmp(pIdx->zName, zIndexedBy); pIdx=pIdx->pNext ); if( !pIdx ){ @@ -119978,7 +119978,7 @@ SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *pParse, struct SrcList_item *pF return SQLITE_OK; } /* -** Detect compound SELECT statements that use an ORDER BY clause with +** Detect compound SELECT statements that use an ORDER BY clause with ** an alternative collating sequence. ** ** SELECT ... FROM t1 EXCEPT SELECT ... FROM t2 ORDER BY .. COLLATE ... @@ -120063,9 +120063,9 @@ static int cannotBeFunction(Parse *pParse, struct SrcList_item *pFrom){ #ifndef SQLITE_OMIT_CTE /* -** Argument pWith (which may be NULL) points to a linked list of nested -** WITH contexts, from inner to outermost. If the table identified by -** FROM clause element pItem is really a common-table-expression (CTE) +** Argument pWith (which may be NULL) points to a linked list of nested +** WITH contexts, from inner to outermost. If the table identified by +** FROM clause element pItem is really a common-table-expression (CTE) ** then return a pointer to the CTE definition for that table. Otherwise ** return NULL. ** @@ -120100,7 +120100,7 @@ static struct Cte *searchWith( ** onto the top of the stack. If argument bFree is true, then this ** WITH clause will never be popped from the stack. In this case it ** should be freed along with the Parse object. In other cases, when -** bFree==0, the With object will be freed along with the SELECT +** bFree==0, the With object will be freed along with the SELECT ** statement with which it is associated. */ SQLITE_PRIVATE void sqlite3WithPush(Parse *pParse, With *pWith, u8 bFree){ @@ -120114,7 +120114,7 @@ SQLITE_PRIVATE void sqlite3WithPush(Parse *pParse, With *pWith, u8 bFree){ } /* -** This function checks if argument pFrom refers to a CTE declared by +** This function checks if argument pFrom refers to a CTE declared by ** a WITH clause on the stack currently maintained by the parser. And, ** if currently processing a CTE expression, if it is a recursive ** reference to the current CTE. @@ -120129,7 +120129,7 @@ SQLITE_PRIVATE void sqlite3WithPush(Parse *pParse, With *pWith, u8 bFree){ ** parser and some error code other than SQLITE_OK returned. */ static int withExpand( - Walker *pWalker, + Walker *pWalker, struct SrcList_item *pFrom ){ Parse *pParse = pWalker->pParse; @@ -120178,8 +120178,8 @@ static int withExpand( SrcList *pSrc = pFrom->pSelect->pSrc; for(i=0; inSrc; i++){ struct SrcList_item *pItem = &pSrc->a[i]; - if( pItem->zDatabase==0 - && pItem->zName!=0 + if( pItem->zDatabase==0 + && pItem->zName!=0 && 0==sqlite3StrICmp(pItem->zName, pCte->zName) ){ pItem->pTab = pTab; @@ -120190,7 +120190,7 @@ static int withExpand( } } - /* Only one recursive reference is permitted. */ + /* Only one recursive reference is permitted. */ if( pTab->nTabRef>2 ){ sqlite3ErrorMsg( pParse, "multiple references to recursive table: %s", pCte->zName @@ -120245,12 +120245,12 @@ static int withExpand( #ifndef SQLITE_OMIT_CTE /* -** If the SELECT passed as the second argument has an associated WITH +** If the SELECT passed as the second argument has an associated WITH ** clause, pop it from the stack stored as part of the Parse object. ** ** This function is used as the xSelectCallback2() callback by ** sqlite3SelectExpand() when walking a SELECT tree to resolve table -** names and other FROM clause elements. +** names and other FROM clause elements. */ static void selectPopWith(Walker *pWalker, Select *p){ Parse *pParse = pWalker->pParse; @@ -120273,7 +120273,7 @@ static void selectPopWith(Walker *pWalker, Select *p){ ** (1) Make sure VDBE cursor numbers have been assigned to every ** element of the FROM clause. ** -** (2) Fill in the pTabList->a[].pTab fields in the SrcList that +** (2) Fill in the pTabList->a[].pTab fields in the SrcList that ** defines FROM clause. When views appear in the FROM clause, ** fill pTabList->a[].pSelect with a copy of the SELECT statement ** that implements the view. A copy is made of the view's SELECT @@ -120483,7 +120483,7 @@ static int selectExpander(Walker *pWalker, Select *p){ ** bit set. */ if( (p->selFlags & SF_IncludeHidden)==0 - && IsHiddenColumn(&pTab->aCol[j]) + && IsHiddenColumn(&pTab->aCol[j]) ){ continue; } @@ -120493,7 +120493,7 @@ static int selectExpander(Walker *pWalker, Select *p){ if( (pFrom->fg.jointype & JT_NATURAL)!=0 && tableAndColumnIndex(pTabList, i, zName, 0, 0) ){ - /* In a NATURAL join, omit the join columns from the + /* In a NATURAL join, omit the join columns from the ** table to the right of the join */ continue; } @@ -120565,8 +120565,8 @@ static int selectExpander(Walker *pWalker, Select *p){ ** ** When this routine is the Walker.xExprCallback then expression trees ** are walked without any actions being taken at each node. Presumably, -** when this routine is used for Walker.xExprCallback then -** Walker.xSelectCallback is set to do something useful for every +** when this routine is used for Walker.xExprCallback then +** Walker.xSelectCallback is set to do something useful for every ** subquery in the parser tree. */ SQLITE_PRIVATE int sqlite3ExprWalkNoop(Walker *NotUsed, Expr *NotUsed2){ @@ -120811,7 +120811,7 @@ static void updateAccumulator(Parse *pParse, AggInfo *pAggInfo){ } /* Before populating the accumulator registers, clear the column cache. - ** Otherwise, if any of the required column values are already present + ** Otherwise, if any of the required column values are already present ** in registers, sqlite3ExprCode() may use OP_SCopy to copy the value ** to pC->iMem. But by the time the value is used, the original register ** may have been used, invalidating the underlying buffer holding the @@ -120861,7 +120861,7 @@ static void explainSimpleCount( #endif /* -** Generate code for the SELECT statement given in the p argument. +** Generate code for the SELECT statement given in the p argument. ** ** The results are returned according to the SelectDest structure. ** See comments in sqliteInt.h for further information. @@ -120918,7 +120918,7 @@ SQLITE_PRIVATE int sqlite3Select( assert( p->pOrderBy==0 || pDest->eDest!=SRT_DistQueue ); assert( p->pOrderBy==0 || pDest->eDest!=SRT_Queue ); if( IgnorableOrderby(pDest) ){ - assert(pDest->eDest==SRT_Exists || pDest->eDest==SRT_Union || + assert(pDest->eDest==SRT_Exists || pDest->eDest==SRT_Union || pDest->eDest==SRT_Except || pDest->eDest==SRT_Discard || pDest->eDest==SRT_Queue || pDest->eDest==SRT_DistFifo || pDest->eDest==SRT_DistQueue || pDest->eDest==SRT_Fifo); @@ -121133,7 +121133,7 @@ SQLITE_PRIVATE int sqlite3Select( } #endif - /* If the query is DISTINCT with an ORDER BY but is not an aggregate, and + /* If the query is DISTINCT with an ORDER BY but is not an aggregate, and ** if the select-list is the same as the ORDER BY list, then this query ** can be rewritten as a GROUP BY. In other words, this: ** @@ -121143,12 +121143,12 @@ SQLITE_PRIVATE int sqlite3Select( ** ** SELECT xyz FROM ... GROUP BY xyz ORDER BY xyz ** - ** The second form is preferred as a single index (or temp-table) may be - ** used for both the ORDER BY and DISTINCT processing. As originally - ** written the query must use a temp-table for at least one of the ORDER + ** The second form is preferred as a single index (or temp-table) may be + ** used for both the ORDER BY and DISTINCT processing. As originally + ** written the query must use a temp-table for at least one of the ORDER ** BY and DISTINCT, and an index or separate temp-table for the other. */ - if( (p->selFlags & (SF_Distinct|SF_Aggregate))==SF_Distinct + if( (p->selFlags & (SF_Distinct|SF_Aggregate))==SF_Distinct && sqlite3ExprListCompare(sSort.pOrderBy, pEList, -1)==0 ){ p->selFlags &= ~SF_Distinct; @@ -121243,7 +121243,7 @@ SQLITE_PRIVATE int sqlite3Select( } } - /* If sorting index that was created by a prior OP_OpenEphemeral + /* If sorting index that was created by a prior OP_OpenEphemeral ** instruction ended up not being needed, then change the OP_OpenEphemeral ** into an OP_Noop. */ @@ -121296,8 +121296,8 @@ SQLITE_PRIVATE int sqlite3Select( } /* If there is both a GROUP BY and an ORDER BY clause and they are - ** identical, then it may be possible to disable the ORDER BY clause - ** on the grounds that the GROUP BY will cause elements to come out + ** identical, then it may be possible to disable the ORDER BY clause + ** on the grounds that the GROUP BY will cause elements to come out ** in the correct order. It also may not - the GROUP BY might use a ** database index that causes rows to be grouped together as required ** but not actually sorted. Either way, record the fact that the @@ -121306,7 +121306,7 @@ SQLITE_PRIVATE int sqlite3Select( if( sqlite3ExprListCompare(pGroupBy, sSort.pOrderBy, -1)==0 ){ orderByGrp = 1; } - + /* Create a label to jump to when we want to abort the query */ addrEnd = sqlite3VdbeMakeLabel(v); @@ -121353,12 +121353,12 @@ SQLITE_PRIVATE int sqlite3Select( /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction - ** will be converted into a Noop. + ** will be converted into a Noop. */ sAggInfo.sortingIdx = pParse->nTab++; pKeyInfo = keyInfoFromExprList(pParse, pGroupBy, 0, sAggInfo.nColumn); - addrSortingIdx = sqlite3VdbeAddOp4(v, OP_SorterOpen, - sAggInfo.sortingIdx, sAggInfo.nSortingColumn, + addrSortingIdx = sqlite3VdbeAddOp4(v, OP_SorterOpen, + sAggInfo.sortingIdx, sAggInfo.nSortingColumn, 0, (char*)pKeyInfo, P4_KEYINFO); /* Initialize memory locations used by GROUP BY aggregate processing @@ -121406,7 +121406,7 @@ SQLITE_PRIVATE int sqlite3Select( int nCol; int nGroupBy; - explainTempTable(pParse, + explainTempTable(pParse, (sDistinct.isTnct && (p->selFlags&SF_Distinct)==0) ? "DISTINCT" : "GROUP BY"); @@ -121428,7 +121428,7 @@ SQLITE_PRIVATE int sqlite3Select( struct AggInfo_col *pCol = &sAggInfo.aCol[i]; if( pCol->iSorterColumn>=j ){ int r1 = j + regBase; - sqlite3ExprCodeGetColumnToReg(pParse, + sqlite3ExprCodeGetColumnToReg(pParse, pCol->pTab, pCol->iColumn, pCol->iTable, r1); j++; } @@ -121454,9 +121454,9 @@ SQLITE_PRIVATE int sqlite3Select( ** clause, cancel the ephemeral table open coded earlier. ** ** This is an optimization - the correct answer should result regardless. - ** Use the SQLITE_GroupByOrder flag with SQLITE_TESTCTRL_OPTIMIZER to + ** Use the SQLITE_GroupByOrder flag with SQLITE_TESTCTRL_OPTIMIZER to ** disable this optimization for testing purposes. */ - if( orderByGrp && OptimizationEnabled(db, SQLITE_GroupByOrder) + if( orderByGrp && OptimizationEnabled(db, SQLITE_GroupByOrder) && (groupBySort || sqlite3WhereIsSorted(pWInfo)) ){ sSort.pOrderBy = 0; @@ -121561,7 +121561,7 @@ SQLITE_PRIVATE int sqlite3Select( sqlite3VdbeResolveLabel(v, addrReset); resetAccumulator(pParse, &sAggInfo); sqlite3VdbeAddOp1(v, OP_Return, regReset); - + } /* endif pGroupBy. Begin aggregate queries without GROUP BY: */ else { ExprList *pDel = 0; @@ -121597,7 +121597,7 @@ SQLITE_PRIVATE int sqlite3Select( ** ** (2013-10-03) Do not count the entries in a partial index. ** - ** In practice the KeyInfo structure will not be used. It is only + ** In practice the KeyInfo structure will not be used. It is only ** passed to keep OP_OpenRead happy. */ if( !HasRowid(pTab) ) pBest = sqlite3PrimaryKeyIndex(pTab); @@ -121632,11 +121632,11 @@ SQLITE_PRIVATE int sqlite3Select( ** SELECT max(x) FROM ... ** ** If it is, then ask the code in where.c to attempt to sort results - ** as if there was an "ORDER ON x" or "ORDER ON x DESC" clause. + ** as if there was an "ORDER ON x" or "ORDER ON x DESC" clause. ** If where.c is able to produce results sorted in this order, then - ** add vdbe code to break out of the processing loop after the - ** first iteration (since the first iteration of the loop is - ** guaranteed to operate on the row with the minimum or maximum + ** add vdbe code to break out of the processing loop after the + ** first iteration (since the first iteration of the loop is + ** guaranteed to operate on the row with the minimum or maximum ** value of x, the only row required). ** ** A special flag must be passed to sqlite3WhereBegin() to slightly @@ -121647,13 +121647,13 @@ SQLITE_PRIVATE int sqlite3Select( ** for x. ** ** + The optimizer code in where.c (the thing that decides which - ** index or indices to use) should place a different priority on + ** index or indices to use) should place a different priority on ** satisfying the 'ORDER BY' clause than it does in other cases. ** Refer to code and comments in where.c for details. */ ExprList *pMinMax = 0; u8 flag = WHERE_ORDERBY_NORMAL; - + assert( p->pGroupBy==0 ); assert( flag==0 ); if( p->pHaving==0 ){ @@ -121670,7 +121670,7 @@ SQLITE_PRIVATE int sqlite3Select( pMinMax->a[0].pExpr->op = TK_COLUMN; } } - + /* This case runs if the aggregate has no GROUP BY clause. The ** processing is much simpler since there is only a single row ** of output. @@ -121694,12 +121694,12 @@ SQLITE_PRIVATE int sqlite3Select( sSort.pOrderBy = 0; sqlite3ExprIfFalse(pParse, pHaving, addrEnd, SQLITE_JUMPIFNULL); - selectInnerLoop(pParse, p, p->pEList, -1, 0, 0, + selectInnerLoop(pParse, p, p->pEList, -1, 0, 0, pDest, addrEnd, addrEnd); sqlite3ExprListDelete(db, pDel); } sqlite3VdbeResolveLabel(v, addrEnd); - + } /* endif aggregate query */ if( sDistinct.eTnctType==WHERE_DISTINCT_UNORDERED ){ @@ -121857,7 +121857,7 @@ malloc_failed: ** at the conclusion of the call. ** ** The result that is written to ***pazResult is held in memory obtained -** from malloc(). But the caller cannot free this memory directly. +** from malloc(). But the caller cannot free this memory directly. ** Instead, the entire table should be passed to sqlite3_free_table() when ** the calling procedure is finished using it. */ @@ -121980,7 +121980,7 @@ SQLITE_PRIVATE void sqlite3DeleteTriggerStep(sqlite3 *db, TriggerStep *pTriggerS } /* -** Given table pTab, return a list of all the triggers attached to +** Given table pTab, return a list of all the triggers attached to ** the table. The list is connected by Trigger.pNext pointers. ** ** All of the triggers on pTab that are in the same database as pTab @@ -122007,7 +122007,7 @@ SQLITE_PRIVATE Trigger *sqlite3TriggerList(Parse *pParse, Table *pTab){ for(p=sqliteHashFirst(&pTmpSchema->trigHash); p; p=sqliteHashNext(p)){ Trigger *pTrig = (Trigger *)sqliteHashData(p); if( pTrig->pTabSchema==pTab->pSchema - && 0==sqlite3StrICmp(pTrig->table, pTab->zName) + && 0==sqlite3StrICmp(pTrig->table, pTab->zName) ){ pTrig->pNext = (pList ? pList : pTab->pTrigger); pList = pTrig; @@ -122148,7 +122148,7 @@ SQLITE_PRIVATE void sqlite3BeginTrigger( ** of triggers. */ if( pTab->pSelect && tr_tm!=TK_INSTEAD ){ - sqlite3ErrorMsg(pParse, "cannot create %s trigger on view: %S", + sqlite3ErrorMsg(pParse, "cannot create %s trigger on view: %S", (tr_tm == TK_BEFORE)?"BEFORE":"AFTER", pTableName, 0); goto trigger_cleanup; } @@ -122237,8 +122237,8 @@ SQLITE_PRIVATE void sqlite3FinishTrigger( } sqlite3TokenInit(&nameToken, pTrig->zName); sqlite3FixInit(&sFix, pParse, iDb, "trigger", &nameToken); - if( sqlite3FixTriggerStep(&sFix, pTrig->step_list) - || sqlite3FixExpr(&sFix, pTrig->pWhen) + if( sqlite3FixTriggerStep(&sFix, pTrig->step_list) + || sqlite3FixExpr(&sFix, pTrig->pWhen) ){ goto triggerfinish_cleanup; } @@ -122292,7 +122292,7 @@ triggerfinish_cleanup: ** a trigger step. Return a pointer to a TriggerStep structure. ** ** The parser calls this routine when it finds a SELECT statement in -** body of a TRIGGER. +** body of a TRIGGER. */ SQLITE_PRIVATE TriggerStep *sqlite3TriggerSelectStep(sqlite3 *db, Select *pSelect){ TriggerStep *pTriggerStep = sqlite3DbMallocZero(db, sizeof(TriggerStep)); @@ -122407,7 +122407,7 @@ SQLITE_PRIVATE TriggerStep *sqlite3TriggerDeleteStep( return pTriggerStep; } -/* +/* ** Recursively delete a Trigger structure */ SQLITE_PRIVATE void sqlite3DeleteTrigger(sqlite3 *db, Trigger *pTrigger){ @@ -122421,7 +122421,7 @@ SQLITE_PRIVATE void sqlite3DeleteTrigger(sqlite3 *db, Trigger *pTrigger){ } /* -** This function is called to drop a trigger from the database schema. +** This function is called to drop a trigger from the database schema. ** ** This may be called directly from the parser and therefore identifies ** the trigger by name. The sqlite3DropTriggerPtr() routine does the @@ -122476,7 +122476,7 @@ static Table *tableOfTrigger(Trigger *pTrigger){ /* -** Drop a trigger given a pointer to that trigger. +** Drop a trigger given a pointer to that trigger. */ SQLITE_PRIVATE void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){ Table *pTable; @@ -122552,12 +122552,12 @@ static int checkColumnOverlap(IdList *pIdList, ExprList *pEList){ for(e=0; enExpr; e++){ if( sqlite3IdListIndex(pIdList, pEList->a[e].zName)>=0 ) return 1; } - return 0; + return 0; } /* ** Return a list of all triggers on table pTab if there exists at least -** one trigger that must be fired when an operation of type 'op' is +** one trigger that must be fired when an operation of type 'op' is ** performed on the table, and, if that operation is an UPDATE, if at ** least one of the columns in pChanges is being modified. */ @@ -122621,13 +122621,13 @@ static SrcList *targetSrcList( } /* -** Generate VDBE code for the statements inside the body of a single +** Generate VDBE code for the statements inside the body of a single ** trigger. */ static int codeTriggerProgram( Parse *pParse, /* The parser context */ TriggerStep *pStepList, /* List of statements inside the trigger body */ - int orconf /* Conflict algorithm. (OE_Abort, etc) */ + int orconf /* Conflict algorithm. (OE_Abort, etc) */ ){ TriggerStep *pStep; Vdbe *v = pParse->pVdbe; @@ -122655,25 +122655,25 @@ static int codeTriggerProgram( switch( pStep->op ){ case TK_UPDATE: { - sqlite3Update(pParse, + sqlite3Update(pParse, targetSrcList(pParse, pStep), - sqlite3ExprListDup(db, pStep->pExprList, 0), - sqlite3ExprDup(db, pStep->pWhere, 0), + sqlite3ExprListDup(db, pStep->pExprList, 0), + sqlite3ExprDup(db, pStep->pWhere, 0), pParse->eOrconf ); break; } case TK_INSERT: { - sqlite3Insert(pParse, + sqlite3Insert(pParse, targetSrcList(pParse, pStep), - sqlite3SelectDup(db, pStep->pSelect, 0), - sqlite3IdListDup(db, pStep->pIdList), + sqlite3SelectDup(db, pStep->pSelect, 0), + sqlite3IdListDup(db, pStep->pIdList), pParse->eOrconf ); break; } case TK_DELETE: { - sqlite3DeleteFrom(pParse, + sqlite3DeleteFrom(pParse, targetSrcList(pParse, pStep), sqlite3ExprDup(db, pStep->pWhere, 0) ); @@ -122687,7 +122687,7 @@ static int codeTriggerProgram( sqlite3SelectDelete(db, pSelect); break; } - } + } if( pStep->op!=TK_SELECT ){ sqlite3VdbeAddOp0(v, OP_ResetCount); } @@ -122732,7 +122732,7 @@ static void transferParseError(Parse *pTo, Parse *pFrom){ } /* -** Create and populate a new TriggerPrg object with a sub-program +** Create and populate a new TriggerPrg object with a sub-program ** implementing trigger pTrigger with ON CONFLICT policy orconf. */ static TriggerPrg *codeRowTrigger( @@ -122755,7 +122755,7 @@ static TriggerPrg *codeRowTrigger( assert( pTop->pVdbe ); /* Allocate the TriggerPrg and SubProgram objects. To ensure that they - ** are freed if an error occurs, link them into the Parse.pTriggerPrg + ** are freed if an error occurs, link them into the Parse.pTriggerPrg ** list of the top-level Parse object sooner rather than later. */ pPrg = sqlite3DbMallocZero(db, sizeof(TriggerPrg)); if( !pPrg ) return 0; @@ -122769,7 +122769,7 @@ static TriggerPrg *codeRowTrigger( pPrg->aColmask[0] = 0xffffffff; pPrg->aColmask[1] = 0xffffffff; - /* Allocate and populate a new Parse context to use for coding the + /* Allocate and populate a new Parse context to use for coding the ** trigger sub-program. */ pSubParse = sqlite3StackAllocZero(db, sizeof(Parse)); if( !pSubParse ) return 0; @@ -122784,7 +122784,7 @@ static TriggerPrg *codeRowTrigger( v = sqlite3GetVdbe(pSubParse); if( v ){ - VdbeComment((v, "Start: %s.%s (%s %s%s%s ON %s)", + VdbeComment((v, "Start: %s.%s (%s %s%s%s ON %s)", pTrigger->zName, onErrorText(orconf), (pTrigger->tr_tm==TRIGGER_BEFORE ? "BEFORE" : "AFTER"), (pTrigger->op==TK_UPDATE ? "UPDATE" : ""), @@ -122793,18 +122793,18 @@ static TriggerPrg *codeRowTrigger( pTab->zName )); #ifndef SQLITE_OMIT_TRACE - sqlite3VdbeChangeP4(v, -1, + sqlite3VdbeChangeP4(v, -1, sqlite3MPrintf(db, "-- TRIGGER %s", pTrigger->zName), P4_DYNAMIC ); #endif /* If one was specified, code the WHEN clause. If it evaluates to false - ** (or NULL) the sub-vdbe is immediately halted by jumping to the + ** (or NULL) the sub-vdbe is immediately halted by jumping to the ** OP_Halt inserted at the end of the program. */ if( pTrigger->pWhen ){ pWhen = sqlite3ExprDup(db, pTrigger->pWhen, 0); - if( SQLITE_OK==sqlite3ResolveExprNames(&sNC, pWhen) - && db->mallocFailed==0 + if( SQLITE_OK==sqlite3ResolveExprNames(&sNC, pWhen) + && db->mallocFailed==0 ){ iEndTrigger = sqlite3VdbeMakeLabel(v); sqlite3ExprIfFalse(pSubParse, pWhen, iEndTrigger, SQLITE_JUMPIFNULL); @@ -122841,7 +122841,7 @@ static TriggerPrg *codeRowTrigger( return pPrg; } - + /* ** Return a pointer to a TriggerPrg object containing the sub-program for ** trigger pTrigger with default ON CONFLICT algorithm orconf. If no such @@ -122863,8 +122863,8 @@ static TriggerPrg *getRowTrigger( ** process of being coded). If this is the case, then an entry with ** a matching TriggerPrg.pTrigger field will be present somewhere ** in the Parse.pTriggerPrg list. Search for such an entry. */ - for(pPrg=pRoot->pTriggerPrg; - pPrg && (pPrg->pTrigger!=pTrigger || pPrg->orconf!=orconf); + for(pPrg=pRoot->pTriggerPrg; + pPrg && (pPrg->pTrigger!=pTrigger || pPrg->orconf!=orconf); pPrg=pPrg->pNext ); @@ -122877,7 +122877,7 @@ static TriggerPrg *getRowTrigger( } /* -** Generate code for the trigger program associated with trigger p on +** Generate code for the trigger program associated with trigger p on ** table pTab. The reg, orconf and ignoreJump parameters passed to this ** function are the same as those described in the header function for ** sqlite3CodeRowTrigger() @@ -122895,7 +122895,7 @@ SQLITE_PRIVATE void sqlite3CodeRowTriggerDirect( pPrg = getRowTrigger(pParse, p, pTab, orconf); assert( pPrg || pParse->nErr || pParse->db->mallocFailed ); - /* Code the OP_Program opcode in the parent VDBE. P4 of the OP_Program + /* Code the OP_Program opcode in the parent VDBE. P4 of the OP_Program ** is a pointer to the sub-vdbe containing the trigger program. */ if( pPrg ){ int bRecursive = (p->zName && 0==(pParse->db->flags&SQLITE_RecTriggers)); @@ -122924,7 +122924,7 @@ SQLITE_PRIVATE void sqlite3CodeRowTriggerDirect( ** If there are no triggers that fire at the specified time for the specified ** operation on pTab, this function is a no-op. ** -** The reg argument is the address of the first in an array of registers +** The reg argument is the address of the first in an array of registers ** that contain the values substituted for the new.* and old.* references ** in the trigger program. If N is the number of columns in table pTab ** (a copy of pTab->nCol), then registers are populated as follows: @@ -122941,12 +122941,12 @@ SQLITE_PRIVATE void sqlite3CodeRowTriggerDirect( ** reg+N+N+1 NEW.* value of right-most column of pTab ** ** For ON DELETE triggers, the registers containing the NEW.* values will -** never be accessed by the trigger program, so they are not allocated or -** populated by the caller (there is no data to populate them with anyway). +** never be accessed by the trigger program, so they are not allocated or +** populated by the caller (there is no data to populate them with anyway). ** Similarly, for ON INSERT triggers the values stored in the OLD.* registers ** are never accessed, and so are not allocated by the caller. So, for an ** ON INSERT trigger, the value passed to this function as parameter reg -** is not a readable register, although registers (reg+N) through +** is not a readable register, although registers (reg+N) through ** (reg+N+N+1) are. ** ** Parameter orconf is the default conflict resolution algorithm for the @@ -122978,12 +122978,12 @@ SQLITE_PRIVATE void sqlite3CodeRowTrigger( ** or else it must be a TEMP trigger. */ assert( p->pSchema!=0 ); assert( p->pTabSchema!=0 ); - assert( p->pSchema==p->pTabSchema + assert( p->pSchema==p->pTabSchema || p->pSchema==pParse->db->aDb[1].pSchema ); /* Determine whether we should code this trigger */ - if( p->op==op - && p->tr_tm==tr_tm + if( p->op==op + && p->tr_tm==tr_tm && checkColumnOverlap(p->pColumns, pChanges) ){ sqlite3CodeRowTriggerDirect(pParse, p, pTab, reg, orconf, ignoreJump); @@ -122992,9 +122992,9 @@ SQLITE_PRIVATE void sqlite3CodeRowTrigger( } /* -** Triggers may access values stored in the old.* or new.* pseudo-table. -** This function returns a 32-bit bitmask indicating which columns of the -** old.* or new.* tables actually are used by triggers. This information +** Triggers may access values stored in the old.* or new.* pseudo-table. +** This function returns a 32-bit bitmask indicating which columns of the +** old.* or new.* tables actually are used by triggers. This information ** may be used by the caller, for example, to avoid having to load the entire ** old.* record into memory when executing an UPDATE or DELETE command. ** @@ -123004,7 +123004,7 @@ SQLITE_PRIVATE void sqlite3CodeRowTrigger( ** are more than 32 columns in the table, and at least one of the columns ** with an index greater than 32 may be accessed, 0xffffffff is returned. ** -** It is not possible to determine if the old.rowid or new.rowid column is +** It is not possible to determine if the old.rowid or new.rowid column is ** accessed by triggers. The caller must always assume that it is. ** ** Parameter isNew must be either 1 or 0. If it is 0, then the mask returned @@ -123081,10 +123081,10 @@ static void updateVirtualTable( /* ** The most recently coded instruction was an OP_Column to retrieve the -** i-th column of table pTab. This routine sets the P4 parameter of the +** i-th column of table pTab. This routine sets the P4 parameter of the ** OP_Column to the default value, if any. ** -** The default value of a column is specified by a DEFAULT clause in the +** The default value of a column is specified by a DEFAULT clause in the ** column definition. This was either supplied by the user when the table ** was created, or added later to the table definition by an ALTER TABLE ** command. If the latter, then the row-records in the table btree on disk @@ -123093,9 +123093,9 @@ static void updateVirtualTable( ** If the former, then all row-records are guaranteed to include a value ** for the column and the P4 value is not required. ** -** Column definitions created by an ALTER TABLE command may only have +** Column definitions created by an ALTER TABLE command may only have ** literal default values specified: a number, null or a string. (If a more -** complicated default expression value was provided, it is evaluated +** complicated default expression value was provided, it is evaluated ** when the ALTER TABLE is executed and one of the literal values written ** into the sqlite_master table.) ** @@ -123105,8 +123105,8 @@ static void updateVirtualTable( ** sqlite3_value objects. ** ** If parameter iReg is not negative, code an OP_RealAffinity instruction -** on register iReg. This is used when an equivalent integer value is -** stored in place of an 8-byte floating point value in order to save +** on register iReg. This is used when an equivalent integer value is +** stored in place of an 8-byte floating point value in order to save ** space. */ SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i, int iReg){ @@ -123117,7 +123117,7 @@ SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i, int iReg){ Column *pCol = &pTab->aCol[i]; VdbeComment((v, "%s.%s", pTab->zName, pCol->zName)); assert( inCol ); - sqlite3ValueFromExpr(sqlite3VdbeDb(v), pCol->pDflt, enc, + sqlite3ValueFromExpr(sqlite3VdbeDb(v), pCol->pDflt, enc, pCol->affinity, &pValue); if( pValue ){ sqlite3VdbeAppendP4(v, pValue, P4_MEM); @@ -123204,7 +123204,7 @@ SQLITE_PRIVATE void sqlite3Update( } assert( pTabList->nSrc==1 ); - /* Locate the table which we want to update. + /* Locate the table which we want to update. */ pTab = sqlite3SrcListLookup(pParse, pTabList); if( pTab==0 ) goto update_cleanup; @@ -123250,7 +123250,7 @@ SQLITE_PRIVATE void sqlite3Update( pParse->nTab++; } - /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. + /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. ** Initialize aXRef[] and aToOpen[] to their default values. */ aXRef = sqlite3DbMallocRawNN(db, sizeof(int) * (pTab->nCol+nIdx) + nIdx+2 ); @@ -123319,7 +123319,7 @@ SQLITE_PRIVATE void sqlite3Update( assert( chngPk==0 || chngPk==1 ); chngKey = chngRowid + chngPk; - /* The SET expressions are not actually used inside the WHERE loop. + /* The SET expressions are not actually used inside the WHERE loop. ** So reset the colUsed mask. Unless this is a virtual table. In that ** case, set all bits of the colUsed mask (to ensure that the virtual ** table implementation makes all columns available). @@ -123347,7 +123347,7 @@ SQLITE_PRIVATE void sqlite3Update( reg = ++pParse->nMem; pParse->nMem += pIdx->nColumn; if( (onError==OE_Replace) - || (onError==OE_Default && pIdx->onError==OE_Replace) + || (onError==OE_Default && pIdx->onError==OE_Replace) ){ bReplace = 1; } @@ -123359,7 +123359,7 @@ SQLITE_PRIVATE void sqlite3Update( aRegIdx[j] = reg; } if( bReplace ){ - /* If REPLACE conflict resolution might be invoked, open cursors on all + /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ memset(aToOpen, 1, nIdx+1); } @@ -123436,7 +123436,7 @@ SQLITE_PRIVATE void sqlite3Update( sqlite3VdbeSetP4KeyInfo(pParse, pPk); } - /* Begin the database scan. + /* Begin the database scan. ** ** Do not consider a single-pass strategy for a multi-row update if ** there are any triggers or foreign keys to process, or rows may @@ -123468,7 +123468,7 @@ SQLITE_PRIVATE void sqlite3Update( } assert( iCur!=iDataCur || !HasRowid(pTab) ); } - + if( HasRowid(pTab) ){ /* Read the rowid of the current row of the WHERE scan. In ONEPASS_OFF ** mode, write the rowid into the FIFO. In either of the one-pass modes, @@ -123481,7 +123481,7 @@ SQLITE_PRIVATE void sqlite3Update( /* Read the PK of the current row into an array of registers. In ** ONEPASS_OFF mode, serialize the array into a record and store it in ** the ephemeral table. Or, in ONEPASS_SINGLE or MULTI mode, change - ** the OP_OpenEphemeral instruction to a Noop (the ephemeral table + ** the OP_OpenEphemeral instruction to a Noop (the ephemeral table ** is not required) and leave the PK fields in the array of registers. */ for(i=0; iaiColumn[i]>=0 ); @@ -123563,7 +123563,7 @@ SQLITE_PRIVATE void sqlite3Update( ** information is needed */ if( chngPk || hasFK || pTrigger ){ u32 oldmask = (hasFK ? sqlite3FkOldmask(pParse, pTab) : 0); - oldmask |= sqlite3TriggerColmask(pParse, + oldmask |= sqlite3TriggerColmask(pParse, pTrigger, pChanges, 0, TRIGGER_BEFORE|TRIGGER_AFTER, pTab, onError ); for(i=0; inCol; i++){ @@ -123590,8 +123590,8 @@ SQLITE_PRIVATE void sqlite3Update( ** If there are one or more BEFORE triggers, then do not populate the ** registers associated with columns that are (a) not modified by ** this UPDATE statement and (b) not accessed by new.* references. The - ** values for registers not modified by the UPDATE must be reloaded from - ** the database after the BEFORE triggers are fired anyway (as the trigger + ** values for registers not modified by the UPDATE must be reloaded from + ** the database after the BEFORE triggers are fired anyway (as the trigger ** may have modified them). So not loading those that are not going to ** be used eliminates some redundant opcodes. */ @@ -123606,7 +123606,7 @@ SQLITE_PRIVATE void sqlite3Update( if( j>=0 ){ sqlite3ExprCode(pParse, pChanges->a[j].pExpr, regNew+i); }else if( 0==(tmask&TRIGGER_BEFORE) || i>31 || (newmask & MASKBIT32(i)) ){ - /* This branch loads the value of a column that will not be changed + /* This branch loads the value of a column that will not be changed ** into a register. This is done if there are no BEFORE triggers, or ** if there are one or more BEFORE triggers that use this value via ** a new.* reference in a trigger program. @@ -123625,11 +123625,11 @@ SQLITE_PRIVATE void sqlite3Update( */ if( tmask&TRIGGER_BEFORE ){ sqlite3TableAffinity(v, pTab, regNew); - sqlite3CodeRowTrigger(pParse, pTrigger, TK_UPDATE, pChanges, + sqlite3CodeRowTrigger(pParse, pTrigger, TK_UPDATE, pChanges, TRIGGER_BEFORE, pTab, regOldRowid, onError, labelContinue); /* The row-trigger may have deleted the row being updated. In this - ** case, jump to the next row. No updates or AFTER triggers are + ** case, jump to the next row. No updates or AFTER triggers are ** required. This behavior - what happens when the row being updated ** is deleted or renamed by a BEFORE trigger - is left undefined in the ** documentation. @@ -123642,9 +123642,9 @@ SQLITE_PRIVATE void sqlite3Update( VdbeCoverage(v); } - /* If it did not delete it, the row-trigger may still have modified - ** some of the columns of the row being updated. Load the values for - ** all columns not modified by the update statement into their + /* If it did not delete it, the row-trigger may still have modified + ** some of the columns of the row being updated. Load the values for + ** all columns not modified by the update statement into their ** registers in case this has happened. */ for(i=0; inCol; i++){ @@ -123683,7 +123683,7 @@ SQLITE_PRIVATE void sqlite3Update( ** to process, delete the old record. Otherwise, add a noop OP_Delete ** to invoke the pre-update hook. ** - ** That (regNew==regnewRowid+1) is true is also important for the + ** That (regNew==regnewRowid+1) is true is also important for the ** pre-update hook. If the caller invokes preupdate_new(), the returned ** value is copied from memory cell (regNewRowid+1+iCol), where iCol ** is the column index supplied by the user. @@ -123713,29 +123713,29 @@ SQLITE_PRIVATE void sqlite3Update( if( hasFK ){ sqlite3FkCheck(pParse, pTab, 0, regNewRowid, aXRef, chngKey); } - + /* Insert the new index entries and the new record. */ sqlite3CompleteInsertion( - pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, - OPFLAG_ISUPDATE | (eOnePass==ONEPASS_MULTI ? OPFLAG_SAVEPOSITION : 0), + pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, + OPFLAG_ISUPDATE | (eOnePass==ONEPASS_MULTI ? OPFLAG_SAVEPOSITION : 0), 0, 0 ); /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key - ** to the row just updated. */ + ** to the row just updated. */ if( hasFK ){ sqlite3FkActions(pParse, pTab, pChanges, regOldRowid, aXRef, chngKey); } } - /* Increment the row counter + /* Increment the row counter */ if( (db->flags & SQLITE_CountRows) && !pParse->pTriggerTab){ sqlite3VdbeAddOp2(v, OP_AddImm, regRowCount, 1); } - sqlite3CodeRowTrigger(pParse, pTrigger, TK_UPDATE, pChanges, + sqlite3CodeRowTrigger(pParse, pTrigger, TK_UPDATE, pChanges, TRIGGER_AFTER, pTab, regOldRowid, onError, labelContinue); /* Repeat the above with the next record to be updated, until @@ -123763,7 +123763,7 @@ SQLITE_PRIVATE void sqlite3Update( } /* - ** Return the number of rows that were changed. If this routine is + ** Return the number of rows that were changed. If this routine is ** generating code because of a call to sqlite3NestedParse(), do not ** invoke the callback function. */ @@ -123795,8 +123795,8 @@ update_cleanup: /* ** Generate code for an UPDATE of a virtual table. ** -** There are two possible strategies - the default and the special -** "onepass" strategy. Onepass is only used if the virtual table +** There are two possible strategies - the default and the special +** "onepass" strategy. Onepass is only used if the virtual table ** implementation indicates that pWhere may match at most one row. ** ** The default strategy is to create an ephemeral table that contains @@ -123894,7 +123894,7 @@ static void updateVirtualTable( /* Begin scannning through the ephemeral table. */ addr = sqlite3VdbeAddOp1(v, OP_Rewind, ephemTab); VdbeCoverage(v); - /* Extract arguments from the current row of the ephemeral table and + /* Extract arguments from the current row of the ephemeral table and ** invoke the VUpdate method. */ for(i=0; iflags; @@ -124190,7 +124190,7 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db, int iDb){ ); if( rc ) goto end_of_vacuum; - /* At this point, there is a write transaction open on both the + /* At this point, there is a write transaction open on both the ** vacuum database and the main database. Assuming no error occurs, ** both transactions are closed by this block - the main database ** transaction by sqlite3BtreeCopyFile() and the other by an explicit @@ -124263,7 +124263,7 @@ end_of_vacuum: } /* This both clears the schemas and reduces the size of the db->aDb[] - ** array. */ + ** array. */ sqlite3ResetAllSchemasOfConnection(db); return rc; @@ -124292,7 +124292,7 @@ end_of_vacuum: /* ** Before a virtual table xCreate() or xConnect() method is invoked, the ** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of +** this struct allocated on the stack. It is used by the implementation of ** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which ** are invoked only from within xCreate and xConnect methods. */ @@ -124399,7 +124399,7 @@ SQLITE_API int sqlite3_create_module_v2( /* ** Lock the virtual table so that it cannot be disconnected. ** Locks nest. Every lock should have a corresponding unlock. -** If an unlock is omitted, resources leaks will occur. +** If an unlock is omitted, resources leaks will occur. ** ** If a disconnect is attempted while a virtual table is locked, ** the disconnect is deferred until all locks have been removed. @@ -124411,7 +124411,7 @@ SQLITE_PRIVATE void sqlite3VtabLock(VTable *pVTab){ /* ** pTab is a pointer to a Table structure representing a virtual-table. -** Return a pointer to the VTable object used by connection db to access +** Return a pointer to the VTable object used by connection db to access ** this virtual-table, if one has been created, or NULL otherwise. */ SQLITE_PRIVATE VTable *sqlite3GetVTable(sqlite3 *db, Table *pTab){ @@ -124445,7 +124445,7 @@ SQLITE_PRIVATE void sqlite3VtabUnlock(VTable *pVTab){ /* ** Table p is a virtual table. This function moves all elements in the ** p->pVTable list to the sqlite3.pDisconnect lists of their associated -** database connections to be disconnected at the next opportunity. +** database connections to be disconnected at the next opportunity. ** Except, if argument db is not NULL, then the entry associated with ** connection db is left in the p->pVTable list. */ @@ -124454,8 +124454,8 @@ static VTable *vtabDisconnectAll(sqlite3 *db, Table *p){ VTable *pVTable = p->pVTable; p->pVTable = 0; - /* Assert that the mutex (if any) associated with the BtShared database - ** that contains table p is held by the caller. See header comments + /* Assert that the mutex (if any) associated with the BtShared database + ** that contains table p is held by the caller. See header comments ** above function sqlite3VtabUnlockList() for an explanation of why ** this makes it safe to access the sqlite3.pDisconnect list of any ** database connection that may have an entry in the p->pVTable list. @@ -124511,7 +124511,7 @@ SQLITE_PRIVATE void sqlite3VtabDisconnect(sqlite3 *db, Table *p){ ** Disconnect all the virtual table objects in the sqlite3.pDisconnect list. ** ** This function may only be called when the mutexes associated with all -** shared b-tree databases opened using connection db are held by the +** shared b-tree databases opened using connection db are held by the ** caller. This is done to protect the sqlite3.pDisconnect list. The ** sqlite3.pDisconnect list is accessed only as follows: ** @@ -124524,7 +124524,7 @@ SQLITE_PRIVATE void sqlite3VtabDisconnect(sqlite3 *db, Table *p){ ** or, if the virtual table is stored in a non-sharable database, then ** the database handle mutex is held. ** -** As a result, a sqlite3.pDisconnect cannot be accessed simultaneously +** As a result, a sqlite3.pDisconnect cannot be accessed simultaneously ** by multiple threads. It is thread-safe. */ SQLITE_PRIVATE void sqlite3VtabUnlockList(sqlite3 *db){ @@ -124550,12 +124550,12 @@ SQLITE_PRIVATE void sqlite3VtabUnlockList(sqlite3 *db){ ** record. ** ** Since it is a virtual-table, the Table structure contains a pointer -** to the head of a linked list of VTable structures. Each VTable +** to the head of a linked list of VTable structures. Each VTable ** structure is associated with a single sqlite3* user of the schema. -** The reference count of the VTable structure associated with database -** connection db is decremented immediately (which may lead to the +** The reference count of the VTable structure associated with database +** connection db is decremented immediately (which may lead to the ** structure being xDisconnected and free). Any other VTable structures -** in the list are moved to the sqlite3.pDisconnect list of the associated +** in the list are moved to the sqlite3.pDisconnect list of the associated ** database connection. */ SQLITE_PRIVATE void sqlite3VtabClear(sqlite3 *db, Table *p){ @@ -124633,7 +124633,7 @@ SQLITE_PRIVATE void sqlite3VtabBeginParse( ** The second call, to obtain permission to create the table, is made now. */ if( pTable->azModuleArg ){ - sqlite3AuthCheck(pParse, SQLITE_CREATE_VTABLE, pTable->zName, + sqlite3AuthCheck(pParse, SQLITE_CREATE_VTABLE, pTable->zName, pTable->azModuleArg[0], pParse->db->aDb[iDb].zDbSName); } #endif @@ -124665,7 +124665,7 @@ SQLITE_PRIVATE void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){ addArgumentToVtab(pParse); pParse->sArg.z = 0; if( pTab->nModuleArg<1 ) return; - + /* If the CREATE VIRTUAL TABLE statement is being entered for the ** first time (in other words if the virtual table is actually being ** created now instead of just being read out of sqlite_master) then @@ -124685,9 +124685,9 @@ SQLITE_PRIVATE void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){ } zStmt = sqlite3MPrintf(db, "CREATE VIRTUAL TABLE %T", &pParse->sNameToken); - /* A slot for the record has already been allocated in the + /* A slot for the record has already been allocated in the ** SQLITE_MASTER table. We just need to update that slot with all - ** the information we've collected. + ** the information we've collected. ** ** The VM register number pParse->regRowid holds the rowid of an ** entry in the sqlite_master table tht was created for this vtab @@ -124768,7 +124768,7 @@ SQLITE_PRIVATE void sqlite3VtabArgExtend(Parse *pParse, Token *p){ ** to this procedure. */ static int vtabCallConstructor( - sqlite3 *db, + sqlite3 *db, Table *pTab, Module *pMod, int (*xConstruct)(sqlite3*,void*,int,const char*const*,sqlite3_vtab**,char**), @@ -124787,7 +124787,7 @@ static int vtabCallConstructor( /* Check that the virtual-table is not already being initialized */ for(pCtx=db->pVtabCtx; pCtx; pCtx=pCtx->pPrior){ if( pCtx->pTab==pTab ){ - *pzErr = sqlite3MPrintf(db, + *pzErr = sqlite3MPrintf(db, "vtable constructor called recursively: %s", pTab->zName ); return SQLITE_LOCKED; @@ -124846,7 +124846,7 @@ static int vtabCallConstructor( int iCol; u8 oooHidden = 0; /* If everything went according to plan, link the new VTable structure - ** into the linked list headed by pTab->pVTable. Then loop through the + ** into the linked list headed by pTab->pVTable. Then loop through the ** columns of the table to see if any of them contain the token "hidden". ** If so, set the Column COLFLAG_HIDDEN flag and remove the token from ** the type string. */ @@ -124891,7 +124891,7 @@ static int vtabCallConstructor( /* ** This function is invoked by the parser to call the xConnect() method -** of the virtual table pTab. If an error occurs, an error code is returned +** of the virtual table pTab. If an error occurs, an error code is returned ** and an error left in pParse. ** ** This call is a no-op if table pTab is not a virtual table. @@ -124960,7 +124960,7 @@ static void addToVTrans(sqlite3 *db, VTable *pVTab){ /* ** This function is invoked by the vdbe to call the xCreate method -** of the virtual table named zTab in database iDb. +** of the virtual table named zTab in database iDb. ** ** If an error occurs, *pzErr is set to point to an English language ** description of the error and an SQLITE_XXX error code is returned. @@ -124979,8 +124979,8 @@ SQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3 *db, int iDb, const char *zTab, zMod = pTab->azModuleArg[0]; pMod = (Module*)sqlite3HashFind(&db->aModule, zMod); - /* If the module has been registered and includes a Create method, - ** invoke it now. If the module has not been registered, return an + /* If the module has been registered and includes a Create method, + ** invoke it now. If the module has not been registered, return an ** error. Otherwise, do nothing. */ if( pMod==0 || pMod->pModule->xCreate==0 || pMod->pModule->xDestroy==0 ){ @@ -125036,8 +125036,8 @@ SQLITE_API int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){ pParse->declareVtab = 1; pParse->db = db; pParse->nQueryLoop = 1; - - if( SQLITE_OK==sqlite3RunParser(pParse, zCreateTable, &zErr) + + if( SQLITE_OK==sqlite3RunParser(pParse, zCreateTable, &zErr) && pParse->pNewTable && !db->mallocFailed && !pParse->pNewTable->pSelect @@ -125070,7 +125070,7 @@ SQLITE_API int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){ rc = SQLITE_ERROR; } pParse->declareVtab = 0; - + if( pParse->pVdbe ){ sqlite3VdbeFinalize(pParse->pVdbe); } @@ -125128,7 +125128,7 @@ SQLITE_PRIVATE int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab ** called is identified by the second argument, "offset", which is ** the offset of the method to call in the sqlite3_module structure. ** -** The array is cleared after invoking the callbacks. +** The array is cleared after invoking the callbacks. */ static void callFinaliser(sqlite3 *db, int offset){ int i; @@ -125177,7 +125177,7 @@ SQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, Vdbe *p){ } /* -** Invoke the xRollback method of all virtual tables in the +** Invoke the xRollback method of all virtual tables in the ** sqlite3.aVTrans array. Then clear the array itself. */ SQLITE_PRIVATE int sqlite3VtabRollback(sqlite3 *db){ @@ -125186,7 +125186,7 @@ SQLITE_PRIVATE int sqlite3VtabRollback(sqlite3 *db){ } /* -** Invoke the xCommit method of all virtual tables in the +** Invoke the xCommit method of all virtual tables in the ** sqlite3.aVTrans array. Then clear the array itself. */ SQLITE_PRIVATE int sqlite3VtabCommit(sqlite3 *db){ @@ -125208,7 +125208,7 @@ SQLITE_PRIVATE int sqlite3VtabBegin(sqlite3 *db, VTable *pVTab){ /* Special case: If db->aVTrans is NULL and db->nVTrans is greater ** than zero, then this function is being called from within a - ** virtual module xSync() callback. It is illegal to write to + ** virtual module xSync() callback. It is illegal to write to ** virtual module tables in this case, so return SQLITE_LOCKED. */ if( sqlite3VtabInSync(db) ){ @@ -125216,7 +125216,7 @@ SQLITE_PRIVATE int sqlite3VtabBegin(sqlite3 *db, VTable *pVTab){ } if( !pVTab ){ return SQLITE_OK; - } + } pModule = pVTab->pVtab->pModule; if( pModule->xBegin ){ @@ -125229,7 +125229,7 @@ SQLITE_PRIVATE int sqlite3VtabBegin(sqlite3 *db, VTable *pVTab){ } } - /* Invoke the xBegin method. If successful, add the vtab to the + /* Invoke the xBegin method. If successful, add the vtab to the ** sqlite3.aVTrans[] array. */ rc = growVTrans(db); if( rc==SQLITE_OK ){ @@ -125253,11 +125253,11 @@ SQLITE_PRIVATE int sqlite3VtabBegin(sqlite3 *db, VTable *pVTab){ ** as the second argument to the virtual table method invoked. ** ** If op is SAVEPOINT_BEGIN, the xSavepoint method is invoked. If it is -** SAVEPOINT_ROLLBACK, the xRollbackTo method. Otherwise, if op is +** SAVEPOINT_ROLLBACK, the xRollbackTo method. Otherwise, if op is ** SAVEPOINT_RELEASE, then the xRelease method of each virtual table with ** an open transaction is invoked. ** -** If any virtual table method returns an error code other than SQLITE_OK, +** If any virtual table method returns an error code other than SQLITE_OK, ** processing is abandoned and the error returned to the caller of this ** function immediately. If all calls to virtual table methods are successful, ** SQLITE_OK is returned. @@ -125304,7 +125304,7 @@ SQLITE_PRIVATE int sqlite3VtabSavepoint(sqlite3 *db, int op, int iSavepoint){ ** This routine is used to allow virtual table implementations to ** overload MATCH, LIKE, GLOB, and REGEXP operators. ** -** Return either the pDef argument (indicating no change) or a +** Return either the pDef argument (indicating no change) or a ** new FuncDef structure that is marked as ephemeral using the ** SQLITE_FUNC_EPHEM flag. */ @@ -125336,9 +125336,9 @@ SQLITE_PRIVATE FuncDef *sqlite3VtabOverloadFunction( assert( pVtab->pModule!=0 ); pMod = (sqlite3_module *)pVtab->pModule; if( pMod->xFindFunction==0 ) return pDef; - + /* Call the xFindFunction method on the virtual table implementation - ** to see if the implementation wants to overload this function + ** to see if the implementation wants to overload this function */ zLowerName = sqlite3DbStrDup(db, pDef->zName); if( zLowerName ){ @@ -125449,7 +125449,7 @@ SQLITE_PRIVATE void sqlite3VtabEponymousTableClear(sqlite3 *db, Module *pMod){ Table *pTab = pMod->pEpoTab; if( pTab!=0 ){ /* Mark the table as Ephemeral prior to deleting it, so that the - ** sqlite3DeleteTable() routine will know that it is not stored in + ** sqlite3DeleteTable() routine will know that it is not stored in ** the schema. */ pTab->tabFlags |= TF_Ephemeral; sqlite3DeleteTable(db, pTab); @@ -125465,8 +125465,8 @@ SQLITE_PRIVATE void sqlite3VtabEponymousTableClear(sqlite3 *db, Module *pMod){ ** within an xUpdate method. */ SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *db){ - static const unsigned char aMap[] = { - SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE + static const unsigned char aMap[] = { + SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE }; #ifdef SQLITE_ENABLE_API_ARMOR if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; @@ -125478,7 +125478,7 @@ SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *db){ } /* -** Call from within the xCreate() or xConnect() methods to provide +** Call from within the xCreate() or xConnect() methods to provide ** the SQLite core with additional information about the behavior ** of the virtual table being implemented. */ @@ -125688,7 +125688,7 @@ struct WhereLoop { /* This object holds the prerequisites and the cost of running a ** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information +** See WhereOrSet for additional information */ struct WhereOrCost { Bitmask prereq; /* Prerequisites */ @@ -125740,7 +125740,7 @@ struct WherePath { ** clause subexpression is separated from the others by AND operators, ** usually, or sometimes subexpressions separated by OR. ** -** All WhereTerms are collected into a single WhereClause structure. +** All WhereTerms are collected into a single WhereClause structure. ** The following identity holds: ** ** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm @@ -125890,8 +125890,8 @@ struct WhereAndInfo { ** An instance of the following structure keeps track of a mapping ** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. ** -** The VDBE cursor numbers are small integers contained in -** SrcList_item.iCursor and Expr.iTable fields. For any given WHERE +** The VDBE cursor numbers are small integers contained in +** SrcList_item.iCursor and Expr.iTable fields. For any given WHERE ** clause, the cursor numbers might not begin with 0 and they might ** contain gaps in the numbering sequence. But we want to make maximum ** use of the bits in our bitmasks. This structure provides a mapping @@ -126145,7 +126145,7 @@ static void explainAppendTerm( } /* -** Argument pLevel describes a strategy for scanning table pTab. This +** Argument pLevel describes a strategy for scanning table pTab. This ** function appends text to pStr that describes the subset of table ** rows scanned by the strategy in the form of an SQL expression. ** @@ -126186,7 +126186,7 @@ static void explainIndexRange(StrAccum *pStr, WhereLoop *pLoop){ /* ** This function is a no-op unless currently processing an EXPLAIN QUERY PLAN ** command, or if either SQLITE_DEBUG or SQLITE_ENABLE_STMT_SCANSTATUS was -** defined at compile-time. If it is not a no-op, a single OP_Explain opcode +** defined at compile-time. If it is not a no-op, a single OP_Explain opcode ** is added to the output to describe the table scan strategy in pLevel. ** ** If an OP_Explain opcode is added to the VM, its address is returned. @@ -126297,11 +126297,11 @@ SQLITE_PRIVATE int sqlite3WhereExplainOneScan( #ifdef SQLITE_ENABLE_STMT_SCANSTATUS /* ** Configure the VM passed as the first argument with an -** sqlite3_stmt_scanstatus() entry corresponding to the scan used to -** implement level pLvl. Argument pSrclist is a pointer to the FROM +** sqlite3_stmt_scanstatus() entry corresponding to the scan used to +** implement level pLvl. Argument pSrclist is a pointer to the FROM ** clause that the scan reads data from. ** -** If argument addrExplain is not 0, it must be the address of an +** If argument addrExplain is not 0, it must be the address of an ** OP_Explain instruction that describes the same loop. */ SQLITE_PRIVATE void sqlite3WhereAddScanStatus( @@ -126357,7 +126357,7 @@ SQLITE_PRIVATE void sqlite3WhereAddScanStatus( ** ** Only the parent term was in the original WHERE clause. The child1 ** and child2 terms were added by the LIKE optimization. If both of -** the virtual child terms are valid, then testing of the parent can be +** the virtual child terms are valid, then testing of the parent can be ** skipped. ** ** Usually the parent term is marked as TERM_CODED. But if the parent @@ -126388,7 +126388,7 @@ static void disableTerm(WhereLevel *pLevel, WhereTerm *pTerm){ /* ** Code an OP_Affinity opcode to apply the column affinity string zAff -** to the n registers starting at base. +** to the n registers starting at base. ** ** As an optimization, SQLITE_AFF_BLOB entries (which are no-ops) at the ** beginning and end of zAff are ignored. If all entries in zAff are @@ -126425,7 +126425,7 @@ static void codeApplyAffinity(Parse *pParse, int base, int n, char *zAff){ } /* -** Expression pRight, which is the RHS of a comparison operation, is +** Expression pRight, which is the RHS of a comparison operation, is ** either a vector of n elements or, if n==1, a scalar expression. ** Before the comparison operation, affinity zAff is to be applied ** to the pRight values. This function modifies characters within the @@ -126452,7 +126452,7 @@ static void updateRangeAffinityStr( /* ** Generate code for a single equality term of the WHERE clause. An equality -** term can be either X=expr or X IN (...). pTerm is the term to be +** term can be either X=expr or X IN (...). pTerm is the term to be ** coded. ** ** The current value for the constraint is left in a register, the index @@ -126540,12 +126540,12 @@ static int codeEqualityTerm( Expr *pLeft = pX->pLeft; if( pSelect->pOrderBy ){ - /* If the SELECT statement has an ORDER BY clause, zero the - ** iOrderByCol variables. These are set to non-zero when an - ** ORDER BY term exactly matches one of the terms of the + /* If the SELECT statement has an ORDER BY clause, zero the + ** iOrderByCol variables. These are set to non-zero when an + ** ORDER BY term exactly matches one of the terms of the ** result-set. Since the result-set of the SELECT statement may - ** have been modified or reordered, these variables are no longer - ** set correctly. Since setting them is just an optimization, + ** have been modified or reordered, these variables are no longer + ** set correctly. Since setting them is just an optimization, ** it's easiest just to zero them here. */ ExprList *pOrderBy = pSelect->pOrderBy; for(i=0; inExpr; i++){ @@ -126637,7 +126637,7 @@ static int codeEqualityTerm( ** For example, consider table t1(a,b,c,d,e,f) with index i1(a,b,c). ** Suppose the WHERE clause is this: a==5 AND b IN (1,2,3) AND c>5 AND c<10 ** The index has as many as three equality constraints, but in this -** example, the third "c" value is an inequality. So only two +** example, the third "c" value is an inequality. So only two ** constraints are coded. This routine will generate code to evaluate ** a==5 and b IN (1,2,3). The current values for a and b will be stored ** in consecutive registers and the index of the first register is returned. @@ -126727,7 +126727,7 @@ static int codeAllEqualityTerms( testcase( pIdx->aiColumn[j]==XN_EXPR ); VdbeComment((v, "%s", explainIndexColumnName(pIdx, j))); } - } + } /* Evaluate the equality constraints */ @@ -126736,7 +126736,7 @@ static int codeAllEqualityTerms( int r1; pTerm = pLoop->aLTerm[j]; assert( pTerm!=0 ); - /* The following testcase is true for indices with redundant columns. + /* The following testcase is true for indices with redundant columns. ** Ex: CREATE INDEX i1 ON t1(a,b,a); SELECT * FROM t1 WHERE a=0 AND b=0; */ testcase( (pTerm->wtFlags & TERM_CODED)!=0 ); testcase( pTerm->wtFlags & TERM_VIRTUAL ); @@ -126752,8 +126752,8 @@ static int codeAllEqualityTerms( if( pTerm->eOperator & WO_IN ){ if( pTerm->pExpr->flags & EP_xIsSelect ){ /* No affinity ever needs to be (or should be) applied to a value - ** from the RHS of an "? IN (SELECT ...)" expression. The - ** sqlite3FindInIndex() routine has already ensured that the + ** from the RHS of an "? IN (SELECT ...)" expression. The + ** sqlite3FindInIndex() routine has already ensured that the ** affinity of the comparison has been applied to the value. */ if( zAff ) zAff[j] = SQLITE_AFF_BLOB; } @@ -126780,7 +126780,7 @@ static int codeAllEqualityTerms( #ifndef SQLITE_LIKE_DOESNT_MATCH_BLOBS /* ** If the most recently coded instruction is a constant range constraint -** (a string literal) that originated from the LIKE optimization, then +** (a string literal) that originated from the LIKE optimization, then ** set P3 and P5 on the OP_String opcode so that the string will be cast ** to a BLOB at appropriate times. ** @@ -126805,7 +126805,7 @@ static void whereLikeOptimizationStringFixup( assert( pLevel->iLikeRepCntr>0 ); pOp = sqlite3VdbeGetOp(v, -1); assert( pOp!=0 ); - assert( pOp->opcode==OP_String8 + assert( pOp->opcode==OP_String8 || pTerm->pWC->pWInfo->pParse->db->mallocFailed ); pOp->p3 = (int)(pLevel->iLikeRepCntr>>1); /* Register holding counter */ pOp->p5 = (u8)(pLevel->iLikeRepCntr&1); /* ASC or DESC */ @@ -126848,7 +126848,7 @@ static int codeCursorHintCheckExpr(Walker *pWalker, Expr *pExpr){ /* ** Test whether or not expression pExpr, which was part of a WHERE clause, ** should be included in the cursor-hint for a table that is on the rhs -** of a LEFT JOIN. Set Walker.eCode to non-zero before returning if the +** of a LEFT JOIN. Set Walker.eCode to non-zero before returning if the ** expression is not suitable. ** ** An expression is unsuitable if it might evaluate to non NULL even if @@ -126861,9 +126861,9 @@ static int codeCursorHintCheckExpr(Walker *pWalker, Expr *pExpr){ ** CASE WHEN col THEN 0 ELSE 1 END */ static int codeCursorHintIsOrFunction(Walker *pWalker, Expr *pExpr){ - if( pExpr->op==TK_IS - || pExpr->op==TK_ISNULL || pExpr->op==TK_ISNOT - || pExpr->op==TK_NOTNULL || pExpr->op==TK_CASE + if( pExpr->op==TK_IS + || pExpr->op==TK_ISNULL || pExpr->op==TK_ISNOT + || pExpr->op==TK_NOTNULL || pExpr->op==TK_CASE ){ pWalker->eCode = 1; }else if( pExpr->op==TK_FUNCTION ){ @@ -126884,10 +126884,10 @@ static int codeCursorHintIsOrFunction(Walker *pWalker, Expr *pExpr){ ** that accesses any table other than the one identified by ** CCurHint.iTabCur, then do the following: ** -** 1) allocate a register and code an OP_Column instruction to read +** 1) allocate a register and code an OP_Column instruction to read ** the specified column into the new register, and ** -** 2) transform the expression node to a TK_REGISTER node that reads +** 2) transform the expression node to a TK_REGISTER node that reads ** from the newly populated register. ** ** Also, if the node is a TK_COLUMN that does access the table idenified @@ -126918,7 +126918,7 @@ static int codeCursorHintFixExpr(Walker *pWalker, Expr *pExpr){ ** the parent context. Do not walk the function arguments in this case. ** ** todo: It should be possible to replace this node with a TK_REGISTER - ** expression, as the result of the expression must be stored in a + ** expression, as the result of the expression must be stored in a ** register at this point. The same holds for TK_AGG_COLUMN nodes. */ rc = WRC_Prune; } @@ -126961,18 +126961,18 @@ static void codeCursorHint( if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; if( pTerm->prereqAll & pLevel->notReady ) continue; - /* Any terms specified as part of the ON(...) clause for any LEFT + /* Any terms specified as part of the ON(...) clause for any LEFT ** JOIN for which the current table is not the rhs are omitted - ** from the cursor-hint. + ** from the cursor-hint. ** - ** If this table is the rhs of a LEFT JOIN, "IS" or "IS NULL" terms + ** If this table is the rhs of a LEFT JOIN, "IS" or "IS NULL" terms ** that were specified as part of the WHERE clause must be excluded. ** This is to address the following: ** ** SELECT ... t1 LEFT JOIN t2 ON (t1.a=t2.b) WHERE t2.c IS NULL; ** ** Say there is a single row in t2 that matches (t1.a=t2.b), but its - ** t2.c values is not NULL. If the (t2.c IS NULL) constraint is + ** t2.c values is not NULL. If the (t2.c IS NULL) constraint is ** pushed down to the cursor, this row is filtered out, causing ** SQLite to synthesize a row of NULL values. Which does match the ** WHERE clause, and so the query returns a row. Which is incorrect. @@ -126985,7 +126985,7 @@ static void codeCursorHint( */ if( pTabItem->fg.jointype & JT_LEFT ){ Expr *pExpr = pTerm->pExpr; - if( !ExprHasProperty(pExpr, EP_FromJoin) + if( !ExprHasProperty(pExpr, EP_FromJoin) || pExpr->iRightJoinTable!=pTabItem->iCursor ){ sWalker.eCode = 0; @@ -127023,7 +127023,7 @@ static void codeCursorHint( if( pExpr!=0 ){ sWalker.xExprCallback = codeCursorHintFixExpr; sqlite3WalkExpr(&sWalker, pExpr); - sqlite3VdbeAddOp4(v, OP_CursorHint, + sqlite3VdbeAddOp4(v, OP_CursorHint, (sHint.pIdx ? sHint.iIdxCur : sHint.iTabCur), 0, 0, (const char*)pExpr, P4_EXPR); } @@ -127035,7 +127035,7 @@ static void codeCursorHint( /* ** Cursor iCur is open on an intkey b-tree (a table). Register iRowid contains ** a rowid value just read from cursor iIdxCur, open on index pIdx. This -** function generates code to do a deferred seek of cursor iCur to the +** function generates code to do a deferred seek of cursor iCur to the ** rowid stored in register iRowid. ** ** Normally, this is just: @@ -127045,8 +127045,8 @@ static void codeCursorHint( ** However, if the scan currently being coded is a branch of an OR-loop and ** the statement currently being coded is a SELECT, then P3 of the OP_Seek ** is set to iIdxCur and P4 is set to point to an array of integers -** containing one entry for each column of the table cursor iCur is open -** on. For each table column, if the column is the i'th column of the +** containing one entry for each column of the table cursor iCur is open +** on. For each table column, if the column is the i'th column of the ** index, then the corresponding array entry is set to (i+1). If the column ** does not appear in the index at all, the array entry is set to 0. */ @@ -127061,7 +127061,7 @@ static void codeDeferredSeek( assert( iIdxCur>0 ); assert( pIdx->aiColumn[pIdx->nColumn-1]==-1 ); - + sqlite3VdbeAddOp3(v, OP_Seek, iIdxCur, 0, iCur); if( (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE) && DbMaskAllZero(sqlite3ParseToplevel(pParse)->writeMask) @@ -127150,7 +127150,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( iCur = pTabItem->iCursor; pLevel->notReady = notReady & ~sqlite3WhereGetMask(&pWInfo->sMaskSet, iCur); bRev = (pWInfo->revMask>>iLevel)&1; - omitTable = (pLoop->wsFlags & WHERE_IDX_ONLY)!=0 + omitTable = (pLoop->wsFlags & WHERE_IDX_ONLY)!=0 && (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE)==0; VdbeModuleComment((v, "Begin WHERE-loop%d: %s",iLevel,pTabItem->pTab->zName)); @@ -127247,7 +127247,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( sqlite3VdbeAddOp3(v, pOp->opcode, pOp->p1, pOp->p2, pOp->p3); } - /* Generate code that will continue to the next row if + /* Generate code that will continue to the next row if ** the IN constraint is not satisfied */ pCompare = sqlite3PExpr(pParse, TK_EQ, 0, 0); assert( pCompare!=0 || db->mallocFailed ); @@ -127325,7 +127325,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( int r1, rTemp; /* Registers for holding the start boundary */ int op; /* Cursor seek operation */ - /* The following constant maps TK_xx codes into corresponding + /* The following constant maps TK_xx codes into corresponding ** seek opcodes. It depends on a particular ordering of TK_xx */ const u8 aMoveOp[] = { @@ -127374,8 +127374,8 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( testcase( pEnd->wtFlags & TERM_VIRTUAL ); memEndValue = ++pParse->nMem; codeExprOrVector(pParse, pX->pRight, memEndValue, 1); - if( 0==sqlite3ExprIsVector(pX->pRight) - && (pX->op==TK_LT || pX->op==TK_GT) + if( 0==sqlite3ExprIsVector(pX->pRight) + && (pX->op==TK_LT || pX->op==TK_GT) ){ testOp = bRev ? OP_Le : OP_Ge; }else{ @@ -127404,14 +127404,14 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( }else if( pLoop->wsFlags & WHERE_INDEXED ){ /* Case 4: A scan using an index. ** - ** The WHERE clause may contain zero or more equality + ** The WHERE clause may contain zero or more equality ** terms ("==" or "IN" operators) that refer to the N ** left-most columns of the index. It may also contain ** inequality constraints (>, <, >= or <=) on the indexed - ** column that immediately follows the N equalities. Only + ** column that immediately follows the N equalities. Only ** the right-most column can be an inequality - the rest must - ** use the "==" and "IN" operators. For example, if the - ** index is on (x,y,z), then the following clauses are all + ** use the "==" and "IN" operators. For example, if the + ** index is on (x,y,z), then the following clauses are all ** optimized: ** ** x=5 @@ -127432,7 +127432,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( ** This case is also used when there are no WHERE clause ** constraints but an index is selected anyway, in order ** to force the output order to conform to an ORDER BY. - */ + */ static const u8 aStartOp[] = { 0, 0, @@ -127472,8 +127472,8 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( iIdxCur = pLevel->iIdxCur; assert( nEq>=pLoop->nSkip ); - /* If this loop satisfies a sort order (pOrderBy) request that - ** was passed to this function to implement a "SELECT min(x) ..." + /* If this loop satisfies a sort order (pOrderBy) request that + ** was passed to this function to implement a "SELECT min(x) ..." ** query, then the caller will only allow the loop to run for ** a single iteration. This means that the first row returned ** should not have a NULL value stored in 'x'. If column 'x' is @@ -127492,15 +127492,15 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( nExtraReg = 1; } - /* Find any inequality constraint terms for the start and end - ** of the range. + /* Find any inequality constraint terms for the start and end + ** of the range. */ j = nEq; if( pLoop->wsFlags & WHERE_BTM_LIMIT ){ pRangeStart = pLoop->aLTerm[j++]; nExtraReg = MAX(nExtraReg, pLoop->u.btree.nBtm); /* Like optimization range constraints always occur in pairs */ - assert( (pRangeStart->wtFlags & TERM_LIKEOPT)==0 || + assert( (pRangeStart->wtFlags & TERM_LIKEOPT)==0 || (pLoop->wsFlags & WHERE_TOP_LIMIT)!=0 ); } if( pLoop->wsFlags & WHERE_TOP_LIMIT ){ @@ -127533,7 +127533,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( assert( pRangeEnd==0 || (pRangeEnd->wtFlags & TERM_VNULL)==0 ); /* If we are doing a reverse order scan on an ascending index, or - ** a forward order scan on a descending index, interchange the + ** a forward order scan on a descending index, interchange the ** start and end terms (pRangeStart and pRangeEnd). */ if( (nEqnKeyCol && bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC)) @@ -127578,7 +127578,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( } if( zStartAff ){ updateRangeAffinityStr(pRight, nBtm, &zStartAff[nEq]); - } + } nConstraint += nBtm; testcase( pRangeStart->wtFlags & TERM_VIRTUAL ); if( sqlite3ExprIsVector(pRight)==0 ){ @@ -127666,7 +127666,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( /* pIdx is a covering index. No need to access the main table. */ }else if( HasRowid(pIdx->pTable) ){ if( (pWInfo->wctrlFlags & WHERE_SEEK_TABLE) || ( - (pWInfo->wctrlFlags & WHERE_SEEK_UNIQ_TABLE) + (pWInfo->wctrlFlags & WHERE_SEEK_UNIQ_TABLE) && (pWInfo->eOnePass==ONEPASS_SINGLE) )){ iRowidReg = ++pParse->nMem; @@ -127796,15 +127796,15 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( pOrTab = pWInfo->pTabList; } - /* Initialize the rowset register to contain NULL. An SQL NULL is + /* Initialize the rowset register to contain NULL. An SQL NULL is ** equivalent to an empty rowset. Or, create an ephemeral index ** capable of holding primary keys in the case of a WITHOUT ROWID. ** - ** Also initialize regReturn to contain the address of the instruction + ** Also initialize regReturn to contain the address of the instruction ** immediately following the OP_Return at the bottom of the loop. This ** is required in a few obscure LEFT JOIN cases where control jumps - ** over the top of the loop into the body of it. In this case the - ** correct response for the end-of-loop code (the OP_Return) is to + ** over the top of the loop into the body of it. In this case the + ** correct response for the end-of-loop code (the OP_Return) is to ** fall through to the next instruction, just as an OP_Next does if ** called on an uninitialized cursor. */ @@ -127829,7 +127829,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( ** ** Actually, each subexpression is converted to "xN AND w" where w is ** the "interesting" terms of z - terms that did not originate in the - ** ON or USING clause of a LEFT JOIN, and terms that are usable as + ** ON or USING clause of a LEFT JOIN, and terms that are usable as ** indices. ** ** This optimization also only applies if the (x1 OR x2 OR ...) term @@ -127915,9 +127915,9 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( ** ** Use some of the same optimizations as OP_RowSetTest: If iSet ** is zero, assume that the key cannot already be present in - ** the temp table. And if iSet is -1, assume that there is no - ** need to insert the key into the temp table, as it will never - ** be tested for. */ + ** the temp table. And if iSet is -1, assume that there is no + ** need to insert the key into the temp table, as it will never + ** be tested for. */ if( iSet ){ jmp1 = sqlite3VdbeAddOp4Int(v, OP_Found, regRowset, 0, r, nPk); VdbeCoverage(v); @@ -127956,8 +127956,8 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( ** If the call to sqlite3WhereBegin() above resulted in a scan that ** uses an index, and this is either the first OR-connected term ** processed or the index is the same as that used by all previous - ** terms, set pCov to the candidate covering index. Otherwise, set - ** pCov to NULL to indicate that no candidate covering index will + ** terms, set pCov to the candidate covering index. Otherwise, set + ** pCov to NULL to indicate that no candidate covering index will ** be available. */ pSubLoop = pSubWInfo->a[0].pWLoop; @@ -128091,7 +128091,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( } /* For a LEFT OUTER JOIN, generate code that will record the fact that - ** at least one row of the right table has matched the left table. + ** at least one row of the right table has matched the left table. */ if( pLevel->iLeftJoin ){ pLevel->addrFirst = sqlite3VdbeCurrentAddr(v); @@ -128233,7 +128233,7 @@ static int allowedOp(int op){ ** collating sequence, then COLLATE operators are adjusted to ensure ** that the collating sequence does not change. For example: ** "Y collate NOCASE op X" becomes "X op Y" because any collation sequence on -** the left hand side of a comparison overrides any collation sequence +** the left hand side of a comparison overrides any collation sequence ** attached to the right. For the same reason the EP_Collate flag ** is not commuted. */ @@ -128332,8 +128332,8 @@ static int isLikeOrGlob( #endif pList = pExpr->x.pList; pLeft = pList->a[1].pExpr; - if( pLeft->op!=TK_COLUMN - || sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT + if( pLeft->op!=TK_COLUMN + || sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT || IsVirtual(pLeft->pTab) /* Value might be numeric */ ){ /* IMP: R-02065-49465 The left-hand side of the LIKE or GLOB operator must @@ -128376,7 +128376,7 @@ static int isLikeOrGlob( ** function, then no OP_Variable will be added to the program. ** This causes problems for the sqlite3_bind_parameter_name() ** API. To work around them, add a dummy OP_Variable here. - */ + */ int r1 = sqlite3GetTempReg(pParse); sqlite3ExprCodeTarget(pParse, pRight, r1); sqlite3VdbeChangeP3(v, sqlite3VdbeCurrentAddr(v)-1, 0); @@ -128401,7 +128401,7 @@ static int isLikeOrGlob( ** ** column OP expr ** -** where OP is one of MATCH, GLOB, LIKE or REGEXP and "column" is a +** where OP is one of MATCH, GLOB, LIKE or REGEXP and "column" is a ** column of a virtual table. ** ** If it is then return TRUE. If not, return FALSE. @@ -128497,7 +128497,7 @@ static WhereTerm *whereNthSubterm(WhereTerm *pTerm, int N){ ** ** The following is NOT generated: ** -** xy --> x!=y +** xy --> x!=y */ static void whereCombineDisjuncts( SrcList *pSrc, /* the FROM clause */ @@ -128594,10 +128594,10 @@ static void whereCombineDisjuncts( ** WhereTerm.u.pOrInfo->indexable |= the cursor number for table T ** ** A subterm is "indexable" if it is of the form -** "T.C " where C is any column of table T and +** "T.C " where C is any column of table T and ** is one of "=", "<", "<=", ">", ">=", "IS NULL", or "IN". ** A subterm is also indexable if it is an AND of two or more -** subsubterms at least one of which is indexable. Indexable AND +** subsubterms at least one of which is indexable. Indexable AND ** subterms have their eOperator set to WO_AND and they have ** u.pAndInfo set to a dynamically allocated WhereAndTerm object. ** @@ -128688,8 +128688,8 @@ static void exprAnalyzeOrTerm( if( !db->mallocFailed ){ for(j=0, pAndTerm=pAndWC->a; jnTerm; j++, pAndTerm++){ assert( pAndTerm->pExpr ); - if( allowedOp(pAndTerm->pExpr->op) - || pAndTerm->eOperator==WO_MATCH + if( allowedOp(pAndTerm->pExpr->op) + || pAndTerm->eOperator==WO_MATCH ){ b |= sqlite3WhereGetMask(&pWInfo->sMaskSet, pAndTerm->leftCursor); } @@ -128785,7 +128785,7 @@ static void exprAnalyzeOrTerm( pOrTerm->leftCursor))==0 ){ /* This term must be of the form t1.a==t2.b where t2 is in the ** chngToIN set but t1 is not. This term will be either preceded - ** or follwed by an inverted copy (t2.b==t1.a). Skip this term + ** or follwed by an inverted copy (t2.b==t1.a). Skip this term ** and use its inversion. */ testcase( pOrTerm->wtFlags & TERM_COPIED ); testcase( pOrTerm->wtFlags & TERM_VIRTUAL ); @@ -128833,7 +128833,7 @@ static void exprAnalyzeOrTerm( } /* At this point, okToChngToIN is true if original pTerm satisfies - ** case 1. In that case, construct a new virtual term that is + ** case 1. In that case, construct a new virtual term that is ** pTerm converted into an IN operator. */ if( okToChngToIN ){ @@ -128962,8 +128962,8 @@ static int exprMightBeIndexed( int i; int iCur; - /* If this expression is a vector to the left or right of a - ** inequality constraint (>, <, >= or <=), perform the processing + /* If this expression is a vector to the left or right of a + ** inequality constraint (>, <, >= or <=), perform the processing ** on the first element of the vector. */ assert( TK_GT+1==TK_LE && TK_GT+2==TK_LT && TK_GT+3==TK_GE ); assert( TK_ISeOperator = operatorMask(op) & opMask; } if( op==TK_IS ) pTerm->wtFlags |= TERM_IS; - if( pRight + if( pRight && exprMightBeIndexed(pSrc, op, pTerm->prereqRight, pRight, &iCur,&iColumn) ){ WhereTerm *pNew; @@ -129154,7 +129154,7 @@ static void exprAnalyze( for(i=0; i<2; i++){ Expr *pNewExpr; int idxNew; - pNewExpr = sqlite3PExpr(pParse, ops[i], + pNewExpr = sqlite3PExpr(pParse, ops[i], sqlite3ExprDup(db, pExpr->pLeft, 0), sqlite3ExprDup(db, pList->a[i].pExpr, 0)); transferJoinMarkings(pNewExpr, pExpr); @@ -129192,7 +129192,7 @@ static void exprAnalyze( ** bound is made all lowercase so that the bounds also work when comparing ** BLOBs. */ - if( pWC->op==TK_AND + if( pWC->op==TK_AND && isLikeOrGlob(pParse, pExpr, &pStr1, &isComplete, &noCase) ){ Expr *pLeft; /* LHS of LIKE/GLOB operator */ @@ -129228,7 +129228,7 @@ static void exprAnalyze( if( noCase ){ /* The point is to increment the last character before the first ** wildcard. But if we increment '@', that will push it into the - ** alphabetic range where case conversions will mess up the + ** alphabetic range where case conversions will mess up the ** inequality. To avoid this, make sure to also run the full ** LIKE on all candidate expressions by clearing the isComplete flag */ @@ -129281,7 +129281,7 @@ static void exprAnalyze( prereqColumn = sqlite3WhereExprUsage(pMaskSet, pLeft); if( (prereqExpr & prereqColumn)==0 ){ Expr *pNewExpr; - pNewExpr = sqlite3PExpr(pParse, TK_MATCH, + pNewExpr = sqlite3PExpr(pParse, TK_MATCH, 0, sqlite3ExprDup(db, pRight, 0)); idxNew = whereClauseInsert(pWC, pNewExpr, TERM_VIRTUAL|TERM_DYNAMIC); testcase( idxNew==0 ); @@ -129306,11 +129306,11 @@ static void exprAnalyze( ** ** This is only required if at least one side of the comparison operation ** is not a sub-select. */ - if( pWC->op==TK_AND + if( pWC->op==TK_AND && (pExpr->op==TK_EQ || pExpr->op==TK_IS) && (nLeft = sqlite3ExprVectorSize(pExpr->pLeft))>1 && sqlite3ExprVectorSize(pExpr->pRight)==nLeft - && ( (pExpr->pLeft->flags & EP_xIsSelect)==0 + && ( (pExpr->pLeft->flags & EP_xIsSelect)==0 || (pExpr->pRight->flags & EP_xIsSelect)==0) ){ int i; @@ -129332,7 +129332,7 @@ static void exprAnalyze( /* If there is a vector IN term - e.g. "(a, b) IN (SELECT ...)" - create ** a virtual term for each vector component. The expression object - ** used by each such virtual term is pExpr (the full vector IN(...) + ** used by each such virtual term is pExpr (the full vector IN(...) ** expression). The WhereTerm.iField variable identifies the index within ** the vector on the LHS that the virtual term represents. ** @@ -129506,7 +129506,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereExprListUsage(WhereMaskSet *pMaskSet, ExprLis /* -** Call exprAnalyze on all terms in a WHERE clause. +** Call exprAnalyze on all terms in a WHERE clause. ** ** Note that exprAnalyze() might add new virtual terms onto the ** end of the WHERE clause. We do not want to analyze these new @@ -129525,7 +129525,7 @@ SQLITE_PRIVATE void sqlite3WhereExprAnalyze( /* ** For table-valued-functions, transform the function arguments into -** new WHERE clause terms. +** new WHERE clause terms. ** ** Each function argument translates into an equality constraint against ** a HIDDEN column in the table. @@ -129652,7 +129652,7 @@ SQLITE_PRIVATE int sqlite3WhereBreakLabel(WhereInfo *pWInfo){ ** operate directly on the rowis returned by a WHERE clause. Return ** ONEPASS_SINGLE (1) if the statement can operation directly because only ** a single row is to be changed. Return ONEPASS_MULTI (2) if the one-pass -** optimization can be used on multiple +** optimization can be used on multiple ** ** If the ONEPASS optimization is used (if this routine returns true) ** then also write the indices of open cursors used by ONEPASS @@ -129900,7 +129900,7 @@ static WhereTerm *whereScanInit( ** if pIdx!=0 and is one of the WO_xx operator codes specified by ** the op parameter. Return a pointer to the term. Return 0 if not found. ** -** If pIdx!=0 then it must be one of the indexes of table iCur. +** If pIdx!=0 then it must be one of the indexes of table iCur. ** Search for terms matching the iColumn-th column of pIdx ** rather than the iColumn-th column of table iCur. ** @@ -130013,17 +130013,17 @@ static int isDistinctRedundant( ){ Table *pTab; Index *pIdx; - int i; + int i; int iBase; /* If there is more than one table or sub-select in the FROM clause of - ** this query, then it will not be possible to show that the DISTINCT + ** this query, then it will not be possible to show that the DISTINCT ** clause is redundant. */ if( pTabList->nSrc!=1 ) return 0; iBase = pTabList->a[0].iCursor; pTab = pTabList->a[0].pTab; - /* If any of the expressions is an IPK column on table iBase, then return + /* If any of the expressions is an IPK column on table iBase, then return ** true. Note: The (p->iTable==iBase) part of this test may be false if the ** current SELECT is a correlated sub-query. */ @@ -130074,7 +130074,7 @@ static LogEst estLog(LogEst N){ ** Convert OP_Column opcodes to OP_Copy in previously generated code. ** ** This routine runs over generated VDBE code and translates OP_Column -** opcodes into OP_Copy when the table is being accessed via co-routine +** opcodes into OP_Copy when the table is being accessed via co-routine ** instead of via table lookup. ** ** If the bIncrRowid parameter is 0, then any OP_Rowid instructions on @@ -130378,7 +130378,7 @@ static void constructAutomaticIndex( sqlite3VdbeJumpHere(v, addrTop); sqlite3ReleaseTempReg(pParse, regRecord); sqlite3ExprCachePop(pParse); - + /* Jump here when skipping the initialization */ sqlite3VdbeJumpHere(v, addrInit); @@ -130389,7 +130389,7 @@ end_auto_index_create: #ifndef SQLITE_OMIT_VIRTUALTABLE /* -** Allocate and populate an sqlite3_index_info structure. It is the +** Allocate and populate an sqlite3_index_info structure. It is the ** responsibility of the caller to eventually release the structure ** by passing the pointer returned by this function to sqlite3_free(). */ @@ -130427,7 +130427,7 @@ static sqlite3_index_info *allocateIndexInfo( nTerm++; } - /* If the ORDER BY clause contains only columns in the current + /* If the ORDER BY clause contains only columns in the current ** virtual table then allocate space for the aOrderBy part of ** the sqlite3_index_info structure. */ @@ -130500,7 +130500,7 @@ static sqlite3_index_info *allocateIndexInfo( assert( pTerm->eOperator & (WO_IN|WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE|WO_MATCH) ); if( op & (WO_LT|WO_LE|WO_GT|WO_GE) - && sqlite3ExprIsVector(pTerm->pExpr->pRight) + && sqlite3ExprIsVector(pTerm->pExpr->pRight) ){ if( i<16 ) mNoOmit |= (1 << i); if( op==WO_LT ) pIdxCons[j].op = WO_LE; @@ -130558,7 +130558,7 @@ static int vtabBestIndex(Parse *pParse, Table *pTab, sqlite3_index_info *p){ ** Search for "xBestIndex malfunction" below */ for(i=0; inConstraint; i++){ if( !p->aConstraint[i].usable && p->aConstraintUsage[i].argvIndex>0 ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "table %s: xBestIndex returned an invalid plan", pTab->zName); } } @@ -130579,8 +130579,8 @@ static int vtabBestIndex(Parse *pParse, Table *pTab, sqlite3_index_info *p){ ** Return the index of the sample that is the smallest sample that ** is greater than or equal to pRec. Note that this index is not an index ** into the aSample[] array - it is an index into a virtual set of samples -** based on the contents of aSample[] and the number of fields in record -** pRec. +** based on the contents of aSample[] and the number of fields in record +** pRec. */ static int whereKeyStats( Parse *pParse, /* Database connection */ @@ -130616,38 +130616,38 @@ static int whereKeyStats( ** consider prefixes of those samples. For example, if the set of samples ** in aSample is: ** - ** aSample[0] = (a, 5) - ** aSample[1] = (a, 10) - ** aSample[2] = (b, 5) - ** aSample[3] = (c, 100) + ** aSample[0] = (a, 5) + ** aSample[1] = (a, 10) + ** aSample[2] = (b, 5) + ** aSample[3] = (c, 100) ** aSample[4] = (c, 105) ** - ** Then the search space should ideally be the samples above and the - ** unique prefixes [a], [b] and [c]. But since that is hard to organize, + ** Then the search space should ideally be the samples above and the + ** unique prefixes [a], [b] and [c]. But since that is hard to organize, ** the code actually searches this set: ** - ** 0: (a) - ** 1: (a, 5) - ** 2: (a, 10) - ** 3: (a, 10) - ** 4: (b) - ** 5: (b, 5) - ** 6: (c) - ** 7: (c, 100) + ** 0: (a) + ** 1: (a, 5) + ** 2: (a, 10) + ** 3: (a, 10) + ** 4: (b) + ** 5: (b, 5) + ** 6: (c) + ** 7: (c, 100) ** 8: (c, 105) ** 9: (c, 105) ** ** For each sample in the aSample[] array, N samples are present in the - ** effective sample array. In the above, samples 0 and 1 are based on + ** effective sample array. In the above, samples 0 and 1 are based on ** sample aSample[0]. Samples 2 and 3 on aSample[1] etc. ** ** Often, sample i of each block of N effective samples has (i+1) fields. ** Except, each sample may be extended to ensure that it is greater than or - ** equal to the previous sample in the array. For example, in the above, - ** sample 2 is the first sample of a block of N samples, so at first it - ** appears that it should be 1 field in size. However, that would make it - ** smaller than sample 1, so the binary search would not work. As a result, - ** it is extended to two fields. The duplicates that this creates do not + ** equal to the previous sample in the array. For example, in the above, + ** sample 2 is the first sample of a block of N samples, so at first it + ** appears that it should be 1 field in size. However, that would make it + ** smaller than sample 1, so the binary search would not work. As a result, + ** it is extended to two fields. The duplicates that this creates do not ** cause any problems. */ nField = pRec->nField; @@ -130661,7 +130661,7 @@ static int whereKeyStats( iSamp = iTest / nField; if( iSamp>0 ){ /* The proposed effective sample is a prefix of sample aSample[iSamp]. - ** Specifically, the shortest prefix of at least (1 + iTest%nField) + ** Specifically, the shortest prefix of at least (1 + iTest%nField) ** fields that is greater than the previous effective sample. */ for(n=(iTest % nField) + 1; nnSample ); assert( iCol==nField-1 ); pRec->nField = nField; - assert( 0==sqlite3VdbeRecordCompare(aSample[i].n, aSample[i].p, pRec) - || pParse->db->mallocFailed + assert( 0==sqlite3VdbeRecordCompare(aSample[i].n, aSample[i].p, pRec) + || pParse->db->mallocFailed ); }else{ /* Unless i==pIdx->nSample, indicating that pRec is larger than @@ -130705,7 +130705,7 @@ static int whereKeyStats( ** (iCol+1) field prefix of sample i. */ assert( i<=pIdx->nSample && i>=0 ); pRec->nField = iCol+1; - assert( i==pIdx->nSample + assert( i==pIdx->nSample || sqlite3VdbeRecordCompare(aSample[i].n, aSample[i].p, pRec)>0 || pParse->db->mallocFailed ); @@ -130733,7 +130733,7 @@ static int whereKeyStats( aStat[0] = aSample[i].anLt[iCol]; aStat[1] = aSample[i].anEq[iCol]; }else{ - /* At this point, the (iCol+1) field prefix of aSample[i] is the first + /* At this point, the (iCol+1) field prefix of aSample[i] is the first ** sample that is greater than pRec. Or, if i==pIdx->nSample then pRec ** is larger than all samples in the array. */ tRowcnt iUpper, iGap; @@ -130765,7 +130765,7 @@ static int whereKeyStats( /* ** If it is not NULL, pTerm is a term that provides an upper or lower -** bound on a range scan. Without considering pTerm, it is estimated +** bound on a range scan. Without considering pTerm, it is estimated ** that the scan will visit nNew rows. This function returns the number ** estimated to be visited after taking pTerm into account. ** @@ -130802,18 +130802,18 @@ SQLITE_PRIVATE char sqlite3IndexColumnAffinity(sqlite3 *db, Index *pIdx, int iCo #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 -/* +/* ** This function is called to estimate the number of rows visited by a ** range-scan on a skip-scan index. For example: ** ** CREATE INDEX i1 ON t1(a, b, c); ** SELECT * FROM t1 WHERE a=? AND c BETWEEN ? AND ?; ** -** Value pLoop->nOut is currently set to the estimated number of rows -** visited for scanning (a=? AND b=?). This function reduces that estimate +** Value pLoop->nOut is currently set to the estimated number of rows +** visited for scanning (a=? AND b=?). This function reduces that estimate ** by some factor to account for the (c BETWEEN ? AND ?) expression based -** on the stat4 data for the index. this scan will be peformed multiple -** times (once for each (a,b) combination that matches a=?) is dealt with +** on the stat4 data for the index. this scan will be peformed multiple +** times (once for each (a,b) combination that matches a=?) is dealt with ** by the caller. ** ** It does this by scanning through all stat4 samples, comparing values @@ -130834,7 +130834,7 @@ SQLITE_PRIVATE char sqlite3IndexColumnAffinity(sqlite3 *db, Index *pIdx, int iCo ** estimate of the number of rows delivered remains unchanged), *pbDone ** is left as is. ** -** If an error occurs, an SQLite error code is returned. Otherwise, +** If an error occurs, an SQLite error code is returned. Otherwise, ** SQLITE_OK. */ static int whereRangeSkipScanEst( @@ -130852,7 +130852,7 @@ static int whereRangeSkipScanEst( int rc = SQLITE_OK; u8 aff = sqlite3IndexColumnAffinity(db, p, nEq); CollSeq *pColl; - + sqlite3_value *p1 = 0; /* Value extracted from pLower */ sqlite3_value *p2 = 0; /* Value extracted from pUpper */ sqlite3_value *pVal = 0; /* Value extracted from record */ @@ -130884,7 +130884,7 @@ static int whereRangeSkipScanEst( nDiff = (nUpper - nLower); if( nDiff<=0 ) nDiff = 1; - /* If there is both an upper and lower bound specified, and the + /* If there is both an upper and lower bound specified, and the ** comparisons indicate that they are close together, use the fallback ** method (assume that the scan visits 1/64 of the rows) for estimating ** the number of rows visited. Otherwise, estimate the number of rows @@ -130931,7 +130931,7 @@ static int whereRangeSkipScanEst( ** ** ... FROM t1 WHERE a = ? AND b > ? AND b < ? ... ** -** then nEq is set to 1 (as the range restricted column, b, is the second +** then nEq is set to 1 (as the range restricted column, b, is the second ** left-most column of the index). Or, if the query is: ** ** ... FROM t1 WHERE a > ? AND a < ? ... @@ -130939,13 +130939,13 @@ static int whereRangeSkipScanEst( ** then nEq is set to 0. ** ** When this function is called, *pnOut is set to the sqlite3LogEst() of the -** number of rows that the index scan is expected to visit without -** considering the range constraints. If nEq is 0, then *pnOut is the number of +** number of rows that the index scan is expected to visit without +** considering the range constraints. If nEq is 0, then *pnOut is the number of ** rows in the index. Assuming no error occurs, *pnOut is adjusted (reduced) ** to account for the range constraints pLower and pUpper. -** +** ** In the absence of sqlite_stat4 ANALYZE data, or if such data cannot be -** used, a single range inequality reduces the search space by a factor of 4. +** used, a single range inequality reduces the search space by a factor of 4. ** and a pair of constraints (x>? AND xu.btree.nBtm; int nTop = pLoop->u.btree.nTop; - /* Variable iLower will be set to the estimate of the number of rows in + /* Variable iLower will be set to the estimate of the number of rows in ** the index that are less than the lower bound of the range query. The ** lower bound being the concatenation of $P and $L, where $P is the ** key-prefix formed by the nEq values matched against the nEq left-most @@ -130980,7 +130980,7 @@ static int whereRangeScanEst( ** Or, if pLower is NULL or $L cannot be extracted from it (because it ** is not a simple variable or literal value), the lower bound of the ** range is $P. Due to a quirk in the way whereKeyStats() works, even - ** if $L is available, whereKeyStats() is called for both ($P) and + ** if $L is available, whereKeyStats() is called for both ($P) and ** ($P:$L) and the larger of the two returned values is used. ** ** Similarly, iUpper is to be set to the estimate of the number of rows @@ -131004,7 +131004,7 @@ static int whereRangeScanEst( iLower = 0; iUpper = p->nRowEst0; }else{ - /* Note: this call could be optimized away - since the same values must + /* Note: this call could be optimized away - since the same values must ** have been requested when testing key $P in whereEqualScanEst(). */ whereKeyStats(pParse, p, pRec, 0, a); iLower = a[0]; @@ -131092,7 +131092,7 @@ static int whereRangeScanEst( ** reduced by an additional 75%. This means that, by default, an open-ended ** range query (e.g. col > ?) is assumed to match 1/4 of the rows in the ** index. While a closed range (e.g. col BETWEEN ? AND ?) is estimated to - ** match 1/64 of the index. */ + ** match 1/64 of the index. */ if( pLower && pLower->truthProb>0 && pUpper && pUpper->truthProb>0 ){ nNew -= 20; } @@ -131119,7 +131119,7 @@ static int whereRangeScanEst( ** for that index. When pExpr==NULL that means the constraint is ** "x IS NULL" instead of "x=VALUE". ** -** Write the estimated row count into *pnRow and return SQLITE_OK. +** Write the estimated row count into *pnRow and return SQLITE_OK. ** If unable to make an estimate, leave *pnRow unchanged and return ** non-zero. ** @@ -131170,7 +131170,7 @@ static int whereEqualScanEst( WHERETRACE(0x10,("equality scan regions %s(%d): %d\n", p->zName, nEq-1, (int)a[1])); *pnRow = a[1]; - + return rc; } #endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */ @@ -131183,7 +131183,7 @@ static int whereEqualScanEst( ** ** WHERE x IN (1,2,3,4) ** -** Write the estimated row count into *pnRow and return SQLITE_OK. +** Write the estimated row count into *pnRow and return SQLITE_OK. ** If unable to make an estimate, leave *pnRow unchanged and return ** non-zero. ** @@ -131243,7 +131243,7 @@ static void whereTermPrint(WhereTerm *pTerm, int iTerm){ sqlite3_snprintf(sizeof(zLeft),zLeft,"left={%d:%d}", pTerm->leftCursor, pTerm->u.leftColumn); }else if( (pTerm->eOperator & WO_OR)!=0 && pTerm->u.pOrInfo!=0 ){ - sqlite3_snprintf(sizeof(zLeft),zLeft,"indexable=0x%lld", + sqlite3_snprintf(sizeof(zLeft),zLeft,"indexable=0x%lld", pTerm->u.pOrInfo->indexable); }else{ sqlite3_snprintf(sizeof(zLeft),zLeft,"left=%d", pTerm->leftCursor); @@ -131440,7 +131440,7 @@ static void whereInfoFree(sqlite3 *db, WhereInfo *pWInfo){ ** by Y. ** ** If X is a proper subset of Y then Y is a better choice and ought -** to have a lower cost. This routine returns TRUE when that cost +** to have a lower cost. This routine returns TRUE when that cost ** relationship is inverted and needs to be adjusted. The third rule ** was added because if X uses skip-scan less than Y it still might ** deserve a lower cost even if it is a proper subset of Y. @@ -131488,7 +131488,7 @@ static void whereLoopAdjustCost(const WhereLoop *p, WhereLoop *pTemplate){ if( p->iTab!=pTemplate->iTab ) continue; if( (p->wsFlags & WHERE_INDEXED)==0 ) continue; if( whereLoopCheaperProperSubset(p, pTemplate) ){ - /* Adjust pTemplate cost downward so that it is cheaper than its + /* Adjust pTemplate cost downward so that it is cheaper than its ** subset p. */ WHERETRACE(0x80,("subset cost adjustment %d,%d to %d,%d\n", pTemplate->rRun, pTemplate->nOut, p->rRun, p->nOut-1)); @@ -131533,7 +131533,7 @@ static WhereLoop **whereLoopFindLesser( /* In the current implementation, the rSetup value is either zero ** or the cost of building an automatic index (NlogN) and the NlogN ** is the same for compatible WhereLoops. */ - assert( p->rSetup==0 || pTemplate->rSetup==0 + assert( p->rSetup==0 || pTemplate->rSetup==0 || p->rSetup==pTemplate->rSetup ); /* whereLoopAddBtree() always generates and inserts the automatic index @@ -131598,7 +131598,7 @@ static WhereLoop **whereLoopFindLesser( ** ** When accumulating multiple loops (when pBuilder->pOrSet is NULL) we ** still might overwrite similar loops with the new template if the -** new template is better. Loops may be overwritten if the following +** new template is better. Loops may be overwritten if the following ** conditions are met: ** ** (1) They have the same iTab. @@ -131647,7 +131647,7 @@ static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){ whereLoopPrint(pTemplate, pBuilder->pWC); } #endif - return SQLITE_OK; + return SQLITE_OK; }else{ p = *ppPrev; } @@ -131778,7 +131778,7 @@ static void whereLoopOutputAdjust( if( pLoop->nOut > nRow-iReduce ) pLoop->nOut = nRow - iReduce; } -/* +/* ** Term pTerm is a vector range comparison operation. The first comparison ** in the vector can be optimized using column nEq of the index. This ** function returns the total number of vector elements that can be used @@ -131807,7 +131807,7 @@ static int whereRangeVectorLen( nCmp = MIN(nCmp, (pIdx->nColumn - nEq)); for(i=1; iop!=TK_COLUMN - || pLhs->iTable!=iCur - || pLhs->iColumn!=pIdx->aiColumn[i+nEq] + if( pLhs->op!=TK_COLUMN + || pLhs->iTable!=iCur + || pLhs->iColumn!=pIdx->aiColumn[i+nEq] || pIdx->aSortOrder[i+nEq]!=pIdx->aSortOrder[nEq] ){ break; @@ -131855,12 +131855,12 @@ static int whereRangeVectorLen( #endif /* -** We have so far matched pBuilder->pNew->u.btree.nEq terms of the +** We have so far matched pBuilder->pNew->u.btree.nEq terms of the ** index pIndex. Try to match one more. ** -** When this function is called, pBuilder->pNew->nOut contains the -** number of rows expected to be visited by filtering using the nEq -** terms only. If it is modified, this value is restored before this +** When this function is called, pBuilder->pNew->nOut contains the +** number of rows expected to be visited by filtering using the nEq +** terms only. If it is modified, this value is restored before this ** function returns. ** ** If pProbe->tnum==0, that means pIndex is a fake index used for the @@ -131963,9 +131963,9 @@ static int whereLoopAddBtreeIndex( pNew->prereq = (saved_prereq | pTerm->prereqRight) & ~pNew->maskSelf; assert( nInMul==0 - || (pNew->wsFlags & WHERE_COLUMN_NULL)!=0 - || (pNew->wsFlags & WHERE_COLUMN_IN)!=0 - || (pNew->wsFlags & WHERE_SKIPSCAN)!=0 + || (pNew->wsFlags & WHERE_COLUMN_NULL)!=0 + || (pNew->wsFlags & WHERE_COLUMN_IN)!=0 + || (pNew->wsFlags & WHERE_SKIPSCAN)!=0 ); if( eOp & WO_IN ){ @@ -131994,7 +131994,7 @@ static int whereLoopAddBtreeIndex( int iCol = pProbe->aiColumn[saved_nEq]; pNew->wsFlags |= WHERE_COLUMN_EQ; assert( saved_nEq==pNew->u.btree.nEq ); - if( iCol==XN_ROWID + if( iCol==XN_ROWID || (iCol>0 && nInMul==0 && saved_nEq==pProbe->nKeyCol-1) ){ if( iCol>=0 && pProbe->uniqNotNull==0 ){ @@ -132041,7 +132041,7 @@ static int whereLoopAddBtreeIndex( /* At this point pNew->nOut is set to the number of rows expected to ** be visited by the index scan before considering term pTerm, or the - ** values of nIn and nInMul. In other words, assuming that all + ** values of nIn and nInMul. In other words, assuming that all ** "x IN(...)" terms are replaced with "x = ?". This block updates ** the value of pNew->nOut to account for pTerm (but not nIn/nInMul). */ assert( pNew->nOut==saved_nOut ); @@ -132062,8 +132062,8 @@ static int whereLoopAddBtreeIndex( }else{ #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 tRowcnt nOut = 0; - if( nInMul==0 - && pProbe->nSample + if( nInMul==0 + && pProbe->nSample && pNew->u.btree.nEq<=pProbe->nSampleCol && ((eOp & WO_IN)==0 || !ExprHasProperty(pTerm->pExpr, EP_xIsSelect)) ){ @@ -132089,8 +132089,8 @@ static int whereLoopAddBtreeIndex( { pNew->nOut += (pProbe->aiRowLogEst[nEq] - pProbe->aiRowLogEst[nEq-1]); if( eOp & WO_ISNULL ){ - /* TUNING: If there is no likelihood() value, assume that a - ** "col IS NULL" expression matches twice as many rows + /* TUNING: If there is no likelihood() value, assume that a + ** "col IS NULL" expression matches twice as many rows ** as (col=?). */ pNew->nOut += 10; } @@ -132142,12 +132142,12 @@ static int whereLoopAddBtreeIndex( /* Consider using a skip-scan if there are no WHERE clause constraints ** available for the left-most terms of the index, and if the average - ** number of repeats in the left-most terms is at least 18. + ** number of repeats in the left-most terms is at least 18. ** ** The magic number 18 is selected on the basis that scanning 17 rows ** is almost always quicker than an index seek (even though if the index ** contains fewer than 2^17 rows we assume otherwise in other parts of - ** the code). And, even if it is not, it should not be too much slower. + ** the code). And, even if it is not, it should not be too much slower. ** On the other hand, the extra seeks could end up being significantly ** more expensive. */ assert( 42==sqlite3LogEst(18) ); @@ -132247,7 +132247,7 @@ static int whereUsablePartialIndex(int iTab, WhereClause *pWC, Expr *pWhere){ } for(i=0, pTerm=pWC->a; inTerm; i++, pTerm++){ Expr *pExpr = pTerm->pExpr; - if( sqlite3ExprImpliesExpr(pExpr, pWhere, iTab) + if( sqlite3ExprImpliesExpr(pExpr, pWhere, iTab) && (!ExprHasProperty(pExpr, EP_FromJoin) || pExpr->iRightJoinTable==iTab) ){ return 1; @@ -132270,18 +132270,18 @@ static int whereUsablePartialIndex(int iTab, WhereClause *pWC, Expr *pWhere){ ** cost = nRow * K // scan of covering index ** cost = nRow * (K+3.0) // scan of non-covering index ** -** where K is a value between 1.1 and 3.0 set based on the relative +** where K is a value between 1.1 and 3.0 set based on the relative ** estimated average size of the index and table records. ** ** For an index scan, where nVisit is the number of index rows visited -** by the scan, and nSeek is the number of seek operations required on +** by the scan, and nSeek is the number of seek operations required on ** the index b-tree: ** ** cost = nSeek * (log(nRow) + K * nVisit) // covering index ** cost = nSeek * (log(nRow) + (K+3.0) * nVisit) // non-covering index ** -** Normally, nSeek is 1. nSeek values greater than 1 come about if the -** WHERE clause includes "x IN (....)" terms used in place of "x=?". Or when +** Normally, nSeek is 1. nSeek values greater than 1 come about if the +** WHERE clause includes "x IN (....)" terms used in place of "x=?". Or when ** implicit "x IN (SELECT x FROM tbl)" terms are added for skip-scans. ** ** The estimated values (nRow, nVisit, nSeek) often contain a large amount @@ -132311,7 +132311,7 @@ static int whereLoopAddBtree( LogEst rLogSize; /* Logarithm of the number of rows in the table */ WhereClause *pWC; /* The parsed WHERE clause */ Table *pTab; /* Table being queried */ - + pNew = pBuilder->pNew; pWInfo = pBuilder->pWInfo; pTabList = pWInfo->pTabList; @@ -132489,7 +132489,7 @@ static int whereLoopAddBtree( if( pTerm->eOperator & (WO_EQ|WO_IS) ) nLookup -= 19; } } - + pNew->rRun = sqlite3LogEstAdd(pNew->rRun, nLookup); } ApplyCostMultiplier(pNew->rRun, pTab->costMult); @@ -132560,13 +132560,13 @@ static int whereLoopAddVirtualOne( *pbIn = 0; pNew->prereq = mPrereq; - /* Set the usable flag on the subset of constraints identified by + /* Set the usable flag on the subset of constraints identified by ** arguments mUsable and mExclude. */ pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint; for(i=0; ia[pIdxCons->iTermOffset]; pIdxCons->usable = 0; - if( (pTerm->prereqRight & mUsable)==pTerm->prereqRight + if( (pTerm->prereqRight & mUsable)==pTerm->prereqRight && (pTerm->eOperator & mExclude)==0 ){ pIdxCons->usable = 1; @@ -132674,8 +132674,8 @@ static int whereLoopAddVirtualOne( ** entries that occur before the virtual table in the FROM clause and are ** separated from it by at least one LEFT or CROSS JOIN. Similarly, the ** mUnusable mask contains all FROM clause entries that occur after the -** virtual table and are separated from it by at least one LEFT or -** CROSS JOIN. +** virtual table and are separated from it by at least one LEFT or +** CROSS JOIN. ** ** For example, if the query were: ** @@ -132683,9 +132683,9 @@ static int whereLoopAddVirtualOne( ** ** then mPrereq corresponds to (t1, t2) and mUnusable to (t5, t6). ** -** All the tables in mPrereq must be scanned before the current virtual -** table. So any terms for which all prerequisites are satisfied by -** mPrereq may be specified as "usable" in all calls to xBestIndex. +** All the tables in mPrereq must be scanned before the current virtual +** table. So any terms for which all prerequisites are satisfied by +** mPrereq may be specified as "usable" in all calls to xBestIndex. ** Conversely, all tables in mUnusable must be scanned after the current ** virtual table, so any terms for which the prerequisites overlap with ** mUnusable should always be configured as "not-usable" for xBestIndex. @@ -132714,7 +132714,7 @@ static int whereLoopAddVirtual( pNew = pBuilder->pNew; pSrc = &pWInfo->pTabList->a[pNew->iTab]; assert( IsVirtual(pSrc->pTab) ); - p = allocateIndexInfo(pParse, pWC, mUnusable, pSrc, pBuilder->pOrderBy, + p = allocateIndexInfo(pParse, pWC, mUnusable, pSrc, pBuilder->pOrderBy, &mNoOmit); if( p==0 ) return SQLITE_NOMEM_BKPT; pNew->rSetup = 0; @@ -132733,7 +132733,7 @@ static int whereLoopAddVirtual( /* If the call to xBestIndex() with all terms enabled produced a plan ** that does not require any source tables (IOW: a plan with mBest==0), - ** then there is no point in making any further calls to xBestIndex() + ** then there is no point in making any further calls to xBestIndex() ** since they will all return the same result (if the xBestIndex() ** implementation is sane). */ if( rc==SQLITE_OK && (mBest = (pNew->prereq & ~mPrereq))!=0 ){ @@ -132756,7 +132756,7 @@ static int whereLoopAddVirtual( } } - /* Call xBestIndex once for each distinct value of (prereqRight & ~mPrereq) + /* Call xBestIndex once for each distinct value of (prereqRight & ~mPrereq) ** in the set of terms that apply to the current virtual table. */ while( rc==SQLITE_OK ){ int i; @@ -132812,8 +132812,8 @@ static int whereLoopAddVirtual( ** btrees or virtual tables. */ static int whereLoopAddOr( - WhereLoopBuilder *pBuilder, - Bitmask mPrereq, + WhereLoopBuilder *pBuilder, + Bitmask mPrereq, Bitmask mUnusable ){ WhereInfo *pWInfo = pBuilder->pWInfo; @@ -132826,7 +132826,7 @@ static int whereLoopAddOr( WhereLoopBuilder sSubBuild; WhereOrSet sSum, sCur; struct SrcList_item *pItem; - + pWC = pBuilder->pWC; pWCEnd = pWC->a + pWC->nTerm; pNew = pBuilder->pNew; @@ -132836,14 +132836,14 @@ static int whereLoopAddOr( for(pTerm=pWC->a; pTermeOperator & WO_OR)!=0 - && (pTerm->u.pOrInfo->indexable & pNew->maskSelf)!=0 + && (pTerm->u.pOrInfo->indexable & pNew->maskSelf)!=0 ){ WhereClause * const pOrWC = &pTerm->u.pOrInfo->wc; WhereTerm * const pOrWCEnd = &pOrWC->a[pOrWC->nTerm]; WhereTerm *pOrTerm; int once = 1; int i, j; - + sSubBuild = *pBuilder; sSubBuild.pOrderBy = 0; sSubBuild.pOrSet = &sCur; @@ -132864,7 +132864,7 @@ static int whereLoopAddOr( } sCur.n = 0; #ifdef WHERETRACE_ENABLED - WHERETRACE(0x200, ("OR-term %d of %p has %d subterms:\n", + WHERETRACE(0x200, ("OR-term %d of %p has %d subterms:\n", (int)(pOrTerm-pOrWC->a), pTerm, sSubBuild.pWC->nTerm)); if( sqlite3WhereTrace & 0x400 ){ sqlite3WhereClausePrint(sSubBuild.pWC); @@ -132911,8 +132911,8 @@ static int whereLoopAddOr( /* TUNING: Currently sSum.a[i].rRun is set to the sum of the costs ** of all sub-scans required by the OR-scan. However, due to rounding ** errors, it may be that the cost of the OR-scan is equal to its - ** most expensive sub-scan. Add the smallest possible penalty - ** (equivalent to multiplying the cost by 1.07) to ensure that + ** most expensive sub-scan. Add the smallest possible penalty + ** (equivalent to multiplying the cost by 1.07) to ensure that ** this does not happen. Otherwise, for WHERE clauses such as the ** following where there is an index on "y": ** @@ -132932,7 +132932,7 @@ static int whereLoopAddOr( } /* -** Add all WhereLoop objects for all tables +** Add all WhereLoop objects for all tables */ static int whereLoopAddAll(WhereLoopBuilder *pBuilder){ WhereInfo *pWInfo = pBuilder->pWInfo; @@ -132989,17 +132989,17 @@ static int whereLoopAddAll(WhereLoopBuilder *pBuilder){ ** Examine a WherePath (with the addition of the extra WhereLoop of the 5th ** parameters) to see if it outputs rows in the requested ORDER BY ** (or GROUP BY) without requiring a separate sort operation. Return N: -** +** ** N>0: N terms of the ORDER BY clause are satisfied ** N==0: No terms of the ORDER BY clause are satisfied -** N<0: Unknown yet how many terms of ORDER BY might be satisfied. +** N<0: Unknown yet how many terms of ORDER BY might be satisfied. ** ** Note that processing for WHERE_GROUPBY and WHERE_DISTINCTBY is not as ** strict. With GROUP BY and DISTINCT the only requirement is that ** equivalent rows appear immediately adjacent to one another. GROUP BY ** and DISTINCT do not require rows to appear in any particular order as long ** as equivalent rows are grouped together. Thus for GROUP BY and DISTINCT -** the pOrderBy terms can be matched in any order. With ORDER BY, the +** the pOrderBy terms can be matched in any order. With ORDER BY, the ** pOrderBy terms must be matched in strict left-to-right order. */ static i8 wherePathSatisfiesOrderBy( @@ -133049,7 +133049,7 @@ static i8 wherePathSatisfiesOrderBy( ** row of the WhereLoop. Every one-row WhereLoop is automatically ** order-distinct. A WhereLoop that has no columns in the ORDER BY clause ** is not order-distinct. To be order-distinct is not quite the same as being - ** UNIQUE since a UNIQUE column or index can have multiple rows that + ** UNIQUE since a UNIQUE column or index can have multiple rows that ** are NULL and NULL values are equivalent for the purpose of order-distinct. ** To be order-distinct, the columns must be UNIQUE and NOT NULL. ** @@ -133098,7 +133098,7 @@ static i8 wherePathSatisfiesOrderBy( ~ready, eqOpMask, 0); if( pTerm==0 ) continue; if( pTerm->eOperator==WO_IN ){ - /* IN terms are only valid for sorting in the ORDER BY LIMIT + /* IN terms are only valid for sorting in the ORDER BY LIMIT ** optimization, and then only if they are actually used ** by the query plan */ assert( wctrlFlags & WHERE_ORDERBY_LIMIT ); @@ -133143,16 +133143,16 @@ static i8 wherePathSatisfiesOrderBy( for(j=0; j=pLoop->u.btree.nEq + assert( j>=pLoop->u.btree.nEq || (pLoop->aLTerm[j]==0)==(jnSkip) ); if( ju.btree.nEq && j>=pLoop->nSkip ){ u16 eOp = pLoop->aLTerm[j]->eOperator; /* Skip over == and IS and ISNULL terms. (Also skip IN terms when - ** doing WHERE_ORDERBY_LIMIT processing). + ** doing WHERE_ORDERBY_LIMIT processing). ** - ** If the current term is a column of an ((?,?) IN (SELECT...)) + ** If the current term is a column of an ((?,?) IN (SELECT...)) ** expression for which the SELECT returns more than one column, ** check that it is the only column used by this loop. Otherwise, ** if it is one of two or more, none of the columns can be @@ -133162,7 +133162,7 @@ static i8 wherePathSatisfiesOrderBy( testcase( isOrderDistinct ); isOrderDistinct = 0; } - continue; + continue; }else if( ALWAYS(eOp & WO_IN) ){ /* ALWAYS() justification: eOp is an equality operator due to the ** ju.btree.nEq constraint above. Any equality other @@ -133203,7 +133203,7 @@ static i8 wherePathSatisfiesOrderBy( } /* Find the ORDER BY term that corresponds to the j-th column - ** of the index and mark that ORDER BY term off + ** of the index and mark that ORDER BY term off */ isMatch = 0; for(i=0; bOnce && i0 ? -1 : nOrderBy; } @@ -133488,7 +133488,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ assert( 10==sqlite3LogEst(2) ); continue; } - /* At this point, pWLoop is a candidate to be the next loop. + /* At this point, pWLoop is a candidate to be the next loop. ** Compute its cost */ rUnsorted = sqlite3LogEstAdd(pWLoop->rSetup,pWLoop->rRun + pFrom->nRow); rUnsorted = sqlite3LogEstAdd(rUnsorted, pFrom->rUnsorted); @@ -133511,7 +133511,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ WHERETRACE(0x002, ("---- sort cost=%-3d (%d/%d) increases cost %3d to %-3d\n", - aSortCost[isOrdered], (nOrderBy-isOrdered), nOrderBy, + aSortCost[isOrdered], (nOrderBy-isOrdered), nOrderBy, rUnsorted, rCost)); }else{ rCost = rUnsorted; @@ -133620,8 +133620,8 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ mxCost = aTo[0].rCost; mxUnsorted = aTo[0].nRow; for(jj=1, pTo=&aTo[1]; jjrCost>mxCost - || (pTo->rCost==mxCost && pTo->rUnsorted>mxUnsorted) + if( pTo->rCost>mxCost + || (pTo->rCost==mxCost && pTo->rUnsorted>mxUnsorted) ){ mxCost = pTo->rCost; mxUnsorted = pTo->rUnsorted; @@ -133660,7 +133660,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ sqlite3DbFree(db, pSpace); return SQLITE_ERROR; } - + /* Find the lowest cost path. pFrom will be left pointing to that path */ pFrom = aFrom; for(ii=1; iinOBSat = 0; if( nLoop>0 ){ u32 wsFlags = pFrom->aLoop[nLoop-1]->wsFlags; - if( (wsFlags & WHERE_ONEROW)==0 + if( (wsFlags & WHERE_ONEROW)==0 && (wsFlags&(WHERE_IPK|WHERE_COLUMN_IN))!=(WHERE_IPK|WHERE_COLUMN_IN) ){ Bitmask m = 0; @@ -133718,7 +133718,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ && pWInfo->nOBSat==pWInfo->pOrderBy->nExpr && nLoop>0 ){ Bitmask revMask = 0; - int nOrder = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, + int nOrder = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, pFrom, 0, nLoop-1, pFrom->aLoop[nLoop-1], &revMask ); assert( pWInfo->sorted==0 ); @@ -133745,7 +133745,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ ** times for the common case. ** ** Return non-zero on success, if this query can be handled by this -** no-frills query planner. Return zero if this query needs the +** no-frills query planner. Return zero if this query needs the ** general-purpose query planner. */ static int whereShortCut(WhereLoopBuilder *pBuilder){ @@ -133785,8 +133785,8 @@ static int whereShortCut(WhereLoopBuilder *pBuilder){ int opMask; assert( pLoop->aLTermSpace==pLoop->aLTerm ); if( !IsUniqueIndex(pIdx) - || pIdx->pPartIdxWhere!=0 - || pIdx->nKeyCol>ArraySize(pLoop->aLTermSpace) + || pIdx->pPartIdxWhere!=0 + || pIdx->nKeyCol>ArraySize(pLoop->aLTermSpace) ) continue; opMask = pIdx->uniqNotNull ? (WO_EQ|WO_IS) : WO_EQ; for(j=0; jnKeyCol; j++){ @@ -133906,7 +133906,7 @@ static int whereShortCut(WhereLoopBuilder *pBuilder){ ** if there is one. If there is no ORDER BY clause or if this routine ** is called from an UPDATE or DELETE statement, then pOrderBy is NULL. ** -** The iIdxCur parameter is the cursor number of an index. If +** The iIdxCur parameter is the cursor number of an index. If ** WHERE_OR_SUBCLAUSE is set, iIdxCur is the cursor number of an index ** to use for OR clause processing. The WHERE clause should use this ** specific cursor. If WHERE_ONEPASS_DESIRED is set, then iIdxCur is @@ -133939,8 +133939,8 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( u8 bFordelete = 0; /* OPFLAG_FORDELETE or zero, as appropriate */ assert( (wctrlFlags & WHERE_ONEPASS_MULTIROW)==0 || ( - (wctrlFlags & WHERE_ONEPASS_DESIRED)!=0 - && (wctrlFlags & WHERE_OR_SUBCLAUSE)==0 + (wctrlFlags & WHERE_ONEPASS_DESIRED)!=0 + && (wctrlFlags & WHERE_OR_SUBCLAUSE)==0 )); /* Only one of WHERE_OR_SUBCLAUSE or WHERE_USE_LIMIT */ @@ -133963,7 +133963,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( } /* The number of tables in the FROM clause is limited by the number of - ** bits in a Bitmask + ** bits in a Bitmask */ testcase( pTabList->nSrc==BMS ); if( pTabList->nSrc>BMS ){ @@ -133971,7 +133971,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( return 0; } - /* This function normally generates a nested loop for all tables in + /* This function normally generates a nested loop for all tables in ** pTabList. But if the WHERE_OR_SUBCLAUSE flag is set, then we should ** only generate code for the first table in pTabList and assume that ** any cursors associated with subsequent tables are uninitialized. @@ -134002,7 +134002,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( pWInfo->wctrlFlags = wctrlFlags; pWInfo->iLimit = iAuxArg; pWInfo->savedNQueryLoop = pParse->nQueryLoop; - memset(&pWInfo->nOBSat, 0, + memset(&pWInfo->nOBSat, 0, offsetof(WhereInfo,sWC) - offsetof(WhereInfo,nOBSat)); memset(&pWInfo->a[0], 0, sizeof(WhereLoop)+nTabList*sizeof(WhereLevel)); assert( pWInfo->eOnePass==ONEPASS_OFF ); /* ONEPASS defaults to OFF */ @@ -134022,7 +134022,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( initMaskSet(pMaskSet); sqlite3WhereClauseInit(&pWInfo->sWC, pWInfo); sqlite3WhereSplit(&pWInfo->sWC, pWhere, TK_AND); - + /* Special case: a WHERE clause that is constant. Evaluate the ** expression and either jump over all of the code or fall thru. */ @@ -134100,7 +134100,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( if( nTabList!=1 || whereShortCut(&sWLB)==0 ){ rc = whereLoopAddAll(&sWLB); if( rc ) goto whereBeginError; - + #ifdef WHERETRACE_ENABLED if( sqlite3WhereTrace ){ /* Display all of the WhereLoop objects */ WhereLoop *p; @@ -134113,7 +134113,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( } } #endif - + wherePathSolver(pWInfo, 0); if( db->mallocFailed ) goto whereBeginError; if( pWInfo->pOrderBy ){ @@ -134373,7 +134373,7 @@ whereBeginError: } /* -** Generate the end of the WHERE loop. See comments on +** Generate the end of the WHERE loop. See comments on ** sqlite3WhereBegin() for additional information. */ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ @@ -134438,8 +134438,8 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ if( (ws & WHERE_IDX_ONLY)==0 ){ sqlite3VdbeAddOp1(v, OP_NullRow, pTabList->a[i].iCursor); } - if( (ws & WHERE_INDEXED) - || ((ws & WHERE_MULTI_OR) && pLevel->u.pCovidx) + if( (ws & WHERE_INDEXED) + || ((ws & WHERE_MULTI_OR) && pLevel->u.pCovidx) ){ sqlite3VdbeAddOp1(v, OP_NullRow, pLevel->iIdxCur); } @@ -134483,7 +134483,7 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ ** from the index instead of from the table where possible. In some cases ** this optimization prevents the table from ever being read, which can ** yield a significant performance boost. - ** + ** ** Calls to the code generator in between sqlite3WhereBegin and ** sqlite3WhereEnd will have created code that references the table ** directly. This loop scans all that code looking for opcodes @@ -134517,7 +134517,7 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ pOp->p2 = x; pOp->p1 = pLevel->iIdxCur; } - assert( (pLoop->wsFlags & WHERE_IDX_ONLY)==0 || x>=0 + assert( (pLoop->wsFlags & WHERE_IDX_ONLY)==0 || x>=0 || pWInfo->eOnePass ); }else if( pOp->opcode==OP_Rowid ){ pOp->p1 = pLevel->iIdxCur; @@ -134644,7 +134644,7 @@ static void disableLookaside(Parse *pParse){ pLoop->pNext = pNext; pLoop->selFlags |= SF_Compound; } - if( (p->selFlags & SF_MultiValue)==0 && + if( (p->selFlags & SF_MultiValue)==0 && (mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0 && cnt>mxSelect ){ @@ -134682,7 +134682,7 @@ static void disableLookaside(Parse *pParse){ } #if SQLITE_MAX_EXPR_DEPTH>0 p->nHeight = 1; -#endif +#endif } pOut->pExpr = p; pOut->zStart = t.z; @@ -134721,7 +134721,7 @@ static void disableLookaside(Parse *pParse){ ){ pOperand->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0); pOperand->zEnd = &pPostOp->z[pPostOp->n]; - } + } /* A routine to convert a binary TK_IS or TK_ISNOT expression into a ** unary TK_ISNULL or TK_NOTNULL expression. */ @@ -134800,7 +134800,7 @@ static void disableLookaside(Parse *pParse){ ** the minor type might be the name of the identifier. ** Each non-terminal can have a different minor type. ** Terminal symbols all have the same minor type, though. -** This macros defines the minor type for terminal +** This macros defines the minor type for terminal ** symbols. ** YYMINORTYPE is the data type used for all minor types. ** This is typically a union of many types, one of @@ -134885,7 +134885,7 @@ typedef union { /* Next are the tables used to determine what action to take based on the ** current state and lookahead token. These tables are used to implement ** functions that take a state number and lookahead value and return an -** action integer. +** action integer. ** ** Suppose the action integer is N. Then the action is determined as ** follows @@ -135398,9 +135398,9 @@ static const YYACTIONTYPE yy_default[] = { }; /********** End of lemon-generated parsing tables *****************************/ -/* The next table maps tokens (terminal symbols) into fallback tokens. +/* The next table maps tokens (terminal symbols) into fallback tokens. ** If a construct like the following: -** +** ** %fallback ID X Y Z. ** ** appears in the grammar, then ID becomes a fallback token for X, Y, @@ -135566,10 +135566,10 @@ static char *yyTracePrompt = 0; #endif /* NDEBUG */ #ifndef NDEBUG -/* +/* ** Turn parser tracing on by giving a stream to which to write the trace ** and a prompt to preface each trace message. Tracing is turned off -** by making either argument NULL +** by making either argument NULL ** ** Inputs: **
            @@ -135594,7 +135594,7 @@ SQLITE_PRIVATE void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){ #ifndef NDEBUG /* For tracing shifts, the names of all terminals and nonterminals ** are required. The following table supplies these names */ -static const char *const yyTokenName[] = { +static const char *const yyTokenName[] = { "$", "SEMI", "EXPLAIN", "QUERY", "PLAN", "BEGIN", "TRANSACTION", "DEFERRED", "IMMEDIATE", "EXCLUSIVE", "COMMIT", "END", @@ -136030,7 +136030,7 @@ static int yyGrowStack(yyParser *p){ #endif p->yystksz = newSize; } - return pNew==0; + return pNew==0; } #endif @@ -136068,7 +136068,7 @@ SQLITE_PRIVATE void sqlite3ParserInit(void *yypParser){ } #ifndef sqlite3Parser_ENGINEALWAYSONSTACK -/* +/* ** This function allocates a new parser. ** The only argument is a pointer to a function which works like ** malloc. @@ -136092,7 +136092,7 @@ SQLITE_PRIVATE void *sqlite3ParserAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){ /* The following function deletes the "minor type" or semantic value ** associated with a symbol. The symbol can be either a terminal ** or nonterminal. "yymajor" is the symbol code, and "yypminor" is -** a pointer to the value to be deleted. The code used to do the +** a pointer to the value to be deleted. The code used to do the ** deletions is derived from the %destructor and/or %token_destructor ** directives of the input grammar. */ @@ -136106,7 +136106,7 @@ static void yy_destructor( /* Here is inserted the actions which take place when a ** terminal or non-terminal is destroyed. This can happen ** when the symbol is popped from the stack during a - ** reduce or during error processing or when a parser is + ** reduce or during error processing or when a parser is ** being destroyed before it is finished parsing. ** ** Note: during a reduce, the only symbols destroyed are those @@ -136225,7 +136225,7 @@ SQLITE_PRIVATE void sqlite3ParserFinalize(void *p){ } #ifndef sqlite3Parser_ENGINEALWAYSONSTACK -/* +/* ** Deallocate and destroy a parser. Destructors are called for ** all stack elements before shutting the parser down. ** @@ -136265,7 +136265,7 @@ static unsigned int yy_find_shift_action( ){ int i; int stateno = pParser->yytos->stateno; - + if( stateno>=YY_MIN_REDUCE ) return stateno; assert( stateno <= YY_SHIFT_COUNT ); do{ @@ -136291,7 +136291,7 @@ static unsigned int yy_find_shift_action( #ifdef YYWILDCARD { int j = i - iLookAhead + YYWILDCARD; - if( + if( #if YY_SHIFT_MIN+YYWILDCARD<0 j>=0 && #endif @@ -136406,7 +136406,7 @@ static void yy_shift( assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) ); } #endif -#if YYSTACKDEPTH>0 +#if YYSTACKDEPTH>0 if( yypParser->yytos>=&yypParser->yystack[YYSTACKDEPTH] ){ yypParser->yytos--; yyStackOverflow(yypParser); @@ -136806,7 +136806,7 @@ static void yy_reduce( assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack)); } #endif -#if YYSTACKDEPTH>0 +#if YYSTACKDEPTH>0 if( yypParser->yytos>=&yypParser->yystack[YYSTACKDEPTH-1] ){ yyStackOverflow(yypParser); return; @@ -137384,7 +137384,7 @@ static void yy_reduce( { sqlite3WithPush(pParse, yymsp[-7].minor.yy285, 1); sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy185, &yymsp[-3].minor.yy0); - sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy148,"set list"); + sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy148,"set list"); sqlite3Update(pParse,yymsp[-4].minor.yy185,yymsp[-1].minor.yy148,yymsp[0].minor.yy72,yymsp[-5].minor.yy194); } break; @@ -137631,7 +137631,7 @@ static void yy_reduce( yymsp[-4].minor.yy190.pExpr->x.pList = pList; }else{ sqlite3ExprListDelete(pParse->db, pList); - } + } exprNot(pParse, yymsp[-3].minor.yy194, &yymsp[-4].minor.yy190); yymsp[-4].minor.yy190.zEnd = yymsp[0].minor.yy190.zEnd; } @@ -137763,7 +137763,7 @@ static void yy_reduce( break; case 208: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */ { - sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, + sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy148, yymsp[-10].minor.yy194, &yymsp[-11].minor.yy0, yymsp[0].minor.yy72, SQLITE_SO_ASC, yymsp[-8].minor.yy194, SQLITE_IDXTYPE_APPDEF); } @@ -137858,7 +137858,7 @@ static void yy_reduce( } break; case 239: /* trigger_cmd_list ::= trigger_cmd SEMI */ -{ +{ assert( yymsp[-1].minor.yy145!=0 ); yymsp[-1].minor.yy145->pLast = yymsp[-1].minor.yy145; } @@ -137866,7 +137866,7 @@ static void yy_reduce( case 240: /* trnm ::= nm DOT nm */ { yymsp[-2].minor.yy0 = yymsp[0].minor.yy0; - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "qualified table names are not allowed on INSERT, UPDATE, and DELETE " "statements within triggers"); } @@ -137900,7 +137900,7 @@ static void yy_reduce( case 247: /* expr ::= RAISE LP IGNORE RP */ { spanSet(&yymsp[-3].minor.yy190,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/ - yymsp[-3].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0); + yymsp[-3].minor.yy190.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0); if( yymsp[-3].minor.yy190.pExpr ){ yymsp[-3].minor.yy190.pExpr->affinity = OE_Ignore; } @@ -137909,7 +137909,7 @@ static void yy_reduce( case 248: /* expr ::= RAISE LP raisetype COMMA nm RP */ { spanSet(&yymsp[-5].minor.yy190,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/ - yymsp[-5].minor.yy190.pExpr = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1); + yymsp[-5].minor.yy190.pExpr = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1); if( yymsp[-5].minor.yy190.pExpr ) { yymsp[-5].minor.yy190.pExpr->affinity = (char)yymsp[-3].minor.yy194; } @@ -138219,7 +138219,7 @@ SQLITE_PRIVATE void sqlite3Parser( #ifdef YYERRORSYMBOL /* A syntax error has occurred. ** The response to an error depends upon whether or not the - ** grammar defines an error token "ERROR". + ** grammar defines an error token "ERROR". ** ** This is what we do if the grammar does define ERROR: ** @@ -138282,7 +138282,7 @@ SQLITE_PRIVATE void sqlite3Parser( yy_syntax_error(yypParser,yymajor, yyminor); yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); yymajor = YYNOCODE; - + #else /* YYERRORSYMBOL is not defined */ /* This is what we do if the grammar does not define ERROR: ** @@ -138428,7 +138428,7 @@ static const unsigned char aiClass[] = { ** lower-case ASCII equivalent. On ASCII machines, this is just ** an upper-to-lower case map. On EBCDIC machines we also need ** to adjust the encoding. The mapping is only valid for alphabetics -** which are the only characters for which this feature is used. +** which are the only characters for which this feature is used. ** ** Used by keywordhash.h */ @@ -138460,7 +138460,7 @@ const unsigned char ebcdicToAscii[] = { /* ** The sqlite3KeywordCode function looks up an identifier to determine if -** it is a keyword. If it is a keyword, the token code of that keyword is +** it is a keyword. If it is a keyword, the token code of that keyword is ** returned. If the input is not a keyword, TK_ID is returned. ** ** The implementation of this routine was generated by a program, @@ -138766,14 +138766,14 @@ SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){ ** IdChar(X) will be true. Otherwise it is false. ** ** For ASCII, any character with the high-order bit set is -** allowed in an identifier. For 7-bit characters, +** allowed in an identifier. For 7-bit characters, ** sqlite3IsIdChar[X] must be 1. ** ** For EBCDIC, the rules are more complex but have the same ** end result. ** ** Ticket #1066. the SQL standard does not allow '$' in the -** middle of identifiers. But many SQL implementations do. +** middle of identifiers. But many SQL implementations do. ** SQLite will allow '$' in identifiers for compatibility. ** But the feature is undocumented. */ @@ -138806,7 +138806,7 @@ SQLITE_PRIVATE int sqlite3IsIdChar(u8 c){ return IdChar(c); } /* -** Return the length (in bytes) of the token that begins at z[0]. +** Return the length (in bytes) of the token that begins at z[0]. ** Store the token type in *tokenType before returning. */ SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *z, int *tokenType){ @@ -138984,7 +138984,7 @@ SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *z, int *tokenType){ *tokenType = TK_FLOAT; } if( (z[i]=='e' || z[i]=='E') && - ( sqlite3Isdigit(z[i+1]) + ( sqlite3Isdigit(z[i+1]) || ((z[i+1]=='+' || z[i+1]=='-') && sqlite3Isdigit(z[i+2])) ) ){ @@ -139085,7 +139085,7 @@ SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *z, int *tokenType){ /* ** Run the parser on the given SQL string. The parser structure is ** passed in. An SQLITE_ status code is returned. If an error occurs -** then an and attempt is made to write an error message into +** then an and attempt is made to write an error message into ** memory obtained from sqlite3_malloc() and to make *pzErrMsg point to that ** error message. */ @@ -139206,7 +139206,7 @@ SQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzEr #endif if( !IN_DECLARE_VTAB ){ - /* If the pParse->declareVtab flag is set, do not delete any table + /* If the pParse->declareVtab flag is set, do not delete any table ** structure built up in pParse->pNewTable. The calling code (see vtab.c) ** will take responsibility for freeing the Table structure. */ @@ -139300,7 +139300,7 @@ SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[]; ** (2) NORMAL We are in the middle of statement which ends with a single ** semicolon. ** -** (3) EXPLAIN The keyword EXPLAIN has been seen at the beginning of +** (3) EXPLAIN The keyword EXPLAIN has been seen at the beginning of ** a statement. ** ** (4) CREATE The keyword CREATE has been seen at the beginning of a @@ -139652,19 +139652,19 @@ SQLITE_PRIVATE int sqlite3Fts5Init(sqlite3*); #ifndef SQLITE_AMALGAMATION /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant -** contains the text of SQLITE_VERSION macro. +** contains the text of SQLITE_VERSION macro. */ SQLITE_API const char sqlite3_version[] = SQLITE_VERSION; #endif /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns -** a pointer to the to the sqlite3_version[] string constant. +** a pointer to the to the sqlite3_version[] string constant. */ SQLITE_API const char *sqlite3_libversion(void){ return sqlite3_version; } /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a ** pointer to a string constant whose value is the same as the -** SQLITE_SOURCE_ID C preprocessor macro. +** SQLITE_SOURCE_ID C preprocessor macro. */ SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } @@ -139720,13 +139720,13 @@ SQLITE_API char *sqlite3_temp_directory = 0; SQLITE_API char *sqlite3_data_directory = 0; /* -** Initialize SQLite. +** Initialize SQLite. ** ** This routine must be called to initialize the memory allocation, ** VFS, and mutex subsystems prior to doing any serious work with ** SQLite. But as long as you do not compile with SQLITE_OMIT_AUTOINIT ** this routine will be called automatically by key routines such as -** sqlite3_open(). +** sqlite3_open(). ** ** This routine is a no-op except on its very first call for the process, ** or for the first call after a call to sqlite3_shutdown. @@ -139776,7 +139776,7 @@ SQLITE_API int sqlite3_initialize(void){ */ if( sqlite3GlobalConfig.isInit ) return SQLITE_OK; - /* Make sure the mutex subsystem is initialized. If unable to + /* Make sure the mutex subsystem is initialized. If unable to ** initialize the mutex subsystem, return early with the error. ** If the system is so sick that we are unable to allocate a mutex, ** there is not much SQLite is going to be able to do. @@ -139853,7 +139853,7 @@ SQLITE_API int sqlite3_initialize(void){ rc = sqlite3OsInit(); } if( rc==SQLITE_OK ){ - sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage, + sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage, sqlite3GlobalConfig.szPage, sqlite3GlobalConfig.nPage); sqlite3GlobalConfig.isInit = 1; #ifdef SQLITE_EXTRA_INIT @@ -140076,7 +140076,7 @@ SQLITE_API int sqlite3_config(int op, ...){ ** a single parameter which is a pointer to an integer and writes into ** that integer the number of extra bytes per page required for each page ** in SQLITE_CONFIG_PAGECACHE. */ - *va_arg(ap, int*) = + *va_arg(ap, int*) = sqlite3HeaderSizeBtree() + sqlite3HeaderSizePcache() + sqlite3HeaderSizePcache1(); @@ -140163,7 +140163,7 @@ SQLITE_API int sqlite3_config(int op, ...){ sqlite3GlobalConfig.nLookaside = va_arg(ap, int); break; } - + /* Record a pointer to the logger function and its first argument. ** The default is NULL. Logging is disabled if the function pointer is ** NULL. @@ -140267,7 +140267,7 @@ SQLITE_API int sqlite3_config(int op, ...){ /* ** Set up the lookaside buffers for a database connection. -** Return SQLITE_OK on success. +** Return SQLITE_OK on success. ** If lookaside is already active, return SQLITE_BUSY. ** ** The sz parameter is the number of bytes in each lookaside slot. @@ -140283,7 +140283,7 @@ static int setupLookaside(sqlite3 *db, void *pBuf, int sz, int cnt){ return SQLITE_BUSY; } /* Free any existing lookaside buffer for this handle before - ** allocating a new one so we don't have to have space for + ** allocating a new one so we don't have to have space for ** both at the same time. */ if( db->lookaside.bMalloced ){ @@ -140504,7 +140504,7 @@ static int binCollFunc( } /* -** Another built-in collating sequence: NOCASE. +** Another built-in collating sequence: NOCASE. ** ** This collating sequence is intended to be used for "case independent ** comparison". SQLite's knowledge of upper and lower case equivalents @@ -140631,7 +140631,7 @@ static void disconnectAllVtab(sqlite3 *db){ /* ** Return TRUE if database connection db has unfinalized prepared -** statements or unfinished sqlite3_backup objects. +** statements or unfinished sqlite3_backup objects. */ static int connectionIsBusy(sqlite3 *db){ int j; @@ -140820,7 +140820,7 @@ SQLITE_PRIVATE void sqlite3LeaveMutexAndCloseZombie(sqlite3 *db){ /* The temp-database schema is allocated differently from the other schema ** objects (using sqliteMalloc() directly, instead of sqlite3BtreeSchema()). ** So it needs to be freed here. Todo: Why not roll the temp schema into - ** the same sqliteMalloc() as the one that allocates the database + ** the same sqliteMalloc() as the one that allocates the database ** structure? */ sqlite3DbFree(db, db->aDb[1].pSchema); @@ -140848,7 +140848,7 @@ SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3 *db, int tripCode){ assert( sqlite3_mutex_held(db->mutex) ); sqlite3BeginBenignMalloc(); - /* Obtain all b-tree mutexes before making any calls to BtreeRollback(). + /* Obtain all b-tree mutexes before making any calls to BtreeRollback(). ** This is important in case the transaction being rolled back has ** modified the database schema. If the b-tree mutexes are not taken ** here, then another shared-cache connection might sneak in between @@ -141107,7 +141107,7 @@ SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler *p){ }else{ p->nBusy++; } - return rc; + return rc; } /* @@ -141138,9 +141138,9 @@ SQLITE_API int sqlite3_busy_handler( ** be invoked every nOps opcodes. */ SQLITE_API void sqlite3_progress_handler( - sqlite3 *db, + sqlite3 *db, int nOps, - int (*xProgress)(void*), + int (*xProgress)(void*), void *pArg ){ #ifdef SQLITE_ENABLE_API_ARMOR @@ -141199,7 +141199,7 @@ SQLITE_API void sqlite3_interrupt(sqlite3 *db){ ** This function is exactly the same as sqlite3_create_function(), except ** that it is designed to be called by internal code. The difference is ** that if a malloc() fails in sqlite3_create_function(), an error code -** is returned and the mallocFailed flag cleared. +** is returned and the mallocFailed flag cleared. */ SQLITE_PRIVATE int sqlite3CreateFunc( sqlite3 *db, @@ -141218,7 +141218,7 @@ SQLITE_PRIVATE int sqlite3CreateFunc( assert( sqlite3_mutex_held(db->mutex) ); if( zFunctionName==0 || - (xSFunc && (xFinal || xStep)) || + (xSFunc && (xFinal || xStep)) || (!xSFunc && (xFinal && !xStep)) || (!xSFunc && (!xFinal && xStep)) || (nArg<-1 || nArg>SQLITE_MAX_FUNCTION_ARG) || @@ -141229,7 +141229,7 @@ SQLITE_PRIVATE int sqlite3CreateFunc( assert( SQLITE_FUNC_CONSTANT==SQLITE_DETERMINISTIC ); extraFlags = enc & SQLITE_DETERMINISTIC; enc &= (SQLITE_FUNC_ENCMASK|SQLITE_ANY); - + #ifndef SQLITE_OMIT_UTF16 /* If SQLITE_UTF16 is specified as the encoding type, transform this ** to one of SQLITE_UTF16LE or SQLITE_UTF16BE using the @@ -141256,7 +141256,7 @@ SQLITE_PRIVATE int sqlite3CreateFunc( #else enc = SQLITE_UTF8; #endif - + /* Check if an existing function is being overridden or deleted. If so, ** and there are active VMs, then return SQLITE_BUSY. If a function ** is being overridden/deleted but there are no active VMs, allow the @@ -141265,7 +141265,7 @@ SQLITE_PRIVATE int sqlite3CreateFunc( p = sqlite3FindFunction(db, zFunctionName, nArg, (u8)enc, 0); if( p && (p->funcFlags & SQLITE_FUNC_ENCMASK)==enc && p->nArg==nArg ){ if( db->nVdbeActive ){ - sqlite3ErrorWithMsg(db, SQLITE_BUSY, + sqlite3ErrorWithMsg(db, SQLITE_BUSY, "unable to delete/modify user-function due to active statements"); assert( !db->mallocFailed ); return SQLITE_BUSY; @@ -141390,7 +141390,7 @@ SQLITE_API int sqlite3_create_function16( ** ** If the function already exists as a regular global function, then ** this routine is a no-op. If the function does not exist, then create -** a new one that always throws a run-time error. +** a new one that always throws a run-time error. ** ** When virtual tables intend to provide an overloaded function, they ** should call this routine to make sure the global function exists. @@ -141422,7 +141422,7 @@ SQLITE_API int sqlite3_overload_function( #ifndef SQLITE_OMIT_TRACE /* ** Register a trace function. The pArg from the previously registered trace -** is returned. +** is returned. ** ** A NULL trace function means that no tracing is executes. A non-NULL ** trace is a pointer to a function that is invoked at the start of each @@ -141473,8 +141473,8 @@ SQLITE_API int sqlite3_trace_v2( #ifndef SQLITE_OMIT_DEPRECATED /* -** Register a profile function. The pArg from the previously registered -** profile function is returned. +** Register a profile function. The pArg from the previously registered +** profile function is returned. ** ** A NULL profile function means that no profiling is executes. A non-NULL ** profile is a pointer to a function that is invoked at the conclusion of @@ -141606,7 +141606,7 @@ SQLITE_API void *sqlite3_preupdate_hook( ** Invoke sqlite3_wal_checkpoint if the number of frames in the log file ** is greater than sqlite3.pWalArg cast to an integer (the value configured by ** wal_autocheckpoint()). -*/ +*/ SQLITE_PRIVATE int sqlite3WalDefaultHook( void *pClientData, /* Argument */ sqlite3 *db, /* Connection */ @@ -141740,7 +141740,7 @@ SQLITE_API int sqlite3_wal_checkpoint_v2( /* ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points -** to contains a zero-length string, all attached databases are +** to contains a zero-length string, all attached databases are ** checkpointed. */ SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){ @@ -141754,9 +141754,9 @@ SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){ ** Run a checkpoint on database iDb. This is a no-op if database iDb is ** not currently open in WAL mode. ** -** If a transaction is open on the database being checkpointed, this -** function returns SQLITE_LOCKED and a checkpoint is not attempted. If -** an error occurs while running the checkpoint, an SQLite error code is +** If a transaction is open on the database being checkpointed, this +** function returns SQLITE_LOCKED and a checkpoint is not attempted. If +** an error occurs while running the checkpoint, an SQLite error code is ** returned (i.e. SQLITE_IOERR). Otherwise, SQLITE_OK. ** ** The mutex on database handle db should be held by the caller. The mutex @@ -141867,11 +141867,11 @@ SQLITE_API const void *sqlite3_errmsg16(sqlite3 *db){ 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0 }; static const u16 misuse[] = { - 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ', - 'r', 'o', 'u', 't', 'i', 'n', 'e', ' ', - 'c', 'a', 'l', 'l', 'e', 'd', ' ', - 'o', 'u', 't', ' ', - 'o', 'f', ' ', + 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ', + 'r', 'o', 'u', 't', 'i', 'n', 'e', ' ', + 'c', 'a', 'l', 'l', 'e', 'd', ' ', + 'o', 'u', 't', ' ', + 'o', 'f', ' ', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', 0 }; @@ -141927,7 +141927,7 @@ SQLITE_API int sqlite3_extended_errcode(sqlite3 *db){ } SQLITE_API int sqlite3_system_errno(sqlite3 *db){ return db ? db->iSysErrno : 0; -} +} /* ** Return a string that describes the kind of error specified in the @@ -141944,7 +141944,7 @@ SQLITE_API const char *sqlite3_errstr(int rc){ */ static int createCollation( sqlite3* db, - const char *zName, + const char *zName, u8 enc, void* pCtx, int(*xCompare)(void*,int,const void*,int,const void*), @@ -141952,7 +141952,7 @@ static int createCollation( ){ CollSeq *pColl; int enc2; - + assert( sqlite3_mutex_held(db->mutex) ); /* If SQLITE_UTF16 is specified as the encoding type, transform this @@ -141969,14 +141969,14 @@ static int createCollation( return SQLITE_MISUSE_BKPT; } - /* Check if this call is removing or replacing an existing collation + /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there ** are no active VMs, invalidate any pre-compiled statements. */ pColl = sqlite3FindCollSeq(db, (u8)enc2, zName, 0); if( pColl && pColl->xCmp ){ if( db->nVdbeActive ){ - sqlite3ErrorWithMsg(db, SQLITE_BUSY, + sqlite3ErrorWithMsg(db, SQLITE_BUSY, "unable to delete/modify collation sequence due to active statements"); return SQLITE_BUSY; } @@ -141987,7 +141987,7 @@ static int createCollation( ** then any copies made by synthCollSeq() need to be invalidated. ** Also, collation destructor - CollSeq.xDel() - function may need ** to be called. - */ + */ if( (pColl->enc & ~SQLITE_UTF16_ALIGNED)==enc2 ){ CollSeq *aColl = sqlite3HashFind(&db->aCollSeq, zName); int j; @@ -142136,17 +142136,17 @@ SQLITE_API int sqlite3_limit(sqlite3 *db, int limitId, int newLimit){ ** query parameter. The second argument contains the URI (or non-URI filename) ** itself. When this function is called the *pFlags variable should contain ** the default flags to open the database handle with. The value stored in -** *pFlags may be updated before returning if the URI filename contains +** *pFlags may be updated before returning if the URI filename contains ** "cache=xxx" or "mode=xxx" query parameters. ** ** If successful, SQLITE_OK is returned. In this case *ppVfs is set to point to ** the VFS that should be used to open the database file. *pzFile is set to -** point to a buffer containing the name of the file to open. It is the +** point to a buffer containing the name of the file to open. It is the ** responsibility of the caller to eventually call sqlite3_free() to release ** this buffer. ** ** If an error occurs, then an SQLite error code is returned and *pzErrMsg -** may be set to point to a buffer containing an English language error +** may be set to point to a buffer containing an English language error ** message. It is the responsibility of the caller to eventually release ** this buffer by calling sqlite3_free(). */ @@ -142154,7 +142154,7 @@ SQLITE_PRIVATE int sqlite3ParseUri( const char *zDefaultVfs, /* VFS to use if no "vfs=xxx" query option */ const char *zUri, /* Nul-terminated URI to parse */ unsigned int *pFlags, /* IN/OUT: SQLITE_OPEN_XXX flags */ - sqlite3_vfs **ppVfs, /* OUT: VFS to use */ + sqlite3_vfs **ppVfs, /* OUT: VFS to use */ char **pzFile, /* OUT: Filename component of URI */ char **pzErrMsg /* OUT: Error message (if rc!=SQLITE_OK) */ ){ @@ -142177,7 +142177,7 @@ SQLITE_PRIVATE int sqlite3ParseUri( int iOut = 0; /* Output character index */ u64 nByte = nUri+2; /* Bytes of space to allocate */ - /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen + /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen ** method that there may be extra parameters following the file-name. */ flags |= SQLITE_OPEN_URI; @@ -142192,7 +142192,7 @@ SQLITE_PRIVATE int sqlite3ParseUri( /* The following condition causes URIs with five leading / characters ** like file://///host/path to be converted into UNCs like //host/path. ** The correct URI for that UNC has only two or four leading / characters - ** file://host/path or file:////host/path. But 5 leading slashes is a + ** file://host/path or file:////host/path. But 5 leading slashes is a ** common error, we are told, so we handle it as a special case. */ if( strncmp(zUri+7, "///", 3)==0 ){ iIn++; } }else if( strncmp(zUri+5, "//localhost/", 12)==0 ){ @@ -142204,7 +142204,7 @@ SQLITE_PRIVATE int sqlite3ParseUri( iIn = 7; while( zUri[iIn] && zUri[iIn]!='/' ) iIn++; if( iIn!=7 && (iIn!=16 || memcmp("localhost", &zUri[7], 9)) ){ - *pzErrMsg = sqlite3_mprintf("invalid uri authority: %.*s", + *pzErrMsg = sqlite3_mprintf("invalid uri authority: %.*s", iIn-7, &zUri[7]); rc = SQLITE_ERROR; goto parse_uri_out; @@ -142212,8 +142212,8 @@ SQLITE_PRIVATE int sqlite3ParseUri( } #endif - /* Copy the filename and any query parameters into the zFile buffer. - ** Decode %HH escape codes along the way. + /* Copy the filename and any query parameters into the zFile buffer. + ** Decode %HH escape codes along the way. ** ** Within this loop, variable eState may be set to 0, 1 or 2, depending ** on the parsing context. As follows: @@ -142225,9 +142225,9 @@ SQLITE_PRIVATE int sqlite3ParseUri( eState = 0; while( (c = zUri[iIn])!=0 && c!='#' ){ iIn++; - if( c=='%' - && sqlite3Isxdigit(zUri[iIn]) - && sqlite3Isxdigit(zUri[iIn+1]) + if( c=='%' + && sqlite3Isxdigit(zUri[iIn]) + && sqlite3Isxdigit(zUri[iIn+1]) ){ int octet = (sqlite3HexToInt(zUri[iIn++]) << 4); octet += sqlite3HexToInt(zUri[iIn++]); @@ -142239,7 +142239,7 @@ SQLITE_PRIVATE int sqlite3ParseUri( ** case we ignore all text in the remainder of the path, name or ** value currently being parsed. So ignore the current character ** and skip to the next "?", "=" or "&", as appropriate. */ - while( (c = zUri[iIn])!=0 && c!='#' + while( (c = zUri[iIn])!=0 && c!='#' && (eState!=0 || c!='?') && (eState!=1 || (c!='=' && c!='&')) && (eState!=2 || c!='&') @@ -142277,7 +142277,7 @@ SQLITE_PRIVATE int sqlite3ParseUri( zFile[iOut++] = '\0'; zFile[iOut++] = '\0'; - /* Check if there were any options specified that should be interpreted + /* Check if there were any options specified that should be interpreted ** here. Options that are interpreted here include "vfs" and those that ** correspond to flags that may be passed to the sqlite3_open_v2() ** method. */ @@ -142313,7 +142313,7 @@ SQLITE_PRIVATE int sqlite3ParseUri( if( nOpt==4 && memcmp("mode", zOpt, 4)==0 ){ static struct OpenMode aOpenMode[] = { { "ro", SQLITE_OPEN_READONLY }, - { "rw", SQLITE_OPEN_READWRITE }, + { "rw", SQLITE_OPEN_READWRITE }, { "rwc", SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE }, { "memory", SQLITE_OPEN_MEMORY }, { 0, 0 } @@ -142383,7 +142383,7 @@ SQLITE_PRIVATE int sqlite3ParseUri( /* ** This routine does the work of opening a database on behalf of -** sqlite3_open() and sqlite3_open16(). The database filename "zFilename" +** sqlite3_open() and sqlite3_open16(). The database filename "zFilename" ** is UTF-8 encoded. */ static int openDatabase( @@ -142407,7 +142407,7 @@ static int openDatabase( if( rc ) return rc; #endif - /* Only allow sensible combinations of bits in the flags argument. + /* Only allow sensible combinations of bits in the flags argument. ** Throw an error if any non-sense combination is used. If we ** do not block illegal combinations here, it could trigger ** assert() statements in deeper layers. Sensible combinations @@ -142454,11 +142454,11 @@ static int openDatabase( flags &= ~( SQLITE_OPEN_DELETEONCLOSE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_MAIN_DB | - SQLITE_OPEN_TEMP_DB | - SQLITE_OPEN_TRANSIENT_DB | - SQLITE_OPEN_MAIN_JOURNAL | - SQLITE_OPEN_TEMP_JOURNAL | - SQLITE_OPEN_SUBJOURNAL | + SQLITE_OPEN_TEMP_DB | + SQLITE_OPEN_TRANSIENT_DB | + SQLITE_OPEN_MAIN_JOURNAL | + SQLITE_OPEN_TEMP_JOURNAL | + SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_MASTER_JOURNAL | SQLITE_OPEN_NOMUTEX | SQLITE_OPEN_FULLMUTEX | @@ -142540,7 +142540,7 @@ static int openDatabase( goto opendb_out; } /* EVIDENCE-OF: R-08308-17224 The default collating function for all - ** strings is BINARY. + ** strings is BINARY. */ db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, sqlite3StrBINARY, 0); assert( db->pDfltColl!=0 ); @@ -142572,7 +142572,7 @@ static int openDatabase( db->aDb[1].pSchema = sqlite3SchemaGet(db, 0); /* The default safety_level for the main database is FULL; for the temp - ** database it is OFF. This matches the pager layer defaults. + ** database it is OFF. This matches the pager layer defaults. */ db->aDb[0].zDbSName = "main"; db->aDb[0].safety_level = SQLITE_DEFAULT_SYNCHRONOUS+1; @@ -142594,7 +142594,7 @@ static int openDatabase( #ifdef SQLITE_ENABLE_FTS5 /* Register any built-in FTS5 module before loading the automatic - ** extensions. This allows automatic extensions to register FTS5 + ** extensions. This allows automatic extensions to register FTS5 ** tokenizers and auxiliary functions. */ if( !db->mallocFailed && rc==SQLITE_OK ){ rc = sqlite3Fts5Init(db); @@ -142727,8 +142727,8 @@ opendb_out: ** Open a new database handle. */ SQLITE_API int sqlite3_open( - const char *zFilename, - sqlite3 **ppDb + const char *zFilename, + sqlite3 **ppDb ){ return openDatabase(zFilename, ppDb, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0); @@ -142747,7 +142747,7 @@ SQLITE_API int sqlite3_open_v2( ** Open a new database handle. */ SQLITE_API int sqlite3_open16( - const void *zFilename, + const void *zFilename, sqlite3 **ppDb ){ char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */ @@ -142786,9 +142786,9 @@ SQLITE_API int sqlite3_open16( ** Register a new collation sequence with the database handle db. */ SQLITE_API int sqlite3_create_collation( - sqlite3* db, - const char *zName, - int enc, + sqlite3* db, + const char *zName, + int enc, void* pCtx, int(*xCompare)(void*,int,const void*,int,const void*) ){ @@ -142799,9 +142799,9 @@ SQLITE_API int sqlite3_create_collation( ** Register a new collation sequence with the database handle db. */ SQLITE_API int sqlite3_create_collation_v2( - sqlite3* db, - const char *zName, - int enc, + sqlite3* db, + const char *zName, + int enc, void* pCtx, int(*xCompare)(void*,int,const void*,int,const void*), void(*xDel)(void*) @@ -142824,9 +142824,9 @@ SQLITE_API int sqlite3_create_collation_v2( ** Register a new collation sequence with the database handle db. */ SQLITE_API int sqlite3_create_collation16( - sqlite3* db, + sqlite3* db, const void *zName, - int enc, + int enc, void* pCtx, int(*xCompare)(void*,int,const void*,int,const void*) ){ @@ -142854,8 +142854,8 @@ SQLITE_API int sqlite3_create_collation16( ** db. Replace any previously installed collation sequence factory. */ SQLITE_API int sqlite3_collation_needed( - sqlite3 *db, - void *pCollNeededArg, + sqlite3 *db, + void *pCollNeededArg, void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*) ){ #ifdef SQLITE_ENABLE_API_ARMOR @@ -142875,8 +142875,8 @@ SQLITE_API int sqlite3_collation_needed( ** db. Replace any previously installed collation sequence factory. */ SQLITE_API int sqlite3_collation_needed16( - sqlite3 *db, - void *pCollNeededArg, + sqlite3 *db, + void *pCollNeededArg, void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*) ){ #ifdef SQLITE_ENABLE_API_ARMOR @@ -143040,13 +143040,13 @@ SQLITE_API int sqlite3_table_column_metadata( /* The following block stores the meta information that will be returned ** to the caller in local variables zDataType, zCollSeq, notnull, primarykey ** and autoinc. At this point there are two possibilities: - ** - ** 1. The specified column name was rowid", "oid" or "_rowid_" - ** and there is no explicitly declared IPK column. ** - ** 2. The table is not a view and the column name identified an + ** 1. The specified column name was rowid", "oid" or "_rowid_" + ** and there is no explicitly declared IPK column. + ** + ** 2. The table is not a view and the column name identified an ** explicitly declared column. Copy meta information from *pCol. - */ + */ if( pCol ){ zDataType = sqlite3ColumnType(pCol,0); zCollSeq = pCol->zColl; @@ -143096,7 +143096,7 @@ SQLITE_API int sqlite3_sleep(int ms){ pVfs = sqlite3_vfs_find(0); if( pVfs==0 ) return 0; - /* This function works in milliseconds, but the underlying OsSleep() + /* This function works in milliseconds, but the underlying OsSleep() ** API uses microseconds. Hence the 1000's. */ rc = (sqlite3OsSleep(pVfs, 1000*ms)/1000); @@ -143236,7 +143236,7 @@ SQLITE_API int sqlite3_test_control(int op, ...){ /* ** sqlite3_test_control(BENIGN_MALLOC_HOOKS, xBegin, xEnd) ** - ** Register hooks to call to indicate which malloc() failures + ** Register hooks to call to indicate which malloc() failures ** are benign. */ case SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS: { @@ -143297,7 +143297,7 @@ SQLITE_API int sqlite3_test_control(int op, ...){ ** This action provides a run-time test to see how the ALWAYS and ** NEVER macros were defined at compile-time. ** - ** The return value is ALWAYS(X). + ** The return value is ALWAYS(X). ** ** The recommended test is X==2. If the return value is 2, that means ** ALWAYS() and NEVER() are both no-op pass-through macros, which is the @@ -143334,7 +143334,7 @@ SQLITE_API int sqlite3_test_control(int op, ...){ ** 10 little-endian, determined at run-time ** 432101 big-endian, determined at compile-time ** 123410 little-endian, determined at compile-time - */ + */ case SQLITE_TESTCTRL_BYTEORDER: { rc = SQLITE_BYTEORDER*100 + SQLITE_LITTLEENDIAN*10 + SQLITE_BIGENDIAN; break; @@ -143356,7 +143356,7 @@ SQLITE_API int sqlite3_test_control(int op, ...){ /* sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS, sqlite3 *db, int N) ** - ** Enable or disable various optimizations for testing purposes. The + ** Enable or disable various optimizations for testing purposes. The ** argument N is a bitmask of optimizations to be disabled. For normal ** operation N should be 0. The idea is that a test program (like the ** SQL Logic Test or SLT test module) can run the same SQL multiple times @@ -143374,7 +143374,7 @@ SQLITE_API int sqlite3_test_control(int op, ...){ ** ** If zWord is a keyword recognized by the parser, then return the ** number of keywords. Or if zWord is not a keyword, return 0. - ** + ** ** This test feature is only available in the amalgamation since ** the SQLITE_N_KEYWORD macro is not defined in this file if SQLite ** is built using separate source files. @@ -143385,12 +143385,12 @@ SQLITE_API int sqlite3_test_control(int op, ...){ rc = (sqlite3KeywordCode((u8*)zWord, n)!=TK_ID) ? SQLITE_N_KEYWORD : 0; break; } -#endif +#endif /* sqlite3_test_control(SQLITE_TESTCTRL_SCRATCHMALLOC, sz, &pNew, pFree); ** - ** Pass pFree into sqlite3ScratchFree(). - ** If sz>0 then allocate a scratch buffer into pNew. + ** Pass pFree into sqlite3ScratchFree(). + ** If sz>0 then allocate a scratch buffer into pNew. */ case SQLITE_TESTCTRL_SCRATCHMALLOC: { void *pFree, **ppNew; @@ -143439,7 +143439,7 @@ SQLITE_API int sqlite3_test_control(int op, ...){ /* sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE, xCallback, ptr); ** - ** Set the VDBE coverage callback function to xCallback with context + ** Set the VDBE coverage callback function to xCallback with context ** pointer ptr. */ case SQLITE_TESTCTRL_VDBE_COVERAGE: { @@ -143504,7 +143504,7 @@ SQLITE_API int sqlite3_test_control(int op, ...){ /* ** This is a utility routine, useful to VFS implementations, that checks -** to see if a database file was a URI that contained a specific query +** to see if a database file was a URI that contained a specific query ** parameter, and if so obtains the value of the query parameter. ** ** The zFilename argument is the filename pointer passed into the xOpen() @@ -143592,11 +143592,11 @@ SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName){ #ifdef SQLITE_ENABLE_SNAPSHOT /* -** Obtain a snapshot handle for the snapshot of database zDb currently +** Obtain a snapshot handle for the snapshot of database zDb currently ** being read by handle db. */ SQLITE_API int sqlite3_snapshot_get( - sqlite3 *db, + sqlite3 *db, const char *zDb, sqlite3_snapshot **ppSnapshot ){ @@ -143632,8 +143632,8 @@ SQLITE_API int sqlite3_snapshot_get( ** Open a read-transaction on the snapshot idendified by pSnapshot. */ SQLITE_API int sqlite3_snapshot_open( - sqlite3 *db, - const char *zDb, + sqlite3 *db, + const char *zDb, sqlite3_snapshot *pSnapshot ){ int rc = SQLITE_ERROR; @@ -143750,13 +143750,13 @@ static sqlite3 *SQLITE_WSD sqlite3BlockedList = 0; #ifndef NDEBUG /* -** This function is a complex assert() that verifies the following +** This function is a complex assert() that verifies the following ** properties of the blocked connections list: ** -** 1) Each entry in the list has a non-NULL value for either +** 1) Each entry in the list has a non-NULL value for either ** pUnlockConnection or pBlockingConnection, or both. ** -** 2) All entries in the list that share a common value for +** 2) All entries in the list that share a common value for ** xUnlockNotify are grouped together. ** ** 3) If the argument db is not NULL, then none of the entries in the @@ -143808,8 +143808,8 @@ static void addToBlockedList(sqlite3 *db){ sqlite3 **pp; assertMutexHeld(); for( - pp=&sqlite3BlockedList; - *pp && (*pp)->xUnlockNotify!=db->xUnlockNotify; + pp=&sqlite3BlockedList; + *pp && (*pp)->xUnlockNotify!=db->xUnlockNotify; pp=&(*pp)->pNextBlocked ); db->pNextBlocked = *pp; @@ -143871,9 +143871,9 @@ SQLITE_API int sqlite3_unlock_notify( db->xUnlockNotify = 0; db->pUnlockArg = 0; }else if( 0==db->pBlockingConnection ){ - /* The blocking transaction has been concluded. Or there never was a + /* The blocking transaction has been concluded. Or there never was a ** blocking transaction. In either case, invoke the notify callback - ** immediately. + ** immediately. */ xNotify(&pArg, 1); }else{ @@ -143899,7 +143899,7 @@ SQLITE_API int sqlite3_unlock_notify( } /* -** This function is called while stepping or preparing a statement +** This function is called while stepping or preparing a statement ** associated with connection db. The operation will return SQLITE_LOCKED ** to the user because it requires a lock that will not be available ** until connection pBlocker concludes its current transaction. @@ -143915,7 +143915,7 @@ SQLITE_PRIVATE void sqlite3ConnectionBlocked(sqlite3 *db, sqlite3 *pBlocker){ /* ** This function is called when -** the transaction opened by database db has just finished. Locks held +** the transaction opened by database db has just finished. Locks held ** by database connection db have been released. ** ** This function loops through each entry in the blocked connections @@ -143975,7 +143975,7 @@ SQLITE_PRIVATE void sqlite3ConnectionUnlocked(sqlite3 *db){ }else{ /* This occurs when the array of context pointers that need to ** be passed to the unlock-notify callback is larger than the - ** aStatic[] array allocated on the stack and the attempt to + ** aStatic[] array allocated on the stack and the attempt to ** allocate a larger array from the heap has failed. ** ** This is a difficult situation to handle. Returning an error @@ -143983,17 +143983,17 @@ SQLITE_PRIVATE void sqlite3ConnectionUnlocked(sqlite3 *db){ ** is returned the transaction on connection db will still be ** closed and the unlock-notify callbacks on blocked connections ** will go unissued. This might cause the application to wait - ** indefinitely for an unlock-notify callback that will never + ** indefinitely for an unlock-notify callback that will never ** arrive. ** ** Instead, invoke the unlock-notify callback with the context ** array already accumulated. We can then clear the array and - ** begin accumulating any further context pointers without + ** begin accumulating any further context pointers without ** requiring any dynamic allocation. This is sub-optimal because ** it means that instead of one callback with a large array of ** context pointers the application will receive two or more ** callbacks with smaller arrays of context pointers, which will - ** reduce the applications ability to prioritize multiple + ** reduce the applications ability to prioritize multiple ** connections. But it is the best that can be done under the ** circumstances. */ @@ -144028,7 +144028,7 @@ SQLITE_PRIVATE void sqlite3ConnectionUnlocked(sqlite3 *db){ } /* -** This is called when the database connection passed as an argument is +** This is called when the database connection passed as an argument is ** being closed. The connection is removed from the blocked list. */ SQLITE_PRIVATE void sqlite3ConnectionClosed(sqlite3 *db){ @@ -144105,7 +144105,7 @@ SQLITE_PRIVATE void sqlite3ConnectionClosed(sqlite3 *db){ ** A doclist (document list) holds a docid-sorted list of hits for a ** given term. Doclists hold docids and associated token positions. ** A docid is the unique integer identifier for a single document. -** A position is the index of a word within the document. The first +** A position is the index of a word within the document. The first ** word of the document has a position of 0. ** ** FTS3 used to optionally store character offsets using a compile-time @@ -144130,7 +144130,7 @@ SQLITE_PRIVATE void sqlite3ConnectionClosed(sqlite3 *db){ ** ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream -** generated by the tokenizer. Note that POS_END and POS_COLUMN occur +** generated by the tokenizer. Note that POS_END and POS_COLUMN occur ** in the same logical place as the position element, and act as sentinals ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more @@ -144154,7 +144154,7 @@ SQLITE_PRIVATE void sqlite3ConnectionClosed(sqlite3 *db){ ** a document record consists of a docid followed by a position-list and ** a doclist consists of one or more document records. ** -** A bare doclist omits the position information, becoming an +** A bare doclist omits the position information, becoming an ** array of varint-encoded docids. ** **** Segment leaf nodes **** @@ -144351,7 +144351,7 @@ SQLITE_PRIVATE void sqlite3ConnectionClosed(sqlite3 *db){ #ifndef _FTSINT_H #define _FTSINT_H -#if !defined(NDEBUG) && !defined(SQLITE_DEBUG) +#if !defined(NDEBUG) && !defined(SQLITE_DEBUG) # define NDEBUG 1 #endif @@ -144374,7 +144374,7 @@ SQLITE_PRIVATE void sqlite3ConnectionClosed(sqlite3 *db){ /* If not building as part of the core, include sqlite3ext.h. */ #ifndef SQLITE_CORE -/* # include "sqlite3ext.h" */ +/* # include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT3 #endif @@ -144418,7 +144418,7 @@ SQLITE_EXTENSION_INIT3 ** When an fts3 table is created, it passes any arguments passed to ** the tokenizer clause of the CREATE VIRTUAL TABLE statement to the ** sqlite3_tokenizer_module.xCreate() function of the requested tokenizer -** implementation. The xCreate() function in turn returns an +** implementation. The xCreate() function in turn returns an ** sqlite3_tokenizer structure representing the specific tokenizer to ** be used for the fts3 table (customized by the tokenizer clause arguments). ** @@ -144450,7 +144450,7 @@ struct sqlite3_tokenizer_module { ** then argc is set to 2, and the argv[] array contains pointers ** to the strings "arg1" and "arg2". ** - ** This method should return either SQLITE_OK (0), or an SQLite error + ** This method should return either SQLITE_OK (0), or an SQLite error ** code. If SQLITE_OK is returned, then *ppTokenizer should be set ** to point at the newly created tokenizer structure. The generic ** sqlite3_tokenizer.pModule variable should not be initialized by @@ -144471,7 +144471,7 @@ struct sqlite3_tokenizer_module { /* ** Create a tokenizer cursor to tokenize an input buffer. The caller ** is responsible for ensuring that the input buffer remains valid - ** until the cursor is closed (using the xClose() method). + ** until the cursor is closed (using the xClose() method). */ int (*xOpen)( sqlite3_tokenizer *pTokenizer, /* Tokenizer object */ @@ -144480,7 +144480,7 @@ struct sqlite3_tokenizer_module { ); /* - ** Destroy an existing tokenizer cursor. The fts3 module calls this + ** Destroy an existing tokenizer cursor. The fts3 module calls this ** method exactly once for each successful call to xOpen(). */ int (*xClose)(sqlite3_tokenizer_cursor *pCursor); @@ -144491,7 +144491,7 @@ struct sqlite3_tokenizer_module { ** "OUT" variables identified below, or SQLITE_DONE to indicate that ** the end of the buffer has been reached, or an SQLite error code. ** - ** *ppToken should be set to point at a buffer containing the + ** *ppToken should be set to point at a buffer containing the ** normalized version of the token (i.e. after any case-folding and/or ** stemming has been performed). *pnBytes should be set to the length ** of this buffer in bytes. The input text that generated the token is @@ -144503,7 +144503,7 @@ struct sqlite3_tokenizer_module { ** ** The buffer *ppToken is set to point at is managed by the tokenizer ** implementation. It is only required to be valid until the next call - ** to xNext() or xClose(). + ** to xNext() or xClose(). */ /* TODO(shess) current implementation requires pInput to be ** nul-terminated. This should either be fixed, or pInput/nBytes @@ -144521,7 +144521,7 @@ struct sqlite3_tokenizer_module { ** Methods below this point are only available if iVersion>=1. */ - /* + /* ** Configure the language id of a tokenizer cursor. */ int (*xLanguageid)(sqlite3_tokenizer_cursor *pCsr, int iLangid); @@ -144590,7 +144590,7 @@ struct Fts3Hash { } *ht; }; -/* Each element in the hash table is an instance of the following +/* Each element in the hash table is an instance of the following ** structure. All elements are stored on a single doubly-linked list. ** ** Again, this structure is intended to be opaque, but it can't really @@ -144609,10 +144609,10 @@ struct Fts3HashElem { ** (including the null-terminator, if any). Case ** is respected in comparisons. ** -** FTS3_HASH_BINARY pKey points to binary data nKey bytes long. +** FTS3_HASH_BINARY pKey points to binary data nKey bytes long. ** memcmp() is used to compare keys. ** -** A copy of the key is made if the copyKey parameter to fts3HashInit is 1. +** A copy of the key is made if the copyKey parameter to fts3HashInit is 1. */ #define FTS3_HASH_STRING 1 #define FTS3_HASH_BINARY 2 @@ -144665,7 +144665,7 @@ SQLITE_PRIVATE Fts3HashElem *sqlite3Fts3HashFindElem(const Fts3Hash *, const voi /* ** This constant determines the maximum depth of an FTS expression tree -** that the library will create and use. FTS uses recursion to perform +** that the library will create and use. FTS uses recursion to perform ** various operations on the query tree, so the disadvantage of a large ** limit is that it may allow very large queries to use large amounts ** of stack space (perhaps causing a stack overflow). @@ -144683,11 +144683,11 @@ SQLITE_PRIVATE Fts3HashElem *sqlite3Fts3HashFindElem(const Fts3Hash *, const voi #define FTS3_MERGE_COUNT 16 /* -** This is the maximum amount of data (in bytes) to store in the +** This is the maximum amount of data (in bytes) to store in the ** Fts3Table.pendingTerms hash table. Normally, the hash table is ** populated as documents are inserted/updated/deleted in a transaction ** and used to create a new segment when the transaction is committed. -** However if this limit is reached midway through a transaction, a new +** However if this limit is reached midway through a transaction, a new ** segment is created and the hash table cleared immediately. */ #define FTS3_MAX_PENDING_DATA (1*1024*1024) @@ -144716,7 +144716,7 @@ SQLITE_PRIVATE Fts3HashElem *sqlite3Fts3HashFindElem(const Fts3Hash *, const voi /* ** FTS4 virtual tables may maintain multiple indexes - one index of all terms ** in the document set and zero or more prefix indexes. All indexes are stored -** as one or more b+-trees in the %_segments and %_segdir tables. +** as one or more b+-trees in the %_segments and %_segdir tables. ** ** It is possible to determine which index a b+-tree belongs to based on the ** value stored in the "%_segdir.level" column. Given this value L, the index @@ -144724,8 +144724,8 @@ SQLITE_PRIVATE Fts3HashElem *sqlite3Fts3HashFindElem(const Fts3Hash *, const voi ** level values between 0 and 1023 (inclusive) belong to index 0, all levels ** between 1024 and 2047 to index 1, and so on. ** -** It is considered impossible for an index to use more than 1024 levels. In -** theory though this may happen, but only after at least +** It is considered impossible for an index to use more than 1024 levels. In +** theory though this may happen, but only after at least ** (FTS3_MERGE_COUNT^1024) separate flushes of the pending-terms tables. */ #define FTS3_SEGDIR_MAXLEVEL 1024 @@ -144743,11 +144743,11 @@ SQLITE_PRIVATE Fts3HashElem *sqlite3Fts3HashFindElem(const Fts3Hash *, const voi ** Terminator values for position-lists and column-lists. */ #define POS_COLUMN (1) /* Column-list terminator */ -#define POS_END (0) /* Position-list terminator */ +#define POS_END (0) /* Position-list terminator */ /* ** This section provides definitions to allow the -** FTS3 extension to be compiled outside of the +** FTS3 extension to be compiled outside of the ** amalgamation. */ #ifndef SQLITE_AMALGAMATION @@ -144785,7 +144785,7 @@ typedef sqlite3_int64 i64; /* 8-byte signed integer */ /* ** Activate assert() only if SQLITE_TEST is enabled. */ -#if !defined(NDEBUG) && !defined(SQLITE_DEBUG) +#if !defined(NDEBUG) && !defined(SQLITE_DEBUG) # define NDEBUG 1 #endif @@ -144844,8 +144844,8 @@ struct Fts3Table { int nAutoincrmerge; /* Value configured by 'automerge' */ u32 nLeafAdd; /* Number of leaf blocks added this trans */ - /* Precompiled statements used by the implementation. Each of these - ** statements is run and reset within a single virtual table API call. + /* Precompiled statements used by the implementation. Each of these + ** statements is run and reset within a single virtual table API call. */ sqlite3_stmt *aStmt[40]; sqlite3_stmt *pSeekStmt; /* Cache for fts3CursorSeekStmt() */ @@ -144863,8 +144863,8 @@ struct Fts3Table { char *zSegmentsTbl; /* Name of %_segments table */ sqlite3_blob *pSegments; /* Blob handle open on %_segments table */ - /* - ** The following array of hash tables is used to buffer pending index + /* + ** The following array of hash tables is used to buffer pending index ** updates during transactions. All pending updates buffered at any one ** time must share a common language-id (see the FTS4 langid= feature). ** The current language id is stored in variable iPrevLangid. @@ -144874,10 +144874,10 @@ struct Fts3Table { ** terms that appear in the document set. Each subsequent index in aIndex[] ** is an index of prefixes of a specific length. ** - ** Variable nPendingData contains an estimate the memory consumed by the + ** Variable nPendingData contains an estimate the memory consumed by the ** pending data structures, including hash table overhead, but not including ** malloc overhead. When nPendingData exceeds nMaxPendingData, all hash - ** tables are flushed to disk. Variable iPrevDocid is the docid of the most + ** tables are flushed to disk. Variable iPrevDocid is the docid of the most ** recently inserted record. */ int nIndex; /* Size of aIndex[] */ @@ -144950,10 +144950,10 @@ struct Fts3Cursor { ** ** CREATE VIRTUAL TABLE ex1 USING fts3(a,b,c,d); ** SELECT docid FROM ex1 WHERE b MATCH 'one two three'; -** +** ** Because the LHS of the MATCH operator is 2nd column "b", ** Fts3Cursor.eSearch will be set to FTS3_FULLTEXT_SEARCH+1. (+0 for a, -** +1 for b, +2 for c, +3 for d.) If the LHS of MATCH were "ex1" +** +1 for b, +2 for c, +3 for d.) If the LHS of MATCH were "ex1" ** indicating that all columns should be searched, ** then eSearch would be set to FTS3_FULLTEXT_SEARCH+4. */ @@ -145012,8 +145012,8 @@ struct Fts3Phrase { char *pOrPoslist; i64 iOrDocid; - /* Variables below this point are populated by fts3_expr.c when parsing - ** a MATCH expression. Everything above is part of the evaluation phase. + /* Variables below this point are populated by fts3_expr.c when parsing + ** a MATCH expression. Everything above is part of the evaluation phase. */ int nToken; /* Number of tokens in the phrase */ int iColumn; /* Index of column this phrase must match */ @@ -145023,10 +145023,10 @@ struct Fts3Phrase { /* ** A tree of these objects forms the RHS of a MATCH operator. ** -** If Fts3Expr.eType is FTSQUERY_PHRASE and isLoaded is true, then aDoclist -** points to a malloced buffer, size nDoclist bytes, containing the results -** of this phrase query in FTS3 doclist format. As usual, the initial -** "Length" field found in doclists stored on disk is omitted from this +** If Fts3Expr.eType is FTSQUERY_PHRASE and isLoaded is true, then aDoclist +** points to a malloced buffer, size nDoclist bytes, containing the results +** of this phrase query in FTS3 doclist format. As usual, the initial +** "Length" field found in doclists stored on disk is omitted from this ** buffer. ** ** Variable aMI is used only for FTSQUERY_NEAR nodes to store the global @@ -145038,7 +145038,7 @@ struct Fts3Phrase { ** aMI[iCol*3 + 1] = Number of occurrences ** aMI[iCol*3 + 2] = Number of rows containing at least one instance ** -** The aMI array is allocated using sqlite3_malloc(). It should be freed +** The aMI array is allocated using sqlite3_malloc(). It should be freed ** when the expression node is. */ struct Fts3Expr { @@ -145062,7 +145062,7 @@ struct Fts3Expr { /* ** Candidate values for Fts3Query.eType. Note that the order of the first -** four values is in order of precedence when parsing expressions. For +** four values is in order of precedence when parsing expressions. For ** example, the following: ** ** "a OR b AND c NOT d NEAR e" @@ -145119,7 +145119,7 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderStart(Fts3Table*, Fts3MultiSegReader*, Ft SQLITE_PRIVATE int sqlite3Fts3SegReaderStep(Fts3Table *, Fts3MultiSegReader *); SQLITE_PRIVATE void sqlite3Fts3SegReaderFinish(Fts3MultiSegReader *); -SQLITE_PRIVATE int sqlite3Fts3SegReaderCursor(Fts3Table *, +SQLITE_PRIVATE int sqlite3Fts3SegReaderCursor(Fts3Table *, int, int, int, const char *, int, int, int, Fts3MultiSegReader *); /* Flags allowed as part of the 4th argument to SegmentReaderIterate() */ @@ -145183,7 +145183,7 @@ SQLITE_PRIVATE int sqlite3Fts3EvalTestDeferred(Fts3Cursor *pCsr, int *pRc); /* fts3_tokenizer.c */ SQLITE_PRIVATE const char *sqlite3Fts3NextToken(const char *, int *); SQLITE_PRIVATE int sqlite3Fts3InitHashTable(sqlite3 *, Fts3Hash *, const char *); -SQLITE_PRIVATE int sqlite3Fts3InitTokenizer(Fts3Hash *pHash, const char *, +SQLITE_PRIVATE int sqlite3Fts3InitTokenizer(Fts3Hash *pHash, const char *, sqlite3_tokenizer **, char ** ); SQLITE_PRIVATE int sqlite3Fts3IsIdChar(char); @@ -145219,7 +145219,7 @@ SQLITE_PRIVATE int sqlite3Fts3MsrIncrStart( Fts3Table*, Fts3MultiSegReader*, int, const char*, int); SQLITE_PRIVATE int sqlite3Fts3MsrIncrNext( Fts3Table *, Fts3MultiSegReader *, sqlite3_int64 *, char **, int *); -SQLITE_PRIVATE int sqlite3Fts3EvalPhrasePoslist(Fts3Cursor *, Fts3Expr *, int iCol, char **); +SQLITE_PRIVATE int sqlite3Fts3EvalPhrasePoslist(Fts3Cursor *, Fts3Expr *, int iCol, char **); SQLITE_PRIVATE int sqlite3Fts3MsrOvfl(Fts3Cursor *, Fts3MultiSegReader *, int *); SQLITE_PRIVATE int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr); @@ -145252,7 +145252,7 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeIsdiacritic(int); /* #include */ /* #include "fts3.h" */ -#ifndef SQLITE_CORE +#ifndef SQLITE_CORE /* # include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #endif @@ -145269,7 +145269,7 @@ SQLITE_PRIVATE int sqlite3Fts3Never(int b) { assert( !b ); return b; } # endif #endif -/* +/* ** Write a 64-bit variable-length integer to memory starting at p[0]. ** The length of data written will be between 1 and FTS3_VARINT_MAX bytes. ** The number of bytes written is returned. @@ -145293,7 +145293,7 @@ SQLITE_PRIVATE int sqlite3Fts3PutVarint(char *p, sqlite_int64 v){ v = (*ptr++); \ if( (v & mask2)==0 ){ var = v; return ret; } -/* +/* ** Read a 64-bit variable-length integer from memory starting at p[0]. ** Return the number of bytes read, or 0 on error. ** The value is stored in *v. @@ -145376,7 +145376,7 @@ SQLITE_PRIVATE void sqlite3Fts3Dequote(char *z){ int iOut = 0; /* Index of next byte to write to output */ /* If the first byte was a '[', then the close-quote character is a ']' */ - if( quote=='[' ) quote = ']'; + if( quote=='[' ) quote = ']'; while( z[iIn] ){ if( z[iIn]==quote ){ @@ -145412,14 +145412,14 @@ static void fts3GetDeltaVarint(char **pp, sqlite3_int64 *pVal){ ** varint is part of. */ static void fts3GetReverseVarint( - char **pp, - char *pStart, + char **pp, + char *pStart, sqlite3_int64 *pVal ){ sqlite3_int64 iVal; char *p; - /* Pointer p now points at the first byte past the varint we are + /* Pointer p now points at the first byte past the varint we are ** interested in. So, unless the doclist is corrupt, the 0x80 bit is ** clear on character p[-1]. */ for(p = (*pp)-2; p>=pStart && *p&0x80; p--); @@ -145527,7 +145527,7 @@ static int fts3DestroyMethod(sqlite3_vtab *pVtab){ ** passed as the first argument. This is done as part of the xConnect() ** and xCreate() methods. ** -** If *pRc is non-zero when this function is called, it is a no-op. +** If *pRc is non-zero when this function is called, it is a no-op. ** Otherwise, if an error occurs, an SQLite error code is stored in *pRc ** before returning. */ @@ -145550,7 +145550,7 @@ static void fts3DeclareVtab(int *pRc, Fts3Table *p){ /* Create the whole "CREATE TABLE" statement to pass to SQLite */ zSql = sqlite3_mprintf( - "CREATE TABLE x(%s %Q HIDDEN, docid HIDDEN, %Q HIDDEN)", + "CREATE TABLE x(%s %Q HIDDEN, docid HIDDEN, %Q HIDDEN)", zCols, p->zName, zLanguageid ); if( !zCols || !zSql ){ @@ -145569,7 +145569,7 @@ static void fts3DeclareVtab(int *pRc, Fts3Table *p){ ** Create the %_stat table if it does not already exist. */ SQLITE_PRIVATE void sqlite3Fts3CreateStatTable(int *pRc, Fts3Table *p){ - fts3DbExec(pRc, p->db, + fts3DbExec(pRc, p->db, "CREATE TABLE IF NOT EXISTS %Q.'%q_stat'" "(id INTEGER PRIMARY KEY, value BLOB);", p->zDb, p->zName @@ -145605,9 +145605,9 @@ static int fts3CreateTables(Fts3Table *p){ zContentCols = sqlite3_mprintf("%z, langid", zContentCols, zLanguageid); } if( zContentCols==0 ) rc = SQLITE_NOMEM; - + /* Create the content table */ - fts3DbExec(&rc, db, + fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_content'(%s)", p->zDb, p->zName, zContentCols ); @@ -145615,11 +145615,11 @@ static int fts3CreateTables(Fts3Table *p){ } /* Create other tables */ - fts3DbExec(&rc, db, + fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_segments'(blockid INTEGER PRIMARY KEY, block BLOB);", p->zDb, p->zName ); - fts3DbExec(&rc, db, + fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_segdir'(" "level INTEGER," "idx INTEGER," @@ -145632,7 +145632,7 @@ static int fts3CreateTables(Fts3Table *p){ p->zDb, p->zName ); if( p->bHasDocsize ){ - fts3DbExec(&rc, db, + fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_docsize'(docid INTEGER PRIMARY KEY, size BLOB);", p->zDb, p->zName ); @@ -145647,7 +145647,7 @@ static int fts3CreateTables(Fts3Table *p){ /* ** Store the current database page-size in bytes in p->nPgsz. ** -** If *pRc is non-zero when this function is called, it is a no-op. +** If *pRc is non-zero when this function is called, it is a no-op. ** Otherwise, if an error occurs, an SQLite error code is stored in *pRc ** before returning. */ @@ -145656,7 +145656,7 @@ static void fts3DatabasePageSize(int *pRc, Fts3Table *p){ int rc; /* Return code */ char *zSql; /* SQL text "PRAGMA %Q.page_size" */ sqlite3_stmt *pStmt; /* Compiled "PRAGMA %Q.page_size" statement */ - + zSql = sqlite3_mprintf("PRAGMA %Q.page_size", p->zDb); if( !zSql ){ rc = SQLITE_NOMEM; @@ -145682,11 +145682,11 @@ static void fts3DatabasePageSize(int *pRc, Fts3Table *p){ ** ** = ** -** There may not be whitespace surrounding the "=" character. The +** There may not be whitespace surrounding the "=" character. The ** term may be quoted, but the may not. */ static int fts3IsSpecialColumn( - const char *z, + const char *z, int *pnKey, char **pzValue ){ @@ -145763,7 +145763,7 @@ static char *fts3QuoteId(char const *zInput){ } /* -** Return a list of comma separated SQL expressions and a FROM clause that +** Return a list of comma separated SQL expressions and a FROM clause that ** could be used in a SELECT statement such as the following: ** ** SELECT FROM %_content AS x ... @@ -145814,7 +145814,7 @@ static char *fts3ReadExprList(Fts3Table *p, const char *zFunc, int *pRc){ fts3Appendf(pRc, &zRet, ", x.%Q", p->zLanguageid); } } - fts3Appendf(pRc, &zRet, " FROM '%q'.'%q%s' AS x", + fts3Appendf(pRc, &zRet, " FROM '%q'.'%q%s' AS x", p->zDb, (p->zContentTbl ? p->zContentTbl : p->zName), (p->zContentTbl ? "" : "_content") @@ -145829,7 +145829,7 @@ static char *fts3ReadExprList(Fts3Table *p, const char *zFunc, int *pRc){ ** ** If argument zFunc is not NULL, then all but the first question mark ** is preceded by zFunc and an open bracket, and followed by a closed -** bracket. For example, if zFunc is "zip" and the FTS3 table has three +** bracket. For example, if zFunc is "zip" and the FTS3 table has three ** user-defined text columns, the following string is returned: ** ** "?, zip(?), zip(?), zip(?)" @@ -145866,11 +145866,11 @@ static char *fts3WriteExprList(Fts3Table *p, const char *zFunc, int *pRc){ /* ** This function interprets the string at (*pp) as a non-negative integer -** value. It reads the integer and sets *pnOut to the value read, then +** value. It reads the integer and sets *pnOut to the value read, then ** sets *pp to point to the byte immediately following the last byte of ** the integer value. ** -** Only decimal digits ('0'..'9') may be part of an integer value. +** Only decimal digits ('0'..'9') may be part of an integer value. ** ** If *pp does not being with a decimal digit SQLITE_ERROR is returned and ** the output value undefined. Otherwise SQLITE_OK is returned. @@ -145991,7 +145991,7 @@ static int fts3ContentColumns( char **pzErr /* OUT: error message */ ){ int rc = SQLITE_OK; /* Return code */ - char *zSql; /* "SELECT *" statement on zTbl */ + char *zSql; /* "SELECT *" statement on zTbl */ sqlite3_stmt *pStmt = 0; /* Compiled version of zSql */ zSql = sqlite3_mprintf("SELECT * FROM %Q.%Q", zDb, zTbl); @@ -146133,9 +146133,9 @@ static int fts3InitVtab( char *zVal; /* Check if this is a tokenizer specification */ - if( !pTokenizer + if( !pTokenizer && strlen(z)>8 - && 0==sqlite3_strnicmp(z, "tokenize", 8) + && 0==sqlite3_strnicmp(z, "tokenize", 8) && 0==sqlite3Fts3IsIdChar(z[8]) ){ rc = sqlite3Fts3InitTokenizer(pHash, &z[9], &pTokenizer, pzErr); @@ -146199,8 +146199,8 @@ static int fts3InitVtab( break; case 4: /* ORDER */ - if( (strlen(zVal)!=3 || sqlite3_strnicmp(zVal, "asc", 3)) - && (strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "desc", 4)) + if( (strlen(zVal)!=3 || sqlite3_strnicmp(zVal, "asc", 3)) + && (strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "desc", 4)) ){ sqlite3Fts3ErrMsg(pzErr, "unrecognized order: %s", zVal); rc = SQLITE_ERROR; @@ -146246,17 +146246,17 @@ static int fts3InitVtab( ** TABLE statement, use all columns from the content table. */ if( rc==SQLITE_OK && zContent ){ - sqlite3_free(zCompress); - sqlite3_free(zUncompress); + sqlite3_free(zCompress); + sqlite3_free(zUncompress); zCompress = 0; zUncompress = 0; if( nCol==0 ){ - sqlite3_free((void*)aCol); + sqlite3_free((void*)aCol); aCol = 0; rc = fts3ContentColumns(db, argv[1], zContent,&aCol,&nCol,&nString,pzErr); /* If a languageid= option was specified, remove the language id - ** column from the aCol[] array. */ + ** column from the aCol[] array. */ if( rc==SQLITE_OK && zLanguageid ){ int j; for(j=0; jazColumn[iCol], zNot, n) + && 0==sqlite3_strnicmp(p->azColumn[iCol], zNot, n) ){ p->abNotindexed[iCol] = 1; sqlite3_free(zNot); @@ -146384,7 +146384,7 @@ static int fts3InitVtab( p->zWriteExprlist = fts3WriteExprList(p, zCompress, &rc); if( rc!=SQLITE_OK ) goto fts3_init_out; - /* If this is an xCreate call, create the underlying tables in the + /* If this is an xCreate call, create the underlying tables in the ** database. TODO: For xConnect(), it could verify that said tables exist. */ if( isCreate ){ @@ -146480,11 +146480,11 @@ static void fts3SetUniqueFlag(sqlite3_index_info *pIdxInfo){ #endif } -/* +/* ** Implementation of the xBestIndex method for FTS3 tables. There ** are three possible strategies, in order of preference: ** -** 1. Direct lookup by rowid or docid. +** 1. Direct lookup by rowid or docid. ** 2. Full-text search using a MATCH operator on a non-docid column. ** 3. Linear scan of %_content table. */ @@ -146499,7 +146499,7 @@ static int fts3BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ int iIdx; /* By default use a full table scan. This is an expensive option, - ** so search through the constraints to see if a more efficient + ** so search through the constraints to see if a more efficient ** strategy is possible. */ pInfo->idxNum = FTS3_FULLSCAN_SEARCH; @@ -146535,12 +146535,12 @@ static int fts3BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ ** ** If there is more than one MATCH constraint available, use the first ** one encountered. If there is both a MATCH constraint and a direct - ** rowid/docid lookup, prefer the MATCH strategy. This is done even + ** rowid/docid lookup, prefer the MATCH strategy. This is done even ** though the rowid/docid lookup is faster than a MATCH query, selecting - ** it would lead to an "unable to use function MATCH in the requested + ** it would lead to an "unable to use function MATCH in the requested ** context" error. */ - if( pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH + if( pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH && pCons->iColumn>=0 && pCons->iColumn<=p->nColumn ){ pInfo->idxNum = FTS3_FULLTEXT_SEARCH + pCons->iColumn; @@ -146549,7 +146549,7 @@ static int fts3BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ } /* Equality constraint on the langid column */ - if( pCons->op==SQLITE_INDEX_CONSTRAINT_EQ + if( pCons->op==SQLITE_INDEX_CONSTRAINT_EQ && pCons->iColumn==p->nColumn + 2 ){ iLangidCons = i; @@ -146577,22 +146577,22 @@ static int fts3BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ if( iCons>=0 ){ pInfo->aConstraintUsage[iCons].argvIndex = iIdx++; pInfo->aConstraintUsage[iCons].omit = 1; - } + } if( iLangidCons>=0 ){ pInfo->idxNum |= FTS3_HAVE_LANGID; pInfo->aConstraintUsage[iLangidCons].argvIndex = iIdx++; - } + } if( iDocidGe>=0 ){ pInfo->idxNum |= FTS3_HAVE_DOCID_GE; pInfo->aConstraintUsage[iDocidGe].argvIndex = iIdx++; - } + } if( iDocidLe>=0 ){ pInfo->idxNum |= FTS3_HAVE_DOCID_LE; pInfo->aConstraintUsage[iDocidLe].argvIndex = iIdx++; - } + } /* Regardless of the strategy selected, FTS can deliver rows in rowid (or - ** docid) order. Both ascending and descending are possible. + ** docid) order. Both ascending and descending are possible. */ if( pInfo->nOrderBy==1 ){ struct sqlite3_index_orderby *pOrder = &pInfo->aOrderBy[0]; @@ -146619,7 +146619,7 @@ static int fts3OpenMethod(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCsr){ UNUSED_PARAMETER(pVTab); /* Allocate a buffer large enough for an Fts3Cursor structure. If the - ** allocation succeeds, zero it and return SQLITE_OK. Otherwise, + ** allocation succeeds, zero it and return SQLITE_OK. Otherwise, ** if the allocation fails, return SQLITE_NOMEM. */ *ppCsr = pCsr = (sqlite3_vtab_cursor *)sqlite3_malloc(sizeof(Fts3Cursor)); @@ -146698,7 +146698,7 @@ static int fts3CursorSeekStmt(Fts3Cursor *pCsr){ /* ** Position the pCsr->pStmt statement so that it is on the row ** of the %_content table that contains the last match. Return -** SQLITE_OK on success. +** SQLITE_OK on success. */ static int fts3CursorSeek(sqlite3_context *pContext, Fts3Cursor *pCsr){ int rc = SQLITE_OK; @@ -146730,7 +146730,7 @@ static int fts3CursorSeek(sqlite3_context *pContext, Fts3Cursor *pCsr){ /* ** This function is used to process a single interior node when searching -** a b-tree for a term or term prefix. The node data is passed to this +** a b-tree for a term or term prefix. The node data is passed to this ** function via the zNode/nNode parameters. The term to search for is ** passed in zTerm/nTerm. ** @@ -146759,9 +146759,9 @@ static int fts3ScanInteriorNode( int isFirstTerm = 1; /* True when processing first term on page */ sqlite3_int64 iChild; /* Block id of child node to descend to */ - /* Skip over the 'height' varint that occurs at the start of every + /* Skip over the 'height' varint that occurs at the start of every ** interior node. Then load the blockid of the left-child of the b-tree - ** node into variable iChild. + ** node into variable iChild. ** ** Even if the data structure on disk is corrupted, this (reading two ** varints from the buffer) does not risk an overread. If zNode is a @@ -146777,13 +146777,13 @@ static int fts3ScanInteriorNode( if( zCsr>zEnd ){ return FTS_CORRUPT_VTAB; } - + while( zCsrpos(*pp1) && pos(*pp2)-pos(*pp1)<=nToken). i.e. ** when the *pp1 token appears before the *pp2 token, but not more than nToken @@ -147181,11 +147181,11 @@ static int fts3PoslistPhraseMerge( assert( isSaveLeft==0 || isExact==0 ); assert( p!=0 && *p1!=0 && *p2!=0 ); - if( *p1==POS_COLUMN ){ + if( *p1==POS_COLUMN ){ p1++; p1 += fts3GetVarint32(p1, &iCol1); } - if( *p2==POS_COLUMN ){ + if( *p2==POS_COLUMN ){ p2++; p2 += fts3GetVarint32(p2, &iCol2); } @@ -147208,8 +147208,8 @@ static int fts3PoslistPhraseMerge( fts3GetDeltaVarint(&p2, &iPos2); iPos2 -= 2; while( 1 ){ - if( iPos2==iPos1+nToken - || (isExact==0 && iPos2>iPos1 && iPos2<=iPos1+nToken) + if( iPos2==iPos1+nToken + || (isExact==0 && iPos2>iPos1 && iPos2<=iPos1+nToken) ){ sqlite3_int64 iSave; iSave = isSaveLeft ? iPos1 : iPos2; @@ -147244,8 +147244,8 @@ static int fts3PoslistPhraseMerge( /* Advance pointer p1 or p2 (whichever corresponds to the smaller of ** iCol1 and iCol2) so that it points to either the 0x00 that marks the - ** end of the position list, or the 0x01 that precedes the next - ** column-number in the position list. + ** end of the position list, or the 0x01 that precedes the next + ** column-number in the position list. */ else if( iCol1bDescIdx, + int rc = fts3DoclistOrMerge(p->bDescIdx, pTS->aaOutput[i], pTS->anOutput[i], aOut, nOut, &aNew, &nNew ); if( rc!=SQLITE_OK ){ @@ -147702,15 +147702,15 @@ static int fts3TermSelectMerge( ){ if( pTS->aaOutput[0]==0 ){ /* If this is the first term selected, copy the doclist to the output - ** buffer using memcpy(). + ** buffer using memcpy(). ** - ** Add FTS3_VARINT_MAX bytes of unused space to the end of the + ** Add FTS3_VARINT_MAX bytes of unused space to the end of the ** allocation. This is so as to ensure that the buffer is big enough ** to hold the current doclist AND'd with any other doclist. If the ** doclists are stored in order=ASC order, this padding would not be ** required (since the size of [doclistA AND doclistB] is always less ** than or equal to the size of [doclistA] in that case). But this is - ** not true for order=DESC. For example, a doclist containing (1, -1) + ** not true for order=DESC. For example, a doclist containing (1, -1) ** may be smaller than (-1), as in the first example the -1 may be stored ** as a single-byte delta, whereas in the second it must be stored as a ** FTS3_VARINT_MAX byte varint. @@ -147739,7 +147739,7 @@ static int fts3TermSelectMerge( char *aNew; int nNew; - int rc = fts3DoclistOrMerge(p->bDescIdx, aMerge, nMerge, + int rc = fts3DoclistOrMerge(p->bDescIdx, aMerge, nMerge, pTS->aaOutput[iOut], pTS->anOutput[iOut], &aNew, &nNew ); if( rc!=SQLITE_OK ){ @@ -147750,7 +147750,7 @@ static int fts3TermSelectMerge( if( aMerge!=aDoclist ) sqlite3_free(aMerge); sqlite3_free(pTS->aaOutput[iOut]); pTS->aaOutput[iOut] = 0; - + aMerge = aNew; nMerge = nNew; if( (iOut+1)==SizeofArray(pTS->aaOutput) ){ @@ -147767,7 +147767,7 @@ static int fts3TermSelectMerge( ** Append SegReader object pNew to the end of the pCsr->apSegment[] array. */ static int fts3SegReaderCursorAppend( - Fts3MultiSegReader *pCsr, + Fts3MultiSegReader *pCsr, Fts3SegReader *pNew ){ if( (pCsr->nSegment%16)==0 ){ @@ -147806,10 +147806,10 @@ static int fts3SegReaderCursor( sqlite3_stmt *pStmt = 0; /* Statement to iterate through segments */ int rc2; /* Result of sqlite3_reset() */ - /* If iLevel is less than 0 and this is not a scan, include a seg-reader + /* If iLevel is less than 0 and this is not a scan, include a seg-reader ** for the pending-terms. If this is a scan, then this call must be being ** made by an fts4aux module, not an FTS table. In this case calling - ** Fts3SegReaderPending might segfault, as the data structures used by + ** Fts3SegReaderPending might segfault, as the data structures used by ** fts4aux are not completely populated. So it's easiest to filter these ** calls out here. */ if( iLevel<0 && p->aIndex ){ @@ -147843,10 +147843,10 @@ static int fts3SegReaderCursor( if( rc!=SQLITE_OK ) goto finished; if( isPrefix==0 && isScan==0 ) iLeavesEndBlock = iStartBlock; } - - rc = sqlite3Fts3SegReaderNew(pCsr->nSegment+1, + + rc = sqlite3Fts3SegReaderNew(pCsr->nSegment+1, (isPrefix==0 && isScan==0), - iStartBlock, iLeavesEndBlock, + iStartBlock, iLeavesEndBlock, iEndBlock, zRoot, nRoot, &pSeg ); if( rc!=SQLITE_OK ) goto finished; @@ -147862,7 +147862,7 @@ static int fts3SegReaderCursor( } /* -** Set up a cursor object for iterating through a full-text index or a +** Set up a cursor object for iterating through a full-text index or a ** single level therein. */ SQLITE_PRIVATE int sqlite3Fts3SegReaderCursor( @@ -147878,7 +147878,7 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderCursor( ){ assert( iIndex>=0 && iIndexnIndex ); assert( iLevel==FTS3_SEGCURSOR_ALL - || iLevel==FTS3_SEGCURSOR_PENDING + || iLevel==FTS3_SEGCURSOR_PENDING || iLevel>=0 ); assert( iLevelnIndex; i++){ if( p->aIndex[i].nPrefix==nTerm ){ bFound = 1; - rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, + rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, i, FTS3_SEGCURSOR_ALL, zTerm, nTerm, 0, 0, pSegcsr ); pSegcsr->bLookup = 1; @@ -147952,7 +147952,7 @@ static int fts3TermSegReaderCursor( for(i=1; bFound==0 && inIndex; i++){ if( p->aIndex[i].nPrefix==nTerm+1 ){ bFound = 1; - rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, + rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, i, FTS3_SEGCURSOR_ALL, zTerm, nTerm, 1, 0, pSegcsr ); if( rc==SQLITE_OK ){ @@ -147965,7 +147965,7 @@ static int fts3TermSegReaderCursor( } if( bFound==0 ){ - rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, + rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, 0, FTS3_SEGCURSOR_ALL, zTerm, nTerm, isPrefix, 0, pSegcsr ); pSegcsr->bLookup = !isPrefix; @@ -148013,7 +148013,7 @@ static int fts3TermSelect( rc = sqlite3Fts3SegReaderStart(p, pSegcsr, &filter); while( SQLITE_OK==rc - && SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, pSegcsr)) + && SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, pSegcsr)) ){ rc = fts3TermSelectMerge(p, &tsc, pSegcsr->aDoclist, pSegcsr->nDoclist); } @@ -148042,7 +148042,7 @@ static int fts3TermSelect( ** ** If the isPoslist argument is true, then it is assumed that the doclist ** contains a position-list following each docid. Otherwise, it is assumed -** that the doclist is simply a list of docids stored as delta encoded +** that the doclist is simply a list of docids stored as delta encoded ** varints. */ static int fts3DoclistCountDocids(char *aList, int nList){ @@ -148197,7 +148197,7 @@ static int fts3FilterMethod( assert( p->base.zErrMsg==0 ); rc = sqlite3Fts3ExprParse(p->pTokenizer, pCsr->iLangid, - p->azColumn, p->bFts4, p->nColumn, iCol, zQuery, -1, &pCsr->pExpr, + p->azColumn, p->bFts4, p->nColumn, iCol, zQuery, -1, &pCsr->pExpr, &p->base.zErrMsg ); if( rc!=SQLITE_OK ){ @@ -148224,7 +148224,7 @@ static int fts3FilterMethod( (pCsr->bDesc ? "DESC" : "ASC") ); }else{ - zSql = sqlite3_mprintf("SELECT %s ORDER BY rowid %s", + zSql = sqlite3_mprintf("SELECT %s ORDER BY rowid %s", p->zReadExprlist, (pCsr->bDesc ? "DESC" : "ASC") ); } @@ -148245,15 +148245,15 @@ static int fts3FilterMethod( return fts3NextMethod(pCursor); } -/* -** This is the xEof method of the virtual table. SQLite calls this +/* +** This is the xEof method of the virtual table. SQLite calls this ** routine to find out if it has reached the end of a result set. */ static int fts3EofMethod(sqlite3_vtab_cursor *pCursor){ return ((Fts3Cursor *)pCursor)->isEof; } -/* +/* ** This is the xRowid method. The SQLite core calls this routine to ** retrieve the rowid for the current row of the result set. fts3 ** exposes %_content.docid as the rowid for the virtual table. The @@ -148265,7 +148265,7 @@ static int fts3RowidMethod(sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid){ return SQLITE_OK; } -/* +/* ** This is the xColumn method, called by SQLite to request a value from ** the row that the supplied cursor currently points to. ** @@ -148289,7 +148289,7 @@ static int fts3ColumnMethod( assert( iCol>=0 && iCol<=p->nColumn+2 ); if( iCol==p->nColumn+1 ){ - /* This call is a request for the "docid" column. Since "docid" is an + /* This call is a request for the "docid" column. Since "docid" is an ** alias for "rowid", use the xRowid() method to obtain the value. */ sqlite3_result_int64(pCtx, pCsr->iPrevId); @@ -148300,7 +148300,7 @@ static int fts3ColumnMethod( }else if( iCol==p->nColumn+2 && pCsr->pExpr ){ sqlite3_result_int64(pCtx, pCsr->iLangid); }else{ - /* The requested column is either a user column (one that contains + /* The requested column is either a user column (one that contains ** indexed data), or the language-id column. */ rc = fts3CursorSeek(0, pCsr); @@ -148321,8 +148321,8 @@ static int fts3ColumnMethod( return rc; } -/* -** This function is the implementation of the xUpdate callback used by +/* +** This function is the implementation of the xUpdate callback used by ** FTS3 virtual tables. It is invoked by SQLite each time a row is to be ** inserted, updated or deleted. */ @@ -148357,7 +148357,7 @@ static int fts3SyncMethod(sqlite3_vtab *pVtab){ ** ** Of course, updating the input segments also involves deleting a bunch ** of blocks from the segments table. But this is not considered overhead - ** as it would also be required by a crisis-merge that used the same input + ** as it would also be required by a crisis-merge that used the same input ** segments. */ const u32 nMinMerge = 64; /* Minimum amount of incr-merge work to do */ @@ -148365,8 +148365,8 @@ static int fts3SyncMethod(sqlite3_vtab *pVtab){ Fts3Table *p = (Fts3Table*)pVtab; int rc = sqlite3Fts3PendingTermsFlush(p); - if( rc==SQLITE_OK - && p->nLeafAdd>(nMinMerge/16) + if( rc==SQLITE_OK + && p->nLeafAdd>(nMinMerge/16) && p->nAutoincrmerge && p->nAutoincrmerge!=0xff ){ int mxLevel = 0; /* Maximum relative level value in db */ @@ -148410,7 +148410,7 @@ static int fts3SetHasStat(Fts3Table *p){ } /* -** Implementation of xBegin() method. +** Implementation of xBegin() method. */ static int fts3BeginMethod(sqlite3_vtab *pVtab){ Fts3Table *p = (Fts3Table*)pVtab; @@ -148466,17 +148466,17 @@ static void fts3ReversePoslist(char *pStart, char **ppPoslist){ /* Skip backwards passed any trailing 0x00 bytes added by NearTrim() */ while( p>pStart && (c=*p--)==0 ); - /* Search backwards for a varint with value zero (the end of the previous + /* Search backwards for a varint with value zero (the end of the previous ** poslist). This is an 0x00 byte preceded by some byte that does not ** have the 0x80 bit set. */ - while( p>pStart && (*p & 0x80) | c ){ - c = *p--; + while( p>pStart && (*p & 0x80) | c ){ + c = *p--; } assert( p==pStart || c==0 ); /* At this point p points to that preceding byte without the 0x80 bit ** set. So to find the start of the poslist, skip forward 2 bytes then - ** over a varint. + ** over a varint. ** ** Normally. The other case is that p==pStart and the poslist to return ** is the first in the doclist. In this case do not skip forward 2 bytes. @@ -148497,7 +148497,7 @@ static void fts3ReversePoslist(char *pStart, char **ppPoslist){ ** offsets() and optimize() SQL functions. ** ** If the value passed as the third argument is a blob of size -** sizeof(Fts3Cursor*), then the blob contents are copied to the +** sizeof(Fts3Cursor*), then the blob contents are copied to the ** output variable *ppCsr and SQLITE_OK is returned. Otherwise, an error ** message is written to context pContext and SQLITE_ERROR returned. The ** string passed via zFunc is used as part of the error message. @@ -148540,7 +148540,7 @@ static void fts3SnippetFunc( assert( nVal>=1 ); if( nVal>6 ){ - sqlite3_result_error(pContext, + sqlite3_result_error(pContext, "wrong number of arguments to function snippet()", -1); return; } @@ -148582,8 +148582,8 @@ static void fts3OffsetsFunc( } } -/* -** Implementation of the special optimize() function for FTS3. This +/* +** Implementation of the special optimize() function for FTS3. This ** function merges all segments in the database to a single segment. ** Example usage is: ** @@ -148692,10 +148692,10 @@ static int fts3RenameMethod( /* At this point it must be known if the %_stat table exists or not. ** So bHasStat may not be 2. */ rc = fts3SetHasStat(p); - + /* As it happens, the pending terms table is always empty here. This is - ** because an "ALTER TABLE RENAME TABLE" statement inside a transaction - ** always opens a savepoint transaction. And the xSavepoint() method + ** because an "ALTER TABLE RENAME TABLE" statement inside a transaction + ** always opens a savepoint transaction. And the xSavepoint() method ** flushes the pending terms table. But leave the (no-op) call to ** PendingTermsFlush() in in case that changes. */ @@ -148819,7 +148819,7 @@ static void hashDestroy(void *p){ } /* -** The fts3 built-in tokenizers - "simple", "porter" and "icu"- are +** The fts3 built-in tokenizers - "simple", "porter" and "icu"- are ** implemented in files fts3_tokenizer1.c, fts3_porter.c and fts3_icu.c ** respectively. The following three forward declarations are for functions ** declared in these files used to retrieve the respective implementations. @@ -148883,10 +148883,10 @@ SQLITE_PRIVATE int sqlite3Fts3Init(sqlite3 *db){ /* Load the built-in tokenizers into the hash table */ if( rc==SQLITE_OK ){ if( sqlite3Fts3HashInsert(pHash, "simple", 7, (void *)pSimple) - || sqlite3Fts3HashInsert(pHash, "porter", 7, (void *)pPorter) + || sqlite3Fts3HashInsert(pHash, "porter", 7, (void *)pPorter) #ifndef SQLITE_DISABLE_FTS3_UNICODE - || sqlite3Fts3HashInsert(pHash, "unicode61", 10, (void *)pUnicode) + || sqlite3Fts3HashInsert(pHash, "unicode61", 10, (void *)pUnicode) #endif #ifdef SQLITE_ENABLE_ICU || (pIcu && sqlite3Fts3HashInsert(pHash, "icu", 4, (void *)pIcu)) @@ -148902,11 +148902,11 @@ SQLITE_PRIVATE int sqlite3Fts3Init(sqlite3 *db){ } #endif - /* Create the virtual table wrapper around the hash-table and overload + /* Create the virtual table wrapper around the hash-table and overload ** the two scalar functions. If this is successful, register the ** module with sqlite. */ - if( SQLITE_OK==rc + if( SQLITE_OK==rc #if CHROMIUM_FTS3_CHANGES && !SQLITE_TEST /* fts3_tokenizer() disabled for security reasons. */ #else @@ -148948,7 +148948,7 @@ SQLITE_PRIVATE int sqlite3Fts3Init(sqlite3 *db){ /* ** Allocate an Fts3MultiSegReader for each token in the expression headed -** by pExpr. +** by pExpr. ** ** An Fts3SegReader object is a cursor that can seek or scan a range of ** entries within a single segment b-tree. An Fts3MultiSegReader uses multiple @@ -148958,7 +148958,7 @@ SQLITE_PRIVATE int sqlite3Fts3Init(sqlite3 *db){ ** If the allocated Fts3MultiSegReader just seeks to a single entry in a ** segment b-tree (if the term is not a prefix or it is a prefix for which ** there exists prefix b-tree of the right length) then it may be traversed -** and merged incrementally. Otherwise, it has to be merged into an in-memory +** and merged incrementally. Otherwise, it has to be merged into an in-memory ** doclist and then traversed. */ static void fts3EvalAllocateReaders( @@ -148975,7 +148975,7 @@ static void fts3EvalAllocateReaders( *pnToken += nToken; for(i=0; ipPhrase->aToken[i]; - int rc = fts3TermSegReaderCursor(pCsr, + int rc = fts3TermSegReaderCursor(pCsr, pToken->z, pToken->n, pToken->isPrefix, &pToken->pSegcsr ); if( rc!=SQLITE_OK ){ @@ -149180,7 +149180,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){ sqlite3_free(aPoslist); return SQLITE_NOMEM; } - + pPhrase->doclist.pList = aOut; if( fts3PoslistPhraseMerge(&aOut, nDistance, 0, 1, &p1, &p2) ){ pPhrase->doclist.bFreeList = 1; @@ -149204,7 +149204,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){ #define MAX_INCR_PHRASE_TOKENS 4 /* -** This function is called for each Fts3Phrase in a full-text query +** This function is called for each Fts3Phrase in a full-text query ** expression to initialize the mechanism for returning rows. Once this ** function has been called successfully on an Fts3Phrase, it may be ** used with fts3EvalPhraseNext() to iterate through the matching docids. @@ -149222,12 +149222,12 @@ static int fts3EvalPhraseStart(Fts3Cursor *pCsr, int bOptOk, Fts3Phrase *p){ /* Determine if doclists may be loaded from disk incrementally. This is ** possible if the bOptOk argument is true, the FTS doclists will be - ** scanned in forward order, and the phrase consists of + ** scanned in forward order, and the phrase consists of ** MAX_INCR_PHRASE_TOKENS or fewer tokens, none of which are are "^first" ** tokens or prefix tokens that cannot use a prefix-index. */ int bHaveIncr = 0; - int bIncrOk = (bOptOk - && pCsr->bDesc==pTab->bDescIdx + int bIncrOk = (bOptOk + && pCsr->bDesc==pTab->bDescIdx && p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 #ifdef SQLITE_TEST && pTab->bNoIncrDoclist==0 @@ -149263,12 +149263,12 @@ static int fts3EvalPhraseStart(Fts3Cursor *pCsr, int bOptOk, Fts3Phrase *p){ } /* -** This function is used to iterate backwards (from the end to start) +** This function is used to iterate backwards (from the end to start) ** through doclists. It is used by this module to iterate through phrase ** doclists in reverse and by the fts3_write.c module to iterate through ** pending-terms lists when writing to databases with "order=desc". ** -** The doclist may be sorted in ascending (parameter bDescIdx==0) or +** The doclist may be sorted in ascending (parameter bDescIdx==0) or ** descending (parameter bDescIdx==1) order of docid. Regardless, this ** function iterates from the end of the doclist to the beginning. */ @@ -149348,7 +149348,7 @@ SQLITE_PRIVATE void sqlite3Fts3DoclistNext( p += sqlite3Fts3GetVarint(p, piDocid); }else{ fts3PoslistCopy(0, &p); - while( p<&aDoclist[nDoclist] && *p==0 ) p++; + while( p<&aDoclist[nDoclist] && *p==0 ) p++; if( p>=&aDoclist[nDoclist] ){ *pbEof = 1; }else{ @@ -149372,7 +149372,7 @@ static void fts3EvalDlPhraseNext( ){ char *pIter; /* Used to iterate through aAll */ char *pEnd = &pDL->aAll[pDL->nAll]; /* 1 byte past end of aAll */ - + if( pDL->pNextDocid ){ pIter = pDL->pNextDocid; }else{ @@ -149420,12 +149420,12 @@ struct TokenDoclist { }; /* -** Token pToken is an incrementally loaded token that is part of a +** Token pToken is an incrementally loaded token that is part of a ** multi-token phrase. Advance it to the next matching document in the ** database and populate output variable *p with the details of the new ** entry. Or, if the iterator has reached EOF, set *pbEof to true. ** -** If an error occurs, return an SQLite error code. Otherwise, return +** If an error occurs, return an SQLite error code. Otherwise, return ** SQLITE_OK. */ static int incrPhraseTokenNext( @@ -149466,18 +149466,18 @@ static int incrPhraseTokenNext( /* ** The phrase iterator passed as the second argument: ** -** * features at least one token that uses an incremental doclist, and +** * features at least one token that uses an incremental doclist, and ** ** * does not contain any deferred tokens. ** ** Advance it to the next matching documnent in the database and populate -** the Fts3Doclist.pList and nList fields. +** the Fts3Doclist.pList and nList fields. ** ** If there is no "next" entry and no error occurs, then *pbEof is set to ** 1 before returning. Otherwise, if no error occurs and the iterator is ** successfully advanced, *pbEof is set to 0. ** -** If an error occurs, return an SQLite error code. Otherwise, return +** If an error occurs, return an SQLite error code. Otherwise, return ** SQLITE_OK. */ static int fts3EvalIncrPhraseNext( @@ -149495,7 +149495,7 @@ static int fts3EvalIncrPhraseNext( assert( p->bIncr==1 ); if( p->nToken==1 && p->bIncr ){ - rc = sqlite3Fts3MsrIncrNext(pTab, p->aToken[0].pSegcsr, + rc = sqlite3Fts3MsrIncrNext(pTab, p->aToken[0].pSegcsr, &pDL->iDocid, &pDL->pList, &pDL->nList ); if( pDL->pList==0 ) bEof = 1; @@ -149525,8 +149525,8 @@ static int fts3EvalIncrPhraseNext( /* Keep advancing iterators until they all point to the same document */ for(i=0; inToken; i++){ - while( rc==SQLITE_OK && bEof==0 - && a[i].bIgnore==0 && DOCID_CMP(a[i].iDocid, iMax)<0 + while( rc==SQLITE_OK && bEof==0 + && a[i].bIgnore==0 && DOCID_CMP(a[i].iDocid, iMax)<0 ){ rc = incrPhraseTokenNext(pTab, p, i, &a[i], &bEof); if( DOCID_CMP(a[i].iDocid, iMax)>0 ){ @@ -149572,8 +149572,8 @@ static int fts3EvalIncrPhraseNext( } /* -** Attempt to move the phrase iterator to point to the next matching docid. -** If an error occurs, return an SQLite error code. Otherwise, return +** Attempt to move the phrase iterator to point to the next matching docid. +** If an error occurs, return an SQLite error code. Otherwise, return ** SQLITE_OK. ** ** If there is no "next" entry and no error occurs, then *pbEof is set to @@ -149592,7 +149592,7 @@ static int fts3EvalPhraseNext( if( p->bIncr ){ rc = fts3EvalIncrPhraseNext(pCsr, p, pbEof); }else if( pCsr->bDesc!=pTab->bDescIdx && pDL->nAll ){ - sqlite3Fts3DoclistPrev(pTab->bDescIdx, pDL->aAll, pDL->nAll, + sqlite3Fts3DoclistPrev(pTab->bDescIdx, pDL->aAll, pDL->nAll, &pDL->pNextDocid, &pDL->iDocid, &pDL->nList, pbEof ); pDL->pList = pDL->pNextDocid; @@ -149652,7 +149652,7 @@ static void fts3EvalStartReaders( ** Tokens are divided into AND/NEAR clusters. All tokens in a cluster belong ** to phrases that are connected only by AND and NEAR operators (not OR or ** NOT). When determining tokens to defer, each AND/NEAR cluster is considered -** separately. The root of a tokens AND/NEAR cluster is stored in +** separately. The root of a tokens AND/NEAR cluster is stored in ** Fts3TokenAndCost.pRoot. */ typedef struct Fts3TokenAndCost Fts3TokenAndCost; @@ -149720,7 +149720,7 @@ static void fts3EvalTokenCosts( ** write this value to *pnPage and return SQLITE_OK. Otherwise, return ** an SQLite error code. ** -** The average document size in pages is calculated by first calculating +** The average document size in pages is calculated by first calculating ** determining the average size in bytes, B. If B is less than the amount ** of data that will fit on a single leaf page of an intkey table in ** this database, then the average docsize is 1. Otherwise, it is 1 plus @@ -149729,10 +149729,10 @@ static void fts3EvalTokenCosts( static int fts3EvalAverageDocsize(Fts3Cursor *pCsr, int *pnPage){ if( pCsr->nRowAvg==0 ){ /* The average document size, which is required to calculate the cost - ** of each doclist, has not yet been determined. Read the required + ** of each doclist, has not yet been determined. Read the required ** data from the %_stat table to calculate it. ** - ** Entry 0 of the %_stat table is a blob containing (nCol+1) FTS3 + ** Entry 0 of the %_stat table is a blob containing (nCol+1) FTS3 ** varints, where nCol is the number of columns in the FTS3 table. ** The first varint is the number of documents currently stored in ** the table. The following nCol varints contain the total amount of @@ -149764,7 +149764,7 @@ static int fts3EvalAverageDocsize(Fts3Cursor *pCsr, int *pnPage){ pCsr->nDoc = nDoc; pCsr->nRowAvg = (int)(((nByte / nDoc) + p->nPgsz) / p->nPgsz); - assert( pCsr->nRowAvg>0 ); + assert( pCsr->nRowAvg>0 ); rc = sqlite3_reset(pStmt); if( rc!=SQLITE_OK ) return rc; } @@ -149774,11 +149774,11 @@ static int fts3EvalAverageDocsize(Fts3Cursor *pCsr, int *pnPage){ } /* -** This function is called to select the tokens (if any) that will be +** This function is called to select the tokens (if any) that will be ** deferred. The array aTC[] has already been populated when this is ** called. ** -** This function is called once for each AND/NEAR cluster in the +** This function is called once for each AND/NEAR cluster in the ** expression. Each invocation determines which tokens to defer within ** the cluster with root node pRoot. See comments above the definition ** of struct Fts3TokenAndCost for more details. @@ -149828,8 +149828,8 @@ static int fts3EvalSelectDeferred( assert( rc!=SQLITE_OK || nDocSize>0 ); - /* Iterate through all tokens in this AND/NEAR cluster, in ascending order - ** of the number of overflow pages that will be loaded by the pager layer + /* Iterate through all tokens in this AND/NEAR cluster, in ascending order + ** of the number of overflow pages that will be loaded by the pager layer ** to retrieve the entire doclist for the token from the full-text index. ** Load the doclists for tokens that are either: ** @@ -149840,7 +149840,7 @@ static int fts3EvalSelectDeferred( ** ** After each token doclist is loaded, merge it with the others from the ** same phrase and count the number of documents that the merged doclist - ** contains. Set variable "nMinEst" to the smallest number of documents in + ** contains. Set variable "nMinEst" to the smallest number of documents in ** any phrase doclist for which 1 or more token doclists have been loaded. ** Let nOther be the number of other phrases for which it is certain that ** one or more tokens will not be deferred. @@ -149856,8 +149856,8 @@ static int fts3EvalSelectDeferred( /* Set pTC to point to the cheapest remaining token. */ for(iTC=0; iTCnOvfl) + if( aTC[iTC].pToken && aTC[iTC].pRoot==pRoot + && (!pTC || aTC[iTC].nOvflnOvfl) ){ pTC = &aTC[iTC]; } @@ -149866,7 +149866,7 @@ static int fts3EvalSelectDeferred( if( ii && pTC->nOvfl>=((nMinEst+(nLoad4/4)-1)/(nLoad4/4))*nDocSize ){ /* The number of overflow pages to load for this (and therefore all - ** subsequent) tokens is greater than the estimated number of pages + ** subsequent) tokens is greater than the estimated number of pages ** that will be loaded if all subsequent tokens are deferred. */ Fts3PhraseToken *pToken = pTC->pToken; @@ -149875,7 +149875,7 @@ static int fts3EvalSelectDeferred( pToken->pSegcsr = 0; }else{ /* Set nLoad4 to the value of (4^nOther) for the next iteration of the - ** for-loop. Except, limit the value to 2^24 to prevent it from + ** for-loop. Except, limit the value to 2^24 to prevent it from ** overflowing the 32-bit integer it is stored in. */ if( ii<12 ) nLoad4 = nLoad4*4; @@ -149997,7 +149997,7 @@ static void fts3EvalInvalidatePoslist(Fts3Phrase *pPhrase){ ** close to a position in the *paPoslist position list are removed. If this ** leaves 0 positions, zero is returned. Otherwise, non-zero. ** -** Before returning, *paPoslist is set to point to the position lsit +** Before returning, *paPoslist is set to point to the position lsit ** associated with pPhrase. And *pnToken is set to the number of tokens in ** pPhrase. */ @@ -150011,8 +150011,8 @@ static int fts3EvalNearTrim( int nParam1 = nNear + pPhrase->nToken; int nParam2 = nNear + *pnToken; int nNew; - char *p2; - char *pOut; + char *p2; + char *pOut; int res; assert( pPhrase->doclist.pList ); @@ -150059,19 +150059,19 @@ static int fts3EvalNearTrim( ** ** 1. Deferred tokens are not taken into account. If a phrase consists ** entirely of deferred tokens, it is assumed to match every row in -** the db. In this case the position-list is not populated at all. +** the db. In this case the position-list is not populated at all. ** ** Or, if a phrase contains one or more deferred tokens and one or -** more non-deferred tokens, then the expression is advanced to the +** more non-deferred tokens, then the expression is advanced to the ** next possible match, considering only non-deferred tokens. In other ** words, if the phrase is "A B C", and "B" is deferred, the expression -** is advanced to the next row that contains an instance of "A * C", +** is advanced to the next row that contains an instance of "A * C", ** where "*" may match any single token. The position list in this case ** is populated as for "A * C" before returning. ** -** 2. NEAR is treated as AND. If the expression is "x NEAR y", it is +** 2. NEAR is treated as AND. If the expression is "x NEAR y", it is ** advanced to point to the next row that matches "x AND y". -** +** ** See sqlite3Fts3EvalTestDeferred() for details on testing if a row is ** really a match, taking into account deferred tokens and NEAR operators. */ @@ -150138,7 +150138,7 @@ static void fts3EvalNextRow( } break; } - + case FTSQUERY_OR: { Fts3Expr *pLeft = pExpr->pLeft; Fts3Expr *pRight = pExpr->pRight; @@ -150178,9 +150178,9 @@ static void fts3EvalNextRow( fts3EvalNextRow(pCsr, pLeft, pRc); if( pLeft->bEof==0 ){ - while( !*pRc - && !pRight->bEof - && DOCID_CMP(pLeft->iDocid, pRight->iDocid)>0 + while( !*pRc + && !pRight->bEof + && DOCID_CMP(pLeft->iDocid, pRight->iDocid)>0 ){ fts3EvalNextRow(pCsr, pRight, pRc); } @@ -150205,14 +150205,14 @@ static void fts3EvalNextRow( ** If *pRc is not SQLITE_OK, or if pExpr is not the root node of a NEAR ** cluster, then this function returns 1 immediately. ** -** Otherwise, it checks if the current row really does match the NEAR -** expression, using the data currently stored in the position lists -** (Fts3Expr->pPhrase.doclist.pList/nList) for each phrase in the expression. +** Otherwise, it checks if the current row really does match the NEAR +** expression, using the data currently stored in the position lists +** (Fts3Expr->pPhrase.doclist.pList/nList) for each phrase in the expression. ** ** If the current row is a match, the position list associated with each ** phrase in the NEAR expression is edited in place to contain only those ** phrase instances sufficiently close to their peers to satisfy all NEAR -** constraints. In this case it returns 1. If the NEAR expression does not +** constraints. In this case it returns 1. If the NEAR expression does not ** match the current row, 0 is returned. The position lists may or may not ** be edited if 0 is returned. */ @@ -150235,16 +150235,16 @@ static int fts3EvalNearTest(Fts3Expr *pExpr, int *pRc){ ** | | ** "w" "x" ** - ** The right-hand child of a NEAR node is always a phrase. The + ** The right-hand child of a NEAR node is always a phrase. The ** left-hand child may be either a phrase or a NEAR node. There are ** no exceptions to this - it's the way the parser in fts3_expr.c works. */ - if( *pRc==SQLITE_OK - && pExpr->eType==FTSQUERY_NEAR + if( *pRc==SQLITE_OK + && pExpr->eType==FTSQUERY_NEAR && pExpr->bEof==0 && (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR) ){ - Fts3Expr *p; + Fts3Expr *p; int nTmp = 0; /* Bytes of temp space */ char *aTmp; /* Temp space for PoslistNearMerge() */ @@ -150294,12 +150294,12 @@ static int fts3EvalNearTest(Fts3Expr *pExpr, int *pRc){ /* ** This function is a helper function for sqlite3Fts3EvalTestDeferred(). ** Assuming no error occurs or has occurred, It returns non-zero if the -** expression passed as the second argument matches the row that pCsr +** expression passed as the second argument matches the row that pCsr ** currently points to, or zero if it does not. ** ** If *pRc is not SQLITE_OK when this function is called, it is a no-op. -** If an error occurs during execution of this function, *pRc is set to -** the appropriate SQLite error code. In this case the returned value is +** If an error occurs during execution of this function, *pRc is set to +** the appropriate SQLite error code. In this case the returned value is ** undefined. */ static int fts3EvalTestExpr( @@ -150318,10 +150318,10 @@ static int fts3EvalTestExpr( && fts3EvalNearTest(pExpr, pRc) ); - /* If the NEAR expression does not match any rows, zero the doclist for + /* If the NEAR expression does not match any rows, zero the doclist for ** all phrases involved in the NEAR. This is because the snippet(), - ** offsets() and matchinfo() functions are not supposed to recognize - ** any instances of phrases that are part of unmatched NEAR queries. + ** offsets() and matchinfo() functions are not supposed to recognize + ** any instances of phrases that are part of unmatched NEAR queries. ** For example if this expression: ** ** ... MATCH 'a OR (b NEAR c)' @@ -150333,8 +150333,8 @@ static int fts3EvalTestExpr( ** then any snippet() should ony highlight the "a" term, not the "b" ** (as "b" is part of a non-matching NEAR clause). */ - if( bHit==0 - && pExpr->eType==FTSQUERY_NEAR + if( bHit==0 + && pExpr->eType==FTSQUERY_NEAR && (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR) ){ Fts3Expr *p; @@ -150366,7 +150366,7 @@ static int fts3EvalTestExpr( default: { #ifndef SQLITE_DISABLE_FTS4_DEFERRED - if( pCsr->pDeferred + if( pCsr->pDeferred && (pExpr->iDocid==pCsr->iPrevId || pExpr->bDeferred) ){ Fts3Phrase *pPhrase = pExpr->pPhrase; @@ -150422,7 +150422,7 @@ SQLITE_PRIVATE int sqlite3Fts3EvalTestDeferred(Fts3Cursor *pCsr, int *pRc){ ** memory and scan it to determine the position list for each deferred ** token. Then, see if this row is really a match, considering deferred ** tokens and NEAR operators (neither of which were taken into account - ** earlier, by fts3EvalNextRow()). + ** earlier, by fts3EvalNextRow()). */ if( pCsr->pDeferred ){ rc = fts3CursorSeek(0, pCsr); @@ -150477,7 +150477,7 @@ static int fts3EvalNext(Fts3Cursor *pCsr){ /* ** Restart interation for expression pExpr so that the next call to -** fts3EvalNext() visits the first row. Do not allow incremental +** fts3EvalNext() visits the first row. Do not allow incremental ** loading or merging of phrase doclists for this iteration. ** ** If *pRc is other than SQLITE_OK when this function is called, it is @@ -150520,11 +150520,11 @@ static void fts3EvalRestart( } /* -** After allocating the Fts3Expr.aMI[] array for each phrase in the +** After allocating the Fts3Expr.aMI[] array for each phrase in the ** expression rooted at pExpr, the cursor iterates through all rows matched ** by pExpr, calling this function for each row. This function increments ** the values in Fts3Expr.aMI[] according to the position-list currently -** found in Fts3Expr.pPhrase->doclist.pList for each of the phrase +** found in Fts3Expr.pPhrase->doclist.pList for each of the phrase ** expression nodes. */ static void fts3EvalUpdateCounts(Fts3Expr *pExpr){ @@ -150619,9 +150619,9 @@ static int fts3EvalGatherStats( pCsr->isRequireSeek = 1; pCsr->isMatchinfoNeeded = 1; pCsr->iPrevId = pRoot->iDocid; - }while( pCsr->isEof==0 - && pRoot->eType==FTSQUERY_NEAR - && sqlite3Fts3EvalTestDeferred(pCsr, &rc) + }while( pCsr->isEof==0 + && pRoot->eType==FTSQUERY_NEAR + && sqlite3Fts3EvalTestDeferred(pCsr, &rc) ); if( rc==SQLITE_OK && pCsr->isEof==0 ){ @@ -150636,7 +150636,7 @@ static int fts3EvalGatherStats( pRoot->bEof = bEof; }else{ /* Caution: pRoot may iterate through docids in ascending or descending - ** order. For this reason, even though it seems more defensive, the + ** order. For this reason, even though it seems more defensive, the ** do loop can not be written: ** ** do {...} while( pRoot->iDocid=0 && iColnColumn ); @@ -150760,8 +150760,8 @@ SQLITE_PRIVATE int sqlite3Fts3EvalPhrasePoslist( Fts3Expr *pNear; /* Most senior NEAR ancestor (or pExpr) */ int bMatch; - /* Check if this phrase descends from an OR expression node. If not, - ** return NULL. Otherwise, the entry that corresponds to docid + /* Check if this phrase descends from an OR expression node. If not, + ** return NULL. Otherwise, the entry that corresponds to docid ** pCsr->iPrevId may lie earlier in the doclist buffer. Or, if the ** tree that the node is part of has been marked as EOF, but the node ** itself is not EOF, then it may point to an earlier entry. */ @@ -150809,7 +150809,7 @@ SQLITE_PRIVATE int sqlite3Fts3EvalPhrasePoslist( (pIter >= (pPh->doclist.aAll + pPh->doclist.nAll)); while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)<0 ) && bEof==0 ){ sqlite3Fts3DoclistNext( - bDescDoclist, pPh->doclist.aAll, pPh->doclist.nAll, + bDescDoclist, pPh->doclist.aAll, pPh->doclist.nAll, &pIter, &iDocid, &bEof ); } @@ -150818,7 +150818,7 @@ SQLITE_PRIVATE int sqlite3Fts3EvalPhrasePoslist( while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)>0 ) && bEof==0 ){ int dummy; sqlite3Fts3DoclistPrev( - bDescDoclist, pPh->doclist.aAll, pPh->doclist.nAll, + bDescDoclist, pPh->doclist.aAll, pPh->doclist.nAll, &pIter, &iDocid, &dummy, &bEof ); } @@ -150894,7 +150894,7 @@ SQLITE_PRIVATE int sqlite3Fts3Corrupt(){ __declspec(dllexport) #endif SQLITE_API int sqlite3_fts3_init( - sqlite3 *db, + sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ @@ -150988,11 +150988,11 @@ static int fts3auxConnectMethod( */ if( argc!=4 && argc!=5 ) goto bad_args; - zDb = argv[1]; + zDb = argv[1]; nDb = (int)strlen(zDb); if( argc==5 ){ if( nDb==4 && 0==sqlite3_strnicmp("temp", zDb, 4) ){ - zDb = argv[3]; + zDb = argv[3]; nDb = (int)strlen(zDb); zFts3 = argv[4]; }else{ @@ -151056,7 +151056,7 @@ static int fts3auxDisconnectMethod(sqlite3_vtab *pVtab){ ** xBestIndex - Analyze a WHERE and ORDER BY clause. */ static int fts3auxBestIndexMethod( - sqlite3_vtab *pVTab, + sqlite3_vtab *pVTab, sqlite3_index_info *pInfo ){ int i; @@ -151069,14 +151069,14 @@ static int fts3auxBestIndexMethod( UNUSED_PARAMETER(pVTab); /* This vtab delivers always results in "ORDER BY term ASC" order. */ - if( pInfo->nOrderBy==1 - && pInfo->aOrderBy[0].iColumn==0 + if( pInfo->nOrderBy==1 + && pInfo->aOrderBy[0].iColumn==0 && pInfo->aOrderBy[0].desc==0 ){ pInfo->orderByConsumed = 1; } - /* Search for equality and range constraints on the "term" column. + /* Search for equality and range constraints on the "term" column. ** And equality constraints on the hidden "languageid" column. */ for(i=0; inConstraint; i++){ if( pInfo->aConstraint[i].usable ){ @@ -151157,11 +151157,11 @@ static int fts3auxCloseMethod(sqlite3_vtab_cursor *pCursor){ static int fts3auxGrowStatArray(Fts3auxCursor *pCsr, int nSize){ if( nSize>pCsr->nStat ){ struct Fts3auxColstats *aNew; - aNew = (struct Fts3auxColstats *)sqlite3_realloc(pCsr->aStat, + aNew = (struct Fts3auxColstats *)sqlite3_realloc(pCsr->aStat, sizeof(struct Fts3auxColstats) * nSize ); if( aNew==0 ) return SQLITE_NOMEM; - memset(&aNew[pCsr->nStat], 0, + memset(&aNew[pCsr->nStat], 0, sizeof(struct Fts3auxColstats) * (nSize - pCsr->nStat) ); pCsr->aStat = aNew; @@ -151221,8 +151221,8 @@ static int fts3auxNextMethod(sqlite3_vtab_cursor *pCursor){ /* State 1. In this state we are expecting either a 1, indicating ** that the following integer will be a column number, or the - ** start of a position list for column 0. - ** + ** start of a position list for column 0. + ** ** The only difference between state 1 and state 2 is that if the ** integer encountered in state 1 is not 0 or 1, then we need to ** increment the column 0 "nDoc" count for this term. @@ -151335,7 +151335,7 @@ static int fts3auxFilterMethod( pCsr->nStop = sqlite3_value_bytes(apVal[iLe]); if( pCsr->zStop==0 ) return SQLITE_NOMEM; } - + if( iLangid>=0 ){ iLangVal = sqlite3_value_int(apVal[iLangid]); @@ -151473,15 +151473,15 @@ SQLITE_PRIVATE int sqlite3Fts3InitAux(sqlite3 *db){ ****************************************************************************** ** ** This module contains code that implements a parser for fts3 query strings -** (the right-hand argument to the MATCH operator). Because the supported +** (the right-hand argument to the MATCH operator). Because the supported ** syntax is relatively simple, the whole tokenizer/parser system is -** hand-coded. +** hand-coded. */ /* #include "fts3Int.h" */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) /* -** By default, this module parses the legacy syntax that has been +** By default, this module parses the legacy syntax that has been ** traditionally used by fts3. Or, if SQLITE_ENABLE_FTS3_PARENTHESIS ** is defined, then it uses the new syntax. The differences between ** the new and the old syntaxes are: @@ -151490,7 +151490,7 @@ SQLITE_PRIVATE int sqlite3Fts3InitAux(sqlite3 *db){ ** ** b) The new syntax supports the AND and NOT operators. The old does not. ** -** c) The old syntax supports the "-" token qualifier. This is not +** c) The old syntax supports the "-" token qualifier. This is not ** supported by the new syntax (it is replaced by the NOT operator). ** ** d) When using the old syntax, the OR operator has a greater precedence @@ -151499,7 +151499,7 @@ SQLITE_PRIVATE int sqlite3Fts3InitAux(sqlite3 *db){ ** ** If compiled with SQLITE_TEST defined, then this module exports the ** symbol "int sqlite3_fts3_enable_parentheses". Setting this variable -** to zero causes the module to use the old syntax. If it is set to +** to zero causes the module to use the old syntax. If it is set to ** non-zero the new syntax is activated. This is so both syntaxes can ** be tested using a single build of testfixture. ** @@ -151528,7 +151528,7 @@ SQLITE_PRIVATE int sqlite3Fts3InitAux(sqlite3 *db){ #ifdef SQLITE_TEST SQLITE_API int sqlite3_fts3_enable_parentheses = 0; #else -# ifdef SQLITE_ENABLE_FTS3_PARENTHESIS +# ifdef SQLITE_ENABLE_FTS3_PARENTHESIS # define sqlite3_fts3_enable_parentheses 1 # else # define sqlite3_fts3_enable_parentheses 0 @@ -151546,7 +151546,7 @@ SQLITE_API int sqlite3_fts3_enable_parentheses = 0; /* ** isNot: ** This variable is used by function getNextNode(). When getNextNode() is -** called, it sets ParseContext.isNot to true if the 'next node' is a +** called, it sets ParseContext.isNot to true if the 'next node' is a ** FTSQUERY_PHRASE with a unary "-" attached to it. i.e. "mysql" in the ** FTS3 query "sqlite -mysql". Otherwise, ParseContext.isNot is set to ** zero. @@ -151565,7 +151565,7 @@ struct ParseContext { }; /* -** This function is equivalent to the standard isspace() function. +** This function is equivalent to the standard isspace() function. ** ** The standard isspace() can be awkward to use safely, because although it ** is defined to accept an argument of type int, its behavior when passed @@ -151581,7 +151581,7 @@ static int fts3isspace(char c){ /* ** Allocate nByte bytes of memory using sqlite3_malloc(). If successful, -** zero the memory before returning a pointer to it. If unsuccessful, +** zero the memory before returning a pointer to it. If unsuccessful, ** return NULL. */ static void *fts3MallocZero(int nByte){ @@ -151629,7 +151629,7 @@ static int fts3ExprParse(ParseContext *, const char *, int, Fts3Expr **, int *); ** structure of type FTSQUERY_PHRASE containing a phrase consisting of this ** single token and set *ppExpr to point to it. If the end of the buffer is ** reached before a token is found, set *ppExpr to zero. It is the -** responsibility of the caller to eventually deallocate the allocated +** responsibility of the caller to eventually deallocate the allocated ** Fts3Expr structure (if any) by passing it to sqlite3_free(). ** ** Return SQLITE_OK if successful, or SQLITE_NOMEM if a memory allocation @@ -151683,8 +151683,8 @@ static int getNextToken( } while( 1 ){ - if( !sqlite3_fts3_enable_parentheses - && iStart>0 && z[iStart-1]=='-' + if( !sqlite3_fts3_enable_parentheses + && iStart>0 && z[iStart-1]=='-' ){ pParse->isNot = 1; iStart--; @@ -151704,7 +151704,7 @@ static int getNextToken( pModule->xClose(pCursor); } - + *ppExpr = pRet; return rc; } @@ -151726,7 +151726,7 @@ static void *fts3ReallocOrFree(void *pOrig, int nNew){ ** Buffer zInput, length nInput, contains the contents of a quoted string ** that appeared as part of an fts3 query expression. Neither quote character ** is included in the buffer. This function attempts to tokenize the entire -** input buffer and create an Fts3Expr structure of type FTSQUERY_PHRASE +** input buffer and create an Fts3Expr structure of type FTSQUERY_PHRASE ** containing the results. ** ** If successful, SQLITE_OK is returned and *ppExpr set to point at the @@ -151751,7 +151751,7 @@ static int getNextString( int nToken = 0; /* The final Fts3Expr data structure, including the Fts3Phrase, - ** Fts3PhraseToken structures token buffers are all stored as a single + ** Fts3PhraseToken structures token buffers are all stored as a single ** allocation so that the expression can be freed with a single call to ** sqlite3_free(). Setting this up requires a two pass approach. ** @@ -151760,7 +151760,7 @@ static int getNextString( ** to assemble data in two dynamic buffers: ** ** Buffer p: Points to the Fts3Expr structure, followed by the Fts3Phrase - ** structure, followed by the array of Fts3PhraseToken + ** structure, followed by the array of Fts3PhraseToken ** structures. This pass only populates the Fts3PhraseToken array. ** ** Buffer zTemp: Contains copies of all tokens. @@ -151845,7 +151845,7 @@ no_mem: } /* -** The output variable *ppExpr is populated with an allocated Fts3Expr +** The output variable *ppExpr is populated with an allocated Fts3Expr ** structure, or set to 0 if the end of the input buffer is reached. ** ** Returns an SQLite error code. SQLITE_OK if everything works, SQLITE_NOMEM @@ -151881,7 +151881,7 @@ static int getNextNode( pParse->isNot = 0; /* Skip over any whitespace before checking for a keyword, an open or - ** close bracket, or a quoted string. + ** close bracket, or a quoted string. */ while( nInput>0 && fts3isspace(*zInput) ){ nInput--; @@ -151917,10 +151917,10 @@ static int getNextNode( /* At this point this is probably a keyword. But for that to be true, ** the next byte must contain either whitespace, an open or close - ** parenthesis, a quote character, or EOF. + ** parenthesis, a quote character, or EOF. */ cNext = zInput[nKey]; - if( fts3isspace(cNext) + if( fts3isspace(cNext) || cNext=='"' || cNext=='(' || cNext==')' || cNext==0 ){ pRet = (Fts3Expr *)fts3MallocZero(sizeof(Fts3Expr)); @@ -151970,15 +151970,15 @@ static int getNextNode( } } - /* If control flows to this point, this must be a regular token, or + /* If control flows to this point, this must be a regular token, or ** the end of the input. Read a regular token using the sqlite3_tokenizer ** interface. Before doing so, figure out if there is an explicit - ** column specifier for the token. + ** column specifier for the token. ** ** TODO: Strangely, it is not possible to associate a column specifier ** with a quoted phrase, only with a single token. Not sure if this was ** an implementation artifact or an intentional decision when fts3 was - ** first implemented. Whichever it was, this module duplicates the + ** first implemented. Whichever it was, this module duplicates the ** limitation. */ iCol = pParse->iDefaultCol; @@ -151986,8 +151986,8 @@ static int getNextNode( for(ii=0; iinCol; ii++){ const char *zStr = pParse->azCol[ii]; int nStr = (int)strlen(zStr); - if( nInput>nStr && zInput[nStr]==':' - && sqlite3_strnicmp(zStr, zInput, nStr)==0 + if( nInput>nStr && zInput[nStr]==':' + && sqlite3_strnicmp(zStr, zInput, nStr)==0 ){ iCol = ii; iColLen = (int)((zInput - z) + nStr + 1); @@ -152032,7 +152032,7 @@ static int opPrecedence(Fts3Expr *p){ } /* -** Argument ppHead contains a pointer to the current head of a query +** Argument ppHead contains a pointer to the current head of a query ** expression tree being parsed. pPrev is the expression node most recently ** inserted into the tree. This function adds pNew, which is always a binary ** operator node, into the expression tree based on the relative precedence @@ -152062,7 +152062,7 @@ static void insertBinaryOperator( /* ** Parse the fts3 query expression found in buffer z, length n. This function -** returns either when the end of the buffer is reached or an unmatched +** returns either when the end of the buffer is reached or an unmatched ** closing bracket - ')' - is encountered. ** ** If successful, SQLITE_OK is returned, *ppExpr is set to point to the @@ -152094,8 +152094,8 @@ static int fts3ExprParse( if( p ){ int isPhrase; - if( !sqlite3_fts3_enable_parentheses - && p->eType==FTSQUERY_PHRASE && pParse->isNot + if( !sqlite3_fts3_enable_parentheses + && p->eType==FTSQUERY_PHRASE && pParse->isNot ){ /* Create an implicit NOT operator. */ Fts3Expr *pNot = fts3MallocZero(sizeof(Fts3Expr)); @@ -152216,13 +152216,13 @@ exprparse_out: } /* -** Return SQLITE_ERROR if the maximum depth of the expression tree passed +** Return SQLITE_ERROR if the maximum depth of the expression tree passed ** as the only argument is more than nMaxDepth. */ static int fts3ExprCheckDepth(Fts3Expr *p, int nMaxDepth){ int rc = SQLITE_OK; if( p ){ - if( nMaxDepth<0 ){ + if( nMaxDepth<0 ){ rc = SQLITE_TOOBIG; }else{ rc = fts3ExprCheckDepth(p->pLeft, nMaxDepth-1); @@ -152237,12 +152237,12 @@ static int fts3ExprCheckDepth(Fts3Expr *p, int nMaxDepth){ /* ** This function attempts to transform the expression tree at (*pp) to ** an equivalent but more balanced form. The tree is modified in place. -** If successful, SQLITE_OK is returned and (*pp) set to point to the -** new root expression node. +** If successful, SQLITE_OK is returned and (*pp) set to point to the +** new root expression node. ** ** nMaxDepth is the maximum allowable depth of the balanced sub-tree. ** -** Otherwise, if an error occurs, an SQLite error code is returned and +** Otherwise, if an error occurs, an SQLite error code is returned and ** expression (*pp) freed. */ static int fts3ExprBalance(Fts3Expr **pp, int nMaxDepth){ @@ -152357,7 +152357,7 @@ static int fts3ExprBalance(Fts3Expr **pp, int nMaxDepth){ } pRoot = p; }else{ - /* An error occurred. Delete the contents of the apLeaf[] array + /* An error occurred. Delete the contents of the apLeaf[] array ** and pFree list. Everything else is cleaned up by the call to ** sqlite3Fts3ExprFree(pRoot) below. */ Fts3Expr *pDel; @@ -152399,7 +152399,7 @@ static int fts3ExprBalance(Fts3Expr **pp, int nMaxDepth){ } } } - + if( rc!=SQLITE_OK ){ sqlite3Fts3ExprFree(pRoot); pRoot = 0; @@ -152413,9 +152413,9 @@ static int fts3ExprBalance(Fts3Expr **pp, int nMaxDepth){ ** differences: ** ** 1. It does not do expression rebalancing. -** 2. It does not check that the expression does not exceed the +** 2. It does not check that the expression does not exceed the ** maximum allowable depth. -** 3. Even if it fails, *ppExpr may still be set to point to an +** 3. Even if it fails, *ppExpr may still be set to point to an ** expression tree. It should be deleted using sqlite3Fts3ExprFree() ** in this case. */ @@ -152454,7 +152454,7 @@ static int fts3ExprParseUnbalanced( if( rc==SQLITE_OK && sParse.nNest ){ rc = SQLITE_ERROR; } - + return rc; } @@ -152473,7 +152473,7 @@ static int fts3ExprParseUnbalanced( ** The first parameter, pTokenizer, is passed the fts3 tokenizer module to ** use to normalize query tokens while parsing the expression. The azCol[] ** array, which is assumed to contain nCol entries, should contain the names -** of each column in the target fts3 table, in order from left to right. +** of each column in the target fts3 table, in order from left to right. ** Column names must be nul-terminated strings. ** ** The iDefaultCol parameter should be passed the index of the table column @@ -152496,7 +152496,7 @@ SQLITE_PRIVATE int sqlite3Fts3ExprParse( int rc = fts3ExprParseUnbalanced( pTokenizer, iLangid, azCol, bFts4, nCol, iDefaultCol, z, n, ppExpr ); - + /* Rebalance the expression. And check that its depth does not exceed ** SQLITE_FTS3_MAX_EXPR_DEPTH. */ if( rc==SQLITE_OK && *ppExpr ){ @@ -152511,7 +152511,7 @@ SQLITE_PRIVATE int sqlite3Fts3ExprParse( *ppExpr = 0; if( rc==SQLITE_TOOBIG ){ sqlite3Fts3ErrMsg(pzErr, - "FTS expression tree is too large (maximum depth %d)", + "FTS expression tree is too large (maximum depth %d)", SQLITE_FTS3_MAX_EXPR_DEPTH ); rc = SQLITE_ERROR; @@ -152574,8 +152574,8 @@ SQLITE_PRIVATE void sqlite3Fts3ExprFree(Fts3Expr *pDel){ ** Function to query the hash-table of tokenizers (see README.tokenizers). */ static int queryTestTokenizer( - sqlite3 *db, - const char *zName, + sqlite3 *db, + const char *zName, const sqlite3_tokenizer_module **pp ){ int rc; @@ -152601,11 +152601,11 @@ static int queryTestTokenizer( /* ** Return a pointer to a buffer containing a text representation of the ** expression passed as the first argument. The buffer is obtained from -** sqlite3_malloc(). It is the responsibility of the caller to use +** sqlite3_malloc(). It is the responsibility of the caller to use ** sqlite3_free() to release the memory. If an OOM condition is encountered, ** NULL is returned. ** -** If the second argument is not NULL, then its contents are prepended to +** If the second argument is not NULL, then its contents are prepended to ** the returned expression text and then freed using sqlite3_free(). */ static char *exprToString(Fts3Expr *pExpr, char *zBuf){ @@ -152619,7 +152619,7 @@ static char *exprToString(Fts3Expr *pExpr, char *zBuf){ zBuf = sqlite3_mprintf( "%zPHRASE %d 0", zBuf, pPhrase->iColumn); for(i=0; zBuf && inToken; i++){ - zBuf = sqlite3_mprintf("%z %.*s%s", zBuf, + zBuf = sqlite3_mprintf("%z %.*s%s", zBuf, pPhrase->aToken[i].n, pPhrase->aToken[i].z, (pPhrase->aToken[i].isPrefix?"+":"") ); @@ -152652,7 +152652,7 @@ static char *exprToString(Fts3Expr *pExpr, char *zBuf){ } /* -** This is the implementation of a scalar SQL function used to test the +** This is the implementation of a scalar SQL function used to test the ** expression parser. It should be called as follows: ** ** fts3_exprtest(, , , ...); @@ -152683,7 +152683,7 @@ static void fts3ExprTest( sqlite3 *db = sqlite3_context_db_handle(context); if( argc<3 ){ - sqlite3_result_error(context, + sqlite3_result_error(context, "Usage: fts3_exprtest(tokenizer, expr, col1, ...", -1 ); return; @@ -152752,15 +152752,15 @@ exprtest_out: } /* -** Register the query expression parser test function fts3_exprtest() -** with database connection db. +** Register the query expression parser test function fts3_exprtest() +** with database connection db. */ SQLITE_PRIVATE int sqlite3Fts3ExprInitTestInterface(sqlite3* db){ int rc = sqlite3_create_function( db, "fts3_exprtest", -1, SQLITE_UTF8, 0, fts3ExprTest, 0, 0 ); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "fts3_exprtest_rebalance", + rc = sqlite3_create_function(db, "fts3_exprtest_rebalance", -1, SQLITE_UTF8, (void *)1, fts3ExprTest, 0, 0 ); } @@ -152824,8 +152824,8 @@ static void fts3HashFree(void *p){ ** fields of the Hash structure. ** ** "pNew" is a pointer to the hash table that is to be initialized. -** keyClass is one of the constants -** FTS3_HASH_BINARY or FTS3_HASH_STRING. The value of keyClass +** keyClass is one of the constants +** FTS3_HASH_BINARY or FTS3_HASH_STRING. The value of keyClass ** determines what kind of key the hash table will use. "copyKey" is ** true if the hash table should make its own private copy of keys and ** false if it should just use the supplied pointer. @@ -152902,7 +152902,7 @@ static int fts3BinCompare(const void *pKey1, int n1, const void *pKey2, int n2){ /* ** Return a pointer to the appropriate hash function given the key class. ** -** The C syntax in this function definition may be unfamilar to some +** The C syntax in this function definition may be unfamilar to some ** programmers, so we provide the following additional explanation: ** ** The name of the function is "ftsHashFunction". The function takes a @@ -152962,7 +152962,7 @@ static void fts3HashInsertElement( /* Resize the hash table so that it cantains "new_size" buckets. -** "new_size" must be a power of 2. The hash table might fail +** "new_size" must be a power of 2. The hash table might fail ** to resize if sqliteMalloc() fails. ** ** Return non-zero if a memory allocation error occurs. @@ -153007,7 +153007,7 @@ static Fts3HashElem *fts3FindElementByHash( count = pEntry->count; xCompare = ftsCompareFunction(pH->keyClass); while( count-- && elem ){ - if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ + if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ return elem; } elem = elem->next; @@ -153026,7 +153026,7 @@ static void fts3RemoveElementByHash( ){ struct _fts3ht *pEntry; if( elem->prev ){ - elem->prev->next = elem->next; + elem->prev->next = elem->next; }else{ pH->first = elem->next; } @@ -153054,8 +153054,8 @@ static void fts3RemoveElementByHash( } SQLITE_PRIVATE Fts3HashElem *sqlite3Fts3HashFindElem( - const Fts3Hash *pH, - const void *pKey, + const Fts3Hash *pH, + const void *pKey, int nKey ){ int h; /* A hash on key */ @@ -153069,7 +153069,7 @@ SQLITE_PRIVATE Fts3HashElem *sqlite3Fts3HashFindElem( return fts3FindElementByHash(pH,pKey,nKey, h & (pH->htsize-1)); } -/* +/* ** Attempt to locate an element of the hash table pH with a key ** that matches pKey,nKey. Return the data for this element if it is ** found, or NULL if there is no match. @@ -153243,7 +153243,7 @@ static int porterDestroy(sqlite3_tokenizer *pTokenizer){ /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is zInput[0..nInput-1]. A cursor -** used to incrementally tokenize this string is returned in +** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int porterOpen( @@ -153296,7 +153296,7 @@ static const char cType[] = { /* ** isConsonant() and isVowel() determine if their first character in ** the string they point to is a consonant or a vowel, according -** to Porter ruls. +** to Porter ruls. ** ** A consonate is any letter other than 'a', 'e', 'i', 'o', or 'u'. ** 'Y' is a consonant unless it follows another consonant, @@ -153416,11 +153416,11 @@ static int star_oh(const char *z){ /* ** If the word ends with zFrom and xCond() is true for the stem -** of the word that preceeds the zFrom ending, then change the +** of the word that preceeds the zFrom ending, then change the ** ending to zTo. ** ** The input word *pz and zFrom are both in reverse order. zTo -** is in normal order. +** is in normal order. ** ** Return TRUE if zFrom matches. Return FALSE if zFrom does not ** match. Not that TRUE is returned even if xCond() fails and @@ -153489,9 +153489,9 @@ static void copy_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ ** word contains digits, 3 bytes are taken from the beginning and ** 3 bytes from the end. For long words without digits, 10 bytes ** are taken from each end. US-ASCII case folding still applies. -** -** If the input word contains not digits but does characters not -** in [a-zA-Z] then no stemming is attempted and this routine just +** +** If the input word contains not digits but does characters not +** in [a-zA-Z] then no stemming is attempted and this routine just ** copies the input into the input into the output with US-ASCII ** case folding. ** @@ -153536,11 +153536,11 @@ static void porter_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ } } - /* Step 1b */ + /* Step 1b */ z2 = z; if( stem(&z, "dee", "ee", m_gt_0) ){ /* Do nothing. The work was all in the test */ - }else if( + }else if( (stem(&z, "gni", "", hasVowel) || stem(&z, "de", "", hasVowel)) && z!=z2 ){ @@ -153579,7 +153579,7 @@ static void porter_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ stem(&z, "igol", "log", m_gt_0); break; case 'l': - if( !stem(&z, "ilb", "ble", m_gt_0) + if( !stem(&z, "ilb", "ble", m_gt_0) && !stem(&z, "illa", "al", m_gt_0) && !stem(&z, "iltne", "ent", m_gt_0) && !stem(&z, "ile", "e", m_gt_0) @@ -153867,7 +153867,7 @@ static int fts3TokenizerEnabled(sqlite3_context *context){ } /* -** Implementation of the SQL scalar function for accessing the underlying +** Implementation of the SQL scalar function for accessing the underlying ** hash table. This function may be called as follows: ** ** SELECT (); @@ -154037,7 +154037,7 @@ SQLITE_PRIVATE int sqlite3Fts3InitTokenizer( if( rc!=SQLITE_OK ){ sqlite3Fts3ErrMsg(pzErr, "unknown tokenizer"); }else{ - (*ppTok)->pModule = m; + (*ppTok)->pModule = m; } sqlite3_free((void *)aArg); } @@ -154057,7 +154057,7 @@ SQLITE_PRIVATE int sqlite3Fts3InitTokenizer( /* #include */ /* -** Implementation of a special SQL scalar function for testing tokenizers +** Implementation of a special SQL scalar function for testing tokenizers ** designed to be used in concert with the Tcl testing framework. This ** function must be called with two or more arguments: ** @@ -154069,9 +154069,9 @@ SQLITE_PRIVATE int sqlite3Fts3InitTokenizer( ** ** The return value is a string that may be interpreted as a Tcl ** list. For each token in the , three elements are -** added to the returned list. The first is the token position, the +** added to the returned list. The first is the token position, the ** second is the token text (folded, stemmed, etc.) and the third is the -** substring of associated with the token. For example, +** substring of associated with the token. For example, ** using the built-in "simple" tokenizer: ** ** SELECT fts_tokenizer_test('simple', 'I don't see how'); @@ -154079,7 +154079,7 @@ SQLITE_PRIVATE int sqlite3Fts3InitTokenizer( ** will return the string: ** ** "{0 i I 1 dont don't 2 see see 3 how how}" -** +** */ static void testFunc( sqlite3_context *context, @@ -154174,8 +154174,8 @@ finish: static int registerTokenizer( - sqlite3 *db, - char *zName, + sqlite3 *db, + char *zName, const sqlite3_tokenizer_module *p ){ int rc; @@ -154197,8 +154197,8 @@ int registerTokenizer( static int queryTokenizer( - sqlite3 *db, - char *zName, + sqlite3 *db, + char *zName, const sqlite3_tokenizer_module **pp ){ int rc; @@ -154281,23 +154281,23 @@ static void intTestFunc( /* ** Set up SQL objects in database db used to access the contents of ** the hash table pointed to by argument pHash. The hash table must -** been initialized to use string keys, and to take a private copy +** been initialized to use string keys, and to take a private copy ** of the key when a value is inserted. i.e. by a call similar to: ** ** sqlite3Fts3HashInit(pHash, FTS3_HASH_STRING, 1); ** ** This function adds a scalar function (see header comment above ** fts3TokenizerFunc() in this file for details) and, if ENABLE_TABLE is -** defined at compilation time, a temporary virtual table (see header -** comment above struct HashTableVtab) to the database schema. Both +** defined at compilation time, a temporary virtual table (see header +** comment above struct HashTableVtab) to the database schema. Both ** provide read/write access to the contents of *pHash. ** ** The third argument to this function, zName, is used as the name ** of both the scalar and, if created, the virtual table. */ SQLITE_PRIVATE int sqlite3Fts3InitHashTable( - sqlite3 *db, - Fts3Hash *pHash, + sqlite3 *db, + Fts3Hash *pHash, const char *zName ){ int rc = SQLITE_OK; @@ -154451,7 +154451,7 @@ static int simpleDestroy(sqlite3_tokenizer *pTokenizer){ /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is pInput[0..nBytes-1]. A cursor -** used to incrementally tokenize this string is returned in +** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int simpleOpen( @@ -154606,8 +154606,8 @@ SQLITE_PRIVATE void sqlite3Fts3SimpleTokenizerModule( ** ** input = ** -** The virtual table module tokenizes this , using the FTS3 -** tokenizer specified by the arguments to the CREATE VIRTUAL TABLE +** The virtual table module tokenizes this , using the FTS3 +** tokenizer specified by the arguments to the CREATE VIRTUAL TABLE ** statement and returns one row for each token in the result. With ** fields set as follows: ** @@ -154676,7 +154676,7 @@ static int fts3tokQueryTokenizer( /* ** The second argument, argv[], is an array of pointers to nul-terminated -** strings. This function makes a copy of the array and strings into a +** strings. This function makes a copy of the array and strings into a ** single block of memory. It then dequotes any of the strings that appear ** to be quoted. ** @@ -154732,7 +154732,7 @@ static int fts3tokDequoteArray( ** and xCreate are identical operations. ** ** argv[0]: module name -** argv[1]: database name +** argv[1]: database name ** argv[2]: table name ** argv[3]: first argument (tokenizer name) */ @@ -154812,16 +154812,16 @@ static int fts3tokDisconnectMethod(sqlite3_vtab *pVtab){ ** xBestIndex - Analyze a WHERE and ORDER BY clause. */ static int fts3tokBestIndexMethod( - sqlite3_vtab *pVTab, + sqlite3_vtab *pVTab, sqlite3_index_info *pInfo ){ int i; UNUSED_PARAMETER(pVTab); for(i=0; inConstraint; i++){ - if( pInfo->aConstraint[i].usable - && pInfo->aConstraint[i].iColumn==0 - && pInfo->aConstraint[i].op==SQLITE_INDEX_CONSTRAINT_EQ + if( pInfo->aConstraint[i].usable + && pInfo->aConstraint[i].iColumn==0 + && pInfo->aConstraint[i].op==SQLITE_INDEX_CONSTRAINT_EQ ){ pInfo->idxNum = 1; pInfo->aConstraintUsage[i].argvIndex = 1; @@ -155051,7 +155051,7 @@ SQLITE_PRIVATE int sqlite3Fts3InitTok(sqlite3 *db, Fts3Hash *pHash){ ** This file is part of the SQLite FTS3 extension module. Specifically, ** this file contains code to insert, update and delete rows from FTS3 ** tables. It also contains code to merge FTS3 b-tree segments. Some -** of the sub-routines used to merge segments are also used by the query +** of the sub-routines used to merge segments are also used by the query ** code in fts3.c. */ @@ -155067,7 +155067,7 @@ SQLITE_PRIVATE int sqlite3Fts3InitTok(sqlite3 *db, Fts3Hash *pHash){ /* ** When full-text index nodes are loaded from disk, the buffer that they -** are loaded into has the following number of bytes of padding at the end +** are loaded into has the following number of bytes of padding at the end ** of it. i.e. if a full-text index node is 900 bytes in size, then a buffer ** of 920 bytes is allocated for it. ** @@ -155084,10 +155084,10 @@ SQLITE_PRIVATE int sqlite3Fts3InitTok(sqlite3 *db, Fts3Hash *pHash){ ** method before retrieving all query results (as may happen, for example, ** if a query has a LIMIT clause). ** -** Incremental loading is used for b-tree nodes FTS3_NODE_CHUNK_THRESHOLD +** Incremental loading is used for b-tree nodes FTS3_NODE_CHUNK_THRESHOLD ** bytes and larger. Nodes are loaded in chunks of FTS3_NODE_CHUNKSIZE bytes. -** The code is written so that the hard lower-limit for each of these values -** is 1. Clearly such small values would be inefficient, but can be useful +** The code is written so that the hard lower-limit for each of these values +** is 1. Clearly such small values would be inefficient, but can be useful ** for testing purposes. ** ** If this module is built with SQLITE_TEST defined, these constants may @@ -155100,7 +155100,7 @@ int test_fts3_node_chunk_threshold = (4*1024)*4; # define FTS3_NODE_CHUNKSIZE test_fts3_node_chunksize # define FTS3_NODE_CHUNK_THRESHOLD test_fts3_node_chunk_threshold #else -# define FTS3_NODE_CHUNKSIZE (4*1024) +# define FTS3_NODE_CHUNKSIZE (4*1024) # define FTS3_NODE_CHUNK_THRESHOLD (FTS3_NODE_CHUNKSIZE*4) #endif @@ -155114,7 +155114,7 @@ int test_fts3_node_chunk_threshold = (4*1024)*4; /* ** If FTS_LOG_MERGES is defined, call sqlite3_log() to report each automatic -** and incremental merge operation that takes place. This is used for +** and incremental merge operation that takes place. This is used for ** debugging FTS only, it should not usually be turned on in production ** systems. */ @@ -155200,7 +155200,7 @@ struct Fts3SegReader { char *aDoclist; /* Pointer to doclist of current entry */ int nDoclist; /* Size of doclist in current entry */ - /* The following variables are used by fts3SegReaderNextDocid() to iterate + /* The following variables are used by fts3SegReaderNextDocid() to iterate ** through the current doclist (aDoclist/nDoclist). */ char *pOffsetList; @@ -155245,11 +155245,11 @@ struct SegmentWriter { ** fts3NodeFree() ** ** When a b+tree is written to the database (either as a result of a merge -** or the pending-terms table being flushed), leaves are written into the +** or the pending-terms table being flushed), leaves are written into the ** database file as soon as they are completely populated. The interior of ** the tree is assembled in memory and written out only once all leaves have ** been populated and stored. This is Ok, as the b+-tree fanout is usually -** very large, meaning that the interior of the tree consumes relatively +** very large, meaning that the interior of the tree consumes relatively ** little memory. */ struct SegmentNode { @@ -155270,7 +155270,7 @@ struct SegmentNode { */ #define SQL_DELETE_CONTENT 0 #define SQL_IS_EMPTY 1 -#define SQL_DELETE_ALL_CONTENT 2 +#define SQL_DELETE_ALL_CONTENT 2 #define SQL_DELETE_ALL_SEGMENTS 3 #define SQL_DELETE_ALL_SEGDIR 4 #define SQL_DELETE_ALL_DOCSIZE 5 @@ -155318,7 +155318,7 @@ struct SegmentNode { ** Otherwise, an SQLite error code is returned and *pp is set to 0. ** ** If argument apVal is not NULL, then it must point to an array with -** at least as many entries as the requested statement has bound +** at least as many entries as the requested statement has bound ** parameters. The values are bound to the statements parameters before ** returning. */ @@ -155342,7 +155342,7 @@ static int fts3SqlStmt( /* 10 */ "SELECT coalesce((SELECT max(blockid) FROM %Q.'%q_segments') + 1, 1)", /* 11 */ "REPLACE INTO %Q.'%q_segdir' VALUES(?,?,?,?,?,?)", - /* Return segments in order from oldest to newest.*/ + /* Return segments in order from oldest to newest.*/ /* 12 */ "SELECT idx, start_block, leaves_end_block, end_block, root " "FROM %Q.'%q_segdir' WHERE level = ? ORDER BY idx ASC", /* 13 */ "SELECT idx, start_block, leaves_end_block, end_block, root " @@ -155376,7 +155376,7 @@ static int fts3SqlStmt( " ORDER BY (level %% 1024) ASC LIMIT 1", /* Estimate the upper limit on the number of leaf nodes in a new segment -** created by merging the oldest :2 segments from absolute level :1. See +** created by merging the oldest :2 segments from absolute level :1. See ** function sqlite3Fts3Incrmerge() for details. */ /* 29 */ "SELECT 2 * total(1 + leaves_end_block - start_block) " " FROM %Q.'%q_segdir' WHERE level = ? AND idx < ?", @@ -155391,7 +155391,7 @@ static int fts3SqlStmt( /* 31 */ "UPDATE %Q.'%q_segdir' SET idx = ? WHERE level=? AND idx=?", /* SQL_SELECT_SEGDIR -** Read a single entry from the %_segdir table. The entry from absolute +** Read a single entry from the %_segdir table. The entry from absolute ** level :1 with index value :2. */ /* 32 */ "SELECT idx, start_block, leaves_end_block, end_block, root " "FROM %Q.'%q_segdir' WHERE level = ? AND idx = ?", @@ -155415,7 +155415,7 @@ static int fts3SqlStmt( ** Return the largest relative level in the FTS index or indexes. */ /* 36 */ "SELECT max( level %% 1024 ) FROM %Q.'%q_segdir'", - /* Return segments in order from oldest to newest.*/ + /* Return segments in order from oldest to newest.*/ /* 37 */ "SELECT level, idx, end_block " "FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ? " "ORDER BY level DESC, idx ASC", @@ -155431,7 +155431,7 @@ static int fts3SqlStmt( assert( SizeofArray(azSql)==SizeofArray(p->aStmt) ); assert( eStmt=0 ); - + pStmt = p->aStmt[eStmt]; if( !pStmt ){ char *zSql; @@ -155534,7 +155534,7 @@ static void fts3SqlExec( sqlite3_stmt *pStmt; int rc; if( *pRC ) return; - rc = fts3SqlStmt(p, eStmt, &pStmt, apVal); + rc = fts3SqlStmt(p, eStmt, &pStmt, apVal); if( rc==SQLITE_OK ){ sqlite3_step(pStmt); rc = sqlite3_reset(pStmt); @@ -155544,22 +155544,22 @@ static void fts3SqlExec( /* -** This function ensures that the caller has obtained an exclusive -** shared-cache table-lock on the %_segdir table. This is required before +** This function ensures that the caller has obtained an exclusive +** shared-cache table-lock on the %_segdir table. This is required before ** writing data to the fts3 table. If this lock is not acquired first, then ** the caller may end up attempting to take this lock as part of committing -** a transaction, causing SQLite to return SQLITE_LOCKED or +** a transaction, causing SQLite to return SQLITE_LOCKED or ** LOCKED_SHAREDCACHEto a COMMIT command. ** -** It is best to avoid this because if FTS3 returns any error when -** committing a transaction, the whole transaction will be rolled back. -** And this is not what users expect when they get SQLITE_LOCKED_SHAREDCACHE. -** It can still happen if the user locks the underlying tables directly +** It is best to avoid this because if FTS3 returns any error when +** committing a transaction, the whole transaction will be rolled back. +** And this is not what users expect when they get SQLITE_LOCKED_SHAREDCACHE. +** It can still happen if the user locks the underlying tables directly ** instead of accessing them via FTS. */ static int fts3Writelock(Fts3Table *p){ int rc = SQLITE_OK; - + if( p->nPendingData==0 ){ sqlite3_stmt *pStmt; rc = fts3SqlStmt(p, SQL_DELETE_SEGDIR_LEVEL, &pStmt, 0); @@ -155576,7 +155576,7 @@ static int fts3Writelock(Fts3Table *p){ /* ** FTS maintains a separate indexes for each language-id (a 32-bit integer). ** Within each language id, a separate index is maintained to store the -** document terms, and each configured prefix size (configured the FTS +** document terms, and each configured prefix size (configured the FTS ** "prefix=" option). And each index consists of multiple levels ("relative ** levels"). ** @@ -155586,14 +155586,14 @@ static int fts3Writelock(Fts3Table *p){ ** separate component values into the single 64-bit integer value that ** can be used to query the %_segdir table. ** -** Specifically, each language-id/index combination is allocated 1024 +** Specifically, each language-id/index combination is allocated 1024 ** 64-bit integer level values ("absolute levels"). The main terms index ** for language-id 0 is allocate values 0-1023. The first prefix index ** (if any) for language-id 0 is allocated values 1024-2047. And so on. ** Language 1 indexes are allocated immediately following language 0. ** ** So, for a system with nPrefix prefix indexes configured, the block of -** absolute levels that corresponds to language-id iLangid and index +** absolute levels that corresponds to language-id iLangid and index ** iIndex starts at absolute level ((iLangid * (nPrefix+1) + iIndex) * 1024). */ static sqlite3_int64 getAbsoluteLevel( @@ -155614,7 +155614,7 @@ static sqlite3_int64 getAbsoluteLevel( /* ** Set *ppStmt to a statement handle that may be used to iterate through ** all rows in the %_segdir table, from oldest to newest. If successful, -** return SQLITE_OK. If an error occurs while preparing the statement, +** return SQLITE_OK. If an error occurs while preparing the statement, ** return an SQLite error code. ** ** There is only ever one instance of this SQL statement compiled for @@ -155645,16 +155645,16 @@ SQLITE_PRIVATE int sqlite3Fts3AllSegdirs( if( iLevel<0 ){ /* "SELECT * FROM %_segdir WHERE level BETWEEN ? AND ? ORDER BY ..." */ rc = fts3SqlStmt(p, SQL_SELECT_LEVEL_RANGE, &pStmt, 0); - if( rc==SQLITE_OK ){ + if( rc==SQLITE_OK ){ sqlite3_bind_int64(pStmt, 1, getAbsoluteLevel(p, iLangid, iIndex, 0)); - sqlite3_bind_int64(pStmt, 2, + sqlite3_bind_int64(pStmt, 2, getAbsoluteLevel(p, iLangid, iIndex, FTS3_SEGDIR_MAXLEVEL-1) ); } }else{ /* "SELECT * FROM %_segdir WHERE level = ? ORDER BY ..." */ rc = fts3SqlStmt(p, SQL_SELECT_LEVEL, &pStmt, 0); - if( rc==SQLITE_OK ){ + if( rc==SQLITE_OK ){ sqlite3_bind_int64(pStmt, 1, getAbsoluteLevel(p, iLangid, iIndex,iLevel)); } } @@ -155798,7 +155798,7 @@ static int fts3PendingTermsAddOne( } if( fts3PendingListAppend(&pList, p->iPrevDocid, iCol, iPos, &rc) ){ if( pList==fts3HashInsert(pHash, zToken, nToken, pList) ){ - /* Malloc failed while inserting the new entry. This can only + /* Malloc failed while inserting the new entry. This can only ** happen if there was no previous entry for this token. */ assert( 0==fts3HashFind(pHash, zToken, nToken) ); @@ -155844,7 +155844,7 @@ static int fts3PendingTermsAdd( assert( pTokenizer && pModule ); /* If the user has inserted a NULL value, this function may be called with - ** zText==0. In this case, add zero token entries to the hash table and + ** zText==0. In this case, add zero token entries to the hash table and ** return early. */ if( zText==0 ){ *pnWord = 0; @@ -155875,8 +155875,8 @@ static int fts3PendingTermsAdd( rc = fts3PendingTermsAddOne( p, iCol, iPos, &p->aIndex[0].hPending, zToken, nToken ); - - /* Add the term to each of the prefix indexes that it is not too + + /* Add the term to each of the prefix indexes that it is not too ** short for. */ for(i=1; rc==SQLITE_OK && inIndex; i++){ struct Fts3Index *pIndex = &p->aIndex[i]; @@ -155892,8 +155892,8 @@ static int fts3PendingTermsAdd( return (rc==SQLITE_DONE ? SQLITE_OK : rc); } -/* -** Calling this function indicates that subsequent calls to +/* +** Calling this function indicates that subsequent calls to ** fts3PendingTermsAdd() are to add term/position-list pairs for the ** contents of the document with docid iDocid. */ @@ -155912,10 +155912,10 @@ static int fts3PendingTermsDocid( ** buffer was half empty, that would let the less frequent terms ** generate longer doclists. */ - if( iDocidiPrevDocid + if( iDocidiPrevDocid || (iDocid==p->iPrevDocid && p->bPrevDelete==0) || p->iPrevLangid!=iLangid - || p->nPendingData>p->nMaxPendingData + || p->nPendingData>p->nMaxPendingData ){ int rc = sqlite3Fts3PendingTermsFlush(p); if( rc!=SQLITE_OK ) return rc; @@ -155927,7 +155927,7 @@ static int fts3PendingTermsDocid( } /* -** Discard the contents of the pending-terms hash tables. +** Discard the contents of the pending-terms hash tables. */ SQLITE_PRIVATE void sqlite3Fts3PendingTermsClear(Fts3Table *p){ int i; @@ -155952,9 +155952,9 @@ SQLITE_PRIVATE void sqlite3Fts3PendingTermsClear(Fts3Table *p){ ** fts3InsertData(). Parameter iDocid is the docid of the new row. */ static int fts3InsertTerms( - Fts3Table *p, - int iLangid, - sqlite3_value **apVal, + Fts3Table *p, + int iLangid, + sqlite3_value **apVal, u32 *aSz ){ int i; /* Iterator variable */ @@ -156017,7 +156017,7 @@ static int fts3InsertData( rc = fts3SqlStmt(p, SQL_CONTENT_INSERT, &pContentInsert, &apVal[1]); if( rc==SQLITE_OK && p->zLanguageid ){ rc = sqlite3_bind_int( - pContentInsert, p->nColumn+2, + pContentInsert, p->nColumn+2, sqlite3_value_int(apVal[p->nColumn+4]) ); } @@ -156044,8 +156044,8 @@ static int fts3InsertData( if( rc!=SQLITE_OK ) return rc; } - /* Execute the statement to insert the record. Set *piDocid to the - ** new docid value. + /* Execute the statement to insert the record. Set *piDocid to the + ** new docid value. */ sqlite3_step(pContentInsert); rc = sqlite3_reset(pContentInsert); @@ -156095,7 +156095,7 @@ static int langidFromSelect(Fts3Table *p, sqlite3_stmt *pSelect){ ** (an integer) of a row about to be deleted. Remove all terms from the ** full-text index. */ -static void fts3DeleteTerms( +static void fts3DeleteTerms( int *pRC, /* Result code */ Fts3Table *p, /* The FTS table to delete from */ sqlite3_value *pRowid, /* The docid to be deleted */ @@ -156142,7 +156142,7 @@ static void fts3DeleteTerms( */ static int fts3SegmentMerge(Fts3Table *, int, int, int); -/* +/* ** This function allocates a new level iLevel index in the segdir table. ** Usually, indexes are allocated within a level sequentially starting ** with 0, so the allocated index is one greater than the value returned @@ -156151,17 +156151,17 @@ static int fts3SegmentMerge(Fts3Table *, int, int, int); ** SELECT max(idx) FROM %_segdir WHERE level = :iLevel ** ** However, if there are already FTS3_MERGE_COUNT indexes at the requested -** level, they are merged into a single level (iLevel+1) segment and the +** level, they are merged into a single level (iLevel+1) segment and the ** allocated index is 0. ** ** If successful, *piIdx is set to the allocated index slot and SQLITE_OK ** returned. Otherwise, an SQLite error code is returned. */ static int fts3AllocateSegdirIdx( - Fts3Table *p, + Fts3Table *p, int iLangid, /* Language id */ int iIndex, /* Index for p->aIndex */ - int iLevel, + int iLevel, int *piIdx ){ int rc; /* Return Code */ @@ -156209,7 +156209,7 @@ static int fts3AllocateSegdirIdx( ** This function reads data from a single row of the %_segments table. The ** specific row is identified by the iBlockid parameter. If paBlob is not ** NULL, then a buffer is allocated using sqlite3_malloc() and populated -** with the contents of the blob stored in the "block" column of the +** with the contents of the blob stored in the "block" column of the ** identified table row is. Whether or not paBlob is NULL, *pnBlob is set ** to the size of the blob in bytes before returning. ** @@ -156286,14 +156286,14 @@ SQLITE_PRIVATE void sqlite3Fts3SegmentsClose(Fts3Table *p){ sqlite3_blob_close(p->pSegments); p->pSegments = 0; } - + static int fts3SegReaderIncrRead(Fts3SegReader *pReader){ int nRead; /* Number of bytes to read */ int rc; /* Return code */ nRead = MIN(pReader->nNode - pReader->nPopulate, FTS3_NODE_CHUNKSIZE); rc = sqlite3_blob_read( - pReader->pBlob, + pReader->pBlob, &pReader->aNode[pReader->nPopulate], nRead, pReader->nPopulate @@ -156313,10 +156313,10 @@ static int fts3SegReaderIncrRead(Fts3SegReader *pReader){ static int fts3SegReaderRequire(Fts3SegReader *pReader, char *pFrom, int nByte){ int rc = SQLITE_OK; - assert( !pReader->pBlob + assert( !pReader->pBlob || (pFrom>=pReader->aNode && pFrom<&pReader->aNode[pReader->nNode]) ); - while( pReader->pBlob && rc==SQLITE_OK + while( pReader->pBlob && rc==SQLITE_OK && (pFrom - pReader->aNode + nByte)>pReader->nPopulate ){ rc = fts3SegReaderIncrRead(pReader); @@ -156342,7 +156342,7 @@ static void fts3SegReaderSetEof(Fts3SegReader *pSeg){ ** SQLITE_DONE. Otherwise, an SQLite error code. */ static int fts3SegReaderNext( - Fts3Table *p, + Fts3Table *p, Fts3SegReader *pReader, int bIncr ){ @@ -156382,7 +156382,7 @@ static int fts3SegReaderNext( fts3SegReaderSetEof(pReader); - /* If iCurrentBlock>=iLeafEndBlock, this is an EOF condition. All leaf + /* If iCurrentBlock>=iLeafEndBlock, this is an EOF condition. All leaf ** blocks have already been traversed. */ assert( pReader->iCurrentBlock<=pReader->iLeafEndBlock ); if( pReader->iCurrentBlock>=pReader->iLeafEndBlock ){ @@ -156390,7 +156390,7 @@ static int fts3SegReaderNext( } rc = sqlite3Fts3ReadBlock( - p, ++pReader->iCurrentBlock, &pReader->aNode, &pReader->nNode, + p, ++pReader->iCurrentBlock, &pReader->aNode, &pReader->nNode, (bIncr ? &pReader->nPopulate : 0) ); if( rc!=SQLITE_OK ) return rc; @@ -156406,13 +156406,13 @@ static int fts3SegReaderNext( rc = fts3SegReaderRequire(pReader, pNext, FTS3_VARINT_MAX*2); if( rc!=SQLITE_OK ) return rc; - - /* Because of the FTS3_NODE_PADDING bytes of padding, the following is + + /* Because of the FTS3_NODE_PADDING bytes of padding, the following is ** safe (no risk of overread) even if the node data is corrupted. */ pNext += fts3GetVarint32(pNext, &nPrefix); pNext += fts3GetVarint32(pNext, &nSuffix); - if( nPrefix<0 || nSuffix<=0 - || &pNext[nSuffix]>&pReader->aNode[pReader->nNode] + if( nPrefix<0 || nSuffix<=0 + || &pNext[nSuffix]>&pReader->aNode[pReader->nNode] ){ return FTS_CORRUPT_VTAB; } @@ -156438,10 +156438,10 @@ static int fts3SegReaderNext( pReader->pOffsetList = 0; /* Check that the doclist does not appear to extend past the end of the - ** b-tree node. And that the final byte of the doclist is 0x00. If either + ** b-tree node. And that the final byte of the doclist is 0x00. If either ** of these statements is untrue, then the data structure is corrupt. */ - if( &pReader->aDoclist[pReader->nDoclist]>&pReader->aNode[pReader->nNode] + if( &pReader->aDoclist[pReader->nDoclist]>&pReader->aNode[pReader->nNode] || (pReader->nPopulate==0 && pReader->aDoclist[pReader->nDoclist-1]) ){ return FTS_CORRUPT_VTAB; @@ -156462,7 +156462,7 @@ static int fts3SegReaderFirstDocid(Fts3Table *pTab, Fts3SegReader *pReader){ pReader->iDocid = 0; pReader->nOffsetList = 0; sqlite3Fts3DoclistPrev(0, - pReader->aDoclist, pReader->nDoclist, &pReader->pOffsetList, + pReader->aDoclist, pReader->nDoclist, &pReader->pOffsetList, &pReader->iDocid, &pReader->nOffsetList, &bEof ); }else{ @@ -156478,8 +156478,8 @@ static int fts3SegReaderFirstDocid(Fts3Table *pTab, Fts3SegReader *pReader){ /* ** Advance the SegReader to point to the next docid in the doclist ** associated with the current term. -** -** If arguments ppOffsetList and pnOffsetList are not NULL, then +** +** If arguments ppOffsetList and pnOffsetList are not NULL, then ** *ppOffsetList is set to point to the first column-offset list ** in the doclist entry (i.e. immediately past the docid varint). ** *pnOffsetList is set to the length of the set of column-offset @@ -156522,22 +156522,22 @@ static int fts3SegReaderNextDocid( ** following block advances it to point one byte past the end of ** the same offset list. */ while( 1 ){ - + /* The following line of code (and the "p++" below the while() loop) is - ** normally all that is required to move pointer p to the desired + ** normally all that is required to move pointer p to the desired ** position. The exception is if this node is being loaded from disk ** incrementally and pointer "p" now points to the first byte past ** the populated part of pReader->aNode[]. */ while( *p | c ) c = *p++ & 0x80; assert( *p==0 ); - + if( pReader->pBlob==0 || p<&pReader->aNode[pReader->nPopulate] ) break; rc = fts3SegReaderIncrRead(pReader); if( rc!=SQLITE_OK ) return rc; } p++; - + /* If required, populate the output variables with a pointer to and the ** size of the previous offset-list. */ @@ -156548,7 +156548,7 @@ static int fts3SegReaderNextDocid( /* List may have been edited in place by fts3EvalNearTrim() */ while( pnSegment; ii++){ Fts3SegReader *pReader = pMsr->apSegment[ii]; - if( !fts3SegReaderIsPending(pReader) - && !fts3SegReaderIsRootOnly(pReader) + if( !fts3SegReaderIsPending(pReader) + && !fts3SegReaderIsRootOnly(pReader) ){ sqlite3_int64 jj; for(jj=pReader->iStartBlock; jj<=pReader->iLeafEndBlock; jj++){ @@ -156609,7 +156609,7 @@ SQLITE_PRIVATE int sqlite3Fts3MsrOvfl( } /* -** Free all allocations associated with the iterator passed as the +** Free all allocations associated with the iterator passed as the ** second argument. */ SQLITE_PRIVATE void sqlite3Fts3SegReaderFree(Fts3SegReader *pReader){ @@ -156763,7 +156763,7 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderPending( }else{ /* The query is a simple term lookup that matches at most one term in - ** the index. All that is required is a straight hash-lookup. + ** the index. All that is required is a straight hash-lookup. ** ** Because the stack address of pE may be accessed via the aElem pointer ** below, the "Fts3HashElem *pE" must be declared so that it is valid @@ -156797,7 +156797,7 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderPending( } /* -** Compare the entries pointed to by two Fts3SegReader structures. +** Compare the entries pointed to by two Fts3SegReader structures. ** Comparison is as follows: ** ** 1) EOF is greater than not EOF. @@ -156868,7 +156868,7 @@ static int fts3SegReaderDoclistCmpRev(Fts3SegReader *pLhs, Fts3SegReader *pRhs){ /* ** Compare the term that the Fts3SegReader object passed as the first argument -** points to with the term specified by arguments zTerm and nTerm. +** points to with the term specified by arguments zTerm and nTerm. ** ** If the pSeg iterator is already at EOF, return 0. Otherwise, return ** -ve if the pSeg term is less than zTerm/nTerm, 0 if the two terms are @@ -156929,7 +156929,7 @@ static void fts3SegReaderSort( #endif } -/* +/* ** Insert a record into the %_segments table. */ static int fts3WriteSegment( @@ -156970,7 +156970,7 @@ SQLITE_PRIVATE int sqlite3Fts3MaxLevel(Fts3Table *p, int *pnMax){ return rc; } -/* +/* ** Insert a record into the %_segdir table. */ static int fts3WriteSegdir( @@ -157007,7 +157007,7 @@ static int fts3WriteSegdir( /* ** Return the size of the common prefix (if any) shared by zPrev and -** zNext, in bytes. For example, +** zNext, in bytes. For example, ** ** fts3PrefixCompress("abc", 3, "abcdef", 6) // returns 3 ** fts3PrefixCompress("abX", 3, "abcdef", 6) // returns 2 @@ -157031,7 +157031,7 @@ static int fts3PrefixCompress( */ static int fts3NodeAddTerm( Fts3Table *p, /* Virtual table handle */ - SegmentNode **ppTree, /* IN/OUT: SegmentNode handle */ + SegmentNode **ppTree, /* IN/OUT: SegmentNode handle */ int isCopyTerm, /* True if zTerm/nTerm is transient */ const char *zTerm, /* Pointer to buffer containing term */ int nTerm /* Size of term in bytes */ @@ -157040,7 +157040,7 @@ static int fts3NodeAddTerm( int rc; SegmentNode *pNew; - /* First try to append the term to the current node. Return early if + /* First try to append the term to the current node. Return early if ** this is possible. */ if( pTree ){ @@ -157060,8 +157060,8 @@ static int fts3NodeAddTerm( ** and the static node buffer (p->nNodeSize bytes) is not large ** enough. Use a separately malloced buffer instead This wastes ** p->nNodeSize bytes, but since this scenario only comes about when - ** the database contain two terms that share a prefix of almost 2KB, - ** this is not expected to be a serious problem. + ** the database contain two terms that share a prefix of almost 2KB, + ** this is not expected to be a serious problem. */ assert( pTree->aData==(char *)&pTree[1] ); pTree->aData = (char *)sqlite3_malloc(nReq); @@ -157105,7 +157105,7 @@ static int fts3NodeAddTerm( ** If this is the first node in the tree, the term is added to it. ** ** Otherwise, the term is not added to the new node, it is left empty for - ** now. Instead, the term is inserted into the parent of pTree. If pTree + ** now. Instead, the term is inserted into the parent of pTree. If pTree ** has no parent, one is created here. */ pNew = (SegmentNode *)sqlite3_malloc(sizeof(SegmentNode) + p->nNodeSize); @@ -157130,7 +157130,7 @@ static int fts3NodeAddTerm( pTree->zMalloc = 0; }else{ pNew->pLeftmost = pNew; - rc = fts3NodeAddTerm(p, &pNew, isCopyTerm, zTerm, nTerm); + rc = fts3NodeAddTerm(p, &pNew, isCopyTerm, zTerm, nTerm); } *ppTree = pNew; @@ -157141,8 +157141,8 @@ static int fts3NodeAddTerm( ** Helper function for fts3NodeWrite(). */ static int fts3TreeFinishNode( - SegmentNode *pTree, - int iHeight, + SegmentNode *pTree, + int iHeight, sqlite3_int64 iLeftChild ){ int nStart; @@ -157155,15 +157155,15 @@ static int fts3TreeFinishNode( /* ** Write the buffer for the segment node pTree and all of its peers to the -** database. Then call this function recursively to write the parent of -** pTree and its peers to the database. +** database. Then call this function recursively to write the parent of +** pTree and its peers to the database. ** ** Except, if pTree is a root node, do not write it to the database. Instead, ** set output variables *paRoot and *pnRoot to contain the root node. ** ** If successful, SQLITE_OK is returned and output variable *piLast is ** set to the largest blockid written to the database (or zero if no -** blocks were written to the db). Otherwise, an SQLite error code is +** blocks were written to the db). Otherwise, an SQLite error code is ** returned. */ static int fts3NodeWrite( @@ -157191,7 +157191,7 @@ static int fts3NodeWrite( for(pIter=pTree->pLeftmost; pIter && rc==SQLITE_OK; pIter=pIter->pRight){ int nStart = fts3TreeFinishNode(pIter, iHeight, iNextLeaf); int nWrite = pIter->nData - nStart; - + rc = fts3WriteSegment(p, iNextFree, &pIter->aData[nStart], nWrite); iNextFree++; iNextLeaf += (pIter->nEntry+1); @@ -157237,7 +157237,7 @@ static void fts3NodeFree(SegmentNode *pTree){ */ static int fts3SegWriterAdd( Fts3Table *p, /* Virtual table handle */ - SegmentWriter **ppWriter, /* IN/OUT: SegmentWriter handle */ + SegmentWriter **ppWriter, /* IN/OUT: SegmentWriter handle */ int isCopyTerm, /* True if buffer zTerm must be copied */ const char *zTerm, /* Pointer to buffer containing term */ int nTerm, /* Size of term in bytes */ @@ -157397,12 +157397,12 @@ static int fts3SegWriterFlush( pWriter->iFirst, pWriter->iFree, &iLast, &zRoot, &nRoot); } if( rc==SQLITE_OK ){ - rc = fts3WriteSegdir(p, iLevel, iIdx, + rc = fts3WriteSegdir(p, iLevel, iIdx, pWriter->iFirst, iLastLeaf, iLast, pWriter->nLeafData, zRoot, nRoot); } }else{ /* The entire tree fits on the root node. Write it to the segdir table. */ - rc = fts3WriteSegdir(p, iLevel, iIdx, + rc = fts3WriteSegdir(p, iLevel, iIdx, 0, 0, 0, pWriter->nLeafData, pWriter->aData, pWriter->nData); } p->nLeafAdd++; @@ -157410,7 +157410,7 @@ static int fts3SegWriterFlush( } /* -** Release all memory held by the SegmentWriter object passed as the +** Release all memory held by the SegmentWriter object passed as the ** first argument. */ static void fts3SegWriterFree(SegmentWriter *pWriter){ @@ -157460,9 +157460,9 @@ static int fts3IsEmpty(Fts3Table *p, sqlite3_value *pRowid, int *pisEmpty){ ** Return SQLITE_OK if successful, or an SQLite error code if not. */ static int fts3SegmentMaxLevel( - Fts3Table *p, + Fts3Table *p, int iLangid, - int iIndex, + int iIndex, sqlite3_int64 *pnMax ){ sqlite3_stmt *pStmt; @@ -157478,7 +157478,7 @@ static int fts3SegmentMaxLevel( rc = fts3SqlStmt(p, SQL_SELECT_SEGDIR_MAX_LEVEL, &pStmt, 0); if( rc!=SQLITE_OK ) return rc; sqlite3_bind_int64(pStmt, 1, getAbsoluteLevel(p, iLangid, iIndex, 0)); - sqlite3_bind_int64(pStmt, 2, + sqlite3_bind_int64(pStmt, 2, getAbsoluteLevel(p, iLangid, iIndex, FTS3_SEGDIR_MAXLEVEL-1) ); if( SQLITE_ROW==sqlite3_step(pStmt) ){ @@ -157507,7 +157507,7 @@ static int fts3SegmentIsMaxLevel(Fts3Table *p, i64 iAbsLevel, int *pbMax){ int rc = fts3SqlStmt(p, SQL_SELECT_SEGDIR_MAX_LEVEL, &pStmt, 0); if( rc!=SQLITE_OK ) return rc; sqlite3_bind_int64(pStmt, 1, iAbsLevel+1); - sqlite3_bind_int64(pStmt, 2, + sqlite3_bind_int64(pStmt, 2, ((iAbsLevel/FTS3_SEGDIR_MAXLEVEL)+1) * FTS3_SEGDIR_MAXLEVEL ); @@ -157545,9 +157545,9 @@ static int fts3DeleteSegment( ** This function is used after merging multiple segments into a single large ** segment to delete the old, now redundant, segment b-trees. Specifically, ** it: -** -** 1) Deletes all %_segments entries for the segments associated with -** each of the SegReader objects in the array passed as the third +** +** 1) Deletes all %_segments entries for the segments associated with +** each of the SegReader objects in the array passed as the third ** argument, and ** ** 2) deletes all %_segdir entries with level iLevel, or all %_segdir @@ -157579,7 +157579,7 @@ static int fts3DeleteSegdir( rc = fts3SqlStmt(p, SQL_DELETE_SEGDIR_RANGE, &pDelete, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pDelete, 1, getAbsoluteLevel(p, iLangid, iIndex, 0)); - sqlite3_bind_int64(pDelete, 2, + sqlite3_bind_int64(pDelete, 2, getAbsoluteLevel(p, iLangid, iIndex, FTS3_SEGDIR_MAXLEVEL-1) ); } @@ -157601,7 +157601,7 @@ static int fts3DeleteSegdir( } /* -** When this function is called, buffer *ppList (size *pnList bytes) contains +** When this function is called, buffer *ppList (size *pnList bytes) contains ** a position list that may (or may not) feature multiple columns. This ** function adjusts the pointer *ppList and the length *pnList so that they ** identify the subset of the position list that corresponds to column iCol. @@ -157628,7 +157628,7 @@ static void fts3ColumnFilter( while( 1 ){ char c = 0; while( ppOffsetList && apSegment[j]->iDocid==iDocid @@ -157751,7 +157751,7 @@ static int fts3SegReaderStart( int i; int nSeg = pCsr->nSegment; - /* If the Fts3SegFilter defines a specific term (or term prefix) to search + /* If the Fts3SegFilter defines a specific term (or term prefix) to search ** for, then advance each segment iterator until it points to a term of ** equal or greater value than the specified term. This prevents many ** unnecessary merge/sort operations for the case where single segment @@ -157835,7 +157835,7 @@ SQLITE_PRIVATE int sqlite3Fts3MsrIncrStart( ** sqlite3Fts3SegReaderStart() ** sqlite3Fts3SegReaderStep() ** -** then the entire doclist for the term is available in +** then the entire doclist for the term is available in ** MultiSegReader.aDoclist/nDoclist. */ SQLITE_PRIVATE int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr){ @@ -157883,9 +157883,9 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderStep( do { int nMerge; int i; - + /* Advance the first pCsr->nAdvance entries in the apSegment[] array - ** forward. Then sort the list in order of current term again. + ** forward. Then sort the list in order of current term again. */ for(i=0; inAdvance; i++){ Fts3SegReader *pSeg = apSegment[i]; @@ -157907,34 +157907,34 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderStep( pCsr->zTerm = apSegment[0]->zTerm; /* If this is a prefix-search, and if the term that apSegment[0] points - ** to does not share a suffix with pFilter->zTerm/nTerm, then all + ** to does not share a suffix with pFilter->zTerm/nTerm, then all ** required callbacks have been made. In this case exit early. ** ** Similarly, if this is a search for an exact match, and the first term ** of segment apSegment[0] is not a match, exit early. */ if( pFilter->zTerm && !isScan ){ - if( pCsr->nTermnTerm + if( pCsr->nTermnTerm || (!isPrefix && pCsr->nTerm>pFilter->nTerm) - || memcmp(pCsr->zTerm, pFilter->zTerm, pFilter->nTerm) + || memcmp(pCsr->zTerm, pFilter->zTerm, pFilter->nTerm) ){ break; } } nMerge = 1; - while( nMergeaNode - && apSegment[nMerge]->nTerm==pCsr->nTerm + && apSegment[nMerge]->nTerm==pCsr->nTerm && 0==memcmp(pCsr->zTerm, apSegment[nMerge]->zTerm, pCsr->nTerm) ){ nMerge++; } assert( isIgnoreEmpty || (isRequirePos && !isColFilter) ); - if( nMerge==1 - && !isIgnoreEmpty - && !isFirst + if( nMerge==1 + && !isIgnoreEmpty + && !isFirst && (p->bDescIdx==0 || fts3SegReaderIsPending(apSegment[0])==0) ){ pCsr->nDoclist = apSegment[0]->nDoclist; @@ -157979,7 +157979,7 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderStep( if( !isIgnoreEmpty || nList>0 ){ - /* Calculate the 'docid' delta value to write into the merged + /* Calculate the 'docid' delta value to write into the merged ** doclist. */ sqlite3_int64 iDelta; if( p->bDescIdx && nDoclist>0 ){ @@ -158004,7 +158004,7 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderStep( if( isFirst ){ char *a = &pCsr->aBuffer[nDoclist]; int nWrite; - + nWrite = sqlite3Fts3FirstFilter(iDelta, pList, nList, a); if( nWrite ){ iPrev = iDocid; @@ -158054,18 +158054,18 @@ SQLITE_PRIVATE void sqlite3Fts3SegReaderFinish( } /* -** Decode the "end_block" field, selected by column iCol of the SELECT -** statement passed as the first argument. +** Decode the "end_block" field, selected by column iCol of the SELECT +** statement passed as the first argument. ** ** The "end_block" field may contain either an integer, or a text field -** containing the text representation of two non-negative integers separated -** by one or more space (0x20) characters. In the first case, set *piEndBlock -** to the integer value and *pnByte to zero before returning. In the second, +** containing the text representation of two non-negative integers separated +** by one or more space (0x20) characters. In the first case, set *piEndBlock +** to the integer value and *pnByte to zero before returning. In the second, ** set *piEndBlock to the first value and *pnByte to the second. */ static void fts3ReadEndBlockField( - sqlite3_stmt *pStmt, - int iCol, + sqlite3_stmt *pStmt, + int iCol, i64 *piEndBlock, i64 *pnByte ){ @@ -158111,10 +158111,10 @@ static int fts3PromoteSegments( i64 iLast = (iAbsLevel/FTS3_SEGDIR_MAXLEVEL + 1) * FTS3_SEGDIR_MAXLEVEL - 1; i64 nLimit = (nByte*3)/2; - /* Loop through all entries in the %_segdir table corresponding to + /* Loop through all entries in the %_segdir table corresponding to ** segments in this index on levels greater than iAbsLevel. If there is - ** at least one such segment, and it is possible to determine that all - ** such segments are smaller than nLimit bytes in size, they will be + ** at least one such segment, and it is possible to determine that all + ** such segments are smaller than nLimit bytes in size, they will be ** promoted to level iAbsLevel. */ sqlite3_bind_int64(pRange, 1, iAbsLevel+1); sqlite3_bind_int64(pRange, 2, iLast); @@ -158122,7 +158122,7 @@ static int fts3PromoteSegments( i64 nSize = 0, dummy; fts3ReadEndBlockField(pRange, 2, &dummy, &nSize); if( nSize<=0 || nSize>nLimit ){ - /* If nSize==0, then the %_segdir.end_block field does not not + /* If nSize==0, then the %_segdir.end_block field does not not ** contain a size value. This happens if it was written by an ** old version of FTS. In this case it is not possible to determine ** the size of the segment, and so segment promotion does not @@ -158188,18 +158188,18 @@ static int fts3PromoteSegments( } /* -** Merge all level iLevel segments in the database into a single +** Merge all level iLevel segments in the database into a single ** iLevel+1 segment. Or, if iLevel<0, merge all segments into a -** single segment with a level equal to the numerically largest level +** single segment with a level equal to the numerically largest level ** currently present in the database. ** ** If this function is called with iLevel<0, but there is only one -** segment in the database, SQLITE_DONE is returned immediately. -** Otherwise, if successful, SQLITE_OK is returned. If an error occurs, +** segment in the database, SQLITE_DONE is returned immediately. +** Otherwise, if successful, SQLITE_OK is returned. If an error occurs, ** an SQLite error code is returned. */ static int fts3SegmentMerge( - Fts3Table *p, + Fts3Table *p, int iLangid, /* Language id to merge */ int iIndex, /* Index in p->aIndex[] to merge */ int iLevel /* Level to merge */ @@ -158243,7 +158243,7 @@ static int fts3SegmentMerge( }else{ /* This call is to merge all segments at level iLevel. find the next ** available segment index at level iLevel+1. The call to - ** fts3AllocateSegdirIdx() will merge the segments at level iLevel+1 to + ** fts3AllocateSegdirIdx() will merge the segments at level iLevel+1 to ** a single iLevel+2 segment if necessary. */ assert( FTS3_SEGCURSOR_PENDING==-1 ); iNewLevel = getAbsoluteLevel(p, iLangid, iIndex, iLevel+1); @@ -158264,7 +158264,7 @@ static int fts3SegmentMerge( while( SQLITE_OK==rc ){ rc = sqlite3Fts3SegReaderStep(p, &csr); if( rc!=SQLITE_ROW ) break; - rc = fts3SegWriterAdd(p, &pWriter, 1, + rc = fts3SegWriterAdd(p, &pWriter, 1, csr.zTerm, csr.nTerm, csr.aDoclist, csr.nDoclist); } if( rc!=SQLITE_OK ) goto finished; @@ -158292,13 +158292,13 @@ static int fts3SegmentMerge( } -/* -** Flush the contents of pendingTerms to level 0 segments. +/* +** Flush the contents of pendingTerms to level 0 segments. */ SQLITE_PRIVATE int sqlite3Fts3PendingTermsFlush(Fts3Table *p){ int rc = SQLITE_OK; int i; - + for(i=0; rc==SQLITE_OK && inIndex; i++){ rc = fts3SegmentMerge(p, p->iPrevLangid, i, FTS3_SEGCURSOR_PENDING); if( rc==SQLITE_DONE ) rc = SQLITE_OK; @@ -158400,7 +158400,7 @@ static void fts3InsertDocsize( /* ** Record 0 of the %_stat table contains a blob consisting of N varints, ** where N is the number of user defined columns in the fts3 table plus -** two. If nCol is the number of user defined columns, then values of the +** two. If nCol is the number of user defined columns, then values of the ** varints are set as follows: ** ** Varint 0: Total number of rows in the table. @@ -158484,7 +158484,7 @@ static void fts3UpdateDocTotals( } /* -** Merge the entire database so that there is one segment for each +** Merge the entire database so that there is one segment for each ** iIndex/iLangid combination. */ static int fts3DoOptimize(Fts3Table *p, int bReturnDone){ @@ -158523,7 +158523,7 @@ static int fts3DoOptimize(Fts3Table *p, int bReturnDone){ ** ** INSERT INTO () VALUES('rebuild'); ** -** The entire FTS index is discarded and rebuilt. If the table is one +** The entire FTS index is discarded and rebuilt. If the table is one ** created using the content=xxx option, then the new index is based on ** the current contents of the xxx table. Otherwise, it is rebuilt based ** on the contents of the %_content table. @@ -158603,9 +158603,9 @@ static int fts3DoRebuild(Fts3Table *p){ /* -** This function opens a cursor used to read the input data for an +** This function opens a cursor used to read the input data for an ** incremental merge operation. Specifically, it opens a cursor to scan -** the oldest nSeg segments (idx=0 through idx=(nSeg-1)) in absolute +** the oldest nSeg segments (idx=0 through idx=(nSeg-1)) in absolute ** level iAbsLevel. */ static int fts3IncrmergeCsr( @@ -158615,7 +158615,7 @@ static int fts3IncrmergeCsr( Fts3MultiSegReader *pCsr /* Cursor object to populate */ ){ int rc; /* Return Code */ - sqlite3_stmt *pStmt = 0; /* Statement used to read %_segdir entry */ + sqlite3_stmt *pStmt = 0; /* Statement used to read %_segdir entry */ int nByte; /* Bytes allocated at pCsr->apSegment[] */ /* Allocate space for the Fts3MultiSegReader.aCsr[] array */ @@ -158670,7 +158670,7 @@ struct Blob { }; /* -** This structure is used to build up buffers containing segment b-tree +** This structure is used to build up buffers containing segment b-tree ** nodes (blocks). */ struct NodeWriter { @@ -158739,12 +158739,12 @@ static void blobGrowBuffer(Blob *pBlob, int nMin, int *pRc){ /* ** Attempt to advance the node-reader object passed as the first argument to -** the next entry on the node. +** the next entry on the node. ** -** Return an error code if an error occurs (SQLITE_NOMEM is possible). +** Return an error code if an error occurs (SQLITE_NOMEM is possible). ** Otherwise return SQLITE_OK. If there is no next entry on the node ** (e.g. because the current entry is the last) set NodeReader->aNode to -** NULL to indicate EOF. Otherwise, populate the NodeReader structure output +** NULL to indicate EOF. Otherwise, populate the NodeReader structure output ** variables for the new entry. */ static int nodeReaderNext(NodeReader *p){ @@ -158792,7 +158792,7 @@ static void nodeReaderRelease(NodeReader *p){ /* ** Initialize a node-reader object to read the node in buffer aNode/nNode. ** -** If successful, SQLITE_OK is returned and the NodeReader object set to +** If successful, SQLITE_OK is returned and the NodeReader object set to ** point to the first entry on the node (if any). Otherwise, an SQLite ** error code is returned. */ @@ -158841,7 +158841,7 @@ static int fts3IncrmergePush( int nSpace; /* Figure out how much space the key will consume if it is written to - ** the current node of layer iLayer. Due to the prefix compression, + ** the current node of layer iLayer. Due to the prefix compression, ** the space required changes depending on which node the key is to ** be added to. */ nPrefix = fts3PrefixCompress(pNode->key.a, pNode->key.n, zTerm, nTerm); @@ -158849,9 +158849,9 @@ static int fts3IncrmergePush( nSpace = sqlite3Fts3VarintLen(nPrefix); nSpace += sqlite3Fts3VarintLen(nSuffix) + nSuffix; - if( pNode->key.n==0 || (pNode->block.n + nSpace)<=p->nNodeSize ){ + if( pNode->key.n==0 || (pNode->block.n + nSpace)<=p->nNodeSize ){ /* If the current node of layer iLayer contains zero keys, or if adding - ** the key to it will not cause it to grow to larger than nNodeSize + ** the key to it will not cause it to grow to larger than nNodeSize ** bytes in size, write the key here. */ Blob *pBlk = &pNode->block; @@ -158907,12 +158907,12 @@ static int fts3IncrmergePush( ** A node header is a single 0x00 byte for a leaf node, or a height varint ** followed by the left-hand-child varint for an internal node. ** -** The term to be appended is passed via arguments zTerm/nTerm. For a +** The term to be appended is passed via arguments zTerm/nTerm. For a ** leaf node, the doclist is passed as aDoclist/nDoclist. For an internal ** node, both aDoclist and nDoclist must be passed 0. ** ** If the size of the value in blob pPrev is zero, then this is the first -** term written to the node. Otherwise, pPrev contains a copy of the +** term written to the node. Otherwise, pPrev contains a copy of the ** previous term. Before this function returns, it is updated to contain a ** copy of zTerm/nTerm. ** @@ -158929,7 +158929,7 @@ static int fts3AppendToNode( const char *zTerm, /* New term to write */ int nTerm, /* Size of zTerm in bytes */ const char *aDoclist, /* Doclist (or NULL) to write */ - int nDoclist /* Size of aDoclist in bytes */ + int nDoclist /* Size of aDoclist in bytes */ ){ int rc = SQLITE_OK; /* Return code */ int bFirst = (pPrev->n==0); /* True if this is the first term written */ @@ -159003,7 +159003,7 @@ static int fts3IncrmergeAppend( rc = fts3WriteSegment(p, pLeaf->iBlock, pLeaf->block.a, pLeaf->block.n); pWriter->nWork++; - /* Add the current term to the parent node. The term added to the + /* Add the current term to the parent node. The term added to the ** parent must: ** ** a) be greater than the largest term on the leaf node just written @@ -159068,7 +159068,7 @@ static void fts3IncrmergeRelease( NodeWriter *pRoot; /* NodeWriter for root node */ int rc = *pRc; /* Error code */ - /* Set iRoot to the index in pWriter->aNodeWriter[] of the output segment + /* Set iRoot to the index in pWriter->aNodeWriter[] of the output segment ** root node. If the segment fits entirely on a single leaf node, iRoot ** will be set to 0. If the root node is the parent of the leaves, iRoot ** will be 1. And so on. */ @@ -159086,17 +159086,17 @@ static void fts3IncrmergeRelease( /* The entire output segment fits on a single node. Normally, this means ** the node would be stored as a blob in the "root" column of the %_segdir - ** table. However, this is not permitted in this case. The problem is that - ** space has already been reserved in the %_segments table, and so the - ** start_block and end_block fields of the %_segdir table must be populated. - ** And, by design or by accident, released versions of FTS cannot handle + ** table. However, this is not permitted in this case. The problem is that + ** space has already been reserved in the %_segments table, and so the + ** start_block and end_block fields of the %_segdir table must be populated. + ** And, by design or by accident, released versions of FTS cannot handle ** segments that fit entirely on the root node with start_block!=0. ** - ** Instead, create a synthetic root node that contains nothing but a + ** Instead, create a synthetic root node that contains nothing but a ** pointer to the single content node. So that the segment consists of a ** single leaf and a single interior (root) node. ** - ** Todo: Better might be to defer allocating space in the %_segments + ** Todo: Better might be to defer allocating space in the %_segments ** table until we are sure it is needed. */ if( iRoot==0 ){ @@ -159124,7 +159124,7 @@ static void fts3IncrmergeRelease( /* Write the %_segdir record. */ if( rc==SQLITE_OK ){ - rc = fts3WriteSegdir(p, + rc = fts3WriteSegdir(p, pWriter->iAbsLevel+1, /* level */ pWriter->iIdx, /* idx */ pWriter->iStart, /* start_block */ @@ -159163,11 +159163,11 @@ static int fts3TermCmp( /* -** Query to see if the entry in the %_segments table with blockid iEnd is +** Query to see if the entry in the %_segments table with blockid iEnd is ** NULL. If no error occurs and the entry is NULL, set *pbRes 1 before -** returning. Otherwise, set *pbRes to 0. +** returning. Otherwise, set *pbRes to 0. ** -** Or, if an error occurs while querying the database, return an SQLite +** Or, if an error occurs while querying the database, return an SQLite ** error code. The final value of *pbRes is undefined in this case. ** ** This is used to test if a segment is an "appendable" segment. If it @@ -159185,14 +159185,14 @@ static int fts3IsAppendable(Fts3Table *p, sqlite3_int64 iEnd, int *pbRes){ if( SQLITE_ROW==sqlite3_step(pCheck) ) bRes = 1; rc = sqlite3_reset(pCheck); } - + *pbRes = bRes; return rc; } /* ** This function is called when initializing an incremental-merge operation. -** It checks if the existing segment with index value iIdx at absolute level +** It checks if the existing segment with index value iIdx at absolute level ** (iAbsLevel+1) can be appended to by the incremental merge. If it can, the ** merge-writer object *pWriter is initialized to write to it. ** @@ -159201,7 +159201,7 @@ static int fts3IsAppendable(Fts3Table *p, sqlite3_int64 iEnd, int *pbRes){ ** * It was initially created as an appendable segment (with all required ** space pre-allocated), and ** -** * The first key read from the input (arguments zKey and nKey) is +** * The first key read from the input (arguments zKey and nKey) is ** greater than the largest key currently stored in the potential ** output segment. */ @@ -159331,13 +159331,13 @@ static int fts3IncrmergeLoad( /* ** Determine the largest segment index value that exists within absolute ** level iAbsLevel+1. If no error occurs, set *piIdx to this value plus -** one before returning SQLITE_OK. Or, if there are no segments at all +** one before returning SQLITE_OK. Or, if there are no segments at all ** within level iAbsLevel, set *piIdx to zero. ** ** If an error occurs, return an SQLite error code. The final value of ** *piIdx is undefined in this case. */ -static int fts3IncrmergeOutputIdx( +static int fts3IncrmergeOutputIdx( Fts3Table *p, /* FTS Table handle */ sqlite3_int64 iAbsLevel, /* Absolute index of input segments */ int *piIdx /* OUT: Next free index at iAbsLevel+1 */ @@ -159356,7 +159356,7 @@ static int fts3IncrmergeOutputIdx( return rc; } -/* +/* ** Allocate an appendable output segment on absolute level iAbsLevel+1 ** with idx value iIdx. ** @@ -159370,7 +159370,7 @@ static int fts3IncrmergeOutputIdx( ** When an appendable segment is allocated, it is estimated that the ** maximum number of leaf blocks that may be required is the sum of the ** number of leaf blocks consumed by the input segments, plus the number -** of input segments, multiplied by two. This value is stored in stack +** of input segments, multiplied by two. This value is stored in stack ** variable nLeafEst. ** ** A total of 16*nLeafEst blocks are allocated when an appendable segment @@ -159379,10 +159379,10 @@ static int fts3IncrmergeOutputIdx( ** of interior nodes that are parents of the leaf nodes start at block ** (start_block + (1 + end_block - start_block) / 16). And so on. ** -** In the actual code below, the value "16" is replaced with the +** In the actual code below, the value "16" is replaced with the ** pre-processor macro FTS_MAX_APPENDABLE_HEIGHT. */ -static int fts3IncrmergeWriter( +static int fts3IncrmergeWriter( Fts3Table *p, /* Fts3 table handle */ sqlite3_int64 iAbsLevel, /* Absolute level of input segments */ int iIdx, /* Index of new output segment */ @@ -159420,7 +159420,7 @@ static int fts3IncrmergeWriter( if( rc!=SQLITE_OK ) return rc; /* Insert the marker in the %_segments table to make sure nobody tries - ** to steal the space just allocated. This is also used to identify + ** to steal the space just allocated. This is also used to identify ** appendable segments. */ rc = fts3WriteSegment(p, pWriter->iEnd, 0, 0); if( rc!=SQLITE_OK ) return rc; @@ -159437,13 +159437,13 @@ static int fts3IncrmergeWriter( } /* -** Remove an entry from the %_segdir table. This involves running the +** Remove an entry from the %_segdir table. This involves running the ** following two statements: ** ** DELETE FROM %_segdir WHERE level = :iAbsLevel AND idx = :iIdx ** UPDATE %_segdir SET idx = idx - 1 WHERE level = :iAbsLevel AND idx > :iIdx ** -** The DELETE statement removes the specific %_segdir level. The UPDATE +** The DELETE statement removes the specific %_segdir level. The UPDATE ** statement ensures that the remaining segments have contiguously allocated ** idx values. */ @@ -159565,8 +159565,8 @@ static int fts3TruncateNode( pNew->n = 0; /* Populate new node buffer */ - for(rc = nodeReaderInit(&reader, aNode, nNode); - rc==SQLITE_OK && reader.aNode; + for(rc = nodeReaderInit(&reader, aNode, nNode); + rc==SQLITE_OK && reader.aNode; rc = nodeReaderNext(&reader) ){ if( pNew->n==0 ){ @@ -159593,7 +159593,7 @@ static int fts3TruncateNode( } /* -** Remove all terms smaller than zTerm/nTerm from segment iIdx in absolute +** Remove all terms smaller than zTerm/nTerm from segment iIdx in absolute ** level iAbsLevel. This may involve deleting entries from the %_segments ** table, and modifying existing entries in both the %_segments and %_segdir ** tables. @@ -159716,9 +159716,9 @@ static int fts3IncrmergeChomp( } *pnRem = 0; }else{ - /* The incremental merge did not copy all the data from this + /* The incremental merge did not copy all the data from this ** segment to the upper level. The segment is modified in place - ** so that it contains no keys smaller than zTerm/nTerm. */ + ** so that it contains no keys smaller than zTerm/nTerm. */ const char *zTerm = pSeg->zTerm; int nTerm = pSeg->nTerm; rc = fts3TruncateSegment(p, iAbsLevel, pSeg->iIdx, zTerm, nTerm); @@ -159753,7 +159753,7 @@ static int fts3IncrmergeHintStore(Fts3Table *p, Blob *pHint){ } /* -** Load an incr-merge hint from the database. The incr-merge hint, if one +** Load an incr-merge hint from the database. The incr-merge hint, if one ** exists, is stored in the rowid==1 row of the %_stat table. ** ** If successful, populate blob *pHint with the value read from the %_stat @@ -159790,7 +159790,7 @@ static int fts3IncrmergeHintLoad(Fts3Table *p, Blob *pHint){ /* ** If *pRc is not SQLITE_OK when this function is called, it is a no-op. ** Otherwise, append an entry to the hint stored in blob *pHint. Each entry -** consists of two varints, the absolute level number of the input segments +** consists of two varints, the absolute level number of the input segments ** and the number of input segments. ** ** If successful, leave *pRc set to SQLITE_OK and return. If an error occurs, @@ -159811,7 +159811,7 @@ static void fts3IncrmergeHintPush( /* ** Read the last entry (most recently pushed) from the hint blob *pHint -** and then remove the entry. Write the two values read to *piAbsLevel and +** and then remove the entry. Write the two values read to *piAbsLevel and ** *pnInput before returning. ** ** If no error occurs, return SQLITE_OK. If the hint blob in *pHint does @@ -159837,10 +159837,10 @@ static int fts3IncrmergeHintPop(Blob *pHint, i64 *piAbsLevel, int *pnInput){ /* ** Attempt an incremental merge that writes nMerge leaf blocks. ** -** Incremental merges happen nMin segments at a time. The segments -** to be merged are the nMin oldest segments (the ones with the smallest -** values for the _segdir.idx field) in the highest level that contains -** at least nMin segments. Multiple merges might occur in an attempt to +** Incremental merges happen nMin segments at a time. The segments +** to be merged are the nMin oldest segments (the ones with the smallest +** values for the _segdir.idx field) in the highest level that contains +** at least nMin segments. Multiple merges might occur in an attempt to ** write the quota of nMerge leaf blocks. */ SQLITE_PRIVATE int sqlite3Fts3Incrmerge(Fts3Table *p, int nMerge, int nMin){ @@ -159871,7 +159871,7 @@ SQLITE_PRIVATE int sqlite3Fts3Incrmerge(Fts3Table *p, int nMerge, int nMin){ /* Search the %_segdir table for the absolute level with the smallest ** relative level number that contains at least nMin segments, if any. ** If one is found, set iAbsLevel to the absolute level number and - ** nSeg to nMin. If no level with at least nMin segments can be found, + ** nSeg to nMin. If no level with at least nMin segments can be found, ** set nSeg to -1. */ rc = fts3SqlStmt(p, SQL_FIND_MERGE_LEVEL, &pFindLevel, 0); @@ -159887,7 +159887,7 @@ SQLITE_PRIVATE int sqlite3Fts3Incrmerge(Fts3Table *p, int nMerge, int nMin){ /* If the hint read from the %_stat table is not empty, check if the ** last entry in it specifies a relative level smaller than or equal - ** to the level identified by the block above (if any). If so, this + ** to the level identified by the block above (if any). If so, this ** iteration of the loop will work on merging at the hinted level. */ if( rc==SQLITE_OK && hint.n ){ @@ -159913,11 +159913,11 @@ SQLITE_PRIVATE int sqlite3Fts3Incrmerge(Fts3Table *p, int nMerge, int nMin){ ** Exit early in this case. */ if( nSeg<0 ) break; - /* Open a cursor to iterate through the contents of the oldest nSeg - ** indexes of absolute level iAbsLevel. If this cursor is opened using + /* Open a cursor to iterate through the contents of the oldest nSeg + ** indexes of absolute level iAbsLevel. If this cursor is opened using ** the 'hint' parameters, it is possible that there are less than nSeg ** segments available in level iAbsLevel. In this case, no work is - ** done on iAbsLevel - fall through to the next iteration of the loop + ** done on iAbsLevel - fall through to the next iteration of the loop ** to start work on some other level. */ memset(pWriter, 0, nAlloc); pFilter->flags = FTS3_SEGMENT_REQUIRE_POS; @@ -160184,7 +160184,7 @@ static u64 fts3ChecksumIndex( ** to true and return SQLITE_OK. Or if the contents do not match, set *pbOk ** to false before returning. ** -** If an error occurs (e.g. an OOM or IO error), return an SQLite error +** If an error occurs (e.g. an OOM or IO error), return an SQLite error ** code. The final value of *pbOk is undefined in this case. */ static int fts3IntegrityCheck(Fts3Table *p, int *pbOk){ @@ -160215,7 +160215,7 @@ static int fts3IntegrityCheck(Fts3Table *p, int *pbOk){ sqlite3_tokenizer_module const *pModule = p->pTokenizer->pModule; sqlite3_stmt *pStmt = 0; char *zSql; - + zSql = sqlite3_mprintf("SELECT %s" , p->zReadExprlist); if( !zSql ){ rc = SQLITE_NOMEM; @@ -160275,7 +160275,7 @@ static int fts3IntegrityCheck(Fts3Table *p, int *pbOk){ ** the FTS index are correct, return SQLITE_OK. Or, if the contents of the ** FTS index are incorrect, return SQLITE_CORRUPT_VTAB. ** -** Or, if an error (e.g. an OOM or IO error) occurs, return an SQLite +** Or, if an error (e.g. an OOM or IO error) occurs, return an SQLite ** error code. ** ** The integrity-check works as follows. For each token and indexed token @@ -160284,7 +160284,7 @@ static int fts3IntegrityCheck(Fts3Table *p, int *pbOk){ ** ** + The index number (0 for the main index, 1 for the first prefix ** index etc.), -** + The token (or token prefix) text itself, +** + The token (or token prefix) text itself, ** + The language-id of the row it appears in, ** + The docid of the row it appears in, ** + The column it appears in, and @@ -160295,7 +160295,7 @@ static int fts3IntegrityCheck(Fts3Table *p, int *pbOk){ ** ** The integrity-check code calculates the same checksum in two ways: ** -** 1. By scanning the contents of the FTS index, and +** 1. By scanning the contents of the FTS index, and ** 2. By scanning and tokenizing the content table. ** ** If the two checksums are identical, the integrity-check is deemed to have @@ -160316,7 +160316,7 @@ static int fts3DoIntegrityCheck( ** ** "INSERT INTO tbl(tbl) VALUES()" ** -** Argument pVal contains the result of . Currently the only +** Argument pVal contains the result of . Currently the only ** meaningful value to insert is the text 'optimize'. */ static int fts3SpecialInsert(Fts3Table *p, sqlite3_value *pVal){ @@ -160368,7 +160368,7 @@ SQLITE_PRIVATE void sqlite3Fts3FreeDeferredDoclists(Fts3Cursor *pCsr){ } /* -** Free all entries in the pCsr->pDeffered list. Entries are added to +** Free all entries in the pCsr->pDeffered list. Entries are added to ** this list using sqlite3Fts3DeferToken(). */ SQLITE_PRIVATE void sqlite3Fts3FreeDeferredTokens(Fts3Cursor *pCsr){ @@ -160396,14 +160396,14 @@ SQLITE_PRIVATE int sqlite3Fts3CacheDeferredDoclists(Fts3Cursor *pCsr){ int i; /* Used to iterate through table columns */ sqlite3_int64 iDocid; /* Docid of the row pCsr points to */ Fts3DeferredToken *pDef; /* Used to iterate through deferred tokens */ - + Fts3Table *p = (Fts3Table *)pCsr->base.pVtab; sqlite3_tokenizer *pT = p->pTokenizer; sqlite3_tokenizer_module const *pModule = pT->pModule; - + assert( pCsr->isRequireSeek==0 ); iDocid = sqlite3_column_int64(pCsr->pStmt, 0); - + for(i=0; inColumn && rc==SQLITE_OK; i++){ if( p->abNotindexed[i]==0 ){ const char *zText = (const char *)sqlite3_column_text(pCsr->pStmt, i+1); @@ -160444,8 +160444,8 @@ SQLITE_PRIVATE int sqlite3Fts3CacheDeferredDoclists(Fts3Cursor *pCsr){ } SQLITE_PRIVATE int sqlite3Fts3DeferredTokenList( - Fts3DeferredToken *p, - char **ppData, + Fts3DeferredToken *p, + char **ppData, int *pnData ){ char *pRet; @@ -160465,7 +160465,7 @@ SQLITE_PRIVATE int sqlite3Fts3DeferredTokenList( nSkip = sqlite3Fts3GetVarint(p->pList->aData, &dummy); *pnData = p->pList->nData - nSkip; *ppData = pRet; - + memcpy(pRet, &p->pList->aData[nSkip], *pnData); return SQLITE_OK; } @@ -160485,7 +160485,7 @@ SQLITE_PRIVATE int sqlite3Fts3DeferToken( } memset(pDeferred, 0, sizeof(*pDeferred)); pDeferred->pToken = pToken; - pDeferred->pNext = pCsr->pDeferred; + pDeferred->pNext = pCsr->pDeferred; pDeferred->iCol = iCol; pCsr->pDeferred = pDeferred; @@ -160502,8 +160502,8 @@ SQLITE_PRIVATE int sqlite3Fts3DeferToken( ** of subsiduary data structures accordingly. */ static int fts3DeleteByRowid( - Fts3Table *p, - sqlite3_value *pRowid, + Fts3Table *p, + sqlite3_value *pRowid, int *pnChng, /* IN/OUT: Decrement if row is deleted */ u32 *aSzDel ){ @@ -160541,14 +160541,14 @@ static int fts3DeleteByRowid( ** This function does the work for the xUpdate method of FTS3 virtual ** tables. The schema of the virtual table being: ** -** CREATE TABLE ( +** CREATE TABLE
            ( ** , -**
            HIDDEN, -** docid HIDDEN, +**
            HIDDEN, +** docid HIDDEN, ** HIDDEN ** ); ** -** +** */ SQLITE_PRIVATE int sqlite3Fts3UpdateMethod( sqlite3_vtab *pVtab, /* FTS3 vtab object */ @@ -160569,7 +160569,7 @@ SQLITE_PRIVATE int sqlite3Fts3UpdateMethod( assert( p->bHasStat==0 || p->bHasStat==1 ); assert( p->pSegments==0 ); - assert( + assert( nArg==1 /* DELETE operations */ || nArg==(2 + p->nColumn + 3) /* INSERT or UPDATE operations */ ); @@ -160578,9 +160578,9 @@ SQLITE_PRIVATE int sqlite3Fts3UpdateMethod( ** ** INSERT INTO xyz(xyz) VALUES('command'); */ - if( nArg>1 - && sqlite3_value_type(apVal[0])==SQLITE_NULL - && sqlite3_value_type(apVal[p->nColumn+2])!=SQLITE_NULL + if( nArg>1 + && sqlite3_value_type(apVal[0])==SQLITE_NULL + && sqlite3_value_type(apVal[p->nColumn+2])!=SQLITE_NULL ){ rc = fts3SpecialInsert(p, apVal[p->nColumn+2]); goto update_out; @@ -160619,24 +160619,24 @@ SQLITE_PRIVATE int sqlite3Fts3UpdateMethod( pNewRowid = apVal[1]; } - if( sqlite3_value_type(pNewRowid)!=SQLITE_NULL && ( + if( sqlite3_value_type(pNewRowid)!=SQLITE_NULL && ( sqlite3_value_type(apVal[0])==SQLITE_NULL || sqlite3_value_int64(apVal[0])!=sqlite3_value_int64(pNewRowid) )){ /* The new rowid is not NULL (in this case the rowid will be - ** automatically assigned and there is no chance of a conflict), and + ** automatically assigned and there is no chance of a conflict), and ** the statement is either an INSERT or an UPDATE that modifies the ** rowid column. So if the conflict mode is REPLACE, then delete any - ** existing row with rowid=pNewRowid. + ** existing row with rowid=pNewRowid. ** - ** Or, if the conflict mode is not REPLACE, insert the new record into + ** Or, if the conflict mode is not REPLACE, insert the new record into ** the %_content table. If we hit the duplicate rowid constraint (or any ** other error) while doing so, return immediately. ** ** This branch may also run if pNewRowid contains a value that cannot - ** be losslessly converted to an integer. In this case, the eventual + ** be losslessly converted to an integer. In this case, the eventual ** call to fts3InsertData() (either just below or further on in this - ** function) will return SQLITE_MISMATCH. If fts3DeleteByRowid is + ** function) will return SQLITE_MISMATCH. If fts3DeleteByRowid is ** invoked, it will delete zero rows (since no row will have ** docid=$pNewRowid if $pNewRowid is not an integer value). */ @@ -160658,7 +160658,7 @@ SQLITE_PRIVATE int sqlite3Fts3UpdateMethod( rc = fts3DeleteByRowid(p, apVal[0], &nChng, aSzDel); isRemove = 1; } - + /* If this is an INSERT or UPDATE operation, insert the new record. */ if( nArg>1 && rc==SQLITE_OK ){ int iLangid = sqlite3_value_int(apVal[2 + p->nColumn + 2]); @@ -160691,10 +160691,10 @@ SQLITE_PRIVATE int sqlite3Fts3UpdateMethod( return rc; } -/* +/* ** Flush any data in the pending-terms hash table to disk. If successful, -** merge all segments in the database (including the new segment, if -** there was any data to flush) into a single segment. +** merge all segments in the database (including the new segment, if +** there was any data to flush) into a single segment. */ SQLITE_PRIVATE int sqlite3Fts3Optimize(Fts3Table *p){ int rc; @@ -160750,7 +160750,7 @@ SQLITE_PRIVATE int sqlite3Fts3Optimize(Fts3Table *p){ #define FTS3_MATCHINFO_LHITS_BM 'b' /* nCol*nPhrase values */ /* -** The default value for the second argument to matchinfo(). +** The default value for the second argument to matchinfo(). */ #define FTS3_MATCHINFO_DEFAULT "pcx" @@ -160767,7 +160767,7 @@ struct LoadDoclistCtx { }; /* -** The following types are used as part of the implementation of the +** The following types are used as part of the implementation of the ** fts3BestSnippet() routine. */ typedef struct SnippetIter SnippetIter; @@ -160800,7 +160800,7 @@ struct SnippetFragment { }; /* -** This type is used as an fts3ExprIterate() context object while +** This type is used as an fts3ExprIterate() context object while ** accumulating the data returned by the matchinfo() function. */ typedef struct MatchInfo MatchInfo; @@ -160869,8 +160869,8 @@ static MatchinfoBuffer *fts3MIBufferNew(int nElem, const char *zMatchinfo){ static void fts3MIBufferFree(void *p){ MatchinfoBuffer *pBuf = (MatchinfoBuffer*)((u8*)p - ((u32*)p)[-1]); - assert( (u32*)p==&pBuf->aMatchinfo[1] - || (u32*)p==&pBuf->aMatchinfo[pBuf->nElem+2] + assert( (u32*)p==&pBuf->aMatchinfo[1] + || (u32*)p==&pBuf->aMatchinfo[pBuf->nElem+2] ); if( (u32*)p==&pBuf->aMatchinfo[1] ){ pBuf->aRef[1] = 0; @@ -160926,7 +160926,7 @@ SQLITE_PRIVATE void sqlite3Fts3MIBufferFree(MatchinfoBuffer *p){ } } -/* +/* ** End of MatchinfoBuffer code. *************************************************************************/ @@ -160987,7 +160987,7 @@ static int fts3ExprIterate2( ** are part of a sub-tree that is the right-hand-side of a NOT operator. ** For each phrase node found, the supplied callback function is invoked. ** -** If the callback function returns anything other than SQLITE_OK, +** If the callback function returns anything other than SQLITE_OK, ** the iteration is abandoned and the error code returned immediately. ** Otherwise, SQLITE_OK is returned after a callback has been made for ** all eligible phrase nodes. @@ -161022,11 +161022,11 @@ static int fts3ExprLoadDoclistsCb(Fts3Expr *pExpr, int iPhrase, void *ctx){ /* ** Load the doclists for each phrase in the query associated with FTS3 cursor -** pCsr. +** pCsr. ** -** If pnPhrase is not NULL, then *pnPhrase is set to the number of matchable -** phrases in the expression (all phrases except those directly or -** indirectly descended from the right-hand-side of a NOT operator). If +** If pnPhrase is not NULL, then *pnPhrase is set to the number of matchable +** phrases in the expression (all phrases except those directly or +** indirectly descended from the right-hand-side of a NOT operator). If ** pnToken is not NULL, then it is set to the number of tokens in all ** matchable phrases of the expression. */ @@ -161056,7 +161056,7 @@ static int fts3ExprPhraseCount(Fts3Expr *pExpr){ } /* -** Advance the position list iterator specified by the first two +** Advance the position list iterator specified by the first two ** arguments so that it points to the first element with a value greater ** than or equal to parameter iNext. */ @@ -161125,7 +161125,7 @@ static int fts3SnippetNextCandidate(SnippetIter *pIter){ } /* -** Retrieve information about the current candidate snippet of snippet +** Retrieve information about the current candidate snippet of snippet ** iterator pIter. */ static void fts3SnippetDetails( @@ -161201,7 +161201,7 @@ static int fts3SnippetFindPositions(Fts3Expr *pExpr, int iPhrase, void *ctx){ pPhrase->iTail = iFirst; }else{ assert( rc!=SQLITE_OK || ( - pPhrase->pList==0 && pPhrase->pHead==0 && pPhrase->pTail==0 + pPhrase->pList==0 && pPhrase->pHead==0 && pPhrase->pTail==0 )); } @@ -161209,14 +161209,14 @@ static int fts3SnippetFindPositions(Fts3Expr *pExpr, int iPhrase, void *ctx){ } /* -** Select the fragment of text consisting of nFragment contiguous tokens +** Select the fragment of text consisting of nFragment contiguous tokens ** from column iCol that represent the "best" snippet. The best snippet ** is the snippet with the highest score, where scores are calculated ** by adding: ** ** (a) +1 point for each occurrence of a matchable phrase in the snippet. ** -** (b) +1000 points for the first occurrence of each matchable phrase in +** (b) +1000 points for the first occurrence of each matchable phrase in ** the snippet for which the corresponding mCovered bit is not set. ** ** The selected snippet parameters are stored in structure *pFragment before @@ -161277,7 +161277,7 @@ static int fts3BestSnippet( } } - /* Loop through all candidate snippets. Store the best snippet in + /* Loop through all candidate snippets. Store the best snippet in ** *pFragment. Store its associated 'score' in iBestScore. */ pFragment->iCol = iCol; @@ -161349,8 +161349,8 @@ static int fts3StringAppend( ** ** ........X.....X ** -** This function "shifts" the beginning of the snippet forward in the -** document so that there are approximately the same number of +** This function "shifts" the beginning of the snippet forward in the +** document so that there are approximately the same number of ** non-highlighted terms to the right of the final highlighted term as there ** are to the left of the first highlighted term. For example, to this: ** @@ -161358,8 +161358,8 @@ static int fts3StringAppend( ** ** This is done as part of extracting the snippet text, not when selecting ** the snippet. Snippet selection is done based on doclists only, so there -** is no way for fts3BestSnippet() to know whether or not the document -** actually contains terms that follow the final highlighted term. +** is no way for fts3BestSnippet() to know whether or not the document +** actually contains terms that follow the final highlighted term. */ static int fts3SnippetShift( Fts3Table *pTab, /* FTS3 table snippet comes from */ @@ -161448,7 +161448,7 @@ static int fts3SnippetText( int iCol = pFragment->iCol+1; /* Query column to extract text from */ sqlite3_tokenizer_module *pMod; /* Tokenizer module methods object */ sqlite3_tokenizer_cursor *pC; /* Tokenizer cursor open on zDoc/nDoc */ - + zDoc = (const char *)sqlite3_column_text(pCsr->pStmt, iCol); if( zDoc==0 ){ if( sqlite3_column_type(pCsr->pStmt, iCol)!=SQLITE_NULL ){ @@ -161488,7 +161488,7 @@ static int fts3SnippetText( if( rc==SQLITE_DONE ){ /* Special case - the last token of the snippet is also the last token ** of the column. Append any punctuation that occurred between the end - ** of the previous token and the end of the document to the output. + ** of the previous token and the end of the document to the output. ** Then break out of the loop. */ rc = fts3StringAppend(pOut, &zDoc[iEnd], -1); } @@ -161505,7 +161505,7 @@ static int fts3SnippetText( /* Now that the shift has been done, check if the initial "..." are ** required. They are required if (a) this is not the first fragment, - ** or (b) this fragment does not begin at position 0 of its column. + ** or (b) this fragment does not begin at position 0 of its column. */ if( rc==SQLITE_OK ){ if( iPos>0 || iFragment>0 ){ @@ -161541,8 +161541,8 @@ static int fts3SnippetText( /* -** This function is used to count the entries in a column-list (a -** delta-encoded list of term offsets within a single column of a single +** This function is used to count the entries in a column-list (a +** delta-encoded list of term offsets within a single column of a single ** row). When this function is called, *ppCollist should point to the ** beginning of the first varint in the column-list (the varint that ** contains the position of the first matching term in the column data). @@ -161624,11 +161624,11 @@ static void fts3ExprLHitGather( /* ** fts3ExprIterate() callback used to collect the "global" matchinfo stats -** for a single query. +** for a single query. ** ** fts3ExprIterate() callback to load the 'global' elements of a -** FTS3_MATCHINFO_HITS matchinfo array. The global stats are those elements -** of the matchinfo array that are constant for all rows returned by the +** FTS3_MATCHINFO_HITS matchinfo array. The global stats are those elements +** of the matchinfo array that are constant for all rows returned by the ** current query. ** ** Argument pCtx is actually a pointer to a struct of type MatchInfo. This @@ -161644,7 +161644,7 @@ static void fts3ExprLHitGather( ** at least one instance of phrase iPhrase. ** ** If the phrase pExpr consists entirely of deferred tokens, then all X and -** Y values are set to nDoc, where nDoc is the number of documents in the +** Y values are set to nDoc, where nDoc is the number of documents in the ** file system. This is done because the full-text index doclist is required ** to calculate these values properly, and the full-text index doclist is ** not available for deferred tokens. @@ -161662,7 +161662,7 @@ static int fts3ExprGlobalHitsCb( /* ** fts3ExprIterate() callback used to collect the "local" part of the -** FTS3_MATCHINFO_HITS array. The local stats are those elements of the +** FTS3_MATCHINFO_HITS array. The local stats are those elements of the ** array that are different for each row returned by the query. */ static int fts3ExprLocalHitsCb( @@ -161689,7 +161689,7 @@ static int fts3ExprLocalHitsCb( } static int fts3MatchinfoCheck( - Fts3Table *pTab, + Fts3Table *pTab, char cArg, char **pzErr ){ @@ -161714,8 +161714,8 @@ static int fts3MatchinfoSize(MatchInfo *pInfo, char cArg){ switch( cArg ){ case FTS3_MATCHINFO_NDOC: - case FTS3_MATCHINFO_NPHRASE: - case FTS3_MATCHINFO_NCOL: + case FTS3_MATCHINFO_NPHRASE: + case FTS3_MATCHINFO_NCOL: nVal = 1; break; @@ -161769,7 +161769,7 @@ static int fts3MatchinfoSelectDoctotal( } /* -** An instance of the following structure is used to store state while +** An instance of the following structure is used to store state while ** iterating through a multi-column position-list corresponding to the ** hits for a single phrase on a single row in order to calculate the ** values for a matchinfo() FTS3_MATCHINFO_LCS request. @@ -161782,7 +161782,7 @@ struct LcsIterator { int iPos; /* Current position */ }; -/* +/* ** If LcsIterator.iCol is set to the following value, the iterator has ** finished iterating through all offsets for all columns. */ @@ -161819,16 +161819,16 @@ static int fts3LcsIteratorAdvance(LcsIterator *pIter){ pIter->pRead = pRead; return rc; } - + /* -** This function implements the FTS3_MATCHINFO_LCS matchinfo() flag. +** This function implements the FTS3_MATCHINFO_LCS matchinfo() flag. ** ** If the call is successful, the longest-common-substring lengths for each -** column are written into the first nCol elements of the pInfo->aMatchinfo[] +** column are written into the first nCol elements of the pInfo->aMatchinfo[] ** array before returning. SQLITE_OK is returned in this case. ** ** Otherwise, if an error occurs, an SQLite error code is returned and the -** data written to the first nCol elements of pInfo->aMatchinfo[] is +** data written to the first nCol elements of pInfo->aMatchinfo[] is ** undefined. */ static int fts3MatchinfoLcs(Fts3Cursor *pCsr, MatchInfo *pInfo){ @@ -161900,7 +161900,7 @@ static int fts3MatchinfoLcs(Fts3Cursor *pCsr, MatchInfo *pInfo){ /* ** Populate the buffer pInfo->aMatchinfo[] with an array of integers to -** be returned by the matchinfo() function. Argument zArg contains the +** be returned by the matchinfo() function. Argument zArg contains the ** format string passed as the second argument to matchinfo (or the ** default value "pcx" if no second argument was specified). The format ** string has already been validated and the pInfo->aMatchinfo[] array @@ -161911,7 +161911,7 @@ static int fts3MatchinfoLcs(Fts3Cursor *pCsr, MatchInfo *pInfo){ ** rows (i.e. FTS3_MATCHINFO_NPHRASE, NCOL, NDOC, AVGLENGTH and part of HITS) ** have already been populated. ** -** Return SQLITE_OK if successful, or an SQLite error code if an error +** Return SQLITE_OK if successful, or an SQLite error code if an error ** occurs. If a value other than SQLITE_OK is returned, the state the ** pInfo->aMatchinfo[] buffer is left in is undefined. */ @@ -161936,7 +161936,7 @@ static int fts3MatchinfoValues( case FTS3_MATCHINFO_NCOL: if( bGlobal ) pInfo->aMatchinfo[0] = pInfo->nCol; break; - + case FTS3_MATCHINFO_NDOC: if( bGlobal ){ sqlite3_int64 nDoc = 0; @@ -161945,7 +161945,7 @@ static int fts3MatchinfoValues( } break; - case FTS3_MATCHINFO_AVGLENGTH: + case FTS3_MATCHINFO_AVGLENGTH: if( bGlobal ){ sqlite3_int64 nDoc; /* Number of rows in table */ const char *a; /* Aggregate column length array */ @@ -162024,7 +162024,7 @@ static int fts3MatchinfoValues( /* -** Populate pCsr->aMatchinfo[] with data for the current row. The +** Populate pCsr->aMatchinfo[] with data for the current row. The ** 'matchinfo' data is an array of 32-bit unsigned integers (C type u32). */ static void fts3GetMatchinfo( @@ -162044,8 +162044,8 @@ static void fts3GetMatchinfo( sInfo.pCursor = pCsr; sInfo.nCol = pTab->nColumn; - /* If there is cached matchinfo() data, but the format string for the - ** cache does not match the format string for this request, discard + /* If there is cached matchinfo() data, but the format string for the + ** cache does not match the format string for this request, discard ** the cached data. */ if( pCsr->pMIBuffer && strcmp(pCsr->pMIBuffer->zMatchinfo, zArg) ){ sqlite3Fts3MIBufferFree(pCsr->pMIBuffer); @@ -162053,7 +162053,7 @@ static void fts3GetMatchinfo( } /* If Fts3Cursor.pMIBuffer is NULL, then this is the first time the - ** matchinfo function has been called for this query. In this case + ** matchinfo function has been called for this query. In this case ** allocate the array used to accumulate the matchinfo data and ** initialize those elements that are constant for every row. */ @@ -162128,7 +162128,7 @@ SQLITE_PRIVATE void sqlite3Fts3Snippet( /* The returned text includes up to four fragments of text extracted from ** the data in the current row. The first iteration of the for(...) loop - ** below attempts to locate a single fragment of text nToken tokens in + ** below attempts to locate a single fragment of text nToken tokens in ** size that contains at least one instance of all phrases in the query ** expression that appear in the current row. If such a fragment of text ** cannot be found, the second iteration of the loop attempts to locate @@ -162195,7 +162195,7 @@ SQLITE_PRIVATE void sqlite3Fts3Snippet( assert( nFToken>0 ); for(i=0; iiPrevId; sCtx.pCsr = pCsr; - /* Loop through the table columns, appending offset information to + /* Loop through the table columns, appending offset information to ** string-buffer res for each column. */ for(iCol=0; iColnColumn; iCol++){ @@ -162306,7 +162306,7 @@ SQLITE_PRIVATE void sqlite3Fts3Offsets( const char *zDoc; int nDoc; - /* Initialize the contents of sCtx.aTerm[] for column iCol. There is + /* Initialize the contents of sCtx.aTerm[] for column iCol. There is ** no way that this operation can fail, so the return code from ** fts3ExprIterate() can be discarded. */ @@ -162314,11 +162314,11 @@ SQLITE_PRIVATE void sqlite3Fts3Offsets( sCtx.iTerm = 0; (void)fts3ExprIterate(pCsr->pExpr, fts3ExprTermOffsetInit, (void*)&sCtx); - /* Retreive the text stored in column iCol. If an SQL NULL is stored + /* Retreive the text stored in column iCol. If an SQL NULL is stored ** in column iCol, jump immediately to the next iteration of the loop. ** If an OOM occurs while retrieving the data (this can happen if SQLite - ** needs to transform the data from utf-16 to utf-8), return SQLITE_NOMEM - ** to the caller. + ** needs to transform the data from utf-16 to utf-8), return SQLITE_NOMEM + ** to the caller. */ zDoc = (const char *)sqlite3_column_text(pCsr->pStmt, iCol+1); nDoc = sqlite3_column_bytes(pCsr->pStmt, iCol+1); @@ -162365,7 +162365,7 @@ SQLITE_PRIVATE void sqlite3Fts3Offsets( } if( rc==SQLITE_OK ){ char aBuffer[64]; - sqlite3_snprintf(sizeof(aBuffer), aBuffer, + sqlite3_snprintf(sizeof(aBuffer), aBuffer, "%d %d %d %d ", iCol, pTerm-sCtx.aTerm, iStart, iEnd-iStart ); rc = fts3StringAppend(&res, aBuffer, -1); @@ -162546,7 +162546,7 @@ static int unicodeDestroy(sqlite3_tokenizer *pTokenizer){ ** ** For each codepoint in the zIn/nIn string, this function checks if the ** sqlite3FtsUnicodeIsalnum() function already returns the desired result. -** If so, no action is taken. Otherwise, the codepoint is added to the +** If so, no action is taken. Otherwise, the codepoint is added to the ** unicode_tokenizer.aiException[] array. For the purposes of tokenization, ** the return value of sqlite3FtsUnicodeIsalnum() is inverted for all ** codepoints in the aiException[] array. @@ -162572,8 +162572,8 @@ static int unicodeAddExceptions( while( zaInput[pCsr->nInput]; /* Scan past any delimiter characters before the start of the next token. - ** Return SQLITE_DONE early if this takes us all the way to the end of + ** Return SQLITE_DONE early if this takes us all the way to the end of ** the input. */ while( z=zTerm ) break; READ_UTF8(z, zTerm, iCode); - }while( unicodeIsAlnum(p, iCode) + }while( unicodeIsAlnum(p, iCode) || sqlite3FtsUnicodeIsdiacritic(iCode) ); @@ -162801,7 +162801,7 @@ static int unicodeNext( } /* -** Set *ppModule to a pointer to the sqlite3_tokenizer_module +** Set *ppModule to a pointer to the sqlite3_tokenizer_module ** structure for the unicode tokenizer. */ SQLITE_PRIVATE void sqlite3Fts3UnicodeTokenizer(sqlite3_tokenizer_module const **ppModule){ @@ -162856,11 +162856,11 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeIsalnum(int c){ ** range of unicode codepoints that are not either letters or numbers (i.e. ** codepoints for which this function should return 0). ** - ** The most significant 22 bits in each 32-bit value contain the first + ** The most significant 22 bits in each 32-bit value contain the first ** codepoint in the range. The least significant 10 bits are used to store - ** the size of the range (always at least 1). In other words, the value - ** ((C<<22) + N) represents a range of N codepoints starting with codepoint - ** C. It is not possible to represent a range larger than 1023 codepoints + ** the size of the range (always at least 1). In other words, the value + ** ((C<<22) + N) represents a range of N codepoints starting with codepoint + ** C. It is not possible to represent a range larger than 1023 codepoints ** using this format. */ static const unsigned int aEntry[] = { @@ -162985,30 +162985,30 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeIsalnum(int c){ */ static int remove_diacritic(int c){ unsigned short aDia[] = { - 0, 1797, 1848, 1859, 1891, 1928, 1940, 1995, - 2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286, - 2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732, - 2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336, - 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928, - 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234, - 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504, - 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529, - 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726, - 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122, - 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536, - 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730, - 62924, 63050, 63082, 63274, 63390, + 0, 1797, 1848, 1859, 1891, 1928, 1940, 1995, + 2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286, + 2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732, + 2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336, + 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928, + 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234, + 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504, + 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529, + 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726, + 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122, + 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536, + 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730, + 62924, 63050, 63082, 63274, 63390, }; char aChar[] = { - '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c', - 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r', - 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o', - 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r', - 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0', - '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h', - 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't', - 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a', - 'e', 'i', 'o', 'u', 'y', + '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c', + 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r', + 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o', + 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r', + 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h', + 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't', + 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a', + 'e', 'i', 'o', 'u', 'y', }; unsigned int key = (((unsigned int)c)<<3) | 0x00000007; @@ -163129,19 +163129,19 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeFold(int c, int bRemoveDiacritic){ {42802, 1, 62}, {42873, 1, 4}, {42877, 76, 1}, {42878, 1, 10}, {42891, 0, 1}, {42893, 74, 1}, {42896, 1, 4}, {42912, 1, 10}, {42922, 72, 1}, - {65313, 14, 26}, + {65313, 14, 26}, }; static const unsigned short aiOff[] = { - 1, 2, 8, 15, 16, 26, 28, 32, - 37, 38, 40, 48, 63, 64, 69, 71, - 79, 80, 116, 202, 203, 205, 206, 207, - 209, 210, 211, 213, 214, 217, 218, 219, - 775, 7264, 10792, 10795, 23228, 23256, 30204, 54721, - 54753, 54754, 54756, 54787, 54793, 54809, 57153, 57274, - 57921, 58019, 58363, 61722, 65268, 65341, 65373, 65406, - 65408, 65410, 65415, 65424, 65436, 65439, 65450, 65462, - 65472, 65476, 65478, 65480, 65482, 65488, 65506, 65511, - 65514, 65521, 65527, 65528, 65529, + 1, 2, 8, 15, 16, 26, 28, 32, + 37, 38, 40, 48, 63, 64, 69, 71, + 79, 80, 116, 202, 203, 205, 206, 207, + 209, 210, 211, 213, 214, 217, 218, 219, + 775, 7264, 10792, 10795, 23228, 23256, 30204, 54721, + 54753, 54754, 54756, 54787, 54793, 54809, 57153, 57274, + 57921, 58019, 58363, 61722, 65268, 65341, 65373, 65406, + 65408, 65410, 65415, 65424, 65436, 65439, 65450, 65462, + 65472, 65476, 65478, 65480, 65482, 65488, 65506, 65511, + 65514, 65521, 65527, 65528, 65529, }; int ret = c; @@ -163178,7 +163178,7 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeFold(int c, int bRemoveDiacritic){ if( bRemoveDiacritic ) ret = remove_diacritic(ret); } - + else if( c>=66560 && c<66600 ){ ret = c + 40; } @@ -163209,7 +163209,7 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeFold(int c, int bRemoveDiacritic){ ** Database Format of R-Tree Tables ** -------------------------------- ** -** The data structure for a single virtual r-tree table is stored in three +** The data structure for a single virtual r-tree table is stored in three ** native SQLite tables declared as follows. In each case, the '%' character ** in the table name is replaced with the user-supplied name of the r-tree ** table. @@ -163234,7 +163234,7 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeFold(int c, int bRemoveDiacritic){ ** of the node contain the tree depth as a big-endian integer. ** For non-root nodes, the first 2 bytes are left unused. ** -** 2. The next 2 bytes contain the number of entries currently +** 2. The next 2 bytes contain the number of entries currently ** stored in the node. ** ** 3. The remainder of the node contains the node entries. Each entry @@ -163286,7 +163286,7 @@ typedef struct RtreeSearchPoint RtreeSearchPoint; #define RTREE_MAX_DIMENSIONS 5 /* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is +** ever contain very many entries, so a fixed number of buckets is ** used. */ #define HASHSIZE 97 @@ -163295,13 +163295,13 @@ typedef struct RtreeSearchPoint RtreeSearchPoint; ** the number of rows in the virtual table to calculate the costs of ** various strategies. If possible, this estimate is loaded from the ** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use +** Otherwise, if no sqlite_stat1 entry is available, use ** RTREE_DEFAULT_ROWEST. */ #define RTREE_DEFAULT_ROWEST 1048576 #define RTREE_MIN_ROWEST 100 -/* +/* ** An rtree virtual-table object. */ struct Rtree { @@ -163315,14 +163315,14 @@ struct Rtree { u8 inWrTrans; /* True if inside write transaction */ int iDepth; /* Current depth of the r-tree structure */ char *zDb; /* Name of database containing r-tree table */ - char *zName; /* Name of r-tree table */ + char *zName; /* Name of r-tree table */ u32 nBusy; /* Current number of users of this structure */ i64 nRowEst; /* Estimated number of rows in this table */ u32 nCursor; /* Number of open cursors */ /* List of nodes removed during a CondenseTree operation. List is ** linked together via the pointer normally used for hash chains - - ** RtreeNode.pNext. RtreeNode.iNode stores the depth of the sub-tree + ** RtreeNode.pNext. RtreeNode.iNode stores the depth of the sub-tree ** headed by the node (leaf nodes have RtreeNode.iNode==0). */ RtreeNode *pDeleted; @@ -163345,7 +163345,7 @@ struct Rtree { sqlite3_stmt *pWriteParent; sqlite3_stmt *pDeleteParent; - RtreeNode *aHash[HASHSIZE]; /* Hash table of in-memory nodes. */ + RtreeNode *aHash[HASHSIZE]; /* Hash table of in-memory nodes. */ }; /* Possible values for Rtree.eCoordType: */ @@ -163385,7 +163385,7 @@ struct RtreeSearchPoint { }; /* -** The minimum number of cells allowed for a node is a third of the +** The minimum number of cells allowed for a node is a third of the ** maximum. In Gutman's notation: ** ** m = M/3 @@ -163400,7 +163400,7 @@ struct RtreeSearchPoint { /* ** The smallest possible node-size is (512-64)==448 bytes. And the largest ** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since +** Therefore all non-root nodes must contain at least 3 entries. Since ** 2^40 is greater than 2^64, an r-tree structure always has a depth of ** 40 or less. */ @@ -163414,7 +163414,7 @@ struct RtreeSearchPoint { */ #define RTREE_CACHE_SZ 5 -/* +/* ** An rtree cursor object. */ struct RtreeCursor { @@ -163486,7 +163486,7 @@ struct RtreeConstraint { #define RTREE_QUERY 0x47 /* G: New-style sqlite3_rtree_query_callback() */ -/* +/* ** An rtree structure node. */ struct RtreeNode { @@ -163501,7 +163501,7 @@ struct RtreeNode { /* Return the number of cells in a node */ #define NCELL(pNode) readInt16(&(pNode)->zData[2]) -/* +/* ** A single cell from a node, deserialized */ struct RtreeCell { @@ -163516,11 +163516,11 @@ struct RtreeCell { ** sqlite3_rtree_query_callback() and which appear on the right of MATCH ** operators in order to constrain a search. ** -** xGeom and xQueryFunc are the callback functions. Exactly one of +** xGeom and xQueryFunc are the callback functions. Exactly one of ** xGeom and xQueryFunc fields is non-NULL, depending on whether the ** SQL function was created using sqlite3_rtree_geometry_callback() or ** sqlite3_rtree_query_callback(). -** +** ** This object is deleted automatically by the destructor mechanism in ** sqlite3_create_function_v2(). */ @@ -163635,9 +163635,9 @@ static void readCoord(u8 *p, RtreeCoord *pCoord){ pCoord->u = *(u32*)p; #else pCoord->u = ( - (((u32)p[0]) << 24) + - (((u32)p[1]) << 16) + - (((u32)p[2]) << 8) + + (((u32)p[0]) << 24) + + (((u32)p[1]) << 16) + + (((u32)p[2]) << 8) + (((u32)p[3]) << 0) ); #endif @@ -163657,13 +163657,13 @@ static i64 readInt64(u8 *p){ return x; #else return ( - (((i64)p[0]) << 56) + - (((i64)p[1]) << 48) + - (((i64)p[2]) << 40) + - (((i64)p[3]) << 32) + - (((i64)p[4]) << 24) + - (((i64)p[5]) << 16) + - (((i64)p[6]) << 8) + + (((i64)p[0]) << 56) + + (((i64)p[1]) << 48) + + (((i64)p[2]) << 40) + + (((i64)p[3]) << 32) + + (((i64)p[4]) << 24) + + (((i64)p[5]) << 16) + + (((i64)p[6]) << 8) + (((i64)p[7]) << 0) ); #endif @@ -163893,7 +163893,7 @@ static int nodeAcquire( } /* If no error has occurred so far, check if the "number of entries" - ** field on the node is too large. If so, set the return code to + ** field on the node is too large. If so, set the return code to ** SQLITE_CORRUPT_VTAB. */ if( pNode && rc==SQLITE_OK ){ @@ -164083,7 +164083,7 @@ static int rtreeInit( sqlite3 *, void *, int, const char *const*, sqlite3_vtab **, char **, int ); -/* +/* ** Rtree virtual table module xCreate method. */ static int rtreeCreate( @@ -164096,7 +164096,7 @@ static int rtreeCreate( return rtreeInit(db, pAux, argc, argv, ppVtab, pzErr, 1); } -/* +/* ** Rtree virtual table module xConnect method. */ static int rtreeConnect( @@ -164138,7 +164138,7 @@ static void rtreeRelease(Rtree *pRtree){ } } -/* +/* ** Rtree virtual table module xDisconnect method. */ static int rtreeDisconnect(sqlite3_vtab *pVtab){ @@ -164146,7 +164146,7 @@ static int rtreeDisconnect(sqlite3_vtab *pVtab){ return SQLITE_OK; } -/* +/* ** Rtree virtual table module xDestroy method. */ static int rtreeDestroy(sqlite3_vtab *pVtab){ @@ -164156,7 +164156,7 @@ static int rtreeDestroy(sqlite3_vtab *pVtab){ "DROP TABLE '%q'.'%q_node';" "DROP TABLE '%q'.'%q_rowid';" "DROP TABLE '%q'.'%q_parent';", - pRtree->zDb, pRtree->zName, + pRtree->zDb, pRtree->zName, pRtree->zDb, pRtree->zName, pRtree->zDb, pRtree->zName ); @@ -164174,7 +164174,7 @@ static int rtreeDestroy(sqlite3_vtab *pVtab){ return rc; } -/* +/* ** Rtree virtual table module xOpen method. */ static int rtreeOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){ @@ -164213,7 +164213,7 @@ static void freeCursorConstraints(RtreeCursor *pCsr){ } } -/* +/* ** Rtree virtual table module xClose method. */ static int rtreeClose(sqlite3_vtab_cursor *cur){ @@ -164233,7 +164233,7 @@ static int rtreeClose(sqlite3_vtab_cursor *cur){ /* ** Rtree virtual table module xEof method. ** -** Return non-zero if the cursor does not currently point to a valid +** Return non-zero if the cursor does not currently point to a valid ** record (i.e if the scan has finished), or zero otherwise. */ static int rtreeEof(sqlite3_vtab_cursor *cur){ @@ -164289,7 +164289,7 @@ static int rtreeEof(sqlite3_vtab_cursor *cur){ /* ** Check the RTree node or entry given by pCellData and p against the MATCH -** constraint pConstraint. +** constraint pConstraint. */ static int rtreeCallbackConstraint( RtreeConstraint *pConstraint, /* The constraint to test */ @@ -164362,7 +164362,7 @@ static int rtreeCallbackConstraint( return rc; } -/* +/* ** Check the internal RTree node given by pCellData against constraint p. ** If this constraint cannot be satisfied by any child within the node, ** set *peWithin to NOT_WITHIN. @@ -164380,7 +164380,7 @@ static void rtreeNonleafConstraint( */ pCellData += 8 + 4*(p->iCoord&0xfe); - assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE + assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE || p->op==RTREE_GT || p->op==RTREE_EQ ); assert( ((((char*)pCellData) - (char*)0)&3)==0 ); /* 4-byte aligned */ switch( p->op ){ @@ -164420,7 +164420,7 @@ static void rtreeLeafConstraint( ){ RtreeDValue xN; /* Coordinate value converted to a double */ - assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE + assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE || p->op==RTREE_GT || p->op==RTREE_EQ ); pCellData += 8 + p->iCoord*4; assert( ((((char*)pCellData) - (char*)0)&3)==0 ); /* 4-byte aligned */ @@ -164436,12 +164436,12 @@ static void rtreeLeafConstraint( } /* -** One of the cells in node pNode is guaranteed to have a 64-bit +** One of the cells in node pNode is guaranteed to have a 64-bit ** integer value equal to iRowid. Return the index of this cell. */ static int nodeRowidIndex( - Rtree *pRtree, - RtreeNode *pNode, + Rtree *pRtree, + RtreeNode *pNode, i64 iRowid, int *piIndex ){ @@ -164582,7 +164582,7 @@ static RtreeSearchPoint *rtreeSearchPointNew( pFirst = rtreeSearchPointFirst(pCur); pCur->anQueue[iLevel]++; if( pFirst==0 - || pFirst->rScore>rScore + || pFirst->rScore>rScore || (pFirst->rScore==rScore && pFirst->iLevel>iLevel) ){ if( pCur->bPoint ){ @@ -164755,7 +164755,7 @@ static int rtreeStepToLeaf(RtreeCursor *pCur){ return SQLITE_OK; } -/* +/* ** Rtree virtual table module xNext method. */ static int rtreeNext(sqlite3_vtab_cursor *pVtabCursor){ @@ -164769,7 +164769,7 @@ static int rtreeNext(sqlite3_vtab_cursor *pVtabCursor){ return rc; } -/* +/* ** Rtree virtual table module xRowid method. */ static int rtreeRowid(sqlite3_vtab_cursor *pVtabCursor, sqlite_int64 *pRowid){ @@ -164783,7 +164783,7 @@ static int rtreeRowid(sqlite3_vtab_cursor *pVtabCursor, sqlite_int64 *pRowid){ return rc; } -/* +/* ** Rtree virtual table module xColumn method. */ static int rtreeColumn(sqlite3_vtab_cursor *cur, sqlite3_context *ctx, int i){ @@ -164813,8 +164813,8 @@ static int rtreeColumn(sqlite3_vtab_cursor *cur, sqlite3_context *ctx, int i){ return SQLITE_OK; } -/* -** Use nodeAcquire() to obtain the leaf node containing the record with +/* +** Use nodeAcquire() to obtain the leaf node containing the record with ** rowid iRowid. If successful, set *ppLeaf to point to the node and ** return SQLITE_OK. If there is no such record in the table, set ** *ppLeaf to 0 and return SQLITE_OK. If an error occurs, set *ppLeaf @@ -164889,11 +164889,11 @@ static int deserializeGeometry(sqlite3_value *pValue, RtreeConstraint *pCons){ return SQLITE_OK; } -/* +/* ** Rtree virtual table module xFilter method. */ static int rtreeFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -164933,8 +164933,8 @@ static int rtreeFilter( pCsr->atEOF = 1; } }else{ - /* Normal case - r-tree scan. Set up the RtreeCursor.aConstraint array - ** with the configured constraints. + /* Normal case - r-tree scan. Set up the RtreeCursor.aConstraint array + ** with the configured constraints. */ rc = nodeAcquire(pRtree, 1, 0, &pRoot); if( rc==SQLITE_OK && argc>0 ){ @@ -164995,7 +164995,7 @@ static int rtreeFilter( /* ** Rtree virtual table module xBestIndex method. There are three -** table scan strategies to choose from (in order from most to +** table scan strategies to choose from (in order from most to ** least desirable): ** ** idxNum idxStr Strategy @@ -165005,8 +165005,8 @@ static int rtreeFilter( ** ------------------------------------------------ ** ** If strategy 1 is used, then idxStr is not meaningful. If strategy -** 2 is used, idxStr is formatted to contain 2 bytes for each -** constraint used. The first two bytes of idxStr correspond to +** 2 is used, idxStr is formatted to contain 2 bytes for each +** constraint used. The first two bytes of idxStr correspond to ** the constraint in sqlite3_index_info.aConstraintUsage[] with ** (argvIndex==1) etc. ** @@ -165052,8 +165052,8 @@ static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ for(ii=0; iinConstraint && iIdx<(int)(sizeof(zIdxStr)-1); ii++){ struct sqlite3_index_constraint *p = &pIdxInfo->aConstraint[ii]; - if( bMatch==0 && p->usable - && p->iColumn==0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ + if( bMatch==0 && p->usable + && p->iColumn==0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ ){ /* We have an equality constraint on the rowid. Use strategy 1. */ int jj; @@ -165066,11 +165066,11 @@ static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ pIdxInfo->aConstraintUsage[jj].omit = 1; /* This strategy involves a two rowid lookups on an B-Tree structures - ** and then a linear search of an R-Tree node. This should be - ** considered almost as quick as a direct rowid lookup (for which + ** and then a linear search of an R-Tree node. This should be + ** considered almost as quick as a direct rowid lookup (for which ** sqlite uses an internal cost of 0.0). It is expected to return ** a single row. - */ + */ pIdxInfo->estimatedCost = 30.0; pIdxInfo->estimatedRows = 1; return SQLITE_OK; @@ -165086,7 +165086,7 @@ static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ case SQLITE_INDEX_CONSTRAINT_GE: op = RTREE_GE; break; default: assert( p->op==SQLITE_INDEX_CONSTRAINT_MATCH ); - op = RTREE_MATCH; + op = RTREE_MATCH; break; } zIdxStr[iIdx++] = op; @@ -165182,8 +165182,8 @@ static int cellContains(Rtree *pRtree, RtreeCell *p1, RtreeCell *p2){ for(ii=0; iinDim2; ii+=2){ RtreeCoord *a1 = &p1->aCoord[ii]; RtreeCoord *a2 = &p2->aCoord[ii]; - if( (!isInt && (a2[0].fa1[1].f)) - || ( isInt && (a2[0].ia1[1].i)) + if( (!isInt && (a2[0].fa1[1].f)) + || ( isInt && (a2[0].ia1[1].i)) ){ return 0; } @@ -165204,9 +165204,9 @@ static RtreeDValue cellGrowth(Rtree *pRtree, RtreeCell *p, RtreeCell *pCell){ } static RtreeDValue cellOverlap( - Rtree *pRtree, - RtreeCell *p, - RtreeCell *aCell, + Rtree *pRtree, + RtreeCell *p, + RtreeCell *aCell, int nCell ){ int ii; @@ -165315,7 +165315,7 @@ static int AdjustTree( cellUnion(pRtree, &cell, pCell); nodeOverwriteCell(pRtree, pParent, &cell, iCell); } - + p = pParent; } return SQLITE_OK; @@ -165346,7 +165346,7 @@ static int rtreeInsertCell(Rtree *, RtreeNode *, RtreeCell *, int); /* ** Arguments aIdx, aDistance and aSpare all point to arrays of size -** nIdx. The aIdx array contains the set of integers from 0 to +** nIdx. The aIdx array contains the set of integers from 0 to ** (nIdx-1) in no particular order. This function sorts the values ** in aIdx according to the indexed values in aDistance. For ** example, assuming the inputs: @@ -165362,9 +165362,9 @@ static int rtreeInsertCell(Rtree *, RtreeNode *, RtreeCell *, int); ** sorting algorithm. */ static void SortByDistance( - int *aIdx, - int nIdx, - RtreeDValue *aDistance, + int *aIdx, + int nIdx, + RtreeDValue *aDistance, int *aSpare ){ if( nIdx>1 ){ @@ -165418,7 +165418,7 @@ static void SortByDistance( /* ** Arguments aIdx, aCell and aSpare all point to arrays of size -** nIdx. The aIdx array contains the set of integers from 0 to +** nIdx. The aIdx array contains the set of integers from 0 to ** (nIdx-1) in no particular order. This function sorts the values ** in aIdx according to dimension iDim of the cells in aCell. The ** minimum value of dimension iDim is considered first, the @@ -165429,10 +165429,10 @@ static void SortByDistance( */ static void SortByDimension( Rtree *pRtree, - int *aIdx, - int nIdx, - int iDim, - RtreeCell *aCell, + int *aIdx, + int nIdx, + int iDim, + RtreeCell *aCell, int *aSpare ){ if( nIdx>1 ){ @@ -165529,8 +165529,8 @@ static int splitNodeStartree( int nLeft; for( - nLeft=RTREE_MINCELLS(pRtree); - nLeft<=(nCell-RTREE_MINCELLS(pRtree)); + nLeft=RTREE_MINCELLS(pRtree); + nLeft<=(nCell-RTREE_MINCELLS(pRtree)); nLeft++ ){ RtreeCell left; @@ -165585,9 +165585,9 @@ static int splitNodeStartree( static int updateMapping( - Rtree *pRtree, - i64 iRowid, - RtreeNode *pNode, + Rtree *pRtree, + i64 iRowid, + RtreeNode *pNode, int iHeight ){ int (*xSetMapping)(Rtree *, sqlite3_int64, sqlite3_int64); @@ -165623,7 +165623,7 @@ static int SplitNode( RtreeCell leftbbox; RtreeCell rightbbox; - /* Allocate an array and populate it with a copy of pCell and + /* Allocate an array and populate it with a copy of pCell and ** all cells from node pLeft. Then zero the original node. */ aCell = sqlite3_malloc((sizeof(RtreeCell)+sizeof(int))*(nCell+1)); @@ -165740,14 +165740,14 @@ splitnode_out: } /* -** If node pLeaf is not the root of the r-tree and its pParent pointer is +** If node pLeaf is not the root of the r-tree and its pParent pointer is ** still NULL, load all ancestor nodes of pLeaf into memory and populate ** the pLeaf->pParent chain all the way up to the root node. ** ** This operation is required when a row is deleted (or updated - an update ** is implemented as a delete followed by an insert). SQLite provides the ** rowid of the row to delete, which can be used to find the leaf on which -** the entry resides (argument pLeaf). Once the leaf is located, this +** the entry resides (argument pLeaf). Once the leaf is located, this ** function is called to determine its ancestry. */ static int fixLeafParent(Rtree *pRtree, RtreeNode *pLeaf){ @@ -165818,7 +165818,7 @@ static int removeNode(Rtree *pRtree, RtreeNode *pNode, int iHeight){ if( SQLITE_OK!=(rc = sqlite3_reset(pRtree->pDeleteParent)) ){ return rc; } - + /* Remove the node from the in-memory hash table and link it into ** the Rtree.pDeleted list. Its contents will be re-inserted later on. */ @@ -165833,9 +165833,9 @@ static int removeNode(Rtree *pRtree, RtreeNode *pNode, int iHeight){ static int fixBoundingBox(Rtree *pRtree, RtreeNode *pNode){ RtreeNode *pParent = pNode->pParent; - int rc = SQLITE_OK; + int rc = SQLITE_OK; if( pParent ){ - int ii; + int ii; int nCell = NCELL(pNode); RtreeCell box; /* Bounding box for pNode */ nodeGetCell(pRtree, pNode, 0, &box); @@ -165890,9 +165890,9 @@ static int deleteCell(Rtree *pRtree, RtreeNode *pNode, int iCell, int iHeight){ } static int Reinsert( - Rtree *pRtree, - RtreeNode *pNode, - RtreeCell *pCell, + Rtree *pRtree, + RtreeNode *pNode, + RtreeCell *pCell, int iHeight ){ int *aOrder; @@ -165946,7 +165946,7 @@ static int Reinsert( for(ii=0; iinDim; iDim++){ - RtreeDValue coord = (DCOORD(aCell[ii].aCoord[iDim*2+1]) - + RtreeDValue coord = (DCOORD(aCell[ii].aCoord[iDim*2+1]) - DCOORD(aCell[ii].aCoord[iDim*2])); aDistance[ii] += (coord-aCenterCoord[iDim])*(coord-aCenterCoord[iDim]); } @@ -165991,7 +165991,7 @@ static int Reinsert( } /* -** Insert cell pCell into node pNode. Node pNode is the head of a +** Insert cell pCell into node pNode. Node pNode is the head of a ** subtree iHeight high (leaf nodes have iHeight==0). */ static int rtreeInsertCell( @@ -166081,8 +166081,8 @@ static int rtreeDeleteRowid(Rtree *pRtree, sqlite3_int64 iDelete){ /* Obtain a reference to the root node to initialize Rtree.iDepth */ rc = nodeAcquire(pRtree, 1, 0, &pRoot); - /* Obtain a reference to the leaf node that contains the entry - ** about to be deleted. + /* Obtain a reference to the leaf node that contains the entry + ** about to be deleted. */ if( rc==SQLITE_OK ){ rc = findLeafNode(pRtree, iDelete, &pLeaf, 0); @@ -166109,11 +166109,11 @@ static int rtreeDeleteRowid(Rtree *pRtree, sqlite3_int64 iDelete){ } /* Check if the root node now has exactly one child. If so, remove - ** it, schedule the contents of the child for reinsertion and + ** it, schedule the contents of the child for reinsertion and ** reduce the tree height by one. ** ** This is equivalent to copying the contents of the child into - ** the root node (the operation that Gutman's paper says to perform + ** the root node (the operation that Gutman's paper says to perform ** in this scenario). */ if( rc==SQLITE_OK && pRtree->iDepth>0 && NCELL(pRoot)==1 ){ @@ -166182,8 +166182,8 @@ static RtreeValue rtreeValueUp(sqlite3_value *v){ #endif /* !defined(SQLITE_RTREE_INT_ONLY) */ /* -** A constraint has failed while inserting a row into an rtree table. -** Assuming no OOM error occurs, this function sets the error message +** A constraint has failed while inserting a row into an rtree table. +** Assuming no OOM error occurs, this function sets the error message ** (at pRtree->base.zErrMsg) to an appropriate value and returns ** SQLITE_CONSTRAINT. ** @@ -166196,7 +166196,7 @@ static RtreeValue rtreeValueUp(sqlite3_value *v){ */ static int rtreeConstraintError(Rtree *pRtree, int iCol){ sqlite3_stmt *pStmt = 0; - char *zSql; + char *zSql; int rc; assert( iCol==0 || iCol%2 ); @@ -166233,9 +166233,9 @@ static int rtreeConstraintError(Rtree *pRtree, int iCol){ ** The xUpdate method for rtree module virtual tables. */ static int rtreeUpdate( - sqlite3_vtab *pVtab, - int nData, - sqlite3_value **azData, + sqlite3_vtab *pVtab, + int nData, + sqlite3_value **azData, sqlite_int64 *pRowid ){ Rtree *pRtree = (Rtree *)pVtab; @@ -166295,7 +166295,7 @@ static int rtreeUpdate( } } - /* If a rowid value was supplied, check if it is already present in + /* If a rowid value was supplied, check if it is already present in ** the table. If so, the constraint has failed. */ if( sqlite3_value_type(azData[2])!=SQLITE_NULL ){ cell.iRowid = sqlite3_value_int64(azData[2]); @@ -166391,8 +166391,8 @@ static int rtreeRename(sqlite3_vtab *pVtab, const char *zNewName){ "ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";" "ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";" "ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";" - , pRtree->zDb, pRtree->zName, zNewName - , pRtree->zDb, pRtree->zName, zNewName + , pRtree->zDb, pRtree->zName, zNewName + , pRtree->zDb, pRtree->zName, zNewName , pRtree->zDb, pRtree->zName, zNewName ); if( zSql ){ @@ -166474,10 +166474,10 @@ static sqlite3_module rtreeModule = { }; static int rtreeSqlInit( - Rtree *pRtree, - sqlite3 *db, - const char *zDb, - const char *zPrefix, + Rtree *pRtree, + sqlite3 *db, + const char *zDb, + const char *zPrefix, int isCreate ){ int rc = SQLITE_OK; @@ -166535,7 +166535,7 @@ static int rtreeSqlInit( for(i=0; i*2 coordinates. */ static void rtreenode(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){ @@ -166776,7 +166776,7 @@ static void rtreenode(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){ zText = sqlite3_mprintf("{%s}", zCell); } } - + sqlite3_result_text(ctx, zText, -1, sqlite3_free); } @@ -166791,10 +166791,10 @@ static void rtreenode(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){ */ static void rtreedepth(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){ UNUSED_PARAMETER(nArg); - if( sqlite3_value_type(apArg[0])!=SQLITE_BLOB + if( sqlite3_value_type(apArg[0])!=SQLITE_BLOB || sqlite3_value_bytes(apArg[0])<2 ){ - sqlite3_result_error(ctx, "Invalid argument to rtreedepth()", -1); + sqlite3_result_error(ctx, "Invalid argument to rtreedepth()", -1); }else{ u8 *zBlob = (u8 *)sqlite3_value_blob(apArg[0]); sqlite3_result_int(ctx, readInt16(zBlob)); @@ -166803,7 +166803,7 @@ static void rtreedepth(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){ /* ** Register the r-tree module with database handle db. This creates the -** virtual table module "rtree" and the debugging/analysis scalar +** virtual table module "rtree" and the debugging/analysis scalar ** function "rtreenode". */ SQLITE_PRIVATE int sqlite3RtreeInit(sqlite3 *db){ @@ -166922,7 +166922,7 @@ SQLITE_API int sqlite3_rtree_geometry_callback( pGeomCtx->xQueryFunc = 0; pGeomCtx->xDestructor = 0; pGeomCtx->pContext = pContext; - return sqlite3_create_function_v2(db, zGeom, -1, SQLITE_ANY, + return sqlite3_create_function_v2(db, zGeom, -1, SQLITE_ANY, (void *)pGeomCtx, geomCallback, 0, 0, rtreeFreeCallback ); } @@ -166947,7 +166947,7 @@ SQLITE_API int sqlite3_rtree_query_callback( pGeomCtx->xQueryFunc = xQueryFunc; pGeomCtx->xDestructor = xDestructor; pGeomCtx->pContext = pContext; - return sqlite3_create_function_v2(db, zQueryFunc, -1, SQLITE_ANY, + return sqlite3_create_function_v2(db, zQueryFunc, -1, SQLITE_ANY, (void *)pGeomCtx, geomCallback, 0, 0, rtreeFreeCallback ); } @@ -166983,9 +166983,9 @@ SQLITE_API int sqlite3_rtree_init( ************************************************************************* ** $Id: icu.c,v 1.7 2007/12/13 21:54:11 drh Exp $ ** -** This file implements an integration between the ICU library -** ("International Components for Unicode", an open-source library -** for handling unicode data) and SQLite. The integration uses +** This file implements an integration between the ICU library +** ("International Components for Unicode", an open-source library +** for handling unicode data) and SQLite. The integration uses ** ICU to provide the following to SQLite: ** ** * An implementation of the SQL regexp() function (and hence REGEXP @@ -166996,7 +166996,7 @@ SQLITE_API int sqlite3_rtree_init( ** ** * Integration of ICU and SQLite collation sequences. ** -** * An implementation of the LIKE operator that uses ICU to +** * An implementation of the LIKE operator that uses ICU to ** provide case-independent matching. */ @@ -167066,7 +167066,7 @@ static const unsigned char icuUtf8Trans1[] = { /* ** Compare two UTF-8 strings for equality where the first string is -** a "LIKE" expression. Return true (1) if they are the same and +** a "LIKE" expression. Return true (1) if they are the same and ** false (0) if they are different. */ static int icuLikeCompare( @@ -167098,7 +167098,7 @@ static int icuLikeCompare( uint8_t c; /* Skip any MATCH_ALL or MATCH_ONE characters that follow a - ** MATCH_ALL. For each MATCH_ONE, skip one character in the + ** MATCH_ALL. For each MATCH_ONE, skip one character in the ** test string. */ while( (c=*zPattern) == MATCH_ALL || c == MATCH_ONE ){ @@ -167151,15 +167151,15 @@ static int icuLikeCompare( ** ** A LIKE B ** -** is implemented as like(B, A). If there is an escape character E, +** is implemented as like(B, A). If there is an escape character E, ** ** A LIKE B ESCAPE E ** ** is mapped to like(B, A, E). */ static void icuLikeFunc( - sqlite3_context *context, - int argc, + sqlite3_context *context, + int argc, sqlite3_value **argv ){ const unsigned char *zA = sqlite3_value_text(argv[0]); @@ -167185,7 +167185,7 @@ static void icuLikeFunc( if( zE==0 ) return; U8_NEXT(zE, i, nE, uEsc); if( i!=nE){ - sqlite3_result_error(context, + sqlite3_result_error(context, "ESCAPE expression must be a single character", -1); return; } @@ -167200,7 +167200,7 @@ static void icuLikeFunc( ** This function is called when an ICU function called from within ** the implementation of an SQL scalar function returns an error. ** -** The scalar function context passed as the first argument is +** The scalar function context passed as the first argument is ** loaded with an error message based on the following two args. */ static void icuFunctionError( @@ -167226,7 +167226,7 @@ static void icuRegexpDelete(void *p){ /* ** Implementation of SQLite REGEXP operator. This scalar function takes ** two arguments. The first is a regular expression pattern to compile -** the second is a string to match against that pattern. If either +** the second is a string to match against that pattern. If either ** argument is an SQL NULL, then NULL Is returned. Otherwise, the result ** is 1 if the string matches the pattern, or 0 otherwise. ** @@ -167250,8 +167250,8 @@ static void icuRegexpFunc(sqlite3_context *p, int nArg, sqlite3_value **apArg){ (void)nArg; /* Unused parameter */ - /* If the left hand side of the regexp operator is NULL, - ** then the result is also NULL. + /* If the left hand side of the regexp operator is NULL, + ** then the result is also NULL. */ if( !zString ){ return; @@ -167289,7 +167289,7 @@ static void icuRegexpFunc(sqlite3_context *p, int nArg, sqlite3_value **apArg){ } /* Set the text that the regular expression operates on to a NULL - ** pointer. This is not really necessary, but it is tidier than + ** pointer. This is not really necessary, but it is tidier than ** leaving the regular expression object configured with an invalid ** pointer after this function returns. */ @@ -167300,7 +167300,7 @@ static void icuRegexpFunc(sqlite3_context *p, int nArg, sqlite3_value **apArg){ } /* -** Implementations of scalar functions for case mapping - upper() and +** Implementations of scalar functions for case mapping - upper() and ** lower(). Function upper() converts its input to upper-case (ABC). ** Function lower() converts to lower-case (abc). ** @@ -167308,7 +167308,7 @@ static void icuRegexpFunc(sqlite3_context *p, int nArg, sqlite3_value **apArg){ ** "language specific". Refer to ICU documentation for the differences ** between the two. ** -** To utilise "general" case mapping, the upper() or lower() scalar +** To utilise "general" case mapping, the upper() or lower() scalar ** functions are invoked with one argument: ** ** upper('ABC') -> 'abc' @@ -167414,7 +167414,7 @@ static int icuCollationColl( /* ** Implementation of the scalar function icu_load_collation(). ** -** This scalar function is used to add ICU collation based collation +** This scalar function is used to add ICU collation based collation ** types to an SQLite database connection. It is intended to be called ** as follows: ** @@ -167425,8 +167425,8 @@ static int icuCollationColl( ** collation sequence to create. */ static void icuLoadCollation( - sqlite3_context *p, - int nArg, + sqlite3_context *p, + int nArg, sqlite3_value **apArg ){ sqlite3 *db = (sqlite3 *)sqlite3_user_data(p); @@ -167452,7 +167452,7 @@ static void icuLoadCollation( } assert(p); - rc = sqlite3_create_collation_v2(db, zName, SQLITE_UTF16, (void *)pUCollator, + rc = sqlite3_create_collation_v2(db, zName, SQLITE_UTF16, (void *)pUCollator, icuCollationColl, icuCollationDel ); if( rc!=SQLITE_OK ){ @@ -167488,11 +167488,11 @@ SQLITE_PRIVATE int sqlite3IcuInit(sqlite3 *db){ int rc = SQLITE_OK; int i; - + for(i=0; rc==SQLITE_OK && i<(int)(sizeof(scalars)/sizeof(scalars[0])); i++){ const struct IcuScalar *p = &scalars[i]; rc = sqlite3_create_function( - db, p->zName, p->nArg, p->enc, + db, p->zName, p->nArg, p->enc, p->iContext ? (void*)db : (void*)0, p->xFunc, 0, 0 ); @@ -167506,7 +167506,7 @@ SQLITE_PRIVATE int sqlite3IcuInit(sqlite3 *db){ __declspec(dllexport) #endif SQLITE_API int sqlite3_icu_init( - sqlite3 *db, + sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ @@ -167609,7 +167609,7 @@ static int icuDestroy(sqlite3_tokenizer *pTokenizer){ /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is pInput[0..nBytes-1]. A cursor -** used to incrementally tokenize this string is returned in +** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int icuOpen( @@ -167651,7 +167651,7 @@ static int icuOpen( pCsr->aOffset = (int *)&pCsr->aChar[(nChar+3)&~3]; pCsr->aOffset[iOut] = iInput; - U8_NEXT(zInput, iInput, nInput, c); + U8_NEXT(zInput, iInput, nInput, c); while( c>0 ){ int isError = 0; c = u_foldCase(c, opt); @@ -167797,7 +167797,7 @@ SQLITE_PRIVATE void sqlite3Fts3IcuTokenizerModule( ************************************************************************* ** ** -** OVERVIEW +** OVERVIEW ** ** The RBU extension requires that the RBU update be packaged as an ** SQLite database. The tables it expects to find are described in @@ -167805,34 +167805,34 @@ SQLITE_PRIVATE void sqlite3Fts3IcuTokenizerModule( ** that the user wishes to write to, a corresponding data_xyz table is ** created in the RBU database and populated with one row for each row to ** update, insert or delete from the target table. -** +** ** The update proceeds in three stages: -** +** ** 1) The database is updated. The modified database pages are written ** to a *-oal file. A *-oal file is just like a *-wal file, except ** that it is named "-oal" instead of "-wal". ** Because regular SQLite clients do not look for file named ** "-oal", they go on using the original database in ** rollback mode while the *-oal file is being generated. -** +** ** During this stage RBU does not update the database by writing ** directly to the target tables. Instead it creates "imposter" ** tables using the SQLITE_TESTCTRL_IMPOSTER interface that it uses ** to update each b-tree individually. All updates required by each ** b-tree are completed before moving on to the next, and all ** updates are done in sorted key order. -** +** ** 2) The "-oal" file is moved to the equivalent "-wal" ** location using a call to rename(2). Before doing this the RBU ** module takes an EXCLUSIVE lock on the database file, ensuring ** that there are no other active readers. -** +** ** Once the EXCLUSIVE lock is released, any other database readers ** detect the new *-wal file and read the database in wal mode. At ** this point they see the new version of the database - including ** the updates made as part of the RBU update. -** -** 3) The new *-wal file is checkpointed. This proceeds in the same way +** +** 3) The new *-wal file is checkpointed. This proceeds in the same way ** as a regular database checkpoint, except that a single frame is ** checkpointed each time sqlite3rbu_step() is called. If the RBU ** handle is closed before the entire *-wal file is checkpointed, @@ -167841,7 +167841,7 @@ SQLITE_PRIVATE void sqlite3Fts3IcuTokenizerModule( ** the future. ** ** POTENTIAL PROBLEMS -** +** ** The rename() call might not be portable. And RBU is not currently ** syncing the directory after renaming the file. ** @@ -167863,7 +167863,7 @@ SQLITE_PRIVATE void sqlite3Fts3IcuTokenizerModule( ** fields are collected. This means we're probably writing a lot more ** data to disk when saving the state of an ongoing update to the RBU ** update database than is strictly necessary. -** +** */ /* #include */ @@ -167887,42 +167887,42 @@ SQLITE_PRIVATE void sqlite3Fts3IcuTokenizerModule( ** ************************************************************************* ** -** This file contains the public interface for the RBU extension. +** This file contains the public interface for the RBU extension. */ /* ** SUMMARY ** -** Writing a transaction containing a large number of operations on +** Writing a transaction containing a large number of operations on ** b-tree indexes that are collectively larger than the available cache -** memory can be very inefficient. +** memory can be very inefficient. ** ** The problem is that in order to update a b-tree, the leaf page (at least) ** containing the entry being inserted or deleted must be modified. If the -** working set of leaves is larger than the available cache memory, then a -** single leaf that is modified more than once as part of the transaction +** working set of leaves is larger than the available cache memory, then a +** single leaf that is modified more than once as part of the transaction ** may be loaded from or written to the persistent media multiple times. ** Additionally, because the index updates are likely to be applied in -** random order, access to pages within the database is also likely to be in +** random order, access to pages within the database is also likely to be in ** random order, which is itself quite inefficient. ** ** One way to improve the situation is to sort the operations on each index ** by index key before applying them to the b-tree. This leads to an IO ** pattern that resembles a single linear scan through the index b-tree, -** and all but guarantees each modified leaf page is loaded and stored +** and all but guarantees each modified leaf page is loaded and stored ** exactly once. SQLite uses this trick to improve the performance of ** CREATE INDEX commands. This extension allows it to be used to improve ** the performance of large transactions on existing databases. ** -** Additionally, this extension allows the work involved in writing the -** large transaction to be broken down into sub-transactions performed -** sequentially by separate processes. This is useful if the system cannot -** guarantee that a single update process will run for long enough to apply -** the entire update, for example because the update is being applied on a -** mobile device that is frequently rebooted. Even after the writer process +** Additionally, this extension allows the work involved in writing the +** large transaction to be broken down into sub-transactions performed +** sequentially by separate processes. This is useful if the system cannot +** guarantee that a single update process will run for long enough to apply +** the entire update, for example because the update is being applied on a +** mobile device that is frequently rebooted. Even after the writer process ** has committed one or more sub-transactions, other database clients continue -** to read from the original database snapshot. In other words, partially -** applied transactions are not visible to other clients. +** to read from the original database snapshot. In other words, partially +** applied transactions are not visible to other clients. ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction @@ -167938,9 +167938,9 @@ SQLITE_PRIVATE void sqlite3Fts3IcuTokenizerModule( ** ** * INSERT statements may not use any default values. ** -** * UPDATE and DELETE statements must identify their target rows by +** * UPDATE and DELETE statements must identify their target rows by ** non-NULL PRIMARY KEY values. Rows with NULL values stored in PRIMARY -** KEY fields may not be updated or deleted. If the table being written +** KEY fields may not be updated or deleted. If the table being written ** has no PRIMARY KEY, affected rows must be identified by rowid. ** ** * UPDATE statements may not modify PRIMARY KEY columns. @@ -167957,10 +167957,10 @@ SQLITE_PRIVATE void sqlite3Fts3IcuTokenizerModule( ** PREPARATION ** ** An "RBU update" is stored as a separate SQLite database. A database -** containing an RBU update is an "RBU database". For each table in the +** containing an RBU update is an "RBU database". For each table in the ** target database to be updated, the RBU database should contain a table ** named "data_" containing the same set of columns as the -** target table, and one more - "rbu_control". The data_% table should +** target table, and one more - "rbu_control". The data_% table should ** have no PRIMARY KEY or UNIQUE constraints, but each column should have ** the same type as the corresponding column in the target database. ** The "rbu_control" column should have no type at all. For example, if @@ -167975,22 +167975,22 @@ SQLITE_PRIVATE void sqlite3Fts3IcuTokenizerModule( ** The order of the columns in the data_% table does not matter. ** ** Instead of a regular table, the RBU database may also contain virtual -** tables or view named using the data_ naming scheme. +** tables or view named using the data_ naming scheme. ** -** Instead of the plain data_ naming scheme, RBU database tables +** Instead of the plain data_ naming scheme, RBU database tables ** may also be named data_, where is any sequence ** of zero or more numeric characters (0-9). This can be significant because -** tables within the RBU database are always processed in order sorted by +** tables within the RBU database are always processed in order sorted by ** name. By judicious selection of the portion of the names ** of the RBU tables the user can therefore control the order in which they ** are processed. This can be useful, for example, to ensure that "external ** content" FTS4 tables are updated before their underlying content tables. ** ** If the target database table is a virtual table or a table that has no -** PRIMARY KEY declaration, the data_% table must also contain a column -** named "rbu_rowid". This column is mapped to the tables implicit primary -** key column - "rowid". Virtual tables for which the "rowid" column does -** not function like a primary key value cannot be updated using RBU. For +** PRIMARY KEY declaration, the data_% table must also contain a column +** named "rbu_rowid". This column is mapped to the tables implicit primary +** key column - "rowid". Virtual tables for which the "rowid" column does +** not function like a primary key value cannot be updated using RBU. For ** example, if the target db contains either of the following: ** ** CREATE VIRTUAL TABLE x1 USING fts3(a, b); @@ -168013,35 +168013,35 @@ SQLITE_PRIVATE void sqlite3Fts3IcuTokenizerModule( ** CREATE TABLE data_ft1(a, b, langid, rbu_rowid, rbu_control); ** CREATE TABLE data_ft1(a, b, rbu_rowid, rbu_control); ** -** For each row to INSERT into the target database as part of the RBU +** For each row to INSERT into the target database as part of the RBU ** update, the corresponding data_% table should contain a single record ** with the "rbu_control" column set to contain integer value 0. The -** other columns should be set to the values that make up the new record -** to insert. +** other columns should be set to the values that make up the new record +** to insert. ** -** If the target database table has an INTEGER PRIMARY KEY, it is not -** possible to insert a NULL value into the IPK column. Attempting to +** If the target database table has an INTEGER PRIMARY KEY, it is not +** possible to insert a NULL value into the IPK column. Attempting to ** do so results in an SQLITE_MISMATCH error. ** -** For each row to DELETE from the target database as part of the RBU +** For each row to DELETE from the target database as part of the RBU ** update, the corresponding data_% table should contain a single record ** with the "rbu_control" column set to contain integer value 1. The ** real primary key values of the row to delete should be stored in the ** corresponding columns of the data_% table. The values stored in the ** other columns are not used. ** -** For each row to UPDATE from the target database as part of the RBU +** For each row to UPDATE from the target database as part of the RBU ** update, the corresponding data_% table should contain a single record ** with the "rbu_control" column set to contain a value of type text. -** The real primary key values identifying the row to update should be +** The real primary key values identifying the row to update should be ** stored in the corresponding columns of the data_% table row, as should -** the new values of all columns being update. The text value in the +** the new values of all columns being update. The text value in the ** "rbu_control" column must contain the same number of characters as ** there are columns in the target database table, and must consist entirely -** of 'x' and '.' characters (or in some special cases 'd' - see below). For +** of 'x' and '.' characters (or in some special cases 'd' - see below). For ** each column that is being updated, the corresponding character is set to ** 'x'. For those that remain as they are, the corresponding character of the -** rbu_control value should be set to '.'. For example, given the tables +** rbu_control value should be set to '.'. For example, given the tables ** above, the update statement: ** ** UPDATE t1 SET c = 'usa' WHERE a = 4; @@ -168055,30 +168055,30 @@ SQLITE_PRIVATE void sqlite3Fts3IcuTokenizerModule( ** target table with the value stored in the corresponding data_% column, the ** user-defined SQL function "rbu_delta()" is invoked and the result stored in ** the target table column. rbu_delta() is invoked with two arguments - the -** original value currently stored in the target table column and the +** original value currently stored in the target table column and the ** value specified in the data_xxx table. ** ** For example, this row: ** ** INSERT INTO data_t1(a, b, c, rbu_control) VALUES(4, NULL, 'usa', '..d'); ** -** is similar to an UPDATE statement such as: +** is similar to an UPDATE statement such as: ** ** UPDATE t1 SET c = rbu_delta(c, 'usa') WHERE a = 4; ** -** Finally, if an 'f' character appears in place of a 'd' or 's' in an +** Finally, if an 'f' character appears in place of a 'd' or 's' in an ** ota_control string, the contents of the data_xxx table column is assumed ** to be a "fossil delta" - a patch to be applied to a blob value in the ** format used by the fossil source-code management system. In this case -** the existing value within the target database table must be of type BLOB. +** the existing value within the target database table must be of type BLOB. ** It is replaced by the result of applying the specified fossil delta to ** itself. ** ** If the target database table is a virtual table or a table with no PRIMARY -** KEY, the rbu_control value should not include a character corresponding +** KEY, the rbu_control value should not include a character corresponding ** to the rbu_rowid value. For example, this: ** -** INSERT INTO data_ft1(a, b, rbu_rowid, rbu_control) +** INSERT INTO data_ft1(a, b, rbu_rowid, rbu_control) ** VALUES(NULL, 'usa', 12, '.x'); ** ** causes a result similar to: @@ -168088,14 +168088,14 @@ SQLITE_PRIVATE void sqlite3Fts3IcuTokenizerModule( ** The data_xxx tables themselves should have no PRIMARY KEY declarations. ** However, RBU is more efficient if reading the rows in from each data_xxx ** table in "rowid" order is roughly the same as reading them sorted by -** the PRIMARY KEY of the corresponding target database table. In other -** words, rows should be sorted using the destination table PRIMARY KEY +** the PRIMARY KEY of the corresponding target database table. In other +** words, rows should be sorted using the destination table PRIMARY KEY ** fields before they are inserted into the data_xxx tables. ** ** USAGE ** -** The API declared below allows an application to apply an RBU update -** stored on disk to an existing target database. Essentially, the +** The API declared below allows an application to apply an RBU update +** stored on disk to an existing target database. Essentially, the ** application: ** ** 1) Opens an RBU handle using the sqlite3rbu_open() function. @@ -168106,24 +168106,24 @@ SQLITE_PRIVATE void sqlite3Fts3IcuTokenizerModule( ** ** 3) Calls the sqlite3rbu_step() function one or more times on ** the new handle. Each call to sqlite3rbu_step() performs a single -** b-tree operation, so thousands of calls may be required to apply +** b-tree operation, so thousands of calls may be required to apply ** a complete update. ** ** 4) Calls sqlite3rbu_close() to close the RBU update handle. If ** sqlite3rbu_step() has been called enough times to completely ** apply the update to the target database, then the RBU database -** is marked as fully applied. Otherwise, the state of the RBU -** update application is saved in the RBU database for later +** is marked as fully applied. Otherwise, the state of the RBU +** update application is saved in the RBU database for later ** resumption. ** ** See comments below for more detail on APIs. ** ** If an update is only partially applied to the target database by the -** time sqlite3rbu_close() is called, various state information is saved +** time sqlite3rbu_close() is called, various state information is saved ** within the RBU database. This allows subsequent processes to automatically ** resume the RBU update from where it left off. ** -** To remove all RBU extension state information, returning an RBU database +** To remove all RBU extension state information, returning an RBU database ** to its original contents, it is sufficient to drop all tables that begin ** with the prefix "rbu_" ** @@ -168159,21 +168159,21 @@ typedef struct sqlite3rbu sqlite3rbu; ** the path to the RBU database. Each call to this function must be matched ** by a call to sqlite3rbu_close(). When opening the databases, RBU passes ** the SQLITE_CONFIG_URI flag to sqlite3_open_v2(). So if either zTarget -** or zRbu begin with "file:", it will be interpreted as an SQLite +** or zRbu begin with "file:", it will be interpreted as an SQLite ** database URI, not a regular file name. ** -** If the zState argument is passed a NULL value, the RBU extension stores -** the current state of the update (how many rows have been updated, which +** If the zState argument is passed a NULL value, the RBU extension stores +** the current state of the update (how many rows have been updated, which ** indexes are yet to be updated etc.) within the RBU database itself. This ** can be convenient, as it means that the RBU application does not need to -** organize removing a separate state file after the update is concluded. -** Or, if zState is non-NULL, it must be a path to a database file in which +** organize removing a separate state file after the update is concluded. +** Or, if zState is non-NULL, it must be a path to a database file in which ** the RBU extension can store the state of the update. ** ** When resuming an RBU update, the zState argument must be passed the same ** value as when the RBU update was started. ** -** Once the RBU update is finished, the RBU extension does not +** Once the RBU update is finished, the RBU extension does not ** automatically remove any zState database file, even if it created it. ** ** By default, RBU uses the default VFS to access the files on disk. To @@ -168186,7 +168186,7 @@ typedef struct sqlite3rbu sqlite3rbu; ** the zipvfs_create_vfs() API below for details on using RBU with zipvfs. */ SQLITE_API sqlite3rbu *sqlite3rbu_open( - const char *zTarget, + const char *zTarget, const char *zRbu, const char *zState ); @@ -168196,13 +168196,13 @@ SQLITE_API sqlite3rbu *sqlite3rbu_open( ** An RBU vacuum is similar to SQLite's built-in VACUUM command, except ** that it can be suspended and resumed like an RBU update. ** -** The second argument to this function identifies a database in which -** to store the state of the RBU vacuum operation if it is suspended. The +** The second argument to this function identifies a database in which +** to store the state of the RBU vacuum operation if it is suspended. The ** first time sqlite3rbu_vacuum() is called, to start an RBU vacuum ** operation, the state database should either not exist or be empty -** (contain no tables). If an RBU vacuum is suspended by calling +** (contain no tables). If an RBU vacuum is suspended by calling ** sqlite3rbu_close() on the RBU handle before sqlite3rbu_step() has -** returned SQLITE_DONE, the vacuum state is stored in the state database. +** returned SQLITE_DONE, the vacuum state is stored in the state database. ** The vacuum can be resumed by calling this function to open a new RBU ** handle specifying the same target and state databases. ** @@ -168216,21 +168216,21 @@ SQLITE_API sqlite3rbu *sqlite3rbu_open( ** is completed, even if it created it. However, if the call to ** sqlite3rbu_close() returns any value other than SQLITE_OK, the contents ** of the state tables within the state database are zeroed. This way, -** the next call to sqlite3rbu_vacuum() opens a handle that starts a +** the next call to sqlite3rbu_vacuum() opens a handle that starts a ** new RBU vacuum operation. ** ** As with sqlite3rbu_open(), Zipvfs users should rever to the comment -** describing the sqlite3rbu_create_vfs() API function below for -** a description of the complications associated with using RBU with +** describing the sqlite3rbu_create_vfs() API function below for +** a description of the complications associated with using RBU with ** zipvfs databases. */ SQLITE_API sqlite3rbu *sqlite3rbu_vacuum( - const char *zTarget, + const char *zTarget, const char *zState ); /* -** Internally, each RBU connection uses a separate SQLite database +** Internally, each RBU connection uses a separate SQLite database ** connection to access the target and rbu update databases. This ** API allows the application direct access to these database handles. ** @@ -168241,10 +168241,10 @@ SQLITE_API sqlite3rbu *sqlite3rbu_vacuum( ** following scenarios: ** ** * If any target tables are virtual tables, it may be necessary to -** call sqlite3_create_module() on the target database handle to +** call sqlite3_create_module() on the target database handle to ** register the required virtual table implementations. ** -** * If the data_xxx tables in the RBU source database are virtual +** * If the data_xxx tables in the RBU source database are virtual ** tables, the application may need to call sqlite3_create_module() on ** the rbu update db handle to any required virtual table ** implementations. @@ -168263,12 +168263,12 @@ SQLITE_API sqlite3rbu *sqlite3rbu_vacuum( SQLITE_API sqlite3 *sqlite3rbu_db(sqlite3rbu*, int bRbu); /* -** Do some work towards applying the RBU update to the target db. +** Do some work towards applying the RBU update to the target db. ** -** Return SQLITE_DONE if the update has been completely applied, or +** Return SQLITE_DONE if the update has been completely applied, or ** SQLITE_OK if no error occurs but there remains work to do to apply -** the RBU update. If an error does occur, some other error code is -** returned. +** the RBU update. If an error does occur, some other error code is +** returned. ** ** Once a call to sqlite3rbu_step() has returned a value other than ** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops @@ -168281,7 +168281,7 @@ SQLITE_API int sqlite3rbu_step(sqlite3rbu *pRbu); ** ** If a power failure or application crash occurs during an update, following ** system recovery RBU may resume the update from the point at which the state -** was last saved. In other words, from the most recent successful call to +** was last saved. In other words, from the most recent successful call to ** sqlite3rbu_close() or this function. ** ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. @@ -168289,7 +168289,7 @@ SQLITE_API int sqlite3rbu_step(sqlite3rbu *pRbu); SQLITE_API int sqlite3rbu_savestate(sqlite3rbu *pRbu); /* -** Close an RBU handle. +** Close an RBU handle. ** ** If the RBU update has been completely applied, mark the RBU database ** as fully applied. Otherwise, assuming no error has occurred, save the @@ -168299,24 +168299,24 @@ SQLITE_API int sqlite3rbu_savestate(sqlite3rbu *pRbu); ** or sqlite3rbu_open() call, or if one occurs within this function, an ** SQLite error code is returned. Additionally, *pzErrmsg may be set to ** point to a buffer containing a utf-8 formatted English language error -** message. It is the responsibility of the caller to eventually free any +** message. It is the responsibility of the caller to eventually free any ** such buffer using sqlite3_free(). ** ** Otherwise, if no error occurs, this function returns SQLITE_OK if the -** update has been partially applied, or SQLITE_DONE if it has been +** update has been partially applied, or SQLITE_DONE if it has been ** completely applied. */ SQLITE_API int sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg); /* -** Return the total number of key-value operations (inserts, deletes or +** Return the total number of key-value operations (inserts, deletes or ** updates) that have been performed on the target database since the ** current RBU update was started. */ SQLITE_API sqlite3_int64 sqlite3rbu_progress(sqlite3rbu *pRbu); /* -** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100) +** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100) ** progress indications for the two stages of an RBU update. This API may ** be useful for driving GUI progress indicators and similar. ** @@ -168329,16 +168329,16 @@ SQLITE_API sqlite3_int64 sqlite3rbu_progress(sqlite3rbu *pRbu); ** The update is visible to non-RBU clients during stage 2. During stage 1 ** non-RBU reader clients may see the original database. ** -** If this API is called during stage 2 of the update, output variable +** If this API is called during stage 2 of the update, output variable ** (*pnOne) is set to 10000 to indicate that stage 1 has finished and (*pnTwo) ** to a value between 0 and 10000 to indicate the permyriadage progress of -** stage 2. A value of 5000 indicates that stage 2 is half finished, +** stage 2. A value of 5000 indicates that stage 2 is half finished, ** 9000 indicates that it is 90% finished, and so on. ** -** If this API is called during stage 1 of the update, output variable +** If this API is called during stage 1 of the update, output variable ** (*pnTwo) is set to 0 to indicate that stage 2 has not yet started. The -** value to which (*pnOne) is set depends on whether or not the RBU -** database contains an "rbu_count" table. The rbu_count table, if it +** value to which (*pnOne) is set depends on whether or not the RBU +** database contains an "rbu_count" table. The rbu_count table, if it ** exists, must contain the same columns as the following: ** ** CREATE TABLE rbu_count(tbl TEXT PRIMARY KEY, cnt INTEGER) WITHOUT ROWID; @@ -168397,20 +168397,20 @@ SQLITE_API int sqlite3rbu_state(sqlite3rbu *pRbu); /* ** Create an RBU VFS named zName that accesses the underlying file-system -** via existing VFS zParent. Or, if the zParent parameter is passed NULL, +** via existing VFS zParent. Or, if the zParent parameter is passed NULL, ** then the new RBU VFS uses the default system VFS to access the file-system. -** The new object is registered as a non-default VFS with SQLite before +** The new object is registered as a non-default VFS with SQLite before ** returning. ** ** Part of the RBU implementation uses a custom VFS object. Usually, this -** object is created and deleted automatically by RBU. +** object is created and deleted automatically by RBU. ** ** The exception is for applications that also use zipvfs. In this case, ** the custom VFS must be explicitly created by the user before the RBU ** handle is opened. The RBU VFS should be installed so that the zipvfs -** VFS uses the RBU VFS, which in turn uses any other VFS layers in use +** VFS uses the RBU VFS, which in turn uses any other VFS layers in use ** (for example multiplexor) to access the file-system. For example, -** to assemble an RBU enabled VFS stack that uses both zipvfs and +** to assemble an RBU enabled VFS stack that uses both zipvfs and ** multiplexor (error checking omitted): ** ** // Create a VFS named "multiplex" (not the default). @@ -168432,9 +168432,9 @@ SQLITE_API int sqlite3rbu_state(sqlite3rbu *pRbu); ** may be used by RBU clients. Attempting to use RBU with a zipvfs VFS stack ** that does not include the RBU layer results in an error. ** -** The overhead of adding the "rbu" VFS to the system is negligible for -** non-RBU users. There is no harm in an application accessing the -** file-system via "rbu" all the time, even if it only uses RBU functionality +** The overhead of adding the "rbu" VFS to the system is negligible for +** non-RBU users. There is no harm in an application accessing the +** file-system via "rbu" all the time, even if it only uses RBU functionality ** occasionally. */ SQLITE_API int sqlite3rbu_create_vfs(const char *zName, const char *zParent); @@ -168480,17 +168480,17 @@ SQLITE_API void sqlite3rbu_destroy_vfs(const char *zName); ** RBU_STATE_STAGE: ** May be set to integer values 1, 2, 4 or 5. As follows: ** 1: the *-rbu file is currently under construction. -** 2: the *-rbu file has been constructed, but not yet moved +** 2: the *-rbu file has been constructed, but not yet moved ** to the *-wal path. ** 4: the checkpoint is underway. ** 5: the rbu update has been checkpointed. ** ** RBU_STATE_TBL: -** Only valid if STAGE==1. The target database name of the table +** Only valid if STAGE==1. The target database name of the table ** currently being written. ** ** RBU_STATE_IDX: -** Only valid if STAGE==1. The target database name of the index +** Only valid if STAGE==1. The target database name of the index ** currently being written, or NULL if the main table is currently being ** updated. ** @@ -168510,7 +168510,7 @@ SQLITE_API void sqlite3rbu_destroy_vfs(const char *zName); ** be continued if this happens). ** ** RBU_STATE_COOKIE: -** Valid if STAGE==1. The current change-counter cookie value in the +** Valid if STAGE==1. The current change-counter cookie value in the ** target db file. ** ** RBU_STATE_OALSZ: @@ -168587,7 +168587,7 @@ struct RbuUpdateStmt { ** the target database that require updating. For each such table, the ** iterator visits, in order: ** -** * the table itself, +** * the table itself, ** * each index of the table (zero or more points to visit), and ** * a special "cleanup table" state. ** @@ -168596,7 +168596,7 @@ struct RbuUpdateStmt { ** it points to an array of flags nTblCol elements in size. The flag is ** set for each column that is either a part of the PK or a part of an ** index. Or clear otherwise. -** +** */ struct RbuObjIter { sqlite3_stmt *pTblIter; /* Iterate through tables */ @@ -168675,7 +168675,7 @@ struct RbuFrame { ** ** nPhaseOneStep: ** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to +** a running estimate of the number of b-tree operations required to ** finish populating the *-oal file. This allows the sqlite3_bp_progress() ** API to calculate the permyriadage progress of populating the *-oal file ** using the formula: @@ -168695,7 +168695,7 @@ struct RbuFrame { ** ** * the RBU update contains any UPDATE operations. If the PK specified ** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the +** no b-tree operations are required on index b-trees. Or if the ** specified PK does exist, then (nIndex*2) such operations are ** required (one delete and one insert on each index b-tree). ** @@ -169034,7 +169034,7 @@ static void rbuFossilDeltaFunc( /* ** Prepare the SQL statement in buffer zSql against database handle db. ** If successful, set *ppStmt to point to the new statement and return -** SQLITE_OK. +** SQLITE_OK. ** ** Otherwise, if an error does occur, set *ppStmt to NULL and return ** an SQLite error code. Additionally, set output variable *pzErrmsg to @@ -169042,7 +169042,7 @@ static void rbuFossilDeltaFunc( ** of the caller to (eventually) free this buffer using sqlite3_free(). */ static int prepareAndCollectError( - sqlite3 *db, + sqlite3 *db, sqlite3_stmt **ppStmt, char **pzErrmsg, const char *zSql @@ -169074,9 +169074,9 @@ static int resetAndCollectError(sqlite3_stmt *pStmt, char **pzErrmsg){ /* ** Unless it is NULL, argument zSql points to a buffer allocated using ** sqlite3_malloc containing an SQL statement. This function prepares the SQL -** statement against database db and frees the buffer. If statement -** compilation is successful, *ppStmt is set to point to the new statement -** handle and SQLITE_OK is returned. +** statement against database db and frees the buffer. If statement +** compilation is successful, *ppStmt is set to point to the new statement +** handle and SQLITE_OK is returned. ** ** Otherwise, if an error occurs, *ppStmt is set to NULL and an error code ** returned. In this case, *pzErrmsg may also be set to point to an error @@ -169087,7 +169087,7 @@ static int resetAndCollectError(sqlite3_stmt *pStmt, char **pzErrmsg){ ** In this case SQLITE_NOMEM is returned and *ppStmt set to NULL. */ static int prepareFreeAndCollectError( - sqlite3 *db, + sqlite3 *db, sqlite3_stmt **ppStmt, char **pzErrmsg, char *zSql @@ -169142,7 +169142,7 @@ static void rbuObjIterClearStatements(RbuObjIter *pIter){ sqlite3_free(pUp); pUp = pTmp; } - + pIter->pSelect = 0; pIter->pInsert = 0; pIter->pDelete = 0; @@ -169166,16 +169166,16 @@ static void rbuObjIterFinalize(RbuObjIter *pIter){ /* ** Advance the iterator to the next position. ** -** If no error occurs, SQLITE_OK is returned and the iterator is left -** pointing to the next entry. Otherwise, an error code and message is -** left in the RBU handle passed as the first argument. A copy of the +** If no error occurs, SQLITE_OK is returned and the iterator is left +** pointing to the next entry. Otherwise, an error code and message is +** left in the RBU handle passed as the first argument. A copy of the ** error code is returned. */ static int rbuObjIterNext(sqlite3rbu *p, RbuObjIter *pIter){ int rc = p->rc; if( rc==SQLITE_OK ){ - /* Free any SQLite statements used while processing the previous object */ + /* Free any SQLite statements used while processing the previous object */ rbuObjIterClearStatements(pIter); if( pIter->zIdx==0 ){ rc = sqlite3_exec(p->dbMain, @@ -169234,7 +169234,7 @@ static int rbuObjIterNext(sqlite3rbu *p, RbuObjIter *pIter){ ** The implementation of the rbu_target_name() SQL function. This function ** accepts one or two arguments. The first argument is the name of a table - ** the name of a table in the RBU database. The second, if it is present, is 1 -** for a view or 0 for a table. +** for a view or 0 for a table. ** ** For a non-vacuum RBU handle, if the table name matches the pattern: ** @@ -169281,16 +169281,16 @@ static void rbuTargetNameFunc( /* ** Initialize the iterator structure passed as the second argument. ** -** If no error occurs, SQLITE_OK is returned and the iterator is left -** pointing to the first entry. Otherwise, an error code and message is -** left in the RBU handle passed as the first argument. A copy of the +** If no error occurs, SQLITE_OK is returned and the iterator is left +** pointing to the first entry. Otherwise, an error code and message is +** left in the RBU handle passed as the first argument. A copy of the ** error code is returned. */ static int rbuObjIterFirst(sqlite3rbu *p, RbuObjIter *pIter){ int rc; memset(pIter, 0, sizeof(RbuObjIter)); - rc = prepareFreeAndCollectError(p->dbRbu, &pIter->pTblIter, &p->zErrmsg, + rc = prepareFreeAndCollectError(p->dbRbu, &pIter->pTblIter, &p->zErrmsg, sqlite3_mprintf( "SELECT rbu_target_name(name, type='view') AS target, name " "FROM sqlite_master " @@ -169318,7 +169318,7 @@ static int rbuObjIterFirst(sqlite3rbu *p, RbuObjIter *pIter){ ** ** If an error has already occurred (p->rc is already set to something other ** than SQLITE_OK), then this function returns NULL without modifying the -** stored error code. In this case it still calls sqlite3_free() on any +** stored error code. In this case it still calls sqlite3_free() on any ** printf() parameters associated with %z conversions. */ static char *rbuMPrintf(sqlite3rbu *p, const char *zFmt, ...){ @@ -169364,12 +169364,12 @@ static int rbuMPrintfExec(sqlite3rbu *p, sqlite3 *db, const char *zFmt, ...){ } /* -** Attempt to allocate and return a pointer to a zeroed block of nByte -** bytes. +** Attempt to allocate and return a pointer to a zeroed block of nByte +** bytes. ** -** If an error (i.e. an OOM condition) occurs, return NULL and leave an -** error code in the rbu handle passed as the first argument. Or, if an -** error has already occurred when this function is called, return NULL +** If an error (i.e. an OOM condition) occurs, return NULL and leave an +** error code in the rbu handle passed as the first argument. Or, if an +** error has already occurred when this function is called, return NULL ** immediately without attempting the allocation or modifying the stored ** error code. */ @@ -169465,7 +169465,7 @@ static void rbuFinalize(sqlite3rbu *p, sqlite3_stmt *pStmt){ ** RBU_PK_VTAB: Table is a virtual table. ** ** Argument *piPk is also of type (int*), and also points to an output -** parameter. Unless the table has an external primary key index +** parameter. Unless the table has an external primary key index ** (i.e. unless *peType is set to 3), then *piPk is set to zero. Or, ** if the table does have an external primary key index, then *piPk ** is set to the root page number of the primary key index before @@ -169500,7 +169500,7 @@ static void rbuTableType( /* ** 0) SELECT count(*) FROM sqlite_master where name=%Q AND IsVirtual(%Q) ** 1) PRAGMA index_list = ? - ** 2) SELECT count(*) FROM sqlite_master where name=%Q + ** 2) SELECT count(*) FROM sqlite_master where name=%Q ** 3) PRAGMA table_info = ? */ sqlite3_stmt *aStmt[4] = {0, 0, 0, 0}; @@ -169509,7 +169509,7 @@ static void rbuTableType( *piPk = 0; assert( p->rc==SQLITE_OK ); - p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[0], &p->zErrmsg, + p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[0], &p->zErrmsg, sqlite3_mprintf( "SELECT (sql LIKE 'create virtual%%'), rootpage" " FROM sqlite_master" @@ -169525,7 +169525,7 @@ static void rbuTableType( } *piTnum = sqlite3_column_int(aStmt[0], 1); - p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[1], &p->zErrmsg, + p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[1], &p->zErrmsg, sqlite3_mprintf("PRAGMA index_list=%Q",zTab) ); if( p->rc ) goto rbuTableType_end; @@ -169533,7 +169533,7 @@ static void rbuTableType( const u8 *zOrig = sqlite3_column_text(aStmt[1], 3); const u8 *zIdx = sqlite3_column_text(aStmt[1], 1); if( zOrig && zIdx && zOrig[0]=='p' ){ - p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[2], &p->zErrmsg, + p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[2], &p->zErrmsg, sqlite3_mprintf( "SELECT rootpage FROM sqlite_master WHERE name = %Q", zIdx )); @@ -169549,7 +169549,7 @@ static void rbuTableType( } } - p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[3], &p->zErrmsg, + p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[3], &p->zErrmsg, sqlite3_mprintf("PRAGMA table_info=%Q",zTab) ); if( p->rc==SQLITE_OK ){ @@ -169618,7 +169618,7 @@ static void rbuObjIterCacheIndexedCols(sqlite3rbu *p, RbuObjIter *pIter){ ** the table (not index) that the iterator currently points to. ** ** Return SQLITE_OK if successful, or an SQLite error code otherwise. If -** an error does occur, an error code and error message are also left in +** an error does occur, an error code and error message are also left in ** the RBU handle. */ static int rbuObjIterCacheTableInfo(sqlite3rbu *p, RbuObjIter *pIter){ @@ -169640,7 +169640,7 @@ static int rbuObjIterCacheTableInfo(sqlite3rbu *p, RbuObjIter *pIter){ if( p->rc ) return p->rc; if( pIter->zIdx==0 ) pIter->iTnum = iTnum; - assert( pIter->eType==RBU_PK_NONE || pIter->eType==RBU_PK_IPK + assert( pIter->eType==RBU_PK_NONE || pIter->eType==RBU_PK_IPK || pIter->eType==RBU_PK_EXTERNAL || pIter->eType==RBU_PK_WITHOUT_ROWID || pIter->eType==RBU_PK_VTAB ); @@ -169648,7 +169648,7 @@ static int rbuObjIterCacheTableInfo(sqlite3rbu *p, RbuObjIter *pIter){ /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - p->rc = prepareFreeAndCollectError(p->dbRbu, &pStmt, &p->zErrmsg, + p->rc = prepareFreeAndCollectError(p->dbRbu, &pStmt, &p->zErrmsg, sqlite3_mprintf("SELECT * FROM '%q'", pIter->zDataTbl) ); if( p->rc==SQLITE_OK ){ @@ -169684,7 +169684,7 @@ static int rbuObjIterCacheTableInfo(sqlite3rbu *p, RbuObjIter *pIter){ ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if( p->rc==SQLITE_OK ){ - p->rc = prepareFreeAndCollectError(p->dbMain, &pStmt, &p->zErrmsg, + p->rc = prepareFreeAndCollectError(p->dbMain, &pStmt, &p->zErrmsg, sqlite3_mprintf("PRAGMA table_info(%Q)", pIter->zTbl) ); } @@ -169726,8 +169726,8 @@ static int rbuObjIterCacheTableInfo(sqlite3rbu *p, RbuObjIter *pIter){ } /* -** This function constructs and returns a pointer to a nul-terminated -** string containing some SQL clause or list based on one or more of the +** This function constructs and returns a pointer to a nul-terminated +** string containing some SQL clause or list based on one or more of the ** column names currently stored in the pIter->azTblCol[] array. */ static char *rbuObjIterGetCollist( @@ -169746,23 +169746,23 @@ static char *rbuObjIterGetCollist( } /* -** This function is used to create a SELECT list (the list of SQL -** expressions that follows a SELECT keyword) for a SELECT statement -** used to read from an data_xxx or rbu_tmp_xxx table while updating the -** index object currently indicated by the iterator object passed as the -** second argument. A "PRAGMA index_xinfo = " statement is used +** This function is used to create a SELECT list (the list of SQL +** expressions that follows a SELECT keyword) for a SELECT statement +** used to read from an data_xxx or rbu_tmp_xxx table while updating the +** index object currently indicated by the iterator object passed as the +** second argument. A "PRAGMA index_xinfo = " statement is used ** to obtain the required information. ** ** If the index is of the following form: ** ** CREATE INDEX i1 ON t1(c, b COLLATE nocase); ** -** and "t1" is a table with an explicit INTEGER PRIMARY KEY column +** and "t1" is a table with an explicit INTEGER PRIMARY KEY column ** "ipk", the returned string is: ** ** "`c` COLLATE 'BINARY', `b` COLLATE 'NOCASE', `ipk` COLLATE 'BINARY'" ** -** As well as the returned string, three other malloc'd strings are +** As well as the returned string, three other malloc'd strings are ** returned via output parameters. As follows: ** ** pzImposterCols: ... @@ -169824,11 +169824,11 @@ static char *rbuObjIterGetIndexCols( zRet = sqlite3_mprintf("%z%s\"%w\" COLLATE %Q", zRet, zCom, zCol, zCollate); if( pIter->bUnique==0 || sqlite3_column_int(pXInfo, 5) ){ const char *zOrder = (bDesc ? " DESC" : ""); - zImpPK = sqlite3_mprintf("%z%s\"rbu_imp_%d%w\"%s", + zImpPK = sqlite3_mprintf("%z%s\"rbu_imp_%d%w\"%s", zImpPK, zCom, nBind, zCol, zOrder ); } - zImpCols = sqlite3_mprintf("%z%s\"rbu_imp_%d%w\" %s COLLATE %Q", + zImpCols = sqlite3_mprintf("%z%s\"rbu_imp_%d%w\" %s COLLATE %Q", zImpCols, zCom, nBind, zCol, zType, zCollate ); zWhere = sqlite3_mprintf( @@ -169874,7 +169874,7 @@ static char *rbuObjIterGetIndexCols( ** the text ", old._rowid_" to the returned value. */ static char *rbuObjIterGetOldlist( - sqlite3rbu *p, + sqlite3rbu *p, RbuObjIter *pIter, const char *zObj ){ @@ -169915,7 +169915,7 @@ static char *rbuObjIterGetOldlist( ** "b = ?1 AND c = ?2" */ static char *rbuObjIterGetWhere( - sqlite3rbu *p, + sqlite3rbu *p, RbuObjIter *pIter ){ char *zList = 0; @@ -169930,7 +169930,7 @@ static char *rbuObjIterGetWhere( zSep = " AND "; } } - zList = rbuMPrintf(p, + zList = rbuMPrintf(p, "_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)", zList ); @@ -169970,7 +169970,7 @@ static void rbuBadControlError(sqlite3rbu *p){ ** ** The memory for the returned string is obtained from sqlite3_malloc(). ** It is the responsibility of the caller to eventually free it using -** sqlite3_free(). +** sqlite3_free(). ** ** If an OOM error is encountered when allocating space for the new ** string, an error code is left in the rbu handle passed as the first @@ -169994,19 +169994,19 @@ static char *rbuObjIterGetSetlist( for(i=0; inTblCol; i++){ char c = zMask[pIter->aiSrcOrder[i]]; if( c=='x' ){ - zList = rbuMPrintf(p, "%z%s\"%w\"=?%d", + zList = rbuMPrintf(p, "%z%s\"%w\"=?%d", zList, zSep, pIter->azTblCol[i], i+1 ); zSep = ", "; } else if( c=='d' ){ - zList = rbuMPrintf(p, "%z%s\"%w\"=rbu_delta(\"%w\", ?%d)", + zList = rbuMPrintf(p, "%z%s\"%w\"=rbu_delta(\"%w\", ?%d)", zList, zSep, pIter->azTblCol[i], pIter->azTblCol[i], i+1 ); zSep = ", "; } else if( c=='f' ){ - zList = rbuMPrintf(p, "%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)", + zList = rbuMPrintf(p, "%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)", zList, zSep, pIter->azTblCol[i], pIter->azTblCol[i], i+1 ); zSep = ", "; @@ -170024,7 +170024,7 @@ static char *rbuObjIterGetSetlist( ** ** The memory for the returned string is obtained from sqlite3_malloc(). ** It is the responsibility of the caller to eventually free it using -** sqlite3_free(). +** sqlite3_free(). ** ** If an OOM error is encountered when allocating space for the new ** string, an error code is left in the rbu handle passed as the first @@ -170048,8 +170048,8 @@ static char *rbuObjIterGetBindlist(sqlite3rbu *p, int nBind){ } /* -** The iterator currently points to a table (not index) of type -** RBU_PK_WITHOUT_ROWID. This function creates the PRIMARY KEY +** The iterator currently points to a table (not index) of type +** RBU_PK_WITHOUT_ROWID. This function creates the PRIMARY KEY ** declaration for the corresponding imposter table. For example, ** if the iterator points to a table created as: ** @@ -170066,7 +170066,7 @@ static char *rbuWithoutRowidPK(sqlite3rbu *p, RbuObjIter *pIter){ const char *zSep = "PRIMARY KEY("; sqlite3_stmt *pXList = 0; /* PRAGMA index_list = (pIter->zTbl) */ sqlite3_stmt *pXInfo = 0; /* PRAGMA index_xinfo = */ - + p->rc = prepareFreeAndCollectError(p->dbMain, &pXList, &p->zErrmsg, sqlite3_mprintf("PRAGMA main.index_list = %Q", pIter->zTbl) ); @@ -170104,7 +170104,7 @@ static char *rbuWithoutRowidPK(sqlite3rbu *p, RbuObjIter *pIter){ ** a table b-tree where the table has an external primary key. If the ** iterator passed as the second argument does not currently point to ** a table (not index) with an external primary key, this function is a -** no-op. +** no-op. ** ** Assuming the iterator does point to a table with an external PK, this ** function creates a WITHOUT ROWID imposter table named "rbu_imposter2" @@ -170131,7 +170131,7 @@ static void rbuCreateImposterTable2(sqlite3rbu *p, RbuObjIter *pIter){ /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - p->rc = prepareAndCollectError(p->dbMain, &pQuery, &p->zErrmsg, + p->rc = prepareAndCollectError(p->dbMain, &pQuery, &p->zErrmsg, "SELECT name FROM sqlite_master WHERE rootpage = ?" ); if( p->rc==SQLITE_OK ){ @@ -170153,7 +170153,7 @@ static void rbuCreateImposterTable2(sqlite3rbu *p, RbuObjIter *pIter){ int iCid = sqlite3_column_int(pXInfo, 1); int bDesc = sqlite3_column_int(pXInfo, 3); const char *zCollate = (const char*)sqlite3_column_text(pXInfo, 4); - zCols = rbuMPrintf(p, "%z%sc%d %s COLLATE %s", zCols, zComma, + zCols = rbuMPrintf(p, "%z%sc%d %s COLLATE %s", zCols, zComma, iCid, pIter->azTblType[iCid], zCollate ); zPk = rbuMPrintf(p, "%z%sc%d%s", zPk, zComma, iCid, bDesc?" DESC":""); @@ -170165,7 +170165,7 @@ static void rbuCreateImposterTable2(sqlite3rbu *p, RbuObjIter *pIter){ sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 1, tnum); rbuMPrintfExec(p, p->dbMain, - "CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID", + "CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID", zCols, zPk ); sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 0, 0); @@ -170173,7 +170173,7 @@ static void rbuCreateImposterTable2(sqlite3rbu *p, RbuObjIter *pIter){ } /* -** If an error has already occurred when this function is called, it +** If an error has already occurred when this function is called, it ** immediately returns zero (without doing any work). Or, if an error ** occurs during the execution of this function, it sets the error code ** in the sqlite3rbu object indicated by the first argument and returns @@ -170186,9 +170186,9 @@ static void rbuCreateImposterTable2(sqlite3rbu *p, RbuObjIter *pIter){ ** an imposter table are created, or zero otherwise. ** ** An imposter table is required in all cases except RBU_PK_VTAB. Only -** virtual tables are written to directly. The imposter table has the -** same schema as the actual target table (less any UNIQUE constraints). -** More precisely, the "same schema" means the same columns, types, +** virtual tables are written to directly. The imposter table has the +** same schema as the actual target table (less any UNIQUE constraints). +** More precisely, the "same schema" means the same columns, types, ** collation sequences. For tables that do not have an external PRIMARY ** KEY, it also means the same PRIMARY KEY declaration. */ @@ -170214,7 +170214,7 @@ static void rbuCreateImposterTable(sqlite3rbu *p, RbuObjIter *pIter){ ** "PRIMARY KEY" to the imposter table column declaration. */ zPk = "PRIMARY KEY "; } - zSql = rbuMPrintf(p, "%z%s\"%w\" %s %sCOLLATE %s%s", + zSql = rbuMPrintf(p, "%z%s\"%w\" %s %sCOLLATE %s%s", zSql, zComma, zCol, pIter->azTblType[iCol], zPk, zColl, (pIter->abNotNull[iCol] ? " NOT NULL" : "") ); @@ -170229,8 +170229,8 @@ static void rbuCreateImposterTable(sqlite3rbu *p, RbuObjIter *pIter){ } sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 1, tnum); - rbuMPrintfExec(p, p->dbMain, "CREATE TABLE \"rbu_imp_%w\"(%z)%s", - pIter->zTbl, zSql, + rbuMPrintfExec(p, p->dbMain, "CREATE TABLE \"rbu_imp_%w\"(%z)%s", + pIter->zTbl, zSql, (pIter->eType==RBU_PK_WITHOUT_ROWID ? " WITHOUT ROWID" : "") ); sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 0, 0); @@ -170244,12 +170244,12 @@ static void rbuCreateImposterTable(sqlite3rbu *p, RbuObjIter *pIter){ ** INSERT INTO rbu_tmp_xxx VALUES(?, ?, ? ...); ** ** The number of bound variables is equal to the number of columns in -** the target table, plus one (for the rbu_control column), plus one more -** (for the rbu_rowid column) if the target table is an implicit IPK or +** the target table, plus one (for the rbu_control column), plus one more +** (for the rbu_rowid column) if the target table is an implicit IPK or ** virtual table. */ static void rbuObjIterPrepareTmpInsert( - sqlite3rbu *p, + sqlite3rbu *p, RbuObjIter *pIter, const char *zCollist, const char *zRbuRowid @@ -170260,14 +170260,14 @@ static void rbuObjIterPrepareTmpInsert( assert( pIter->pTmpInsert==0 ); p->rc = prepareFreeAndCollectError( p->dbRbu, &pIter->pTmpInsert, &p->zErrmsg, sqlite3_mprintf( - "INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)", + "INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)", p->zStateDb, pIter->zDataTbl, zCollist, zRbuRowid, zBind )); } } static void rbuTmpInsertFunc( - sqlite3_context *pCtx, + sqlite3_context *pCtx, int nVal, sqlite3_value **apVal ){ @@ -170276,8 +170276,8 @@ static void rbuTmpInsertFunc( int i; assert( sqlite3_value_int(apVal[0])!=0 - || p->objiter.eType==RBU_PK_EXTERNAL - || p->objiter.eType==RBU_PK_NONE + || p->objiter.eType==RBU_PK_EXTERNAL + || p->objiter.eType==RBU_PK_NONE ); if( sqlite3_value_int(apVal[0])!=0 ){ p->nPhaseOneStep += p->objiter.nIndex; @@ -170297,12 +170297,12 @@ static void rbuTmpInsertFunc( } /* -** Ensure that the SQLite statement handles required to update the -** target database object currently indicated by the iterator passed +** Ensure that the SQLite statement handles required to update the +** target database object currently indicated by the iterator passed ** as the second argument are available. */ static int rbuObjIterPrepareAll( - sqlite3rbu *p, + sqlite3rbu *p, RbuObjIter *pIter, int nOffset /* Add "LIMIT -1 OFFSET $nOffset" to SELECT */ ){ @@ -170365,7 +170365,7 @@ static int rbuObjIterPrepareAll( if( rbuIsVacuum(p) ){ zSql = sqlite3_mprintf( "SELECT %s, 0 AS rbu_control FROM '%q' ORDER BY %s%s", - zCollist, + zCollist, pIter->zDataTbl, zCollist, zLimit ); @@ -170384,8 +170384,8 @@ static int rbuObjIterPrepareAll( "SELECT %s, rbu_control FROM '%q' " "WHERE typeof(rbu_control)='integer' AND rbu_control!=1 " "ORDER BY %s%s", - zCollist, p->zStateDb, pIter->zDataTbl, - zCollist, pIter->zDataTbl, + zCollist, p->zStateDb, pIter->zDataTbl, + zCollist, pIter->zDataTbl, zCollist, zLimit ); } @@ -170420,7 +170420,7 @@ static int rbuObjIterPrepareAll( if( p->rc==SQLITE_OK ){ p->rc = prepareFreeAndCollectError(p->dbMain, &pIter->pInsert, pz, sqlite3_mprintf( - "INSERT INTO \"%s%w\"(%s%s) VALUES(%s)", + "INSERT INTO \"%s%w\"(%s%s) VALUES(%s)", zWrite, zTbl, zCollist, (bRbuRowid ? ", _rowid_" : ""), zBindings ) ); @@ -170493,8 +170493,8 @@ static int rbuObjIterPrepareAll( } p->rc = prepareFreeAndCollectError(p->dbRbu, &pIter->pSelect, pz, sqlite3_mprintf( - "SELECT %s,%s rbu_control%s FROM '%q'%s", - zCollist, + "SELECT %s,%s rbu_control%s FROM '%q'%s", + zCollist, (rbuIsVacuum(p) ? "0 AS " : ""), zRbuRowid, pIter->zDataTbl, zLimit @@ -170510,16 +170510,16 @@ static int rbuObjIterPrepareAll( sqlite3_free(zCollist); sqlite3_free(zLimit); } - + return p->rc; } /* ** Set output variable *ppStmt to point to an UPDATE statement that may ** be used to update the imposter table for the main table b-tree of the -** table object that pIter currently points to, assuming that the +** table object that pIter currently points to, assuming that the ** rbu_control column of the data_xyz table contains zMask. -** +** ** If the zMask string does not specify any columns to update, then this ** is not an error. Output variable *ppStmt is set to NULL in this case. */ @@ -170546,7 +170546,7 @@ static int rbuGetUpdateStmt( *pp = pUp->pNext; pUp->pNext = pIter->pRbuUpdate; pIter->pRbuUpdate = pUp; - *ppStmt = pUp->pUpdate; + *ppStmt = pUp->pUpdate; return SQLITE_OK; } nUp++; @@ -170576,7 +170576,7 @@ static int rbuGetUpdateStmt( const char *zPrefix = ""; if( pIter->eType!=RBU_PK_VTAB ) zPrefix = "rbu_imp_"; - zUpdate = sqlite3_mprintf("UPDATE \"%s%w\" SET %s WHERE %s", + zUpdate = sqlite3_mprintf("UPDATE \"%s%w\" SET %s WHERE %s", zPrefix, pIter->zTbl, zSet, zWhere ); p->rc = prepareFreeAndCollectError( @@ -170592,8 +170592,8 @@ static int rbuGetUpdateStmt( } static sqlite3 *rbuOpenDbhandle( - sqlite3rbu *p, - const char *zName, + sqlite3rbu *p, + const char *zName, int bUseVfs ){ sqlite3 *db = 0; @@ -170621,8 +170621,8 @@ static void rbuFreeState(RbuState *p){ } /* -** Allocate an RbuState object and load the contents of the rbu_state -** table into it. Return a pointer to the new object. It is the +** Allocate an RbuState object and load the contents of the rbu_state +** table into it. Return a pointer to the new object. It is the ** responsibility of the caller to eventually free the object using ** sqlite3_free(). ** @@ -170638,7 +170638,7 @@ static RbuState *rbuLoadState(sqlite3rbu *p){ pRet = (RbuState*)rbuMalloc(p, sizeof(RbuState)); if( pRet==0 ) return 0; - rc = prepareFreeAndCollectError(p->dbRbu, &pStmt, &p->zErrmsg, + rc = prepareFreeAndCollectError(p->dbRbu, &pStmt, &p->zErrmsg, sqlite3_mprintf("SELECT k, v FROM %s.rbu_state", p->zStateDb) ); while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ @@ -170744,7 +170744,7 @@ static void rbuOpenDatabase(sqlite3rbu *p, int *pbRetry){ p->rc = prepareAndCollectError(p->dbRbu, &pCnt, &p->zErrmsg, "SELECT count(*) FROM stat.sqlite_master" ); - if( p->rc==SQLITE_OK + if( p->rc==SQLITE_OK && sqlite3_step(pCnt)==SQLITE_ROW && 1==sqlite3_column_int(pCnt, 0) ){ @@ -170757,7 +170757,7 @@ static void rbuOpenDatabase(sqlite3rbu *p, int *pbRetry){ p->rc = SQLITE_ERROR; p->zErrmsg = sqlite3_mprintf("invalid state database"); } - + if( p->rc==SQLITE_OK ){ p->rc = sqlite3_exec(p->dbRbu, "COMMIT", 0, 0, 0); } @@ -170811,7 +170811,7 @@ static void rbuOpenDatabase(sqlite3rbu *p, int *pbRetry){ if( *zExtra=='\0' ) zExtra = 0; } - zTarget = sqlite3_mprintf("file:%s-vacuum?rbu_memory=1%s%s", + zTarget = sqlite3_mprintf("file:%s-vacuum?rbu_memory=1%s%s", sqlite3_db_filename(p->dbRbu, "main"), (zExtra==0 ? "" : "&"), (zExtra==0 ? "" : zExtra) ); @@ -170826,19 +170826,19 @@ static void rbuOpenDatabase(sqlite3rbu *p, int *pbRetry){ } if( p->rc==SQLITE_OK ){ - p->rc = sqlite3_create_function(p->dbMain, + p->rc = sqlite3_create_function(p->dbMain, "rbu_tmp_insert", -1, SQLITE_UTF8, (void*)p, rbuTmpInsertFunc, 0, 0 ); } if( p->rc==SQLITE_OK ){ - p->rc = sqlite3_create_function(p->dbMain, + p->rc = sqlite3_create_function(p->dbMain, "rbu_fossil_delta", 2, SQLITE_UTF8, 0, rbuFossilDeltaFunc, 0, 0 ); } if( p->rc==SQLITE_OK ){ - p->rc = sqlite3_create_function(p->dbRbu, + p->rc = sqlite3_create_function(p->dbRbu, "rbu_target_name", -1, SQLITE_UTF8, (void*)p, rbuTargetNameFunc, 0, 0 ); } @@ -170848,7 +170848,7 @@ static void rbuOpenDatabase(sqlite3rbu *p, int *pbRetry){ } rbuMPrintfExec(p, p->dbMain, "SELECT * FROM sqlite_master"); - /* Mark the database file just opened as an RBU target database. If + /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if( p->rc==SQLITE_OK ){ @@ -170896,10 +170896,10 @@ static void rbuFileSuffix3(const char *zBase, char *z){ } /* -** Return the current wal-index header checksum for the target database +** Return the current wal-index header checksum for the target database ** as a 64-bit integer. ** -** The checksum is store in the first page of xShmMap memory as an 8-byte +** The checksum is store in the first page of xShmMap memory as an 8-byte ** blob starting at byte offset 40. */ static i64 rbuShmChecksum(sqlite3rbu *p){ @@ -170917,11 +170917,11 @@ static i64 rbuShmChecksum(sqlite3rbu *p){ /* ** This function is called as part of initializing or reinitializing an -** incremental checkpoint. +** incremental checkpoint. ** -** It populates the sqlite3rbu.aFrame[] array with the set of -** (wal frame -> db page) copy operations required to checkpoint the -** current wal file, and obtains the set of shm locks required to safely +** It populates the sqlite3rbu.aFrame[] array with the set of +** (wal frame -> db page) copy operations required to checkpoint the +** current wal file, and obtains the set of shm locks required to safely ** perform the copy operations directly on the file-system. ** ** If argument pState is not NULL, then the incremental checkpoint is @@ -170956,19 +170956,19 @@ static void rbuSetupCheckpoint(sqlite3rbu *p, RbuState *pState){ ** would be read/written are recorded in the sqlite3rbu.aFrame[] ** array. ** - ** * Calls to xShmLock(UNLOCK) to release the exclusive shm WRITER, + ** * Calls to xShmLock(UNLOCK) to release the exclusive shm WRITER, ** READ0 and CHECKPOINT locks taken as part of the checkpoint are ** no-ops. These locks will not be released until the connection ** is closed. ** - ** * Attempting to xSync() the database file causes an SQLITE_INTERNAL + ** * Attempting to xSync() the database file causes an SQLITE_INTERNAL ** error. ** ** As a result, unless an error (i.e. OOM or SQLITE_BUSY) occurs, the ** checkpoint below fails with SQLITE_INTERNAL, and leaves the aFrame[] - ** array populated with a set of (frame -> page) mappings. Because the - ** WRITER, CHECKPOINT and READ0 locks are still held, it is safe to copy - ** data from the wal file into the database file according to the + ** array populated with a set of (frame -> page) mappings. Because the + ** WRITER, CHECKPOINT and READ0 locks are still held, it is safe to copy + ** data from the wal file into the database file according to the ** contents of aFrame[]. */ if( p->rc==SQLITE_OK ){ @@ -171027,7 +171027,7 @@ static int rbuCaptureWalRead(sqlite3rbu *pRbu, i64 iOff, int iAmt){ /* ** Called when a page of data is written to offset iOff of the database -** file while the rbu handle is in capture mode. Record the page number +** file while the rbu handle is in capture mode. Record the page number ** of the page being written in the aFrame[] array. */ static int rbuCaptureDbWrite(sqlite3rbu *pRbu, i64 iOff){ @@ -171095,7 +171095,7 @@ static LPWSTR rbuWinUtf8ToUnicode(const char *zFilename){ ** The RBU handle is currently in RBU_STAGE_OAL state, with a SHARED lock ** on the database file. This proc moves the *-oal file to the *-wal path, ** then reopens the database file (this time in vanilla, non-oal, WAL mode). -** If an error occurs, leave an error code and error message in the rbu +** If an error occurs, leave an error code and error message in the rbu ** handle. */ static void rbuMoveOalFile(sqlite3rbu *p){ @@ -171117,7 +171117,7 @@ static void rbuMoveOalFile(sqlite3rbu *p){ }else{ /* Move the *-oal file to *-wal. At this point connection p->db is ** holding a SHARED lock on the target database file (because it is - ** in WAL mode). So no other connection may be writing the db. + ** in WAL mode). So no other connection may be writing the db. ** ** In order to ensure that there are no database readers, an EXCLUSIVE ** lock is obtained here before the *-oal is moved to *-wal. @@ -171275,8 +171275,8 @@ static void rbuStepOneOp(sqlite3rbu *p, int eType){ /* If this is an INSERT into a table b-tree and the table has an ** explicit INTEGER PRIMARY KEY, check that this is not an attempt ** to write a NULL into the IPK column. That is not permitted. */ - if( eType==RBU_INSERT - && pIter->zIdx==0 && pIter->eType==RBU_PK_IPK && pIter->abTblPk[i] + if( eType==RBU_INSERT + && pIter->zIdx==0 && pIter->eType==RBU_PK_IPK && pIter->abTblPk[i] && sqlite3_column_type(pIter->pSelect, i)==SQLITE_NULL ){ p->rc = SQLITE_MISMATCH; @@ -171293,18 +171293,18 @@ static void rbuStepOneOp(sqlite3rbu *p, int eType){ if( p->rc ) return; } if( pIter->zIdx==0 ){ - if( pIter->eType==RBU_PK_VTAB - || pIter->eType==RBU_PK_NONE - || (pIter->eType==RBU_PK_EXTERNAL && rbuIsVacuum(p)) + if( pIter->eType==RBU_PK_VTAB + || pIter->eType==RBU_PK_NONE + || (pIter->eType==RBU_PK_EXTERNAL && rbuIsVacuum(p)) ){ - /* For a virtual table, or a table with no primary key, the + /* For a virtual table, or a table with no primary key, the ** SELECT statement is: ** ** SELECT , rbu_control, rbu_rowid FROM .... ** ** Hence column_value(pIter->nCol+1). */ - assertColumnName(pIter->pSelect, pIter->nCol+1, + assertColumnName(pIter->pSelect, pIter->nCol+1, rbuIsVacuum(p) ? "rowid" : "rbu_rowid" ); pVal = sqlite3_column_value(pIter->pSelect, pIter->nCol+1); @@ -171368,8 +171368,8 @@ static int rbuStep(sqlite3rbu *p){ p->rc = sqlite3_bind_value(pUpdate, i+1, pVal); } } - if( p->rc==SQLITE_OK - && (pIter->eType==RBU_PK_VTAB || pIter->eType==RBU_PK_NONE) + if( p->rc==SQLITE_OK + && (pIter->eType==RBU_PK_VTAB || pIter->eType==RBU_PK_NONE) ){ /* Bind the rbu_rowid value to column _rowid_ */ assertColumnName(pIter->pSelect, pIter->nCol+1, "rbu_rowid"); @@ -171399,7 +171399,7 @@ static void rbuIncrSchemaCookie(sqlite3rbu *p){ int iCookie = 1000000; sqlite3_stmt *pStmt; - p->rc = prepareAndCollectError(dbread, &pStmt, &p->zErrmsg, + p->rc = prepareAndCollectError(dbread, &pStmt, &p->zErrmsg, "PRAGMA schema_version" ); if( p->rc==SQLITE_OK ){ @@ -171431,7 +171431,7 @@ static void rbuSaveState(sqlite3rbu *p, int eStage){ int rc; assert( p->zErrmsg==0 ); - rc = prepareFreeAndCollectError(p->dbRbu, &pInsert, &p->zErrmsg, + rc = prepareFreeAndCollectError(p->dbRbu, &pInsert, &p->zErrmsg, sqlite3_mprintf( "INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES " "(%d, %d), " @@ -171445,9 +171445,9 @@ static void rbuSaveState(sqlite3rbu *p, int eStage){ "(%d, %lld) ", p->zStateDb, RBU_STATE_STAGE, eStage, - RBU_STATE_TBL, p->objiter.zTbl, - RBU_STATE_IDX, p->objiter.zIdx, - RBU_STATE_ROW, p->nStep, + RBU_STATE_TBL, p->objiter.zTbl, + RBU_STATE_IDX, p->objiter.zIdx, + RBU_STATE_ROW, p->nStep, RBU_STATE_PROGRESS, p->nProgress, RBU_STATE_CKPT, p->iWalCksum, RBU_STATE_COOKIE, (i64)pFd->iCookie, @@ -171467,7 +171467,7 @@ static void rbuSaveState(sqlite3rbu *p, int eStage){ /* -** The second argument passed to this function is the name of a PRAGMA +** The second argument passed to this function is the name of a PRAGMA ** setting - "page_size", "auto_vacuum", "user_version" or "application_id". ** This function executes the following on sqlite3rbu.dbRbu: ** @@ -171486,7 +171486,7 @@ static void rbuSaveState(sqlite3rbu *p, int eStage){ static void rbuCopyPragma(sqlite3rbu *p, const char *zPragma){ if( p->rc==SQLITE_OK ){ sqlite3_stmt *pPragma = 0; - p->rc = prepareFreeAndCollectError(p->dbRbu, &pPragma, &p->zErrmsg, + p->rc = prepareFreeAndCollectError(p->dbRbu, &pPragma, &p->zErrmsg, sqlite3_mprintf("PRAGMA main.%s", zPragma) ); if( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pPragma) ){ @@ -171499,7 +171499,7 @@ static void rbuCopyPragma(sqlite3rbu *p, const char *zPragma){ } /* -** The RBU handle passed as the only argument has just been opened and +** The RBU handle passed as the only argument has just been opened and ** the state database is empty. If this RBU handle was opened for an ** RBU vacuum operation, create the schema in the target db. */ @@ -171510,7 +171510,7 @@ static void rbuCreateTargetSchema(sqlite3rbu *p){ assert( rbuIsVacuum(p) ); p->rc = sqlite3_exec(p->dbMain, "PRAGMA writable_schema=1", 0,0, &p->zErrmsg); if( p->rc==SQLITE_OK ){ - p->rc = prepareAndCollectError(p->dbRbu, &pSql, &p->zErrmsg, + p->rc = prepareAndCollectError(p->dbRbu, &pSql, &p->zErrmsg, "SELECT sql FROM sqlite_master WHERE sql!='' AND rootpage!=0" " AND name!='sqlite_sequence' " " ORDER BY type DESC" @@ -171525,13 +171525,13 @@ static void rbuCreateTargetSchema(sqlite3rbu *p){ if( p->rc!=SQLITE_OK ) return; if( p->rc==SQLITE_OK ){ - p->rc = prepareAndCollectError(p->dbRbu, &pSql, &p->zErrmsg, - "SELECT * FROM sqlite_master WHERE rootpage=0 OR rootpage IS NULL" + p->rc = prepareAndCollectError(p->dbRbu, &pSql, &p->zErrmsg, + "SELECT * FROM sqlite_master WHERE rootpage=0 OR rootpage IS NULL" ); } if( p->rc==SQLITE_OK ){ - p->rc = prepareAndCollectError(p->dbMain, &pInsert, &p->zErrmsg, + p->rc = prepareAndCollectError(p->dbMain, &pInsert, &p->zErrmsg, "INSERT INTO sqlite_master VALUES(?,?,?,?,?)" ); } @@ -171572,11 +171572,11 @@ SQLITE_API int sqlite3rbu_step(sqlite3rbu *p){ while( p->rc==SQLITE_OK && pIter->zTbl ){ if( pIter->bCleanup ){ - /* Clean up the rbu_tmp_xxx table for the previous table. It + /* Clean up the rbu_tmp_xxx table for the previous table. It ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if( rbuIsVacuum(p)==0 && pIter->abIndexed ){ - rbuMPrintfExec(p, p->dbRbu, + rbuMPrintfExec(p, p->dbRbu, "DELETE FROM %s.'rbu_tmp_%q'", p->zStateDb, pIter->zDataTbl ); } @@ -171626,10 +171626,10 @@ SQLITE_API int sqlite3rbu_step(sqlite3rbu *p){ if( p->rc==SQLITE_OK ){ if( p->nStep>=p->nFrame ){ sqlite3_file *pDb = p->pTargetFd->pReal; - + /* Sync the db file */ p->rc = pDb->pMethods->xSync(pDb, SQLITE_SYNC_NORMAL); - + /* Update nBackfill */ if( p->rc==SQLITE_OK ){ void volatile *ptr; @@ -171638,7 +171638,7 @@ SQLITE_API int sqlite3rbu_step(sqlite3rbu *p){ ((u32 volatile*)ptr)[24] = p->iMaxFrame; } } - + if( p->rc==SQLITE_OK ){ p->eStage = RBU_STAGE_DONE; p->rc = SQLITE_DONE; @@ -171689,9 +171689,9 @@ static void rbuSetupOal(sqlite3rbu *p, RbuState *pState){ RbuObjIter *pIter = &p->objiter; int rc = SQLITE_OK; - while( rc==SQLITE_OK && pIter->zTbl && (pIter->bCleanup + while( rc==SQLITE_OK && pIter->zTbl && (pIter->bCleanup || rbuStrCompare(pIter->zIdx, pState->zIdx) - || rbuStrCompare(pIter->zTbl, pState->zTbl) + || rbuStrCompare(pIter->zTbl, pState->zTbl) )){ rc = rbuObjIterNext(p, pIter); } @@ -171763,7 +171763,7 @@ static void rbuDeleteVfs(sqlite3rbu *p){ ** the number of auxilliary indexes on the table. */ static void rbuIndexCntFunc( - sqlite3_context *pCtx, + sqlite3_context *pCtx, int nVal, sqlite3_value **apVal ){ @@ -171773,8 +171773,8 @@ static void rbuIndexCntFunc( int rc; assert( nVal==1 ); - - rc = prepareFreeAndCollectError(p->dbMain, &pStmt, &zErrmsg, + + rc = prepareFreeAndCollectError(p->dbMain, &pStmt, &zErrmsg, sqlite3_mprintf("SELECT count(*) FROM sqlite_master " "WHERE type='index' AND tbl_name = %Q", sqlite3_value_text(apVal[0])) ); @@ -171808,7 +171808,7 @@ static void rbuIndexCntFunc( ** and the cnt column the number of rows it contains. ** ** sqlite3rbu.nPhaseOneStep is initialized to the sum of (1 + nIndex) * cnt -** for all rows in the rbu_count table, where nIndex is the number of +** for all rows in the rbu_count table, where nIndex is the number of ** indexes on the corresponding target database table. */ static void rbuInitPhaseOneSteps(sqlite3rbu *p){ @@ -171818,10 +171818,10 @@ static void rbuInitPhaseOneSteps(sqlite3rbu *p){ p->nPhaseOneStep = -1; - p->rc = sqlite3_create_function(p->dbRbu, + p->rc = sqlite3_create_function(p->dbRbu, "rbu_index_cnt", 1, SQLITE_UTF8, (void*)p, rbuIndexCntFunc, 0, 0 ); - + /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if( p->rc==SQLITE_OK ){ @@ -171835,7 +171835,7 @@ static void rbuInitPhaseOneSteps(sqlite3rbu *p){ } p->rc = sqlite3_finalize(pStmt); } - + if( p->rc==SQLITE_OK && bExists ){ p->rc = prepareAndCollectError(p->dbRbu, &pStmt, &p->zErrmsg, "SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))" @@ -171853,7 +171853,7 @@ static void rbuInitPhaseOneSteps(sqlite3rbu *p){ static sqlite3rbu *openRbuHandle( - const char *zTarget, + const char *zTarget, const char *zRbu, const char *zState ){ @@ -171891,7 +171891,7 @@ static sqlite3rbu *openRbuHandle( ** to be a wal-mode db. But, this may have happened due to an earlier ** RBU vacuum operation leaving an old wal file in the directory. ** If this is the case, it will have been checkpointed and deleted - ** when the handle was closed and a second attempt to open the + ** when the handle was closed and a second attempt to open the ** database may succeed. */ rbuOpenDatabase(p, &bRetry); if( bRetry ){ @@ -171904,7 +171904,7 @@ static sqlite3rbu *openRbuHandle( assert( pState || p->rc!=SQLITE_OK ); if( p->rc==SQLITE_OK ){ - if( pState->eStage==0 ){ + if( pState->eStage==0 ){ rbuDeleteOalFile(p); rbuInitPhaseOneSteps(p); p->eStage = RBU_STAGE_OAL; @@ -171928,15 +171928,15 @@ static sqlite3rbu *openRbuHandle( } } - if( p->rc==SQLITE_OK + if( p->rc==SQLITE_OK && (p->eStage==RBU_STAGE_OAL || p->eStage==RBU_STAGE_MOVE) && pState->eStage!=0 ){ rbu_file *pFd = (rbuIsVacuum(p) ? p->pRbuFd : p->pTargetFd); - if( pFd->iCookie!=pState->iCookie ){ + if( pFd->iCookie!=pState->iCookie ){ /* At this point (pTargetFd->iCookie) contains the value of the - ** change-counter cookie (the thing that gets incremented when a - ** transaction is committed in rollback mode) currently stored on + ** change-counter cookie (the thing that gets incremented when a + ** transaction is committed in rollback mode) currently stored on ** page 1 of the database file. */ p->rc = SQLITE_BUSY; p->zErrmsg = sqlite3_mprintf("database modified during rbu %s", @@ -171973,7 +171973,7 @@ static sqlite3rbu *openRbuHandle( } /* Check if the main database is a zipvfs db. If it is, set the upper - ** level pager to use "journal_mode=off". This prevents it from + ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if( p->rc==SQLITE_OK ){ int frc = sqlite3_file_control(db, "main", SQLITE_FCNTL_ZIPVFS, 0); @@ -172019,10 +172019,10 @@ static sqlite3rbu *rbuMisuseError(void){ } /* -** Open and return a new RBU handle. +** Open and return a new RBU handle. */ SQLITE_API sqlite3rbu *sqlite3rbu_open( - const char *zTarget, + const char *zTarget, const char *zRbu, const char *zState ){ @@ -172035,7 +172035,7 @@ SQLITE_API sqlite3rbu *sqlite3rbu_open( ** Open a handle to begin or resume an RBU VACUUM operation. */ SQLITE_API sqlite3rbu *sqlite3rbu_vacuum( - const char *zTarget, + const char *zTarget, const char *zState ){ if( zTarget==0 ){ return rbuMisuseError(); } @@ -172097,8 +172097,8 @@ SQLITE_API int sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){ rbuObjIterFinalize(&p->objiter); /* If this is an RBU vacuum handle and the vacuum has either finished - ** successfully or encountered an error, delete the contents of the - ** state table. This causes the next call to sqlite3rbu_vacuum() + ** successfully or encountered an error, delete the contents of the + ** state table. This causes the next call to sqlite3rbu_vacuum() ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if( rbuIsVacuum(p) && p->rc!=SQLITE_OK && p->dbRbu ){ @@ -172126,7 +172126,7 @@ SQLITE_API int sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){ } /* -** Return the total number of key-value operations (inserts, deletes or +** Return the total number of key-value operations (inserts, deletes or ** updates) that have been performed on the target database since the ** current RBU update was started. */ @@ -172230,7 +172230,7 @@ SQLITE_API int sqlite3rbu_savestate(sqlite3rbu *p){ ** Beginning of RBU VFS shim methods. The VFS shim modifies the behaviour ** of a standard VFS in the following ways: ** -** 1. Whenever the first page of a main database file is read or +** 1. Whenever the first page of a main database file is read or ** written, the value of the change-counter cookie is stored in ** rbu_file.iCookie. Similarly, the value of the "write-version" ** database header field is stored in rbu_file.iWriteVer. This ensures @@ -172238,15 +172238,15 @@ SQLITE_API int sqlite3rbu_savestate(sqlite3rbu *p){ ** ** 2. Whenever an SQLITE_OPEN_WAL file is opened, the (rbu_file.pWalFd) ** member variable of the associated database file descriptor is set -** to point to the new file. A mutex protected linked list of all main -** db fds opened using a particular RBU VFS is maintained at +** to point to the new file. A mutex protected linked list of all main +** db fds opened using a particular RBU VFS is maintained at ** rbu_vfs.pMain to facilitate this. ** -** 3. Using a new file-control "SQLITE_FCNTL_RBU", a main db rbu_file +** 3. Using a new file-control "SQLITE_FCNTL_RBU", a main db rbu_file ** object can be marked as the target database of an RBU update. This ** turns on the following extra special behaviour: ** -** 3a. If xAccess() is called to check if there exists a *-wal file +** 3a. If xAccess() is called to check if there exists a *-wal file ** associated with an RBU target database currently in RBU_STAGE_OAL ** stage (preparing the *-oal file), the following special handling ** applies: @@ -172259,26 +172259,26 @@ SQLITE_API int sqlite3rbu_savestate(sqlite3rbu *p){ ** ** Then, when xOpen() is called to open the *-wal file associated with ** the RBU target in RBU_STAGE_OAL stage, instead of opening the *-wal -** file, the rbu vfs opens the corresponding *-oal file instead. +** file, the rbu vfs opens the corresponding *-oal file instead. ** ** 3b. The *-shm pages returned by xShmMap() for a target db file in ** RBU_STAGE_OAL mode are actually stored in heap memory. This is to ** avoid creating a *-shm file on disk. Additionally, xShmLock() calls ** are no-ops on target database files in RBU_STAGE_OAL mode. This is -** because assert() statements in some VFS implementations fail if +** because assert() statements in some VFS implementations fail if ** xShmLock() is called before xShmMap(). ** ** 3c. If an EXCLUSIVE lock is attempted on a target database file in any -** mode except RBU_STAGE_DONE (all work completed and checkpointed), it +** mode except RBU_STAGE_DONE (all work completed and checkpointed), it ** fails with an SQLITE_BUSY error. This is to stop RBU connections ** from automatically checkpointing a *-wal (or *-oal) file from within ** sqlite3_close(). ** ** 3d. In RBU_STAGE_CAPTURE mode, all xRead() calls on the wal file, and -** all xWrite() calls on the target database file perform no IO. +** all xWrite() calls on the target database file perform no IO. ** Instead the frame and page numbers that would be read and written ** are recorded. Additionally, successful attempts to obtain exclusive -** xShmLock() WRITER, CHECKPOINTER and READ0 locks on the target +** xShmLock() WRITER, CHECKPOINTER and READ0 locks on the target ** database file are recorded. xShmLock() calls to unlock the same ** locks are no-ops (so that once obtained, these locks are never ** relinquished). Finally, calls to xSync() on the target database @@ -172331,7 +172331,7 @@ static int rbuVfsClose(sqlite3_file *pFile){ /* -** Read and return an unsigned 32-bit big-endian integer from the buffer +** Read and return an unsigned 32-bit big-endian integer from the buffer ** passed as the only argument. */ static u32 rbuGetU32(u8 *aBuf){ @@ -172361,9 +172361,9 @@ static void rbuPutU16(u8 *aBuf, u16 iVal){ ** Read data from an rbuVfs-file. */ static int rbuVfsRead( - sqlite3_file *pFile, - void *zBuf, - int iAmt, + sqlite3_file *pFile, + void *zBuf, + int iAmt, sqlite_int64 iOfst ){ rbu_file *p = (rbu_file*)pFile; @@ -172374,20 +172374,20 @@ static int rbuVfsRead( assert( p->openFlags & SQLITE_OPEN_WAL ); rc = rbuCaptureWalRead(p->pRbu, iOfst, iAmt); }else{ - if( pRbu && pRbu->eStage==RBU_STAGE_OAL - && (p->openFlags & SQLITE_OPEN_WAL) - && iOfst>=pRbu->iOalSz + if( pRbu && pRbu->eStage==RBU_STAGE_OAL + && (p->openFlags & SQLITE_OPEN_WAL) + && iOfst>=pRbu->iOalSz ){ rc = SQLITE_OK; memset(zBuf, 0, iAmt); }else{ rc = p->pReal->pMethods->xRead(p->pReal, zBuf, iAmt, iOfst); #if 1 - /* If this is being called to read the first page of the target - ** database as part of an rbu vacuum operation, synthesize the + /* If this is being called to read the first page of the target + ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ - if( pRbu && rbuIsVacuum(pRbu) + if( pRbu && rbuIsVacuum(pRbu) && rc==SQLITE_IOERR_SHORT_READ && iOfst==0 && (p->openFlags & SQLITE_OPEN_MAIN_DB) && pRbu->rc==SQLITE_OK @@ -172427,9 +172427,9 @@ static int rbuVfsRead( ** Write data to an rbuVfs-file. */ static int rbuVfsWrite( - sqlite3_file *pFile, - const void *zBuf, - int iAmt, + sqlite3_file *pFile, + const void *zBuf, + int iAmt, sqlite_int64 iOfst ){ rbu_file *p = (rbu_file*)pFile; @@ -172440,8 +172440,8 @@ static int rbuVfsWrite( assert( p->openFlags & SQLITE_OPEN_MAIN_DB ); rc = rbuCaptureDbWrite(p->pRbu, iOfst); }else{ - if( pRbu && pRbu->eStage==RBU_STAGE_OAL - && (p->openFlags & SQLITE_OPEN_WAL) + if( pRbu && pRbu->eStage==RBU_STAGE_OAL + && (p->openFlags & SQLITE_OPEN_WAL) && iOfst>=pRbu->iOalSz ){ pRbu->iOalSz = iAmt + iOfst; @@ -172490,10 +172490,10 @@ static int rbuVfsFileSize(sqlite3_file *pFile, sqlite_int64 *pSize){ /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existance of a *-wal file. rbuVfsRead() contains ** similar logic. */ - if( rc==SQLITE_OK && *pSize==0 - && p->pRbu && rbuIsVacuum(p->pRbu) + if( rc==SQLITE_OK && *pSize==0 + && p->pRbu && rbuIsVacuum(p->pRbu) && (p->openFlags & SQLITE_OPEN_MAIN_DB) ){ *pSize = 1024; @@ -172510,10 +172510,10 @@ static int rbuVfsLock(sqlite3_file *pFile, int eLock){ int rc = SQLITE_OK; assert( p->openFlags & (SQLITE_OPEN_MAIN_DB|SQLITE_OPEN_TEMP_DB) ); - if( eLock==SQLITE_LOCK_EXCLUSIVE + if( eLock==SQLITE_LOCK_EXCLUSIVE && (p->bNolock || (pRbu && pRbu->eStage!=RBU_STAGE_DONE)) ){ - /* Do not allow EXCLUSIVE locks. Preventing SQLite from taking this + /* Do not allow EXCLUSIVE locks. Preventing SQLite from taking this ** prevents it from checkpointing the database from sqlite3_close(). */ rc = SQLITE_BUSY; }else{ @@ -172625,8 +172625,8 @@ static int rbuVfsShmLock(sqlite3_file *pFile, int ofst, int n, int flags){ assert( p->openFlags & (SQLITE_OPEN_MAIN_DB|SQLITE_OPEN_TEMP_DB) ); if( pRbu && (pRbu->eStage==RBU_STAGE_OAL || pRbu->eStage==RBU_STAGE_MOVE) ){ /* Magic number 1 is the WAL_CKPT_LOCK lock. Preventing SQLite from - ** taking this lock also prevents any checkpoints from occurring. - ** todo: really, it's not clear why this might occur, as + ** taking this lock also prevents any checkpoints from occurring. + ** todo: really, it's not clear why this might occur, as ** wal_autocheckpoint ought to be turned off. */ if( ofst==WAL_LOCK_CKPT && n==1 ) rc = SQLITE_BUSY; }else{ @@ -172653,10 +172653,10 @@ static int rbuVfsShmLock(sqlite3_file *pFile, int ofst, int n, int flags){ ** Obtain a pointer to a mapping of a single 32KiB page of the *-shm file. */ static int rbuVfsShmMap( - sqlite3_file *pFile, - int iRegion, - int szRegion, - int isWrite, + sqlite3_file *pFile, + int iRegion, + int szRegion, + int isWrite, void volatile **pp ){ rbu_file *p = (rbu_file*)pFile; @@ -172664,7 +172664,7 @@ static int rbuVfsShmMap( int eStage = (p->pRbu ? p->pRbu->eStage : 0); /* If not in RBU_STAGE_OAL, allow this call to pass through. Or, if this - ** rbu is in the RBU_STAGE_OAL state, use heap memory for *-shm space + ** rbu is in the RBU_STAGE_OAL state, use heap memory for *-shm space ** instead of a file on disk. */ assert( p->openFlags & (SQLITE_OPEN_MAIN_DB|SQLITE_OPEN_TEMP_DB) ); if( eStage==RBU_STAGE_OAL || eStage==RBU_STAGE_MOVE ){ @@ -172731,7 +172731,7 @@ static int rbuVfsShmUnmap(sqlite3_file *pFile, int delFlag){ } /* -** Given that zWal points to a buffer containing a wal file name passed to +** Given that zWal points to a buffer containing a wal file name passed to ** either the xOpen() or xAccess() VFS method, return a pointer to the ** file-handle opened by the same database connection on the corresponding ** database file. @@ -172744,12 +172744,12 @@ static rbu_file *rbuFindMaindb(rbu_vfs *pRbuVfs, const char *zWal){ return pDb; } -/* -** A main database named zName has just been opened. The following +/* +** A main database named zName has just been opened. The following ** function returns a pointer to a buffer owned by SQLite that contains ** the name of the *-wal file this db connection will use. SQLite ** happens to pass a pointer to this buffer when using xAccess() -** or xOpen() to operate on the *-wal file. +** or xOpen() to operate on the *-wal file. */ static const char *rbuMainToWal(const char *zName, int flags){ int n = (int)strlen(zName); @@ -172827,7 +172827,7 @@ static int rbuVfsOpen( if( pDb->pRbu && pDb->pRbu->eStage==RBU_STAGE_OAL ){ /* This call is to open a *-wal file. Intead, open the *-oal. This ** code ensures that the string passed to xOpen() is terminated by a - ** pair of '\0' bytes in case the VFS attempts to extract a URI + ** pair of '\0' bytes in case the VFS attempts to extract a URI ** parameter from it. */ const char *zBase = zName; size_t nCopy; @@ -172854,8 +172854,8 @@ static int rbuVfsOpen( } } - if( oflags & SQLITE_OPEN_MAIN_DB - && sqlite3_uri_boolean(zName, "rbu_memory", 0) + if( oflags & SQLITE_OPEN_MAIN_DB + && sqlite3_uri_boolean(zName, "rbu_memory", 0) ){ assert( oflags & SQLITE_OPEN_MAIN_DB ); oflags = SQLITE_OPEN_TEMP_DB | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | @@ -172897,9 +172897,9 @@ static int rbuVfsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ ** is available, or false otherwise. */ static int rbuVfsAccess( - sqlite3_vfs *pVfs, - const char *zPath, - int flags, + sqlite3_vfs *pVfs, + const char *zPath, + int flags, int *pResOut ){ rbu_vfs *pRbuVfs = (rbu_vfs*)pVfs; @@ -172915,7 +172915,7 @@ static int rbuVfsAccess( ** a) if the *-wal file does exist, return SQLITE_CANTOPEN. This ** ensures that the RBU extension never tries to update a database ** in wal mode, even if the first page of the database file has - ** been damaged. + ** been damaged. ** ** b) if the *-wal file does not exist, claim that it does anyway, ** causing SQLite to call xOpen() to open it. This call will also @@ -172942,9 +172942,9 @@ static int rbuVfsAccess( ** of at least (DEVSYM_MAX_PATHNAME+1) bytes. */ static int rbuVfsFullPathname( - sqlite3_vfs *pVfs, - const char *zPath, - int nOut, + sqlite3_vfs *pVfs, + const char *zPath, + int nOut, char *zOut ){ sqlite3_vfs *pRealVfs = ((rbu_vfs*)pVfs)->pRealVfs; @@ -172962,7 +172962,7 @@ static void *rbuVfsDlOpen(sqlite3_vfs *pVfs, const char *zPath){ /* ** Populate the buffer zErrMsg (size nByte bytes) with a human readable -** utf-8 string describing the most recent error encountered associated +** utf-8 string describing the most recent error encountered associated ** with dynamic libraries. */ static void rbuVfsDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){ @@ -172974,8 +172974,8 @@ static void rbuVfsDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){ ** Return a pointer to the symbol zSymbol in the dynamic library pHandle. */ static void (*rbuVfsDlSym( - sqlite3_vfs *pVfs, - void *pArg, + sqlite3_vfs *pVfs, + void *pArg, const char *zSym ))(void){ sqlite3_vfs *pRealVfs = ((rbu_vfs*)pVfs)->pRealVfs; @@ -172992,7 +172992,7 @@ static void rbuVfsDlClose(sqlite3_vfs *pVfs, void *pHandle){ #endif /* SQLITE_OMIT_LOAD_EXTENSION */ /* -** Populate the buffer pointed to by zBufOut with nByte bytes of +** Populate the buffer pointed to by zBufOut with nByte bytes of ** random data. */ static int rbuVfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ @@ -173001,7 +173001,7 @@ static int rbuVfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ } /* -** Sleep for nMicro microseconds. Return the number of microseconds +** Sleep for nMicro microseconds. Return the number of microseconds ** actually slept. */ static int rbuVfsSleep(sqlite3_vfs *pVfs, int nMicro){ @@ -173153,22 +173153,22 @@ SQLITE_API int sqlite3rbu_create_vfs(const char *zName, const char *zParent){ /* ** Page paths: -** -** The value of the 'path' column describes the path taken from the -** root-node of the b-tree structure to each page. The value of the +** +** The value of the 'path' column describes the path taken from the +** root-node of the b-tree structure to each page. The value of the ** root-node path is '/'. ** ** The value of the path for the left-most child page of the root of ** a b-tree is '/000/'. (Btrees store content ordered from left to right ** so the pages to the left have smaller keys than the pages to the right.) ** The next to left-most child of the root page is -** '/001', and so on, each sibling page identified by a 3-digit hex +** '/001', and so on, each sibling page identified by a 3-digit hex ** value. The children of the 451st left-most sibling have paths such ** as '/1c2/000/, '/1c2/001/' etc. ** -** Overflow pages are specified by appending a '+' character and a +** Overflow pages are specified by appending a '+' character and a ** six-digit hexadecimal value to the path to the cell they are linked -** from. For example, the three overflow pages in a chain linked from +** from. For example, the three overflow pages in a chain linked from ** the left-most cell of the 450th child of the root page are identified ** by the paths: ** @@ -173339,8 +173339,8 @@ static int statBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ } - /* Records are always returned in ascending order of (name, path). - ** If this will satisfy the client, set the orderByConsumed flag so that + /* Records are always returned in ascending order of (name, path). + ** If this will satisfy the client, set the orderByConsumed flag so that ** SQLite does not do an external sort. */ if( ( pIdxInfo->nOrderBy==1 @@ -173425,7 +173425,7 @@ static void getLocalPayload( int nLocal; int nMinLocal; int nMaxLocal; - + if( flags==0x0D ){ /* Table leaf node */ nMinLocal = (nUsable - 12) * 32 / 255 - 23; nMaxLocal = nUsable - 35; @@ -173518,7 +173518,7 @@ static int statDecodePage(Btree *pBt, StatPage *p){ if( rc!=SQLITE_OK ){ assert( pPg==0 ); return rc; - } + } pCell->aOvfl[j] = sqlite3Get4byte(sqlite3PagerGetData(pPg)); sqlite3PagerUnref(pPg); } @@ -173602,7 +173602,7 @@ statNextRestart: if( pCell->iOvflnOvfl ){ int nUsable; sqlite3BtreeEnter(pBt); - nUsable = sqlite3BtreeGetPageSize(pBt) - + nUsable = sqlite3BtreeGetPageSize(pBt) - sqlite3BtreeGetReserveNoMutex(pBt); sqlite3BtreeLeave(pBt); pCsr->zName = (char *)sqlite3_column_text(pCsr->pStmt, 0); @@ -173698,7 +173698,7 @@ static int statEof(sqlite3_vtab_cursor *pCursor){ } static int statFilter( - sqlite3_vtab_cursor *pCursor, + sqlite3_vtab_cursor *pCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -173743,8 +173743,8 @@ static int statFilter( } static int statColumn( - sqlite3_vtab_cursor *pCursor, - sqlite3_context *ctx, + sqlite3_vtab_cursor *pCursor, + sqlite3_context *ctx, int i ){ StatCursor *pCsr = (StatCursor *)pCursor; @@ -173892,7 +173892,7 @@ struct SessionBuffer { }; /* -** An object of this type is used internally as an abstraction for +** An object of this type is used internally as an abstraction for ** input data. Input data may be supplied either as a single large buffer ** (e.g. sqlite3changeset_start()) or using a stream function (e.g. ** sqlite3changeset_start_strm()). @@ -173951,11 +173951,11 @@ struct SessionTable { SessionChange **apChange; /* Hash table buckets */ }; -/* +/* ** RECORD FORMAT: ** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the +** The following record format is similar to (but not compatible with) that +** used in SQLite database files. This format is used as part of the ** change-set binary format, and so must be architecture independent. ** ** Unlike the SQLite database record format, each field is self-contained - @@ -173989,7 +173989,7 @@ struct SessionTable { ** Real values: ** An 8-byte big-endian IEEE 754-2008 real value. ** -** Varint values are encoded in the same way as varints in the SQLite +** Varint values are encoded in the same way as varints in the SQLite ** record format. ** ** CHANGESET FORMAT: @@ -174021,7 +174021,7 @@ struct SessionTable { ** ** The new.* record that is part of each INSERT change contains the values ** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted +** DELETE change contains the values that made up the row that was deleted ** from the database. In the changeset format, the records that are part ** of INSERT or DELETE changes never contain any undefined (type byte 0x00) ** fields. @@ -174030,8 +174030,8 @@ struct SessionTable { ** associated with table columns that are not PRIMARY KEY columns and are ** not modified by the UPDATE change are set to "undefined". Other fields ** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new +** change records took place. Within the new.* record, fields associated +** with table columns modified by the UPDATE change contain the new ** values. Fields associated with table columns that are not modified ** are set to "undefined". ** @@ -174057,7 +174057,7 @@ struct SessionTable { ** ** As in the changeset format, each field of the single record that is part ** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE +** table column, counting from left to right within the CREATE TABLE ** statement. ** ** For a DELETE change, all fields within the record except those associated @@ -174087,7 +174087,7 @@ struct SessionChange { }; /* -** Write a varint with value iVal into the buffer at aBuf. Return the +** Write a varint with value iVal into the buffer at aBuf. Return the ** number of bytes written. */ static int sessionVarintPut(u8 *aBuf, int iVal){ @@ -174102,7 +174102,7 @@ static int sessionVarintLen(int iVal){ } /* -** Read a varint value from aBuf[] into *piVal. Return the number of +** Read a varint value from aBuf[] into *piVal. Return the number of ** bytes read. */ static int sessionVarintGet(u8 *aBuf, int *piVal){ @@ -174141,13 +174141,13 @@ static void sessionPutI64(u8 *aBuf, sqlite3_int64 i){ ** This function is used to serialize the contents of value pValue (see ** comment titled "RECORD FORMAT" above). ** -** If it is non-NULL, the serialized form of the value is written to +** If it is non-NULL, the serialized form of the value is written to ** buffer aBuf. *pnWrite is set to the number of bytes written before ** returning. Or, if aBuf is NULL, the only thing this function does is ** set *pnWrite. ** ** If no error occurs, SQLITE_OK is returned. Or, if an OOM error occurs -** within a call to sqlite3_value_text() (may fail if the db is utf-16)) +** within a call to sqlite3_value_text() (may fail if the db is utf-16)) ** SQLITE_NOMEM is returned. */ static int sessionSerializeValue( @@ -174159,16 +174159,16 @@ static int sessionSerializeValue( if( pValue ){ int eType; /* Value type (SQLITE_NULL, TEXT etc.) */ - + eType = sqlite3_value_type(pValue); if( aBuf ) aBuf[0] = eType; - + switch( eType ){ - case SQLITE_NULL: + case SQLITE_NULL: nByte = 1; break; - - case SQLITE_INTEGER: + + case SQLITE_INTEGER: case SQLITE_FLOAT: if( aBuf ){ /* TODO: SQLite does something special to deal with mixed-endian @@ -174185,14 +174185,14 @@ static int sessionSerializeValue( } sessionPutI64(&aBuf[1], i); } - nByte = 9; + nByte = 9; break; - + default: { u8 *z; int n; int nVarint; - + assert( eType==SQLITE_TEXT || eType==SQLITE_BLOB ); if( eType==SQLITE_TEXT ){ z = (u8 *)sqlite3_value_text(pValue); @@ -174202,12 +174202,12 @@ static int sessionSerializeValue( n = sqlite3_value_bytes(pValue); if( z==0 && (eType!=SQLITE_BLOB || n>0) ) return SQLITE_NOMEM; nVarint = sessionVarintLen(n); - + if( aBuf ){ sessionVarintPut(&aBuf[1], n); if( n ) memcpy(&aBuf[nVarint + 1], z, n); } - + nByte = 1 + nVarint + n; break; } @@ -174249,7 +174249,7 @@ static unsigned int sessionHashAppendI64(unsigned int h, i64 i){ } /* -** Append the hash of the blob passed via the second and third arguments to +** Append the hash of the blob passed via the second and third arguments to ** the hash-key value passed as the first. Return the new hash-key value. */ static unsigned int sessionHashAppendBlob(unsigned int h, int n, const u8 *z){ @@ -174268,7 +174268,7 @@ static unsigned int sessionHashAppendType(unsigned int h, int eType){ /* ** This function may only be called from within a pre-update callback. -** It calculates a hash based on the primary key values of the old.* or +** It calculates a hash based on the primary key values of the old.* or ** new.* row currently available and, assuming no error occurs, writes it to ** *piHash before returning. If the primary key contains one or more NULL ** values, *pbNullPK is set to true before returning. @@ -174374,12 +174374,12 @@ static unsigned int sessionChangeHash( int isPK = pTab->abPK[i]; if( bPkOnly && isPK==0 ) continue; - /* It is not possible for eType to be SQLITE_NULL here. The session + /* It is not possible for eType to be SQLITE_NULL here. The session ** module does not record changes for rows with NULL values stored in ** primary key columns. */ - assert( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT - || eType==SQLITE_TEXT || eType==SQLITE_BLOB - || eType==SQLITE_NULL || eType==0 + assert( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT + || eType==SQLITE_TEXT || eType==SQLITE_BLOB + || eType==SQLITE_NULL || eType==0 ); assert( !isPK || (eType!=0 && eType!=SQLITE_NULL) ); @@ -174390,7 +174390,7 @@ static unsigned int sessionChangeHash( h = sessionHashAppendI64(h, sessionGetI64(a)); a += 8; }else{ - int n; + int n; a += sessionVarintGet(a, &n); h = sessionHashAppendBlob(h, n, a); a += n; @@ -174405,7 +174405,7 @@ static unsigned int sessionChangeHash( /* ** Arguments aLeft and aRight are pointers to change records for table pTab. ** This function returns true if the two records apply to the same row (i.e. -** have the same values stored in the primary key columns), or false +** have the same values stored in the primary key columns), or false ** otherwise. */ static int sessionChangeEqual( @@ -174442,17 +174442,17 @@ static int sessionChangeEqual( ** Arguments aLeft and aRight both point to buffers containing change ** records with nCol columns. This function "merges" the two records into ** a single records which is written to the buffer at *paOut. *paOut is -** then set to point to one byte after the last byte written before +** then set to point to one byte after the last byte written before ** returning. ** -** The merging of records is done as follows: For each column, if the +** The merging of records is done as follows: For each column, if the ** aRight record contains a value for the column, copy the value from ** their. Otherwise, if aLeft contains a value, copy it. If neither ** record contains a value for a given column, then neither does the ** output record. */ static void sessionMergeRecord( - u8 **paOut, + u8 **paOut, int nCol, u8 *aLeft, u8 *aRight @@ -174482,13 +174482,13 @@ static void sessionMergeRecord( /* ** This is a helper function used by sessionMergeUpdate(). ** -** When this function is called, both *paOne and *paTwo point to a value -** within a change record. Before it returns, both have been advanced so +** When this function is called, both *paOne and *paTwo point to a value +** within a change record. Before it returns, both have been advanced so ** as to point to the next value in the record. ** ** If, when this function is called, *paTwo points to a valid value (i.e. ** *paTwo[0] is not 0x00 - the "no value" placeholder), a copy of the *paTwo -** pointer is returned and *pnVal is set to the number of bytes in the +** pointer is returned and *pnVal is set to the number of bytes in the ** serialized value. Otherwise, a copy of *paOne is returned and *pnVal ** set to the number of bytes in the value at *paOne. If *paOne points ** to the "no value" placeholder, *pnVal is set to 1. In other words: @@ -174587,8 +174587,8 @@ static int sessionMergeUpdate( aOld = sessionMergeValue(&aOld1, &aOld2, &nOld); aNew = sessionMergeValue(&aNew1, &aNew2, &nNew); - if( bPatchset==0 - && (pTab->abPK[i] || (nOld==nNew && 0==memcmp(aOld, aNew, nNew))) + if( bPatchset==0 + && (pTab->abPK[i] || (nOld==nNew && 0==memcmp(aOld, aNew, nNew))) ){ *(aOut++) = '\0'; }else{ @@ -174678,7 +174678,7 @@ static int sessionPreupdateEqual( } /* -** If required, grow the hash table used to store changes on table pTab +** If required, grow the hash table used to store changes on table pTab ** (part of the session pSession). If a fatal OOM error occurs, set the ** session object to failed and return SQLITE_ERROR. Otherwise, return ** SQLITE_OK. @@ -174806,7 +174806,7 @@ static int sessionTableInfo( *pzTab = (char *)pAlloc; pAlloc += nThis+1; } - + i = 0; while( SQLITE_ROW==sqlite3_step(pStmt) ){ int nName = sqlite3_column_bytes(pStmt, 1); @@ -174819,7 +174819,7 @@ static int sessionTableInfo( i++; } rc = sqlite3_reset(pStmt); - + } /* If successful, populate the output variables. Otherwise, zero them and @@ -174849,14 +174849,14 @@ static int sessionTableInfo( ** If an error occurs, an error code is stored in sqlite3_session.rc and ** non-zero returned. Or, if no error occurs but the table has no primary ** key, sqlite3_session.rc is left set to SQLITE_OK and non-zero returned to -** indicate that updates on this table should be ignored. SessionTable.abPK +** indicate that updates on this table should be ignored. SessionTable.abPK ** is set to NULL in this case. */ static int sessionInitTable(sqlite3_session *pSession, SessionTable *pTab){ if( pTab->nCol==0 ){ u8 *abPK; assert( pTab->azCol==0 || pTab->abPK==0 ); - pSession->rc = sessionTableInfo(pSession->db, pSession->zDb, + pSession->rc = sessionTableInfo(pSession->db, pSession->zDb, pTab->zName, &pTab->nCol, 0, &pTab->azCol, &abPK ); if( pSession->rc==SQLITE_OK ){ @@ -174873,7 +174873,7 @@ static int sessionInitTable(sqlite3_session *pSession, SessionTable *pTab){ } /* -** This function is only called from with a pre-update-hook reporting a +** This function is only called from with a pre-update-hook reporting a ** change on table pTab (attached to session pSession). The type of change ** (UPDATE, INSERT, DELETE) is specified by the first argument. ** @@ -174885,8 +174885,8 @@ static void sessionPreupdateOneChange( sqlite3_session *pSession, /* Session object pTab is attached to */ SessionTable *pTab /* Table that change applies to */ ){ - int iHash; - int bNull = 0; + int iHash; + int bNull = 0; int rc = SQLITE_OK; if( pSession->rc ) return; @@ -174894,7 +174894,7 @@ static void sessionPreupdateOneChange( /* Load table details if required */ if( sessionInitTable(pSession, pTab) ) return; - /* Check the number of columns in this xPreUpdate call matches the + /* Check the number of columns in this xPreUpdate call matches the ** number of columns in the table. */ if( pTab->nCol!=pSession->hook.xCount(pSession->hook.pCtx) ){ pSession->rc = SQLITE_SCHEMA; @@ -174927,10 +174927,10 @@ static void sessionPreupdateOneChange( SessionChange *pChange; /* New change object */ int nByte; /* Number of bytes to allocate */ int i; /* Used to iterate through columns */ - + assert( rc==SQLITE_OK ); pTab->nEntry++; - + /* Figure out how large an allocation is required */ nByte = sizeof(SessionChange); for(i=0; inCol; i++){ @@ -174948,7 +174948,7 @@ static void sessionPreupdateOneChange( rc = sessionSerializeValue(0, p, &nByte); if( rc!=SQLITE_OK ) goto error_out; } - + /* Allocate the change object */ pChange = (SessionChange *)sqlite3_malloc(nByte); if( !pChange ){ @@ -174958,7 +174958,7 @@ static void sessionPreupdateOneChange( memset(pChange, 0, sizeof(SessionChange)); pChange->aRecord = (u8 *)&pChange[1]; } - + /* Populate the change object. None of the preupdate_old(), ** preupdate_new() or SerializeValue() calls below may fail as all ** required values and encodings have already been cached in memory. @@ -174986,8 +174986,8 @@ static void sessionPreupdateOneChange( }else if( pC->bIndirect ){ /* If the existing change is considered "indirect", but this current ** change is "direct", mark the change object as direct. */ - if( pSession->hook.xDepth(pSession->hook.pCtx)==0 - && pSession->bIndirect==0 + if( pSession->hook.xDepth(pSession->hook.pCtx)==0 + && pSession->bIndirect==0 ){ pC->bIndirect = 0; } @@ -175002,7 +175002,7 @@ static void sessionPreupdateOneChange( } static int sessionFindTable( - sqlite3_session *pSession, + sqlite3_session *pSession, const char *zName, SessionTable **ppTab ){ @@ -175019,7 +175019,7 @@ static int sessionFindTable( /* If there is a table-filter configured, invoke it. If it returns 0, ** do not automatically add the new table. */ if( pSession->xTableFilter==0 - || pSession->xTableFilter(pSession->pFilterCtx, zName) + || pSession->xTableFilter(pSession->pFilterCtx, zName) ){ rc = sqlite3session_attach(pSession, zName); if( rc==SQLITE_OK ){ @@ -175054,8 +175054,8 @@ static void xPreUpdate( for(pSession=(sqlite3_session *)pCtx; pSession; pSession=pSession->pNext){ SessionTable *pTab; - /* If this session is attached to a different database ("main", "temp" - ** etc.), or if it is not currently enabled, there is nothing to do. Skip + /* If this session is attached to a different database ("main", "temp" + ** etc.), or if it is not currently enabled, there is nothing to do. Skip ** to the next session object attached to this database. */ if( pSession->bEnable==0 ) continue; if( pSession->rc ) continue; @@ -175146,7 +175146,7 @@ static void sessionDiffHooks( static char *sessionExprComparePK( int nCol, - const char *zDb1, const char *zDb2, + const char *zDb1, const char *zDb2, const char *zTab, const char **azCol, u8 *abPK ){ @@ -175169,7 +175169,7 @@ static char *sessionExprComparePK( static char *sessionExprCompareOther( int nCol, - const char *zDb1, const char *zDb2, + const char *zDb1, const char *zDb2, const char *zTab, const char **azCol, u8 *abPK ){ @@ -175246,9 +175246,9 @@ static int sessionDiffFindNew( } static int sessionDiffFindModified( - sqlite3_session *pSession, - SessionTable *pTab, - const char *zFrom, + sqlite3_session *pSession, + SessionTable *pTab, + const char *zFrom, const char *zExpr ){ int rc = SQLITE_OK; @@ -175346,7 +175346,7 @@ SQLITE_API int sqlite3session_diff( } if( rc==SQLITE_OK ){ - zExpr = sessionExprComparePK(pTo->nCol, + zExpr = sessionExprComparePK(pTo->nCol, zDb, zFrom, pTo->zName, pTo->azCol, pTo->abPK ); } @@ -175401,7 +175401,7 @@ SQLITE_API int sqlite3session_create( memcpy(pNew->zDb, zDb, nDb+1); sessionPreupdateHooks(pNew); - /* Add the new session object to the linked list of session objects + /* Add the new session object to the linked list of session objects ** attached to database handle $db. Do this under the cover of the db ** handle mutex. */ sqlite3_mutex_enter(sqlite3_db_mutex(db)); @@ -175459,7 +175459,7 @@ SQLITE_API void sqlite3session_delete(sqlite3_session *pSession){ } sqlite3_mutex_leave(sqlite3_db_mutex(db)); - /* Delete all attached table objects. And the contents of their + /* Delete all attached table objects. And the contents of their ** associated hash-tables. */ sessionDeleteTable(pSession->pTable); @@ -175471,7 +175471,7 @@ SQLITE_API void sqlite3session_delete(sqlite3_session *pSession){ ** Set a table filter on a Session Object. */ SQLITE_API void sqlite3session_table_filter( - sqlite3_session *pSession, + sqlite3_session *pSession, int(*xFilter)(void*, const char*), void *pCtx /* First argument passed to xFilter */ ){ @@ -175515,7 +175515,7 @@ SQLITE_API int sqlite3session_attach( rc = SQLITE_NOMEM; }else{ /* Populate the new SessionTable object and link it into the list. - ** The new object must be linked onto the end of the list, not + ** The new object must be linked onto the end of the list, not ** simply added to the start of it in order to ensure that tables ** appear in the correct order when a changeset or patchset is ** eventually generated. */ @@ -175583,8 +175583,8 @@ static void sessionAppendValue(SessionBuffer *p, sqlite3_value *pVal, int *pRc){ } /* -** This function is a no-op if *pRc is other than SQLITE_OK when it is -** called. Otherwise, append a single byte to the buffer. +** This function is a no-op if *pRc is other than SQLITE_OK when it is +** called. Otherwise, append a single byte to the buffer. ** ** If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before ** returning. @@ -175596,8 +175596,8 @@ static void sessionAppendByte(SessionBuffer *p, u8 v, int *pRc){ } /* -** This function is a no-op if *pRc is other than SQLITE_OK when it is -** called. Otherwise, append a single varint to the buffer. +** This function is a no-op if *pRc is other than SQLITE_OK when it is +** called. Otherwise, append a single varint to the buffer. ** ** If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before ** returning. @@ -175609,16 +175609,16 @@ static void sessionAppendVarint(SessionBuffer *p, int v, int *pRc){ } /* -** This function is a no-op if *pRc is other than SQLITE_OK when it is -** called. Otherwise, append a blob of data to the buffer. +** This function is a no-op if *pRc is other than SQLITE_OK when it is +** called. Otherwise, append a blob of data to the buffer. ** ** If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before ** returning. */ static void sessionAppendBlob( - SessionBuffer *p, - const u8 *aBlob, - int nBlob, + SessionBuffer *p, + const u8 *aBlob, + int nBlob, int *pRc ){ if( nBlob>0 && 0==sessionBufferGrow(p, nBlob, pRc) ){ @@ -175628,7 +175628,7 @@ static void sessionAppendBlob( } /* -** This function is a no-op if *pRc is other than SQLITE_OK when it is +** This function is a no-op if *pRc is other than SQLITE_OK when it is ** called. Otherwise, append a string to the buffer. All bytes in the string ** up to (but not including) the nul-terminator are written to the buffer. ** @@ -175636,8 +175636,8 @@ static void sessionAppendBlob( ** returning. */ static void sessionAppendStr( - SessionBuffer *p, - const char *zStr, + SessionBuffer *p, + const char *zStr, int *pRc ){ int nStr = sqlite3Strlen30(zStr); @@ -175648,7 +175648,7 @@ static void sessionAppendStr( } /* -** This function is a no-op if *pRc is other than SQLITE_OK when it is +** This function is a no-op if *pRc is other than SQLITE_OK when it is ** called. Otherwise, append the string representation of integer iVal ** to the buffer. No nul-terminator is written. ** @@ -175666,9 +175666,9 @@ static void sessionAppendInteger( } /* -** This function is a no-op if *pRc is other than SQLITE_OK when it is +** This function is a no-op if *pRc is other than SQLITE_OK when it is ** called. Otherwise, append the string zStr enclosed in quotes (") and -** with any embedded quote characters escaped to the buffer. No +** with any embedded quote characters escaped to the buffer. No ** nul-terminator byte is written. ** ** If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before @@ -175741,8 +175741,8 @@ static void sessionAppendCol( /* ** -** This function appends an update change to the buffer (see the comments -** under "CHANGESET FORMAT" at the top of the file). An update change +** This function appends an update change to the buffer (see the comments +** under "CHANGESET FORMAT" at the top of the file). An update change ** consists of: ** ** 1 byte: SQLITE_UPDATE (0x17) @@ -175757,10 +175757,10 @@ static void sessionAppendCol( ** If all of the old.* values are equal to their corresponding new.* value ** (i.e. nothing has changed), then no data at all is appended to the buffer. ** -** Otherwise, the old.* record contains all primary key values and the -** original values of any fields that have been modified. The new.* record +** Otherwise, the old.* record contains all primary key values and the +** original values of any fields that have been modified. The new.* record ** contains the new values of only those fields that have been modified. -*/ +*/ static int sessionAppendUpdate( SessionBuffer *pBuf, /* Buffer to append to */ int bPatchset, /* True for "patchset", 0 for "changeset" */ @@ -175811,8 +175811,8 @@ static int sessionAppendUpdate( int nHdr = 1 + sessionVarintGet(&pCsr[1], &n); assert( eType==SQLITE_TEXT || eType==SQLITE_BLOB ); nAdvance = nHdr + n; - if( eType==sqlite3_column_type(pStmt, i) - && n==sqlite3_column_bytes(pStmt, i) + if( eType==sqlite3_column_type(pStmt, i) + && n==sqlite3_column_bytes(pStmt, i) && (n==0 || 0==memcmp(&pCsr[nHdr], sqlite3_column_blob(pStmt, i), n)) ){ break; @@ -176025,7 +176025,7 @@ static int sessionSelectBind( /* ** This function is a no-op if *pRc is set to other than SQLITE_OK when it -** is called. Otherwise, append a serialized table header (part of the binary +** is called. Otherwise, append a serialized table header (part of the binary ** changeset format) to buffer *pBuf. If an error occurs, set *pRc to an ** SQLite error code before returning. */ @@ -176049,7 +176049,7 @@ static void sessionAppendTableHdr( ** ** If no error occurs, SQLITE_OK is returned and the new changeset/patchset ** stored in output variables *pnChangeset and *ppChangeset. Or, if an error -** occurs, an SQLite error code is returned and both output variables set +** occurs, an SQLite error code is returned and both output variables set ** to 0. */ static int sessionGenerateChangeset( @@ -176134,10 +176134,10 @@ static int sessionGenerateChangeset( /* If the buffer is now larger than SESSIONS_STRM_CHUNK_SIZE, pass ** its contents to the xOutput() callback. */ - if( xOutput - && rc==SQLITE_OK - && buf.nBuf>nNoop - && buf.nBuf>SESSIONS_STRM_CHUNK_SIZE + if( xOutput + && rc==SQLITE_OK + && buf.nBuf>nNoop + && buf.nBuf>SESSIONS_STRM_CHUNK_SIZE ){ rc = xOutput(pOut, (void*)buf.aBuf, buf.nBuf); nNoop = -1; @@ -176172,10 +176172,10 @@ static int sessionGenerateChangeset( } /* -** Obtain a changeset object containing all changes recorded by the +** Obtain a changeset object containing all changes recorded by the ** session object passed as the first argument. ** -** It is the responsibility of the caller to eventually free the buffer +** It is the responsibility of the caller to eventually free the buffer ** using sqlite3_free(). */ SQLITE_API int sqlite3session_changeset( @@ -176209,10 +176209,10 @@ SQLITE_API int sqlite3session_patchset_strm( } /* -** Obtain a patchset object containing all changes recorded by the +** Obtain a patchset object containing all changes recorded by the ** session object passed as the first argument. ** -** It is the responsibility of the caller to eventually free the buffer +** It is the responsibility of the caller to eventually free the buffer ** using sqlite3_free(). */ SQLITE_API int sqlite3session_patchset( @@ -176398,7 +176398,7 @@ static void sessionSkipRecord( /* ** This function sets the value of the sqlite3_value object passed as the -** first argument to a copy of the string or blob held in the aData[] +** first argument to a copy of the string or blob held in the aData[] ** buffer. SQLITE_OK is returned if successful, or SQLITE_NOMEM if an OOM ** error occurs. */ @@ -176409,7 +176409,7 @@ static int sessionValueSetStr( u8 enc /* String encoding (0 for blobs) */ ){ /* In theory this code could just pass SQLITE_TRANSIENT as the final - ** argument to sqlite3ValueSetStr() and have the copy created + ** argument to sqlite3ValueSetStr() and have the copy created ** automatically. But doing so makes it difficult to detect any OOM ** error. Hence the code to create the copy externally. */ u8 *aCopy = sqlite3_malloc(nData+1); @@ -176503,7 +176503,7 @@ static int sessionReadRecord( ** + array of PK flags (1 byte per column), ** + table name (nul terminated). ** -** This function ensures that all of the above is present in the input +** This function ensures that all of the above is present in the input ** buffer (i.e. that it can be accessed without any calls to xInput()). ** If successful, SQLITE_OK is returned. Otherwise, an SQLite error code. ** The input pointer is not moved. @@ -176575,8 +176575,8 @@ static int sessionChangesetBufferRecord( ** + array of PK flags (1 byte per column), ** + table name (nul terminated). ** -** This function decodes the table-header and populates the p->nCol, -** p->zTab and p->abPK[] variables accordingly. The p->apValue[] array is +** This function decodes the table-header and populates the p->nCol, +** p->zTab and p->abPK[] variables accordingly. The p->apValue[] array is ** also allocated or resized according to the new value of p->nCol. The ** input pointer is left pointing to the byte following the table header. ** @@ -176625,9 +176625,9 @@ static int sessionChangesetReadTblhdr(sqlite3_changeset_iter *p){ ** record is written to *paRec before returning and the number of bytes in ** the record to *pnRec. ** -** Either way, this function returns SQLITE_ROW if the iterator is -** successfully advanced to the next change in the changeset, an SQLite -** error code if an error occurs, or SQLITE_DONE if there are no further +** Either way, this function returns SQLITE_ROW if the iterator is +** successfully advanced to the next change in the changeset, an SQLite +** error code if an error occurs, or SQLITE_DONE if there are no further ** changes in the changeset. */ static int sessionChangesetNext( @@ -176681,7 +176681,7 @@ static int sessionChangesetNext( return (p->rc = SQLITE_CORRUPT_BKPT); } - if( paRec ){ + if( paRec ){ int nVal; /* Number of values to buffer */ if( p->bPatchset==0 && op==SQLITE_UPDATE ){ nVal = p->nCol * 2; @@ -176842,7 +176842,7 @@ SQLITE_API int sqlite3changeset_new( /* ** This function may only be called with a changeset iterator that has been -** passed to an SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT +** passed to an SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT ** conflict-handler function. Otherwise, SQLITE_MISUSE is returned. ** ** If successful, *ppValue is set to point to an sqlite3_value structure @@ -177189,7 +177189,7 @@ static int sessionDeleteRow( } /* -** Formulate and prepare a statement to UPDATE a row from database db. +** Formulate and prepare a statement to UPDATE a row from database db. ** Assuming a table structure like this: ** ** CREATE TABLE x(a, b, c, d, PRIMARY KEY(a, c)); @@ -177201,7 +177201,7 @@ static int sessionDeleteRow( ** b = CASE WHEN ?5 THEN ?6 ELSE b END, ** c = CASE WHEN ?8 THEN ?9 ELSE c END, ** d = CASE WHEN ?11 THEN ?12 ELSE d END -** WHERE a = ?1 AND c = ?7 AND (?13 OR +** WHERE a = ?1 AND c = ?7 AND (?13 OR ** (?5==0 OR b IS ?4) AND (?11==0 OR d IS ?10) AND ** ) ** @@ -177346,7 +177346,7 @@ static int sessionInsertRow( } /* -** A wrapper around sqlite3_bind_value() that detects an extra problem. +** A wrapper around sqlite3_bind_value() that detects an extra problem. ** See comments in the body of this function for details. */ static int sessionBindValue( @@ -177369,15 +177369,15 @@ static int sessionBindValue( } /* -** Iterator pIter must point to an SQLITE_INSERT entry. This function +** Iterator pIter must point to an SQLITE_INSERT entry. This function ** transfers new.* values from the current iterator entry to statement ** pStmt. The table being inserted into has nCol columns. ** -** New.* value $i from the iterator is bound to variable ($i+1) of +** New.* value $i from the iterator is bound to variable ($i+1) of ** statement pStmt. If parameter abPK is NULL, all values from 0 to (nCol-1) ** are transfered to the statement. Otherwise, if abPK is not NULL, it points -** to an array nCol elements in size. In this case only those values for -** which abPK[$i] is true are read from the iterator and bound to the +** to an array nCol elements in size. In this case only those values for +** which abPK[$i] is true are read from the iterator and bound to the ** statement. ** ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. @@ -177393,8 +177393,8 @@ static int sessionBindRow( int rc = SQLITE_OK; /* Neither sqlite3changeset_old or sqlite3changeset_new can fail if the - ** argument iterator points to a suitable entry. Make sure that xValue - ** is one of these to guarantee that it is safe to ignore the return + ** argument iterator points to a suitable entry. Make sure that xValue + ** is one of these to guarantee that it is safe to ignore the return ** in the code below. */ assert( xValue==sqlite3changeset_old || xValue==sqlite3changeset_new ); @@ -177412,18 +177412,18 @@ static int sessionBindRow( ** SQL statement pSelect is as generated by the sessionSelectRow() function. ** This function binds the primary key values from the change that changeset ** iterator pIter points to to the SELECT and attempts to seek to the table -** entry. If a row is found, the SELECT statement left pointing at the row +** entry. If a row is found, the SELECT statement left pointing at the row ** and SQLITE_ROW is returned. Otherwise, if no row is found and no error ** has occured, the statement is reset and SQLITE_OK is returned. If an ** error occurs, the statement is reset and an SQLite error code is returned. ** -** If this function returns SQLITE_ROW, the caller must eventually reset() +** If this function returns SQLITE_ROW, the caller must eventually reset() ** statement pSelect. If any other value is returned, the statement does ** not require a reset(). ** ** If the iterator currently points to an INSERT record, bind values from the ** new.* record to the SELECT statement. Or, if it points to a DELETE or -** UPDATE, bind values from the old.* record. +** UPDATE, bind values from the old.* record. */ static int sessionSeekToRow( sqlite3 *db, /* Database handle */ @@ -177437,7 +177437,7 @@ static int sessionSeekToRow( const char *zDummy; /* Unused */ sqlite3changeset_op(pIter, &zDummy, &nCol, &op, 0); - rc = sessionBindRow(pIter, + rc = sessionBindRow(pIter, op==SQLITE_INSERT ? sqlite3changeset_new : sqlite3changeset_old, nCol, abPK, pSelect ); @@ -177481,7 +177481,7 @@ static int sessionSeekToRow( ** is set to non-zero before returning SQLITE_OK. ** ** If the conflict handler returns SQLITE_CHANGESET_ABORT, SQLITE_ABORT is -** returned. Or, if the conflict handler returns an invalid value, +** returned. Or, if the conflict handler returns an invalid value, ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, ** this function returns SQLITE_OK. */ @@ -177568,16 +177568,16 @@ static int sessionConflictHandler( ** to true before returning. In this case the caller will invoke this function ** again, this time with pbRetry set to NULL. ** -** If argument pbReplace is NULL and a CHANGESET_CONFLICT conflict is +** If argument pbReplace is NULL and a CHANGESET_CONFLICT conflict is ** encountered invoke the conflict handler with CHANGESET_CONSTRAINT instead. ** Or, if pbReplace is not NULL, invoke it with CHANGESET_CONFLICT. If such ** an invocation returns SQLITE_CHANGESET_REPLACE, set *pbReplace to true ** before retrying. In this case the caller attempts to remove the conflicting -** row before invoking this function again, this time with pbReplace set +** row before invoking this function again, this time with pbReplace set ** to NULL. ** ** If any conflict handler returns SQLITE_CHANGESET_ABORT, this function -** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is +** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is ** returned. */ static int sessionApplyOneOp( @@ -177696,7 +177696,7 @@ static int sessionApplyOneOp( ** the conflict handler callback. ** ** The difference between this function and sessionApplyOne() is that this -** function handles the case where the conflict-handler is invoked and +** function handles the case where the conflict-handler is invoked and ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be ** retried in some manner. */ @@ -177717,7 +177717,7 @@ static int sessionApplyOneWithRetry( /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and ** a row with the correct PK is present in the db, but one or more other - ** fields do not contain the expected values) and the conflict handler + ** fields do not contain the expected values) and the conflict handler ** returned SQLITE_CHANGESET_REPLACE. In this case retry the operation, ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ @@ -177735,7 +177735,7 @@ static int sessionApplyOneWithRetry( assert( pIter->op==SQLITE_INSERT ); rc = sqlite3_exec(db, "SAVEPOINT replace_op", 0, 0, 0); if( rc==SQLITE_OK ){ - rc = sessionBindRow(pIter, + rc = sessionBindRow(pIter, sqlite3changeset_new, pApply->nCol, pApply->abPK, pApply->pDelete); sqlite3_bind_int(pApply->pDelete, pApply->nCol+1, 1); } @@ -177758,7 +177758,7 @@ static int sessionApplyOneWithRetry( ** Retry the changes accumulated in the pApply->constraints buffer. */ static int sessionRetryConstraints( - sqlite3 *db, + sqlite3 *db, int bPatchset, const char *zTab, SessionApplyCtx *pApply, @@ -177806,7 +177806,7 @@ static int sessionRetryConstraints( /* ** Argument pIter is a changeset iterator that has been initialized, but -** not yet passed to sqlite3changeset_next(). This function applies the +** not yet passed to sqlite3changeset_next(). This function applies the ** changeset to the main database attached to handle "db". The supplied ** conflict handler callback is invoked to resolve any conflicts encountered ** while applying the change. @@ -177845,7 +177845,7 @@ static int sessionChangesetApply( int nCol; int op; const char *zNew; - + sqlite3changeset_op(pIter, &zNew, &nCol, &op, 0); if( zTab==0 || sqlite3_strnicmp(zNew, zTab, nTab+1) ){ @@ -177858,14 +177858,14 @@ static int sessionChangesetApply( sqlite3_free((char*)sApply.azCol); /* cast works around VC++ bug */ sqlite3_finalize(sApply.pDelete); - sqlite3_finalize(sApply.pUpdate); + sqlite3_finalize(sApply.pUpdate); sqlite3_finalize(sApply.pInsert); sqlite3_finalize(sApply.pSelect); memset(&sApply, 0, sizeof(sApply)); sApply.db = db; sApply.bDeferConstraints = 1; - /* If an xFilter() callback was specified, invoke it now. If the + /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ schemaMismatch = (xFilter && (0==xFilter(pCtx, zNew))); @@ -177889,18 +177889,18 @@ static int sessionChangesetApply( for(i=0; iop; - /* + /* ** op1=INSERT, op2=INSERT -> Unsupported. Discard op2. ** op1=INSERT, op2=UPDATE -> INSERT. ** op1=INSERT, op2=DELETE -> (none) @@ -178083,7 +178083,7 @@ static int sessionChangeMerge( ** op1=DELETE, op2=INSERT -> UPDATE. ** op1=DELETE, op2=UPDATE -> Unsupported. Discard op2. ** op1=DELETE, op2=DELETE -> Unsupported. Discard op2. - */ + */ if( (op1==SQLITE_INSERT && op2==SQLITE_INSERT) || (op1==SQLITE_UPDATE && op2==SQLITE_INSERT) || (op1==SQLITE_DELETE && op2==SQLITE_UPDATE) @@ -178222,7 +178222,7 @@ static int sessionChangesetToHash( /* The new object must be linked on to the end of the list, not ** simply added to the start of it. This is to ensure that the - ** tables within the output of sqlite3changegroup_output() are in + ** tables within the output of sqlite3changegroup_output() are in ** the right order. */ for(ppTab=&pGrp->pList; *ppTab; ppTab=&(*ppTab)->pNext); *ppTab = pTab; @@ -178240,7 +178240,7 @@ static int sessionChangesetToHash( pTab, (pIter->bPatchset && op==SQLITE_DELETE), aRec, pTab->nChange ); - /* Search for existing entry. If found, remove it from the hash table. + /* Search for existing entry. If found, remove it from the hash table. ** Code below may link it back in. */ for(pp=&pTab->apChange[iHash]; *pp; pp=&(*pp)->pNext){ @@ -178258,7 +178258,7 @@ static int sessionChangesetToHash( } } - rc = sessionChangeMerge(pTab, + rc = sessionChangeMerge(pTab, pIter->bPatchset, pExist, op, bIndirect, aRec, nRec, &pChange ); if( rc ) break; @@ -178279,7 +178279,7 @@ static int sessionChangesetToHash( ** ** If xOutput is not NULL, then the changeset/patchset is returned to the ** user via one or more calls to xOutput, as with the other streaming -** interfaces. +** interfaces. ** ** Or, if xOutput is NULL, then (*ppOut) is populated with a pointer to a ** buffer containing the output changeset before this function returns. In @@ -178304,7 +178304,7 @@ static int sessionChangegroupOutput( assert( xOutput==0 || (ppOut==0 && pnOut==0) ); /* Create the serialized output changeset based on the contents of the - ** hash tables attached to the SessionTable objects in list p->pList. + ** hash tables attached to the SessionTable objects in list p->pList. */ for(pTab=pGrp->pList; rc==SQLITE_OK && pTab; pTab=pTab->pNext){ int i; @@ -178408,7 +178408,7 @@ SQLITE_API int sqlite3changegroup_add_strm( */ SQLITE_API int sqlite3changegroup_output_strm( sqlite3_changegroup *pGrp, - int (*xOutput)(void *pOut, const void *pData, int nData), + int (*xOutput)(void *pOut, const void *pData, int nData), void *pOut ){ return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0); @@ -178424,7 +178424,7 @@ SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup *pGrp){ } } -/* +/* ** Combine two changesets together. */ SQLITE_API int sqlite3changeset_concat( @@ -178688,7 +178688,7 @@ static void jsonReset(JsonString *p){ } -/* Report an out-of-memory (OOM) condition +/* Report an out-of-memory (OOM) condition */ static void jsonOom(JsonString *p){ p->bErr = 1; @@ -178805,7 +178805,7 @@ static void jsonAppendString(JsonString *p, const char *zIn, u32 N){ } /* -** Append a function parameter value to the JSON string under +** Append a function parameter value to the JSON string under ** construction. */ static void jsonAppendValue( @@ -178850,7 +178850,7 @@ static void jsonAppendValue( */ static void jsonResult(JsonString *p){ if( p->bErr==0 ){ - sqlite3_result_text64(p->pCtx, p->zBuf, p->nUsed, + sqlite3_result_text64(p->pCtx, p->zBuf, p->nUsed, p->bStatic ? SQLITE_TRANSIENT : sqlite3_free, SQLITE_UTF8); jsonZero(p); @@ -179056,7 +179056,7 @@ static void jsonReturn( if( pNode->jnFlags & JNODE_RAW ){ sqlite3_result_text(pCtx, pNode->u.zJContent, pNode->n, SQLITE_TRANSIENT); - }else + }else #endif assert( (pNode->jnFlags & JNODE_RAW)==0 ); if( (pNode->jnFlags & JNODE_ESCAPE)==0 ){ @@ -179650,7 +179650,7 @@ static void jsonWrongNumArgs( char *zMsg = sqlite3_mprintf("json_%s() needs an odd number of arguments", zFuncName); sqlite3_result_error(pCtx, zMsg, -1); - sqlite3_free(zMsg); + sqlite3_free(zMsg); } @@ -179718,7 +179718,7 @@ static void jsonTest1Func( /* ** Implementation of the json_QUOTE(VALUE) function. Return a JSON value -** corresponding to the SQL value input. Mostly this means putting +** corresponding to the SQL value input. Mostly this means putting ** double-quotes around strings and returning the unquoted string "null" ** when given a NULL input. */ @@ -179765,7 +179765,7 @@ static void jsonArrayFunc( ** json_array_length(JSON) ** json_array_length(JSON, PATH) ** -** Return the number of elements in the top-level JSON array. +** Return the number of elements in the top-level JSON array. ** Return 0 if the input is not a well-formed JSON array. */ static void jsonArrayLengthFunc( @@ -180209,7 +180209,7 @@ static int jsonEachConnect( UNUSED_PARAM(argv); UNUSED_PARAM(argc); UNUSED_PARAM(pAux); - rc = sqlite3_declare_vtab(db, + rc = sqlite3_declare_vtab(db, "CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path," "json HIDDEN,root HIDDEN)"); if( rc==SQLITE_OK ){ @@ -180387,7 +180387,7 @@ static int jsonEachColumn( break; } case JEACH_ID: { - sqlite3_result_int64(ctx, + sqlite3_result_int64(ctx, (sqlite3_int64)p->i + ((pThis->jnFlags & JNODE_LABEL)!=0)); break; } @@ -180683,7 +180683,7 @@ SQLITE_PRIVATE int sqlite3Json1Init(sqlite3 *db){ #endif for(i=0; i FTS5_TOKENIZE_QUERY - A MATCH query is being executed -** against the FTS index. The tokenizer is being called to tokenize +**
          • FTS5_TOKENIZE_QUERY - A MATCH query is being executed +** against the FTS index. The tokenizer is being called to tokenize ** a bareword or quoted string specified as part of the query. ** **
          • (FTS5_TOKENIZE_QUERY | FTS5_TOKENIZE_PREFIX) - Same as @@ -181096,10 +181096,10 @@ struct Fts5ExtensionApi { ** followed by a "*" character, indicating that the last token ** returned by the tokenizer will be treated as a token prefix. ** -**
          • FTS5_TOKENIZE_AUX - The tokenizer is being invoked to +**
          • FTS5_TOKENIZE_AUX - The tokenizer is being invoked to ** satisfy an fts5_api.xTokenize() request made by an auxiliary ** function. Or an fts5_api.xColumnSize() request made by the same -** on a columnsize=0 database. +** on a columnsize=0 database. ** ** ** For each token in the input string, the supplied callback xToken() must @@ -181111,10 +181111,10 @@ struct Fts5ExtensionApi { ** which the token is derived within the input. ** ** The second argument passed to the xToken() callback ("tflags") should -** normally be set to 0. The exception is if the tokenizer supports +** normally be set to 0. The exception is if the tokenizer supports ** synonyms. In this case see the discussion below for details. ** -** FTS5 assumes the xToken() callback is invoked for each token in the +** FTS5 assumes the xToken() callback is invoked for each token in the ** order that they occur within the input text. ** ** If an xToken() callback returns any value other than SQLITE_OK, then @@ -181128,7 +181128,7 @@ struct Fts5ExtensionApi { ** SYNONYM SUPPORT ** ** Custom tokenizers may also support synonyms. Consider a case in which a -** user wishes to query for a phrase such as "first place". Using the +** user wishes to query for a phrase such as "first place". Using the ** built-in tokenizers, the FTS5 query 'first + place' will match instances ** of "first place" within the document set, but not alternative forms ** such as "1st place". In some applications, it would be better to match @@ -181137,7 +181137,7 @@ struct Fts5ExtensionApi { ** ** There are several ways to approach this in FTS5: ** -**
            1. By mapping all synonyms to a single token. In this case, the +**
              1. By mapping all synonyms to a single token. In this case, the ** In the above example, this means that the tokenizer returns the ** same token for inputs "first" and "1st". Say that token is in ** fact "first", so that when the user inserts the document "I won @@ -181147,7 +181147,7 @@ struct Fts5ExtensionApi { ** as expected. ** **
              2. By adding multiple synonyms for a single term to the FTS index. -** In this case, when tokenizing query text, the tokenizer may +** In this case, when tokenizing query text, the tokenizer may ** provide multiple synonyms for a single term within the document. ** FTS5 then queries the index for each synonym individually. For ** example, faced with the query: @@ -181156,26 +181156,26 @@ struct Fts5ExtensionApi { ** ... MATCH 'first place' ** ** the tokenizer offers both "1st" and "first" as synonyms for the -** first token in the MATCH query and FTS5 effectively runs a query +** first token in the MATCH query and FTS5 effectively runs a query ** similar to: ** ** ** ... MATCH '(first OR 1st) place' ** ** except that, for the purposes of auxiliary functions, the query -** still appears to contain just two phrases - "(first OR 1st)" +** still appears to contain just two phrases - "(first OR 1st)" ** being treated as a single phrase. ** **
              3. By adding multiple synonyms for a single term to the FTS index. ** Using this method, when tokenizing document text, the tokenizer -** provides multiple synonyms for each token. So that when a +** provides multiple synonyms for each token. So that when a ** document such as "I won first place" is tokenized, entries are ** added to the FTS index for "i", "won", "first", "1st" and ** "place". ** ** This way, even if the tokenizer does not provide synonyms ** when tokenizing query text (it should not - to do would be -** inefficient), it doesn't matter if the user queries for +** inefficient), it doesn't matter if the user queries for ** 'first + place' or '1st + place', as there are entires in the ** FTS index corresponding to both forms of the first token. **
              @@ -181196,11 +181196,11 @@ struct Fts5ExtensionApi { ** ** It is an error to specify the FTS5_TOKEN_COLOCATED flag the first time ** xToken() is called. Multiple synonyms may be specified for a single token -** by making multiple calls to xToken(FTS5_TOKEN_COLOCATED) in sequence. +** by making multiple calls to xToken(FTS5_TOKEN_COLOCATED) in sequence. ** There is no limit to the number of synonyms that may be provided for a ** single token. ** -** In many cases, method (1) above is the best approach. It does not add +** In many cases, method (1) above is the best approach. It does not add ** extra data to the FTS index or require FTS5 to query for multiple terms, ** so it is efficient in terms of disk space and query speed. However, it ** does not support prefix queries very well. If, as suggested above, the @@ -181212,18 +181212,18 @@ struct Fts5ExtensionApi { ** will not match documents that contain the token "1st" (as the tokenizer ** will probably not map "1s" to any prefix of "first"). ** -** For full prefix support, method (3) may be preferred. In this case, +** For full prefix support, method (3) may be preferred. In this case, ** because the index contains entries for both "first" and "1st", prefix ** queries such as 'fi*' or '1s*' will match correctly. However, because ** extra entries are added to the FTS index, this method uses more space ** within the database. ** ** Method (2) offers a midpoint between (1) and (3). Using this method, -** a query such as '1s*' will match documents that contain the literal +** a query such as '1s*' will match documents that contain the literal ** token "1st", but not "first" (assuming the tokenizer is not able to ** provide synonyms for prefixes). However, a non-prefix query like '1st' ** will match against "1st" and "first". This method does not require -** extra disk space, as no extra entries are added to the FTS index. +** extra disk space, as no extra entries are added to the FTS index. ** On the other hand, it may require more CPU cycles to run MATCH queries, ** as separate queries of the FTS index are required for each synonym. ** @@ -181237,10 +181237,10 @@ typedef struct fts5_tokenizer fts5_tokenizer; struct fts5_tokenizer { int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); void (*xDelete)(Fts5Tokenizer*); - int (*xTokenize)(Fts5Tokenizer*, + int (*xTokenize)(Fts5Tokenizer*, void *pCtx, int flags, /* Mask of FTS5_TOKENIZE_* flags */ - const char *pText, int nText, + const char *pText, int nText, int (*xToken)( void *pCtx, /* Copy of 2nd argument to xTokenize() */ int tflags, /* Mask of FTS5_TOKEN_* flags */ @@ -181359,7 +181359,7 @@ typedef sqlite3_uint64 u64; #endif -/* Truncate very long tokens to this many bytes. Hard limit is +/* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset ** field that occurs at the start of each leaf page (see fts5_index.c). */ #define FTS5_MAX_TOKEN_SIZE 32768 @@ -181387,7 +181387,7 @@ static int sqlite3Fts5Corrupt(void); /* ** The assert_nc() macro is similar to the assert() macro, except that it -** is used for assert() conditions that are true only if it can be +** is used for assert() conditions that are true only if it can be ** guranteed that the database is not corrupt. */ #ifdef SQLITE_DEBUG @@ -181410,7 +181410,7 @@ SQLITE_API extern int sqlite3_fts5_may_be_corrupt; typedef struct Fts5Global Fts5Global; typedef struct Fts5Colset Fts5Colset; -/* If a NEAR() clump or phrase may only match a specific set of columns, +/* If a NEAR() clump or phrase may only match a specific set of columns, ** then an object of the following type is used to record the set of columns. ** Each entry in the aiCol[] array is a column that may be matched. ** @@ -181438,20 +181438,20 @@ typedef struct Fts5Config Fts5Config; ** ** nAutomerge: ** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the +** attempt to merge together. A value of 1 sets the object to use the ** compile time default. Zero disables auto-merge altogether. ** ** zContent: ** ** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or +** The value of the content_rowid= option, if one was specified. Or ** the string "rowid" otherwise. This text is not quoted - if it is ** used as part of an SQL statement it needs to be quoted appropriately. ** ** zContentExprlist: ** ** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a +** This exists in order to allow the fts5_index.c module to return a ** decent error message if it encounters a file-format version it does ** not understand. ** @@ -181475,8 +181475,8 @@ struct Fts5Config { int nPrefix; /* Number of prefix indexes */ int *aPrefix; /* Sizes in bytes of nPrefix prefix indexes */ int eContent; /* An FTS5_CONTENT value */ - char *zContent; /* content table */ - char *zContentRowid; /* "content_rowid=" option value */ + char *zContent; /* content table */ + char *zContentRowid; /* "content_rowid=" option value */ int bColumnsize; /* "columnsize=" option value (dflt==1) */ int eDetail; /* FTS5_DETAIL_XXX value */ char *zContentExprlist; @@ -181677,27 +181677,27 @@ static int sqlite3Fts5IndexClose(Fts5Index *p); ** Return a simple checksum value based on the arguments. */ static u64 sqlite3Fts5IndexEntryCksum( - i64 iRowid, - int iCol, - int iPos, + i64 iRowid, + int iCol, + int iPos, int iIdx, const char *pTerm, int nTerm ); /* -** Argument p points to a buffer containing utf-8 text that is n bytes in +** Argument p points to a buffer containing utf-8 text that is n bytes in ** size. Return the number of bytes in the nChar character prefix of the ** buffer, or 0 if there are less than nChar characters in total. */ static int sqlite3Fts5IndexCharlenToBytelen( - const char *p, - int nByte, + const char *p, + int nByte, int nChar ); /* -** Open a new iterator to iterate though all rowids that match the +** Open a new iterator to iterate though all rowids that match the ** specified token or token prefix. */ static int sqlite3Fts5IndexQuery( @@ -181728,7 +181728,7 @@ static int sqlite3Fts5IterNextScan(Fts5IndexIter*); /* -** Insert or remove data to or from the index. Each time a document is +** Insert or remove data to or from the index. Each time a document is ** added to or removed from the index, this function is called one or more ** times. ** @@ -181763,7 +181763,7 @@ static int sqlite3Fts5IndexSync(Fts5Index *p, int bCommit); /* ** Discard any data stored in the in-memory hash tables. Do not write it ** to the database. Additionally, assume that the contents of the %_data -** table may have changed on disk. So any in-memory caches of %_data +** table may have changed on disk. So any in-memory caches of %_data ** records must be invalidated. */ static int sqlite3Fts5IndexRollback(Fts5Index *p); @@ -181779,16 +181779,16 @@ static int sqlite3Fts5IndexSetAverages(Fts5Index *p, const u8*, int); */ static int sqlite3Fts5IndexIntegrityCheck(Fts5Index*, u64 cksum); -/* -** Called during virtual module initialization to register UDF -** fts5_decode() with SQLite +/* +** Called during virtual module initialization to register UDF +** fts5_decode() with SQLite */ static int sqlite3Fts5IndexInit(sqlite3*); static int sqlite3Fts5IndexSetCookie(Fts5Index*, int); /* -** Return the total number of entries read from the %_data table by +** Return the total number of entries read from the %_data table by ** this connection since it was created. */ static int sqlite3Fts5IndexReads(Fts5Index *p); @@ -181805,7 +181805,7 @@ static int sqlite3Fts5IndexLoadConfig(Fts5Index *p); **************************************************************************/ /************************************************************************** -** Interface to code in fts5_varint.c. +** Interface to code in fts5_varint.c. */ static int sqlite3Fts5GetVarint32(const unsigned char *p, u32 *v); static int sqlite3Fts5GetVarintLen(u32 iVal); @@ -181830,11 +181830,11 @@ static int sqlite3Fts5PutVarint(unsigned char *p, u64 v); /************************************************************************** -** Interface to code in fts5.c. +** Interface to code in fts5.c. */ static int sqlite3Fts5GetTokenizer( - Fts5Global*, + Fts5Global*, const char **azArg, int nArg, Fts5Tokenizer**, @@ -181849,7 +181849,7 @@ static Fts5Index *sqlite3Fts5IndexFromCsrid(Fts5Global*, i64, Fts5Config **); **************************************************************************/ /************************************************************************** -** Interface to code in fts5_hash.c. +** Interface to code in fts5_hash.c. */ typedef struct Fts5Hash Fts5Hash; @@ -181898,7 +181898,7 @@ static void sqlite3Fts5HashScanEntry(Fts5Hash *, **************************************************************************/ /************************************************************************** -** Interface to code in fts5_storage.c. fts5_storage.c contains contains +** Interface to code in fts5_storage.c. fts5_storage.c contains contains ** code to access the data stored in the %_content and %_docsize tables. */ @@ -181947,7 +181947,7 @@ static int sqlite3Fts5StorageReset(Fts5Storage *p); /************************************************************************** -** Interface to code in fts5_expr.c. +** Interface to code in fts5_expr.c. */ typedef struct Fts5Expr Fts5Expr; typedef struct Fts5ExprNode Fts5ExprNode; @@ -181963,9 +181963,9 @@ struct Fts5Token { /* Parse a MATCH expression. */ static int sqlite3Fts5ExprNew( - Fts5Config *pConfig, + Fts5Config *pConfig, const char *zExpr, - Fts5Expr **ppNew, + Fts5Expr **ppNew, char **pzErr ); @@ -182025,21 +182025,21 @@ static Fts5ExprNode *sqlite3Fts5ParseImplicitAnd( ); static Fts5ExprPhrase *sqlite3Fts5ParseTerm( - Fts5Parse *pParse, - Fts5ExprPhrase *pPhrase, + Fts5Parse *pParse, + Fts5ExprPhrase *pPhrase, Fts5Token *pToken, int bPrefix ); static Fts5ExprNearset *sqlite3Fts5ParseNearset( - Fts5Parse*, + Fts5Parse*, Fts5ExprNearset*, - Fts5ExprPhrase* + Fts5ExprPhrase* ); static Fts5Colset *sqlite3Fts5ParseColset( - Fts5Parse*, - Fts5Colset*, + Fts5Parse*, + Fts5Colset*, Fts5Token * ); @@ -182060,7 +182060,7 @@ static void sqlite3Fts5ParseNear(Fts5Parse *pParse, Fts5Token*); /************************************************************************** -** Interface to code in fts5_aux.c. +** Interface to code in fts5_aux.c. */ static int sqlite3Fts5AuxInit(fts5_api*); @@ -182069,7 +182069,7 @@ static int sqlite3Fts5AuxInit(fts5_api*); **************************************************************************/ /************************************************************************** -** Interface to code in fts5_tokenizer.c. +** Interface to code in fts5_tokenizer.c. */ static int sqlite3Fts5TokenizerInit(fts5_api*); @@ -182078,7 +182078,7 @@ static int sqlite3Fts5TokenizerInit(fts5_api*); **************************************************************************/ /************************************************************************** -** Interface to code in fts5_vocab.c. +** Interface to code in fts5_vocab.c. */ static int sqlite3Fts5VocabInit(Fts5Global*, sqlite3*); @@ -182089,7 +182089,7 @@ static int sqlite3Fts5VocabInit(Fts5Global*, sqlite3*); /************************************************************************** -** Interface to automatically generated code in fts5_unicode2.c. +** Interface to automatically generated code in fts5_unicode2.c. */ static int sqlite3Fts5UnicodeIsalnum(int c); static int sqlite3Fts5UnicodeIsdiacritic(int c); @@ -182198,7 +182198,7 @@ static int sqlite3Fts5UnicodeFold(int c, int bRemoveDiacritic); ** the minor type might be the name of the identifier. ** Each non-terminal can have a different minor type. ** Terminal symbols all have the same minor type, though. -** This macros defines the minor type for terminal +** This macros defines the minor type for terminal ** symbols. ** fts5YYMINORTYPE is the data type used for all minor types. ** This is typically a union of many types, one of @@ -182274,7 +182274,7 @@ typedef union { /* Next are the tables used to determine what action to take based on the ** current state and lookahead token. These tables are used to implement ** functions that take a state number and lookahead value and return an -** action integer. +** action integer. ** ** Suppose the action integer is N. Then the action is determined as ** follows @@ -182374,9 +182374,9 @@ static const fts5YYACTIONTYPE fts5yy_default[] = { }; /********** End of lemon-generated parsing tables *****************************/ -/* The next table maps tokens (terminal symbols) into fallback tokens. +/* The next table maps tokens (terminal symbols) into fallback tokens. ** If a construct like the following: -** +** ** %fallback ID X Y Z. ** ** appears in the grammar, then ID becomes a fallback token for X, Y, @@ -182446,10 +182446,10 @@ static char *fts5yyTracePrompt = 0; #endif /* NDEBUG */ #ifndef NDEBUG -/* +/* ** Turn parser tracing on by giving a stream to which to write the trace ** and a prompt to preface each trace message. Tracing is turned off -** by making either argument NULL +** by making either argument NULL ** ** Inputs: **
                @@ -182474,7 +182474,7 @@ static void sqlite3Fts5ParserTrace(FILE *TraceFILE, char *zTracePrompt){ #ifndef NDEBUG /* For tracing shifts, the names of all terminals and nonterminals ** are required. The following table supplies these names */ -static const char *const fts5yyTokenName[] = { +static const char *const fts5yyTokenName[] = { "$", "OR", "AND", "NOT", "TERM", "COLON", "LP", "RP", "MINUS", "LCP", "RCP", "STRING", @@ -182548,7 +182548,7 @@ static int fts5yyGrowStack(fts5yyParser *p){ #endif p->fts5yystksz = newSize; } - return pNew==0; + return pNew==0; } #endif @@ -182586,7 +182586,7 @@ static void sqlite3Fts5ParserInit(void *fts5yypParser){ } #ifndef sqlite3Fts5Parser_ENGINEALWAYSONSTACK -/* +/* ** This function allocates a new parser. ** The only argument is a pointer to a function which works like ** malloc. @@ -182610,7 +182610,7 @@ static void *sqlite3Fts5ParserAlloc(void *(*mallocProc)(fts5YYMALLOCARGTYPE)){ /* The following function deletes the "minor type" or semantic value ** associated with a symbol. The symbol can be either a terminal ** or nonterminal. "fts5yymajor" is the symbol code, and "fts5yypminor" is -** a pointer to the value to be deleted. The code used to do the +** a pointer to the value to be deleted. The code used to do the ** deletions is derived from the %destructor and/or %token_destructor ** directives of the input grammar. */ @@ -182624,7 +182624,7 @@ static void fts5yy_destructor( /* Here is inserted the actions which take place when a ** terminal or non-terminal is destroyed. This can happen ** when the symbol is popped from the stack during a - ** reduce or during error processing or when a parser is + ** reduce or during error processing or when a parser is ** being destroyed before it is finished parsing. ** ** Note: during a reduce, the only symbols destroyed are those @@ -182699,7 +182699,7 @@ static void sqlite3Fts5ParserFinalize(void *p){ } #ifndef sqlite3Fts5Parser_ENGINEALWAYSONSTACK -/* +/* ** Deallocate and destroy a parser. Destructors are called for ** all stack elements before shutting the parser down. ** @@ -182739,7 +182739,7 @@ static unsigned int fts5yy_find_shift_action( ){ int i; int stateno = pParser->fts5yytos->stateno; - + if( stateno>=fts5YY_MIN_REDUCE ) return stateno; assert( stateno <= fts5YY_SHIFT_COUNT ); do{ @@ -182765,7 +182765,7 @@ static unsigned int fts5yy_find_shift_action( #ifdef fts5YYWILDCARD { int j = i - iLookAhead + fts5YYWILDCARD; - if( + if( #if fts5YY_SHIFT_MIN+fts5YYWILDCARD<0 j>=0 && #endif @@ -182880,7 +182880,7 @@ static void fts5yy_shift( assert( fts5yypParser->fts5yyhwm == (int)(fts5yypParser->fts5yytos - fts5yypParser->fts5yystack) ); } #endif -#if fts5YYSTACKDEPTH>0 +#if fts5YYSTACKDEPTH>0 if( fts5yypParser->fts5yytos>=&fts5yypParser->fts5yystack[fts5YYSTACKDEPTH] ){ fts5yypParser->fts5yytos--; fts5yyStackOverflow(fts5yypParser); @@ -182974,7 +182974,7 @@ static void fts5yy_reduce( assert( fts5yypParser->fts5yyhwm == (int)(fts5yypParser->fts5yytos - fts5yypParser->fts5yystack)); } #endif -#if fts5YYSTACKDEPTH>0 +#if fts5YYSTACKDEPTH>0 if( fts5yypParser->fts5yytos>=&fts5yypParser->fts5yystack[fts5YYSTACKDEPTH-1] ){ fts5yyStackOverflow(fts5yypParser); return; @@ -183037,20 +183037,20 @@ static void fts5yy_reduce( fts5yymsp[-1].minor.fts5yy24 = fts5yylhsminor.fts5yy24; break; case 8: /* cnearset ::= nearset */ -{ - fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, fts5yymsp[0].minor.fts5yy46); +{ + fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, fts5yymsp[0].minor.fts5yy46); } fts5yymsp[0].minor.fts5yy24 = fts5yylhsminor.fts5yy24; break; case 9: /* cnearset ::= colset COLON nearset */ -{ +{ sqlite3Fts5ParseSetColset(pParse, fts5yymsp[0].minor.fts5yy46, fts5yymsp[-2].minor.fts5yy11); - fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, fts5yymsp[0].minor.fts5yy46); + fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, fts5yymsp[0].minor.fts5yy46); } fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24; break; case 10: /* colset ::= MINUS LCP colsetlist RCP */ -{ +{ fts5yymsp[-3].minor.fts5yy11 = sqlite3Fts5ParseColsetInvert(pParse, fts5yymsp[-1].minor.fts5yy11); } break; @@ -183058,6 +183058,7 @@ static void fts5yy_reduce( { fts5yymsp[-2].minor.fts5yy11 = fts5yymsp[-1].minor.fts5yy11; } break; case 12: /* colset ::= STRING */ + case 15: /* colsetlist ::= STRING */ fts5yytestcase(fts5yyruleno==15); { fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0); } @@ -183070,16 +183071,10 @@ static void fts5yy_reduce( } break; case 14: /* colsetlist ::= colsetlist STRING */ -{ +{ fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, fts5yymsp[-1].minor.fts5yy11, &fts5yymsp[0].minor.fts5yy0); } fts5yymsp[-1].minor.fts5yy11 = fts5yylhsminor.fts5yy11; break; - case 15: /* colsetlist ::= STRING */ -{ - fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0); -} - fts5yymsp[0].minor.fts5yy11 = fts5yylhsminor.fts5yy11; - break; case 16: /* nearset ::= phrase */ { fts5yylhsminor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy53); } fts5yymsp[0].minor.fts5yy46 = fts5yylhsminor.fts5yy46; @@ -183093,8 +183088,8 @@ static void fts5yy_reduce( fts5yymsp[-4].minor.fts5yy46 = fts5yylhsminor.fts5yy46; break; case 18: /* nearphrases ::= phrase */ -{ - fts5yylhsminor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy53); +{ + fts5yylhsminor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy53); } fts5yymsp[0].minor.fts5yy46 = fts5yylhsminor.fts5yy46; break; @@ -183111,13 +183106,13 @@ static void fts5yy_reduce( { fts5yymsp[-1].minor.fts5yy0 = fts5yymsp[0].minor.fts5yy0; } break; case 22: /* phrase ::= phrase PLUS STRING star_opt */ -{ +{ fts5yylhsminor.fts5yy53 = sqlite3Fts5ParseTerm(pParse, fts5yymsp[-3].minor.fts5yy53, &fts5yymsp[-1].minor.fts5yy0, fts5yymsp[0].minor.fts5yy4); } fts5yymsp[-3].minor.fts5yy53 = fts5yylhsminor.fts5yy53; break; case 23: /* phrase ::= STRING star_opt */ -{ +{ fts5yylhsminor.fts5yy53 = sqlite3Fts5ParseTerm(pParse, 0, &fts5yymsp[-1].minor.fts5yy0, fts5yymsp[0].minor.fts5yy4); } fts5yymsp[-1].minor.fts5yy53 = fts5yylhsminor.fts5yy53; @@ -183289,7 +183284,7 @@ static void sqlite3Fts5Parser( #ifdef fts5YYERRORSYMBOL /* A syntax error has occurred. ** The response to an error depends upon whether or not the - ** grammar defines an error token "ERROR". + ** grammar defines an error token "ERROR". ** ** This is what we do if the grammar does define ERROR: ** @@ -183352,7 +183347,7 @@ static void sqlite3Fts5Parser( fts5yy_syntax_error(fts5yypParser,fts5yymajor, fts5yyminor); fts5yy_destructor(fts5yypParser,(fts5YYCODETYPE)fts5yymajor,&fts5yyminorunion); fts5yymajor = fts5YYNOCODE; - + #else /* fts5YYERRORSYMBOL is not defined */ /* This is what we do if the grammar does not define ERROR: ** @@ -183411,7 +183406,7 @@ static void sqlite3Fts5Parser( #include /* amalgamator: keep */ /* -** Object used to iterate through all "coalesced phrase instances" in +** Object used to iterate through all "coalesced phrase instances" in ** a single column of the current row. If the phrase instances in the ** column being considered do not overlap, this object simply iterates ** through them. Or, if they do overlap (share one or more tokens in @@ -183474,7 +183469,7 @@ static int fts5CInstIterNext(CInstIter *pIter){ } /* -** Initialize the iterator object indicated by the final parameter to +** Initialize the iterator object indicated by the final parameter to ** iterate through coalesced phrase instances in column iCol. */ static int fts5CInstIterInit( @@ -183519,16 +183514,16 @@ struct HighlightContext { /* ** Append text to the HighlightContext output string - p->zOut. Argument -** z points to a buffer containing n bytes of text to append. If n is +** z points to a buffer containing n bytes of text to append. If n is ** negative, everything up until the first '\0' is appended to the output. ** -** If *pRc is set to any value other than SQLITE_OK when this function is -** called, it is a no-op. If an error (i.e. an OOM condition) is encountered, -** *pRc is set to an error code before returning. +** If *pRc is set to any value other than SQLITE_OK when this function is +** called, it is a no-op. If an error (i.e. an OOM condition) is encountered, +** *pRc is set to an error code before returning. */ static void fts5HighlightAppend( - int *pRc, - HighlightContext *p, + int *pRc, + HighlightContext *p, const char *z, int n ){ if( *pRc==SQLITE_OK ){ @@ -183813,7 +183808,7 @@ static void fts5SnippetFunction( sFinder.nFirst = 0; rc = pApi->xColumnText(pFts, i, &sFinder.zDoc, &nDoc); if( rc!=SQLITE_OK ) break; - rc = pApi->xTokenize(pFts, + rc = pApi->xTokenize(pFts, sFinder.zDoc, nDoc, (void*)&sFinder,fts5SentenceFinderCb ); if( rc!=SQLITE_OK ) break; @@ -183846,7 +183841,7 @@ static void fts5SnippetFunction( if( sFinder.aFirst[jj]nPhrase; i++){ score += pData->aIDF[i] * ( - ( aFreq[i] * (k1 + 1.0) ) / + ( aFreq[i] * (k1 + 1.0) ) / ( aFreq[i] + k1 * (1 - b + b * D / pData->avgdl) ) ); } - + /* If no error has occurred, return the calculated score. Otherwise, ** throw an SQL exception. */ if( rc==SQLITE_OK ){ @@ -184156,14 +184151,14 @@ static int sqlite3Fts5Get32(const u8 *aBuf){ } /* -** Append buffer nData/pData to buffer pBuf. If an OOM error occurs, set +** Append buffer nData/pData to buffer pBuf. If an OOM error occurs, set ** the error code in p. If an error has already occurred when this function ** is called, it is a no-op. */ static void sqlite3Fts5BufferAppendBlob( int *pRc, - Fts5Buffer *pBuf, - u32 nData, + Fts5Buffer *pBuf, + u32 nData, const u8 *pData ){ assert_nc( *pRc || nData>=0 ); @@ -184174,12 +184169,12 @@ static void sqlite3Fts5BufferAppendBlob( /* ** Append the nul-terminated string zStr to the buffer pBuf. This function -** ensures that the byte following the buffer data is set to 0x00, even +** ensures that the byte following the buffer data is set to 0x00, even ** though this byte is not included in the pBuf->n count. */ static void sqlite3Fts5BufferAppendString( int *pRc, - Fts5Buffer *pBuf, + Fts5Buffer *pBuf, const char *zStr ){ int nStr = (int)strlen(zStr); @@ -184191,13 +184186,13 @@ static void sqlite3Fts5BufferAppendString( ** Argument zFmt is a printf() style format string. This function performs ** the printf() style processing, then appends the results to buffer pBuf. ** -** Like sqlite3Fts5BufferAppendString(), this function ensures that the byte +** Like sqlite3Fts5BufferAppendString(), this function ensures that the byte ** following the buffer data is set to 0x00, even though this byte is not ** included in the pBuf->n count. -*/ +*/ static void sqlite3Fts5BufferAppendPrintf( int *pRc, - Fts5Buffer *pBuf, + Fts5Buffer *pBuf, char *zFmt, ... ){ if( *pRc==SQLITE_OK ){ @@ -184224,12 +184219,12 @@ static char *sqlite3Fts5Mprintf(int *pRc, const char *zFmt, ...){ zRet = sqlite3_vmprintf(zFmt, ap); va_end(ap); if( zRet==0 ){ - *pRc = SQLITE_NOMEM; + *pRc = SQLITE_NOMEM; } } return zRet; } - + /* ** Free any buffer allocated by pBuf. Zero the structure before returning. @@ -184240,7 +184235,7 @@ static void sqlite3Fts5BufferFree(Fts5Buffer *pBuf){ } /* -** Zero the contents of the buffer object. But do not free the associated +** Zero the contents of the buffer object. But do not free the associated ** memory allocation. */ static void sqlite3Fts5BufferZero(Fts5Buffer *pBuf){ @@ -184254,8 +184249,8 @@ static void sqlite3Fts5BufferZero(Fts5Buffer *pBuf){ */ static void sqlite3Fts5BufferSet( int *pRc, - Fts5Buffer *pBuf, - int nData, + Fts5Buffer *pBuf, + int nData, const u8 *pData ){ pBuf->n = 0; @@ -184271,7 +184266,7 @@ static int sqlite3Fts5PoslistNext64( if( i>=n ){ /* EOF */ *piOff = -1; - return 1; + return 1; }else{ i64 iOff = *piOff; int iVal; @@ -184317,8 +184312,8 @@ static int sqlite3Fts5PoslistReaderInit( ** to iPos before returning. */ static void sqlite3Fts5PoslistSafeAppend( - Fts5Buffer *pBuf, - i64 *piPrev, + Fts5Buffer *pBuf, + i64 *piPrev, i64 iPos ){ static const i64 colmask = ((i64)(0x7FFFFFFF)) << 32; @@ -184332,7 +184327,7 @@ static void sqlite3Fts5PoslistSafeAppend( } static int sqlite3Fts5PoslistWriterAppend( - Fts5Buffer *pBuf, + Fts5Buffer *pBuf, Fts5PoslistWriter *pWriter, i64 iPos ){ @@ -184361,7 +184356,7 @@ static void *sqlite3Fts5MallocZero(int *pRc, int nByte){ ** the length of the string is determined using strlen(). ** ** It is the responsibility of the caller to eventually free the returned -** buffer using sqlite3_free(). If an OOM error occurs, NULL is returned. +** buffer using sqlite3_free(). If an OOM error occurs, NULL is returned. */ static char *sqlite3Fts5Strndup(int *pRc, const char *pIn, int nIn){ char *zRet = 0; @@ -184428,9 +184423,9 @@ static int sqlite3Fts5TermsetNew(Fts5Termset **pp){ } static int sqlite3Fts5TermsetAdd( - Fts5Termset *p, + Fts5Termset *p, int iIdx, - const char *pTerm, int nTerm, + const char *pTerm, int nTerm, int *pbPresent ){ int rc = SQLITE_OK; @@ -184451,9 +184446,9 @@ static int sqlite3Fts5TermsetAdd( hash = hash % ArraySize(p->apHash); for(pEntry=p->apHash[hash]; pEntry; pEntry=pEntry->pNext){ - if( pEntry->iIdx==iIdx - && pEntry->nTerm==nTerm - && memcmp(pEntry->pTerm, pTerm, nTerm)==0 + if( pEntry->iIdx==iIdx + && pEntry->nTerm==nTerm + && memcmp(pEntry->pTerm, pTerm, nTerm)==0 ){ *pbPresent = 1; break; @@ -184527,8 +184522,8 @@ static int fts5_isopenquote(char x){ } /* -** Argument pIn points to a character that is part of a nul-terminated -** string. Return a pointer to the first character following *pIn in +** Argument pIn points to a character that is part of a nul-terminated +** string. Return a pointer to the first character following *pIn in ** the string that is not a white-space character. */ static const char *fts5ConfigSkipWhitespace(const char *pIn){ @@ -184540,8 +184535,8 @@ static const char *fts5ConfigSkipWhitespace(const char *pIn){ } /* -** Argument pIn points to a character that is part of a nul-terminated -** string. Return a pointer to the first character following *pIn in +** Argument pIn points to a character that is part of a nul-terminated +** string. Return a pointer to the first character following *pIn in ** the string that is not a "bareword" character. */ static const char *fts5ConfigSkipBareword(const char *pIn){ @@ -184572,9 +184567,9 @@ static const char *fts5ConfigSkipLiteral(const char *pIn){ p++; if( *p=='\'' ){ p++; - while( (*p>='a' && *p<='f') - || (*p>='A' && *p<='F') - || (*p>='0' && *p<='9') + while( (*p>='a' && *p<='f') + || (*p>='A' && *p<='F') + || (*p>='0' && *p<='9') ){ p++; } @@ -184605,7 +184600,7 @@ static const char *fts5ConfigSkipLiteral(const char *pIn){ if( *p=='+' || *p=='-' ) p++; while( fts5_isdigit(*p) ) p++; - /* At this point, if the literal was an integer, the parse is + /* At this point, if the literal was an integer, the parse is ** finished. Or, if it is a floating point value, it may continue ** with either a decimal point or an 'E' character. */ if( *p=='.' && fts5_isdigit(p[1]) ){ @@ -184629,8 +184624,8 @@ static const char *fts5ConfigSkipLiteral(const char *pIn){ ** nul-terminator byte. ** ** If the close-quote is found, the value returned is the byte offset of -** the character immediately following it. Or, if the close-quote is not -** found, -1 is returned. If -1 is returned, the buffer is left in an +** the character immediately following it. Or, if the close-quote is not +** found, -1 is returned. If -1 is returned, the buffer is left in an ** undefined state. */ static int fts5Dequote(char *z){ @@ -184641,7 +184636,7 @@ static int fts5Dequote(char *z){ /* Set stack variable q to the close-quote character */ assert( q=='[' || q=='\'' || q=='"' || q=='`' ); - if( q=='[' ) q = ']'; + if( q=='[' ) q = ']'; while( ALWAYS(z[iIn]) ){ if( z[iIn]==q ){ @@ -184651,7 +184646,7 @@ static int fts5Dequote(char *z){ break; }else{ /* Character iIn and iIn+1 form an escaped quote character. Skip - ** the input cursor past both and copy a single quote character + ** the input cursor past both and copy a single quote character ** to the output buffer. */ iIn += 2; z[iOut++] = q; @@ -184696,8 +184691,8 @@ struct Fts5Enum { typedef struct Fts5Enum Fts5Enum; static int fts5ConfigSetEnum( - const Fts5Enum *aEnum, - const char *zEnum, + const Fts5Enum *aEnum, + const char *zEnum, int *peVal ){ int nEnum = (int)strlen(zEnum); @@ -184817,7 +184812,7 @@ static int fts5ConfigParseSpecial( *pzErr = sqlite3_mprintf("parse error in tokenize directive"); rc = SQLITE_ERROR; }else{ - rc = sqlite3Fts5GetTokenizer(pGlobal, + rc = sqlite3Fts5GetTokenizer(pGlobal, (const char**)azArg, nArg, &pConfig->pTok, &pConfig->pTokApi, pzErr ); @@ -184884,7 +184879,7 @@ static int fts5ConfigParseSpecial( } /* -** Allocate an instance of the default tokenizer ("simple") at +** Allocate an instance of the default tokenizer ("simple") at ** Fts5Config.pTokenizer. Return SQLITE_OK if successful, or an SQLite error ** code if an error occurs. */ @@ -184951,14 +184946,14 @@ static const char *fts5ConfigGobbleWord( } static int fts5ConfigParseColumn( - Fts5Config *p, - char *zCol, - char *zArg, + Fts5Config *p, + char *zCol, + char *zArg, char **pzErr ){ int rc = SQLITE_OK; - if( 0==sqlite3_stricmp(zCol, FTS5_RANK_NAME) - || 0==sqlite3_stricmp(zCol, FTS5_ROWID_NAME) + if( 0==sqlite3_stricmp(zCol, FTS5_RANK_NAME) + || 0==sqlite3_stricmp(zCol, FTS5_ROWID_NAME) ){ *pzErr = sqlite3_mprintf("reserved fts5 column name: %s", zCol); rc = SQLITE_ERROR; @@ -185001,14 +184996,14 @@ static int fts5ConfigMakeExprlist(Fts5Config *p){ /* ** Arguments nArg/azArg contain the string arguments passed to the xCreate -** or xConnect method of the virtual table. This function attempts to +** or xConnect method of the virtual table. This function attempts to ** allocate an instance of Fts5Config containing the results of parsing ** those arguments. ** ** If successful, SQLITE_OK is returned and *ppOut is set to point to the -** new Fts5Config object. If an error occurs, an SQLite error code is +** new Fts5Config object. If an error occurs, an SQLite error code is ** returned, *ppOut is set to NULL and an error message may be left in -** *pzErr. It is the responsibility of the caller to eventually free any +** *pzErr. It is the responsibility of the caller to eventually free any ** such error message using sqlite3_free(). */ static int sqlite3Fts5ConfigParse( @@ -185095,8 +185090,8 @@ static int sqlite3Fts5ConfigParse( /* If no zContent option was specified, fill in the default values. */ if( rc==SQLITE_OK && pRet->zContent==0 ){ const char *zTail = 0; - assert( pRet->eContent==FTS5_CONTENT_NORMAL - || pRet->eContent==FTS5_CONTENT_NONE + assert( pRet->eContent==FTS5_CONTENT_NORMAL + || pRet->eContent==FTS5_CONTENT_NONE ); if( pRet->eContent==FTS5_CONTENT_NORMAL ){ zTail = "content"; @@ -185167,7 +185162,7 @@ static int sqlite3Fts5ConfigDeclareVtab(Fts5Config *pConfig){ const char *zSep = (i==0?"":", "); zSql = sqlite3Fts5Mprintf(&rc, "%z%s%Q", zSql, zSep, pConfig->azCol[i]); } - zSql = sqlite3Fts5Mprintf(&rc, "%z, %Q HIDDEN, %s HIDDEN)", + zSql = sqlite3Fts5Mprintf(&rc, "%z, %Q HIDDEN, %s HIDDEN)", zSql, pConfig->zName, FTS5_RANK_NAME ); @@ -185176,7 +185171,7 @@ static int sqlite3Fts5ConfigDeclareVtab(Fts5Config *pConfig){ rc = sqlite3_declare_vtab(pConfig->db, zSql); sqlite3_free(zSql); } - + return rc; } @@ -185194,7 +185189,7 @@ static int sqlite3Fts5ConfigDeclareVtab(Fts5Config *pConfig){ ** int iPos // Position of token in input (first token is 0) ** ** If the callback returns a non-zero value the tokenization is abandoned -** and no further callbacks are issued. +** and no further callbacks are issued. ** ** This function returns SQLITE_OK if successful or an SQLite error code ** if an error occurs. If the tokenization was abandoned early because @@ -185224,7 +185219,7 @@ static int sqlite3Fts5Tokenize( */ static const char *fts5ConfigSkipArgs(const char *pIn){ const char *p = pIn; - + while( 1 ){ p = fts5ConfigSkipWhitespace(p); p = fts5ConfigSkipLiteral(p); @@ -185241,7 +185236,7 @@ static const char *fts5ConfigSkipArgs(const char *pIn){ } /* -** Parameter zIn contains a rank() function specification. The format of +** Parameter zIn contains a rank() function specification. The format of ** this is: ** ** + Bareword (function name) @@ -185283,7 +185278,7 @@ static int sqlite3Fts5ConfigParseRank( p++; } if( rc==SQLITE_OK ){ - const char *pArgs; + const char *pArgs; p = fts5ConfigSkipWhitespace(p); pArgs = p; if( *p!=')' ){ @@ -185309,8 +185304,8 @@ static int sqlite3Fts5ConfigParseRank( } static int sqlite3Fts5ConfigSetValue( - Fts5Config *pConfig, - const char *zKey, + Fts5Config *pConfig, + const char *zKey, sqlite3_value *pVal, int *pbBadkey ){ @@ -185435,7 +185430,7 @@ static int sqlite3Fts5ConfigLoad(Fts5Config *pConfig, int iCookie){ } rc = sqlite3_finalize(p); } - + if( rc==SQLITE_OK && iVersion!=FTS5_CURRENT_VERSION ){ rc = SQLITE_ERROR; if( pConfig->pzErrmsg ){ @@ -185523,7 +185518,7 @@ struct Fts5ExprNode { i64 iRowid; /* Current rowid */ Fts5ExprNearset *pNear; /* For FTS5_STRING - cluster of phrases */ - /* Child nodes. For a NOT node, this array always contains 2 entries. For + /* Child nodes. For a NOT node, this array always contains 2 entries. For ** AND or OR nodes, it contains 2 or more entries. */ int nChild; /* Number of child nodes */ Fts5ExprNode *apChild[1]; /* Array of child nodes */ @@ -185601,7 +185596,7 @@ static int fts5ExprIsspace(char t){ ** Read the first token from the nul-terminated string at *pz. */ static int fts5ExprGetToken( - Fts5Parse *pParse, + Fts5Parse *pParse, const char **pz, /* IN/OUT: Pointer into buffer */ Fts5Token *pToken ){ @@ -185669,7 +185664,7 @@ static void fts5ParseFree(void *p){ sqlite3_free(p); } static int sqlite3Fts5ExprNew( Fts5Config *pConfig, /* FTS5 Configuration */ const char *zExpr, /* Expression text */ - Fts5Expr **ppNew, + Fts5Expr **ppNew, char **pzErr ){ Fts5Parse sParse; @@ -185777,7 +185772,7 @@ static i64 fts5ExprSynonymRowid(Fts5ExprTerm *pTerm, int bDesc, int *pbEof){ ** Argument pTerm must be a synonym iterator. */ static int fts5ExprSynonymList( - Fts5ExprTerm *pTerm, + Fts5ExprTerm *pTerm, i64 iRowid, Fts5Buffer *pBuf, /* Use this buffer for space if required */ u8 **pa, int *pn @@ -185850,13 +185845,13 @@ static int fts5ExprSynonymList( /* ** All individual term iterators in pPhrase are guaranteed to be valid and -** pointing to the same rowid when this function is called. This function +** pointing to the same rowid when this function is called. This function ** checks if the current rowid really is a match, and if so populates ** the pPhrase->poslist buffer accordingly. Output parameter *pbMatch ** is set to true if this is really a match, or false otherwise. ** -** SQLITE_OK is returned if an error occurs, or an SQLite error code -** otherwise. It is not considered an error code if the current rowid is +** SQLITE_OK is returned if an error occurs, or an SQLite error code +** otherwise. It is not considered an error code if the current rowid is ** not a match. */ static int fts5ExprPhraseIsMatch( @@ -185869,7 +185864,7 @@ static int fts5ExprPhraseIsMatch( Fts5PoslistReader *aIter = aStatic; int i; int rc = SQLITE_OK; - + fts5BufferZero(&pPhrase->poslist); /* If the aStatic[] array is not large enough, allocate a large array @@ -185989,7 +185984,7 @@ struct Fts5NearTrimmer { ** function is called, it is a no-op. Or, if an error (e.g. SQLITE_NOMEM) ** occurs within this function (*pRc) is set accordingly before returning. ** The return value is undefined in both these cases. -** +** ** If no error occurs and non-zero (a match) is returned, the position-list ** of each phrase object is edited to contain only those entries that ** meet the constraint before returning. @@ -186021,7 +186016,7 @@ static int fts5ExprNearIsMatch(int *pRc, Fts5ExprNearset *pNear){ /* Initialize a lookahead iterator for each phrase. After passing the ** buffer and buffer size to the lookaside-reader init function, zero ** the phrase poslist buffer. The new poslist for the phrase (containing - ** the same entries as the original with some entries removed on account + ** the same entries as the original with some entries removed on account ** of the NEAR constraint) is written over the original even as it is ** being read. This is safe as the entries for the new poslist are a ** subset of the old, so it is not possible for data yet to be read to @@ -186324,7 +186319,7 @@ static void fts5ExprNodeZeroPoslist(Fts5ExprNode *pNode){ */ static int fts5NodeCompare( Fts5Expr *pExpr, - Fts5ExprNode *p1, + Fts5ExprNode *p1, Fts5ExprNode *p2 ){ if( p2->bEof ) return -1; @@ -186339,7 +186334,7 @@ static int fts5NodeCompare( ** If an EOF is reached before this happens, *pbEof is set to true before ** returning. ** -** SQLITE_OK is returned if an error occurs, or an SQLite error code +** SQLITE_OK is returned if an error occurs, or an SQLite error code ** otherwise. It is not considered an error code if an iterator reaches ** EOF. */ @@ -186356,8 +186351,8 @@ static int fts5ExprNodeTest_STRING( const int bDesc = pExpr->bDesc; /* Check that this node should not be FTS5_TERM */ - assert( pNear->nPhrase>1 - || pNear->apPhrase[0]->nTerm>1 + assert( pNear->nPhrase>1 + || pNear->apPhrase[0]->nTerm>1 || pNear->apPhrase[0]->aTerm[0].pSynonym ); @@ -186416,7 +186411,7 @@ static int fts5ExprNodeNext_STRING( Fts5Expr *pExpr, /* Expression pPhrase belongs to */ Fts5ExprNode *pNode, /* FTS5_STRING or FTS5_TERM node */ int bFromValid, - i64 iFrom + i64 iFrom ){ Fts5ExprTerm *pTerm = &pNode->pNear->apPhrase[0]->aTerm[0]; int rc = SQLITE_OK; @@ -186434,8 +186429,8 @@ static int fts5ExprNodeNext_STRING( for(p=pTerm; p; p=p->pSynonym){ if( sqlite3Fts5IterEof(p->pIter)==0 ){ i64 ii = p->pIter->iRowid; - if( ii==iRowid - || (bFromValid && ii!=iFrom && (ii>iFrom)==pExpr->bDesc) + if( ii==iRowid + || (bFromValid && ii!=iFrom && (ii>iFrom)==pExpr->bDesc) ){ if( bFromValid ){ rc = sqlite3Fts5IterNextFrom(p->pIter, iFrom); @@ -186481,9 +186476,9 @@ static int fts5ExprNodeTest_TERM( Fts5Expr *pExpr, /* Expression that pNear is a part of */ Fts5ExprNode *pNode /* The "NEAR" node (FTS5_TERM) */ ){ - /* As this "NEAR" object is actually a single phrase that consists + /* As this "NEAR" object is actually a single phrase that consists ** of a single term only, grab pointers into the poslist managed by the - ** fts5_index.c iterator object. This is much faster than synthesizing + ** fts5_index.c iterator object. This is much faster than synthesizing ** a new poslist the way we have to for more complicated phrase or NEAR ** expressions. */ Fts5ExprPhrase *pPhrase = pNode->pNear->apPhrase[0]; @@ -186506,7 +186501,7 @@ static int fts5ExprNodeTest_TERM( ** xNext() method for a node of type FTS5_TERM. */ static int fts5ExprNodeNext_TERM( - Fts5Expr *pExpr, + Fts5Expr *pExpr, Fts5ExprNode *pNode, int bFromValid, i64 iFrom @@ -186549,7 +186544,7 @@ static void fts5ExprNodeTest_OR( } static int fts5ExprNodeNext_OR( - Fts5Expr *pExpr, + Fts5Expr *pExpr, Fts5ExprNode *pNode, int bFromValid, i64 iFrom @@ -186561,7 +186556,7 @@ static int fts5ExprNodeNext_OR( Fts5ExprNode *p1 = pNode->apChild[i]; assert( p1->bEof || fts5RowidCmp(pExpr, p1->iRowid, iLast)>=0 ); if( p1->bEof==0 ){ - if( (p1->iRowid==iLast) + if( (p1->iRowid==iLast) || (bFromValid && fts5RowidCmp(pExpr, p1->iRowid, iFrom)<0) ){ int rc = fts5ExprNodeNext(pExpr, p1, bFromValid, iFrom); @@ -186627,7 +186622,7 @@ static int fts5ExprNodeTest_AND( } static int fts5ExprNodeNext_AND( - Fts5Expr *pExpr, + Fts5Expr *pExpr, Fts5ExprNode *pNode, int bFromValid, i64 iFrom @@ -186668,7 +186663,7 @@ static int fts5ExprNodeTest_NOT( } static int fts5ExprNodeNext_NOT( - Fts5Expr *pExpr, + Fts5Expr *pExpr, Fts5ExprNode *pNode, int bFromValid, i64 iFrom @@ -186722,7 +186717,7 @@ static int fts5ExprNodeTest( return rc; } - + /* ** Set node pNode, which is part of expression pExpr, to point to the first ** match. If there are no matches, set the Node.bEof flag to indicate EOF. @@ -186776,8 +186771,8 @@ static int fts5ExprNodeFirst(Fts5Expr *pExpr, Fts5ExprNode *pNode){ /* ** Begin iterating through the set of documents in index pIdx matched by -** the MATCH expression passed as the first argument. If the "bDesc" -** parameter is passed a non-zero value, iteration is in descending rowid +** the MATCH expression passed as the first argument. If the "bDesc" +** parameter is passed a non-zero value, iteration is in descending rowid ** order. Or, if it is zero, in ascending order. ** ** If iterating in ascending rowid order (bDesc==0), the first document @@ -186799,9 +186794,9 @@ static int sqlite3Fts5ExprFirst(Fts5Expr *p, Fts5Index *pIdx, i64 iFirst, int bD /* If not at EOF but the current rowid occurs earlier than iFirst in ** the iteration order, move to document iFirst or later. */ - if( rc==SQLITE_OK - && 0==pRoot->bEof - && fts5RowidCmp(p, pRoot->iRowid, iFirst)<0 + if( rc==SQLITE_OK + && 0==pRoot->bEof + && fts5RowidCmp(p, pRoot->iRowid, iFirst)<0 ){ rc = fts5ExprNodeNext(p, pRoot, 1, iFirst); } @@ -186815,7 +186810,7 @@ static int sqlite3Fts5ExprFirst(Fts5Expr *p, Fts5Index *pIdx, i64 iFirst, int bD } /* -** Move to the next document +** Move to the next document ** ** Return SQLITE_OK if successful, or an SQLite error code otherwise. It ** is not considered an error if the query does not match any documents. @@ -186985,7 +186980,7 @@ static int fts5ParseTokenize( Fts5ExprPhrase *pNew; int nNew = SZALLOC + (pPhrase ? pPhrase->nTerm : 0); - pNew = (Fts5ExprPhrase*)sqlite3_realloc(pPhrase, + pNew = (Fts5ExprPhrase*)sqlite3_realloc(pPhrase, sizeof(Fts5ExprPhrase) + sizeof(Fts5ExprTerm) * nNew ); if( pNew==0 ){ @@ -187102,8 +187097,8 @@ static Fts5ExprPhrase *sqlite3Fts5ParseTerm( ** expression passed as the second argument. */ static int sqlite3Fts5ExprClonePhrase( - Fts5Expr *pExpr, - int iPhrase, + Fts5Expr *pExpr, + int iPhrase, Fts5Expr **ppNew ){ int rc = SQLITE_OK; /* Return code */ @@ -187114,15 +187109,15 @@ static int sqlite3Fts5ExprClonePhrase( pOrig = pExpr->apExprPhrase[iPhrase]; pNew = (Fts5Expr*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5Expr)); if( rc==SQLITE_OK ){ - pNew->apExprPhrase = (Fts5ExprPhrase**)sqlite3Fts5MallocZero(&rc, + pNew->apExprPhrase = (Fts5ExprPhrase**)sqlite3Fts5MallocZero(&rc, sizeof(Fts5ExprPhrase*)); } if( rc==SQLITE_OK ){ - pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&rc, + pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5ExprNode)); } if( rc==SQLITE_OK ){ - pNew->pRoot->pNear = (Fts5ExprNearset*)sqlite3Fts5MallocZero(&rc, + pNew->pRoot->pNear = (Fts5ExprNearset*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5ExprNearset) + sizeof(Fts5ExprPhrase*)); } if( rc==SQLITE_OK ){ @@ -187130,7 +187125,7 @@ static int sqlite3Fts5ExprClonePhrase( if( pColsetOrig ){ int nByte = sizeof(Fts5Colset) + (pColsetOrig->nCol-1) * sizeof(int); Fts5Colset *pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&rc, nByte); - if( pColset ){ + if( pColset ){ memcpy(pColset, pColsetOrig, nByte); } pNew->pRoot->pNear->pColset = pColset; @@ -187200,7 +187195,7 @@ static void sqlite3Fts5ParseNear(Fts5Parse *pParse, Fts5Token *pTok){ } static void sqlite3Fts5ParseSetDistance( - Fts5Parse *pParse, + Fts5Parse *pParse, Fts5ExprNearset *pNear, Fts5Token *p ){ @@ -187229,7 +187224,7 @@ static void sqlite3Fts5ParseSetDistance( ** The second argument passed to this function may be NULL, or it may be ** an existing Fts5Colset object. This function returns a pointer to ** a new colset object containing the contents of (p) with new value column -** number iCol appended. +** number iCol appended. ** ** If an OOM error occurs, store an error code in pParse and return NULL. ** The old colset object (if any) is not freed in this case. @@ -187279,7 +187274,7 @@ static Fts5Colset *sqlite3Fts5ParseColsetInvert(Fts5Parse *pParse, Fts5Colset *p Fts5Colset *pRet; int nCol = pParse->pConfig->nCol; - pRet = (Fts5Colset*)sqlite3Fts5MallocZero(&pParse->rc, + pRet = (Fts5Colset*)sqlite3Fts5MallocZero(&pParse->rc, sizeof(Fts5Colset) + sizeof(int)*nCol ); if( pRet ){ @@ -187331,9 +187326,9 @@ static Fts5Colset *sqlite3Fts5ParseColset( } static void sqlite3Fts5ParseSetColset( - Fts5Parse *pParse, - Fts5ExprNearset *pNear, - Fts5Colset *pColset + Fts5Parse *pParse, + Fts5ExprNearset *pNear, + Fts5Colset *pColset ){ if( pParse->pConfig->eDetail==FTS5_DETAIL_NONE ){ pParse->rc = SQLITE_ERROR; @@ -187355,7 +187350,7 @@ static void fts5ExprAssignXNext(Fts5ExprNode *pNode){ switch( pNode->eType ){ case FTS5_STRING: { Fts5ExprNearset *pNear = pNode->pNear; - if( pNear->nPhrase==1 && pNear->apPhrase[0]->nTerm==1 + if( pNear->nPhrase==1 && pNear->apPhrase[0]->nTerm==1 && pNear->apPhrase[0]->aTerm[0].pSynonym==0 ){ pNode->eType = FTS5_TERM; @@ -187410,7 +187405,7 @@ static Fts5ExprNode *sqlite3Fts5ParseNode( if( pParse->rc==SQLITE_OK ){ int nChild = 0; /* Number of children of returned node */ int nByte; /* Bytes of space to allocate for this node */ - + assert( (eType!=FTS5_STRING && !pNear) || (eType==FTS5_STRING && !pLeft && !pRight) ); @@ -187443,14 +187438,14 @@ static Fts5ExprNode *sqlite3Fts5ParseNode( } } - if( pParse->pConfig->eDetail!=FTS5_DETAIL_FULL + if( pParse->pConfig->eDetail!=FTS5_DETAIL_FULL && (pNear->nPhrase!=1 || pNear->apPhrase[0]->nTerm>1) ){ assert( pParse->rc==SQLITE_OK ); pParse->rc = SQLITE_ERROR; assert( pParse->zErr==0 ); pParse->zErr = sqlite3_mprintf( - "fts5: %s queries are not supported (detail!=full)", + "fts5: %s queries are not supported (detail!=full)", pNear->nPhrase==1 ? "phrase": "NEAR" ); sqlite3_free(pRet); @@ -187486,14 +187481,14 @@ static Fts5ExprNode *sqlite3Fts5ParseImplicitAnd( sqlite3Fts5ParseNodeFree(pRight); }else{ - assert( pLeft->eType==FTS5_STRING + assert( pLeft->eType==FTS5_STRING || pLeft->eType==FTS5_TERM || pLeft->eType==FTS5_EOF || pLeft->eType==FTS5_AND ); - assert( pRight->eType==FTS5_STRING - || pRight->eType==FTS5_TERM - || pRight->eType==FTS5_EOF + assert( pRight->eType==FTS5_STRING + || pRight->eType==FTS5_TERM + || pRight->eType==FTS5_EOF ); if( pLeft->eType==FTS5_AND ){ @@ -187501,9 +187496,9 @@ static Fts5ExprNode *sqlite3Fts5ParseImplicitAnd( }else{ pPrev = pLeft; } - assert( pPrev->eType==FTS5_STRING - || pPrev->eType==FTS5_TERM - || pPrev->eType==FTS5_EOF + assert( pPrev->eType==FTS5_STRING + || pPrev->eType==FTS5_TERM + || pPrev->eType==FTS5_EOF ); if( pRight->eType==FTS5_EOF ){ @@ -187585,20 +187580,20 @@ static char *fts5PrintfAppend(char *zApp, const char *zFmt, ...){ } /* -** Compose a tcl-readable representation of expression pExpr. Return a -** pointer to a buffer containing that representation. It is the -** responsibility of the caller to at some point free the buffer using +** Compose a tcl-readable representation of expression pExpr. Return a +** pointer to a buffer containing that representation. It is the +** responsibility of the caller to at some point free the buffer using ** sqlite3_free(). */ static char *fts5ExprPrintTcl( - Fts5Config *pConfig, + Fts5Config *pConfig, const char *zNearsetCmd, Fts5ExprNode *pExpr ){ char *zRet = 0; if( pExpr->eType==FTS5_STRING || pExpr->eType==FTS5_TERM ){ Fts5ExprNearset *pNear = pExpr->pNear; - int i; + int i; int iTerm; zRet = fts5PrintfAppend(zRet, "%s ", zNearsetCmd); @@ -187648,9 +187643,9 @@ static char *fts5ExprPrintTcl( switch( pExpr->eType ){ case FTS5_AND: zOp = "AND"; break; case FTS5_NOT: zOp = "NOT"; break; - default: + default: assert( pExpr->eType==FTS5_OR ); - zOp = "OR"; + zOp = "OR"; break; } @@ -187676,7 +187671,7 @@ static char *fts5ExprPrint(Fts5Config *pConfig, Fts5ExprNode *pExpr){ }else if( pExpr->eType==FTS5_STRING || pExpr->eType==FTS5_TERM ){ Fts5ExprNearset *pNear = pExpr->pNear; - int i; + int i; int iTerm; if( pNear->pColset ){ @@ -187721,9 +187716,9 @@ static char *fts5ExprPrint(Fts5Config *pConfig, Fts5ExprNode *pExpr){ switch( pExpr->eType ){ case FTS5_AND: zOp = " AND "; break; case FTS5_NOT: zOp = " NOT "; break; - default: + default: assert( pExpr->eType==FTS5_OR ); - zOp = " OR "; + zOp = " OR "; break; } @@ -187735,7 +187730,7 @@ static char *fts5ExprPrint(Fts5Config *pConfig, Fts5ExprNode *pExpr){ }else{ int e = pExpr->apChild[i]->eType; int b = (e!=FTS5_STRING && e!=FTS5_TERM && e!=FTS5_EOF); - zRet = fts5PrintfAppend(zRet, "%s%s%z%s", + zRet = fts5PrintfAppend(zRet, "%s%s%z%s", (i==0 ? "" : zOp), (b?"(":""), z, (b?")":"") ); @@ -187851,7 +187846,7 @@ static void fts5ExprFunctionTcl( /* ** The implementation of an SQLite user-defined-function that accepts a -** single integer as an argument. If the integer is an alpha-numeric +** single integer as an argument. If the integer is an alpha-numeric ** unicode code point, 1 is returned. Otherwise 0. */ static void fts5ExprIsAlnum( @@ -187861,7 +187856,7 @@ static void fts5ExprIsAlnum( ){ int iCode; if( nArg!=1 ){ - sqlite3_result_error(pCtx, + sqlite3_result_error(pCtx, "wrong number of arguments to function fts5_isalnum", -1 ); return; @@ -187876,7 +187871,7 @@ static void fts5ExprFold( sqlite3_value **apVal /* Function arguments */ ){ if( nArg!=1 && nArg!=2 ){ - sqlite3_result_error(pCtx, + sqlite3_result_error(pCtx, "wrong number of arguments to function fts5_fold", -1 ); }else{ @@ -187968,7 +187963,7 @@ static Fts5PoslistPopulator *sqlite3Fts5ExprClearPoslists(Fts5Expr *pExpr, int b Fts5Buffer *pBuf = &pExpr->apExprPhrase[i]->poslist; Fts5ExprNode *pNode = pExpr->apExprPhrase[i]->pNode; assert( pExpr->apExprPhrase[i]->nTerm==1 ); - if( bLive && + if( bLive && (pBuf->n==0 || pNode->iRowid!=pExpr->pRoot->iRowid || pNode->bEof) ){ pRet[i].bMiss = 1; @@ -188035,9 +188030,9 @@ static int fts5ExprPopulatePoslistsCb( static int sqlite3Fts5ExprPopulatePoslists( Fts5Config *pConfig, - Fts5Expr *pExpr, + Fts5Expr *pExpr, Fts5PoslistPopulator *aPopulator, - int iCol, + int iCol, const char *z, int n ){ int i; @@ -188049,7 +188044,7 @@ static int sqlite3Fts5ExprPopulatePoslists( for(i=0; inPhrase; i++){ Fts5ExprNode *pNode = pExpr->apExprPhrase[i]->pNode; Fts5Colset *pColset = pNode->pNear->pColset; - if( (pColset && 0==fts5ExprColsetTest(pColset, iCol)) + if( (pColset && 0==fts5ExprColsetTest(pColset, iCol)) || aPopulator[i].bMiss ){ aPopulator[i].bOk = 0; @@ -188058,7 +188053,7 @@ static int sqlite3Fts5ExprPopulatePoslists( } } - return sqlite3Fts5Tokenize(pConfig, + return sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, z, n, (void*)&sCtx, fts5ExprPopulatePoslistsCb ); } @@ -188123,12 +188118,12 @@ static void sqlite3Fts5ExprCheckPoslists(Fts5Expr *pExpr, i64 iRowid){ } /* -** This function is only called for detail=columns tables. +** This function is only called for detail=columns tables. */ static int sqlite3Fts5ExprPhraseCollist( - Fts5Expr *pExpr, - int iPhrase, - const u8 **ppCollist, + Fts5Expr *pExpr, + int iPhrase, + const u8 **ppCollist, int *pnCollist ){ Fts5ExprPhrase *pPhrase = pExpr->apExprPhrase[iPhrase]; @@ -188138,8 +188133,8 @@ static int sqlite3Fts5ExprPhraseCollist( assert( iPhrase>=0 && iPhrasenPhrase ); assert( pExpr->pConfig->eDetail==FTS5_DETAIL_COLUMNS ); - if( pNode->bEof==0 - && pNode->iRowid==pExpr->pRoot->iRowid + if( pNode->bEof==0 + && pNode->iRowid==pExpr->pRoot->iRowid && pPhrase->poslist.n>0 ){ Fts5ExprTerm *pTerm = &pPhrase->aTerm[0]; @@ -188198,9 +188193,9 @@ struct Fts5Hash { }; /* -** Each entry in the hash table is represented by an object of the +** Each entry in the hash table is represented by an object of the ** following type. Each object, its key (zKey[]) and its current data -** are stored in a single memory allocation. The position list data +** are stored in a single memory allocation. The position list data ** immediately follows the key data in memory. ** ** The data that follows the key is in a similar, but not identical format @@ -188221,7 +188216,7 @@ struct Fts5Hash { struct Fts5HashEntry { Fts5HashEntry *pHashNext; /* Next hash entry with same hash-key */ Fts5HashEntry *pScanNext; /* Next entry in sorted order */ - + int nAlloc; /* Total size of allocation */ int iSzPoslist; /* Offset of space for 4-byte poslist size */ int nData; /* Total bytes of data (incl. structure) */ @@ -188401,15 +188396,15 @@ static int sqlite3Fts5HashWrite( u8 *pPtr; int nIncr = 0; /* Amount to increment (*pHash->pnByte) by */ int bNew; /* If non-delete entry should be written */ - + bNew = (pHash->eDetail==FTS5_DETAIL_FULL); /* Attempt to locate an existing hash entry */ iHash = fts5HashKey2(pHash->nSlot, (u8)bByte, (const u8*)pToken, nToken); for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ - if( p->zKey[0]==bByte + if( p->zKey[0]==bByte && p->nKey==nToken - && memcmp(&p->zKey[1], pToken, nToken)==0 + && memcmp(&p->zKey[1], pToken, nToken)==0 ){ break; } @@ -188456,8 +188451,8 @@ static int sqlite3Fts5HashWrite( nIncr += p->nData; }else{ - /* Appending to an existing hash-entry. Check that there is enough - ** space to append the largest possible new entry. Worst case scenario + /* Appending to an existing hash-entry. Check that there is enough + ** space to append the largest possible new entry. Worst case scenario ** is: ** ** + 9 bytes for a new rowid, @@ -188583,7 +188578,7 @@ static Fts5HashEntry *fts5HashEntryMerge( ** list. */ static int fts5HashEntrySort( - Fts5Hash *pHash, + Fts5Hash *pHash, const char *pTerm, int nTerm, /* Query prefix, if any */ Fts5HashEntry **ppSorted ){ @@ -188701,7 +188696,7 @@ static void sqlite3Fts5HashScanEntry( ** ****************************************************************************** ** -** Low level access to the FTS index stored in the database file. The +** Low level access to the FTS index stored in the database file. The ** routines in this file file implement all read and write access to the ** %_data table. Other parts of the system access this functionality via ** the interface defined in fts5Int.h. @@ -188717,10 +188712,10 @@ static void sqlite3Fts5HashScanEntry( ** As well as the main term index, there may be up to 31 prefix indexes. ** The format is similar to FTS3/4, except that: ** -** * all segment b-tree leaf data is stored in fixed size page records -** (e.g. 1000 bytes). A single doclist may span multiple pages. Care is -** taken to ensure it is possible to iterate in either direction through -** the entries in a doclist, or to seek to a specific entry within a +** * all segment b-tree leaf data is stored in fixed size page records +** (e.g. 1000 bytes). A single doclist may span multiple pages. Care is +** taken to ensure it is possible to iterate in either direction through +** the entries in a doclist, or to seek to a specific entry within a ** doclist, without loading it into memory. ** ** * large doclists that span many pages have associated "doclist index" @@ -188753,14 +188748,14 @@ static void sqlite3Fts5HashScanEntry( ** CREATE TABLE %_data(id INTEGER PRIMARY KEY, block BLOB); ** ** , contains the following 5 types of records. See the comments surrounding -** the FTS5_*_ROWID macros below for a description of how %_data rowids are +** the FTS5_*_ROWID macros below for a description of how %_data rowids are ** assigned to each fo them. ** ** 1. Structure Records: ** ** The set of segments that make up an index - the index structure - are ** recorded in a single record within the %_data table. The record consists -** of a single 32-bit configuration cookie value followed by a list of +** of a single 32-bit configuration cookie value followed by a list of ** SQLite varints. If the FTS table features more than one index (because ** there are one or more prefix indexes), it is guaranteed that all share ** the same cookie value. @@ -188792,7 +188787,7 @@ static void sqlite3Fts5HashScanEntry( ** ** TERM/DOCLIST FORMAT: ** -** Most of each segment leaf is taken up by term/doclist data. The +** Most of each segment leaf is taken up by term/doclist data. The ** general format of term/doclist, starting with the first term ** on the leaf page, is: ** @@ -188835,7 +188830,7 @@ static void sqlite3Fts5HashScanEntry( ** ** PAGE FORMAT ** -** Each leaf page begins with a 4-byte header containing 2 16-bit +** Each leaf page begins with a 4-byte header containing 2 16-bit ** unsigned integer fields in big-endian format. They are: ** ** * The byte offset of the first rowid on the page, if it exists @@ -188870,7 +188865,7 @@ static void sqlite3Fts5HashScanEntry( ** 5. Segment doclist indexes: ** ** Doclist indexes are themselves b-trees, however they usually consist of -** a single leaf record only. The format of each doclist index leaf page +** a single leaf record only. The format of each doclist index leaf page ** is: ** ** * Flags byte. Bits are: @@ -188880,8 +188875,8 @@ static void sqlite3Fts5HashScanEntry( ** ** * First rowid on page indicated by previous field. As a varint. ** -** * A list of varints, one for each subsequent termless page. A -** positive delta if the termless page contains at least one rowid, +** * A list of varints, one for each subsequent termless page. A +** positive delta if the termless page contains at least one rowid, ** or an 0x00 byte otherwise. ** ** Internal doclist index nodes are: @@ -188894,7 +188889,7 @@ static void sqlite3Fts5HashScanEntry( ** * Copy of first rowid on page indicated by previous field. As a varint. ** ** * A list of delta-encoded varints - the first rowid on each subsequent -** child page. +** child page. ** */ @@ -188911,7 +188906,7 @@ static void sqlite3Fts5HashScanEntry( ** ** Each segment has a unique non-zero 16-bit id. ** -** The rowid for each segment leaf is found by passing the segment id and +** The rowid for each segment leaf is found by passing the segment id and ** the leaf page number to the FTS5_SEGMENT_ROWID macro. Leaves are numbered ** sequentially starting from 1. */ @@ -188931,7 +188926,7 @@ static void sqlite3Fts5HashScanEntry( #define FTS5_DLIDX_ROWID(segid, height, pgno) fts5_dri(segid, 1, height, pgno) /* -** Maximum segments permitted in a single index +** Maximum segments permitted in a single index */ #define FTS5_MAX_SEGMENT 2000 @@ -189013,7 +189008,7 @@ struct Fts5DoclistIter { /* ** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the +** using an Fts5Structure record in memory. Which uses instances of the ** other Fts5StructureXXX types as components. */ struct Fts5StructureSegment { @@ -189086,10 +189081,10 @@ struct Fts5CResult { ** Current leaf page number within segment. ** ** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the +** Byte offset within the current leaf that is the first byte of the ** position list data (one byte passed the position-list size field). ** rowid field of the current entry. Usually this is the size field of the -** position list data. The exception is if the rowid for the current entry +** position list data. The exception is if the rowid for the current entry ** is the last thing on the leaf page. ** ** pLeaf: @@ -189103,7 +189098,7 @@ struct Fts5CResult { ** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: ** ** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist +** If set, set the iterator to point to EOF after the current doclist ** has been exhausted. Do not proceed to the next term in the segment. ** ** FTS5_SEGITER_REVERSE: @@ -189132,7 +189127,7 @@ struct Fts5SegIter { /* Next method */ void (*xNext)(Fts5Index*, Fts5SegIter*, int*); - /* The page and offset from which the current term was read. The offset + /* The page and offset from which the current term was read. The offset ** is the offset of the first rowid in the current doclist. */ int iTermLeafPgno; int iTermLeafOffset; @@ -189155,7 +189150,7 @@ struct Fts5SegIter { }; /* -** Argument is a pointer to an Fts5Data structure that contains a +** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. */ #define ASSERT_SZLEAF_OK(x) assert( \ @@ -189165,7 +189160,7 @@ struct Fts5SegIter { #define FTS5_SEGITER_ONETERM 0x01 #define FTS5_SEGITER_REVERSE 0x02 -/* +/* ** Argument is a pointer to an Fts5Data structure that contains a leaf ** page. This macro evaluates to true if the leaf contains no terms, or ** false if it contains at least one term. @@ -189187,13 +189182,13 @@ struct Fts5SegIter { ** on empty segments. ** ** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the +** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the ** comparison in this context is the index of the iterator that currently ** points to the smaller term/rowid combination. Iterators at EOF are ** considered to be greater than all other iterators. ** ** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. +** the smallest key overall. aFirst[0] is unused. ** ** poslist: ** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. @@ -189256,7 +189251,7 @@ static void fts5PutU16(u8 *aOut, u16 iVal){ static u16 fts5GetU16(const u8 *aIn){ return ((u16)aIn[0] << 8) + aIn[1]; -} +} /* ** Allocate and return a buffer at least nByte bytes in size. @@ -189323,7 +189318,7 @@ static void fts5CloseReader(Fts5Index *p){ /* ** Retrieve a record from the %_data table. ** -** If an error occurs, NULL is returned and an error left in the +** If an error occurs, NULL is returned and an error left in the ** Fts5Index object. */ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){ @@ -189346,11 +189341,11 @@ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){ if( rc==SQLITE_ABORT ) rc = SQLITE_OK; } - /* If the blob handle is not open at this point, open it and seek + /* If the blob handle is not open at this point, open it and seek ** to the requested entry. */ if( p->pReader==0 && rc==SQLITE_OK ){ Fts5Config *pConfig = p->pConfig; - rc = sqlite3_blob_open(pConfig->db, + rc = sqlite3_blob_open(pConfig->db, pConfig->zDb, p->zDataTbl, "block", iRowid, 0, &p->pReader ); } @@ -189358,7 +189353,7 @@ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){ /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. ** All the reasons those functions might return SQLITE_ERROR - missing - ** table, missing row, non-blob/text in block column - indicate + ** table, missing row, non-blob/text in block column - indicate ** backing store corruption. */ if( rc==SQLITE_ERROR ) rc = FTS5_CORRUPT; @@ -189439,7 +189434,7 @@ static void fts5DataWrite(Fts5Index *p, i64 iRowid, const u8 *pData, int nData){ if( p->pWriter==0 ){ Fts5Config *pConfig = p->pConfig; fts5IndexPrepareStmt(p, &p->pWriter, sqlite3_mprintf( - "REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)", + "REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)", pConfig->zDb, pConfig->zName )); if( p->rc ) return; @@ -189463,7 +189458,7 @@ static void fts5DataDelete(Fts5Index *p, i64 iFirst, i64 iLast){ int rc; Fts5Config *pConfig = p->pConfig; char *zSql = sqlite3_mprintf( - "DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?", + "DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?", pConfig->zDb, pConfig->zName ); if( zSql==0 ){ @@ -189506,7 +189501,7 @@ static void fts5DataRemoveSegment(Fts5Index *p, int iSegid){ } /* -** Release a reference to an Fts5Structure object returned by an earlier +** Release a reference to an Fts5Structure object returned by an earlier ** call to fts5StructureRead() or fts5StructureDecode(). */ static void fts5StructureRelease(Fts5Structure *pStruct){ @@ -189581,7 +189576,7 @@ static int fts5StructureDecode( i += fts5GetVarint32(&pData[i], pLvl->nMerge); i += fts5GetVarint32(&pData[i], nTotal); assert( nTotal>=pLvl->nMerge ); - pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&rc, + pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&rc, nTotal * sizeof(Fts5StructureSegment) ); } @@ -189637,10 +189632,10 @@ static void fts5StructureAddLevel(int *pRc, Fts5Structure **ppStruct){ ** segments. */ static void fts5StructureExtendLevel( - int *pRc, - Fts5Structure *pStruct, - int iLvl, - int nExtra, + int *pRc, + Fts5Structure *pStruct, + int iLvl, + int nExtra, int bInsert ){ if( *pRc==SQLITE_OK ){ @@ -189694,7 +189689,7 @@ static i64 fts5IndexDataVersion(Fts5Index *p){ if( p->rc==SQLITE_OK ){ if( p->pDataVersion==0 ){ - p->rc = fts5IndexPrepareStmt(p, &p->pDataVersion, + p->rc = fts5IndexPrepareStmt(p, &p->pDataVersion, sqlite3_mprintf("PRAGMA %Q.data_version", p->pConfig->zDb) ); if( p->rc ) return 0; @@ -189713,7 +189708,7 @@ static i64 fts5IndexDataVersion(Fts5Index *p){ ** Read, deserialize and return the structure record. ** ** The Fts5Structure.aLevel[] and each Fts5StructureLevel.aSeg[] array -** are over-allocated as described for function fts5StructureDecode() +** are over-allocated as described for function fts5StructureDecode() ** above. ** ** If an error occurs, NULL is returned and an error code left in the @@ -189862,8 +189857,8 @@ static int fts5SegmentSize(Fts5StructureSegment *pSeg){ } /* -** Return a copy of index structure pStruct. Except, promote as many -** segments as possible to level iPromote. If an OOM occurs, NULL is +** Return a copy of index structure pStruct. Except, promote as many +** segments as possible to level iPromote. If an OOM occurs, NULL is ** returned. */ static void fts5StructurePromoteTo( @@ -189903,8 +189898,8 @@ static void fts5StructurePromoteTo( ** ** b) If the segment just written is larger than the newest segment on ** the next populated level, then that segment, and any other adjacent -** segments that are also smaller than the one just written, are -** promoted. +** segments that are also smaller than the one just written, are +** promoted. ** ** If one or more segments are promoted, the structure object is updated ** to reflect this. @@ -189938,7 +189933,7 @@ static void fts5StructurePromote( if( sz>szMax ) szMax = sz; } if( szMax>=szSeg ){ - /* Condition (a) is true. Promote the newest segment on level + /* Condition (a) is true. Promote the newest segment on level ** iLvl to level iTst. */ iPromote = iTst; szPromote = szMax; @@ -189957,7 +189952,7 @@ static void fts5StructurePromote( /* -** Advance the iterator passed as the only argument. If the end of the +** Advance the iterator passed as the only argument. If the end of the ** doclist-index page is reached, return non-zero. */ static int fts5DlidxLvlNext(Fts5DlidxLvl *pLvl){ @@ -189972,7 +189967,7 @@ static int fts5DlidxLvlNext(Fts5DlidxLvl *pLvl){ }else{ int iOff; for(iOff=pLvl->iOff; iOffnn; iOff++){ - if( pData->p[iOff] ) break; + if( pData->p[iOff] ) break; } if( iOffnn ){ @@ -190002,7 +189997,7 @@ static int fts5DlidxIterNextR(Fts5Index *p, Fts5DlidxIter *pIter, int iLvl){ if( pLvl[1].bEof==0 ){ fts5DataRelease(pLvl->pData); memset(pLvl, 0, sizeof(Fts5DlidxLvl)); - pLvl->pData = fts5DataRead(p, + pLvl->pData = fts5DataRead(p, FTS5_DLIDX_ROWID(pIter->iSegid, iLvl, pLvl[1].iLeafPgno) ); if( pLvl->pData ) fts5DlidxLvlNext(pLvl); @@ -190022,7 +190017,7 @@ static int fts5DlidxIterNext(Fts5Index *p, Fts5DlidxIter *pIter){ ** points to the first rowid in the doclist-index. ** ** pData: -** pointer to doclist-index record, +** pointer to doclist-index record, ** ** When this function is called pIter->iLeafPgno is the page number the ** doclist is associated with (the one featuring the term). @@ -190053,7 +190048,7 @@ static void fts5DlidxIterLast(Fts5Index *p, Fts5DlidxIter *pIter){ Fts5DlidxLvl *pChild = &pLvl[-1]; fts5DataRelease(pChild->pData); memset(pChild, 0, sizeof(Fts5DlidxLvl)); - pChild->pData = fts5DataRead(p, + pChild->pData = fts5DataRead(p, FTS5_DLIDX_ROWID(pIter->iSegid, i-1, pLvl->iLeafPgno) ); } @@ -190076,8 +190071,8 @@ static int fts5DlidxLvlPrev(Fts5DlidxLvl *pLvl){ int ii; int nZero = 0; - /* Currently iOff points to the first byte of a varint. This block - ** decrements iOff until it points to the first byte of the previous + /* Currently iOff points to the first byte of a varint. This block + ** decrements iOff until it points to the first byte of the previous ** varint. Taking care not to read any memory locations that occur ** before the buffer in memory. */ iLimit = (iOff>9 ? iOff-9 : 0); @@ -190122,7 +190117,7 @@ static int fts5DlidxIterPrevR(Fts5Index *p, Fts5DlidxIter *pIter, int iLvl){ if( pLvl[1].bEof==0 ){ fts5DataRelease(pLvl->pData); memset(pLvl, 0, sizeof(Fts5DlidxLvl)); - pLvl->pData = fts5DataRead(p, + pLvl->pData = fts5DataRead(p, FTS5_DLIDX_ROWID(pIter->iSegid, iLvl, pLvl[1].iLeafPgno) ); if( pLvl->pData ){ @@ -190221,7 +190216,7 @@ static void fts5SegIterNextPage( pIter->pLeaf = pIter->pNextLeaf; pIter->pNextLeaf = 0; }else if( pIter->iLeafPgno<=pSeg->pgnoLast ){ - pIter->pLeaf = fts5LeafRead(p, + pIter->pLeaf = fts5LeafRead(p, FTS5_SEGMENT_ROWID(pSeg->iSegid, pIter->iLeafPgno) ); }else{ @@ -190265,7 +190260,7 @@ static int fts5GetPoslistSize(const u8 *p, int *pnSz, int *pbDel){ ** Fts5SegIter.nPos ** Fts5SegIter.bDel ** -** Leave Fts5SegIter.iLeafOffset pointing to the first byte of the +** Leave Fts5SegIter.iLeafOffset pointing to the first byte of the ** position list content (if any). */ static void fts5SegIterLoadNPos(Fts5Index *p, Fts5SegIter *pIter){ @@ -190316,7 +190311,7 @@ static void fts5SegIterLoadRowid(Fts5Index *p, Fts5SegIter *pIter){ } /* -** Fts5SegIter.iLeafOffset currently points to the first byte of the +** Fts5SegIter.iLeafOffset currently points to the first byte of the ** "nSuffix" field of a term. Function parameter nKeep contains the value ** of the "nPrefix" field (if there was one - it is passed 0 if this is ** the first term in the segment). @@ -190327,7 +190322,7 @@ static void fts5SegIterLoadRowid(Fts5Index *p, Fts5SegIter *pIter){ ** Fts5SegIter.rowid ** ** accordingly and leaves (Fts5SegIter.iLeafOffset) set to the content of -** the first position list. The position list belonging to document +** the first position list. The position list belonging to document ** (Fts5SegIter.iRowid). */ static void fts5SegIterLoadTerm(Fts5Index *p, Fts5SegIter *pIter, int nKeep){ @@ -190374,10 +190369,10 @@ static void fts5SegIterSetNext(Fts5Index *p, Fts5SegIter *pIter){ /* ** Initialize the iterator object pIter to iterate through the entries in -** segment pSeg. The iterator is left pointing to the first entry when +** segment pSeg. The iterator is left pointing to the first entry when ** this function returns. ** -** If an error occurs, Fts5Index.rc is set to an appropriate error code. If +** If an error occurs, Fts5Index.rc is set to an appropriate error code. If ** an error has already occurred when this function is called, it is a no-op. */ static void fts5SegIterInit( @@ -190422,8 +190417,8 @@ static void fts5SegIterInit( ** the position-list size field for the first relevant rowid on the page. ** Fts5SegIter.rowid is set, but nPos and bDel are not. ** -** This function advances the iterator so that it points to the last -** relevant rowid on the page and, if necessary, initializes the +** This function advances the iterator so that it points to the last +** relevant rowid on the page and, if necessary, initializes the ** aRowidOffset[] and iRowidOffset variables. At this point the iterator ** is in its regular state - Fts5SegIter.iLeafOffset points to the first ** byte of the position list content associated with said rowid. @@ -190643,10 +190638,10 @@ static void fts5SegIterNext_None( /* -** Advance iterator pIter to the next entry. +** Advance iterator pIter to the next entry. ** -** If an error occurs, Fts5Index.rc is set to an appropriate error code. It -** is not considered an error if the iterator reaches EOF. If an error has +** If an error occurs, Fts5Index.rc is set to an appropriate error code. It +** is not considered an error if the iterator reaches EOF. If an error has ** already occurred when this function is called, it is a no-op. */ static void fts5SegIterNext( @@ -190757,7 +190752,7 @@ static void fts5SegIterNext( }else{ /* The following could be done by calling fts5SegIterLoadNPos(). But ** this block is particularly performance critical, so equivalent - ** code is inlined. + ** code is inlined. ** ** Later: Switched back to fts5SegIterLoadNPos() because it supports ** detail=none mode. Not ideal. @@ -190837,7 +190832,7 @@ static void fts5SegIterReverse(Fts5Index *p, Fts5SegIter *pIter){ } /* If pLast is NULL at this point, then the last rowid for this doclist - ** lies on the page currently indicated by the iterator. In this case + ** lies on the page currently indicated by the iterator. In this case ** pIter->iLeafOffset is already set to point to the position-list size ** field associated with the first relevant rowid on the page. ** @@ -190867,8 +190862,8 @@ static void fts5SegIterReverse(Fts5Index *p, Fts5SegIter *pIter){ /* ** Iterator pIter currently points to the first rowid of a doclist. -** There is a doclist-index associated with the final term on the current -** page. If the current term is the last term on the page, load the +** There is a doclist-index associated with the final term on the current +** page. If the current term is the last term on the page, load the ** doclist-index from disk and initialize an iterator at (pIter->pDlidx). */ static void fts5SegIterLoadDlidx(Fts5Index *p, Fts5SegIter *pIter){ @@ -190882,8 +190877,8 @@ static void fts5SegIterLoadDlidx(Fts5Index *p, Fts5SegIter *pIter){ /* Check if the current doclist ends on this page. If it does, return ** early without loading the doclist-index (as it belongs to a different ** term. */ - if( pIter->iTermLeafPgno==pIter->iLeafPgno - && pIter->iEndofDoclistszLeaf + if( pIter->iTermLeafPgno==pIter->iLeafPgno + && pIter->iEndofDoclistszLeaf ){ return; } @@ -191044,7 +191039,7 @@ static sqlite3_stmt *fts5IdxSelectStmt(Fts5Index *p){ ** Initialize the object pIter to point to term pTerm/nTerm within segment ** pSeg. If there is no such term in the index, the iterator is set to EOF. ** -** If an error occurs, Fts5Index.rc is set to an appropriate error code. If +** If an error occurs, Fts5Index.rc is set to an appropriate error code. If ** an error has already occurred when this function is called, it is a no-op. */ static void fts5SegIterSeekInit( @@ -191123,10 +191118,10 @@ static void fts5SegIterSeekInit( /* ** Initialize the object pIter to point to term pTerm/nTerm within the -** in-memory hash table. If there is no such term in the hash-table, the +** in-memory hash table. If there is no such term in the hash-table, the ** iterator is set to EOF. ** -** If an error occurs, Fts5Index.rc is set to an appropriate error code. If +** If an error occurs, Fts5Index.rc is set to an appropriate error code. If ** an error has already occurred when this function is called, it is a no-op. */ static void fts5SegIterHashInit( @@ -191197,7 +191192,7 @@ static void fts5SegIterClear(Fts5SegIter *pIter){ ** two iterators. */ static void fts5AssertComparisonResult( - Fts5Iter *pIter, + Fts5Iter *pIter, Fts5SegIter *p1, Fts5SegIter *p2, Fts5CResult *pRes @@ -191234,7 +191229,7 @@ static void fts5AssertComparisonResult( /* ** This function is a no-op unless SQLITE_DEBUG is defined when this module -** is compiled. In that case, this function is essentially an assert() +** is compiled. In that case, this function is essentially an assert() ** statement used to verify that the contents of the pIter->aFirst[] array ** are correct. */ @@ -191248,9 +191243,9 @@ static void fts5AssertMultiIterSetup(Fts5Index *p, Fts5Iter *pIter){ /* Check that pIter->iSwitchRowid is set correctly. */ for(i=0; inSeg; i++){ Fts5SegIter *p1 = &pIter->aSeg[i]; - assert( p1==pFirst - || p1->pLeaf==0 - || fts5BufferCompare(&pFirst->term, &p1->term) + assert( p1==pFirst + || p1->pLeaf==0 + || fts5BufferCompare(&pFirst->term, &p1->term) || p1->iRowid==pIter->iSwitchRowid || (p1->iRowidiSwitchRowid)==pIter->bRev ); @@ -191280,7 +191275,7 @@ static void fts5AssertMultiIterSetup(Fts5Index *p, Fts5Iter *pIter){ ** ** If the returned value is non-zero, then it is the index of an entry ** in the pIter->aSeg[] array that is (a) not at EOF, and (b) pointing -** to a key that is a duplicate of another, higher priority, +** to a key that is a duplicate of another, higher priority, ** segment-iterator in the pSeg->aSeg[] array. */ static int fts5MultiIterDoCompare(Fts5Iter *pIter, int iOut){ @@ -191371,7 +191366,7 @@ static void fts5SegIterGotoPage( } /* -** Advance the iterator passed as the second argument until it is at or +** Advance the iterator passed as the second argument until it is at or ** past rowid iFrom. Regardless of the value of iFrom, the iterator is ** always advanced at least once. */ @@ -191468,7 +191463,7 @@ static void fts5MultiIterAdvanced( ** If non-zero is returned, the caller should call fts5MultiIterAdvanced() ** on the iterator instead. That function does the same as this one, except ** that it deals with more complicated cases as well. -*/ +*/ static int fts5MultiIterAdvanceRowid( Fts5Iter *pIter, /* Iterator to update aFirst[] array for */ int iChanged, /* Index of sub-iterator just advanced */ @@ -191519,14 +191514,14 @@ static void fts5MultiIterSetEof(Fts5Iter *pIter){ } /* -** Move the iterator to the next entry. +** Move the iterator to the next entry. ** -** If an error occurs, an error code is left in Fts5Index.rc. It is not -** considered an error if the iterator reaches EOF, or if it is already at +** If an error occurs, an error code is left in Fts5Index.rc. It is not +** considered an error if the iterator reaches EOF, or if it is already at ** EOF when this function is called. */ static void fts5MultiIterNext( - Fts5Index *p, + Fts5Index *p, Fts5Iter *pIter, int bFrom, /* True if argument iFrom is valid */ i64 iFrom /* Advance at least as far as this */ @@ -191544,7 +191539,7 @@ static void fts5MultiIterNext( pSeg->xNext(p, pSeg, &bNewTerm); } - if( pSeg->pLeaf==0 || bNewTerm + if( pSeg->pLeaf==0 || bNewTerm || fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg) ){ fts5MultiIterAdvanced(p, pIter, iFirst, 1); @@ -191564,7 +191559,7 @@ static void fts5MultiIterNext( } static void fts5MultiIterNext2( - Fts5Index *p, + Fts5Index *p, Fts5Iter *pIter, int *pbNewTerm /* OUT: True if *might* be new term */ ){ @@ -191577,7 +191572,7 @@ static void fts5MultiIterNext2( assert( p->rc==SQLITE_OK ); pSeg->xNext(p, pSeg, &bNewTerm); - if( pSeg->pLeaf==0 || bNewTerm + if( pSeg->pLeaf==0 || bNewTerm || fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg) ){ fts5MultiIterAdvanced(p, pIter, iFirst, 1); @@ -191604,7 +191599,7 @@ static Fts5Iter *fts5MultiIterAlloc( int nSlot; /* Power of two >= nSeg */ for(nSlot=2; nSlotaSeg[] */ sizeof(Fts5CResult) * nSlot /* pNew->aFirst[] */ @@ -191619,8 +191614,8 @@ static Fts5Iter *fts5MultiIterAlloc( } static void fts5PoslistCallback( - Fts5Index *pUnused, - void *pContext, + Fts5Index *pUnused, + void *pContext, const u8 *pChunk, int nChunk ){ UNUSED_PARAM(pUnused); @@ -191657,8 +191652,8 @@ static int fts5IndexColsetTest(Fts5Colset *pColset, int iCol){ } static void fts5PoslistOffsetsCallback( - Fts5Index *pUnused, - void *pContext, + Fts5Index *pUnused, + void *pContext, const u8 *pChunk, int nChunk ){ PoslistOffsetsCtx *pCtx = (PoslistOffsetsCtx*)pContext; @@ -191681,7 +191676,7 @@ static void fts5PoslistOffsetsCallback( static void fts5PoslistFilterCallback( Fts5Index *pUnused, - void *pContext, + void *pContext, const u8 *pChunk, int nChunk ){ PoslistCallbackCtx *pCtx = (PoslistCallbackCtx*)pContext; @@ -191825,7 +191820,7 @@ static int fts5IndexExtractCol( while( iCol>iCurrent ){ /* Advance pointer p until it points to pEnd or an 0x01 byte that is ** not part of a varint. Note that it is not possible for a negative - ** or extremely large varint to occur within an uncorrupted position + ** or extremely large varint to occur within an uncorrupted position ** list. So the last byte of each varint may be assumed to have a clear ** 0x80 bit. */ while( *p!=0x01 ){ @@ -191890,7 +191885,7 @@ static void fts5IterSetOutputs_Nocolset(Fts5Iter *pIter, Fts5SegIter *pSeg){ assert( pIter->pColset==0 ); if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){ - /* All data is stored on the current page. Populate the output + /* All data is stored on the current page. Populate the output ** variables to point into the body of the page object. */ pIter->base.pData = &pSeg->pLeaf->p[pSeg->iLeafOffset]; }else{ @@ -191926,13 +191921,13 @@ static void fts5IterSetOutputs_Col(Fts5Iter *pIter, Fts5SegIter *pSeg){ } /* -** xSetOutputs callback used when: +** xSetOutputs callback used when: ** ** * detail=col, ** * there is a column filter, and -** * the table contains 100 or fewer columns. +** * the table contains 100 or fewer columns. ** -** The last point is to ensure all column numbers are stored as +** The last point is to ensure all column numbers are stored as ** single-byte varints. */ static void fts5IterSetOutputs_Col100(Fts5Iter *pIter, Fts5SegIter *pSeg){ @@ -191944,7 +191939,7 @@ static void fts5IterSetOutputs_Col100(Fts5Iter *pIter, Fts5SegIter *pSeg){ fts5IterSetOutputs_Col(pIter, pSeg); }else{ u8 *a = (u8*)&pSeg->pLeaf->p[pSeg->iLeafOffset]; - u8 *pEnd = (u8*)&a[pSeg->nPos]; + u8 *pEnd = (u8*)&a[pSeg->nPos]; int iPrev = 0; int *aiCol = pIter->pColset->aiCol; int *aiColEnd = &aiCol[pIter->pColset->nCol]; @@ -191983,7 +191978,7 @@ static void fts5IterSetOutputs_Full(Fts5Iter *pIter, Fts5SegIter *pSeg){ assert( pColset ); if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){ - /* All data is stored on the current page. Populate the output + /* All data is stored on the current page. Populate the output ** variables to point into the body of the page object. */ const u8 *a = &pSeg->pLeaf->p[pSeg->iLeafOffset]; if( pColset->nCol==1 ){ @@ -192046,7 +192041,7 @@ static void fts5IterSetOutputCb(int *pRc, Fts5Iter *pIter){ ** is zero or greater, data from the first nSegment segments on level iLevel ** is merged. ** -** The iterator initially points to the first term/rowid entry in the +** The iterator initially points to the first term/rowid entry in the ** iterated data. */ static void fts5MultiIterNew( @@ -192117,8 +192112,8 @@ static void fts5MultiIterNew( assert( iIter==nSeg ); } - /* If the above was successful, each component iterators now points - ** to the first entry in its segment. In this case initialize the + /* If the above was successful, each component iterators now points + ** to the first entry in its segment. In this case initialize the ** aFirst[] array. Or, if an error has occurred, free the iterator ** object and set the output variable to NULL. */ if( p->rc==SQLITE_OK ){ @@ -192187,12 +192182,12 @@ static void fts5MultiIterNew2( } /* -** Return true if the iterator is at EOF or if an error has occurred. +** Return true if the iterator is at EOF or if an error has occurred. ** False otherwise. */ static int fts5MultiIterEof(Fts5Index *p, Fts5Iter *pIter){ - assert( p->rc - || (pIter->aSeg[ pIter->aFirst[1].iFirst ].pLeaf==0)==pIter->base.bEof + assert( p->rc + || (pIter->aSeg[ pIter->aFirst[1].iFirst ].pLeaf==0)==pIter->base.bEof ); return (p->rc || pIter->base.bEof); } @@ -192211,8 +192206,8 @@ static i64 fts5MultiIterRowid(Fts5Iter *pIter){ ** Move the iterator to the next entry at or following iMatch. */ static void fts5MultiIterNextFrom( - Fts5Index *p, - Fts5Iter *pIter, + Fts5Index *p, + Fts5Iter *pIter, i64 iMatch ){ while( 1 ){ @@ -192226,7 +192221,7 @@ static void fts5MultiIterNextFrom( } /* -** Return a pointer to a buffer containing the term associated with the +** Return a pointer to a buffer containing the term associated with the ** entry that the iterator currently points to. */ static const u8 *fts5MultiIterTerm(Fts5Iter *pIter, int *pn){ @@ -192237,11 +192232,11 @@ static const u8 *fts5MultiIterTerm(Fts5Iter *pIter, int *pn){ /* ** Allocate a new segment-id for the structure pStruct. The new segment -** id must be between 1 and 65335 inclusive, and must not be used by +** id must be between 1 and 65335 inclusive, and must not be used by ** any currently existing segment. If a free segment id cannot be found, ** SQLITE_FULL is returned. ** -** If an error has already occurred, this function is a no-op. 0 is +** If an error has already occurred, this function is a no-op. 0 is ** returned in this case. */ static int fts5AllocateSegid(Fts5Index *p, Fts5Structure *pStruct){ @@ -192309,10 +192304,10 @@ static void fts5IndexDiscardData(Fts5Index *p){ } /* -** Return the size of the prefix, in bytes, that buffer +** Return the size of the prefix, in bytes, that buffer ** (pNew/) shares with buffer (pOld/nOld). ** -** Buffer (pNew/) is guaranteed to be greater +** Buffer (pNew/) is guaranteed to be greater ** than buffer (pOld/nOld). */ static int fts5PrefixCompress(int nOld, const u8 *pOld, const u8 *pNew){ @@ -192324,7 +192319,7 @@ static int fts5PrefixCompress(int nOld, const u8 *pOld, const u8 *pNew){ } static void fts5WriteDlidxClear( - Fts5Index *p, + Fts5Index *p, Fts5SegWriter *pWriter, int bFlush /* If true, write dlidx to disk */ ){ @@ -192335,7 +192330,7 @@ static void fts5WriteDlidxClear( if( pDlidx->buf.n==0 ) break; if( bFlush ){ assert( pDlidx->pgno!=0 ); - fts5DataWrite(p, + fts5DataWrite(p, FTS5_DLIDX_ROWID(pWriter->iSegid, i, pDlidx->pgno), pDlidx->buf.p, pDlidx->buf.n ); @@ -192389,8 +192384,8 @@ static int fts5WriteFlushDlidx(Fts5Index *p, Fts5SegWriter *pWriter){ } /* -** This function is called whenever processing of the doclist for the -** last term on leaf page (pWriter->iBtPage) is completed. +** This function is called whenever processing of the doclist for the +** last term on leaf page (pWriter->iBtPage) is completed. ** ** The doclist-index for that term is currently stored in-memory within the ** Fts5SegWriter.aDlidx[] array. If it is large enough, this function @@ -192472,8 +192467,8 @@ static i64 fts5DlidxExtractFirstRowid(Fts5Buffer *pBuf){ ** doclist-index. */ static void fts5WriteDlidxAppend( - Fts5Index *p, - Fts5SegWriter *pWriter, + Fts5Index *p, + Fts5SegWriter *pWriter, i64 iRowid ){ int i; @@ -192486,11 +192481,11 @@ static void fts5WriteDlidxAppend( if( pDlidx->buf.n>=p->pConfig->pgsz ){ /* The current doclist-index page is full. Write it to disk and push ** a copy of iRowid (which will become the first rowid on the next - ** doclist-index leaf page) up into the next level of the b-tree + ** doclist-index leaf page) up into the next level of the b-tree ** hierarchy. If the node being flushed is currently the root node, ** also push its first rowid upwards. */ pDlidx->buf.p[0] = 0x01; /* Not the root node */ - fts5DataWrite(p, + fts5DataWrite(p, FTS5_DLIDX_ROWID(pWriter->iSegid, i, pDlidx->pgno), pDlidx->buf.p, pDlidx->buf.n ); @@ -192577,13 +192572,13 @@ nCall++; ** Append term pTerm/nTerm to the segment being written by the writer passed ** as the second argument. ** -** If an error occurs, set the Fts5Index.rc error code. If an error has +** If an error occurs, set the Fts5Index.rc error code. If an error has ** already occurred, this function is a no-op. */ static void fts5WriteAppendTerm( - Fts5Index *p, + Fts5Index *p, Fts5SegWriter *pWriter, - int nTerm, const u8 *pTerm + int nTerm, const u8 *pTerm ){ int nPrefix; /* Bytes of prefix compression for term */ Fts5PageWriter *pPage = &pWriter->writer; @@ -192600,7 +192595,7 @@ static void fts5WriteAppendTerm( } fts5BufferGrow(&p->rc, &pPage->buf, nTerm+FTS5_DATA_PADDING); } - + /* TODO1: Updating pgidx here. */ pPgidx->n += sqlite3Fts5PutVarint( &pPgidx->p[pPgidx->n], pPage->buf.n - pPage->iPrevPgidx @@ -192616,11 +192611,11 @@ static void fts5WriteAppendTerm( if( pPage->pgno!=1 ){ /* This is the first term on a leaf that is not the leftmost leaf in ** the segment b-tree. In this case it is necessary to add a term to - ** the b-tree hierarchy that is (a) larger than the largest term + ** the b-tree hierarchy that is (a) larger than the largest term ** already written to the segment and (b) smaller than or equal to ** this term. In other words, a prefix of (pTerm/nTerm) that is one ** byte longer than the longest prefix (pTerm/nTerm) shares with the - ** previous term. + ** previous term. ** ** Usually, the previous term is available in pPage->term. The exception ** is if this is the first term written in an incremental-merge step. @@ -192656,10 +192651,10 @@ static void fts5WriteAppendTerm( } /* -** Append a rowid and position-list size field to the writers output. +** Append a rowid and position-list size field to the writers output. */ static void fts5WriteAppendRowid( - Fts5Index *p, + Fts5Index *p, Fts5SegWriter *pWriter, i64 iRowid ){ @@ -192670,7 +192665,7 @@ static void fts5WriteAppendRowid( fts5WriteFlushLeaf(p, pWriter); } - /* If this is to be the first rowid written to the page, set the + /* If this is to be the first rowid written to the page, set the ** rowid-pointer in the page-header. Also append a value to the dlidx ** buffer, in case a doclist-index is required. */ if( pWriter->bFirstRowidInPage ){ @@ -192692,18 +192687,18 @@ static void fts5WriteAppendRowid( } static void fts5WriteAppendPoslistData( - Fts5Index *p, - Fts5SegWriter *pWriter, - const u8 *aData, + Fts5Index *p, + Fts5SegWriter *pWriter, + const u8 *aData, int nData ){ Fts5PageWriter *pPage = &pWriter->writer; const u8 *a = aData; int n = nData; - + assert( p->pConfig->pgsz>0 ); - while( p->rc==SQLITE_OK - && (pPage->buf.n + pPage->pgidx.n + n)>=p->pConfig->pgsz + while( p->rc==SQLITE_OK + && (pPage->buf.n + pPage->pgidx.n + n)>=p->pConfig->pgsz ){ int nReq = p->pConfig->pgsz - pPage->buf.n - pPage->pgidx.n; int nCopy = 0; @@ -192726,7 +192721,7 @@ static void fts5WriteAppendPoslistData( ** allocations associated with the writer. */ static void fts5WriteFinish( - Fts5Index *p, + Fts5Index *p, Fts5SegWriter *pWriter, /* Writer object */ int *pnLeaf /* OUT: Number of leaf pages in b-tree */ ){ @@ -192754,8 +192749,8 @@ static void fts5WriteFinish( } static void fts5WriteInit( - Fts5Index *p, - Fts5SegWriter *pWriter, + Fts5Index *p, + Fts5SegWriter *pWriter, int iSegid ){ const int nBuffer = p->pConfig->pgsz + FTS5_DATA_PADDING; @@ -192778,7 +192773,7 @@ static void fts5WriteInit( if( p->pIdxWriter==0 ){ Fts5Config *pConfig = p->pConfig; fts5IndexPrepareStmt(p, &p->pIdxWriter, sqlite3_mprintf( - "INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)", + "INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)", pConfig->zDb, pConfig->zName )); } @@ -192837,12 +192832,12 @@ static void fts5TrimSegments(Fts5Index *p, Fts5Iter *pIter){ /* Set up the new page-index array */ fts5BufferAppendVarint(&p->rc, &buf, 4); - if( pSeg->iLeafPgno==pSeg->iTermLeafPgno - && pSeg->iEndofDoclistszLeaf + if( pSeg->iLeafPgno==pSeg->iTermLeafPgno + && pSeg->iEndofDoclistszLeaf ){ int nDiff = pData->szLeaf - pSeg->iEndofDoclist; fts5BufferAppendVarint(&p->rc, &buf, buf.n - 1 - nDiff - 4); - fts5BufferAppendBlob(&p->rc, &buf, + fts5BufferAppendBlob(&p->rc, &buf, pData->nn - pSeg->iPgidxOff, &pData->p[pSeg->iPgidxOff] ); } @@ -192858,8 +192853,8 @@ static void fts5TrimSegments(Fts5Index *p, Fts5Iter *pIter){ } static void fts5MergeChunkCallback( - Fts5Index *p, - void *pCtx, + Fts5Index *p, + void *pCtx, const u8 *pChunk, int nChunk ){ Fts5SegWriter *pWriter = (Fts5SegWriter*)pCtx; @@ -193069,7 +193064,7 @@ static int fts5IndexMerge( ** segment. This function updates the write-counter accordingly and, if ** necessary, performs incremental merge work. ** -** If an error occurs, set the Fts5Index.rc error code. If an error has +** If an error occurs, set the Fts5Index.rc error code. If an error has ** already occurred, this function is a no-op. */ static void fts5IndexAutomerge( @@ -193120,12 +193115,12 @@ static int fts5IndexReturn(Fts5Index *p){ typedef struct Fts5FlushCtx Fts5FlushCtx; struct Fts5FlushCtx { Fts5Index *pIdx; - Fts5SegWriter writer; + Fts5SegWriter writer; }; /* ** Buffer aBuf[] contains a list of varints, all small enough to fit -** in a 32-bit integer. Return the size of the largest prefix of this +** in a 32-bit integer. Return the size of the largest prefix of this ** list nMax bytes or less in size. */ static int fts5PoslistPrefix(const u8 *aBuf, int nMax){ @@ -193143,10 +193138,10 @@ static int fts5PoslistPrefix(const u8 *aBuf, int nMax){ } /* -** Flush the contents of in-memory hash table iHash to a new level-0 +** Flush the contents of in-memory hash table iHash to a new level-0 ** segment on disk. Also update the corresponding structure record. ** -** If an error occurs, set the Fts5Index.rc error code. If an error has +** If an error occurs, set the Fts5Index.rc error code. If an error has ** already occurred, this function is a no-op. */ static void fts5FlushOneHash(Fts5Index *p){ @@ -193202,13 +193197,13 @@ static void fts5FlushOneHash(Fts5Index *p){ i64 iDelta = 0; int iOff = 0; - /* The entire doclist will not fit on this leaf. The following - ** loop iterates through the poslists that make up the current + /* The entire doclist will not fit on this leaf. The following + ** loop iterates through the poslists that make up the current ** doclist. */ while( p->rc==SQLITE_OK && iOffp[0], (u16)pBuf->n); /* first rowid on page */ pBuf->n += sqlite3Fts5PutVarint(&pBuf->p[pBuf->n], iRowid); @@ -193311,7 +193306,7 @@ static void fts5IndexFlush(Fts5Index *p){ } static Fts5Structure *fts5IndexOptimizeStruct( - Fts5Index *p, + Fts5Index *p, Fts5Structure *pStruct ){ Fts5Structure *pNew = 0; @@ -193322,7 +193317,7 @@ static Fts5Structure *fts5IndexOptimizeStruct( /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: ** - ** + it consists of fewer than two segments, or + ** + it consists of fewer than two segments, or ** + all segments are on the same level, or ** + all segments except one are currently inputs to a merge operation. ** @@ -193399,7 +193394,7 @@ static int sqlite3Fts5IndexOptimize(Fts5Index *p){ fts5StructureRelease(pNew); } - return fts5IndexReturn(p); + return fts5IndexReturn(p); } /* @@ -193481,7 +193476,7 @@ static void fts5DoclistIterNext(Fts5DoclistIter *pIter){ } static void fts5DoclistIterInit( - Fts5Buffer *pBuf, + Fts5Buffer *pBuf, Fts5DoclistIter *pIter ){ memset(pIter, 0, sizeof(*pIter)); @@ -193617,7 +193612,7 @@ static void fts5MergePrefixLists( if( i2.aPoslist==0 ) break; } else{ - /* Merge the two position lists. */ + /* Merge the two position lists. */ i64 iPos1 = 0; i64 iPos2 = 0; int iOff1 = 0; @@ -193724,8 +193719,8 @@ static void fts5SetupPrefixIter( pStruct = fts5StructureRead(p); if( aBuf && pStruct ){ - const int flags = FTS5INDEX_QUERY_SCAN - | FTS5INDEX_QUERY_SKIPEMPTY + const int flags = FTS5INDEX_QUERY_SCAN + | FTS5INDEX_QUERY_SKIPEMPTY | FTS5INDEX_QUERY_NOOUTPUT; int i; i64 iLastRowid = 0; @@ -193807,9 +193802,9 @@ static int sqlite3Fts5IndexBeginWrite(Fts5Index *p, int bDelete, i64 iRowid){ } /* Flush the hash table to disk if required */ - if( iRowidiWriteRowid + if( iRowidiWriteRowid || (iRowid==p->iWriteRowid && p->bDelete==0) - || (p->nPendingData > p->pConfig->nHashSize) + || (p->nPendingData > p->pConfig->nHashSize) ){ fts5IndexFlush(p); } @@ -193832,7 +193827,7 @@ static int sqlite3Fts5IndexSync(Fts5Index *p, int bCommit){ /* ** Discard any data stored in the in-memory hash tables. Do not write it ** to the database. Additionally, assume that the contents of the %_data -** table may have changed on disk. So any in-memory caches of %_data +** table may have changed on disk. So any in-memory caches of %_data ** records must be invalidated. */ static int sqlite3Fts5IndexRollback(Fts5Index *p){ @@ -193865,8 +193860,8 @@ static int sqlite3Fts5IndexReinit(Fts5Index *p){ ** Otherwise, set *pp to NULL and return an SQLite error code. */ static int sqlite3Fts5IndexOpen( - Fts5Config *pConfig, - int bCreate, + Fts5Config *pConfig, + int bCreate, Fts5Index **pp, char **pzErr ){ @@ -193883,8 +193878,8 @@ static int sqlite3Fts5IndexOpen( pConfig, "data", "id INTEGER PRIMARY KEY, block BLOB", 0, pzErr ); if( rc==SQLITE_OK ){ - rc = sqlite3Fts5CreateTable(pConfig, "idx", - "segid, term, pgno, PRIMARY KEY(segid, term)", + rc = sqlite3Fts5CreateTable(pConfig, "idx", + "segid, term, pgno, PRIMARY KEY(segid, term)", 1, pzErr ); } @@ -193924,13 +193919,13 @@ static int sqlite3Fts5IndexClose(Fts5Index *p){ } /* -** Argument p points to a buffer containing utf-8 text that is n bytes in +** Argument p points to a buffer containing utf-8 text that is n bytes in ** size. Return the number of bytes in the nChar character prefix of the ** buffer, or 0 if there are less than nChar characters in total. */ static int sqlite3Fts5IndexCharlenToBytelen( - const char *p, - int nByte, + const char *p, + int nByte, int nChar ){ int n = 0; @@ -193949,7 +193944,7 @@ static int sqlite3Fts5IndexCharlenToBytelen( ** unicode characters in the string. */ static int fts5IndexCharlen(const char *pIn, int nIn){ - int nChar = 0; + int nChar = 0; int i = 0; while( i=0xc0 ){ @@ -193961,7 +193956,7 @@ static int fts5IndexCharlen(const char *pIn, int nIn){ } /* -** Insert or remove data to or from the index. Each time a document is +** Insert or remove data to or from the index. Each time a document is ** added to or removed from the index, this function is called one or more ** times. ** @@ -193992,7 +193987,7 @@ static int sqlite3Fts5IndexWrite( const int nChar = pConfig->aPrefix[i]; int nByte = sqlite3Fts5IndexCharlenToBytelen(pToken, nToken, nChar); if( nByte ){ - rc = sqlite3Fts5HashWrite(p->pHash, + rc = sqlite3Fts5HashWrite(p->pHash, p->iWriteRowid, iCol, iPos, (char)(FTS5_MAIN_PREFIX+i+1), pToken, nByte ); @@ -194003,7 +193998,7 @@ static int sqlite3Fts5IndexWrite( } /* -** Open a new iterator to iterate though all rowid that match the +** Open a new iterator to iterate though all rowid that match the ** specified token or token prefix. */ static int sqlite3Fts5IndexQuery( @@ -194030,9 +194025,9 @@ static int sqlite3Fts5IndexQuery( ** satisfied by scanning multiple terms in the main index. ** ** If the QUERY_TEST_NOIDX flag was specified, then this must be a - ** prefix-query. Instead of using a prefix-index (if one exists), + ** prefix-query. Instead of using a prefix-index (if one exists), ** evaluate the prefix query using the main FTS index. This is used - ** for internal sanity checking by the integrity-check in debug + ** for internal sanity checking by the integrity-check in debug ** mode only. */ #ifdef SQLITE_DEBUG if( pConfig->bPrefixIndex==0 || (flags & FTS5INDEX_QUERY_TEST_NOIDX) ){ @@ -194052,7 +194047,7 @@ static int sqlite3Fts5IndexQuery( Fts5Structure *pStruct = fts5StructureRead(p); buf.p[0] = (u8)(FTS5_MAIN_PREFIX + iIdx); if( pStruct ){ - fts5MultiIterNew(p, pStruct, flags | FTS5INDEX_QUERY_SKIPEMPTY, + fts5MultiIterNew(p, pStruct, flags | FTS5INDEX_QUERY_SKIPEMPTY, pColset, buf.p, nToken+1, -1, 0, &pRet ); fts5StructureRelease(pStruct); @@ -194086,7 +194081,7 @@ static int sqlite3Fts5IndexQuery( ** Return true if the iterator passed as the only argument is at EOF. */ /* -** Move to the next matching rowid. +** Move to the next matching rowid. */ static int sqlite3Fts5IterNext(Fts5IndexIter *pIndexIter){ Fts5Iter *pIter = (Fts5Iter*)pIndexIter; @@ -194151,7 +194146,7 @@ static void sqlite3Fts5IterClose(Fts5IndexIter *pIndexIter){ } /* -** Read and decode the "averages" record from the database. +** Read and decode the "averages" record from the database. ** ** Parameter anSize must point to an array of size nCol, where nCol is ** the number of user defined columns in the FTS table. @@ -194177,7 +194172,7 @@ static int sqlite3Fts5IndexGetAverages(Fts5Index *p, i64 *pnRow, i64 *anSize){ } /* -** Replace the current "averages" record with the contents of the buffer +** Replace the current "averages" record with the contents of the buffer ** supplied as the second argument. */ static int sqlite3Fts5IndexSetAverages(Fts5Index *p, const u8 *pData, int nData){ @@ -194195,7 +194190,7 @@ static int sqlite3Fts5IndexReads(Fts5Index *p){ } /* -** Set the 32-bit cookie value stored at the start of all structure +** Set the 32-bit cookie value stored at the start of all structure ** records to the value passed as the second argument. ** ** Return SQLITE_OK if successful, or an SQLite error code if an error @@ -194210,7 +194205,7 @@ static int sqlite3Fts5IndexSetCookie(Fts5Index *p, int iNew){ assert( p->rc==SQLITE_OK ); sqlite3Fts5Put32(aCookie, iNew); - rc = sqlite3_blob_open(pConfig->db, pConfig->zDb, p->zDataTbl, + rc = sqlite3_blob_open(pConfig->db, pConfig->zDb, p->zDataTbl, "block", FTS5_STRUCTURE_ROWID, 1, &pBlob ); if( rc==SQLITE_OK ){ @@ -194231,7 +194226,7 @@ static int sqlite3Fts5IndexLoadConfig(Fts5Index *p){ /************************************************************************* ************************************************************************** -** Below this point is the implementation of the integrity-check +** Below this point is the implementation of the integrity-check ** functionality. */ @@ -194239,9 +194234,9 @@ static int sqlite3Fts5IndexLoadConfig(Fts5Index *p){ ** Return a simple checksum value based on the arguments. */ static u64 sqlite3Fts5IndexEntryCksum( - i64 iRowid, - int iCol, - int iPos, + i64 iRowid, + int iCol, + int iPos, int iIdx, const char *pTerm, int nTerm @@ -194257,15 +194252,15 @@ static u64 sqlite3Fts5IndexEntryCksum( #ifdef SQLITE_DEBUG /* -** This function is purely an internal test. It does not contribute to +** This function is purely an internal test. It does not contribute to ** FTS functionality, or even the integrity-check, in any way. ** -** Instead, it tests that the same set of pgno/rowid combinations are +** Instead, it tests that the same set of pgno/rowid combinations are ** visited regardless of whether the doclist-index identified by parameters ** iSegid/iLeaf is iterated in forwards or reverse order. */ static void fts5TestDlidxReverse( - Fts5Index *p, + Fts5Index *p, int iSegid, /* Segment id to load from */ int iLeaf /* Load doclist-index for this leaf */ ){ @@ -194341,11 +194336,11 @@ static int fts5QueryCksum( /* -** This function is also purely an internal test. It does not contribute to +** This function is also purely an internal test. It does not contribute to ** FTS functionality, or even the integrity-check, in any way. */ static void fts5TestTerm( - Fts5Index *p, + Fts5Index *p, Fts5Buffer *pPrev, /* Previous term */ const char *z, int n, /* Possibly new term to test */ u64 expected, @@ -194374,7 +194369,7 @@ static void fts5TestTerm( if( rc==SQLITE_OK && ck1!=ck2 ) rc = FTS5_CORRUPT; /* If this is a prefix query, check that the results returned if the - ** the index is disabled are the same. In both ASC and DESC order. + ** the index is disabled are the same. In both ASC and DESC order. ** ** This check may only be performed if the hash table is empty. This ** is because the hash table only supports a single scan query at @@ -194405,7 +194400,7 @@ static void fts5TestTerm( } p->rc = rc; } - + #else # define fts5TestDlidxReverse(x,y,z) # define fts5TestTerm(u,v,w,x,y,z) @@ -194517,7 +194512,7 @@ static void fts5IndexIntegrityCheckSegment( int iIdxLeaf = sqlite3_column_int(pStmt, 2); int bIdxDlidx = sqlite3_column_int(pStmt, 3); - /* If the leaf in question has already been trimmed from the segment, + /* If the leaf in question has already been trimmed from the segment, ** ignore this b-tree entry. Otherwise, load it into memory. */ if( iIdxLeafpgnoFirst ) continue; iRow = FTS5_SEGMENT_ROWID(pSeg->iSegid, iIdxLeaf); @@ -194625,7 +194620,7 @@ static void fts5IndexIntegrityCheckSegment( /* -** Run internal checks to ensure that the FTS index (a) is internally +** Run internal checks to ensure that the FTS index (a) is internally ** consistent and (b) contains entries for which the XOR of the checksums ** as calculated by sqlite3Fts5IndexEntryCksum() is cksum. ** @@ -194647,7 +194642,7 @@ static int sqlite3Fts5IndexIntegrityCheck(Fts5Index *p, u64 cksum){ Fts5Buffer term = {0,0,0}; /* Buffer used to hold most recent term */ #endif const int flags = FTS5INDEX_QUERY_NOOUTPUT; - + /* Load the FTS index structure */ pStruct = fts5StructureRead(p); @@ -194669,7 +194664,7 @@ static int sqlite3Fts5IndexIntegrityCheck(Fts5Index *p, u64 cksum){ ** ** Two versions of the same checksum are calculated. The first (stack ** variable cksum2) based on entries extracted from the full-text index - ** while doing a linear scan of each individual index in turn. + ** while doing a linear scan of each individual index in turn. ** ** As each term visited by the linear scans, a separate query for the ** same term is performed. cksum3 is calculated based on the entries @@ -194771,12 +194766,12 @@ static void fts5DebugStructure( for(iLvl=0; iLvlnLevel; iLvl++){ Fts5StructureLevel *pLvl = &p->aLevel[iLvl]; - sqlite3Fts5BufferAppendPrintf(pRc, pBuf, + sqlite3Fts5BufferAppendPrintf(pRc, pBuf, " {lvl=%d nMerge=%d nSeg=%d", iLvl, pLvl->nMerge, pLvl->nSeg ); for(iSeg=0; iSegnSeg; iSeg++){ Fts5StructureSegment *pSeg = &pLvl->aSeg[iSeg]; - sqlite3Fts5BufferAppendPrintf(pRc, pBuf, " {id=%d leaves=%d..%d}", + sqlite3Fts5BufferAppendPrintf(pRc, pBuf, " {id=%d leaves=%d..%d}", pSeg->iSegid, pSeg->pgnoFirst, pSeg->pgnoLast ); } @@ -194789,7 +194784,7 @@ static void fts5DebugStructure( ** ** Arguments pBlob/nBlob contain a serialized Fts5Structure object. This ** function appends a human-readable representation of the same object -** to the buffer passed as the second argument. +** to the buffer passed as the second argument. */ static void fts5DecodeStructure( int *pRc, /* IN/OUT: error code */ @@ -194812,9 +194807,9 @@ static void fts5DecodeStructure( /* ** This is part of the fts5_decode() debugging aid. ** -** Arguments pBlob/nBlob contain an "averages" record. This function -** appends a human-readable representation of record to the buffer passed -** as the second argument. +** Arguments pBlob/nBlob contain an "averages" record. This function +** appends a human-readable representation of record to the buffer passed +** as the second argument. */ static void fts5DecodeAverages( int *pRc, /* IN/OUT: error code */ @@ -194853,7 +194848,7 @@ static int fts5DecodePoslist(int *pRc, Fts5Buffer *pBuf, const u8 *a, int n){ ** The start of buffer (a/n) contains the start of a doclist. The doclist ** may or may not finish within the buffer. This function appends a text ** representation of the part of the doclist that is present to buffer -** pBuf. +** pBuf. ** ** The return value is the number of bytes read from the input buffer. */ @@ -194883,7 +194878,7 @@ static int fts5DecodeDoclist(int *pRc, Fts5Buffer *pBuf, const u8 *a, int n){ } /* -** This function is part of the fts5_decode() debugging function. It is +** This function is part of the fts5_decode() debugging function. It is ** only ever used with detail=none tables. ** ** Buffer (pData/nData) contains a doclist in the format used by detail=none @@ -194971,7 +194966,7 @@ static void fts5DecodeFunction( lvl.iLeafPgno = iPgno; for(fts5DlidxLvlNext(&lvl); lvl.bEof==0; fts5DlidxLvlNext(&lvl)){ - sqlite3Fts5BufferAppendPrintf(&rc, &s, + sqlite3Fts5BufferAppendPrintf(&rc, &s, " %d(%lld)", lvl.iLeafPgno, lvl.iRowid ); } @@ -195071,7 +195066,7 @@ static void fts5DecodeFunction( int bFirst = (iPgidxOff==szLeaf); /* True for first term on page */ int nByte; /* Bytes of data */ int iEnd; - + iPgidxOff += fts5GetVarint32(&a[iPgidxOff], nByte); iPgidxPrev += nByte; iOff = iPgidxPrev; @@ -195099,7 +195094,7 @@ static void fts5DecodeFunction( fts5BufferFree(&term); } - + decode_out: sqlite3_free(a); if( rc==SQLITE_OK ){ @@ -195127,7 +195122,7 @@ static void fts5RowidFunction( i64 iRowid; int segid, pgno; if( nArg!=3 ){ - sqlite3_result_error(pCtx, + sqlite3_result_error(pCtx, "should be: fts5_rowid('segment', segid, pgno))", -1 ); }else{ @@ -195137,7 +195132,7 @@ static void fts5RowidFunction( sqlite3_result_int64(pCtx, iRowid); } }else{ - sqlite3_result_error(pCtx, + sqlite3_result_error(pCtx, "first arg to fts5_rowid() must be 'segment'" , -1 ); } @@ -195159,7 +195154,7 @@ static int sqlite3Fts5IndexInit(sqlite3 *db){ if( rc==SQLITE_OK ){ rc = sqlite3_create_function( - db, "fts5_decode_none", 2, + db, "fts5_decode_none", 2, SQLITE_UTF8, (void*)db, fts5DecodeFunction, 0, 0 ); } @@ -195216,9 +195211,9 @@ typedef struct Fts5Table Fts5Table; typedef struct Fts5TokenizerModule Fts5TokenizerModule; /* -** NOTES ON TRANSACTIONS: +** NOTES ON TRANSACTIONS: ** -** SQLite invokes the following virtual table methods as transactions are +** SQLite invokes the following virtual table methods as transactions are ** opened and closed by the user: ** ** xBegin(): Start of a new transaction. @@ -195227,7 +195222,7 @@ typedef struct Fts5TokenizerModule Fts5TokenizerModule; ** xRollback(): Rollback the transaction. ** ** Anything that is required as part of a commit that may fail is performed -** in the xSync() callback. Current versions of SQLite ignore any errors +** in the xSync() callback. Current versions of SQLite ignore any errors ** returned by xCommit(). ** ** And as sub-transactions are opened/closed: @@ -195236,9 +195231,9 @@ typedef struct Fts5TokenizerModule Fts5TokenizerModule; ** xRelease(int S): Commit and close savepoint S. ** xRollbackTo(int S): Rollback to start of savepoint S. ** -** During a write-transaction the fts5_index.c module may cache some data +** During a write-transaction the fts5_index.c module may cache some data ** in-memory. It is flushed to disk whenever xSync(), xRelease() or -** xSavepoint() is called. And discarded whenever xRollback() or xRollbackTo() +** xSavepoint() is called. And discarded whenever xRollback() or xRollbackTo() ** is called. ** ** Additionally, if SQLITE_DEBUG is defined, an instance of the following @@ -195252,13 +195247,13 @@ struct Fts5TransactionState { }; /* -** A single object of this type is allocated when the FTS5 module is +** A single object of this type is allocated when the FTS5 module is ** registered with a database handle. It is used to store pointers to ** all registered FTS5 extensions - tokenizers and auxiliary functions. */ struct Fts5Global { fts5_api api; /* User visible part of object (see fts5.h) */ - sqlite3 *db; /* Associated database connection */ + sqlite3 *db; /* Associated database connection */ i64 iNextId; /* Used to allocate unique cursor ids */ Fts5Auxiliary *pAux; /* First in list of all aux. functions */ Fts5TokenizerModule *pTok; /* First in list of all tokenizer modules */ @@ -195319,7 +195314,7 @@ struct Fts5MatchPhrase { ** ** aIdx[]: ** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last +** the value of which is the offset within aPoslist[] following the last ** byte of the position list for the corresponding phrase. */ struct Fts5Sorter { @@ -195335,8 +195330,8 @@ struct Fts5Sorter { ** Virtual-table cursor object. ** ** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. +** If this is a 'special' query (refer to function fts5SpecialMatch()), +** then this variable contains the result of the query. ** ** iFirstRowid, iLastRowid: ** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the @@ -195387,7 +195382,7 @@ struct Fts5Cursor { }; /* -** Bits that make up the "idxNum" parameter passed indirectly by +** Bits that make up the "idxNum" parameter passed indirectly by ** xBestIndex() to xFilter(). */ #define FTS5_BI_MATCH 0x0001 /* MATCH ? */ @@ -195466,7 +195461,7 @@ static void fts5CheckTransactionState(Fts5Table *p, int op, int iSavepoint){ assert( iSavepoint>p->ts.iSavepoint ); p->ts.iSavepoint = iSavepoint; break; - + case FTS5_RELEASE: assert( p->ts.eState==1 ); assert( iSavepoint>=0 ); @@ -195494,7 +195489,7 @@ static int fts5IsContentless(Fts5Table *pTab){ } /* -** Delete a virtual table handle allocated by fts5InitVtab(). +** Delete a virtual table handle allocated by fts5InitVtab(). */ static void fts5FreeVtab(Fts5Table *pTab){ if( pTab ){ @@ -195650,7 +195645,7 @@ static void fts5SetUniqueFlag(sqlite3_index_info *pIdxInfo){ } /* -** Implementation of the xBestIndex method for FTS5 tables. Within the +** Implementation of the xBestIndex method for FTS5 tables. Within the ** WHERE constraint, it searches for the following: ** ** 1. A MATCH constraint against the special column. @@ -195701,14 +195696,14 @@ static int fts5BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ int omit; /* True to omit this if found */ int iConsIndex; /* Index in pInfo->aConstraint[] */ } aConstraint[] = { - {SQLITE_INDEX_CONSTRAINT_MATCH|SQLITE_INDEX_CONSTRAINT_EQ, + {SQLITE_INDEX_CONSTRAINT_MATCH|SQLITE_INDEX_CONSTRAINT_EQ, FTS5_BI_MATCH, 1, 1, -1}, - {SQLITE_INDEX_CONSTRAINT_MATCH|SQLITE_INDEX_CONSTRAINT_EQ, + {SQLITE_INDEX_CONSTRAINT_MATCH|SQLITE_INDEX_CONSTRAINT_EQ, FTS5_BI_RANK, 2, 1, -1}, {SQLITE_INDEX_CONSTRAINT_EQ, FTS5_BI_ROWID_EQ, 0, 0, -1}, - {SQLITE_INDEX_CONSTRAINT_LT|SQLITE_INDEX_CONSTRAINT_LE, + {SQLITE_INDEX_CONSTRAINT_LT|SQLITE_INDEX_CONSTRAINT_LE, FTS5_BI_ROWID_LE, 0, 0, -1}, - {SQLITE_INDEX_CONSTRAINT_GT|SQLITE_INDEX_CONSTRAINT_GE, + {SQLITE_INDEX_CONSTRAINT_GT|SQLITE_INDEX_CONSTRAINT_GE, FTS5_BI_ROWID_GE, 0, 0, -1}, }; @@ -195728,7 +195723,7 @@ static int fts5BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ pC->iConsIndex = i; idxFlags |= pC->fts5op; }else if( j==0 ){ - /* As there exists an unusable MATCH constraint this is an + /* As there exists an unusable MATCH constraint this is an ** unusable plan. Set a prohibitively high cost. */ pInfo->estimatedCost = 1e50; return SQLITE_OK; @@ -195826,15 +195821,15 @@ static int fts5StmtType(Fts5Cursor *pCsr){ /* ** This function is called after the cursor passed as the only argument -** is moved to point at a different row. It clears all cached data +** is moved to point at a different row. It clears all cached data ** specific to the previous row stored by the cursor object. */ static void fts5CsrNewrow(Fts5Cursor *pCsr){ - CsrFlagSet(pCsr, - FTS5CSR_REQUIRE_CONTENT - | FTS5CSR_REQUIRE_DOCSIZE - | FTS5CSR_REQUIRE_INST - | FTS5CSR_REQUIRE_POSLIST + CsrFlagSet(pCsr, + FTS5CSR_REQUIRE_CONTENT + | FTS5CSR_REQUIRE_DOCSIZE + | FTS5CSR_REQUIRE_INST + | FTS5CSR_REQUIRE_POSLIST ); } @@ -195937,14 +195932,14 @@ static int fts5SorterNext(Fts5Cursor *pCsr){ /* -** Set the FTS5CSR_REQUIRE_RESEEK flag on all FTS5_PLAN_MATCH cursors +** Set the FTS5CSR_REQUIRE_RESEEK flag on all FTS5_PLAN_MATCH cursors ** open on table pTab. */ static void fts5TripCursors(Fts5Table *pTab){ Fts5Cursor *pCsr; for(pCsr=pTab->pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){ if( pCsr->ePlan==FTS5_PLAN_MATCH - && pCsr->base.pVtab==(sqlite3_vtab*)pTab + && pCsr->base.pVtab==(sqlite3_vtab*)pTab ){ CsrFlagSet(pCsr, FTS5CSR_REQUIRE_RESEEK); } @@ -195953,14 +195948,14 @@ static void fts5TripCursors(Fts5Table *pTab){ /* ** If the REQUIRE_RESEEK flag is set on the cursor passed as the first -** argument, close and reopen all Fts5IndexIter iterators that the cursor +** argument, close and reopen all Fts5IndexIter iterators that the cursor ** is using. Then attempt to move the cursor to a rowid equal to or laster -** (in the cursors sort order - ASC or DESC) than the current rowid. +** (in the cursors sort order - ASC or DESC) than the current rowid. ** ** If the new rowid is not equal to the old, set output parameter *pbSkip ** to 1 before returning. Otherwise, leave it unchanged. ** -** Return SQLITE_OK if successful or if no reseek was required, or an +** Return SQLITE_OK if successful or if no reseek was required, or an ** error code if an error occurred. */ static int fts5CursorReseek(Fts5Cursor *pCsr, int *pbSkip){ @@ -195988,7 +195983,7 @@ static int fts5CursorReseek(Fts5Cursor *pCsr, int *pbSkip){ /* -** Advance the cursor to the next row in the table that matches the +** Advance the cursor to the next row in the table that matches the ** search criteria. ** ** Return SQLITE_OK if nothing goes wrong. SQLITE_OK is returned @@ -196000,7 +195995,7 @@ static int fts5NextMethod(sqlite3_vtab_cursor *pCursor){ int rc; assert( (pCsr->ePlan<3)== - (pCsr->ePlan==FTS5_PLAN_MATCH || pCsr->ePlan==FTS5_PLAN_SOURCE) + (pCsr->ePlan==FTS5_PLAN_MATCH || pCsr->ePlan==FTS5_PLAN_SOURCE) ); assert( !CsrFlagTest(pCsr, FTS5CSR_EOF) ); @@ -196017,12 +196012,12 @@ static int fts5NextMethod(sqlite3_vtab_cursor *pCursor){ rc = SQLITE_OK; break; } - + case FTS5_PLAN_SORTED_MATCH: { rc = fts5SorterNext(pCsr); break; } - + default: rc = sqlite3_step(pCsr->pStmt); if( rc!=SQLITE_ROW ){ @@ -196034,14 +196029,14 @@ static int fts5NextMethod(sqlite3_vtab_cursor *pCursor){ break; } } - + return rc; } static int fts5PrepareStatement( sqlite3_stmt **ppStmt, - Fts5Config *pConfig, + Fts5Config *pConfig, const char *zFmt, ... ){ @@ -196053,7 +196048,7 @@ static int fts5PrepareStatement( va_start(ap, zFmt); zSql = sqlite3_vmprintf(zFmt, ap); if( zSql==0 ){ - rc = SQLITE_NOMEM; + rc = SQLITE_NOMEM; }else{ rc = sqlite3_prepare_v2(pConfig->db, zSql, -1, &pRet, 0); if( rc!=SQLITE_OK ){ @@ -196065,7 +196060,7 @@ static int fts5PrepareStatement( va_end(ap); *ppStmt = pRet; return rc; -} +} static int fts5CursorFirstSorted(Fts5Table *pTab, Fts5Cursor *pCsr, int bDesc){ Fts5Config *pConfig = pTab->pConfig; @@ -196075,7 +196070,7 @@ static int fts5CursorFirstSorted(Fts5Table *pTab, Fts5Cursor *pCsr, int bDesc){ int rc; const char *zRank = pCsr->zRank; const char *zRankArgs = pCsr->zRankArgs; - + nPhrase = sqlite3Fts5ExprPhraseCount(pCsr->pExpr); nByte = sizeof(Fts5Sorter) + sizeof(int) * (nPhrase-1); pSorter = (Fts5Sorter*)sqlite3_malloc(nByte); @@ -196086,7 +196081,7 @@ static int fts5CursorFirstSorted(Fts5Table *pTab, Fts5Cursor *pCsr, int bDesc){ /* TODO: It would be better to have some system for reusing statement ** handles here, rather than preparing a new one for each query. But that ** is not possible as SQLite reference counts the virtual table objects. - ** And since the statement required here reads from this very virtual + ** And since the statement required here reads from this very virtual ** table, saving it creates a circular reference. ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ @@ -196133,8 +196128,8 @@ static int fts5CursorFirst(Fts5Table *pTab, Fts5Cursor *pCsr, int bDesc){ ** parameters. */ static int fts5SpecialMatch( - Fts5Table *pTab, - Fts5Cursor *pCsr, + Fts5Table *pTab, + Fts5Cursor *pCsr, const char *zQuery ){ int rc = SQLITE_OK; /* Return code */ @@ -196231,7 +196226,7 @@ static int fts5FindRankFunction(Fts5Cursor *pCsr){ static int fts5CursorParseRank( Fts5Config *pConfig, - Fts5Cursor *pCsr, + Fts5Cursor *pCsr, sqlite3_value *pRank ){ int rc = SQLITE_OK; @@ -196280,7 +196275,7 @@ static i64 fts5GetRowidLimit(sqlite3_value *pVal, i64 iDefault){ ** This is the xFilter interface for the virtual table. See ** the virtual table xFilter method documentation for additional ** information. -** +** ** There are three possible query strategies: ** ** 1. Full-text search using a MATCH operator. @@ -196340,7 +196335,7 @@ static int fts5FilterMethod( bOrderByRank = ((idxNum & FTS5_BI_ORDER_RANK) ? 1 : 0); pCsr->bDesc = bDesc = ((idxNum & FTS5_BI_ORDER_DESC) ? 1 : 0); - /* Set the cursor upper and lower rowid limits. Only some strategies + /* Set the cursor upper and lower rowid limits. Only some strategies ** actually use them. This is ok, as the xBestIndex() method leaves the ** sqlite3_index_constraint.omit flag clear for range constraints ** on the rowid field. */ @@ -196356,11 +196351,11 @@ static int fts5FilterMethod( } if( pTab->pSortCsr ){ - /* If pSortCsr is non-NULL, then this call is being made as part of + /* If pSortCsr is non-NULL, then this call is being made as part of ** processing for a "... MATCH ORDER BY rank" query (ePlan is ** set to FTS5_PLAN_SORTED_MATCH). pSortCsr is the cursor that will - ** return results to the user for this query. The current cursor - ** (pCursor) is used to execute the query issued by function + ** return results to the user for this query. The current cursor + ** (pCursor) is used to execute the query issued by function ** fts5CursorFirstSorted() above. */ assert( pRowidEq==0 && pRowidLe==0 && pRowidGe==0 && pRank==0 ); assert( nVal==0 && pMatch==0 && bOrderByRank==0 && bDesc==0 ); @@ -196421,8 +196416,8 @@ static int fts5FilterMethod( return rc; } -/* -** This is the xEof method of the virtual table. SQLite calls this +/* +** This is the xEof method of the virtual table. SQLite calls this ** routine to find out if it has reached the end of a result set. */ static int fts5EofMethod(sqlite3_vtab_cursor *pCursor){ @@ -196434,9 +196429,9 @@ static int fts5EofMethod(sqlite3_vtab_cursor *pCursor){ ** Return the rowid that the cursor currently points to. */ static i64 fts5CursorRowid(Fts5Cursor *pCsr){ - assert( pCsr->ePlan==FTS5_PLAN_MATCH - || pCsr->ePlan==FTS5_PLAN_SORTED_MATCH - || pCsr->ePlan==FTS5_PLAN_SOURCE + assert( pCsr->ePlan==FTS5_PLAN_MATCH + || pCsr->ePlan==FTS5_PLAN_SORTED_MATCH + || pCsr->ePlan==FTS5_PLAN_SOURCE ); if( pCsr->pSorter ){ return pCsr->pSorter->iRowid; @@ -196445,7 +196440,7 @@ static i64 fts5CursorRowid(Fts5Cursor *pCsr){ } } -/* +/* ** This is the xRowid method. The SQLite core calls this routine to ** retrieve the rowid for the current row of the result set. fts5 ** exposes %_content.rowid as the rowid for the virtual table. The @@ -196454,7 +196449,7 @@ static i64 fts5CursorRowid(Fts5Cursor *pCsr){ static int fts5RowidMethod(sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid){ Fts5Cursor *pCsr = (Fts5Cursor*)pCursor; int ePlan = pCsr->ePlan; - + assert( CsrFlagTest(pCsr, FTS5CSR_EOF)==0 ); switch( ePlan ){ case FTS5_PLAN_SPECIAL: @@ -196485,7 +196480,7 @@ static int fts5RowidMethod(sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid){ static int fts5SeekCursor(Fts5Cursor *pCsr, int bErrormsg){ int rc = SQLITE_OK; - /* If the cursor does not yet have a statement handle, obtain one now. */ + /* If the cursor does not yet have a statement handle, obtain one now. */ if( pCsr->pStmt==0 ){ Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab); int eStmt = fts5StmtType(pCsr); @@ -196529,7 +196524,7 @@ static void fts5SetVtabError(Fts5Table *p, const char *zFormat, ...){ ** INSERT INTO fts(fts) VALUES($pCmd) ** INSERT INTO fts(fts, rank) VALUES($pCmd, $pVal) ** -** Argument pVal is the value assigned to column "fts" by the INSERT +** Argument pVal is the value assigned to column "fts" by the INSERT ** statement. This function returns SQLITE_OK if successful, or an SQLite ** error code if an error occurs. ** @@ -196548,7 +196543,7 @@ static int fts5SpecialInsert( if( 0==sqlite3_stricmp("delete-all", zCmd) ){ if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ - fts5SetVtabError(pTab, + fts5SetVtabError(pTab, "'delete-all' may only be used with a " "contentless or external content fts5 table" ); @@ -196558,7 +196553,7 @@ static int fts5SpecialInsert( } }else if( 0==sqlite3_stricmp("rebuild", zCmd) ){ if( pConfig->eContent==FTS5_CONTENT_NONE ){ - fts5SetVtabError(pTab, + fts5SetVtabError(pTab, "'rebuild' may not be used with a contentless fts5 table" ); rc = SQLITE_ERROR; @@ -196593,7 +196588,7 @@ static int fts5SpecialInsert( } static int fts5SpecialDelete( - Fts5Table *pTab, + Fts5Table *pTab, sqlite3_value **apVal ){ int rc = SQLITE_OK; @@ -196606,9 +196601,9 @@ static int fts5SpecialDelete( } static void fts5StorageInsert( - int *pRc, - Fts5Table *pTab, - sqlite3_value **apVal, + int *pRc, + Fts5Table *pTab, + sqlite3_value **apVal, i64 *piRowid ){ int rc = *pRc; @@ -196621,13 +196616,13 @@ static void fts5StorageInsert( *pRc = rc; } -/* -** This function is the implementation of the xUpdate callback used by +/* +** This function is the implementation of the xUpdate callback used by ** FTS3 virtual tables. It is invoked by SQLite each time a row is to be ** inserted, updated or deleted. ** ** A delete specifies a single argument - the rowid of the row to remove. -** +** ** Update and insert operations pass: ** ** 1. The "old" rowid, or NULL. @@ -196651,9 +196646,9 @@ static int fts5UpdateMethod( assert( pVtab->zErrMsg==0 ); assert( nArg==1 || nArg==(2+pConfig->nCol+2) ); - assert( nArg==1 - || sqlite3_value_type(apVal[1])==SQLITE_INTEGER - || sqlite3_value_type(apVal[1])==SQLITE_NULL + assert( nArg==1 + || sqlite3_value_type(apVal[1])==SQLITE_INTEGER + || sqlite3_value_type(apVal[1])==SQLITE_NULL ); assert( pTab->pConfig->pzErrmsg==0 ); pTab->pConfig->pzErrmsg = &pTab->base.zErrMsg; @@ -196662,13 +196657,13 @@ static int fts5UpdateMethod( fts5TripCursors(pTab); eType0 = sqlite3_value_type(apVal[0]); - if( eType0==SQLITE_NULL - && sqlite3_value_type(apVal[2+pConfig->nCol])!=SQLITE_NULL + if( eType0==SQLITE_NULL + && sqlite3_value_type(apVal[2+pConfig->nCol])!=SQLITE_NULL ){ /* A "special" INSERT op. These are handled separately. */ const char *z = (const char*)sqlite3_value_text(apVal[2+pConfig->nCol]); - if( pConfig->eContent!=FTS5_CONTENT_NORMAL - && 0==sqlite3_stricmp("delete", z) + if( pConfig->eContent!=FTS5_CONTENT_NORMAL + && 0==sqlite3_stricmp("delete", z) ){ rc = fts5SpecialDelete(pTab, apVal); }else{ @@ -196676,7 +196671,7 @@ static int fts5UpdateMethod( } }else{ /* A regular INSERT, UPDATE or DELETE statement. The trick here is that - ** any conflict on the rowid value must be detected before any + ** any conflict on the rowid value must be detected before any ** modifications are made to the database file. There are 4 cases: ** ** 1) DELETE @@ -196698,7 +196693,7 @@ static int fts5UpdateMethod( ** This is not suported. */ if( eType0==SQLITE_INTEGER && fts5IsContentless(pTab) ){ pTab->base.zErrMsg = sqlite3_mprintf( - "cannot %s contentless fts5 table: %s", + "cannot %s contentless fts5 table: %s", (nArg>1 ? "UPDATE" : "DELETE from"), pConfig->zName ); rc = SQLITE_ERROR; @@ -196711,10 +196706,10 @@ static int fts5UpdateMethod( } /* INSERT */ - else if( eType0!=SQLITE_INTEGER ){ + else if( eType0!=SQLITE_INTEGER ){ /* If this is a REPLACE, first remove the current entry (if any) */ - if( eConflict==SQLITE_REPLACE - && sqlite3_value_type(apVal[1])==SQLITE_INTEGER + if( eConflict==SQLITE_REPLACE + && sqlite3_value_type(apVal[1])==SQLITE_INTEGER ){ i64 iNew = sqlite3_value_int64(apVal[1]); /* Rowid to delete */ rc = sqlite3Fts5StorageDelete(pTab->pStorage, iNew, 0); @@ -196754,7 +196749,7 @@ static int fts5UpdateMethod( } /* -** Implementation of xSync() method. +** Implementation of xSync() method. */ static int fts5SyncMethod(sqlite3_vtab *pVtab){ int rc; @@ -196768,7 +196763,7 @@ static int fts5SyncMethod(sqlite3_vtab *pVtab){ } /* -** Implementation of xBegin() method. +** Implementation of xBegin() method. */ static int fts5BeginMethod(sqlite3_vtab *pVtab){ fts5CheckTransactionState((Fts5Table*)pVtab, FTS5_BEGIN, 0); @@ -196812,8 +196807,8 @@ static int fts5ApiColumnCount(Fts5Context *pCtx){ } static int fts5ApiColumnTotalSize( - Fts5Context *pCtx, - int iCol, + Fts5Context *pCtx, + int iCol, sqlite3_int64 *pnToken ){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; @@ -196828,8 +196823,8 @@ static int fts5ApiRowCount(Fts5Context *pCtx, i64 *pnRow){ } static int fts5ApiTokenize( - Fts5Context *pCtx, - const char *pText, int nText, + Fts5Context *pCtx, + const char *pText, int nText, void *pUserData, int (*xToken)(void*, int, const char*, int, int, int) ){ @@ -196851,9 +196846,9 @@ static int fts5ApiPhraseSize(Fts5Context *pCtx, int iPhrase){ } static int fts5ApiColumnText( - Fts5Context *pCtx, - int iCol, - const char **pz, + Fts5Context *pCtx, + int iCol, + const char **pz, int *pn ){ int rc = SQLITE_OK; @@ -196872,8 +196867,8 @@ static int fts5ApiColumnText( } static int fts5CsrPoslist( - Fts5Cursor *pCsr, - int iPhrase, + Fts5Cursor *pCsr, + int iPhrase, const u8 **pa, int *pn ){ @@ -196927,7 +196922,7 @@ static int fts5CacheInstArray(Fts5Cursor *pCsr){ int rc = SQLITE_OK; Fts5PoslistReader *aIter; /* One iterator for each phrase */ int nIter; /* Number of iterators/phrases */ - + nIter = sqlite3Fts5ExprPhraseCount(pCsr->pExpr); if( pCsr->aInstIter==0 ){ int nByte = sizeof(Fts5PoslistReader) * nIter; @@ -196942,7 +196937,7 @@ static int fts5CacheInstArray(Fts5Cursor *pCsr){ /* Initialize all iterators */ for(i=0; inInstCount; } @@ -197001,16 +196996,16 @@ static int fts5ApiInstCount(Fts5Context *pCtx, int *pnInst){ } static int fts5ApiInst( - Fts5Context *pCtx, - int iIdx, - int *piPhrase, - int *piCol, + Fts5Context *pCtx, + int iIdx, + int *piPhrase, + int *piCol, int *piOff ){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; int rc = SQLITE_OK; - if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_INST)==0 - || SQLITE_OK==(rc = fts5CacheInstArray(pCsr)) + if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_INST)==0 + || SQLITE_OK==(rc = fts5CacheInstArray(pCsr)) ){ if( iIdx<0 || iIdx>=pCsr->nInstCount ){ rc = SQLITE_RANGE; @@ -197159,8 +197154,8 @@ static void *fts5ApiGetAuxdata(Fts5Context *pCtx, int bClear){ } static void fts5ApiPhraseNext( - Fts5Context *pUnused, - Fts5PhraseIter *pIter, + Fts5Context *pUnused, + Fts5PhraseIter *pIter, int *piCol, int *piOff ){ UNUSED_PARAM(pUnused); @@ -197181,9 +197176,9 @@ static void fts5ApiPhraseNext( } static int fts5ApiPhraseFirst( - Fts5Context *pCtx, - int iPhrase, - Fts5PhraseIter *pIter, + Fts5Context *pCtx, + int iPhrase, + Fts5PhraseIter *pIter, int *piCol, int *piOff ){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; @@ -197199,8 +197194,8 @@ static int fts5ApiPhraseFirst( } static void fts5ApiPhraseNextColumn( - Fts5Context *pCtx, - Fts5PhraseIter *pIter, + Fts5Context *pCtx, + Fts5PhraseIter *pIter, int *piCol ){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; @@ -197229,9 +197224,9 @@ static void fts5ApiPhraseNextColumn( } static int fts5ApiPhraseFirstColumn( - Fts5Context *pCtx, - int iPhrase, - Fts5PhraseIter *pIter, + Fts5Context *pCtx, + int iPhrase, + Fts5PhraseIter *pIter, int *piCol ){ int rc = SQLITE_OK; @@ -197272,7 +197267,7 @@ static int fts5ApiPhraseFirstColumn( } -static int fts5ApiQueryPhrase(Fts5Context*, int, void*, +static int fts5ApiQueryPhrase(Fts5Context*, int, void*, int(*)(const Fts5ExtensionApi*, Fts5Context*, void*) ); @@ -197303,8 +197298,8 @@ static const Fts5ExtensionApi sFts5Api = { ** Implementation of API function xQueryPhrase(). */ static int fts5ApiQueryPhrase( - Fts5Context *pCtx, - int iPhrase, + Fts5Context *pCtx, + int iPhrase, void *pUserData, int(*xCallback)(const Fts5ExtensionApi*, Fts5Context*, void*) ){ @@ -197386,10 +197381,10 @@ static void fts5ApiCallback( /* -** Given cursor id iId, return a pointer to the corresponding Fts5Index +** Given cursor id iId, return a pointer to the corresponding Fts5Index ** object. Or NULL If the cursor id does not exist. ** -** If successful, set *ppConfig to point to the associated config object +** If successful, set *ppConfig to point to the associated config object ** before returning. */ static Fts5Index *sqlite3Fts5IndexFromCsrid( @@ -197475,7 +197470,7 @@ static int fts5PoslistBlob(sqlite3_context *pCtx, Fts5Cursor *pCsr){ return rc; } -/* +/* ** This is the xColumn method, called by SQLite to request a value from ** the row that the supplied cursor currently points to. */ @@ -197488,7 +197483,7 @@ static int fts5ColumnMethod( Fts5Config *pConfig = pTab->pConfig; Fts5Cursor *pCsr = (Fts5Cursor*)pCursor; int rc = SQLITE_OK; - + assert( CsrFlagTest(pCsr, FTS5CSR_EOF)==0 ); if( pCsr->ePlan==FTS5_PLAN_SPECIAL ){ @@ -197508,7 +197503,7 @@ static int fts5ColumnMethod( /* The value of the "rank" column. */ if( pCsr->ePlan==FTS5_PLAN_SOURCE ){ fts5PoslistBlob(pCtx, pCsr); - }else if( + }else if( pCsr->ePlan==FTS5_PLAN_MATCH || pCsr->ePlan==FTS5_PLAN_SORTED_MATCH ){ @@ -197641,7 +197636,7 @@ static int fts5CreateAux( } /* -** Register a new tokenizer. This is the implementation of the +** Register a new tokenizer. This is the implementation of the ** fts5_api.xCreateTokenizer() method. */ static int fts5CreateTokenizer( @@ -197680,7 +197675,7 @@ static int fts5CreateTokenizer( } static Fts5TokenizerModule *fts5LocateTokenizer( - Fts5Global *pGlobal, + Fts5Global *pGlobal, const char *zName ){ Fts5TokenizerModule *pMod = 0; @@ -197697,7 +197692,7 @@ static Fts5TokenizerModule *fts5LocateTokenizer( } /* -** Find a tokenizer. This is the implementation of the +** Find a tokenizer. This is the implementation of the ** fts5_api.xFindTokenizer() method. */ static int fts5FindTokenizer( @@ -197722,7 +197717,7 @@ static int fts5FindTokenizer( } static int sqlite3Fts5GetTokenizer( - Fts5Global *pGlobal, + Fts5Global *pGlobal, const char **azArg, int nArg, Fts5Tokenizer **ppTok, @@ -197877,7 +197872,7 @@ static int fts5Init(sqlite3 *db){ ** this module is being built as part of the SQLite core (SQLITE_CORE is ** defined), then sqlite3_open() will call sqlite3Fts5Init() directly. ** -** Or, if this module is being built as a loadable extension, +** Or, if this module is being built as a loadable extension, ** sqlite3Fts5Init() is omitted and the two standard entry points ** sqlite3_fts_init() and sqlite3_fts5_init() defined instead. */ @@ -197936,19 +197931,19 @@ struct Fts5Storage { Fts5Index *pIndex; int bTotalsValid; /* True if nTotalRow/aTotalSize[] are valid */ i64 nTotalRow; /* Total number of rows in FTS table */ - i64 *aTotalSize; /* Total sizes of each column */ + i64 *aTotalSize; /* Total sizes of each column */ sqlite3_stmt *aStmt[11]; }; -#if FTS5_STMT_SCAN_ASC!=0 -# error "FTS5_STMT_SCAN_ASC mismatch" +#if FTS5_STMT_SCAN_ASC!=0 +# error "FTS5_STMT_SCAN_ASC mismatch" #endif -#if FTS5_STMT_SCAN_DESC!=1 -# error "FTS5_STMT_SCAN_DESC mismatch" +#if FTS5_STMT_SCAN_DESC!=1 +# error "FTS5_STMT_SCAN_DESC mismatch" #endif #if FTS5_STMT_LOOKUP!=2 -# error "FTS5_STMT_LOOKUP mismatch" +# error "FTS5_STMT_LOOKUP mismatch" #endif #define FTS5_STMT_INSERT_CONTENT 3 @@ -197974,12 +197969,12 @@ static int fts5StorageGetStmt( ){ int rc = SQLITE_OK; - /* If there is no %_docsize table, there should be no requests for + /* If there is no %_docsize table, there should be no requests for ** statements to operate on it. */ assert( p->pConfig->bColumnsize || ( - eStmt!=FTS5_STMT_REPLACE_DOCSIZE - && eStmt!=FTS5_STMT_DELETE_DOCSIZE - && eStmt!=FTS5_STMT_LOOKUP_DOCSIZE + eStmt!=FTS5_STMT_REPLACE_DOCSIZE + && eStmt!=FTS5_STMT_DELETE_DOCSIZE + && eStmt!=FTS5_STMT_LOOKUP_DOCSIZE )); assert( eStmt>=0 && eStmtaStmt) ); @@ -198005,26 +198000,26 @@ static int fts5StorageGetStmt( switch( eStmt ){ case FTS5_STMT_SCAN: - zSql = sqlite3_mprintf(azStmt[eStmt], + zSql = sqlite3_mprintf(azStmt[eStmt], pC->zContentExprlist, pC->zContent ); break; case FTS5_STMT_SCAN_ASC: case FTS5_STMT_SCAN_DESC: - zSql = sqlite3_mprintf(azStmt[eStmt], pC->zContentExprlist, + zSql = sqlite3_mprintf(azStmt[eStmt], pC->zContentExprlist, pC->zContent, pC->zContentRowid, pC->zContentRowid, pC->zContentRowid ); break; case FTS5_STMT_LOOKUP: - zSql = sqlite3_mprintf(azStmt[eStmt], + zSql = sqlite3_mprintf(azStmt[eStmt], pC->zContentExprlist, pC->zContent, pC->zContentRowid ); break; - case FTS5_STMT_INSERT_CONTENT: + case FTS5_STMT_INSERT_CONTENT: case FTS5_STMT_REPLACE_CONTENT: { int nCol = pC->nCol + 1; char *zBind; @@ -198094,7 +198089,7 @@ static int fts5ExecPrintf( ** code otherwise. */ static int sqlite3Fts5DropAll(Fts5Config *pConfig){ - int rc = fts5ExecPrintf(pConfig->db, 0, + int rc = fts5ExecPrintf(pConfig->db, 0, "DROP TABLE IF EXISTS %Q.'%q_data';" "DROP TABLE IF EXISTS %Q.'%q_idx';" "DROP TABLE IF EXISTS %Q.'%q_config';", @@ -198103,13 +198098,13 @@ static int sqlite3Fts5DropAll(Fts5Config *pConfig){ pConfig->zDb, pConfig->zName ); if( rc==SQLITE_OK && pConfig->bColumnsize ){ - rc = fts5ExecPrintf(pConfig->db, 0, + rc = fts5ExecPrintf(pConfig->db, 0, "DROP TABLE IF EXISTS %Q.'%q_docsize';", pConfig->zDb, pConfig->zName ); } if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){ - rc = fts5ExecPrintf(pConfig->db, 0, + rc = fts5ExecPrintf(pConfig->db, 0, "DROP TABLE IF EXISTS %Q.'%q_content';", pConfig->zDb, pConfig->zName ); @@ -198124,7 +198119,7 @@ static void fts5StorageRenameOne( const char *zName /* New name of FTS5 table */ ){ if( *pRc==SQLITE_OK ){ - *pRc = fts5ExecPrintf(pConfig->db, 0, + *pRc = fts5ExecPrintf(pConfig->db, 0, "ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';", pConfig->zDb, pConfig->zName, zTail, zName, zTail ); @@ -198162,7 +198157,7 @@ static int sqlite3Fts5CreateTable( char *zErr = 0; rc = fts5ExecPrintf(pConfig->db, &zErr, "CREATE TABLE %Q.'%q_%q'(%s)%s", - pConfig->zDb, pConfig->zName, zPost, zDefn, + pConfig->zDb, pConfig->zName, zPost, zDefn, #ifndef SQLITE_FTS5_NO_WITHOUT_ROWID bWithout?" WITHOUT ROWID": #endif @@ -198170,7 +198165,7 @@ static int sqlite3Fts5CreateTable( ); if( zErr ){ *pzErr = sqlite3_mprintf( - "fts5: error creating shadow table %q_%s: %s", + "fts5: error creating shadow table %q_%s: %s", pConfig->zName, zPost, zErr ); sqlite3_free(zErr); @@ -198181,15 +198176,15 @@ static int sqlite3Fts5CreateTable( /* ** Open a new Fts5Index handle. If the bCreate argument is true, create -** and initialize the underlying tables +** and initialize the underlying tables ** ** If successful, set *pp to point to the new object and return SQLITE_OK. ** Otherwise, set *pp to NULL and return an SQLite error code. */ static int sqlite3Fts5StorageOpen( - Fts5Config *pConfig, - Fts5Index *pIndex, - int bCreate, + Fts5Config *pConfig, + Fts5Index *pIndex, + int bCreate, Fts5Storage **pp, char **pzErr /* OUT: Error message */ ){ @@ -198301,8 +198296,8 @@ static int fts5StorageInsertCallback( ** remove the %_content row at this time though. */ static int fts5StorageDeleteFromIndex( - Fts5Storage *p, - i64 iDel, + Fts5Storage *p, + i64 iDel, sqlite3_value **apVal ){ Fts5Config *pConfig = p->pConfig; @@ -198336,7 +198331,7 @@ static int fts5StorageDeleteFromIndex( nText = sqlite3_value_bytes(apVal[iCol-1]); } ctx.szCol = 0; - rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, + rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, zText, nText, (void*)&ctx, fts5StorageInsertCallback ); p->aTotalSize[iCol-1] -= (i64)ctx.szCol; @@ -198378,7 +198373,7 @@ static int fts5StorageInsertDocsize( } /* -** Load the contents of the "averages" record from disk into the +** Load the contents of the "averages" record from disk into the ** p->nTotalRow and p->aTotalSize[] variables. If successful, and if ** argument bCache is true, set the p->bTotalsValid flag to indicate ** that the contents of aTotalSize[] and nTotalRow are valid until @@ -198397,7 +198392,7 @@ static int fts5StorageLoadTotals(Fts5Storage *p, int bCache){ } /* -** Store the current contents of the p->nTotalRow and p->aTotalSize[] +** Store the current contents of the p->nTotalRow and p->aTotalSize[] ** variables in the "averages" record on disk. ** ** Return SQLITE_OK if successful, or an SQLite error code if an error @@ -198477,7 +198472,7 @@ static int sqlite3Fts5StorageDeleteAll(Fts5Storage *p){ /* Delete the contents of the %_data and %_docsize tables. */ rc = fts5ExecPrintf(pConfig->db, 0, - "DELETE FROM %Q.'%q_data';" + "DELETE FROM %Q.'%q_data';" "DELETE FROM %Q.'%q_idx';", pConfig->zDb, pConfig->zName, pConfig->zDb, pConfig->zName @@ -198526,7 +198521,7 @@ static int sqlite3Fts5StorageRebuild(Fts5Storage *p){ for(ctx.iCol=0; rc==SQLITE_OK && ctx.iColnCol; ctx.iCol++){ ctx.szCol = 0; if( pConfig->abUnindexed[ctx.iCol]==0 ){ - rc = sqlite3Fts5Tokenize(pConfig, + rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, (const char*)sqlite3_column_text(pScan, ctx.iCol+1), sqlite3_column_bytes(pScan, ctx.iCol+1), @@ -198595,8 +198590,8 @@ static int fts5StorageNewRowid(Fts5Storage *p, i64 *piRowid){ ** Insert a new row into the FTS content table. */ static int sqlite3Fts5StorageContentInsert( - Fts5Storage *p, - sqlite3_value **apVal, + Fts5Storage *p, + sqlite3_value **apVal, i64 *piRowid ){ Fts5Config *pConfig = p->pConfig; @@ -198630,8 +198625,8 @@ static int sqlite3Fts5StorageContentInsert( ** Insert new entries into the FTS index and %_docsize table. */ static int sqlite3Fts5StorageIndexInsert( - Fts5Storage *p, - sqlite3_value **apVal, + Fts5Storage *p, + sqlite3_value **apVal, i64 iRowid ){ Fts5Config *pConfig = p->pConfig; @@ -198649,7 +198644,7 @@ static int sqlite3Fts5StorageIndexInsert( for(ctx.iCol=0; rc==SQLITE_OK && ctx.iColnCol; ctx.iCol++){ ctx.szCol = 0; if( pConfig->abUnindexed[ctx.iCol]==0 ){ - rc = sqlite3Fts5Tokenize(pConfig, + rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, (const char*)sqlite3_value_text(apVal[ctx.iCol+2]), sqlite3_value_bytes(apVal[ctx.iCol+2]), @@ -198681,7 +198676,7 @@ static int fts5StorageCount(Fts5Storage *p, const char *zSuffix, i64 *pnRow){ char *zSql; int rc; - zSql = sqlite3_mprintf("SELECT count(*) FROM %Q.'%q_%s'", + zSql = sqlite3_mprintf("SELECT count(*) FROM %Q.'%q_%s'", pConfig->zDb, pConfig->zName, zSuffix ); if( zSql==0 ){ @@ -198826,7 +198821,7 @@ static int sqlite3Fts5StorageIntegrity(Fts5Storage *p){ rc = sqlite3Fts5TermsetNew(&ctx.pTermset); } if( rc==SQLITE_OK ){ - rc = sqlite3Fts5Tokenize(pConfig, + rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, (const char*)sqlite3_column_text(pScan, i+1), sqlite3_column_bytes(pScan, i+1), @@ -198890,13 +198885,13 @@ static int sqlite3Fts5StorageIntegrity(Fts5Storage *p){ ** %_content table. */ static int sqlite3Fts5StorageStmt( - Fts5Storage *p, - int eStmt, - sqlite3_stmt **pp, + Fts5Storage *p, + int eStmt, + sqlite3_stmt **pp, char **pzErrMsg ){ int rc; - assert( eStmt==FTS5_STMT_SCAN_ASC + assert( eStmt==FTS5_STMT_SCAN_ASC || eStmt==FTS5_STMT_SCAN_DESC || eStmt==FTS5_STMT_LOOKUP ); @@ -198914,8 +198909,8 @@ static int sqlite3Fts5StorageStmt( ** must match that passed to the sqlite3Fts5StorageStmt() call. */ static void sqlite3Fts5StorageStmtRelease( - Fts5Storage *p, - int eStmt, + Fts5Storage *p, + int eStmt, sqlite3_stmt *pStmt ){ assert( eStmt==FTS5_STMT_SCAN_ASC @@ -199021,7 +199016,7 @@ static int sqlite3Fts5StorageRollback(Fts5Storage *p){ } static int sqlite3Fts5StorageConfigValue( - Fts5Storage *p, + Fts5Storage *p, const char *z, sqlite3_value *pVal, int iVal @@ -199070,7 +199065,7 @@ static int sqlite3Fts5StorageConfigValue( /* ** For tokenizers with no "unicode" modifier, the set of token characters -** is the same as the set of ASCII range alphanumeric characters. +** is the same as the set of ASCII range alphanumeric characters. */ static unsigned char aAsciiTokenChar[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00..0x0F */ @@ -199089,8 +199084,8 @@ struct AsciiTokenizer { }; static void fts5AsciiAddExceptions( - AsciiTokenizer *p, - const char *zArg, + AsciiTokenizer *p, + const char *zArg, int bTokenChars ){ int i; @@ -199112,7 +199107,7 @@ static void fts5AsciiDelete(Fts5Tokenizer *p){ ** Create an "ascii" tokenizer. */ static int fts5AsciiCreate( - void *pUnused, + void *pUnused, const char **azArg, int nArg, Fts5Tokenizer **ppOut ){ @@ -199215,7 +199210,7 @@ static int fts5AsciiTokenize( rc = xToken(pCtx, 0, pFold, nByte, is, ie); is = ie+1; } - + if( pFold!=aFold ) sqlite3_free(pFold); if( rc==SQLITE_DONE ) rc = SQLITE_OK; return rc; @@ -199312,7 +199307,7 @@ static int fts5UnicodeAddExceptions( p->aTokenChar[iCode] = (unsigned char)bTokenChars; }else{ bToken = sqlite3Fts5UnicodeIsalnum(iCode); - assert( (bToken==0 || bToken==1) ); + assert( (bToken==0 || bToken==1) ); assert( (bTokenChars==0 || bTokenChars==1) ); if( bToken!=bTokenChars && sqlite3Fts5UnicodeIsdiacritic(iCode)==0 ){ int i; @@ -199376,12 +199371,12 @@ static void fts5UnicodeDelete(Fts5Tokenizer *pTok){ ** Create a "unicode61" tokenizer. */ static int fts5UnicodeCreate( - void *pUnused, + void *pUnused, const char **azArg, int nArg, Fts5Tokenizer **ppOut ){ int rc = SQLITE_OK; /* Return code */ - Unicode61Tokenizer *p = 0; /* New tokenizer object */ + Unicode61Tokenizer *p = 0; /* New tokenizer object */ UNUSED_PARAM(pUnused); @@ -199430,7 +199425,7 @@ static int fts5UnicodeCreate( /* ** Return true if, for the purposes of tokenizing with the tokenizer -** passed as the first argument, codepoint iCode is considered a token +** passed as the first argument, codepoint iCode is considered a token ** character (not a separator). */ static int fts5UnicodeIsAlnum(Unicode61Tokenizer *p, int iCode){ @@ -199520,7 +199515,7 @@ static int fts5UnicodeTokenize( } }else if( a[*zCsr]==0 ){ /* An ascii-range separator character. End of token. */ - break; + break; }else{ ascii_tokenchar: if( *zCsr>='A' && *zCsr<='Z' ){ @@ -199534,9 +199529,9 @@ static int fts5UnicodeTokenize( } /* Invoke the token callback */ - rc = xToken(pCtx, 0, aFold, zOut-aFold, is, ie); + rc = xToken(pCtx, 0, aFold, zOut-aFold, is, ie); } - + tokenize_done: if( rc==SQLITE_DONE ) rc = SQLITE_OK; return rc; @@ -199574,7 +199569,7 @@ static void fts5PorterDelete(Fts5Tokenizer *pTok){ ** Create a "porter" tokenizer. */ static int fts5PorterCreate( - void *pCtx, + void *pCtx, const char **azArg, int nArg, Fts5Tokenizer **ppOut ){ @@ -199718,7 +199713,7 @@ static int fts5Porter_Ostar(char *zStem, int nStem){ /* porter rule condition: (m > 1 and (*S or *T)) */ static int fts5Porter_MGt1_and_S_or_T(char *zStem, int nStem){ assert( nStem>0 ); - return (zStem[nStem-1]=='s' || zStem[nStem-1]=='t') + return (zStem[nStem-1]=='s' || zStem[nStem-1]=='t') && fts5Porter_MGt1(zStem, nStem); } @@ -199743,16 +199738,16 @@ static int fts5PorterStep4(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ - - case 'a': + + case 'a': if( nBuf>2 && 0==memcmp("al", &aBuf[nBuf-2], 2) ){ if( fts5Porter_MGt1(aBuf, nBuf-2) ){ *pnBuf = nBuf - 2; } } break; - - case 'c': + + case 'c': if( nBuf>4 && 0==memcmp("ance", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt1(aBuf, nBuf-4) ){ *pnBuf = nBuf - 4; @@ -199763,24 +199758,24 @@ static int fts5PorterStep4(char *aBuf, int *pnBuf){ } } break; - - case 'e': + + case 'e': if( nBuf>2 && 0==memcmp("er", &aBuf[nBuf-2], 2) ){ if( fts5Porter_MGt1(aBuf, nBuf-2) ){ *pnBuf = nBuf - 2; } } break; - - case 'i': + + case 'i': if( nBuf>2 && 0==memcmp("ic", &aBuf[nBuf-2], 2) ){ if( fts5Porter_MGt1(aBuf, nBuf-2) ){ *pnBuf = nBuf - 2; } } break; - - case 'l': + + case 'l': if( nBuf>4 && 0==memcmp("able", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt1(aBuf, nBuf-4) ){ *pnBuf = nBuf - 4; @@ -199791,8 +199786,8 @@ static int fts5PorterStep4(char *aBuf, int *pnBuf){ } } break; - - case 'n': + + case 'n': if( nBuf>3 && 0==memcmp("ant", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; @@ -199811,8 +199806,8 @@ static int fts5PorterStep4(char *aBuf, int *pnBuf){ } } break; - - case 'o': + + case 'o': if( nBuf>3 && 0==memcmp("ion", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1_and_S_or_T(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; @@ -199823,16 +199818,16 @@ static int fts5PorterStep4(char *aBuf, int *pnBuf){ } } break; - - case 's': + + case 's': if( nBuf>3 && 0==memcmp("ism", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; - - case 't': + + case 't': if( nBuf>3 && 0==memcmp("ate", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; @@ -199843,76 +199838,76 @@ static int fts5PorterStep4(char *aBuf, int *pnBuf){ } } break; - - case 'u': + + case 'u': if( nBuf>3 && 0==memcmp("ous", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; - - case 'v': + + case 'v': if( nBuf>3 && 0==memcmp("ive", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; - - case 'z': + + case 'z': if( nBuf>3 && 0==memcmp("ize", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; - + } return ret; } - + static int fts5PorterStep1B2(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ - - case 'a': + + case 'a': if( nBuf>2 && 0==memcmp("at", &aBuf[nBuf-2], 2) ){ memcpy(&aBuf[nBuf-2], "ate", 3); *pnBuf = nBuf - 2 + 3; ret = 1; } break; - - case 'b': + + case 'b': if( nBuf>2 && 0==memcmp("bl", &aBuf[nBuf-2], 2) ){ memcpy(&aBuf[nBuf-2], "ble", 3); *pnBuf = nBuf - 2 + 3; ret = 1; } break; - - case 'i': + + case 'i': if( nBuf>2 && 0==memcmp("iz", &aBuf[nBuf-2], 2) ){ memcpy(&aBuf[nBuf-2], "ize", 3); *pnBuf = nBuf - 2 + 3; ret = 1; } break; - + } return ret; } - + static int fts5PorterStep2(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ - - case 'a': + + case 'a': if( nBuf>7 && 0==memcmp("ational", &aBuf[nBuf-7], 7) ){ if( fts5Porter_MGt0(aBuf, nBuf-7) ){ memcpy(&aBuf[nBuf-7], "ate", 3); @@ -199925,8 +199920,8 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - - case 'c': + + case 'c': if( nBuf>4 && 0==memcmp("enci", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ memcpy(&aBuf[nBuf-4], "ence", 4); @@ -199939,8 +199934,8 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - - case 'e': + + case 'e': if( nBuf>4 && 0==memcmp("izer", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ memcpy(&aBuf[nBuf-4], "ize", 3); @@ -199948,8 +199943,8 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - - case 'g': + + case 'g': if( nBuf>4 && 0==memcmp("logi", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ memcpy(&aBuf[nBuf-4], "log", 3); @@ -199957,8 +199952,8 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - - case 'l': + + case 'l': if( nBuf>3 && 0==memcmp("bli", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt0(aBuf, nBuf-3) ){ memcpy(&aBuf[nBuf-3], "ble", 3); @@ -199986,8 +199981,8 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - - case 'o': + + case 'o': if( nBuf>7 && 0==memcmp("ization", &aBuf[nBuf-7], 7) ){ if( fts5Porter_MGt0(aBuf, nBuf-7) ){ memcpy(&aBuf[nBuf-7], "ize", 3); @@ -200005,8 +200000,8 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - - case 's': + + case 's': if( nBuf>5 && 0==memcmp("alism", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "al", 2); @@ -200029,8 +200024,8 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - - case 't': + + case 't': if( nBuf>5 && 0==memcmp("aliti", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "al", 2); @@ -200048,18 +200043,18 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - + } return ret; } - + static int fts5PorterStep3(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ - - case 'a': + + case 'a': if( nBuf>4 && 0==memcmp("ical", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ memcpy(&aBuf[nBuf-4], "ic", 2); @@ -200067,16 +200062,16 @@ static int fts5PorterStep3(char *aBuf, int *pnBuf){ } } break; - - case 's': + + case 's': if( nBuf>4 && 0==memcmp("ness", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ *pnBuf = nBuf - 4; } } break; - - case 't': + + case 't': if( nBuf>5 && 0==memcmp("icate", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "ic", 2); @@ -200089,24 +200084,24 @@ static int fts5PorterStep3(char *aBuf, int *pnBuf){ } } break; - - case 'u': + + case 'u': if( nBuf>3 && 0==memcmp("ful", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt0(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; - - case 'v': + + case 'v': if( nBuf>5 && 0==memcmp("ative", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ *pnBuf = nBuf - 5; } } break; - - case 'z': + + case 'z': if( nBuf>5 && 0==memcmp("alize", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "al", 2); @@ -200114,18 +200109,18 @@ static int fts5PorterStep3(char *aBuf, int *pnBuf){ } } break; - + } return ret; } - + static int fts5PorterStep1B(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ - - case 'e': + + case 'e': if( nBuf>3 && 0==memcmp("eed", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt0(aBuf, nBuf-3) ){ memcpy(&aBuf[nBuf-3], "ee", 2); @@ -200138,8 +200133,8 @@ static int fts5PorterStep1B(char *aBuf, int *pnBuf){ } } break; - - case 'n': + + case 'n': if( nBuf>3 && 0==memcmp("ing", &aBuf[nBuf-3], 3) ){ if( fts5Porter_Vowel(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; @@ -200147,12 +200142,12 @@ static int fts5PorterStep1B(char *aBuf, int *pnBuf){ } } break; - + } return ret; } - -/* + +/* ** GENERATED CODE ENDS HERE (mkportersteps.tcl) *************************************************************************** **************************************************************************/ @@ -200161,7 +200156,7 @@ static void fts5PorterStep1A(char *aBuf, int *pnBuf){ int nBuf = *pnBuf; if( aBuf[nBuf-1]=='s' ){ if( aBuf[nBuf-2]=='e' ){ - if( (nBuf>4 && aBuf[nBuf-4]=='s' && aBuf[nBuf-3]=='s') + if( (nBuf>4 && aBuf[nBuf-4]=='s' && aBuf[nBuf-3]=='s') || (nBuf>3 && aBuf[nBuf-3]=='i' ) ){ *pnBuf = nBuf-2; @@ -200176,11 +200171,11 @@ static void fts5PorterStep1A(char *aBuf, int *pnBuf){ } static int fts5PorterCb( - void *pCtx, + void *pCtx, int tflags, - const char *pToken, - int nToken, - int iStart, + const char *pToken, + int nToken, + int iStart, int iEnd ){ PorterContext *p = (PorterContext*)pCtx; @@ -200198,8 +200193,8 @@ static int fts5PorterCb( if( fts5PorterStep1B(aBuf, &nBuf) ){ if( fts5PorterStep1B2(aBuf, &nBuf)==0 ){ char c = aBuf[nBuf-1]; - if( fts5PorterIsVowel(c, 0)==0 - && c!='l' && c!='s' && c!='z' && c==aBuf[nBuf-2] + if( fts5PorterIsVowel(c, 0)==0 + && c!='l' && c!='s' && c!='z' && c==aBuf[nBuf-2] ){ nBuf--; }else if( fts5Porter_MEq1(aBuf, nBuf) && fts5Porter_Ostar(aBuf, nBuf) ){ @@ -200221,7 +200216,7 @@ static int fts5PorterCb( /* Step 5a. */ assert( nBuf>0 ); if( aBuf[nBuf-1]=='e' ){ - if( fts5Porter_MGt1(aBuf, nBuf-1) + if( fts5Porter_MGt1(aBuf, nBuf-1) || (fts5Porter_MEq1(aBuf, nBuf-1) && !fts5Porter_Ostar(aBuf, nBuf-1)) ){ nBuf--; @@ -200229,8 +200224,8 @@ static int fts5PorterCb( } /* Step 5b. */ - if( nBuf>1 && aBuf[nBuf-1]=='l' - && aBuf[nBuf-2]=='l' && fts5Porter_MGt1(aBuf, nBuf-1) + if( nBuf>1 && aBuf[nBuf-1]=='l' + && aBuf[nBuf-2]=='l' && fts5Porter_MGt1(aBuf, nBuf-1) ){ nBuf--; } @@ -200273,7 +200268,7 @@ static int sqlite3Fts5TokenizerInit(fts5_api *pApi){ { "ascii", {fts5AsciiCreate, fts5AsciiDelete, fts5AsciiTokenize }}, { "porter", {fts5PorterCreate, fts5PorterDelete, fts5PorterTokenize }}, }; - + int rc = SQLITE_OK; /* Return code */ int i; /* To iterate through builtin functions */ @@ -200323,11 +200318,11 @@ static int sqlite3Fts5UnicodeIsalnum(int c){ ** range of unicode codepoints that are not either letters or numbers (i.e. ** codepoints for which this function should return 0). ** - ** The most significant 22 bits in each 32-bit value contain the first + ** The most significant 22 bits in each 32-bit value contain the first ** codepoint in the range. The least significant 10 bits are used to store - ** the size of the range (always at least 1). In other words, the value - ** ((C<<22) + N) represents a range of N codepoints starting with codepoint - ** C. It is not possible to represent a range larger than 1023 codepoints + ** the size of the range (always at least 1). In other words, the value + ** ((C<<22) + N) represents a range of N codepoints starting with codepoint + ** C. It is not possible to represent a range larger than 1023 codepoints ** using this format. */ static const unsigned int aEntry[] = { @@ -200452,30 +200447,30 @@ static int sqlite3Fts5UnicodeIsalnum(int c){ */ static int fts5_remove_diacritic(int c){ unsigned short aDia[] = { - 0, 1797, 1848, 1859, 1891, 1928, 1940, 1995, - 2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286, - 2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732, - 2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336, - 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928, - 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234, - 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504, - 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529, - 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726, - 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122, - 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536, - 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730, - 62924, 63050, 63082, 63274, 63390, + 0, 1797, 1848, 1859, 1891, 1928, 1940, 1995, + 2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286, + 2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732, + 2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336, + 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928, + 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234, + 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504, + 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529, + 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726, + 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122, + 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536, + 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730, + 62924, 63050, 63082, 63274, 63390, }; char aChar[] = { - '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c', - 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r', - 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o', - 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r', - 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0', - '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h', - 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't', - 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a', - 'e', 'i', 'o', 'u', 'y', + '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c', + 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r', + 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o', + 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r', + 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h', + 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't', + 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a', + 'e', 'i', 'o', 'u', 'y', }; unsigned int key = (((unsigned int)c)<<3) | 0x00000007; @@ -200596,19 +200591,19 @@ static int sqlite3Fts5UnicodeFold(int c, int bRemoveDiacritic){ {42802, 1, 62}, {42873, 1, 4}, {42877, 76, 1}, {42878, 1, 10}, {42891, 0, 1}, {42893, 74, 1}, {42896, 1, 4}, {42912, 1, 10}, {42922, 72, 1}, - {65313, 14, 26}, + {65313, 14, 26}, }; static const unsigned short aiOff[] = { - 1, 2, 8, 15, 16, 26, 28, 32, - 37, 38, 40, 48, 63, 64, 69, 71, - 79, 80, 116, 202, 203, 205, 206, 207, - 209, 210, 211, 213, 214, 217, 218, 219, - 775, 7264, 10792, 10795, 23228, 23256, 30204, 54721, - 54753, 54754, 54756, 54787, 54793, 54809, 57153, 57274, - 57921, 58019, 58363, 61722, 65268, 65341, 65373, 65406, - 65408, 65410, 65415, 65424, 65436, 65439, 65450, 65462, - 65472, 65476, 65478, 65480, 65482, 65488, 65506, 65511, - 65514, 65521, 65527, 65528, 65529, + 1, 2, 8, 15, 16, 26, 28, 32, + 37, 38, 40, 48, 63, 64, 69, 71, + 79, 80, 116, 202, 203, 205, 206, 207, + 209, 210, 211, 213, 214, 217, 218, 219, + 775, 7264, 10792, 10795, 23228, 23256, 30204, 54721, + 54753, 54754, 54756, 54787, 54793, 54809, 57153, 57274, + 57921, 58019, 58363, 61722, 65268, 65341, 65373, 65406, + 65408, 65410, 65415, 65424, 65436, 65439, 65450, 65462, + 65472, 65476, 65478, 65480, 65482, 65488, 65506, 65511, + 65514, 65521, 65527, 65528, 65529, }; int ret = c; @@ -200644,7 +200639,7 @@ static int sqlite3Fts5UnicodeFold(int c, int bRemoveDiacritic){ if( bRemoveDiacritic ) ret = fts5_remove_diacritic(ret); } - + else if( c>=66560 && c<66600 ){ ret = c + 40; } @@ -200958,7 +200953,7 @@ static int FTS5_NOINLINE fts5PutVarint64(unsigned char *p, u64 v){ v >>= 7; } return 9; - } + } n = 0; do{ buf[n++] = (u8)((v & 0x7f) | 0x80); @@ -201011,7 +201006,7 @@ static int sqlite3Fts5GetVarintLen(u32 iVal){ ****************************************************************************** ** ** This is an SQLite virtual table module implementing direct access to an -** existing FTS5 index. The module may create several different types of +** existing FTS5 index. The module may create several different types of ** tables: ** ** col: @@ -201019,15 +201014,15 @@ static int sqlite3Fts5GetVarintLen(u32 iVal){ ** ** One row for each term/column combination. The value of $doc is set to ** the number of fts5 rows that contain at least one instance of term -** $term within column $col. Field $cnt is set to the total number of -** instances of term $term in column $col (in any row of the fts5 table). +** $term within column $col. Field $cnt is set to the total number of +** instances of term $term in column $col (in any row of the fts5 table). ** ** row: ** CREATE TABLE vocab(term, doc, cnt, PRIMARY KEY(term)); ** ** One row for each term in the database. The value of $doc is set to ** the number of fts5 rows that contain at least one instance of term -** $term. Field $cnt is set to the total number of instances of term +** $term. Field $cnt is set to the total number of instances of term ** $term in the database. */ @@ -201084,7 +201079,7 @@ struct Fts5VocabCursor { /* -** Translate a string containing an fts5vocab table type to an +** Translate a string containing an fts5vocab table type to an ** FTS5_VOCAB_XXX constant. If successful, set *peType to the output ** value and return SQLITE_OK. Otherwise, set *pzErr to an error message ** and return SQLITE_ERROR. @@ -201159,8 +201154,8 @@ static int fts5VocabInitVtab( sqlite3_vtab **ppVTab, /* Write the resulting vtab structure here */ char **pzErr /* Write any error message here */ ){ - const char *azSchema[] = { - "CREATE TABlE vocab(" FTS5_VOCAB_COL_SCHEMA ")", + const char *azSchema[] = { + "CREATE TABlE vocab(" FTS5_VOCAB_COL_SCHEMA ")", "CREATE TABlE vocab(" FTS5_VOCAB_ROW_SCHEMA ")" }; @@ -201178,10 +201173,10 @@ static int fts5VocabInitVtab( const char *zDb = bDb ? argv[3] : argv[1]; const char *zTab = bDb ? argv[4] : argv[3]; const char *zType = bDb ? argv[5] : argv[4]; - int nDb = (int)strlen(zDb)+1; + int nDb = (int)strlen(zDb)+1; int nTab = (int)strlen(zTab)+1; int eType = 0; - + rc = fts5VocabTableType(zType, pzErr, &eType); if( rc==SQLITE_OK ){ assert( eType>=0 && eTypenOrderBy==1 - && pInfo->aOrderBy[0].iColumn==0 + if( pInfo->nOrderBy==1 + && pInfo->aOrderBy[0].iColumn==0 && pInfo->aOrderBy[0].desc==0 ){ pInfo->orderByConsumed = 1; @@ -201299,7 +201294,7 @@ static int fts5VocabBestIndexMethod( ** Implementation of xOpen method. */ static int fts5VocabOpenMethod( - sqlite3_vtab *pVTab, + sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCsr ){ Fts5VocabTable *pTab = (Fts5VocabTable*)pVTab; @@ -201467,7 +201462,7 @@ static int fts5VocabNextMethod(sqlite3_vtab_cursor *pCursor){ } break; - default: + default: assert( pCsr->pConfig->eDetail==FTS5_DETAIL_NONE ); pCsr->aDoc[0]++; break; @@ -201556,8 +201551,8 @@ static int fts5VocabFilterMethod( return rc; } -/* -** This is the xEof method of the virtual table. SQLite calls this +/* +** This is the xEof method of the virtual table. SQLite calls this ** routine to find out if it has reached the end of a result set. */ static int fts5VocabEofMethod(sqlite3_vtab_cursor *pCursor){ @@ -201604,13 +201599,13 @@ static int fts5VocabColumnMethod( return SQLITE_OK; } -/* +/* ** This is the xRowid method. The SQLite core calls this routine to ** retrieve the rowid for the current row of the result set. The ** rowid should be written to *pRowid. */ static int fts5VocabRowidMethod( - sqlite3_vtab_cursor *pCursor, + sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid ){ Fts5VocabCursor *pCsr = (Fts5VocabCursor*)pCursor; @@ -201652,7 +201647,7 @@ static int sqlite3Fts5VocabInit(Fts5Global *pGlobal, sqlite3 *db){ - + #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) */ /************** End of fts5.c ************************************************/ diff --git a/third_party/sqlite/amalgamation/sqlite3.h b/third_party/sqlite/amalgamation/sqlite3.h index a476a98f528a2..dd5b89d80cc06 100644 --- a/third_party/sqlite/amalgamation/sqlite3.h +++ b/third_party/sqlite/amalgamation/sqlite3.h @@ -108,7 +108,7 @@ extern "C" { ** be held constant and Z will be incremented or else Y will be incremented ** and Z will be reset to zero. ** -** Since [version 3.6.18] ([dateof:3.6.18]), +** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the ** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to @@ -149,8 +149,8 @@ extern "C" { ** function is provided for use in DLLs since DLL users usually do not have ** direct access to string constants within the DLL. ^The ** sqlite3_libversion_number() function returns an integer equal to -** [SQLITE_VERSION_NUMBER]. ^The sqlite3_sourceid() function returns -** a pointer to a string constant whose value is the same as the +** [SQLITE_VERSION_NUMBER]. ^The sqlite3_sourceid() function returns +** a pointer to a string constant whose value is the same as the ** [SQLITE_SOURCE_ID] C preprocessor macro. ** ** See also: [sqlite_version()] and [sqlite_source_id()]. @@ -163,20 +163,20 @@ SQLITE_API int sqlite3_libversion_number(void); /* ** CAPI3REF: Run-Time Library Compilation Options Diagnostics ** -** ^The sqlite3_compileoption_used() function returns 0 or 1 -** indicating whether the specified option was defined at -** compile time. ^The SQLITE_ prefix may be omitted from the -** option name passed to sqlite3_compileoption_used(). +** ^The sqlite3_compileoption_used() function returns 0 or 1 +** indicating whether the specified option was defined at +** compile time. ^The SQLITE_ prefix may be omitted from the +** option name passed to sqlite3_compileoption_used(). ** ** ^The sqlite3_compileoption_get() function allows iterating ** over the list of options that were defined at compile time by ** returning the N-th compile time option string. ^If N is out of range, -** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_ -** prefix is omitted from any strings returned by +** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_ +** prefix is omitted from any strings returned by ** sqlite3_compileoption_get(). ** ** ^Support for the diagnostic functions sqlite3_compileoption_used() -** and sqlite3_compileoption_get() may be omitted by specifying the +** and sqlite3_compileoption_get() may be omitted by specifying the ** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time. ** ** See also: SQL functions [sqlite_compileoption_used()] and @@ -197,7 +197,7 @@ SQLITE_API const char *sqlite3_compileoption_get(int N); ** SQLite can be compiled with or without mutexes. When ** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes ** are enabled and SQLite is threadsafe. When the -** [SQLITE_THREADSAFE] macro is 0, +** [SQLITE_THREADSAFE] macro is 0, ** the mutexes are omitted. Without the mutexes, it is not safe ** to use SQLite concurrently from more than one thread. ** @@ -254,14 +254,14 @@ typedef struct sqlite3 sqlite3; ** ** ^The sqlite3_int64 and sqlite_int64 types can store integer values ** between -9223372036854775808 and +9223372036854775807 inclusive. ^The -** sqlite3_uint64 and sqlite_uint64 types can store integer values +** sqlite3_uint64 and sqlite_uint64 types can store integer values ** between 0 and +18446744073709551615 inclusive. */ #ifdef SQLITE_INT64_TYPE typedef SQLITE_INT64_TYPE sqlite_int64; # ifdef SQLITE_UINT64_TYPE typedef SQLITE_UINT64_TYPE sqlite_uint64; -# else +# else typedef unsigned SQLITE_INT64_TYPE sqlite_uint64; # endif #elif defined(_MSC_VER) || defined(__BORLANDC__) @@ -304,7 +304,7 @@ typedef sqlite_uint64 sqlite3_uint64; ** destructors are called is arbitrary. ** ** Applications should [sqlite3_finalize | finalize] all [prepared statements], -** [sqlite3_blob_close | close] all [BLOB handles], and +** [sqlite3_blob_close | close] all [BLOB handles], and ** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated ** with the [sqlite3] object prior to attempting to close the object. ^If ** sqlite3_close_v2() is called on a [database connection] that still has @@ -341,7 +341,7 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**); ** The sqlite3_exec() interface is a convenience wrapper around ** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()], ** that allows an application to run multiple statements of SQL -** without having to use a lot of C code. +** without having to use a lot of C code. ** ** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded, ** semicolon-separate SQL statements passed into its 2nd argument, @@ -381,7 +381,7 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**); ** from [sqlite3_column_name()]. ** ** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer -** to an empty string, or a pointer that contains only whitespace and/or +** to an empty string, or a pointer that contains only whitespace and/or ** SQL comments, then no SQL statements are evaluated and the database ** is not changed. ** @@ -642,7 +642,7 @@ SQLITE_API int sqlite3_exec( /* ** CAPI3REF: OS Interface Open File Handle ** -** An [sqlite3_file] object represents an open file in the +** An [sqlite3_file] object represents an open file in the ** [sqlite3_vfs | OS interface layer]. Individual OS interface ** implementations will ** want to subclass this object by appending additional fields @@ -664,7 +664,7 @@ struct sqlite3_file { ** This object defines the methods used to perform various operations ** against the open file represented by the [sqlite3_file] object. ** -** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element +** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element ** to a non-NULL pointer, then the sqlite3_io_methods.xClose method ** may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed. The ** only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen] @@ -804,7 +804,7 @@ struct sqlite3_io_methods { **
              • [[SQLITE_FCNTL_CHUNK_SIZE]] ** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS ** extends and truncates the database file in chunks of a size specified -** by the user. The fourth argument to [sqlite3_file_control()] should +** by the user. The fourth argument to [sqlite3_file_control()] should ** point to an integer (type int) containing the new chunk-size to use ** for the nominated database. Allocating database file space in large ** chunks (say 1MB at a time), may reduce file-system fragmentation and @@ -827,24 +827,24 @@ struct sqlite3_io_methods { **
              • [[SQLITE_FCNTL_SYNC]] ** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and ** sent to the VFS immediately before the xSync method is invoked on a -** database file descriptor. Or, if the xSync method is not invoked -** because the user has configured SQLite with -** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place +** database file descriptor. Or, if the xSync method is not invoked +** because the user has configured SQLite with +** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place ** of the xSync method. In most cases, the pointer argument passed with ** this file-control is NULL. However, if the database file is being synced ** as part of a multi-database commit, the argument points to a nul-terminated -** string containing the transactions master-journal file name. VFSes that -** do not need this signal should silently ignore this opcode. Applications -** should not call [sqlite3_file_control()] with this opcode as doing so may -** disrupt the operation of the specialized VFSes that do require it. +** string containing the transactions master-journal file name. VFSes that +** do not need this signal should silently ignore this opcode. Applications +** should not call [sqlite3_file_control()] with this opcode as doing so may +** disrupt the operation of the specialized VFSes that do require it. ** **
              • [[SQLITE_FCNTL_COMMIT_PHASETWO]] ** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite ** and sent to the VFS after a transaction has been committed immediately ** but before the database is unlocked. VFSes that do not need this signal ** should silently ignore this opcode. Applications should not call -** [sqlite3_file_control()] with this opcode as doing so may disrupt the -** operation of the specialized VFSes that do require it. +** [sqlite3_file_control()] with this opcode as doing so may disrupt the +** operation of the specialized VFSes that do require it. ** **
              • [[SQLITE_FCNTL_WIN32_AV_RETRY]] ** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic @@ -891,13 +891,13 @@ struct sqlite3_io_methods { **
              • [[SQLITE_FCNTL_OVERWRITE]] ** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening ** a write transaction to indicate that, unless it is rolled back for some -** reason, the entire database file will be overwritten by the current +** reason, the entire database file will be overwritten by the current ** transaction. This is used by VACUUM operations. ** **
              • [[SQLITE_FCNTL_VFSNAME]] ** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of ** all [VFSes] in the VFS stack. The names are of all VFS shims and the -** final bottom-level VFS are written into memory obtained from +** final bottom-level VFS are written into memory obtained from ** [sqlite3_malloc()] and the result is stored in the char* variable ** that the fourth parameter of [sqlite3_file_control()] points to. ** The caller is responsible for freeing the memory when done. As with @@ -916,7 +916,7 @@ struct sqlite3_io_methods { ** upper-most shim only. ** **
              • [[SQLITE_FCNTL_PRAGMA]] -** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] +** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] ** file control is sent to the open [sqlite3_file] object corresponding ** to the database file to which the pragma statement refers. ^The argument ** to the [SQLITE_FCNTL_PRAGMA] file control is an array of @@ -927,7 +927,7 @@ struct sqlite3_io_methods { ** of the char** argument point to a string obtained from [sqlite3_mprintf()] ** or the equivalent and that string will become the result of the pragma or ** the error message if the pragma fails. ^If the -** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal +** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal ** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] ** file control returns [SQLITE_OK], then the parser assumes that the ** VFS has handled the PRAGMA itself and the parser generates a no-op @@ -967,7 +967,7 @@ struct sqlite3_io_methods { ** The argument is a pointer to a value of type sqlite3_int64 that ** is an advisory maximum number of bytes in the file to memory map. The ** pointer is overwritten with the old value. The limit is not changed if -** the value originally pointed to is negative, and so the current limit +** the value originally pointed to is negative, and so the current limit ** can be queried by passing in a pointer to a negative number. This ** file-control is used internally to implement [PRAGMA mmap_size]. ** @@ -1011,7 +1011,7 @@ struct sqlite3_io_methods { **
              • [[SQLITE_FCNTL_RBU]] ** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by ** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for -** this opcode. +** this opcode. **
              */ #define SQLITE_FCNTL_LOCKSTATE 1 @@ -1120,14 +1120,14 @@ typedef struct sqlite3_api_routines sqlite3_api_routines; ** the [sqlite3_file] can safely store a pointer to the ** filename if it needs to remember the filename for some reason. ** If the zFilename parameter to xOpen is a NULL pointer then xOpen -** must invent its own temporary name for the file. ^Whenever the +** must invent its own temporary name for the file. ^Whenever the ** xFilename parameter is NULL it will also be the case that the ** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE]. ** ** The flags argument to xOpen() includes all bits set in ** the flags argument to [sqlite3_open_v2()]. Or if [sqlite3_open()] ** or [sqlite3_open16()] is used, then flags includes at least -** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. +** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. ** If xOpen() opens a file read-only then it sets *pOutFlags to ** include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be set. ** @@ -1169,10 +1169,10 @@ typedef struct sqlite3_api_routines sqlite3_api_routines; ** ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction ** with the [SQLITE_OPEN_CREATE] flag, which are both directly ** analogous to the O_EXCL and O_CREAT flags of the POSIX open() -** API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the +** API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the ** SQLITE_OPEN_CREATE, is used to indicate that file should always ** be created, and that it is an error if it already exists. -** It is not used to indicate the file should be opened +** It is not used to indicate the file should be opened ** for exclusive access. ** ** ^At least szOsFile bytes of memory are allocated by SQLite @@ -1210,16 +1210,16 @@ typedef struct sqlite3_api_routines sqlite3_api_routines; ** method returns a Julian Day Number for the current date and time as ** a floating point value. ** ^The xCurrentTimeInt64() method returns, as an integer, the Julian -** Day Number multiplied by 86400000 (the number of milliseconds in -** a 24-hour day). +** Day Number multiplied by 86400000 (the number of milliseconds in +** a 24-hour day). ** ^SQLite will use the xCurrentTimeInt64() method to get the current -** date and time if that method is available (if iVersion is 2 or +** date and time if that method is available (if iVersion is 2 or ** greater and the function pointer is not NULL) and will fall back ** to xCurrentTime() if xCurrentTimeInt64() is unavailable. ** ** ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces ** are not used by the SQLite core. These optional interfaces are provided -** by some VFSes to facilitate testing of the VFS code. By overriding +** by some VFSes to facilitate testing of the VFS code. By overriding ** system calls with functions under its control, a test program can ** simulate faults and error conditions that would otherwise be difficult ** or impossible to induce. The set of system calls that can be overridden @@ -1266,7 +1266,7 @@ struct sqlite3_vfs { /* ** The methods above are in versions 1 through 3 of the sqlite_vfs object. ** New fields may be appended in future versions. The iVersion - ** value will increment whenever this happens. + ** value will increment whenever this happens. */ }; @@ -1310,7 +1310,7 @@ struct sqlite3_vfs { ** ** ** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as -** was given on the corresponding lock. +** was given on the corresponding lock. ** ** The xShmLock method can transition between unlocked and SHARED or ** between unlocked and EXCLUSIVE. It cannot transition between SHARED @@ -1455,7 +1455,7 @@ SQLITE_API int sqlite3_config(int, ...); ** [database connection] (specified in the first argument). ** ** The second argument to sqlite3_db_config(D,V,...) is the -** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code +** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code ** that indicates what aspect of the [database connection] is being configured. ** Subsequent arguments vary depending on the configuration verb. ** @@ -1473,7 +1473,7 @@ SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...); ** This object is used in only one place in the SQLite interface. ** A pointer to an instance of this object is the argument to ** [sqlite3_config()] when the configuration option is -** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC]. +** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC]. ** By creating an instance of this object ** and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC]) ** during configuration, an application can specify an alternative @@ -1503,7 +1503,7 @@ SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...); ** allocators round up memory allocations at least to the next multiple ** of 8. Some allocators round up to a larger multiple or to a power of 2. ** Every memory allocation request coming in through [sqlite3_malloc()] -** or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0, +** or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0, ** that causes the corresponding memory allocation to fail. ** ** The xInit method initializes the memory allocator. For example, @@ -1561,7 +1561,7 @@ struct sqlite3_mem_methods { ** by a single thread. ^If SQLite is compiled with ** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then ** it is not possible to change the [threading mode] from its default -** value of Single-thread and so [sqlite3_config()] will return +** value of Single-thread and so [sqlite3_config()] will return ** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD ** configuration option. ** @@ -1596,7 +1596,7 @@ struct sqlite3_mem_methods { ** SQLITE_CONFIG_SERIALIZED configuration option. ** ** [[SQLITE_CONFIG_MALLOC]]
              SQLITE_CONFIG_MALLOC
              -**
              ^(The SQLITE_CONFIG_MALLOC option takes a single argument which is +**
              ^(The SQLITE_CONFIG_MALLOC option takes a single argument which is ** a pointer to an instance of the [sqlite3_mem_methods] structure. ** The argument specifies ** alternative low-level memory allocation routines to be used in place of @@ -1642,7 +1642,7 @@ struct sqlite3_mem_methods { ** ^SQLite will never request a scratch buffer that is more than 6 ** times the database page size. ** ^If SQLite needs needs additional -** scratch memory beyond what is provided by this configuration option, then +** scratch memory beyond what is provided by this configuration option, then ** [sqlite3_malloc()] will be used to obtain the memory needed.

              ** ^When the application provides any amount of scratch memory using ** SQLITE_CONFIG_SCRATCH, SQLite avoids unnecessary large @@ -1654,7 +1654,7 @@ struct sqlite3_mem_methods { ** [[SQLITE_CONFIG_PAGECACHE]]

              SQLITE_CONFIG_PAGECACHE
              **
              ^The SQLITE_CONFIG_PAGECACHE option specifies a memory pool ** that SQLite can use for the database page cache with the default page -** cache implementation. +** cache implementation. ** This configuration option is a no-op if an application-define page ** cache implementation is loaded using the [SQLITE_CONFIG_PCACHE2]. ** ^There are three arguments to SQLITE_CONFIG_PAGECACHE: A pointer to @@ -1682,7 +1682,7 @@ struct sqlite3_mem_methods { ** additional cache line.
              ** ** [[SQLITE_CONFIG_HEAP]]
              SQLITE_CONFIG_HEAP
              -**
              ^The SQLITE_CONFIG_HEAP option specifies a static memory buffer +**
              ^The SQLITE_CONFIG_HEAP option specifies a static memory buffer ** that SQLite will use for all of its dynamic memory allocation needs ** beyond those provided for by [SQLITE_CONFIG_SCRATCH] and ** [SQLITE_CONFIG_PAGECACHE]. @@ -1738,7 +1738,7 @@ struct sqlite3_mem_methods { ** configuration on individual connections.)^
              ** ** [[SQLITE_CONFIG_PCACHE2]]
              SQLITE_CONFIG_PCACHE2
              -**
              ^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is +**
              ^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is ** a pointer to an [sqlite3_pcache_methods2] object. This object specifies ** the interface to a custom page cache implementation.)^ ** ^SQLite makes a copy of the [sqlite3_pcache_methods2] object.
              @@ -1752,7 +1752,7 @@ struct sqlite3_mem_methods { **
              The SQLITE_CONFIG_LOG option is used to configure the SQLite ** global [error log]. ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a -** function with a call signature of void(*)(void*,int,const char*), +** function with a call signature of void(*)(void*,int,const char*), ** and a pointer to void. ^If the function pointer is not NULL, it is ** invoked by [sqlite3_log()] to process each logging event. ^If the ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op. @@ -1861,7 +1861,7 @@ struct sqlite3_mem_methods { ** [[SQLITE_CONFIG_STMTJRNL_SPILL]] **
              SQLITE_CONFIG_STMTJRNL_SPILL **
              ^The SQLITE_CONFIG_STMTJRNL_SPILL option takes a single parameter which -** becomes the [statement journal] spill-to-disk threshold. +** becomes the [statement journal] spill-to-disk threshold. ** [Statement journals] are held in memory until their size (in bytes) ** exceeds this threshold, at which point they are written to disk. ** Or if the threshold is -1, statement journals are always held @@ -1884,7 +1884,7 @@ struct sqlite3_mem_methods { #define SQLITE_CONFIG_MEMSTATUS 9 /* boolean */ #define SQLITE_CONFIG_MUTEX 10 /* sqlite3_mutex_methods* */ #define SQLITE_CONFIG_GETMUTEX 11 /* sqlite3_mutex_methods* */ -/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ +/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ #define SQLITE_CONFIG_LOOKASIDE 13 /* int int */ #define SQLITE_CONFIG_PCACHE 14 /* no-op */ #define SQLITE_CONFIG_GETPCACHE 15 /* no-op */ @@ -1915,7 +1915,7 @@ struct sqlite3_mem_methods { ** **
              **
              SQLITE_DBCONFIG_LOOKASIDE
              -**
              ^This option takes three additional arguments that determine the +**
              ^This option takes three additional arguments that determine the ** [lookaside memory allocator] configuration for the [database connection]. ** ^The first argument (the third parameter to [sqlite3_db_config()] is a ** pointer to a memory buffer to use for lookaside memory. @@ -1933,7 +1933,7 @@ struct sqlite3_mem_methods { ** when the "current value" returned by ** [sqlite3_db_status](D,[SQLITE_CONFIG_LOOKASIDE],...) is zero. ** Any attempt to change the lookaside memory configuration when lookaside -** memory is in use leaves the configuration unchanged and returns +** memory is in use leaves the configuration unchanged and returns ** [SQLITE_BUSY].)^
              ** **
              SQLITE_DBCONFIG_ENABLE_FKEY
              @@ -1996,9 +1996,9 @@ struct sqlite3_mem_methods { **
              ** **
              SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
              -**
              Usually, when a database in wal mode is closed or detached from a -** database handle, SQLite checks if this will mean that there are now no -** connections at all to the database. If so, it performs a checkpoint +**
              Usually, when a database in wal mode is closed or detached from a +** database handle, SQLite checks if this will mean that there are now no +** connections at all to the database. If so, it performs a checkpoint ** operation before closing the connection. This option may be used to ** override this behaviour. The first parameter passed to this operation ** is an integer - non-zero to disable checkpoints-on-close, or zero (the @@ -2040,18 +2040,18 @@ SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff); ** the table has a column of type [INTEGER PRIMARY KEY] then that column ** is another alias for the rowid. ** -** ^The sqlite3_last_insert_rowid(D) interface returns the [rowid] of the +** ^The sqlite3_last_insert_rowid(D) interface returns the [rowid] of the ** most recent successful [INSERT] into a rowid table or [virtual table] ** on database connection D. ** ^Inserts into [WITHOUT ROWID] tables are not recorded. ** ^If no successful [INSERT]s into rowid tables -** have ever occurred on the database connection D, +** have ever occurred on the database connection D, ** then sqlite3_last_insert_rowid(D) returns zero. ** ** ^(If an [INSERT] occurs within a trigger or within a [virtual table] ** method, then this routine will return the [rowid] of the inserted ** row as long as the trigger or virtual table method is running. -** But once the trigger or virtual table method ends, the value returned +** But once the trigger or virtual table method ends, the value returned ** by this routine reverts to what it was before the trigger or virtual ** table method began.)^ ** @@ -2091,37 +2091,37 @@ SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); ** returned by this function. ** ** ^Only changes made directly by the INSERT, UPDATE or DELETE statement are -** considered - auxiliary changes caused by [CREATE TRIGGER | triggers], +** considered - auxiliary changes caused by [CREATE TRIGGER | triggers], ** [foreign key actions] or [REPLACE] constraint resolution are not counted. -** -** Changes to a view that are intercepted by -** [INSTEAD OF trigger | INSTEAD OF triggers] are not counted. ^The value -** returned by sqlite3_changes() immediately after an INSERT, UPDATE or -** DELETE statement run on a view is always zero. Only changes made to real +** +** Changes to a view that are intercepted by +** [INSTEAD OF trigger | INSTEAD OF triggers] are not counted. ^The value +** returned by sqlite3_changes() immediately after an INSERT, UPDATE or +** DELETE statement run on a view is always zero. Only changes made to real ** tables are counted. ** ** Things are more complicated if the sqlite3_changes() function is ** executed while a trigger program is running. This may happen if the ** program uses the [changes() SQL function], or if some other callback ** function invokes sqlite3_changes() directly. Essentially: -** +** **
                **
              • ^(Before entering a trigger program the value returned by -** sqlite3_changes() function is saved. After the trigger program +** sqlite3_changes() function is saved. After the trigger program ** has finished, the original value is restored.)^ -** -**
              • ^(Within a trigger program each INSERT, UPDATE and DELETE -** statement sets the value returned by sqlite3_changes() -** upon completion as normal. Of course, this value will not include -** any changes performed by sub-triggers, as the sqlite3_changes() +** +**
              • ^(Within a trigger program each INSERT, UPDATE and DELETE +** statement sets the value returned by sqlite3_changes() +** upon completion as normal. Of course, this value will not include +** any changes performed by sub-triggers, as the sqlite3_changes() ** value will be saved and restored after each sub-trigger has run.)^ **
              -** +** ** ^This means that if the changes() SQL function (or similar) is used -** by the first INSERT, UPDATE or DELETE statement within a trigger, it +** by the first INSERT, UPDATE or DELETE statement within a trigger, it ** returns the value as set when the calling statement began executing. -** ^If it is used by the second or subsequent such statement within a trigger -** program, the value returned reflects the number of rows modified by the +** ^If it is used by the second or subsequent such statement within a trigger +** program, the value returned reflects the number of rows modified by the ** previous INSERT, UPDATE or DELETE statement within the same trigger. ** ** See also the [sqlite3_total_changes()] interface, the @@ -2142,12 +2142,12 @@ SQLITE_API int sqlite3_changes(sqlite3*); ** since the database connection was opened, including those executed as ** part of trigger programs. ^Executing any other type of SQL statement ** does not affect the value returned by sqlite3_total_changes(). -** +** ** ^Changes made as part of [foreign key actions] are included in the ** count, but those made as part of REPLACE constraint resolution are -** not. ^Changes to a view that are intercepted by INSTEAD OF triggers +** not. ^Changes to a view that are intercepted by INSTEAD OF triggers ** are not counted. -** +** ** See also the [sqlite3_changes()] interface, the ** [count_changes pragma], and the [total_changes() SQL function]. ** @@ -2183,7 +2183,7 @@ SQLITE_API int sqlite3_total_changes(sqlite3*); ** ** ^The sqlite3_interrupt(D) call is in effect until all currently running ** SQL statements on [database connection] D complete. ^Any new SQL statements -** that are started after the sqlite3_interrupt() call and before the +** that are started after the sqlite3_interrupt() call and before the ** running statements reaches zero are interrupted as if they had been ** running prior to the sqlite3_interrupt() call. ^New SQL statements ** that are started after the running statement count reaches zero are @@ -2218,7 +2218,7 @@ SQLITE_API void sqlite3_interrupt(sqlite3*); ** ^These routines do not parse the SQL statements thus ** will not detect syntactically incorrect SQL. ** -** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior +** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior ** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked ** automatically by sqlite3_complete16(). If that initialization fails, ** then the return value from sqlite3_complete16() will be non-zero @@ -2263,7 +2263,7 @@ SQLITE_API int sqlite3_complete16(const void *sql); ** The presence of a busy handler does not guarantee that it will be invoked ** when there is lock contention. ^If SQLite determines that invoking the busy ** handler could result in a deadlock, it will go ahead and return [SQLITE_BUSY] -** to the application instead of invoking the +** to the application instead of invoking the ** busy handler. ** Consider a scenario where one process is holding a read lock that ** it is trying to promote to a reserved lock and @@ -2288,7 +2288,7 @@ SQLITE_API int sqlite3_complete16(const void *sql); ** database connection that invoked the busy handler. In other words, ** the busy handler is not reentrant. Any such actions ** result in undefined behavior. -** +** ** A busy handler must not close the database connection ** or [prepared statement] that invoked the busy handler. */ @@ -2677,7 +2677,7 @@ SQLITE_API void sqlite3_randomness(int N, void *P); ** requested is ok. ^When the callback returns [SQLITE_DENY], the ** [sqlite3_prepare_v2()] or equivalent call that triggered the ** authorizer will fail with an error message explaining that -** access is denied. +** access is denied. ** ** ^The first parameter to the authorizer callback is a copy of the third ** parameter to the sqlite3_set_authorizer() interface. ^The second parameter @@ -2724,7 +2724,7 @@ SQLITE_API void sqlite3_randomness(int N, void *P); ** database connections for the meaning of "modify" in this paragraph. ** ** ^When [sqlite3_prepare_v2()] is used to prepare a statement, the -** statement might be re-prepared during [sqlite3_step()] due to a +** statement might be re-prepared during [sqlite3_step()] due to a ** schema change. Hence, the application should ensure that the ** correct authorizer callback remains in place during the [sqlite3_step()]. ** @@ -2872,7 +2872,7 @@ SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, ** execution of the prepared statement, such as at the start of each ** trigger subprogram. ^The P argument is a pointer to the ** [prepared statement]. ^The X argument is a pointer to a string which -** is the unexpanded SQL text of the prepared statement or an SQL comment +** is the unexpanded SQL text of the prepared statement or an SQL comment ** that indicates the invocation of a trigger. ^The callback can compute ** the same text that would have been returned by the legacy [sqlite3_trace()] ** interface by using the X argument when X begins with "--" and invoking @@ -2888,7 +2888,7 @@ SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, ** ** [[SQLITE_TRACE_ROW]]
              SQLITE_TRACE_ROW
              **
              ^An SQLITE_TRACE_ROW callback is invoked whenever a prepared -** statement generates a single row of result. +** statement generates a single row of result. ** ^The P argument is a pointer to the [prepared statement] and the ** X argument is unused. ** @@ -2915,10 +2915,10 @@ SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, ** M argument should be the bitwise OR-ed combination of ** zero or more [SQLITE_TRACE] constants. ** -** ^Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides +** ^Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides ** (cancels) any prior calls to sqlite3_trace() or sqlite3_trace_v2(). ** -** ^The X callback is invoked whenever any of the events identified by +** ^The X callback is invoked whenever any of the events identified by ** mask M occur. ^The integer return value from the callback is currently ** ignored, though this may change in future releases. Callback ** implementations should return zero to ensure future compatibility. @@ -2950,8 +2950,8 @@ SQLITE_API int sqlite3_trace_v2( ** database connection D. An example use for this ** interface is to keep a GUI updated during a large query. ** -** ^The parameter P is passed through as the only parameter to the -** callback function X. ^The parameter N is the approximate number of +** ^The parameter P is passed through as the only parameter to the +** callback function X. ^The parameter N is the approximate number of ** [virtual machine instructions] that are evaluated between successive ** invocations of the callback X. ^If N is less than one then the progress ** handler is disabled. @@ -2978,7 +2978,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** CAPI3REF: Opening A New Database Connection ** CONSTRUCTOR: sqlite3 ** -** ^These routines open an SQLite database file as specified by the +** ^These routines open an SQLite database file as specified by the ** filename argument. ^The filename argument is interpreted as UTF-8 for ** sqlite3_open() and sqlite3_open_v2() and as UTF-16 in the native byte ** order for sqlite3_open16(). ^(A [database connection] handle is usually @@ -3003,7 +3003,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** except that it accepts two additional parameters for additional control ** over the new database connection. ^(The flags parameter to ** sqlite3_open_v2() can take one of -** the following three values, optionally combined with the +** the following three values, optionally combined with the ** [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], [SQLITE_OPEN_SHAREDCACHE], ** [SQLITE_OPEN_PRIVATECACHE], and/or [SQLITE_OPEN_URI] flags:)^ ** @@ -3071,17 +3071,17 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** information. ** ** URI filenames are parsed according to RFC 3986. ^If the URI contains an -** authority, then it must be either an empty string or the string -** "localhost". ^If the authority is not an empty string or "localhost", an -** error is returned to the caller. ^The fragment component of a URI, if +** authority, then it must be either an empty string or the string +** "localhost". ^If the authority is not an empty string or "localhost", an +** error is returned to the caller. ^The fragment component of a URI, if ** present, is ignored. ** ** ^SQLite uses the path component of the URI as the name of the disk file -** which contains the database. ^If the path begins with a '/' character, -** then it is interpreted as an absolute path. ^If the path does not begin +** which contains the database. ^If the path begins with a '/' character, +** then it is interpreted as an absolute path. ^If the path does not begin ** with a '/' (meaning that the authority section is omitted from the URI) -** then the path is interpreted as a relative path. -** ^(On windows, the first component of an absolute path +** then the path is interpreted as a relative path. +** ^(On windows, the first component of an absolute path ** is a drive specification (e.g. "C:").)^ ** ** [[core URI query parameters]] @@ -3101,13 +3101,13 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** **
            2. mode: ^(The mode parameter may be set to either "ro", "rw", ** "rwc", or "memory". Attempting to set it to any other value is -** an error)^. -** ^If "ro" is specified, then the database is opened for read-only -** access, just as if the [SQLITE_OPEN_READONLY] flag had been set in the -** third argument to sqlite3_open_v2(). ^If the mode option is set to -** "rw", then the database is opened for read-write (but not create) -** access, as if SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had -** been set. ^Value "rwc" is equivalent to setting both +** an error)^. +** ^If "ro" is specified, then the database is opened for read-only +** access, just as if the [SQLITE_OPEN_READONLY] flag had been set in the +** third argument to sqlite3_open_v2(). ^If the mode option is set to +** "rw", then the database is opened for read-write (but not create) +** access, as if SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had +** been set. ^Value "rwc" is equivalent to setting both ** SQLITE_OPEN_READWRITE and SQLITE_OPEN_CREATE. ^If the mode option is ** set to "memory" then a pure [in-memory database] that never reads ** or writes from disk is used. ^It is an error to specify a value for @@ -3117,7 +3117,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); **
            3. cache: ^The cache parameter may be set to either "shared" or ** "private". ^Setting it to "shared" is equivalent to setting the ** SQLITE_OPEN_SHAREDCACHE bit in the flags argument passed to -** sqlite3_open_v2(). ^Setting the cache parameter to "private" is +** sqlite3_open_v2(). ^Setting the cache parameter to "private" is ** equivalent to setting the SQLITE_OPEN_PRIVATECACHE bit. ** ^If sqlite3_open_v2() is used and the "cache" parameter is present in ** a URI filename, its value overrides any behavior requested by setting @@ -3143,7 +3143,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** property on a database file that does in fact change can result ** in incorrect query results and/or [SQLITE_CORRUPT] errors. ** See also: [SQLITE_IOCAP_IMMUTABLE]. -** +** ** ** ** ^Specifying an unknown parameter in the query component of a URI is not an @@ -3155,36 +3155,36 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** **
          • **
            URI filenames Results -**
            file:data.db +**
            file:data.db ** Open the file "data.db" in the current directory. **
            file:/home/fred/data.db
            -** file:///home/fred/data.db
            -** file://localhost/home/fred/data.db
            +** file:///home/fred/data.db
            +** file://localhost/home/fred/data.db
            ** Open the database file "/home/fred/data.db". -**
            file://darkstar/home/fred/data.db +**
            file://darkstar/home/fred/data.db ** An error. "darkstar" is not a recognized authority. -**
            +**
            ** file:///C:/Documents%20and%20Settings/fred/Desktop/data.db ** Windows only: Open the file "data.db" on fred's desktop on drive -** C:. Note that the %20 escaping in this example is not strictly +** C:. Note that the %20 escaping in this example is not strictly ** necessary - space characters can be used literally ** in URI filenames. -**
            file:data.db?mode=ro&cache=private +**
            file:data.db?mode=ro&cache=private ** Open file "data.db" in the current directory for read-only access. ** Regardless of whether or not shared-cache mode is enabled by ** default, use a private cache. **
            file:/home/fred/data.db?vfs=unix-dotfile ** Open file "/home/fred/data.db". Use the special VFS "unix-dotfile" ** that uses dot-files in place of posix advisory locking. -**
            file:data.db?mode=readonly +**
            file:data.db?mode=readonly ** An error. "readonly" is not a valid option for the "mode" parameter. **
            ** ** ^URI hexadecimal escape sequences (%HH) are supported within the path and ** query components of a URI. A hexadecimal escape sequence consists of a -** percent sign - "%" - followed by exactly two hexadecimal digits +** percent sign - "%" - followed by exactly two hexadecimal digits ** specifying an octet value. ^Before the path or query components of a -** URI filename are interpreted, they are encoded using UTF-8 and all +** URI filename are interpreted, they are encoded using UTF-8 and all ** hexadecimal escape sequences replaced by a single byte containing the ** corresponding octet. If this process generates an invalid UTF-8 encoding, ** the results are undefined. @@ -3220,15 +3220,15 @@ SQLITE_API int sqlite3_open_v2( ** CAPI3REF: Obtain Values For URI Parameters ** ** These are utility routines, useful to VFS implementations, that check -** to see if a database file was a URI that contained a specific query +** to see if a database file was a URI that contained a specific query ** parameter, and if so obtains the value of that query parameter. ** -** If F is the database filename pointer passed into the xOpen() method of -** a VFS implementation when the flags parameter to xOpen() has one or +** If F is the database filename pointer passed into the xOpen() method of +** a VFS implementation when the flags parameter to xOpen() has one or ** more of the [SQLITE_OPEN_URI] or [SQLITE_OPEN_MAIN_DB] bits set and ** P is the name of the query parameter, then ** sqlite3_uri_parameter(F,P) returns the value of the P -** parameter if it exists or a NULL pointer if P does not appear as a +** parameter if it exists or a NULL pointer if P does not appear as a ** query parameter on F. If P is a query parameter of F ** has no explicit value, then sqlite3_uri_parameter(F,P) returns ** a pointer to an empty string. @@ -3237,7 +3237,7 @@ SQLITE_API int sqlite3_open_v2( ** parameter and returns true (1) or false (0) according to the value ** of P. The sqlite3_uri_boolean(F,P,B) routine returns true (1) if the ** value of query parameter P is one of "yes", "true", or "on" in any -** case or if the value begins with a non-zero number. The +** case or if the value begins with a non-zero number. The ** sqlite3_uri_boolean(F,P,B) routines returns false (0) if the value of ** query parameter P is one of "no", "false", or "off" in any case or ** if the value begins with a numeric zero. If P is not a query @@ -3248,7 +3248,7 @@ SQLITE_API int sqlite3_open_v2( ** 64-bit signed integer and returns that integer, or D if P does not ** exist. If the value of P is something other than an integer, then ** zero is returned. -** +** ** If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and ** is not a database file pathname pointer that SQLite passed into the xOpen @@ -3264,14 +3264,14 @@ SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int ** CAPI3REF: Error Codes And Messages ** METHOD: sqlite3 ** -** ^If the most recent sqlite3_* API call associated with +** ^If the most recent sqlite3_* API call associated with ** [database connection] D failed, then the sqlite3_errcode(D) interface ** returns the numeric [result code] or [extended result code] for that ** API call. ** If the most recent API call was successful, ** then the return value from sqlite3_errcode() is undefined. ** ^The sqlite3_extended_errcode() -** interface is the same except that it always returns the +** interface is the same except that it always returns the ** [extended result code] even when extended result codes are ** disabled. ** @@ -3315,7 +3315,7 @@ SQLITE_API const char *sqlite3_errstr(int); ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The -** original SQL text is source code. A prepared statement object +** original SQL text is source code. A prepared statement object ** is the compiled object code. All SQL must be converted into a ** prepared statement before it can be run. ** @@ -3345,7 +3345,7 @@ typedef struct sqlite3_stmt sqlite3_stmt; ** new limit for that construct.)^ ** ** ^If the new limit is a negative number, the limit is unchanged. -** ^(For each limit category SQLITE_LIMIT_NAME there is a +** ^(For each limit category SQLITE_LIMIT_NAME there is a ** [limits | hard upper bound] ** set at compile-time by a C preprocessor macro called ** [limits | SQLITE_MAX_NAME]. @@ -3353,7 +3353,7 @@ typedef struct sqlite3_stmt sqlite3_stmt; ** ^Attempts to increase a limit above its hard upper bound are ** silently truncated to the hard upper bound. ** -** ^Regardless of whether or not the limit was changed, the +** ^Regardless of whether or not the limit was changed, the ** [sqlite3_limit()] interface returns the prior value of the limit. ** ^Hence, to find the current value of a limit without changing it, ** simply invoke this interface with the third parameter set to -1. @@ -3513,12 +3513,12 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); ** ** **
          • -** ^If the specific value bound to [parameter | host parameter] in the +** ^If the specific value bound to [parameter | host parameter] in the ** WHERE clause might influence the choice of query plan for a statement, -** then the statement will be automatically recompiled, as if there had been +** then the statement will be automatically recompiled, as if there had been ** a schema change, on the first [sqlite3_step()] call following any change -** to the [sqlite3_bind_text | bindings] of that [parameter]. -** ^The specific value of WHERE-clause [parameter] might influence the +** to the [sqlite3_bind_text | bindings] of that [parameter]. +** ^The specific value of WHERE-clause [parameter] might influence the ** choice of query plan if the parameter is the left-hand side of a [LIKE] ** or [GLOB] operator or if the parameter is compared to an indexed column ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled. @@ -3597,8 +3597,8 @@ SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt); ** the content of the database file. ** ** Note that [application-defined SQL functions] or -** [virtual tables] might change the database indirectly as a side effect. -** ^(For example, if an application defines a function "eval()" that +** [virtual tables] might change the database indirectly as a side effect. +** ^(For example, if an application defines a function "eval()" that ** calls [sqlite3_exec()], then the following SQL statement would ** change the database file through side-effects: ** @@ -3612,10 +3612,10 @@ SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt); ** ^Transaction control statements such as [BEGIN], [COMMIT], [ROLLBACK], ** [SAVEPOINT], and [RELEASE] cause sqlite3_stmt_readonly() to return true, ** since the statements themselves do not actually modify the database but -** rather they control the timing of when other statements modify the +** rather they control the timing of when other statements modify the ** database. ^The [ATTACH] and [DETACH] statements also cause ** sqlite3_stmt_readonly() to return true since, while those statements -** change the configuration of a database connection, they do not make +** change the configuration of a database connection, they do not make ** changes to the content of the database files on disk. ** ^The sqlite3_stmt_readonly() interface returns true for [BEGIN] since ** [BEGIN] merely sets internal flags, but the [BEGIN|BEGIN IMMEDIATE] and @@ -3629,18 +3629,18 @@ SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); ** METHOD: sqlite3_stmt ** ** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the -** [prepared statement] S has been stepped at least once using +** [prepared statement] S has been stepped at least once using ** [sqlite3_step(S)] but has neither run to completion (returned ** [SQLITE_DONE] from [sqlite3_step(S)]) nor ** been reset using [sqlite3_reset(S)]. ^The sqlite3_stmt_busy(S) -** interface returns false if S is a NULL pointer. If S is not a +** interface returns false if S is a NULL pointer. If S is not a ** NULL pointer and is not a pointer to a valid [prepared statement] ** object, then the behavior is undefined and probably undesirable. ** ** This interface can be used in combination [sqlite3_next_stmt()] -** to locate all prepared statements associated with a database +** to locate all prepared statements associated with a database ** connection that are in need of being reset. This can be used, -** for example, in diagnostic routines to search for prepared +** for example, in diagnostic routines to search for prepared ** statements that are holding a transaction open. */ SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*); @@ -3659,7 +3659,7 @@ SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*); ** will accept either a protected or an unprotected sqlite3_value. ** Every interface that accepts sqlite3_value arguments specifies ** whether or not it requires a protected sqlite3_value. The -** [sqlite3_value_dup()] interface can be used to construct a new +** [sqlite3_value_dup()] interface can be used to construct a new ** protected sqlite3_value from an unprotected sqlite3_value. ** ** The terms "protected" and "unprotected" refer to whether or not @@ -3667,7 +3667,7 @@ SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*); ** sqlite3_value object but no mutex is held for an unprotected ** sqlite3_value object. If SQLite is compiled to be single-threaded ** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0) -** or if SQLite is run in one of reduced mutex modes +** or if SQLite is run in one of reduced mutex modes ** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD] ** then there is no distinction between protected and unprotected ** sqlite3_value objects and they can be used interchangeably. However, @@ -3754,7 +3754,7 @@ typedef struct sqlite3_context sqlite3_context; ** or sqlite3_bind_text16() or sqlite3_bind_text64() then ** that parameter must be the byte offset ** where the NUL terminator would occur assuming the string were NUL -** terminated. If any NUL characters occur at byte offsets less than +** terminated. If any NUL characters occur at byte offsets less than ** the value of the fourth parameter then the resulting string value will ** contain embedded NULs. The result of expressions involving strings ** with embedded NULs is undefined. @@ -3913,7 +3913,7 @@ SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*); ** METHOD: sqlite3_stmt ** ** ^Return the number of columns in the result set returned by the -** [prepared statement]. ^If this routine returns 0, that means the +** [prepared statement]. ^If this routine returns 0, that means the ** [prepared statement] returns no data (for example an [UPDATE]). ** ^However, just because this routine returns a positive number does not ** mean that one or more rows of data will be returned. ^A SELECT statement @@ -4097,7 +4097,7 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); ** For all versions of SQLite up to and including 3.6.23.1, a call to ** [sqlite3_reset()] was required after sqlite3_step() returned anything ** other than [SQLITE_ROW] before any subsequent invocation of -** sqlite3_step(). Failure to reset the prepared statement using +** sqlite3_step(). Failure to reset the prepared statement using ** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from ** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1], ** sqlite3_step() began @@ -4228,7 +4228,7 @@ SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); ** the number of bytes in that string. ** ^If the result is NULL, then sqlite3_column_bytes16() returns zero. ** -** ^The values returned by [sqlite3_column_bytes()] and +** ^The values returned by [sqlite3_column_bytes()] and ** [sqlite3_column_bytes16()] do not include the zero terminators at the end ** of the string. ^For clarity: the values returned by ** [sqlite3_column_bytes()] and [sqlite3_column_bytes16()] are the number of @@ -4419,7 +4419,7 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); ** ^The second parameter is the name of the SQL function to be created or ** redefined. ^The length of the name is limited to 255 bytes in a UTF-8 ** representation, exclusive of the zero-terminator. ^Note that the name -** length limit is in UTF-8 bytes, not characters nor UTF-16 bytes. +** length limit is in UTF-8 bytes, not characters nor UTF-16 bytes. ** ^Any attempt to create a function with a longer name ** will result in [SQLITE_MISUSE] being returned. ** @@ -4434,7 +4434,7 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); ** ^The fourth parameter, eTextRep, specifies what ** [SQLITE_UTF8 | text encoding] this SQL function prefers for ** its parameters. The application should set this parameter to -** [SQLITE_UTF16LE] if the function implementation invokes +** [SQLITE_UTF16LE] if the function implementation invokes ** [sqlite3_value_text16le()] on an input, or [SQLITE_UTF16BE] if the ** implementation invokes [sqlite3_value_text16be()] on an input, or ** [SQLITE_UTF16] if [sqlite3_value_text16()] is used, or [SQLITE_UTF8] @@ -4465,13 +4465,13 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); ** callbacks. ** ** ^(If the ninth parameter to sqlite3_create_function_v2() is not NULL, -** then it is destructor for the application data pointer. +** then it is destructor for the application data pointer. ** The destructor is invoked when the function is deleted, either by being ** overloaded or when the database connection closes.)^ ** ^The destructor is also invoked if the call to ** sqlite3_create_function_v2() fails. ** ^When the destructor callback of the tenth parameter is invoked, it -** is passed a single argument which is a copy of the application data +** is passed a single argument which is a copy of the application data ** pointer which was the fifth parameter to sqlite3_create_function_v2(). ** ** ^It is permitted to register multiple implementations of the same @@ -4482,7 +4482,7 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); ** nArg parameter is a better match than a function implementation with ** a negative nArg. ^A function where the preferred text encoding ** matches the database encoding is a better -** match than a function where the encoding is different. +** match than a function where the encoding is different. ** ^A function where the encoding difference is between UTF16le and UTF16be ** is a closer match than a function where the encoding difference is ** between UTF8 and UTF16. @@ -4542,7 +4542,7 @@ SQLITE_API int sqlite3_create_function_v2( /* ** CAPI3REF: Function Flags ** -** These constants may be ORed together with the +** These constants may be ORed together with the ** [SQLITE_UTF8 | preferred text encoding] as the fourth argument ** to [sqlite3_create_function()], [sqlite3_create_function16()], or ** [sqlite3_create_function_v2()]. @@ -4554,7 +4554,7 @@ SQLITE_API int sqlite3_create_function_v2( ** DEPRECATED ** ** These functions are [deprecated]. In order to maintain -** backwards compatibility with older code, these functions continue +** backwards compatibility with older code, these functions continue ** to be supported. However, new applications should avoid ** the use of these functions. To encourage programmers to avoid ** these functions, we will not explain what they do. @@ -4575,7 +4575,7 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6 ** ** The C-language implementation of SQL functions and aggregates uses ** this set of interface routines to access the parameter values on -** the function or aggregate. +** the function or aggregate. ** ** The xFunc (for scalar functions) or xStep (for aggregates) parameters ** to [sqlite3_create_function()] and [sqlite3_create_function16()] @@ -4670,7 +4670,7 @@ SQLITE_API void sqlite3_value_free(sqlite3_value*); ** Implementations of aggregate SQL functions use this ** routine to allocate memory for storing their state. ** -** ^The first time the sqlite3_aggregate_context(C,N) routine is called +** ^The first time the sqlite3_aggregate_context(C,N) routine is called ** for a particular aggregate function, SQLite ** allocates N of memory, zeroes out that memory, and returns a pointer ** to the new memory. ^On second and subsequent calls to @@ -4683,7 +4683,7 @@ SQLITE_API void sqlite3_value_free(sqlite3_value*); ** In those cases, sqlite3_aggregate_context() might be called for the ** first time from within xFinal().)^ ** -** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer +** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer ** when first called if N is less than or equal to zero or if a memory ** allocate error occurs. ** @@ -4692,10 +4692,10 @@ SQLITE_API void sqlite3_value_free(sqlite3_value*); ** value of N in subsequent call to sqlite3_aggregate_context() within ** the same aggregate function instance will not resize the memory ** allocation.)^ Within the xFinal callback, it is customary to set -** N=0 in calls to sqlite3_aggregate_context(C,N) so that no +** N=0 in calls to sqlite3_aggregate_context(C,N) so that no ** pointless memory allocations occur. ** -** ^SQLite automatically frees the memory allocated by +** ^SQLite automatically frees the memory allocated by ** sqlite3_aggregate_context() when the aggregate query concludes. ** ** The first parameter must be a copy of the @@ -4745,7 +4745,7 @@ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*); ** some circumstances the associated metadata may be preserved. An example ** of where this might be useful is in a regular-expression matching ** function. The compiled version of the regular expression can be stored as -** metadata associated with the pattern string. +** metadata associated with the pattern string. ** Then as long as the pattern string remains the same, ** the compiled regular expression can be reused on multiple ** invocations of the same function. @@ -4770,10 +4770,10 @@ SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*); ** SQL statement)^, or **
          • ^(when sqlite3_set_auxdata() is invoked again on the same ** parameter)^, or -**
          • ^(during the original sqlite3_set_auxdata() call when a memory +**
          • ^(during the original sqlite3_set_auxdata() call when a memory ** allocation error occurs.)^
          ** -** Note the last bullet in particular. The destructor X in +** Note the last bullet in particular. The destructor X in ** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the ** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata() ** should be called near the end of the function implementation and the @@ -4961,8 +4961,8 @@ SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); ** METHOD: sqlite3_context ** ** The sqlite3_result_subtype(C,T) function causes the subtype of -** the result from the [application-defined SQL function] with -** [sqlite3_context] C to be the value T. Only the lower 8 bits +** the result from the [application-defined SQL function] with +** [sqlite3_context] C to be the value T. Only the lower 8 bits ** of the subtype T are preserved in current versions of SQLite; ** higher order bits are discarded. ** The number of subtype bytes preserved by SQLite might increase @@ -5009,7 +5009,7 @@ SQLITE_API void sqlite3_result_subtype(sqlite3_context*,unsigned int); ** deleted. ^When all collating functions having the same name are deleted, ** that collation is no longer usable. ** -** ^The collating function callback is invoked with a copy of the pArg +** ^The collating function callback is invoked with a copy of the pArg ** application data pointer and with two strings in the encoding specified ** by the eTextRep argument. The collating function must return an ** integer that is negative, zero, or positive @@ -5039,36 +5039,36 @@ SQLITE_API void sqlite3_result_subtype(sqlite3_context*,unsigned int); ** calls to the collation creation functions or when the ** [database connection] is closed using [sqlite3_close()]. ** -** ^The xDestroy callback is not called if the +** ^The xDestroy callback is not called if the ** sqlite3_create_collation_v2() function fails. Applications that invoke -** sqlite3_create_collation_v2() with a non-NULL xDestroy argument should +** sqlite3_create_collation_v2() with a non-NULL xDestroy argument should ** check the return code and dispose of the application data pointer ** themselves rather than expecting SQLite to deal with it for them. -** This is different from every other SQLite interface. The inconsistency -** is unfortunate but cannot be changed without breaking backwards +** This is different from every other SQLite interface. The inconsistency +** is unfortunate but cannot be changed without breaking backwards ** compatibility. ** ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. */ SQLITE_API int sqlite3_create_collation( - sqlite3*, - const char *zName, - int eTextRep, + sqlite3*, + const char *zName, + int eTextRep, void *pArg, int(*xCompare)(void*,int,const void*,int,const void*) ); SQLITE_API int sqlite3_create_collation_v2( - sqlite3*, - const char *zName, - int eTextRep, + sqlite3*, + const char *zName, + int eTextRep, void *pArg, int(*xCompare)(void*,int,const void*,int,const void*), void(*xDestroy)(void*) ); SQLITE_API int sqlite3_create_collation16( - sqlite3*, + sqlite3*, const void *zName, - int eTextRep, + int eTextRep, void *pArg, int(*xCompare)(void*,int,const void*,int,const void*) ); @@ -5101,12 +5101,12 @@ SQLITE_API int sqlite3_create_collation16( ** [sqlite3_create_collation_v2()]. */ SQLITE_API int sqlite3_collation_needed( - sqlite3*, - void*, + sqlite3*, + void*, void(*)(void*,sqlite3*,int eTextRep,const char*) ); SQLITE_API int sqlite3_collation_needed16( - sqlite3*, + sqlite3*, void*, void(*)(void*,sqlite3*,int eTextRep,const void*) ); @@ -5148,7 +5148,7 @@ SQLITE_API int sqlite3_rekey_v2( ); /* -** Specify the activation key for a SEE database. Unless +** Specify the activation key for a SEE database. Unless ** activated, none of the SEE routines will work. */ SQLITE_API void sqlite3_activate_see( @@ -5158,7 +5158,7 @@ SQLITE_API void sqlite3_activate_see( #ifdef SQLITE_ENABLE_CEROD /* -** Specify the activation key for a CEROD database. Unless +** Specify the activation key for a CEROD database. Unless ** activated, none of the CEROD routines will work. */ SQLITE_API void sqlite3_activate_cerod( @@ -5214,7 +5214,7 @@ SQLITE_API int sqlite3_sleep(int); ** ^The [temp_store_directory pragma] may modify this variable and cause ** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, ** the [temp_store_directory pragma] always assumes that any string -** that this variable points to is held in memory obtained from +** that this variable points to is held in memory obtained from ** [sqlite3_malloc] and the pragma may attempt to free that memory ** using [sqlite3_free]. ** Hence, if this variable is modified directly, either it should be @@ -5271,7 +5271,7 @@ SQLITE_API SQLITE_EXTERN char *sqlite3_temp_directory; ** ^The [data_store_directory pragma] may modify this variable and cause ** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, ** the [data_store_directory pragma] always assumes that any string -** that this variable points to is held in memory obtained from +** that this variable points to is held in memory obtained from ** [sqlite3_malloc] and the pragma may attempt to free that memory ** using [sqlite3_free]. ** Hence, if this variable is modified directly, either it should be @@ -5460,7 +5460,7 @@ SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); ** and [sqlite3_preupdate_hook()] interfaces. */ SQLITE_API void *sqlite3_update_hook( - sqlite3*, + sqlite3*, void(*)(void *,int ,char const *,char const *,sqlite3_int64), void* ); @@ -5474,7 +5474,7 @@ SQLITE_API void *sqlite3_update_hook( ** and disabled if the argument is false.)^ ** ** ^Cache sharing is enabled and disabled for an entire process. -** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]). +** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]). ** In prior versions of SQLite, ** sharing was enabled or disabled for each thread separately. ** @@ -5491,8 +5491,8 @@ SQLITE_API void *sqlite3_update_hook( ** cache setting should set it explicitly. ** ** Note: This method is disabled on MacOS X 10.7 and iOS version 5.0 -** and will always return SQLITE_MISUSE. On those systems, -** shared cache mode should be enabled per-database connection via +** and will always return SQLITE_MISUSE. On those systems, +** shared cache mode should be enabled per-database connection via ** [sqlite3_open_v2()] with [SQLITE_OPEN_SHAREDCACHE]. ** ** This interface is threadsafe on processors where writing a @@ -5542,7 +5542,7 @@ SQLITE_API int sqlite3_db_release_memory(sqlite3*); ** as heap memory usages approaches the limit. ** ^The soft heap limit is "soft" because even though SQLite strives to stay ** below the limit, it will exceed the limit rather than generate -** an [SQLITE_NOMEM] error. In other words, the soft heap limit +** an [SQLITE_NOMEM] error. In other words, the soft heap limit ** is advisory only. ** ** ^The return value from sqlite3_soft_heap_limit64() is the size of @@ -5569,7 +5569,7 @@ SQLITE_API int sqlite3_db_release_memory(sqlite3*); ** from the heap. **
        )^ ** -** Beginning with SQLite [version 3.7.3] ([dateof:3.7.3]), +** Beginning with SQLite [version 3.7.3] ([dateof:3.7.3]), ** the soft heap limit is enforced ** regardless of whether or not the [SQLITE_ENABLE_MEMORY_MANAGEMENT] ** compile-time option is invoked. With [SQLITE_ENABLE_MEMORY_MANAGEMENT], @@ -5645,7 +5645,7 @@ SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N); ** ** ^If the specified table is actually a view, an [error code] is returned. ** -** ^If the specified column is "rowid", "oid" or "_rowid_" and the table +** ^If the specified column is "rowid", "oid" or "_rowid_" and the table ** is not a [WITHOUT ROWID] table and an ** [INTEGER PRIMARY KEY] column has been explicitly declared, then the output ** parameters are set for the explicitly declared column. ^(If there is no @@ -5711,7 +5711,7 @@ SQLITE_API int sqlite3_table_column_metadata( ** prior to calling this API, ** otherwise an error will be returned. ** -** Security warning: It is recommended that the +** Security warning: It is recommended that the ** [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method be used to enable only this ** interface. The use of the [sqlite3_enable_load_extension()] interface ** should be avoided. This will keep the SQL function [load_extension()] @@ -5798,7 +5798,7 @@ SQLITE_API int sqlite3_auto_extension(void(*xEntryPoint)(void)); ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the ** initialization routine X that was registered using a prior call to ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)] -** routine returns 1 if initialization routine X was successfully +** routine returns 1 if initialization routine X was successfully ** unregistered and it returns 0 if X was not on the list of initialization ** routines. */ @@ -5833,8 +5833,8 @@ typedef struct sqlite3_module sqlite3_module; ** CAPI3REF: Virtual Table Object ** KEYWORDS: sqlite3_module {virtual table module} ** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual tables]. +** This structure, sometimes called a "virtual table module", +** defines the implementation of a [virtual tables]. ** This structure consists mostly of methods for the module. ** ** ^A virtual table module is created by filling in a persistent @@ -5873,7 +5873,7 @@ struct sqlite3_module { void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), void **ppArg); int (*xRename)(sqlite3_vtab *pVtab, const char *zNew); - /* The methods above are in version 1 of the sqlite_module object. Those + /* The methods above are in version 1 of the sqlite_module object. Those ** below are for version 2 and greater. */ int (*xSavepoint)(sqlite3_vtab *pVTab, int); int (*xRelease)(sqlite3_vtab *pVTab, int); @@ -5920,7 +5920,7 @@ struct sqlite3_module { ** required by SQLite. If the table has at least 64 columns and any column ** to the right of the first 63 is required, then bit 63 of colUsed is also ** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to +** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to ** non-zero. ** ** The [xBestIndex] method must fill aConstraintUsage[] with information @@ -5941,17 +5941,17 @@ struct sqlite3_module { ** ** ^The estimatedCost value is an estimate of the cost of a particular ** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) +** to a linear scan of an SQLite table with N rows. A cost of log(N) ** indicates that the expense of the operation is similar to that of a ** binary search on a unique indexed field of an SQLite table with N rows. ** ** ^The estimatedRows value is an estimate of the number of rows that ** will be returned by the strategy. ** -** The xBestIndex method may optionally populate the idxFlags field with a +** The xBestIndex method may optionally populate the idxFlags field with a ** mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag - ** SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite -** assumes that the strategy may visit at most one row. +** assumes that the strategy may visit at most one row. ** ** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then ** SQLite also assumes that if a call to the xUpdate() method is made as @@ -5964,14 +5964,14 @@ struct sqlite3_module { ** the xUpdate method are automatically rolled back by SQLite. ** ** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). +** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). ** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely +** used with an SQLite version earlier than 3.8.2, the results of attempting +** to read or write the estimatedRows field are undefined (but are likely ** to included crashing the application). The estimatedRows field should ** therefore only be used if [sqlite3_libversion_number()] returns a ** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). +** was added for [version 3.9.0] ([dateof:3.9.0]). ** It may therefore only be used if ** sqlite3_libversion_number() returns a value greater than or equal to ** 3009000. @@ -6041,7 +6041,7 @@ struct sqlite3_index_info { ** preexisting [virtual table] for the module. ** ** ^The module name is registered on the [database connection] specified -** by the first parameter. ^The name of the module is given by the +** by the first parameter. ^The name of the module is given by the ** second parameter. ^The third parameter is a pointer to ** the implementation of the [virtual table module]. ^The fourth ** parameter is an arbitrary client data pointer that is passed through @@ -6133,7 +6133,7 @@ SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL); ** METHOD: sqlite3 ** ** ^(Virtual tables can provide alternative implementations of functions -** using the [xFindFunction] method of the [virtual table module]. +** using the [xFindFunction] method of the [virtual table module]. ** But global versions of those functions ** must exist in order to be overloaded.)^ ** @@ -6184,7 +6184,7 @@ typedef struct sqlite3_blob sqlite3_blob; ** SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow; ** )^ ** -** ^(Parameter zDb is not the filename that contains the database, but +** ^(Parameter zDb is not the filename that contains the database, but ** rather the symbolic name of the database. For attached databases, this is ** the name that appears after the AS keyword in the [ATTACH] statement. ** For the main database file, the database name is "main". For TEMP @@ -6197,28 +6197,28 @@ typedef struct sqlite3_blob sqlite3_blob; ** ^(On success, [SQLITE_OK] is returned and the new [BLOB handle] is stored ** in *ppBlob. Otherwise an [error code] is returned and, unless the error ** code is SQLITE_MISUSE, *ppBlob is set to NULL.)^ ^This means that, provided -** the API is not misused, it is always safe to call [sqlite3_blob_close()] +** the API is not misused, it is always safe to call [sqlite3_blob_close()] ** on *ppBlob after this function it returns. ** ** This function fails with SQLITE_ERROR if any of the following are true: **
          -**
        • ^(Database zDb does not exist)^, -**
        • ^(Table zTable does not exist within database zDb)^, -**
        • ^(Table zTable is a WITHOUT ROWID table)^, +**
        • ^(Database zDb does not exist)^, +**
        • ^(Table zTable does not exist within database zDb)^, +**
        • ^(Table zTable is a WITHOUT ROWID table)^, **
        • ^(Column zColumn does not exist)^, **
        • ^(Row iRow is not present in the table)^, **
        • ^(The specified column of row iRow contains a value that is not ** a TEXT or BLOB value)^, -**
        • ^(Column zColumn is part of an index, PRIMARY KEY or UNIQUE +**
        • ^(Column zColumn is part of an index, PRIMARY KEY or UNIQUE ** constraint and the blob is being opened for read/write access)^, -**
        • ^([foreign key constraints | Foreign key constraints] are enabled, +**
        • ^([foreign key constraints | Foreign key constraints] are enabled, ** column zColumn is part of a [child key] definition and the blob is ** being opened for read/write access)^. **
        ** -** ^Unless it returns SQLITE_MISUSE, this function sets the -** [database connection] error code and message accessible via -** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. +** ^Unless it returns SQLITE_MISUSE, this function sets the +** [database connection] error code and message accessible via +** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. ** ** A BLOB referenced by sqlite3_blob_open() may be read using the ** [sqlite3_blob_read()] interface and modified by using @@ -6244,7 +6244,7 @@ typedef struct sqlite3_blob sqlite3_blob; ** blob. ** ** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces -** and the built-in [zeroblob] SQL function may be used to create a +** and the built-in [zeroblob] SQL function may be used to create a ** zero-filled blob to read or write using the incremental-blob interface. ** ** To avoid a resource leak, every open [BLOB handle] should eventually @@ -6294,7 +6294,7 @@ SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); ** DESTRUCTOR: sqlite3_blob ** ** ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed -** unconditionally. Even if this routine returns an error code, the +** unconditionally. Even if this routine returns an error code, the ** handle is still closed.)^ ** ** ^If the blob handle being closed was opened for read-write access, and if @@ -6304,10 +6304,10 @@ SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); ** code is returned and the transaction rolled back. ** ** Calling this function with an argument that is not a NULL pointer or an -** open blob handle results in undefined behaviour. ^Calling this routine -** with a null pointer (such as would be returned by a failed call to +** open blob handle results in undefined behaviour. ^Calling this routine +** with a null pointer (such as would be returned by a failed call to ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function -** is passed a valid open blob handle, the values returned by the +** is passed a valid open blob handle, the values returned by the ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning. */ SQLITE_API int sqlite3_blob_close(sqlite3_blob *); @@ -6316,7 +6316,7 @@ SQLITE_API int sqlite3_blob_close(sqlite3_blob *); ** CAPI3REF: Return The Size Of An Open BLOB ** METHOD: sqlite3_blob ** -** ^Returns the size in bytes of the BLOB accessible via the +** ^Returns the size in bytes of the BLOB accessible via the ** successfully opened [BLOB handle] in its only argument. ^The ** incremental blob I/O routines can only read or overwriting existing ** blob content; they cannot change the size of a blob. @@ -6367,9 +6367,9 @@ SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); ** ** ^(On success, sqlite3_blob_write() returns SQLITE_OK. ** Otherwise, an [error code] or an [extended error code] is returned.)^ -** ^Unless SQLITE_MISUSE is returned, this function sets the -** [database connection] error code and message accessible via -** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. +** ^Unless SQLITE_MISUSE is returned, this function sets the +** [database connection] error code and message accessible via +** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. ** ** ^If the [BLOB handle] passed as the first argument was not opened for ** writing (the flags parameter to [sqlite3_blob_open()] was zero), @@ -6378,9 +6378,9 @@ SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); ** This function may only modify the contents of the BLOB; it is ** not possible to increase the size of a BLOB using this API. ** ^If offset iOffset is less than N bytes from the end of the BLOB, -** [SQLITE_ERROR] is returned and no data is written. The size of the -** BLOB (and hence the maximum value of N+iOffset) can be determined -** using the [sqlite3_blob_bytes()] interface. ^If N or iOffset are less +** [SQLITE_ERROR] is returned and no data is written. The size of the +** BLOB (and hence the maximum value of N+iOffset) can be determined +** using the [sqlite3_blob_bytes()] interface. ^If N or iOffset are less ** than zero [SQLITE_ERROR] is returned and no data is written. ** ** ^An attempt to write to an expired [BLOB handle] fails with an @@ -6532,7 +6532,7 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); ** ^(Some systems (for example, Windows 95) do not support the operation ** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try() ** will always return SQLITE_BUSY. The SQLite core only ever uses -** sqlite3_mutex_try() as an optimization so this is acceptable +** sqlite3_mutex_try() as an optimization so this is acceptable ** behavior.)^ ** ** ^The sqlite3_mutex_leave() routine exits a mutex that was @@ -6695,7 +6695,7 @@ SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*); ** CAPI3REF: Retrieve the mutex for a database connection ** METHOD: sqlite3 ** -** ^This interface returns a pointer the [sqlite3_mutex] object that +** ^This interface returns a pointer the [sqlite3_mutex] object that ** serializes access to the [database connection] given in the argument ** when the [threading mode] is Serialized. ** ^If the [threading mode] is Single-thread or Multi-thread then this @@ -6850,7 +6850,7 @@ SQLITE_API int sqlite3_status64( **
        This parameter records the largest memory allocation request ** handed to [sqlite3_malloc()] or [sqlite3_realloc()] (or their ** internal equivalents). Only the value returned in the -** *pHighwater parameter to [sqlite3_status()] is of interest. +** *pHighwater parameter to [sqlite3_status()] is of interest. ** The value written into the *pCurrent parameter is undefined.
        )^ ** ** [[SQLITE_STATUS_MALLOC_COUNT]] ^(
        SQLITE_STATUS_MALLOC_COUNT
        @@ -6859,11 +6859,11 @@ SQLITE_API int sqlite3_status64( ** ** [[SQLITE_STATUS_PAGECACHE_USED]] ^(
        SQLITE_STATUS_PAGECACHE_USED
        **
        This parameter returns the number of pages used out of the -** [pagecache memory allocator] that was configured using +** [pagecache memory allocator] that was configured using ** [SQLITE_CONFIG_PAGECACHE]. The ** value returned is in pages, not in bytes.
        )^ ** -** [[SQLITE_STATUS_PAGECACHE_OVERFLOW]] +** [[SQLITE_STATUS_PAGECACHE_OVERFLOW]] ** ^(
        SQLITE_STATUS_PAGECACHE_OVERFLOW
        **
        This parameter returns the number of bytes of page cache ** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] @@ -6876,7 +6876,7 @@ SQLITE_API int sqlite3_status64( ** [[SQLITE_STATUS_PAGECACHE_SIZE]] ^(
        SQLITE_STATUS_PAGECACHE_SIZE
        **
        This parameter records the largest memory allocation request ** handed to [pagecache memory allocator]. Only the value returned in the -** *pHighwater parameter to [sqlite3_status()] is of interest. +** *pHighwater parameter to [sqlite3_status()] is of interest. ** The value written into the *pCurrent parameter is undefined.
        )^ ** ** [[SQLITE_STATUS_SCRATCH_USED]] ^(
        SQLITE_STATUS_SCRATCH_USED
        @@ -6900,11 +6900,11 @@ SQLITE_API int sqlite3_status64( ** [[SQLITE_STATUS_SCRATCH_SIZE]] ^(
        SQLITE_STATUS_SCRATCH_SIZE
        **
        This parameter records the largest memory allocation request ** handed to [scratch memory allocator]. Only the value returned in the -** *pHighwater parameter to [sqlite3_status()] is of interest. +** *pHighwater parameter to [sqlite3_status()] is of interest. ** The value written into the *pCurrent parameter is undefined.
        )^ ** ** [[SQLITE_STATUS_PARSER_STACK]] ^(
        SQLITE_STATUS_PARSER_STACK
        -**
        The *pHighwater parameter records the deepest parser stack. +**
        The *pHighwater parameter records the deepest parser stack. ** The *pCurrent value is undefined. The *pHighwater value is only ** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].
        )^ ** @@ -6926,12 +6926,12 @@ SQLITE_API int sqlite3_status64( ** CAPI3REF: Database Connection Status ** METHOD: sqlite3 ** -** ^This interface is used to retrieve runtime status information +** ^This interface is used to retrieve runtime status information ** about a single [database connection]. ^The first argument is the ** database connection object to be interrogated. ^The second argument ** is an integer constant, taken from the set of ** [SQLITE_DBSTATUS options], that -** determines the parameter to interrogate. The set of +** determines the parameter to interrogate. The set of ** [SQLITE_DBSTATUS options] is likely ** to grow in future releases of SQLite. ** @@ -6966,7 +6966,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** checked out.
    )^ ** ** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(
    SQLITE_DBSTATUS_LOOKASIDE_HIT
    -**
    This parameter returns the number malloc attempts that were +**
    This parameter returns the number malloc attempts that were ** satisfied using lookaside memory. Only the high-water value is meaningful; ** the current value is always zero.)^ ** @@ -6991,7 +6991,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** memory used by all pager caches associated with the database connection.)^ ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. ** -** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] +** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] ** ^(
    SQLITE_DBSTATUS_CACHE_USED_SHARED
    **
    This parameter is similar to DBSTATUS_CACHE_USED, except that if a ** pager cache is shared between two or more connections the bytes of heap @@ -7006,7 +7006,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(
    SQLITE_DBSTATUS_SCHEMA_USED
    **
    This parameter returns the approximate number of bytes of heap ** memory used to store the schema for all databases associated -** with the connection - main, temp, and any [ATTACH]-ed databases.)^ +** with the connection - main, temp, and any [ATTACH]-ed databases.)^ ** ^The full amount of memory used by the schemas is reported, even if the ** schema memory is shared with other database connections due to ** [shared cache mode] being enabled. @@ -7021,13 +7021,13 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** ** [[SQLITE_DBSTATUS_CACHE_HIT]] ^(
    SQLITE_DBSTATUS_CACHE_HIT
    **
    This parameter returns the number of pager cache hits that have -** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT +** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT ** is always 0. **
    ** ** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(
    SQLITE_DBSTATUS_CACHE_MISS
    **
    This parameter returns the number of pager cache misses that have -** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS +** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS ** is always 0. **
    ** @@ -7075,7 +7075,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** statements. For example, if the number of table steps greatly exceeds ** the number of table searches or result rows, that would tend to indicate ** that the prepared statement is using a full table scan rather than -** an index. +** an index. ** ** ^(This interface is used to retrieve and reset counter values from ** a [prepared statement]. The first argument is the prepared statement @@ -7102,7 +7102,7 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** [[SQLITE_STMTSTATUS_FULLSCAN_STEP]]
    SQLITE_STMTSTATUS_FULLSCAN_STEP
    **
    ^This is the number of times that SQLite has stepped forward in ** a table as part of a full table scan. Large numbers for this counter -** may indicate opportunities for performance improvement through +** may indicate opportunities for performance improvement through ** careful use of indices.
    ** ** [[SQLITE_STMTSTATUS_SORT]]
    SQLITE_STMTSTATUS_SORT
    @@ -7120,7 +7120,7 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** [[SQLITE_STMTSTATUS_VM_STEP]]
    SQLITE_STMTSTATUS_VM_STEP
    **
    ^This is the number of virtual machine operations executed ** by the prepared statement if that number is less than or equal -** to 2147483647. The number of virtual machine operations can be +** to 2147483647. The number of virtual machine operations can be ** used as a proxy for the total work done by the prepared statement. ** If the number of virtual machine operations exceeds 2147483647 ** then the value returned by this statement status code is undefined. @@ -7166,15 +7166,15 @@ struct sqlite3_pcache_page { ** KEYWORDS: {page cache} ** ** ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE2], ...) interface can -** register an alternative page cache implementation by passing in an +** register an alternative page cache implementation by passing in an ** instance of the sqlite3_pcache_methods2 structure.)^ -** In many applications, most of the heap memory allocated by +** In many applications, most of the heap memory allocated by ** SQLite is used for the page cache. -** By implementing a +** By implementing a ** custom page cache using this API, an application can better control -** the amount of memory consumed by SQLite, the way in which -** that memory is allocated and released, and the policies used to -** determine exactly which parts of a database file are cached and for +** the amount of memory consumed by SQLite, the way in which +** that memory is allocated and released, and the policies used to +** determine exactly which parts of a database file are cached and for ** how long. ** ** The alternative page cache mechanism is an @@ -7187,19 +7187,19 @@ struct sqlite3_pcache_page { ** [sqlite3_config()] returns.)^ ** ** [[the xInit() page cache method]] -** ^(The xInit() method is called once for each effective +** ^(The xInit() method is called once for each effective ** call to [sqlite3_initialize()])^ ** (usually only once during the lifetime of the process). ^(The xInit() ** method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^ -** The intent of the xInit() method is to set up global data structures -** required by the custom page cache implementation. -** ^(If the xInit() method is NULL, then the +** The intent of the xInit() method is to set up global data structures +** required by the custom page cache implementation. +** ^(If the xInit() method is NULL, then the ** built-in default page cache is used instead of the application defined ** page cache.)^ ** ** [[the xShutdown() page cache method]] ** ^The xShutdown() method is called by [sqlite3_shutdown()]. -** It can be used to clean up +** It can be used to clean up ** any outstanding resources before process shutdown, if required. ** ^The xShutdown() method may be NULL. ** @@ -7218,7 +7218,7 @@ struct sqlite3_pcache_page { ** though this is not guaranteed. ^The ** first parameter, szPage, is the size in bytes of the pages that must ** be allocated by the cache. ^szPage will always a power of two. ^The -** second parameter szExtra is a number of bytes of extra storage +** second parameter szExtra is a number of bytes of extra storage ** associated with each page cache entry. ^The szExtra parameter will ** a number less than 250. SQLite will use the ** extra szExtra bytes on each page to store metadata about the underlying @@ -7231,7 +7231,7 @@ struct sqlite3_pcache_page { ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will ** never invoke xUnpin() except to deliberately delete a page. ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to -** false will always have the "discard" flag set to true. +** false will always have the "discard" flag set to true. ** ^Hence, a cache created with bPurgeable false will ** never contain any unpinned pages. ** @@ -7246,12 +7246,12 @@ struct sqlite3_pcache_page { ** [[the xPagecount() page cache methods]] ** The xPagecount() method must return the number of pages currently ** stored in the cache, both pinned and unpinned. -** +** ** [[the xFetch() page cache methods]] -** The xFetch() method locates a page in the cache and returns a pointer to +** The xFetch() method locates a page in the cache and returns a pointer to ** an sqlite3_pcache_page object associated with that page, or a NULL pointer. ** The pBuf element of the returned sqlite3_pcache_page object will be a -** pointer to a buffer of szPage bytes used to store the content of a +** pointer to a buffer of szPage bytes used to store the content of a ** single database page. The pExtra element of sqlite3_pcache_page will be ** a pointer to the szExtra bytes of extra storage that SQLite has requested ** for each entry in the page cache. @@ -7290,8 +7290,8 @@ struct sqlite3_pcache_page { ** page cache implementation. ^The page cache implementation ** may choose to evict unpinned pages at any time. ** -** The cache must not perform any reference counting. A single -** call to xUnpin() unpins the page regardless of the number of prior calls +** The cache must not perform any reference counting. A single +** call to xUnpin() unpins the page regardless of the number of prior calls ** to xFetch(). ** ** [[the xRekey() page cache methods]] @@ -7331,7 +7331,7 @@ struct sqlite3_pcache_methods2 { int (*xPagecount)(sqlite3_pcache*); sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); - void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, + void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, unsigned oldKey, unsigned newKey); void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); void (*xDestroy)(sqlite3_pcache*); @@ -7376,7 +7376,7 @@ typedef struct sqlite3_backup sqlite3_backup; ** ** The backup API copies the content of one database into another. ** It is useful either for creating backups of databases or -** for copying in-memory databases to or from persistent files. +** for copying in-memory databases to or from persistent files. ** ** See Also: [Using the SQLite Online Backup API] ** @@ -7387,36 +7387,36 @@ typedef struct sqlite3_backup sqlite3_backup; ** ^Thus, the backup may be performed on a live source database without ** preventing other database connections from ** reading or writing to the source database while the backup is underway. -** -** ^(To perform a backup operation: +** +** ^(To perform a backup operation: **
      **
    1. sqlite3_backup_init() is called once to initialize the -** backup, -**
    2. sqlite3_backup_step() is called one or more times to transfer +** backup, +**
    3. sqlite3_backup_step() is called one or more times to transfer ** the data between the two databases, and finally -**
    4. sqlite3_backup_finish() is called to release all resources -** associated with the backup operation. +**
    5. sqlite3_backup_finish() is called to release all resources +** associated with the backup operation. **
    )^ ** There should be exactly one call to sqlite3_backup_finish() for each ** successful call to sqlite3_backup_init(). ** ** [[sqlite3_backup_init()]] sqlite3_backup_init() ** -** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the -** [database connection] associated with the destination database +** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the +** [database connection] associated with the destination database ** and the database name, respectively. ** ^The database name is "main" for the main database, "temp" for the ** temporary database, or the name specified after the AS keyword in ** an [ATTACH] statement for an attached database. -** ^The S and M arguments passed to +** ^The S and M arguments passed to ** sqlite3_backup_init(D,N,S,M) identify the [database connection] ** and database name of the source database, respectively. ** ^The source and destination [database connections] (parameters S and D) ** must be different or else sqlite3_backup_init(D,N,S,M) will fail with ** an error. ** -** ^A call to sqlite3_backup_init() will fail, returning NULL, if -** there is already a read or read-write transaction open on the +** ^A call to sqlite3_backup_init() will fail, returning NULL, if +** there is already a read or read-write transaction open on the ** destination database. ** ** ^If an error occurs within sqlite3_backup_init(D,N,S,M), then NULL is @@ -7428,14 +7428,14 @@ typedef struct sqlite3_backup sqlite3_backup; ** ^A successful call to sqlite3_backup_init() returns a pointer to an ** [sqlite3_backup] object. ** ^The [sqlite3_backup] object may be used with the sqlite3_backup_step() and -** sqlite3_backup_finish() functions to perform the specified backup +** sqlite3_backup_finish() functions to perform the specified backup ** operation. ** ** [[sqlite3_backup_step()]] sqlite3_backup_step() ** -** ^Function sqlite3_backup_step(B,N) will copy up to N pages between +** ^Function sqlite3_backup_step(B,N) will copy up to N pages between ** the source and destination databases specified by [sqlite3_backup] object B. -** ^If N is negative, all remaining source pages are copied. +** ^If N is negative, all remaining source pages are copied. ** ^If sqlite3_backup_step(B,N) successfully copies N pages and there ** are still more pages to be copied, then the function returns [SQLITE_OK]. ** ^If sqlite3_backup_step(B,N) successfully finishes copying all pages @@ -7457,8 +7457,8 @@ typedef struct sqlite3_backup sqlite3_backup; ** ** ^If sqlite3_backup_step() cannot obtain a required file-system lock, then ** the [sqlite3_busy_handler | busy-handler function] -** is invoked (if one is specified). ^If the -** busy-handler returns non-zero before the lock is available, then +** is invoked (if one is specified). ^If the +** busy-handler returns non-zero before the lock is available, then ** [SQLITE_BUSY] is returned to the caller. ^In this case the call to ** sqlite3_backup_step() can be retried later. ^If the source ** [database connection] @@ -7466,15 +7466,15 @@ typedef struct sqlite3_backup sqlite3_backup; ** is called, then [SQLITE_LOCKED] is returned immediately. ^Again, in this ** case the call to sqlite3_backup_step() can be retried later on. ^(If ** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX], [SQLITE_NOMEM], or -** [SQLITE_READONLY] is returned, then -** there is no point in retrying the call to sqlite3_backup_step(). These -** errors are considered fatal.)^ The application must accept -** that the backup operation has failed and pass the backup operation handle +** [SQLITE_READONLY] is returned, then +** there is no point in retrying the call to sqlite3_backup_step(). These +** errors are considered fatal.)^ The application must accept +** that the backup operation has failed and pass the backup operation handle ** to the sqlite3_backup_finish() to release associated resources. ** ** ^The first call to sqlite3_backup_step() obtains an exclusive lock -** on the destination file. ^The exclusive lock is not released until either -** sqlite3_backup_finish() is called or the backup operation is complete +** on the destination file. ^The exclusive lock is not released until either +** sqlite3_backup_finish() is called or the backup operation is complete ** and sqlite3_backup_step() returns [SQLITE_DONE]. ^Every call to ** sqlite3_backup_step() obtains a [shared lock] on the source database that ** lasts for the duration of the sqlite3_backup_step() call. @@ -7483,18 +7483,18 @@ typedef struct sqlite3_backup sqlite3_backup; ** through the backup process. ^If the source database is modified by an ** external process or via a database connection other than the one being ** used by the backup operation, then the backup will be automatically -** restarted by the next call to sqlite3_backup_step(). ^If the source +** restarted by the next call to sqlite3_backup_step(). ^If the source ** database is modified by the using the same database connection as is used ** by the backup operation, then the backup database is automatically ** updated at the same time. ** ** [[sqlite3_backup_finish()]] sqlite3_backup_finish() ** -** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the +** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the ** application wishes to abandon the backup operation, the application ** should destroy the [sqlite3_backup] by passing it to sqlite3_backup_finish(). ** ^The sqlite3_backup_finish() interfaces releases all -** resources associated with the [sqlite3_backup] object. +** resources associated with the [sqlite3_backup] object. ** ^If sqlite3_backup_step() has not yet returned [SQLITE_DONE], then any ** active write-transaction on the destination database is rolled back. ** The [sqlite3_backup] object is invalid @@ -7534,8 +7534,8 @@ typedef struct sqlite3_backup sqlite3_backup; ** connections, then the source database connection may be used concurrently ** from within other threads. ** -** However, the application must guarantee that the destination -** [database connection] is not passed to any other API (by any thread) after +** However, the application must guarantee that the destination +** [database connection] is not passed to any other API (by any thread) after ** sqlite3_backup_init() is called and before the corresponding call to ** sqlite3_backup_finish(). SQLite does not currently check to see ** if the application incorrectly accesses the destination [database connection] @@ -7546,11 +7546,11 @@ typedef struct sqlite3_backup sqlite3_backup; ** If running in [shared cache mode], the application must ** guarantee that the shared cache used by the destination database ** is not accessed while the backup is running. In practice this means -** that the application must guarantee that the disk file being +** that the application must guarantee that the disk file being ** backed up to is not accessed by any connection within the process, ** not just the specific connection that was passed to sqlite3_backup_init(). ** -** The [sqlite3_backup] object itself is partially threadsafe. Multiple +** The [sqlite3_backup] object itself is partially threadsafe. Multiple ** threads may safely make multiple concurrent calls to sqlite3_backup_step(). ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() ** APIs are not strictly speaking threadsafe. If they are invoked at the @@ -7575,8 +7575,8 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** ^When running in shared-cache mode, a database operation may fail with ** an [SQLITE_LOCKED] error if the required locks on the shared-cache or ** individual tables within the shared-cache cannot be obtained. See -** [SQLite Shared-Cache Mode] for a description of shared-cache locking. -** ^This API may be used to register a callback that SQLite will invoke +** [SQLite Shared-Cache Mode] for a description of shared-cache locking. +** ^This API may be used to register a callback that SQLite will invoke ** when the connection currently holding the required lock relinquishes it. ** ^This API is only available if the library was compiled with the ** [SQLITE_ENABLE_UNLOCK_NOTIFY] C-preprocessor symbol defined. @@ -7584,14 +7584,14 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** See Also: [Using the SQLite Unlock Notification Feature]. ** ** ^Shared-cache locks are released when a database connection concludes -** its current transaction, either by committing it or rolling it back. +** its current transaction, either by committing it or rolling it back. ** ** ^When a connection (known as the blocked connection) fails to obtain a ** shared-cache lock and SQLITE_LOCKED is returned to the caller, the ** identity of the database connection (the blocking connection) that -** has locked the required resource is stored internally. ^After an +** has locked the required resource is stored internally. ^After an ** application receives an SQLITE_LOCKED error, it may call the -** sqlite3_unlock_notify() method with the blocked connection handle as +** sqlite3_unlock_notify() method with the blocked connection handle as ** the first argument to register for a callback that will be invoked ** when the blocking connections current transaction is concluded. ^The ** callback is invoked from within the [sqlite3_step] or [sqlite3_close] @@ -7605,15 +7605,15 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** ** ^If the blocked connection is attempting to obtain a write-lock on a ** shared-cache table, and more than one other connection currently holds -** a read-lock on the same table, then SQLite arbitrarily selects one of +** a read-lock on the same table, then SQLite arbitrarily selects one of ** the other connections to use as the blocking connection. ** -** ^(There may be at most one unlock-notify callback registered by a +** ^(There may be at most one unlock-notify callback registered by a ** blocked connection. If sqlite3_unlock_notify() is called when the ** blocked connection already has a registered unlock-notify callback, ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is ** called with a NULL pointer as its second argument, then any existing -** unlock-notify callback is canceled. ^The blocked connections +** unlock-notify callback is canceled. ^The blocked connections ** unlock-notify callback may also be canceled by closing the blocked ** connection using [sqlite3_close()]. ** @@ -7626,7 +7626,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** ** Callback Invocation Details ** -** When an unlock-notify callback is registered, the application provides a +** When an unlock-notify callback is registered, the application provides a ** single void* pointer that is passed to the callback when it is invoked. ** However, the signature of the callback function allows SQLite to pass ** it an array of void* context pointers. The first argument passed to @@ -7639,12 +7639,12 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** same callback function, then instead of invoking the callback function ** multiple times, it is invoked once with the set of void* context pointers ** specified by the blocked connections bundled together into an array. -** This gives the application an opportunity to prioritize any actions +** This gives the application an opportunity to prioritize any actions ** related to the set of unblocked database connections. ** ** Deadlock Detection ** -** Assuming that after registering for an unlock-notify callback a +** Assuming that after registering for an unlock-notify callback a ** database waits for the callback to be issued before taking any further ** action (a reasonable assumption), then using this API may cause the ** application to deadlock. For example, if connection X is waiting for @@ -7667,7 +7667,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** ** The "DROP TABLE" Exception ** -** When a call to [sqlite3_step()] returns SQLITE_LOCKED, it is almost +** When a call to [sqlite3_step()] returns SQLITE_LOCKED, it is almost ** always appropriate to call sqlite3_unlock_notify(). There is however, ** one exception. When executing a "DROP TABLE" or "DROP INDEX" statement, ** SQLite checks if there are any currently executing SELECT statements @@ -7680,7 +7680,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** One way around this problem is to check the extended error code returned ** by an sqlite3_step() call. ^(If there is a blocking connection, then the ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in -** the special "DROP TABLE/INDEX" case, the extended error code is just +** the special "DROP TABLE/INDEX" case, the extended error code is just ** SQLITE_LOCKED.)^ */ SQLITE_API int sqlite3_unlock_notify( @@ -7794,8 +7794,8 @@ SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); ** ^The [sqlite3_wal_hook()] function is used to register a callback that ** is invoked each time data is committed to a database in wal mode. ** -** ^(The callback is invoked by SQLite after the commit has taken place and -** the associated write-lock on the database released)^, so the implementation +** ^(The callback is invoked by SQLite after the commit has taken place and +** the associated write-lock on the database released)^, so the implementation ** may read, write or [checkpoint] the database as required. ** ** ^The first parameter passed to the callback function when it is invoked @@ -7814,7 +7814,7 @@ SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); ** that does not correspond to any valid SQLite error code, the results ** are undefined. ** -** A single database handle may have at most a single write-ahead log callback +** A single database handle may have at most a single write-ahead log callback ** registered at one time. ^Calling [sqlite3_wal_hook()] replaces any ** previously registered write-ahead log callback. ^Note that the ** [sqlite3_wal_autocheckpoint()] interface and the @@ -7822,7 +7822,7 @@ SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); ** overwrite any prior [sqlite3_wal_hook()] settings. */ SQLITE_API void *sqlite3_wal_hook( - sqlite3*, + sqlite3*, int(*)(void *,sqlite3*,const char*,int), void* ); @@ -7835,7 +7835,7 @@ SQLITE_API void *sqlite3_wal_hook( ** [sqlite3_wal_hook()] that causes any database on [database connection] D ** to automatically [checkpoint] ** after committing a transaction if there are N or -** more frames in the [write-ahead log] file. ^Passing zero or +** more frames in the [write-ahead log] file. ^Passing zero or ** a negative value as the nFrame parameter disables automatic ** checkpoints entirely. ** @@ -7865,7 +7865,7 @@ SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N); ** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to ** [sqlite3_wal_checkpoint_v2](D,X,[SQLITE_CHECKPOINT_PASSIVE],0,0).)^ ** -** In brief, sqlite3_wal_checkpoint(D,X) causes the content in the +** In brief, sqlite3_wal_checkpoint(D,X) causes the content in the ** [write-ahead log] for database X on [database connection] D to be ** transferred into the database file and for the write-ahead log to ** be reset. See the [checkpointing] documentation for addition @@ -7891,10 +7891,10 @@ SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); ** **
    **
    SQLITE_CHECKPOINT_PASSIVE
    -** ^Checkpoint as many frames as possible without waiting for any database -** readers or writers to finish, then sync the database file if all frames +** ^Checkpoint as many frames as possible without waiting for any database +** readers or writers to finish, then sync the database file if all frames ** in the log were checkpointed. ^The [busy-handler callback] -** is never invoked in the SQLITE_CHECKPOINT_PASSIVE mode. +** is never invoked in the SQLITE_CHECKPOINT_PASSIVE mode. ** ^On the other hand, passive mode might leave the checkpoint unfinished ** if there are concurrent readers or writers. ** @@ -7908,9 +7908,9 @@ SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); ** **
    SQLITE_CHECKPOINT_RESTART
    ** ^This mode works the same way as SQLITE_CHECKPOINT_FULL with the addition -** that after checkpointing the log file it blocks (calls the +** that after checkpointing the log file it blocks (calls the ** [busy-handler callback]) -** until all readers are reading from the database file only. ^This ensures +** until all readers are reading from the database file only. ^This ensures ** that the next writer will restart the log file from the beginning. ** ^Like SQLITE_CHECKPOINT_FULL, this mode blocks new ** database writer attempts while it is pending, but does not impede readers. @@ -7932,31 +7932,31 @@ SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); ** truncated to zero bytes and so both *pnLog and *pnCkpt will be set to zero. ** ** ^All calls obtain an exclusive "checkpoint" lock on the database file. ^If -** any other process is running a checkpoint operation at the same time, the -** lock cannot be obtained and SQLITE_BUSY is returned. ^Even if there is a +** any other process is running a checkpoint operation at the same time, the +** lock cannot be obtained and SQLITE_BUSY is returned. ^Even if there is a ** busy-handler configured, it will not be invoked in this case. ** -** ^The SQLITE_CHECKPOINT_FULL, RESTART and TRUNCATE modes also obtain the +** ^The SQLITE_CHECKPOINT_FULL, RESTART and TRUNCATE modes also obtain the ** exclusive "writer" lock on the database file. ^If the writer lock cannot be ** obtained immediately, and a busy-handler is configured, it is invoked and ** the writer lock retried until either the busy-handler returns 0 or the lock ** is successfully obtained. ^The busy-handler is also invoked while waiting for ** database readers as described above. ^If the busy-handler returns 0 before ** the writer lock is obtained or while waiting for database readers, the -** checkpoint operation proceeds from that point in the same way as -** SQLITE_CHECKPOINT_PASSIVE - checkpointing as many frames as possible +** checkpoint operation proceeds from that point in the same way as +** SQLITE_CHECKPOINT_PASSIVE - checkpointing as many frames as possible ** without blocking any further. ^SQLITE_BUSY is returned in this case. ** ** ^If parameter zDb is NULL or points to a zero length string, then the -** specified operation is attempted on all WAL databases [attached] to +** specified operation is attempted on all WAL databases [attached] to ** [database connection] db. In this case the -** values written to output parameters *pnLog and *pnCkpt are undefined. ^If -** an SQLITE_BUSY error is encountered when processing one or more of the -** attached WAL databases, the operation is still attempted on any remaining -** attached databases and SQLITE_BUSY is returned at the end. ^If any other -** error occurs while processing an attached database, processing is abandoned -** and the error code is returned to the caller immediately. ^If no error -** (SQLITE_BUSY or otherwise) is encountered while processing the attached +** values written to output parameters *pnLog and *pnCkpt are undefined. ^If +** an SQLITE_BUSY error is encountered when processing one or more of the +** attached WAL databases, the operation is still attempted on any remaining +** attached databases and SQLITE_BUSY is returned at the end. ^If any other +** error occurs while processing an attached database, processing is abandoned +** and the error code is returned to the caller immediately. ^If no error +** (SQLITE_BUSY or otherwise) is encountered while processing the attached ** databases, SQLITE_OK is returned. ** ** ^If database zDb is the name of an attached database that is not in WAL @@ -8032,20 +8032,20 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** If X is non-zero, then the virtual table implementation guarantees ** that if [xUpdate] returns [SQLITE_CONSTRAINT], it will do so before ** any modifications to internal or persistent data structures have been made. -** If the [ON CONFLICT] mode is ABORT, FAIL, IGNORE or ROLLBACK, SQLite +** If the [ON CONFLICT] mode is ABORT, FAIL, IGNORE or ROLLBACK, SQLite ** is able to roll back a statement or database transaction, and abandon -** or continue processing the current SQL statement as appropriate. +** or continue processing the current SQL statement as appropriate. ** If the ON CONFLICT mode is REPLACE and the [xUpdate] method returns ** [SQLITE_CONSTRAINT], SQLite handles this as if the ON CONFLICT mode ** had been ABORT. ** ** Virtual table implementations that are required to handle OR REPLACE -** must do so within the [xUpdate] method. If a call to the -** [sqlite3_vtab_on_conflict()] function indicates that the current ON -** CONFLICT policy is REPLACE, the virtual table implementation should +** must do so within the [xUpdate] method. If a call to the +** [sqlite3_vtab_on_conflict()] function indicates that the current ON +** CONFLICT policy is REPLACE, the virtual table implementation should ** silently replace the appropriate rows within the xUpdate callback and ** return SQLITE_OK. Or, if this is not possible, it may return -** SQLITE_CONSTRAINT, in which case SQLite falls back to OR ABORT +** SQLITE_CONSTRAINT, in which case SQLite falls back to OR ABORT ** constraint handling. **
    */ @@ -8171,7 +8171,7 @@ SQLITE_API int sqlite3_stmt_scanstatus( int idx, /* Index of loop to report on */ int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ void *pOut /* Result written here */ -); +); /* ** CAPI3REF: Zero Scan-Status Counters @@ -8189,15 +8189,15 @@ SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); ** ** ^If a write-transaction is open on [database connection] D when the ** [sqlite3_db_cacheflush(D)] interface invoked, any dirty -** pages in the pager-cache that are not currently in use are written out +** pages in the pager-cache that are not currently in use are written out ** to disk. A dirty page may be in use if a database cursor created by an ** active SQL statement is reading from it, or if it is page 1 of a database ** file (page 1 is always "in use"). ^The [sqlite3_db_cacheflush(D)] ** interface flushes caches for all schemas - "main", "temp", and ** any [attached] databases. ** -** ^If this function needs to obtain extra database locks before dirty pages -** can be flushed to disk, it does so. ^If those locks cannot be obtained +** ^If this function needs to obtain extra database locks before dirty pages +** can be flushed to disk, it does so. ^If those locks cannot be obtained ** immediately and there is a busy-handler callback configured, it is invoked ** in the usual manner. ^If the required lock still cannot be obtained, then ** the database is skipped and an attempt made to flush any dirty pages @@ -8244,16 +8244,16 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); ** kind of update operation that is about to occur. ** ^(The fourth parameter to the preupdate callback is the name of the ** database within the database connection that is being modified. This -** will be "main" for the main database or "temp" for TEMP tables or +** will be "main" for the main database or "temp" for TEMP tables or ** the name given after the AS keyword in the [ATTACH] statement for attached ** databases.)^ ** ^The fifth parameter to the preupdate callback is the name of the ** table that is being modified. ** ** For an UPDATE or DELETE operation on a [rowid table], the sixth -** parameter passed to the preupdate callback is the initial [rowid] of the +** parameter passed to the preupdate callback is the initial [rowid] of the ** row being modified or deleted. For an INSERT operation on a rowid table, -** or any operation on a WITHOUT ROWID table, the value of the sixth +** or any operation on a WITHOUT ROWID table, the value of the sixth ** parameter is undefined. For an INSERT or UPDATE on a rowid table the ** seventh parameter is the final rowid value of the row being inserted ** or updated. The value of the seventh parameter passed to the callback @@ -8292,7 +8292,7 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); ** ** ^The [sqlite3_preupdate_depth(D)] interface returns 0 if the preupdate ** callback was invoked as a result of a direct insert, update, or delete -** operation; or 1 for inserts, updates, or deletes invoked by top-level +** operation; or 1 for inserts, updates, or deletes invoked by top-level ** triggers; or 2 for changes resulting from triggers called by top-level ** triggers; and so forth. ** @@ -8326,7 +8326,7 @@ SQLITE_API int sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); ** The return value is OS-dependent. For example, on unix systems, after ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be ** called to get back the underlying "errno" that caused the problem, such -** as ENOSPC, EAUTH, EISDIR, and so forth. +** as ENOSPC, EAUTH, EISDIR, and so forth. */ SQLITE_API int sqlite3_system_errno(sqlite3*); @@ -8353,7 +8353,7 @@ SQLITE_API int sqlite3_system_errno(sqlite3*); ** ** The constructor for this object is [sqlite3_snapshot_get()]. The ** [sqlite3_snapshot_open()] method causes a fresh read transaction to refer -** to an historical snapshot (if possible). The destructor for +** to an historical snapshot (if possible). The destructor for ** sqlite3_snapshot objects is [sqlite3_snapshot_free()]. */ typedef struct sqlite3_snapshot { @@ -8370,12 +8370,12 @@ typedef struct sqlite3_snapshot { ** [sqlite3_snapshot_get(D,S,P)] interface writes a pointer to the newly ** created [sqlite3_snapshot] object into *P and returns SQLITE_OK. ** If there is not already a read-transaction open on schema S when -** this function is called, one is opened automatically. +** this function is called, one is opened automatically. ** ** The following must be true for this function to succeed. If any of ** the following statements are false when sqlite3_snapshot_get() is ** called, SQLITE_ERROR is returned. The final value of *P is undefined -** in this case. +** in this case. ** **
      **
    • The database handle must be in [autocommit mode]. @@ -8387,13 +8387,13 @@ typedef struct sqlite3_snapshot { ** **
    • One or more transactions must have been written to the current wal ** file since it was created on disk (by any connection). This means -** that a snapshot cannot be taken on a wal mode database with no wal +** that a snapshot cannot be taken on a wal mode database with no wal ** file immediately after it is first opened. At least one transaction ** must be written to it first. **
    ** ** This function may also return SQLITE_NOMEM. If it is called with the -** database handle in autocommit mode but fails for some other reason, +** database handle in autocommit mode but fails for some other reason, ** whether or not a read transaction is opened on schema S is undefined. ** ** The [sqlite3_snapshot] object returned from a successful call to @@ -8433,7 +8433,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_get( ** database connection D does not know that the database file for ** schema S is in [WAL mode]. A database connection might not know ** that the database file is in [WAL mode] if there has been no prior -** I/O on that database connection, or if the database entered [WAL mode] +** I/O on that database connection, or if the database entered [WAL mode] ** after the most recent I/O on the database connection.)^ ** (Hint: Run "[PRAGMA application_id]" against a newly opened ** database connection in order to make it ready to use snapshots.) @@ -8465,17 +8465,17 @@ SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_snapshot_free(sqlite3_snapshot*); ** EXPERIMENTAL ** ** The sqlite3_snapshot_cmp(P1, P2) interface is used to compare the ages -** of two valid snapshot handles. +** of two valid snapshot handles. ** -** If the two snapshot handles are not associated with the same database -** file, the result of the comparison is undefined. +** If the two snapshot handles are not associated with the same database +** file, the result of the comparison is undefined. ** ** Additionally, the result of the comparison is only valid if both of the ** snapshot handles were obtained by calling sqlite3_snapshot_get() since the ** last time the wal file was deleted. The wal file is deleted when the ** database is changed back to rollback mode or when the number of database -** clients drops to zero. If either snapshot handle was obtained before the -** wal file was last deleted, the value returned by this function +** clients drops to zero. If either snapshot handle was obtained before the +** wal file was last deleted, the value returned by this function ** is undefined. ** ** Otherwise, this API returns a negative value if P1 refers to an older @@ -8583,7 +8583,7 @@ struct sqlite3_rtree_geometry { }; /* -** Register a 2nd-generation geometry callback named zScore that can be +** Register a 2nd-generation geometry callback named zScore that can be ** used as part of an R-Tree geometry query as follows: ** ** SELECT ... FROM WHERE MATCH $zQueryFunc(... params ...) @@ -8598,7 +8598,7 @@ SQLITE_API int sqlite3_rtree_query_callback( /* -** A pointer to a structure of the following type is passed as the +** A pointer to a structure of the following type is passed as the ** argument to scored geometry callback registered using ** sqlite3_rtree_query_callback(). ** @@ -8686,7 +8686,7 @@ typedef struct sqlite3_changeset_iter sqlite3_changeset_iter; ** is not possible for an application to register a pre-update hook on a ** database handle that has one or more session objects attached. Nor is ** it possible to create a session object attached to a database handle for -** which a pre-update hook is already defined. The results of attempting +** which a pre-update hook is already defined. The results of attempting ** either of these things are undefined. ** ** The session object will be used to create changesets for tables in @@ -8703,13 +8703,13 @@ SQLITE_API int sqlite3session_create( /* ** CAPI3REF: Delete A Session Object ** -** Delete a session object previously allocated using +** Delete a session object previously allocated using ** [sqlite3session_create()]. Once a session object has been deleted, the ** results of attempting to use pSession with any other session module ** function are undefined. ** ** Session objects must be deleted before the database handle to which they -** are attached is closed. Refer to the documentation for +** are attached is closed. Refer to the documentation for ** [sqlite3session_create()] for details. */ SQLITE_API void sqlite3session_delete(sqlite3_session *pSession); @@ -8726,10 +8726,10 @@ SQLITE_API void sqlite3session_delete(sqlite3_session *pSession); ** the eventual changesets. ** ** Passing zero to this function disables the session. Passing a value -** greater than zero enables it. Passing a value less than zero is a +** greater than zero enables it. Passing a value less than zero is a ** no-op, and may be used to query the current state of the session. ** -** The return value indicates the final state of the session object: 0 if +** The return value indicates the final state of the session object: 0 if ** the session is disabled, or 1 if it is enabled. */ SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable); @@ -8743,7 +8743,7 @@ SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable); **
      **
    • The session object "indirect" flag is set when the change is ** made, or -**
    • The change is made by an SQL trigger or foreign key action +**
    • The change is made by an SQL trigger or foreign key action ** instead of directly as a result of a users SQL statement. **
    ** @@ -8755,10 +8755,10 @@ SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable); ** flag. If the second argument passed to this function is zero, then the ** indirect flag is cleared. If it is greater than zero, the indirect flag ** is set. Passing a value less than zero does not modify the current value -** of the indirect flag, and may be used to query the current state of the +** of the indirect flag, and may be used to query the current state of the ** indirect flag for the specified session object. ** -** The return value indicates the final state of the indirect flag: 0 if +** The return value indicates the final state of the indirect flag: 0 if ** it is clear, or 1 if it is set. */ SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect); @@ -8767,20 +8767,20 @@ SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect) ** CAPI3REF: Attach A Table To A Session Object ** ** If argument zTab is not NULL, then it is the name of a table to attach -** to the session object passed as the first argument. All subsequent changes -** made to the table while the session object is enabled will be recorded. See +** to the session object passed as the first argument. All subsequent changes +** made to the table while the session object is enabled will be recorded. See ** documentation for [sqlite3session_changeset()] for further details. ** ** Or, if argument zTab is NULL, then changes are recorded for all tables -** in the database. If additional tables are added to the database (by -** executing "CREATE TABLE" statements) after this call is made, changes for +** in the database. If additional tables are added to the database (by +** executing "CREATE TABLE" statements) after this call is made, changes for ** the new tables are also recorded. ** ** Changes can only be recorded for tables that have a PRIMARY KEY explicitly -** defined as part of their CREATE TABLE statement. It does not matter if the +** defined as part of their CREATE TABLE statement. It does not matter if the ** PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias) or not. The PRIMARY ** KEY may consist of a single column, or may be a composite key. -** +** ** It is not an error if the named table does not exist in the database. Nor ** is it an error if the named table does not have a PRIMARY KEY. However, ** no changes will be recorded in either of these scenarios. @@ -8788,7 +8788,7 @@ SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect) ** Changes are not recorded for individual rows that have NULL values stored ** in one or more of their PRIMARY KEY columns. ** -** SQLITE_OK is returned if the call completes without error. Or, if an error +** SQLITE_OK is returned if the call completes without error. Or, if an error ** occurs, an SQLite error code (e.g. SQLITE_NOMEM) is returned. */ SQLITE_API int sqlite3session_attach( @@ -8799,10 +8799,10 @@ SQLITE_API int sqlite3session_attach( /* ** CAPI3REF: Set a table filter on a Session Object. ** -** The second argument (xFilter) is the "filter callback". For changes to rows +** The second argument (xFilter) is the "filter callback". For changes to rows ** in tables that are not attached to the Session object, the filter is called -** to determine whether changes to the table's rows should be tracked or not. -** If xFilter returns 0, changes is not tracked. Note that once a table is +** to determine whether changes to the table's rows should be tracked or not. +** If xFilter returns 0, changes is not tracked. Note that once a table is ** attached, xFilter will not be called again. */ SQLITE_API void sqlite3session_table_filter( @@ -8817,9 +8817,9 @@ SQLITE_API void sqlite3session_table_filter( /* ** CAPI3REF: Generate A Changeset From A Session Object ** -** Obtain a changeset containing changes to the tables attached to the -** session object passed as the first argument. If successful, -** set *ppChangeset to point to a buffer containing the changeset +** Obtain a changeset containing changes to the tables attached to the +** session object passed as the first argument. If successful, +** set *ppChangeset to point to a buffer containing the changeset ** and *pnChangeset to the size of the changeset in bytes before returning ** SQLITE_OK. If an error occurs, set both *ppChangeset and *pnChangeset to ** zero and return an SQLite error code. @@ -8834,7 +8834,7 @@ SQLITE_API void sqlite3session_table_filter( ** modifies the values of primary key columns. If such a change is made, it ** is represented in a changeset as a DELETE followed by an INSERT. ** -** Changes are not recorded for rows that have NULL values stored in one or +** Changes are not recorded for rows that have NULL values stored in one or ** more of their PRIMARY KEY columns. If such a row is inserted or deleted, ** no corresponding change is present in the changesets returned by this ** function. If an existing row with one or more NULL values stored in @@ -8887,14 +8887,14 @@ SQLITE_API void sqlite3session_table_filter( **
      **
    • For each record generated by an insert, the database is queried ** for a row with a matching primary key. If one is found, an INSERT -** change is added to the changeset. If no such row is found, no change +** change is added to the changeset. If no such row is found, no change ** is added to the changeset. ** -**
    • For each record generated by an update or delete, the database is +**
    • For each record generated by an update or delete, the database is ** queried for a row with a matching primary key. If such a row is ** found and one or more of the non-primary key fields have been -** modified from their original values, an UPDATE change is added to -** the changeset. Or, if no such row is found in the table, a DELETE +** modified from their original values, an UPDATE change is added to +** the changeset. Or, if no such row is found in the table, a DELETE ** change is added to the changeset. If there is a row with a matching ** primary key in the database, but all fields contain their original ** values, no change is added to the changeset. @@ -8902,7 +8902,7 @@ SQLITE_API void sqlite3session_table_filter( ** ** This means, amongst other things, that if a row is inserted and then later ** deleted while a session object is active, neither the insert nor the delete -** will be present in the changeset. Or if a row is deleted and then later a +** will be present in the changeset. Or if a row is deleted and then later a ** row with the same primary key values inserted while a session object is ** active, the resulting changeset will contain an UPDATE change instead of ** a DELETE and an INSERT. @@ -8911,10 +8911,10 @@ SQLITE_API void sqlite3session_table_filter( ** it does not accumulate records when rows are inserted, updated or deleted. ** This may appear to have some counter-intuitive effects if a single row ** is written to more than once during a session. For example, if a row -** is inserted while a session object is enabled, then later deleted while +** is inserted while a session object is enabled, then later deleted while ** the same session object is disabled, no INSERT record will appear in the ** changeset, even though the delete took place while the session was disabled. -** Or, if one field of a row is updated while a session is disabled, and +** Or, if one field of a row is updated while a session is disabled, and ** another field of the same row is updated while the session is enabled, the ** resulting changeset will contain an UPDATE change that updates both fields. */ @@ -8925,7 +8925,7 @@ SQLITE_API int sqlite3session_changeset( ); /* -** CAPI3REF: Load The Difference Between Tables Into A Session +** CAPI3REF: Load The Difference Between Tables Into A Session ** ** If it is not already attached to the session object passed as the first ** argument, this function attaches table zTbl in the same manner as the @@ -8934,7 +8934,7 @@ SQLITE_API int sqlite3session_changeset( ** an error). ** ** Argument zFromDb must be the name of a database ("main", "temp" etc.) -** attached to the same database handle as the session object that contains +** attached to the same database handle as the session object that contains ** a table compatible with the table attached to the session by this function. ** A table is considered compatible if it: ** @@ -8950,25 +8950,25 @@ SQLITE_API int sqlite3session_changeset( ** APIs, tables without PRIMARY KEYs are simply ignored. ** ** This function adds a set of changes to the session object that could be -** used to update the table in database zFrom (call this the "from-table") -** so that its content is the same as the table attached to the session +** used to update the table in database zFrom (call this the "from-table") +** so that its content is the same as the table attached to the session ** object (call this the "to-table"). Specifically: ** **
        -**
      • For each row (primary key) that exists in the to-table but not in +**
      • For each row (primary key) that exists in the to-table but not in ** the from-table, an INSERT record is added to the session object. ** -**
      • For each row (primary key) that exists in the to-table but not in +**
      • For each row (primary key) that exists in the to-table but not in ** the from-table, a DELETE record is added to the session object. ** -**
      • For each row (primary key) that exists in both tables, but features +**
      • For each row (primary key) that exists in both tables, but features ** different non-PK values in each, an UPDATE record is added to the -** session. +** session. **
      ** ** To clarify, if this function is called and then a changeset constructed -** using [sqlite3session_changeset()], then after applying that changeset to -** database zFrom the contents of the two compatible tables would be +** using [sqlite3session_changeset()], then after applying that changeset to +** database zFrom the contents of the two compatible tables would be ** identical. ** ** It an error if database zFrom does not exist or does not contain the @@ -8976,7 +8976,7 @@ SQLITE_API int sqlite3session_changeset( ** ** If the operation successful, SQLITE_OK is returned. Otherwise, an SQLite ** error code. In this case, if argument pzErrMsg is not NULL, *pzErrMsg -** may be set to point to a buffer containing an English language error +** may be set to point to a buffer containing an English language error ** message. It is the responsibility of the caller to free this buffer using ** sqlite3_free(). */ @@ -8994,19 +8994,19 @@ SQLITE_API int sqlite3session_diff( ** The differences between a patchset and a changeset are that: ** **
        -**
      • DELETE records consist of the primary key fields only. The +**
      • DELETE records consist of the primary key fields only. The ** original values of other fields are omitted. -**
      • The original values of any modified fields are omitted from +**
      • The original values of any modified fields are omitted from ** UPDATE records. **
      ** -** A patchset blob may be used with up to date versions of all -** sqlite3changeset_xxx API functions except for sqlite3changeset_invert(), +** A patchset blob may be used with up to date versions of all +** sqlite3changeset_xxx API functions except for sqlite3changeset_invert(), ** which returns SQLITE_CORRUPT if it is passed a patchset. Similarly, ** attempting to use a patchset blob with old versions of the -** sqlite3changeset_xxx APIs also provokes an SQLITE_CORRUPT error. +** sqlite3changeset_xxx APIs also provokes an SQLITE_CORRUPT error. ** -** Because the non-primary key "old.*" fields are omitted, no +** Because the non-primary key "old.*" fields are omitted, no ** SQLITE_CHANGESET_DATA conflicts can be detected or reported if a patchset ** is passed to the sqlite3changeset_apply() API. Other conflict types work ** in the same way as for changesets. @@ -9025,29 +9025,29 @@ SQLITE_API int sqlite3session_patchset( /* ** CAPI3REF: Test if a changeset has recorded any changes. ** -** Return non-zero if no changes to attached tables have been recorded by -** the session object passed as the first argument. Otherwise, if one or +** Return non-zero if no changes to attached tables have been recorded by +** the session object passed as the first argument. Otherwise, if one or ** more changes have been recorded, return zero. ** ** Even if this function returns zero, it is possible that calling ** [sqlite3session_changeset()] on the session handle may still return a -** changeset that contains no changes. This can happen when a row in -** an attached table is modified and then later on the original values +** changeset that contains no changes. This can happen when a row in +** an attached table is modified and then later on the original values ** are restored. However, if this function returns non-zero, then it is -** guaranteed that a call to sqlite3session_changeset() will return a +** guaranteed that a call to sqlite3session_changeset() will return a ** changeset containing zero changes. */ SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession); /* -** CAPI3REF: Create An Iterator To Traverse A Changeset +** CAPI3REF: Create An Iterator To Traverse A Changeset ** ** Create an iterator used to iterate through the contents of a changeset. ** If successful, *pp is set to point to the iterator handle and SQLITE_OK ** is returned. Otherwise, if an error occurs, *pp is set to zero and an ** SQLite error code is returned. ** -** The following functions can be used to advance and query a changeset +** The following functions can be used to advance and query a changeset ** iterator created by this function: ** **
        @@ -9064,12 +9064,12 @@ SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession); ** ** Assuming the changeset blob was created by one of the ** [sqlite3session_changeset()], [sqlite3changeset_concat()] or -** [sqlite3changeset_invert()] functions, all changes within the changeset -** that apply to a single table are grouped together. This means that when -** an application iterates through a changeset using an iterator created by -** this function, all changes that relate to a single table are visited -** consecutively. There is no chance that the iterator will visit a change -** the applies to table X, then one for table Y, and then later on visit +** [sqlite3changeset_invert()] functions, all changes within the changeset +** that apply to a single table are grouped together. This means that when +** an application iterates through a changeset using an iterator created by +** this function, all changes that relate to a single table are visited +** consecutively. There is no chance that the iterator will visit a change +** the applies to table X, then one for table Y, and then later on visit ** another change for table X. */ SQLITE_API int sqlite3changeset_start( @@ -9093,12 +9093,12 @@ SQLITE_API int sqlite3changeset_start( ** point to the first change in the changeset. Each subsequent call advances ** the iterator to point to the next change in the changeset (if any). If ** no error occurs and the iterator points to a valid change after a call -** to sqlite3changeset_next() has advanced it, SQLITE_ROW is returned. +** to sqlite3changeset_next() has advanced it, SQLITE_ROW is returned. ** Otherwise, if all changes in the changeset have already been visited, ** SQLITE_DONE is returned. ** -** If an error occurs, an SQLite error code is returned. Possible error -** codes include SQLITE_CORRUPT (if the changeset buffer is corrupt) or +** If an error occurs, an SQLite error code is returned. Possible error +** codes include SQLITE_CORRUPT (if the changeset buffer is corrupt) or ** SQLITE_NOMEM. */ SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *pIter); @@ -9115,14 +9115,14 @@ SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *pIter); ** If argument pzTab is not NULL, then *pzTab is set to point to a ** nul-terminated utf-8 encoded string containing the name of the table ** affected by the current change. The buffer remains valid until either -** sqlite3changeset_next() is called on the iterator or until the -** conflict-handler function returns. If pnCol is not NULL, then *pnCol is +** sqlite3changeset_next() is called on the iterator or until the +** conflict-handler function returns. If pnCol is not NULL, then *pnCol is ** set to the number of columns in the table affected by the change. If ** pbIncorrect is not NULL, then *pbIndirect is set to true (1) if the change ** is an indirect change, or false (0) otherwise. See the documentation for ** [sqlite3session_indirect()] for a description of direct and indirect -** changes. Finally, if pOp is not NULL, then *pOp is set to one of -** [SQLITE_INSERT], [SQLITE_DELETE] or [SQLITE_UPDATE], depending on the +** changes. Finally, if pOp is not NULL, then *pOp is set to one of +** [SQLITE_INSERT], [SQLITE_DELETE] or [SQLITE_UPDATE], depending on the ** type of change that the iterator currently points to. ** ** If no error occurs, SQLITE_OK is returned. If an error does occur, an @@ -9174,7 +9174,7 @@ SQLITE_API int sqlite3changeset_pk( ** The pIter argument passed to this function may either be an iterator ** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator ** created by [sqlite3changeset_start()]. In the latter case, the most recent -** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. +** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. ** Furthermore, it may only be called if the type of change that the iterator ** currently points to is either [SQLITE_DELETE] or [SQLITE_UPDATE]. Otherwise, ** this function returns [SQLITE_MISUSE] and sets *ppValue to NULL. @@ -9184,9 +9184,9 @@ SQLITE_API int sqlite3changeset_pk( ** [SQLITE_RANGE] is returned and *ppValue is set to NULL. ** ** If successful, this function sets *ppValue to point to a protected -** sqlite3_value object containing the iVal'th value from the vector of +** sqlite3_value object containing the iVal'th value from the vector of ** original row values stored as part of the UPDATE or DELETE change and -** returns SQLITE_OK. The name of the function comes from the fact that this +** returns SQLITE_OK. The name of the function comes from the fact that this ** is similar to the "old.*" columns available to update or delete triggers. ** ** If some other error occurs (e.g. an OOM condition), an SQLite error code @@ -9204,7 +9204,7 @@ SQLITE_API int sqlite3changeset_old( ** The pIter argument passed to this function may either be an iterator ** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator ** created by [sqlite3changeset_start()]. In the latter case, the most recent -** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. +** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. ** Furthermore, it may only be called if the type of change that the iterator ** currently points to is either [SQLITE_UPDATE] or [SQLITE_INSERT]. Otherwise, ** this function returns [SQLITE_MISUSE] and sets *ppValue to NULL. @@ -9214,12 +9214,12 @@ SQLITE_API int sqlite3changeset_old( ** [SQLITE_RANGE] is returned and *ppValue is set to NULL. ** ** If successful, this function sets *ppValue to point to a protected -** sqlite3_value object containing the iVal'th value from the vector of +** sqlite3_value object containing the iVal'th value from the vector of ** new row values stored as part of the UPDATE or INSERT change and ** returns SQLITE_OK. If the change is an UPDATE and does not include -** a new value for the requested column, *ppValue is set to NULL and -** SQLITE_OK returned. The name of the function comes from the fact that -** this is similar to the "new.*" columns available to update or delete +** a new value for the requested column, *ppValue is set to NULL and +** SQLITE_OK returned. The name of the function comes from the fact that +** this is similar to the "new.*" columns available to update or delete ** triggers. ** ** If some other error occurs (e.g. an OOM condition), an SQLite error code @@ -9245,7 +9245,7 @@ SQLITE_API int sqlite3changeset_new( ** [SQLITE_RANGE] is returned and *ppValue is set to NULL. ** ** If successful, this function sets *ppValue to point to a protected -** sqlite3_value object containing the iVal'th value from the +** sqlite3_value object containing the iVal'th value from the ** "conflicting row" associated with the current conflict-handler callback ** and returns SQLITE_OK. ** @@ -9287,7 +9287,7 @@ SQLITE_API int sqlite3changeset_fk_conflicts( ** call has no effect. ** ** If an error was encountered within a call to an sqlite3changeset_xxx() -** function (for example an [SQLITE_CORRUPT] in [sqlite3changeset_next()] or an +** function (for example an [SQLITE_CORRUPT] in [sqlite3changeset_next()] or an ** [SQLITE_NOMEM] in [sqlite3changeset_new()]) then an error code corresponding ** to that error is returned by this function. Otherwise, SQLITE_OK is ** returned. This is to allow the following pattern (pseudo-code): @@ -9298,7 +9298,7 @@ SQLITE_API int sqlite3changeset_fk_conflicts( ** } ** rc = sqlite3changeset_finalize(); ** if( rc!=SQLITE_OK ){ -** // An error has occurred +** // An error has occurred ** } */ SQLITE_API int sqlite3changeset_finalize(sqlite3_changeset_iter *pIter); @@ -9325,7 +9325,7 @@ SQLITE_API int sqlite3changeset_finalize(sqlite3_changeset_iter *pIter); ** zeroed and an SQLite error code returned. ** ** It is the responsibility of the caller to eventually call sqlite3_free() -** on the *ppOut pointer to free the buffer allocation following a successful +** on the *ppOut pointer to free the buffer allocation following a successful ** call to this function. ** ** WARNING/TODO: This function currently assumes that the input is a valid @@ -9339,11 +9339,11 @@ SQLITE_API int sqlite3changeset_invert( /* ** CAPI3REF: Concatenate Two Changeset Objects ** -** This function is used to concatenate two changesets, A and B, into a +** This function is used to concatenate two changesets, A and B, into a ** single changeset. The result is a changeset equivalent to applying -** changeset A followed by changeset B. +** changeset A followed by changeset B. ** -** This function combines the two input changesets using an +** This function combines the two input changesets using an ** sqlite3_changegroup object. Calling it produces similar results as the ** following code fragment: ** @@ -9385,7 +9385,7 @@ typedef struct sqlite3_changegroup sqlite3_changegroup; ** ** If successful, this function returns SQLITE_OK and populates (*pp) with ** a pointer to a new sqlite3_changegroup object before returning. The caller -** should eventually free the returned object using a call to +** should eventually free the returned object using a call to ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL. ** @@ -9397,7 +9397,7 @@ typedef struct sqlite3_changegroup sqlite3_changegroup; **
      • Zero or more changesets (or patchsets) are added to the object ** by calling sqlite3changegroup_add(). ** -**
      • The result of combining all input changesets together is obtained +**
      • The result of combining all input changesets together is obtained ** by the application via a call to sqlite3changegroup_output(). ** **
      • The object is deleted using a call to sqlite3changegroup_delete(). @@ -9406,7 +9406,7 @@ typedef struct sqlite3_changegroup sqlite3_changegroup; ** Any number of calls to add() and output() may be made between the calls to ** new() and delete(), and in any order. ** -** As well as the regular sqlite3changegroup_add() and +** As well as the regular sqlite3changegroup_add() and ** sqlite3changegroup_output() functions, also available are the streaming ** versions sqlite3changegroup_add_strm() and sqlite3changegroup_output_strm(). */ @@ -9416,7 +9416,7 @@ int sqlite3changegroup_new(sqlite3_changegroup **pp); ** CAPI3REF: Add A Changeset To A Changegroup ** ** Add all changes within the changeset (or patchset) in buffer pData (size -** nData bytes) to the changegroup. +** nData bytes) to the changegroup. ** ** If the buffer contains a patchset, then all prior calls to this function ** on the same changegroup object must also have specified patchsets. Or, if @@ -9443,7 +9443,7 @@ int sqlite3changegroup_new(sqlite3_changegroup **pp); ** changeset was recorded immediately after the changesets already ** added to the changegroup. ** INSERT UPDATE -** The INSERT change remains in the changegroup. The values in the +** The INSERT change remains in the changegroup. The values in the ** INSERT change are modified as if the row was inserted by the ** existing change and then updated according to the new change. ** INSERT DELETE @@ -9454,17 +9454,17 @@ int sqlite3changegroup_new(sqlite3_changegroup **pp); ** changeset was recorded immediately after the changesets already ** added to the changegroup. ** UPDATE UPDATE -** The existing UPDATE remains within the changegroup. It is amended -** so that the accompanying values are as if the row was updated once +** The existing UPDATE remains within the changegroup. It is amended +** so that the accompanying values are as if the row was updated once ** by the existing change and then again by the new change. ** UPDATE DELETE ** The existing UPDATE is replaced by the new DELETE within the ** changegroup. ** DELETE INSERT ** If one or more of the column values in the row inserted by the -** new change differ from those in the row deleted by the existing +** new change differ from those in the row deleted by the existing ** change, the existing DELETE is replaced by an UPDATE within the -** changegroup. Otherwise, if the inserted row is exactly the same +** changegroup. Otherwise, if the inserted row is exactly the same ** as the deleted row, the existing DELETE is simply discarded. ** DELETE UPDATE ** The new change is ignored. This case does not occur if the new @@ -9508,7 +9508,7 @@ int sqlite3changegroup_add(sqlite3_changegroup*, int nData, void *pData); ** ** If an error occurs, an SQLite error code is returned and the output ** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK -** is returned and the output variables are set to the size of and a +** is returned and the output variables are set to the size of and a ** pointer to the output buffer, respectively. In this case it is the ** responsibility of the caller to eventually free the buffer using a ** call to sqlite3_free(). @@ -9536,21 +9536,21 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** change in the changeset, the filter callback is invoked with ** the table name as the second argument, and a copy of the context pointer ** passed as the sixth argument to this function as the first. If the "filter -** callback" returns zero, then no attempt is made to apply any changes to +** callback" returns zero, then no attempt is made to apply any changes to ** the table. Otherwise, if the return value is non-zero or the xFilter ** argument to this function is NULL, all changes related to the table are ** attempted. ** -** For each table that is not excluded by the filter callback, this function -** tests that the target database contains a compatible table. A table is +** For each table that is not excluded by the filter callback, this function +** tests that the target database contains a compatible table. A table is ** considered compatible if all of the following are true: ** **
          -**
        • The table has the same name as the name recorded in the +**
        • The table has the same name as the name recorded in the ** changeset, and -**
        • The table has at least as many columns as recorded in the +**
        • The table has at least as many columns as recorded in the ** changeset, and -**
        • The table has primary key columns in the same position as +**
        • The table has primary key columns in the same position as ** recorded in the changeset. **
        ** @@ -9559,11 +9559,11 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** via the sqlite3_log() mechanism with the error code SQLITE_SCHEMA. At most ** one such warning is issued for each table in the changeset. ** -** For each change for which there is a compatible table, an attempt is made -** to modify the table contents according to the UPDATE, INSERT or DELETE -** change. If a change cannot be applied cleanly, the conflict handler -** function passed as the fifth argument to sqlite3changeset_apply() may be -** invoked. A description of exactly when the conflict handler is invoked for +** For each change for which there is a compatible table, an attempt is made +** to modify the table contents according to the UPDATE, INSERT or DELETE +** change. If a change cannot be applied cleanly, the conflict handler +** function passed as the fifth argument to sqlite3changeset_apply() may be +** invoked. A description of exactly when the conflict handler is invoked for ** each type of change is below. ** ** Unlike the xFilter argument, xConflict may not be passed NULL. The results @@ -9571,23 +9571,23 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** argument are undefined. ** ** Each time the conflict handler function is invoked, it must return one -** of [SQLITE_CHANGESET_OMIT], [SQLITE_CHANGESET_ABORT] or +** of [SQLITE_CHANGESET_OMIT], [SQLITE_CHANGESET_ABORT] or ** [SQLITE_CHANGESET_REPLACE]. SQLITE_CHANGESET_REPLACE may only be returned ** if the second argument passed to the conflict handler is either ** SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT. If the conflict-handler ** returns an illegal value, any changes already made are rolled back and -** the call to sqlite3changeset_apply() returns SQLITE_MISUSE. Different +** the call to sqlite3changeset_apply() returns SQLITE_MISUSE. Different ** actions are taken by sqlite3changeset_apply() depending on the value ** returned by each invocation of the conflict-handler function. Refer to -** the documentation for the three +** the documentation for the three ** [SQLITE_CHANGESET_OMIT|available return values] for details. ** **
        **
        DELETE Changes
        -** For each DELETE change, this function checks if the target database -** contains a row with the same primary key value (or values) as the -** original row values stored in the changeset. If it does, and the values -** stored in all non-primary key columns also match the values stored in +** For each DELETE change, this function checks if the target database +** contains a row with the same primary key value (or values) as the +** original row values stored in the changeset. If it does, and the values +** stored in all non-primary key columns also match the values stored in ** the changeset the row is deleted from the target database. ** ** If a row with matching primary key values is found, but one or more of @@ -9616,22 +9616,22 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** database table, the trailing fields are populated with their default ** values. ** -** If the attempt to insert the row fails because the database already +** If the attempt to insert the row fails because the database already ** contains a row with the same primary key values, the conflict handler -** function is invoked with the second argument set to +** function is invoked with the second argument set to ** [SQLITE_CHANGESET_CONFLICT]. ** ** If the attempt to insert the row fails because of some other constraint -** violation (e.g. NOT NULL or UNIQUE), the conflict handler function is +** violation (e.g. NOT NULL or UNIQUE), the conflict handler function is ** invoked with the second argument set to [SQLITE_CHANGESET_CONSTRAINT]. -** This includes the case where the INSERT operation is re-attempted because -** an earlier call to the conflict handler function returned +** This includes the case where the INSERT operation is re-attempted because +** an earlier call to the conflict handler function returned ** [SQLITE_CHANGESET_REPLACE]. ** **
        UPDATE Changes
        -** For each UPDATE change, this function checks if the target database -** contains a row with the same primary key value (or values) as the -** original row values stored in the changeset. If it does, and the values +** For each UPDATE change, this function checks if the target database +** contains a row with the same primary key value (or values) as the +** original row values stored in the changeset. If it does, and the values ** stored in all modified non-primary key columns also match the values ** stored in the changeset the row is updated within the target database. ** @@ -9647,12 +9647,12 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** the conflict-handler function is invoked with [SQLITE_CHANGESET_NOTFOUND] ** passed as the second argument. ** -** If the UPDATE operation is attempted, but SQLite returns -** SQLITE_CONSTRAINT, the conflict-handler function is invoked with +** If the UPDATE operation is attempted, but SQLite returns +** SQLITE_CONSTRAINT, the conflict-handler function is invoked with ** [SQLITE_CHANGESET_CONSTRAINT] passed as the second argument. -** This includes the case where the UPDATE operation is attempted after +** This includes the case where the UPDATE operation is attempted after ** an earlier call to the conflict handler function returned -** [SQLITE_CHANGESET_REPLACE]. +** [SQLITE_CHANGESET_REPLACE]. **
        ** ** It is safe to execute SQL statements, including those that write to the @@ -9663,7 +9663,7 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** All changes made by this function are enclosed in a savepoint transaction. ** If any other error (aside from a constraint failure when attempting to ** write to the target database) occurs, then the savepoint transaction is -** rolled back, restoring the target database to its original state, and an +** rolled back, restoring the target database to its original state, and an ** SQLite error code returned. */ SQLITE_API int sqlite3changeset_apply( @@ -9682,7 +9682,7 @@ SQLITE_API int sqlite3changeset_apply( void *pCtx /* First argument passed to xConflict */ ); -/* +/* ** CAPI3REF: Constants Passed To The Conflict Handler ** ** Values that may be passed as the second argument to a conflict-handler. @@ -9691,32 +9691,32 @@ SQLITE_API int sqlite3changeset_apply( **
        SQLITE_CHANGESET_DATA
        ** The conflict handler is invoked with CHANGESET_DATA as the second argument ** when processing a DELETE or UPDATE change if a row with the required -** PRIMARY KEY fields is present in the database, but one or more other -** (non primary-key) fields modified by the update do not contain the +** PRIMARY KEY fields is present in the database, but one or more other +** (non primary-key) fields modified by the update do not contain the ** expected "before" values. -** +** ** The conflicting row, in this case, is the database row with the matching ** primary key. -** +** **
        SQLITE_CHANGESET_NOTFOUND
        ** The conflict handler is invoked with CHANGESET_NOTFOUND as the second ** argument when processing a DELETE or UPDATE change if a row with the ** required PRIMARY KEY fields is not present in the database. -** +** ** There is no conflicting row in this case. The results of invoking the ** sqlite3changeset_conflict() API are undefined. -** +** **
        SQLITE_CHANGESET_CONFLICT
        ** CHANGESET_CONFLICT is passed as the second argument to the conflict -** handler while processing an INSERT change if the operation would result +** handler while processing an INSERT change if the operation would result ** in duplicate primary key values. -** +** ** The conflicting row in this case is the database row with the matching ** primary key. ** **
        SQLITE_CHANGESET_FOREIGN_KEY
        ** If foreign key handling is enabled, and applying a changeset leaves the -** database in a state containing foreign key violations, the conflict +** database in a state containing foreign key violations, the conflict ** handler is invoked with CHANGESET_FOREIGN_KEY as the second argument ** exactly once before the changeset is committed. If the conflict handler ** returns CHANGESET_OMIT, the changes, including those that caused the @@ -9726,12 +9726,12 @@ SQLITE_API int sqlite3changeset_apply( ** No current or conflicting row information is provided. The only function ** it is possible to call on the supplied sqlite3_changeset_iter handle ** is sqlite3changeset_fk_conflicts(). -** +** **
        SQLITE_CHANGESET_CONSTRAINT
        -** If any other constraint violation occurs while applying a change (i.e. -** a UNIQUE, CHECK or NOT NULL constraint), the conflict handler is +** If any other constraint violation occurs while applying a change (i.e. +** a UNIQUE, CHECK or NOT NULL constraint), the conflict handler is ** invoked with CHANGESET_CONSTRAINT as the second argument. -** +** ** There is no conflicting row in this case. The results of invoking the ** sqlite3changeset_conflict() API are undefined. ** @@ -9743,7 +9743,7 @@ SQLITE_API int sqlite3changeset_apply( #define SQLITE_CHANGESET_CONSTRAINT 4 #define SQLITE_CHANGESET_FOREIGN_KEY 5 -/* +/* ** CAPI3REF: Constants Returned By The Conflict Handler ** ** A conflict handler callback must return one of the following three values. @@ -9751,13 +9751,13 @@ SQLITE_API int sqlite3changeset_apply( **
        **
        SQLITE_CHANGESET_OMIT
        ** If a conflict handler returns this value no special action is taken. The -** change that caused the conflict is not applied. The session module +** change that caused the conflict is not applied. The session module ** continues to the next change in the changeset. ** **
        SQLITE_CHANGESET_REPLACE
        ** This value may only be returned if the second argument to the conflict ** handler was SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT. If this -** is not the case, any changes applied so far are rolled back and the +** is not the case, any changes applied so far are rolled back and the ** call to sqlite3changeset_apply() returns SQLITE_MISUSE. ** ** If CHANGESET_REPLACE is returned by an SQLITE_CHANGESET_DATA conflict @@ -9770,7 +9770,7 @@ SQLITE_API int sqlite3changeset_apply( ** the original row is restored to the database before continuing. ** **
        SQLITE_CHANGESET_ABORT
        -** If this value is returned, any changes applied so far are rolled back +** If this value is returned, any changes applied so far are rolled back ** and the call to sqlite3changeset_apply() returns SQLITE_ABORT. **
        */ @@ -9781,24 +9781,24 @@ SQLITE_API int sqlite3changeset_apply( /* ** CAPI3REF: Streaming Versions of API functions. ** -** The six streaming API xxx_strm() functions serve similar purposes to the +** The six streaming API xxx_strm() functions serve similar purposes to the ** corresponding non-streaming API functions: ** ** ** -**
        Streaming functionNon-streaming equivalent
        sqlite3changeset_apply_str[sqlite3changeset_apply] -**
        sqlite3changeset_concat_str[sqlite3changeset_concat] -**
        sqlite3changeset_invert_str[sqlite3changeset_invert] -**
        sqlite3changeset_start_str[sqlite3changeset_start] -**
        sqlite3session_changeset_str[sqlite3session_changeset] -**
        sqlite3session_patchset_str[sqlite3session_patchset] +**
        sqlite3changeset_apply_str[sqlite3changeset_apply] +**
        sqlite3changeset_concat_str[sqlite3changeset_concat] +**
        sqlite3changeset_invert_str[sqlite3changeset_invert] +**
        sqlite3changeset_start_str[sqlite3changeset_start] +**
        sqlite3session_changeset_str[sqlite3session_changeset] +**
        sqlite3session_patchset_str[sqlite3session_patchset] **
        ** ** Non-streaming functions that accept changesets (or patchsets) as input -** require that the entire changeset be stored in a single buffer in memory. -** Similarly, those that return a changeset or patchset do so by returning -** a pointer to a single large buffer allocated using sqlite3_malloc(). -** Normally this is convenient. However, if an application running in a +** require that the entire changeset be stored in a single buffer in memory. +** Similarly, those that return a changeset or patchset do so by returning +** a pointer to a single large buffer allocated using sqlite3_malloc(). +** Normally this is convenient. However, if an application running in a ** low-memory environment is required to handle very large changesets, the ** large contiguous memory allocations required can become onerous. ** @@ -9820,12 +9820,12 @@ SQLITE_API int sqlite3changeset_apply( ** ** ** Each time the xInput callback is invoked by the sessions module, the first -** argument passed is a copy of the supplied pIn context pointer. The second -** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no -** error occurs the xInput method should copy up to (*pnData) bytes of data -** into the buffer and set (*pnData) to the actual number of bytes copied -** before returning SQLITE_OK. If the input is completely exhausted, (*pnData) -** should be set to zero to indicate this. Or, if an error occurs, an SQLite +** argument passed is a copy of the supplied pIn context pointer. The second +** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no +** error occurs the xInput method should copy up to (*pnData) bytes of data +** into the buffer and set (*pnData) to the actual number of bytes copied +** before returning SQLITE_OK. If the input is completely exhausted, (*pnData) +** should be set to zero to indicate this. Or, if an error occurs, an SQLite ** error code should be returned. In all cases, if an xInput callback returns ** an error, all processing is abandoned and the streaming API function ** returns a copy of the error code to the caller. @@ -9833,7 +9833,7 @@ SQLITE_API int sqlite3changeset_apply( ** In the case of sqlite3changeset_start_strm(), the xInput callback may be ** invoked by the sessions module at any point during the lifetime of the ** iterator. If such an xInput callback returns an error, the iterator enters -** an error state, whereby all subsequent calls to iterator functions +** an error state, whereby all subsequent calls to iterator functions ** immediately fail with the same error code as returned by xInput. ** ** Similarly, streaming API functions that return changesets (or patchsets) @@ -9863,7 +9863,7 @@ SQLITE_API int sqlite3changeset_apply( ** is immediately abandoned and the streaming API function returns a copy ** of the xOutput error code to the application. ** -** The sessions module never invokes an xOutput callback with the third +** The sessions module never invokes an xOutput callback with the third ** parameter set to a value less than or equal to zero. Other than this, ** no guarantees are made as to the size of the chunks of data returned. */ @@ -9911,12 +9911,12 @@ SQLITE_API int sqlite3session_patchset_strm( int (*xOutput)(void *pOut, const void *pData, int nData), void *pOut ); -int sqlite3changegroup_add_strm(sqlite3_changegroup*, +int sqlite3changegroup_add_strm(sqlite3_changegroup*, int (*xInput)(void *pIn, void *pData, int *pnData), void *pIn ); int sqlite3changegroup_output_strm(sqlite3_changegroup*, - int (*xOutput)(void *pOut, const void *pData, int nData), + int (*xOutput)(void *pOut, const void *pData, int nData), void *pOut ); @@ -9944,7 +9944,7 @@ int sqlite3changegroup_output_strm(sqlite3_changegroup*, ** ****************************************************************************** ** -** Interfaces to extend FTS5. Using the interfaces defined in this file, +** Interfaces to extend FTS5. Using the interfaces defined in this file, ** FTS5 may be extended with: ** ** * custom tokenizers, and @@ -9988,19 +9988,19 @@ struct Fts5PhraseIter { ** EXTENSION API FUNCTIONS ** ** xUserData(pFts): -** Return a copy of the context pointer the extension function was +** Return a copy of the context pointer the extension function was ** registered with. ** ** xColumnTotalSize(pFts, iCol, pnToken): ** If parameter iCol is less than zero, set output variable *pnToken ** to the total number of tokens in the FTS5 table. Or, if iCol is ** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in +** the total number of tokens in column iCol, considering all rows in ** the FTS5 table. ** ** If parameter iCol is greater than or equal to the number of columns ** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is +** an OOM condition or IO error), an appropriate SQLite error code is ** returned. ** ** xColumnCount(pFts): @@ -10014,7 +10014,7 @@ struct Fts5PhraseIter { ** ** If parameter iCol is greater than or equal to the number of columns ** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is +** an OOM condition or IO error), an appropriate SQLite error code is ** returned. ** ** This function may be quite inefficient if used with an FTS5 table @@ -10041,8 +10041,8 @@ struct Fts5PhraseIter { ** an error code (i.e. SQLITE_NOMEM) if an error occurs. ** ** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option +** "detail=none" or "detail=column" option. If the FTS5 table is created +** with either "detail=none" or "detail=column" and "content=" option ** (i.e. if it is a contentless table), then this API always returns 0. ** ** xInst: @@ -10057,11 +10057,11 @@ struct Fts5PhraseIter { ** with the offsets=0 option specified. In this case *piOff is always ** set to -1. ** -** Returns SQLITE_OK if successful, or an error code (i.e. SQLITE_NOMEM) +** Returns SQLITE_OK if successful, or an error code (i.e. SQLITE_NOMEM) ** if an error occurs. ** ** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. +** "detail=none" or "detail=column" option. ** ** xRowid: ** Returns the rowid of the current row. @@ -10077,11 +10077,11 @@ struct Fts5PhraseIter { ** ** with $p set to a phrase equivalent to the phrase iPhrase of the ** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback +** phrase iPhrase of the current query is included in $p. For each +** row visited, the callback function passed as the fourth argument +** is invoked. The context and API objects passed to the callback ** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as +** Invoking Api.xUserData() returns a copy of the pointer passed as ** the third argument to pUserData. ** ** If the callback function returns any value other than SQLITE_OK, the @@ -10096,14 +10096,14 @@ struct Fts5PhraseIter { ** ** xSetAuxdata(pFts5, pAux, xDelete) ** -** Save the pointer passed as the second argument as the extension functions +** Save the pointer passed as the second argument as the extension functions ** "auxiliary data". The pointer may then be retrieved by the current or any ** future invocation of the same fts5 extension function made as part of ** of the same MATCH query using the xGetAuxdata() API. ** ** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a +** each FTS query (MATCH expression). If the extension function is invoked +** more than once for a single FTS query, then all invocations share a ** single auxiliary data context. ** ** If there is already an auxiliary data pointer when this function is @@ -10122,7 +10122,7 @@ struct Fts5PhraseIter { ** ** xGetAuxdata(pFts5, bClear) ** -** Returns the current auxiliary data pointer for the fts5 extension +** Returns the current auxiliary data pointer for the fts5 extension ** function. See the xSetAuxdata() method for details. ** ** If the bClear argument is non-zero, then the auxiliary data is cleared @@ -10142,7 +10142,7 @@ struct Fts5PhraseIter { ** method, to iterate through all instances of a single query phrase within ** the current row. This is the same information as is accessible via the ** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate +** to use, this API may be faster under some circumstances. To iterate ** through instances of phrase iPhrase, use the following code: ** ** Fts5PhraseIter iter; @@ -10160,8 +10160,8 @@ struct Fts5PhraseIter { ** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). ** ** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option +** "detail=none" or "detail=column" option. If the FTS5 table is created +** with either "detail=none" or "detail=column" and "content=" option ** (i.e. if it is a contentless table), then this API always iterates ** through an empty set (all calls to xPhraseFirst() set iCol to -1). ** @@ -10185,16 +10185,16 @@ struct Fts5PhraseIter { ** } ** ** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to +** "detail=none" option. If the FTS5 table is created with either +** "detail=none" "content=" option (i.e. if it is a contentless table), +** then this API always iterates through an empty set (all calls to ** xPhraseFirstColumn() set iCol to -1). ** ** The information accessed using this API and its companion ** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext ** (or xInst/xInstCount). The chief advantage of this API is that it is ** significantly more efficient than those alternatives when used with -** "detail=column" tables. +** "detail=column" tables. ** ** xPhraseNextColumn() ** See xPhraseFirstColumn above. @@ -10208,7 +10208,7 @@ struct Fts5ExtensionApi { int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken); - int (*xTokenize)(Fts5Context*, + int (*xTokenize)(Fts5Context*, const char *pText, int nText, /* Text to tokenize */ void *pCtx, /* Context passed to xToken() */ int (*xToken)(void*, int, const char*, int, int, int) /* Callback */ @@ -10237,15 +10237,15 @@ struct Fts5ExtensionApi { void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); }; -/* +/* ** CUSTOM AUXILIARY FUNCTIONS *************************************************************************/ /************************************************************************* ** CUSTOM TOKENIZERS ** -** Applications may also register custom tokenizer types. A tokenizer -** is registered by providing fts5 with a populated instance of the +** Applications may also register custom tokenizer types. A tokenizer +** is registered by providing fts5 with a populated instance of the ** following structure. All structure methods must be defined, setting ** any member of the fts5_tokenizer struct to NULL leads to undefined ** behaviour. The structure methods are expected to function as follows: @@ -10256,16 +10256,16 @@ struct Fts5ExtensionApi { ** ** The first argument passed to this function is a copy of the (void*) ** pointer provided by the application when the fts5_tokenizer object -** was registered with FTS5 (the third argument to xCreateTokenizer()). +** was registered with FTS5 (the third argument to xCreateTokenizer()). ** The second and third arguments are an array of nul-terminated strings ** containing the tokenizer arguments, if any, specified following the ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used ** to create the FTS5 table. ** -** The final argument is an output variable. If successful, (*ppOut) +** The final argument is an output variable. If successful, (*ppOut) ** should be set to point to the new tokenizer handle and SQLITE_OK ** returned. If an error occurs, some value other than SQLITE_OK should -** be returned. In this case, fts5 assumes that the final value of *ppOut +** be returned. In this case, fts5 assumes that the final value of *ppOut ** is undefined. ** ** xDelete: @@ -10274,7 +10274,7 @@ struct Fts5ExtensionApi { ** be invoked exactly once for each successful call to xCreate(). ** ** xTokenize: -** This function is expected to tokenize the nText byte string indicated +** This function is expected to tokenize the nText byte string indicated ** by argument pText. pText may or may not be nul-terminated. The first ** argument passed to this function is a pointer to an Fts5Tokenizer object ** returned by an earlier call to xCreate(). @@ -10288,8 +10288,8 @@ struct Fts5ExtensionApi { ** determine the set of tokens to add to (or delete from) the ** FTS index. ** -**
      • FTS5_TOKENIZE_QUERY - A MATCH query is being executed -** against the FTS index. The tokenizer is being called to tokenize +**
      • FTS5_TOKENIZE_QUERY - A MATCH query is being executed +** against the FTS index. The tokenizer is being called to tokenize ** a bareword or quoted string specified as part of the query. ** **
      • (FTS5_TOKENIZE_QUERY | FTS5_TOKENIZE_PREFIX) - Same as @@ -10297,10 +10297,10 @@ struct Fts5ExtensionApi { ** followed by a "*" character, indicating that the last token ** returned by the tokenizer will be treated as a token prefix. ** -**
      • FTS5_TOKENIZE_AUX - The tokenizer is being invoked to +**
      • FTS5_TOKENIZE_AUX - The tokenizer is being invoked to ** satisfy an fts5_api.xTokenize() request made by an auxiliary ** function. Or an fts5_api.xColumnSize() request made by the same -** on a columnsize=0 database. +** on a columnsize=0 database. **
      ** ** For each token in the input string, the supplied callback xToken() must @@ -10312,10 +10312,10 @@ struct Fts5ExtensionApi { ** which the token is derived within the input. ** ** The second argument passed to the xToken() callback ("tflags") should -** normally be set to 0. The exception is if the tokenizer supports +** normally be set to 0. The exception is if the tokenizer supports ** synonyms. In this case see the discussion below for details. ** -** FTS5 assumes the xToken() callback is invoked for each token in the +** FTS5 assumes the xToken() callback is invoked for each token in the ** order that they occur within the input text. ** ** If an xToken() callback returns any value other than SQLITE_OK, then @@ -10329,7 +10329,7 @@ struct Fts5ExtensionApi { ** SYNONYM SUPPORT ** ** Custom tokenizers may also support synonyms. Consider a case in which a -** user wishes to query for a phrase such as "first place". Using the +** user wishes to query for a phrase such as "first place". Using the ** built-in tokenizers, the FTS5 query 'first + place' will match instances ** of "first place" within the document set, but not alternative forms ** such as "1st place". In some applications, it would be better to match @@ -10338,7 +10338,7 @@ struct Fts5ExtensionApi { ** ** There are several ways to approach this in FTS5: ** -**
      1. By mapping all synonyms to a single token. In this case, the +**
        1. By mapping all synonyms to a single token. In this case, the ** In the above example, this means that the tokenizer returns the ** same token for inputs "first" and "1st". Say that token is in ** fact "first", so that when the user inserts the document "I won @@ -10348,7 +10348,7 @@ struct Fts5ExtensionApi { ** as expected. ** **
        2. By adding multiple synonyms for a single term to the FTS index. -** In this case, when tokenizing query text, the tokenizer may +** In this case, when tokenizing query text, the tokenizer may ** provide multiple synonyms for a single term within the document. ** FTS5 then queries the index for each synonym individually. For ** example, faced with the query: @@ -10357,26 +10357,26 @@ struct Fts5ExtensionApi { ** ... MATCH 'first place' ** ** the tokenizer offers both "1st" and "first" as synonyms for the -** first token in the MATCH query and FTS5 effectively runs a query +** first token in the MATCH query and FTS5 effectively runs a query ** similar to: ** ** ** ... MATCH '(first OR 1st) place' ** ** except that, for the purposes of auxiliary functions, the query -** still appears to contain just two phrases - "(first OR 1st)" +** still appears to contain just two phrases - "(first OR 1st)" ** being treated as a single phrase. ** **
        3. By adding multiple synonyms for a single term to the FTS index. ** Using this method, when tokenizing document text, the tokenizer -** provides multiple synonyms for each token. So that when a +** provides multiple synonyms for each token. So that when a ** document such as "I won first place" is tokenized, entries are ** added to the FTS index for "i", "won", "first", "1st" and ** "place". ** ** This way, even if the tokenizer does not provide synonyms ** when tokenizing query text (it should not - to do would be -** inefficient), it doesn't matter if the user queries for +** inefficient), it doesn't matter if the user queries for ** 'first + place' or '1st + place', as there are entires in the ** FTS index corresponding to both forms of the first token. **
        @@ -10397,11 +10397,11 @@ struct Fts5ExtensionApi { ** ** It is an error to specify the FTS5_TOKEN_COLOCATED flag the first time ** xToken() is called. Multiple synonyms may be specified for a single token -** by making multiple calls to xToken(FTS5_TOKEN_COLOCATED) in sequence. +** by making multiple calls to xToken(FTS5_TOKEN_COLOCATED) in sequence. ** There is no limit to the number of synonyms that may be provided for a ** single token. ** -** In many cases, method (1) above is the best approach. It does not add +** In many cases, method (1) above is the best approach. It does not add ** extra data to the FTS index or require FTS5 to query for multiple terms, ** so it is efficient in terms of disk space and query speed. However, it ** does not support prefix queries very well. If, as suggested above, the @@ -10413,18 +10413,18 @@ struct Fts5ExtensionApi { ** will not match documents that contain the token "1st" (as the tokenizer ** will probably not map "1s" to any prefix of "first"). ** -** For full prefix support, method (3) may be preferred. In this case, +** For full prefix support, method (3) may be preferred. In this case, ** because the index contains entries for both "first" and "1st", prefix ** queries such as 'fi*' or '1s*' will match correctly. However, because ** extra entries are added to the FTS index, this method uses more space ** within the database. ** ** Method (2) offers a midpoint between (1) and (3). Using this method, -** a query such as '1s*' will match documents that contain the literal +** a query such as '1s*' will match documents that contain the literal ** token "1st", but not "first" (assuming the tokenizer is not able to ** provide synonyms for prefixes). However, a non-prefix query like '1st' ** will match against "1st" and "first". This method does not require -** extra disk space, as no extra entries are added to the FTS index. +** extra disk space, as no extra entries are added to the FTS index. ** On the other hand, it may require more CPU cycles to run MATCH queries, ** as separate queries of the FTS index are required for each synonym. ** @@ -10438,10 +10438,10 @@ typedef struct fts5_tokenizer fts5_tokenizer; struct fts5_tokenizer { int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); void (*xDelete)(Fts5Tokenizer*); - int (*xTokenize)(Fts5Tokenizer*, + int (*xTokenize)(Fts5Tokenizer*, void *pCtx, int flags, /* Mask of FTS5_TOKENIZE_* flags */ - const char *pText, int nText, + const char *pText, int nText, int (*xToken)( void *pCtx, /* Copy of 2nd argument to xTokenize() */ int tflags, /* Mask of FTS5_TOKEN_* flags */ diff --git a/third_party/sqlite/patches/0001-test-SQLite-tests-compiling-on-Linux.patch b/third_party/sqlite/patches/0001-test-SQLite-tests-compiling-on-Linux.patch index 135e611b51f5c..0d7e8ffbe5709 100644 --- a/third_party/sqlite/patches/0001-test-SQLite-tests-compiling-on-Linux.patch +++ b/third_party/sqlite/patches/0001-test-SQLite-tests-compiling-on-Linux.patch @@ -18,7 +18,7 @@ index 1491a4b02a80..a1dec21affea 100644 # -TOP = ../sqlite +TOP = .. - + #### C Compiler and options for use in building executables that # will run on the platform that is doing the build. @@ -32,19 +32,19 @@ USLEEP = -DHAVE_USLEEP=1 @@ -29,26 +29,26 @@ index 1491a4b02a80..a1dec21affea 100644 -THREADSAFE = -DTHREADSAFE=0 +THREADSAFE = -DTHREADSAFE=1 +#THREADSAFE = -DTHREADSAFE=0 - + #### Specify any extra linker options needed to make the library # thread safe # -#THREADLIB = -lpthread --THREADLIB = +-THREADLIB = +THREADLIB = -lpthread -+#THREADLIB = - ++#THREADLIB = + #### Specify any extra libraries needed to access required functions. # #TLIBS = -lrt # fdatasync on Solaris 8 --TLIBS = +-TLIBS = +TLIBS = -ldl - + #### Leave SQLITE_DEBUG undefined for maximum speed. Use SQLITE_DEBUG=1 # to check for memory leaks. Use SQLITE_DEBUG=2 to print a log of all @@ -58,7 +58,24 @@ TLIBS = #OPTS = -DSQLITE_DEBUG=1 - #OPTS = + #OPTS = OPTS = -DNDEBUG=1 -OPTS += -DHAVE_FDATASYNC=1 +#OPTS += -DHAVE_FDATASYNC=1 @@ -69,7 +69,7 @@ index 1491a4b02a80..a1dec21affea 100644 + +# TODO(shess) I can't see why I need this setting. +OPTS += -DOS_UNIX=1 - + #### The suffix to add to executable files. ".exe" for windows. # Nothing for unix. @@ -70,7 +87,7 @@ EXE = @@ -82,7 +82,7 @@ index 1491a4b02a80..a1dec21affea 100644 #TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage #TCC = /opt/mingw/bin/i386-mingw32-gcc -O6 @@ -91,16 +108,16 @@ SHPREFIX = lib - + #### Extra compiler options needed for programs that use the TCL library. # -#TCL_FLAGS = @@ -92,7 +92,7 @@ index 1491a4b02a80..a1dec21affea 100644 +#TCL_FLAGS = -I/home/drh/tcltk/8.5linux #TCL_FLAGS = -I/home/drh/tcltk/8.5win -DSTATIC_BUILD=1 #TCL_FLAGS = -I/home/drh/tcltk/8.3hpux - + #### Linker options needed to link against the TCL library. # -#LIBTCL = -ltcl -lm -ldl @@ -101,20 +101,20 @@ index 1491a4b02a80..a1dec21affea 100644 +#LIBTCL = /home/drh/tcltk/8.5linux/libtcl8.5g.a -lm -ldl #LIBTCL = /home/drh/tcltk/8.5win/libtcl85s.a -lmsvcrt #LIBTCL = /home/drh/tcltk/8.3hpux/libtcl8.3.a -ldld -lm -lc - + diff --git a/third_party/sqlite/src/main.mk b/third_party/sqlite/src/main.mk index 85ed76a143c1..6feb638b9280 100644 --- a/third_party/sqlite/src/main.mk +++ b/third_party/sqlite/src/main.mk @@ -760,7 +760,7 @@ sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl echo "; return zMainloop; }" >> $@ - + sqlite3_analyzer$(EXE): sqlite3_analyzer.c -- $(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB) +- $(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(THREADLIB) + $(TCCX) $(TCL_FLAGS) sqlite3_analyzer.c -o $@ $(LIBTCL) $(TLIBS) $(THREADLIB) - + # Rules to build the 'testfixture' application. # --- +-- 2.11.0 diff --git a/third_party/sqlite/patches/0002-Use-seperate-page-cache-pools-for-each-sqlite-connec.patch b/third_party/sqlite/patches/0002-Use-seperate-page-cache-pools-for-each-sqlite-connec.patch index dbd29cc120ce8..266fdf04ed16a 100644 --- a/third_party/sqlite/patches/0002-Use-seperate-page-cache-pools-for-each-sqlite-connec.patch +++ b/third_party/sqlite/patches/0002-Use-seperate-page-cache-pools-for-each-sqlite-connec.patch @@ -39,6 +39,6 @@ index 110d7ec656ae..3b938ce7b2f8 100644 pcache1.separateCache = 0; #elif SQLITE_THREADSAFE pcache1.separateCache = sqlite3GlobalConfig.pPage==0 --- +-- 2.11.0 diff --git a/third_party/sqlite/patches/0003-Modify-default-VFS-to-support-WebDatabase.patch b/third_party/sqlite/patches/0003-Modify-default-VFS-to-support-WebDatabase.patch index aa016b2286c73..4b97092418fd3 100644 --- a/third_party/sqlite/patches/0003-Modify-default-VFS-to-support-WebDatabase.patch +++ b/third_party/sqlite/patches/0003-Modify-default-VFS-to-support-WebDatabase.patch @@ -37,11 +37,11 @@ index 7f0ebdba6fdf..60981af7e738 100644 + return 0; + return pFile->pInode!=0 && - (osStat(pFile->zPath, &buf)!=0 + (osStat(pFile->zPath, &buf)!=0 || (u64)buf.st_ino!=pFile->pInode->fileId.ino); @@ -5640,6 +5646,44 @@ static int findCreateFileMode( } - + /* +** Initialize |unixFile| internals of |file| on behalf of chromiumOpen() in +** WebDatabase SQLiteFileSystemPosix.cpp. Function is a subset of unixOpen(), @@ -82,15 +82,15 @@ index 7f0ebdba6fdf..60981af7e738 100644 + +/* ** Open the file zPath. - ** + ** ** Previously, the SQLite OS layer used three functions in place of this @@ -5740,6 +5784,7 @@ static int unixOpen( sqlite3_randomness(0,0); } - + + /* Duplicated in chromium_sqlite3_fill_in_unix_sqlite3_file(). */ memset(p, 0, sizeof(unixFile)); - + if( eType==SQLITE_OPEN_MAIN_DB ){ @@ -5748,6 +5793,7 @@ static int unixOpen( if( pUnused ){ @@ -102,7 +102,7 @@ index 7f0ebdba6fdf..60981af7e738 100644 return SQLITE_NOMEM_BKPT; @@ -5825,6 +5871,7 @@ static int unixOpen( } - + if( p->pUnused ){ + /* Duplicated in chromium_sqlite3_fill_in_unix_sqlite3_file(). */ p->pUnused->fd = fd; @@ -111,10 +111,10 @@ index 7f0ebdba6fdf..60981af7e738 100644 @@ -5903,10 +5950,12 @@ static int unixOpen( } #endif - + + /* Duplicated in chromium_sqlite3_fill_in_unix_sqlite3_file(). */ rc = fillInUnixFile(pVfs, fd, pFile, zPath, ctrlFlags); - + open_finished: if( rc!=SQLITE_OK ){ + /* Duplicated in chromium_sqlite3_fill_in_unix_sqlite3_file(). */ @@ -128,7 +128,7 @@ index 2cb5f7b0c836..94dcd0e047f9 100644 @@ -5960,4 +5960,12 @@ int sqlite3_os_end(void){ return SQLITE_OK; } - + +CHROMIUM_SQLITE_API +void chromium_sqlite3_initialize_win_sqlite3_file(sqlite3_file* file, HANDLE handle) { + winFile* winSQLite3File = (winFile*)file; @@ -145,7 +145,7 @@ index eaa75fc249e1..fbbf4b9f2db3 100644 @@ -7697,6 +7697,29 @@ int sqlite3_strnicmp(const char *, const char *, int); */ int sqlite3_strglob(const char *zGlob, const char *zStr); - + +/* Begin WebDatabase patch for Chromium */ +/* Expose some SQLite internals for the WebDatabase vfs. +** DO NOT EXTEND THE USE OF THIS. @@ -172,6 +172,6 @@ index eaa75fc249e1..fbbf4b9f2db3 100644 /* ** CAPI3REF: String LIKE Matching * --- +-- 2.11.0 diff --git a/third_party/sqlite/patches/0004-Virtual-table-supporting-recovery-of-corrupted-datab.patch b/third_party/sqlite/patches/0004-Virtual-table-supporting-recovery-of-corrupted-datab.patch index a6e191c49eb7b..4ef1d6fdc2c51 100644 --- a/third_party/sqlite/patches/0004-Virtual-table-supporting-recovery-of-corrupted-datab.patch +++ b/third_party/sqlite/patches/0004-Virtual-table-supporting-recovery-of-corrupted-datab.patch @@ -40,11 +40,11 @@ index 6feb638b9280..b46c5bbc9ced 100644 @@ -75,6 +75,8 @@ LIBOBJ+= vdbe.o parse.o \ vdbetrace.o wal.o walker.o where.o wherecode.o whereexpr.o \ utf.o vtab.o - + +LIBOBJ += recover.o recover_varint.o resolve.o + LIBOBJ += sqlite3session.o - + # All of the source code files. @@ -370,6 +372,8 @@ TESTSRC2 = \ $(TOP)/src/prepare.c \ @@ -60,7 +60,7 @@ index 6feb638b9280..b46c5bbc9ced 100644 TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1 TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024 +TESTFIXTURE_FLAGS += -DDEFAULT_ENABLE_RECOVER=1 - + testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c $(TCCX) $(TCL_FLAGS) -DTCLSH=1 $(TESTFIXTURE_FLAGS) \ diff --git a/third_party/sqlite/src/src/main.c b/third_party/sqlite/src/src/main.c @@ -70,7 +70,7 @@ index 9aad8fdd4cf8..03e4f1b92845 100644 @@ -3014,6 +3014,14 @@ static int openDatabase( } #endif - + +#ifdef DEFAULT_ENABLE_RECOVER + /* Initialize recover virtual table for testing. */ + extern int recoverVtableInit(sqlite3 *db); @@ -3900,6 +3900,6 @@ index 000000000000..8aa4e049a010 +} [list 4 1024 1 text [string length $substr] $substr] + +finish_test --- +-- 2.11.0 diff --git a/third_party/sqlite/patches/0005-Custom-shell.c-helpers-to-load-Chromium-s-ICU-data.patch b/third_party/sqlite/patches/0005-Custom-shell.c-helpers-to-load-Chromium-s-ICU-data.patch index 355684cf96c0b..3e663042df832 100644 --- a/third_party/sqlite/patches/0005-Custom-shell.c-helpers-to-load-Chromium-s-ICU-data.patch +++ b/third_party/sqlite/patches/0005-Custom-shell.c-helpers-to-load-Chromium-s-ICU-data.patch @@ -24,7 +24,7 @@ index a1dec21affea..c59886b087e2 100644 @@ -77,6 +77,13 @@ OPTS += -DSQLITE_MEMDEBUG=1 # TODO(shess) I can't see why I need this setting. OPTS += -DOS_UNIX=1 - + +# Support for loading Chromium ICU data in sqlite3. +ifeq ($(shell uname -s),Darwin) +SHELL_ICU = @@ -40,12 +40,12 @@ index b46c5bbc9ced..a8e8ffe27562 100644 --- a/third_party/sqlite/src/main.mk +++ b/third_party/sqlite/src/main.mk @@ -498,7 +498,7 @@ libsqlite3.a: $(LIBOBJ) - + sqlite3$(EXE): $(TOP)/src/shell.c libsqlite3.a sqlite3.h $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) $(SHELL_OPT) \ - $(TOP)/src/shell.c libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB) + $(TOP)/src/shell.c $(SHELL_ICU) libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB) - + sqldiff$(EXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h $(TCCX) -o sqldiff$(EXE) -DSQLITE_THREADSAFE=0 \ diff --git a/third_party/sqlite/src/src/shell.c b/third_party/sqlite/src/src/shell.c @@ -55,7 +55,7 @@ index 0e553d9fbb6f..33377da521d3 100644 @@ -5849,6 +5849,16 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ } #endif - + + /* Begin evanm patch. */ +#if !defined(__APPLE__) + extern int sqlite_shell_init_icu(); @@ -140,6 +140,6 @@ index 000000000000..67ebbf4fbdb4 + + return 1; +} --- +-- 2.11.0 diff --git a/third_party/sqlite/patches/0006-fts3-Disable-fts3_tokenizer-and-fts4.patch b/third_party/sqlite/patches/0006-fts3-Disable-fts3_tokenizer-and-fts4.patch index ac27bf170fe45..00151ea7fc094 100644 --- a/third_party/sqlite/patches/0006-fts3-Disable-fts3_tokenizer-and-fts4.patch +++ b/third_party/sqlite/patches/0006-fts3-Disable-fts3_tokenizer-and-fts4.patch @@ -22,13 +22,13 @@ index 7c931c42d49e..9659815da93a 100644 ** older data. */ +#define CHROMIUM_FTS3_CHANGES 1 - + #include "fts3Int.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) @@ -3955,7 +3956,11 @@ int sqlite3Fts3Init(sqlite3 *db){ ** module with sqlite. */ - if( SQLITE_OK==rc + if( SQLITE_OK==rc +#if CHROMIUM_FTS3_CHANGES && !SQLITE_TEST + /* fts3_tokenizer() disabled for security reasons. */ +#else @@ -54,7 +54,7 @@ index 7c931c42d49e..9659815da93a 100644 +#endif return rc; } - --- + +-- 2.11.0 diff --git a/third_party/sqlite/patches/0007-fts3-Interior-node-corruption-detection.patch b/third_party/sqlite/patches/0007-fts3-Interior-node-corruption-detection.patch index e520fdbbe9da1..5ea152921ab8c 100644 --- a/third_party/sqlite/patches/0007-fts3-Interior-node-corruption-detection.patch +++ b/third_party/sqlite/patches/0007-fts3-Interior-node-corruption-detection.patch @@ -27,7 +27,7 @@ index 9659815da93a..4b032271148e 100644 @@ -1844,7 +1844,13 @@ static int fts3ScanInteriorNode( isFirstTerm = 0; zCsr += fts3GetVarint32(zCsr, &nSuffix); - + - if( nPrefix<0 || nSuffix<0 || &zCsr[nSuffix]>zEnd ){ + /* NOTE(shess): Previous code checked for negative nPrefix and + ** nSuffix and suffix overrunning zEnd. Additionally corrupt if @@ -39,6 +39,6 @@ index 9659815da93a..4b032271148e 100644 rc = FTS_CORRUPT_VTAB; goto finish_scan; } --- +-- 2.11.0 diff --git a/third_party/sqlite/patches/0008-fts3-Fix-uninit-variable-in-fts3EvalDeferredPhrase.patch b/third_party/sqlite/patches/0008-fts3-Fix-uninit-variable-in-fts3EvalDeferredPhrase.patch index 358d9fb4298b1..02f2fba146269 100644 --- a/third_party/sqlite/patches/0008-fts3-Fix-uninit-variable-in-fts3EvalDeferredPhrase.patch +++ b/third_party/sqlite/patches/0008-fts3-Fix-uninit-variable-in-fts3EvalDeferredPhrase.patch @@ -19,7 +19,7 @@ index 4b032271148e..2a24b78f3783 100644 +++ b/third_party/sqlite/src/ext/fts3/fts3.c @@ -4171,8 +4171,8 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){ Fts3DeferredToken *pDeferred = pToken->pDeferred; - + if( pDeferred ){ - char *pList; - int nList; @@ -27,7 +27,7 @@ index 4b032271148e..2a24b78f3783 100644 + int nList = 0; int rc = sqlite3Fts3DeferredTokenList(pDeferred, &pList, &nList); if( rc!=SQLITE_OK ) return rc; - --- + +-- 2.11.0 diff --git a/third_party/sqlite/patches/0009-build-Fix-_CRT_RAND_S-conflict-in-sqliteInt.h.patch b/third_party/sqlite/patches/0009-build-Fix-_CRT_RAND_S-conflict-in-sqliteInt.h.patch index 0355d22b0e9f0..f5fdd321c1dbc 100644 --- a/third_party/sqlite/patches/0009-build-Fix-_CRT_RAND_S-conflict-in-sqliteInt.h.patch +++ b/third_party/sqlite/patches/0009-build-Fix-_CRT_RAND_S-conflict-in-sqliteInt.h.patch @@ -24,9 +24,9 @@ index f9768895ae98..ee58edad775c 100644 # define _CRT_RAND_S #endif +#endif - + /* ** Include the header file used to customize the compiler options for MSVC. --- +-- 2.11.0 diff --git a/third_party/sqlite/patches/0010-build-Undefined-symbol-in-intrinsic-on-clang.patch b/third_party/sqlite/patches/0010-build-Undefined-symbol-in-intrinsic-on-clang.patch index eff4d2c7a4c94..b91ba419f62e1 100644 --- a/third_party/sqlite/patches/0010-build-Undefined-symbol-in-intrinsic-on-clang.patch +++ b/third_party/sqlite/patches/0010-build-Undefined-symbol-in-intrinsic-on-clang.patch @@ -31,6 +31,6 @@ index c6d2bae3a7b4..445aba9b48e4 100644 return __builtin_mul_overflow(*pA, iB, pA); #else i64 iA = *pA; --- +-- 2.11.0 diff --git a/third_party/sqlite/patches/0011-Allow-auto-vacuum-to-work-with-chunks.patch b/third_party/sqlite/patches/0011-Allow-auto-vacuum-to-work-with-chunks.patch index 58294ad0b9d3d..b3a748ce49b3c 100644 --- a/third_party/sqlite/patches/0011-Allow-auto-vacuum-to-work-with-chunks.patch +++ b/third_party/sqlite/patches/0011-Allow-auto-vacuum-to-work-with-chunks.patch @@ -24,7 +24,7 @@ index de553423b884..3335ced417ca 100644 @@ -2812,6 +2812,46 @@ int sqlite3BtreeGetAutoVacuum(Btree *p){ #endif } - + +/* +** Change the 'auto-vacuum-slack-pages' property of the database. If auto vacuum +** is enabled, this is the number of chunks of slack to allow before @@ -65,7 +65,7 @@ index de553423b884..3335ced417ca 100644 +#endif +} + - + /* ** Get a reference to pPage1 of the database file. This will @@ -3653,13 +3693,27 @@ int sqlite3BtreeIncrVacuum(Btree *p){ @@ -75,7 +75,7 @@ index de553423b884..3335ced417ca 100644 + int bShouldVacuum = pBt->autoVacuum && !pBt->incrVacuum; Pager *pPager = pBt->pPager; VVA_ONLY( int nRef = sqlite3PagerRefcount(pPager); ) - + assert( sqlite3_mutex_held(pBt->mutex) ); invalidateAllOverflowCache(pBt); assert(pBt->autoVacuum); @@ -129,7 +129,7 @@ index b1775a4082a3..1d5ebfca098d 100644 @@ -736,6 +736,27 @@ void sqlite3Pragma( } #endif - + + /* + ** PRAGMA [schema.]auto_vacuum_slack_pages(N) + ** @@ -163,7 +163,7 @@ index 5d8d0aa35b3f..e47f80fefac4 100644 #define PragTyp_LOCK_STATUS 41 #define PragTyp_PARSER_TRACE 42 +#define PragTyp_AUTO_VACUUM_SLACK_PAGES 43 - + /* Property flags associated with various pragma. */ #define PragFlg_NeedSchema 0x01 /* Force schema load before running */ @@ -145,6 +146,13 @@ static const PragmaName aPragmaName[] = { @@ -180,6 +180,6 @@ index 5d8d0aa35b3f..e47f80fefac4 100644 #if !defined(SQLITE_OMIT_FLAG_PRAGMAS) #if !defined(SQLITE_OMIT_AUTOMATIC_INDEX) {/* zName: */ "automatic_index", --- +-- 2.11.0 diff --git a/third_party/sqlite/src/Makefile.in b/third_party/sqlite/src/Makefile.in index 740b49c08f1ba..03b32a500bd16 100644 --- a/third_party/sqlite/src/Makefile.in +++ b/third_party/sqlite/src/Makefile.in @@ -22,7 +22,7 @@ TOP = @abs_srcdir@ # BCC = @BUILD_CC@ @BUILD_CFLAGS@ -# TCC is the C Compile and options for use in building executables that +# TCC is the C Compile and options for use in building executables that # will run on the target platform. (BCC and TCC are usually the # same unless your are cross-compiling.) Separate CC and CFLAGS macros # are provide so that these aspects of the build process can be changed @@ -35,7 +35,7 @@ TCC += -I${TOP}/ext/fts3 -I${TOP}/ext/async -I${TOP}/ext/session # Define this for the autoconf-based build, so that the code knows it can # include the generated config.h -# +# TCC += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite # Define -DNDEBUG to compile without debugging (i.e., for production usage) @@ -66,7 +66,7 @@ LIBREADLINE = @TARGET_READLINE_LIBS@ TCC += -DSQLITE_THREADSAFE=@SQLITE_THREADSAFE@ # Any target libraries which libsqlite must be linked against -# +# TLIBS = @LIBS@ $(LIBS) # Flags controlling use of the in memory btree implementation @@ -78,8 +78,8 @@ TLIBS = @LIBS@ $(LIBS) TEMP_STORE = -DSQLITE_TEMP_STORE=@TEMP_STORE@ # Enable/disable loadable extensions, and other optional features -# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*). -# The same set of OMIT and ENABLE flags should be passed to the +# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*). +# The same set of OMIT and ENABLE flags should be passed to the # LEMON parser generator and the mkkeywordhash tool as well. OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@ @@ -123,8 +123,8 @@ SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ # If gcov support was enabled by the configure script, add the appropriate # flags here. It's not always as easy as just having the user add the right # CFLAGS / LDFLAGS, because libtool wants to use CFLAGS when linking, which -# causes build errors with -fprofile-arcs -ftest-coverage with some GCCs. -# Supposedly GCC does the right thing if you use --coverage, but in +# causes build errors with -fprofile-arcs -ftest-coverage with some GCCs. +# Supposedly GCC does the right thing if you use --coverage, but in # practice it still fails. See: # # http://www.mail-archive.com/debian-gcc@lists.debian.org/msg26197.html @@ -411,7 +411,7 @@ TESTSRC = \ $(TOP)/ext/fts3/fts3_term.c \ $(TOP)/ext/fts3/fts3_test.c \ $(TOP)/ext/session/test_session.c \ - $(TOP)/ext/rbu/test_rbu.c + $(TOP)/ext/rbu/test_rbu.c # Statically linked extensions # @@ -483,7 +483,7 @@ TESTSRC2 = \ $(TOP)/ext/fts3/fts3_tokenizer.c \ $(TOP)/ext/fts3/fts3_write.c \ $(TOP)/ext/async/sqlite3async.c \ - $(TOP)/ext/session/sqlite3session.c + $(TOP)/ext/session/sqlite3session.c # Header files used by all library source files. # @@ -567,7 +567,7 @@ SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1 FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ FUZZCHECK_SRC = $(TOP)/test/fuzzcheck.c $(TOP)/test/ossfuzz.c -DBFUZZ_OPT = +DBFUZZ_OPT = # This is the default Makefile target. The objects listed here # are what get build when you type just "make" with no arguments. @@ -1051,7 +1051,7 @@ FTS5_SRC = \ $(TOP)/ext/fts5/fts5_varint.c \ $(TOP)/ext/fts5/fts5_vocab.c \ -fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon +fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon cp $(TOP)/ext/fts5/fts5parse.y . rm -f fts5parse.h ./lemon$(BEXE) $(OPTS) fts5parse.y @@ -1077,7 +1077,7 @@ sqlite3rbu.lo: $(TOP)/ext/rbu/sqlite3rbu.c $(HDR) $(EXTHDR) # hidden when the library is built via the amalgamation). # TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1 -TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE +TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE TESTFIXTURE_FLAGS += -DBUILD_sqlite TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1 TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024 @@ -1190,7 +1190,7 @@ DBSELFTEST_OPT += -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_FTS4 dbselftest$(TEXE): $(TOP)/test/dbselftest.c sqlite3.c $(LTLINK) $(DBSELFTEST_OPT) -o $@ $(TOP)/test/dbselftest.c sqlite3.c $(TLIBS) -rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo +rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.lo $(LTLINK) -I. -o $@ $(TOP)/ext/rbu/rbu.c sqlite3.lo $(TLIBS) loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la @@ -1218,7 +1218,7 @@ snapshot-tarball: sqlite3.c # The next two rules are used to support the "threadtest" target. Building # threadtest runs a few thread-safety tests that are implemented in C. This # target is invoked by the releasetest.tcl script. -# +# THREADTEST3_SRC = $(TOP)/test/threadtest3.c \ $(TOP)/test/tt3_checkpoint.c \ $(TOP)/test/tt3_index.c \ @@ -1232,7 +1232,7 @@ threadtest3$(TEXE): sqlite3.lo $(THREADTEST3_SRC) threadtest: threadtest3$(TEXE) ./threadtest3$(TEXE) -releasetest: +releasetest: $(TCLSH_CMD) $(TOP)/test/releasetest.tcl # Standard install and cleanup targets @@ -1240,7 +1240,7 @@ releasetest: lib_install: libsqlite3.la $(INSTALL) -d $(DESTDIR)$(libdir) $(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir) - + install: sqlite3$(TEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_install} $(INSTALL) -d $(DESTDIR)$(bindir) $(LTINSTALL) sqlite3$(TEXE) $(DESTDIR)$(bindir) @@ -1258,7 +1258,7 @@ tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a $(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR) -clean: +clean: rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la rm -f sqlite3.h opcodes.* rm -rf .libs .deps diff --git a/third_party/sqlite/src/Makefile.linux-gcc b/third_party/sqlite/src/Makefile.linux-gcc index c59886b087e2d..a37d41a0099df 100644 --- a/third_party/sqlite/src/Makefile.linux-gcc +++ b/third_party/sqlite/src/Makefile.linux-gcc @@ -25,10 +25,10 @@ BCC = gcc -g -O2 #### If the target operating system supports the "usleep()" system # call, then define the HAVE_USLEEP macro for all C modules. # -#USLEEP = +#USLEEP = USLEEP = -DHAVE_USLEEP=1 -#### If you want the SQLite library to be safe for use within a +#### If you want the SQLite library to be safe for use within a # multi-threaded program, then define the following macro # appropriately: # @@ -39,7 +39,7 @@ THREADSAFE = -DTHREADSAFE=1 # thread safe # THREADLIB = -lpthread -#THREADLIB = +#THREADLIB = #### Specify any extra libraries needed to access required functions. # @@ -49,14 +49,14 @@ TLIBS = -ldl #### Leave SQLITE_DEBUG undefined for maximum speed. Use SQLITE_DEBUG=1 # to check for memory leaks. Use SQLITE_DEBUG=2 to print a log of all # malloc()s and free()s in order to track down memory leaks. -# +# # SQLite uses some expensive assert() statements in the inner loop. # You can make the library go almost twice as fast if you compile # with -DNDEBUG=1 # #OPTS = -DSQLITE_DEBUG=2 #OPTS = -DSQLITE_DEBUG=1 -#OPTS = +#OPTS = OPTS = -DNDEBUG=1 #OPTS += -DHAVE_FDATASYNC=1 @@ -90,7 +90,7 @@ endif #EXE = .exe EXE = -#### C Compile and options for use in building executables that +#### C Compile and options for use in building executables that # will run on the target platform. This is usually the same # as BCC, unless you are cross-compiling. # diff --git a/third_party/sqlite/src/aclocal.m4 b/third_party/sqlite/src/aclocal.m4 index 8e5151ebade66..65cad9adc270b 100644 --- a/third_party/sqlite/src/aclocal.m4 +++ b/third_party/sqlite/src/aclocal.m4 @@ -7904,7 +7904,7 @@ _LT_DECL(, macro_revision, 0) # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until diff --git a/third_party/sqlite/src/autoconf/configure.ac b/third_party/sqlite/src/autoconf/configure.ac index b9a11aac8f495..25458899df929 100644 --- a/third_party/sqlite/src/autoconf/configure.ac +++ b/third_party/sqlite/src/autoconf/configure.ac @@ -31,7 +31,7 @@ AC_CONFIG_FILES([Makefile sqlite3.pc]) AC_SUBST(BUILD_CFLAGS) #------------------------------------------------------------------------- -# Two options to enable readline compatible libraries: +# Two options to enable readline compatible libraries: # # --enable-editline # --enable-readline @@ -42,7 +42,7 @@ AC_SUBST(BUILD_CFLAGS) # user must pass "--disable-editline". To disable command line editing # support altogether, "--disable-editline --disable-readline". # -# When searching for either library, check for headers before libraries +# When searching for either library, check for headers before libraries # as some distros supply packages that contain libraries but not header # files, which come as a separate development package. # @@ -83,7 +83,7 @@ AC_SUBST(READLINE_LIBS) # --enable-threadsafe # AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING( - [--enable-threadsafe], [build a thread-safe library [default=yes]])], + [--enable-threadsafe], [build a thread-safe library [default=yes]])], [], [enable_threadsafe=yes]) THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0 if test x"$enable_threadsafe" != "xno"; then @@ -98,7 +98,7 @@ AC_SUBST(THREADSAFE_FLAGS) # --enable-dynamic-extensions # AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING( - [--enable-dynamic-extensions], [support loadable extensions [default=yes]])], + [--enable-dynamic-extensions], [support loadable extensions [default=yes]])], [], [enable_dynamic_extensions=yes]) if test x"$enable_dynamic_extensions" != "xno"; then AC_SEARCH_LIBS(dlopen, dl) @@ -114,7 +114,7 @@ AC_SUBST(DYNAMIC_EXTENSION_FLAGS) # --enable-fts5 # AC_ARG_ENABLE(fts5, [AS_HELP_STRING( - [--enable-fts5], [include fts5 support [default=no]])], + [--enable-fts5], [include fts5 support [default=no]])], [], [enable_fts5=no]) if test x"$enable_fts5" = "xyes"; then AC_SEARCH_LIBS(log, m) @@ -127,7 +127,7 @@ AC_SUBST(FTS5_FLAGS) # --enable-json1 # AC_ARG_ENABLE(json1, [AS_HELP_STRING( - [--enable-json1], [include json1 support [default=no]])], + [--enable-json1], [include json1 support [default=no]])], [], [enable_json1=no]) if test x"$enable_json1" = "xyes"; then JSON1_FLAGS=-DSQLITE_ENABLE_JSON1 @@ -139,7 +139,7 @@ AC_SUBST(JSON1_FLAGS) # --enable-session # AC_ARG_ENABLE(session, [AS_HELP_STRING( - [--enable-session], [enable the session extension [default=no]])], + [--enable-session], [enable the session extension [default=no]])], [], [enable_session=no]) if test x"$enable_session" = "xyes"; then SESSION_FLAGS="-DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" @@ -151,8 +151,8 @@ AC_SUBST(SESSION_FLAGS) # --enable-static-shell # AC_ARG_ENABLE(static-shell, [AS_HELP_STRING( - [--enable-static-shell], - [statically link libsqlite3 into shell tool [default=yes]])], + [--enable-static-shell], + [statically link libsqlite3 into shell tool [default=yes]])], [], [enable_static_shell=yes]) if test x"$enable_static_shell" = "xyes"; then EXTRA_SHELL_OBJ=sqlite3-sqlite3.$OBJEXT @@ -171,8 +171,8 @@ AC_CHECK_FUNCS(posix_fallocate) # --enable-tempstore # # AC_ARG_ENABLE(tempstore, [AS_HELP_STRING( -# [--enable-tempstore], -# [in-memory temporary tables (never, no, yes, always) [default=no]])], +# [--enable-tempstore], +# [in-memory temporary tables (never, no, yes, always) [default=no]])], # [], [enable_tempstore=no]) # AC_MSG_CHECKING([for whether or not to store temp tables in-memory]) # case "$enable_tempstore" in diff --git a/third_party/sqlite/src/autoconf/tea/Makefile.in b/third_party/sqlite/src/autoconf/tea/Makefile.in index 3e481dadfe84f..bac35c2c7d12d 100644 --- a/third_party/sqlite/src/autoconf/tea/Makefile.in +++ b/third_party/sqlite/src/autoconf/tea/Makefile.in @@ -340,7 +340,7 @@ dist: dist-clean # variable in configure.in #======================================================================== -clean: +clean: -test -z "$(BINARIES)" || rm -f $(BINARIES) -rm -f *.$(OBJEXT) core *.core -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) diff --git a/third_party/sqlite/src/autoconf/tea/win/makefile.vc b/third_party/sqlite/src/autoconf/tea/win/makefile.vc index a5e462770721e..b4be80988dbd0 100644 --- a/third_party/sqlite/src/autoconf/tea/win/makefile.vc +++ b/third_party/sqlite/src/autoconf/tea/win/makefile.vc @@ -2,7 +2,7 @@ # # Microsoft Visual C++ makefile for use with nmake.exe v1.62+ (VC++ 5.0+) # -# This makefile is based upon the Tcl 8.4 Makefile.vc and modified to +# This makefile is based upon the Tcl 8.4 Makefile.vc and modified to # make it suitable as a general package makefile. Look for the word EDIT # which marks sections that may need modification. As a minumum you will # need to change the PROJECT, DOTVERSION and DLLOBJS variables to values @@ -10,7 +10,7 @@ # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# +# # Copyright (c) 1995-1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. # Copyright (c) 2001 ActiveState Corporation. @@ -97,7 +97,7 @@ the environment. Jump to this line to read the new instructions. # TMP_DIR= # OUT_DIR= # Hooks to allow the intermediate and output directories to be -# changed. $(OUT_DIR) is assumed to be +# changed. $(OUT_DIR) is assumed to be # $(BINROOT)\(Release|Debug) based on if symbols are requested. # $(TMP_DIR) will de $(OUT_DIR)\ by default. # diff --git a/third_party/sqlite/src/autoconf/tea/win/nmakehlp.c b/third_party/sqlite/src/autoconf/tea/win/nmakehlp.c index e00f1b49965d0..4d23fe4c64b29 100644 --- a/third_party/sqlite/src/autoconf/tea/win/nmakehlp.c +++ b/third_party/sqlite/src/autoconf/tea/win/nmakehlp.c @@ -61,7 +61,7 @@ typedef struct { pipeinfo Out = {INVALID_HANDLE_VALUE, '\0'}; pipeinfo Err = {INVALID_HANDLE_VALUE, '\0'}; - + /* * exitcodes: 0 == no, 1 == yes, 2 == error */ @@ -176,7 +176,7 @@ main( WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL); return 2; } - + static int CheckForCompilerFeature( const char *option) @@ -310,7 +310,7 @@ CheckForCompilerFeature( || strstr(Out.buffer, "D2021") != NULL || strstr(Err.buffer, "D2021") != NULL); } - + static int CheckForLinkerFeature( const char *option) @@ -435,7 +435,7 @@ CheckForLinkerFeature( strstr(Out.buffer, "LNK4044") != NULL || strstr(Err.buffer, "LNK4044") != NULL); } - + static DWORD WINAPI ReadFromPipe( LPVOID args) @@ -460,7 +460,7 @@ ReadFromPipe( return 0; /* makes the compiler happy */ } - + static int IsIn( const char *string, @@ -468,7 +468,7 @@ IsIn( { return (strstr(string, substring) != NULL); } - + /* * GetVersionFromFile -- * Looks for a match string in a file and then returns the version @@ -523,7 +523,7 @@ GetVersionFromFile( } return szResult; } - + /* * List helpers for the SubstituteFile function */ @@ -564,7 +564,7 @@ list_free(list_item_t **listPtrPtr) free(tmpPtr); } } - + /* * SubstituteFile -- * As windows doesn't provide anything useful like sed and it's unreliable @@ -628,11 +628,11 @@ SubstituteFile( } } #endif - + /* * Run the substitutions over each line of the input */ - + while (fgets(szBuffer, cbBuffer, fp) != NULL) { list_item_t *p = NULL; for (p = substPtr; p != NULL; p = p->nextPtr) { @@ -652,13 +652,13 @@ SubstituteFile( } printf(szBuffer); } - + list_free(&substPtr); } fclose(fp); return 0; } - + /* * QualifyPath -- * diff --git a/third_party/sqlite/src/configure.ac b/third_party/sqlite/src/configure.ac index 095db6bf81af7..4a1c4f4d62ce2 100644 --- a/third_party/sqlite/src/configure.ac +++ b/third_party/sqlite/src/configure.ac @@ -1,7 +1,7 @@ # # The build process allows for using a cross-compiler. But the default # action is to target the same platform that we are running on. The -# configure script needs to discover the following properties of the +# configure script needs to discover the following properties of the # build and target systems: # # srcdir @@ -61,7 +61,7 @@ # TARGET_READLINE_INC # # This variables define the directory that contain header -# files for the readline library. If the compiler is able +# files for the readline library. If the compiler is able # to find on its own, then this can be blank. # # TARGET_EXEEXT @@ -119,7 +119,7 @@ USE_AMALGAMATION=1 # See whether we can run specific tclsh versions known to work well; # if not, then we fall back to plain tclsh. # TODO: try other versions before falling back? -# +# AC_CHECK_PROGS(TCLSH_CMD, [tclsh8.6 tclsh8.5 tclsh], none) if test "$TCLSH_CMD" = "none"; then # If we can't find a local tclsh, then building the amalgamation will fail. @@ -181,7 +181,7 @@ AC_SUBST(BUILD_CC) ########## # Do we want to support multithreaded use of sqlite # -AC_ARG_ENABLE(threadsafe, +AC_ARG_ENABLE(threadsafe, AC_HELP_STRING([--disable-threadsafe],[Disable mutexing]),,enable_threadsafe=yes) AC_MSG_CHECKING([whether to support threadsafe operation]) if test "$enable_threadsafe" = "no"; then @@ -201,7 +201,7 @@ fi ########## # Do we want to support release # -AC_ARG_ENABLE(releasemode, +AC_ARG_ENABLE(releasemode, AC_HELP_STRING([--enable-releasemode],[Support libtool link to release mode]),,enable_releasemode=no) AC_MSG_CHECKING([whether to support shared library linked as release mode or not]) if test "$enable_releasemode" = "no"; then @@ -216,27 +216,27 @@ AC_SUBST(ALLOWRELEASE) ########## # Do we want temporary databases in memory # -AC_ARG_ENABLE(tempstore, +AC_ARG_ENABLE(tempstore, AC_HELP_STRING([--enable-tempstore],[Use an in-ram database for temporary tables (never,no,yes,always)]),,enable_tempstore=no) AC_MSG_CHECKING([whether to use an in-ram database for temporary tables]) case "$enable_tempstore" in - never ) + never ) TEMP_STORE=0 AC_MSG_RESULT([never]) ;; - no ) + no ) TEMP_STORE=1 AC_MSG_RESULT([no]) ;; - yes ) + yes ) TEMP_STORE=2 AC_MSG_RESULT([yes]) ;; - always ) + always ) TEMP_STORE=3 AC_MSG_RESULT([always]) ;; - * ) + * ) TEMP_STORE=1 AC_MSG_RESULT([no]) ;; @@ -418,7 +418,7 @@ if test "${use_tcl}" = "yes" ; then else AC_MSG_RESULT([file not found]) fi - + # # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. @@ -427,34 +427,34 @@ if test "${use_tcl}" = "yes" ; then # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # - + if test -f $TCL_BIN_DIR/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} fi - + # # eval is required to do the TCL_DBGX substitution # - + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - + AC_SUBST(TCL_VERSION) AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_INCLUDE_SPEC) - + AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_LIB_SPEC) - + AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FLAG) AC_SUBST(TCL_STUB_LIB_SPEC) @@ -591,7 +591,7 @@ fi ########## # Do we want to support memsys3 and/or memsys5 # -AC_ARG_ENABLE(memsys5, +AC_ARG_ENABLE(memsys5, AC_HELP_STRING([--enable-memsys5],[Enable MEMSYS5]), [enable_memsys5=yes],[enable_memsys5=no]) AC_MSG_CHECKING([whether to support MEMSYS5]) @@ -601,7 +601,7 @@ if test "${enable_memsys5}" = "yes"; then else AC_MSG_RESULT([no]) fi -AC_ARG_ENABLE(memsys3, +AC_ARG_ENABLE(memsys3, AC_HELP_STRING([--enable-memsys3],[Enable MEMSYS3]), [enable_memsys3=yes],[enable_memsys3=no]) AC_MSG_CHECKING([whether to support MEMSYS3]) diff --git a/third_party/sqlite/src/doc/lemon.html b/third_party/sqlite/src/doc/lemon.html index 114526f372ca8..86155c4f32091 100644 --- a/third_party/sqlite/src/doc/lemon.html +++ b/third_party/sqlite/src/doc/lemon.html @@ -88,9 +88,9 @@ output with all comments, actions, and other extraneous text removed. Omit "#line" directives in the generated parser C code.
      2. -m Cause the output C source code to be compatible with the "makeheaders" -program. +program.
      3. -p -Display all conflicts that are resolved by +Display all conflicts that are resolved by precedence rules.
      4. -q Suppress generation of the report file. @@ -197,7 +197,7 @@ simple.) We assume the existence of some kind of tokenizer which is created using TokenizerCreate() on line 8 and deleted by TokenizerFree() on line 16. The GetNextToken() function on line 11 retrieves the -next token from the input file and puts its type in the +next token from the input file and puts its type in the integer variable hTokenId. The sToken variable is assumed to be some kind of structure that contains details about each token, such as its complete text, what line it occurs on, etc.

        @@ -295,7 +295,7 @@ and underscore characters than begins with a lower case letter. Again, the usual convention is to make nonterminals use all lower case letters.

        -

        In Lemon, terminal and nonterminal symbols do not need to +

        In Lemon, terminal and nonterminal symbols do not need to be declared or identified in a separate section of the grammar file. Lemon is able to generate a list of all terminals and nonterminals by examining the grammar rules, and it can always distinguish a @@ -402,10 +402,10 @@ of the shift, and a reduce-reduce conflict is resolved by reducing whichever rule comes first in the grammar file.

        Just like in -yacc and bison, Lemon allows a measure of control +yacc and bison, Lemon allows a measure of control over the resolution of paring conflicts using precedence rules. A precedence value can be assigned to any terminal symbol -using the +using the %left, %right or %nonassoc directives. Terminal symbols @@ -499,7 +499,7 @@ as follows:

    Reduce-reduce conflicts are resolved this way:
      -
    • If either reduce rule +
    • If either reduce rule lacks precedence information, then resolve in favor of the rule that appears first in the grammar and report a parsing conflict. @@ -563,13 +563,13 @@ the %include directive except that %include is inserted at the beginning of the main output file.

      %code is typically used to include some action routines or perhaps -a tokenizer or even the "main()" function +a tokenizer or even the "main()" function as part of the output file.

      The %default_destructor directive

      -

      The %default_destructor directive specifies a destructor to +

      The %default_destructor directive specifies a destructor to use for non-terminals that do not have their own destructor specified by a separate %destructor directive. See the documentation on the %destructor directive below for @@ -585,7 +585,7 @@ non-terminals using a single statement.

      The %default_type directive specifies the datatype of non-terminal symbols that do no have their own datatype defined using a separate -%type directive. +%type directive.

      @@ -698,7 +698,7 @@ ignored unless the "-DMACRO" command-line option is used. Grammar text betwen "%ifndef MACRO" and the next nested "%endif" is included except when the "-DMACRO" command-line option is used. -

      Note that the argument to %ifdef and %ifndef must be a single +

      Note that the argument to %ifdef and %ifndef must be a single preprocessor symbol name, not a general expression. There is no "%else" directive. @@ -728,7 +728,7 @@ grammar call functions that are prototyed in unistd.h.

      The %left directive

      The %left directive is used (along with the %right and -%nonassoc directives) to declare precedences of +%nonassoc directives) to declare precedences of terminal symbols. Every terminal symbol whose name appears after a %left directive but before the next period (".") is given the same left-associative precedence value. Subsequent @@ -778,7 +778,7 @@ parsers and link them all into the same executable.

      The %nonassoc directive

      This directive is used to assign non-associative precedence to -one or more terminal symbols. See the section on +one or more terminal symbols. See the section on precedence rules or on the %left directive for additional information.

      @@ -817,7 +817,7 @@ only invoked when parsing is unable to continue.

      The %right directive

      This directive is used to assign right-associative precedence to -one or more terminal symbols. See the section on +one or more terminal symbols. See the section on precedence rules or on the %left directive for additional information.

      @@ -954,7 +954,7 @@ and able to pay that price, fine. You just need to know.

      The %wildcard directive

      The %wildcard directive is followed by a single token name and a -period. This directive specifies that the identified token should +period. This directive specifies that the identified token should match any input token.

      When the generated parser has the choice of matching an input against @@ -980,7 +980,7 @@ until at least three new tokens have been successfully shifted.

      is unable to shift the error symbol, then the %parse_failed routine is invoked and the parser resets itself to its start state, ready to begin parsing a new file. This is what will happen at the very -first syntax error, of course, if there are no instances of the +first syntax error, of course, if there are no instances of the "error" non-terminal in your grammar.

      diff --git a/third_party/sqlite/src/doc/pager-invariants.txt b/third_party/sqlite/src/doc/pager-invariants.txt index 44444dad54bea..3f6fa485e3a53 100644 --- a/third_party/sqlite/src/doc/pager-invariants.txt +++ b/third_party/sqlite/src/doc/pager-invariants.txt @@ -5,60 +5,60 @@ *** Definition: A page of the database file is said to be "overwriteable" if one or more of the following are true about the page: - + (a) The original content of the page as it was at the beginning of the transaction has been written into the rollback journal and synced. - + (b) The page was a freelist leaf page at the start of the transaction. - + (c) The page number is greater than the largest page that existed in the database file at the start of the transaction. - + (1) A page of the database file is never overwritten unless one of the following are true: - + (a) The page and all other pages on the same sector are overwriteable. - + (b) The atomic page write optimization is enabled, and the entire transaction other than the update of the transaction sequence number consists of a single page change. - + (2) The content of a page written into the rollback journal exactly matches both the content in the database when the rollback journal was written and the content in the database at the beginning of the current transaction. - + (3) Writes to the database file are an integer multiple of the page size in length and are aligned to a page boundary. - + (4) Reads from the database file are either aligned on a page boundary and an integer multiple of the page size in length or are taken from the first 100 bytes of the database file. - + (5) All writes to the database file are synced prior to the rollback journal being deleted, truncated, or zeroed. - + (6) If a master journal file is used, then all writes to the database file are synced prior to the master journal being deleted. - + *** Definition: Two databases (or the same database at two points it time) are said to be "logically equivalent" if they give the same answer to all queries. Note in particular the content of freelist leaf pages can be changed arbitarily without effecting the logical equivalence of the database. - + (7) At any time, if any subset, including the empty set and the total set, - of the unsynced changes to a rollback journal are removed and the + of the unsynced changes to a rollback journal are removed and the journal is rolled back, the resulting database file will be logical equivalent to the database file at the beginning of the transaction. - + (8) When a transaction is rolled back, the xTruncate method of the VFS is called to restore the database file to the same size it was at the beginning of the transaction. (In some VFSes, the xTruncate method is a no-op, but that does not change the fact the SQLite will invoke it.) - + (9) Whenever the database file is modified, at least one bit in the range of bytes from 24 through 39 inclusive will be changed prior to releasing the EXCLUSIVE lock. diff --git a/third_party/sqlite/src/doc/vfs-shm.txt b/third_party/sqlite/src/doc/vfs-shm.txt index c1f125a120364..da752da41b3da 100644 --- a/third_party/sqlite/src/doc/vfs-shm.txt +++ b/third_party/sqlite/src/doc/vfs-shm.txt @@ -54,14 +54,14 @@ The meanings of the various wal-index locking states is as follows: RECOVER - Held during wal-index recovery. Used to prevent a race if multiple clients try to recover a wal-index at the same time. - -A particular lock manager implementation may coalesce one or more of + +A particular lock manager implementation may coalesce one or more of the wal-index locking states, though with a reduction in concurrency. For example, an implemention might implement only exclusive locking, -in which case all states would be equivalent to CHECKPOINT, meaning that -only one reader or one writer or one checkpointer could be active at a -time. Or, an implementation might combine READ and READ_FULL into +in which case all states would be equivalent to CHECKPOINT, meaning that +only one reader or one writer or one checkpointer could be active at a +time. Or, an implementation might combine READ and READ_FULL into a single state equivalent to READ, meaning that a writer could coexist with a reader, but no reader or writers could coexist with a checkpointer. @@ -93,7 +93,7 @@ during testing using an instrumented lock manager. the original database files. (9) A CHECKPOINT or RECOVER must be held on the wal-index, or an - EXCLUSIVE on the original database file, in order to reset the + EXCLUSIVE on the original database file, in order to reset the last valid frame counter in the header of the wal-index back to zero. (10) A WRITE can only increase the last valid frame pointer in the header. diff --git a/third_party/sqlite/src/ext/async/README.txt b/third_party/sqlite/src/ext/async/README.txt index f62fa2fc17e82..1c1a12033bf53 100644 --- a/third_party/sqlite/src/ext/async/README.txt +++ b/third_party/sqlite/src/ext/async/README.txt @@ -52,32 +52,32 @@ the database, eliminating the bottleneck. 1.1 How it Works Asynchronous I/O works by creating a special SQLite "vfs" structure - and registering it with sqlite3_vfs_register(). When files opened via - this vfs are written to (using the vfs xWrite() method), the data is not + and registering it with sqlite3_vfs_register(). When files opened via + this vfs are written to (using the vfs xWrite() method), the data is not written directly to disk, but is placed in the "write-queue" to be handled by the background thread. - When files opened with the asynchronous vfs are read from - (using the vfs xRead() method), the data is read from the file on + When files opened with the asynchronous vfs are read from + (using the vfs xRead() method), the data is read from the file on disk and the write-queue, so that from the point of view of the vfs reader the xWrite() appears to have already completed. - The special vfs is registered (and unregistered) by calls to the + The special vfs is registered (and unregistered) by calls to the API functions sqlite3async_initialize() and sqlite3async_shutdown(). See section "Compilation and Usage" below for details. 1.2 Limitations - In order to gain experience with the main ideas surrounding asynchronous - IO, this implementation is deliberately kept simple. Additional + In order to gain experience with the main ideas surrounding asynchronous + IO, this implementation is deliberately kept simple. Additional capabilities may be added in the future. - For example, as currently implemented, if writes are happening at a + For example, as currently implemented, if writes are happening at a steady stream that exceeds the I/O capability of the background writer thread, the queue of pending write operations will grow without bound. - If this goes on for long enough, the host system could run out of memory. - A more sophisticated module could to keep track of the quantity of - pending writes and stop accepting new write requests when the queue of + If this goes on for long enough, the host system could run out of memory. + A more sophisticated module could to keep track of the quantity of + pending writes and stop accepting new write requests when the queue of pending writes grows too large. 1.3 Locking and Concurrency @@ -97,7 +97,7 @@ the database, eliminating the bottleneck. transaction, the database is locked immediately. However the lock is not released until after all relevant operations in the write-queue have been flushed to disk. This means - (for example) that the database may remain locked for some + (for example) that the database may remain locked for some time after a "COMMIT" or "ROLLBACK" is issued. * If an application using asynchronous IO executes transactions @@ -105,16 +105,16 @@ the database, eliminating the bottleneck. locked out of the database. This is because when a BEGIN is executed, a database lock is established immediately. But when the corresponding COMMIT or ROLLBACK occurs, the lock - is not released until the relevant part of the write-queue + is not released until the relevant part of the write-queue has been flushed through. As a result, if a COMMIT is followed - by a BEGIN before the write-queue is flushed through, the database - is never unlocked,preventing other processes from accessing + by a BEGIN before the write-queue is flushed through, the database + is never unlocked,preventing other processes from accessing the database. File-locking may be disabled at runtime using the sqlite3async_control() - API (see below). This may improve performance when an NFS or other - network file-system, as the synchronous round-trips to the server be - required to establish file locks are avoided. However, if multiple + API (see below). This may improve performance when an NFS or other + network file-system, as the synchronous round-trips to the server be + required to establish file locks are avoided. However, if multiple connections attempt to access the same database file when file-locking is disabled, application crashes and database corruption is a likely outcome. @@ -123,15 +123,15 @@ the database, eliminating the bottleneck. 2. COMPILATION AND USAGE The asynchronous IO extension consists of a single file of C code - (sqlite3async.c), and a header file (sqlite3async.h) that defines the - C API used by applications to activate and control the modules + (sqlite3async.c), and a header file (sqlite3async.h) that defines the + C API used by applications to activate and control the modules functionality. To use the asynchronous IO extension, compile sqlite3async.c as part of the application that uses SQLite. Then use the API defined in sqlite3async.h to initialize and configure the module. - The asynchronous IO VFS API is described in detail in comments in + The asynchronous IO VFS API is described in detail in comments in sqlite3async.h. Using the API usually consists of the following steps: 1. Register the asynchronous IO VFS with SQLite by calling the @@ -140,7 +140,7 @@ the database, eliminating the bottleneck. 2. Create a background thread to perform write operations and call sqlite3async_run(). - 3. Use the normal SQLite API to read and write to databases via + 3. Use the normal SQLite API to read and write to databases via the asynchronous IO VFS. Refer to sqlite3async.h for details. @@ -149,8 +149,8 @@ the database, eliminating the bottleneck. 3. PORTING Currently the asynchronous IO extension is compatible with win32 systems - and systems that support the pthreads interface, including Mac OSX, Linux, - and other varieties of Unix. + and systems that support the pthreads interface, including Mac OSX, Linux, + and other varieties of Unix. To port the asynchronous IO extension to another platform, the user must implement mutex and condition variable primitives for the new platform. diff --git a/third_party/sqlite/src/ext/async/sqlite3async.c b/third_party/sqlite/src/ext/async/sqlite3async.c index b6f4a4bd36b10..d1d16ed8d8ac5 100644 --- a/third_party/sqlite/src/ext/async/sqlite3async.c +++ b/third_party/sqlite/src/ext/async/sqlite3async.c @@ -12,7 +12,7 @@ ** ** $Id: sqlite3async.c,v 1.7 2009/07/18 11:52:04 danielk1977 Exp $ ** -** This file contains the implementation of an asynchronous IO backend +** This file contains the implementation of an asynchronous IO backend ** for SQLite. */ @@ -63,14 +63,14 @@ static void asyncTrace(const char *zFormat, ...){ ** ** Basic rules: ** -** * Both read and write access to the global write-op queue must be +** * Both read and write access to the global write-op queue must be ** protected by the async.queueMutex. As are the async.ioError and ** async.nFile variables. ** ** * The async.pLock list and all AsyncLock and AsyncFileLock ** structures must be protected by the async.lockMutex mutex. ** -** * The file handles from the underlying system are not assumed to +** * The file handles from the underlying system are not assumed to ** be thread safe. ** ** * See the last two paragraphs under "The Writer Thread" for @@ -78,11 +78,11 @@ static void asyncTrace(const char *zFormat, ...){ ** ** Deadlock prevention: ** -** There are three mutex used by the system: the "writer" mutex, +** There are three mutex used by the system: the "writer" mutex, ** the "queue" mutex and the "lock" mutex. Rules are: ** ** * It is illegal to block on the writer mutex when any other mutex -** are held, and +** are held, and ** ** * It is illegal to block on the queue mutex when the lock mutex ** is held. @@ -97,26 +97,26 @@ static void asyncTrace(const char *zFormat, ...){ ** ** File handle operations (invoked by SQLite thread): ** -** asyncWrite, asyncClose, asyncTruncate, asyncSync -** +** asyncWrite, asyncClose, asyncTruncate, asyncSync +** ** The operations above add an entry to the global write-op list. They ** prepare the entry, acquire the async.queueMutex momentarily while ** list pointers are manipulated to insert the new entry, then release ** the mutex and signal the writer thread to wake up in case it happens ** to be asleep. ** -** +** ** asyncRead, asyncFileSize. ** ** Read operations. Both of these read from both the underlying file -** first then adjust their result based on pending writes in the +** first then adjust their result based on pending writes in the ** write-op queue. So async.queueMutex is held for the duration ** of these operations to prevent other threads from changing the ** queue in mid operation. -** +** ** ** asyncLock, asyncUnlock, asyncCheckReservedLock -** +** ** These primitives implement in-process locking using a hash table ** on the file name. Files are locked correctly for connections coming ** from the same process. But other processes cannot see these locks @@ -135,7 +135,7 @@ static void asyncTrace(const char *zFormat, ...){ ** Remove entry from head of write-op list ** END WHILE ** -** The async.queueMutex is always held during the test, and when the entry is removed from the head ** of the write-op list. Sometimes it is held for the interim ** period (while the IO is performed), and sometimes it is @@ -144,17 +144,17 @@ static void asyncTrace(const char *zFormat, ...){ ** the underlying systems handles were opened on the same ** file-system entry. ** -** If condition (b) above is true, then one file-handle +** If condition (b) above is true, then one file-handle ** (AsyncFile.pBaseRead) is used exclusively by sqlite threads to read the -** file, the other (AsyncFile.pBaseWrite) by sqlite3_async_flush() -** threads to perform write() operations. This means that read -** operations are not blocked by asynchronous writes (although +** file, the other (AsyncFile.pBaseWrite) by sqlite3_async_flush() +** threads to perform write() operations. This means that read +** operations are not blocked by asynchronous writes (although ** asynchronous writes may still be blocked by reads). ** ** This assumes that the OS keeps two handles open on the same file ** properly in sync. That is, any read operation that starts after a ** write operation on the same file system entry has completed returns -** data consistent with the write. We also assume that if one thread +** data consistent with the write. We also assume that if one thread ** reads a file while another is writing it all bytes other than the ** ones actually being written contain valid data. ** @@ -190,13 +190,13 @@ static void asyncTrace(const char *zFormat, ...){ ** on the pthreads functions with similar names. The first parameter to ** both functions is always ASYNC_COND_QUEUE. When async_cond_wait() ** is called the mutex identified by the second parameter must be held. -** The mutex is unlocked, and the calling thread simultaneously begins +** The mutex is unlocked, and the calling thread simultaneously begins ** waiting for the condition variable to be signalled by another thread. ** After another thread signals the condition variable, the calling -** thread stops waiting, locks mutex eMutex and returns. The -** async_cond_signal() function is used to signal the condition variable. -** It is assumed that the mutex used by the thread calling async_cond_wait() -** is held by the caller of async_cond_signal() (otherwise there would be +** thread stops waiting, locks mutex eMutex and returns. The +** async_cond_signal() function is used to signal the condition variable. +** It is assumed that the mutex used by the thread calling async_cond_wait() +** is held by the caller of async_cond_signal() (otherwise there would be ** a race condition). ** ** It is guaranteed that no other thread will call async_cond_wait() when @@ -232,7 +232,7 @@ static void async_os_shutdown(void); /* Values for use as the 'eMutex' argument of the above functions. The ** integer values assigned to these constants are important for assert() ** statements that verify that mutexes are locked in the correct order. -** Specifically, it is unsafe to try to lock mutex N while holding a lock +** Specifically, it is unsafe to try to lock mutex N while holding a lock ** on mutex M if (M<=N). */ #define ASYNC_MUTEX_LOCK 0 @@ -327,8 +327,8 @@ static struct AsyncPrimitives { pthread_cond_t aCond[1]; pthread_t aHolder[3]; } primitives = { - { PTHREAD_MUTEX_INITIALIZER, - PTHREAD_MUTEX_INITIALIZER, + { PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER } , { PTHREAD_COND_INITIALIZER @@ -414,7 +414,7 @@ static const char *azOpcodeName[] = { ** Entries on the write-op queue are instances of the AsyncWrite ** structure, defined here. ** -** The interpretation of the iOffset and nByte variables varies depending +** The interpretation of the iOffset and nByte variables varies depending ** on the value of AsyncWrite.op: ** ** ASYNC_NOOP: @@ -447,9 +447,9 @@ static const char *azOpcodeName[] = { ** nByte -> Argument to sqlite3OsUnlock(). ** ** -** For an ASYNC_WRITE operation, zBuf points to the data to write to the file. +** For an ASYNC_WRITE operation, zBuf points to the data to write to the file. ** This space is sqlite3_malloc()d along with the AsyncWrite structure in a -** single blob, so is deleted when sqlite3_free() is called on the parent +** single blob, so is deleted when sqlite3_free() is called on the parent ** structure. */ struct AsyncWrite { @@ -462,7 +462,7 @@ struct AsyncWrite { }; /* -** An instance of this structure is created for each distinct open file +** An instance of this structure is created for each distinct open file ** (i.e. if two handles are opened on the one file, only one of these ** structures is allocated) and stored in the async.aLock hash table. The ** keys for async.aLock are the full pathnames of the opened files. @@ -471,13 +471,13 @@ struct AsyncWrite { ** structures, one for each handle currently open on the file. ** ** If the opened file is not a main-database (the SQLITE_OPEN_MAIN_DB is -** not passed to the sqlite3OsOpen() call), or if async.bLockFiles is -** false, variables AsyncLock.pFile and AsyncLock.eLock are never used. -** Otherwise, pFile is a file handle opened on the file in question and -** used to obtain the file-system locks required by database connections +** not passed to the sqlite3OsOpen() call), or if async.bLockFiles is +** false, variables AsyncLock.pFile and AsyncLock.eLock are never used. +** Otherwise, pFile is a file handle opened on the file in question and +** used to obtain the file-system locks required by database connections ** within this process. ** -** See comments above the asyncLock() function for more details on +** See comments above the asyncLock() function for more details on ** the implementation of database locking used by this backend. */ struct AsyncLock { @@ -500,9 +500,9 @@ struct AsyncFileLock { AsyncFileLock *pNext; }; -/* -** The AsyncFile structure is a subclass of sqlite3_file used for -** asynchronous IO. +/* +** The AsyncFile structure is a subclass of sqlite3_file used for +** asynchronous IO. ** ** All of the actual data for the structure is stored in the structure ** pointed to by AsyncFile.pData, which is allocated as part of the @@ -526,14 +526,14 @@ struct AsyncFileData { }; /* -** Add an entry to the end of the global write-op list. pWrite should point +** Add an entry to the end of the global write-op list. pWrite should point ** to an AsyncWrite structure allocated using sqlite3_malloc(). The writer ** thread will call sqlite3_free() to free the structure after the specified ** operation has been completed. ** ** Once an AsyncWrite structure has been added to the list, it becomes the ** property of the writer thread and must not be read or modified by the -** caller. +** caller. */ static void addAsyncWrite(AsyncWrite *pWrite){ /* We must hold the queue mutex in order to modify the queue pointers */ @@ -585,9 +585,9 @@ static void incrOpenFileCount(void){ ** structure and insert it (via addAsyncWrite() ) into the global list. */ static int addNewAsyncWrite( - AsyncFileData *pFileData, - int op, - sqlite3_int64 iOffset, + AsyncFileData *pFileData, + int op, + sqlite3_int64 iOffset, int nByte, const char *zByte ){ @@ -637,15 +637,15 @@ static int asyncClose(sqlite3_file *pFile){ } /* -** Implementation of sqlite3OsWrite() for asynchronous files. Instead of +** Implementation of sqlite3OsWrite() for asynchronous files. Instead of ** writing to the underlying file, this function adds an entry to the end of ** the global AsyncWrite list. Either SQLITE_OK or SQLITE_NOMEM may be ** returned. */ static int asyncWrite( - sqlite3_file *pFile, - const void *pBuf, - int amt, + sqlite3_file *pFile, + const void *pBuf, + int amt, sqlite3_int64 iOff ){ AsyncFileData *p = ((AsyncFile *)pFile)->pData; @@ -653,16 +653,16 @@ static int asyncWrite( } /* -** Read data from the file. First we read from the filesystem, then adjust -** the contents of the buffer based on ASYNC_WRITE operations in the +** Read data from the file. First we read from the filesystem, then adjust +** the contents of the buffer based on ASYNC_WRITE operations in the ** write-op queue. ** ** This method holds the mutex from start to finish. */ static int asyncRead( - sqlite3_file *pFile, - void *zOut, - int iAmt, + sqlite3_file *pFile, + void *zOut, + int iAmt, sqlite3_int64 iOffset ){ AsyncFileData *p = ((AsyncFile *)pFile)->pData; @@ -674,7 +674,7 @@ static int asyncRead( /* Grab the write queue mutex for the duration of the call */ async_mutex_enter(ASYNC_MUTEX_QUEUE); - /* If an I/O error has previously occurred in this virtual file + /* If an I/O error has previously occurred in this virtual file ** system, then all subsequent operations fail. */ if( async.ioError!=SQLITE_OK ){ @@ -737,7 +737,7 @@ asyncread_out: } /* -** Truncate the file to nByte bytes in length. This just adds an entry to +** Truncate the file to nByte bytes in length. This just adds an entry to ** the write-op list, no IO actually takes place. */ static int asyncTruncate(sqlite3_file *pFile, sqlite3_int64 nByte){ @@ -746,7 +746,7 @@ static int asyncTruncate(sqlite3_file *pFile, sqlite3_int64 nByte){ } /* -** Sync the file. This just adds an entry to the write-op list, the +** Sync the file. This just adds an entry to the write-op list, the ** sync() is done later by sqlite3_async_flush(). */ static int asyncSync(sqlite3_file *pFile, int flags){ @@ -755,9 +755,9 @@ static int asyncSync(sqlite3_file *pFile, int flags){ } /* -** Read the size of the file. First we read the size of the file system -** entry, then adjust for any ASYNC_WRITE or ASYNC_TRUNCATE operations -** currently in the write-op list. +** Read the size of the file. First we read the size of the file system +** entry, then adjust for any ASYNC_WRITE or ASYNC_TRUNCATE operations +** currently in the write-op list. ** ** This method holds the mutex from start to finish. */ @@ -770,7 +770,7 @@ int asyncFileSize(sqlite3_file *pFile, sqlite3_int64 *piSize){ async_mutex_enter(ASYNC_MUTEX_QUEUE); /* Read the filesystem size from the base file. If pMethods is NULL, this - ** means the file hasn't been opened yet. In this case all relevant data + ** means the file hasn't been opened yet. In this case all relevant data ** must be in the write-op queue anyway, so we can omit reading from the ** file-system. */ @@ -782,14 +782,14 @@ int asyncFileSize(sqlite3_file *pFile, sqlite3_int64 *piSize){ if( rc==SQLITE_OK ){ AsyncWrite *pWrite; for(pWrite=async.pQueueFirst; pWrite; pWrite = pWrite->pNext){ - if( pWrite->op==ASYNC_DELETE - && p->zName - && strcmp(p->zName, pWrite->zBuf)==0 + if( pWrite->op==ASYNC_DELETE + && p->zName + && strcmp(p->zName, pWrite->zBuf)==0 ){ s = 0; }else if( pWrite->pFileData && ( - (pWrite->pFileData==p) - || (p->zName && pWrite->pFileData->zName==p->zName) + (pWrite->pFileData==p) + || (p->zName && pWrite->pFileData->zName==p->zName) )){ switch( pWrite->op ){ case ASYNC_WRITE: @@ -842,8 +842,8 @@ static int getFileLock(AsyncLock *pLock){ } /* -** Return the AsyncLock structure from the global async.pLock list -** associated with the file-system entry identified by path zName +** Return the AsyncLock structure from the global async.pLock list +** associated with the file-system entry identified by path zName ** (a string of nName bytes). If no such structure exists, return 0. */ static AsyncLock *findLock(const char *zName, int nName){ @@ -932,7 +932,7 @@ static int asyncCheckReservedLock(sqlite3_file *pFile, int *pResOut){ return SQLITE_OK; } -/* +/* ** sqlite3_file_control() implementation. */ static int asyncFileControl(sqlite3_file *id, int op, void *pArg){ @@ -947,9 +947,9 @@ static int asyncFileControl(sqlite3_file *id, int op, void *pArg){ return SQLITE_NOTFOUND; } -/* +/* ** Return the device characteristics and sector-size of the device. It -** is tricky to implement these correctly, as this backend might +** is tricky to implement these correctly, as this backend might ** not have an open file handle at this point. */ static int asyncSectorSize(sqlite3_file *pFile){ @@ -1056,7 +1056,7 @@ static int asyncOpen( sizeof(AsyncFileData) + /* AsyncFileData structure */ 2 * pVfs->szOsFile + /* AsyncFileData.pBaseRead and pBaseWrite */ nName + 2 /* AsyncFileData.zName */ - ); + ); z = sqlite3_malloc(nByte); if( !z ){ return SQLITE_NOMEM; @@ -1080,8 +1080,8 @@ static int asyncOpen( if( !isAsyncOpen ){ int flagsout; rc = pVfs->xOpen(pVfs, pData->zName, pData->pBaseRead, flags, &flagsout); - if( rc==SQLITE_OK - && (flagsout&SQLITE_OPEN_READWRITE) + if( rc==SQLITE_OK + && (flagsout&SQLITE_OPEN_READWRITE) && (flags&SQLITE_OPEN_EXCLUSIVE)==0 ){ rc = pVfs->xOpen(pVfs, pData->zName, pData->pBaseWrite, flags, 0); @@ -1096,7 +1096,7 @@ static int asyncOpen( if( zName && rc==SQLITE_OK ){ pLock = findLock(pData->zName, pData->nName); if( !pLock ){ - int nByte = pVfs->szOsFile + sizeof(AsyncLock) + pData->nName + 1; + int nByte = pVfs->szOsFile + sizeof(AsyncLock) + pData->nName + 1; pLock = (AsyncLock *)sqlite3_malloc(nByte); if( pLock ){ memset(pLock, 0, nByte); @@ -1125,7 +1125,7 @@ static int asyncOpen( p->pMethod = &async_methods; p->pData = pData; - /* Link AsyncFileData.lock into the linked list of + /* Link AsyncFileData.lock into the linked list of ** AsyncFileLock structures for this file. */ if( zName ){ @@ -1170,7 +1170,7 @@ static int asyncOpen( } /* -** Implementation of sqlite3OsDelete. Add an entry to the end of the +** Implementation of sqlite3OsDelete. Add an entry to the end of the ** write-op queue to perform the delete. */ static int asyncDelete(sqlite3_vfs *pAsyncVfs, const char *z, int syncDir){ @@ -1183,8 +1183,8 @@ static int asyncDelete(sqlite3_vfs *pAsyncVfs, const char *z, int syncDir){ ** start to finish. */ static int asyncAccess( - sqlite3_vfs *pAsyncVfs, - const char *zName, + sqlite3_vfs *pAsyncVfs, + const char *zName, int flags, int *pResOut ){ @@ -1193,9 +1193,9 @@ static int asyncAccess( AsyncWrite *p; sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; - assert(flags==SQLITE_ACCESS_READWRITE - || flags==SQLITE_ACCESS_READ - || flags==SQLITE_ACCESS_EXISTS + assert(flags==SQLITE_ACCESS_READWRITE + || flags==SQLITE_ACCESS_READ + || flags==SQLITE_ACCESS_EXISTS ); async_mutex_enter(ASYNC_MUTEX_QUEUE); @@ -1204,15 +1204,15 @@ static int asyncAccess( for(p=async.pQueueFirst; p; p = p->pNext){ if( p->op==ASYNC_DELETE && 0==strcmp(p->zBuf, zName) ){ ret = 0; - }else if( p->op==ASYNC_OPENEXCLUSIVE + }else if( p->op==ASYNC_OPENEXCLUSIVE && p->pFileData->zName - && 0==strcmp(p->pFileData->zName, zName) + && 0==strcmp(p->pFileData->zName, zName) ){ ret = 1; } } } - ASYNC_TRACE(("ACCESS(%s): %s = %d\n", + ASYNC_TRACE(("ACCESS(%s): %s = %d\n", flags==SQLITE_ACCESS_READWRITE?"read-write": flags==SQLITE_ACCESS_READ?"read":"exists" , zName, ret) @@ -1226,8 +1226,8 @@ static int asyncAccess( ** Fill in zPathOut with the full path to the file identified by zPath. */ static int asyncFullPathname( - sqlite3_vfs *pAsyncVfs, - const char *zPath, + sqlite3_vfs *pAsyncVfs, + const char *zPath, int nPathOut, char *zPathOut ){ @@ -1237,7 +1237,7 @@ static int asyncFullPathname( /* Because of the way intra-process file locking works, this backend ** needs to return a canonical path. The following block assumes the - ** file-system uses unix style paths. + ** file-system uses unix style paths. */ if( rc==SQLITE_OK ){ int i, j; @@ -1274,8 +1274,8 @@ static void asyncDlError(sqlite3_vfs *pAsyncVfs, int nByte, char *zErrMsg){ pVfs->xDlError(pVfs, nByte, zErrMsg); } static void (*asyncDlSym( - sqlite3_vfs *pAsyncVfs, - void *pHandle, + sqlite3_vfs *pAsyncVfs, + void *pHandle, const char *zSymbol ))(void){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; @@ -1318,9 +1318,9 @@ static sqlite3_vfs async_vfs = { asyncCurrentTime /* xDlClose */ }; -/* +/* ** This procedure runs in a separate thread, reading messages off of the -** write queue and processing them one by one. +** write queue and processing them one by one. ** ** If async.writerHaltNow is true, then this procedure exits ** after processing a single message. @@ -1368,7 +1368,7 @@ static void asyncWriterThread(void){ /* Right now this thread is holding the mutex on the write-op queue. ** Variable 'p' points to the first entry in the write-op queue. In ** the general case, we hold on to the mutex for the entire body of - ** the loop. + ** the loop. ** ** However in the cases enumerated below, we relinquish the mutex, ** perform the IO, and then re-request the mutex before removing 'p' from @@ -1376,11 +1376,11 @@ static void asyncWriterThread(void){ ** sqlite threads. ** ** * An ASYNC_CLOSE operation. - ** * An ASYNC_OPENEXCLUSIVE operation. For this one, we relinquish + ** * An ASYNC_OPENEXCLUSIVE operation. For this one, we relinquish ** the mutex, call the underlying xOpenExclusive() function, then - ** re-aquire the mutex before seting the AsyncFile.pBaseRead + ** re-aquire the mutex before seting the AsyncFile.pBaseRead ** variable. - ** * ASYNC_SYNC and ASYNC_WRITE operations, if + ** * ASYNC_SYNC and ASYNC_WRITE operations, if ** SQLITE_ASYNC_TWO_FILEHANDLES was set at compile time and two ** file-handles are open for the particular file being "synced". */ @@ -1389,10 +1389,10 @@ static void asyncWriterThread(void){ } if( p->pFileData ){ pBase = p->pFileData->pBaseWrite; - if( - p->op==ASYNC_CLOSE || + if( + p->op==ASYNC_CLOSE || p->op==ASYNC_OPENEXCLUSIVE || - (pBase->pMethods && (p->op==ASYNC_SYNC || p->op==ASYNC_WRITE) ) + (pBase->pMethods && (p->op==ASYNC_SYNC || p->op==ASYNC_WRITE) ) ){ async_mutex_leave(ASYNC_MUTEX_QUEUE); holdingMutex = 0; @@ -1421,7 +1421,7 @@ static void asyncWriterThread(void){ case ASYNC_TRUNCATE: assert( pBase ); - ASYNC_TRACE(("TRUNCATE %s to %d bytes\n", + ASYNC_TRACE(("TRUNCATE %s to %d bytes\n", p->pFileData->zName, p->iOffset)); rc = pBase->pMethods->xTruncate(pBase, p->iOffset); break; @@ -1436,8 +1436,8 @@ static void asyncWriterThread(void){ pData->pBaseRead->pMethods->xClose(pData->pBaseRead); } - /* Unlink AsyncFileData.lock from the linked list of AsyncFileLock - ** structures for this file. Obtain the async.lockMutex mutex + /* Unlink AsyncFileData.lock from the linked list of AsyncFileLock + ** structures for this file. Obtain the async.lockMutex mutex ** before doing so. */ async_mutex_enter(ASYNC_MUTEX_LOCK); @@ -1460,7 +1460,7 @@ static void asyncWriterThread(void){ AsyncFileData *pData = p->pFileData; int eLock = p->nByte; - /* When a file is locked by SQLite using the async backend, it is + /* When a file is locked by SQLite using the async backend, it is ** locked within the 'real' file-system synchronously. When it is ** unlocked, an ASYNC_UNLOCK event is added to the write-queue to ** unlock the file asynchronously. The design of the async backend @@ -1470,11 +1470,11 @@ static void asyncWriterThread(void){ ** SQLite unlocked the file have been processed. ** ** This is more complex if SQLite locks and unlocks the file multiple - ** times in quick succession. For example, if SQLite does: - ** + ** times in quick succession. For example, if SQLite does: + ** ** lock, write, unlock, lock, write, unlock ** - ** Each "lock" operation locks the file immediately. Each "write" + ** Each "lock" operation locks the file immediately. Each "write" ** and "unlock" operation adds an event to the event queue. If the ** second "lock" operation is performed before the first "unlock" ** operation has been processed asynchronously, then the first @@ -1489,7 +1489,7 @@ static void asyncWriterThread(void){ ** ** 2) Only unlocks the file at all if this event is the last ** ASYNC_UNLOCK event on this file in the write-queue. - */ + */ assert( holdingMutex==1 ); assert( async.pQueueFirst==p ); for(pIter=async.pQueueFirst->pNext; pIter; pIter=pIter->pNext){ @@ -1529,7 +1529,7 @@ static void asyncWriterThread(void){ } /* If we didn't hang on to the mutex during the IO op, obtain it now - ** so that the AsyncWrite structure can be safely removed from the + ** so that the AsyncWrite structure can be safely removed from the ** global write-op queue. */ if( !holdingMutex ){ @@ -1548,21 +1548,21 @@ static void asyncWriterThread(void){ assert( holdingMutex ); /* An IO error has occurred. We cannot report the error back to the - ** connection that requested the I/O since the error happened - ** asynchronously. The connection has already moved on. There + ** connection that requested the I/O since the error happened + ** asynchronously. The connection has already moved on. There ** really is nobody to report the error to. ** ** The file for which the error occurred may have been a database or ** journal file. Regardless, none of the currently queued operations ** associated with the same database should now be performed. Nor should - ** any subsequently requested IO on either a database or journal file + ** any subsequently requested IO on either a database or journal file ** handle for the same database be accepted until the main database ** file handle has been closed and reopened. ** ** Furthermore, no further IO should be queued or performed on any file - ** handle associated with a database that may have been part of a - ** multi-file transaction that included the database associated with - ** the IO error (i.e. a database ATTACHed to the same handle at some + ** handle associated with a database that may have been part of a + ** multi-file transaction that included the database associated with + ** the IO error (i.e. a database ATTACHed to the same handle at some ** point in time). */ if( rc!=SQLITE_OK ){ @@ -1590,14 +1590,14 @@ static void asyncWriterThread(void){ } } } - + async_mutex_leave(ASYNC_MUTEX_WRITER); return; } /* ** Install the asynchronous VFS. -*/ +*/ int sqlite3async_initialize(const char *zParent, int isDefault){ int rc = SQLITE_OK; if( async_vfs.pAppData==0 ){ @@ -1678,7 +1678,7 @@ int sqlite3async_control(int op, ...){ async_mutex_leave(ASYNC_MUTEX_QUEUE); break; } - + case SQLITEASYNC_GET_HALT: { int *peWhen = va_arg(ap, int *); *peWhen = async.eHalt; diff --git a/third_party/sqlite/src/ext/async/sqlite3async.h b/third_party/sqlite/src/ext/async/sqlite3async.h index 5b20d7189a021..f969a2425912d 100644 --- a/third_party/sqlite/src/ext/async/sqlite3async.h +++ b/third_party/sqlite/src/ext/async/sqlite3async.h @@ -19,7 +19,7 @@ extern "C" { ** sqlite3async_initialize() ** sqlite3async_shutdown() ** -** Care must be taken that neither of these functions is called while +** Care must be taken that neither of these functions is called while ** another thread may be calling either any sqlite3async_XXX() function ** or an sqlite3_XXX() API function related to a database handle that ** is using the asynchronous IO VFS. @@ -40,7 +40,7 @@ extern "C" { ** and registered, this function is a no-op. The asynchronous IO VFS ** is registered as "sqlite3async". ** -** The asynchronous IO VFS does not make operating system IO requests +** The asynchronous IO VFS does not make operating system IO requests ** directly. Instead, it uses an existing VFS implementation for all ** required file-system operations. If the first parameter to this function ** is NULL, then the current default VFS is used for IO. If it is not @@ -49,46 +49,46 @@ extern "C" { ** locate the VFS to use for all real IO operations. This VFS is known ** as the "parent VFS". ** -** If the second parameter to this function is non-zero, then the -** asynchronous IO VFS is registered as the default VFS for all SQLite +** If the second parameter to this function is non-zero, then the +** asynchronous IO VFS is registered as the default VFS for all SQLite ** database connections within the process. Otherwise, the asynchronous IO ** VFS is only used by connections opened using sqlite3_open_v2() that ** specifically request VFS "sqlite3async". ** ** If a parent VFS cannot be located, then SQLITE_ERROR is returned. ** In the unlikely event that operating system specific initialization -** fails (win32 systems create the required critical section and event +** fails (win32 systems create the required critical section and event ** objects within this function), then SQLITE_ERROR is also returned. -** Finally, if the call to sqlite3_vfs_register() returns an error, then +** Finally, if the call to sqlite3_vfs_register() returns an error, then ** the error code is returned to the user by this function. In all three ** of these cases, intialization has failed and the asynchronous IO VFS ** is not registered with SQLite. ** ** Otherwise, if no error occurs, SQLITE_OK is returned. -*/ +*/ int sqlite3async_initialize(const char *zParent, int isDefault); /* -** This function unregisters the asynchronous IO VFS using +** This function unregisters the asynchronous IO VFS using ** sqlite3_vfs_unregister(). ** -** On win32 platforms, this function also releases the small number of +** On win32 platforms, this function also releases the small number of ** critical section and event objects created by sqlite3async_initialize(). -*/ +*/ void sqlite3async_shutdown(void); /* -** This function may only be called when the asynchronous IO VFS is +** This function may only be called when the asynchronous IO VFS is ** installed (after a call to sqlite3async_initialize()). It processes ** zero or more queued write operations before returning. It is expected -** (but not required) that this function will be called by a different +** (but not required) that this function will be called by a different ** thread than those threads that use SQLite. The "background thread" ** that performs IO. ** -** How many queued write operations are performed before returning +** How many queued write operations are performed before returning ** depends on the global setting configured by passing the SQLITEASYNC_HALT ** verb to sqlite3async_control() (see below for details). By default -** this function never returns - it processes all pending operations and +** this function never returns - it processes all pending operations and ** then blocks waiting for new ones. ** ** If multiple simultaneous calls are made to sqlite3async_run() from two @@ -97,10 +97,10 @@ void sqlite3async_shutdown(void); void sqlite3async_run(void); /* -** This function may only be called when the asynchronous IO VFS is -** installed (after a call to sqlite3async_initialize()). It is used -** to query or configure various parameters that affect the operation -** of the asynchronous IO VFS. At present there are three parameters +** This function may only be called when the asynchronous IO VFS is +** installed (after a call to sqlite3async_initialize()). It is used +** to query or configure various parameters that affect the operation +** of the asynchronous IO VFS. At present there are three parameters ** supported: ** ** * The "halt" parameter, which configures the circumstances under @@ -108,10 +108,10 @@ void sqlite3async_run(void); ** ** * The "delay" parameter. Setting the delay parameter to a non-zero ** value causes the sqlite3async_run() function to sleep for the -** configured number of milliseconds between each queued write +** configured number of milliseconds between each queued write ** operation. ** -** * The "lockfiles" parameter. This parameter determines whether or +** * The "lockfiles" parameter. This parameter determines whether or ** not the asynchronous IO VFS locks the database files it operates ** on. Disabling file locking can improve throughput. ** @@ -121,7 +121,7 @@ void sqlite3async_run(void); ** be passed the new value for the parameter as type "int". ** ** When querying the current value of a paramter, the first argument must -** be one of SQLITEASYNC_GET_HALT, GET_DELAY or GET_LOCKFILES. The second +** be one of SQLITEASYNC_GET_HALT, GET_DELAY or GET_LOCKFILES. The second ** argument to this function must be of type (int *). The current value ** of the queried parameter is copied to the memory pointed to by the ** second argument. For example: @@ -145,29 +145,29 @@ void sqlite3async_run(void); ** never return. This is the default setting. If the parameter is set ** to IDLE, then calls to sqlite3async_run() return as soon as the ** queue of pending write operations is empty. If the parameter is set -** to NOW, then calls to sqlite3async_run() return as quickly as +** to NOW, then calls to sqlite3async_run() return as quickly as ** possible, without processing any pending write requests. ** ** If an attempt is made to set this parameter to an integer value other -** than SQLITEASYNC_HALT_NEVER, IDLE or NOW, then sqlite3async_control() -** returns SQLITE_MISUSE and the current value of the parameter is not +** than SQLITEASYNC_HALT_NEVER, IDLE or NOW, then sqlite3async_control() +** returns SQLITE_MISUSE and the current value of the parameter is not ** modified. ** -** Modifying the "halt" parameter affects calls to sqlite3async_run() +** Modifying the "halt" parameter affects calls to sqlite3async_run() ** made by other threads that are currently in progress. ** ** SQLITEASYNC_DELAY: ** ** This is used to set the value of the "delay" parameter. If set to ** a non-zero value, then after completing a pending write request, the -** sqlite3async_run() function sleeps for the configured number of +** sqlite3async_run() function sleeps for the configured number of ** milliseconds. ** ** If an attempt is made to set this parameter to a negative value, ** sqlite3async_control() returns SQLITE_MISUSE and the current value ** of the parameter is not modified. ** -** Modifying the "delay" parameter affects calls to sqlite3async_run() +** Modifying the "delay" parameter affects calls to sqlite3async_run() ** made by other threads that are currently in progress. ** ** SQLITEASYNC_LOCKFILES: @@ -180,7 +180,7 @@ void sqlite3async_run(void); ** ** This parameter may only be set when there are no open database ** connections using the VFS and the queue of pending write requests -** is empty. Attempting to set it when this is not true, or to set it +** is empty. Attempting to set it when this is not true, or to set it ** to a value other than 0 or 1 causes sqlite3async_control() to return ** SQLITE_MISUSE and the value of the parameter to remain unchanged. ** diff --git a/third_party/sqlite/src/ext/fts1/ft_hash.c b/third_party/sqlite/src/ext/fts1/ft_hash.c index 8b3a7064eebf9..ad2dbd43ab65f 100644 --- a/third_party/sqlite/src/ext/fts1/ft_hash.c +++ b/third_party/sqlite/src/ext/fts1/ft_hash.c @@ -32,7 +32,7 @@ void *malloc_and_zero(int n){ ** ** "pNew" is a pointer to the hash table that is to be initialized. ** keyClass is one of the constants HASH_INT, HASH_POINTER, -** HASH_BINARY, or HASH_STRING. The value of keyClass +** HASH_BINARY, or HASH_STRING. The value of keyClass ** determines what kind of key the hash table will use. "copyKey" is ** true if the hash table should make its own private copy of keys and ** false if it should just use the supplied pointer. CopyKey only makes @@ -143,7 +143,7 @@ static int binCompare(const void *pKey1, int n1, const void *pKey2, int n2){ /* ** Return a pointer to the appropriate hash function given the key class. ** -** The C syntax in this function definition may be unfamilar to some +** The C syntax in this function definition may be unfamilar to some ** programmers, so we provide the following additional explanation: ** ** The name of the function is "hashFunction". The function takes a @@ -225,7 +225,7 @@ static void insertElement( /* Resize the hash table so that it cantains "new_size" buckets. -** "new_size" must be a power of 2. The hash table might fail +** "new_size" must be a power of 2. The hash table might fail ** to resize if sqliteMalloc() fails. */ static void rehash(Hash *pH, int new_size){ @@ -267,7 +267,7 @@ static HashElem *findElementGivenHash( count = pEntry->count; xCompare = compareFunction(pH->keyClass); while( count-- && elem ){ - if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ + if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ return elem; } elem = elem->next; @@ -286,7 +286,7 @@ static void removeElementGivenHash( ){ struct _ht *pEntry; if( elem->prev ){ - elem->prev->next = elem->next; + elem->prev->next = elem->next; }else{ pH->first = elem->next; } diff --git a/third_party/sqlite/src/ext/fts1/ft_hash.h b/third_party/sqlite/src/ext/fts1/ft_hash.h index 95871a4590cd1..5f4228462cf16 100644 --- a/third_party/sqlite/src/ext/fts1/ft_hash.h +++ b/third_party/sqlite/src/ext/fts1/ft_hash.h @@ -43,7 +43,7 @@ struct Hash { } *ht; }; -/* Each element in the hash table is an instance of the following +/* Each element in the hash table is an instance of the following ** structure. All elements are stored on a single doubly-linked list. ** ** Again, this structure is intended to be opaque, but it can't really @@ -66,11 +66,11 @@ struct HashElem { ** (including the null-terminator, if any). Case ** is respected in comparisons. ** -** HASH_BINARY pKey points to binary data nKey bytes long. +** HASH_BINARY pKey points to binary data nKey bytes long. ** memcmp() is used to compare keys. ** ** A copy of the key is made for HASH_STRING and HASH_BINARY -** if the copyKey parameter to HashInit is 1. +** if the copyKey parameter to HashInit is 1. */ /* #define HASH_INT 1 // NOT USED */ /* #define HASH_POINTER 2 // NOT USED */ diff --git a/third_party/sqlite/src/ext/fts1/fts1.c b/third_party/sqlite/src/ext/fts1/fts1.c index 77fa9e23f595c..0b89e0883f0e5 100644 --- a/third_party/sqlite/src/ext/fts1/fts1.c +++ b/third_party/sqlite/src/ext/fts1/fts1.c @@ -64,7 +64,7 @@ SQLITE_EXTENSION_INIT1 typedef struct StringBuffer { int len; /* length, not including null terminator */ - int alloced; /* Space allocated for s[] */ + int alloced; /* Space allocated for s[] */ char *s; /* Content of the string */ } StringBuffer; @@ -180,7 +180,7 @@ static int getVarint32(const char *p, int *pi){ * * On disk, every document list has positions and offsets, so we don't bother * to serialize a doclist's type. - * + * * We don't yet delta-encode document IDs; doing so will probably be a * modest win. * @@ -391,7 +391,7 @@ static int atEnd(DocListReader *pReader){ return pReader->pDoclist==0 || (pReader->p >= docListEnd(pReader->pDoclist)); } -/* Peek at the next docid without advancing the read pointer. +/* Peek at the next docid without advancing the read pointer. */ static sqlite_int64 peekDocid(DocListReader *pReader){ sqlite_int64 ret; @@ -671,7 +671,7 @@ static sqlite_int64 nextDocid(DocListReader *pIn){ /* ** pLeft and pRight are two DocListReaders that are pointing to -** positions lists of the same document: iDocid. +** positions lists of the same document: iDocid. ** ** If there are no instances in pLeft or pRight where the position ** of pLeft is one less than the position of pRight, then this @@ -973,7 +973,7 @@ typedef struct QueryTerm { * * OR binds more tightly than the implied AND, which is what the * major search engines seem to do. So, for example: - * + * * [one two OR three] ==> one AND (two OR three) * [one OR two three] ==> (one OR two) AND three * @@ -1110,7 +1110,7 @@ typedef struct fulltext_cursor { Query q; /* Parsed query string */ Snippet snippet; /* Cached snippet for the current row */ int iColumn; /* Column being searched */ - DocListReader result; /* used when iCursorType == QUERY_FULLTEXT */ + DocListReader result; /* used when iCursorType == QUERY_FULLTEXT */ } fulltext_cursor; static struct fulltext_vtab *cursor_vtab(fulltext_cursor *c){ @@ -1516,7 +1516,7 @@ static void fulltext_vtab_destroy(fulltext_vtab *v){ v->pTokenizer->pModule->xDestroy(v->pTokenizer); v->pTokenizer = NULL; } - + free(v->azColumn); for(i = 0; i < v->nColumn; ++i) { sqlite3_free(v->azContentColumn[i]); @@ -1539,11 +1539,11 @@ static void fulltext_vtab_destroy(fulltext_vtab *v){ ** IdChar(X) will be true. Otherwise it is false. ** ** For ASCII, any character with the high-order bit set is -** allowed in an identifier. For 7-bit characters, +** allowed in an identifier. For 7-bit characters, ** sqlite3IsIdChar[X] must be 1. ** ** Ticket #1066. the SQL standard does not allow '$' in the -** middle of identfiers. But many SQL implementations do. +** middle of identfiers. But many SQL implementations do. ** SQLite will allow '$' in identifiers for compatibility. ** But the feature is undocumented. */ @@ -1560,7 +1560,7 @@ static const char isIdChar[] = { /* -** Return the length of the token that begins at z[0]. +** Return the length of the token that begins at z[0]. ** Store the token type in *tokenType before returning. */ static int getToken(const char *z, int *tokenType){ @@ -1766,7 +1766,7 @@ static char *firstToken(char *zIn, char **pzTail){ ** * s begins with the string t, ignoring case ** * s is longer than t ** * The first character of s beyond t is not a alphanumeric -** +** ** Ignore leading space in *s. ** ** To put it another way, return true if the first token of @@ -1809,7 +1809,7 @@ static void clearTableSpec(TableSpec *p) { * USING fts1(subject, body, tokenize mytokenizer(myarg)) * * We return parsed information in a TableSpec structure. - * + * */ static int parseSpec(TableSpec *pSpec, int argc, const char *const*argv, char**pzErr){ @@ -2109,7 +2109,7 @@ static int fulltextBestIndex(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ /* An arbitrary value for now. * TODO: Perhaps rowid matches should be considered cheaper than * full-text searches. */ - pInfo->estimatedCost = 1.0; + pInfo->estimatedCost = 1.0; return SQLITE_OK; } @@ -2221,7 +2221,7 @@ static void snippetOffsetsOfColumn( fulltext_vtab *pVtab; /* The full text index */ int nColumn; /* Number of columns in the index */ const QueryTerm *aTerm; /* Query string terms */ - int nTerm; /* Number of query string terms */ + int nTerm; /* Number of query string terms */ int i, j; /* Loop counters */ int rc; /* Return code */ unsigned int match, prevMatch; /* Phrase search bitmasks */ @@ -2273,12 +2273,12 @@ static void snippetOffsetsOfColumn( prevMatch = match<<1; iRotor++; } - pTModule->xClose(pTCursor); + pTModule->xClose(pTCursor); } /* -** Compute all offsets for the current row of the query. +** Compute all offsets for the current row of the query. ** If the offsets have already been computed, this routine is a no-op. */ static void snippetAllOffsets(fulltext_cursor *p){ @@ -2425,7 +2425,7 @@ static void snippetText( int iStart, iEnd; int tailEllipsis = 0; int iMatch; - + free(pCursor->snippet.zSnippet); pCursor->snippet.zSnippet = 0; @@ -2513,7 +2513,7 @@ static void snippetText( append(&sb, zEllipsis); } pCursor->snippet.zSnippet = sb.s; - pCursor->snippet.nSnippet = sb.len; + pCursor->snippet.nSnippet = sb.len; } @@ -2679,7 +2679,7 @@ static int tokenizeSegment( int firstIndex = pQuery->nTerms; int iCol; int nTerm = 1; - + int rc = pModule->xOpen(pTokenizer, pSegment, nSegment, &pCursor); if( rc!=SQLITE_OK ) return rc; pCursor->pTokenizer = pTokenizer; @@ -3156,7 +3156,7 @@ static int fulltextUpdate(sqlite3_vtab *pVtab, int nArg, sqlite3_value **ppArg, fts1HashElem *e; TRACE(("FTS1 Update %p\n", pVtab)); - + fts1HashInit(&terms, FTS1_HASH_STRING, 1); if( nArg<2 ){ @@ -3320,7 +3320,7 @@ static const sqlite3_module fulltextModule = { /* xColumn */ fulltextColumn, /* xRowid */ fulltextRowid, /* xUpdate */ fulltextUpdate, - /* xBegin */ 0, + /* xBegin */ 0, /* xSync */ 0, /* xCommit */ 0, /* xRollback */ 0, diff --git a/third_party/sqlite/src/ext/fts1/fts1_hash.c b/third_party/sqlite/src/ext/fts1/fts1_hash.c index 463a52b64555b..61cc159862470 100644 --- a/third_party/sqlite/src/ext/fts1/fts1_hash.c +++ b/third_party/sqlite/src/ext/fts1/fts1_hash.c @@ -43,8 +43,8 @@ static void *malloc_and_zero(int n){ ** fields of the Hash structure. ** ** "pNew" is a pointer to the hash table that is to be initialized. -** keyClass is one of the constants -** FTS1_HASH_BINARY or FTS1_HASH_STRING. The value of keyClass +** keyClass is one of the constants +** FTS1_HASH_BINARY or FTS1_HASH_STRING. The value of keyClass ** determines what kind of key the hash table will use. "copyKey" is ** true if the hash table should make its own private copy of keys and ** false if it should just use the supplied pointer. @@ -123,7 +123,7 @@ static int binCompare(const void *pKey1, int n1, const void *pKey2, int n2){ /* ** Return a pointer to the appropriate hash function given the key class. ** -** The C syntax in this function definition may be unfamilar to some +** The C syntax in this function definition may be unfamilar to some ** programmers, so we provide the following additional explanation: ** ** The name of the function is "hashFunction". The function takes a @@ -183,7 +183,7 @@ static void insertElement( /* Resize the hash table so that it cantains "new_size" buckets. -** "new_size" must be a power of 2. The hash table might fail +** "new_size" must be a power of 2. The hash table might fail ** to resize if sqliteMalloc() fails. */ static void rehash(fts1Hash *pH, int new_size){ @@ -225,7 +225,7 @@ static fts1HashElem *findElementGivenHash( count = pEntry->count; xCompare = compareFunction(pH->keyClass); while( count-- && elem ){ - if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ + if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ return elem; } elem = elem->next; @@ -244,7 +244,7 @@ static void removeElementGivenHash( ){ struct _fts1ht *pEntry; if( elem->prev ){ - elem->prev->next = elem->next; + elem->prev->next = elem->next; }else{ pH->first = elem->next; } diff --git a/third_party/sqlite/src/ext/fts1/fts1_hash.h b/third_party/sqlite/src/ext/fts1/fts1_hash.h index 9001152931c8c..ba2efd33cdd70 100644 --- a/third_party/sqlite/src/ext/fts1/fts1_hash.h +++ b/third_party/sqlite/src/ext/fts1/fts1_hash.h @@ -43,7 +43,7 @@ struct fts1Hash { } *ht; }; -/* Each element in the hash table is an instance of the following +/* Each element in the hash table is an instance of the following ** structure. All elements are stored on a single doubly-linked list. ** ** Again, this structure is intended to be opaque, but it can't really @@ -62,10 +62,10 @@ struct fts1HashElem { ** (including the null-terminator, if any). Case ** is respected in comparisons. ** -** FTS1_HASH_BINARY pKey points to binary data nKey bytes long. +** FTS1_HASH_BINARY pKey points to binary data nKey bytes long. ** memcmp() is used to compare keys. ** -** A copy of the key is made if the copyKey parameter to fts1HashInit is 1. +** A copy of the key is made if the copyKey parameter to fts1HashInit is 1. */ #define FTS1_HASH_STRING 1 #define FTS1_HASH_BINARY 2 diff --git a/third_party/sqlite/src/ext/fts1/fts1_porter.c b/third_party/sqlite/src/ext/fts1/fts1_porter.c index 1d26236681a05..3ec2b747351c7 100644 --- a/third_party/sqlite/src/ext/fts1/fts1_porter.c +++ b/third_party/sqlite/src/ext/fts1/fts1_porter.c @@ -84,7 +84,7 @@ static int porterDestroy(sqlite3_tokenizer *pTokenizer){ /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is zInput[0..nInput-1]. A cursor -** used to incrementally tokenize this string is returned in +** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int porterOpen( @@ -135,7 +135,7 @@ static const char cType[] = { /* ** isConsonant() and isVowel() determine if their first character in ** the string they point to is a consonant or a vowel, according -** to Porter ruls. +** to Porter ruls. ** ** A consonate is any letter other than 'a', 'e', 'i', 'o', or 'u'. ** 'Y' is a consonant unless it follows another consonant, @@ -255,11 +255,11 @@ static int star_oh(const char *z){ /* ** If the word ends with zFrom and xCond() is true for the stem -** of the word that preceeds the zFrom ending, then change the +** of the word that preceeds the zFrom ending, then change the ** ending to zTo. ** ** The input word *pz and zFrom are both in reverse order. zTo -** is in normal order. +** is in normal order. ** ** Return TRUE if zFrom matches. Return FALSE if zFrom does not ** match. Not that TRUE is returned even if xCond() fails and @@ -328,9 +328,9 @@ static void copy_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ ** word contains digits, 3 bytes are taken from the beginning and ** 3 bytes from the end. For long words without digits, 10 bytes ** are taken from each end. US-ASCII case folding still applies. -** -** If the input word contains not digits but does characters not -** in [a-zA-Z] then no stemming is attempted and this routine just +** +** If the input word contains not digits but does characters not +** in [a-zA-Z] then no stemming is attempted and this routine just ** copies the input into the input into the output with US-ASCII ** case folding. ** @@ -375,11 +375,11 @@ static void porter_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ } } - /* Step 1b */ + /* Step 1b */ z2 = z; if( stem(&z, "dee", "ee", m_gt_0) ){ /* Do nothing. The work was all in the test */ - }else if( + }else if( (stem(&z, "gni", "", hasVowel) || stem(&z, "de", "", hasVowel)) && z!=z2 ){ diff --git a/third_party/sqlite/src/ext/fts1/fts1_tokenizer1.c b/third_party/sqlite/src/ext/fts1/fts1_tokenizer1.c index f58fba8f8e613..b67d3b1fc75d5 100644 --- a/third_party/sqlite/src/ext/fts1/fts1_tokenizer1.c +++ b/third_party/sqlite/src/ext/fts1/fts1_tokenizer1.c @@ -99,7 +99,7 @@ static int simpleDestroy(sqlite3_tokenizer *pTokenizer){ /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is pInput[0..nBytes-1]. A cursor -** used to incrementally tokenize this string is returned in +** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int simpleOpen( diff --git a/third_party/sqlite/src/ext/fts1/fulltext.c b/third_party/sqlite/src/ext/fts1/fulltext.c index 313ff303e1af2..61f35164b63ee 100644 --- a/third_party/sqlite/src/ext/fts1/fulltext.c +++ b/third_party/sqlite/src/ext/fts1/fulltext.c @@ -105,7 +105,7 @@ static int getVarint32(const char *p, int *pi){ * * On disk, every document list has positions and offsets, so we don't bother * to serialize a doclist's type. - * + * * We don't yet delta-encode document IDs; doing so will probably be a * modest win. * @@ -1105,7 +1105,7 @@ static int query_merge(fulltext_vtab *v, sqlite3_stmt **pSelect, return rc; } } - + return SQLITE_OK; } @@ -1137,7 +1137,7 @@ static void query_add(Query *q, int is_phrase, const char *zTerm){ t->is_phrase = is_phrase; t->zTerm = zTerm; } - + static void query_free(Query *q){ int i; for(i = 0; i < q->nTerms; ++i){ @@ -1152,7 +1152,7 @@ static int tokenize_segment(sqlite3_tokenizer *pTokenizer, sqlite3_tokenizer_module *pModule = pTokenizer->pModule; sqlite3_tokenizer_cursor *pCursor; int is_first = 1; - + int rc = pModule->xOpen(pTokenizer, zQuery, -1, &pCursor); if( rc!=SQLITE_OK ) return rc; pCursor->pTokenizer = pTokenizer; @@ -1196,7 +1196,7 @@ static int parse_query(fulltext_vtab *v, const char *zQuery, Query *pQuery){ s = t; in_phrase = !in_phrase; } - + free(zQuery1); return SQLITE_OK; } @@ -1317,7 +1317,7 @@ static int build_terms(Hash *terms, sqlite3_tokenizer *pTokenizer, /* Positions can't be negative; we use -1 as a terminator internally. */ if( iPosition<0 ) { - rc = SQLITE_ERROR; + rc = SQLITE_ERROR; goto err; } diff --git a/third_party/sqlite/src/ext/fts2/README.tokenizers b/third_party/sqlite/src/ext/fts2/README.tokenizers index 98d2021ba1d02..a2ab859d20136 100644 --- a/third_party/sqlite/src/ext/fts2/README.tokenizers +++ b/third_party/sqlite/src/ext/fts2/README.tokenizers @@ -14,17 +14,17 @@ "simple" and "porter". should consist of zero or more white-space separated - arguments to pass to the selected tokenizer implementation. The - interpretation of the arguments, if any, depends on the individual + arguments to pass to the selected tokenizer implementation. The + interpretation of the arguments, if any, depends on the individual tokenizer. 2. Custom Tokenizers - FTS2 allows users to provide custom tokenizer implementations. The - interface used to create a new tokenizer is defined and described in + FTS2 allows users to provide custom tokenizer implementations. The + interface used to create a new tokenizer is defined and described in the fts2_tokenizer.h source file. - Registering a new FTS2 tokenizer is similar to registering a new + Registering a new FTS2 tokenizer is similar to registering a new virtual table module with SQLite. The user passes a pointer to a structure containing pointers to various callback functions that make up the implementation of the new tokenizer type. For tokenizers, @@ -40,7 +40,7 @@ SELECT fts2_tokenizer(); SELECT fts2_tokenizer(, ); - + Where is a string identifying the tokenizer and is a pointer to an sqlite3_tokenizer_module structure encoded as an SQL blob. If the second argument is present, @@ -60,8 +60,8 @@ 3. ICU Library Tokenizers - If this extension is compiled with the SQLITE_ENABLE_ICU pre-processor - symbol defined, then there exists a built-in tokenizer named "icu" + If this extension is compiled with the SQLITE_ENABLE_ICU pre-processor + symbol defined, then there exists a built-in tokenizer named "icu" implemented using the ICU library. The first argument passed to the xCreate() method (see fts2_tokenizer.h) of this tokenizer may be an ICU locale identifier. For example "tr_TR" for Turkish as used @@ -73,8 +73,8 @@ text according to the ICU rules for finding word boundaries and discards any tokens that consist entirely of white-space. This may be suitable for some applications in some locales, but not all. If more complex - processing is required, for example to implement stemming or - discard punctuation, this can be done by creating a tokenizer + processing is required, for example to implement stemming or + discard punctuation, this can be done by creating a tokenizer implementation that uses the ICU tokenizer as part of its implementation. When using the ICU tokenizer this way, it is safe to overwrite the @@ -87,47 +87,47 @@ the fts2_tokenizer() scalar function: int registerTokenizer( - sqlite3 *db, - char *zName, + sqlite3 *db, + char *zName, const sqlite3_tokenizer_module *p ){ int rc; sqlite3_stmt *pStmt; const char zSql[] = "SELECT fts2_tokenizer(?, ?)"; - + rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc!=SQLITE_OK ){ return rc; } - + sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); sqlite3_bind_blob(pStmt, 2, &p, sizeof(p), SQLITE_STATIC); sqlite3_step(pStmt); - + return sqlite3_finalize(pStmt); } - + int queryTokenizer( - sqlite3 *db, - char *zName, + sqlite3 *db, + char *zName, const sqlite3_tokenizer_module **pp ){ int rc; sqlite3_stmt *pStmt; const char zSql[] = "SELECT fts2_tokenizer(?)"; - + *pp = 0; rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc!=SQLITE_OK ){ return rc; } - + sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); if( SQLITE_ROW==sqlite3_step(pStmt) ){ if( sqlite3_column_type(pStmt, 0)==SQLITE_BLOB ){ memcpy(pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp)); } } - + return sqlite3_finalize(pStmt); } diff --git a/third_party/sqlite/src/ext/fts2/fts2.c b/third_party/sqlite/src/ext/fts2/fts2.c index 0405fb7b1e56f..27250730104e3 100644 --- a/third_party/sqlite/src/ext/fts2/fts2.c +++ b/third_party/sqlite/src/ext/fts2/fts2.c @@ -1716,7 +1716,7 @@ typedef struct QueryTerm { * * OR binds more tightly than the implied AND, which is what the * major search engines seem to do. So, for example: - * + * * [one two OR three] ==> one AND (two OR three) * [one OR two three] ==> (one OR two) AND three * @@ -2407,11 +2407,11 @@ static void fulltext_vtab_destroy(fulltext_vtab *v){ ** IdChar(X) will be true. Otherwise it is false. ** ** For ASCII, any character with the high-order bit set is -** allowed in an identifier. For 7-bit characters, +** allowed in an identifier. For 7-bit characters, ** sqlite3IsIdChar[X] must be 1. ** ** Ticket #1066. the SQL standard does not allow '$' in the -** middle of identfiers. But many SQL implementations do. +** middle of identfiers. But many SQL implementations do. ** SQLite will allow '$' in identifiers for compatibility. ** But the feature is undocumented. */ @@ -2428,7 +2428,7 @@ static const char isIdChar[] = { /* -** Return the length of the token that begins at z[0]. +** Return the length of the token that begins at z[0]. ** Store the token type in *tokenType before returning. */ static int getToken(const char *z, int *tokenType){ @@ -2634,7 +2634,7 @@ static char *firstToken(char *zIn, char **pzTail){ ** * s begins with the string t, ignoring case ** * s is longer than t ** * The first character of s beyond t is not a alphanumeric -** +** ** Ignore leading space in *s. ** ** To put it another way, return true if the first token of @@ -2677,7 +2677,7 @@ static void clearTableSpec(TableSpec *p) { * USING fts2(subject, body, tokenize mytokenizer(myarg)) * * We return parsed information in a TableSpec structure. - * + * */ static int parseSpec(TableSpec *pSpec, int argc, const char *const*argv, char**pzErr){ @@ -2834,7 +2834,7 @@ static int constructVtab( return SQLITE_NOMEM; } - zTok = spec->azTokenizer[0]; + zTok = spec->azTokenizer[0]; if( !zTok ){ zTok = "simple"; } @@ -2970,7 +2970,7 @@ static int fulltextBestIndex(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ /* An arbitrary value for now. * TODO: Perhaps rowid matches should be considered cheaper than * full-text searches. */ - pInfo->estimatedCost = 1.0; + pInfo->estimatedCost = 1.0; return SQLITE_OK; } @@ -3087,7 +3087,7 @@ static void snippetOffsetsOfColumn( fulltext_vtab *pVtab; /* The full text index */ int nColumn; /* Number of columns in the index */ const QueryTerm *aTerm; /* Query string terms */ - int nTerm; /* Number of query string terms */ + int nTerm; /* Number of query string terms */ int i, j; /* Loop counters */ int rc; /* Return code */ unsigned int match, prevMatch; /* Phrase search bitmasks */ @@ -3141,12 +3141,12 @@ static void snippetOffsetsOfColumn( prevMatch = match<<1; iRotor++; } - pTModule->xClose(pTCursor); + pTModule->xClose(pTCursor); } /* -** Compute all offsets for the current row of the query. +** Compute all offsets for the current row of the query. ** If the offsets have already been computed, this routine is a no-op. */ static void snippetAllOffsets(fulltext_cursor *p){ @@ -3274,7 +3274,7 @@ static void snippetText( int iStart, iEnd; int tailEllipsis = 0; int iMatch; - + sqlite3_free(pCursor->snippet.zSnippet); pCursor->snippet.zSnippet = 0; @@ -3542,7 +3542,7 @@ static int tokenizeSegment( int firstIndex = pQuery->nTerms; int iCol; int nTerm = 1; - + int rc = pModule->xOpen(pTokenizer, pSegment, nSegment, &pCursor); if( rc!=SQLITE_OK ) return rc; pCursor->pTokenizer = pTokenizer; @@ -6721,8 +6721,8 @@ static int fulltextRename( "ALTER TABLE %Q.'%q_content' RENAME TO '%q_content';" "ALTER TABLE %Q.'%q_segments' RENAME TO '%q_segments';" "ALTER TABLE %Q.'%q_segdir' RENAME TO '%q_segdir';" - , p->zDb, p->zName, zName - , p->zDb, p->zName, zName + , p->zDb, p->zName, zName + , p->zDb, p->zName, zName , p->zDb, p->zName, zName ); if( zSql ){ @@ -6808,18 +6808,18 @@ int sqlite3Fts2Init(sqlite3 *db){ /* Load the built-in tokenizers into the hash table */ if( rc==SQLITE_OK ){ if( sqlite3Fts2HashInsert(pHash, "simple", 7, (void *)pSimple) - || sqlite3Fts2HashInsert(pHash, "porter", 7, (void *)pPorter) + || sqlite3Fts2HashInsert(pHash, "porter", 7, (void *)pPorter) || (pIcu && sqlite3Fts2HashInsert(pHash, "icu", 4, (void *)pIcu)) ){ rc = SQLITE_NOMEM; } } - /* Create the virtual table wrapper around the hash-table and overload + /* Create the virtual table wrapper around the hash-table and overload ** the two scalar functions. If this is successful, register the ** module with sqlite. */ - if( SQLITE_OK==rc + if( SQLITE_OK==rc && SQLITE_OK==(rc = sqlite3Fts2InitHashTable(db, pHash, "fts2_tokenizer")) && SQLITE_OK==(rc = sqlite3_overload_function(db, "snippet", -1)) && SQLITE_OK==(rc = sqlite3_overload_function(db, "offsets", -1)) @@ -6848,7 +6848,7 @@ int sqlite3Fts2Init(sqlite3 *db){ __declspec(dllexport) #endif int sqlite3_fts2_init( - sqlite3 *db, + sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ diff --git a/third_party/sqlite/src/ext/fts2/fts2_hash.c b/third_party/sqlite/src/ext/fts2/fts2_hash.c index 3596dcf0b8007..913e9d010f1ef 100644 --- a/third_party/sqlite/src/ext/fts2/fts2_hash.c +++ b/third_party/sqlite/src/ext/fts2/fts2_hash.c @@ -52,8 +52,8 @@ static void fts2HashFree(void *p){ ** fields of the Hash structure. ** ** "pNew" is a pointer to the hash table that is to be initialized. -** keyClass is one of the constants -** FTS2_HASH_BINARY or FTS2_HASH_STRING. The value of keyClass +** keyClass is one of the constants +** FTS2_HASH_BINARY or FTS2_HASH_STRING. The value of keyClass ** determines what kind of key the hash table will use. "copyKey" is ** true if the hash table should make its own private copy of keys and ** false if it should just use the supplied pointer. @@ -130,7 +130,7 @@ static int binCompare(const void *pKey1, int n1, const void *pKey2, int n2){ /* ** Return a pointer to the appropriate hash function given the key class. ** -** The C syntax in this function definition may be unfamilar to some +** The C syntax in this function definition may be unfamilar to some ** programmers, so we provide the following additional explanation: ** ** The name of the function is "hashFunction". The function takes a @@ -190,7 +190,7 @@ static void insertElement( /* Resize the hash table so that it cantains "new_size" buckets. -** "new_size" must be a power of 2. The hash table might fail +** "new_size" must be a power of 2. The hash table might fail ** to resize if sqliteMalloc() fails. */ static void rehash(fts2Hash *pH, int new_size){ @@ -232,7 +232,7 @@ static fts2HashElem *findElementGivenHash( count = pEntry->count; xCompare = compareFunction(pH->keyClass); while( count-- && elem ){ - if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ + if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ return elem; } elem = elem->next; @@ -251,7 +251,7 @@ static void removeElementGivenHash( ){ struct _fts2ht *pEntry; if( elem->prev ){ - elem->prev->next = elem->next; + elem->prev->next = elem->next; }else{ pH->first = elem->next; } diff --git a/third_party/sqlite/src/ext/fts2/fts2_hash.h b/third_party/sqlite/src/ext/fts2/fts2_hash.h index 02936f18bbaa7..2335bca7cc03e 100644 --- a/third_party/sqlite/src/ext/fts2/fts2_hash.h +++ b/third_party/sqlite/src/ext/fts2/fts2_hash.h @@ -41,7 +41,7 @@ struct fts2Hash { } *ht; }; -/* Each element in the hash table is an instance of the following +/* Each element in the hash table is an instance of the following ** structure. All elements are stored on a single doubly-linked list. ** ** Again, this structure is intended to be opaque, but it can't really @@ -60,10 +60,10 @@ struct fts2HashElem { ** (including the null-terminator, if any). Case ** is respected in comparisons. ** -** FTS2_HASH_BINARY pKey points to binary data nKey bytes long. +** FTS2_HASH_BINARY pKey points to binary data nKey bytes long. ** memcmp() is used to compare keys. ** -** A copy of the key is made if the copyKey parameter to fts2HashInit is 1. +** A copy of the key is made if the copyKey parameter to fts2HashInit is 1. */ #define FTS2_HASH_STRING 1 #define FTS2_HASH_BINARY 2 diff --git a/third_party/sqlite/src/ext/fts2/fts2_icu.c b/third_party/sqlite/src/ext/fts2/fts2_icu.c index 2670301f5198f..ea4a98b5c462f 100644 --- a/third_party/sqlite/src/ext/fts2/fts2_icu.c +++ b/third_party/sqlite/src/ext/fts2/fts2_icu.c @@ -10,7 +10,7 @@ ** ************************************************************************* ** This file implements a tokenizer for fts2 based on the ICU library. -** +** ** $Id: fts2_icu.c,v 1.3 2008/12/18 05:30:26 danielk1977 Exp $ */ @@ -90,7 +90,7 @@ static int icuDestroy(sqlite3_tokenizer *pTokenizer){ /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is pInput[0..nBytes-1]. A cursor -** used to incrementally tokenize this string is returned in +** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int icuOpen( @@ -129,7 +129,7 @@ static int icuOpen( pCsr->aOffset = (int *)&pCsr->aChar[(nChar+3)&~3]; pCsr->aOffset[iOut] = iInput; - U8_NEXT(zInput, iInput, nInput, c); + U8_NEXT(zInput, iInput, nInput, c); while( c>0 ){ int isError = 0; c = u_foldCase(c, opt); diff --git a/third_party/sqlite/src/ext/fts2/fts2_porter.c b/third_party/sqlite/src/ext/fts2/fts2_porter.c index 881baf7100f46..09cc30cc5c640 100644 --- a/third_party/sqlite/src/ext/fts2/fts2_porter.c +++ b/third_party/sqlite/src/ext/fts2/fts2_porter.c @@ -86,7 +86,7 @@ static int porterDestroy(sqlite3_tokenizer *pTokenizer){ /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is zInput[0..nInput-1]. A cursor -** used to incrementally tokenize this string is returned in +** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int porterOpen( @@ -137,7 +137,7 @@ static const char cType[] = { /* ** isConsonant() and isVowel() determine if their first character in ** the string they point to is a consonant or a vowel, according -** to Porter ruls. +** to Porter ruls. ** ** A consonate is any letter other than 'a', 'e', 'i', 'o', or 'u'. ** 'Y' is a consonant unless it follows another consonant, @@ -257,11 +257,11 @@ static int star_oh(const char *z){ /* ** If the word ends with zFrom and xCond() is true for the stem -** of the word that preceeds the zFrom ending, then change the +** of the word that preceeds the zFrom ending, then change the ** ending to zTo. ** ** The input word *pz and zFrom are both in reverse order. zTo -** is in normal order. +** is in normal order. ** ** Return TRUE if zFrom matches. Return FALSE if zFrom does not ** match. Not that TRUE is returned even if xCond() fails and @@ -330,9 +330,9 @@ static void copy_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ ** word contains digits, 3 bytes are taken from the beginning and ** 3 bytes from the end. For long words without digits, 10 bytes ** are taken from each end. US-ASCII case folding still applies. -** -** If the input word contains not digits but does characters not -** in [a-zA-Z] then no stemming is attempted and this routine just +** +** If the input word contains not digits but does characters not +** in [a-zA-Z] then no stemming is attempted and this routine just ** copies the input into the input into the output with US-ASCII ** case folding. ** @@ -377,11 +377,11 @@ static void porter_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ } } - /* Step 1b */ + /* Step 1b */ z2 = z; if( stem(&z, "dee", "ee", m_gt_0) ){ /* Do nothing. The work was all in the test */ - }else if( + }else if( (stem(&z, "gni", "", hasVowel) || stem(&z, "de", "", hasVowel)) && z!=z2 ){ diff --git a/third_party/sqlite/src/ext/fts2/fts2_tokenizer.c b/third_party/sqlite/src/ext/fts2/fts2_tokenizer.c index dda33a72d262e..46adcb281253f 100644 --- a/third_party/sqlite/src/ext/fts2/fts2_tokenizer.c +++ b/third_party/sqlite/src/ext/fts2/fts2_tokenizer.c @@ -35,7 +35,7 @@ SQLITE_EXTENSION_INIT3 #include /* -** Implementation of the SQL scalar function for accessing the underlying +** Implementation of the SQL scalar function for accessing the underlying ** hash table. This function may be called as follows: ** ** SELECT (); @@ -107,7 +107,7 @@ static void scalarFunc( #include /* -** Implementation of a special SQL scalar function for testing tokenizers +** Implementation of a special SQL scalar function for testing tokenizers ** designed to be used in concert with the Tcl testing framework. This ** function must be called with two arguments: ** @@ -120,9 +120,9 @@ static void scalarFunc( ** ** The return value is a string that may be interpreted as a Tcl ** list. For each token in the , three elements are -** added to the returned list. The first is the token position, the +** added to the returned list. The first is the token position, the ** second is the token text (folded, stemmed, etc.) and the third is the -** substring of associated with the token. For example, +** substring of associated with the token. For example, ** using the built-in "simple" tokenizer: ** ** SELECT fts_tokenizer_test('simple', 'I don't see how'); @@ -130,7 +130,7 @@ static void scalarFunc( ** will return the string: ** ** "{0 i I 1 dont don't 2 see see 3 how how}" -** +** */ static void testFunc( sqlite3_context *context, @@ -222,8 +222,8 @@ finish: static int registerTokenizer( - sqlite3 *db, - char *zName, + sqlite3 *db, + char *zName, const sqlite3_tokenizer_module *p ){ int rc; @@ -244,8 +244,8 @@ int registerTokenizer( static int queryFts2Tokenizer( - sqlite3 *db, - char *zName, + sqlite3 *db, + char *zName, const sqlite3_tokenizer_module **pp ){ int rc; @@ -323,23 +323,23 @@ static void intTestFunc( /* ** Set up SQL objects in database db used to access the contents of ** the hash table pointed to by argument pHash. The hash table must -** been initialized to use string keys, and to take a private copy +** been initialized to use string keys, and to take a private copy ** of the key when a value is inserted. i.e. by a call similar to: ** ** sqlite3Fts2HashInit(pHash, FTS2_HASH_STRING, 1); ** ** This function adds a scalar function (see header comment above ** scalarFunc() in this file for details) and, if ENABLE_TABLE is -** defined at compilation time, a temporary virtual table (see header -** comment above struct HashTableVtab) to the database schema. Both +** defined at compilation time, a temporary virtual table (see header +** comment above struct HashTableVtab) to the database schema. Both ** provide read/write access to the contents of *pHash. ** ** The third argument to this function, zName, is used as the name ** of both the scalar and, if created, the virtual table. */ int sqlite3Fts2InitHashTable( - sqlite3 *db, - fts2Hash *pHash, + sqlite3 *db, + fts2Hash *pHash, const char *zName ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/fts2/fts2_tokenizer.h b/third_party/sqlite/src/ext/fts2/fts2_tokenizer.h index 8db2048d6bf36..1cf860ce321b8 100644 --- a/third_party/sqlite/src/ext/fts2/fts2_tokenizer.h +++ b/third_party/sqlite/src/ext/fts2/fts2_tokenizer.h @@ -35,7 +35,7 @@ ** When an fts2 table is created, it passes any arguments passed to ** the tokenizer clause of the CREATE VIRTUAL TABLE statement to the ** sqlite3_tokenizer_module.xCreate() function of the requested tokenizer -** implementation. The xCreate() function in turn returns an +** implementation. The xCreate() function in turn returns an ** sqlite3_tokenizer structure representing the specific tokenizer to ** be used for the fts2 table (customized by the tokenizer clause arguments). ** @@ -67,7 +67,7 @@ struct sqlite3_tokenizer_module { ** then argc is set to 2, and the argv[] array contains pointers ** to the strings "arg1" and "arg2". ** - ** This method should return either SQLITE_OK (0), or an SQLite error + ** This method should return either SQLITE_OK (0), or an SQLite error ** code. If SQLITE_OK is returned, then *ppTokenizer should be set ** to point at the newly created tokenizer structure. The generic ** sqlite3_tokenizer.pModule variable should not be initialized by @@ -88,7 +88,7 @@ struct sqlite3_tokenizer_module { /* ** Create a tokenizer cursor to tokenize an input buffer. The caller ** is responsible for ensuring that the input buffer remains valid - ** until the cursor is closed (using the xClose() method). + ** until the cursor is closed (using the xClose() method). */ int (*xOpen)( sqlite3_tokenizer *pTokenizer, /* Tokenizer object */ @@ -97,7 +97,7 @@ struct sqlite3_tokenizer_module { ); /* - ** Destroy an existing tokenizer cursor. The fts2 module calls this + ** Destroy an existing tokenizer cursor. The fts2 module calls this ** method exactly once for each successful call to xOpen(). */ int (*xClose)(sqlite3_tokenizer_cursor *pCursor); @@ -108,7 +108,7 @@ struct sqlite3_tokenizer_module { ** "OUT" variables identified below, or SQLITE_DONE to indicate that ** the end of the buffer has been reached, or an SQLite error code. ** - ** *ppToken should be set to point at a buffer containing the + ** *ppToken should be set to point at a buffer containing the ** normalized version of the token (i.e. after any case-folding and/or ** stemming has been performed). *pnBytes should be set to the length ** of this buffer in bytes. The input text that generated the token is @@ -117,7 +117,7 @@ struct sqlite3_tokenizer_module { ** ** The buffer *ppToken is set to point at is managed by the tokenizer ** implementation. It is only required to be valid until the next call - ** to xNext() or xClose(). + ** to xNext() or xClose(). */ /* TODO(shess) current implementation requires pInput to be ** nul-terminated. This should either be fixed, or pInput/nBytes diff --git a/third_party/sqlite/src/ext/fts2/fts2_tokenizer1.c b/third_party/sqlite/src/ext/fts2/fts2_tokenizer1.c index fe4f9eb4b5620..ae6c3811fbd93 100644 --- a/third_party/sqlite/src/ext/fts2/fts2_tokenizer1.c +++ b/third_party/sqlite/src/ext/fts2/fts2_tokenizer1.c @@ -111,7 +111,7 @@ static int simpleDestroy(sqlite3_tokenizer *pTokenizer){ /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is pInput[0..nBytes-1]. A cursor -** used to incrementally tokenize this string is returned in +** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int simpleOpen( diff --git a/third_party/sqlite/src/ext/fts2/mkfts2amal.tcl b/third_party/sqlite/src/ext/fts2/mkfts2amal.tcl index 5c8d1e93d78f5..4f0edbf8d2f42 100644 --- a/third_party/sqlite/src/ext/fts2/mkfts2amal.tcl +++ b/third_party/sqlite/src/ext/fts2/mkfts2amal.tcl @@ -26,8 +26,8 @@ set today [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S UTC" -gmt 1] puts $out [subst \ {/****************************************************************************** ** This file is an amalgamation of separate C source files from the SQLite -** Full Text Search extension 2 (fts2). By combining all the individual C -** code files into this single large file, the entire code can be compiled +** Full Text Search extension 2 (fts2). By combining all the individual C +** code files into this single large file, the entire code can be compiled ** as a one translation unit. This allows many compilers to do optimizations ** that would not be possible if the files were compiled separately. It also ** makes the code easier to import into other projects. @@ -35,7 +35,7 @@ puts $out [subst \ ** This amalgamation was generated on $today. */}] -# These are the header files used by FTS2. The first time any of these +# These are the header files used by FTS2. The first time any of these # files are seen in a #include statement in the C code, include the complete # text of the file in-line. The file only needs to be included once. # diff --git a/third_party/sqlite/src/ext/fts3/README.content b/third_party/sqlite/src/ext/fts3/README.content index ab986754df212..ef6b44a2a1598 100644 --- a/third_party/sqlite/src/ext/fts3/README.content +++ b/third_party/sqlite/src/ext/fts3/README.content @@ -1,21 +1,21 @@ FTS4 CONTENT OPTION - Normally, in order to create a full-text index on a dataset, the FTS4 - module stores a copy of all indexed documents in a specially created + Normally, in order to create a full-text index on a dataset, the FTS4 + module stores a copy of all indexed documents in a specially created database table. As of SQLite version 3.7.9, FTS4 supports a new option - "content" - designed to extend FTS4 to support the creation of full-text indexes where: - * The indexed documents are not stored within the SQLite database + * The indexed documents are not stored within the SQLite database at all (a "contentless" FTS4 table), or * The indexed documents are stored in a database table created and managed by the user (an "external content" FTS4 table). - Because the indexed documents themselves are usually much larger than - the full-text index, the content option can sometimes be used to achieve + Because the indexed documents themselves are usually much larger than + the full-text index, the content option can sometimes be used to achieve significant space savings. CONTENTLESS FTS4 TABLES @@ -60,18 +60,18 @@ CONTENTLESS FTS4 TABLES Errors related to attempting to retrieve column values other than docid are runtime errors that occur within sqlite3_step(). In some cases, for example if the MATCH expression in a SELECT query matches zero rows, there - may be no error at all even if a statement does refer to column values + may be no error at all even if a statement does refer to column values other than docid. EXTERNAL CONTENT FTS4 TABLES An "external content" FTS4 table is similar to a contentless table, except - that if evaluation of a query requires the value of a column other than - docid, FTS4 attempts to retrieve that value from a table (or view, or + that if evaluation of a query requires the value of a column other than + docid, FTS4 attempts to retrieve that value from a table (or view, or virtual table) nominated by the user (hereafter referred to as the "content table"). The FTS4 module never writes to the content table, and writing to the content table does not affect the full-text index. It is the - responsibility of the user to ensure that the content table and the + responsibility of the user to ensure that the content table and the full-text index are consistent. An external content FTS4 table is created by setting the content option @@ -83,7 +83,7 @@ EXTERNAL CONTENT FTS4 TABLES CREATE TABLE t2(id INTEGER PRIMARY KEY, a, b, c); CREATE VIRTUAL TABLE t3 USING fts4(content="t2", a, c); - Assuming the nominated table does exist, then its columns must be the same + Assuming the nominated table does exist, then its columns must be the same as or a superset of those defined for the FTS table. When a users query on the FTS table requires a column value other than @@ -94,7 +94,7 @@ EXTERNAL CONTENT FTS4 TABLES CREATE TABLE t2(id INTEGER PRIMARY KEY, a, b, c, d); CREATE VIRTUAL TABLE t3 USING fts4(content="t2", b, c); - + INSERT INTO t2 VALUES(2, 'a b', 'c d', 'e f'); INSERT INTO t2 VALUES(3, 'g h', 'i j', 'k l'); INSERT INTO t3(docid, b, c) SELECT id, b, c FROM t2; @@ -102,7 +102,7 @@ EXTERNAL CONTENT FTS4 TABLES -- The following query returns a single row with two columns containing -- the text values "i j" and "k l". -- - -- The query uses the full-text index to discover that the MATCH + -- The query uses the full-text index to discover that the MATCH -- term matches the row with docid=3. It then retrieves the values -- of columns b and c from the row with rowid=3 in the content table -- to return. @@ -128,14 +128,14 @@ EXTERNAL CONTENT FTS4 TABLES When a row is deleted from an external content FTS4 table, FTS4 needs to retrieve the column values of the row being deleted from the content table. This is so that FTS4 can update the full-text index entries for each token - that occurs within the deleted row to indicate that that row has been + that occurs within the deleted row to indicate that that row has been deleted. If the content table row cannot be found, or if it contains values inconsistent with the contents of the FTS index, the results can be difficult to predict. The FTS index may be left containing entries corresponding to the deleted row, which can lead to seemingly nonsensical results being returned by subsequent SELECT queries. The same applies when a row is updated, as internally an UPDATE is the same as a DELETE followed by an INSERT. - + Instead of writing separately to the full-text index and the content table, some users may wish to use database triggers to keep the full-text index up to date with respect to the set of documents stored in the content table. diff --git a/third_party/sqlite/src/ext/fts3/README.syntax b/third_party/sqlite/src/ext/fts3/README.syntax index 01bc80c5fbe9f..76d071f7c04e9 100644 --- a/third_party/sqlite/src/ext/fts3/README.syntax +++ b/third_party/sqlite/src/ext/fts3/README.syntax @@ -2,15 +2,15 @@ 1. OVERVIEW This README file describes the syntax of the arguments that may be passed to - the FTS3 MATCH operator used for full-text queries. For example, if table + the FTS3 MATCH operator used for full-text queries. For example, if table "t1" is an Fts3 virtual table, the following SQL query: SELECT * FROM t1 WHERE MATCH - may be used to retrieve all rows that match a specified for full-text query. - The text "" should be replaced by either the name of the fts3 table - (in this case "t1"), or by the name of one of the columns of the fts3 - table. should be replaced by an SQL expression that + may be used to retrieve all rows that match a specified for full-text query. + The text "" should be replaced by either the name of the fts3 table + (in this case "t1"), or by the name of one of the columns of the fts3 + table. should be replaced by an SQL expression that computes to a string containing an Fts3 query. If the left-hand-side of the MATCH operator is set to the name of the @@ -19,7 +19,7 @@ may only match the specified column. In both cases this may be overriden as part of the query text (see sections 2 and 3 below). - As of SQLite version 3.6.8, Fts3 supports two slightly different query + As of SQLite version 3.6.8, Fts3 supports two slightly different query formats; the standard syntax, which is used by default, and the enhanced query syntax which can be selected by compiling with the pre-processor symbol SQLITE_ENABLE_FTS3_PARENTHESIS defined. @@ -28,15 +28,15 @@ 2. STANDARD QUERY SYNTAX - When using the standard Fts3 query syntax, a query usually consists of a + When using the standard Fts3 query syntax, a query usually consists of a list of terms (words) separated by white-space characters. To match a query, a row (or column) of an Fts3 table must contain each of the specified terms. For example, the following query: MATCH 'hello world' - matches rows (or columns, if is the name of a column name) that - contain at least one instance of the token "hello", and at least one + matches rows (or columns, if is the name of a column name) that + contain at least one instance of the token "hello", and at least one instance of the token "world". Tokens may be grouped into phrases using quotation marks. In this case, a matching row or column must contain each of the tokens in the phrase in the order specified, with no intervening @@ -51,8 +51,8 @@ "One should always greet the world with a cheery hello, thought Joe." "How many hello world programs could their be?" - As well as grouping tokens together by phrase, the binary NEAR operator - may be used to search for rows that contain two or more specified tokens + As well as grouping tokens together by phrase, the binary NEAR operator + may be used to search for rows that contain two or more specified tokens or phrases within a specified proximity of each other. The NEAR operator must always be specified in upper case. The word "near" in lower or mixed case is treated as an ordinary token. For example, the following query: @@ -74,13 +74,13 @@ MATCH 'reliable NEAR/2 engineering NEAR/5 consultancy' - searches for a row that contains an instance of the token "reliable" + searches for a row that contains an instance of the token "reliable" seperated by not more than two tokens from an instance of "engineering", which is in turn separated by not more than 5 other tokens from an instance of the term "consultancy". Phrases enclosed in quotes may also be used as arguments to the NEAR operator. - Similar to the NEAR operator, one or more tokens or phrases may be + Similar to the NEAR operator, one or more tokens or phrases may be separated by OR operators. In this case, only one of the specified tokens or phrases must appear in the document. For example, the query: @@ -98,7 +98,7 @@ Any token that is part of an Fts3 query expression, whether or not it is part of a phrase enclosed in quotes, may have a '*' character appended to it. In this case, the token matches all terms that begin with the characters - of the token, not just those that exactly match it. For example, the + of the token, not just those that exactly match it. For example, the following query: MATCH 'sql*' @@ -107,7 +107,7 @@ contain "SQL". A token that is not part of a quoted phrase may be preceded by a '-' - character, which indicates that matching rows must not contain the + character, which indicates that matching rows must not contain the specified term. For example, the following: MATCH '"database engine" -sqlite' @@ -118,7 +118,7 @@ on a single term. At this time, all Fts3 queries must contain at least one term or phrase that is not preceded by the '-' prefix. - Regardless of whether or not a table name or column name is used on the + Regardless of whether or not a table name or column name is used on the left hand side of the MATCH operator, a specific column of the fts3 table may be associated with each token in a query by preceding a token with a column name followed by a ':' character. For example, regardless of what @@ -130,7 +130,7 @@ MATCH 'col1:hello col2:world' - It is not possible to associate a specific table column with a quoted + It is not possible to associate a specific table column with a quoted phrase or a term preceded by a '-' operator. A '*' character may be appended to a term associated with a specific column for prefix matching. @@ -157,7 +157,7 @@ MATCH '(hello AND world) OR (simple AND example)' As with the OR and NEAR operators, the AND operator must be specified - in upper case. The word "and" specified in lower or mixed case is + in upper case. The word "and" specified in lower or mixed case is handled as a regular token. 3) The '-' token prefix is not supported. Instead, a new binary operator, diff --git a/third_party/sqlite/src/ext/fts3/README.tokenizers b/third_party/sqlite/src/ext/fts3/README.tokenizers index 7f2345a81fd0e..add3b55a9a436 100644 --- a/third_party/sqlite/src/ext/fts3/README.tokenizers +++ b/third_party/sqlite/src/ext/fts3/README.tokenizers @@ -14,17 +14,17 @@ "simple", "porter" and "unicode". should consist of zero or more white-space separated - arguments to pass to the selected tokenizer implementation. The - interpretation of the arguments, if any, depends on the individual + arguments to pass to the selected tokenizer implementation. The + interpretation of the arguments, if any, depends on the individual tokenizer. 2. Custom Tokenizers - FTS3 allows users to provide custom tokenizer implementations. The - interface used to create a new tokenizer is defined and described in + FTS3 allows users to provide custom tokenizer implementations. The + interface used to create a new tokenizer is defined and described in the fts3_tokenizer.h source file. - Registering a new FTS3 tokenizer is similar to registering a new + Registering a new FTS3 tokenizer is similar to registering a new virtual table module with SQLite. The user passes a pointer to a structure containing pointers to various callback functions that make up the implementation of the new tokenizer type. For tokenizers, @@ -40,7 +40,7 @@ SELECT fts3_tokenizer(); SELECT fts3_tokenizer(, ); - + Where is a string identifying the tokenizer and is a pointer to an sqlite3_tokenizer_module structure encoded as an SQL blob. If the second argument is present, @@ -60,8 +60,8 @@ 3. ICU Library Tokenizers - If this extension is compiled with the SQLITE_ENABLE_ICU pre-processor - symbol defined, then there exists a built-in tokenizer named "icu" + If this extension is compiled with the SQLITE_ENABLE_ICU pre-processor + symbol defined, then there exists a built-in tokenizer named "icu" implemented using the ICU library. The first argument passed to the xCreate() method (see fts3_tokenizer.h) of this tokenizer may be an ICU locale identifier. For example "tr_TR" for Turkish as used @@ -73,8 +73,8 @@ text according to the ICU rules for finding word boundaries and discards any tokens that consist entirely of white-space. This may be suitable for some applications in some locales, but not all. If more complex - processing is required, for example to implement stemming or - discard punctuation, this can be done by creating a tokenizer + processing is required, for example to implement stemming or + discard punctuation, this can be done by creating a tokenizer implementation that uses the ICU tokenizer as part of its implementation. When using the ICU tokenizer this way, it is safe to overwrite the @@ -87,47 +87,47 @@ the fts3_tokenizer() scalar function: int registerTokenizer( - sqlite3 *db, - char *zName, + sqlite3 *db, + char *zName, const sqlite3_tokenizer_module *p ){ int rc; sqlite3_stmt *pStmt; const char zSql[] = "SELECT fts3_tokenizer(?, ?)"; - + rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc!=SQLITE_OK ){ return rc; } - + sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); sqlite3_bind_blob(pStmt, 2, &p, sizeof(p), SQLITE_STATIC); sqlite3_step(pStmt); - + return sqlite3_finalize(pStmt); } - + int queryTokenizer( - sqlite3 *db, - char *zName, + sqlite3 *db, + char *zName, const sqlite3_tokenizer_module **pp ){ int rc; sqlite3_stmt *pStmt; const char zSql[] = "SELECT fts3_tokenizer(?)"; - + *pp = 0; rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc!=SQLITE_OK ){ return rc; } - + sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); if( SQLITE_ROW==sqlite3_step(pStmt) ){ if( sqlite3_column_type(pStmt, 0)==SQLITE_BLOB ){ memcpy(pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp)); } } - + return sqlite3_finalize(pStmt); } diff --git a/third_party/sqlite/src/ext/fts3/fts3.c b/third_party/sqlite/src/ext/fts3/fts3.c index 5d2f21d2937f5..30c336d2c7da2 100644 --- a/third_party/sqlite/src/ext/fts3/fts3.c +++ b/third_party/sqlite/src/ext/fts3/fts3.c @@ -61,7 +61,7 @@ ** A doclist (document list) holds a docid-sorted list of hits for a ** given term. Doclists hold docids and associated token positions. ** A docid is the unique integer identifier for a single document. -** A position is the index of a word within the document. The first +** A position is the index of a word within the document. The first ** word of the document has a position of 0. ** ** FTS3 used to optionally store character offsets using a compile-time @@ -86,7 +86,7 @@ ** ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream -** generated by the tokenizer. Note that POS_END and POS_COLUMN occur +** generated by the tokenizer. Note that POS_END and POS_COLUMN occur ** in the same logical place as the position element, and act as sentinals ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more @@ -110,7 +110,7 @@ ** a document record consists of a docid followed by a position-list and ** a doclist consists of one or more document records. ** -** A bare doclist omits the position information, becoming an +** A bare doclist omits the position information, becoming an ** array of varint-encoded docids. ** **** Segment leaf nodes **** @@ -304,7 +304,7 @@ #include #include "fts3.h" -#ifndef SQLITE_CORE +#ifndef SQLITE_CORE # include "sqlite3ext.h" SQLITE_EXTENSION_INIT1 #endif @@ -321,7 +321,7 @@ int sqlite3Fts3Never(int b) { assert( !b ); return b; } # endif #endif -/* +/* ** Write a 64-bit variable-length integer to memory starting at p[0]. ** The length of data written will be between 1 and FTS3_VARINT_MAX bytes. ** The number of bytes written is returned. @@ -345,7 +345,7 @@ int sqlite3Fts3PutVarint(char *p, sqlite_int64 v){ v = (*ptr++); \ if( (v & mask2)==0 ){ var = v; return ret; } -/* +/* ** Read a 64-bit variable-length integer from memory starting at p[0]. ** Return the number of bytes read, or 0 on error. ** The value is stored in *v. @@ -428,7 +428,7 @@ void sqlite3Fts3Dequote(char *z){ int iOut = 0; /* Index of next byte to write to output */ /* If the first byte was a '[', then the close-quote character is a ']' */ - if( quote=='[' ) quote = ']'; + if( quote=='[' ) quote = ']'; while( z[iIn] ){ if( z[iIn]==quote ){ @@ -464,14 +464,14 @@ static void fts3GetDeltaVarint(char **pp, sqlite3_int64 *pVal){ ** varint is part of. */ static void fts3GetReverseVarint( - char **pp, - char *pStart, + char **pp, + char *pStart, sqlite3_int64 *pVal ){ sqlite3_int64 iVal; char *p; - /* Pointer p now points at the first byte past the varint we are + /* Pointer p now points at the first byte past the varint we are ** interested in. So, unless the doclist is corrupt, the 0x80 bit is ** clear on character p[-1]. */ for(p = (*pp)-2; p>=pStart && *p&0x80; p--); @@ -579,7 +579,7 @@ static int fts3DestroyMethod(sqlite3_vtab *pVtab){ ** passed as the first argument. This is done as part of the xConnect() ** and xCreate() methods. ** -** If *pRc is non-zero when this function is called, it is a no-op. +** If *pRc is non-zero when this function is called, it is a no-op. ** Otherwise, if an error occurs, an SQLite error code is stored in *pRc ** before returning. */ @@ -602,7 +602,7 @@ static void fts3DeclareVtab(int *pRc, Fts3Table *p){ /* Create the whole "CREATE TABLE" statement to pass to SQLite */ zSql = sqlite3_mprintf( - "CREATE TABLE x(%s %Q HIDDEN, docid HIDDEN, %Q HIDDEN)", + "CREATE TABLE x(%s %Q HIDDEN, docid HIDDEN, %Q HIDDEN)", zCols, p->zName, zLanguageid ); if( !zCols || !zSql ){ @@ -621,7 +621,7 @@ static void fts3DeclareVtab(int *pRc, Fts3Table *p){ ** Create the %_stat table if it does not already exist. */ void sqlite3Fts3CreateStatTable(int *pRc, Fts3Table *p){ - fts3DbExec(pRc, p->db, + fts3DbExec(pRc, p->db, "CREATE TABLE IF NOT EXISTS %Q.'%q_stat'" "(id INTEGER PRIMARY KEY, value BLOB);", p->zDb, p->zName @@ -657,9 +657,9 @@ static int fts3CreateTables(Fts3Table *p){ zContentCols = sqlite3_mprintf("%z, langid", zContentCols, zLanguageid); } if( zContentCols==0 ) rc = SQLITE_NOMEM; - + /* Create the content table */ - fts3DbExec(&rc, db, + fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_content'(%s)", p->zDb, p->zName, zContentCols ); @@ -667,11 +667,11 @@ static int fts3CreateTables(Fts3Table *p){ } /* Create other tables */ - fts3DbExec(&rc, db, + fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_segments'(blockid INTEGER PRIMARY KEY, block BLOB);", p->zDb, p->zName ); - fts3DbExec(&rc, db, + fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_segdir'(" "level INTEGER," "idx INTEGER," @@ -684,7 +684,7 @@ static int fts3CreateTables(Fts3Table *p){ p->zDb, p->zName ); if( p->bHasDocsize ){ - fts3DbExec(&rc, db, + fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_docsize'(docid INTEGER PRIMARY KEY, size BLOB);", p->zDb, p->zName ); @@ -699,7 +699,7 @@ static int fts3CreateTables(Fts3Table *p){ /* ** Store the current database page-size in bytes in p->nPgsz. ** -** If *pRc is non-zero when this function is called, it is a no-op. +** If *pRc is non-zero when this function is called, it is a no-op. ** Otherwise, if an error occurs, an SQLite error code is stored in *pRc ** before returning. */ @@ -708,7 +708,7 @@ static void fts3DatabasePageSize(int *pRc, Fts3Table *p){ int rc; /* Return code */ char *zSql; /* SQL text "PRAGMA %Q.page_size" */ sqlite3_stmt *pStmt; /* Compiled "PRAGMA %Q.page_size" statement */ - + zSql = sqlite3_mprintf("PRAGMA %Q.page_size", p->zDb); if( !zSql ){ rc = SQLITE_NOMEM; @@ -734,11 +734,11 @@ static void fts3DatabasePageSize(int *pRc, Fts3Table *p){ ** ** = ** -** There may not be whitespace surrounding the "=" character. The +** There may not be whitespace surrounding the "=" character. The ** term may be quoted, but the may not. */ static int fts3IsSpecialColumn( - const char *z, + const char *z, int *pnKey, char **pzValue ){ @@ -815,7 +815,7 @@ static char *fts3QuoteId(char const *zInput){ } /* -** Return a list of comma separated SQL expressions and a FROM clause that +** Return a list of comma separated SQL expressions and a FROM clause that ** could be used in a SELECT statement such as the following: ** ** SELECT FROM %_content AS x ... @@ -866,7 +866,7 @@ static char *fts3ReadExprList(Fts3Table *p, const char *zFunc, int *pRc){ fts3Appendf(pRc, &zRet, ", x.%Q", p->zLanguageid); } } - fts3Appendf(pRc, &zRet, " FROM '%q'.'%q%s' AS x", + fts3Appendf(pRc, &zRet, " FROM '%q'.'%q%s' AS x", p->zDb, (p->zContentTbl ? p->zContentTbl : p->zName), (p->zContentTbl ? "" : "_content") @@ -881,7 +881,7 @@ static char *fts3ReadExprList(Fts3Table *p, const char *zFunc, int *pRc){ ** ** If argument zFunc is not NULL, then all but the first question mark ** is preceded by zFunc and an open bracket, and followed by a closed -** bracket. For example, if zFunc is "zip" and the FTS3 table has three +** bracket. For example, if zFunc is "zip" and the FTS3 table has three ** user-defined text columns, the following string is returned: ** ** "?, zip(?), zip(?), zip(?)" @@ -918,11 +918,11 @@ static char *fts3WriteExprList(Fts3Table *p, const char *zFunc, int *pRc){ /* ** This function interprets the string at (*pp) as a non-negative integer -** value. It reads the integer and sets *pnOut to the value read, then +** value. It reads the integer and sets *pnOut to the value read, then ** sets *pp to point to the byte immediately following the last byte of ** the integer value. ** -** Only decimal digits ('0'..'9') may be part of an integer value. +** Only decimal digits ('0'..'9') may be part of an integer value. ** ** If *pp does not being with a decimal digit SQLITE_ERROR is returned and ** the output value undefined. Otherwise SQLITE_OK is returned. @@ -1043,7 +1043,7 @@ static int fts3ContentColumns( char **pzErr /* OUT: error message */ ){ int rc = SQLITE_OK; /* Return code */ - char *zSql; /* "SELECT *" statement on zTbl */ + char *zSql; /* "SELECT *" statement on zTbl */ sqlite3_stmt *pStmt = 0; /* Compiled version of zSql */ zSql = sqlite3_mprintf("SELECT * FROM %Q.%Q", zDb, zTbl); @@ -1185,9 +1185,9 @@ static int fts3InitVtab( char *zVal; /* Check if this is a tokenizer specification */ - if( !pTokenizer + if( !pTokenizer && strlen(z)>8 - && 0==sqlite3_strnicmp(z, "tokenize", 8) + && 0==sqlite3_strnicmp(z, "tokenize", 8) && 0==sqlite3Fts3IsIdChar(z[8]) ){ rc = sqlite3Fts3InitTokenizer(pHash, &z[9], &pTokenizer, pzErr); @@ -1251,8 +1251,8 @@ static int fts3InitVtab( break; case 4: /* ORDER */ - if( (strlen(zVal)!=3 || sqlite3_strnicmp(zVal, "asc", 3)) - && (strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "desc", 4)) + if( (strlen(zVal)!=3 || sqlite3_strnicmp(zVal, "asc", 3)) + && (strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "desc", 4)) ){ sqlite3Fts3ErrMsg(pzErr, "unrecognized order: %s", zVal); rc = SQLITE_ERROR; @@ -1298,17 +1298,17 @@ static int fts3InitVtab( ** TABLE statement, use all columns from the content table. */ if( rc==SQLITE_OK && zContent ){ - sqlite3_free(zCompress); - sqlite3_free(zUncompress); + sqlite3_free(zCompress); + sqlite3_free(zUncompress); zCompress = 0; zUncompress = 0; if( nCol==0 ){ - sqlite3_free((void*)aCol); + sqlite3_free((void*)aCol); aCol = 0; rc = fts3ContentColumns(db, argv[1], zContent,&aCol,&nCol,&nString,pzErr); /* If a languageid= option was specified, remove the language id - ** column from the aCol[] array. */ + ** column from the aCol[] array. */ if( rc==SQLITE_OK && zLanguageid ){ int j; for(j=0; jazColumn[iCol], zNot, n) + && 0==sqlite3_strnicmp(p->azColumn[iCol], zNot, n) ){ p->abNotindexed[iCol] = 1; sqlite3_free(zNot); @@ -1436,7 +1436,7 @@ static int fts3InitVtab( p->zWriteExprlist = fts3WriteExprList(p, zCompress, &rc); if( rc!=SQLITE_OK ) goto fts3_init_out; - /* If this is an xCreate call, create the underlying tables in the + /* If this is an xCreate call, create the underlying tables in the ** database. TODO: For xConnect(), it could verify that said tables exist. */ if( isCreate ){ @@ -1532,11 +1532,11 @@ static void fts3SetUniqueFlag(sqlite3_index_info *pIdxInfo){ #endif } -/* +/* ** Implementation of the xBestIndex method for FTS3 tables. There ** are three possible strategies, in order of preference: ** -** 1. Direct lookup by rowid or docid. +** 1. Direct lookup by rowid or docid. ** 2. Full-text search using a MATCH operator on a non-docid column. ** 3. Linear scan of %_content table. */ @@ -1551,7 +1551,7 @@ static int fts3BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ int iIdx; /* By default use a full table scan. This is an expensive option, - ** so search through the constraints to see if a more efficient + ** so search through the constraints to see if a more efficient ** strategy is possible. */ pInfo->idxNum = FTS3_FULLSCAN_SEARCH; @@ -1587,12 +1587,12 @@ static int fts3BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ ** ** If there is more than one MATCH constraint available, use the first ** one encountered. If there is both a MATCH constraint and a direct - ** rowid/docid lookup, prefer the MATCH strategy. This is done even + ** rowid/docid lookup, prefer the MATCH strategy. This is done even ** though the rowid/docid lookup is faster than a MATCH query, selecting - ** it would lead to an "unable to use function MATCH in the requested + ** it would lead to an "unable to use function MATCH in the requested ** context" error. */ - if( pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH + if( pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH && pCons->iColumn>=0 && pCons->iColumn<=p->nColumn ){ pInfo->idxNum = FTS3_FULLTEXT_SEARCH + pCons->iColumn; @@ -1601,7 +1601,7 @@ static int fts3BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ } /* Equality constraint on the langid column */ - if( pCons->op==SQLITE_INDEX_CONSTRAINT_EQ + if( pCons->op==SQLITE_INDEX_CONSTRAINT_EQ && pCons->iColumn==p->nColumn + 2 ){ iLangidCons = i; @@ -1629,22 +1629,22 @@ static int fts3BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ if( iCons>=0 ){ pInfo->aConstraintUsage[iCons].argvIndex = iIdx++; pInfo->aConstraintUsage[iCons].omit = 1; - } + } if( iLangidCons>=0 ){ pInfo->idxNum |= FTS3_HAVE_LANGID; pInfo->aConstraintUsage[iLangidCons].argvIndex = iIdx++; - } + } if( iDocidGe>=0 ){ pInfo->idxNum |= FTS3_HAVE_DOCID_GE; pInfo->aConstraintUsage[iDocidGe].argvIndex = iIdx++; - } + } if( iDocidLe>=0 ){ pInfo->idxNum |= FTS3_HAVE_DOCID_LE; pInfo->aConstraintUsage[iDocidLe].argvIndex = iIdx++; - } + } /* Regardless of the strategy selected, FTS can deliver rows in rowid (or - ** docid) order. Both ascending and descending are possible. + ** docid) order. Both ascending and descending are possible. */ if( pInfo->nOrderBy==1 ){ struct sqlite3_index_orderby *pOrder = &pInfo->aOrderBy[0]; @@ -1671,7 +1671,7 @@ static int fts3OpenMethod(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCsr){ UNUSED_PARAMETER(pVTab); /* Allocate a buffer large enough for an Fts3Cursor structure. If the - ** allocation succeeds, zero it and return SQLITE_OK. Otherwise, + ** allocation succeeds, zero it and return SQLITE_OK. Otherwise, ** if the allocation fails, return SQLITE_NOMEM. */ *ppCsr = pCsr = (sqlite3_vtab_cursor *)sqlite3_malloc(sizeof(Fts3Cursor)); @@ -1750,7 +1750,7 @@ static int fts3CursorSeekStmt(Fts3Cursor *pCsr){ /* ** Position the pCsr->pStmt statement so that it is on the row ** of the %_content table that contains the last match. Return -** SQLITE_OK on success. +** SQLITE_OK on success. */ static int fts3CursorSeek(sqlite3_context *pContext, Fts3Cursor *pCsr){ int rc = SQLITE_OK; @@ -1782,7 +1782,7 @@ static int fts3CursorSeek(sqlite3_context *pContext, Fts3Cursor *pCsr){ /* ** This function is used to process a single interior node when searching -** a b-tree for a term or term prefix. The node data is passed to this +** a b-tree for a term or term prefix. The node data is passed to this ** function via the zNode/nNode parameters. The term to search for is ** passed in zTerm/nTerm. ** @@ -1811,9 +1811,9 @@ static int fts3ScanInteriorNode( int isFirstTerm = 1; /* True when processing first term on page */ sqlite3_int64 iChild; /* Block id of child node to descend to */ - /* Skip over the 'height' varint that occurs at the start of every + /* Skip over the 'height' varint that occurs at the start of every ** interior node. Then load the blockid of the left-child of the b-tree - ** node into variable iChild. + ** node into variable iChild. ** ** Even if the data structure on disk is corrupted, this (reading two ** varints from the buffer) does not risk an overread. If zNode is a @@ -1829,13 +1829,13 @@ static int fts3ScanInteriorNode( if( zCsr>zEnd ){ return FTS_CORRUPT_VTAB; } - + while( zCsrpos(*pp1) && pos(*pp2)-pos(*pp1)<=nToken). i.e. ** when the *pp1 token appears before the *pp2 token, but not more than nToken @@ -2233,11 +2233,11 @@ static int fts3PoslistPhraseMerge( assert( isSaveLeft==0 || isExact==0 ); assert( p!=0 && *p1!=0 && *p2!=0 ); - if( *p1==POS_COLUMN ){ + if( *p1==POS_COLUMN ){ p1++; p1 += fts3GetVarint32(p1, &iCol1); } - if( *p2==POS_COLUMN ){ + if( *p2==POS_COLUMN ){ p2++; p2 += fts3GetVarint32(p2, &iCol2); } @@ -2260,8 +2260,8 @@ static int fts3PoslistPhraseMerge( fts3GetDeltaVarint(&p2, &iPos2); iPos2 -= 2; while( 1 ){ - if( iPos2==iPos1+nToken - || (isExact==0 && iPos2>iPos1 && iPos2<=iPos1+nToken) + if( iPos2==iPos1+nToken + || (isExact==0 && iPos2>iPos1 && iPos2<=iPos1+nToken) ){ sqlite3_int64 iSave; iSave = isSaveLeft ? iPos1 : iPos2; @@ -2296,8 +2296,8 @@ static int fts3PoslistPhraseMerge( /* Advance pointer p1 or p2 (whichever corresponds to the smaller of ** iCol1 and iCol2) so that it points to either the 0x00 that marks the - ** end of the position list, or the 0x01 that precedes the next - ** column-number in the position list. + ** end of the position list, or the 0x01 that precedes the next + ** column-number in the position list. */ else if( iCol1bDescIdx, + int rc = fts3DoclistOrMerge(p->bDescIdx, pTS->aaOutput[i], pTS->anOutput[i], aOut, nOut, &aNew, &nNew ); if( rc!=SQLITE_OK ){ @@ -2754,15 +2754,15 @@ static int fts3TermSelectMerge( ){ if( pTS->aaOutput[0]==0 ){ /* If this is the first term selected, copy the doclist to the output - ** buffer using memcpy(). + ** buffer using memcpy(). ** - ** Add FTS3_VARINT_MAX bytes of unused space to the end of the + ** Add FTS3_VARINT_MAX bytes of unused space to the end of the ** allocation. This is so as to ensure that the buffer is big enough ** to hold the current doclist AND'd with any other doclist. If the ** doclists are stored in order=ASC order, this padding would not be ** required (since the size of [doclistA AND doclistB] is always less ** than or equal to the size of [doclistA] in that case). But this is - ** not true for order=DESC. For example, a doclist containing (1, -1) + ** not true for order=DESC. For example, a doclist containing (1, -1) ** may be smaller than (-1), as in the first example the -1 may be stored ** as a single-byte delta, whereas in the second it must be stored as a ** FTS3_VARINT_MAX byte varint. @@ -2791,7 +2791,7 @@ static int fts3TermSelectMerge( char *aNew; int nNew; - int rc = fts3DoclistOrMerge(p->bDescIdx, aMerge, nMerge, + int rc = fts3DoclistOrMerge(p->bDescIdx, aMerge, nMerge, pTS->aaOutput[iOut], pTS->anOutput[iOut], &aNew, &nNew ); if( rc!=SQLITE_OK ){ @@ -2802,7 +2802,7 @@ static int fts3TermSelectMerge( if( aMerge!=aDoclist ) sqlite3_free(aMerge); sqlite3_free(pTS->aaOutput[iOut]); pTS->aaOutput[iOut] = 0; - + aMerge = aNew; nMerge = nNew; if( (iOut+1)==SizeofArray(pTS->aaOutput) ){ @@ -2819,7 +2819,7 @@ static int fts3TermSelectMerge( ** Append SegReader object pNew to the end of the pCsr->apSegment[] array. */ static int fts3SegReaderCursorAppend( - Fts3MultiSegReader *pCsr, + Fts3MultiSegReader *pCsr, Fts3SegReader *pNew ){ if( (pCsr->nSegment%16)==0 ){ @@ -2858,10 +2858,10 @@ static int fts3SegReaderCursor( sqlite3_stmt *pStmt = 0; /* Statement to iterate through segments */ int rc2; /* Result of sqlite3_reset() */ - /* If iLevel is less than 0 and this is not a scan, include a seg-reader + /* If iLevel is less than 0 and this is not a scan, include a seg-reader ** for the pending-terms. If this is a scan, then this call must be being ** made by an fts4aux module, not an FTS table. In this case calling - ** Fts3SegReaderPending might segfault, as the data structures used by + ** Fts3SegReaderPending might segfault, as the data structures used by ** fts4aux are not completely populated. So it's easiest to filter these ** calls out here. */ if( iLevel<0 && p->aIndex ){ @@ -2895,10 +2895,10 @@ static int fts3SegReaderCursor( if( rc!=SQLITE_OK ) goto finished; if( isPrefix==0 && isScan==0 ) iLeavesEndBlock = iStartBlock; } - - rc = sqlite3Fts3SegReaderNew(pCsr->nSegment+1, + + rc = sqlite3Fts3SegReaderNew(pCsr->nSegment+1, (isPrefix==0 && isScan==0), - iStartBlock, iLeavesEndBlock, + iStartBlock, iLeavesEndBlock, iEndBlock, zRoot, nRoot, &pSeg ); if( rc!=SQLITE_OK ) goto finished; @@ -2914,7 +2914,7 @@ static int fts3SegReaderCursor( } /* -** Set up a cursor object for iterating through a full-text index or a +** Set up a cursor object for iterating through a full-text index or a ** single level therein. */ int sqlite3Fts3SegReaderCursor( @@ -2930,7 +2930,7 @@ int sqlite3Fts3SegReaderCursor( ){ assert( iIndex>=0 && iIndexnIndex ); assert( iLevel==FTS3_SEGCURSOR_ALL - || iLevel==FTS3_SEGCURSOR_PENDING + || iLevel==FTS3_SEGCURSOR_PENDING || iLevel>=0 ); assert( iLevelnIndex; i++){ if( p->aIndex[i].nPrefix==nTerm ){ bFound = 1; - rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, + rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, i, FTS3_SEGCURSOR_ALL, zTerm, nTerm, 0, 0, pSegcsr ); pSegcsr->bLookup = 1; @@ -3004,7 +3004,7 @@ static int fts3TermSegReaderCursor( for(i=1; bFound==0 && inIndex; i++){ if( p->aIndex[i].nPrefix==nTerm+1 ){ bFound = 1; - rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, + rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, i, FTS3_SEGCURSOR_ALL, zTerm, nTerm, 1, 0, pSegcsr ); if( rc==SQLITE_OK ){ @@ -3017,7 +3017,7 @@ static int fts3TermSegReaderCursor( } if( bFound==0 ){ - rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, + rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, 0, FTS3_SEGCURSOR_ALL, zTerm, nTerm, isPrefix, 0, pSegcsr ); pSegcsr->bLookup = !isPrefix; @@ -3065,7 +3065,7 @@ static int fts3TermSelect( rc = sqlite3Fts3SegReaderStart(p, pSegcsr, &filter); while( SQLITE_OK==rc - && SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, pSegcsr)) + && SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, pSegcsr)) ){ rc = fts3TermSelectMerge(p, &tsc, pSegcsr->aDoclist, pSegcsr->nDoclist); } @@ -3094,7 +3094,7 @@ static int fts3TermSelect( ** ** If the isPoslist argument is true, then it is assumed that the doclist ** contains a position-list following each docid. Otherwise, it is assumed -** that the doclist is simply a list of docids stored as delta encoded +** that the doclist is simply a list of docids stored as delta encoded ** varints. */ static int fts3DoclistCountDocids(char *aList, int nList){ @@ -3249,7 +3249,7 @@ static int fts3FilterMethod( assert( p->base.zErrMsg==0 ); rc = sqlite3Fts3ExprParse(p->pTokenizer, pCsr->iLangid, - p->azColumn, p->bFts4, p->nColumn, iCol, zQuery, -1, &pCsr->pExpr, + p->azColumn, p->bFts4, p->nColumn, iCol, zQuery, -1, &pCsr->pExpr, &p->base.zErrMsg ); if( rc!=SQLITE_OK ){ @@ -3276,7 +3276,7 @@ static int fts3FilterMethod( (pCsr->bDesc ? "DESC" : "ASC") ); }else{ - zSql = sqlite3_mprintf("SELECT %s ORDER BY rowid %s", + zSql = sqlite3_mprintf("SELECT %s ORDER BY rowid %s", p->zReadExprlist, (pCsr->bDesc ? "DESC" : "ASC") ); } @@ -3297,15 +3297,15 @@ static int fts3FilterMethod( return fts3NextMethod(pCursor); } -/* -** This is the xEof method of the virtual table. SQLite calls this +/* +** This is the xEof method of the virtual table. SQLite calls this ** routine to find out if it has reached the end of a result set. */ static int fts3EofMethod(sqlite3_vtab_cursor *pCursor){ return ((Fts3Cursor *)pCursor)->isEof; } -/* +/* ** This is the xRowid method. The SQLite core calls this routine to ** retrieve the rowid for the current row of the result set. fts3 ** exposes %_content.docid as the rowid for the virtual table. The @@ -3317,7 +3317,7 @@ static int fts3RowidMethod(sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid){ return SQLITE_OK; } -/* +/* ** This is the xColumn method, called by SQLite to request a value from ** the row that the supplied cursor currently points to. ** @@ -3341,7 +3341,7 @@ static int fts3ColumnMethod( assert( iCol>=0 && iCol<=p->nColumn+2 ); if( iCol==p->nColumn+1 ){ - /* This call is a request for the "docid" column. Since "docid" is an + /* This call is a request for the "docid" column. Since "docid" is an ** alias for "rowid", use the xRowid() method to obtain the value. */ sqlite3_result_int64(pCtx, pCsr->iPrevId); @@ -3352,7 +3352,7 @@ static int fts3ColumnMethod( }else if( iCol==p->nColumn+2 && pCsr->pExpr ){ sqlite3_result_int64(pCtx, pCsr->iLangid); }else{ - /* The requested column is either a user column (one that contains + /* The requested column is either a user column (one that contains ** indexed data), or the language-id column. */ rc = fts3CursorSeek(0, pCsr); @@ -3373,8 +3373,8 @@ static int fts3ColumnMethod( return rc; } -/* -** This function is the implementation of the xUpdate callback used by +/* +** This function is the implementation of the xUpdate callback used by ** FTS3 virtual tables. It is invoked by SQLite each time a row is to be ** inserted, updated or deleted. */ @@ -3409,7 +3409,7 @@ static int fts3SyncMethod(sqlite3_vtab *pVtab){ ** ** Of course, updating the input segments also involves deleting a bunch ** of blocks from the segments table. But this is not considered overhead - ** as it would also be required by a crisis-merge that used the same input + ** as it would also be required by a crisis-merge that used the same input ** segments. */ const u32 nMinMerge = 64; /* Minimum amount of incr-merge work to do */ @@ -3417,8 +3417,8 @@ static int fts3SyncMethod(sqlite3_vtab *pVtab){ Fts3Table *p = (Fts3Table*)pVtab; int rc = sqlite3Fts3PendingTermsFlush(p); - if( rc==SQLITE_OK - && p->nLeafAdd>(nMinMerge/16) + if( rc==SQLITE_OK + && p->nLeafAdd>(nMinMerge/16) && p->nAutoincrmerge && p->nAutoincrmerge!=0xff ){ int mxLevel = 0; /* Maximum relative level value in db */ @@ -3462,7 +3462,7 @@ static int fts3SetHasStat(Fts3Table *p){ } /* -** Implementation of xBegin() method. +** Implementation of xBegin() method. */ static int fts3BeginMethod(sqlite3_vtab *pVtab){ Fts3Table *p = (Fts3Table*)pVtab; @@ -3518,17 +3518,17 @@ static void fts3ReversePoslist(char *pStart, char **ppPoslist){ /* Skip backwards passed any trailing 0x00 bytes added by NearTrim() */ while( p>pStart && (c=*p--)==0 ); - /* Search backwards for a varint with value zero (the end of the previous + /* Search backwards for a varint with value zero (the end of the previous ** poslist). This is an 0x00 byte preceded by some byte that does not ** have the 0x80 bit set. */ - while( p>pStart && (*p & 0x80) | c ){ - c = *p--; + while( p>pStart && (*p & 0x80) | c ){ + c = *p--; } assert( p==pStart || c==0 ); /* At this point p points to that preceding byte without the 0x80 bit ** set. So to find the start of the poslist, skip forward 2 bytes then - ** over a varint. + ** over a varint. ** ** Normally. The other case is that p==pStart and the poslist to return ** is the first in the doclist. In this case do not skip forward 2 bytes. @@ -3549,7 +3549,7 @@ static void fts3ReversePoslist(char *pStart, char **ppPoslist){ ** offsets() and optimize() SQL functions. ** ** If the value passed as the third argument is a blob of size -** sizeof(Fts3Cursor*), then the blob contents are copied to the +** sizeof(Fts3Cursor*), then the blob contents are copied to the ** output variable *ppCsr and SQLITE_OK is returned. Otherwise, an error ** message is written to context pContext and SQLITE_ERROR returned. The ** string passed via zFunc is used as part of the error message. @@ -3592,7 +3592,7 @@ static void fts3SnippetFunc( assert( nVal>=1 ); if( nVal>6 ){ - sqlite3_result_error(pContext, + sqlite3_result_error(pContext, "wrong number of arguments to function snippet()", -1); return; } @@ -3634,8 +3634,8 @@ static void fts3OffsetsFunc( } } -/* -** Implementation of the special optimize() function for FTS3. This +/* +** Implementation of the special optimize() function for FTS3. This ** function merges all segments in the database to a single segment. ** Example usage is: ** @@ -3744,10 +3744,10 @@ static int fts3RenameMethod( /* At this point it must be known if the %_stat table exists or not. ** So bHasStat may not be 2. */ rc = fts3SetHasStat(p); - + /* As it happens, the pending terms table is always empty here. This is - ** because an "ALTER TABLE RENAME TABLE" statement inside a transaction - ** always opens a savepoint transaction. And the xSavepoint() method + ** because an "ALTER TABLE RENAME TABLE" statement inside a transaction + ** always opens a savepoint transaction. And the xSavepoint() method ** flushes the pending terms table. But leave the (no-op) call to ** PendingTermsFlush() in in case that changes. */ @@ -3871,7 +3871,7 @@ static void hashDestroy(void *p){ } /* -** The fts3 built-in tokenizers - "simple", "porter" and "icu"- are +** The fts3 built-in tokenizers - "simple", "porter" and "icu"- are ** implemented in files fts3_tokenizer1.c, fts3_porter.c and fts3_icu.c ** respectively. The following three forward declarations are for functions ** declared in these files used to retrieve the respective implementations. @@ -3935,10 +3935,10 @@ int sqlite3Fts3Init(sqlite3 *db){ /* Load the built-in tokenizers into the hash table */ if( rc==SQLITE_OK ){ if( sqlite3Fts3HashInsert(pHash, "simple", 7, (void *)pSimple) - || sqlite3Fts3HashInsert(pHash, "porter", 7, (void *)pPorter) + || sqlite3Fts3HashInsert(pHash, "porter", 7, (void *)pPorter) #ifndef SQLITE_DISABLE_FTS3_UNICODE - || sqlite3Fts3HashInsert(pHash, "unicode61", 10, (void *)pUnicode) + || sqlite3Fts3HashInsert(pHash, "unicode61", 10, (void *)pUnicode) #endif #ifdef SQLITE_ENABLE_ICU || (pIcu && sqlite3Fts3HashInsert(pHash, "icu", 4, (void *)pIcu)) @@ -3954,11 +3954,11 @@ int sqlite3Fts3Init(sqlite3 *db){ } #endif - /* Create the virtual table wrapper around the hash-table and overload + /* Create the virtual table wrapper around the hash-table and overload ** the two scalar functions. If this is successful, register the ** module with sqlite. */ - if( SQLITE_OK==rc + if( SQLITE_OK==rc #if CHROMIUM_FTS3_CHANGES && !SQLITE_TEST /* fts3_tokenizer() disabled for security reasons. */ #else @@ -4000,7 +4000,7 @@ int sqlite3Fts3Init(sqlite3 *db){ /* ** Allocate an Fts3MultiSegReader for each token in the expression headed -** by pExpr. +** by pExpr. ** ** An Fts3SegReader object is a cursor that can seek or scan a range of ** entries within a single segment b-tree. An Fts3MultiSegReader uses multiple @@ -4010,7 +4010,7 @@ int sqlite3Fts3Init(sqlite3 *db){ ** If the allocated Fts3MultiSegReader just seeks to a single entry in a ** segment b-tree (if the term is not a prefix or it is a prefix for which ** there exists prefix b-tree of the right length) then it may be traversed -** and merged incrementally. Otherwise, it has to be merged into an in-memory +** and merged incrementally. Otherwise, it has to be merged into an in-memory ** doclist and then traversed. */ static void fts3EvalAllocateReaders( @@ -4027,7 +4027,7 @@ static void fts3EvalAllocateReaders( *pnToken += nToken; for(i=0; ipPhrase->aToken[i]; - int rc = fts3TermSegReaderCursor(pCsr, + int rc = fts3TermSegReaderCursor(pCsr, pToken->z, pToken->n, pToken->isPrefix, &pToken->pSegcsr ); if( rc!=SQLITE_OK ){ @@ -4232,7 +4232,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){ sqlite3_free(aPoslist); return SQLITE_NOMEM; } - + pPhrase->doclist.pList = aOut; if( fts3PoslistPhraseMerge(&aOut, nDistance, 0, 1, &p1, &p2) ){ pPhrase->doclist.bFreeList = 1; @@ -4256,7 +4256,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){ #define MAX_INCR_PHRASE_TOKENS 4 /* -** This function is called for each Fts3Phrase in a full-text query +** This function is called for each Fts3Phrase in a full-text query ** expression to initialize the mechanism for returning rows. Once this ** function has been called successfully on an Fts3Phrase, it may be ** used with fts3EvalPhraseNext() to iterate through the matching docids. @@ -4274,12 +4274,12 @@ static int fts3EvalPhraseStart(Fts3Cursor *pCsr, int bOptOk, Fts3Phrase *p){ /* Determine if doclists may be loaded from disk incrementally. This is ** possible if the bOptOk argument is true, the FTS doclists will be - ** scanned in forward order, and the phrase consists of + ** scanned in forward order, and the phrase consists of ** MAX_INCR_PHRASE_TOKENS or fewer tokens, none of which are are "^first" ** tokens or prefix tokens that cannot use a prefix-index. */ int bHaveIncr = 0; - int bIncrOk = (bOptOk - && pCsr->bDesc==pTab->bDescIdx + int bIncrOk = (bOptOk + && pCsr->bDesc==pTab->bDescIdx && p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 #ifdef SQLITE_TEST && pTab->bNoIncrDoclist==0 @@ -4315,12 +4315,12 @@ static int fts3EvalPhraseStart(Fts3Cursor *pCsr, int bOptOk, Fts3Phrase *p){ } /* -** This function is used to iterate backwards (from the end to start) +** This function is used to iterate backwards (from the end to start) ** through doclists. It is used by this module to iterate through phrase ** doclists in reverse and by the fts3_write.c module to iterate through ** pending-terms lists when writing to databases with "order=desc". ** -** The doclist may be sorted in ascending (parameter bDescIdx==0) or +** The doclist may be sorted in ascending (parameter bDescIdx==0) or ** descending (parameter bDescIdx==1) order of docid. Regardless, this ** function iterates from the end of the doclist to the beginning. */ @@ -4400,7 +4400,7 @@ void sqlite3Fts3DoclistNext( p += sqlite3Fts3GetVarint(p, piDocid); }else{ fts3PoslistCopy(0, &p); - while( p<&aDoclist[nDoclist] && *p==0 ) p++; + while( p<&aDoclist[nDoclist] && *p==0 ) p++; if( p>=&aDoclist[nDoclist] ){ *pbEof = 1; }else{ @@ -4424,7 +4424,7 @@ static void fts3EvalDlPhraseNext( ){ char *pIter; /* Used to iterate through aAll */ char *pEnd = &pDL->aAll[pDL->nAll]; /* 1 byte past end of aAll */ - + if( pDL->pNextDocid ){ pIter = pDL->pNextDocid; }else{ @@ -4472,12 +4472,12 @@ struct TokenDoclist { }; /* -** Token pToken is an incrementally loaded token that is part of a +** Token pToken is an incrementally loaded token that is part of a ** multi-token phrase. Advance it to the next matching document in the ** database and populate output variable *p with the details of the new ** entry. Or, if the iterator has reached EOF, set *pbEof to true. ** -** If an error occurs, return an SQLite error code. Otherwise, return +** If an error occurs, return an SQLite error code. Otherwise, return ** SQLITE_OK. */ static int incrPhraseTokenNext( @@ -4518,18 +4518,18 @@ static int incrPhraseTokenNext( /* ** The phrase iterator passed as the second argument: ** -** * features at least one token that uses an incremental doclist, and +** * features at least one token that uses an incremental doclist, and ** ** * does not contain any deferred tokens. ** ** Advance it to the next matching documnent in the database and populate -** the Fts3Doclist.pList and nList fields. +** the Fts3Doclist.pList and nList fields. ** ** If there is no "next" entry and no error occurs, then *pbEof is set to ** 1 before returning. Otherwise, if no error occurs and the iterator is ** successfully advanced, *pbEof is set to 0. ** -** If an error occurs, return an SQLite error code. Otherwise, return +** If an error occurs, return an SQLite error code. Otherwise, return ** SQLITE_OK. */ static int fts3EvalIncrPhraseNext( @@ -4547,7 +4547,7 @@ static int fts3EvalIncrPhraseNext( assert( p->bIncr==1 ); if( p->nToken==1 && p->bIncr ){ - rc = sqlite3Fts3MsrIncrNext(pTab, p->aToken[0].pSegcsr, + rc = sqlite3Fts3MsrIncrNext(pTab, p->aToken[0].pSegcsr, &pDL->iDocid, &pDL->pList, &pDL->nList ); if( pDL->pList==0 ) bEof = 1; @@ -4577,8 +4577,8 @@ static int fts3EvalIncrPhraseNext( /* Keep advancing iterators until they all point to the same document */ for(i=0; inToken; i++){ - while( rc==SQLITE_OK && bEof==0 - && a[i].bIgnore==0 && DOCID_CMP(a[i].iDocid, iMax)<0 + while( rc==SQLITE_OK && bEof==0 + && a[i].bIgnore==0 && DOCID_CMP(a[i].iDocid, iMax)<0 ){ rc = incrPhraseTokenNext(pTab, p, i, &a[i], &bEof); if( DOCID_CMP(a[i].iDocid, iMax)>0 ){ @@ -4624,8 +4624,8 @@ static int fts3EvalIncrPhraseNext( } /* -** Attempt to move the phrase iterator to point to the next matching docid. -** If an error occurs, return an SQLite error code. Otherwise, return +** Attempt to move the phrase iterator to point to the next matching docid. +** If an error occurs, return an SQLite error code. Otherwise, return ** SQLITE_OK. ** ** If there is no "next" entry and no error occurs, then *pbEof is set to @@ -4644,7 +4644,7 @@ static int fts3EvalPhraseNext( if( p->bIncr ){ rc = fts3EvalIncrPhraseNext(pCsr, p, pbEof); }else if( pCsr->bDesc!=pTab->bDescIdx && pDL->nAll ){ - sqlite3Fts3DoclistPrev(pTab->bDescIdx, pDL->aAll, pDL->nAll, + sqlite3Fts3DoclistPrev(pTab->bDescIdx, pDL->aAll, pDL->nAll, &pDL->pNextDocid, &pDL->iDocid, &pDL->nList, pbEof ); pDL->pList = pDL->pNextDocid; @@ -4704,7 +4704,7 @@ static void fts3EvalStartReaders( ** Tokens are divided into AND/NEAR clusters. All tokens in a cluster belong ** to phrases that are connected only by AND and NEAR operators (not OR or ** NOT). When determining tokens to defer, each AND/NEAR cluster is considered -** separately. The root of a tokens AND/NEAR cluster is stored in +** separately. The root of a tokens AND/NEAR cluster is stored in ** Fts3TokenAndCost.pRoot. */ typedef struct Fts3TokenAndCost Fts3TokenAndCost; @@ -4772,7 +4772,7 @@ static void fts3EvalTokenCosts( ** write this value to *pnPage and return SQLITE_OK. Otherwise, return ** an SQLite error code. ** -** The average document size in pages is calculated by first calculating +** The average document size in pages is calculated by first calculating ** determining the average size in bytes, B. If B is less than the amount ** of data that will fit on a single leaf page of an intkey table in ** this database, then the average docsize is 1. Otherwise, it is 1 plus @@ -4781,10 +4781,10 @@ static void fts3EvalTokenCosts( static int fts3EvalAverageDocsize(Fts3Cursor *pCsr, int *pnPage){ if( pCsr->nRowAvg==0 ){ /* The average document size, which is required to calculate the cost - ** of each doclist, has not yet been determined. Read the required + ** of each doclist, has not yet been determined. Read the required ** data from the %_stat table to calculate it. ** - ** Entry 0 of the %_stat table is a blob containing (nCol+1) FTS3 + ** Entry 0 of the %_stat table is a blob containing (nCol+1) FTS3 ** varints, where nCol is the number of columns in the FTS3 table. ** The first varint is the number of documents currently stored in ** the table. The following nCol varints contain the total amount of @@ -4816,7 +4816,7 @@ static int fts3EvalAverageDocsize(Fts3Cursor *pCsr, int *pnPage){ pCsr->nDoc = nDoc; pCsr->nRowAvg = (int)(((nByte / nDoc) + p->nPgsz) / p->nPgsz); - assert( pCsr->nRowAvg>0 ); + assert( pCsr->nRowAvg>0 ); rc = sqlite3_reset(pStmt); if( rc!=SQLITE_OK ) return rc; } @@ -4826,11 +4826,11 @@ static int fts3EvalAverageDocsize(Fts3Cursor *pCsr, int *pnPage){ } /* -** This function is called to select the tokens (if any) that will be +** This function is called to select the tokens (if any) that will be ** deferred. The array aTC[] has already been populated when this is ** called. ** -** This function is called once for each AND/NEAR cluster in the +** This function is called once for each AND/NEAR cluster in the ** expression. Each invocation determines which tokens to defer within ** the cluster with root node pRoot. See comments above the definition ** of struct Fts3TokenAndCost for more details. @@ -4880,8 +4880,8 @@ static int fts3EvalSelectDeferred( assert( rc!=SQLITE_OK || nDocSize>0 ); - /* Iterate through all tokens in this AND/NEAR cluster, in ascending order - ** of the number of overflow pages that will be loaded by the pager layer + /* Iterate through all tokens in this AND/NEAR cluster, in ascending order + ** of the number of overflow pages that will be loaded by the pager layer ** to retrieve the entire doclist for the token from the full-text index. ** Load the doclists for tokens that are either: ** @@ -4892,7 +4892,7 @@ static int fts3EvalSelectDeferred( ** ** After each token doclist is loaded, merge it with the others from the ** same phrase and count the number of documents that the merged doclist - ** contains. Set variable "nMinEst" to the smallest number of documents in + ** contains. Set variable "nMinEst" to the smallest number of documents in ** any phrase doclist for which 1 or more token doclists have been loaded. ** Let nOther be the number of other phrases for which it is certain that ** one or more tokens will not be deferred. @@ -4908,8 +4908,8 @@ static int fts3EvalSelectDeferred( /* Set pTC to point to the cheapest remaining token. */ for(iTC=0; iTCnOvfl) + if( aTC[iTC].pToken && aTC[iTC].pRoot==pRoot + && (!pTC || aTC[iTC].nOvflnOvfl) ){ pTC = &aTC[iTC]; } @@ -4918,7 +4918,7 @@ static int fts3EvalSelectDeferred( if( ii && pTC->nOvfl>=((nMinEst+(nLoad4/4)-1)/(nLoad4/4))*nDocSize ){ /* The number of overflow pages to load for this (and therefore all - ** subsequent) tokens is greater than the estimated number of pages + ** subsequent) tokens is greater than the estimated number of pages ** that will be loaded if all subsequent tokens are deferred. */ Fts3PhraseToken *pToken = pTC->pToken; @@ -4927,7 +4927,7 @@ static int fts3EvalSelectDeferred( pToken->pSegcsr = 0; }else{ /* Set nLoad4 to the value of (4^nOther) for the next iteration of the - ** for-loop. Except, limit the value to 2^24 to prevent it from + ** for-loop. Except, limit the value to 2^24 to prevent it from ** overflowing the 32-bit integer it is stored in. */ if( ii<12 ) nLoad4 = nLoad4*4; @@ -5049,7 +5049,7 @@ static void fts3EvalInvalidatePoslist(Fts3Phrase *pPhrase){ ** close to a position in the *paPoslist position list are removed. If this ** leaves 0 positions, zero is returned. Otherwise, non-zero. ** -** Before returning, *paPoslist is set to point to the position lsit +** Before returning, *paPoslist is set to point to the position lsit ** associated with pPhrase. And *pnToken is set to the number of tokens in ** pPhrase. */ @@ -5063,8 +5063,8 @@ static int fts3EvalNearTrim( int nParam1 = nNear + pPhrase->nToken; int nParam2 = nNear + *pnToken; int nNew; - char *p2; - char *pOut; + char *p2; + char *pOut; int res; assert( pPhrase->doclist.pList ); @@ -5111,19 +5111,19 @@ static int fts3EvalNearTrim( ** ** 1. Deferred tokens are not taken into account. If a phrase consists ** entirely of deferred tokens, it is assumed to match every row in -** the db. In this case the position-list is not populated at all. +** the db. In this case the position-list is not populated at all. ** ** Or, if a phrase contains one or more deferred tokens and one or -** more non-deferred tokens, then the expression is advanced to the +** more non-deferred tokens, then the expression is advanced to the ** next possible match, considering only non-deferred tokens. In other ** words, if the phrase is "A B C", and "B" is deferred, the expression -** is advanced to the next row that contains an instance of "A * C", +** is advanced to the next row that contains an instance of "A * C", ** where "*" may match any single token. The position list in this case ** is populated as for "A * C" before returning. ** -** 2. NEAR is treated as AND. If the expression is "x NEAR y", it is +** 2. NEAR is treated as AND. If the expression is "x NEAR y", it is ** advanced to point to the next row that matches "x AND y". -** +** ** See sqlite3Fts3EvalTestDeferred() for details on testing if a row is ** really a match, taking into account deferred tokens and NEAR operators. */ @@ -5190,7 +5190,7 @@ static void fts3EvalNextRow( } break; } - + case FTSQUERY_OR: { Fts3Expr *pLeft = pExpr->pLeft; Fts3Expr *pRight = pExpr->pRight; @@ -5230,9 +5230,9 @@ static void fts3EvalNextRow( fts3EvalNextRow(pCsr, pLeft, pRc); if( pLeft->bEof==0 ){ - while( !*pRc - && !pRight->bEof - && DOCID_CMP(pLeft->iDocid, pRight->iDocid)>0 + while( !*pRc + && !pRight->bEof + && DOCID_CMP(pLeft->iDocid, pRight->iDocid)>0 ){ fts3EvalNextRow(pCsr, pRight, pRc); } @@ -5257,14 +5257,14 @@ static void fts3EvalNextRow( ** If *pRc is not SQLITE_OK, or if pExpr is not the root node of a NEAR ** cluster, then this function returns 1 immediately. ** -** Otherwise, it checks if the current row really does match the NEAR -** expression, using the data currently stored in the position lists -** (Fts3Expr->pPhrase.doclist.pList/nList) for each phrase in the expression. +** Otherwise, it checks if the current row really does match the NEAR +** expression, using the data currently stored in the position lists +** (Fts3Expr->pPhrase.doclist.pList/nList) for each phrase in the expression. ** ** If the current row is a match, the position list associated with each ** phrase in the NEAR expression is edited in place to contain only those ** phrase instances sufficiently close to their peers to satisfy all NEAR -** constraints. In this case it returns 1. If the NEAR expression does not +** constraints. In this case it returns 1. If the NEAR expression does not ** match the current row, 0 is returned. The position lists may or may not ** be edited if 0 is returned. */ @@ -5287,16 +5287,16 @@ static int fts3EvalNearTest(Fts3Expr *pExpr, int *pRc){ ** | | ** "w" "x" ** - ** The right-hand child of a NEAR node is always a phrase. The + ** The right-hand child of a NEAR node is always a phrase. The ** left-hand child may be either a phrase or a NEAR node. There are ** no exceptions to this - it's the way the parser in fts3_expr.c works. */ - if( *pRc==SQLITE_OK - && pExpr->eType==FTSQUERY_NEAR + if( *pRc==SQLITE_OK + && pExpr->eType==FTSQUERY_NEAR && pExpr->bEof==0 && (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR) ){ - Fts3Expr *p; + Fts3Expr *p; int nTmp = 0; /* Bytes of temp space */ char *aTmp; /* Temp space for PoslistNearMerge() */ @@ -5346,12 +5346,12 @@ static int fts3EvalNearTest(Fts3Expr *pExpr, int *pRc){ /* ** This function is a helper function for sqlite3Fts3EvalTestDeferred(). ** Assuming no error occurs or has occurred, It returns non-zero if the -** expression passed as the second argument matches the row that pCsr +** expression passed as the second argument matches the row that pCsr ** currently points to, or zero if it does not. ** ** If *pRc is not SQLITE_OK when this function is called, it is a no-op. -** If an error occurs during execution of this function, *pRc is set to -** the appropriate SQLite error code. In this case the returned value is +** If an error occurs during execution of this function, *pRc is set to +** the appropriate SQLite error code. In this case the returned value is ** undefined. */ static int fts3EvalTestExpr( @@ -5370,10 +5370,10 @@ static int fts3EvalTestExpr( && fts3EvalNearTest(pExpr, pRc) ); - /* If the NEAR expression does not match any rows, zero the doclist for + /* If the NEAR expression does not match any rows, zero the doclist for ** all phrases involved in the NEAR. This is because the snippet(), - ** offsets() and matchinfo() functions are not supposed to recognize - ** any instances of phrases that are part of unmatched NEAR queries. + ** offsets() and matchinfo() functions are not supposed to recognize + ** any instances of phrases that are part of unmatched NEAR queries. ** For example if this expression: ** ** ... MATCH 'a OR (b NEAR c)' @@ -5385,8 +5385,8 @@ static int fts3EvalTestExpr( ** then any snippet() should ony highlight the "a" term, not the "b" ** (as "b" is part of a non-matching NEAR clause). */ - if( bHit==0 - && pExpr->eType==FTSQUERY_NEAR + if( bHit==0 + && pExpr->eType==FTSQUERY_NEAR && (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR) ){ Fts3Expr *p; @@ -5418,7 +5418,7 @@ static int fts3EvalTestExpr( default: { #ifndef SQLITE_DISABLE_FTS4_DEFERRED - if( pCsr->pDeferred + if( pCsr->pDeferred && (pExpr->iDocid==pCsr->iPrevId || pExpr->bDeferred) ){ Fts3Phrase *pPhrase = pExpr->pPhrase; @@ -5474,7 +5474,7 @@ int sqlite3Fts3EvalTestDeferred(Fts3Cursor *pCsr, int *pRc){ ** memory and scan it to determine the position list for each deferred ** token. Then, see if this row is really a match, considering deferred ** tokens and NEAR operators (neither of which were taken into account - ** earlier, by fts3EvalNextRow()). + ** earlier, by fts3EvalNextRow()). */ if( pCsr->pDeferred ){ rc = fts3CursorSeek(0, pCsr); @@ -5529,7 +5529,7 @@ static int fts3EvalNext(Fts3Cursor *pCsr){ /* ** Restart interation for expression pExpr so that the next call to -** fts3EvalNext() visits the first row. Do not allow incremental +** fts3EvalNext() visits the first row. Do not allow incremental ** loading or merging of phrase doclists for this iteration. ** ** If *pRc is other than SQLITE_OK when this function is called, it is @@ -5572,11 +5572,11 @@ static void fts3EvalRestart( } /* -** After allocating the Fts3Expr.aMI[] array for each phrase in the +** After allocating the Fts3Expr.aMI[] array for each phrase in the ** expression rooted at pExpr, the cursor iterates through all rows matched ** by pExpr, calling this function for each row. This function increments ** the values in Fts3Expr.aMI[] according to the position-list currently -** found in Fts3Expr.pPhrase->doclist.pList for each of the phrase +** found in Fts3Expr.pPhrase->doclist.pList for each of the phrase ** expression nodes. */ static void fts3EvalUpdateCounts(Fts3Expr *pExpr){ @@ -5671,9 +5671,9 @@ static int fts3EvalGatherStats( pCsr->isRequireSeek = 1; pCsr->isMatchinfoNeeded = 1; pCsr->iPrevId = pRoot->iDocid; - }while( pCsr->isEof==0 - && pRoot->eType==FTSQUERY_NEAR - && sqlite3Fts3EvalTestDeferred(pCsr, &rc) + }while( pCsr->isEof==0 + && pRoot->eType==FTSQUERY_NEAR + && sqlite3Fts3EvalTestDeferred(pCsr, &rc) ); if( rc==SQLITE_OK && pCsr->isEof==0 ){ @@ -5688,7 +5688,7 @@ static int fts3EvalGatherStats( pRoot->bEof = bEof; }else{ /* Caution: pRoot may iterate through docids in ascending or descending - ** order. For this reason, even though it seems more defensive, the + ** order. For this reason, even though it seems more defensive, the ** do loop can not be written: ** ** do {...} while( pRoot->iDocid=0 && iColnColumn ); @@ -5812,8 +5812,8 @@ int sqlite3Fts3EvalPhrasePoslist( Fts3Expr *pNear; /* Most senior NEAR ancestor (or pExpr) */ int bMatch; - /* Check if this phrase descends from an OR expression node. If not, - ** return NULL. Otherwise, the entry that corresponds to docid + /* Check if this phrase descends from an OR expression node. If not, + ** return NULL. Otherwise, the entry that corresponds to docid ** pCsr->iPrevId may lie earlier in the doclist buffer. Or, if the ** tree that the node is part of has been marked as EOF, but the node ** itself is not EOF, then it may point to an earlier entry. */ @@ -5861,7 +5861,7 @@ int sqlite3Fts3EvalPhrasePoslist( (pIter >= (pPh->doclist.aAll + pPh->doclist.nAll)); while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)<0 ) && bEof==0 ){ sqlite3Fts3DoclistNext( - bDescDoclist, pPh->doclist.aAll, pPh->doclist.nAll, + bDescDoclist, pPh->doclist.aAll, pPh->doclist.nAll, &pIter, &iDocid, &bEof ); } @@ -5870,7 +5870,7 @@ int sqlite3Fts3EvalPhrasePoslist( while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)>0 ) && bEof==0 ){ int dummy; sqlite3Fts3DoclistPrev( - bDescDoclist, pPh->doclist.aAll, pPh->doclist.nAll, + bDescDoclist, pPh->doclist.aAll, pPh->doclist.nAll, &pIter, &iDocid, &dummy, &bEof ); } @@ -5946,7 +5946,7 @@ int sqlite3Fts3Corrupt(){ __declspec(dllexport) #endif int sqlite3_fts3_init( - sqlite3 *db, + sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ diff --git a/third_party/sqlite/src/ext/fts3/fts3Int.h b/third_party/sqlite/src/ext/fts3/fts3Int.h index c3cab9d821a43..ba383f2555a22 100644 --- a/third_party/sqlite/src/ext/fts3/fts3Int.h +++ b/third_party/sqlite/src/ext/fts3/fts3Int.h @@ -14,7 +14,7 @@ #ifndef _FTSINT_H #define _FTSINT_H -#if !defined(NDEBUG) && !defined(SQLITE_DEBUG) +#if !defined(NDEBUG) && !defined(SQLITE_DEBUG) # define NDEBUG 1 #endif @@ -37,7 +37,7 @@ /* If not building as part of the core, include sqlite3ext.h. */ #ifndef SQLITE_CORE -# include "sqlite3ext.h" +# include "sqlite3ext.h" SQLITE_EXTENSION_INIT3 #endif @@ -47,7 +47,7 @@ SQLITE_EXTENSION_INIT3 /* ** This constant determines the maximum depth of an FTS expression tree -** that the library will create and use. FTS uses recursion to perform +** that the library will create and use. FTS uses recursion to perform ** various operations on the query tree, so the disadvantage of a large ** limit is that it may allow very large queries to use large amounts ** of stack space (perhaps causing a stack overflow). @@ -65,11 +65,11 @@ SQLITE_EXTENSION_INIT3 #define FTS3_MERGE_COUNT 16 /* -** This is the maximum amount of data (in bytes) to store in the +** This is the maximum amount of data (in bytes) to store in the ** Fts3Table.pendingTerms hash table. Normally, the hash table is ** populated as documents are inserted/updated/deleted in a transaction ** and used to create a new segment when the transaction is committed. -** However if this limit is reached midway through a transaction, a new +** However if this limit is reached midway through a transaction, a new ** segment is created and the hash table cleared immediately. */ #define FTS3_MAX_PENDING_DATA (1*1024*1024) @@ -98,7 +98,7 @@ SQLITE_EXTENSION_INIT3 /* ** FTS4 virtual tables may maintain multiple indexes - one index of all terms ** in the document set and zero or more prefix indexes. All indexes are stored -** as one or more b+-trees in the %_segments and %_segdir tables. +** as one or more b+-trees in the %_segments and %_segdir tables. ** ** It is possible to determine which index a b+-tree belongs to based on the ** value stored in the "%_segdir.level" column. Given this value L, the index @@ -106,8 +106,8 @@ SQLITE_EXTENSION_INIT3 ** level values between 0 and 1023 (inclusive) belong to index 0, all levels ** between 1024 and 2047 to index 1, and so on. ** -** It is considered impossible for an index to use more than 1024 levels. In -** theory though this may happen, but only after at least +** It is considered impossible for an index to use more than 1024 levels. In +** theory though this may happen, but only after at least ** (FTS3_MERGE_COUNT^1024) separate flushes of the pending-terms tables. */ #define FTS3_SEGDIR_MAXLEVEL 1024 @@ -125,11 +125,11 @@ SQLITE_EXTENSION_INIT3 ** Terminator values for position-lists and column-lists. */ #define POS_COLUMN (1) /* Column-list terminator */ -#define POS_END (0) /* Position-list terminator */ +#define POS_END (0) /* Position-list terminator */ /* ** This section provides definitions to allow the -** FTS3 extension to be compiled outside of the +** FTS3 extension to be compiled outside of the ** amalgamation. */ #ifndef SQLITE_AMALGAMATION @@ -167,7 +167,7 @@ typedef sqlite3_int64 i64; /* 8-byte signed integer */ /* ** Activate assert() only if SQLITE_TEST is enabled. */ -#if !defined(NDEBUG) && !defined(SQLITE_DEBUG) +#if !defined(NDEBUG) && !defined(SQLITE_DEBUG) # define NDEBUG 1 #endif @@ -226,8 +226,8 @@ struct Fts3Table { int nAutoincrmerge; /* Value configured by 'automerge' */ u32 nLeafAdd; /* Number of leaf blocks added this trans */ - /* Precompiled statements used by the implementation. Each of these - ** statements is run and reset within a single virtual table API call. + /* Precompiled statements used by the implementation. Each of these + ** statements is run and reset within a single virtual table API call. */ sqlite3_stmt *aStmt[40]; sqlite3_stmt *pSeekStmt; /* Cache for fts3CursorSeekStmt() */ @@ -245,8 +245,8 @@ struct Fts3Table { char *zSegmentsTbl; /* Name of %_segments table */ sqlite3_blob *pSegments; /* Blob handle open on %_segments table */ - /* - ** The following array of hash tables is used to buffer pending index + /* + ** The following array of hash tables is used to buffer pending index ** updates during transactions. All pending updates buffered at any one ** time must share a common language-id (see the FTS4 langid= feature). ** The current language id is stored in variable iPrevLangid. @@ -256,10 +256,10 @@ struct Fts3Table { ** terms that appear in the document set. Each subsequent index in aIndex[] ** is an index of prefixes of a specific length. ** - ** Variable nPendingData contains an estimate the memory consumed by the + ** Variable nPendingData contains an estimate the memory consumed by the ** pending data structures, including hash table overhead, but not including ** malloc overhead. When nPendingData exceeds nMaxPendingData, all hash - ** tables are flushed to disk. Variable iPrevDocid is the docid of the most + ** tables are flushed to disk. Variable iPrevDocid is the docid of the most ** recently inserted record. */ int nIndex; /* Size of aIndex[] */ @@ -332,10 +332,10 @@ struct Fts3Cursor { ** ** CREATE VIRTUAL TABLE ex1 USING fts3(a,b,c,d); ** SELECT docid FROM ex1 WHERE b MATCH 'one two three'; -** +** ** Because the LHS of the MATCH operator is 2nd column "b", ** Fts3Cursor.eSearch will be set to FTS3_FULLTEXT_SEARCH+1. (+0 for a, -** +1 for b, +2 for c, +3 for d.) If the LHS of MATCH were "ex1" +** +1 for b, +2 for c, +3 for d.) If the LHS of MATCH were "ex1" ** indicating that all columns should be searched, ** then eSearch would be set to FTS3_FULLTEXT_SEARCH+4. */ @@ -394,8 +394,8 @@ struct Fts3Phrase { char *pOrPoslist; i64 iOrDocid; - /* Variables below this point are populated by fts3_expr.c when parsing - ** a MATCH expression. Everything above is part of the evaluation phase. + /* Variables below this point are populated by fts3_expr.c when parsing + ** a MATCH expression. Everything above is part of the evaluation phase. */ int nToken; /* Number of tokens in the phrase */ int iColumn; /* Index of column this phrase must match */ @@ -405,10 +405,10 @@ struct Fts3Phrase { /* ** A tree of these objects forms the RHS of a MATCH operator. ** -** If Fts3Expr.eType is FTSQUERY_PHRASE and isLoaded is true, then aDoclist -** points to a malloced buffer, size nDoclist bytes, containing the results -** of this phrase query in FTS3 doclist format. As usual, the initial -** "Length" field found in doclists stored on disk is omitted from this +** If Fts3Expr.eType is FTSQUERY_PHRASE and isLoaded is true, then aDoclist +** points to a malloced buffer, size nDoclist bytes, containing the results +** of this phrase query in FTS3 doclist format. As usual, the initial +** "Length" field found in doclists stored on disk is omitted from this ** buffer. ** ** Variable aMI is used only for FTSQUERY_NEAR nodes to store the global @@ -420,7 +420,7 @@ struct Fts3Phrase { ** aMI[iCol*3 + 1] = Number of occurrences ** aMI[iCol*3 + 2] = Number of rows containing at least one instance ** -** The aMI array is allocated using sqlite3_malloc(). It should be freed +** The aMI array is allocated using sqlite3_malloc(). It should be freed ** when the expression node is. */ struct Fts3Expr { @@ -444,7 +444,7 @@ struct Fts3Expr { /* ** Candidate values for Fts3Query.eType. Note that the order of the first -** four values is in order of precedence when parsing expressions. For +** four values is in order of precedence when parsing expressions. For ** example, the following: ** ** "a OR b AND c NOT d NEAR e" @@ -501,7 +501,7 @@ int sqlite3Fts3SegReaderStart(Fts3Table*, Fts3MultiSegReader*, Fts3SegFilter*); int sqlite3Fts3SegReaderStep(Fts3Table *, Fts3MultiSegReader *); void sqlite3Fts3SegReaderFinish(Fts3MultiSegReader *); -int sqlite3Fts3SegReaderCursor(Fts3Table *, +int sqlite3Fts3SegReaderCursor(Fts3Table *, int, int, int, const char *, int, int, int, Fts3MultiSegReader *); /* Flags allowed as part of the 4th argument to SegmentReaderIterate() */ @@ -565,7 +565,7 @@ int sqlite3Fts3EvalTestDeferred(Fts3Cursor *pCsr, int *pRc); /* fts3_tokenizer.c */ const char *sqlite3Fts3NextToken(const char *, int *); int sqlite3Fts3InitHashTable(sqlite3 *, Fts3Hash *, const char *); -int sqlite3Fts3InitTokenizer(Fts3Hash *pHash, const char *, +int sqlite3Fts3InitTokenizer(Fts3Hash *pHash, const char *, sqlite3_tokenizer **, char ** ); int sqlite3Fts3IsIdChar(char); @@ -601,7 +601,7 @@ int sqlite3Fts3MsrIncrStart( Fts3Table*, Fts3MultiSegReader*, int, const char*, int); int sqlite3Fts3MsrIncrNext( Fts3Table *, Fts3MultiSegReader *, sqlite3_int64 *, char **, int *); -int sqlite3Fts3EvalPhrasePoslist(Fts3Cursor *, Fts3Expr *, int iCol, char **); +int sqlite3Fts3EvalPhrasePoslist(Fts3Cursor *, Fts3Expr *, int iCol, char **); int sqlite3Fts3MsrOvfl(Fts3Cursor *, Fts3MultiSegReader *, int *); int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr); diff --git a/third_party/sqlite/src/ext/fts3/fts3_aux.c b/third_party/sqlite/src/ext/fts3/fts3_aux.c index f85a48ae0204a..258d3da698cde 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_aux.c +++ b/third_party/sqlite/src/ext/fts3/fts3_aux.c @@ -79,11 +79,11 @@ static int fts3auxConnectMethod( */ if( argc!=4 && argc!=5 ) goto bad_args; - zDb = argv[1]; + zDb = argv[1]; nDb = (int)strlen(zDb); if( argc==5 ){ if( nDb==4 && 0==sqlite3_strnicmp("temp", zDb, 4) ){ - zDb = argv[3]; + zDb = argv[3]; nDb = (int)strlen(zDb); zFts3 = argv[4]; }else{ @@ -147,7 +147,7 @@ static int fts3auxDisconnectMethod(sqlite3_vtab *pVtab){ ** xBestIndex - Analyze a WHERE and ORDER BY clause. */ static int fts3auxBestIndexMethod( - sqlite3_vtab *pVTab, + sqlite3_vtab *pVTab, sqlite3_index_info *pInfo ){ int i; @@ -160,14 +160,14 @@ static int fts3auxBestIndexMethod( UNUSED_PARAMETER(pVTab); /* This vtab delivers always results in "ORDER BY term ASC" order. */ - if( pInfo->nOrderBy==1 - && pInfo->aOrderBy[0].iColumn==0 + if( pInfo->nOrderBy==1 + && pInfo->aOrderBy[0].iColumn==0 && pInfo->aOrderBy[0].desc==0 ){ pInfo->orderByConsumed = 1; } - /* Search for equality and range constraints on the "term" column. + /* Search for equality and range constraints on the "term" column. ** And equality constraints on the hidden "languageid" column. */ for(i=0; inConstraint; i++){ if( pInfo->aConstraint[i].usable ){ @@ -248,11 +248,11 @@ static int fts3auxCloseMethod(sqlite3_vtab_cursor *pCursor){ static int fts3auxGrowStatArray(Fts3auxCursor *pCsr, int nSize){ if( nSize>pCsr->nStat ){ struct Fts3auxColstats *aNew; - aNew = (struct Fts3auxColstats *)sqlite3_realloc(pCsr->aStat, + aNew = (struct Fts3auxColstats *)sqlite3_realloc(pCsr->aStat, sizeof(struct Fts3auxColstats) * nSize ); if( aNew==0 ) return SQLITE_NOMEM; - memset(&aNew[pCsr->nStat], 0, + memset(&aNew[pCsr->nStat], 0, sizeof(struct Fts3auxColstats) * (nSize - pCsr->nStat) ); pCsr->aStat = aNew; @@ -312,8 +312,8 @@ static int fts3auxNextMethod(sqlite3_vtab_cursor *pCursor){ /* State 1. In this state we are expecting either a 1, indicating ** that the following integer will be a column number, or the - ** start of a position list for column 0. - ** + ** start of a position list for column 0. + ** ** The only difference between state 1 and state 2 is that if the ** integer encountered in state 1 is not 0 or 1, then we need to ** increment the column 0 "nDoc" count for this term. @@ -426,7 +426,7 @@ static int fts3auxFilterMethod( pCsr->nStop = sqlite3_value_bytes(apVal[iLe]); if( pCsr->zStop==0 ) return SQLITE_NOMEM; } - + if( iLangid>=0 ){ iLangVal = sqlite3_value_int(apVal[iLangid]); diff --git a/third_party/sqlite/src/ext/fts3/fts3_expr.c b/third_party/sqlite/src/ext/fts3/fts3_expr.c index 788e5021ec206..e8f0617abdaf8 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_expr.c +++ b/third_party/sqlite/src/ext/fts3/fts3_expr.c @@ -11,15 +11,15 @@ ****************************************************************************** ** ** This module contains code that implements a parser for fts3 query strings -** (the right-hand argument to the MATCH operator). Because the supported +** (the right-hand argument to the MATCH operator). Because the supported ** syntax is relatively simple, the whole tokenizer/parser system is -** hand-coded. +** hand-coded. */ #include "fts3Int.h" #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) /* -** By default, this module parses the legacy syntax that has been +** By default, this module parses the legacy syntax that has been ** traditionally used by fts3. Or, if SQLITE_ENABLE_FTS3_PARENTHESIS ** is defined, then it uses the new syntax. The differences between ** the new and the old syntaxes are: @@ -28,7 +28,7 @@ ** ** b) The new syntax supports the AND and NOT operators. The old does not. ** -** c) The old syntax supports the "-" token qualifier. This is not +** c) The old syntax supports the "-" token qualifier. This is not ** supported by the new syntax (it is replaced by the NOT operator). ** ** d) When using the old syntax, the OR operator has a greater precedence @@ -37,7 +37,7 @@ ** ** If compiled with SQLITE_TEST defined, then this module exports the ** symbol "int sqlite3_fts3_enable_parentheses". Setting this variable -** to zero causes the module to use the old syntax. If it is set to +** to zero causes the module to use the old syntax. If it is set to ** non-zero the new syntax is activated. This is so both syntaxes can ** be tested using a single build of testfixture. ** @@ -66,7 +66,7 @@ #ifdef SQLITE_TEST int sqlite3_fts3_enable_parentheses = 0; #else -# ifdef SQLITE_ENABLE_FTS3_PARENTHESIS +# ifdef SQLITE_ENABLE_FTS3_PARENTHESIS # define sqlite3_fts3_enable_parentheses 1 # else # define sqlite3_fts3_enable_parentheses 0 @@ -84,7 +84,7 @@ int sqlite3_fts3_enable_parentheses = 0; /* ** isNot: ** This variable is used by function getNextNode(). When getNextNode() is -** called, it sets ParseContext.isNot to true if the 'next node' is a +** called, it sets ParseContext.isNot to true if the 'next node' is a ** FTSQUERY_PHRASE with a unary "-" attached to it. i.e. "mysql" in the ** FTS3 query "sqlite -mysql". Otherwise, ParseContext.isNot is set to ** zero. @@ -103,7 +103,7 @@ struct ParseContext { }; /* -** This function is equivalent to the standard isspace() function. +** This function is equivalent to the standard isspace() function. ** ** The standard isspace() can be awkward to use safely, because although it ** is defined to accept an argument of type int, its behavior when passed @@ -119,7 +119,7 @@ static int fts3isspace(char c){ /* ** Allocate nByte bytes of memory using sqlite3_malloc(). If successful, -** zero the memory before returning a pointer to it. If unsuccessful, +** zero the memory before returning a pointer to it. If unsuccessful, ** return NULL. */ static void *fts3MallocZero(int nByte){ @@ -167,7 +167,7 @@ static int fts3ExprParse(ParseContext *, const char *, int, Fts3Expr **, int *); ** structure of type FTSQUERY_PHRASE containing a phrase consisting of this ** single token and set *ppExpr to point to it. If the end of the buffer is ** reached before a token is found, set *ppExpr to zero. It is the -** responsibility of the caller to eventually deallocate the allocated +** responsibility of the caller to eventually deallocate the allocated ** Fts3Expr structure (if any) by passing it to sqlite3_free(). ** ** Return SQLITE_OK if successful, or SQLITE_NOMEM if a memory allocation @@ -221,8 +221,8 @@ static int getNextToken( } while( 1 ){ - if( !sqlite3_fts3_enable_parentheses - && iStart>0 && z[iStart-1]=='-' + if( !sqlite3_fts3_enable_parentheses + && iStart>0 && z[iStart-1]=='-' ){ pParse->isNot = 1; iStart--; @@ -242,7 +242,7 @@ static int getNextToken( pModule->xClose(pCursor); } - + *ppExpr = pRet; return rc; } @@ -264,7 +264,7 @@ static void *fts3ReallocOrFree(void *pOrig, int nNew){ ** Buffer zInput, length nInput, contains the contents of a quoted string ** that appeared as part of an fts3 query expression. Neither quote character ** is included in the buffer. This function attempts to tokenize the entire -** input buffer and create an Fts3Expr structure of type FTSQUERY_PHRASE +** input buffer and create an Fts3Expr structure of type FTSQUERY_PHRASE ** containing the results. ** ** If successful, SQLITE_OK is returned and *ppExpr set to point at the @@ -289,7 +289,7 @@ static int getNextString( int nToken = 0; /* The final Fts3Expr data structure, including the Fts3Phrase, - ** Fts3PhraseToken structures token buffers are all stored as a single + ** Fts3PhraseToken structures token buffers are all stored as a single ** allocation so that the expression can be freed with a single call to ** sqlite3_free(). Setting this up requires a two pass approach. ** @@ -298,7 +298,7 @@ static int getNextString( ** to assemble data in two dynamic buffers: ** ** Buffer p: Points to the Fts3Expr structure, followed by the Fts3Phrase - ** structure, followed by the array of Fts3PhraseToken + ** structure, followed by the array of Fts3PhraseToken ** structures. This pass only populates the Fts3PhraseToken array. ** ** Buffer zTemp: Contains copies of all tokens. @@ -383,7 +383,7 @@ no_mem: } /* -** The output variable *ppExpr is populated with an allocated Fts3Expr +** The output variable *ppExpr is populated with an allocated Fts3Expr ** structure, or set to 0 if the end of the input buffer is reached. ** ** Returns an SQLite error code. SQLITE_OK if everything works, SQLITE_NOMEM @@ -419,7 +419,7 @@ static int getNextNode( pParse->isNot = 0; /* Skip over any whitespace before checking for a keyword, an open or - ** close bracket, or a quoted string. + ** close bracket, or a quoted string. */ while( nInput>0 && fts3isspace(*zInput) ){ nInput--; @@ -455,10 +455,10 @@ static int getNextNode( /* At this point this is probably a keyword. But for that to be true, ** the next byte must contain either whitespace, an open or close - ** parenthesis, a quote character, or EOF. + ** parenthesis, a quote character, or EOF. */ cNext = zInput[nKey]; - if( fts3isspace(cNext) + if( fts3isspace(cNext) || cNext=='"' || cNext=='(' || cNext==')' || cNext==0 ){ pRet = (Fts3Expr *)fts3MallocZero(sizeof(Fts3Expr)); @@ -508,15 +508,15 @@ static int getNextNode( } } - /* If control flows to this point, this must be a regular token, or + /* If control flows to this point, this must be a regular token, or ** the end of the input. Read a regular token using the sqlite3_tokenizer ** interface. Before doing so, figure out if there is an explicit - ** column specifier for the token. + ** column specifier for the token. ** ** TODO: Strangely, it is not possible to associate a column specifier ** with a quoted phrase, only with a single token. Not sure if this was ** an implementation artifact or an intentional decision when fts3 was - ** first implemented. Whichever it was, this module duplicates the + ** first implemented. Whichever it was, this module duplicates the ** limitation. */ iCol = pParse->iDefaultCol; @@ -524,8 +524,8 @@ static int getNextNode( for(ii=0; iinCol; ii++){ const char *zStr = pParse->azCol[ii]; int nStr = (int)strlen(zStr); - if( nInput>nStr && zInput[nStr]==':' - && sqlite3_strnicmp(zStr, zInput, nStr)==0 + if( nInput>nStr && zInput[nStr]==':' + && sqlite3_strnicmp(zStr, zInput, nStr)==0 ){ iCol = ii; iColLen = (int)((zInput - z) + nStr + 1); @@ -570,7 +570,7 @@ static int opPrecedence(Fts3Expr *p){ } /* -** Argument ppHead contains a pointer to the current head of a query +** Argument ppHead contains a pointer to the current head of a query ** expression tree being parsed. pPrev is the expression node most recently ** inserted into the tree. This function adds pNew, which is always a binary ** operator node, into the expression tree based on the relative precedence @@ -600,7 +600,7 @@ static void insertBinaryOperator( /* ** Parse the fts3 query expression found in buffer z, length n. This function -** returns either when the end of the buffer is reached or an unmatched +** returns either when the end of the buffer is reached or an unmatched ** closing bracket - ')' - is encountered. ** ** If successful, SQLITE_OK is returned, *ppExpr is set to point to the @@ -632,8 +632,8 @@ static int fts3ExprParse( if( p ){ int isPhrase; - if( !sqlite3_fts3_enable_parentheses - && p->eType==FTSQUERY_PHRASE && pParse->isNot + if( !sqlite3_fts3_enable_parentheses + && p->eType==FTSQUERY_PHRASE && pParse->isNot ){ /* Create an implicit NOT operator. */ Fts3Expr *pNot = fts3MallocZero(sizeof(Fts3Expr)); @@ -754,13 +754,13 @@ exprparse_out: } /* -** Return SQLITE_ERROR if the maximum depth of the expression tree passed +** Return SQLITE_ERROR if the maximum depth of the expression tree passed ** as the only argument is more than nMaxDepth. */ static int fts3ExprCheckDepth(Fts3Expr *p, int nMaxDepth){ int rc = SQLITE_OK; if( p ){ - if( nMaxDepth<0 ){ + if( nMaxDepth<0 ){ rc = SQLITE_TOOBIG; }else{ rc = fts3ExprCheckDepth(p->pLeft, nMaxDepth-1); @@ -775,12 +775,12 @@ static int fts3ExprCheckDepth(Fts3Expr *p, int nMaxDepth){ /* ** This function attempts to transform the expression tree at (*pp) to ** an equivalent but more balanced form. The tree is modified in place. -** If successful, SQLITE_OK is returned and (*pp) set to point to the -** new root expression node. +** If successful, SQLITE_OK is returned and (*pp) set to point to the +** new root expression node. ** ** nMaxDepth is the maximum allowable depth of the balanced sub-tree. ** -** Otherwise, if an error occurs, an SQLite error code is returned and +** Otherwise, if an error occurs, an SQLite error code is returned and ** expression (*pp) freed. */ static int fts3ExprBalance(Fts3Expr **pp, int nMaxDepth){ @@ -895,7 +895,7 @@ static int fts3ExprBalance(Fts3Expr **pp, int nMaxDepth){ } pRoot = p; }else{ - /* An error occurred. Delete the contents of the apLeaf[] array + /* An error occurred. Delete the contents of the apLeaf[] array ** and pFree list. Everything else is cleaned up by the call to ** sqlite3Fts3ExprFree(pRoot) below. */ Fts3Expr *pDel; @@ -937,7 +937,7 @@ static int fts3ExprBalance(Fts3Expr **pp, int nMaxDepth){ } } } - + if( rc!=SQLITE_OK ){ sqlite3Fts3ExprFree(pRoot); pRoot = 0; @@ -951,9 +951,9 @@ static int fts3ExprBalance(Fts3Expr **pp, int nMaxDepth){ ** differences: ** ** 1. It does not do expression rebalancing. -** 2. It does not check that the expression does not exceed the +** 2. It does not check that the expression does not exceed the ** maximum allowable depth. -** 3. Even if it fails, *ppExpr may still be set to point to an +** 3. Even if it fails, *ppExpr may still be set to point to an ** expression tree. It should be deleted using sqlite3Fts3ExprFree() ** in this case. */ @@ -992,7 +992,7 @@ static int fts3ExprParseUnbalanced( if( rc==SQLITE_OK && sParse.nNest ){ rc = SQLITE_ERROR; } - + return rc; } @@ -1011,7 +1011,7 @@ static int fts3ExprParseUnbalanced( ** The first parameter, pTokenizer, is passed the fts3 tokenizer module to ** use to normalize query tokens while parsing the expression. The azCol[] ** array, which is assumed to contain nCol entries, should contain the names -** of each column in the target fts3 table, in order from left to right. +** of each column in the target fts3 table, in order from left to right. ** Column names must be nul-terminated strings. ** ** The iDefaultCol parameter should be passed the index of the table column @@ -1034,7 +1034,7 @@ int sqlite3Fts3ExprParse( int rc = fts3ExprParseUnbalanced( pTokenizer, iLangid, azCol, bFts4, nCol, iDefaultCol, z, n, ppExpr ); - + /* Rebalance the expression. And check that its depth does not exceed ** SQLITE_FTS3_MAX_EXPR_DEPTH. */ if( rc==SQLITE_OK && *ppExpr ){ @@ -1049,7 +1049,7 @@ int sqlite3Fts3ExprParse( *ppExpr = 0; if( rc==SQLITE_TOOBIG ){ sqlite3Fts3ErrMsg(pzErr, - "FTS expression tree is too large (maximum depth %d)", + "FTS expression tree is too large (maximum depth %d)", SQLITE_FTS3_MAX_EXPR_DEPTH ); rc = SQLITE_ERROR; @@ -1112,8 +1112,8 @@ void sqlite3Fts3ExprFree(Fts3Expr *pDel){ ** Function to query the hash-table of tokenizers (see README.tokenizers). */ static int queryTestTokenizer( - sqlite3 *db, - const char *zName, + sqlite3 *db, + const char *zName, const sqlite3_tokenizer_module **pp ){ int rc; @@ -1139,11 +1139,11 @@ static int queryTestTokenizer( /* ** Return a pointer to a buffer containing a text representation of the ** expression passed as the first argument. The buffer is obtained from -** sqlite3_malloc(). It is the responsibility of the caller to use +** sqlite3_malloc(). It is the responsibility of the caller to use ** sqlite3_free() to release the memory. If an OOM condition is encountered, ** NULL is returned. ** -** If the second argument is not NULL, then its contents are prepended to +** If the second argument is not NULL, then its contents are prepended to ** the returned expression text and then freed using sqlite3_free(). */ static char *exprToString(Fts3Expr *pExpr, char *zBuf){ @@ -1157,7 +1157,7 @@ static char *exprToString(Fts3Expr *pExpr, char *zBuf){ zBuf = sqlite3_mprintf( "%zPHRASE %d 0", zBuf, pPhrase->iColumn); for(i=0; zBuf && inToken; i++){ - zBuf = sqlite3_mprintf("%z %.*s%s", zBuf, + zBuf = sqlite3_mprintf("%z %.*s%s", zBuf, pPhrase->aToken[i].n, pPhrase->aToken[i].z, (pPhrase->aToken[i].isPrefix?"+":"") ); @@ -1190,7 +1190,7 @@ static char *exprToString(Fts3Expr *pExpr, char *zBuf){ } /* -** This is the implementation of a scalar SQL function used to test the +** This is the implementation of a scalar SQL function used to test the ** expression parser. It should be called as follows: ** ** fts3_exprtest(, , , ...); @@ -1221,7 +1221,7 @@ static void fts3ExprTest( sqlite3 *db = sqlite3_context_db_handle(context); if( argc<3 ){ - sqlite3_result_error(context, + sqlite3_result_error(context, "Usage: fts3_exprtest(tokenizer, expr, col1, ...", -1 ); return; @@ -1290,15 +1290,15 @@ exprtest_out: } /* -** Register the query expression parser test function fts3_exprtest() -** with database connection db. +** Register the query expression parser test function fts3_exprtest() +** with database connection db. */ int sqlite3Fts3ExprInitTestInterface(sqlite3* db){ int rc = sqlite3_create_function( db, "fts3_exprtest", -1, SQLITE_UTF8, 0, fts3ExprTest, 0, 0 ); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "fts3_exprtest_rebalance", + rc = sqlite3_create_function(db, "fts3_exprtest_rebalance", -1, SQLITE_UTF8, (void *)1, fts3ExprTest, 0, 0 ); } diff --git a/third_party/sqlite/src/ext/fts3/fts3_hash.c b/third_party/sqlite/src/ext/fts3/fts3_hash.c index 1a32a537b4069..0a192220b77dc 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_hash.c +++ b/third_party/sqlite/src/ext/fts3/fts3_hash.c @@ -50,8 +50,8 @@ static void fts3HashFree(void *p){ ** fields of the Hash structure. ** ** "pNew" is a pointer to the hash table that is to be initialized. -** keyClass is one of the constants -** FTS3_HASH_BINARY or FTS3_HASH_STRING. The value of keyClass +** keyClass is one of the constants +** FTS3_HASH_BINARY or FTS3_HASH_STRING. The value of keyClass ** determines what kind of key the hash table will use. "copyKey" is ** true if the hash table should make its own private copy of keys and ** false if it should just use the supplied pointer. @@ -128,7 +128,7 @@ static int fts3BinCompare(const void *pKey1, int n1, const void *pKey2, int n2){ /* ** Return a pointer to the appropriate hash function given the key class. ** -** The C syntax in this function definition may be unfamilar to some +** The C syntax in this function definition may be unfamilar to some ** programmers, so we provide the following additional explanation: ** ** The name of the function is "ftsHashFunction". The function takes a @@ -188,7 +188,7 @@ static void fts3HashInsertElement( /* Resize the hash table so that it cantains "new_size" buckets. -** "new_size" must be a power of 2. The hash table might fail +** "new_size" must be a power of 2. The hash table might fail ** to resize if sqliteMalloc() fails. ** ** Return non-zero if a memory allocation error occurs. @@ -233,7 +233,7 @@ static Fts3HashElem *fts3FindElementByHash( count = pEntry->count; xCompare = ftsCompareFunction(pH->keyClass); while( count-- && elem ){ - if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ + if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ return elem; } elem = elem->next; @@ -252,7 +252,7 @@ static void fts3RemoveElementByHash( ){ struct _fts3ht *pEntry; if( elem->prev ){ - elem->prev->next = elem->next; + elem->prev->next = elem->next; }else{ pH->first = elem->next; } @@ -280,8 +280,8 @@ static void fts3RemoveElementByHash( } Fts3HashElem *sqlite3Fts3HashFindElem( - const Fts3Hash *pH, - const void *pKey, + const Fts3Hash *pH, + const void *pKey, int nKey ){ int h; /* A hash on key */ @@ -295,7 +295,7 @@ Fts3HashElem *sqlite3Fts3HashFindElem( return fts3FindElementByHash(pH,pKey,nKey, h & (pH->htsize-1)); } -/* +/* ** Attempt to locate an element of the hash table pH with a key ** that matches pKey,nKey. Return the data for this element if it is ** found, or NULL if there is no match. diff --git a/third_party/sqlite/src/ext/fts3/fts3_hash.h b/third_party/sqlite/src/ext/fts3/fts3_hash.h index dc3fcf8334fb2..00ff45449c51b 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_hash.h +++ b/third_party/sqlite/src/ext/fts3/fts3_hash.h @@ -41,7 +41,7 @@ struct Fts3Hash { } *ht; }; -/* Each element in the hash table is an instance of the following +/* Each element in the hash table is an instance of the following ** structure. All elements are stored on a single doubly-linked list. ** ** Again, this structure is intended to be opaque, but it can't really @@ -60,10 +60,10 @@ struct Fts3HashElem { ** (including the null-terminator, if any). Case ** is respected in comparisons. ** -** FTS3_HASH_BINARY pKey points to binary data nKey bytes long. +** FTS3_HASH_BINARY pKey points to binary data nKey bytes long. ** memcmp() is used to compare keys. ** -** A copy of the key is made if the copyKey parameter to fts3HashInit is 1. +** A copy of the key is made if the copyKey parameter to fts3HashInit is 1. */ #define FTS3_HASH_STRING 1 #define FTS3_HASH_BINARY 2 diff --git a/third_party/sqlite/src/ext/fts3/fts3_icu.c b/third_party/sqlite/src/ext/fts3/fts3_icu.c index 6f90e1ebad053..211803d768770 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_icu.c +++ b/third_party/sqlite/src/ext/fts3/fts3_icu.c @@ -88,7 +88,7 @@ static int icuDestroy(sqlite3_tokenizer *pTokenizer){ /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is pInput[0..nBytes-1]. A cursor -** used to incrementally tokenize this string is returned in +** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int icuOpen( @@ -130,7 +130,7 @@ static int icuOpen( pCsr->aOffset = (int *)&pCsr->aChar[(nChar+3)&~3]; pCsr->aOffset[iOut] = iInput; - U8_NEXT(zInput, iInput, nInput, c); + U8_NEXT(zInput, iInput, nInput, c); while( c>0 ){ int isError = 0; c = u_foldCase(c, opt); diff --git a/third_party/sqlite/src/ext/fts3/fts3_porter.c b/third_party/sqlite/src/ext/fts3/fts3_porter.c index 8fb4c25daa0a9..2ac4e6991157b 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_porter.c +++ b/third_party/sqlite/src/ext/fts3/fts3_porter.c @@ -83,7 +83,7 @@ static int porterDestroy(sqlite3_tokenizer *pTokenizer){ /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is zInput[0..nInput-1]. A cursor -** used to incrementally tokenize this string is returned in +** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int porterOpen( @@ -136,7 +136,7 @@ static const char cType[] = { /* ** isConsonant() and isVowel() determine if their first character in ** the string they point to is a consonant or a vowel, according -** to Porter ruls. +** to Porter ruls. ** ** A consonate is any letter other than 'a', 'e', 'i', 'o', or 'u'. ** 'Y' is a consonant unless it follows another consonant, @@ -256,11 +256,11 @@ static int star_oh(const char *z){ /* ** If the word ends with zFrom and xCond() is true for the stem -** of the word that preceeds the zFrom ending, then change the +** of the word that preceeds the zFrom ending, then change the ** ending to zTo. ** ** The input word *pz and zFrom are both in reverse order. zTo -** is in normal order. +** is in normal order. ** ** Return TRUE if zFrom matches. Return FALSE if zFrom does not ** match. Not that TRUE is returned even if xCond() fails and @@ -329,9 +329,9 @@ static void copy_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ ** word contains digits, 3 bytes are taken from the beginning and ** 3 bytes from the end. For long words without digits, 10 bytes ** are taken from each end. US-ASCII case folding still applies. -** -** If the input word contains not digits but does characters not -** in [a-zA-Z] then no stemming is attempted and this routine just +** +** If the input word contains not digits but does characters not +** in [a-zA-Z] then no stemming is attempted and this routine just ** copies the input into the input into the output with US-ASCII ** case folding. ** @@ -376,11 +376,11 @@ static void porter_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ } } - /* Step 1b */ + /* Step 1b */ z2 = z; if( stem(&z, "dee", "ee", m_gt_0) ){ /* Do nothing. The work was all in the test */ - }else if( + }else if( (stem(&z, "gni", "", hasVowel) || stem(&z, "de", "", hasVowel)) && z!=z2 ){ @@ -419,7 +419,7 @@ static void porter_stemmer(const char *zIn, int nIn, char *zOut, int *pnOut){ stem(&z, "igol", "log", m_gt_0); break; case 'l': - if( !stem(&z, "ilb", "ble", m_gt_0) + if( !stem(&z, "ilb", "ble", m_gt_0) && !stem(&z, "illa", "al", m_gt_0) && !stem(&z, "iltne", "ent", m_gt_0) && !stem(&z, "ile", "e", m_gt_0) diff --git a/third_party/sqlite/src/ext/fts3/fts3_snippet.c b/third_party/sqlite/src/ext/fts3/fts3_snippet.c index a0771c0b305b4..41f64468281e2 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_snippet.c +++ b/third_party/sqlite/src/ext/fts3/fts3_snippet.c @@ -31,7 +31,7 @@ #define FTS3_MATCHINFO_LHITS_BM 'b' /* nCol*nPhrase values */ /* -** The default value for the second argument to matchinfo(). +** The default value for the second argument to matchinfo(). */ #define FTS3_MATCHINFO_DEFAULT "pcx" @@ -48,7 +48,7 @@ struct LoadDoclistCtx { }; /* -** The following types are used as part of the implementation of the +** The following types are used as part of the implementation of the ** fts3BestSnippet() routine. */ typedef struct SnippetIter SnippetIter; @@ -81,7 +81,7 @@ struct SnippetFragment { }; /* -** This type is used as an fts3ExprIterate() context object while +** This type is used as an fts3ExprIterate() context object while ** accumulating the data returned by the matchinfo() function. */ typedef struct MatchInfo MatchInfo; @@ -150,8 +150,8 @@ static MatchinfoBuffer *fts3MIBufferNew(int nElem, const char *zMatchinfo){ static void fts3MIBufferFree(void *p){ MatchinfoBuffer *pBuf = (MatchinfoBuffer*)((u8*)p - ((u32*)p)[-1]); - assert( (u32*)p==&pBuf->aMatchinfo[1] - || (u32*)p==&pBuf->aMatchinfo[pBuf->nElem+2] + assert( (u32*)p==&pBuf->aMatchinfo[1] + || (u32*)p==&pBuf->aMatchinfo[pBuf->nElem+2] ); if( (u32*)p==&pBuf->aMatchinfo[1] ){ pBuf->aRef[1] = 0; @@ -207,7 +207,7 @@ void sqlite3Fts3MIBufferFree(MatchinfoBuffer *p){ } } -/* +/* ** End of MatchinfoBuffer code. *************************************************************************/ @@ -268,7 +268,7 @@ static int fts3ExprIterate2( ** are part of a sub-tree that is the right-hand-side of a NOT operator. ** For each phrase node found, the supplied callback function is invoked. ** -** If the callback function returns anything other than SQLITE_OK, +** If the callback function returns anything other than SQLITE_OK, ** the iteration is abandoned and the error code returned immediately. ** Otherwise, SQLITE_OK is returned after a callback has been made for ** all eligible phrase nodes. @@ -303,11 +303,11 @@ static int fts3ExprLoadDoclistsCb(Fts3Expr *pExpr, int iPhrase, void *ctx){ /* ** Load the doclists for each phrase in the query associated with FTS3 cursor -** pCsr. +** pCsr. ** -** If pnPhrase is not NULL, then *pnPhrase is set to the number of matchable -** phrases in the expression (all phrases except those directly or -** indirectly descended from the right-hand-side of a NOT operator). If +** If pnPhrase is not NULL, then *pnPhrase is set to the number of matchable +** phrases in the expression (all phrases except those directly or +** indirectly descended from the right-hand-side of a NOT operator). If ** pnToken is not NULL, then it is set to the number of tokens in all ** matchable phrases of the expression. */ @@ -337,7 +337,7 @@ static int fts3ExprPhraseCount(Fts3Expr *pExpr){ } /* -** Advance the position list iterator specified by the first two +** Advance the position list iterator specified by the first two ** arguments so that it points to the first element with a value greater ** than or equal to parameter iNext. */ @@ -406,7 +406,7 @@ static int fts3SnippetNextCandidate(SnippetIter *pIter){ } /* -** Retrieve information about the current candidate snippet of snippet +** Retrieve information about the current candidate snippet of snippet ** iterator pIter. */ static void fts3SnippetDetails( @@ -482,7 +482,7 @@ static int fts3SnippetFindPositions(Fts3Expr *pExpr, int iPhrase, void *ctx){ pPhrase->iTail = iFirst; }else{ assert( rc!=SQLITE_OK || ( - pPhrase->pList==0 && pPhrase->pHead==0 && pPhrase->pTail==0 + pPhrase->pList==0 && pPhrase->pHead==0 && pPhrase->pTail==0 )); } @@ -490,14 +490,14 @@ static int fts3SnippetFindPositions(Fts3Expr *pExpr, int iPhrase, void *ctx){ } /* -** Select the fragment of text consisting of nFragment contiguous tokens +** Select the fragment of text consisting of nFragment contiguous tokens ** from column iCol that represent the "best" snippet. The best snippet ** is the snippet with the highest score, where scores are calculated ** by adding: ** ** (a) +1 point for each occurrence of a matchable phrase in the snippet. ** -** (b) +1000 points for the first occurrence of each matchable phrase in +** (b) +1000 points for the first occurrence of each matchable phrase in ** the snippet for which the corresponding mCovered bit is not set. ** ** The selected snippet parameters are stored in structure *pFragment before @@ -558,7 +558,7 @@ static int fts3BestSnippet( } } - /* Loop through all candidate snippets. Store the best snippet in + /* Loop through all candidate snippets. Store the best snippet in ** *pFragment. Store its associated 'score' in iBestScore. */ pFragment->iCol = iCol; @@ -630,8 +630,8 @@ static int fts3StringAppend( ** ** ........X.....X ** -** This function "shifts" the beginning of the snippet forward in the -** document so that there are approximately the same number of +** This function "shifts" the beginning of the snippet forward in the +** document so that there are approximately the same number of ** non-highlighted terms to the right of the final highlighted term as there ** are to the left of the first highlighted term. For example, to this: ** @@ -639,8 +639,8 @@ static int fts3StringAppend( ** ** This is done as part of extracting the snippet text, not when selecting ** the snippet. Snippet selection is done based on doclists only, so there -** is no way for fts3BestSnippet() to know whether or not the document -** actually contains terms that follow the final highlighted term. +** is no way for fts3BestSnippet() to know whether or not the document +** actually contains terms that follow the final highlighted term. */ static int fts3SnippetShift( Fts3Table *pTab, /* FTS3 table snippet comes from */ @@ -729,7 +729,7 @@ static int fts3SnippetText( int iCol = pFragment->iCol+1; /* Query column to extract text from */ sqlite3_tokenizer_module *pMod; /* Tokenizer module methods object */ sqlite3_tokenizer_cursor *pC; /* Tokenizer cursor open on zDoc/nDoc */ - + zDoc = (const char *)sqlite3_column_text(pCsr->pStmt, iCol); if( zDoc==0 ){ if( sqlite3_column_type(pCsr->pStmt, iCol)!=SQLITE_NULL ){ @@ -769,7 +769,7 @@ static int fts3SnippetText( if( rc==SQLITE_DONE ){ /* Special case - the last token of the snippet is also the last token ** of the column. Append any punctuation that occurred between the end - ** of the previous token and the end of the document to the output. + ** of the previous token and the end of the document to the output. ** Then break out of the loop. */ rc = fts3StringAppend(pOut, &zDoc[iEnd], -1); } @@ -786,7 +786,7 @@ static int fts3SnippetText( /* Now that the shift has been done, check if the initial "..." are ** required. They are required if (a) this is not the first fragment, - ** or (b) this fragment does not begin at position 0 of its column. + ** or (b) this fragment does not begin at position 0 of its column. */ if( rc==SQLITE_OK ){ if( iPos>0 || iFragment>0 ){ @@ -822,8 +822,8 @@ static int fts3SnippetText( /* -** This function is used to count the entries in a column-list (a -** delta-encoded list of term offsets within a single column of a single +** This function is used to count the entries in a column-list (a +** delta-encoded list of term offsets within a single column of a single ** row). When this function is called, *ppCollist should point to the ** beginning of the first varint in the column-list (the varint that ** contains the position of the first matching term in the column data). @@ -905,11 +905,11 @@ static void fts3ExprLHitGather( /* ** fts3ExprIterate() callback used to collect the "global" matchinfo stats -** for a single query. +** for a single query. ** ** fts3ExprIterate() callback to load the 'global' elements of a -** FTS3_MATCHINFO_HITS matchinfo array. The global stats are those elements -** of the matchinfo array that are constant for all rows returned by the +** FTS3_MATCHINFO_HITS matchinfo array. The global stats are those elements +** of the matchinfo array that are constant for all rows returned by the ** current query. ** ** Argument pCtx is actually a pointer to a struct of type MatchInfo. This @@ -925,7 +925,7 @@ static void fts3ExprLHitGather( ** at least one instance of phrase iPhrase. ** ** If the phrase pExpr consists entirely of deferred tokens, then all X and -** Y values are set to nDoc, where nDoc is the number of documents in the +** Y values are set to nDoc, where nDoc is the number of documents in the ** file system. This is done because the full-text index doclist is required ** to calculate these values properly, and the full-text index doclist is ** not available for deferred tokens. @@ -943,7 +943,7 @@ static int fts3ExprGlobalHitsCb( /* ** fts3ExprIterate() callback used to collect the "local" part of the -** FTS3_MATCHINFO_HITS array. The local stats are those elements of the +** FTS3_MATCHINFO_HITS array. The local stats are those elements of the ** array that are different for each row returned by the query. */ static int fts3ExprLocalHitsCb( @@ -970,7 +970,7 @@ static int fts3ExprLocalHitsCb( } static int fts3MatchinfoCheck( - Fts3Table *pTab, + Fts3Table *pTab, char cArg, char **pzErr ){ @@ -995,8 +995,8 @@ static int fts3MatchinfoSize(MatchInfo *pInfo, char cArg){ switch( cArg ){ case FTS3_MATCHINFO_NDOC: - case FTS3_MATCHINFO_NPHRASE: - case FTS3_MATCHINFO_NCOL: + case FTS3_MATCHINFO_NPHRASE: + case FTS3_MATCHINFO_NCOL: nVal = 1; break; @@ -1050,7 +1050,7 @@ static int fts3MatchinfoSelectDoctotal( } /* -** An instance of the following structure is used to store state while +** An instance of the following structure is used to store state while ** iterating through a multi-column position-list corresponding to the ** hits for a single phrase on a single row in order to calculate the ** values for a matchinfo() FTS3_MATCHINFO_LCS request. @@ -1063,7 +1063,7 @@ struct LcsIterator { int iPos; /* Current position */ }; -/* +/* ** If LcsIterator.iCol is set to the following value, the iterator has ** finished iterating through all offsets for all columns. */ @@ -1100,16 +1100,16 @@ static int fts3LcsIteratorAdvance(LcsIterator *pIter){ pIter->pRead = pRead; return rc; } - + /* -** This function implements the FTS3_MATCHINFO_LCS matchinfo() flag. +** This function implements the FTS3_MATCHINFO_LCS matchinfo() flag. ** ** If the call is successful, the longest-common-substring lengths for each -** column are written into the first nCol elements of the pInfo->aMatchinfo[] +** column are written into the first nCol elements of the pInfo->aMatchinfo[] ** array before returning. SQLITE_OK is returned in this case. ** ** Otherwise, if an error occurs, an SQLite error code is returned and the -** data written to the first nCol elements of pInfo->aMatchinfo[] is +** data written to the first nCol elements of pInfo->aMatchinfo[] is ** undefined. */ static int fts3MatchinfoLcs(Fts3Cursor *pCsr, MatchInfo *pInfo){ @@ -1181,7 +1181,7 @@ static int fts3MatchinfoLcs(Fts3Cursor *pCsr, MatchInfo *pInfo){ /* ** Populate the buffer pInfo->aMatchinfo[] with an array of integers to -** be returned by the matchinfo() function. Argument zArg contains the +** be returned by the matchinfo() function. Argument zArg contains the ** format string passed as the second argument to matchinfo (or the ** default value "pcx" if no second argument was specified). The format ** string has already been validated and the pInfo->aMatchinfo[] array @@ -1192,7 +1192,7 @@ static int fts3MatchinfoLcs(Fts3Cursor *pCsr, MatchInfo *pInfo){ ** rows (i.e. FTS3_MATCHINFO_NPHRASE, NCOL, NDOC, AVGLENGTH and part of HITS) ** have already been populated. ** -** Return SQLITE_OK if successful, or an SQLite error code if an error +** Return SQLITE_OK if successful, or an SQLite error code if an error ** occurs. If a value other than SQLITE_OK is returned, the state the ** pInfo->aMatchinfo[] buffer is left in is undefined. */ @@ -1217,7 +1217,7 @@ static int fts3MatchinfoValues( case FTS3_MATCHINFO_NCOL: if( bGlobal ) pInfo->aMatchinfo[0] = pInfo->nCol; break; - + case FTS3_MATCHINFO_NDOC: if( bGlobal ){ sqlite3_int64 nDoc = 0; @@ -1226,7 +1226,7 @@ static int fts3MatchinfoValues( } break; - case FTS3_MATCHINFO_AVGLENGTH: + case FTS3_MATCHINFO_AVGLENGTH: if( bGlobal ){ sqlite3_int64 nDoc; /* Number of rows in table */ const char *a; /* Aggregate column length array */ @@ -1305,7 +1305,7 @@ static int fts3MatchinfoValues( /* -** Populate pCsr->aMatchinfo[] with data for the current row. The +** Populate pCsr->aMatchinfo[] with data for the current row. The ** 'matchinfo' data is an array of 32-bit unsigned integers (C type u32). */ static void fts3GetMatchinfo( @@ -1325,8 +1325,8 @@ static void fts3GetMatchinfo( sInfo.pCursor = pCsr; sInfo.nCol = pTab->nColumn; - /* If there is cached matchinfo() data, but the format string for the - ** cache does not match the format string for this request, discard + /* If there is cached matchinfo() data, but the format string for the + ** cache does not match the format string for this request, discard ** the cached data. */ if( pCsr->pMIBuffer && strcmp(pCsr->pMIBuffer->zMatchinfo, zArg) ){ sqlite3Fts3MIBufferFree(pCsr->pMIBuffer); @@ -1334,7 +1334,7 @@ static void fts3GetMatchinfo( } /* If Fts3Cursor.pMIBuffer is NULL, then this is the first time the - ** matchinfo function has been called for this query. In this case + ** matchinfo function has been called for this query. In this case ** allocate the array used to accumulate the matchinfo data and ** initialize those elements that are constant for every row. */ @@ -1409,7 +1409,7 @@ void sqlite3Fts3Snippet( /* The returned text includes up to four fragments of text extracted from ** the data in the current row. The first iteration of the for(...) loop - ** below attempts to locate a single fragment of text nToken tokens in + ** below attempts to locate a single fragment of text nToken tokens in ** size that contains at least one instance of all phrases in the query ** expression that appear in the current row. If such a fragment of text ** cannot be found, the second iteration of the loop attempts to locate @@ -1476,7 +1476,7 @@ void sqlite3Fts3Snippet( assert( nFToken>0 ); for(i=0; iiPrevId; sCtx.pCsr = pCsr; - /* Loop through the table columns, appending offset information to + /* Loop through the table columns, appending offset information to ** string-buffer res for each column. */ for(iCol=0; iColnColumn; iCol++){ @@ -1587,7 +1587,7 @@ void sqlite3Fts3Offsets( const char *zDoc; int nDoc; - /* Initialize the contents of sCtx.aTerm[] for column iCol. There is + /* Initialize the contents of sCtx.aTerm[] for column iCol. There is ** no way that this operation can fail, so the return code from ** fts3ExprIterate() can be discarded. */ @@ -1595,11 +1595,11 @@ void sqlite3Fts3Offsets( sCtx.iTerm = 0; (void)fts3ExprIterate(pCsr->pExpr, fts3ExprTermOffsetInit, (void*)&sCtx); - /* Retreive the text stored in column iCol. If an SQL NULL is stored + /* Retreive the text stored in column iCol. If an SQL NULL is stored ** in column iCol, jump immediately to the next iteration of the loop. ** If an OOM occurs while retrieving the data (this can happen if SQLite - ** needs to transform the data from utf-16 to utf-8), return SQLITE_NOMEM - ** to the caller. + ** needs to transform the data from utf-16 to utf-8), return SQLITE_NOMEM + ** to the caller. */ zDoc = (const char *)sqlite3_column_text(pCsr->pStmt, iCol+1); nDoc = sqlite3_column_bytes(pCsr->pStmt, iCol+1); @@ -1646,7 +1646,7 @@ void sqlite3Fts3Offsets( } if( rc==SQLITE_OK ){ char aBuffer[64]; - sqlite3_snprintf(sizeof(aBuffer), aBuffer, + sqlite3_snprintf(sizeof(aBuffer), aBuffer, "%d %d %d %d ", iCol, pTerm-sCtx.aTerm, iStart, iEnd-iStart ); rc = fts3StringAppend(&res, aBuffer, -1); diff --git a/third_party/sqlite/src/ext/fts3/fts3_term.c b/third_party/sqlite/src/ext/fts3/fts3_term.c index 7edd072892555..644cfa803ba53 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_term.c +++ b/third_party/sqlite/src/ext/fts3/fts3_term.c @@ -11,8 +11,8 @@ ****************************************************************************** ** ** This file is not part of the production FTS code. It is only used for -** testing. It contains a virtual table implementation that provides direct -** access to the full-text index of an FTS table. +** testing. It contains a virtual table implementation that provides direct +** access to the full-text index of an FTS table. */ #include "fts3Int.h" @@ -87,7 +87,7 @@ static int fts3termConnectMethod( return SQLITE_ERROR; } - zDb = argv[1]; + zDb = argv[1]; nDb = (int)strlen(zDb); zFts3 = argv[3]; nFts3 = (int)strlen(zFts3); @@ -142,7 +142,7 @@ static int fts3termDisconnectMethod(sqlite3_vtab *pVtab){ ** xBestIndex - Analyze a WHERE and ORDER BY clause. */ static int fts3termBestIndexMethod( - sqlite3_vtab *pVTab, + sqlite3_vtab *pVTab, sqlite3_index_info *pInfo ){ UNUSED_PARAMETER(pVTab); @@ -203,7 +203,7 @@ static int fts3termNextMethod(sqlite3_vtab_cursor *pCursor){ pCsr->iRowid++; /* Advance to the next term in the full-text index. */ - if( pCsr->csr.aDoclist==0 + if( pCsr->csr.aDoclist==0 || pCsr->pNext>=&pCsr->csr.aDoclist[pCsr->csr.nDoclist-1] ){ rc = sqlite3Fts3SegReaderStep(pFts3, &pCsr->csr); diff --git a/third_party/sqlite/src/ext/fts3/fts3_test.c b/third_party/sqlite/src/ext/fts3/fts3_test.c index a48a556c98f08..ac2a4adf05560 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_test.c +++ b/third_party/sqlite/src/ext/fts3/fts3_test.c @@ -142,7 +142,7 @@ static int nm_match_count( /* This is a real match. Increment the counter. */ nOcc++; } - } + } return nOcc; } @@ -165,7 +165,7 @@ static int SQLITE_TCLAPI fts3_near_match_cmd( Tcl_Obj **apDocToken; Tcl_Obj *pRet; Tcl_Obj *pPhrasecount = 0; - + Tcl_Obj **apExprToken; int nExprToken; @@ -189,7 +189,7 @@ static int SQLITE_TCLAPI fts3_near_match_cmd( }; int iOpt; if( Tcl_GetIndexFromObjStruct( - interp, objv[ii], aOpt, sizeof(aOpt[0]), "option", 0, &iOpt) + interp, objv[ii], aOpt, sizeof(aOpt[0]), "option", 0, &iOpt) ){ return TCL_ERROR; } @@ -254,7 +254,7 @@ static int SQLITE_TCLAPI fts3_near_match_cmd( Tcl_DecrRefCount(pRet); Tcl_SetObjResult(interp, Tcl_NewBooleanObj(nTotal>0)); - near_match_out: + near_match_out: ckfree((char *)aPhrase); ckfree((char *)doc.aToken); return rc; @@ -332,10 +332,10 @@ static int SQLITE_TCLAPI fts3_configure_incr_load_cmd( /************************************************************************** ** Beginning of test tokenizer code. ** -** For language 0, this tokenizer is similar to the default 'simple' +** For language 0, this tokenizer is similar to the default 'simple' ** tokenizer. For other languages L, the following: ** -** * Odd numbered languages are case-sensitive. Even numbered +** * Odd numbered languages are case-sensitive. Even numbered ** languages are not. ** ** * Language ids 100 or greater are considered an error. @@ -570,13 +570,13 @@ static int SQLITE_TCLAPI fts3_test_varint_cmd( return TCL_OK; } -/* +/* ** End of tokenizer code. -**************************************************************************/ +**************************************************************************/ int Sqlitetestfts3_Init(Tcl_Interp *interp){ Tcl_CreateObjCommand(interp, "fts3_near_match", fts3_near_match_cmd, 0, 0); - Tcl_CreateObjCommand(interp, + Tcl_CreateObjCommand(interp, "fts3_configure_incr_load", fts3_configure_incr_load_cmd, 0, 0 ); Tcl_CreateObjCommand( diff --git a/third_party/sqlite/src/ext/fts3/fts3_tokenize_vtab.c b/third_party/sqlite/src/ext/fts3/fts3_tokenize_vtab.c index dfeddfeb963c5..611c5eb29e12c 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_tokenize_vtab.c +++ b/third_party/sqlite/src/ext/fts3/fts3_tokenize_vtab.c @@ -25,8 +25,8 @@ ** ** input = ** -** The virtual table module tokenizes this , using the FTS3 -** tokenizer specified by the arguments to the CREATE VIRTUAL TABLE +** The virtual table module tokenizes this , using the FTS3 +** tokenizer specified by the arguments to the CREATE VIRTUAL TABLE ** statement and returns one row for each token in the result. With ** fields set as follows: ** @@ -95,7 +95,7 @@ static int fts3tokQueryTokenizer( /* ** The second argument, argv[], is an array of pointers to nul-terminated -** strings. This function makes a copy of the array and strings into a +** strings. This function makes a copy of the array and strings into a ** single block of memory. It then dequotes any of the strings that appear ** to be quoted. ** @@ -151,7 +151,7 @@ static int fts3tokDequoteArray( ** and xCreate are identical operations. ** ** argv[0]: module name -** argv[1]: database name +** argv[1]: database name ** argv[2]: table name ** argv[3]: first argument (tokenizer name) */ @@ -231,16 +231,16 @@ static int fts3tokDisconnectMethod(sqlite3_vtab *pVtab){ ** xBestIndex - Analyze a WHERE and ORDER BY clause. */ static int fts3tokBestIndexMethod( - sqlite3_vtab *pVTab, + sqlite3_vtab *pVTab, sqlite3_index_info *pInfo ){ int i; UNUSED_PARAMETER(pVTab); for(i=0; inConstraint; i++){ - if( pInfo->aConstraint[i].usable - && pInfo->aConstraint[i].iColumn==0 - && pInfo->aConstraint[i].op==SQLITE_INDEX_CONSTRAINT_EQ + if( pInfo->aConstraint[i].usable + && pInfo->aConstraint[i].iColumn==0 + && pInfo->aConstraint[i].op==SQLITE_INDEX_CONSTRAINT_EQ ){ pInfo->idxNum = 1; pInfo->aConstraintUsage[i].argvIndex = 1; diff --git a/third_party/sqlite/src/ext/fts3/fts3_tokenizer.c b/third_party/sqlite/src/ext/fts3/fts3_tokenizer.c index bfc36af3e38bb..c8900fb3c331b 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_tokenizer.c +++ b/third_party/sqlite/src/ext/fts3/fts3_tokenizer.c @@ -42,7 +42,7 @@ static int fts3TokenizerEnabled(sqlite3_context *context){ } /* -** Implementation of the SQL scalar function for accessing the underlying +** Implementation of the SQL scalar function for accessing the underlying ** hash table. This function may be called as follows: ** ** SELECT (); @@ -212,7 +212,7 @@ int sqlite3Fts3InitTokenizer( if( rc!=SQLITE_OK ){ sqlite3Fts3ErrMsg(pzErr, "unknown tokenizer"); }else{ - (*ppTok)->pModule = m; + (*ppTok)->pModule = m; } sqlite3_free((void *)aArg); } @@ -232,7 +232,7 @@ int sqlite3Fts3InitTokenizer( #include /* -** Implementation of a special SQL scalar function for testing tokenizers +** Implementation of a special SQL scalar function for testing tokenizers ** designed to be used in concert with the Tcl testing framework. This ** function must be called with two or more arguments: ** @@ -244,9 +244,9 @@ int sqlite3Fts3InitTokenizer( ** ** The return value is a string that may be interpreted as a Tcl ** list. For each token in the , three elements are -** added to the returned list. The first is the token position, the +** added to the returned list. The first is the token position, the ** second is the token text (folded, stemmed, etc.) and the third is the -** substring of associated with the token. For example, +** substring of associated with the token. For example, ** using the built-in "simple" tokenizer: ** ** SELECT fts_tokenizer_test('simple', 'I don't see how'); @@ -254,7 +254,7 @@ int sqlite3Fts3InitTokenizer( ** will return the string: ** ** "{0 i I 1 dont don't 2 see see 3 how how}" -** +** */ static void testFunc( sqlite3_context *context, @@ -349,8 +349,8 @@ finish: static int registerTokenizer( - sqlite3 *db, - char *zName, + sqlite3 *db, + char *zName, const sqlite3_tokenizer_module *p ){ int rc; @@ -372,8 +372,8 @@ int registerTokenizer( static int queryTokenizer( - sqlite3 *db, - char *zName, + sqlite3 *db, + char *zName, const sqlite3_tokenizer_module **pp ){ int rc; @@ -456,23 +456,23 @@ static void intTestFunc( /* ** Set up SQL objects in database db used to access the contents of ** the hash table pointed to by argument pHash. The hash table must -** been initialized to use string keys, and to take a private copy +** been initialized to use string keys, and to take a private copy ** of the key when a value is inserted. i.e. by a call similar to: ** ** sqlite3Fts3HashInit(pHash, FTS3_HASH_STRING, 1); ** ** This function adds a scalar function (see header comment above ** fts3TokenizerFunc() in this file for details) and, if ENABLE_TABLE is -** defined at compilation time, a temporary virtual table (see header -** comment above struct HashTableVtab) to the database schema. Both +** defined at compilation time, a temporary virtual table (see header +** comment above struct HashTableVtab) to the database schema. Both ** provide read/write access to the contents of *pHash. ** ** The third argument to this function, zName, is used as the name ** of both the scalar and, if created, the virtual table. */ int sqlite3Fts3InitHashTable( - sqlite3 *db, - Fts3Hash *pHash, + sqlite3 *db, + Fts3Hash *pHash, const char *zName ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/fts3/fts3_tokenizer.h b/third_party/sqlite/src/ext/fts3/fts3_tokenizer.h index 4a40b2b385038..523af604e2eb1 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_tokenizer.h +++ b/third_party/sqlite/src/ext/fts3/fts3_tokenizer.h @@ -35,7 +35,7 @@ ** When an fts3 table is created, it passes any arguments passed to ** the tokenizer clause of the CREATE VIRTUAL TABLE statement to the ** sqlite3_tokenizer_module.xCreate() function of the requested tokenizer -** implementation. The xCreate() function in turn returns an +** implementation. The xCreate() function in turn returns an ** sqlite3_tokenizer structure representing the specific tokenizer to ** be used for the fts3 table (customized by the tokenizer clause arguments). ** @@ -67,7 +67,7 @@ struct sqlite3_tokenizer_module { ** then argc is set to 2, and the argv[] array contains pointers ** to the strings "arg1" and "arg2". ** - ** This method should return either SQLITE_OK (0), or an SQLite error + ** This method should return either SQLITE_OK (0), or an SQLite error ** code. If SQLITE_OK is returned, then *ppTokenizer should be set ** to point at the newly created tokenizer structure. The generic ** sqlite3_tokenizer.pModule variable should not be initialized by @@ -88,7 +88,7 @@ struct sqlite3_tokenizer_module { /* ** Create a tokenizer cursor to tokenize an input buffer. The caller ** is responsible for ensuring that the input buffer remains valid - ** until the cursor is closed (using the xClose() method). + ** until the cursor is closed (using the xClose() method). */ int (*xOpen)( sqlite3_tokenizer *pTokenizer, /* Tokenizer object */ @@ -97,7 +97,7 @@ struct sqlite3_tokenizer_module { ); /* - ** Destroy an existing tokenizer cursor. The fts3 module calls this + ** Destroy an existing tokenizer cursor. The fts3 module calls this ** method exactly once for each successful call to xOpen(). */ int (*xClose)(sqlite3_tokenizer_cursor *pCursor); @@ -108,7 +108,7 @@ struct sqlite3_tokenizer_module { ** "OUT" variables identified below, or SQLITE_DONE to indicate that ** the end of the buffer has been reached, or an SQLite error code. ** - ** *ppToken should be set to point at a buffer containing the + ** *ppToken should be set to point at a buffer containing the ** normalized version of the token (i.e. after any case-folding and/or ** stemming has been performed). *pnBytes should be set to the length ** of this buffer in bytes. The input text that generated the token is @@ -120,7 +120,7 @@ struct sqlite3_tokenizer_module { ** ** The buffer *ppToken is set to point at is managed by the tokenizer ** implementation. It is only required to be valid until the next call - ** to xNext() or xClose(). + ** to xNext() or xClose(). */ /* TODO(shess) current implementation requires pInput to be ** nul-terminated. This should either be fixed, or pInput/nBytes @@ -138,7 +138,7 @@ struct sqlite3_tokenizer_module { ** Methods below this point are only available if iVersion>=1. */ - /* + /* ** Configure the language id of a tokenizer cursor. */ int (*xLanguageid)(sqlite3_tokenizer_cursor *pCsr, int iLangid); diff --git a/third_party/sqlite/src/ext/fts3/fts3_tokenizer1.c b/third_party/sqlite/src/ext/fts3/fts3_tokenizer1.c index deea06d92bf89..e2801a84fd0c9 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_tokenizer1.c +++ b/third_party/sqlite/src/ext/fts3/fts3_tokenizer1.c @@ -107,7 +107,7 @@ static int simpleDestroy(sqlite3_tokenizer *pTokenizer){ /* ** Prepare to begin tokenizing a particular string. The input ** string to be tokenized is pInput[0..nBytes-1]. A cursor -** used to incrementally tokenize this string is returned in +** used to incrementally tokenize this string is returned in ** *ppCursor. */ static int simpleOpen( diff --git a/third_party/sqlite/src/ext/fts3/fts3_unicode.c b/third_party/sqlite/src/ext/fts3/fts3_unicode.c index 94fc27b5b4e87..3214aebdbf644 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_unicode.c +++ b/third_party/sqlite/src/ext/fts3/fts3_unicode.c @@ -118,7 +118,7 @@ static int unicodeDestroy(sqlite3_tokenizer *pTokenizer){ ** ** For each codepoint in the zIn/nIn string, this function checks if the ** sqlite3FtsUnicodeIsalnum() function already returns the desired result. -** If so, no action is taken. Otherwise, the codepoint is added to the +** If so, no action is taken. Otherwise, the codepoint is added to the ** unicode_tokenizer.aiException[] array. For the purposes of tokenization, ** the return value of sqlite3FtsUnicodeIsalnum() is inverted for all ** codepoints in the aiException[] array. @@ -144,8 +144,8 @@ static int unicodeAddExceptions( while( zaInput[pCsr->nInput]; /* Scan past any delimiter characters before the start of the next token. - ** Return SQLITE_DONE early if this takes us all the way to the end of + ** Return SQLITE_DONE early if this takes us all the way to the end of ** the input. */ while( z=zTerm ) break; READ_UTF8(z, zTerm, iCode); - }while( unicodeIsAlnum(p, iCode) + }while( unicodeIsAlnum(p, iCode) || sqlite3FtsUnicodeIsdiacritic(iCode) ); @@ -373,7 +373,7 @@ static int unicodeNext( } /* -** Set *ppModule to a pointer to the sqlite3_tokenizer_module +** Set *ppModule to a pointer to the sqlite3_tokenizer_module ** structure for the unicode tokenizer. */ void sqlite3Fts3UnicodeTokenizer(sqlite3_tokenizer_module const **ppModule){ diff --git a/third_party/sqlite/src/ext/fts3/fts3_unicode2.c b/third_party/sqlite/src/ext/fts3/fts3_unicode2.c index 20b7a25dbfd4e..a0913dd9c4c7d 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_unicode2.c +++ b/third_party/sqlite/src/ext/fts3/fts3_unicode2.c @@ -32,11 +32,11 @@ int sqlite3FtsUnicodeIsalnum(int c){ ** range of unicode codepoints that are not either letters or numbers (i.e. ** codepoints for which this function should return 0). ** - ** The most significant 22 bits in each 32-bit value contain the first + ** The most significant 22 bits in each 32-bit value contain the first ** codepoint in the range. The least significant 10 bits are used to store - ** the size of the range (always at least 1). In other words, the value - ** ((C<<22) + N) represents a range of N codepoints starting with codepoint - ** C. It is not possible to represent a range larger than 1023 codepoints + ** the size of the range (always at least 1). In other words, the value + ** ((C<<22) + N) represents a range of N codepoints starting with codepoint + ** C. It is not possible to represent a range larger than 1023 codepoints ** using this format. */ static const unsigned int aEntry[] = { @@ -161,30 +161,30 @@ int sqlite3FtsUnicodeIsalnum(int c){ */ static int remove_diacritic(int c){ unsigned short aDia[] = { - 0, 1797, 1848, 1859, 1891, 1928, 1940, 1995, - 2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286, - 2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732, - 2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336, - 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928, - 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234, - 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504, - 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529, - 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726, - 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122, - 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536, - 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730, - 62924, 63050, 63082, 63274, 63390, + 0, 1797, 1848, 1859, 1891, 1928, 1940, 1995, + 2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286, + 2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732, + 2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336, + 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928, + 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234, + 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504, + 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529, + 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726, + 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122, + 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536, + 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730, + 62924, 63050, 63082, 63274, 63390, }; char aChar[] = { - '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c', - 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r', - 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o', - 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r', - 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0', - '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h', - 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't', - 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a', - 'e', 'i', 'o', 'u', 'y', + '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c', + 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r', + 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o', + 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r', + 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h', + 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't', + 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a', + 'e', 'i', 'o', 'u', 'y', }; unsigned int key = (((unsigned int)c)<<3) | 0x00000007; @@ -305,19 +305,19 @@ int sqlite3FtsUnicodeFold(int c, int bRemoveDiacritic){ {42802, 1, 62}, {42873, 1, 4}, {42877, 76, 1}, {42878, 1, 10}, {42891, 0, 1}, {42893, 74, 1}, {42896, 1, 4}, {42912, 1, 10}, {42922, 72, 1}, - {65313, 14, 26}, + {65313, 14, 26}, }; static const unsigned short aiOff[] = { - 1, 2, 8, 15, 16, 26, 28, 32, - 37, 38, 40, 48, 63, 64, 69, 71, - 79, 80, 116, 202, 203, 205, 206, 207, - 209, 210, 211, 213, 214, 217, 218, 219, - 775, 7264, 10792, 10795, 23228, 23256, 30204, 54721, - 54753, 54754, 54756, 54787, 54793, 54809, 57153, 57274, - 57921, 58019, 58363, 61722, 65268, 65341, 65373, 65406, - 65408, 65410, 65415, 65424, 65436, 65439, 65450, 65462, - 65472, 65476, 65478, 65480, 65482, 65488, 65506, 65511, - 65514, 65521, 65527, 65528, 65529, + 1, 2, 8, 15, 16, 26, 28, 32, + 37, 38, 40, 48, 63, 64, 69, 71, + 79, 80, 116, 202, 203, 205, 206, 207, + 209, 210, 211, 213, 214, 217, 218, 219, + 775, 7264, 10792, 10795, 23228, 23256, 30204, 54721, + 54753, 54754, 54756, 54787, 54793, 54809, 57153, 57274, + 57921, 58019, 58363, 61722, 65268, 65341, 65373, 65406, + 65408, 65410, 65415, 65424, 65436, 65439, 65450, 65462, + 65472, 65476, 65478, 65480, 65482, 65488, 65506, 65511, + 65514, 65521, 65527, 65528, 65529, }; int ret = c; @@ -354,7 +354,7 @@ int sqlite3FtsUnicodeFold(int c, int bRemoveDiacritic){ if( bRemoveDiacritic ) ret = remove_diacritic(ret); } - + else if( c>=66560 && c<66600 ){ ret = c + 40; } diff --git a/third_party/sqlite/src/ext/fts3/fts3_write.c b/third_party/sqlite/src/ext/fts3/fts3_write.c index 3ff481b0b081c..641b785731a04 100644 --- a/third_party/sqlite/src/ext/fts3/fts3_write.c +++ b/third_party/sqlite/src/ext/fts3/fts3_write.c @@ -13,7 +13,7 @@ ** This file is part of the SQLite FTS3 extension module. Specifically, ** this file contains code to insert, update and delete rows from FTS3 ** tables. It also contains code to merge FTS3 b-tree segments. Some -** of the sub-routines used to merge segments are also used by the query +** of the sub-routines used to merge segments are also used by the query ** code in fts3.c. */ @@ -29,7 +29,7 @@ /* ** When full-text index nodes are loaded from disk, the buffer that they -** are loaded into has the following number of bytes of padding at the end +** are loaded into has the following number of bytes of padding at the end ** of it. i.e. if a full-text index node is 900 bytes in size, then a buffer ** of 920 bytes is allocated for it. ** @@ -46,10 +46,10 @@ ** method before retrieving all query results (as may happen, for example, ** if a query has a LIMIT clause). ** -** Incremental loading is used for b-tree nodes FTS3_NODE_CHUNK_THRESHOLD +** Incremental loading is used for b-tree nodes FTS3_NODE_CHUNK_THRESHOLD ** bytes and larger. Nodes are loaded in chunks of FTS3_NODE_CHUNKSIZE bytes. -** The code is written so that the hard lower-limit for each of these values -** is 1. Clearly such small values would be inefficient, but can be useful +** The code is written so that the hard lower-limit for each of these values +** is 1. Clearly such small values would be inefficient, but can be useful ** for testing purposes. ** ** If this module is built with SQLITE_TEST defined, these constants may @@ -62,7 +62,7 @@ int test_fts3_node_chunk_threshold = (4*1024)*4; # define FTS3_NODE_CHUNKSIZE test_fts3_node_chunksize # define FTS3_NODE_CHUNK_THRESHOLD test_fts3_node_chunk_threshold #else -# define FTS3_NODE_CHUNKSIZE (4*1024) +# define FTS3_NODE_CHUNKSIZE (4*1024) # define FTS3_NODE_CHUNK_THRESHOLD (FTS3_NODE_CHUNKSIZE*4) #endif @@ -76,7 +76,7 @@ int test_fts3_node_chunk_threshold = (4*1024)*4; /* ** If FTS_LOG_MERGES is defined, call sqlite3_log() to report each automatic -** and incremental merge operation that takes place. This is used for +** and incremental merge operation that takes place. This is used for ** debugging FTS only, it should not usually be turned on in production ** systems. */ @@ -162,7 +162,7 @@ struct Fts3SegReader { char *aDoclist; /* Pointer to doclist of current entry */ int nDoclist; /* Size of doclist in current entry */ - /* The following variables are used by fts3SegReaderNextDocid() to iterate + /* The following variables are used by fts3SegReaderNextDocid() to iterate ** through the current doclist (aDoclist/nDoclist). */ char *pOffsetList; @@ -207,11 +207,11 @@ struct SegmentWriter { ** fts3NodeFree() ** ** When a b+tree is written to the database (either as a result of a merge -** or the pending-terms table being flushed), leaves are written into the +** or the pending-terms table being flushed), leaves are written into the ** database file as soon as they are completely populated. The interior of ** the tree is assembled in memory and written out only once all leaves have ** been populated and stored. This is Ok, as the b+-tree fanout is usually -** very large, meaning that the interior of the tree consumes relatively +** very large, meaning that the interior of the tree consumes relatively ** little memory. */ struct SegmentNode { @@ -232,7 +232,7 @@ struct SegmentNode { */ #define SQL_DELETE_CONTENT 0 #define SQL_IS_EMPTY 1 -#define SQL_DELETE_ALL_CONTENT 2 +#define SQL_DELETE_ALL_CONTENT 2 #define SQL_DELETE_ALL_SEGMENTS 3 #define SQL_DELETE_ALL_SEGDIR 4 #define SQL_DELETE_ALL_DOCSIZE 5 @@ -280,7 +280,7 @@ struct SegmentNode { ** Otherwise, an SQLite error code is returned and *pp is set to 0. ** ** If argument apVal is not NULL, then it must point to an array with -** at least as many entries as the requested statement has bound +** at least as many entries as the requested statement has bound ** parameters. The values are bound to the statements parameters before ** returning. */ @@ -304,7 +304,7 @@ static int fts3SqlStmt( /* 10 */ "SELECT coalesce((SELECT max(blockid) FROM %Q.'%q_segments') + 1, 1)", /* 11 */ "REPLACE INTO %Q.'%q_segdir' VALUES(?,?,?,?,?,?)", - /* Return segments in order from oldest to newest.*/ + /* Return segments in order from oldest to newest.*/ /* 12 */ "SELECT idx, start_block, leaves_end_block, end_block, root " "FROM %Q.'%q_segdir' WHERE level = ? ORDER BY idx ASC", /* 13 */ "SELECT idx, start_block, leaves_end_block, end_block, root " @@ -338,7 +338,7 @@ static int fts3SqlStmt( " ORDER BY (level %% 1024) ASC LIMIT 1", /* Estimate the upper limit on the number of leaf nodes in a new segment -** created by merging the oldest :2 segments from absolute level :1. See +** created by merging the oldest :2 segments from absolute level :1. See ** function sqlite3Fts3Incrmerge() for details. */ /* 29 */ "SELECT 2 * total(1 + leaves_end_block - start_block) " " FROM %Q.'%q_segdir' WHERE level = ? AND idx < ?", @@ -353,7 +353,7 @@ static int fts3SqlStmt( /* 31 */ "UPDATE %Q.'%q_segdir' SET idx = ? WHERE level=? AND idx=?", /* SQL_SELECT_SEGDIR -** Read a single entry from the %_segdir table. The entry from absolute +** Read a single entry from the %_segdir table. The entry from absolute ** level :1 with index value :2. */ /* 32 */ "SELECT idx, start_block, leaves_end_block, end_block, root " "FROM %Q.'%q_segdir' WHERE level = ? AND idx = ?", @@ -377,7 +377,7 @@ static int fts3SqlStmt( ** Return the largest relative level in the FTS index or indexes. */ /* 36 */ "SELECT max( level %% 1024 ) FROM %Q.'%q_segdir'", - /* Return segments in order from oldest to newest.*/ + /* Return segments in order from oldest to newest.*/ /* 37 */ "SELECT level, idx, end_block " "FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ? " "ORDER BY level DESC, idx ASC", @@ -393,7 +393,7 @@ static int fts3SqlStmt( assert( SizeofArray(azSql)==SizeofArray(p->aStmt) ); assert( eStmt=0 ); - + pStmt = p->aStmt[eStmt]; if( !pStmt ){ char *zSql; @@ -496,7 +496,7 @@ static void fts3SqlExec( sqlite3_stmt *pStmt; int rc; if( *pRC ) return; - rc = fts3SqlStmt(p, eStmt, &pStmt, apVal); + rc = fts3SqlStmt(p, eStmt, &pStmt, apVal); if( rc==SQLITE_OK ){ sqlite3_step(pStmt); rc = sqlite3_reset(pStmt); @@ -506,22 +506,22 @@ static void fts3SqlExec( /* -** This function ensures that the caller has obtained an exclusive -** shared-cache table-lock on the %_segdir table. This is required before +** This function ensures that the caller has obtained an exclusive +** shared-cache table-lock on the %_segdir table. This is required before ** writing data to the fts3 table. If this lock is not acquired first, then ** the caller may end up attempting to take this lock as part of committing -** a transaction, causing SQLite to return SQLITE_LOCKED or +** a transaction, causing SQLite to return SQLITE_LOCKED or ** LOCKED_SHAREDCACHEto a COMMIT command. ** -** It is best to avoid this because if FTS3 returns any error when -** committing a transaction, the whole transaction will be rolled back. -** And this is not what users expect when they get SQLITE_LOCKED_SHAREDCACHE. -** It can still happen if the user locks the underlying tables directly +** It is best to avoid this because if FTS3 returns any error when +** committing a transaction, the whole transaction will be rolled back. +** And this is not what users expect when they get SQLITE_LOCKED_SHAREDCACHE. +** It can still happen if the user locks the underlying tables directly ** instead of accessing them via FTS. */ static int fts3Writelock(Fts3Table *p){ int rc = SQLITE_OK; - + if( p->nPendingData==0 ){ sqlite3_stmt *pStmt; rc = fts3SqlStmt(p, SQL_DELETE_SEGDIR_LEVEL, &pStmt, 0); @@ -538,7 +538,7 @@ static int fts3Writelock(Fts3Table *p){ /* ** FTS maintains a separate indexes for each language-id (a 32-bit integer). ** Within each language id, a separate index is maintained to store the -** document terms, and each configured prefix size (configured the FTS +** document terms, and each configured prefix size (configured the FTS ** "prefix=" option). And each index consists of multiple levels ("relative ** levels"). ** @@ -548,14 +548,14 @@ static int fts3Writelock(Fts3Table *p){ ** separate component values into the single 64-bit integer value that ** can be used to query the %_segdir table. ** -** Specifically, each language-id/index combination is allocated 1024 +** Specifically, each language-id/index combination is allocated 1024 ** 64-bit integer level values ("absolute levels"). The main terms index ** for language-id 0 is allocate values 0-1023. The first prefix index ** (if any) for language-id 0 is allocated values 1024-2047. And so on. ** Language 1 indexes are allocated immediately following language 0. ** ** So, for a system with nPrefix prefix indexes configured, the block of -** absolute levels that corresponds to language-id iLangid and index +** absolute levels that corresponds to language-id iLangid and index ** iIndex starts at absolute level ((iLangid * (nPrefix+1) + iIndex) * 1024). */ static sqlite3_int64 getAbsoluteLevel( @@ -576,7 +576,7 @@ static sqlite3_int64 getAbsoluteLevel( /* ** Set *ppStmt to a statement handle that may be used to iterate through ** all rows in the %_segdir table, from oldest to newest. If successful, -** return SQLITE_OK. If an error occurs while preparing the statement, +** return SQLITE_OK. If an error occurs while preparing the statement, ** return an SQLite error code. ** ** There is only ever one instance of this SQL statement compiled for @@ -607,16 +607,16 @@ int sqlite3Fts3AllSegdirs( if( iLevel<0 ){ /* "SELECT * FROM %_segdir WHERE level BETWEEN ? AND ? ORDER BY ..." */ rc = fts3SqlStmt(p, SQL_SELECT_LEVEL_RANGE, &pStmt, 0); - if( rc==SQLITE_OK ){ + if( rc==SQLITE_OK ){ sqlite3_bind_int64(pStmt, 1, getAbsoluteLevel(p, iLangid, iIndex, 0)); - sqlite3_bind_int64(pStmt, 2, + sqlite3_bind_int64(pStmt, 2, getAbsoluteLevel(p, iLangid, iIndex, FTS3_SEGDIR_MAXLEVEL-1) ); } }else{ /* "SELECT * FROM %_segdir WHERE level = ? ORDER BY ..." */ rc = fts3SqlStmt(p, SQL_SELECT_LEVEL, &pStmt, 0); - if( rc==SQLITE_OK ){ + if( rc==SQLITE_OK ){ sqlite3_bind_int64(pStmt, 1, getAbsoluteLevel(p, iLangid, iIndex,iLevel)); } } @@ -760,7 +760,7 @@ static int fts3PendingTermsAddOne( } if( fts3PendingListAppend(&pList, p->iPrevDocid, iCol, iPos, &rc) ){ if( pList==fts3HashInsert(pHash, zToken, nToken, pList) ){ - /* Malloc failed while inserting the new entry. This can only + /* Malloc failed while inserting the new entry. This can only ** happen if there was no previous entry for this token. */ assert( 0==fts3HashFind(pHash, zToken, nToken) ); @@ -806,7 +806,7 @@ static int fts3PendingTermsAdd( assert( pTokenizer && pModule ); /* If the user has inserted a NULL value, this function may be called with - ** zText==0. In this case, add zero token entries to the hash table and + ** zText==0. In this case, add zero token entries to the hash table and ** return early. */ if( zText==0 ){ *pnWord = 0; @@ -837,8 +837,8 @@ static int fts3PendingTermsAdd( rc = fts3PendingTermsAddOne( p, iCol, iPos, &p->aIndex[0].hPending, zToken, nToken ); - - /* Add the term to each of the prefix indexes that it is not too + + /* Add the term to each of the prefix indexes that it is not too ** short for. */ for(i=1; rc==SQLITE_OK && inIndex; i++){ struct Fts3Index *pIndex = &p->aIndex[i]; @@ -854,8 +854,8 @@ static int fts3PendingTermsAdd( return (rc==SQLITE_DONE ? SQLITE_OK : rc); } -/* -** Calling this function indicates that subsequent calls to +/* +** Calling this function indicates that subsequent calls to ** fts3PendingTermsAdd() are to add term/position-list pairs for the ** contents of the document with docid iDocid. */ @@ -874,10 +874,10 @@ static int fts3PendingTermsDocid( ** buffer was half empty, that would let the less frequent terms ** generate longer doclists. */ - if( iDocidiPrevDocid + if( iDocidiPrevDocid || (iDocid==p->iPrevDocid && p->bPrevDelete==0) || p->iPrevLangid!=iLangid - || p->nPendingData>p->nMaxPendingData + || p->nPendingData>p->nMaxPendingData ){ int rc = sqlite3Fts3PendingTermsFlush(p); if( rc!=SQLITE_OK ) return rc; @@ -889,7 +889,7 @@ static int fts3PendingTermsDocid( } /* -** Discard the contents of the pending-terms hash tables. +** Discard the contents of the pending-terms hash tables. */ void sqlite3Fts3PendingTermsClear(Fts3Table *p){ int i; @@ -914,9 +914,9 @@ void sqlite3Fts3PendingTermsClear(Fts3Table *p){ ** fts3InsertData(). Parameter iDocid is the docid of the new row. */ static int fts3InsertTerms( - Fts3Table *p, - int iLangid, - sqlite3_value **apVal, + Fts3Table *p, + int iLangid, + sqlite3_value **apVal, u32 *aSz ){ int i; /* Iterator variable */ @@ -979,7 +979,7 @@ static int fts3InsertData( rc = fts3SqlStmt(p, SQL_CONTENT_INSERT, &pContentInsert, &apVal[1]); if( rc==SQLITE_OK && p->zLanguageid ){ rc = sqlite3_bind_int( - pContentInsert, p->nColumn+2, + pContentInsert, p->nColumn+2, sqlite3_value_int(apVal[p->nColumn+4]) ); } @@ -1006,8 +1006,8 @@ static int fts3InsertData( if( rc!=SQLITE_OK ) return rc; } - /* Execute the statement to insert the record. Set *piDocid to the - ** new docid value. + /* Execute the statement to insert the record. Set *piDocid to the + ** new docid value. */ sqlite3_step(pContentInsert); rc = sqlite3_reset(pContentInsert); @@ -1057,7 +1057,7 @@ static int langidFromSelect(Fts3Table *p, sqlite3_stmt *pSelect){ ** (an integer) of a row about to be deleted. Remove all terms from the ** full-text index. */ -static void fts3DeleteTerms( +static void fts3DeleteTerms( int *pRC, /* Result code */ Fts3Table *p, /* The FTS table to delete from */ sqlite3_value *pRowid, /* The docid to be deleted */ @@ -1104,7 +1104,7 @@ static void fts3DeleteTerms( */ static int fts3SegmentMerge(Fts3Table *, int, int, int); -/* +/* ** This function allocates a new level iLevel index in the segdir table. ** Usually, indexes are allocated within a level sequentially starting ** with 0, so the allocated index is one greater than the value returned @@ -1113,17 +1113,17 @@ static int fts3SegmentMerge(Fts3Table *, int, int, int); ** SELECT max(idx) FROM %_segdir WHERE level = :iLevel ** ** However, if there are already FTS3_MERGE_COUNT indexes at the requested -** level, they are merged into a single level (iLevel+1) segment and the +** level, they are merged into a single level (iLevel+1) segment and the ** allocated index is 0. ** ** If successful, *piIdx is set to the allocated index slot and SQLITE_OK ** returned. Otherwise, an SQLite error code is returned. */ static int fts3AllocateSegdirIdx( - Fts3Table *p, + Fts3Table *p, int iLangid, /* Language id */ int iIndex, /* Index for p->aIndex */ - int iLevel, + int iLevel, int *piIdx ){ int rc; /* Return Code */ @@ -1171,7 +1171,7 @@ static int fts3AllocateSegdirIdx( ** This function reads data from a single row of the %_segments table. The ** specific row is identified by the iBlockid parameter. If paBlob is not ** NULL, then a buffer is allocated using sqlite3_malloc() and populated -** with the contents of the blob stored in the "block" column of the +** with the contents of the blob stored in the "block" column of the ** identified table row is. Whether or not paBlob is NULL, *pnBlob is set ** to the size of the blob in bytes before returning. ** @@ -1248,14 +1248,14 @@ void sqlite3Fts3SegmentsClose(Fts3Table *p){ sqlite3_blob_close(p->pSegments); p->pSegments = 0; } - + static int fts3SegReaderIncrRead(Fts3SegReader *pReader){ int nRead; /* Number of bytes to read */ int rc; /* Return code */ nRead = MIN(pReader->nNode - pReader->nPopulate, FTS3_NODE_CHUNKSIZE); rc = sqlite3_blob_read( - pReader->pBlob, + pReader->pBlob, &pReader->aNode[pReader->nPopulate], nRead, pReader->nPopulate @@ -1275,10 +1275,10 @@ static int fts3SegReaderIncrRead(Fts3SegReader *pReader){ static int fts3SegReaderRequire(Fts3SegReader *pReader, char *pFrom, int nByte){ int rc = SQLITE_OK; - assert( !pReader->pBlob + assert( !pReader->pBlob || (pFrom>=pReader->aNode && pFrom<&pReader->aNode[pReader->nNode]) ); - while( pReader->pBlob && rc==SQLITE_OK + while( pReader->pBlob && rc==SQLITE_OK && (pFrom - pReader->aNode + nByte)>pReader->nPopulate ){ rc = fts3SegReaderIncrRead(pReader); @@ -1304,7 +1304,7 @@ static void fts3SegReaderSetEof(Fts3SegReader *pSeg){ ** SQLITE_DONE. Otherwise, an SQLite error code. */ static int fts3SegReaderNext( - Fts3Table *p, + Fts3Table *p, Fts3SegReader *pReader, int bIncr ){ @@ -1344,7 +1344,7 @@ static int fts3SegReaderNext( fts3SegReaderSetEof(pReader); - /* If iCurrentBlock>=iLeafEndBlock, this is an EOF condition. All leaf + /* If iCurrentBlock>=iLeafEndBlock, this is an EOF condition. All leaf ** blocks have already been traversed. */ assert( pReader->iCurrentBlock<=pReader->iLeafEndBlock ); if( pReader->iCurrentBlock>=pReader->iLeafEndBlock ){ @@ -1352,7 +1352,7 @@ static int fts3SegReaderNext( } rc = sqlite3Fts3ReadBlock( - p, ++pReader->iCurrentBlock, &pReader->aNode, &pReader->nNode, + p, ++pReader->iCurrentBlock, &pReader->aNode, &pReader->nNode, (bIncr ? &pReader->nPopulate : 0) ); if( rc!=SQLITE_OK ) return rc; @@ -1368,13 +1368,13 @@ static int fts3SegReaderNext( rc = fts3SegReaderRequire(pReader, pNext, FTS3_VARINT_MAX*2); if( rc!=SQLITE_OK ) return rc; - - /* Because of the FTS3_NODE_PADDING bytes of padding, the following is + + /* Because of the FTS3_NODE_PADDING bytes of padding, the following is ** safe (no risk of overread) even if the node data is corrupted. */ pNext += fts3GetVarint32(pNext, &nPrefix); pNext += fts3GetVarint32(pNext, &nSuffix); - if( nPrefix<0 || nSuffix<=0 - || &pNext[nSuffix]>&pReader->aNode[pReader->nNode] + if( nPrefix<0 || nSuffix<=0 + || &pNext[nSuffix]>&pReader->aNode[pReader->nNode] ){ return FTS_CORRUPT_VTAB; } @@ -1400,10 +1400,10 @@ static int fts3SegReaderNext( pReader->pOffsetList = 0; /* Check that the doclist does not appear to extend past the end of the - ** b-tree node. And that the final byte of the doclist is 0x00. If either + ** b-tree node. And that the final byte of the doclist is 0x00. If either ** of these statements is untrue, then the data structure is corrupt. */ - if( &pReader->aDoclist[pReader->nDoclist]>&pReader->aNode[pReader->nNode] + if( &pReader->aDoclist[pReader->nDoclist]>&pReader->aNode[pReader->nNode] || (pReader->nPopulate==0 && pReader->aDoclist[pReader->nDoclist-1]) ){ return FTS_CORRUPT_VTAB; @@ -1424,7 +1424,7 @@ static int fts3SegReaderFirstDocid(Fts3Table *pTab, Fts3SegReader *pReader){ pReader->iDocid = 0; pReader->nOffsetList = 0; sqlite3Fts3DoclistPrev(0, - pReader->aDoclist, pReader->nDoclist, &pReader->pOffsetList, + pReader->aDoclist, pReader->nDoclist, &pReader->pOffsetList, &pReader->iDocid, &pReader->nOffsetList, &bEof ); }else{ @@ -1440,8 +1440,8 @@ static int fts3SegReaderFirstDocid(Fts3Table *pTab, Fts3SegReader *pReader){ /* ** Advance the SegReader to point to the next docid in the doclist ** associated with the current term. -** -** If arguments ppOffsetList and pnOffsetList are not NULL, then +** +** If arguments ppOffsetList and pnOffsetList are not NULL, then ** *ppOffsetList is set to point to the first column-offset list ** in the doclist entry (i.e. immediately past the docid varint). ** *pnOffsetList is set to the length of the set of column-offset @@ -1484,22 +1484,22 @@ static int fts3SegReaderNextDocid( ** following block advances it to point one byte past the end of ** the same offset list. */ while( 1 ){ - + /* The following line of code (and the "p++" below the while() loop) is - ** normally all that is required to move pointer p to the desired + ** normally all that is required to move pointer p to the desired ** position. The exception is if this node is being loaded from disk ** incrementally and pointer "p" now points to the first byte past ** the populated part of pReader->aNode[]. */ while( *p | c ) c = *p++ & 0x80; assert( *p==0 ); - + if( pReader->pBlob==0 || p<&pReader->aNode[pReader->nPopulate] ) break; rc = fts3SegReaderIncrRead(pReader); if( rc!=SQLITE_OK ) return rc; } p++; - + /* If required, populate the output variables with a pointer to and the ** size of the previous offset-list. */ @@ -1510,7 +1510,7 @@ static int fts3SegReaderNextDocid( /* List may have been edited in place by fts3EvalNearTrim() */ while( pnSegment; ii++){ Fts3SegReader *pReader = pMsr->apSegment[ii]; - if( !fts3SegReaderIsPending(pReader) - && !fts3SegReaderIsRootOnly(pReader) + if( !fts3SegReaderIsPending(pReader) + && !fts3SegReaderIsRootOnly(pReader) ){ sqlite3_int64 jj; for(jj=pReader->iStartBlock; jj<=pReader->iLeafEndBlock; jj++){ @@ -1571,7 +1571,7 @@ int sqlite3Fts3MsrOvfl( } /* -** Free all allocations associated with the iterator passed as the +** Free all allocations associated with the iterator passed as the ** second argument. */ void sqlite3Fts3SegReaderFree(Fts3SegReader *pReader){ @@ -1725,7 +1725,7 @@ int sqlite3Fts3SegReaderPending( }else{ /* The query is a simple term lookup that matches at most one term in - ** the index. All that is required is a straight hash-lookup. + ** the index. All that is required is a straight hash-lookup. ** ** Because the stack address of pE may be accessed via the aElem pointer ** below, the "Fts3HashElem *pE" must be declared so that it is valid @@ -1759,7 +1759,7 @@ int sqlite3Fts3SegReaderPending( } /* -** Compare the entries pointed to by two Fts3SegReader structures. +** Compare the entries pointed to by two Fts3SegReader structures. ** Comparison is as follows: ** ** 1) EOF is greater than not EOF. @@ -1830,7 +1830,7 @@ static int fts3SegReaderDoclistCmpRev(Fts3SegReader *pLhs, Fts3SegReader *pRhs){ /* ** Compare the term that the Fts3SegReader object passed as the first argument -** points to with the term specified by arguments zTerm and nTerm. +** points to with the term specified by arguments zTerm and nTerm. ** ** If the pSeg iterator is already at EOF, return 0. Otherwise, return ** -ve if the pSeg term is less than zTerm/nTerm, 0 if the two terms are @@ -1891,7 +1891,7 @@ static void fts3SegReaderSort( #endif } -/* +/* ** Insert a record into the %_segments table. */ static int fts3WriteSegment( @@ -1932,7 +1932,7 @@ int sqlite3Fts3MaxLevel(Fts3Table *p, int *pnMax){ return rc; } -/* +/* ** Insert a record into the %_segdir table. */ static int fts3WriteSegdir( @@ -1969,7 +1969,7 @@ static int fts3WriteSegdir( /* ** Return the size of the common prefix (if any) shared by zPrev and -** zNext, in bytes. For example, +** zNext, in bytes. For example, ** ** fts3PrefixCompress("abc", 3, "abcdef", 6) // returns 3 ** fts3PrefixCompress("abX", 3, "abcdef", 6) // returns 2 @@ -1993,7 +1993,7 @@ static int fts3PrefixCompress( */ static int fts3NodeAddTerm( Fts3Table *p, /* Virtual table handle */ - SegmentNode **ppTree, /* IN/OUT: SegmentNode handle */ + SegmentNode **ppTree, /* IN/OUT: SegmentNode handle */ int isCopyTerm, /* True if zTerm/nTerm is transient */ const char *zTerm, /* Pointer to buffer containing term */ int nTerm /* Size of term in bytes */ @@ -2002,7 +2002,7 @@ static int fts3NodeAddTerm( int rc; SegmentNode *pNew; - /* First try to append the term to the current node. Return early if + /* First try to append the term to the current node. Return early if ** this is possible. */ if( pTree ){ @@ -2022,8 +2022,8 @@ static int fts3NodeAddTerm( ** and the static node buffer (p->nNodeSize bytes) is not large ** enough. Use a separately malloced buffer instead This wastes ** p->nNodeSize bytes, but since this scenario only comes about when - ** the database contain two terms that share a prefix of almost 2KB, - ** this is not expected to be a serious problem. + ** the database contain two terms that share a prefix of almost 2KB, + ** this is not expected to be a serious problem. */ assert( pTree->aData==(char *)&pTree[1] ); pTree->aData = (char *)sqlite3_malloc(nReq); @@ -2067,7 +2067,7 @@ static int fts3NodeAddTerm( ** If this is the first node in the tree, the term is added to it. ** ** Otherwise, the term is not added to the new node, it is left empty for - ** now. Instead, the term is inserted into the parent of pTree. If pTree + ** now. Instead, the term is inserted into the parent of pTree. If pTree ** has no parent, one is created here. */ pNew = (SegmentNode *)sqlite3_malloc(sizeof(SegmentNode) + p->nNodeSize); @@ -2092,7 +2092,7 @@ static int fts3NodeAddTerm( pTree->zMalloc = 0; }else{ pNew->pLeftmost = pNew; - rc = fts3NodeAddTerm(p, &pNew, isCopyTerm, zTerm, nTerm); + rc = fts3NodeAddTerm(p, &pNew, isCopyTerm, zTerm, nTerm); } *ppTree = pNew; @@ -2103,8 +2103,8 @@ static int fts3NodeAddTerm( ** Helper function for fts3NodeWrite(). */ static int fts3TreeFinishNode( - SegmentNode *pTree, - int iHeight, + SegmentNode *pTree, + int iHeight, sqlite3_int64 iLeftChild ){ int nStart; @@ -2117,15 +2117,15 @@ static int fts3TreeFinishNode( /* ** Write the buffer for the segment node pTree and all of its peers to the -** database. Then call this function recursively to write the parent of -** pTree and its peers to the database. +** database. Then call this function recursively to write the parent of +** pTree and its peers to the database. ** ** Except, if pTree is a root node, do not write it to the database. Instead, ** set output variables *paRoot and *pnRoot to contain the root node. ** ** If successful, SQLITE_OK is returned and output variable *piLast is ** set to the largest blockid written to the database (or zero if no -** blocks were written to the db). Otherwise, an SQLite error code is +** blocks were written to the db). Otherwise, an SQLite error code is ** returned. */ static int fts3NodeWrite( @@ -2153,7 +2153,7 @@ static int fts3NodeWrite( for(pIter=pTree->pLeftmost; pIter && rc==SQLITE_OK; pIter=pIter->pRight){ int nStart = fts3TreeFinishNode(pIter, iHeight, iNextLeaf); int nWrite = pIter->nData - nStart; - + rc = fts3WriteSegment(p, iNextFree, &pIter->aData[nStart], nWrite); iNextFree++; iNextLeaf += (pIter->nEntry+1); @@ -2199,7 +2199,7 @@ static void fts3NodeFree(SegmentNode *pTree){ */ static int fts3SegWriterAdd( Fts3Table *p, /* Virtual table handle */ - SegmentWriter **ppWriter, /* IN/OUT: SegmentWriter handle */ + SegmentWriter **ppWriter, /* IN/OUT: SegmentWriter handle */ int isCopyTerm, /* True if buffer zTerm must be copied */ const char *zTerm, /* Pointer to buffer containing term */ int nTerm, /* Size of term in bytes */ @@ -2359,12 +2359,12 @@ static int fts3SegWriterFlush( pWriter->iFirst, pWriter->iFree, &iLast, &zRoot, &nRoot); } if( rc==SQLITE_OK ){ - rc = fts3WriteSegdir(p, iLevel, iIdx, + rc = fts3WriteSegdir(p, iLevel, iIdx, pWriter->iFirst, iLastLeaf, iLast, pWriter->nLeafData, zRoot, nRoot); } }else{ /* The entire tree fits on the root node. Write it to the segdir table. */ - rc = fts3WriteSegdir(p, iLevel, iIdx, + rc = fts3WriteSegdir(p, iLevel, iIdx, 0, 0, 0, pWriter->nLeafData, pWriter->aData, pWriter->nData); } p->nLeafAdd++; @@ -2372,7 +2372,7 @@ static int fts3SegWriterFlush( } /* -** Release all memory held by the SegmentWriter object passed as the +** Release all memory held by the SegmentWriter object passed as the ** first argument. */ static void fts3SegWriterFree(SegmentWriter *pWriter){ @@ -2422,9 +2422,9 @@ static int fts3IsEmpty(Fts3Table *p, sqlite3_value *pRowid, int *pisEmpty){ ** Return SQLITE_OK if successful, or an SQLite error code if not. */ static int fts3SegmentMaxLevel( - Fts3Table *p, + Fts3Table *p, int iLangid, - int iIndex, + int iIndex, sqlite3_int64 *pnMax ){ sqlite3_stmt *pStmt; @@ -2440,7 +2440,7 @@ static int fts3SegmentMaxLevel( rc = fts3SqlStmt(p, SQL_SELECT_SEGDIR_MAX_LEVEL, &pStmt, 0); if( rc!=SQLITE_OK ) return rc; sqlite3_bind_int64(pStmt, 1, getAbsoluteLevel(p, iLangid, iIndex, 0)); - sqlite3_bind_int64(pStmt, 2, + sqlite3_bind_int64(pStmt, 2, getAbsoluteLevel(p, iLangid, iIndex, FTS3_SEGDIR_MAXLEVEL-1) ); if( SQLITE_ROW==sqlite3_step(pStmt) ){ @@ -2469,7 +2469,7 @@ static int fts3SegmentIsMaxLevel(Fts3Table *p, i64 iAbsLevel, int *pbMax){ int rc = fts3SqlStmt(p, SQL_SELECT_SEGDIR_MAX_LEVEL, &pStmt, 0); if( rc!=SQLITE_OK ) return rc; sqlite3_bind_int64(pStmt, 1, iAbsLevel+1); - sqlite3_bind_int64(pStmt, 2, + sqlite3_bind_int64(pStmt, 2, ((iAbsLevel/FTS3_SEGDIR_MAXLEVEL)+1) * FTS3_SEGDIR_MAXLEVEL ); @@ -2507,9 +2507,9 @@ static int fts3DeleteSegment( ** This function is used after merging multiple segments into a single large ** segment to delete the old, now redundant, segment b-trees. Specifically, ** it: -** -** 1) Deletes all %_segments entries for the segments associated with -** each of the SegReader objects in the array passed as the third +** +** 1) Deletes all %_segments entries for the segments associated with +** each of the SegReader objects in the array passed as the third ** argument, and ** ** 2) deletes all %_segdir entries with level iLevel, or all %_segdir @@ -2541,7 +2541,7 @@ static int fts3DeleteSegdir( rc = fts3SqlStmt(p, SQL_DELETE_SEGDIR_RANGE, &pDelete, 0); if( rc==SQLITE_OK ){ sqlite3_bind_int64(pDelete, 1, getAbsoluteLevel(p, iLangid, iIndex, 0)); - sqlite3_bind_int64(pDelete, 2, + sqlite3_bind_int64(pDelete, 2, getAbsoluteLevel(p, iLangid, iIndex, FTS3_SEGDIR_MAXLEVEL-1) ); } @@ -2563,7 +2563,7 @@ static int fts3DeleteSegdir( } /* -** When this function is called, buffer *ppList (size *pnList bytes) contains +** When this function is called, buffer *ppList (size *pnList bytes) contains ** a position list that may (or may not) feature multiple columns. This ** function adjusts the pointer *ppList and the length *pnList so that they ** identify the subset of the position list that corresponds to column iCol. @@ -2590,7 +2590,7 @@ static void fts3ColumnFilter( while( 1 ){ char c = 0; while( ppOffsetList && apSegment[j]->iDocid==iDocid @@ -2713,7 +2713,7 @@ static int fts3SegReaderStart( int i; int nSeg = pCsr->nSegment; - /* If the Fts3SegFilter defines a specific term (or term prefix) to search + /* If the Fts3SegFilter defines a specific term (or term prefix) to search ** for, then advance each segment iterator until it points to a term of ** equal or greater value than the specified term. This prevents many ** unnecessary merge/sort operations for the case where single segment @@ -2797,7 +2797,7 @@ int sqlite3Fts3MsrIncrStart( ** sqlite3Fts3SegReaderStart() ** sqlite3Fts3SegReaderStep() ** -** then the entire doclist for the term is available in +** then the entire doclist for the term is available in ** MultiSegReader.aDoclist/nDoclist. */ int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr){ @@ -2845,9 +2845,9 @@ int sqlite3Fts3SegReaderStep( do { int nMerge; int i; - + /* Advance the first pCsr->nAdvance entries in the apSegment[] array - ** forward. Then sort the list in order of current term again. + ** forward. Then sort the list in order of current term again. */ for(i=0; inAdvance; i++){ Fts3SegReader *pSeg = apSegment[i]; @@ -2869,34 +2869,34 @@ int sqlite3Fts3SegReaderStep( pCsr->zTerm = apSegment[0]->zTerm; /* If this is a prefix-search, and if the term that apSegment[0] points - ** to does not share a suffix with pFilter->zTerm/nTerm, then all + ** to does not share a suffix with pFilter->zTerm/nTerm, then all ** required callbacks have been made. In this case exit early. ** ** Similarly, if this is a search for an exact match, and the first term ** of segment apSegment[0] is not a match, exit early. */ if( pFilter->zTerm && !isScan ){ - if( pCsr->nTermnTerm + if( pCsr->nTermnTerm || (!isPrefix && pCsr->nTerm>pFilter->nTerm) - || memcmp(pCsr->zTerm, pFilter->zTerm, pFilter->nTerm) + || memcmp(pCsr->zTerm, pFilter->zTerm, pFilter->nTerm) ){ break; } } nMerge = 1; - while( nMergeaNode - && apSegment[nMerge]->nTerm==pCsr->nTerm + && apSegment[nMerge]->nTerm==pCsr->nTerm && 0==memcmp(pCsr->zTerm, apSegment[nMerge]->zTerm, pCsr->nTerm) ){ nMerge++; } assert( isIgnoreEmpty || (isRequirePos && !isColFilter) ); - if( nMerge==1 - && !isIgnoreEmpty - && !isFirst + if( nMerge==1 + && !isIgnoreEmpty + && !isFirst && (p->bDescIdx==0 || fts3SegReaderIsPending(apSegment[0])==0) ){ pCsr->nDoclist = apSegment[0]->nDoclist; @@ -2941,7 +2941,7 @@ int sqlite3Fts3SegReaderStep( if( !isIgnoreEmpty || nList>0 ){ - /* Calculate the 'docid' delta value to write into the merged + /* Calculate the 'docid' delta value to write into the merged ** doclist. */ sqlite3_int64 iDelta; if( p->bDescIdx && nDoclist>0 ){ @@ -2966,7 +2966,7 @@ int sqlite3Fts3SegReaderStep( if( isFirst ){ char *a = &pCsr->aBuffer[nDoclist]; int nWrite; - + nWrite = sqlite3Fts3FirstFilter(iDelta, pList, nList, a); if( nWrite ){ iPrev = iDocid; @@ -3016,18 +3016,18 @@ void sqlite3Fts3SegReaderFinish( } /* -** Decode the "end_block" field, selected by column iCol of the SELECT -** statement passed as the first argument. +** Decode the "end_block" field, selected by column iCol of the SELECT +** statement passed as the first argument. ** ** The "end_block" field may contain either an integer, or a text field -** containing the text representation of two non-negative integers separated -** by one or more space (0x20) characters. In the first case, set *piEndBlock -** to the integer value and *pnByte to zero before returning. In the second, +** containing the text representation of two non-negative integers separated +** by one or more space (0x20) characters. In the first case, set *piEndBlock +** to the integer value and *pnByte to zero before returning. In the second, ** set *piEndBlock to the first value and *pnByte to the second. */ static void fts3ReadEndBlockField( - sqlite3_stmt *pStmt, - int iCol, + sqlite3_stmt *pStmt, + int iCol, i64 *piEndBlock, i64 *pnByte ){ @@ -3073,10 +3073,10 @@ static int fts3PromoteSegments( i64 iLast = (iAbsLevel/FTS3_SEGDIR_MAXLEVEL + 1) * FTS3_SEGDIR_MAXLEVEL - 1; i64 nLimit = (nByte*3)/2; - /* Loop through all entries in the %_segdir table corresponding to + /* Loop through all entries in the %_segdir table corresponding to ** segments in this index on levels greater than iAbsLevel. If there is - ** at least one such segment, and it is possible to determine that all - ** such segments are smaller than nLimit bytes in size, they will be + ** at least one such segment, and it is possible to determine that all + ** such segments are smaller than nLimit bytes in size, they will be ** promoted to level iAbsLevel. */ sqlite3_bind_int64(pRange, 1, iAbsLevel+1); sqlite3_bind_int64(pRange, 2, iLast); @@ -3084,7 +3084,7 @@ static int fts3PromoteSegments( i64 nSize = 0, dummy; fts3ReadEndBlockField(pRange, 2, &dummy, &nSize); if( nSize<=0 || nSize>nLimit ){ - /* If nSize==0, then the %_segdir.end_block field does not not + /* If nSize==0, then the %_segdir.end_block field does not not ** contain a size value. This happens if it was written by an ** old version of FTS. In this case it is not possible to determine ** the size of the segment, and so segment promotion does not @@ -3150,18 +3150,18 @@ static int fts3PromoteSegments( } /* -** Merge all level iLevel segments in the database into a single +** Merge all level iLevel segments in the database into a single ** iLevel+1 segment. Or, if iLevel<0, merge all segments into a -** single segment with a level equal to the numerically largest level +** single segment with a level equal to the numerically largest level ** currently present in the database. ** ** If this function is called with iLevel<0, but there is only one -** segment in the database, SQLITE_DONE is returned immediately. -** Otherwise, if successful, SQLITE_OK is returned. If an error occurs, +** segment in the database, SQLITE_DONE is returned immediately. +** Otherwise, if successful, SQLITE_OK is returned. If an error occurs, ** an SQLite error code is returned. */ static int fts3SegmentMerge( - Fts3Table *p, + Fts3Table *p, int iLangid, /* Language id to merge */ int iIndex, /* Index in p->aIndex[] to merge */ int iLevel /* Level to merge */ @@ -3205,7 +3205,7 @@ static int fts3SegmentMerge( }else{ /* This call is to merge all segments at level iLevel. find the next ** available segment index at level iLevel+1. The call to - ** fts3AllocateSegdirIdx() will merge the segments at level iLevel+1 to + ** fts3AllocateSegdirIdx() will merge the segments at level iLevel+1 to ** a single iLevel+2 segment if necessary. */ assert( FTS3_SEGCURSOR_PENDING==-1 ); iNewLevel = getAbsoluteLevel(p, iLangid, iIndex, iLevel+1); @@ -3226,7 +3226,7 @@ static int fts3SegmentMerge( while( SQLITE_OK==rc ){ rc = sqlite3Fts3SegReaderStep(p, &csr); if( rc!=SQLITE_ROW ) break; - rc = fts3SegWriterAdd(p, &pWriter, 1, + rc = fts3SegWriterAdd(p, &pWriter, 1, csr.zTerm, csr.nTerm, csr.aDoclist, csr.nDoclist); } if( rc!=SQLITE_OK ) goto finished; @@ -3254,13 +3254,13 @@ static int fts3SegmentMerge( } -/* -** Flush the contents of pendingTerms to level 0 segments. +/* +** Flush the contents of pendingTerms to level 0 segments. */ int sqlite3Fts3PendingTermsFlush(Fts3Table *p){ int rc = SQLITE_OK; int i; - + for(i=0; rc==SQLITE_OK && inIndex; i++){ rc = fts3SegmentMerge(p, p->iPrevLangid, i, FTS3_SEGCURSOR_PENDING); if( rc==SQLITE_DONE ) rc = SQLITE_OK; @@ -3362,7 +3362,7 @@ static void fts3InsertDocsize( /* ** Record 0 of the %_stat table contains a blob consisting of N varints, ** where N is the number of user defined columns in the fts3 table plus -** two. If nCol is the number of user defined columns, then values of the +** two. If nCol is the number of user defined columns, then values of the ** varints are set as follows: ** ** Varint 0: Total number of rows in the table. @@ -3446,7 +3446,7 @@ static void fts3UpdateDocTotals( } /* -** Merge the entire database so that there is one segment for each +** Merge the entire database so that there is one segment for each ** iIndex/iLangid combination. */ static int fts3DoOptimize(Fts3Table *p, int bReturnDone){ @@ -3485,7 +3485,7 @@ static int fts3DoOptimize(Fts3Table *p, int bReturnDone){ ** ** INSERT INTO () VALUES('rebuild'); ** -** The entire FTS index is discarded and rebuilt. If the table is one +** The entire FTS index is discarded and rebuilt. If the table is one ** created using the content=xxx option, then the new index is based on ** the current contents of the xxx table. Otherwise, it is rebuilt based ** on the contents of the %_content table. @@ -3565,9 +3565,9 @@ static int fts3DoRebuild(Fts3Table *p){ /* -** This function opens a cursor used to read the input data for an +** This function opens a cursor used to read the input data for an ** incremental merge operation. Specifically, it opens a cursor to scan -** the oldest nSeg segments (idx=0 through idx=(nSeg-1)) in absolute +** the oldest nSeg segments (idx=0 through idx=(nSeg-1)) in absolute ** level iAbsLevel. */ static int fts3IncrmergeCsr( @@ -3577,7 +3577,7 @@ static int fts3IncrmergeCsr( Fts3MultiSegReader *pCsr /* Cursor object to populate */ ){ int rc; /* Return Code */ - sqlite3_stmt *pStmt = 0; /* Statement used to read %_segdir entry */ + sqlite3_stmt *pStmt = 0; /* Statement used to read %_segdir entry */ int nByte; /* Bytes allocated at pCsr->apSegment[] */ /* Allocate space for the Fts3MultiSegReader.aCsr[] array */ @@ -3632,7 +3632,7 @@ struct Blob { }; /* -** This structure is used to build up buffers containing segment b-tree +** This structure is used to build up buffers containing segment b-tree ** nodes (blocks). */ struct NodeWriter { @@ -3701,12 +3701,12 @@ static void blobGrowBuffer(Blob *pBlob, int nMin, int *pRc){ /* ** Attempt to advance the node-reader object passed as the first argument to -** the next entry on the node. +** the next entry on the node. ** -** Return an error code if an error occurs (SQLITE_NOMEM is possible). +** Return an error code if an error occurs (SQLITE_NOMEM is possible). ** Otherwise return SQLITE_OK. If there is no next entry on the node ** (e.g. because the current entry is the last) set NodeReader->aNode to -** NULL to indicate EOF. Otherwise, populate the NodeReader structure output +** NULL to indicate EOF. Otherwise, populate the NodeReader structure output ** variables for the new entry. */ static int nodeReaderNext(NodeReader *p){ @@ -3754,7 +3754,7 @@ static void nodeReaderRelease(NodeReader *p){ /* ** Initialize a node-reader object to read the node in buffer aNode/nNode. ** -** If successful, SQLITE_OK is returned and the NodeReader object set to +** If successful, SQLITE_OK is returned and the NodeReader object set to ** point to the first entry on the node (if any). Otherwise, an SQLite ** error code is returned. */ @@ -3803,7 +3803,7 @@ static int fts3IncrmergePush( int nSpace; /* Figure out how much space the key will consume if it is written to - ** the current node of layer iLayer. Due to the prefix compression, + ** the current node of layer iLayer. Due to the prefix compression, ** the space required changes depending on which node the key is to ** be added to. */ nPrefix = fts3PrefixCompress(pNode->key.a, pNode->key.n, zTerm, nTerm); @@ -3811,9 +3811,9 @@ static int fts3IncrmergePush( nSpace = sqlite3Fts3VarintLen(nPrefix); nSpace += sqlite3Fts3VarintLen(nSuffix) + nSuffix; - if( pNode->key.n==0 || (pNode->block.n + nSpace)<=p->nNodeSize ){ + if( pNode->key.n==0 || (pNode->block.n + nSpace)<=p->nNodeSize ){ /* If the current node of layer iLayer contains zero keys, or if adding - ** the key to it will not cause it to grow to larger than nNodeSize + ** the key to it will not cause it to grow to larger than nNodeSize ** bytes in size, write the key here. */ Blob *pBlk = &pNode->block; @@ -3869,12 +3869,12 @@ static int fts3IncrmergePush( ** A node header is a single 0x00 byte for a leaf node, or a height varint ** followed by the left-hand-child varint for an internal node. ** -** The term to be appended is passed via arguments zTerm/nTerm. For a +** The term to be appended is passed via arguments zTerm/nTerm. For a ** leaf node, the doclist is passed as aDoclist/nDoclist. For an internal ** node, both aDoclist and nDoclist must be passed 0. ** ** If the size of the value in blob pPrev is zero, then this is the first -** term written to the node. Otherwise, pPrev contains a copy of the +** term written to the node. Otherwise, pPrev contains a copy of the ** previous term. Before this function returns, it is updated to contain a ** copy of zTerm/nTerm. ** @@ -3891,7 +3891,7 @@ static int fts3AppendToNode( const char *zTerm, /* New term to write */ int nTerm, /* Size of zTerm in bytes */ const char *aDoclist, /* Doclist (or NULL) to write */ - int nDoclist /* Size of aDoclist in bytes */ + int nDoclist /* Size of aDoclist in bytes */ ){ int rc = SQLITE_OK; /* Return code */ int bFirst = (pPrev->n==0); /* True if this is the first term written */ @@ -3965,7 +3965,7 @@ static int fts3IncrmergeAppend( rc = fts3WriteSegment(p, pLeaf->iBlock, pLeaf->block.a, pLeaf->block.n); pWriter->nWork++; - /* Add the current term to the parent node. The term added to the + /* Add the current term to the parent node. The term added to the ** parent must: ** ** a) be greater than the largest term on the leaf node just written @@ -4030,7 +4030,7 @@ static void fts3IncrmergeRelease( NodeWriter *pRoot; /* NodeWriter for root node */ int rc = *pRc; /* Error code */ - /* Set iRoot to the index in pWriter->aNodeWriter[] of the output segment + /* Set iRoot to the index in pWriter->aNodeWriter[] of the output segment ** root node. If the segment fits entirely on a single leaf node, iRoot ** will be set to 0. If the root node is the parent of the leaves, iRoot ** will be 1. And so on. */ @@ -4048,17 +4048,17 @@ static void fts3IncrmergeRelease( /* The entire output segment fits on a single node. Normally, this means ** the node would be stored as a blob in the "root" column of the %_segdir - ** table. However, this is not permitted in this case. The problem is that - ** space has already been reserved in the %_segments table, and so the - ** start_block and end_block fields of the %_segdir table must be populated. - ** And, by design or by accident, released versions of FTS cannot handle + ** table. However, this is not permitted in this case. The problem is that + ** space has already been reserved in the %_segments table, and so the + ** start_block and end_block fields of the %_segdir table must be populated. + ** And, by design or by accident, released versions of FTS cannot handle ** segments that fit entirely on the root node with start_block!=0. ** - ** Instead, create a synthetic root node that contains nothing but a + ** Instead, create a synthetic root node that contains nothing but a ** pointer to the single content node. So that the segment consists of a ** single leaf and a single interior (root) node. ** - ** Todo: Better might be to defer allocating space in the %_segments + ** Todo: Better might be to defer allocating space in the %_segments ** table until we are sure it is needed. */ if( iRoot==0 ){ @@ -4086,7 +4086,7 @@ static void fts3IncrmergeRelease( /* Write the %_segdir record. */ if( rc==SQLITE_OK ){ - rc = fts3WriteSegdir(p, + rc = fts3WriteSegdir(p, pWriter->iAbsLevel+1, /* level */ pWriter->iIdx, /* idx */ pWriter->iStart, /* start_block */ @@ -4125,11 +4125,11 @@ static int fts3TermCmp( /* -** Query to see if the entry in the %_segments table with blockid iEnd is +** Query to see if the entry in the %_segments table with blockid iEnd is ** NULL. If no error occurs and the entry is NULL, set *pbRes 1 before -** returning. Otherwise, set *pbRes to 0. +** returning. Otherwise, set *pbRes to 0. ** -** Or, if an error occurs while querying the database, return an SQLite +** Or, if an error occurs while querying the database, return an SQLite ** error code. The final value of *pbRes is undefined in this case. ** ** This is used to test if a segment is an "appendable" segment. If it @@ -4147,14 +4147,14 @@ static int fts3IsAppendable(Fts3Table *p, sqlite3_int64 iEnd, int *pbRes){ if( SQLITE_ROW==sqlite3_step(pCheck) ) bRes = 1; rc = sqlite3_reset(pCheck); } - + *pbRes = bRes; return rc; } /* ** This function is called when initializing an incremental-merge operation. -** It checks if the existing segment with index value iIdx at absolute level +** It checks if the existing segment with index value iIdx at absolute level ** (iAbsLevel+1) can be appended to by the incremental merge. If it can, the ** merge-writer object *pWriter is initialized to write to it. ** @@ -4163,7 +4163,7 @@ static int fts3IsAppendable(Fts3Table *p, sqlite3_int64 iEnd, int *pbRes){ ** * It was initially created as an appendable segment (with all required ** space pre-allocated), and ** -** * The first key read from the input (arguments zKey and nKey) is +** * The first key read from the input (arguments zKey and nKey) is ** greater than the largest key currently stored in the potential ** output segment. */ @@ -4293,13 +4293,13 @@ static int fts3IncrmergeLoad( /* ** Determine the largest segment index value that exists within absolute ** level iAbsLevel+1. If no error occurs, set *piIdx to this value plus -** one before returning SQLITE_OK. Or, if there are no segments at all +** one before returning SQLITE_OK. Or, if there are no segments at all ** within level iAbsLevel, set *piIdx to zero. ** ** If an error occurs, return an SQLite error code. The final value of ** *piIdx is undefined in this case. */ -static int fts3IncrmergeOutputIdx( +static int fts3IncrmergeOutputIdx( Fts3Table *p, /* FTS Table handle */ sqlite3_int64 iAbsLevel, /* Absolute index of input segments */ int *piIdx /* OUT: Next free index at iAbsLevel+1 */ @@ -4318,7 +4318,7 @@ static int fts3IncrmergeOutputIdx( return rc; } -/* +/* ** Allocate an appendable output segment on absolute level iAbsLevel+1 ** with idx value iIdx. ** @@ -4332,7 +4332,7 @@ static int fts3IncrmergeOutputIdx( ** When an appendable segment is allocated, it is estimated that the ** maximum number of leaf blocks that may be required is the sum of the ** number of leaf blocks consumed by the input segments, plus the number -** of input segments, multiplied by two. This value is stored in stack +** of input segments, multiplied by two. This value is stored in stack ** variable nLeafEst. ** ** A total of 16*nLeafEst blocks are allocated when an appendable segment @@ -4341,10 +4341,10 @@ static int fts3IncrmergeOutputIdx( ** of interior nodes that are parents of the leaf nodes start at block ** (start_block + (1 + end_block - start_block) / 16). And so on. ** -** In the actual code below, the value "16" is replaced with the +** In the actual code below, the value "16" is replaced with the ** pre-processor macro FTS_MAX_APPENDABLE_HEIGHT. */ -static int fts3IncrmergeWriter( +static int fts3IncrmergeWriter( Fts3Table *p, /* Fts3 table handle */ sqlite3_int64 iAbsLevel, /* Absolute level of input segments */ int iIdx, /* Index of new output segment */ @@ -4382,7 +4382,7 @@ static int fts3IncrmergeWriter( if( rc!=SQLITE_OK ) return rc; /* Insert the marker in the %_segments table to make sure nobody tries - ** to steal the space just allocated. This is also used to identify + ** to steal the space just allocated. This is also used to identify ** appendable segments. */ rc = fts3WriteSegment(p, pWriter->iEnd, 0, 0); if( rc!=SQLITE_OK ) return rc; @@ -4399,13 +4399,13 @@ static int fts3IncrmergeWriter( } /* -** Remove an entry from the %_segdir table. This involves running the +** Remove an entry from the %_segdir table. This involves running the ** following two statements: ** ** DELETE FROM %_segdir WHERE level = :iAbsLevel AND idx = :iIdx ** UPDATE %_segdir SET idx = idx - 1 WHERE level = :iAbsLevel AND idx > :iIdx ** -** The DELETE statement removes the specific %_segdir level. The UPDATE +** The DELETE statement removes the specific %_segdir level. The UPDATE ** statement ensures that the remaining segments have contiguously allocated ** idx values. */ @@ -4527,8 +4527,8 @@ static int fts3TruncateNode( pNew->n = 0; /* Populate new node buffer */ - for(rc = nodeReaderInit(&reader, aNode, nNode); - rc==SQLITE_OK && reader.aNode; + for(rc = nodeReaderInit(&reader, aNode, nNode); + rc==SQLITE_OK && reader.aNode; rc = nodeReaderNext(&reader) ){ if( pNew->n==0 ){ @@ -4555,7 +4555,7 @@ static int fts3TruncateNode( } /* -** Remove all terms smaller than zTerm/nTerm from segment iIdx in absolute +** Remove all terms smaller than zTerm/nTerm from segment iIdx in absolute ** level iAbsLevel. This may involve deleting entries from the %_segments ** table, and modifying existing entries in both the %_segments and %_segdir ** tables. @@ -4678,9 +4678,9 @@ static int fts3IncrmergeChomp( } *pnRem = 0; }else{ - /* The incremental merge did not copy all the data from this + /* The incremental merge did not copy all the data from this ** segment to the upper level. The segment is modified in place - ** so that it contains no keys smaller than zTerm/nTerm. */ + ** so that it contains no keys smaller than zTerm/nTerm. */ const char *zTerm = pSeg->zTerm; int nTerm = pSeg->nTerm; rc = fts3TruncateSegment(p, iAbsLevel, pSeg->iIdx, zTerm, nTerm); @@ -4715,7 +4715,7 @@ static int fts3IncrmergeHintStore(Fts3Table *p, Blob *pHint){ } /* -** Load an incr-merge hint from the database. The incr-merge hint, if one +** Load an incr-merge hint from the database. The incr-merge hint, if one ** exists, is stored in the rowid==1 row of the %_stat table. ** ** If successful, populate blob *pHint with the value read from the %_stat @@ -4752,7 +4752,7 @@ static int fts3IncrmergeHintLoad(Fts3Table *p, Blob *pHint){ /* ** If *pRc is not SQLITE_OK when this function is called, it is a no-op. ** Otherwise, append an entry to the hint stored in blob *pHint. Each entry -** consists of two varints, the absolute level number of the input segments +** consists of two varints, the absolute level number of the input segments ** and the number of input segments. ** ** If successful, leave *pRc set to SQLITE_OK and return. If an error occurs, @@ -4773,7 +4773,7 @@ static void fts3IncrmergeHintPush( /* ** Read the last entry (most recently pushed) from the hint blob *pHint -** and then remove the entry. Write the two values read to *piAbsLevel and +** and then remove the entry. Write the two values read to *piAbsLevel and ** *pnInput before returning. ** ** If no error occurs, return SQLITE_OK. If the hint blob in *pHint does @@ -4799,10 +4799,10 @@ static int fts3IncrmergeHintPop(Blob *pHint, i64 *piAbsLevel, int *pnInput){ /* ** Attempt an incremental merge that writes nMerge leaf blocks. ** -** Incremental merges happen nMin segments at a time. The segments -** to be merged are the nMin oldest segments (the ones with the smallest -** values for the _segdir.idx field) in the highest level that contains -** at least nMin segments. Multiple merges might occur in an attempt to +** Incremental merges happen nMin segments at a time. The segments +** to be merged are the nMin oldest segments (the ones with the smallest +** values for the _segdir.idx field) in the highest level that contains +** at least nMin segments. Multiple merges might occur in an attempt to ** write the quota of nMerge leaf blocks. */ int sqlite3Fts3Incrmerge(Fts3Table *p, int nMerge, int nMin){ @@ -4833,7 +4833,7 @@ int sqlite3Fts3Incrmerge(Fts3Table *p, int nMerge, int nMin){ /* Search the %_segdir table for the absolute level with the smallest ** relative level number that contains at least nMin segments, if any. ** If one is found, set iAbsLevel to the absolute level number and - ** nSeg to nMin. If no level with at least nMin segments can be found, + ** nSeg to nMin. If no level with at least nMin segments can be found, ** set nSeg to -1. */ rc = fts3SqlStmt(p, SQL_FIND_MERGE_LEVEL, &pFindLevel, 0); @@ -4849,7 +4849,7 @@ int sqlite3Fts3Incrmerge(Fts3Table *p, int nMerge, int nMin){ /* If the hint read from the %_stat table is not empty, check if the ** last entry in it specifies a relative level smaller than or equal - ** to the level identified by the block above (if any). If so, this + ** to the level identified by the block above (if any). If so, this ** iteration of the loop will work on merging at the hinted level. */ if( rc==SQLITE_OK && hint.n ){ @@ -4875,11 +4875,11 @@ int sqlite3Fts3Incrmerge(Fts3Table *p, int nMerge, int nMin){ ** Exit early in this case. */ if( nSeg<0 ) break; - /* Open a cursor to iterate through the contents of the oldest nSeg - ** indexes of absolute level iAbsLevel. If this cursor is opened using + /* Open a cursor to iterate through the contents of the oldest nSeg + ** indexes of absolute level iAbsLevel. If this cursor is opened using ** the 'hint' parameters, it is possible that there are less than nSeg ** segments available in level iAbsLevel. In this case, no work is - ** done on iAbsLevel - fall through to the next iteration of the loop + ** done on iAbsLevel - fall through to the next iteration of the loop ** to start work on some other level. */ memset(pWriter, 0, nAlloc); pFilter->flags = FTS3_SEGMENT_REQUIRE_POS; @@ -5146,7 +5146,7 @@ static u64 fts3ChecksumIndex( ** to true and return SQLITE_OK. Or if the contents do not match, set *pbOk ** to false before returning. ** -** If an error occurs (e.g. an OOM or IO error), return an SQLite error +** If an error occurs (e.g. an OOM or IO error), return an SQLite error ** code. The final value of *pbOk is undefined in this case. */ static int fts3IntegrityCheck(Fts3Table *p, int *pbOk){ @@ -5177,7 +5177,7 @@ static int fts3IntegrityCheck(Fts3Table *p, int *pbOk){ sqlite3_tokenizer_module const *pModule = p->pTokenizer->pModule; sqlite3_stmt *pStmt = 0; char *zSql; - + zSql = sqlite3_mprintf("SELECT %s" , p->zReadExprlist); if( !zSql ){ rc = SQLITE_NOMEM; @@ -5237,7 +5237,7 @@ static int fts3IntegrityCheck(Fts3Table *p, int *pbOk){ ** the FTS index are correct, return SQLITE_OK. Or, if the contents of the ** FTS index are incorrect, return SQLITE_CORRUPT_VTAB. ** -** Or, if an error (e.g. an OOM or IO error) occurs, return an SQLite +** Or, if an error (e.g. an OOM or IO error) occurs, return an SQLite ** error code. ** ** The integrity-check works as follows. For each token and indexed token @@ -5246,7 +5246,7 @@ static int fts3IntegrityCheck(Fts3Table *p, int *pbOk){ ** ** + The index number (0 for the main index, 1 for the first prefix ** index etc.), -** + The token (or token prefix) text itself, +** + The token (or token prefix) text itself, ** + The language-id of the row it appears in, ** + The docid of the row it appears in, ** + The column it appears in, and @@ -5257,7 +5257,7 @@ static int fts3IntegrityCheck(Fts3Table *p, int *pbOk){ ** ** The integrity-check code calculates the same checksum in two ways: ** -** 1. By scanning the contents of the FTS index, and +** 1. By scanning the contents of the FTS index, and ** 2. By scanning and tokenizing the content table. ** ** If the two checksums are identical, the integrity-check is deemed to have @@ -5278,7 +5278,7 @@ static int fts3DoIntegrityCheck( ** ** "INSERT INTO tbl(tbl) VALUES()" ** -** Argument pVal contains the result of . Currently the only +** Argument pVal contains the result of . Currently the only ** meaningful value to insert is the text 'optimize'. */ static int fts3SpecialInsert(Fts3Table *p, sqlite3_value *pVal){ @@ -5330,7 +5330,7 @@ void sqlite3Fts3FreeDeferredDoclists(Fts3Cursor *pCsr){ } /* -** Free all entries in the pCsr->pDeffered list. Entries are added to +** Free all entries in the pCsr->pDeffered list. Entries are added to ** this list using sqlite3Fts3DeferToken(). */ void sqlite3Fts3FreeDeferredTokens(Fts3Cursor *pCsr){ @@ -5358,14 +5358,14 @@ int sqlite3Fts3CacheDeferredDoclists(Fts3Cursor *pCsr){ int i; /* Used to iterate through table columns */ sqlite3_int64 iDocid; /* Docid of the row pCsr points to */ Fts3DeferredToken *pDef; /* Used to iterate through deferred tokens */ - + Fts3Table *p = (Fts3Table *)pCsr->base.pVtab; sqlite3_tokenizer *pT = p->pTokenizer; sqlite3_tokenizer_module const *pModule = pT->pModule; - + assert( pCsr->isRequireSeek==0 ); iDocid = sqlite3_column_int64(pCsr->pStmt, 0); - + for(i=0; inColumn && rc==SQLITE_OK; i++){ if( p->abNotindexed[i]==0 ){ const char *zText = (const char *)sqlite3_column_text(pCsr->pStmt, i+1); @@ -5406,8 +5406,8 @@ int sqlite3Fts3CacheDeferredDoclists(Fts3Cursor *pCsr){ } int sqlite3Fts3DeferredTokenList( - Fts3DeferredToken *p, - char **ppData, + Fts3DeferredToken *p, + char **ppData, int *pnData ){ char *pRet; @@ -5427,7 +5427,7 @@ int sqlite3Fts3DeferredTokenList( nSkip = sqlite3Fts3GetVarint(p->pList->aData, &dummy); *pnData = p->pList->nData - nSkip; *ppData = pRet; - + memcpy(pRet, &p->pList->aData[nSkip], *pnData); return SQLITE_OK; } @@ -5447,7 +5447,7 @@ int sqlite3Fts3DeferToken( } memset(pDeferred, 0, sizeof(*pDeferred)); pDeferred->pToken = pToken; - pDeferred->pNext = pCsr->pDeferred; + pDeferred->pNext = pCsr->pDeferred; pDeferred->iCol = iCol; pCsr->pDeferred = pDeferred; @@ -5464,8 +5464,8 @@ int sqlite3Fts3DeferToken( ** of subsiduary data structures accordingly. */ static int fts3DeleteByRowid( - Fts3Table *p, - sqlite3_value *pRowid, + Fts3Table *p, + sqlite3_value *pRowid, int *pnChng, /* IN/OUT: Decrement if row is deleted */ u32 *aSzDel ){ @@ -5503,14 +5503,14 @@ static int fts3DeleteByRowid( ** This function does the work for the xUpdate method of FTS3 virtual ** tables. The schema of the virtual table being: ** -** CREATE TABLE ( +** CREATE TABLE
      ( ** , -**
      HIDDEN, -** docid HIDDEN, +**
      HIDDEN, +** docid HIDDEN, ** HIDDEN ** ); ** -** +** */ int sqlite3Fts3UpdateMethod( sqlite3_vtab *pVtab, /* FTS3 vtab object */ @@ -5531,7 +5531,7 @@ int sqlite3Fts3UpdateMethod( assert( p->bHasStat==0 || p->bHasStat==1 ); assert( p->pSegments==0 ); - assert( + assert( nArg==1 /* DELETE operations */ || nArg==(2 + p->nColumn + 3) /* INSERT or UPDATE operations */ ); @@ -5540,9 +5540,9 @@ int sqlite3Fts3UpdateMethod( ** ** INSERT INTO xyz(xyz) VALUES('command'); */ - if( nArg>1 - && sqlite3_value_type(apVal[0])==SQLITE_NULL - && sqlite3_value_type(apVal[p->nColumn+2])!=SQLITE_NULL + if( nArg>1 + && sqlite3_value_type(apVal[0])==SQLITE_NULL + && sqlite3_value_type(apVal[p->nColumn+2])!=SQLITE_NULL ){ rc = fts3SpecialInsert(p, apVal[p->nColumn+2]); goto update_out; @@ -5581,24 +5581,24 @@ int sqlite3Fts3UpdateMethod( pNewRowid = apVal[1]; } - if( sqlite3_value_type(pNewRowid)!=SQLITE_NULL && ( + if( sqlite3_value_type(pNewRowid)!=SQLITE_NULL && ( sqlite3_value_type(apVal[0])==SQLITE_NULL || sqlite3_value_int64(apVal[0])!=sqlite3_value_int64(pNewRowid) )){ /* The new rowid is not NULL (in this case the rowid will be - ** automatically assigned and there is no chance of a conflict), and + ** automatically assigned and there is no chance of a conflict), and ** the statement is either an INSERT or an UPDATE that modifies the ** rowid column. So if the conflict mode is REPLACE, then delete any - ** existing row with rowid=pNewRowid. + ** existing row with rowid=pNewRowid. ** - ** Or, if the conflict mode is not REPLACE, insert the new record into + ** Or, if the conflict mode is not REPLACE, insert the new record into ** the %_content table. If we hit the duplicate rowid constraint (or any ** other error) while doing so, return immediately. ** ** This branch may also run if pNewRowid contains a value that cannot - ** be losslessly converted to an integer. In this case, the eventual + ** be losslessly converted to an integer. In this case, the eventual ** call to fts3InsertData() (either just below or further on in this - ** function) will return SQLITE_MISMATCH. If fts3DeleteByRowid is + ** function) will return SQLITE_MISMATCH. If fts3DeleteByRowid is ** invoked, it will delete zero rows (since no row will have ** docid=$pNewRowid if $pNewRowid is not an integer value). */ @@ -5620,7 +5620,7 @@ int sqlite3Fts3UpdateMethod( rc = fts3DeleteByRowid(p, apVal[0], &nChng, aSzDel); isRemove = 1; } - + /* If this is an INSERT or UPDATE operation, insert the new record. */ if( nArg>1 && rc==SQLITE_OK ){ int iLangid = sqlite3_value_int(apVal[2 + p->nColumn + 2]); @@ -5653,10 +5653,10 @@ int sqlite3Fts3UpdateMethod( return rc; } -/* +/* ** Flush any data in the pending-terms hash table to disk. If successful, -** merge all segments in the database (including the new segment, if -** there was any data to flush) into a single segment. +** merge all segments in the database (including the new segment, if +** there was any data to flush) into a single segment. */ int sqlite3Fts3Optimize(Fts3Table *p){ int rc; diff --git a/third_party/sqlite/src/ext/fts3/fts3speed.tcl b/third_party/sqlite/src/ext/fts3/fts3speed.tcl index 377cb19606569..80eadb314a430 100644 --- a/third_party/sqlite/src/ext/fts3/fts3speed.tcl +++ b/third_party/sqlite/src/ext/fts3/fts3speed.tcl @@ -1,7 +1,7 @@ #-------------------------------------------------------------------------- -# This script contains several sub-programs used to test FTS3/FTS4 +# This script contains several sub-programs used to test FTS3/FTS4 # performance. It does not run the queries directly, but generates SQL # scripts that can be run using the shell tool. # diff --git a/third_party/sqlite/src/ext/fts3/mkfts3amal.tcl b/third_party/sqlite/src/ext/fts3/mkfts3amal.tcl index 059048717f9b3..f31e50e6dbf24 100644 --- a/third_party/sqlite/src/ext/fts3/mkfts3amal.tcl +++ b/third_party/sqlite/src/ext/fts3/mkfts3amal.tcl @@ -26,8 +26,8 @@ set today [clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S UTC" -gmt 1] puts $out [subst \ {/****************************************************************************** ** This file is an amalgamation of separate C source files from the SQLite -** Full Text Search extension 2 (fts3). By combining all the individual C -** code files into this single large file, the entire code can be compiled +** Full Text Search extension 2 (fts3). By combining all the individual C +** code files into this single large file, the entire code can be compiled ** as a one translation unit. This allows many compilers to do optimizations ** that would not be possible if the files were compiled separately. It also ** makes the code easier to import into other projects. @@ -35,7 +35,7 @@ puts $out [subst \ ** This amalgamation was generated on $today. */}] -# These are the header files used by FTS3. The first time any of these +# These are the header files used by FTS3. The first time any of these # files are seen in a #include statement in the C code, include the complete # text of the file in-line. The file only needs to be included once. # diff --git a/third_party/sqlite/src/ext/fts3/tool/fts3view.c b/third_party/sqlite/src/ext/fts3/tool/fts3view.c index 37f9b7396dcb4..5272702766170 100644 --- a/third_party/sqlite/src/ext/fts3/tool/fts3view.c +++ b/third_party/sqlite/src/ext/fts3/tool/fts3view.c @@ -47,7 +47,7 @@ const char *findOption(const char *zName, int hasArg, const char *zDefault){ break; } } - return zResult; + return zResult; } @@ -129,7 +129,7 @@ static void showSchema(sqlite3 *db, const char *zTab){ sqlite3_finalize(pStmt); } -/* +/* ** Read a 64-bit variable-length integer from memory starting at p[0]. ** Return the number of bytes read, or 0 on error. ** The value is stored in *v. @@ -201,7 +201,7 @@ static void showVocabulary(sqlite3 *db, const char *zTab){ printf("Number of documents...................... %9d\n", nDoc); runSql(db, "CREATE VIRTUAL TABLE %s USING fts4aux(%Q)", zAux, zTab); - pStmt = prepare(db, + pStmt = prepare(db, "SELECT count(*), sum(occurrences) FROM %s WHERE col='*'", zAux); while( sqlite3_step(pStmt)==SQLITE_ROW ){ @@ -508,7 +508,7 @@ static void showSegdirMap(sqlite3 *db, const char *zTab){ if( iLEnd+1<=iEnd ){ sqlite3_bind_int64(pStmt2, 1, iLEnd+1); sqlite3_bind_int64(pStmt2, 2, iEnd); - iLower = -1; + iLower = -1; while( sqlite3_step(pStmt2)==SQLITE_ROW ){ iX = sqlite3_column_int64(pStmt2, 0); if( iLower<0 ){ @@ -588,8 +588,8 @@ static void decodeSegment( } } } - - + + /* ** Print a a blob as hex and ascii. */ @@ -733,7 +733,7 @@ static void decodeDoclist( } } } - + /* ** Print the content of a doclist. The segment or segdir-root is @@ -871,5 +871,5 @@ int main(int argc, char **argv){ }else{ usage(argv[0]); } - return 0; + return 0; } diff --git a/third_party/sqlite/src/ext/fts3/unicode/CaseFolding.txt b/third_party/sqlite/src/ext/fts3/unicode/CaseFolding.txt index 0d9a4090cde47..2ff8097d98a5d 100644 --- a/third_party/sqlite/src/ext/fts3/unicode/CaseFolding.txt +++ b/third_party/sqlite/src/ext/fts3/unicode/CaseFolding.txt @@ -23,7 +23,7 @@ # # NOTE: case folding does not preserve normalization formats! # -# For information on case folding, including how to have case folding +# For information on case folding, including how to have case folding # preserve normalization formats, see Section 3.13 Default Case Algorithms in # The Unicode Standard, Version 5.0. # diff --git a/third_party/sqlite/src/ext/fts3/unicode/mkunicode.tcl b/third_party/sqlite/src/ext/fts3/unicode/mkunicode.tcl index aafb4e9f9bfa9..0da0412b45e04 100644 --- a/third_party/sqlite/src/ext/fts3/unicode/mkunicode.tcl +++ b/third_party/sqlite/src/ext/fts3/unicode/mkunicode.tcl @@ -115,7 +115,7 @@ proc print_isdiacritic {zFunc map} { } puts "/*" - puts "** Return true if the argument interpreted as a unicode codepoint" + puts "** Return true if the argument interpreted as a unicode codepoint" puts "** is a diacritical modifier character." puts "*/" puts "int ${zFunc}\(int c)\{" @@ -135,8 +135,8 @@ proc print_isdiacritic {zFunc map} { proc an_load_separator_ranges {} { global unicodedata.txt set lSep [an_load_unicodedata_text ${unicodedata.txt}] - unset -nocomplain iFirst - unset -nocomplain nRange + unset -nocomplain iFirst + unset -nocomplain nRange set lRange [list] foreach sep $lSep { if {0==[info exists iFirst]} { @@ -149,7 +149,7 @@ proc an_load_separator_ranges {} { set iFirst $sep set nRange 1 } - } + } lappend lRange [list $iFirst $nRange] set lRange } @@ -171,11 +171,11 @@ proc an_print_range_array {lRange} { ** range of unicode codepoints that are not either letters or numbers (i.e. ** codepoints for which this function should return 0). ** - ** The most significant 22 bits in each 32-bit value contain the first + ** The most significant 22 bits in each 32-bit value contain the first ** codepoint in the range. The least significant 10 bits are used to store - ** the size of the range (always at least 1). In other words, the value - ** ((C<<22) + N) represents a range of N codepoints starting with codepoint - ** C. It is not possible to represent a range larger than 1023 codepoints + ** the size of the range (always at least 1). In other words, the value + ** ((C<<22) + N) represents a range of N codepoints starting with codepoint + ** C. It is not possible to represent a range larger than 1023 codepoints ** using this format. */ }] @@ -476,10 +476,10 @@ proc print_fold {zFunc} { set liOff [tl_generate_ioff_table $lRecord] tl_print_table_header - foreach entry $lRecord { - if {[tl_print_table_entry toggle $entry $liOff]} { - lappend lHigh $entry - } + foreach entry $lRecord { + if {[tl_print_table_entry toggle $entry $liOff]} { + lappend lHigh $entry + } } tl_print_table_footer toggle tl_print_ioff_table $liOff @@ -677,13 +677,13 @@ puts "" # print_fold ${function_prefix}UnicodeFold -# Print the test routines and main() function to stdout, if -test +# Print the test routines and main() function to stdout, if -test # was specified. # if {$::generate_test_code} { print_test_isalnum ${function_prefix}UnicodeIsalnum $lRange print_fold_test ${function_prefix}UnicodeFold $mappings - print_test_main + print_test_main } if {$generate_fts5_code} { diff --git a/third_party/sqlite/src/ext/fts3/unicode/parseunicode.tcl b/third_party/sqlite/src/ext/fts3/unicode/parseunicode.tcl index 0cb2c83a18f76..ce72f04efb35e 100644 --- a/third_party/sqlite/src/ext/fts3/unicode/parseunicode.tcl +++ b/third_party/sqlite/src/ext/fts3/unicode/parseunicode.tcl @@ -4,7 +4,7 @@ # reads the file and returns a list of mappings required to remove all # diacritical marks from a unicode string. Each mapping is itself a list # consisting of two elements - the unicode codepoint and the single ASCII -# character that it should be replaced with, or an empty string if the +# character that it should be replaced with, or an empty string if the # codepoint should simply be removed from the input. Examples: # # { 224 a } (replace codepoint 224 to "a") diff --git a/third_party/sqlite/src/ext/fts5/extract_api_docs.tcl b/third_party/sqlite/src/ext/fts5/extract_api_docs.tcl index 2320d70b7d5bc..a7f1bd06c1567 100644 --- a/third_party/sqlite/src/ext/fts5/extract_api_docs.tcl +++ b/third_party/sqlite/src/ext/fts5/extract_api_docs.tcl @@ -10,10 +10,10 @@ # #-------------------------------------------------------------------------- # -# This script extracts the documentation for the API used by fts5 auxiliary +# This script extracts the documentation for the API used by fts5 auxiliary # functions from header file fts5.h. It outputs html text on stdout that # is included in the documentation on the web. -# +# set ::fts5_docs_output "" if {[info commands hd_putsnl]==""} { @@ -35,7 +35,7 @@ set data [read $fd] close $fd -# Argument $data is the entire text of the fts5.h file. This function +# Argument $data is the entire text of the fts5.h file. This function # extracts the definition of the Fts5ExtensionApi structure from it and # returns a key/value list of structure member names and definitions. i.e. # @@ -53,7 +53,7 @@ proc get_struct_members {data} { foreach member [split $defn2 {;}] { set member [string trim $member] - if {$member!=""} { + if {$member!=""} { catch { set name [lindex $member end] } regexp {.*?[(][*]([^)]*)[)]} $member -> name lappend res $name $member @@ -130,12 +130,12 @@ proc get_api_docs {data} { # ... # array set M [get_struct_members $data] - + # Initialize global list D as a map from section name to documentation # text. Most (all?) section names are structure member names. # set D [get_struct_docs $data [array names M]] - + output "
      " foreach {sub docs} $D { if {[info exists M($sub)]} { @@ -153,7 +153,7 @@ proc get_api_docs {data} { output "
      " output "$hdr
      " - + set mode "" set margin " style=margin-top:0.1em" foreach line [split [string trim $docs] "\n"] { diff --git a/third_party/sqlite/src/ext/fts5/fts5.h b/third_party/sqlite/src/ext/fts5/fts5.h index a45c145d38b9c..1b7eb642f0739 100644 --- a/third_party/sqlite/src/ext/fts5/fts5.h +++ b/third_party/sqlite/src/ext/fts5/fts5.h @@ -10,7 +10,7 @@ ** ****************************************************************************** ** -** Interfaces to extend FTS5. Using the interfaces defined in this file, +** Interfaces to extend FTS5. Using the interfaces defined in this file, ** FTS5 may be extended with: ** ** * custom tokenizers, and @@ -55,19 +55,19 @@ struct Fts5PhraseIter { ** EXTENSION API FUNCTIONS ** ** xUserData(pFts): -** Return a copy of the context pointer the extension function was +** Return a copy of the context pointer the extension function was ** registered with. ** ** xColumnTotalSize(pFts, iCol, pnToken): ** If parameter iCol is less than zero, set output variable *pnToken ** to the total number of tokens in the FTS5 table. Or, if iCol is ** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in +** the total number of tokens in column iCol, considering all rows in ** the FTS5 table. ** ** If parameter iCol is greater than or equal to the number of columns ** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is +** an OOM condition or IO error), an appropriate SQLite error code is ** returned. ** ** xColumnCount(pFts): @@ -81,7 +81,7 @@ struct Fts5PhraseIter { ** ** If parameter iCol is greater than or equal to the number of columns ** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is +** an OOM condition or IO error), an appropriate SQLite error code is ** returned. ** ** This function may be quite inefficient if used with an FTS5 table @@ -108,8 +108,8 @@ struct Fts5PhraseIter { ** an error code (i.e. SQLITE_NOMEM) if an error occurs. ** ** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option +** "detail=none" or "detail=column" option. If the FTS5 table is created +** with either "detail=none" or "detail=column" and "content=" option ** (i.e. if it is a contentless table), then this API always returns 0. ** ** xInst: @@ -124,11 +124,11 @@ struct Fts5PhraseIter { ** with the offsets=0 option specified. In this case *piOff is always ** set to -1. ** -** Returns SQLITE_OK if successful, or an error code (i.e. SQLITE_NOMEM) +** Returns SQLITE_OK if successful, or an error code (i.e. SQLITE_NOMEM) ** if an error occurs. ** ** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. +** "detail=none" or "detail=column" option. ** ** xRowid: ** Returns the rowid of the current row. @@ -144,11 +144,11 @@ struct Fts5PhraseIter { ** ** with $p set to a phrase equivalent to the phrase iPhrase of the ** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback +** phrase iPhrase of the current query is included in $p. For each +** row visited, the callback function passed as the fourth argument +** is invoked. The context and API objects passed to the callback ** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as +** Invoking Api.xUserData() returns a copy of the pointer passed as ** the third argument to pUserData. ** ** If the callback function returns any value other than SQLITE_OK, the @@ -163,14 +163,14 @@ struct Fts5PhraseIter { ** ** xSetAuxdata(pFts5, pAux, xDelete) ** -** Save the pointer passed as the second argument as the extension functions +** Save the pointer passed as the second argument as the extension functions ** "auxiliary data". The pointer may then be retrieved by the current or any ** future invocation of the same fts5 extension function made as part of ** of the same MATCH query using the xGetAuxdata() API. ** ** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a +** each FTS query (MATCH expression). If the extension function is invoked +** more than once for a single FTS query, then all invocations share a ** single auxiliary data context. ** ** If there is already an auxiliary data pointer when this function is @@ -189,7 +189,7 @@ struct Fts5PhraseIter { ** ** xGetAuxdata(pFts5, bClear) ** -** Returns the current auxiliary data pointer for the fts5 extension +** Returns the current auxiliary data pointer for the fts5 extension ** function. See the xSetAuxdata() method for details. ** ** If the bClear argument is non-zero, then the auxiliary data is cleared @@ -209,7 +209,7 @@ struct Fts5PhraseIter { ** method, to iterate through all instances of a single query phrase within ** the current row. This is the same information as is accessible via the ** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate +** to use, this API may be faster under some circumstances. To iterate ** through instances of phrase iPhrase, use the following code: ** ** Fts5PhraseIter iter; @@ -227,8 +227,8 @@ struct Fts5PhraseIter { ** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). ** ** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option +** "detail=none" or "detail=column" option. If the FTS5 table is created +** with either "detail=none" or "detail=column" and "content=" option ** (i.e. if it is a contentless table), then this API always iterates ** through an empty set (all calls to xPhraseFirst() set iCol to -1). ** @@ -252,16 +252,16 @@ struct Fts5PhraseIter { ** } ** ** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to +** "detail=none" option. If the FTS5 table is created with either +** "detail=none" "content=" option (i.e. if it is a contentless table), +** then this API always iterates through an empty set (all calls to ** xPhraseFirstColumn() set iCol to -1). ** ** The information accessed using this API and its companion ** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext ** (or xInst/xInstCount). The chief advantage of this API is that it is ** significantly more efficient than those alternatives when used with -** "detail=column" tables. +** "detail=column" tables. ** ** xPhraseNextColumn() ** See xPhraseFirstColumn above. @@ -275,7 +275,7 @@ struct Fts5ExtensionApi { int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken); - int (*xTokenize)(Fts5Context*, + int (*xTokenize)(Fts5Context*, const char *pText, int nText, /* Text to tokenize */ void *pCtx, /* Context passed to xToken() */ int (*xToken)(void*, int, const char*, int, int, int) /* Callback */ @@ -304,15 +304,15 @@ struct Fts5ExtensionApi { void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); }; -/* +/* ** CUSTOM AUXILIARY FUNCTIONS *************************************************************************/ /************************************************************************* ** CUSTOM TOKENIZERS ** -** Applications may also register custom tokenizer types. A tokenizer -** is registered by providing fts5 with a populated instance of the +** Applications may also register custom tokenizer types. A tokenizer +** is registered by providing fts5 with a populated instance of the ** following structure. All structure methods must be defined, setting ** any member of the fts5_tokenizer struct to NULL leads to undefined ** behaviour. The structure methods are expected to function as follows: @@ -323,16 +323,16 @@ struct Fts5ExtensionApi { ** ** The first argument passed to this function is a copy of the (void*) ** pointer provided by the application when the fts5_tokenizer object -** was registered with FTS5 (the third argument to xCreateTokenizer()). +** was registered with FTS5 (the third argument to xCreateTokenizer()). ** The second and third arguments are an array of nul-terminated strings ** containing the tokenizer arguments, if any, specified following the ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used ** to create the FTS5 table. ** -** The final argument is an output variable. If successful, (*ppOut) +** The final argument is an output variable. If successful, (*ppOut) ** should be set to point to the new tokenizer handle and SQLITE_OK ** returned. If an error occurs, some value other than SQLITE_OK should -** be returned. In this case, fts5 assumes that the final value of *ppOut +** be returned. In this case, fts5 assumes that the final value of *ppOut ** is undefined. ** ** xDelete: @@ -341,7 +341,7 @@ struct Fts5ExtensionApi { ** be invoked exactly once for each successful call to xCreate(). ** ** xTokenize: -** This function is expected to tokenize the nText byte string indicated +** This function is expected to tokenize the nText byte string indicated ** by argument pText. pText may or may not be nul-terminated. The first ** argument passed to this function is a pointer to an Fts5Tokenizer object ** returned by an earlier call to xCreate(). @@ -355,8 +355,8 @@ struct Fts5ExtensionApi { ** determine the set of tokens to add to (or delete from) the ** FTS index. ** -**
    • FTS5_TOKENIZE_QUERY - A MATCH query is being executed -** against the FTS index. The tokenizer is being called to tokenize +**
    • FTS5_TOKENIZE_QUERY - A MATCH query is being executed +** against the FTS index. The tokenizer is being called to tokenize ** a bareword or quoted string specified as part of the query. ** **
    • (FTS5_TOKENIZE_QUERY | FTS5_TOKENIZE_PREFIX) - Same as @@ -364,10 +364,10 @@ struct Fts5ExtensionApi { ** followed by a "*" character, indicating that the last token ** returned by the tokenizer will be treated as a token prefix. ** -**
    • FTS5_TOKENIZE_AUX - The tokenizer is being invoked to +**
    • FTS5_TOKENIZE_AUX - The tokenizer is being invoked to ** satisfy an fts5_api.xTokenize() request made by an auxiliary ** function. Or an fts5_api.xColumnSize() request made by the same -** on a columnsize=0 database. +** on a columnsize=0 database. ** ** ** For each token in the input string, the supplied callback xToken() must @@ -379,10 +379,10 @@ struct Fts5ExtensionApi { ** which the token is derived within the input. ** ** The second argument passed to the xToken() callback ("tflags") should -** normally be set to 0. The exception is if the tokenizer supports +** normally be set to 0. The exception is if the tokenizer supports ** synonyms. In this case see the discussion below for details. ** -** FTS5 assumes the xToken() callback is invoked for each token in the +** FTS5 assumes the xToken() callback is invoked for each token in the ** order that they occur within the input text. ** ** If an xToken() callback returns any value other than SQLITE_OK, then @@ -396,7 +396,7 @@ struct Fts5ExtensionApi { ** SYNONYM SUPPORT ** ** Custom tokenizers may also support synonyms. Consider a case in which a -** user wishes to query for a phrase such as "first place". Using the +** user wishes to query for a phrase such as "first place". Using the ** built-in tokenizers, the FTS5 query 'first + place' will match instances ** of "first place" within the document set, but not alternative forms ** such as "1st place". In some applications, it would be better to match @@ -405,7 +405,7 @@ struct Fts5ExtensionApi { ** ** There are several ways to approach this in FTS5: ** -**
      1. By mapping all synonyms to a single token. In this case, the +**
        1. By mapping all synonyms to a single token. In this case, the ** In the above example, this means that the tokenizer returns the ** same token for inputs "first" and "1st". Say that token is in ** fact "first", so that when the user inserts the document "I won @@ -415,7 +415,7 @@ struct Fts5ExtensionApi { ** as expected. ** **
        2. By adding multiple synonyms for a single term to the FTS index. -** In this case, when tokenizing query text, the tokenizer may +** In this case, when tokenizing query text, the tokenizer may ** provide multiple synonyms for a single term within the document. ** FTS5 then queries the index for each synonym individually. For ** example, faced with the query: @@ -424,26 +424,26 @@ struct Fts5ExtensionApi { ** ... MATCH 'first place' ** ** the tokenizer offers both "1st" and "first" as synonyms for the -** first token in the MATCH query and FTS5 effectively runs a query +** first token in the MATCH query and FTS5 effectively runs a query ** similar to: ** ** ** ... MATCH '(first OR 1st) place' ** ** except that, for the purposes of auxiliary functions, the query -** still appears to contain just two phrases - "(first OR 1st)" +** still appears to contain just two phrases - "(first OR 1st)" ** being treated as a single phrase. ** **
        3. By adding multiple synonyms for a single term to the FTS index. ** Using this method, when tokenizing document text, the tokenizer -** provides multiple synonyms for each token. So that when a +** provides multiple synonyms for each token. So that when a ** document such as "I won first place" is tokenized, entries are ** added to the FTS index for "i", "won", "first", "1st" and ** "place". ** ** This way, even if the tokenizer does not provide synonyms ** when tokenizing query text (it should not - to do would be -** inefficient), it doesn't matter if the user queries for +** inefficient), it doesn't matter if the user queries for ** 'first + place' or '1st + place', as there are entires in the ** FTS index corresponding to both forms of the first token. **
        @@ -464,11 +464,11 @@ struct Fts5ExtensionApi { ** ** It is an error to specify the FTS5_TOKEN_COLOCATED flag the first time ** xToken() is called. Multiple synonyms may be specified for a single token -** by making multiple calls to xToken(FTS5_TOKEN_COLOCATED) in sequence. +** by making multiple calls to xToken(FTS5_TOKEN_COLOCATED) in sequence. ** There is no limit to the number of synonyms that may be provided for a ** single token. ** -** In many cases, method (1) above is the best approach. It does not add +** In many cases, method (1) above is the best approach. It does not add ** extra data to the FTS index or require FTS5 to query for multiple terms, ** so it is efficient in terms of disk space and query speed. However, it ** does not support prefix queries very well. If, as suggested above, the @@ -480,18 +480,18 @@ struct Fts5ExtensionApi { ** will not match documents that contain the token "1st" (as the tokenizer ** will probably not map "1s" to any prefix of "first"). ** -** For full prefix support, method (3) may be preferred. In this case, +** For full prefix support, method (3) may be preferred. In this case, ** because the index contains entries for both "first" and "1st", prefix ** queries such as 'fi*' or '1s*' will match correctly. However, because ** extra entries are added to the FTS index, this method uses more space ** within the database. ** ** Method (2) offers a midpoint between (1) and (3). Using this method, -** a query such as '1s*' will match documents that contain the literal +** a query such as '1s*' will match documents that contain the literal ** token "1st", but not "first" (assuming the tokenizer is not able to ** provide synonyms for prefixes). However, a non-prefix query like '1st' ** will match against "1st" and "first". This method does not require -** extra disk space, as no extra entries are added to the FTS index. +** extra disk space, as no extra entries are added to the FTS index. ** On the other hand, it may require more CPU cycles to run MATCH queries, ** as separate queries of the FTS index are required for each synonym. ** @@ -505,10 +505,10 @@ typedef struct fts5_tokenizer fts5_tokenizer; struct fts5_tokenizer { int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); void (*xDelete)(Fts5Tokenizer*); - int (*xTokenize)(Fts5Tokenizer*, + int (*xTokenize)(Fts5Tokenizer*, void *pCtx, int flags, /* Mask of FTS5_TOKENIZE_* flags */ - const char *pText, int nText, + const char *pText, int nText, int (*xToken)( void *pCtx, /* Copy of 2nd argument to xTokenize() */ int tflags, /* Mask of FTS5_TOKEN_* flags */ diff --git a/third_party/sqlite/src/ext/fts5/fts5Int.h b/third_party/sqlite/src/ext/fts5/fts5Int.h index 9ef338e8215d8..80790ea6b64da 100644 --- a/third_party/sqlite/src/ext/fts5/fts5Int.h +++ b/third_party/sqlite/src/ext/fts5/fts5Int.h @@ -47,7 +47,7 @@ typedef sqlite3_uint64 u64; #endif -/* Truncate very long tokens to this many bytes. Hard limit is +/* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset ** field that occurs at the start of each leaf page (see fts5_index.c). */ #define FTS5_MAX_TOKEN_SIZE 32768 @@ -75,7 +75,7 @@ int sqlite3Fts5Corrupt(void); /* ** The assert_nc() macro is similar to the assert() macro, except that it -** is used for assert() conditions that are true only if it can be +** is used for assert() conditions that are true only if it can be ** guranteed that the database is not corrupt. */ #ifdef SQLITE_DEBUG @@ -98,7 +98,7 @@ extern int sqlite3_fts5_may_be_corrupt; typedef struct Fts5Global Fts5Global; typedef struct Fts5Colset Fts5Colset; -/* If a NEAR() clump or phrase may only match a specific set of columns, +/* If a NEAR() clump or phrase may only match a specific set of columns, ** then an object of the following type is used to record the set of columns. ** Each entry in the aiCol[] array is a column that may be matched. ** @@ -126,20 +126,20 @@ typedef struct Fts5Config Fts5Config; ** ** nAutomerge: ** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the +** attempt to merge together. A value of 1 sets the object to use the ** compile time default. Zero disables auto-merge altogether. ** ** zContent: ** ** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or +** The value of the content_rowid= option, if one was specified. Or ** the string "rowid" otherwise. This text is not quoted - if it is ** used as part of an SQL statement it needs to be quoted appropriately. ** ** zContentExprlist: ** ** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a +** This exists in order to allow the fts5_index.c module to return a ** decent error message if it encounters a file-format version it does ** not understand. ** @@ -163,8 +163,8 @@ struct Fts5Config { int nPrefix; /* Number of prefix indexes */ int *aPrefix; /* Sizes in bytes of nPrefix prefix indexes */ int eContent; /* An FTS5_CONTENT value */ - char *zContent; /* content table */ - char *zContentRowid; /* "content_rowid=" option value */ + char *zContent; /* content table */ + char *zContentRowid; /* "content_rowid=" option value */ int bColumnsize; /* "columnsize=" option value (dflt==1) */ int eDetail; /* FTS5_DETAIL_XXX value */ char *zContentExprlist; @@ -365,27 +365,27 @@ int sqlite3Fts5IndexClose(Fts5Index *p); ** Return a simple checksum value based on the arguments. */ u64 sqlite3Fts5IndexEntryCksum( - i64 iRowid, - int iCol, - int iPos, + i64 iRowid, + int iCol, + int iPos, int iIdx, const char *pTerm, int nTerm ); /* -** Argument p points to a buffer containing utf-8 text that is n bytes in +** Argument p points to a buffer containing utf-8 text that is n bytes in ** size. Return the number of bytes in the nChar character prefix of the ** buffer, or 0 if there are less than nChar characters in total. */ int sqlite3Fts5IndexCharlenToBytelen( - const char *p, - int nByte, + const char *p, + int nByte, int nChar ); /* -** Open a new iterator to iterate though all rowids that match the +** Open a new iterator to iterate though all rowids that match the ** specified token or token prefix. */ int sqlite3Fts5IndexQuery( @@ -416,7 +416,7 @@ int sqlite3Fts5IterNextScan(Fts5IndexIter*); /* -** Insert or remove data to or from the index. Each time a document is +** Insert or remove data to or from the index. Each time a document is ** added to or removed from the index, this function is called one or more ** times. ** @@ -451,7 +451,7 @@ int sqlite3Fts5IndexSync(Fts5Index *p, int bCommit); /* ** Discard any data stored in the in-memory hash tables. Do not write it ** to the database. Additionally, assume that the contents of the %_data -** table may have changed on disk. So any in-memory caches of %_data +** table may have changed on disk. So any in-memory caches of %_data ** records must be invalidated. */ int sqlite3Fts5IndexRollback(Fts5Index *p); @@ -467,16 +467,16 @@ int sqlite3Fts5IndexSetAverages(Fts5Index *p, const u8*, int); */ int sqlite3Fts5IndexIntegrityCheck(Fts5Index*, u64 cksum); -/* -** Called during virtual module initialization to register UDF -** fts5_decode() with SQLite +/* +** Called during virtual module initialization to register UDF +** fts5_decode() with SQLite */ int sqlite3Fts5IndexInit(sqlite3*); int sqlite3Fts5IndexSetCookie(Fts5Index*, int); /* -** Return the total number of entries read from the %_data table by +** Return the total number of entries read from the %_data table by ** this connection since it was created. */ int sqlite3Fts5IndexReads(Fts5Index *p); @@ -493,7 +493,7 @@ int sqlite3Fts5IndexLoadConfig(Fts5Index *p); **************************************************************************/ /************************************************************************** -** Interface to code in fts5_varint.c. +** Interface to code in fts5_varint.c. */ int sqlite3Fts5GetVarint32(const unsigned char *p, u32 *v); int sqlite3Fts5GetVarintLen(u32 iVal); @@ -518,11 +518,11 @@ int sqlite3Fts5PutVarint(unsigned char *p, u64 v); /************************************************************************** -** Interface to code in fts5.c. +** Interface to code in fts5.c. */ int sqlite3Fts5GetTokenizer( - Fts5Global*, + Fts5Global*, const char **azArg, int nArg, Fts5Tokenizer**, @@ -537,7 +537,7 @@ Fts5Index *sqlite3Fts5IndexFromCsrid(Fts5Global*, i64, Fts5Config **); **************************************************************************/ /************************************************************************** -** Interface to code in fts5_hash.c. +** Interface to code in fts5_hash.c. */ typedef struct Fts5Hash Fts5Hash; @@ -586,7 +586,7 @@ void sqlite3Fts5HashScanEntry(Fts5Hash *, **************************************************************************/ /************************************************************************** -** Interface to code in fts5_storage.c. fts5_storage.c contains contains +** Interface to code in fts5_storage.c. fts5_storage.c contains contains ** code to access the data stored in the %_content and %_docsize tables. */ @@ -635,7 +635,7 @@ int sqlite3Fts5StorageReset(Fts5Storage *p); /************************************************************************** -** Interface to code in fts5_expr.c. +** Interface to code in fts5_expr.c. */ typedef struct Fts5Expr Fts5Expr; typedef struct Fts5ExprNode Fts5ExprNode; @@ -651,9 +651,9 @@ struct Fts5Token { /* Parse a MATCH expression. */ int sqlite3Fts5ExprNew( - Fts5Config *pConfig, + Fts5Config *pConfig, const char *zExpr, - Fts5Expr **ppNew, + Fts5Expr **ppNew, char **pzErr ); @@ -713,21 +713,21 @@ Fts5ExprNode *sqlite3Fts5ParseImplicitAnd( ); Fts5ExprPhrase *sqlite3Fts5ParseTerm( - Fts5Parse *pParse, - Fts5ExprPhrase *pPhrase, + Fts5Parse *pParse, + Fts5ExprPhrase *pPhrase, Fts5Token *pToken, int bPrefix ); Fts5ExprNearset *sqlite3Fts5ParseNearset( - Fts5Parse*, + Fts5Parse*, Fts5ExprNearset*, - Fts5ExprPhrase* + Fts5ExprPhrase* ); Fts5Colset *sqlite3Fts5ParseColset( - Fts5Parse*, - Fts5Colset*, + Fts5Parse*, + Fts5Colset*, Fts5Token * ); @@ -748,7 +748,7 @@ void sqlite3Fts5ParseNear(Fts5Parse *pParse, Fts5Token*); /************************************************************************** -** Interface to code in fts5_aux.c. +** Interface to code in fts5_aux.c. */ int sqlite3Fts5AuxInit(fts5_api*); @@ -757,7 +757,7 @@ int sqlite3Fts5AuxInit(fts5_api*); **************************************************************************/ /************************************************************************** -** Interface to code in fts5_tokenizer.c. +** Interface to code in fts5_tokenizer.c. */ int sqlite3Fts5TokenizerInit(fts5_api*); @@ -766,7 +766,7 @@ int sqlite3Fts5TokenizerInit(fts5_api*); **************************************************************************/ /************************************************************************** -** Interface to code in fts5_vocab.c. +** Interface to code in fts5_vocab.c. */ int sqlite3Fts5VocabInit(Fts5Global*, sqlite3*); @@ -777,7 +777,7 @@ int sqlite3Fts5VocabInit(Fts5Global*, sqlite3*); /************************************************************************** -** Interface to automatically generated code in fts5_unicode2.c. +** Interface to automatically generated code in fts5_unicode2.c. */ int sqlite3Fts5UnicodeIsalnum(int c); int sqlite3Fts5UnicodeIsdiacritic(int c); diff --git a/third_party/sqlite/src/ext/fts5/fts5_aux.c b/third_party/sqlite/src/ext/fts5/fts5_aux.c index 219ea6fff8f50..989d3ae35d45b 100644 --- a/third_party/sqlite/src/ext/fts5/fts5_aux.c +++ b/third_party/sqlite/src/ext/fts5/fts5_aux.c @@ -16,7 +16,7 @@ #include /* amalgamator: keep */ /* -** Object used to iterate through all "coalesced phrase instances" in +** Object used to iterate through all "coalesced phrase instances" in ** a single column of the current row. If the phrase instances in the ** column being considered do not overlap, this object simply iterates ** through them. Or, if they do overlap (share one or more tokens in @@ -79,7 +79,7 @@ static int fts5CInstIterNext(CInstIter *pIter){ } /* -** Initialize the iterator object indicated by the final parameter to +** Initialize the iterator object indicated by the final parameter to ** iterate through coalesced phrase instances in column iCol. */ static int fts5CInstIterInit( @@ -124,16 +124,16 @@ struct HighlightContext { /* ** Append text to the HighlightContext output string - p->zOut. Argument -** z points to a buffer containing n bytes of text to append. If n is +** z points to a buffer containing n bytes of text to append. If n is ** negative, everything up until the first '\0' is appended to the output. ** -** If *pRc is set to any value other than SQLITE_OK when this function is -** called, it is a no-op. If an error (i.e. an OOM condition) is encountered, -** *pRc is set to an error code before returning. +** If *pRc is set to any value other than SQLITE_OK when this function is +** called, it is a no-op. If an error (i.e. an OOM condition) is encountered, +** *pRc is set to an error code before returning. */ static void fts5HighlightAppend( - int *pRc, - HighlightContext *p, + int *pRc, + HighlightContext *p, const char *z, int n ){ if( *pRc==SQLITE_OK ){ @@ -418,7 +418,7 @@ static void fts5SnippetFunction( sFinder.nFirst = 0; rc = pApi->xColumnText(pFts, i, &sFinder.zDoc, &nDoc); if( rc!=SQLITE_OK ) break; - rc = pApi->xTokenize(pFts, + rc = pApi->xTokenize(pFts, sFinder.zDoc, nDoc, (void*)&sFinder,fts5SentenceFinderCb ); if( rc!=SQLITE_OK ) break; @@ -451,7 +451,7 @@ static void fts5SnippetFunction( if( sFinder.aFirst[jj]nPhrase; i++){ score += pData->aIDF[i] * ( - ( aFreq[i] * (k1 + 1.0) ) / + ( aFreq[i] * (k1 + 1.0) ) / ( aFreq[i] + k1 * (1 - b + b * D / pData->avgdl) ) ); } - + /* If no error has occurred, return the calculated score. Otherwise, ** throw an SQL exception. */ if( rc==SQLITE_OK ){ diff --git a/third_party/sqlite/src/ext/fts5/fts5_buffer.c b/third_party/sqlite/src/ext/fts5/fts5_buffer.c index 0098846be961e..ce557d4c37260 100644 --- a/third_party/sqlite/src/ext/fts5/fts5_buffer.c +++ b/third_party/sqlite/src/ext/fts5/fts5_buffer.c @@ -56,14 +56,14 @@ int sqlite3Fts5Get32(const u8 *aBuf){ } /* -** Append buffer nData/pData to buffer pBuf. If an OOM error occurs, set +** Append buffer nData/pData to buffer pBuf. If an OOM error occurs, set ** the error code in p. If an error has already occurred when this function ** is called, it is a no-op. */ void sqlite3Fts5BufferAppendBlob( int *pRc, - Fts5Buffer *pBuf, - u32 nData, + Fts5Buffer *pBuf, + u32 nData, const u8 *pData ){ assert_nc( *pRc || nData>=0 ); @@ -74,12 +74,12 @@ void sqlite3Fts5BufferAppendBlob( /* ** Append the nul-terminated string zStr to the buffer pBuf. This function -** ensures that the byte following the buffer data is set to 0x00, even +** ensures that the byte following the buffer data is set to 0x00, even ** though this byte is not included in the pBuf->n count. */ void sqlite3Fts5BufferAppendString( int *pRc, - Fts5Buffer *pBuf, + Fts5Buffer *pBuf, const char *zStr ){ int nStr = (int)strlen(zStr); @@ -91,13 +91,13 @@ void sqlite3Fts5BufferAppendString( ** Argument zFmt is a printf() style format string. This function performs ** the printf() style processing, then appends the results to buffer pBuf. ** -** Like sqlite3Fts5BufferAppendString(), this function ensures that the byte +** Like sqlite3Fts5BufferAppendString(), this function ensures that the byte ** following the buffer data is set to 0x00, even though this byte is not ** included in the pBuf->n count. -*/ +*/ void sqlite3Fts5BufferAppendPrintf( int *pRc, - Fts5Buffer *pBuf, + Fts5Buffer *pBuf, char *zFmt, ... ){ if( *pRc==SQLITE_OK ){ @@ -124,12 +124,12 @@ char *sqlite3Fts5Mprintf(int *pRc, const char *zFmt, ...){ zRet = sqlite3_vmprintf(zFmt, ap); va_end(ap); if( zRet==0 ){ - *pRc = SQLITE_NOMEM; + *pRc = SQLITE_NOMEM; } } return zRet; } - + /* ** Free any buffer allocated by pBuf. Zero the structure before returning. @@ -140,7 +140,7 @@ void sqlite3Fts5BufferFree(Fts5Buffer *pBuf){ } /* -** Zero the contents of the buffer object. But do not free the associated +** Zero the contents of the buffer object. But do not free the associated ** memory allocation. */ void sqlite3Fts5BufferZero(Fts5Buffer *pBuf){ @@ -154,8 +154,8 @@ void sqlite3Fts5BufferZero(Fts5Buffer *pBuf){ */ void sqlite3Fts5BufferSet( int *pRc, - Fts5Buffer *pBuf, - int nData, + Fts5Buffer *pBuf, + int nData, const u8 *pData ){ pBuf->n = 0; @@ -171,7 +171,7 @@ int sqlite3Fts5PoslistNext64( if( i>=n ){ /* EOF */ *piOff = -1; - return 1; + return 1; }else{ i64 iOff = *piOff; int iVal; @@ -217,8 +217,8 @@ int sqlite3Fts5PoslistReaderInit( ** to iPos before returning. */ void sqlite3Fts5PoslistSafeAppend( - Fts5Buffer *pBuf, - i64 *piPrev, + Fts5Buffer *pBuf, + i64 *piPrev, i64 iPos ){ static const i64 colmask = ((i64)(0x7FFFFFFF)) << 32; @@ -232,7 +232,7 @@ void sqlite3Fts5PoslistSafeAppend( } int sqlite3Fts5PoslistWriterAppend( - Fts5Buffer *pBuf, + Fts5Buffer *pBuf, Fts5PoslistWriter *pWriter, i64 iPos ){ @@ -261,7 +261,7 @@ void *sqlite3Fts5MallocZero(int *pRc, int nByte){ ** the length of the string is determined using strlen(). ** ** It is the responsibility of the caller to eventually free the returned -** buffer using sqlite3_free(). If an OOM error occurs, NULL is returned. +** buffer using sqlite3_free(). If an OOM error occurs, NULL is returned. */ char *sqlite3Fts5Strndup(int *pRc, const char *pIn, int nIn){ char *zRet = 0; @@ -328,9 +328,9 @@ int sqlite3Fts5TermsetNew(Fts5Termset **pp){ } int sqlite3Fts5TermsetAdd( - Fts5Termset *p, + Fts5Termset *p, int iIdx, - const char *pTerm, int nTerm, + const char *pTerm, int nTerm, int *pbPresent ){ int rc = SQLITE_OK; @@ -351,9 +351,9 @@ int sqlite3Fts5TermsetAdd( hash = hash % ArraySize(p->apHash); for(pEntry=p->apHash[hash]; pEntry; pEntry=pEntry->pNext){ - if( pEntry->iIdx==iIdx - && pEntry->nTerm==nTerm - && memcmp(pEntry->pTerm, pTerm, nTerm)==0 + if( pEntry->iIdx==iIdx + && pEntry->nTerm==nTerm + && memcmp(pEntry->pTerm, pTerm, nTerm)==0 ){ *pbPresent = 1; break; diff --git a/third_party/sqlite/src/ext/fts5/fts5_config.c b/third_party/sqlite/src/ext/fts5/fts5_config.c index 17fc43e01168d..d0718f4dec62a 100644 --- a/third_party/sqlite/src/ext/fts5/fts5_config.c +++ b/third_party/sqlite/src/ext/fts5/fts5_config.c @@ -34,8 +34,8 @@ static int fts5_isopenquote(char x){ } /* -** Argument pIn points to a character that is part of a nul-terminated -** string. Return a pointer to the first character following *pIn in +** Argument pIn points to a character that is part of a nul-terminated +** string. Return a pointer to the first character following *pIn in ** the string that is not a white-space character. */ static const char *fts5ConfigSkipWhitespace(const char *pIn){ @@ -47,8 +47,8 @@ static const char *fts5ConfigSkipWhitespace(const char *pIn){ } /* -** Argument pIn points to a character that is part of a nul-terminated -** string. Return a pointer to the first character following *pIn in +** Argument pIn points to a character that is part of a nul-terminated +** string. Return a pointer to the first character following *pIn in ** the string that is not a "bareword" character. */ static const char *fts5ConfigSkipBareword(const char *pIn){ @@ -79,9 +79,9 @@ static const char *fts5ConfigSkipLiteral(const char *pIn){ p++; if( *p=='\'' ){ p++; - while( (*p>='a' && *p<='f') - || (*p>='A' && *p<='F') - || (*p>='0' && *p<='9') + while( (*p>='a' && *p<='f') + || (*p>='A' && *p<='F') + || (*p>='0' && *p<='9') ){ p++; } @@ -112,7 +112,7 @@ static const char *fts5ConfigSkipLiteral(const char *pIn){ if( *p=='+' || *p=='-' ) p++; while( fts5_isdigit(*p) ) p++; - /* At this point, if the literal was an integer, the parse is + /* At this point, if the literal was an integer, the parse is ** finished. Or, if it is a floating point value, it may continue ** with either a decimal point or an 'E' character. */ if( *p=='.' && fts5_isdigit(p[1]) ){ @@ -136,8 +136,8 @@ static const char *fts5ConfigSkipLiteral(const char *pIn){ ** nul-terminator byte. ** ** If the close-quote is found, the value returned is the byte offset of -** the character immediately following it. Or, if the close-quote is not -** found, -1 is returned. If -1 is returned, the buffer is left in an +** the character immediately following it. Or, if the close-quote is not +** found, -1 is returned. If -1 is returned, the buffer is left in an ** undefined state. */ static int fts5Dequote(char *z){ @@ -148,7 +148,7 @@ static int fts5Dequote(char *z){ /* Set stack variable q to the close-quote character */ assert( q=='[' || q=='\'' || q=='"' || q=='`' ); - if( q=='[' ) q = ']'; + if( q=='[' ) q = ']'; while( ALWAYS(z[iIn]) ){ if( z[iIn]==q ){ @@ -158,7 +158,7 @@ static int fts5Dequote(char *z){ break; }else{ /* Character iIn and iIn+1 form an escaped quote character. Skip - ** the input cursor past both and copy a single quote character + ** the input cursor past both and copy a single quote character ** to the output buffer. */ iIn += 2; z[iOut++] = q; @@ -203,8 +203,8 @@ struct Fts5Enum { typedef struct Fts5Enum Fts5Enum; static int fts5ConfigSetEnum( - const Fts5Enum *aEnum, - const char *zEnum, + const Fts5Enum *aEnum, + const char *zEnum, int *peVal ){ int nEnum = (int)strlen(zEnum); @@ -324,7 +324,7 @@ static int fts5ConfigParseSpecial( *pzErr = sqlite3_mprintf("parse error in tokenize directive"); rc = SQLITE_ERROR; }else{ - rc = sqlite3Fts5GetTokenizer(pGlobal, + rc = sqlite3Fts5GetTokenizer(pGlobal, (const char**)azArg, nArg, &pConfig->pTok, &pConfig->pTokApi, pzErr ); @@ -391,7 +391,7 @@ static int fts5ConfigParseSpecial( } /* -** Allocate an instance of the default tokenizer ("simple") at +** Allocate an instance of the default tokenizer ("simple") at ** Fts5Config.pTokenizer. Return SQLITE_OK if successful, or an SQLite error ** code if an error occurs. */ @@ -458,14 +458,14 @@ static const char *fts5ConfigGobbleWord( } static int fts5ConfigParseColumn( - Fts5Config *p, - char *zCol, - char *zArg, + Fts5Config *p, + char *zCol, + char *zArg, char **pzErr ){ int rc = SQLITE_OK; - if( 0==sqlite3_stricmp(zCol, FTS5_RANK_NAME) - || 0==sqlite3_stricmp(zCol, FTS5_ROWID_NAME) + if( 0==sqlite3_stricmp(zCol, FTS5_RANK_NAME) + || 0==sqlite3_stricmp(zCol, FTS5_ROWID_NAME) ){ *pzErr = sqlite3_mprintf("reserved fts5 column name: %s", zCol); rc = SQLITE_ERROR; @@ -508,14 +508,14 @@ static int fts5ConfigMakeExprlist(Fts5Config *p){ /* ** Arguments nArg/azArg contain the string arguments passed to the xCreate -** or xConnect method of the virtual table. This function attempts to +** or xConnect method of the virtual table. This function attempts to ** allocate an instance of Fts5Config containing the results of parsing ** those arguments. ** ** If successful, SQLITE_OK is returned and *ppOut is set to point to the -** new Fts5Config object. If an error occurs, an SQLite error code is +** new Fts5Config object. If an error occurs, an SQLite error code is ** returned, *ppOut is set to NULL and an error message may be left in -** *pzErr. It is the responsibility of the caller to eventually free any +** *pzErr. It is the responsibility of the caller to eventually free any ** such error message using sqlite3_free(). */ int sqlite3Fts5ConfigParse( @@ -602,8 +602,8 @@ int sqlite3Fts5ConfigParse( /* If no zContent option was specified, fill in the default values. */ if( rc==SQLITE_OK && pRet->zContent==0 ){ const char *zTail = 0; - assert( pRet->eContent==FTS5_CONTENT_NORMAL - || pRet->eContent==FTS5_CONTENT_NONE + assert( pRet->eContent==FTS5_CONTENT_NORMAL + || pRet->eContent==FTS5_CONTENT_NONE ); if( pRet->eContent==FTS5_CONTENT_NORMAL ){ zTail = "content"; @@ -674,7 +674,7 @@ int sqlite3Fts5ConfigDeclareVtab(Fts5Config *pConfig){ const char *zSep = (i==0?"":", "); zSql = sqlite3Fts5Mprintf(&rc, "%z%s%Q", zSql, zSep, pConfig->azCol[i]); } - zSql = sqlite3Fts5Mprintf(&rc, "%z, %Q HIDDEN, %s HIDDEN)", + zSql = sqlite3Fts5Mprintf(&rc, "%z, %Q HIDDEN, %s HIDDEN)", zSql, pConfig->zName, FTS5_RANK_NAME ); @@ -683,7 +683,7 @@ int sqlite3Fts5ConfigDeclareVtab(Fts5Config *pConfig){ rc = sqlite3_declare_vtab(pConfig->db, zSql); sqlite3_free(zSql); } - + return rc; } @@ -701,7 +701,7 @@ int sqlite3Fts5ConfigDeclareVtab(Fts5Config *pConfig){ ** int iPos // Position of token in input (first token is 0) ** ** If the callback returns a non-zero value the tokenization is abandoned -** and no further callbacks are issued. +** and no further callbacks are issued. ** ** This function returns SQLITE_OK if successful or an SQLite error code ** if an error occurs. If the tokenization was abandoned early because @@ -731,7 +731,7 @@ int sqlite3Fts5Tokenize( */ static const char *fts5ConfigSkipArgs(const char *pIn){ const char *p = pIn; - + while( 1 ){ p = fts5ConfigSkipWhitespace(p); p = fts5ConfigSkipLiteral(p); @@ -748,7 +748,7 @@ static const char *fts5ConfigSkipArgs(const char *pIn){ } /* -** Parameter zIn contains a rank() function specification. The format of +** Parameter zIn contains a rank() function specification. The format of ** this is: ** ** + Bareword (function name) @@ -790,7 +790,7 @@ int sqlite3Fts5ConfigParseRank( p++; } if( rc==SQLITE_OK ){ - const char *pArgs; + const char *pArgs; p = fts5ConfigSkipWhitespace(p); pArgs = p; if( *p!=')' ){ @@ -816,8 +816,8 @@ int sqlite3Fts5ConfigParseRank( } int sqlite3Fts5ConfigSetValue( - Fts5Config *pConfig, - const char *zKey, + Fts5Config *pConfig, + const char *zKey, sqlite3_value *pVal, int *pbBadkey ){ @@ -942,7 +942,7 @@ int sqlite3Fts5ConfigLoad(Fts5Config *pConfig, int iCookie){ } rc = sqlite3_finalize(p); } - + if( rc==SQLITE_OK && iVersion!=FTS5_CURRENT_VERSION ){ rc = SQLITE_ERROR; if( pConfig->pzErrmsg ){ diff --git a/third_party/sqlite/src/ext/fts5/fts5_expr.c b/third_party/sqlite/src/ext/fts5/fts5_expr.c index 209748bbf5627..25cbfb615f299 100644 --- a/third_party/sqlite/src/ext/fts5/fts5_expr.c +++ b/third_party/sqlite/src/ext/fts5/fts5_expr.c @@ -68,7 +68,7 @@ struct Fts5ExprNode { i64 iRowid; /* Current rowid */ Fts5ExprNearset *pNear; /* For FTS5_STRING - cluster of phrases */ - /* Child nodes. For a NOT node, this array always contains 2 entries. For + /* Child nodes. For a NOT node, this array always contains 2 entries. For ** AND or OR nodes, it contains 2 or more entries. */ int nChild; /* Number of child nodes */ Fts5ExprNode *apChild[1]; /* Array of child nodes */ @@ -146,7 +146,7 @@ static int fts5ExprIsspace(char t){ ** Read the first token from the nul-terminated string at *pz. */ static int fts5ExprGetToken( - Fts5Parse *pParse, + Fts5Parse *pParse, const char **pz, /* IN/OUT: Pointer into buffer */ Fts5Token *pToken ){ @@ -214,7 +214,7 @@ static void fts5ParseFree(void *p){ sqlite3_free(p); } int sqlite3Fts5ExprNew( Fts5Config *pConfig, /* FTS5 Configuration */ const char *zExpr, /* Expression text */ - Fts5Expr **ppNew, + Fts5Expr **ppNew, char **pzErr ){ Fts5Parse sParse; @@ -322,7 +322,7 @@ static i64 fts5ExprSynonymRowid(Fts5ExprTerm *pTerm, int bDesc, int *pbEof){ ** Argument pTerm must be a synonym iterator. */ static int fts5ExprSynonymList( - Fts5ExprTerm *pTerm, + Fts5ExprTerm *pTerm, i64 iRowid, Fts5Buffer *pBuf, /* Use this buffer for space if required */ u8 **pa, int *pn @@ -395,13 +395,13 @@ static int fts5ExprSynonymList( /* ** All individual term iterators in pPhrase are guaranteed to be valid and -** pointing to the same rowid when this function is called. This function +** pointing to the same rowid when this function is called. This function ** checks if the current rowid really is a match, and if so populates ** the pPhrase->poslist buffer accordingly. Output parameter *pbMatch ** is set to true if this is really a match, or false otherwise. ** -** SQLITE_OK is returned if an error occurs, or an SQLite error code -** otherwise. It is not considered an error code if the current rowid is +** SQLITE_OK is returned if an error occurs, or an SQLite error code +** otherwise. It is not considered an error code if the current rowid is ** not a match. */ static int fts5ExprPhraseIsMatch( @@ -414,7 +414,7 @@ static int fts5ExprPhraseIsMatch( Fts5PoslistReader *aIter = aStatic; int i; int rc = SQLITE_OK; - + fts5BufferZero(&pPhrase->poslist); /* If the aStatic[] array is not large enough, allocate a large array @@ -534,7 +534,7 @@ struct Fts5NearTrimmer { ** function is called, it is a no-op. Or, if an error (e.g. SQLITE_NOMEM) ** occurs within this function (*pRc) is set accordingly before returning. ** The return value is undefined in both these cases. -** +** ** If no error occurs and non-zero (a match) is returned, the position-list ** of each phrase object is edited to contain only those entries that ** meet the constraint before returning. @@ -566,7 +566,7 @@ static int fts5ExprNearIsMatch(int *pRc, Fts5ExprNearset *pNear){ /* Initialize a lookahead iterator for each phrase. After passing the ** buffer and buffer size to the lookaside-reader init function, zero ** the phrase poslist buffer. The new poslist for the phrase (containing - ** the same entries as the original with some entries removed on account + ** the same entries as the original with some entries removed on account ** of the NEAR constraint) is written over the original even as it is ** being read. This is safe as the entries for the new poslist are a ** subset of the old, so it is not possible for data yet to be read to @@ -869,7 +869,7 @@ static void fts5ExprNodeZeroPoslist(Fts5ExprNode *pNode){ */ static int fts5NodeCompare( Fts5Expr *pExpr, - Fts5ExprNode *p1, + Fts5ExprNode *p1, Fts5ExprNode *p2 ){ if( p2->bEof ) return -1; @@ -884,7 +884,7 @@ static int fts5NodeCompare( ** If an EOF is reached before this happens, *pbEof is set to true before ** returning. ** -** SQLITE_OK is returned if an error occurs, or an SQLite error code +** SQLITE_OK is returned if an error occurs, or an SQLite error code ** otherwise. It is not considered an error code if an iterator reaches ** EOF. */ @@ -901,8 +901,8 @@ static int fts5ExprNodeTest_STRING( const int bDesc = pExpr->bDesc; /* Check that this node should not be FTS5_TERM */ - assert( pNear->nPhrase>1 - || pNear->apPhrase[0]->nTerm>1 + assert( pNear->nPhrase>1 + || pNear->apPhrase[0]->nTerm>1 || pNear->apPhrase[0]->aTerm[0].pSynonym ); @@ -961,7 +961,7 @@ static int fts5ExprNodeNext_STRING( Fts5Expr *pExpr, /* Expression pPhrase belongs to */ Fts5ExprNode *pNode, /* FTS5_STRING or FTS5_TERM node */ int bFromValid, - i64 iFrom + i64 iFrom ){ Fts5ExprTerm *pTerm = &pNode->pNear->apPhrase[0]->aTerm[0]; int rc = SQLITE_OK; @@ -979,8 +979,8 @@ static int fts5ExprNodeNext_STRING( for(p=pTerm; p; p=p->pSynonym){ if( sqlite3Fts5IterEof(p->pIter)==0 ){ i64 ii = p->pIter->iRowid; - if( ii==iRowid - || (bFromValid && ii!=iFrom && (ii>iFrom)==pExpr->bDesc) + if( ii==iRowid + || (bFromValid && ii!=iFrom && (ii>iFrom)==pExpr->bDesc) ){ if( bFromValid ){ rc = sqlite3Fts5IterNextFrom(p->pIter, iFrom); @@ -1026,9 +1026,9 @@ static int fts5ExprNodeTest_TERM( Fts5Expr *pExpr, /* Expression that pNear is a part of */ Fts5ExprNode *pNode /* The "NEAR" node (FTS5_TERM) */ ){ - /* As this "NEAR" object is actually a single phrase that consists + /* As this "NEAR" object is actually a single phrase that consists ** of a single term only, grab pointers into the poslist managed by the - ** fts5_index.c iterator object. This is much faster than synthesizing + ** fts5_index.c iterator object. This is much faster than synthesizing ** a new poslist the way we have to for more complicated phrase or NEAR ** expressions. */ Fts5ExprPhrase *pPhrase = pNode->pNear->apPhrase[0]; @@ -1051,7 +1051,7 @@ static int fts5ExprNodeTest_TERM( ** xNext() method for a node of type FTS5_TERM. */ static int fts5ExprNodeNext_TERM( - Fts5Expr *pExpr, + Fts5Expr *pExpr, Fts5ExprNode *pNode, int bFromValid, i64 iFrom @@ -1094,7 +1094,7 @@ static void fts5ExprNodeTest_OR( } static int fts5ExprNodeNext_OR( - Fts5Expr *pExpr, + Fts5Expr *pExpr, Fts5ExprNode *pNode, int bFromValid, i64 iFrom @@ -1106,7 +1106,7 @@ static int fts5ExprNodeNext_OR( Fts5ExprNode *p1 = pNode->apChild[i]; assert( p1->bEof || fts5RowidCmp(pExpr, p1->iRowid, iLast)>=0 ); if( p1->bEof==0 ){ - if( (p1->iRowid==iLast) + if( (p1->iRowid==iLast) || (bFromValid && fts5RowidCmp(pExpr, p1->iRowid, iFrom)<0) ){ int rc = fts5ExprNodeNext(pExpr, p1, bFromValid, iFrom); @@ -1172,7 +1172,7 @@ static int fts5ExprNodeTest_AND( } static int fts5ExprNodeNext_AND( - Fts5Expr *pExpr, + Fts5Expr *pExpr, Fts5ExprNode *pNode, int bFromValid, i64 iFrom @@ -1213,7 +1213,7 @@ static int fts5ExprNodeTest_NOT( } static int fts5ExprNodeNext_NOT( - Fts5Expr *pExpr, + Fts5Expr *pExpr, Fts5ExprNode *pNode, int bFromValid, i64 iFrom @@ -1267,7 +1267,7 @@ static int fts5ExprNodeTest( return rc; } - + /* ** Set node pNode, which is part of expression pExpr, to point to the first ** match. If there are no matches, set the Node.bEof flag to indicate EOF. @@ -1321,8 +1321,8 @@ static int fts5ExprNodeFirst(Fts5Expr *pExpr, Fts5ExprNode *pNode){ /* ** Begin iterating through the set of documents in index pIdx matched by -** the MATCH expression passed as the first argument. If the "bDesc" -** parameter is passed a non-zero value, iteration is in descending rowid +** the MATCH expression passed as the first argument. If the "bDesc" +** parameter is passed a non-zero value, iteration is in descending rowid ** order. Or, if it is zero, in ascending order. ** ** If iterating in ascending rowid order (bDesc==0), the first document @@ -1344,9 +1344,9 @@ int sqlite3Fts5ExprFirst(Fts5Expr *p, Fts5Index *pIdx, i64 iFirst, int bDesc){ /* If not at EOF but the current rowid occurs earlier than iFirst in ** the iteration order, move to document iFirst or later. */ - if( rc==SQLITE_OK - && 0==pRoot->bEof - && fts5RowidCmp(p, pRoot->iRowid, iFirst)<0 + if( rc==SQLITE_OK + && 0==pRoot->bEof + && fts5RowidCmp(p, pRoot->iRowid, iFirst)<0 ){ rc = fts5ExprNodeNext(p, pRoot, 1, iFirst); } @@ -1360,7 +1360,7 @@ int sqlite3Fts5ExprFirst(Fts5Expr *p, Fts5Index *pIdx, i64 iFirst, int bDesc){ } /* -** Move to the next document +** Move to the next document ** ** Return SQLITE_OK if successful, or an SQLite error code otherwise. It ** is not considered an error if the query does not match any documents. @@ -1530,7 +1530,7 @@ static int fts5ParseTokenize( Fts5ExprPhrase *pNew; int nNew = SZALLOC + (pPhrase ? pPhrase->nTerm : 0); - pNew = (Fts5ExprPhrase*)sqlite3_realloc(pPhrase, + pNew = (Fts5ExprPhrase*)sqlite3_realloc(pPhrase, sizeof(Fts5ExprPhrase) + sizeof(Fts5ExprTerm) * nNew ); if( pNew==0 ){ @@ -1647,8 +1647,8 @@ Fts5ExprPhrase *sqlite3Fts5ParseTerm( ** expression passed as the second argument. */ int sqlite3Fts5ExprClonePhrase( - Fts5Expr *pExpr, - int iPhrase, + Fts5Expr *pExpr, + int iPhrase, Fts5Expr **ppNew ){ int rc = SQLITE_OK; /* Return code */ @@ -1659,15 +1659,15 @@ int sqlite3Fts5ExprClonePhrase( pOrig = pExpr->apExprPhrase[iPhrase]; pNew = (Fts5Expr*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5Expr)); if( rc==SQLITE_OK ){ - pNew->apExprPhrase = (Fts5ExprPhrase**)sqlite3Fts5MallocZero(&rc, + pNew->apExprPhrase = (Fts5ExprPhrase**)sqlite3Fts5MallocZero(&rc, sizeof(Fts5ExprPhrase*)); } if( rc==SQLITE_OK ){ - pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&rc, + pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5ExprNode)); } if( rc==SQLITE_OK ){ - pNew->pRoot->pNear = (Fts5ExprNearset*)sqlite3Fts5MallocZero(&rc, + pNew->pRoot->pNear = (Fts5ExprNearset*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5ExprNearset) + sizeof(Fts5ExprPhrase*)); } if( rc==SQLITE_OK ){ @@ -1675,7 +1675,7 @@ int sqlite3Fts5ExprClonePhrase( if( pColsetOrig ){ int nByte = sizeof(Fts5Colset) + (pColsetOrig->nCol-1) * sizeof(int); Fts5Colset *pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&rc, nByte); - if( pColset ){ + if( pColset ){ memcpy(pColset, pColsetOrig, nByte); } pNew->pRoot->pNear->pColset = pColset; @@ -1745,7 +1745,7 @@ void sqlite3Fts5ParseNear(Fts5Parse *pParse, Fts5Token *pTok){ } void sqlite3Fts5ParseSetDistance( - Fts5Parse *pParse, + Fts5Parse *pParse, Fts5ExprNearset *pNear, Fts5Token *p ){ @@ -1774,7 +1774,7 @@ void sqlite3Fts5ParseSetDistance( ** The second argument passed to this function may be NULL, or it may be ** an existing Fts5Colset object. This function returns a pointer to ** a new colset object containing the contents of (p) with new value column -** number iCol appended. +** number iCol appended. ** ** If an OOM error occurs, store an error code in pParse and return NULL. ** The old colset object (if any) is not freed in this case. @@ -1824,7 +1824,7 @@ Fts5Colset *sqlite3Fts5ParseColsetInvert(Fts5Parse *pParse, Fts5Colset *p){ Fts5Colset *pRet; int nCol = pParse->pConfig->nCol; - pRet = (Fts5Colset*)sqlite3Fts5MallocZero(&pParse->rc, + pRet = (Fts5Colset*)sqlite3Fts5MallocZero(&pParse->rc, sizeof(Fts5Colset) + sizeof(int)*nCol ); if( pRet ){ @@ -1876,9 +1876,9 @@ Fts5Colset *sqlite3Fts5ParseColset( } void sqlite3Fts5ParseSetColset( - Fts5Parse *pParse, - Fts5ExprNearset *pNear, - Fts5Colset *pColset + Fts5Parse *pParse, + Fts5ExprNearset *pNear, + Fts5Colset *pColset ){ if( pParse->pConfig->eDetail==FTS5_DETAIL_NONE ){ pParse->rc = SQLITE_ERROR; @@ -1900,7 +1900,7 @@ static void fts5ExprAssignXNext(Fts5ExprNode *pNode){ switch( pNode->eType ){ case FTS5_STRING: { Fts5ExprNearset *pNear = pNode->pNear; - if( pNear->nPhrase==1 && pNear->apPhrase[0]->nTerm==1 + if( pNear->nPhrase==1 && pNear->apPhrase[0]->nTerm==1 && pNear->apPhrase[0]->aTerm[0].pSynonym==0 ){ pNode->eType = FTS5_TERM; @@ -1955,7 +1955,7 @@ Fts5ExprNode *sqlite3Fts5ParseNode( if( pParse->rc==SQLITE_OK ){ int nChild = 0; /* Number of children of returned node */ int nByte; /* Bytes of space to allocate for this node */ - + assert( (eType!=FTS5_STRING && !pNear) || (eType==FTS5_STRING && !pLeft && !pRight) ); @@ -1988,14 +1988,14 @@ Fts5ExprNode *sqlite3Fts5ParseNode( } } - if( pParse->pConfig->eDetail!=FTS5_DETAIL_FULL + if( pParse->pConfig->eDetail!=FTS5_DETAIL_FULL && (pNear->nPhrase!=1 || pNear->apPhrase[0]->nTerm>1) ){ assert( pParse->rc==SQLITE_OK ); pParse->rc = SQLITE_ERROR; assert( pParse->zErr==0 ); pParse->zErr = sqlite3_mprintf( - "fts5: %s queries are not supported (detail!=full)", + "fts5: %s queries are not supported (detail!=full)", pNear->nPhrase==1 ? "phrase": "NEAR" ); sqlite3_free(pRet); @@ -2031,14 +2031,14 @@ Fts5ExprNode *sqlite3Fts5ParseImplicitAnd( sqlite3Fts5ParseNodeFree(pRight); }else{ - assert( pLeft->eType==FTS5_STRING + assert( pLeft->eType==FTS5_STRING || pLeft->eType==FTS5_TERM || pLeft->eType==FTS5_EOF || pLeft->eType==FTS5_AND ); - assert( pRight->eType==FTS5_STRING - || pRight->eType==FTS5_TERM - || pRight->eType==FTS5_EOF + assert( pRight->eType==FTS5_STRING + || pRight->eType==FTS5_TERM + || pRight->eType==FTS5_EOF ); if( pLeft->eType==FTS5_AND ){ @@ -2046,9 +2046,9 @@ Fts5ExprNode *sqlite3Fts5ParseImplicitAnd( }else{ pPrev = pLeft; } - assert( pPrev->eType==FTS5_STRING - || pPrev->eType==FTS5_TERM - || pPrev->eType==FTS5_EOF + assert( pPrev->eType==FTS5_STRING + || pPrev->eType==FTS5_TERM + || pPrev->eType==FTS5_EOF ); if( pRight->eType==FTS5_EOF ){ @@ -2130,20 +2130,20 @@ static char *fts5PrintfAppend(char *zApp, const char *zFmt, ...){ } /* -** Compose a tcl-readable representation of expression pExpr. Return a -** pointer to a buffer containing that representation. It is the -** responsibility of the caller to at some point free the buffer using +** Compose a tcl-readable representation of expression pExpr. Return a +** pointer to a buffer containing that representation. It is the +** responsibility of the caller to at some point free the buffer using ** sqlite3_free(). */ static char *fts5ExprPrintTcl( - Fts5Config *pConfig, + Fts5Config *pConfig, const char *zNearsetCmd, Fts5ExprNode *pExpr ){ char *zRet = 0; if( pExpr->eType==FTS5_STRING || pExpr->eType==FTS5_TERM ){ Fts5ExprNearset *pNear = pExpr->pNear; - int i; + int i; int iTerm; zRet = fts5PrintfAppend(zRet, "%s ", zNearsetCmd); @@ -2193,9 +2193,9 @@ static char *fts5ExprPrintTcl( switch( pExpr->eType ){ case FTS5_AND: zOp = "AND"; break; case FTS5_NOT: zOp = "NOT"; break; - default: + default: assert( pExpr->eType==FTS5_OR ); - zOp = "OR"; + zOp = "OR"; break; } @@ -2221,7 +2221,7 @@ static char *fts5ExprPrint(Fts5Config *pConfig, Fts5ExprNode *pExpr){ }else if( pExpr->eType==FTS5_STRING || pExpr->eType==FTS5_TERM ){ Fts5ExprNearset *pNear = pExpr->pNear; - int i; + int i; int iTerm; if( pNear->pColset ){ @@ -2266,9 +2266,9 @@ static char *fts5ExprPrint(Fts5Config *pConfig, Fts5ExprNode *pExpr){ switch( pExpr->eType ){ case FTS5_AND: zOp = " AND "; break; case FTS5_NOT: zOp = " NOT "; break; - default: + default: assert( pExpr->eType==FTS5_OR ); - zOp = " OR "; + zOp = " OR "; break; } @@ -2280,7 +2280,7 @@ static char *fts5ExprPrint(Fts5Config *pConfig, Fts5ExprNode *pExpr){ }else{ int e = pExpr->apChild[i]->eType; int b = (e!=FTS5_STRING && e!=FTS5_TERM && e!=FTS5_EOF); - zRet = fts5PrintfAppend(zRet, "%s%s%z%s", + zRet = fts5PrintfAppend(zRet, "%s%s%z%s", (i==0 ? "" : zOp), (b?"(":""), z, (b?")":"") ); @@ -2396,7 +2396,7 @@ static void fts5ExprFunctionTcl( /* ** The implementation of an SQLite user-defined-function that accepts a -** single integer as an argument. If the integer is an alpha-numeric +** single integer as an argument. If the integer is an alpha-numeric ** unicode code point, 1 is returned. Otherwise 0. */ static void fts5ExprIsAlnum( @@ -2406,7 +2406,7 @@ static void fts5ExprIsAlnum( ){ int iCode; if( nArg!=1 ){ - sqlite3_result_error(pCtx, + sqlite3_result_error(pCtx, "wrong number of arguments to function fts5_isalnum", -1 ); return; @@ -2421,7 +2421,7 @@ static void fts5ExprFold( sqlite3_value **apVal /* Function arguments */ ){ if( nArg!=1 && nArg!=2 ){ - sqlite3_result_error(pCtx, + sqlite3_result_error(pCtx, "wrong number of arguments to function fts5_fold", -1 ); }else{ @@ -2513,7 +2513,7 @@ Fts5PoslistPopulator *sqlite3Fts5ExprClearPoslists(Fts5Expr *pExpr, int bLive){ Fts5Buffer *pBuf = &pExpr->apExprPhrase[i]->poslist; Fts5ExprNode *pNode = pExpr->apExprPhrase[i]->pNode; assert( pExpr->apExprPhrase[i]->nTerm==1 ); - if( bLive && + if( bLive && (pBuf->n==0 || pNode->iRowid!=pExpr->pRoot->iRowid || pNode->bEof) ){ pRet[i].bMiss = 1; @@ -2580,9 +2580,9 @@ static int fts5ExprPopulatePoslistsCb( int sqlite3Fts5ExprPopulatePoslists( Fts5Config *pConfig, - Fts5Expr *pExpr, + Fts5Expr *pExpr, Fts5PoslistPopulator *aPopulator, - int iCol, + int iCol, const char *z, int n ){ int i; @@ -2594,7 +2594,7 @@ int sqlite3Fts5ExprPopulatePoslists( for(i=0; inPhrase; i++){ Fts5ExprNode *pNode = pExpr->apExprPhrase[i]->pNode; Fts5Colset *pColset = pNode->pNear->pColset; - if( (pColset && 0==fts5ExprColsetTest(pColset, iCol)) + if( (pColset && 0==fts5ExprColsetTest(pColset, iCol)) || aPopulator[i].bMiss ){ aPopulator[i].bOk = 0; @@ -2603,7 +2603,7 @@ int sqlite3Fts5ExprPopulatePoslists( } } - return sqlite3Fts5Tokenize(pConfig, + return sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, z, n, (void*)&sCtx, fts5ExprPopulatePoslistsCb ); } @@ -2668,12 +2668,12 @@ void sqlite3Fts5ExprCheckPoslists(Fts5Expr *pExpr, i64 iRowid){ } /* -** This function is only called for detail=columns tables. +** This function is only called for detail=columns tables. */ int sqlite3Fts5ExprPhraseCollist( - Fts5Expr *pExpr, - int iPhrase, - const u8 **ppCollist, + Fts5Expr *pExpr, + int iPhrase, + const u8 **ppCollist, int *pnCollist ){ Fts5ExprPhrase *pPhrase = pExpr->apExprPhrase[iPhrase]; @@ -2683,8 +2683,8 @@ int sqlite3Fts5ExprPhraseCollist( assert( iPhrase>=0 && iPhrasenPhrase ); assert( pExpr->pConfig->eDetail==FTS5_DETAIL_COLUMNS ); - if( pNode->bEof==0 - && pNode->iRowid==pExpr->pRoot->iRowid + if( pNode->bEof==0 + && pNode->iRowid==pExpr->pRoot->iRowid && pPhrase->poslist.n>0 ){ Fts5ExprTerm *pTerm = &pPhrase->aTerm[0]; diff --git a/third_party/sqlite/src/ext/fts5/fts5_hash.c b/third_party/sqlite/src/ext/fts5/fts5_hash.c index afa2a30739156..46d99cf7e6477 100644 --- a/third_party/sqlite/src/ext/fts5/fts5_hash.c +++ b/third_party/sqlite/src/ext/fts5/fts5_hash.c @@ -35,9 +35,9 @@ struct Fts5Hash { }; /* -** Each entry in the hash table is represented by an object of the +** Each entry in the hash table is represented by an object of the ** following type. Each object, its key (zKey[]) and its current data -** are stored in a single memory allocation. The position list data +** are stored in a single memory allocation. The position list data ** immediately follows the key data in memory. ** ** The data that follows the key is in a similar, but not identical format @@ -58,7 +58,7 @@ struct Fts5Hash { struct Fts5HashEntry { Fts5HashEntry *pHashNext; /* Next hash entry with same hash-key */ Fts5HashEntry *pScanNext; /* Next entry in sorted order */ - + int nAlloc; /* Total size of allocation */ int iSzPoslist; /* Offset of space for 4-byte poslist size */ int nData; /* Total bytes of data (incl. structure) */ @@ -238,15 +238,15 @@ int sqlite3Fts5HashWrite( u8 *pPtr; int nIncr = 0; /* Amount to increment (*pHash->pnByte) by */ int bNew; /* If non-delete entry should be written */ - + bNew = (pHash->eDetail==FTS5_DETAIL_FULL); /* Attempt to locate an existing hash entry */ iHash = fts5HashKey2(pHash->nSlot, (u8)bByte, (const u8*)pToken, nToken); for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ - if( p->zKey[0]==bByte + if( p->zKey[0]==bByte && p->nKey==nToken - && memcmp(&p->zKey[1], pToken, nToken)==0 + && memcmp(&p->zKey[1], pToken, nToken)==0 ){ break; } @@ -293,8 +293,8 @@ int sqlite3Fts5HashWrite( nIncr += p->nData; }else{ - /* Appending to an existing hash-entry. Check that there is enough - ** space to append the largest possible new entry. Worst case scenario + /* Appending to an existing hash-entry. Check that there is enough + ** space to append the largest possible new entry. Worst case scenario ** is: ** ** + 9 bytes for a new rowid, @@ -420,7 +420,7 @@ static Fts5HashEntry *fts5HashEntryMerge( ** list. */ static int fts5HashEntrySort( - Fts5Hash *pHash, + Fts5Hash *pHash, const char *pTerm, int nTerm, /* Query prefix, if any */ Fts5HashEntry **ppSorted ){ diff --git a/third_party/sqlite/src/ext/fts5/fts5_index.c b/third_party/sqlite/src/ext/fts5/fts5_index.c index 750e0ca82d0ff..ad59ef03048f1 100644 --- a/third_party/sqlite/src/ext/fts5/fts5_index.c +++ b/third_party/sqlite/src/ext/fts5/fts5_index.c @@ -10,7 +10,7 @@ ** ****************************************************************************** ** -** Low level access to the FTS index stored in the database file. The +** Low level access to the FTS index stored in the database file. The ** routines in this file file implement all read and write access to the ** %_data table. Other parts of the system access this functionality via ** the interface defined in fts5Int.h. @@ -26,10 +26,10 @@ ** As well as the main term index, there may be up to 31 prefix indexes. ** The format is similar to FTS3/4, except that: ** -** * all segment b-tree leaf data is stored in fixed size page records -** (e.g. 1000 bytes). A single doclist may span multiple pages. Care is -** taken to ensure it is possible to iterate in either direction through -** the entries in a doclist, or to seek to a specific entry within a +** * all segment b-tree leaf data is stored in fixed size page records +** (e.g. 1000 bytes). A single doclist may span multiple pages. Care is +** taken to ensure it is possible to iterate in either direction through +** the entries in a doclist, or to seek to a specific entry within a ** doclist, without loading it into memory. ** ** * large doclists that span many pages have associated "doclist index" @@ -62,14 +62,14 @@ ** CREATE TABLE %_data(id INTEGER PRIMARY KEY, block BLOB); ** ** , contains the following 5 types of records. See the comments surrounding -** the FTS5_*_ROWID macros below for a description of how %_data rowids are +** the FTS5_*_ROWID macros below for a description of how %_data rowids are ** assigned to each fo them. ** ** 1. Structure Records: ** ** The set of segments that make up an index - the index structure - are ** recorded in a single record within the %_data table. The record consists -** of a single 32-bit configuration cookie value followed by a list of +** of a single 32-bit configuration cookie value followed by a list of ** SQLite varints. If the FTS table features more than one index (because ** there are one or more prefix indexes), it is guaranteed that all share ** the same cookie value. @@ -101,7 +101,7 @@ ** ** TERM/DOCLIST FORMAT: ** -** Most of each segment leaf is taken up by term/doclist data. The +** Most of each segment leaf is taken up by term/doclist data. The ** general format of term/doclist, starting with the first term ** on the leaf page, is: ** @@ -144,7 +144,7 @@ ** ** PAGE FORMAT ** -** Each leaf page begins with a 4-byte header containing 2 16-bit +** Each leaf page begins with a 4-byte header containing 2 16-bit ** unsigned integer fields in big-endian format. They are: ** ** * The byte offset of the first rowid on the page, if it exists @@ -179,7 +179,7 @@ ** 5. Segment doclist indexes: ** ** Doclist indexes are themselves b-trees, however they usually consist of -** a single leaf record only. The format of each doclist index leaf page +** a single leaf record only. The format of each doclist index leaf page ** is: ** ** * Flags byte. Bits are: @@ -189,8 +189,8 @@ ** ** * First rowid on page indicated by previous field. As a varint. ** -** * A list of varints, one for each subsequent termless page. A -** positive delta if the termless page contains at least one rowid, +** * A list of varints, one for each subsequent termless page. A +** positive delta if the termless page contains at least one rowid, ** or an 0x00 byte otherwise. ** ** Internal doclist index nodes are: @@ -203,7 +203,7 @@ ** * Copy of first rowid on page indicated by previous field. As a varint. ** ** * A list of delta-encoded varints - the first rowid on each subsequent -** child page. +** child page. ** */ @@ -220,7 +220,7 @@ ** ** Each segment has a unique non-zero 16-bit id. ** -** The rowid for each segment leaf is found by passing the segment id and +** The rowid for each segment leaf is found by passing the segment id and ** the leaf page number to the FTS5_SEGMENT_ROWID macro. Leaves are numbered ** sequentially starting from 1. */ @@ -240,7 +240,7 @@ #define FTS5_DLIDX_ROWID(segid, height, pgno) fts5_dri(segid, 1, height, pgno) /* -** Maximum segments permitted in a single index +** Maximum segments permitted in a single index */ #define FTS5_MAX_SEGMENT 2000 @@ -322,7 +322,7 @@ struct Fts5DoclistIter { /* ** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the +** using an Fts5Structure record in memory. Which uses instances of the ** other Fts5StructureXXX types as components. */ struct Fts5StructureSegment { @@ -395,10 +395,10 @@ struct Fts5CResult { ** Current leaf page number within segment. ** ** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the +** Byte offset within the current leaf that is the first byte of the ** position list data (one byte passed the position-list size field). ** rowid field of the current entry. Usually this is the size field of the -** position list data. The exception is if the rowid for the current entry +** position list data. The exception is if the rowid for the current entry ** is the last thing on the leaf page. ** ** pLeaf: @@ -412,7 +412,7 @@ struct Fts5CResult { ** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: ** ** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist +** If set, set the iterator to point to EOF after the current doclist ** has been exhausted. Do not proceed to the next term in the segment. ** ** FTS5_SEGITER_REVERSE: @@ -441,7 +441,7 @@ struct Fts5SegIter { /* Next method */ void (*xNext)(Fts5Index*, Fts5SegIter*, int*); - /* The page and offset from which the current term was read. The offset + /* The page and offset from which the current term was read. The offset ** is the offset of the first rowid in the current doclist. */ int iTermLeafPgno; int iTermLeafOffset; @@ -464,7 +464,7 @@ struct Fts5SegIter { }; /* -** Argument is a pointer to an Fts5Data structure that contains a +** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. */ #define ASSERT_SZLEAF_OK(x) assert( \ @@ -474,7 +474,7 @@ struct Fts5SegIter { #define FTS5_SEGITER_ONETERM 0x01 #define FTS5_SEGITER_REVERSE 0x02 -/* +/* ** Argument is a pointer to an Fts5Data structure that contains a leaf ** page. This macro evaluates to true if the leaf contains no terms, or ** false if it contains at least one term. @@ -496,13 +496,13 @@ struct Fts5SegIter { ** on empty segments. ** ** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the +** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the ** comparison in this context is the index of the iterator that currently ** points to the smaller term/rowid combination. Iterators at EOF are ** considered to be greater than all other iterators. ** ** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. +** the smallest key overall. aFirst[0] is unused. ** ** poslist: ** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. @@ -565,7 +565,7 @@ static void fts5PutU16(u8 *aOut, u16 iVal){ static u16 fts5GetU16(const u8 *aIn){ return ((u16)aIn[0] << 8) + aIn[1]; -} +} /* ** Allocate and return a buffer at least nByte bytes in size. @@ -632,7 +632,7 @@ static void fts5CloseReader(Fts5Index *p){ /* ** Retrieve a record from the %_data table. ** -** If an error occurs, NULL is returned and an error left in the +** If an error occurs, NULL is returned and an error left in the ** Fts5Index object. */ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){ @@ -655,11 +655,11 @@ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){ if( rc==SQLITE_ABORT ) rc = SQLITE_OK; } - /* If the blob handle is not open at this point, open it and seek + /* If the blob handle is not open at this point, open it and seek ** to the requested entry. */ if( p->pReader==0 && rc==SQLITE_OK ){ Fts5Config *pConfig = p->pConfig; - rc = sqlite3_blob_open(pConfig->db, + rc = sqlite3_blob_open(pConfig->db, pConfig->zDb, p->zDataTbl, "block", iRowid, 0, &p->pReader ); } @@ -667,7 +667,7 @@ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){ /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. ** All the reasons those functions might return SQLITE_ERROR - missing - ** table, missing row, non-blob/text in block column - indicate + ** table, missing row, non-blob/text in block column - indicate ** backing store corruption. */ if( rc==SQLITE_ERROR ) rc = FTS5_CORRUPT; @@ -748,7 +748,7 @@ static void fts5DataWrite(Fts5Index *p, i64 iRowid, const u8 *pData, int nData){ if( p->pWriter==0 ){ Fts5Config *pConfig = p->pConfig; fts5IndexPrepareStmt(p, &p->pWriter, sqlite3_mprintf( - "REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)", + "REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)", pConfig->zDb, pConfig->zName )); if( p->rc ) return; @@ -772,7 +772,7 @@ static void fts5DataDelete(Fts5Index *p, i64 iFirst, i64 iLast){ int rc; Fts5Config *pConfig = p->pConfig; char *zSql = sqlite3_mprintf( - "DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?", + "DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?", pConfig->zDb, pConfig->zName ); if( zSql==0 ){ @@ -815,7 +815,7 @@ static void fts5DataRemoveSegment(Fts5Index *p, int iSegid){ } /* -** Release a reference to an Fts5Structure object returned by an earlier +** Release a reference to an Fts5Structure object returned by an earlier ** call to fts5StructureRead() or fts5StructureDecode(). */ static void fts5StructureRelease(Fts5Structure *pStruct){ @@ -890,7 +890,7 @@ static int fts5StructureDecode( i += fts5GetVarint32(&pData[i], pLvl->nMerge); i += fts5GetVarint32(&pData[i], nTotal); assert( nTotal>=pLvl->nMerge ); - pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&rc, + pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&rc, nTotal * sizeof(Fts5StructureSegment) ); } @@ -946,10 +946,10 @@ static void fts5StructureAddLevel(int *pRc, Fts5Structure **ppStruct){ ** segments. */ static void fts5StructureExtendLevel( - int *pRc, - Fts5Structure *pStruct, - int iLvl, - int nExtra, + int *pRc, + Fts5Structure *pStruct, + int iLvl, + int nExtra, int bInsert ){ if( *pRc==SQLITE_OK ){ @@ -1003,7 +1003,7 @@ static i64 fts5IndexDataVersion(Fts5Index *p){ if( p->rc==SQLITE_OK ){ if( p->pDataVersion==0 ){ - p->rc = fts5IndexPrepareStmt(p, &p->pDataVersion, + p->rc = fts5IndexPrepareStmt(p, &p->pDataVersion, sqlite3_mprintf("PRAGMA %Q.data_version", p->pConfig->zDb) ); if( p->rc ) return 0; @@ -1022,7 +1022,7 @@ static i64 fts5IndexDataVersion(Fts5Index *p){ ** Read, deserialize and return the structure record. ** ** The Fts5Structure.aLevel[] and each Fts5StructureLevel.aSeg[] array -** are over-allocated as described for function fts5StructureDecode() +** are over-allocated as described for function fts5StructureDecode() ** above. ** ** If an error occurs, NULL is returned and an error code left in the @@ -1171,8 +1171,8 @@ static int fts5SegmentSize(Fts5StructureSegment *pSeg){ } /* -** Return a copy of index structure pStruct. Except, promote as many -** segments as possible to level iPromote. If an OOM occurs, NULL is +** Return a copy of index structure pStruct. Except, promote as many +** segments as possible to level iPromote. If an OOM occurs, NULL is ** returned. */ static void fts5StructurePromoteTo( @@ -1212,8 +1212,8 @@ static void fts5StructurePromoteTo( ** ** b) If the segment just written is larger than the newest segment on ** the next populated level, then that segment, and any other adjacent -** segments that are also smaller than the one just written, are -** promoted. +** segments that are also smaller than the one just written, are +** promoted. ** ** If one or more segments are promoted, the structure object is updated ** to reflect this. @@ -1247,7 +1247,7 @@ static void fts5StructurePromote( if( sz>szMax ) szMax = sz; } if( szMax>=szSeg ){ - /* Condition (a) is true. Promote the newest segment on level + /* Condition (a) is true. Promote the newest segment on level ** iLvl to level iTst. */ iPromote = iTst; szPromote = szMax; @@ -1266,7 +1266,7 @@ static void fts5StructurePromote( /* -** Advance the iterator passed as the only argument. If the end of the +** Advance the iterator passed as the only argument. If the end of the ** doclist-index page is reached, return non-zero. */ static int fts5DlidxLvlNext(Fts5DlidxLvl *pLvl){ @@ -1281,7 +1281,7 @@ static int fts5DlidxLvlNext(Fts5DlidxLvl *pLvl){ }else{ int iOff; for(iOff=pLvl->iOff; iOffnn; iOff++){ - if( pData->p[iOff] ) break; + if( pData->p[iOff] ) break; } if( iOffnn ){ @@ -1311,7 +1311,7 @@ static int fts5DlidxIterNextR(Fts5Index *p, Fts5DlidxIter *pIter, int iLvl){ if( pLvl[1].bEof==0 ){ fts5DataRelease(pLvl->pData); memset(pLvl, 0, sizeof(Fts5DlidxLvl)); - pLvl->pData = fts5DataRead(p, + pLvl->pData = fts5DataRead(p, FTS5_DLIDX_ROWID(pIter->iSegid, iLvl, pLvl[1].iLeafPgno) ); if( pLvl->pData ) fts5DlidxLvlNext(pLvl); @@ -1331,7 +1331,7 @@ static int fts5DlidxIterNext(Fts5Index *p, Fts5DlidxIter *pIter){ ** points to the first rowid in the doclist-index. ** ** pData: -** pointer to doclist-index record, +** pointer to doclist-index record, ** ** When this function is called pIter->iLeafPgno is the page number the ** doclist is associated with (the one featuring the term). @@ -1362,7 +1362,7 @@ static void fts5DlidxIterLast(Fts5Index *p, Fts5DlidxIter *pIter){ Fts5DlidxLvl *pChild = &pLvl[-1]; fts5DataRelease(pChild->pData); memset(pChild, 0, sizeof(Fts5DlidxLvl)); - pChild->pData = fts5DataRead(p, + pChild->pData = fts5DataRead(p, FTS5_DLIDX_ROWID(pIter->iSegid, i-1, pLvl->iLeafPgno) ); } @@ -1385,8 +1385,8 @@ static int fts5DlidxLvlPrev(Fts5DlidxLvl *pLvl){ int ii; int nZero = 0; - /* Currently iOff points to the first byte of a varint. This block - ** decrements iOff until it points to the first byte of the previous + /* Currently iOff points to the first byte of a varint. This block + ** decrements iOff until it points to the first byte of the previous ** varint. Taking care not to read any memory locations that occur ** before the buffer in memory. */ iLimit = (iOff>9 ? iOff-9 : 0); @@ -1431,7 +1431,7 @@ static int fts5DlidxIterPrevR(Fts5Index *p, Fts5DlidxIter *pIter, int iLvl){ if( pLvl[1].bEof==0 ){ fts5DataRelease(pLvl->pData); memset(pLvl, 0, sizeof(Fts5DlidxLvl)); - pLvl->pData = fts5DataRead(p, + pLvl->pData = fts5DataRead(p, FTS5_DLIDX_ROWID(pIter->iSegid, iLvl, pLvl[1].iLeafPgno) ); if( pLvl->pData ){ @@ -1530,7 +1530,7 @@ static void fts5SegIterNextPage( pIter->pLeaf = pIter->pNextLeaf; pIter->pNextLeaf = 0; }else if( pIter->iLeafPgno<=pSeg->pgnoLast ){ - pIter->pLeaf = fts5LeafRead(p, + pIter->pLeaf = fts5LeafRead(p, FTS5_SEGMENT_ROWID(pSeg->iSegid, pIter->iLeafPgno) ); }else{ @@ -1574,7 +1574,7 @@ static int fts5GetPoslistSize(const u8 *p, int *pnSz, int *pbDel){ ** Fts5SegIter.nPos ** Fts5SegIter.bDel ** -** Leave Fts5SegIter.iLeafOffset pointing to the first byte of the +** Leave Fts5SegIter.iLeafOffset pointing to the first byte of the ** position list content (if any). */ static void fts5SegIterLoadNPos(Fts5Index *p, Fts5SegIter *pIter){ @@ -1625,7 +1625,7 @@ static void fts5SegIterLoadRowid(Fts5Index *p, Fts5SegIter *pIter){ } /* -** Fts5SegIter.iLeafOffset currently points to the first byte of the +** Fts5SegIter.iLeafOffset currently points to the first byte of the ** "nSuffix" field of a term. Function parameter nKeep contains the value ** of the "nPrefix" field (if there was one - it is passed 0 if this is ** the first term in the segment). @@ -1636,7 +1636,7 @@ static void fts5SegIterLoadRowid(Fts5Index *p, Fts5SegIter *pIter){ ** Fts5SegIter.rowid ** ** accordingly and leaves (Fts5SegIter.iLeafOffset) set to the content of -** the first position list. The position list belonging to document +** the first position list. The position list belonging to document ** (Fts5SegIter.iRowid). */ static void fts5SegIterLoadTerm(Fts5Index *p, Fts5SegIter *pIter, int nKeep){ @@ -1683,10 +1683,10 @@ static void fts5SegIterSetNext(Fts5Index *p, Fts5SegIter *pIter){ /* ** Initialize the iterator object pIter to iterate through the entries in -** segment pSeg. The iterator is left pointing to the first entry when +** segment pSeg. The iterator is left pointing to the first entry when ** this function returns. ** -** If an error occurs, Fts5Index.rc is set to an appropriate error code. If +** If an error occurs, Fts5Index.rc is set to an appropriate error code. If ** an error has already occurred when this function is called, it is a no-op. */ static void fts5SegIterInit( @@ -1731,8 +1731,8 @@ static void fts5SegIterInit( ** the position-list size field for the first relevant rowid on the page. ** Fts5SegIter.rowid is set, but nPos and bDel are not. ** -** This function advances the iterator so that it points to the last -** relevant rowid on the page and, if necessary, initializes the +** This function advances the iterator so that it points to the last +** relevant rowid on the page and, if necessary, initializes the ** aRowidOffset[] and iRowidOffset variables. At this point the iterator ** is in its regular state - Fts5SegIter.iLeafOffset points to the first ** byte of the position list content associated with said rowid. @@ -1952,10 +1952,10 @@ static void fts5SegIterNext_None( /* -** Advance iterator pIter to the next entry. +** Advance iterator pIter to the next entry. ** -** If an error occurs, Fts5Index.rc is set to an appropriate error code. It -** is not considered an error if the iterator reaches EOF. If an error has +** If an error occurs, Fts5Index.rc is set to an appropriate error code. It +** is not considered an error if the iterator reaches EOF. If an error has ** already occurred when this function is called, it is a no-op. */ static void fts5SegIterNext( @@ -2066,7 +2066,7 @@ static void fts5SegIterNext( }else{ /* The following could be done by calling fts5SegIterLoadNPos(). But ** this block is particularly performance critical, so equivalent - ** code is inlined. + ** code is inlined. ** ** Later: Switched back to fts5SegIterLoadNPos() because it supports ** detail=none mode. Not ideal. @@ -2146,7 +2146,7 @@ static void fts5SegIterReverse(Fts5Index *p, Fts5SegIter *pIter){ } /* If pLast is NULL at this point, then the last rowid for this doclist - ** lies on the page currently indicated by the iterator. In this case + ** lies on the page currently indicated by the iterator. In this case ** pIter->iLeafOffset is already set to point to the position-list size ** field associated with the first relevant rowid on the page. ** @@ -2176,8 +2176,8 @@ static void fts5SegIterReverse(Fts5Index *p, Fts5SegIter *pIter){ /* ** Iterator pIter currently points to the first rowid of a doclist. -** There is a doclist-index associated with the final term on the current -** page. If the current term is the last term on the page, load the +** There is a doclist-index associated with the final term on the current +** page. If the current term is the last term on the page, load the ** doclist-index from disk and initialize an iterator at (pIter->pDlidx). */ static void fts5SegIterLoadDlidx(Fts5Index *p, Fts5SegIter *pIter){ @@ -2191,8 +2191,8 @@ static void fts5SegIterLoadDlidx(Fts5Index *p, Fts5SegIter *pIter){ /* Check if the current doclist ends on this page. If it does, return ** early without loading the doclist-index (as it belongs to a different ** term. */ - if( pIter->iTermLeafPgno==pIter->iLeafPgno - && pIter->iEndofDoclistszLeaf + if( pIter->iTermLeafPgno==pIter->iLeafPgno + && pIter->iEndofDoclistszLeaf ){ return; } @@ -2353,7 +2353,7 @@ static sqlite3_stmt *fts5IdxSelectStmt(Fts5Index *p){ ** Initialize the object pIter to point to term pTerm/nTerm within segment ** pSeg. If there is no such term in the index, the iterator is set to EOF. ** -** If an error occurs, Fts5Index.rc is set to an appropriate error code. If +** If an error occurs, Fts5Index.rc is set to an appropriate error code. If ** an error has already occurred when this function is called, it is a no-op. */ static void fts5SegIterSeekInit( @@ -2432,10 +2432,10 @@ static void fts5SegIterSeekInit( /* ** Initialize the object pIter to point to term pTerm/nTerm within the -** in-memory hash table. If there is no such term in the hash-table, the +** in-memory hash table. If there is no such term in the hash-table, the ** iterator is set to EOF. ** -** If an error occurs, Fts5Index.rc is set to an appropriate error code. If +** If an error occurs, Fts5Index.rc is set to an appropriate error code. If ** an error has already occurred when this function is called, it is a no-op. */ static void fts5SegIterHashInit( @@ -2506,7 +2506,7 @@ static void fts5SegIterClear(Fts5SegIter *pIter){ ** two iterators. */ static void fts5AssertComparisonResult( - Fts5Iter *pIter, + Fts5Iter *pIter, Fts5SegIter *p1, Fts5SegIter *p2, Fts5CResult *pRes @@ -2543,7 +2543,7 @@ static void fts5AssertComparisonResult( /* ** This function is a no-op unless SQLITE_DEBUG is defined when this module -** is compiled. In that case, this function is essentially an assert() +** is compiled. In that case, this function is essentially an assert() ** statement used to verify that the contents of the pIter->aFirst[] array ** are correct. */ @@ -2557,9 +2557,9 @@ static void fts5AssertMultiIterSetup(Fts5Index *p, Fts5Iter *pIter){ /* Check that pIter->iSwitchRowid is set correctly. */ for(i=0; inSeg; i++){ Fts5SegIter *p1 = &pIter->aSeg[i]; - assert( p1==pFirst - || p1->pLeaf==0 - || fts5BufferCompare(&pFirst->term, &p1->term) + assert( p1==pFirst + || p1->pLeaf==0 + || fts5BufferCompare(&pFirst->term, &p1->term) || p1->iRowid==pIter->iSwitchRowid || (p1->iRowidiSwitchRowid)==pIter->bRev ); @@ -2589,7 +2589,7 @@ static void fts5AssertMultiIterSetup(Fts5Index *p, Fts5Iter *pIter){ ** ** If the returned value is non-zero, then it is the index of an entry ** in the pIter->aSeg[] array that is (a) not at EOF, and (b) pointing -** to a key that is a duplicate of another, higher priority, +** to a key that is a duplicate of another, higher priority, ** segment-iterator in the pSeg->aSeg[] array. */ static int fts5MultiIterDoCompare(Fts5Iter *pIter, int iOut){ @@ -2680,7 +2680,7 @@ static void fts5SegIterGotoPage( } /* -** Advance the iterator passed as the second argument until it is at or +** Advance the iterator passed as the second argument until it is at or ** past rowid iFrom. Regardless of the value of iFrom, the iterator is ** always advanced at least once. */ @@ -2777,7 +2777,7 @@ static void fts5MultiIterAdvanced( ** If non-zero is returned, the caller should call fts5MultiIterAdvanced() ** on the iterator instead. That function does the same as this one, except ** that it deals with more complicated cases as well. -*/ +*/ static int fts5MultiIterAdvanceRowid( Fts5Iter *pIter, /* Iterator to update aFirst[] array for */ int iChanged, /* Index of sub-iterator just advanced */ @@ -2828,14 +2828,14 @@ static void fts5MultiIterSetEof(Fts5Iter *pIter){ } /* -** Move the iterator to the next entry. +** Move the iterator to the next entry. ** -** If an error occurs, an error code is left in Fts5Index.rc. It is not -** considered an error if the iterator reaches EOF, or if it is already at +** If an error occurs, an error code is left in Fts5Index.rc. It is not +** considered an error if the iterator reaches EOF, or if it is already at ** EOF when this function is called. */ static void fts5MultiIterNext( - Fts5Index *p, + Fts5Index *p, Fts5Iter *pIter, int bFrom, /* True if argument iFrom is valid */ i64 iFrom /* Advance at least as far as this */ @@ -2853,7 +2853,7 @@ static void fts5MultiIterNext( pSeg->xNext(p, pSeg, &bNewTerm); } - if( pSeg->pLeaf==0 || bNewTerm + if( pSeg->pLeaf==0 || bNewTerm || fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg) ){ fts5MultiIterAdvanced(p, pIter, iFirst, 1); @@ -2873,7 +2873,7 @@ static void fts5MultiIterNext( } static void fts5MultiIterNext2( - Fts5Index *p, + Fts5Index *p, Fts5Iter *pIter, int *pbNewTerm /* OUT: True if *might* be new term */ ){ @@ -2886,7 +2886,7 @@ static void fts5MultiIterNext2( assert( p->rc==SQLITE_OK ); pSeg->xNext(p, pSeg, &bNewTerm); - if( pSeg->pLeaf==0 || bNewTerm + if( pSeg->pLeaf==0 || bNewTerm || fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg) ){ fts5MultiIterAdvanced(p, pIter, iFirst, 1); @@ -2913,7 +2913,7 @@ static Fts5Iter *fts5MultiIterAlloc( int nSlot; /* Power of two >= nSeg */ for(nSlot=2; nSlotaSeg[] */ sizeof(Fts5CResult) * nSlot /* pNew->aFirst[] */ @@ -2928,8 +2928,8 @@ static Fts5Iter *fts5MultiIterAlloc( } static void fts5PoslistCallback( - Fts5Index *pUnused, - void *pContext, + Fts5Index *pUnused, + void *pContext, const u8 *pChunk, int nChunk ){ UNUSED_PARAM(pUnused); @@ -2966,8 +2966,8 @@ static int fts5IndexColsetTest(Fts5Colset *pColset, int iCol){ } static void fts5PoslistOffsetsCallback( - Fts5Index *pUnused, - void *pContext, + Fts5Index *pUnused, + void *pContext, const u8 *pChunk, int nChunk ){ PoslistOffsetsCtx *pCtx = (PoslistOffsetsCtx*)pContext; @@ -2990,7 +2990,7 @@ static void fts5PoslistOffsetsCallback( static void fts5PoslistFilterCallback( Fts5Index *pUnused, - void *pContext, + void *pContext, const u8 *pChunk, int nChunk ){ PoslistCallbackCtx *pCtx = (PoslistCallbackCtx*)pContext; @@ -3134,7 +3134,7 @@ static int fts5IndexExtractCol( while( iCol>iCurrent ){ /* Advance pointer p until it points to pEnd or an 0x01 byte that is ** not part of a varint. Note that it is not possible for a negative - ** or extremely large varint to occur within an uncorrupted position + ** or extremely large varint to occur within an uncorrupted position ** list. So the last byte of each varint may be assumed to have a clear ** 0x80 bit. */ while( *p!=0x01 ){ @@ -3199,7 +3199,7 @@ static void fts5IterSetOutputs_Nocolset(Fts5Iter *pIter, Fts5SegIter *pSeg){ assert( pIter->pColset==0 ); if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){ - /* All data is stored on the current page. Populate the output + /* All data is stored on the current page. Populate the output ** variables to point into the body of the page object. */ pIter->base.pData = &pSeg->pLeaf->p[pSeg->iLeafOffset]; }else{ @@ -3235,13 +3235,13 @@ static void fts5IterSetOutputs_Col(Fts5Iter *pIter, Fts5SegIter *pSeg){ } /* -** xSetOutputs callback used when: +** xSetOutputs callback used when: ** ** * detail=col, ** * there is a column filter, and -** * the table contains 100 or fewer columns. +** * the table contains 100 or fewer columns. ** -** The last point is to ensure all column numbers are stored as +** The last point is to ensure all column numbers are stored as ** single-byte varints. */ static void fts5IterSetOutputs_Col100(Fts5Iter *pIter, Fts5SegIter *pSeg){ @@ -3253,7 +3253,7 @@ static void fts5IterSetOutputs_Col100(Fts5Iter *pIter, Fts5SegIter *pSeg){ fts5IterSetOutputs_Col(pIter, pSeg); }else{ u8 *a = (u8*)&pSeg->pLeaf->p[pSeg->iLeafOffset]; - u8 *pEnd = (u8*)&a[pSeg->nPos]; + u8 *pEnd = (u8*)&a[pSeg->nPos]; int iPrev = 0; int *aiCol = pIter->pColset->aiCol; int *aiColEnd = &aiCol[pIter->pColset->nCol]; @@ -3292,7 +3292,7 @@ static void fts5IterSetOutputs_Full(Fts5Iter *pIter, Fts5SegIter *pSeg){ assert( pColset ); if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){ - /* All data is stored on the current page. Populate the output + /* All data is stored on the current page. Populate the output ** variables to point into the body of the page object. */ const u8 *a = &pSeg->pLeaf->p[pSeg->iLeafOffset]; if( pColset->nCol==1 ){ @@ -3355,7 +3355,7 @@ static void fts5IterSetOutputCb(int *pRc, Fts5Iter *pIter){ ** is zero or greater, data from the first nSegment segments on level iLevel ** is merged. ** -** The iterator initially points to the first term/rowid entry in the +** The iterator initially points to the first term/rowid entry in the ** iterated data. */ static void fts5MultiIterNew( @@ -3426,8 +3426,8 @@ static void fts5MultiIterNew( assert( iIter==nSeg ); } - /* If the above was successful, each component iterators now points - ** to the first entry in its segment. In this case initialize the + /* If the above was successful, each component iterators now points + ** to the first entry in its segment. In this case initialize the ** aFirst[] array. Or, if an error has occurred, free the iterator ** object and set the output variable to NULL. */ if( p->rc==SQLITE_OK ){ @@ -3496,12 +3496,12 @@ static void fts5MultiIterNew2( } /* -** Return true if the iterator is at EOF or if an error has occurred. +** Return true if the iterator is at EOF or if an error has occurred. ** False otherwise. */ static int fts5MultiIterEof(Fts5Index *p, Fts5Iter *pIter){ - assert( p->rc - || (pIter->aSeg[ pIter->aFirst[1].iFirst ].pLeaf==0)==pIter->base.bEof + assert( p->rc + || (pIter->aSeg[ pIter->aFirst[1].iFirst ].pLeaf==0)==pIter->base.bEof ); return (p->rc || pIter->base.bEof); } @@ -3520,8 +3520,8 @@ static i64 fts5MultiIterRowid(Fts5Iter *pIter){ ** Move the iterator to the next entry at or following iMatch. */ static void fts5MultiIterNextFrom( - Fts5Index *p, - Fts5Iter *pIter, + Fts5Index *p, + Fts5Iter *pIter, i64 iMatch ){ while( 1 ){ @@ -3535,7 +3535,7 @@ static void fts5MultiIterNextFrom( } /* -** Return a pointer to a buffer containing the term associated with the +** Return a pointer to a buffer containing the term associated with the ** entry that the iterator currently points to. */ static const u8 *fts5MultiIterTerm(Fts5Iter *pIter, int *pn){ @@ -3546,11 +3546,11 @@ static const u8 *fts5MultiIterTerm(Fts5Iter *pIter, int *pn){ /* ** Allocate a new segment-id for the structure pStruct. The new segment -** id must be between 1 and 65335 inclusive, and must not be used by +** id must be between 1 and 65335 inclusive, and must not be used by ** any currently existing segment. If a free segment id cannot be found, ** SQLITE_FULL is returned. ** -** If an error has already occurred, this function is a no-op. 0 is +** If an error has already occurred, this function is a no-op. 0 is ** returned in this case. */ static int fts5AllocateSegid(Fts5Index *p, Fts5Structure *pStruct){ @@ -3618,10 +3618,10 @@ static void fts5IndexDiscardData(Fts5Index *p){ } /* -** Return the size of the prefix, in bytes, that buffer +** Return the size of the prefix, in bytes, that buffer ** (pNew/) shares with buffer (pOld/nOld). ** -** Buffer (pNew/) is guaranteed to be greater +** Buffer (pNew/) is guaranteed to be greater ** than buffer (pOld/nOld). */ static int fts5PrefixCompress(int nOld, const u8 *pOld, const u8 *pNew){ @@ -3633,7 +3633,7 @@ static int fts5PrefixCompress(int nOld, const u8 *pOld, const u8 *pNew){ } static void fts5WriteDlidxClear( - Fts5Index *p, + Fts5Index *p, Fts5SegWriter *pWriter, int bFlush /* If true, write dlidx to disk */ ){ @@ -3644,7 +3644,7 @@ static void fts5WriteDlidxClear( if( pDlidx->buf.n==0 ) break; if( bFlush ){ assert( pDlidx->pgno!=0 ); - fts5DataWrite(p, + fts5DataWrite(p, FTS5_DLIDX_ROWID(pWriter->iSegid, i, pDlidx->pgno), pDlidx->buf.p, pDlidx->buf.n ); @@ -3698,8 +3698,8 @@ static int fts5WriteFlushDlidx(Fts5Index *p, Fts5SegWriter *pWriter){ } /* -** This function is called whenever processing of the doclist for the -** last term on leaf page (pWriter->iBtPage) is completed. +** This function is called whenever processing of the doclist for the +** last term on leaf page (pWriter->iBtPage) is completed. ** ** The doclist-index for that term is currently stored in-memory within the ** Fts5SegWriter.aDlidx[] array. If it is large enough, this function @@ -3781,8 +3781,8 @@ static i64 fts5DlidxExtractFirstRowid(Fts5Buffer *pBuf){ ** doclist-index. */ static void fts5WriteDlidxAppend( - Fts5Index *p, - Fts5SegWriter *pWriter, + Fts5Index *p, + Fts5SegWriter *pWriter, i64 iRowid ){ int i; @@ -3795,11 +3795,11 @@ static void fts5WriteDlidxAppend( if( pDlidx->buf.n>=p->pConfig->pgsz ){ /* The current doclist-index page is full. Write it to disk and push ** a copy of iRowid (which will become the first rowid on the next - ** doclist-index leaf page) up into the next level of the b-tree + ** doclist-index leaf page) up into the next level of the b-tree ** hierarchy. If the node being flushed is currently the root node, ** also push its first rowid upwards. */ pDlidx->buf.p[0] = 0x01; /* Not the root node */ - fts5DataWrite(p, + fts5DataWrite(p, FTS5_DLIDX_ROWID(pWriter->iSegid, i, pDlidx->pgno), pDlidx->buf.p, pDlidx->buf.n ); @@ -3886,13 +3886,13 @@ nCall++; ** Append term pTerm/nTerm to the segment being written by the writer passed ** as the second argument. ** -** If an error occurs, set the Fts5Index.rc error code. If an error has +** If an error occurs, set the Fts5Index.rc error code. If an error has ** already occurred, this function is a no-op. */ static void fts5WriteAppendTerm( - Fts5Index *p, + Fts5Index *p, Fts5SegWriter *pWriter, - int nTerm, const u8 *pTerm + int nTerm, const u8 *pTerm ){ int nPrefix; /* Bytes of prefix compression for term */ Fts5PageWriter *pPage = &pWriter->writer; @@ -3909,7 +3909,7 @@ static void fts5WriteAppendTerm( } fts5BufferGrow(&p->rc, &pPage->buf, nTerm+FTS5_DATA_PADDING); } - + /* TODO1: Updating pgidx here. */ pPgidx->n += sqlite3Fts5PutVarint( &pPgidx->p[pPgidx->n], pPage->buf.n - pPage->iPrevPgidx @@ -3925,11 +3925,11 @@ static void fts5WriteAppendTerm( if( pPage->pgno!=1 ){ /* This is the first term on a leaf that is not the leftmost leaf in ** the segment b-tree. In this case it is necessary to add a term to - ** the b-tree hierarchy that is (a) larger than the largest term + ** the b-tree hierarchy that is (a) larger than the largest term ** already written to the segment and (b) smaller than or equal to ** this term. In other words, a prefix of (pTerm/nTerm) that is one ** byte longer than the longest prefix (pTerm/nTerm) shares with the - ** previous term. + ** previous term. ** ** Usually, the previous term is available in pPage->term. The exception ** is if this is the first term written in an incremental-merge step. @@ -3965,10 +3965,10 @@ static void fts5WriteAppendTerm( } /* -** Append a rowid and position-list size field to the writers output. +** Append a rowid and position-list size field to the writers output. */ static void fts5WriteAppendRowid( - Fts5Index *p, + Fts5Index *p, Fts5SegWriter *pWriter, i64 iRowid ){ @@ -3979,7 +3979,7 @@ static void fts5WriteAppendRowid( fts5WriteFlushLeaf(p, pWriter); } - /* If this is to be the first rowid written to the page, set the + /* If this is to be the first rowid written to the page, set the ** rowid-pointer in the page-header. Also append a value to the dlidx ** buffer, in case a doclist-index is required. */ if( pWriter->bFirstRowidInPage ){ @@ -4001,18 +4001,18 @@ static void fts5WriteAppendRowid( } static void fts5WriteAppendPoslistData( - Fts5Index *p, - Fts5SegWriter *pWriter, - const u8 *aData, + Fts5Index *p, + Fts5SegWriter *pWriter, + const u8 *aData, int nData ){ Fts5PageWriter *pPage = &pWriter->writer; const u8 *a = aData; int n = nData; - + assert( p->pConfig->pgsz>0 ); - while( p->rc==SQLITE_OK - && (pPage->buf.n + pPage->pgidx.n + n)>=p->pConfig->pgsz + while( p->rc==SQLITE_OK + && (pPage->buf.n + pPage->pgidx.n + n)>=p->pConfig->pgsz ){ int nReq = p->pConfig->pgsz - pPage->buf.n - pPage->pgidx.n; int nCopy = 0; @@ -4035,7 +4035,7 @@ static void fts5WriteAppendPoslistData( ** allocations associated with the writer. */ static void fts5WriteFinish( - Fts5Index *p, + Fts5Index *p, Fts5SegWriter *pWriter, /* Writer object */ int *pnLeaf /* OUT: Number of leaf pages in b-tree */ ){ @@ -4063,8 +4063,8 @@ static void fts5WriteFinish( } static void fts5WriteInit( - Fts5Index *p, - Fts5SegWriter *pWriter, + Fts5Index *p, + Fts5SegWriter *pWriter, int iSegid ){ const int nBuffer = p->pConfig->pgsz + FTS5_DATA_PADDING; @@ -4087,7 +4087,7 @@ static void fts5WriteInit( if( p->pIdxWriter==0 ){ Fts5Config *pConfig = p->pConfig; fts5IndexPrepareStmt(p, &p->pIdxWriter, sqlite3_mprintf( - "INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)", + "INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)", pConfig->zDb, pConfig->zName )); } @@ -4146,12 +4146,12 @@ static void fts5TrimSegments(Fts5Index *p, Fts5Iter *pIter){ /* Set up the new page-index array */ fts5BufferAppendVarint(&p->rc, &buf, 4); - if( pSeg->iLeafPgno==pSeg->iTermLeafPgno - && pSeg->iEndofDoclistszLeaf + if( pSeg->iLeafPgno==pSeg->iTermLeafPgno + && pSeg->iEndofDoclistszLeaf ){ int nDiff = pData->szLeaf - pSeg->iEndofDoclist; fts5BufferAppendVarint(&p->rc, &buf, buf.n - 1 - nDiff - 4); - fts5BufferAppendBlob(&p->rc, &buf, + fts5BufferAppendBlob(&p->rc, &buf, pData->nn - pSeg->iPgidxOff, &pData->p[pSeg->iPgidxOff] ); } @@ -4167,8 +4167,8 @@ static void fts5TrimSegments(Fts5Index *p, Fts5Iter *pIter){ } static void fts5MergeChunkCallback( - Fts5Index *p, - void *pCtx, + Fts5Index *p, + void *pCtx, const u8 *pChunk, int nChunk ){ Fts5SegWriter *pWriter = (Fts5SegWriter*)pCtx; @@ -4378,7 +4378,7 @@ static int fts5IndexMerge( ** segment. This function updates the write-counter accordingly and, if ** necessary, performs incremental merge work. ** -** If an error occurs, set the Fts5Index.rc error code. If an error has +** If an error occurs, set the Fts5Index.rc error code. If an error has ** already occurred, this function is a no-op. */ static void fts5IndexAutomerge( @@ -4429,12 +4429,12 @@ static int fts5IndexReturn(Fts5Index *p){ typedef struct Fts5FlushCtx Fts5FlushCtx; struct Fts5FlushCtx { Fts5Index *pIdx; - Fts5SegWriter writer; + Fts5SegWriter writer; }; /* ** Buffer aBuf[] contains a list of varints, all small enough to fit -** in a 32-bit integer. Return the size of the largest prefix of this +** in a 32-bit integer. Return the size of the largest prefix of this ** list nMax bytes or less in size. */ static int fts5PoslistPrefix(const u8 *aBuf, int nMax){ @@ -4452,10 +4452,10 @@ static int fts5PoslistPrefix(const u8 *aBuf, int nMax){ } /* -** Flush the contents of in-memory hash table iHash to a new level-0 +** Flush the contents of in-memory hash table iHash to a new level-0 ** segment on disk. Also update the corresponding structure record. ** -** If an error occurs, set the Fts5Index.rc error code. If an error has +** If an error occurs, set the Fts5Index.rc error code. If an error has ** already occurred, this function is a no-op. */ static void fts5FlushOneHash(Fts5Index *p){ @@ -4511,13 +4511,13 @@ static void fts5FlushOneHash(Fts5Index *p){ i64 iDelta = 0; int iOff = 0; - /* The entire doclist will not fit on this leaf. The following - ** loop iterates through the poslists that make up the current + /* The entire doclist will not fit on this leaf. The following + ** loop iterates through the poslists that make up the current ** doclist. */ while( p->rc==SQLITE_OK && iOffp[0], (u16)pBuf->n); /* first rowid on page */ pBuf->n += sqlite3Fts5PutVarint(&pBuf->p[pBuf->n], iRowid); @@ -4620,7 +4620,7 @@ static void fts5IndexFlush(Fts5Index *p){ } static Fts5Structure *fts5IndexOptimizeStruct( - Fts5Index *p, + Fts5Index *p, Fts5Structure *pStruct ){ Fts5Structure *pNew = 0; @@ -4631,7 +4631,7 @@ static Fts5Structure *fts5IndexOptimizeStruct( /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: ** - ** + it consists of fewer than two segments, or + ** + it consists of fewer than two segments, or ** + all segments are on the same level, or ** + all segments except one are currently inputs to a merge operation. ** @@ -4708,7 +4708,7 @@ int sqlite3Fts5IndexOptimize(Fts5Index *p){ fts5StructureRelease(pNew); } - return fts5IndexReturn(p); + return fts5IndexReturn(p); } /* @@ -4790,7 +4790,7 @@ static void fts5DoclistIterNext(Fts5DoclistIter *pIter){ } static void fts5DoclistIterInit( - Fts5Buffer *pBuf, + Fts5Buffer *pBuf, Fts5DoclistIter *pIter ){ memset(pIter, 0, sizeof(*pIter)); @@ -4926,7 +4926,7 @@ static void fts5MergePrefixLists( if( i2.aPoslist==0 ) break; } else{ - /* Merge the two position lists. */ + /* Merge the two position lists. */ i64 iPos1 = 0; i64 iPos2 = 0; int iOff1 = 0; @@ -5033,8 +5033,8 @@ static void fts5SetupPrefixIter( pStruct = fts5StructureRead(p); if( aBuf && pStruct ){ - const int flags = FTS5INDEX_QUERY_SCAN - | FTS5INDEX_QUERY_SKIPEMPTY + const int flags = FTS5INDEX_QUERY_SCAN + | FTS5INDEX_QUERY_SKIPEMPTY | FTS5INDEX_QUERY_NOOUTPUT; int i; i64 iLastRowid = 0; @@ -5116,9 +5116,9 @@ int sqlite3Fts5IndexBeginWrite(Fts5Index *p, int bDelete, i64 iRowid){ } /* Flush the hash table to disk if required */ - if( iRowidiWriteRowid + if( iRowidiWriteRowid || (iRowid==p->iWriteRowid && p->bDelete==0) - || (p->nPendingData > p->pConfig->nHashSize) + || (p->nPendingData > p->pConfig->nHashSize) ){ fts5IndexFlush(p); } @@ -5141,7 +5141,7 @@ int sqlite3Fts5IndexSync(Fts5Index *p, int bCommit){ /* ** Discard any data stored in the in-memory hash tables. Do not write it ** to the database. Additionally, assume that the contents of the %_data -** table may have changed on disk. So any in-memory caches of %_data +** table may have changed on disk. So any in-memory caches of %_data ** records must be invalidated. */ int sqlite3Fts5IndexRollback(Fts5Index *p){ @@ -5174,8 +5174,8 @@ int sqlite3Fts5IndexReinit(Fts5Index *p){ ** Otherwise, set *pp to NULL and return an SQLite error code. */ int sqlite3Fts5IndexOpen( - Fts5Config *pConfig, - int bCreate, + Fts5Config *pConfig, + int bCreate, Fts5Index **pp, char **pzErr ){ @@ -5192,8 +5192,8 @@ int sqlite3Fts5IndexOpen( pConfig, "data", "id INTEGER PRIMARY KEY, block BLOB", 0, pzErr ); if( rc==SQLITE_OK ){ - rc = sqlite3Fts5CreateTable(pConfig, "idx", - "segid, term, pgno, PRIMARY KEY(segid, term)", + rc = sqlite3Fts5CreateTable(pConfig, "idx", + "segid, term, pgno, PRIMARY KEY(segid, term)", 1, pzErr ); } @@ -5233,13 +5233,13 @@ int sqlite3Fts5IndexClose(Fts5Index *p){ } /* -** Argument p points to a buffer containing utf-8 text that is n bytes in +** Argument p points to a buffer containing utf-8 text that is n bytes in ** size. Return the number of bytes in the nChar character prefix of the ** buffer, or 0 if there are less than nChar characters in total. */ int sqlite3Fts5IndexCharlenToBytelen( - const char *p, - int nByte, + const char *p, + int nByte, int nChar ){ int n = 0; @@ -5258,7 +5258,7 @@ int sqlite3Fts5IndexCharlenToBytelen( ** unicode characters in the string. */ static int fts5IndexCharlen(const char *pIn, int nIn){ - int nChar = 0; + int nChar = 0; int i = 0; while( i=0xc0 ){ @@ -5270,7 +5270,7 @@ static int fts5IndexCharlen(const char *pIn, int nIn){ } /* -** Insert or remove data to or from the index. Each time a document is +** Insert or remove data to or from the index. Each time a document is ** added to or removed from the index, this function is called one or more ** times. ** @@ -5301,7 +5301,7 @@ int sqlite3Fts5IndexWrite( const int nChar = pConfig->aPrefix[i]; int nByte = sqlite3Fts5IndexCharlenToBytelen(pToken, nToken, nChar); if( nByte ){ - rc = sqlite3Fts5HashWrite(p->pHash, + rc = sqlite3Fts5HashWrite(p->pHash, p->iWriteRowid, iCol, iPos, (char)(FTS5_MAIN_PREFIX+i+1), pToken, nByte ); @@ -5312,7 +5312,7 @@ int sqlite3Fts5IndexWrite( } /* -** Open a new iterator to iterate though all rowid that match the +** Open a new iterator to iterate though all rowid that match the ** specified token or token prefix. */ int sqlite3Fts5IndexQuery( @@ -5339,9 +5339,9 @@ int sqlite3Fts5IndexQuery( ** satisfied by scanning multiple terms in the main index. ** ** If the QUERY_TEST_NOIDX flag was specified, then this must be a - ** prefix-query. Instead of using a prefix-index (if one exists), + ** prefix-query. Instead of using a prefix-index (if one exists), ** evaluate the prefix query using the main FTS index. This is used - ** for internal sanity checking by the integrity-check in debug + ** for internal sanity checking by the integrity-check in debug ** mode only. */ #ifdef SQLITE_DEBUG if( pConfig->bPrefixIndex==0 || (flags & FTS5INDEX_QUERY_TEST_NOIDX) ){ @@ -5361,7 +5361,7 @@ int sqlite3Fts5IndexQuery( Fts5Structure *pStruct = fts5StructureRead(p); buf.p[0] = (u8)(FTS5_MAIN_PREFIX + iIdx); if( pStruct ){ - fts5MultiIterNew(p, pStruct, flags | FTS5INDEX_QUERY_SKIPEMPTY, + fts5MultiIterNew(p, pStruct, flags | FTS5INDEX_QUERY_SKIPEMPTY, pColset, buf.p, nToken+1, -1, 0, &pRet ); fts5StructureRelease(pStruct); @@ -5395,7 +5395,7 @@ int sqlite3Fts5IndexQuery( ** Return true if the iterator passed as the only argument is at EOF. */ /* -** Move to the next matching rowid. +** Move to the next matching rowid. */ int sqlite3Fts5IterNext(Fts5IndexIter *pIndexIter){ Fts5Iter *pIter = (Fts5Iter*)pIndexIter; @@ -5460,7 +5460,7 @@ void sqlite3Fts5IterClose(Fts5IndexIter *pIndexIter){ } /* -** Read and decode the "averages" record from the database. +** Read and decode the "averages" record from the database. ** ** Parameter anSize must point to an array of size nCol, where nCol is ** the number of user defined columns in the FTS table. @@ -5486,7 +5486,7 @@ int sqlite3Fts5IndexGetAverages(Fts5Index *p, i64 *pnRow, i64 *anSize){ } /* -** Replace the current "averages" record with the contents of the buffer +** Replace the current "averages" record with the contents of the buffer ** supplied as the second argument. */ int sqlite3Fts5IndexSetAverages(Fts5Index *p, const u8 *pData, int nData){ @@ -5504,7 +5504,7 @@ int sqlite3Fts5IndexReads(Fts5Index *p){ } /* -** Set the 32-bit cookie value stored at the start of all structure +** Set the 32-bit cookie value stored at the start of all structure ** records to the value passed as the second argument. ** ** Return SQLITE_OK if successful, or an SQLite error code if an error @@ -5519,7 +5519,7 @@ int sqlite3Fts5IndexSetCookie(Fts5Index *p, int iNew){ assert( p->rc==SQLITE_OK ); sqlite3Fts5Put32(aCookie, iNew); - rc = sqlite3_blob_open(pConfig->db, pConfig->zDb, p->zDataTbl, + rc = sqlite3_blob_open(pConfig->db, pConfig->zDb, p->zDataTbl, "block", FTS5_STRUCTURE_ROWID, 1, &pBlob ); if( rc==SQLITE_OK ){ @@ -5540,7 +5540,7 @@ int sqlite3Fts5IndexLoadConfig(Fts5Index *p){ /************************************************************************* ************************************************************************** -** Below this point is the implementation of the integrity-check +** Below this point is the implementation of the integrity-check ** functionality. */ @@ -5548,9 +5548,9 @@ int sqlite3Fts5IndexLoadConfig(Fts5Index *p){ ** Return a simple checksum value based on the arguments. */ u64 sqlite3Fts5IndexEntryCksum( - i64 iRowid, - int iCol, - int iPos, + i64 iRowid, + int iCol, + int iPos, int iIdx, const char *pTerm, int nTerm @@ -5566,15 +5566,15 @@ u64 sqlite3Fts5IndexEntryCksum( #ifdef SQLITE_DEBUG /* -** This function is purely an internal test. It does not contribute to +** This function is purely an internal test. It does not contribute to ** FTS functionality, or even the integrity-check, in any way. ** -** Instead, it tests that the same set of pgno/rowid combinations are +** Instead, it tests that the same set of pgno/rowid combinations are ** visited regardless of whether the doclist-index identified by parameters ** iSegid/iLeaf is iterated in forwards or reverse order. */ static void fts5TestDlidxReverse( - Fts5Index *p, + Fts5Index *p, int iSegid, /* Segment id to load from */ int iLeaf /* Load doclist-index for this leaf */ ){ @@ -5650,11 +5650,11 @@ static int fts5QueryCksum( /* -** This function is also purely an internal test. It does not contribute to +** This function is also purely an internal test. It does not contribute to ** FTS functionality, or even the integrity-check, in any way. */ static void fts5TestTerm( - Fts5Index *p, + Fts5Index *p, Fts5Buffer *pPrev, /* Previous term */ const char *z, int n, /* Possibly new term to test */ u64 expected, @@ -5683,7 +5683,7 @@ static void fts5TestTerm( if( rc==SQLITE_OK && ck1!=ck2 ) rc = FTS5_CORRUPT; /* If this is a prefix query, check that the results returned if the - ** the index is disabled are the same. In both ASC and DESC order. + ** the index is disabled are the same. In both ASC and DESC order. ** ** This check may only be performed if the hash table is empty. This ** is because the hash table only supports a single scan query at @@ -5714,7 +5714,7 @@ static void fts5TestTerm( } p->rc = rc; } - + #else # define fts5TestDlidxReverse(x,y,z) # define fts5TestTerm(u,v,w,x,y,z) @@ -5826,7 +5826,7 @@ static void fts5IndexIntegrityCheckSegment( int iIdxLeaf = sqlite3_column_int(pStmt, 2); int bIdxDlidx = sqlite3_column_int(pStmt, 3); - /* If the leaf in question has already been trimmed from the segment, + /* If the leaf in question has already been trimmed from the segment, ** ignore this b-tree entry. Otherwise, load it into memory. */ if( iIdxLeafpgnoFirst ) continue; iRow = FTS5_SEGMENT_ROWID(pSeg->iSegid, iIdxLeaf); @@ -5934,7 +5934,7 @@ static void fts5IndexIntegrityCheckSegment( /* -** Run internal checks to ensure that the FTS index (a) is internally +** Run internal checks to ensure that the FTS index (a) is internally ** consistent and (b) contains entries for which the XOR of the checksums ** as calculated by sqlite3Fts5IndexEntryCksum() is cksum. ** @@ -5956,7 +5956,7 @@ int sqlite3Fts5IndexIntegrityCheck(Fts5Index *p, u64 cksum){ Fts5Buffer term = {0,0,0}; /* Buffer used to hold most recent term */ #endif const int flags = FTS5INDEX_QUERY_NOOUTPUT; - + /* Load the FTS index structure */ pStruct = fts5StructureRead(p); @@ -5978,7 +5978,7 @@ int sqlite3Fts5IndexIntegrityCheck(Fts5Index *p, u64 cksum){ ** ** Two versions of the same checksum are calculated. The first (stack ** variable cksum2) based on entries extracted from the full-text index - ** while doing a linear scan of each individual index in turn. + ** while doing a linear scan of each individual index in turn. ** ** As each term visited by the linear scans, a separate query for the ** same term is performed. cksum3 is calculated based on the entries @@ -6080,12 +6080,12 @@ static void fts5DebugStructure( for(iLvl=0; iLvlnLevel; iLvl++){ Fts5StructureLevel *pLvl = &p->aLevel[iLvl]; - sqlite3Fts5BufferAppendPrintf(pRc, pBuf, + sqlite3Fts5BufferAppendPrintf(pRc, pBuf, " {lvl=%d nMerge=%d nSeg=%d", iLvl, pLvl->nMerge, pLvl->nSeg ); for(iSeg=0; iSegnSeg; iSeg++){ Fts5StructureSegment *pSeg = &pLvl->aSeg[iSeg]; - sqlite3Fts5BufferAppendPrintf(pRc, pBuf, " {id=%d leaves=%d..%d}", + sqlite3Fts5BufferAppendPrintf(pRc, pBuf, " {id=%d leaves=%d..%d}", pSeg->iSegid, pSeg->pgnoFirst, pSeg->pgnoLast ); } @@ -6098,7 +6098,7 @@ static void fts5DebugStructure( ** ** Arguments pBlob/nBlob contain a serialized Fts5Structure object. This ** function appends a human-readable representation of the same object -** to the buffer passed as the second argument. +** to the buffer passed as the second argument. */ static void fts5DecodeStructure( int *pRc, /* IN/OUT: error code */ @@ -6121,9 +6121,9 @@ static void fts5DecodeStructure( /* ** This is part of the fts5_decode() debugging aid. ** -** Arguments pBlob/nBlob contain an "averages" record. This function -** appends a human-readable representation of record to the buffer passed -** as the second argument. +** Arguments pBlob/nBlob contain an "averages" record. This function +** appends a human-readable representation of record to the buffer passed +** as the second argument. */ static void fts5DecodeAverages( int *pRc, /* IN/OUT: error code */ @@ -6162,7 +6162,7 @@ static int fts5DecodePoslist(int *pRc, Fts5Buffer *pBuf, const u8 *a, int n){ ** The start of buffer (a/n) contains the start of a doclist. The doclist ** may or may not finish within the buffer. This function appends a text ** representation of the part of the doclist that is present to buffer -** pBuf. +** pBuf. ** ** The return value is the number of bytes read from the input buffer. */ @@ -6192,7 +6192,7 @@ static int fts5DecodeDoclist(int *pRc, Fts5Buffer *pBuf, const u8 *a, int n){ } /* -** This function is part of the fts5_decode() debugging function. It is +** This function is part of the fts5_decode() debugging function. It is ** only ever used with detail=none tables. ** ** Buffer (pData/nData) contains a doclist in the format used by detail=none @@ -6280,7 +6280,7 @@ static void fts5DecodeFunction( lvl.iLeafPgno = iPgno; for(fts5DlidxLvlNext(&lvl); lvl.bEof==0; fts5DlidxLvlNext(&lvl)){ - sqlite3Fts5BufferAppendPrintf(&rc, &s, + sqlite3Fts5BufferAppendPrintf(&rc, &s, " %d(%lld)", lvl.iLeafPgno, lvl.iRowid ); } @@ -6380,7 +6380,7 @@ static void fts5DecodeFunction( int bFirst = (iPgidxOff==szLeaf); /* True for first term on page */ int nByte; /* Bytes of data */ int iEnd; - + iPgidxOff += fts5GetVarint32(&a[iPgidxOff], nByte); iPgidxPrev += nByte; iOff = iPgidxPrev; @@ -6408,7 +6408,7 @@ static void fts5DecodeFunction( fts5BufferFree(&term); } - + decode_out: sqlite3_free(a); if( rc==SQLITE_OK ){ @@ -6436,7 +6436,7 @@ static void fts5RowidFunction( i64 iRowid; int segid, pgno; if( nArg!=3 ){ - sqlite3_result_error(pCtx, + sqlite3_result_error(pCtx, "should be: fts5_rowid('segment', segid, pgno))", -1 ); }else{ @@ -6446,7 +6446,7 @@ static void fts5RowidFunction( sqlite3_result_int64(pCtx, iRowid); } }else{ - sqlite3_result_error(pCtx, + sqlite3_result_error(pCtx, "first arg to fts5_rowid() must be 'segment'" , -1 ); } @@ -6468,7 +6468,7 @@ int sqlite3Fts5IndexInit(sqlite3 *db){ if( rc==SQLITE_OK ){ rc = sqlite3_create_function( - db, "fts5_decode_none", 2, + db, "fts5_decode_none", 2, SQLITE_UTF8, (void*)db, fts5DecodeFunction, 0, 0 ); } diff --git a/third_party/sqlite/src/ext/fts5/fts5_main.c b/third_party/sqlite/src/ext/fts5/fts5_main.c index 384d3dd8f72cc..39d304e472257 100644 --- a/third_party/sqlite/src/ext/fts5/fts5_main.c +++ b/third_party/sqlite/src/ext/fts5/fts5_main.c @@ -33,9 +33,9 @@ typedef struct Fts5Table Fts5Table; typedef struct Fts5TokenizerModule Fts5TokenizerModule; /* -** NOTES ON TRANSACTIONS: +** NOTES ON TRANSACTIONS: ** -** SQLite invokes the following virtual table methods as transactions are +** SQLite invokes the following virtual table methods as transactions are ** opened and closed by the user: ** ** xBegin(): Start of a new transaction. @@ -44,7 +44,7 @@ typedef struct Fts5TokenizerModule Fts5TokenizerModule; ** xRollback(): Rollback the transaction. ** ** Anything that is required as part of a commit that may fail is performed -** in the xSync() callback. Current versions of SQLite ignore any errors +** in the xSync() callback. Current versions of SQLite ignore any errors ** returned by xCommit(). ** ** And as sub-transactions are opened/closed: @@ -53,9 +53,9 @@ typedef struct Fts5TokenizerModule Fts5TokenizerModule; ** xRelease(int S): Commit and close savepoint S. ** xRollbackTo(int S): Rollback to start of savepoint S. ** -** During a write-transaction the fts5_index.c module may cache some data +** During a write-transaction the fts5_index.c module may cache some data ** in-memory. It is flushed to disk whenever xSync(), xRelease() or -** xSavepoint() is called. And discarded whenever xRollback() or xRollbackTo() +** xSavepoint() is called. And discarded whenever xRollback() or xRollbackTo() ** is called. ** ** Additionally, if SQLITE_DEBUG is defined, an instance of the following @@ -69,13 +69,13 @@ struct Fts5TransactionState { }; /* -** A single object of this type is allocated when the FTS5 module is +** A single object of this type is allocated when the FTS5 module is ** registered with a database handle. It is used to store pointers to ** all registered FTS5 extensions - tokenizers and auxiliary functions. */ struct Fts5Global { fts5_api api; /* User visible part of object (see fts5.h) */ - sqlite3 *db; /* Associated database connection */ + sqlite3 *db; /* Associated database connection */ i64 iNextId; /* Used to allocate unique cursor ids */ Fts5Auxiliary *pAux; /* First in list of all aux. functions */ Fts5TokenizerModule *pTok; /* First in list of all tokenizer modules */ @@ -136,7 +136,7 @@ struct Fts5MatchPhrase { ** ** aIdx[]: ** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last +** the value of which is the offset within aPoslist[] following the last ** byte of the position list for the corresponding phrase. */ struct Fts5Sorter { @@ -152,8 +152,8 @@ struct Fts5Sorter { ** Virtual-table cursor object. ** ** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. +** If this is a 'special' query (refer to function fts5SpecialMatch()), +** then this variable contains the result of the query. ** ** iFirstRowid, iLastRowid: ** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the @@ -204,7 +204,7 @@ struct Fts5Cursor { }; /* -** Bits that make up the "idxNum" parameter passed indirectly by +** Bits that make up the "idxNum" parameter passed indirectly by ** xBestIndex() to xFilter(). */ #define FTS5_BI_MATCH 0x0001 /* MATCH ? */ @@ -283,7 +283,7 @@ static void fts5CheckTransactionState(Fts5Table *p, int op, int iSavepoint){ assert( iSavepoint>p->ts.iSavepoint ); p->ts.iSavepoint = iSavepoint; break; - + case FTS5_RELEASE: assert( p->ts.eState==1 ); assert( iSavepoint>=0 ); @@ -311,7 +311,7 @@ static int fts5IsContentless(Fts5Table *pTab){ } /* -** Delete a virtual table handle allocated by fts5InitVtab(). +** Delete a virtual table handle allocated by fts5InitVtab(). */ static void fts5FreeVtab(Fts5Table *pTab){ if( pTab ){ @@ -467,7 +467,7 @@ static void fts5SetUniqueFlag(sqlite3_index_info *pIdxInfo){ } /* -** Implementation of the xBestIndex method for FTS5 tables. Within the +** Implementation of the xBestIndex method for FTS5 tables. Within the ** WHERE constraint, it searches for the following: ** ** 1. A MATCH constraint against the special column. @@ -518,14 +518,14 @@ static int fts5BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ int omit; /* True to omit this if found */ int iConsIndex; /* Index in pInfo->aConstraint[] */ } aConstraint[] = { - {SQLITE_INDEX_CONSTRAINT_MATCH|SQLITE_INDEX_CONSTRAINT_EQ, + {SQLITE_INDEX_CONSTRAINT_MATCH|SQLITE_INDEX_CONSTRAINT_EQ, FTS5_BI_MATCH, 1, 1, -1}, - {SQLITE_INDEX_CONSTRAINT_MATCH|SQLITE_INDEX_CONSTRAINT_EQ, + {SQLITE_INDEX_CONSTRAINT_MATCH|SQLITE_INDEX_CONSTRAINT_EQ, FTS5_BI_RANK, 2, 1, -1}, {SQLITE_INDEX_CONSTRAINT_EQ, FTS5_BI_ROWID_EQ, 0, 0, -1}, - {SQLITE_INDEX_CONSTRAINT_LT|SQLITE_INDEX_CONSTRAINT_LE, + {SQLITE_INDEX_CONSTRAINT_LT|SQLITE_INDEX_CONSTRAINT_LE, FTS5_BI_ROWID_LE, 0, 0, -1}, - {SQLITE_INDEX_CONSTRAINT_GT|SQLITE_INDEX_CONSTRAINT_GE, + {SQLITE_INDEX_CONSTRAINT_GT|SQLITE_INDEX_CONSTRAINT_GE, FTS5_BI_ROWID_GE, 0, 0, -1}, }; @@ -545,7 +545,7 @@ static int fts5BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ pC->iConsIndex = i; idxFlags |= pC->fts5op; }else if( j==0 ){ - /* As there exists an unusable MATCH constraint this is an + /* As there exists an unusable MATCH constraint this is an ** unusable plan. Set a prohibitively high cost. */ pInfo->estimatedCost = 1e50; return SQLITE_OK; @@ -643,15 +643,15 @@ static int fts5StmtType(Fts5Cursor *pCsr){ /* ** This function is called after the cursor passed as the only argument -** is moved to point at a different row. It clears all cached data +** is moved to point at a different row. It clears all cached data ** specific to the previous row stored by the cursor object. */ static void fts5CsrNewrow(Fts5Cursor *pCsr){ - CsrFlagSet(pCsr, - FTS5CSR_REQUIRE_CONTENT - | FTS5CSR_REQUIRE_DOCSIZE - | FTS5CSR_REQUIRE_INST - | FTS5CSR_REQUIRE_POSLIST + CsrFlagSet(pCsr, + FTS5CSR_REQUIRE_CONTENT + | FTS5CSR_REQUIRE_DOCSIZE + | FTS5CSR_REQUIRE_INST + | FTS5CSR_REQUIRE_POSLIST ); } @@ -754,14 +754,14 @@ static int fts5SorterNext(Fts5Cursor *pCsr){ /* -** Set the FTS5CSR_REQUIRE_RESEEK flag on all FTS5_PLAN_MATCH cursors +** Set the FTS5CSR_REQUIRE_RESEEK flag on all FTS5_PLAN_MATCH cursors ** open on table pTab. */ static void fts5TripCursors(Fts5Table *pTab){ Fts5Cursor *pCsr; for(pCsr=pTab->pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){ if( pCsr->ePlan==FTS5_PLAN_MATCH - && pCsr->base.pVtab==(sqlite3_vtab*)pTab + && pCsr->base.pVtab==(sqlite3_vtab*)pTab ){ CsrFlagSet(pCsr, FTS5CSR_REQUIRE_RESEEK); } @@ -770,14 +770,14 @@ static void fts5TripCursors(Fts5Table *pTab){ /* ** If the REQUIRE_RESEEK flag is set on the cursor passed as the first -** argument, close and reopen all Fts5IndexIter iterators that the cursor +** argument, close and reopen all Fts5IndexIter iterators that the cursor ** is using. Then attempt to move the cursor to a rowid equal to or laster -** (in the cursors sort order - ASC or DESC) than the current rowid. +** (in the cursors sort order - ASC or DESC) than the current rowid. ** ** If the new rowid is not equal to the old, set output parameter *pbSkip ** to 1 before returning. Otherwise, leave it unchanged. ** -** Return SQLITE_OK if successful or if no reseek was required, or an +** Return SQLITE_OK if successful or if no reseek was required, or an ** error code if an error occurred. */ static int fts5CursorReseek(Fts5Cursor *pCsr, int *pbSkip){ @@ -805,7 +805,7 @@ static int fts5CursorReseek(Fts5Cursor *pCsr, int *pbSkip){ /* -** Advance the cursor to the next row in the table that matches the +** Advance the cursor to the next row in the table that matches the ** search criteria. ** ** Return SQLITE_OK if nothing goes wrong. SQLITE_OK is returned @@ -817,7 +817,7 @@ static int fts5NextMethod(sqlite3_vtab_cursor *pCursor){ int rc; assert( (pCsr->ePlan<3)== - (pCsr->ePlan==FTS5_PLAN_MATCH || pCsr->ePlan==FTS5_PLAN_SOURCE) + (pCsr->ePlan==FTS5_PLAN_MATCH || pCsr->ePlan==FTS5_PLAN_SOURCE) ); assert( !CsrFlagTest(pCsr, FTS5CSR_EOF) ); @@ -834,12 +834,12 @@ static int fts5NextMethod(sqlite3_vtab_cursor *pCursor){ rc = SQLITE_OK; break; } - + case FTS5_PLAN_SORTED_MATCH: { rc = fts5SorterNext(pCsr); break; } - + default: rc = sqlite3_step(pCsr->pStmt); if( rc!=SQLITE_ROW ){ @@ -851,14 +851,14 @@ static int fts5NextMethod(sqlite3_vtab_cursor *pCursor){ break; } } - + return rc; } static int fts5PrepareStatement( sqlite3_stmt **ppStmt, - Fts5Config *pConfig, + Fts5Config *pConfig, const char *zFmt, ... ){ @@ -870,7 +870,7 @@ static int fts5PrepareStatement( va_start(ap, zFmt); zSql = sqlite3_vmprintf(zFmt, ap); if( zSql==0 ){ - rc = SQLITE_NOMEM; + rc = SQLITE_NOMEM; }else{ rc = sqlite3_prepare_v2(pConfig->db, zSql, -1, &pRet, 0); if( rc!=SQLITE_OK ){ @@ -882,7 +882,7 @@ static int fts5PrepareStatement( va_end(ap); *ppStmt = pRet; return rc; -} +} static int fts5CursorFirstSorted(Fts5Table *pTab, Fts5Cursor *pCsr, int bDesc){ Fts5Config *pConfig = pTab->pConfig; @@ -892,7 +892,7 @@ static int fts5CursorFirstSorted(Fts5Table *pTab, Fts5Cursor *pCsr, int bDesc){ int rc; const char *zRank = pCsr->zRank; const char *zRankArgs = pCsr->zRankArgs; - + nPhrase = sqlite3Fts5ExprPhraseCount(pCsr->pExpr); nByte = sizeof(Fts5Sorter) + sizeof(int) * (nPhrase-1); pSorter = (Fts5Sorter*)sqlite3_malloc(nByte); @@ -903,7 +903,7 @@ static int fts5CursorFirstSorted(Fts5Table *pTab, Fts5Cursor *pCsr, int bDesc){ /* TODO: It would be better to have some system for reusing statement ** handles here, rather than preparing a new one for each query. But that ** is not possible as SQLite reference counts the virtual table objects. - ** And since the statement required here reads from this very virtual + ** And since the statement required here reads from this very virtual ** table, saving it creates a circular reference. ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ @@ -950,8 +950,8 @@ static int fts5CursorFirst(Fts5Table *pTab, Fts5Cursor *pCsr, int bDesc){ ** parameters. */ static int fts5SpecialMatch( - Fts5Table *pTab, - Fts5Cursor *pCsr, + Fts5Table *pTab, + Fts5Cursor *pCsr, const char *zQuery ){ int rc = SQLITE_OK; /* Return code */ @@ -1048,7 +1048,7 @@ static int fts5FindRankFunction(Fts5Cursor *pCsr){ static int fts5CursorParseRank( Fts5Config *pConfig, - Fts5Cursor *pCsr, + Fts5Cursor *pCsr, sqlite3_value *pRank ){ int rc = SQLITE_OK; @@ -1097,7 +1097,7 @@ static i64 fts5GetRowidLimit(sqlite3_value *pVal, i64 iDefault){ ** This is the xFilter interface for the virtual table. See ** the virtual table xFilter method documentation for additional ** information. -** +** ** There are three possible query strategies: ** ** 1. Full-text search using a MATCH operator. @@ -1157,7 +1157,7 @@ static int fts5FilterMethod( bOrderByRank = ((idxNum & FTS5_BI_ORDER_RANK) ? 1 : 0); pCsr->bDesc = bDesc = ((idxNum & FTS5_BI_ORDER_DESC) ? 1 : 0); - /* Set the cursor upper and lower rowid limits. Only some strategies + /* Set the cursor upper and lower rowid limits. Only some strategies ** actually use them. This is ok, as the xBestIndex() method leaves the ** sqlite3_index_constraint.omit flag clear for range constraints ** on the rowid field. */ @@ -1173,11 +1173,11 @@ static int fts5FilterMethod( } if( pTab->pSortCsr ){ - /* If pSortCsr is non-NULL, then this call is being made as part of + /* If pSortCsr is non-NULL, then this call is being made as part of ** processing for a "... MATCH ORDER BY rank" query (ePlan is ** set to FTS5_PLAN_SORTED_MATCH). pSortCsr is the cursor that will - ** return results to the user for this query. The current cursor - ** (pCursor) is used to execute the query issued by function + ** return results to the user for this query. The current cursor + ** (pCursor) is used to execute the query issued by function ** fts5CursorFirstSorted() above. */ assert( pRowidEq==0 && pRowidLe==0 && pRowidGe==0 && pRank==0 ); assert( nVal==0 && pMatch==0 && bOrderByRank==0 && bDesc==0 ); @@ -1238,8 +1238,8 @@ static int fts5FilterMethod( return rc; } -/* -** This is the xEof method of the virtual table. SQLite calls this +/* +** This is the xEof method of the virtual table. SQLite calls this ** routine to find out if it has reached the end of a result set. */ static int fts5EofMethod(sqlite3_vtab_cursor *pCursor){ @@ -1251,9 +1251,9 @@ static int fts5EofMethod(sqlite3_vtab_cursor *pCursor){ ** Return the rowid that the cursor currently points to. */ static i64 fts5CursorRowid(Fts5Cursor *pCsr){ - assert( pCsr->ePlan==FTS5_PLAN_MATCH - || pCsr->ePlan==FTS5_PLAN_SORTED_MATCH - || pCsr->ePlan==FTS5_PLAN_SOURCE + assert( pCsr->ePlan==FTS5_PLAN_MATCH + || pCsr->ePlan==FTS5_PLAN_SORTED_MATCH + || pCsr->ePlan==FTS5_PLAN_SOURCE ); if( pCsr->pSorter ){ return pCsr->pSorter->iRowid; @@ -1262,7 +1262,7 @@ static i64 fts5CursorRowid(Fts5Cursor *pCsr){ } } -/* +/* ** This is the xRowid method. The SQLite core calls this routine to ** retrieve the rowid for the current row of the result set. fts5 ** exposes %_content.rowid as the rowid for the virtual table. The @@ -1271,7 +1271,7 @@ static i64 fts5CursorRowid(Fts5Cursor *pCsr){ static int fts5RowidMethod(sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid){ Fts5Cursor *pCsr = (Fts5Cursor*)pCursor; int ePlan = pCsr->ePlan; - + assert( CsrFlagTest(pCsr, FTS5CSR_EOF)==0 ); switch( ePlan ){ case FTS5_PLAN_SPECIAL: @@ -1302,7 +1302,7 @@ static int fts5RowidMethod(sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid){ static int fts5SeekCursor(Fts5Cursor *pCsr, int bErrormsg){ int rc = SQLITE_OK; - /* If the cursor does not yet have a statement handle, obtain one now. */ + /* If the cursor does not yet have a statement handle, obtain one now. */ if( pCsr->pStmt==0 ){ Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab); int eStmt = fts5StmtType(pCsr); @@ -1346,7 +1346,7 @@ static void fts5SetVtabError(Fts5Table *p, const char *zFormat, ...){ ** INSERT INTO fts(fts) VALUES($pCmd) ** INSERT INTO fts(fts, rank) VALUES($pCmd, $pVal) ** -** Argument pVal is the value assigned to column "fts" by the INSERT +** Argument pVal is the value assigned to column "fts" by the INSERT ** statement. This function returns SQLITE_OK if successful, or an SQLite ** error code if an error occurs. ** @@ -1365,7 +1365,7 @@ static int fts5SpecialInsert( if( 0==sqlite3_stricmp("delete-all", zCmd) ){ if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ - fts5SetVtabError(pTab, + fts5SetVtabError(pTab, "'delete-all' may only be used with a " "contentless or external content fts5 table" ); @@ -1375,7 +1375,7 @@ static int fts5SpecialInsert( } }else if( 0==sqlite3_stricmp("rebuild", zCmd) ){ if( pConfig->eContent==FTS5_CONTENT_NONE ){ - fts5SetVtabError(pTab, + fts5SetVtabError(pTab, "'rebuild' may not be used with a contentless fts5 table" ); rc = SQLITE_ERROR; @@ -1410,7 +1410,7 @@ static int fts5SpecialInsert( } static int fts5SpecialDelete( - Fts5Table *pTab, + Fts5Table *pTab, sqlite3_value **apVal ){ int rc = SQLITE_OK; @@ -1423,9 +1423,9 @@ static int fts5SpecialDelete( } static void fts5StorageInsert( - int *pRc, - Fts5Table *pTab, - sqlite3_value **apVal, + int *pRc, + Fts5Table *pTab, + sqlite3_value **apVal, i64 *piRowid ){ int rc = *pRc; @@ -1438,13 +1438,13 @@ static void fts5StorageInsert( *pRc = rc; } -/* -** This function is the implementation of the xUpdate callback used by +/* +** This function is the implementation of the xUpdate callback used by ** FTS3 virtual tables. It is invoked by SQLite each time a row is to be ** inserted, updated or deleted. ** ** A delete specifies a single argument - the rowid of the row to remove. -** +** ** Update and insert operations pass: ** ** 1. The "old" rowid, or NULL. @@ -1468,9 +1468,9 @@ static int fts5UpdateMethod( assert( pVtab->zErrMsg==0 ); assert( nArg==1 || nArg==(2+pConfig->nCol+2) ); - assert( nArg==1 - || sqlite3_value_type(apVal[1])==SQLITE_INTEGER - || sqlite3_value_type(apVal[1])==SQLITE_NULL + assert( nArg==1 + || sqlite3_value_type(apVal[1])==SQLITE_INTEGER + || sqlite3_value_type(apVal[1])==SQLITE_NULL ); assert( pTab->pConfig->pzErrmsg==0 ); pTab->pConfig->pzErrmsg = &pTab->base.zErrMsg; @@ -1479,13 +1479,13 @@ static int fts5UpdateMethod( fts5TripCursors(pTab); eType0 = sqlite3_value_type(apVal[0]); - if( eType0==SQLITE_NULL - && sqlite3_value_type(apVal[2+pConfig->nCol])!=SQLITE_NULL + if( eType0==SQLITE_NULL + && sqlite3_value_type(apVal[2+pConfig->nCol])!=SQLITE_NULL ){ /* A "special" INSERT op. These are handled separately. */ const char *z = (const char*)sqlite3_value_text(apVal[2+pConfig->nCol]); - if( pConfig->eContent!=FTS5_CONTENT_NORMAL - && 0==sqlite3_stricmp("delete", z) + if( pConfig->eContent!=FTS5_CONTENT_NORMAL + && 0==sqlite3_stricmp("delete", z) ){ rc = fts5SpecialDelete(pTab, apVal); }else{ @@ -1493,7 +1493,7 @@ static int fts5UpdateMethod( } }else{ /* A regular INSERT, UPDATE or DELETE statement. The trick here is that - ** any conflict on the rowid value must be detected before any + ** any conflict on the rowid value must be detected before any ** modifications are made to the database file. There are 4 cases: ** ** 1) DELETE @@ -1515,7 +1515,7 @@ static int fts5UpdateMethod( ** This is not suported. */ if( eType0==SQLITE_INTEGER && fts5IsContentless(pTab) ){ pTab->base.zErrMsg = sqlite3_mprintf( - "cannot %s contentless fts5 table: %s", + "cannot %s contentless fts5 table: %s", (nArg>1 ? "UPDATE" : "DELETE from"), pConfig->zName ); rc = SQLITE_ERROR; @@ -1528,10 +1528,10 @@ static int fts5UpdateMethod( } /* INSERT */ - else if( eType0!=SQLITE_INTEGER ){ + else if( eType0!=SQLITE_INTEGER ){ /* If this is a REPLACE, first remove the current entry (if any) */ - if( eConflict==SQLITE_REPLACE - && sqlite3_value_type(apVal[1])==SQLITE_INTEGER + if( eConflict==SQLITE_REPLACE + && sqlite3_value_type(apVal[1])==SQLITE_INTEGER ){ i64 iNew = sqlite3_value_int64(apVal[1]); /* Rowid to delete */ rc = sqlite3Fts5StorageDelete(pTab->pStorage, iNew, 0); @@ -1571,7 +1571,7 @@ static int fts5UpdateMethod( } /* -** Implementation of xSync() method. +** Implementation of xSync() method. */ static int fts5SyncMethod(sqlite3_vtab *pVtab){ int rc; @@ -1585,7 +1585,7 @@ static int fts5SyncMethod(sqlite3_vtab *pVtab){ } /* -** Implementation of xBegin() method. +** Implementation of xBegin() method. */ static int fts5BeginMethod(sqlite3_vtab *pVtab){ fts5CheckTransactionState((Fts5Table*)pVtab, FTS5_BEGIN, 0); @@ -1629,8 +1629,8 @@ static int fts5ApiColumnCount(Fts5Context *pCtx){ } static int fts5ApiColumnTotalSize( - Fts5Context *pCtx, - int iCol, + Fts5Context *pCtx, + int iCol, sqlite3_int64 *pnToken ){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; @@ -1645,8 +1645,8 @@ static int fts5ApiRowCount(Fts5Context *pCtx, i64 *pnRow){ } static int fts5ApiTokenize( - Fts5Context *pCtx, - const char *pText, int nText, + Fts5Context *pCtx, + const char *pText, int nText, void *pUserData, int (*xToken)(void*, int, const char*, int, int, int) ){ @@ -1668,9 +1668,9 @@ static int fts5ApiPhraseSize(Fts5Context *pCtx, int iPhrase){ } static int fts5ApiColumnText( - Fts5Context *pCtx, - int iCol, - const char **pz, + Fts5Context *pCtx, + int iCol, + const char **pz, int *pn ){ int rc = SQLITE_OK; @@ -1689,8 +1689,8 @@ static int fts5ApiColumnText( } static int fts5CsrPoslist( - Fts5Cursor *pCsr, - int iPhrase, + Fts5Cursor *pCsr, + int iPhrase, const u8 **pa, int *pn ){ @@ -1744,7 +1744,7 @@ static int fts5CacheInstArray(Fts5Cursor *pCsr){ int rc = SQLITE_OK; Fts5PoslistReader *aIter; /* One iterator for each phrase */ int nIter; /* Number of iterators/phrases */ - + nIter = sqlite3Fts5ExprPhraseCount(pCsr->pExpr); if( pCsr->aInstIter==0 ){ int nByte = sizeof(Fts5PoslistReader) * nIter; @@ -1759,7 +1759,7 @@ static int fts5CacheInstArray(Fts5Cursor *pCsr){ /* Initialize all iterators */ for(i=0; inInstCount; } @@ -1818,16 +1818,16 @@ static int fts5ApiInstCount(Fts5Context *pCtx, int *pnInst){ } static int fts5ApiInst( - Fts5Context *pCtx, - int iIdx, - int *piPhrase, - int *piCol, + Fts5Context *pCtx, + int iIdx, + int *piPhrase, + int *piCol, int *piOff ){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; int rc = SQLITE_OK; - if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_INST)==0 - || SQLITE_OK==(rc = fts5CacheInstArray(pCsr)) + if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_INST)==0 + || SQLITE_OK==(rc = fts5CacheInstArray(pCsr)) ){ if( iIdx<0 || iIdx>=pCsr->nInstCount ){ rc = SQLITE_RANGE; @@ -1976,8 +1976,8 @@ static void *fts5ApiGetAuxdata(Fts5Context *pCtx, int bClear){ } static void fts5ApiPhraseNext( - Fts5Context *pUnused, - Fts5PhraseIter *pIter, + Fts5Context *pUnused, + Fts5PhraseIter *pIter, int *piCol, int *piOff ){ UNUSED_PARAM(pUnused); @@ -1998,9 +1998,9 @@ static void fts5ApiPhraseNext( } static int fts5ApiPhraseFirst( - Fts5Context *pCtx, - int iPhrase, - Fts5PhraseIter *pIter, + Fts5Context *pCtx, + int iPhrase, + Fts5PhraseIter *pIter, int *piCol, int *piOff ){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; @@ -2016,8 +2016,8 @@ static int fts5ApiPhraseFirst( } static void fts5ApiPhraseNextColumn( - Fts5Context *pCtx, - Fts5PhraseIter *pIter, + Fts5Context *pCtx, + Fts5PhraseIter *pIter, int *piCol ){ Fts5Cursor *pCsr = (Fts5Cursor*)pCtx; @@ -2046,9 +2046,9 @@ static void fts5ApiPhraseNextColumn( } static int fts5ApiPhraseFirstColumn( - Fts5Context *pCtx, - int iPhrase, - Fts5PhraseIter *pIter, + Fts5Context *pCtx, + int iPhrase, + Fts5PhraseIter *pIter, int *piCol ){ int rc = SQLITE_OK; @@ -2089,7 +2089,7 @@ static int fts5ApiPhraseFirstColumn( } -static int fts5ApiQueryPhrase(Fts5Context*, int, void*, +static int fts5ApiQueryPhrase(Fts5Context*, int, void*, int(*)(const Fts5ExtensionApi*, Fts5Context*, void*) ); @@ -2120,8 +2120,8 @@ static const Fts5ExtensionApi sFts5Api = { ** Implementation of API function xQueryPhrase(). */ static int fts5ApiQueryPhrase( - Fts5Context *pCtx, - int iPhrase, + Fts5Context *pCtx, + int iPhrase, void *pUserData, int(*xCallback)(const Fts5ExtensionApi*, Fts5Context*, void*) ){ @@ -2203,10 +2203,10 @@ static void fts5ApiCallback( /* -** Given cursor id iId, return a pointer to the corresponding Fts5Index +** Given cursor id iId, return a pointer to the corresponding Fts5Index ** object. Or NULL If the cursor id does not exist. ** -** If successful, set *ppConfig to point to the associated config object +** If successful, set *ppConfig to point to the associated config object ** before returning. */ Fts5Index *sqlite3Fts5IndexFromCsrid( @@ -2292,7 +2292,7 @@ static int fts5PoslistBlob(sqlite3_context *pCtx, Fts5Cursor *pCsr){ return rc; } -/* +/* ** This is the xColumn method, called by SQLite to request a value from ** the row that the supplied cursor currently points to. */ @@ -2305,7 +2305,7 @@ static int fts5ColumnMethod( Fts5Config *pConfig = pTab->pConfig; Fts5Cursor *pCsr = (Fts5Cursor*)pCursor; int rc = SQLITE_OK; - + assert( CsrFlagTest(pCsr, FTS5CSR_EOF)==0 ); if( pCsr->ePlan==FTS5_PLAN_SPECIAL ){ @@ -2325,7 +2325,7 @@ static int fts5ColumnMethod( /* The value of the "rank" column. */ if( pCsr->ePlan==FTS5_PLAN_SOURCE ){ fts5PoslistBlob(pCtx, pCsr); - }else if( + }else if( pCsr->ePlan==FTS5_PLAN_MATCH || pCsr->ePlan==FTS5_PLAN_SORTED_MATCH ){ @@ -2458,7 +2458,7 @@ static int fts5CreateAux( } /* -** Register a new tokenizer. This is the implementation of the +** Register a new tokenizer. This is the implementation of the ** fts5_api.xCreateTokenizer() method. */ static int fts5CreateTokenizer( @@ -2497,7 +2497,7 @@ static int fts5CreateTokenizer( } static Fts5TokenizerModule *fts5LocateTokenizer( - Fts5Global *pGlobal, + Fts5Global *pGlobal, const char *zName ){ Fts5TokenizerModule *pMod = 0; @@ -2514,7 +2514,7 @@ static Fts5TokenizerModule *fts5LocateTokenizer( } /* -** Find a tokenizer. This is the implementation of the +** Find a tokenizer. This is the implementation of the ** fts5_api.xFindTokenizer() method. */ static int fts5FindTokenizer( @@ -2539,7 +2539,7 @@ static int fts5FindTokenizer( } int sqlite3Fts5GetTokenizer( - Fts5Global *pGlobal, + Fts5Global *pGlobal, const char **azArg, int nArg, Fts5Tokenizer **ppTok, @@ -2694,7 +2694,7 @@ static int fts5Init(sqlite3 *db){ ** this module is being built as part of the SQLite core (SQLITE_CORE is ** defined), then sqlite3_open() will call sqlite3Fts5Init() directly. ** -** Or, if this module is being built as a loadable extension, +** Or, if this module is being built as a loadable extension, ** sqlite3Fts5Init() is omitted and the two standard entry points ** sqlite3_fts_init() and sqlite3_fts5_init() defined instead. */ diff --git a/third_party/sqlite/src/ext/fts5/fts5_storage.c b/third_party/sqlite/src/ext/fts5/fts5_storage.c index a6958874582e0..f807e825a2f69 100644 --- a/third_party/sqlite/src/ext/fts5/fts5_storage.c +++ b/third_party/sqlite/src/ext/fts5/fts5_storage.c @@ -21,19 +21,19 @@ struct Fts5Storage { Fts5Index *pIndex; int bTotalsValid; /* True if nTotalRow/aTotalSize[] are valid */ i64 nTotalRow; /* Total number of rows in FTS table */ - i64 *aTotalSize; /* Total sizes of each column */ + i64 *aTotalSize; /* Total sizes of each column */ sqlite3_stmt *aStmt[11]; }; -#if FTS5_STMT_SCAN_ASC!=0 -# error "FTS5_STMT_SCAN_ASC mismatch" +#if FTS5_STMT_SCAN_ASC!=0 +# error "FTS5_STMT_SCAN_ASC mismatch" #endif -#if FTS5_STMT_SCAN_DESC!=1 -# error "FTS5_STMT_SCAN_DESC mismatch" +#if FTS5_STMT_SCAN_DESC!=1 +# error "FTS5_STMT_SCAN_DESC mismatch" #endif #if FTS5_STMT_LOOKUP!=2 -# error "FTS5_STMT_LOOKUP mismatch" +# error "FTS5_STMT_LOOKUP mismatch" #endif #define FTS5_STMT_INSERT_CONTENT 3 @@ -59,12 +59,12 @@ static int fts5StorageGetStmt( ){ int rc = SQLITE_OK; - /* If there is no %_docsize table, there should be no requests for + /* If there is no %_docsize table, there should be no requests for ** statements to operate on it. */ assert( p->pConfig->bColumnsize || ( - eStmt!=FTS5_STMT_REPLACE_DOCSIZE - && eStmt!=FTS5_STMT_DELETE_DOCSIZE - && eStmt!=FTS5_STMT_LOOKUP_DOCSIZE + eStmt!=FTS5_STMT_REPLACE_DOCSIZE + && eStmt!=FTS5_STMT_DELETE_DOCSIZE + && eStmt!=FTS5_STMT_LOOKUP_DOCSIZE )); assert( eStmt>=0 && eStmtaStmt) ); @@ -90,26 +90,26 @@ static int fts5StorageGetStmt( switch( eStmt ){ case FTS5_STMT_SCAN: - zSql = sqlite3_mprintf(azStmt[eStmt], + zSql = sqlite3_mprintf(azStmt[eStmt], pC->zContentExprlist, pC->zContent ); break; case FTS5_STMT_SCAN_ASC: case FTS5_STMT_SCAN_DESC: - zSql = sqlite3_mprintf(azStmt[eStmt], pC->zContentExprlist, + zSql = sqlite3_mprintf(azStmt[eStmt], pC->zContentExprlist, pC->zContent, pC->zContentRowid, pC->zContentRowid, pC->zContentRowid ); break; case FTS5_STMT_LOOKUP: - zSql = sqlite3_mprintf(azStmt[eStmt], + zSql = sqlite3_mprintf(azStmt[eStmt], pC->zContentExprlist, pC->zContent, pC->zContentRowid ); break; - case FTS5_STMT_INSERT_CONTENT: + case FTS5_STMT_INSERT_CONTENT: case FTS5_STMT_REPLACE_CONTENT: { int nCol = pC->nCol + 1; char *zBind; @@ -179,7 +179,7 @@ static int fts5ExecPrintf( ** code otherwise. */ int sqlite3Fts5DropAll(Fts5Config *pConfig){ - int rc = fts5ExecPrintf(pConfig->db, 0, + int rc = fts5ExecPrintf(pConfig->db, 0, "DROP TABLE IF EXISTS %Q.'%q_data';" "DROP TABLE IF EXISTS %Q.'%q_idx';" "DROP TABLE IF EXISTS %Q.'%q_config';", @@ -188,13 +188,13 @@ int sqlite3Fts5DropAll(Fts5Config *pConfig){ pConfig->zDb, pConfig->zName ); if( rc==SQLITE_OK && pConfig->bColumnsize ){ - rc = fts5ExecPrintf(pConfig->db, 0, + rc = fts5ExecPrintf(pConfig->db, 0, "DROP TABLE IF EXISTS %Q.'%q_docsize';", pConfig->zDb, pConfig->zName ); } if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){ - rc = fts5ExecPrintf(pConfig->db, 0, + rc = fts5ExecPrintf(pConfig->db, 0, "DROP TABLE IF EXISTS %Q.'%q_content';", pConfig->zDb, pConfig->zName ); @@ -209,7 +209,7 @@ static void fts5StorageRenameOne( const char *zName /* New name of FTS5 table */ ){ if( *pRc==SQLITE_OK ){ - *pRc = fts5ExecPrintf(pConfig->db, 0, + *pRc = fts5ExecPrintf(pConfig->db, 0, "ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';", pConfig->zDb, pConfig->zName, zTail, zName, zTail ); @@ -247,7 +247,7 @@ int sqlite3Fts5CreateTable( char *zErr = 0; rc = fts5ExecPrintf(pConfig->db, &zErr, "CREATE TABLE %Q.'%q_%q'(%s)%s", - pConfig->zDb, pConfig->zName, zPost, zDefn, + pConfig->zDb, pConfig->zName, zPost, zDefn, #ifndef SQLITE_FTS5_NO_WITHOUT_ROWID bWithout?" WITHOUT ROWID": #endif @@ -255,7 +255,7 @@ int sqlite3Fts5CreateTable( ); if( zErr ){ *pzErr = sqlite3_mprintf( - "fts5: error creating shadow table %q_%s: %s", + "fts5: error creating shadow table %q_%s: %s", pConfig->zName, zPost, zErr ); sqlite3_free(zErr); @@ -266,15 +266,15 @@ int sqlite3Fts5CreateTable( /* ** Open a new Fts5Index handle. If the bCreate argument is true, create -** and initialize the underlying tables +** and initialize the underlying tables ** ** If successful, set *pp to point to the new object and return SQLITE_OK. ** Otherwise, set *pp to NULL and return an SQLite error code. */ int sqlite3Fts5StorageOpen( - Fts5Config *pConfig, - Fts5Index *pIndex, - int bCreate, + Fts5Config *pConfig, + Fts5Index *pIndex, + int bCreate, Fts5Storage **pp, char **pzErr /* OUT: Error message */ ){ @@ -386,8 +386,8 @@ static int fts5StorageInsertCallback( ** remove the %_content row at this time though. */ static int fts5StorageDeleteFromIndex( - Fts5Storage *p, - i64 iDel, + Fts5Storage *p, + i64 iDel, sqlite3_value **apVal ){ Fts5Config *pConfig = p->pConfig; @@ -421,7 +421,7 @@ static int fts5StorageDeleteFromIndex( nText = sqlite3_value_bytes(apVal[iCol-1]); } ctx.szCol = 0; - rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, + rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, zText, nText, (void*)&ctx, fts5StorageInsertCallback ); p->aTotalSize[iCol-1] -= (i64)ctx.szCol; @@ -463,7 +463,7 @@ static int fts5StorageInsertDocsize( } /* -** Load the contents of the "averages" record from disk into the +** Load the contents of the "averages" record from disk into the ** p->nTotalRow and p->aTotalSize[] variables. If successful, and if ** argument bCache is true, set the p->bTotalsValid flag to indicate ** that the contents of aTotalSize[] and nTotalRow are valid until @@ -482,7 +482,7 @@ static int fts5StorageLoadTotals(Fts5Storage *p, int bCache){ } /* -** Store the current contents of the p->nTotalRow and p->aTotalSize[] +** Store the current contents of the p->nTotalRow and p->aTotalSize[] ** variables in the "averages" record on disk. ** ** Return SQLITE_OK if successful, or an SQLite error code if an error @@ -562,7 +562,7 @@ int sqlite3Fts5StorageDeleteAll(Fts5Storage *p){ /* Delete the contents of the %_data and %_docsize tables. */ rc = fts5ExecPrintf(pConfig->db, 0, - "DELETE FROM %Q.'%q_data';" + "DELETE FROM %Q.'%q_data';" "DELETE FROM %Q.'%q_idx';", pConfig->zDb, pConfig->zName, pConfig->zDb, pConfig->zName @@ -611,7 +611,7 @@ int sqlite3Fts5StorageRebuild(Fts5Storage *p){ for(ctx.iCol=0; rc==SQLITE_OK && ctx.iColnCol; ctx.iCol++){ ctx.szCol = 0; if( pConfig->abUnindexed[ctx.iCol]==0 ){ - rc = sqlite3Fts5Tokenize(pConfig, + rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, (const char*)sqlite3_column_text(pScan, ctx.iCol+1), sqlite3_column_bytes(pScan, ctx.iCol+1), @@ -680,8 +680,8 @@ static int fts5StorageNewRowid(Fts5Storage *p, i64 *piRowid){ ** Insert a new row into the FTS content table. */ int sqlite3Fts5StorageContentInsert( - Fts5Storage *p, - sqlite3_value **apVal, + Fts5Storage *p, + sqlite3_value **apVal, i64 *piRowid ){ Fts5Config *pConfig = p->pConfig; @@ -715,8 +715,8 @@ int sqlite3Fts5StorageContentInsert( ** Insert new entries into the FTS index and %_docsize table. */ int sqlite3Fts5StorageIndexInsert( - Fts5Storage *p, - sqlite3_value **apVal, + Fts5Storage *p, + sqlite3_value **apVal, i64 iRowid ){ Fts5Config *pConfig = p->pConfig; @@ -734,7 +734,7 @@ int sqlite3Fts5StorageIndexInsert( for(ctx.iCol=0; rc==SQLITE_OK && ctx.iColnCol; ctx.iCol++){ ctx.szCol = 0; if( pConfig->abUnindexed[ctx.iCol]==0 ){ - rc = sqlite3Fts5Tokenize(pConfig, + rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, (const char*)sqlite3_value_text(apVal[ctx.iCol+2]), sqlite3_value_bytes(apVal[ctx.iCol+2]), @@ -766,7 +766,7 @@ static int fts5StorageCount(Fts5Storage *p, const char *zSuffix, i64 *pnRow){ char *zSql; int rc; - zSql = sqlite3_mprintf("SELECT count(*) FROM %Q.'%q_%s'", + zSql = sqlite3_mprintf("SELECT count(*) FROM %Q.'%q_%s'", pConfig->zDb, pConfig->zName, zSuffix ); if( zSql==0 ){ @@ -911,7 +911,7 @@ int sqlite3Fts5StorageIntegrity(Fts5Storage *p){ rc = sqlite3Fts5TermsetNew(&ctx.pTermset); } if( rc==SQLITE_OK ){ - rc = sqlite3Fts5Tokenize(pConfig, + rc = sqlite3Fts5Tokenize(pConfig, FTS5_TOKENIZE_DOCUMENT, (const char*)sqlite3_column_text(pScan, i+1), sqlite3_column_bytes(pScan, i+1), @@ -975,13 +975,13 @@ int sqlite3Fts5StorageIntegrity(Fts5Storage *p){ ** %_content table. */ int sqlite3Fts5StorageStmt( - Fts5Storage *p, - int eStmt, - sqlite3_stmt **pp, + Fts5Storage *p, + int eStmt, + sqlite3_stmt **pp, char **pzErrMsg ){ int rc; - assert( eStmt==FTS5_STMT_SCAN_ASC + assert( eStmt==FTS5_STMT_SCAN_ASC || eStmt==FTS5_STMT_SCAN_DESC || eStmt==FTS5_STMT_LOOKUP ); @@ -999,8 +999,8 @@ int sqlite3Fts5StorageStmt( ** must match that passed to the sqlite3Fts5StorageStmt() call. */ void sqlite3Fts5StorageStmtRelease( - Fts5Storage *p, - int eStmt, + Fts5Storage *p, + int eStmt, sqlite3_stmt *pStmt ){ assert( eStmt==FTS5_STMT_SCAN_ASC @@ -1106,7 +1106,7 @@ int sqlite3Fts5StorageRollback(Fts5Storage *p){ } int sqlite3Fts5StorageConfigValue( - Fts5Storage *p, + Fts5Storage *p, const char *z, sqlite3_value *pVal, int iVal diff --git a/third_party/sqlite/src/ext/fts5/fts5_tcl.c b/third_party/sqlite/src/ext/fts5/fts5_tcl.c index 5fe690f6b7a9a..a76437afb119e 100644 --- a/third_party/sqlite/src/ext/fts5/fts5_tcl.c +++ b/third_party/sqlite/src/ext/fts5/fts5_tcl.c @@ -34,7 +34,7 @@ extern int sqlite3Fts5TestRegisterMatchinfo(sqlite3*); extern int sqlite3Fts5TestRegisterTok(sqlite3*, fts5_api*); /************************************************************************* -** This is a copy of the first part of the SqliteDb structure in +** This is a copy of the first part of the SqliteDb structure in ** tclsqlite.c. We need it here so that the get_sqlite_pointer routine ** can extract the sqlite3* pointer from an existing Tcl SQLite ** connection. @@ -86,9 +86,9 @@ static int f5tResultToErrorCode(const char *zRes){ } static int SQLITE_TCLAPI f5tDbAndApi( - Tcl_Interp *interp, - Tcl_Obj *pObj, - sqlite3 **ppDb, + Tcl_Interp *interp, + Tcl_Obj *pObj, + sqlite3 **ppDb, fts5_api **ppApi ){ sqlite3 *db = 0; @@ -136,10 +136,10 @@ struct F5tApi { /* ** An object of this type is used with the xSetAuxdata() and xGetAuxdata() -** API test wrappers. The tcl interface allows a single tcl value to be +** API test wrappers. The tcl interface allows a single tcl value to be ** saved using xSetAuxdata(). Instead of simply storing a pointer to the -** tcl object, the code in this file wraps it in an sqlite3_malloc'd -** instance of the following struct so that if the destructor is not +** tcl object, the code in this file wraps it in an sqlite3_malloc'd +** instance of the following struct so that if the destructor is not ** correctly invoked it will be reported as an SQLite memory leak. */ typedef struct F5tAuxData F5tAuxData; @@ -148,9 +148,9 @@ struct F5tAuxData { }; static int xTokenizeCb( - void *pCtx, + void *pCtx, int tflags, - const char *zToken, int nToken, + const char *zToken, int nToken, int iStart, int iEnd ){ F5tFunction *p = (F5tFunction*)pCtx; @@ -174,8 +174,8 @@ static int xTokenizeCb( static int SQLITE_TCLAPI xF5tApi(void*, Tcl_Interp*, int, Tcl_Obj *CONST []); static int xQueryPhraseCb( - const Fts5ExtensionApi *pApi, - Fts5Context *pFts, + const Fts5ExtensionApi *pApi, + Fts5Context *pFts, void *pCtx ){ F5tFunction *p = (F5tFunction*)pCtx; @@ -501,7 +501,7 @@ static int SQLITE_TCLAPI xF5tApi( break; } - default: + default: assert( 0 ); break; } @@ -654,9 +654,9 @@ struct F5tTokenizeCtx { }; static int xTokenizeCb2( - void *pCtx, + void *pCtx, int tflags, - const char *zToken, int nToken, + const char *zToken, int nToken, int iStart, int iEnd ){ F5tTokenizeCtx *p = (F5tTokenizeCtx*)pCtx; @@ -782,9 +782,9 @@ struct F5tTokenizerInstance { }; static int f5tTokenizerCreate( - void *pCtx, - const char **azArg, - int nArg, + void *pCtx, + const char **azArg, + int nArg, Fts5Tokenizer **ppOut ){ F5tTokenizerModule *pMod = (F5tTokenizerModule*)pCtx; @@ -826,10 +826,10 @@ static void f5tTokenizerDelete(Fts5Tokenizer *p){ } static int f5tTokenizerTokenize( - Fts5Tokenizer *p, + Fts5Tokenizer *p, void *pCtx, int flags, - const char *pText, int nText, + const char *pText, int nText, int (*xToken)(void*, int, const char*, int, int, int) ){ F5tTokenizerInstance *pInst = (F5tTokenizerInstance*)p; @@ -845,7 +845,7 @@ static int f5tTokenizerTokenize( pInst->pContext->pCtx = pCtx; pInst->pContext->xToken = xToken; - assert( + assert( flags==FTS5_TOKENIZE_DOCUMENT || flags==FTS5_TOKENIZE_AUX || flags==FTS5_TOKENIZE_QUERY @@ -912,14 +912,14 @@ static int SQLITE_TCLAPI f5tTokenizerReturn( } zToken = Tcl_GetStringFromObj(objv[objc-3], &nToken); - if( Tcl_GetIntFromObj(interp, objv[objc-2], &iStart) - || Tcl_GetIntFromObj(interp, objv[objc-1], &iEnd) + if( Tcl_GetIntFromObj(interp, objv[objc-2], &iStart) + || Tcl_GetIntFromObj(interp, objv[objc-1], &iEnd) ){ return TCL_ERROR; } if( p->xToken==0 ){ - Tcl_AppendResult(interp, + Tcl_AppendResult(interp, "sqlite3_fts5_token may only be used by tokenizer callback", 0 ); return TCL_ERROR; @@ -947,7 +947,7 @@ static void f5tDelTokenizer(void *pCtx){ ** a tokenizer instance is created (fts5_tokenizer.xCreate), any tokenizer ** arguments are appended to SCRIPT and the result executed. ** -** The value returned by (SCRIPT + args) is itself a tcl script. This +** The value returned by (SCRIPT + args) is itself a tcl script. This ** script - call it SCRIPT2 - is executed to tokenize text using the ** tokenizer instance "returned" by SCRIPT. Specifically, to tokenize ** text SCRIPT2 is invoked with a single argument appended to it - the diff --git a/third_party/sqlite/src/ext/fts5/fts5_test_mi.c b/third_party/sqlite/src/ext/fts5/fts5_test_mi.c index a905b85bb9896..6476e27171839 100644 --- a/third_party/sqlite/src/ext/fts5/fts5_test_mi.c +++ b/third_party/sqlite/src/ext/fts5/fts5_test_mi.c @@ -10,7 +10,7 @@ ** ****************************************************************************** ** -** This file contains test code only, it is not included in release +** This file contains test code only, it is not included in release ** versions of FTS5. It contains the implementation of an FTS5 auxiliary ** function very similar to the FTS4 function matchinfo(): ** @@ -20,20 +20,20 @@ ** ** 1) this function uses the FTS5 definition of "matchable phrase", which ** excludes any phrases that are part of an expression sub-tree that -** does not match the current row. This comes up for MATCH queries +** does not match the current row. This comes up for MATCH queries ** such as: ** ** "a OR (b AND c)" ** -** In FTS4, if a single row contains instances of tokens "a" and "c", +** In FTS4, if a single row contains instances of tokens "a" and "c", ** but not "b", all instances of "c" are considered matches. In FTS5, ** they are not (as the "b AND c" sub-tree does not match the current ** row. ** -** 2) For the values returned by 'x' that apply to all rows of the table, +** 2) For the values returned by 'x' that apply to all rows of the table, ** NEAR constraints are not considered. But for the number of hits in ** the current row, they are. -** +** ** This file exports a single function that may be called to register the ** matchinfo() implementation with a database handle: ** @@ -65,7 +65,7 @@ struct Fts5MatchinfoCtx { /* ** Return a pointer to the fts5_api pointer for database connection db. -** If an error occurs, return NULL and leave an error in the database +** If an error occurs, return NULL and leave an error in the database ** handle (accessible using sqlite3_errcode()/errmsg()). */ static int fts5_api_from_db(sqlite3 *db, fts5_api **ppApi){ @@ -75,7 +75,7 @@ static int fts5_api_from_db(sqlite3 *db, fts5_api **ppApi){ *ppApi = 0; rc = sqlite3_prepare(db, "SELECT fts5()", -1, &pStmt, 0); if( rc==SQLITE_OK ){ - if( SQLITE_ROW==sqlite3_step(pStmt) + if( SQLITE_ROW==sqlite3_step(pStmt) && sizeof(fts5_api*)==sqlite3_column_bytes(pStmt, 0) ){ memcpy(ppApi, sqlite3_column_blob(pStmt, 0), sizeof(fts5_api*)); @@ -89,7 +89,7 @@ static int fts5_api_from_db(sqlite3 *db, fts5_api **ppApi){ /* ** Argument f should be a flag accepted by matchinfo() (a valid character -** in the string passed as the second argument). If it is not, -1 is +** in the string passed as the second argument). If it is not, -1 is ** returned. Otherwise, if f is a valid matchinfo flag, the value returned ** is the number of 32-bit integers added to the output array if the ** table has nCol columns and the query nPhrase phrases. @@ -138,8 +138,8 @@ static int fts5MatchinfoXCb( u32 *aOut = (u32*)pUserData; int iPrev = -1; - for(pApi->xPhraseFirst(pFts, 0, &iter, &iCol, &iOff); - iCol>=0; + for(pApi->xPhraseFirst(pFts, 0, &iter, &iCol, &iOff); + iCol>=0; pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) ){ aOut[iCol*3+1]++; @@ -160,11 +160,11 @@ static int fts5MatchinfoGlobalCb( int rc = SQLITE_OK; switch( f ){ case 'p': - aOut[0] = p->nPhrase; + aOut[0] = p->nPhrase; break; case 'c': - aOut[0] = p->nCol; + aOut[0] = p->nCol; break; case 'x': { @@ -225,7 +225,7 @@ static int fts5MatchinfoLocalCb( Fts5PhraseIter iter; int iCol; for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); - iCol>=0; + iCol>=0; pApi->xPhraseNextColumn(pFts, &iter, &iCol) ){ aOut[iPhrase * ((p->nCol+31)/32) + iCol/32] |= ((u32)1 << iCol%32); @@ -245,8 +245,8 @@ static int fts5MatchinfoLocalCb( for(iPhrase=0; iPhrasenPhrase; iPhrase++){ Fts5PhraseIter iter; int iOff, iCol; - for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); - iOff>=0; + for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); + iOff>=0; pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) ){ aOut[nMul * (iCol + iPhrase * p->nCol)]++; @@ -300,7 +300,7 @@ static int fts5MatchinfoLocalCb( } return rc; } - + static Fts5MatchinfoCtx *fts5MatchinfoNew( const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ Fts5Context *pFts, /* First arg to pass to pApi functions */ @@ -400,8 +400,8 @@ int sqlite3Fts5TestRegisterMatchinfo(sqlite3 *db){ int rc; /* Return code */ fts5_api *pApi; /* FTS5 API functions */ - /* Extract the FTS5 API pointer from the database handle. The - ** fts5_api_from_db() function above is copied verbatim from the + /* Extract the FTS5 API pointer from the database handle. The + ** fts5_api_from_db() function above is copied verbatim from the ** FTS5 documentation. Refer there for details. */ rc = fts5_api_from_db(db, &pApi); if( rc!=SQLITE_OK ) return rc; @@ -409,8 +409,8 @@ int sqlite3Fts5TestRegisterMatchinfo(sqlite3 *db){ /* If fts5_api_from_db() returns NULL, then either FTS5 is not registered ** with this database handle, or an error (OOM perhaps?) has occurred. ** - ** Also check that the fts5_api object is version 2 or newer. - */ + ** Also check that the fts5_api object is version 2 or newer. + */ if( pApi==0 || pApi->iVersion<2 ){ return SQLITE_ERROR; } diff --git a/third_party/sqlite/src/ext/fts5/fts5_test_tok.c b/third_party/sqlite/src/ext/fts5/fts5_test_tok.c index 10af126c10974..18db80ed24c19 100644 --- a/third_party/sqlite/src/ext/fts5/fts5_test_tok.c +++ b/third_party/sqlite/src/ext/fts5/fts5_test_tok.c @@ -25,8 +25,8 @@ ** ** input = ** -** The virtual table module tokenizes this , using the FTS3 -** tokenizer specified by the arguments to the CREATE VIRTUAL TABLE +** The virtual table module tokenizes this , using the FTS3 +** tokenizer specified by the arguments to the CREATE VIRTUAL TABLE ** statement and returns one row for each token in the result. With ** fields set as follows: ** @@ -84,7 +84,7 @@ static void fts5tokDequote(char *z){ if( q=='[' || q=='\'' || q=='"' || q=='`' ){ int iIn = 1; int iOut = 0; - if( q=='[' ) q = ']'; + if( q=='[' ) q = ']'; while( z[iIn] ){ if( z[iIn]==q ){ @@ -94,7 +94,7 @@ static void fts5tokDequote(char *z){ break; }else{ /* Character iIn and iIn+1 form an escaped quote character. Skip - ** the input cursor past both and copy a single quote character + ** the input cursor past both and copy a single quote character ** to the output buffer. */ iIn += 2; z[iOut++] = q; @@ -110,7 +110,7 @@ static void fts5tokDequote(char *z){ /* ** The second argument, argv[], is an array of pointers to nul-terminated -** strings. This function makes a copy of the array and strings into a +** strings. This function makes a copy of the array and strings into a ** single block of memory. It then dequotes any of the strings that appear ** to be quoted. ** @@ -166,7 +166,7 @@ static int fts5tokDequoteArray( ** and xCreate are identical operations. ** ** argv[0]: module name -** argv[1]: database name +** argv[1]: database name ** argv[2]: table name ** argv[3]: first argument (tokenizer name) */ @@ -184,7 +184,7 @@ static int fts5tokConnectMethod( char **azDequote = 0; int nDequote; - rc = sqlite3_declare_vtab(db, + rc = sqlite3_declare_vtab(db, "CREATE TABLE x(input HIDDEN, token, start, end, position)" ); @@ -245,15 +245,15 @@ static int fts5tokDisconnectMethod(sqlite3_vtab *pVtab){ ** xBestIndex - Analyze a WHERE and ORDER BY clause. */ static int fts5tokBestIndexMethod( - sqlite3_vtab *pVTab, + sqlite3_vtab *pVTab, sqlite3_index_info *pInfo ){ int i; for(i=0; inConstraint; i++){ - if( pInfo->aConstraint[i].usable - && pInfo->aConstraint[i].iColumn==0 - && pInfo->aConstraint[i].op==SQLITE_INDEX_CONSTRAINT_EQ + if( pInfo->aConstraint[i].usable + && pInfo->aConstraint[i].iColumn==0 + && pInfo->aConstraint[i].op==SQLITE_INDEX_CONSTRAINT_EQ ){ pInfo->idxNum = 1; pInfo->aConstraintUsage[i].argvIndex = 1; diff --git a/third_party/sqlite/src/ext/fts5/fts5_tokenize.c b/third_party/sqlite/src/ext/fts5/fts5_tokenize.c index b72a0c24ab9f4..e725570bb4c5f 100644 --- a/third_party/sqlite/src/ext/fts5/fts5_tokenize.c +++ b/third_party/sqlite/src/ext/fts5/fts5_tokenize.c @@ -20,7 +20,7 @@ /* ** For tokenizers with no "unicode" modifier, the set of token characters -** is the same as the set of ASCII range alphanumeric characters. +** is the same as the set of ASCII range alphanumeric characters. */ static unsigned char aAsciiTokenChar[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00..0x0F */ @@ -39,8 +39,8 @@ struct AsciiTokenizer { }; static void fts5AsciiAddExceptions( - AsciiTokenizer *p, - const char *zArg, + AsciiTokenizer *p, + const char *zArg, int bTokenChars ){ int i; @@ -62,7 +62,7 @@ static void fts5AsciiDelete(Fts5Tokenizer *p){ ** Create an "ascii" tokenizer. */ static int fts5AsciiCreate( - void *pUnused, + void *pUnused, const char **azArg, int nArg, Fts5Tokenizer **ppOut ){ @@ -165,7 +165,7 @@ static int fts5AsciiTokenize( rc = xToken(pCtx, 0, pFold, nByte, is, ie); is = ie+1; } - + if( pFold!=aFold ) sqlite3_free(pFold); if( rc==SQLITE_DONE ) rc = SQLITE_OK; return rc; @@ -262,7 +262,7 @@ static int fts5UnicodeAddExceptions( p->aTokenChar[iCode] = (unsigned char)bTokenChars; }else{ bToken = sqlite3Fts5UnicodeIsalnum(iCode); - assert( (bToken==0 || bToken==1) ); + assert( (bToken==0 || bToken==1) ); assert( (bTokenChars==0 || bTokenChars==1) ); if( bToken!=bTokenChars && sqlite3Fts5UnicodeIsdiacritic(iCode)==0 ){ int i; @@ -326,12 +326,12 @@ static void fts5UnicodeDelete(Fts5Tokenizer *pTok){ ** Create a "unicode61" tokenizer. */ static int fts5UnicodeCreate( - void *pUnused, + void *pUnused, const char **azArg, int nArg, Fts5Tokenizer **ppOut ){ int rc = SQLITE_OK; /* Return code */ - Unicode61Tokenizer *p = 0; /* New tokenizer object */ + Unicode61Tokenizer *p = 0; /* New tokenizer object */ UNUSED_PARAM(pUnused); @@ -380,7 +380,7 @@ static int fts5UnicodeCreate( /* ** Return true if, for the purposes of tokenizing with the tokenizer -** passed as the first argument, codepoint iCode is considered a token +** passed as the first argument, codepoint iCode is considered a token ** character (not a separator). */ static int fts5UnicodeIsAlnum(Unicode61Tokenizer *p, int iCode){ @@ -470,7 +470,7 @@ static int fts5UnicodeTokenize( } }else if( a[*zCsr]==0 ){ /* An ascii-range separator character. End of token. */ - break; + break; }else{ ascii_tokenchar: if( *zCsr>='A' && *zCsr<='Z' ){ @@ -484,9 +484,9 @@ static int fts5UnicodeTokenize( } /* Invoke the token callback */ - rc = xToken(pCtx, 0, aFold, zOut-aFold, is, ie); + rc = xToken(pCtx, 0, aFold, zOut-aFold, is, ie); } - + tokenize_done: if( rc==SQLITE_DONE ) rc = SQLITE_OK; return rc; @@ -524,7 +524,7 @@ static void fts5PorterDelete(Fts5Tokenizer *pTok){ ** Create a "porter" tokenizer. */ static int fts5PorterCreate( - void *pCtx, + void *pCtx, const char **azArg, int nArg, Fts5Tokenizer **ppOut ){ @@ -668,7 +668,7 @@ static int fts5Porter_Ostar(char *zStem, int nStem){ /* porter rule condition: (m > 1 and (*S or *T)) */ static int fts5Porter_MGt1_and_S_or_T(char *zStem, int nStem){ assert( nStem>0 ); - return (zStem[nStem-1]=='s' || zStem[nStem-1]=='t') + return (zStem[nStem-1]=='s' || zStem[nStem-1]=='t') && fts5Porter_MGt1(zStem, nStem); } @@ -693,16 +693,16 @@ static int fts5PorterStep4(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ - - case 'a': + + case 'a': if( nBuf>2 && 0==memcmp("al", &aBuf[nBuf-2], 2) ){ if( fts5Porter_MGt1(aBuf, nBuf-2) ){ *pnBuf = nBuf - 2; } } break; - - case 'c': + + case 'c': if( nBuf>4 && 0==memcmp("ance", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt1(aBuf, nBuf-4) ){ *pnBuf = nBuf - 4; @@ -713,24 +713,24 @@ static int fts5PorterStep4(char *aBuf, int *pnBuf){ } } break; - - case 'e': + + case 'e': if( nBuf>2 && 0==memcmp("er", &aBuf[nBuf-2], 2) ){ if( fts5Porter_MGt1(aBuf, nBuf-2) ){ *pnBuf = nBuf - 2; } } break; - - case 'i': + + case 'i': if( nBuf>2 && 0==memcmp("ic", &aBuf[nBuf-2], 2) ){ if( fts5Porter_MGt1(aBuf, nBuf-2) ){ *pnBuf = nBuf - 2; } } break; - - case 'l': + + case 'l': if( nBuf>4 && 0==memcmp("able", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt1(aBuf, nBuf-4) ){ *pnBuf = nBuf - 4; @@ -741,8 +741,8 @@ static int fts5PorterStep4(char *aBuf, int *pnBuf){ } } break; - - case 'n': + + case 'n': if( nBuf>3 && 0==memcmp("ant", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; @@ -761,8 +761,8 @@ static int fts5PorterStep4(char *aBuf, int *pnBuf){ } } break; - - case 'o': + + case 'o': if( nBuf>3 && 0==memcmp("ion", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1_and_S_or_T(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; @@ -773,16 +773,16 @@ static int fts5PorterStep4(char *aBuf, int *pnBuf){ } } break; - - case 's': + + case 's': if( nBuf>3 && 0==memcmp("ism", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; - - case 't': + + case 't': if( nBuf>3 && 0==memcmp("ate", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; @@ -793,76 +793,76 @@ static int fts5PorterStep4(char *aBuf, int *pnBuf){ } } break; - - case 'u': + + case 'u': if( nBuf>3 && 0==memcmp("ous", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; - - case 'v': + + case 'v': if( nBuf>3 && 0==memcmp("ive", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; - - case 'z': + + case 'z': if( nBuf>3 && 0==memcmp("ize", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt1(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; - + } return ret; } - + static int fts5PorterStep1B2(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ - - case 'a': + + case 'a': if( nBuf>2 && 0==memcmp("at", &aBuf[nBuf-2], 2) ){ memcpy(&aBuf[nBuf-2], "ate", 3); *pnBuf = nBuf - 2 + 3; ret = 1; } break; - - case 'b': + + case 'b': if( nBuf>2 && 0==memcmp("bl", &aBuf[nBuf-2], 2) ){ memcpy(&aBuf[nBuf-2], "ble", 3); *pnBuf = nBuf - 2 + 3; ret = 1; } break; - - case 'i': + + case 'i': if( nBuf>2 && 0==memcmp("iz", &aBuf[nBuf-2], 2) ){ memcpy(&aBuf[nBuf-2], "ize", 3); *pnBuf = nBuf - 2 + 3; ret = 1; } break; - + } return ret; } - + static int fts5PorterStep2(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ - - case 'a': + + case 'a': if( nBuf>7 && 0==memcmp("ational", &aBuf[nBuf-7], 7) ){ if( fts5Porter_MGt0(aBuf, nBuf-7) ){ memcpy(&aBuf[nBuf-7], "ate", 3); @@ -875,8 +875,8 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - - case 'c': + + case 'c': if( nBuf>4 && 0==memcmp("enci", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ memcpy(&aBuf[nBuf-4], "ence", 4); @@ -889,8 +889,8 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - - case 'e': + + case 'e': if( nBuf>4 && 0==memcmp("izer", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ memcpy(&aBuf[nBuf-4], "ize", 3); @@ -898,8 +898,8 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - - case 'g': + + case 'g': if( nBuf>4 && 0==memcmp("logi", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ memcpy(&aBuf[nBuf-4], "log", 3); @@ -907,8 +907,8 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - - case 'l': + + case 'l': if( nBuf>3 && 0==memcmp("bli", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt0(aBuf, nBuf-3) ){ memcpy(&aBuf[nBuf-3], "ble", 3); @@ -936,8 +936,8 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - - case 'o': + + case 'o': if( nBuf>7 && 0==memcmp("ization", &aBuf[nBuf-7], 7) ){ if( fts5Porter_MGt0(aBuf, nBuf-7) ){ memcpy(&aBuf[nBuf-7], "ize", 3); @@ -955,8 +955,8 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - - case 's': + + case 's': if( nBuf>5 && 0==memcmp("alism", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "al", 2); @@ -979,8 +979,8 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - - case 't': + + case 't': if( nBuf>5 && 0==memcmp("aliti", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "al", 2); @@ -998,18 +998,18 @@ static int fts5PorterStep2(char *aBuf, int *pnBuf){ } } break; - + } return ret; } - + static int fts5PorterStep3(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ - - case 'a': + + case 'a': if( nBuf>4 && 0==memcmp("ical", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ memcpy(&aBuf[nBuf-4], "ic", 2); @@ -1017,16 +1017,16 @@ static int fts5PorterStep3(char *aBuf, int *pnBuf){ } } break; - - case 's': + + case 's': if( nBuf>4 && 0==memcmp("ness", &aBuf[nBuf-4], 4) ){ if( fts5Porter_MGt0(aBuf, nBuf-4) ){ *pnBuf = nBuf - 4; } } break; - - case 't': + + case 't': if( nBuf>5 && 0==memcmp("icate", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "ic", 2); @@ -1039,24 +1039,24 @@ static int fts5PorterStep3(char *aBuf, int *pnBuf){ } } break; - - case 'u': + + case 'u': if( nBuf>3 && 0==memcmp("ful", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt0(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; } } break; - - case 'v': + + case 'v': if( nBuf>5 && 0==memcmp("ative", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ *pnBuf = nBuf - 5; } } break; - - case 'z': + + case 'z': if( nBuf>5 && 0==memcmp("alize", &aBuf[nBuf-5], 5) ){ if( fts5Porter_MGt0(aBuf, nBuf-5) ){ memcpy(&aBuf[nBuf-5], "al", 2); @@ -1064,18 +1064,18 @@ static int fts5PorterStep3(char *aBuf, int *pnBuf){ } } break; - + } return ret; } - + static int fts5PorterStep1B(char *aBuf, int *pnBuf){ int ret = 0; int nBuf = *pnBuf; switch( aBuf[nBuf-2] ){ - - case 'e': + + case 'e': if( nBuf>3 && 0==memcmp("eed", &aBuf[nBuf-3], 3) ){ if( fts5Porter_MGt0(aBuf, nBuf-3) ){ memcpy(&aBuf[nBuf-3], "ee", 2); @@ -1088,8 +1088,8 @@ static int fts5PorterStep1B(char *aBuf, int *pnBuf){ } } break; - - case 'n': + + case 'n': if( nBuf>3 && 0==memcmp("ing", &aBuf[nBuf-3], 3) ){ if( fts5Porter_Vowel(aBuf, nBuf-3) ){ *pnBuf = nBuf - 3; @@ -1097,12 +1097,12 @@ static int fts5PorterStep1B(char *aBuf, int *pnBuf){ } } break; - + } return ret; } - -/* + +/* ** GENERATED CODE ENDS HERE (mkportersteps.tcl) *************************************************************************** **************************************************************************/ @@ -1111,7 +1111,7 @@ static void fts5PorterStep1A(char *aBuf, int *pnBuf){ int nBuf = *pnBuf; if( aBuf[nBuf-1]=='s' ){ if( aBuf[nBuf-2]=='e' ){ - if( (nBuf>4 && aBuf[nBuf-4]=='s' && aBuf[nBuf-3]=='s') + if( (nBuf>4 && aBuf[nBuf-4]=='s' && aBuf[nBuf-3]=='s') || (nBuf>3 && aBuf[nBuf-3]=='i' ) ){ *pnBuf = nBuf-2; @@ -1126,11 +1126,11 @@ static void fts5PorterStep1A(char *aBuf, int *pnBuf){ } static int fts5PorterCb( - void *pCtx, + void *pCtx, int tflags, - const char *pToken, - int nToken, - int iStart, + const char *pToken, + int nToken, + int iStart, int iEnd ){ PorterContext *p = (PorterContext*)pCtx; @@ -1148,8 +1148,8 @@ static int fts5PorterCb( if( fts5PorterStep1B(aBuf, &nBuf) ){ if( fts5PorterStep1B2(aBuf, &nBuf)==0 ){ char c = aBuf[nBuf-1]; - if( fts5PorterIsVowel(c, 0)==0 - && c!='l' && c!='s' && c!='z' && c==aBuf[nBuf-2] + if( fts5PorterIsVowel(c, 0)==0 + && c!='l' && c!='s' && c!='z' && c==aBuf[nBuf-2] ){ nBuf--; }else if( fts5Porter_MEq1(aBuf, nBuf) && fts5Porter_Ostar(aBuf, nBuf) ){ @@ -1171,7 +1171,7 @@ static int fts5PorterCb( /* Step 5a. */ assert( nBuf>0 ); if( aBuf[nBuf-1]=='e' ){ - if( fts5Porter_MGt1(aBuf, nBuf-1) + if( fts5Porter_MGt1(aBuf, nBuf-1) || (fts5Porter_MEq1(aBuf, nBuf-1) && !fts5Porter_Ostar(aBuf, nBuf-1)) ){ nBuf--; @@ -1179,8 +1179,8 @@ static int fts5PorterCb( } /* Step 5b. */ - if( nBuf>1 && aBuf[nBuf-1]=='l' - && aBuf[nBuf-2]=='l' && fts5Porter_MGt1(aBuf, nBuf-1) + if( nBuf>1 && aBuf[nBuf-1]=='l' + && aBuf[nBuf-2]=='l' && fts5Porter_MGt1(aBuf, nBuf-1) ){ nBuf--; } @@ -1223,7 +1223,7 @@ int sqlite3Fts5TokenizerInit(fts5_api *pApi){ { "ascii", {fts5AsciiCreate, fts5AsciiDelete, fts5AsciiTokenize }}, { "porter", {fts5PorterCreate, fts5PorterDelete, fts5PorterTokenize }}, }; - + int rc = SQLITE_OK; /* Return code */ int i; /* To iterate through builtin functions */ diff --git a/third_party/sqlite/src/ext/fts5/fts5_unicode2.c b/third_party/sqlite/src/ext/fts5/fts5_unicode2.c index 1ef56f61567cc..7dee8743b1b0c 100644 --- a/third_party/sqlite/src/ext/fts5/fts5_unicode2.c +++ b/third_party/sqlite/src/ext/fts5/fts5_unicode2.c @@ -30,11 +30,11 @@ int sqlite3Fts5UnicodeIsalnum(int c){ ** range of unicode codepoints that are not either letters or numbers (i.e. ** codepoints for which this function should return 0). ** - ** The most significant 22 bits in each 32-bit value contain the first + ** The most significant 22 bits in each 32-bit value contain the first ** codepoint in the range. The least significant 10 bits are used to store - ** the size of the range (always at least 1). In other words, the value - ** ((C<<22) + N) represents a range of N codepoints starting with codepoint - ** C. It is not possible to represent a range larger than 1023 codepoints + ** the size of the range (always at least 1). In other words, the value + ** ((C<<22) + N) represents a range of N codepoints starting with codepoint + ** C. It is not possible to represent a range larger than 1023 codepoints ** using this format. */ static const unsigned int aEntry[] = { @@ -159,30 +159,30 @@ int sqlite3Fts5UnicodeIsalnum(int c){ */ static int fts5_remove_diacritic(int c){ unsigned short aDia[] = { - 0, 1797, 1848, 1859, 1891, 1928, 1940, 1995, - 2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286, - 2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732, - 2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336, - 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928, - 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234, - 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504, - 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529, - 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726, - 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122, - 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536, - 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730, - 62924, 63050, 63082, 63274, 63390, + 0, 1797, 1848, 1859, 1891, 1928, 1940, 1995, + 2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286, + 2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732, + 2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336, + 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928, + 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234, + 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504, + 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529, + 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726, + 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122, + 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536, + 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730, + 62924, 63050, 63082, 63274, 63390, }; char aChar[] = { - '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c', - 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r', - 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o', - 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r', - 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0', - '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h', - 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't', - 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a', - 'e', 'i', 'o', 'u', 'y', + '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c', + 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r', + 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o', + 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r', + 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h', + 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't', + 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a', + 'e', 'i', 'o', 'u', 'y', }; unsigned int key = (((unsigned int)c)<<3) | 0x00000007; @@ -303,19 +303,19 @@ int sqlite3Fts5UnicodeFold(int c, int bRemoveDiacritic){ {42802, 1, 62}, {42873, 1, 4}, {42877, 76, 1}, {42878, 1, 10}, {42891, 0, 1}, {42893, 74, 1}, {42896, 1, 4}, {42912, 1, 10}, {42922, 72, 1}, - {65313, 14, 26}, + {65313, 14, 26}, }; static const unsigned short aiOff[] = { - 1, 2, 8, 15, 16, 26, 28, 32, - 37, 38, 40, 48, 63, 64, 69, 71, - 79, 80, 116, 202, 203, 205, 206, 207, - 209, 210, 211, 213, 214, 217, 218, 219, - 775, 7264, 10792, 10795, 23228, 23256, 30204, 54721, - 54753, 54754, 54756, 54787, 54793, 54809, 57153, 57274, - 57921, 58019, 58363, 61722, 65268, 65341, 65373, 65406, - 65408, 65410, 65415, 65424, 65436, 65439, 65450, 65462, - 65472, 65476, 65478, 65480, 65482, 65488, 65506, 65511, - 65514, 65521, 65527, 65528, 65529, + 1, 2, 8, 15, 16, 26, 28, 32, + 37, 38, 40, 48, 63, 64, 69, 71, + 79, 80, 116, 202, 203, 205, 206, 207, + 209, 210, 211, 213, 214, 217, 218, 219, + 775, 7264, 10792, 10795, 23228, 23256, 30204, 54721, + 54753, 54754, 54756, 54787, 54793, 54809, 57153, 57274, + 57921, 58019, 58363, 61722, 65268, 65341, 65373, 65406, + 65408, 65410, 65415, 65424, 65436, 65439, 65450, 65462, + 65472, 65476, 65478, 65480, 65482, 65488, 65506, 65511, + 65514, 65521, 65527, 65528, 65529, }; int ret = c; @@ -351,7 +351,7 @@ int sqlite3Fts5UnicodeFold(int c, int bRemoveDiacritic){ if( bRemoveDiacritic ) ret = fts5_remove_diacritic(ret); } - + else if( c>=66560 && c<66600 ){ ret = c + 40; } diff --git a/third_party/sqlite/src/ext/fts5/fts5_varint.c b/third_party/sqlite/src/ext/fts5/fts5_varint.c index bb212ab5a8a1e..91c5333933a43 100644 --- a/third_party/sqlite/src/ext/fts5/fts5_varint.c +++ b/third_party/sqlite/src/ext/fts5/fts5_varint.c @@ -304,7 +304,7 @@ static int FTS5_NOINLINE fts5PutVarint64(unsigned char *p, u64 v){ v >>= 7; } return 9; - } + } n = 0; do{ buf[n++] = (u8)((v & 0x7f) | 0x80); diff --git a/third_party/sqlite/src/ext/fts5/fts5_vocab.c b/third_party/sqlite/src/ext/fts5/fts5_vocab.c index 82c7dc90560b1..5d72c8065ad3c 100644 --- a/third_party/sqlite/src/ext/fts5/fts5_vocab.c +++ b/third_party/sqlite/src/ext/fts5/fts5_vocab.c @@ -11,7 +11,7 @@ ****************************************************************************** ** ** This is an SQLite virtual table module implementing direct access to an -** existing FTS5 index. The module may create several different types of +** existing FTS5 index. The module may create several different types of ** tables: ** ** col: @@ -19,15 +19,15 @@ ** ** One row for each term/column combination. The value of $doc is set to ** the number of fts5 rows that contain at least one instance of term -** $term within column $col. Field $cnt is set to the total number of -** instances of term $term in column $col (in any row of the fts5 table). +** $term within column $col. Field $cnt is set to the total number of +** instances of term $term in column $col (in any row of the fts5 table). ** ** row: ** CREATE TABLE vocab(term, doc, cnt, PRIMARY KEY(term)); ** ** One row for each term in the database. The value of $doc is set to ** the number of fts5 rows that contain at least one instance of term -** $term. Field $cnt is set to the total number of instances of term +** $term. Field $cnt is set to the total number of instances of term ** $term in the database. */ @@ -84,7 +84,7 @@ struct Fts5VocabCursor { /* -** Translate a string containing an fts5vocab table type to an +** Translate a string containing an fts5vocab table type to an ** FTS5_VOCAB_XXX constant. If successful, set *peType to the output ** value and return SQLITE_OK. Otherwise, set *pzErr to an error message ** and return SQLITE_ERROR. @@ -159,8 +159,8 @@ static int fts5VocabInitVtab( sqlite3_vtab **ppVTab, /* Write the resulting vtab structure here */ char **pzErr /* Write any error message here */ ){ - const char *azSchema[] = { - "CREATE TABlE vocab(" FTS5_VOCAB_COL_SCHEMA ")", + const char *azSchema[] = { + "CREATE TABlE vocab(" FTS5_VOCAB_COL_SCHEMA ")", "CREATE TABlE vocab(" FTS5_VOCAB_ROW_SCHEMA ")" }; @@ -178,10 +178,10 @@ static int fts5VocabInitVtab( const char *zDb = bDb ? argv[3] : argv[1]; const char *zTab = bDb ? argv[4] : argv[3]; const char *zType = bDb ? argv[5] : argv[4]; - int nDb = (int)strlen(zDb)+1; + int nDb = (int)strlen(zDb)+1; int nTab = (int)strlen(zTab)+1; int eType = 0; - + rc = fts5VocabTableType(zType, pzErr, &eType); if( rc==SQLITE_OK ){ assert( eType>=0 && eTypenOrderBy==1 - && pInfo->aOrderBy[0].iColumn==0 + if( pInfo->nOrderBy==1 + && pInfo->aOrderBy[0].iColumn==0 && pInfo->aOrderBy[0].desc==0 ){ pInfo->orderByConsumed = 1; @@ -299,7 +299,7 @@ static int fts5VocabBestIndexMethod( ** Implementation of xOpen method. */ static int fts5VocabOpenMethod( - sqlite3_vtab *pVTab, + sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCsr ){ Fts5VocabTable *pTab = (Fts5VocabTable*)pVTab; @@ -467,7 +467,7 @@ static int fts5VocabNextMethod(sqlite3_vtab_cursor *pCursor){ } break; - default: + default: assert( pCsr->pConfig->eDetail==FTS5_DETAIL_NONE ); pCsr->aDoc[0]++; break; @@ -556,8 +556,8 @@ static int fts5VocabFilterMethod( return rc; } -/* -** This is the xEof method of the virtual table. SQLite calls this +/* +** This is the xEof method of the virtual table. SQLite calls this ** routine to find out if it has reached the end of a result set. */ static int fts5VocabEofMethod(sqlite3_vtab_cursor *pCursor){ @@ -604,13 +604,13 @@ static int fts5VocabColumnMethod( return SQLITE_OK; } -/* +/* ** This is the xRowid method. The SQLite core calls this routine to ** retrieve the rowid for the current row of the result set. The ** rowid should be written to *pRowid. */ static int fts5VocabRowidMethod( - sqlite3_vtab_cursor *pCursor, + sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid ){ Fts5VocabCursor *pCsr = (Fts5VocabCursor*)pCursor; diff --git a/third_party/sqlite/src/ext/fts5/fts5parse.y b/third_party/sqlite/src/ext/fts5/fts5parse.y index 1cc4b88e18de6..80087e2ad7244 100644 --- a/third_party/sqlite/src/ext/fts5/fts5parse.y +++ b/third_party/sqlite/src/ext/fts5/fts5parse.y @@ -107,12 +107,12 @@ exprlist(A) ::= exprlist(X) cnearset(Y). { A = sqlite3Fts5ParseImplicitAnd(pParse, X, Y); } -cnearset(A) ::= nearset(X). { - A = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, X); +cnearset(A) ::= nearset(X). { + A = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, X); } -cnearset(A) ::= colset(X) COLON nearset(Y). { +cnearset(A) ::= colset(X) COLON nearset(Y). { sqlite3Fts5ParseSetColset(pParse, Y, X); - A = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, Y); + A = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, Y); } %type colset {Fts5Colset*} @@ -120,7 +120,7 @@ cnearset(A) ::= colset(X) COLON nearset(Y). { %type colsetlist {Fts5Colset*} %destructor colsetlist { sqlite3_free($$); } -colset(A) ::= MINUS LCP colsetlist(X) RCP. { +colset(A) ::= MINUS LCP colsetlist(X) RCP. { A = sqlite3Fts5ParseColsetInvert(pParse, X); } colset(A) ::= LCP colsetlist(X) RCP. { A = X; } @@ -132,10 +132,10 @@ colset(A) ::= MINUS STRING(X). { A = sqlite3Fts5ParseColsetInvert(pParse, A); } -colsetlist(A) ::= colsetlist(Y) STRING(X). { +colsetlist(A) ::= colsetlist(Y) STRING(X). { A = sqlite3Fts5ParseColset(pParse, Y, &X); } -colsetlist(A) ::= STRING(X). { - A = sqlite3Fts5ParseColset(pParse, 0, &X); +colsetlist(A) ::= STRING(X). { + A = sqlite3Fts5ParseColset(pParse, 0, &X); } %type nearset {Fts5ExprNearset*} @@ -150,8 +150,8 @@ nearset(A) ::= STRING(X) LP nearphrases(Y) neardist_opt(Z) RP. { A = Y; } -nearphrases(A) ::= phrase(X). { - A = sqlite3Fts5ParseNearset(pParse, 0, X); +nearphrases(A) ::= phrase(X). { + A = sqlite3Fts5ParseNearset(pParse, 0, X); } nearphrases(A) ::= nearphrases(X) phrase(Y). { A = sqlite3Fts5ParseNearset(pParse, X, Y); @@ -173,10 +173,10 @@ neardist_opt(A) ::= COMMA STRING(X). { A = X; } %type phrase {Fts5ExprPhrase*} %destructor phrase { sqlite3Fts5ParsePhraseFree($$); } -phrase(A) ::= phrase(X) PLUS STRING(Y) star_opt(Z). { +phrase(A) ::= phrase(X) PLUS STRING(Y) star_opt(Z). { A = sqlite3Fts5ParseTerm(pParse, X, &Y, Z); } -phrase(A) ::= STRING(Y) star_opt(Z). { +phrase(A) ::= STRING(Y) star_opt(Z). { A = sqlite3Fts5ParseTerm(pParse, 0, &Y, Z); } diff --git a/third_party/sqlite/src/ext/fts5/mkportersteps.tcl b/third_party/sqlite/src/ext/fts5/mkportersteps.tcl index b6214c6bf73f8..7a6a8d3636301 100644 --- a/third_party/sqlite/src/ext/fts5/mkportersteps.tcl +++ b/third_party/sqlite/src/ext/fts5/mkportersteps.tcl @@ -33,59 +33,59 @@ set O(Step1B) { } set O(Step2) { - { "ational" fts5Porter_MGt0 "ate" } - { "tional" fts5Porter_MGt0 "tion" } - { "enci" fts5Porter_MGt0 "ence" } - { "anci" fts5Porter_MGt0 "ance" } - { "izer" fts5Porter_MGt0 "ize" } + { "ational" fts5Porter_MGt0 "ate" } + { "tional" fts5Porter_MGt0 "tion" } + { "enci" fts5Porter_MGt0 "ence" } + { "anci" fts5Porter_MGt0 "ance" } + { "izer" fts5Porter_MGt0 "ize" } { "logi" fts5Porter_MGt0 "log" } { "bli" fts5Porter_MGt0 "ble" } - { "alli" fts5Porter_MGt0 "al" } - { "entli" fts5Porter_MGt0 "ent" } - { "eli" fts5Porter_MGt0 "e" } - { "ousli" fts5Porter_MGt0 "ous" } - { "ization" fts5Porter_MGt0 "ize" } - { "ation" fts5Porter_MGt0 "ate" } - { "ator" fts5Porter_MGt0 "ate" } - { "alism" fts5Porter_MGt0 "al" } - { "iveness" fts5Porter_MGt0 "ive" } - { "fulness" fts5Porter_MGt0 "ful" } - { "ousness" fts5Porter_MGt0 "ous" } - { "aliti" fts5Porter_MGt0 "al" } - { "iviti" fts5Porter_MGt0 "ive" } - { "biliti" fts5Porter_MGt0 "ble" } + { "alli" fts5Porter_MGt0 "al" } + { "entli" fts5Porter_MGt0 "ent" } + { "eli" fts5Porter_MGt0 "e" } + { "ousli" fts5Porter_MGt0 "ous" } + { "ization" fts5Porter_MGt0 "ize" } + { "ation" fts5Porter_MGt0 "ate" } + { "ator" fts5Porter_MGt0 "ate" } + { "alism" fts5Porter_MGt0 "al" } + { "iveness" fts5Porter_MGt0 "ive" } + { "fulness" fts5Porter_MGt0 "ful" } + { "ousness" fts5Porter_MGt0 "ous" } + { "aliti" fts5Porter_MGt0 "al" } + { "iviti" fts5Porter_MGt0 "ive" } + { "biliti" fts5Porter_MGt0 "ble" } } set O(Step3) { - { "icate" fts5Porter_MGt0 "ic" } - { "ative" fts5Porter_MGt0 "" } - { "alize" fts5Porter_MGt0 "al" } - { "iciti" fts5Porter_MGt0 "ic" } - { "ical" fts5Porter_MGt0 "ic" } - { "ful" fts5Porter_MGt0 "" } - { "ness" fts5Porter_MGt0 "" } + { "icate" fts5Porter_MGt0 "ic" } + { "ative" fts5Porter_MGt0 "" } + { "alize" fts5Porter_MGt0 "al" } + { "iciti" fts5Porter_MGt0 "ic" } + { "ical" fts5Porter_MGt0 "ic" } + { "ful" fts5Porter_MGt0 "" } + { "ness" fts5Porter_MGt0 "" } } set O(Step4) { - { "al" fts5Porter_MGt1 "" } - { "ance" fts5Porter_MGt1 "" } - { "ence" fts5Porter_MGt1 "" } - { "er" fts5Porter_MGt1 "" } - { "ic" fts5Porter_MGt1 "" } - { "able" fts5Porter_MGt1 "" } - { "ible" fts5Porter_MGt1 "" } - { "ant" fts5Porter_MGt1 "" } - { "ement" fts5Porter_MGt1 "" } - { "ment" fts5Porter_MGt1 "" } - { "ent" fts5Porter_MGt1 "" } - { "ion" fts5Porter_MGt1_and_S_or_T "" } - { "ou" fts5Porter_MGt1 "" } - { "ism" fts5Porter_MGt1 "" } - { "ate" fts5Porter_MGt1 "" } - { "iti" fts5Porter_MGt1 "" } - { "ous" fts5Porter_MGt1 "" } - { "ive" fts5Porter_MGt1 "" } - { "ize" fts5Porter_MGt1 "" } + { "al" fts5Porter_MGt1 "" } + { "ance" fts5Porter_MGt1 "" } + { "ence" fts5Porter_MGt1 "" } + { "er" fts5Porter_MGt1 "" } + { "ic" fts5Porter_MGt1 "" } + { "able" fts5Porter_MGt1 "" } + { "ible" fts5Porter_MGt1 "" } + { "ant" fts5Porter_MGt1 "" } + { "ement" fts5Porter_MGt1 "" } + { "ment" fts5Porter_MGt1 "" } + { "ent" fts5Porter_MGt1 "" } + { "ion" fts5Porter_MGt1_and_S_or_T "" } + { "ou" fts5Porter_MGt1 "" } + { "ism" fts5Porter_MGt1 "" } + { "ate" fts5Porter_MGt1 "" } + { "iti" fts5Porter_MGt1 "" } + { "ous" fts5Porter_MGt1 "" } + { "ive" fts5Porter_MGt1 "" } + { "ize" fts5Porter_MGt1 "" } } proc sort_cb {lhs rhs} { @@ -108,7 +108,7 @@ static int fts5Porter${name}(char *aBuf, int *pnBuf){ } set T(case) { - case '${k}': + case '${k}': ${ifstmts} break; } @@ -174,7 +174,7 @@ static int fts5Porter${name}(char *aBuf, int *pnBuf){ set ifstmts "" foreach I $aCase($k) { set zSuffix [lindex $I 0] ;# Suffix text for this rule - set zRep [lindex $I 2] ;# Replacement text for rule + set zRep [lindex $I 2] ;# Replacement text for rule set xCond [lindex $I 1] ;# Condition callback (or "") set n [string length $zSuffix] @@ -212,7 +212,7 @@ foreach step [array names O] { create_step_function $step $O($step) } puts [string trim { -/* +/* ** GENERATED CODE ENDS HERE (mkportersteps.tcl) *************************************************************************** **************************************************************************/ diff --git a/third_party/sqlite/src/ext/fts5/test/fts5_common.tcl b/third_party/sqlite/src/ext/fts5/test/fts5_common.tcl index 0f371dcfd9d90..43c12e06ae8fa 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5_common.tcl +++ b/third_party/sqlite/src/ext/fts5/test/fts5_common.tcl @@ -25,8 +25,8 @@ ifcapable !fts5 { proc return_if_no_fts5 {} {} } -catch { - sqlite3_fts5_may_be_corrupt 0 +catch { + sqlite3_fts5_may_be_corrupt 0 reset_db } @@ -105,7 +105,7 @@ proc fts5_test_rowcount {cmd} { } proc test_queryphrase_cb {cnt cmd} { - upvar $cnt L + upvar $cnt L for {set i 0} {$i < [$cmd xInstCount]} {incr i} { foreach {ip ic io} [$cmd xInst $i] break set A($ic) 1 @@ -172,7 +172,7 @@ proc fts5_level_segs {tbl} { lappend ret [expr [llength $L] - 3] } set ret -} +} proc fts5_level_segids {tbl} { set sql "SELECT fts5_decode(rowid,block) aS r FROM ${tbl}_data WHERE rowid=10" @@ -251,7 +251,7 @@ proc nearset {aCol args} { if {$O(-dict)!=""} { upvar $O(-dict) aDict } for {set j 0} {$j < [llength $aCol]} {incr j} { - for {set i 0} {$i < $nPhrase} {incr i} { + for {set i 0} {$i < $nPhrase} {incr i} { set A($j,$i) [list] } } @@ -266,13 +266,13 @@ proc nearset {aCol args} { set zCol [lindex $aCol $iCol] set nToken [llength $zCol] - # Each iteration of the following loop searches a substring of the + # Each iteration of the following loop searches a substring of the # column value for phrase matches. The last token of the substring # is token $iLast of the column value. The first token is: # # iFirst = ($iLast - $O(-near) - 1) # - # where $sz is the length of the phrase being searched for. A phrase + # where $sz is the length of the phrase being searched for. A phrase # counts as matching the substring if its first token lies on or before # $iLast and its last token on or after $iFirst. # @@ -288,7 +288,7 @@ proc nearset {aCol args} { for { } {$iLast < $nToken} {incr iLast} { catch { array unset B } - + for {set iPhrase 0} {$iPhrase<$nPhrase} {incr iPhrase} { set p [lindex $lPhrase $iPhrase] set nPm1 [expr {[llength $p] - 1}] @@ -440,7 +440,7 @@ proc detail_is_full {} { detail_check ; expr {$::detail == "full"} } #------------------------------------------------------------------------- -# Convert a poslist of the type returned by fts5_test_poslist() to a +# Convert a poslist of the type returned by fts5_test_poslist() to a # collist as returned by fts5_test_collist(). # proc fts5_poslist2collist {poslist} { @@ -467,10 +467,10 @@ proc fts5_collist_elem_compare {a b} { # Construct and return a tcl list equivalent to that returned by the SQL # query executed against database handle [db]: # -# SELECT -# rowid, +# SELECT +# rowid, # fts5_test_poslist($tbl), -# fts5_test_collist($tbl) +# fts5_test_collist($tbl) # FROM $tbl('$expr') # ORDER BY rowid $order; # @@ -497,10 +497,10 @@ proc fts5_query_data {expr tbl {order ASC} {aDictVar ""}} { db eval "SELECT rowid, * FROM $tbl ORDER BY rowid $order" x { set cols [list] foreach col $lCols { lappend cols $x($col) } - + set ::pc 0 set rowdata [eval $tclexpr] - if {$rowdata != ""} { + if {$rowdata != ""} { lappend res $x(rowid) $rowdata [fts5_poslist2collist $rowdata] } } @@ -588,7 +588,7 @@ proc nearset_rf {aCol args} { # Helper for [fts5_expr_ok] proc nearset_rc {aCol args} { nearset_rf $aCol {*}$args - if {[lsearch $args -col]>=0} { + if {[lsearch $args -col]>=0} { set ::expr_not_ok 1 } list diff --git a/third_party/sqlite/src/ext/fts5/test/fts5aa.test b/third_party/sqlite/src/ext/fts5/test/fts5aa.test index 428ca6c1eabf4..a35ad40e7dbd1 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5aa.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5aa.test @@ -154,7 +154,7 @@ do_execsql_test 6.1 { } do_execsql_test 6.2 { - INSERT INTO t1(t1) VALUES('integrity-check') + INSERT INTO t1(t1) VALUES('integrity-check') } do_execsql_test 6.3 { @@ -166,7 +166,7 @@ do_execsql_test 6.4 { } do_execsql_test 6.5 { - INSERT INTO t1(t1) VALUES('integrity-check') + INSERT INTO t1(t1) VALUES('integrity-check') } do_execsql_test 6.6 { @@ -368,7 +368,7 @@ do_execsql_test 14.1 { INSERT INTO t1(t1, rank) VALUES('pgsz', 32); WITH d(x,y) AS ( SELECT NULL, 'xyz xyz xyz xyz xyz xyz' - UNION ALL + UNION ALL SELECT NULL, 'xyz xyz xyz xyz xyz xyz' FROM d ) INSERT INTO t1 SELECT * FROM d LIMIT 200; @@ -435,7 +435,7 @@ db func funk funk # This test case corrupts the structure record within the first invocation # of function funk(). Which used to cause the bm25() function to throw an # exception. But since bm25() can now used the cached structure record, -# it never sees the corruption introduced by funk() and so the following +# it never sees the corruption introduced by funk() and so the following # statement no longer fails. # do_catchsql_test 16.2 { diff --git a/third_party/sqlite/src/ext/fts5/test/fts5ab.test b/third_party/sqlite/src/ext/fts5/test/fts5ab.test index 95da2cd2eb781..ad028667678d7 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5ab.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5ab.test @@ -92,10 +92,10 @@ foreach {tn expr res} { 9 y {6} 10 z {6} } { - do_execsql_test 2.7.$tn.1 { + do_execsql_test 2.7.$tn.1 { SELECT rowid FROM t1 WHERE t1 MATCH $expr ORDER BY rowid DESC } $res - do_execsql_test 2.7.$tn.2 { + do_execsql_test 2.7.$tn.2 { SELECT rowid FROM t1 WHERE t1 MATCH $expr ORDER BY rowid ASC } [lsort -integer $res] } @@ -120,7 +120,7 @@ foreach {tn a b} { 9 {abash abase abate abashing abashed} {abandon abandoned} 10 {abate abandoning abandons abasement aback} {abandon abandoning} } { - do_execsql_test 3.1.$tn.1 { INSERT INTO t1 VALUES($a, $b) } + do_execsql_test 3.1.$tn.1 { INSERT INTO t1 VALUES($a, $b) } do_execsql_test 3.1.$tn.2 { INSERT INTO t1(t1) VALUES('integrity-check') } } diff --git a/third_party/sqlite/src/ext/fts5/test/fts5ac.test b/third_party/sqlite/src/ext/fts5/test/fts5ac.test index 61b3230772618..74f221fe3eb5e 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5ac.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5ac.test @@ -246,13 +246,13 @@ foreach {tn2 sql} { set res [fts5_query_data $expr xx] do_execsql_test 1.$tn2.$tn.[llength $res].asc { - SELECT rowid, fts5_test_poslist(xx), fts5_test_collist(xx) + SELECT rowid, fts5_test_poslist(xx), fts5_test_collist(xx) FROM xx WHERE xx match $expr } $res set res [fts5_query_data $expr xx DESC] do_execsql_test 1.$tn2.$tn.[llength $res].desc { - SELECT rowid, fts5_test_poslist(xx), fts5_test_collist(xx) + SELECT rowid, fts5_test_poslist(xx), fts5_test_collist(xx) FROM xx WHERE xx match $expr ORDER BY 1 DESC } $res } diff --git a/third_party/sqlite/src/ext/fts5/test/fts5ad.test b/third_party/sqlite/src/ext/fts5/test/fts5ad.test index 974aa781aa6a2..16999cb92a483 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5ad.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5ad.test @@ -60,7 +60,7 @@ foreach {T create} { CREATE VIRTUAL TABLE t1 USING fts5(a, b, detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } - + 3 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, prefix="1,2,3,4", detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); @@ -71,7 +71,7 @@ foreach {T create} { INSERT INTO t1(t1, rank) VALUES('pgsz', 32); BEGIN; } - + 5 { CREATE VIRTUAL TABLE t1 USING fts5(a, b, prefix="1,2,3,4", detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); @@ -80,11 +80,11 @@ foreach {T create} { } { - do_test $T.1 { + do_test $T.1 { execsql { DROP TABLE IF EXISTS t1 } execsql $create } {} - + do_test $T.1 { foreach {rowid a b} { 0 {fghij uvwxyz klmn pq uvwx} {klmn f fgh uv fghij klmno} @@ -193,7 +193,7 @@ foreach {T create} { } } } {} - + proc prefix_query {prefixlist} { set ret [list] db eval {SELECT rowid, a, b FROM t1 ORDER BY rowid DESC} { @@ -212,13 +212,13 @@ foreach {T create} { do_execsql_test $T.integrity { INSERT INTO t1(t1) VALUES('integrity-check'); } - + foreach {bAsc sql} { 1 {SELECT rowid FROM t1 WHERE t1 MATCH $prefix} 0 {SELECT rowid FROM t1 WHERE t1 MATCH $prefix ORDER BY rowid DESC} } { foreach {tn prefix} { - 1 {a*} 2 {ab*} 3 {abc*} 4 {abcd*} 5 {abcde*} + 1 {a*} 2 {ab*} 3 {abc*} 4 {abcd*} 5 {abcde*} 6 {f*} 7 {fg*} 8 {fgh*} 9 {fghi*} 10 {fghij*} 11 {k*} 12 {kl*} 13 {klm*} 14 {klmn*} 15 {klmno*} 16 {p*} 17 {pq*} 18 {pqr*} 19 {pqrs*} 20 {pqrst*} @@ -231,7 +231,7 @@ foreach {T create} { set res [lsort -integer -increasing $res] } set n [llength $res] - if {$T==5} breakpoint + if {$T==5} breakpoint do_execsql_test $T.$bAsc.$tn.$n $sql $res } } diff --git a/third_party/sqlite/src/ext/fts5/test/fts5ae.test b/third_party/sqlite/src/ext/fts5/test/fts5ae.test index 5153306d19fca..86bfeb46a80ea 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5ae.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5ae.test @@ -55,7 +55,7 @@ do_execsql_test 1.4.2 { fts5_aux_test_functions db #------------------------------------------------------------------------- -# +# do_execsql_test 2.0 { CREATE VIRTUAL TABLE t2 USING fts5(x, y, detail=%DETAIL%); INSERT INTO t2 VALUES('u t l w w m s', 'm f m o l t k o p e'); @@ -63,15 +63,15 @@ do_execsql_test 2.0 { } do_execsql_test 2.1 { - SELECT rowid, fts5_test_poslist(t2) FROM t2 + SELECT rowid, fts5_test_poslist(t2) FROM t2 WHERE t2 MATCH 'm' ORDER BY rowid; } { - 1 {0.0.5 0.1.0 0.1.2} + 1 {0.0.5 0.1.0 0.1.2} 2 {0.0.7 0.1.5} } do_execsql_test 2.2 { - SELECT rowid, fts5_test_poslist(t2) FROM t2 + SELECT rowid, fts5_test_poslist(t2) FROM t2 WHERE t2 MATCH 'u OR q' ORDER BY rowid; } { 1 {0.0.0} @@ -80,7 +80,7 @@ do_execsql_test 2.2 { if {[detail_is_full]} { do_execsql_test 2.3 { - SELECT rowid, fts5_test_poslist(t2) FROM t2 + SELECT rowid, fts5_test_poslist(t2) FROM t2 WHERE t2 MATCH 'y:o' ORDER BY rowid; } { 1 {0.1.3 0.1.7} @@ -88,7 +88,7 @@ if {[detail_is_full]} { } #------------------------------------------------------------------------- -# +# do_execsql_test 3.0 { CREATE VIRTUAL TABLE t3 USING fts5(x, y, detail=%DETAIL%); INSERT INTO t3 VALUES( 'j f h o x x a z g b a f a m i b', 'j z c z y x w t'); @@ -110,20 +110,20 @@ if {[detail_is_full]} { } do_execsql_test 3.3 { - INSERT INTO t3 + INSERT INTO t3 VALUES('k x j r m a d o i z j', 'r t t t f e b r x i v j v g o'); - SELECT rowid, fts5_test_poslist(t3) + SELECT rowid, fts5_test_poslist(t3) FROM t3 WHERE t3 MATCH 'a OR b AND c'; } { 1 {0.0.6 1.0.9 0.0.10 0.0.12 1.0.15 2.1.2} - 3 0.0.5 + 3 0.0.5 } #------------------------------------------------------------------------- -# +# do_execsql_test 4.0 { CREATE VIRTUAL TABLE t4 USING fts5(x, y, detail=%DETAIL%); - INSERT INTO t4 + INSERT INTO t4 VALUES('k x j r m a d o i z j', 'r t t t f e b r x i v j v g o'); } @@ -229,7 +229,7 @@ foreach {tn q res} { 5 {a AND b} {{4 2} {3 4}} 6 {a OR b OR c OR d} {{4 2} {3 4} {2 1} {2 2}} } { - do_execsql_test 7.3.$tn { + do_execsql_test 7.3.$tn { SELECT fts5_test_queryphrase(t7) FROM t7 WHERE t7 MATCH $q LIMIT 1 } [list $res] } diff --git a/third_party/sqlite/src/ext/fts5/test/fts5af.test b/third_party/sqlite/src/ext/fts5/test/fts5af.test index 6aab55a55790c..2499640c7b1f7 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5af.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5af.test @@ -10,8 +10,8 @@ #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. -# -# More specifically, the tests in this file focus on the built-in +# +# More specifically, the tests in this file focus on the built-in # snippet() function. # @@ -118,9 +118,9 @@ foreach {tn doc res} { 8.1 {o o o o o o o o o X o o o o o o o o o o o o o o o o X X X o o o} {...o o [X] [X] [X] o o...} - 8.2 {o o o o o o o. o o X o o o o o o o o o o o o o o o o X X X o o o} + 8.2 {o o o o o o o. o o X o o o o o o o o o o o o o o o o X X X o o o} {...o o [X] o o o o...} - 8.3 {o o o o X o o o o o o o o o o o o o o o o o o o o o X X X o o o} + 8.3 {o o o o X o o o o o o o o o o o o o o o o o o o o o X X X o o o} {o o o o [X] o o...} } { do_snippet_test 1.$tn $doc X $res @@ -175,7 +175,7 @@ do_execsql_test 5.1 { SELECT snippet(p1, 0, '[', ']', '...', 6) FROM p1('x'); } {{[x] a a a a a...}} -} ;# foreach_detail_mode +} ;# foreach_detail_mode finish_test diff --git a/third_party/sqlite/src/ext/fts5/test/fts5ag.test b/third_party/sqlite/src/ext/fts5/test/fts5ag.test index de126a25f02f7..1f100d034ac5e 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5ag.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5ag.test @@ -22,7 +22,7 @@ ifcapable !fts5 { } #------------------------------------------------------------------------- -# This file attempts to verify that the extension APIs work with +# This file attempts to verify that the extension APIs work with # "ORDER BY rank" queries. This is done by comparing the results of # the fts5_test() function when run with queries of the form: # diff --git a/third_party/sqlite/src/ext/fts5/test/fts5ah.test b/third_party/sqlite/src/ext/fts5/test/fts5ah.test index b7beb5655b21e..9ff29d502da18 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5ah.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5ah.test @@ -85,7 +85,7 @@ do_test 1.4 { do_test 1.5 { set fwd [execsql_reads {SELECT rowid FROM t1 WHERE t1 MATCH 'x' }] set bwd [execsql_reads { - SELECT rowid FROM t1 WHERE t1 MATCH 'x' ORDER BY 1 ASC + SELECT rowid FROM t1 WHERE t1 MATCH 'x' ORDER BY 1 ASC }] expr {$bwd < $fwd + 12} } {1} @@ -138,8 +138,8 @@ foreach {tn fraction tail cnt} { set n [execsql_reads $q] set ret [llength [execsql $q]] - # Because the position lists for 'x' are quite long in this db, the - # advantage is a bit smaller in detail=none mode. Update $fraction to + # Because the position lists for 'x' are quite long in this db, the + # advantage is a bit smaller in detail=none mode. Update $fraction to # reflect this. if {[detail_is_none] && $fraction<0.5} { set fraction [expr $fraction*2] } diff --git a/third_party/sqlite/src/ext/fts5/test/fts5aj.test b/third_party/sqlite/src/ext/fts5/test/fts5aj.test index 6b9dddd8b06fd..8ec7854db35d9 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5aj.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5aj.test @@ -11,8 +11,8 @@ # This file implements regression tests for SQLite library. The # focus of this script is testing the FTS5 module. # -# Specifically, this tests that, provided the amount of data remains -# constant, the FTS index does not grow indefinitely as rows are inserted +# Specifically, this tests that, provided the amount of data remains +# constant, the FTS index does not grow indefinitely as rows are inserted # and deleted, # @@ -57,7 +57,7 @@ for {set iTest 0} {$iTest < 50000} {incr iTest} { set sz [db one {SELECT count(*) FROM t1_data}] set s [structure] do_execsql_test 1.$iTest.$sz.{$s} { - INSERT INTO t1(t1) VALUES('integrity-check') + INSERT INTO t1(t1) VALUES('integrity-check') } } } diff --git a/third_party/sqlite/src/ext/fts5/test/fts5ak.test b/third_party/sqlite/src/ext/fts5/test/fts5ak.test index 0f699a601f13f..c378d639e26d6 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5ak.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5ak.test @@ -86,7 +86,7 @@ do_execsql_test 2.1 { SELECT highlight(ft1, 0, '[', ']') FROM ft1 WHERE ft1 MATCH 'h + d'; } { {[h d] b j c c g a c a} - {j f [h d] g h i b d f} + {j f [h d] g h i b d f} } do_execsql_test 2.2 { diff --git a/third_party/sqlite/src/ext/fts5/test/fts5al.test b/third_party/sqlite/src/ext/fts5/test/fts5al.test index c0dd2117dddc7..e0bf0aab21d89 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5al.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5al.test @@ -121,7 +121,7 @@ do_execsql_test 3.4.1 { SELECT insttest(t1) FROM t1 WHERE t1 MATCH 'q' } { {{0 0 0}} - {{0 0 5}} + {{0 0 5}} } if {[detail_is_full]} { @@ -129,7 +129,7 @@ if {[detail_is_full]} { SELECT insttest(t1) FROM t1 WHERE t1 MATCH 'r+e OR w' } { {{1 0 1}} - {{0 0 2} {1 0 4}} + {{0 0 2} {1 0 4}} } } @@ -142,7 +142,7 @@ do_execsql_test 3.5.1 { SELECT coltest(t1) FROM t1 WHERE t1 MATCH 'q' } { {6 {q w e r t y}} - {6 {y t r e w q}} + {6 {y t r e w q}} } #------------------------------------------------------------------------- @@ -166,7 +166,7 @@ do_execsql_test 4.0 { INSERT INTO t2 VALUES('o q g g q c o k a b', 'r t k p t f t h p c'); } -proc firstinst {cmd} { +proc firstinst {cmd} { foreach {p c o} [$cmd xInst 0] {} expr $c*100 + $o } @@ -180,8 +180,8 @@ do_execsql_test 4.1.1 { } do_execsql_test 4.1.2 { - SELECT rowid, rank FROM t2 - WHERE t2 MATCH 'a' AND rank MATCH 'firstinst()' + SELECT rowid, rank FROM t2 + WHERE t2 MATCH 'a' AND rank MATCH 'firstinst()' ORDER BY rowid ASC } { 1 0 2 4 3 6 5 103 @@ -189,11 +189,11 @@ do_execsql_test 4.1.2 { } do_execsql_test 4.1.3 { - SELECT rowid, rank FROM t2 + SELECT rowid, rank FROM t2 WHERE t2 MATCH 'a' AND rank MATCH 'firstinst()' ORDER BY rank DESC } { - 5 103 9 102 6 9 10 8 3 6 2 4 1 0 7 0 + 5 103 9 102 6 9 10 8 3 6 2 4 1 0 7 0 } do_execsql_test 4.1.4 { @@ -207,17 +207,17 @@ do_execsql_test 4.1.4 { do_execsql_test 4.1.5 { SELECT rowid, rank FROM t2 WHERE t2 MATCH 'a' ORDER BY rank DESC } { - 5 103 9 102 6 9 10 8 3 6 2 4 1 0 7 0 + 5 103 9 102 6 9 10 8 3 6 2 4 1 0 7 0 } do_execsql_test 4.1.6 { INSERT INTO t2(t2, rank) VALUES('rank', 'firstinst ( ) '); SELECT rowid, rank FROM t2 WHERE t2 MATCH 'a' ORDER BY rank DESC } { - 5 103 9 102 6 9 10 8 3 6 2 4 1 0 7 0 + 5 103 9 102 6 9 10 8 3 6 2 4 1 0 7 0 } -proc rowidplus {cmd ival} { +proc rowidplus {cmd ival} { expr [$cmd xRowid] + $ival } sqlite3_fts5_create_function db rowidplus rowidplus @@ -237,14 +237,14 @@ if {[detail_is_full]} { } do_execsql_test 4.2.3 { - SELECT rowid, rank FROM t2 + SELECT rowid, rank FROM t2 WHERE t2 MATCH 'o + q + g' AND rank MATCH 'rowidplus(112)' } { 10 122 } } -proc rowidmod {cmd imod} { +proc rowidmod {cmd imod} { expr [$cmd xRowid] % $imod } sqlite3_fts5_create_function db rowidmod rowidmod @@ -260,7 +260,7 @@ do_execsql_test 4.3.1 { do_execsql_test 4.3.2 { SELECT * FROM t3 - WHERE t3 MATCH 'a' AND rank MATCH 'rowidmod(4)' + WHERE t3 MATCH 'a' AND rank MATCH 'rowidmod(4)' ORDER BY rank ASC } { {a four} {a one} {a five} {a two} {a three} @@ -268,10 +268,10 @@ do_execsql_test 4.3.2 { do_execsql_test 4.3.3 { SELECT *, rank FROM t3 - WHERE t3 MATCH 'a' AND rank MATCH 'rowidmod(3)' + WHERE t3 MATCH 'a' AND rank MATCH 'rowidmod(3)' ORDER BY rank ASC } { - {a three} 0 {a one} 1 {a four} 1 {a two} 2 {a five} 2 + {a three} 0 {a one} 1 {a four} 1 {a two} 2 {a five} 2 } do_execsql_test 4.3.4 { @@ -283,11 +283,11 @@ do_execsql_test 4.3.4 { do_execsql_test 4.3.5 { SELECT *, rank FROM t3('a', 'rowidmod(3)') ORDER BY rank ASC } { - {a three} 0 {a one} 1 {a four} 1 {a two} 2 {a five} 2 + {a three} 0 {a one} 1 {a four} 1 {a two} 2 {a five} 2 } do_catchsql_test 4.4.3 { - SELECT *, rank FROM t3 WHERE t3 MATCH 'a' AND rank MATCH 'xyz(3)' + SELECT *, rank FROM t3 WHERE t3 MATCH 'a' AND rank MATCH 'xyz(3)' } {1 {no such function: xyz}} do_catchsql_test 4.4.4 { SELECT *, rank FROM t3 WHERE t3 MATCH 'a' AND rank MATCH NULL diff --git a/third_party/sqlite/src/ext/fts5/test/fts5auto.test b/third_party/sqlite/src/ext/fts5/test/fts5auto.test index 218b3f486208b..0ebec3eaf718c 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5auto.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5auto.test @@ -24,205 +24,205 @@ ifcapable !fts5 { set data { -4026076 - {n x w k b p x b n t t d s} {f j j s p j o} - {w v i y r} {i p y s} - {a o q v e n q r} {q v g u c y a z y} + {n x w k b p x b n t t d s} {f j j s p j o} + {w v i y r} {i p y s} + {a o q v e n q r} {q v g u c y a z y} 3995120 - {c} {e e w d t} - {x c p f w r s m l r b f d} {g g u e} - {s n u t d v p d} {b k v p m f} + {c} {e e w d t} + {x c p f w r s m l r b f d} {g g u e} + {s n u t d v p d} {b k v p m f} -2913881 - {k m} {a} - {w r j z n s l} {m j i w d t w e l} - {z n c} {v f b m} + {k m} {a} + {w r j z n s l} {m j i w d t w e l} + {z n c} {v f b m} 174082 - {j} {q l w u k e q v r i} - {j l} {u v w r s p e l} - {p i k j k q c t g u s} {g u y s m h q k g t e s o r} + {j} {q l w u k e q v r i} + {j l} {u v w r s p e l} + {p i k j k q c t g u s} {g u y s m h q k g t e s o r} 3207399 - {e t} {} - {p} {y v r b e k h d e v} - {t m w z b g q t s d d h} {o n v u i t o y k j} + {e t} {} + {p} {y v r b e k h d e v} + {t m w z b g q t s d d h} {o n v u i t o y k j} 182399 - {} {m o s o x d y f a x j z} - {x n z r c d} {n r x i r} - {s v s} {a u} + {} {m o s o x d y f a x j z} + {x n z r c d} {n r x i r} + {s v s} {a u} 768994 - {e u t q v z q k j p u f j p} {y c b} - {p s d} {k n w p m p p} - {u o x s d} {f s g r d b d r m m m z y} + {e u t q v z q k j p u f j p} {y c b} + {p s d} {k n w p m p p} + {u o x s d} {f s g r d b d r m m m z y} 3931037 - {c j p x e} {c n k t h z o i} - {} {r r p j k x w q} - {o r d z d} {x} + {c j p x e} {c n k t h z o i} + {} {r r p j k x w q} + {o r d z d} {x} 3105748 - {p x r u} {x i s w o t o g x m z i w} - {q x m z} {h c j w b l y w x c o} - {m b k v} {t v q i s a d x} + {p x r u} {x i s w o t o g x m z i w} + {q x m z} {h c j w b l y w x c o} + {m b k v} {t v q i s a d x} -2501642 - {o u d n w o m o o s n t r h} {k p e u y p e z d j r y g} - {v b b h d d q y j q j} {a m w d t} - {y e f n} {a k x i x} + {o u d n w o m o o s n t r h} {k p e u y p e z d j r y g} + {v b b h d d q y j q j} {a m w d t} + {y e f n} {a k x i x} -1745680 - {z u w j f d b f} {j w i c g u d w e} - {m f p v m a s p v c o s} {s c r z o t w l b e a q} - {m k q} {k b a v o} + {z u w j f d b f} {j w i c g u d w e} + {m f p v m a s p v c o s} {s c r z o t w l b e a q} + {m k q} {k b a v o} -932328 - {r v i u m q d r} {f z u v h c m r f g} - {r x r} {k p i d h h w h z u a x} - {k m j p} {h l j a e u c i q x x f x g} + {r v i u m q d r} {f z u v h c m r f g} + {r x r} {k p i d h h w h z u a x} + {k m j p} {h l j a e u c i q x x f x g} -3923818 - {t t p b n u i h e c k} {m z} - {v u d c} {v y y j s g} - {o a f k k q p h g x e n z x} {h d w c o l} + {t t p b n u i h e c k} {m z} + {v u d c} {v y y j s g} + {o a f k k q p h g x e n z x} {h d w c o l} -2145922 - {z z l f a l g e d c d h} {j b j p k o o u b q} - {d i g q t f d r h k} {n w g j c x r p t y f l c t} - {d o c u k f o} {r y s x z s p p h g t p y c} + {z z l f a l g e d c d h} {j b j p k o o u b q} + {d i g q t f d r h k} {n w g j c x r p t y f l c t} + {d o c u k f o} {r y s x z s p p h g t p y c} 4552917 - {j w j y h l k u} {n a} - {y h w c n k} {b} - {w} {z l r t s i m v c y} + {j w j y h l k u} {n a} + {y h w c n k} {b} + {w} {z l r t s i m v c y} 2292008 - {q v q j w y y x u t} {r q z n h a b o} - {d q y} {y v o e j} - {} {a b h c d l p d x} + {q v q j w y y x u t} {r q z n h a b o} + {d q y} {y v o e j} + {} {a b h c d l p d x} 1407892 - {n j j u q d o a u c f} {r d b w o q n g} - {d e v w s} {v d v o u o x s l s j z y} - {j y w h i f g i h m} {v n z b n y} + {n j j u q d o a u c f} {r d b w o q n g} + {d e v w s} {v d v o u o x s l s j z y} + {j y w h i f g i h m} {v n z b n y} -4412544 - {g h h r s} {h e r e} - {n q s} {o p z r m l l t} - {p} {f s u o b j} + {g h h r s} {h e r e} + {n q s} {o p z r m l l t} + {p} {f s u o b j} 1209110 - {o a a z t t u h j} {z z i r k r} - {i c x q w g v o x z i z p} {q o g k i n z x e d v w v} - {p f v b g f e d n p u c y k} {q z z a i p a a s r e z} + {o a a z t t u h j} {z z i r k r} + {i c x q w g v o x z i z p} {q o g k i n z x e d v w v} + {p f v b g f e d n p u c y k} {q z z a i p a a s r e z} 3448977 - {i v} {l u x t b o k} - {f h u v p} {k a o y j} - {d m k c j} {v c e r u e f i t} + {i v} {l u x t b o k} + {f h u v p} {k a o y j} + {d m k c j} {v c e r u e f i t} -4703774 - {d h v w u z r e h x o l t} {p s f y w y r q d a m w} - {c h g c g j j f t b i c q} {s e} - {c t q j g f} {v n r w y r a g e j d} + {d h v w u z r e h x o l t} {p s f y w y r q d a m w} + {c h g c g j j f t b i c q} {s e} + {c t q j g f} {v n r w y r a g e j d} 2414151 - {s o o s d s k q b f q v p e} {j r o b t o p d l o o x} - {d d k t v e} {} - {t v o d w} {w e q w h y c y y i j b a m} + {s o o s d s k q b f q v p e} {j r o b t o p d l o o x} + {d d k t v e} {} + {t v o d w} {w e q w h y c y y i j b a m} -3342407 - {m c h n e p d o c r w n t} {j d k s p q l} - {t g s r w x j l r z r} {h} - {r q v x i r a n h s} {m y p b v w r a u o g q r} + {m c h n e p d o c r w n t} {j d k s p q l} + {t g s r w x j l r z r} {h} + {r q v x i r a n h s} {m y p b v w r a u o g q r} -993951 - {l n p u o j d x t u u c o j} {k r n a r e k v i t o e} - {q f t t a a c z v f} {o n m p v f o e n} - {h z h i p s b j z h} {i t w m k c u g n i} + {l n p u o j d x t u u c o j} {k r n a r e k v i t o e} + {q f t t a a c z v f} {o n m p v f o e n} + {h z h i p s b j z h} {i t w m k c u g n i} 1575251 - {} {z s i j d o x j a r t} - {h g j u j n v e n z} {p z j n n f} - {s q q f d w r l y i z d o m} {b a n d h t b y g h d} + {} {z s i j d o x j a r t} + {h g j u j n v e n z} {p z j n n f} + {s q q f d w r l y i z d o m} {b a n d h t b y g h d} 4263668 - {q g t h f s} {s g x p f q z i s o f l i} - {q k} {w v h a x n a r b} - {m j a h o b i x k r w z q u} {m t r g j o e q t m p u l} + {q g t h f s} {s g x p f q z i s o f l i} + {q k} {w v h a x n a r b} + {m j a h o b i x k r w z q u} {m t r g j o e q t m p u l} 2487819 - {m w g x r n e u t s r} {b x a t u u j c r n} - {j} {w f j r e e y l p} - {o u h b} {o c a c a b v} + {m w g x r n e u t s r} {b x a t u u j c r n} + {j} {w f j r e e y l p} + {o u h b} {o c a c a b v} 167966 - {o d b s d o a u m o x y} {c} - {r w d o b v} {z e b} - {i n z a f g z o} {m u b a g} + {o d b s d o a u m o x y} {c} + {r w d o b v} {z e b} + {i n z a f g z o} {m u b a g} 1948599 - {n r g q d j s} {n k} - {l b p d v t k h y y} {u m k e c} - {t b n y o t b} {j w c i r x x} + {n r g q d j s} {n k} + {l b p d v t k h y y} {u m k e c} + {t b n y o t b} {j w c i r x x} 2941631 - {l d p l b g f} {e k e} - {p j} {m c s w t b k n l d x} - {f o v y v l} {c w p s w j w c u t y} + {l d p l b g f} {e k e} + {p j} {m c s w t b k n l d x} + {f o v y v l} {c w p s w j w c u t y} 3561104 - {d r j j r j i g p} {u} - {g r j q} {z l p d s n f c h t d c v z} - {w r c f s x z y} {g f o k g g} + {d r j j r j i g p} {u} + {g r j q} {z l p d s n f c h t d c v z} + {w r c f s x z y} {g f o k g g} -2223281 - {y e t j j z f p o m m z} {h k o g o} - {m x a t} {l q x l} - {r w k d l s y b} {q g k b} + {y e t j j z f p o m m z} {h k o g o} + {m x a t} {l q x l} + {r w k d l s y b} {q g k b} -4502874 - {k k b x k l f} {r} - {} {q m z b k h k u n e z} - {z q g y m y u} {} + {k k b x k l f} {r} + {} {q m z b k h k u n e z} + {z q g y m y u} {} 1757599 - {d p z j y u r} {z p l q w j t j} - {n i r x r y j} {} - {h} {w t d q c x z z x e e} + {d p z j y u r} {z p l q w j t j} + {n i r x r y j} {} + {h} {w t d q c x z z x e e} -4809589 - {} {z p x u h i i n g} - {w q s u d b f x n} {l y k b b r x t i} - {n d v j q o t o d p z e} {u r y u v u c} + {} {z p x u h i i n g} + {w q s u d b f x n} {l y k b b r x t i} + {n d v j q o t o d p z e} {u r y u v u c} 1068408 - {y e} {e g s k e w t p v o b k} - {z c m s} {r u r u h n h b p q g b} - {j k b l} {m c d t s r s q a d b o f} + {y e} {e g s k e w t p v o b k} + {z c m s} {r u r u h n h b p q g b} + {j k b l} {m c d t s r s q a d b o f} -1972554 - {m s w} {d k v s a r k p a r i v} - {g j z k p} {y k c v r e u o q f i b a} - {i p i} {c z w c y b n z i v} + {m s w} {d k v s a r k p a r i v} + {g j z k p} {y k c v r e u o q f i b a} + {i p i} {c z w c y b n z i v} -2052385 - {} {x e u f f g n c i x n e i e} - {} {p s w d x p g} - {} {s j a h n} + {} {x e u f f g n c i x n e i e} + {} {p s w d x p g} + {} {s j a h n} 2805981 - {m x g c w o e} {k g u y r y i u e g g} - {f k j v t x p h x k u} {w i} - {b l f z f v t n} {i u d o d p h s m u} + {m x g c w o e} {k g u y r y i u e g g} + {f k j v t x p h x k u} {w i} + {b l f z f v t n} {i u d o d p h s m u} 2507621 - {} {u b n l x f n j t} - {u r x l h} {h r l m r} - {d y e n b s q v t k n q q} {x l t v w h a s k} + {} {u b n l x f n j t} + {u r x l h} {h r l m r} + {d y e n b s q v t k n q q} {x l t v w h a s k} -3138375 - {e o f j y x u w v e w z} {r d q g k n n v r c z n e w} - {l y i q z k j p u f q s k} {c i l l i m a a g a z r x f} - {a v k h m q z b y n z} {q g w c y r r o a} + {e o f j y x u w v e w z} {r d q g k n n v r c z n e w} + {l y i q z k j p u f q s k} {c i l l i m a a g a z r x f} + {a v k h m q z b y n z} {q g w c y r r o a} -457971 - {j x a w e c s h f l f} {q} - {j f v j u m d q r v v} {x n v a w} - {i e h d h f u w t t z} {v s u l s v o v i k n e} + {j x a w e c s h f l f} {q} + {j f v j u m d q r v v} {x n v a w} + {i e h d h f u w t t z} {v s u l s v o v i k n e} 2265221 - {z t c y w n y r t} {n b a x s} - {q w a v} {a b s d x i g w t e z h} - {t l} {j k r w f f y j o k u} + {z t c y w n y r t} {n b a x s} + {q w a v} {a b s d x i g w t e z h} + {t l} {j k r w f f y j o k u} -3941280 - {r x t o z} {f j n z k} - {t x e b t d b k w i s} {j t y h i h} - {y q g n g s u v c z j z n g} {n n g t l p h} + {r x t o z} {f j n z k} + {t x e b t d b k w i s} {j t y h i h} + {y q g n g s u v c z j z n g} {n n g t l p h} 2084745 - {z d z d} {j} - {o e k t b k a z l w} {o p i h k c x} - {c r b t i j f} {z e n m} + {z d z d} {j} + {o e k t b k a z l w} {o p i h k c x} + {c r b t i j f} {z e n m} 1265843 - {} {j s g j j x u y} - {u q t f} {g o g} - {w o j e d} {w q n a c t q x j} + {} {j s g j j x u y} + {u q t f} {g o g} + {w o j e d} {w q n a c t q x j} -2941116 - {i n c u o} {f b} - {o m s q d o z a q} {f s v o b b} - {o a z c h r} {j e w h b f z} + {i n c u o} {f b} + {o m s q d o z a q} {f s v o b b} + {o a z c h r} {j e w h b f z} -1265441 - {p g z q v a o a x a} {s t h} - {w i p o c} {s n d g f z w q o d v v l j} - {y f b i a s v} {u m o z k k s t s d p b l p} + {p g z q v a o a x a} {s t h} + {w i p o c} {s n d g f z w q o d v v l j} + {y f b i a s v} {u m o z k k s t s d p b l p} -1989158 - {r i c n} {r e w w i n z} - {q u s y b w u g y g f o} {y} - {d} {j x i b x u y d c p v a h} + {r i c n} {r e w w i n z} + {q u s y b w u g y g f o} {y} + {d} {j x i b x u y d c p v a h} 2391989 - {b n w x w f q h p i} {e u b b i n a i o c d g} - {v a z o i e n l x l r} {r u f o r k w m d w} - {k s} {r f e j q p w} + {b n w x w f q h p i} {e u b b i n a i o c d g} + {v a z o i e n l x l r} {r u f o r k w m d w} + {k s} {r f e j q p w} } do_execsql_test 1.0 { @@ -238,7 +238,7 @@ proc do_auto_test {tn tbl expr} { set ::autotest_expr $expr do_execsql_test $testname [subst -novar { - SELECT rowid, fts5_test_poslist([set tbl]) FROM [set tbl] + SELECT rowid, fts5_test_poslist([set tbl]) FROM [set tbl] WHERE [set tbl] MATCH $::autotest_expr ORDER BY rowid [set order] }] $res } @@ -251,14 +251,14 @@ for {set fold 0} {$fold < 3} {incr fold} { switch $fold { 0 { set map {} } 1 { set map { - a a b a c b d b e c f c g d h d + a a b a c b d b e c f c g d h d i e j e k f l f m g g g o h p h q i r i s j t j u k v k w l x l y m z m }} 2 { set map { - a a b a c a d a e a f a g a h a + a a b a c a d a e a f a g a h a i b j b k b l b m b g b o b p b q c r c s c t c u c v c w c x c }} @@ -271,7 +271,7 @@ for {set fold 0} {$fold < 3} {incr fold} { foreach {rowid a b c d e f} [string map $map $data] { if {$rowid==-4703774} { execsql { - INSERT INTO tt(rowid, a, b, c, d, e, f) + INSERT INTO tt(rowid, a, b, c, d, e, f) VALUES($rowid, $a, $b, $c, $d, $e, $f) } } @@ -328,8 +328,8 @@ do_test 4.0 { } {} foreach {tn expr} { - 1 x - 2 y + 1 x + 2 y 3 z 4 {c1 : x} 5 {c2 : x} 6 {c3 : x} diff --git a/third_party/sqlite/src/ext/fts5/test/fts5aux.test b/third_party/sqlite/src/ext/fts5/test/fts5aux.test index fa3167a4d1181..58fe1cad76f20 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5aux.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5aux.test @@ -21,17 +21,17 @@ ifcapable !fts5 { return } -proc inst {cmd i} { +proc inst {cmd i} { $cmd xInst $i } sqlite3_fts5_create_function db inst inst -proc colsize {cmd i} { +proc colsize {cmd i} { $cmd xColumnSize $i } sqlite3_fts5_create_function db colsize colsize -proc totalsize {cmd i} { +proc totalsize {cmd i} { $cmd xColumnTotalSize $i } sqlite3_fts5_create_function db totalsize totalsize @@ -104,13 +104,13 @@ do_execsql_test 3.1 { } {0+1 1+3 3+5} do_execsql_test 3.2 { - SELECT prevrowid(e5) || '+' || prevrowid1(e5) || '+' || rowid + SELECT prevrowid(e5) || '+' || prevrowid1(e5) || '+' || rowid FROM e5 WHERE e5 MATCH 'e' } {0+1+2 2+3+4} #------------------------------------------------------------------------- # Test that if the xQueryPhrase callback returns other than SQLITE_OK, -# the query is abandoned. And that if it returns an error code other than +# the query is abandoned. And that if it returns an error code other than # SQLITE_DONE, the error is propagated back to the caller. # do_execsql_test 4.0 { @@ -207,7 +207,7 @@ do_catchsql_test 6.2 { } {1 {no such cursor: 0}} #------------------------------------------------------------------------- -# Test passing an out-of-range phrase number to xPhraseSize (should +# Test passing an out-of-range phrase number to xPhraseSize (should # return 0). # proc my_phrasesize {cmd iPhrase} { $cmd xPhraseSize $iPhrase } @@ -218,7 +218,7 @@ do_execsql_test 7.1 { INSERT INTO t1 VALUES('a b c'); } do_execsql_test 7.2 { - SELECT + SELECT my_phrasesize(t1, -1), my_phrasesize(t1, 0), my_phrasesize(t1, 1), diff --git a/third_party/sqlite/src/ext/fts5/test/fts5auxdata.test b/third_party/sqlite/src/ext/fts5/test/fts5auxdata.test index dbbb1dba7852b..656a4e776f372 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5auxdata.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5auxdata.test @@ -57,7 +57,7 @@ proc aux_function_1 {cmd tn} { } sqlite3_fts5_create_function db aux_function_1 aux_function_1 -db eval { +db eval { SELECT aux_function_1(f1, 1) FROM f1 WHERE f1 MATCH 'a' ORDER BY rowid ASC } @@ -105,8 +105,8 @@ proc aux_function_2 {cmd tn inst} { } sqlite3_fts5_create_function db aux_function_2 aux_function_2 -db eval { - SELECT aux_function_2(f1, 2, 'A'), aux_function_2(f1, 2, 'B') +db eval { + SELECT aux_function_2(f1, 2, 'A'), aux_function_2(f1, 2, 'B') FROM f1 WHERE f1 MATCH 'a' ORDER BY rowid ASC } diff --git a/third_party/sqlite/src/ext/fts5/test/fts5columnsize.test b/third_party/sqlite/src/ext/fts5/test/fts5columnsize.test index dec9b58d3d183..102f1e3df8321 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5columnsize.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5columnsize.test @@ -36,7 +36,7 @@ foreach {tn outcome stmt} { 8 1 { CREATE VIRTUAL TABLE t1 USING fts5(x) } 9 2 { CREATE VIRTUAL TABLE t1 USING fts5(x, columnsize=11) } } { - execsql { + execsql { DROP TABLE IF EXISTS t1; } if {$outcome==2} { @@ -66,19 +66,19 @@ do_execsql_test 2.2 { do_execsql_test 2.3 { SELECT rowid FROM t2 WHERE t2 MATCH 'b'; SELECT '::'; SELECT rowid FROM t2 WHERE t2 MATCH 'e'; SELECT '::'; - SELECT rowid FROM t2 WHERE t2 MATCH 'h'; + SELECT rowid FROM t2 WHERE t2 MATCH 'h'; } {3 :: 1 2 3 :: 2 3} do_execsql_test 2.4 { INSERT INTO t2(t2, rowid, x) VALUES('delete', 2, 'c d e f g h'); SELECT rowid FROM t2 WHERE t2 MATCH 'b'; SELECT '::'; SELECT rowid FROM t2 WHERE t2 MATCH 'e'; SELECT '::'; - SELECT rowid FROM t2 WHERE t2 MATCH 'h'; + SELECT rowid FROM t2 WHERE t2 MATCH 'h'; } {3 :: 1 3 :: 3} do_execsql_test 2.5 { INSERT INTO t2(t2) VALUES('delete-all'); SELECT rowid FROM t2 WHERE t2 MATCH 'b'; SELECT '::'; SELECT rowid FROM t2 WHERE t2 MATCH 'e'; SELECT '::'; - SELECT rowid FROM t2 WHERE t2 MATCH 'h'; + SELECT rowid FROM t2 WHERE t2 MATCH 'h'; } {:: ::} do_execsql_test 2.6 { INSERT INTO t2(rowid, x) VALUES(1, 'o t t f'); diff --git a/third_party/sqlite/src/ext/fts5/test/fts5config.test b/third_party/sqlite/src/ext/fts5/test/fts5config.test index 386d112e7daf3..9b97845015fb7 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5config.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5config.test @@ -29,9 +29,9 @@ do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5('a', "b", [c], `d`); PRAGMA table_info = t1; } { - 0 a {} 0 {} 0 - 1 b {} 0 {} 0 - 2 c {} 0 {} 0 + 0 a {} 0 {} 0 + 1 b {} 0 {} 0 + 2 c {} 0 {} 0 3 d {} 0 {} 0 } @@ -39,7 +39,7 @@ do_execsql_test 1.0 { # Syntax errors in the prefix= option. # foreach {tn opt} { - 1 {prefix=x} + 1 {prefix=x} 2 {prefix='x'} 3 {prefix='$'} 4 {prefix='1,2,'} @@ -104,11 +104,11 @@ do_execsql_test 4.2 { } {} #------------------------------------------------------------------------- -# Misquoting in tokenize= and other options. +# Misquoting in tokenize= and other options. # do_catchsql_test 5.1 { CREATE VIRTUAL TABLE xx USING fts5(x, tokenize="porter 'ascii"); -} {1 {parse error in tokenize directive}} +} {1 {parse error in tokenize directive}} breakpoint do_catchsql_test 5.2 { @@ -232,7 +232,7 @@ foreach {tn spec} { # errors in the detail= option. # foreach {tn opt} { - 1 {detail=x} + 1 {detail=x} 2 {detail='x'} 3 {detail='$'} 4 {detail='1,2,'} diff --git a/third_party/sqlite/src/ext/fts5/test/fts5conflict.test b/third_party/sqlite/src/ext/fts5/test/fts5conflict.test index 5c1e593249822..f9cfbda8aa91a 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5conflict.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5conflict.test @@ -42,11 +42,11 @@ do_execsql_test 2.0 { INSERT INTO fts_idx(rowid, b, c) VALUES (new.a, new.b, new.c); END; CREATE TRIGGER tbl_ad AFTER DELETE ON tbl BEGIN - INSERT INTO fts_idx(fts_idx, rowid, b, c) + INSERT INTO fts_idx(fts_idx, rowid, b, c) VALUES('delete', old.a, old.b, old.c); END; CREATE TRIGGER tbl_au AFTER UPDATE ON tbl BEGIN - INSERT INTO fts_idx(fts_idx, rowid, b, c) + INSERT INTO fts_idx(fts_idx, rowid, b, c) VALUES('delete', old.a, old.b, old.c); INSERT INTO fts_idx(rowid, b, c) VALUES (new.a, new.b, new.c); END; diff --git a/third_party/sqlite/src/ext/fts5/test/fts5content.test b/third_party/sqlite/src/ext/fts5/test/fts5content.test index 69e66a54f8e50..afac550c8848b 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5content.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5content.test @@ -53,12 +53,12 @@ do_execsql_test 1.6 { } {1 1 2 1 4 1} do_execsql_test 1.7 { - SELECT rowid, snippet(f1, -1, '[', ']', '...', 5) IS NULL + SELECT rowid, snippet(f1, -1, '[', ']', '...', 5) IS NULL FROM f1 WHERE f1 MATCH 'o'; } {1 1 2 1 4 1} do_execsql_test 1.8 { - SELECT rowid, snippet(f1, 1, '[', ']', '...', 5) IS NULL + SELECT rowid, snippet(f1, 1, '[', ']', '...', 5) IS NULL FROM f1 WHERE f1 MATCH 'o'; } {1 1 2 1 4 1} @@ -112,11 +112,11 @@ do_execsql_test 2.1 { INSERT INTO fts_idx(rowid, b, c) VALUES (new.a, new.b, new.c); END; CREATE TRIGGER tbl_ad AFTER DELETE ON tbl BEGIN - INSERT INTO fts_idx(fts_idx, rowid, b, c) + INSERT INTO fts_idx(fts_idx, rowid, b, c) VALUES('delete', old.a, old.b, old.c); END; CREATE TRIGGER tbl_au AFTER UPDATE ON tbl BEGIN - INSERT INTO fts_idx(fts_idx, rowid, b, c) + INSERT INTO fts_idx(fts_idx, rowid, b, c) VALUES('delete', old.a, old.b, old.c); INSERT INTO fts_idx(rowid, b, c) VALUES (new.a, new.b, new.c); END; @@ -147,7 +147,7 @@ do_execsql_test 2.6 { } {three {t h r e e x y z}} do_execsql_test 2.7 { - SELECT highlight(fts_idx, 1, '[', ']') FROM fts_idx + SELECT highlight(fts_idx, 1, '[', ']') FROM fts_idx WHERE fts_idx MATCH 't AND x'; } {{[t] h r e e [x] y z}} @@ -212,7 +212,7 @@ do_execsql_test 4.5 { SELECT rowid FROM t2 WHERE t2 MATCH 'x'} {-40} do_execsql_test 4.6 { INSERT INTO t2(t2) VALUES('integrity-check') } {} -do_execsql_test 4.7 { +do_execsql_test 4.7 { DELETE FROM x2 WHERE "key col" = 1; INSERT INTO t2(t2, rowid, a, c) VALUES('delete', 1, 'a b', 'e f'); INSERT INTO t2(t2) VALUES('integrity-check'); diff --git a/third_party/sqlite/src/ext/fts5/test/fts5corrupt.test b/third_party/sqlite/src/ext/fts5/test/fts5corrupt.test index edaafb23793c1..cd51d258c25d8 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5corrupt.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5corrupt.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file tests that the FTS5 'integrity-check' command detects +# This file tests that the FTS5 'integrity-check' command detects # inconsistencies (corruption) in the on-disk backing tables. # diff --git a/third_party/sqlite/src/ext/fts5/test/fts5corrupt2.test b/third_party/sqlite/src/ext/fts5/test/fts5corrupt2.test index c10017a266782..a7c9fa4eb2bf3 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5corrupt2.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5corrupt2.test @@ -10,7 +10,7 @@ #*********************************************************************** # # This file tests that FTS5 handles corrupt databases (i.e. internal -# inconsistencies in the backing tables) correctly. In this case +# inconsistencies in the backing tables) correctly. In this case # "correctly" means without crashing. # @@ -24,7 +24,7 @@ ifcapable !fts5 { } sqlite3_fts5_may_be_corrupt 1 -# Create a simple FTS5 table containing 100 documents. Each document +# Create a simple FTS5 table containing 100 documents. Each document # contains 10 terms, each of which start with the character "x". # expr srand(0) @@ -47,7 +47,7 @@ if 0 { # * an integrity-check, and # * unless the deleted block was a b-tree node, a query for "t1 MATCH 'x*'" # -# and check that the corruption is detected in both cases. The +# and check that the corruption is detected in both cases. The # rollback the transaction. # # Test 2: @@ -63,20 +63,20 @@ foreach {tno stmt} { foreach rowid [db eval {SELECT rowid FROM t1_data WHERE rowid>10}] { incr tn #if {$tn!=224} continue - + do_test 1.$tno.$tn.1.$rowid { execsql { BEGIN } execsql $stmt catchsql { INSERT INTO t1(t1) VALUES('integrity-check') } } {1 {database disk image is malformed}} - + if {($rowid & $mask)==0} { # Node is a leaf node, not a b-tree node. do_catchsql_test 1.$tno.$tn.2.$rowid { SELECT rowid FROM t1 WHERE t1 MATCH 'x*' } {1 {database disk image is malformed}} } - + do_execsql_test 1.$tno.$tn.3.$rowid { ROLLBACK; INSERT INTO t1(t1) VALUES('integrity-check'); @@ -96,7 +96,7 @@ foreach {tno stmt} { # corruption. It may not report the db as corrupt because truncating the # final leaf to some sizes may create a valid leaf page. # -set lrowid [db one {SELECT max(rowid) FROM t1_data WHERE (rowid & $mask)=0}] +set lrowid [db one {SELECT max(rowid) FROM t1_data WHERE (rowid & $mask)=0}] set nbyte [db one {SELECT length(block) FROM t1_data WHERE rowid=$lrowid}] set all [db eval {SELECT rowid FROM t1}] for {set i [expr $nbyte-2]} {$i>=0} {incr i -1} { @@ -112,8 +112,8 @@ for {set i [expr $nbyte-2]} {$i>=0} {incr i -1} { do_test 2.$i.3 { set res [catchsql {SELECT rowid FROM t1 WHERE t1 MATCH 'x*'}] expr { - $res=="1 {database disk image is malformed}" - || $res=="0 {$all}" + $res=="1 {database disk image is malformed}" + || $res=="0 {$all}" } } 1 @@ -131,8 +131,8 @@ set doc "A B C D E F G H I J " do_execsql_test 3.0 { CREATE VIRTUAL TABLE x3 USING fts5(tt); INSERT INTO x3(x3, rank) VALUES('pgsz', 32); - WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<1000) - INSERT INTO x3 + WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<1000) + INSERT INTO x3 SELECT ($doc || CASE WHEN (i%50)==0 THEN 'X' ELSE 'Y' END) FROM ii; } @@ -180,8 +180,8 @@ set doc "A B C D E F G H I J " do_execsql_test 4.0 { CREATE VIRTUAL TABLE x4 USING fts5(tt); INSERT INTO x4(x4, rank) VALUES('pgsz', 32); - WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<10) - INSERT INTO x4 + WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<10) + INSERT INTO x4 SELECT ($doc || CASE WHEN (i%50)==0 THEN 'X' ELSE 'Y' END) FROM ii; } @@ -197,7 +197,7 @@ foreach {tn nCut} { do_test 4.$tn.$tn2 { execsql { BEGIN; - UPDATE x4_data SET block = substr(block, 1, length(block)-$nCut) + UPDATE x4_data SET block = substr(block, 1, length(block)-$nCut) WHERE id = $rowid; } @@ -218,7 +218,7 @@ set doc [string repeat "A B C " 1000] do_execsql_test 5.0 { CREATE VIRTUAL TABLE x5 USING fts5(tt); INSERT INTO x5(x5, rank) VALUES('pgsz', 32); - WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<10) + WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<10) INSERT INTO x5 SELECT $doc FROM ii; } @@ -257,7 +257,7 @@ do_execsql_test 6.1 { UPDATE x5_docsize SET sz = X'' WHERE id=3; } -proc colsize {cmd i} { +proc colsize {cmd i} { $cmd xColumnSize $i } sqlite3_fts5_create_function db colsize colsize diff --git a/third_party/sqlite/src/ext/fts5/test/fts5corrupt3.test b/third_party/sqlite/src/ext/fts5/test/fts5corrupt3.test index 9653bcaac20a3..c8ed42ff70bd9 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5corrupt3.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5corrupt3.test @@ -10,7 +10,7 @@ #*********************************************************************** # # This file tests that FTS5 handles corrupt databases (i.e. internal -# inconsistencies in the backing tables) correctly. In this case +# inconsistencies in the backing tables) correctly. In this case # "correctly" means without crashing. # @@ -37,7 +37,7 @@ proc create_t1 {} { if 1 { -# Create a simple FTS5 table containing 100 documents. Each document +# Create a simple FTS5 table containing 100 documents. Each document # contains 10 terms, each of which start with the character "x". # do_test 1.0 { create_t1 } {} @@ -49,7 +49,7 @@ do_test 1.1 { }] set L [db one {SELECT length(block) FROM t1_data WHERE rowid = $rowid}] set {} {} -} {} +} {} for {set i 0} {$i < $L} {incr i} { do_test 1.2.$i { @@ -61,7 +61,7 @@ for {set i 0} {$i < $L} {incr i} { } {1 {database disk image is malformed}} catchsql ROLLBACK } - + #------------------------------------------------------------------------- # Test that trailing bytes appended to the averages record are ignored. # @@ -117,7 +117,7 @@ do_execsql_test 3.3 { do_3_test 3.4 do_test 3.5 { - execsql { + execsql { DELETE FROM t1; INSERT INTO t1(t1, rank) VALUES('pgsz', 40); } @@ -141,7 +141,7 @@ do_test 3.7 { do_3_test 3.8 do_test 3.9 { - execsql { + execsql { DELETE FROM t1; INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } @@ -159,7 +159,7 @@ do_3_test 3.10 # reset_db do_test 4.0 { - execsql { + execsql { CREATE VIRTUAL TABLE t1 USING fts5(x); INSERT INTO t1(t1, rank) VALUES('pgsz', 32); } @@ -198,7 +198,7 @@ do_test 4.1.x { expr $nErr>45 } 1 #------------------------------------------------------------------------- # -# The first argument passed to this command must be a binary blob +# The first argument passed to this command must be a binary blob # containing an FTS5 leaf page. This command returns a copy of this # blob, with the pgidx of the leaf page replaced by a single varint # containing value $iVal. @@ -230,7 +230,7 @@ do_execsql_test 5.1 { #db eval { SELECT fts5_decode(id, block) b from x1_data } { puts $b } # -db func rewrite_pgidx rewrite_pgidx +db func rewrite_pgidx rewrite_pgidx set i 0 foreach rowid [db eval {SELECT rowid FROM x1_data WHERE rowid>100}] { foreach val {2 100} { @@ -263,7 +263,7 @@ do_execsql_test 6.1.0 { SELECT quote(block) FROM t1_data WHERE rowid>100; } {X'000000180630626262626201020201056363636363010203040A'} do_execsql_test 6.1.1 { - UPDATE t1_data SET block = + UPDATE t1_data SET block = X'000000180630626262626201020201056161616161010203040A' WHERE rowid>100; } @@ -295,7 +295,7 @@ do_execsql_test 6.3.0 { } {X'0000001C043061626301020204036465660102030703676869010204040808'} do_execsql_test 6.3.1 { BEGIN; - UPDATE t1_data SET block = + UPDATE t1_data SET block = X'0000001C043061626301020204036465660102035003676869010204040808' ------------------------------------------^^--------------------- WHERE id>100; @@ -306,7 +306,7 @@ do_catchsql_test 6.3.2 { do_execsql_test 6.3.3 { ROLLBACK; BEGIN; - UPDATE t1_data SET block = + UPDATE t1_data SET block = X'0000001C043061626301020204036465660102030750676869010204040808' --------------------------------------------^^------------------- WHERE id>100; @@ -317,7 +317,7 @@ do_catchsql_test 6.3.3 { do_execsql_test 6.3.4 { ROLLBACK; BEGIN; - UPDATE t1_data SET block = + UPDATE t1_data SET block = X'0000001C043061626301020204036465660102030707676869010204040850' --------------------------------------------------------------^^- WHERE id>100; @@ -328,7 +328,7 @@ do_catchsql_test 6.3.5 { do_execsql_test 6.3.6 { ROLLBACK; BEGIN; - UPDATE t1_data SET block = + UPDATE t1_data SET block = X'0000001C503061626301020204036465660102030707676869010204040808' ----------^^----------------------------------------------------- WHERE id>100; @@ -364,11 +364,11 @@ do_test 7.0 { do_test 7.1 { foreach i [db eval { SELECT rowid FROM t5_data WHERE rowid>100 }] { - db eval BEGIN + db eval BEGIN db eval {DELETE FROM t5_data WHERE rowid = $i} set r [catchsql { INSERT INTO t5(t5) VALUES('integrity-check')} ] if {$r != "1 {database disk image is malformed}"} { error $r } - db eval ROLLBACK + db eval ROLLBACK } } {} diff --git a/third_party/sqlite/src/ext/fts5/test/fts5detail.test b/third_party/sqlite/src/ext/fts5/test/fts5detail.test index 58fda3e995483..4eeb4966927e4 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5detail.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5detail.test @@ -213,7 +213,7 @@ do_catchsql_test 4.1 { } {1 {fts5: column queries are not supported (detail=none)}} #------------------------------------------------------------------------- -# Test that for the same content detail=none uses less space than +# Test that for the same content detail=none uses less space than # detail=col, and that detail=col uses less space than detail=full # reset_db @@ -227,13 +227,13 @@ do_test 5.1 { } {} do_execsql_test 5.2 { - SELECT + SELECT (SELECT sum(length(block)) from t1_data) < (SELECT sum(length(block)) from t2_data) } {1} do_execsql_test 5.3 { - SELECT + SELECT (SELECT sum(length(block)) from t2_data) < (SELECT sum(length(block)) from t3_data) } {1} diff --git a/third_party/sqlite/src/ext/fts5/test/fts5determin.test b/third_party/sqlite/src/ext/fts5/test/fts5determin.test index e368c4704e7b0..d0fad4ef49329 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5determin.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5determin.test @@ -18,7 +18,7 @@ source [file join [file dirname [info script]] fts5_common.tcl] set testprefix fts5aa -return_if_no_fts5 +return_if_no_fts5 proc do_determin_test {tn} { uplevel [list diff --git a/third_party/sqlite/src/ext/fts5/test/fts5dlidx.test b/third_party/sqlite/src/ext/fts5/test/fts5dlidx.test index 655beb984b68f..1c3e1ed39883a 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5dlidx.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5dlidx.test @@ -34,7 +34,7 @@ proc do_fb_test {tn sql res} { uplevel [list do_execsql_test $tn.2 "$sql ORDER BY rowid DESC" $res2] } -# This test populates the FTS5 table with $nEntry entries. Rows are +# This test populates the FTS5 table with $nEntry entries. Rows are # numbered from 0 to ($nEntry-1). The rowid for row $i is: # # ($iFirst + $i*$nStep) @@ -56,10 +56,10 @@ proc do_dlidx_test1 {tn spc1 spc2 nEntry iFirst nStep} { set doc [string trim [string repeat "a b c " 100]] if {($i % $spc1)==0} { lappend xdoc $rowid - append doc " x" - if {($i % $spc2)==0} { + append doc " x" + if {($i % $spc2)==0} { lappend ydoc $rowid - append doc " y" + append doc " y" } } execsql { INSERT INTO t1(rowid, x) VALUES($rowid, $doc) } @@ -70,17 +70,17 @@ proc do_dlidx_test1 {tn spc1 spc2 nEntry iFirst nStep} { do_test $tn.1 { execsql { INSERT INTO t1(t1) VALUES('integrity-check') } } {} - + do_fb_test $tn.3.1 { SELECT rowid FROM t1 WHERE t1 MATCH 'a AND x' } $xdoc do_fb_test $tn.3.2 { SELECT rowid FROM t1 WHERE t1 MATCH 'x AND a' } $xdoc - + do_fb_test $tn.4.1 { SELECT rowid FROM t1 WHERE t1 MATCH 'a AND y' } $ydoc do_fb_test $tn.4.2 { SELECT rowid FROM t1 WHERE t1 MATCH 'y AND a' } $ydoc - + if {[detail_is_full]} { - do_fb_test $tn.5.1 { + do_fb_test $tn.5.1 { SELECT rowid FROM t1 WHERE t1 MATCH 'a + b + c + x' } $xdoc - do_fb_test $tn.5.2 { + do_fb_test $tn.5.2 { SELECT rowid FROM t1 WHERE t1 MATCH 'b + c + x + y' } $ydoc } } @@ -90,7 +90,7 @@ foreach {tn pgsz} { 1 32 2 200 } { - do_execsql_test $tn.0 { + do_execsql_test $tn.0 { DROP TABLE IF EXISTS t1; CREATE VIRTUAL TABLE t1 USING fts5(x, detail=%DETAIL%); INSERT INTO t1(t1, rank) VALUES('pgsz', $pgsz); @@ -114,7 +114,7 @@ proc do_dlidx_test2 {tn nEntry iFirst nStep} { INSERT INTO t1 VALUES('b a'); WITH iii(ii, i) AS ( - SELECT 1, $iFirst UNION ALL + SELECT 1, $iFirst UNION ALL SELECT ii+1, i+$nStep FROM iii WHERE ii<$nEntry ) INSERT INTO t1(rowid,x) SELECT i, $str FROM iii; @@ -173,8 +173,8 @@ do_execsql_test 3.1 { do_execsql_test 3.2 { - SELECT rowid FROM abc WHERE abc - MATCH 'IteratorpItercurrentlypointstothefirstrowidofadoclist' + SELECT rowid FROM abc WHERE abc + MATCH 'IteratorpItercurrentlypointstothefirstrowidofadoclist' ORDER BY rowid DESC; } {16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} diff --git a/third_party/sqlite/src/ext/fts5/test/fts5doclist.test b/third_party/sqlite/src/ext/fts5/test/fts5doclist.test index 411289a5235ea..aa560f851436b 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5doclist.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5doclist.test @@ -32,7 +32,7 @@ do_test 1.0 { execsql "CREATE VIRTUAL TABLE ccc USING fts5([join $cols ,])" } {} -db func rnddoc fts5_rnddoc +db func rnddoc fts5_rnddoc do_execsql_test 1.1 { WITH ii(i) AS (SELECT 1 UNION SELECT i+1 FROM ii WHERE i<100) INSERT INTO ccc(x899) SELECT rnddoc(500) FROM ii; diff --git a/third_party/sqlite/src/ext/fts5/test/fts5ea.test b/third_party/sqlite/src/ext/fts5/test/fts5ea.test index 3ccbd7d7a2d8d..540b6d637b51c 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5ea.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5ea.test @@ -52,9 +52,9 @@ foreach {tn expr res} { } foreach {tn expr res} { - 1 {c1:abc} + 1 {c1:abc} {c1 : "abc"} - 2 {c2 : NEAR(one two) c1:"hello world"} + 2 {c2 : NEAR(one two) c1:"hello world"} {c2 : NEAR("one" "two", 10) AND c1 : "hello" + "world"} } { do_execsql_test 2.$tn {SELECT fts5_expr($expr, 'c1', 'c2')} [list $res] diff --git a/third_party/sqlite/src/ext/fts5/test/fts5fault1.test b/third_party/sqlite/src/ext/fts5/test/fts5fault1.test index 9d63a1175f20e..da0abb7e5d983 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5fault1.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5fault1.test @@ -48,7 +48,7 @@ faultsim_save_and_close do_faultsim_test 2 -prep { faultsim_restore_and_reopen } -body { - execsql { + execsql { INSERT INTO t1 VALUES('a b c', 'a bc def ghij klmno'); } } -test { @@ -116,7 +116,7 @@ foreach {tn expr res} { # an error to occur. # reset_db -do_execsql_test 5.0.1 { +do_execsql_test 5.0.1 { PRAGMA main.page_size = 512; CREATE VIRTUAL TABLE x1 USING fts5(a, b); PRAGMA main.page_size; @@ -177,21 +177,21 @@ do_faultsim_test 5.4 -faults oom* -prep { } do_faultsim_test 5.5.1 -faults oom* -body { - execsql { + execsql { SELECT count(fts5_decode(rowid, block)) FROM x1_data WHERE rowid=1 } } -test { faultsim_test_result [list 0 1] } do_faultsim_test 5.5.2 -faults oom* -body { - execsql { + execsql { SELECT count(fts5_decode(rowid, block)) FROM x1_data WHERE rowid=10 } } -test { faultsim_test_result [list 0 1] } do_faultsim_test 5.5.3 -faults oom* -body { - execsql { + execsql { SELECT count(fts5_decode(rowid, block)) FROM x1_data WHERE rowid = ( SELECT min(rowid) FROM x1_data WHERE rowid>20 ) @@ -200,9 +200,9 @@ do_faultsim_test 5.5.3 -faults oom* -body { faultsim_test_result [list 0 1] } do_faultsim_test 5.5.4 -faults oom* -body { - execsql { + execsql { SELECT count(fts5_decode(rowid, block)) FROM x1_data WHERE rowid = ( - SELECT max(rowid) FROM x1_data + SELECT max(rowid) FROM x1_data ) } } -test { @@ -309,7 +309,7 @@ do_test 8.0 { do_faultsim_test 8.1 -faults oom* -prep { } -body { - execsql { + execsql { SELECT rowid FROM x1 WHERE x1 MATCH 'x*' } } -test { diff --git a/third_party/sqlite/src/ext/fts5/test/fts5fault2.test b/third_party/sqlite/src/ext/fts5/test/fts5fault2.test index 43c7c7a3dda1e..e5cf23a1a16f9 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5fault2.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5fault2.test @@ -29,7 +29,7 @@ do_execsql_test 1.0 { INSERT INTO x1(x1, rank) VALUES('pgsz', 32); WITH input(a,b) AS ( SELECT 1, $doc UNION ALL - SELECT a+1, ($doc || CASE WHEN (a+1)%100 THEN '' ELSE ' xyz' END) + SELECT a+1, ($doc || CASE WHEN (a+1)%100 THEN '' ELSE ' xyz' END) FROM input WHERE a < 1000 ) INSERT INTO t1 SELECT * FROM input; @@ -52,9 +52,9 @@ do_faultsim_test 1.2 -faults oom-* -prep { } #------------------------------------------------------------------------- -# OOM within a query that accesses the in-memory hash table. +# OOM within a query that accesses the in-memory hash table. # -reset_db +reset_db do_execsql_test 2.0 { CREATE VIRTUAL TABLE "a b c" USING fts5(a, b, c); INSERT INTO "a b c" VALUES('one two', 'x x x', 'three four'); @@ -76,7 +76,7 @@ do_faultsim_test 2.1 -faults oom-trans* -prep { #------------------------------------------------------------------------- # OOM within an 'optimize' operation that writes multiple pages to disk. # -reset_db +reset_db do_execsql_test 3.0 { CREATE VIRTUAL TABLE zzz USING fts5(z); INSERT INTO zzz(zzz, rank) VALUES('pgsz', 32); @@ -101,7 +101,7 @@ do_faultsim_test 3.1 -faults oom-trans* -prep { #------------------------------------------------------------------------- # OOM within an 'integrity-check' operation. # -reset_db +reset_db db func rnddoc fts5_rnddoc do_execsql_test 4.0 { CREATE VIRTUAL TABLE zzz USING fts5(z); @@ -125,8 +125,8 @@ faultsim_save_and_close do_faultsim_test 5.0 -faults oom-* -prep { faultsim_restore_and_reopen } -body { - execsql { - CREATE VIRTUAL TABLE uio USING fts5(a, b, + execsql { + CREATE VIRTUAL TABLE uio USING fts5(a, b, tokenize="porter 'ascii'", content="another table", content_rowid="somecolumn" diff --git a/third_party/sqlite/src/ext/fts5/test/fts5fault3.test b/third_party/sqlite/src/ext/fts5/test/fts5fault3.test index bfeead4e2317d..8e84a40bc3832 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5fault3.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5fault3.test @@ -25,7 +25,7 @@ ifcapable !fts5 { #------------------------------------------------------------------------- # An OOM while resuming a partially completed segment merge. # -db func rnddoc fts5_rnddoc +db func rnddoc fts5_rnddoc do_test 1.0 { expr srand(0) execsql { diff --git a/third_party/sqlite/src/ext/fts5/test/fts5fault4.test b/third_party/sqlite/src/ext/fts5/test/fts5fault4.test index bfa54a5b04c75..e586c0d787d38 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5fault4.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5fault4.test @@ -25,7 +25,7 @@ ifcapable !fts5 { #------------------------------------------------------------------------- # An OOM while dropping an fts5 table. # -db func rnddoc fts5_rnddoc +db func rnddoc fts5_rnddoc do_test 1.0 { execsql { CREATE VIRTUAL TABLE xx USING fts5(x) } } {} @@ -103,7 +103,7 @@ do_execsql_test 5.0 { INSERT INTO x2(rowid, x) VALUES(50, 'a b c'); -- 1 } -proc rowidmod {cmd mod} { +proc rowidmod {cmd mod} { set row [$cmd xRowid] expr {$row % $mod} } @@ -111,14 +111,14 @@ sqlite3_fts5_create_function db rowidmod rowidmod do_faultsim_test 5.1 -faults oom-* -body { db eval { - SELECT rowid || '-' || rank FROM x2 WHERE x2 MATCH 'b' AND + SELECT rowid || '-' || rank FROM x2 WHERE x2 MATCH 'b' AND rank MATCH "rowidmod('7')" ORDER BY rank } } -test { faultsim_test_result {0 {50-1 30-2 10-3 40-5 20-6}} } -proc rowidprefix {cmd prefix} { +proc rowidprefix {cmd prefix} { set row [$cmd xRowid] set {} "${row}-${prefix}" } @@ -127,7 +127,7 @@ sqlite3_fts5_create_function db rowidprefix rowidprefix set str [string repeat abcdefghijklmnopqrstuvwxyz 10] do_faultsim_test 5.2 -faults oom-* -body { db eval " - SELECT rank, x FROM x2 WHERE x2 MATCH 'b' AND + SELECT rank, x FROM x2 WHERE x2 MATCH 'b' AND rank MATCH 'rowidprefix(''$::str'')' LIMIT 1 " @@ -153,7 +153,7 @@ do_faultsim_test 6.1 -faults oom-t* -body { faultsim_test_result {0 {{a b *c* d *c* b a}}} } -proc firstinst {cmd} { +proc firstinst {cmd} { foreach {p c o} [$cmd xInst 0] {} expr $c*100 + $o } @@ -267,8 +267,8 @@ do_execsql_test 9.0 { INSERT INTO tt(tt, rank) VALUES('pgsz', 32); BEGIN; WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<200) - INSERT INTO tt(rowid, x) - SELECT i, CASE WHEN (i%50)==0 THEN 'a a a a a a' ELSE 'a x a x a x' END + INSERT INTO tt(rowid, x) + SELECT i, CASE WHEN (i%50)==0 THEN 'a a a a a a' ELSE 'a x a x a x' END FROM ii; COMMIT; } @@ -285,7 +285,7 @@ do_faultsim_test 9.1 -faults oom-* -body { do_faultsim_test 10.1 -faults oom-t* -body { db one { SELECT fts5_expr('a AND b NEAR(a b)') } } -test { - faultsim_test_result {0 {"a" AND "b" AND NEAR("a" "b", 10)}} + faultsim_test_result {0 {"a" AND "b" AND NEAR("a" "b", 10)}} } do_faultsim_test 10.2 -faults oom-t* -body { @@ -328,7 +328,7 @@ do_faultsim_test 12.1 -faults oom-t* -prep { } -body { db eval { CREATE VIRTUAL TABLE vv USING fts5vocab(ft, 'row') } } -test { - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} } #------------------------------------------------------------------------- @@ -347,7 +347,7 @@ do_faultsim_test 13.1 -faults oom-t* -prep { } -body { db eval { SELECT * FROM vv } } -test { - faultsim_test_result {0 {a 1 1 b 1 1}} + faultsim_test_result {0 {a 1 1 b 1 1}} } #------------------------------------------------------------------------- diff --git a/third_party/sqlite/src/ext/fts5/test/fts5fault5.test b/third_party/sqlite/src/ext/fts5/test/fts5fault5.test index 75b7d9af503fb..56c99db4f873a 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5fault5.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5fault5.test @@ -109,9 +109,9 @@ breakpoint do_execsql_test 3.3.0 { SELECT * FROM tv2; } { - 0 x 1 {} 1 x 1 {} 10 x 1 {} 11 x 1 {} 12 x 1 {} 13 x 1 {} - 14 x 1 {} 15 x 1 {} 16 x 1 {} 17 x 1 {} 18 x 1 {} 19 x 1 {} - 2 x 1 {} 3 x 1 {} 4 x 1 {} 5 x 1 {} 6 x 1 {} 7 x 1 {} 8 x 1 {} + 0 x 1 {} 1 x 1 {} 10 x 1 {} 11 x 1 {} 12 x 1 {} 13 x 1 {} + 14 x 1 {} 15 x 1 {} 16 x 1 {} 17 x 1 {} 18 x 1 {} 19 x 1 {} + 2 x 1 {} 3 x 1 {} 4 x 1 {} 5 x 1 {} 6 x 1 {} 7 x 1 {} 8 x 1 {} 9 x 1 {} } do_faultsim_test 3.3 -faults oom-t* -body { diff --git a/third_party/sqlite/src/ext/fts5/test/fts5fault6.test b/third_party/sqlite/src/ext/fts5/test/fts5fault6.test index 118761fab5e27..46b68ac1b2ba6 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5fault6.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5fault6.test @@ -102,7 +102,7 @@ do_faultsim_test 2.3 -faults oom-t* -prep { } #------------------------------------------------------------------------- -# OOM in the ASCII tokenizer with very large tokens. +# OOM in the ASCII tokenizer with very large tokens. # # Also the unicode tokenizer. # @@ -142,7 +142,7 @@ faultsim_save_and_close do_faultsim_test 4.1 -faults oom-t* -prep { faultsim_restore_and_reopen } -body { - db eval { + db eval { CREATE VIRTUAL TABLE yu USING fts5(x, tokenize="unicode61 separators abc"); } } -test { @@ -181,7 +181,7 @@ do_test 5.0 { execsql { CREATE VIRTUAL TABLE t1 USING fts5(a, tokenize=tcl) } execsql { INSERT INTO t1(t1, rank) VALUES('pgsz', 32) } foreach {rowid text} { - 1 {aaaa cc b aaaaa cc aa} + 1 {aaaa cc b aaaaa cc aa} 2 {aa aa bb a bbb} 3 {bb aaaaa aaaaa b aaaa aaaaa} 4 {aa a b aaaa aa} @@ -249,7 +249,7 @@ do_faultsim_test 5.2 -faults oom* -prep { sqlite3_fts5_register_matchinfo db db func mit mit } -body { - db eval { + db eval { SELECT rowid, mit(matchinfo(t1, 'x')) FROM t1 WHERE t1 MATCH 'a AND c' } } -test { @@ -260,7 +260,7 @@ do_faultsim_test 5.3 -faults oom* -prep { faultsim_restore_and_reopen sqlite3_fts5_create_tokenizer db tcl tcl_create } -body { - db eval { + db eval { SELECT count(*) FROM t1 WHERE t1 MATCH 'd AND e AND f' } } -test { @@ -271,7 +271,7 @@ do_faultsim_test 5.4 -faults oom* -prep { faultsim_restore_and_reopen sqlite3_fts5_create_tokenizer db tcl tcl_create } -body { - db eval { + db eval { SELECT count(*) FROM t1 WHERE t1 MATCH 'x + e' } } -test { diff --git a/third_party/sqlite/src/ext/fts5/test/fts5fault8.test b/third_party/sqlite/src/ext/fts5/test/fts5fault8.test index c613490e540cb..c44656a933e9e 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5fault8.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5fault8.test @@ -31,16 +31,16 @@ foreach_detail_mode $testprefix { INSERT INTO t1 VALUES('a b a b', NULL); INSERT INTO t1 VALUES(NULL, '1 2 1 2'); } - + do_faultsim_test 1 -faults oom-* -body { - execsql { - SELECT rowid, fts5_test_poslist(t1) FROM t1 WHERE t1 MATCH 'b OR 2' + execsql { + SELECT rowid, fts5_test_poslist(t1) FROM t1 WHERE t1 MATCH 'b OR 2' } } -test { faultsim_test_result {0 {1 {0.0.1 1.1.1} 2 {0.0.1 0.0.3} 3 {1.1.1 1.1.3}}} \ {1 SQLITE_NOMEM} } - + do_faultsim_test 2 -faults oom-* -body { execsql { INSERT INTO t1(t1) VALUES('integrity-check') } } -test { diff --git a/third_party/sqlite/src/ext/fts5/test/fts5fault9.test b/third_party/sqlite/src/ext/fts5/test/fts5fault9.test index 908a91d22a321..851c0dc670fc0 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5fault9.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5fault9.test @@ -112,7 +112,7 @@ do_faultsim_test 4.2 -faults oom-t* -body { #------------------------------------------------------------------------- # An OOM within an "ORDER BY rank" query. # -db func rnddoc fts5_rnddoc +db func rnddoc fts5_rnddoc do_execsql_test 5.0 { CREATE VIRTUAL TABLE xx USING fts5(x, y, detail=%DETAIL%); INSERT INTO xx VALUES ('def', 'abc ' || rnddoc(10)); diff --git a/third_party/sqlite/src/ext/fts5/test/fts5faultA.test b/third_party/sqlite/src/ext/fts5/test/fts5faultA.test index 817ccb4ee848e..175b01ca17a98 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5faultA.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5faultA.test @@ -26,16 +26,16 @@ foreach_detail_mode $testprefix { do_execsql_test 1.0 { CREATE VIRTUAL TABLE o1 USING fts5(a, detail=%DETAIL%); INSERT INTO o1(o1, rank) VALUES('pgsz', 32); - + WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<300 ) INSERT INTO o1 SELECT 'A B C' FROM s; - + INSERT INTO o1 VALUES('A X C'); - + WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<300 ) INSERT INTO o1 SELECT 'A B C' FROM s; } - + do_faultsim_test 1 -faults oom* -prep { sqlite3 db test.db } -body { @@ -47,7 +47,7 @@ foreach_detail_mode $testprefix { do_execsql_test 2.0 { CREATE VIRTUAL TABLE o2 USING fts5(a); - + INSERT INTO o2 VALUES('A B C'); WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<300 ) INSERT INTO o2 SELECT group_concat('A B C ') FROM s; diff --git a/third_party/sqlite/src/ext/fts5/test/fts5faultB.test b/third_party/sqlite/src/ext/fts5/test/fts5faultB.test index 2ce33f4bc4207..f100dcf3cd61e 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5faultB.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5faultB.test @@ -58,13 +58,13 @@ do_execsql_test 2 { do_faultsim_test 2.1 -faults oom* -body { execsql { SELECT mit(matchinfo(t1, 'a')) FROM t1('x') } } -test { - faultsim_test_result {0 {{2 5} {2 5}}} + faultsim_test_result {0 {{2 5} {2 5}}} } do_faultsim_test 2.2 -faults oom* -body { execsql { SELECT mit(matchinfo(t1, 'l')) FROM t1('x') } } -test { - faultsim_test_result {0 {{3 3} {1 7}}} + faultsim_test_result {0 {{3 3} {1 7}}} } do_execsql_test 2.3 { @@ -75,12 +75,12 @@ do_execsql_test 2.3 { do_faultsim_test 2.4 -faults oom* -body { execsql { SELECT mit(matchinfo(t1, 's')) FROM t1('a b c') } } -test { - faultsim_test_result {0 {{3 2} {2 3}}} + faultsim_test_result {0 {{3 2} {2 3}}} } #------------------------------------------------------------------------- # -reset_db +reset_db do_execsql_test 3.0 { CREATE VIRTUAL TABLE x1 USING fts5(z); } diff --git a/third_party/sqlite/src/ext/fts5/test/fts5full.test b/third_party/sqlite/src/ext/fts5/test/fts5full.test index c640f56e0651b..66a8706d957d4 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5full.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5full.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# Test that SQLITE_FULL is returned if the FTS5 table cannot find a free +# Test that SQLITE_FULL is returned if the FTS5 table cannot find a free # segid to use. In practice this can only really happen when automerge and # crisismerge are both disabled. # diff --git a/third_party/sqlite/src/ext/fts5/test/fts5hash.test b/third_party/sqlite/src/ext/fts5/test/fts5hash.test index f3952d6157284..fe41882f8ca34 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5hash.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5hash.test @@ -67,8 +67,8 @@ proc random_doc {vocab nWord} { foreach_detail_mode $testprefix { set vocab [build_vocab1] - db func r random_doc - + db func r random_doc + do_execsql_test 1.0 { CREATE VIRTUAL TABLE eee USING fts5(e, ee, detail=%DETAIL%); BEGIN; @@ -78,13 +78,13 @@ foreach_detail_mode $testprefix { COMMIT; INSERT INTO eee(eee) VALUES('integrity-check'); } - + set hash [sqlite3_fts5_token_hash 1024 xyz] set vocab [build_vocab1 -prefix xyz -hash $hash] lappend vocab xyz - + do_execsql_test 1.1 { - CREATE VIRTUAL TABLE vocab USING fts5vocab(eee, 'row'); + CREATE VIRTUAL TABLE vocab USING fts5vocab(eee, 'row'); BEGIN; } do_test 1.2 { @@ -92,7 +92,7 @@ foreach_detail_mode $testprefix { execsql { INSERT INTO eee VALUES( r($vocab, 5), r($vocab, 7) ) } } } {} - + do_test 1.3 { db eval { SELECT term, doc FROM vocab } { set nRow [db one {SELECT count(*) FROM eee WHERE eee MATCH $term}] @@ -102,7 +102,7 @@ foreach_detail_mode $testprefix { } set {} {} } {} - + do_execsql_test 1.4 { COMMIT; INSERT INTO eee(eee) VALUES('integrity-check'); diff --git a/third_party/sqlite/src/ext/fts5/test/fts5integrity.test b/third_party/sqlite/src/ext/fts5/test/fts5integrity.test index 37ca9331dd217..b54909f811dd5 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5integrity.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5integrity.test @@ -67,36 +67,36 @@ do_execsql_test 4.0 { INSERT INTO aa(zz) VALUES('a'); SELECT length(sz) FROM aa_docsize; } {1 1 1 1 1} -do_execsql_test 4.1 { - INSERT INTO aa(aa) VALUES('integrity-check'); +do_execsql_test 4.1 { + INSERT INTO aa(aa) VALUES('integrity-check'); } -do_catchsql_test 4.2 { +do_catchsql_test 4.2 { BEGIN; UPDATE aa_docsize SET sz = X'44' WHERE rowid = 3; - INSERT INTO aa(aa) VALUES('integrity-check'); + INSERT INTO aa(aa) VALUES('integrity-check'); } {1 {database disk image is malformed}} -do_catchsql_test 4.3 { +do_catchsql_test 4.3 { ROLLBACK; BEGIN; UPDATE aa_data SET block = X'44' WHERE rowid = 1; - INSERT INTO aa(aa) VALUES('integrity-check'); + INSERT INTO aa(aa) VALUES('integrity-check'); } {1 {database disk image is malformed}} -do_catchsql_test 4.4 { +do_catchsql_test 4.4 { ROLLBACK; BEGIN; INSERT INTO aa_docsize VALUES(23, X'04'); - INSERT INTO aa(aa) VALUES('integrity-check'); + INSERT INTO aa(aa) VALUES('integrity-check'); } {1 {database disk image is malformed}} -do_catchsql_test 4.5 { +do_catchsql_test 4.5 { ROLLBACK; BEGIN; INSERT INTO aa_docsize VALUES(23, X'00'); INSERT INTO aa_content VALUES(23, ''); - INSERT INTO aa(aa) VALUES('integrity-check'); + INSERT INTO aa(aa) VALUES('integrity-check'); } {1 {database disk image is malformed}} #db eval {SELECT rowid, fts5_decode(rowid, block) aS r FROM zz_data} {puts $r} diff --git a/third_party/sqlite/src/ext/fts5/test/fts5matchinfo.test b/third_party/sqlite/src/ext/fts5/test/fts5matchinfo.test index 99b07677af2aa..ab535025bcea2 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5matchinfo.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5matchinfo.test @@ -30,7 +30,7 @@ sqlite3_fts5_register_matchinfo db do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(content, detail=%DETAIL%); -} +} do_execsql_test 1.1 { INSERT INTO t1(content) VALUES('I wandered lonely as a cloud'); @@ -56,8 +56,8 @@ do_execsql_test 1.2 { # full identifier (i.e. "fts3matchinfo-1.1") or, if global var $testprefix # is set, just the numeric component (i.e. "1.1"). # -# The second argument is the name of an FTSX table. The third is the -# full text of a WHERE/MATCH expression to query the table for +# The second argument is the name of an FTSX table. The third is the +# full text of a WHERE/MATCH expression to query the table for # (i.e. "t1 MATCH 'abc'"). The final argument - $results - should be a # key-value list (serialized array) with matchinfo() format specifiers # as keys, and the results of executing the statement: @@ -89,7 +89,7 @@ do_execsql_test 1.2 { # } # # And this command would compute the expected results for matchinfo(t1, 'pcx') -# based on the results of matchinfo(t1, 'p'), matchinfo(t1, 'c') and +# based on the results of matchinfo(t1, 'p'), matchinfo(t1, 'c') and # matchinfo(t1, 'x') in order to test 'pcx'. # proc do_matchinfo_test {tn tbl expr results} { @@ -104,7 +104,7 @@ proc do_matchinfo_test {tn tbl expr results} { if {[llength $res]>$nRow} { set nRow [llength $res] } } - # Construct expected results for any formats for which the caller + # Construct expected results for any formats for which the caller # supplied result is "-". # foreach {fmt res} $results { @@ -217,13 +217,13 @@ do_matchinfo_p_test 4.1.4 t4 {t4 MATCH '"a b" c'} { s {{2 0} {0 2}} } do_matchinfo_p_test 4.1.5 t4 {t4 MATCH 'a "b c"'} { s {{2 0} {0 2}} } do_matchinfo_test 4.1.6 t4 {t4 MATCH 'd d'} { s {{1 0} {0 1}} } do_matchinfo_test 4.1.7 t4 {t4 MATCH 'f OR abcd'} { - x { - {0 1 1 1 1 1 0 0 0 0 0 0} + x { + {0 1 1 1 1 1 0 0 0 0 0 0} {1 1 1 0 1 1 0 0 0 0 0 0} } } do_matchinfo_test 4.1.8 t4 {t4 MATCH 'f NOT abcd'} { - x { + x { {0 1 1 1 1 1 0 0 0 0 0 0} {1 1 1 0 1 1 0 0 0 0 0 0} } @@ -236,9 +236,9 @@ do_execsql_test 4.2.0 { INSERT INTO t5 VALUES('c b c b c'); INSERT INTO t5 VALUES('x x x x x'); } -do_matchinfo_test 4.2.1 t5 {t5 MATCH 'a a'} { +do_matchinfo_test 4.2.1 t5 {t5 MATCH 'a a'} { x {{5 8 2 5 8 2} {3 8 2 3 8 2}} - s {2 1} + s {2 1} } do_matchinfo_test 4.2.2 t5 {t5 MATCH 'a b'} { s {2} } do_matchinfo_test 4.2.3 t5 {t5 MATCH 'a b a'} { s {3} } @@ -251,9 +251,9 @@ do_execsql_test 4.3.0 "INSERT INTO t5 VALUES('x y [string repeat {b } 50000]')"; # It used to be that the second 'a' token would be deferred. That doesn't # work any longer. if 0 { - do_matchinfo_test 4.3.1 t5 {t5 MATCH 'a a'} { + do_matchinfo_test 4.3.1 t5 {t5 MATCH 'a a'} { x {{5 8 2 5 5 5} {3 8 2 3 5 5}} - s {2 1} + s {2 1} } } @@ -295,13 +295,13 @@ do_execsql_test 7.3 { SELECT typeof(matchinfo(t10)), length(matchinfo(t10)) FROM t10 WHERE rowid=1; } {blob 8} do_execsql_test 7.4 { - SELECT typeof(matchinfo(t10)), length(matchinfo(t10)) + SELECT typeof(matchinfo(t10)), length(matchinfo(t10)) FROM t10 WHERE t10 MATCH 'record' } {blob 20 blob 20} #------------------------------------------------------------------------- -# Test a special case - matchinfo('nxa') with many zero length documents. -# Special because "x" internally uses a statement used by both "n" and "a". +# Test a special case - matchinfo('nxa') with many zero length documents. +# Special because "x" internally uses a statement used by both "n" and "a". # This was causing a problem at one point in the obscure case where the # total number of bytes of data stored in an fts3 table was greater than # the number of rows. i.e. when the following query returns true: @@ -363,7 +363,7 @@ do_execsql_test 10.1 { GROUP BY t10.rowid ORDER BY 1; } {1 1 one 2 2 two 3 3 three} - + #--------------------------------------------------------------------------- # Test the 'y' matchinfo flag # @@ -392,11 +392,11 @@ foreach {tn expr res} { 2 "b" { 1 {0 1} 2 {1 0} 3 {1 2} 4 {0 1} 5 {0 1} - 6 {2 2} 8 {2 1} 9 {1 3} + 6 {2 2} 8 {2 1} 9 {1 3} } 3 "y:a" { - 1 {0 2} 3 {0 1} + 1 {0 2} 3 {0 1} 7 {0 1} 8 {0 2} 9 {0 1} 10 {0 3} } @@ -412,12 +412,12 @@ foreach {tn expr res} { 6 "a AND b" { 1 {1 2 0 1} 2 {1 0 1 0} 3 {0 1 1 2} 4 {1 0 0 1} 5 {1 0 0 1} - 6 {1 0 2 2} 8 {1 2 2 1} 9 {1 1 1 3} + 6 {1 0 2 2} 8 {1 2 2 1} 9 {1 1 1 3} } 7 "a OR (a AND b)" { - 1 {1 2 1 2 0 1} 2 {1 0 1 0 1 0} 3 {0 1 0 1 1 2} 4 {1 0 1 0 0 1} - 5 {1 0 1 0 0 1} 6 {1 0 1 0 2 2} 7 {2 1 0 0 0 0} 8 {1 2 1 2 2 1} + 1 {1 2 1 2 0 1} 2 {1 0 1 0 1 0} 3 {0 1 0 1 1 2} 4 {1 0 1 0 0 1} + 5 {1 0 1 0 0 1} 6 {1 0 1 0 2 2} 7 {2 1 0 0 0 0} 8 {1 2 1 2 2 1} 9 {1 1 1 1 1 3} 10 {1 3 0 0 0 0} } diff --git a/third_party/sqlite/src/ext/fts5/test/fts5merge.test b/third_party/sqlite/src/ext/fts5/test/fts5merge.test index 73e006a7d2ce5..fe63f646c51d6 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5merge.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5merge.test @@ -192,7 +192,7 @@ foreach {tn pgsz} { #------------------------------------------------------------------------- # Test that the 'merge' command does not modify the database if there is -# no work to do. +# no work to do. do_execsql_test 5.1 { CREATE VIRTUAL TABLE x9 USING fts5(one, two); @@ -221,7 +221,7 @@ do_test 5.2 { #-------------------------------------------------------------------------- -# Test that running 'merge' on an empty database does not cause a +# Test that running 'merge' on an empty database does not cause a # problem. # reset_db diff --git a/third_party/sqlite/src/ext/fts5/test/fts5near.test b/third_party/sqlite/src/ext/fts5/test/fts5near.test index b4ae205deeb62..46a6f0405c39f 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5near.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5near.test @@ -29,8 +29,8 @@ proc do_near_test {tn doc near res} { " $res] } -execsql { - CREATE VIRTUAL TABLE t1 USING fts5(x, tokenize = "ascii tokenchars '.'") +execsql { + CREATE VIRTUAL TABLE t1 USING fts5(x, tokenize = "ascii tokenchars '.'") } do_near_test 1.1 ". . a . . . b . ." { NEAR(a b, 5) } 1 diff --git a/third_party/sqlite/src/ext/fts5/test/fts5onepass.test b/third_party/sqlite/src/ext/fts5/test/fts5onepass.test index a614b780a2915..e998d627ecf77 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5onepass.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5onepass.test @@ -27,7 +27,7 @@ do_execsql_test 1.0 { } #------------------------------------------------------------------------- -# Check that UPDATE and DELETE statements that feature "WHERE rowid=?" or +# Check that UPDATE and DELETE statements that feature "WHERE rowid=?" or # or "WHERE rowid=?" clauses do not use statement journals. But that other # DELETE and UPDATE statements do. # @@ -53,7 +53,7 @@ foreach {tn sql uses} { #------------------------------------------------------------------------- # Check that putting a "DELETE/UPDATE ... WHERE rowid=?" statement in a -# trigger program does not prevent the VM from using a statement +# trigger program does not prevent the VM from using a statement # transaction. Even if the calling statement cannot hit a constraint. # do_execsql_test 2.0 { @@ -82,7 +82,7 @@ foreach {tn sql uses} { #------------------------------------------------------------------------- # Test that an "UPDATE ... WHERE rowid=?" works and does not corrupt the -# index when it strikes a constraint. Both inside and outside a +# index when it strikes a constraint. Both inside and outside a # transaction. # foreach {tn tcl1 tcl2} { @@ -109,7 +109,7 @@ foreach {tn tcl1 tcl2} { 1 { UPDATE ft2 SET rowid=2 WHERE rowid=1 } { 1 {a b c} 2 {a b d} 3 {a b e} } - 2 { + 2 { INSERT INTO ft2(rowid, content) VALUES(4, 'a b f'); UPDATE ft2 SET rowid=5 WHERE rowid=4; UPDATE ft2 SET rowid=3 WHERE rowid=5; @@ -135,7 +135,7 @@ foreach {tn tcl1 tcl2} { do_catchsql_test 3.$tn.$tn2.a $sql {1 {constraint failed}} do_execsql_test 3.$tn.$tn2.b { SELECT rowid, content FROM ft2 } $content - do_execsql_test 3.$tn.$tn2.c { + do_execsql_test 3.$tn.$tn2.c { INSERT INTO ft2(ft2) VALUES('integrity-check'); } } diff --git a/third_party/sqlite/src/ext/fts5/test/fts5phrase.test b/third_party/sqlite/src/ext/fts5/test/fts5phrase.test index 6dac684e83193..fd0d708861d31 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5phrase.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5phrase.test @@ -99,8 +99,8 @@ foreach {tn cols tokens} { set where [join $where " OR "] set res [db eval "SELECT rowid FROM t3 WHERE $where"] - do_execsql_test "1.$tn.$fts->([llength $res] rows)" { - SELECT rowid FROM t3($fts) + do_execsql_test "1.$tn.$fts->([llength $res] rows)" { + SELECT rowid FROM t3($fts) } $res } @@ -111,7 +111,7 @@ do_execsql_test 2.0 { highlight(t3, 2, '*', '*') FROM t3('a:f+f') } { - 31 {h *f f*} {i j g e c} {j j f c a i j} + 31 {h *f f*} {i j g e c} {j j f c a i j} 50 {*f f* c} {f f b i i} {f f a j e c i} } diff --git a/third_party/sqlite/src/ext/fts5/test/fts5plan.test b/third_party/sqlite/src/ext/fts5/test/fts5plan.test index d7f5fd65a035d..1f238267fc1a0 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5plan.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5plan.test @@ -29,7 +29,7 @@ do_execsql_test 1.0 { do_eqp_test 1.1 { SELECT * FROM t1, f1 WHERE f1 MATCH t1.x } { - 0 0 0 {SCAN TABLE t1} + 0 0 0 {SCAN TABLE t1} 0 1 1 {SCAN TABLE f1 VIRTUAL TABLE INDEX 1:} } @@ -37,7 +37,7 @@ do_eqp_test 1.2 { SELECT * FROM t1, f1 WHERE f1 > t1.x } { 0 0 1 {SCAN TABLE f1 VIRTUAL TABLE INDEX 0:} - 0 1 0 {SCAN TABLE t1} + 0 1 0 {SCAN TABLE t1} } do_eqp_test 1.3 { diff --git a/third_party/sqlite/src/ext/fts5/test/fts5porter.test b/third_party/sqlite/src/ext/fts5/test/fts5porter.test index 2535eb75b1ee9..3666e395414a3 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5porter.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5porter.test @@ -24,11772 +24,11772 @@ ifcapable !fts5 { } set test_vocab { - a a aaron aaron - abaissiez abaissiez abandon abandon - abandoned abandon abase abas - abash abash abate abat - abated abat abatement abat - abatements abat abates abat - abbess abbess abbey abbei - abbeys abbei abbominable abbomin - abbot abbot abbots abbot - abbreviated abbrevi abed ab - abel abel aberga aberga - abergavenny abergavenni abet abet - abetting abet abhominable abhomin - abhor abhor abhorr abhorr - abhorred abhor abhorring abhor - abhors abhor abhorson abhorson - abide abid abides abid - abilities abil ability abil - abject abject abjectly abjectli - abjects abject abjur abjur - abjure abjur able abl - abler abler aboard aboard - abode abod aboded abod - abodements abod aboding abod - abominable abomin abominably abomin - abominations abomin abortive abort - abortives abort abound abound - abounding abound about about - above abov abr abr - abraham abraham abram abram - abreast abreast abridg abridg - abridge abridg abridged abridg - abridgment abridg abroach abroach - abroad abroad abrogate abrog - abrook abrook abrupt abrupt - abruption abrupt abruptly abruptli - absence absenc absent absent - absey absei absolute absolut - absolutely absolut absolv absolv - absolver absolv abstains abstain - abstemious abstemi abstinence abstin - abstract abstract absurd absurd - absyrtus absyrtu abundance abund - abundant abund abundantly abundantli - abus abu abuse abus - abused abus abuser abus - abuses abus abusing abus - abutting abut aby abi - abysm abysm ac ac - academe academ academes academ - accent accent accents accent - accept accept acceptable accept - acceptance accept accepted accept - accepts accept access access - accessary accessari accessible access - accidence accid accident accid - accidental accident accidentally accident - accidents accid accite accit - accited accit accites accit - acclamations acclam accommodate accommod - accommodated accommod accommodation accommod - accommodations accommod accommodo accommodo - accompanied accompani accompany accompani - accompanying accompani accomplices accomplic - accomplish accomplish accomplished accomplish - accomplishing accomplish accomplishment accomplish - accompt accompt accord accord - accordant accord accorded accord - accordeth accordeth according accord - accordingly accordingli accords accord - accost accost accosted accost - account account accountant account - accounted account accounts account - accoutred accoutr accoutrement accoutr - accoutrements accoutr accrue accru - accumulate accumul accumulated accumul - accumulation accumul accurs accur - accursed accurs accurst accurst - accus accu accusation accus - accusations accus accusative accus - accusativo accusativo accuse accus - accused accus accuser accus - accusers accus accuses accus - accuseth accuseth accusing accus - accustom accustom accustomed accustom - ace ac acerb acerb - ache ach acheron acheron - aches ach achiev achiev - achieve achiev achieved achiev - achievement achiev achievements achiev - achiever achiev achieves achiev - achieving achiev achilles achil - aching ach achitophel achitophel - acknowledg acknowledg acknowledge acknowledg - acknowledged acknowledg acknowledgment acknowledg - acknown acknown acold acold - aconitum aconitum acordo acordo - acorn acorn acquaint acquaint - acquaintance acquaint acquainted acquaint - acquaints acquaint acquir acquir - acquire acquir acquisition acquisit - acquit acquit acquittance acquitt - acquittances acquitt acquitted acquit - acre acr acres acr - across across act act - actaeon actaeon acted act - acting act action action - actions action actium actium - active activ actively activ - activity activ actor actor - actors actor acts act - actual actual acture actur - acute acut acutely acut - ad ad adage adag - adallas adalla adam adam - adamant adam add add - added ad adder adder - adders adder addeth addeth - addict addict addicted addict - addiction addict adding ad - addition addit additions addit - addle addl address address - addressing address addrest addrest - adds add adhere adher - adheres adher adieu adieu - adieus adieu adjacent adjac - adjoin adjoin adjoining adjoin - adjourn adjourn adjudg adjudg - adjudged adjudg adjunct adjunct - administer administ administration administr - admir admir admirable admir - admiral admir admiration admir - admire admir admired admir - admirer admir admiring admir - admiringly admiringli admission admiss - admit admit admits admit - admittance admitt admitted admit - admitting admit admonish admonish - admonishing admonish admonishment admonish - admonishments admonish admonition admonit - ado ado adonis adoni - adopt adopt adopted adopt - adoptedly adoptedli adoption adopt - adoptious adopti adopts adopt - ador ador adoration ador - adorations ador adore ador - adorer ador adores ador - adorest adorest adoreth adoreth - adoring ador adorn adorn - adorned adorn adornings adorn - adornment adorn adorns adorn - adown adown adramadio adramadio - adrian adrian adriana adriana - adriano adriano adriatic adriat - adsum adsum adulation adul - adulterate adulter adulterates adulter - adulterers adulter adulteress adulteress - adulteries adulteri adulterous adulter - adultery adulteri adultress adultress - advanc advanc advance advanc - advanced advanc advancement advanc - advancements advanc advances advanc - advancing advanc advantage advantag - advantageable advantag advantaged advantag - advantageous advantag advantages advantag - advantaging advantag advent advent - adventur adventur adventure adventur - adventures adventur adventuring adventur - adventurous adventur adventurously adventur - adversaries adversari adversary adversari - adverse advers adversely advers - adversities advers adversity advers - advertis adverti advertise advertis - advertised advertis advertisement advertis - advertising advertis advice advic - advis advi advise advis - advised advis advisedly advisedli - advises advis advisings advis - advocate advoc advocation advoc - aeacida aeacida aeacides aeacid - aedile aedil aediles aedil - aegeon aegeon aegion aegion - aegles aegl aemelia aemelia - aemilia aemilia aemilius aemiliu - aeneas aenea aeolus aeolu - aer aer aerial aerial - aery aeri aesculapius aesculapiu - aeson aeson aesop aesop - aetna aetna afar afar - afear afear afeard afeard - affability affabl affable affabl - affair affair affaire affair - affairs affair affect affect - affectation affect affectations affect - affected affect affectedly affectedli - affecteth affecteth affecting affect - affection affect affectionate affection - affectionately affection affections affect - affects affect affeer affeer - affianc affianc affiance affianc - affianced affianc affied affi - affin affin affined affin - affinity affin affirm affirm - affirmation affirm affirmatives affirm - afflict afflict afflicted afflict - affliction afflict afflictions afflict - afflicts afflict afford afford - affordeth affordeth affords afford - affray affrai affright affright - affrighted affright affrights affright - affront affront affronted affront - affy affi afield afield - afire afir afloat afloat - afoot afoot afore afor - aforehand aforehand aforesaid aforesaid - afraid afraid afresh afresh - afric afric africa africa - african african afront afront - after after afternoon afternoon - afterward afterward afterwards afterward - ag ag again again - against against agamemmon agamemmon - agamemnon agamemnon agate agat - agaz agaz age ag - aged ag agenor agenor - agent agent agents agent - ages ag aggravate aggrav - aggrief aggrief agile agil - agincourt agincourt agitation agit - aglet aglet agnize agniz - ago ago agone agon - agony agoni agree agre - agreed agre agreeing agre - agreement agreement agrees agre - agrippa agrippa aground aground - ague agu aguecheek aguecheek - agued agu agueface aguefac - agues agu ah ah - aha aha ahungry ahungri - ai ai aialvolio aialvolio - aiaria aiaria aid aid - aidance aidanc aidant aidant - aided aid aiding aid - aidless aidless aids aid - ail ail aim aim - aimed aim aimest aimest - aiming aim aims aim - ainsi ainsi aio aio - air air aired air - airless airless airs air - airy airi ajax ajax - akilling akil al al - alabaster alabast alack alack - alacrity alacr alarbus alarbu - alarm alarm alarms alarm - alarum alarum alarums alarum - alas ala alb alb - alban alban albans alban - albany albani albeit albeit - albion albion alchemist alchemist - alchemy alchemi alcibiades alcibiad - alcides alcid alder alder - alderman alderman aldermen aldermen - ale al alecto alecto - alehouse alehous alehouses alehous - alencon alencon alengon alengon - aleppo aleppo ales al - alewife alewif alexander alexand - alexanders alexand alexandria alexandria - alexandrian alexandrian alexas alexa - alias alia alice alic - alien alien aliena aliena - alight alight alighted alight - alights alight aliis alii - alike alik alisander alisand - alive aliv all all - alla alla allay allai - allayed allai allaying allai - allayment allay allayments allay - allays allai allegation alleg - allegations alleg allege alleg - alleged alleg allegiance allegi - allegiant allegi alley allei - alleys allei allhallowmas allhallowma - alliance allianc allicholy allicholi - allied alli allies alli - alligant allig alligator allig - allons allon allot allot - allots allot allotted allot - allottery allotteri allow allow - allowance allow allowed allow - allowing allow allows allow - allur allur allure allur - allurement allur alluring allur - allusion allus ally alli - allycholly allycholli almain almain - almanac almanac almanack almanack - almanacs almanac almighty almighti - almond almond almost almost - alms alm almsman almsman - aloes alo aloft aloft - alone alon along along - alonso alonso aloof aloof - aloud aloud alphabet alphabet - alphabetical alphabet alphonso alphonso - alps alp already alreadi - also also alt alt - altar altar altars altar - alter alter alteration alter - altered alter alters alter - althaea althaea although although - altitude altitud altogether altogeth - alton alton alway alwai - always alwai am am - amaimon amaimon amain amain - amaking amak amamon amamon - amaz amaz amaze amaz - amazed amaz amazedly amazedli - amazedness amazed amazement amaz - amazes amaz amazeth amazeth - amazing amaz amazon amazon - amazonian amazonian amazons amazon - ambassador ambassador ambassadors ambassador - amber amber ambiguides ambiguid - ambiguities ambigu ambiguous ambigu - ambition ambit ambitions ambit - ambitious ambiti ambitiously ambiti - amble ambl ambled ambl - ambles ambl ambling ambl - ambo ambo ambuscadoes ambuscado - ambush ambush amen amen - amend amend amended amend - amendment amend amends amend - amerce amerc america america - ames am amiable amiabl - amid amid amidst amidst - amiens amien amis ami - amiss amiss amities amiti - amity amiti amnipotent amnipot - among among amongst amongst - amorous amor amorously amor - amort amort amount amount - amounts amount amour amour - amphimacus amphimacu ample ampl - ampler ampler amplest amplest - amplified amplifi amplify amplifi - amply ampli ampthill ampthil - amurath amurath amyntas amynta - an an anatomiz anatomiz - anatomize anatom anatomy anatomi - ancestor ancestor ancestors ancestor - ancestry ancestri anchises anchis - anchor anchor anchorage anchorag - anchored anchor anchoring anchor - anchors anchor anchovies anchovi - ancient ancient ancientry ancientri - ancients ancient ancus ancu - and and andirons andiron - andpholus andpholu andren andren - andrew andrew andromache andromach - andronici andronici andronicus andronicu - anew anew ang ang - angel angel angelica angelica - angelical angel angelo angelo - angels angel anger anger - angerly angerli angers anger - anges ang angiers angier - angl angl anglais anglai - angle angl angler angler - angleterre angleterr angliae anglia - angling angl anglish anglish - angrily angrili angry angri - anguish anguish angus angu - animal anim animals anim - animis animi anjou anjou - ankle ankl anna anna - annals annal anne ann - annex annex annexed annex - annexions annexion annexment annex - annothanize annothan announces announc - annoy annoi annoyance annoy - annoying annoi annual annual - anoint anoint anointed anoint - anon anon another anoth - anselmo anselmo answer answer - answerable answer answered answer - answerest answerest answering answer - answers answer ant ant - ante ant antenor antenor - antenorides antenorid anteroom anteroom - anthem anthem anthems anthem - anthony anthoni anthropophagi anthropophagi - anthropophaginian anthropophaginian antiates antiat - antic antic anticipate anticip - anticipates anticip anticipatest anticipatest - anticipating anticip anticipation anticip - antick antick anticly anticli - antics antic antidote antidot - antidotes antidot antigonus antigonu - antiopa antiopa antipathy antipathi - antipholus antipholu antipholuses antipholus - antipodes antipod antiquary antiquari - antique antiqu antiquity antiqu - antium antium antoniad antoniad - antonio antonio antonius antoniu - antony antoni antres antr - anvil anvil any ani - anybody anybodi anyone anyon - anything anyth anywhere anywher - ap ap apace apac - apart apart apartment apart - apartments apart ape ap - apemantus apemantu apennines apennin - apes ap apiece apiec - apish apish apollinem apollinem - apollo apollo apollodorus apollodoru - apology apolog apoplex apoplex - apoplexy apoplexi apostle apostl - apostles apostl apostrophas apostropha - apoth apoth apothecary apothecari - appal appal appall appal - appalled appal appals appal - apparel apparel apparell apparel - apparelled apparel apparent appar - apparently appar apparition apparit - apparitions apparit appeach appeach - appeal appeal appeals appeal - appear appear appearance appear - appeared appear appeareth appeareth - appearing appear appears appear - appeas appea appease appeas - appeased appeas appelant appel - appele appel appelee appele - appeles appel appelez appelez - appellant appel appellants appel - appelons appelon appendix appendix - apperil apperil appertain appertain - appertaining appertain appertainings appertain - appertains appertain appertinent appertin - appertinents appertin appetite appetit - appetites appetit applaud applaud - applauded applaud applauding applaud - applause applaus applauses applaus - apple appl apples appl - appletart appletart appliance applianc - appliances applianc applications applic - applied appli applies appli - apply appli applying appli - appoint appoint appointed appoint - appointment appoint appointments appoint - appoints appoint apprehend apprehend - apprehended apprehend apprehends apprehend - apprehension apprehens apprehensions apprehens - apprehensive apprehens apprendre apprendr - apprenne apprenn apprenticehood apprenticehood - appris appri approach approach - approachers approach approaches approach - approacheth approacheth approaching approach - approbation approb approof approof - appropriation appropri approv approv - approve approv approved approv - approvers approv approves approv - appurtenance appurten appurtenances appurten - apricocks apricock april april - apron apron aprons apron - apt apt apter apter - aptest aptest aptly aptli - aptness apt aqua aqua - aquilon aquilon aquitaine aquitain - arabia arabia arabian arabian - araise arais arbitrate arbitr - arbitrating arbitr arbitrator arbitr - arbitrement arbitr arbors arbor - arbour arbour arc arc - arch arch archbishop archbishop - archbishopric archbishopr archdeacon archdeacon - arched arch archelaus archelau - archer archer archers archer - archery archeri archibald archibald - archidamus archidamu architect architect - arcu arcu arde ard - arden arden ardent ardent - ardour ardour are ar - argal argal argier argier - argo argo argosies argosi - argosy argosi argu argu - argue argu argued argu - argues argu arguing argu - argument argument arguments argument - argus argu ariachne ariachn - ariadne ariadn ariel ariel - aries ari aright aright - arinado arinado arinies arini - arion arion arise aris - arises aris ariseth ariseth - arising aris aristode aristod - aristotle aristotl arithmetic arithmet - arithmetician arithmetician ark ark - arm arm arma arma - armado armado armadoes armado - armagnac armagnac arme arm - armed arm armenia armenia - armies armi armigero armigero - arming arm armipotent armipot - armor armor armour armour - armourer armour armourers armour - armours armour armoury armouri - arms arm army armi - arn arn aroint aroint - arose aros arouse arous - aroused arous arragon arragon - arraign arraign arraigned arraign - arraigning arraign arraignment arraign - arrant arrant arras arra - array arrai arrearages arrearag - arrest arrest arrested arrest - arrests arrest arriv arriv - arrival arriv arrivance arriv - arrive arriv arrived arriv - arrives arriv arriving arriv - arrogance arrog arrogancy arrog - arrogant arrog arrow arrow - arrows arrow art art - artemidorus artemidoru arteries arteri - arthur arthur article articl - articles articl articulate articul - artificer artific artificial artifici - artillery artilleri artire artir - artist artist artists artist - artless artless artois artoi - arts art artus artu - arviragus arviragu as as - asaph asaph ascanius ascaniu - ascend ascend ascended ascend - ascendeth ascendeth ascends ascend - ascension ascens ascent ascent - ascribe ascrib ascribes ascrib - ash ash asham asham - ashamed asham asher asher - ashes ash ashford ashford - ashore ashor ashouting ashout - ashy ashi asia asia - aside asid ask ask - askance askanc asked ask - asker asker asketh asketh - asking ask asks ask - aslant aslant asleep asleep - asmath asmath asp asp - aspect aspect aspects aspect - aspen aspen aspersion aspers - aspic aspic aspicious aspici - aspics aspic aspir aspir - aspiration aspir aspire aspir - aspiring aspir asquint asquint - ass ass assail assail - assailable assail assailant assail - assailants assail assailed assail - assaileth assaileth assailing assail - assails assail assassination assassin - assault assault assaulted assault - assaults assault assay assai - assaying assai assays assai - assemblance assembl assemble assembl - assembled assembl assemblies assembl - assembly assembl assent assent - asses ass assez assez - assign assign assigned assign - assigns assign assinico assinico - assist assist assistance assist - assistances assist assistant assist - assistants assist assisted assist - assisting assist associate associ - associated associ associates associ - assuage assuag assubjugate assubjug - assum assum assume assum - assumes assum assumption assumpt - assur assur assurance assur - assure assur assured assur - assuredly assuredli assures assur - assyrian assyrian astonish astonish - astonished astonish astraea astraea - astray astrai astrea astrea - astronomer astronom astronomers astronom - astronomical astronom astronomy astronomi - asunder asund at at - atalanta atalanta ate at - ates at athenian athenian - athenians athenian athens athen - athol athol athversary athversari - athwart athwart atlas atla - atomies atomi atomy atomi - atone aton atonement aton - atonements aton atropos atropo - attach attach attached attach - attachment attach attain attain - attainder attaind attains attain - attaint attaint attainted attaint - attainture attaintur attempt attempt - attemptable attempt attempted attempt - attempting attempt attempts attempt - attend attend attendance attend - attendant attend attendants attend - attended attend attendents attend - attendeth attendeth attending attend - attends attend attent attent - attention attent attentive attent - attentivenes attentiven attest attest - attested attest attir attir - attire attir attired attir - attires attir attorney attornei - attorneyed attornei attorneys attornei - attorneyship attorneyship attract attract - attraction attract attractive attract - attracts attract attribute attribut - attributed attribut attributes attribut - attribution attribut attributive attribut - atwain atwain au au - aubrey aubrei auburn auburn - aucun aucun audacious audaci - audaciously audaci audacity audac - audible audibl audience audienc - audis audi audit audit - auditor auditor auditors auditor - auditory auditori audre audr - audrey audrei aufidius aufidiu - aufidiuses aufidius auger auger - aught aught augment augment - augmentation augment augmented augment - augmenting augment augurer augur - augurers augur augures augur - auguring augur augurs augur - augury auguri august august - augustus augustu auld auld - aumerle aumerl aunchient aunchient - aunt aunt aunts aunt - auricular auricular aurora aurora - auspicious auspici aussi aussi - austere auster austerely auster - austereness auster austerity auster - austria austria aut aut - authentic authent author author - authorities author authority author - authorized author authorizing author - authors author autolycus autolycu - autre autr autumn autumn - auvergne auvergn avail avail - avails avail avarice avaric - avaricious avarici avaunt avaunt - ave av aveng aveng - avenge aveng avenged aveng - averring aver avert avert - aves av avez avez - avis avi avoid avoid - avoided avoid avoiding avoid - avoids avoid avoirdupois avoirdupoi - avouch avouch avouched avouch - avouches avouch avouchment avouch - avow avow aw aw - await await awaits await - awak awak awake awak - awaked awak awaken awaken - awakened awaken awakens awaken - awakes awak awaking awak - award award awards award - awasy awasi away awai - awe aw aweary aweari - aweless aweless awful aw - awhile awhil awkward awkward - awl awl awooing awoo - awork awork awry awri - axe ax axle axl - axletree axletre ay ay - aye ay ayez ayez - ayli ayli azur azur - azure azur b b - ba ba baa baa - babbl babbl babble babbl - babbling babbl babe babe - babes babe babies babi - baboon baboon baboons baboon - baby babi babylon babylon - bacare bacar bacchanals bacchan - bacchus bacchu bach bach - bachelor bachelor bachelors bachelor - back back backbite backbit - backbitten backbitten backing back - backs back backward backward - backwardly backwardli backwards backward - bacon bacon bacons bacon - bad bad bade bade - badge badg badged badg - badges badg badly badli - badness bad baes bae - baffl baffl baffle baffl - baffled baffl bag bag - baggage baggag bagot bagot - bagpipe bagpip bags bag - bail bail bailiff bailiff - baillez baillez baily baili - baisant baisant baisees baise - baiser baiser bait bait - baited bait baiting bait - baitings bait baits bait - bajazet bajazet bak bak - bake bake baked bake - baker baker bakers baker - bakes bake baking bake - bal bal balanc balanc - balance balanc balcony balconi - bald bald baldrick baldrick - bale bale baleful bale - balk balk ball ball - ballad ballad ballads ballad - ballast ballast ballasting ballast - ballet ballet ballow ballow - balls ball balm balm - balms balm balmy balmi - balsam balsam balsamum balsamum - balth balth balthasar balthasar - balthazar balthazar bames bame - ban ban banbury banburi - band band bandied bandi - banding band bandit bandit - banditti banditti banditto banditto - bands band bandy bandi - bandying bandi bane bane - banes bane bang bang - bangor bangor banish banish - banished banish banishers banish - banishment banish banister banist - bank bank bankrout bankrout - bankrupt bankrupt bankrupts bankrupt - banks bank banner banner - bannerets banneret banners banner - banning ban banns bann - banquet banquet banqueted banquet - banqueting banquet banquets banquet - banquo banquo bans ban - baptism baptism baptista baptista - baptiz baptiz bar bar - barbarian barbarian barbarians barbarian - barbarism barbar barbarous barbar - barbary barbari barbason barbason - barbed barb barber barber - barbermonger barbermong bard bard - bardolph bardolph bards bard - bare bare bared bare - barefac barefac barefaced barefac - barefoot barefoot bareheaded barehead - barely bare bareness bare - barful bar bargain bargain - bargains bargain barge barg - bargulus bargulu baring bare - bark bark barking bark - barkloughly barkloughli barks bark - barky barki barley barlei - barm barm barn barn - barnacles barnacl barnardine barnardin - barne barn barnes barn - barnet barnet barns barn - baron baron barons baron - barony baroni barr barr - barrabas barraba barrel barrel - barrels barrel barren barren - barrenly barrenli barrenness barren - barricado barricado barricadoes barricado - barrow barrow bars bar - barson barson barter barter - bartholomew bartholomew bas ba - basan basan base base - baseless baseless basely base - baseness base baser baser - bases base basest basest - bashful bash bashfulness bash - basilisco basilisco basilisk basilisk - basilisks basilisk basimecu basimecu - basin basin basingstoke basingstok - basins basin basis basi - bask bask basket basket - baskets basket bass bass - bassanio bassanio basset basset - bassianus bassianu basta basta - bastard bastard bastardizing bastard - bastardly bastardli bastards bastard - bastardy bastardi basted bast - bastes bast bastinado bastinado - basting bast bat bat - batailles batail batch batch - bate bate bated bate - bates bate bath bath - bathe bath bathed bath - bathing bath baths bath - bating bate batler batler - bats bat batt batt - battalia battalia battalions battalion - batten batten batter batter - battering batter batters batter - battery batteri battle battl - battled battl battlefield battlefield - battlements battlement battles battl - batty batti bauble baubl - baubles baubl baubling baubl - baulk baulk bavin bavin - bawcock bawcock bawd bawd - bawdry bawdri bawds bawd - bawdy bawdi bawl bawl - bawling bawl bay bai - baying bai baynard baynard - bayonne bayonn bays bai - be be beach beach - beached beach beachy beachi - beacon beacon bead bead - beaded bead beadle beadl - beadles beadl beads bead - beadsmen beadsmen beagle beagl - beagles beagl beak beak - beaks beak beam beam - beamed beam beams beam - bean bean beans bean - bear bear beard beard - bearded beard beardless beardless - beards beard bearer bearer - bearers bearer bearest bearest - beareth beareth bearing bear - bears bear beast beast - beastliest beastliest beastliness beastli - beastly beastli beasts beast - beat beat beated beat - beaten beaten beating beat - beatrice beatric beats beat - beau beau beaufort beaufort - beaumond beaumond beaumont beaumont - beauteous beauteou beautied beauti - beauties beauti beautified beautifi - beautiful beauti beautify beautifi - beauty beauti beaver beaver - beavers beaver became becam - because becaus bechanc bechanc - bechance bechanc bechanced bechanc - beck beck beckon beckon - beckons beckon becks beck - becom becom become becom - becomed becom becomes becom - becoming becom becomings becom - bed bed bedabbled bedabbl - bedash bedash bedaub bedaub - bedazzled bedazzl bedchamber bedchamb - bedclothes bedcloth bedded bed - bedeck bedeck bedecking bedeck - bedew bedew bedfellow bedfellow - bedfellows bedfellow bedford bedford - bedlam bedlam bedrench bedrench - bedrid bedrid beds bed - bedtime bedtim bedward bedward - bee bee beef beef - beefs beef beehives beehiv - been been beer beer - bees bee beest beest - beetle beetl beetles beetl - beeves beev befall befal - befallen befallen befalls befal - befell befel befits befit - befitted befit befitting befit - befor befor before befor - beforehand beforehand befortune befortun - befriend befriend befriended befriend - befriends befriend beg beg - began began beget beget - begets beget begetting beget - begg begg beggar beggar - beggared beggar beggarly beggarli - beggarman beggarman beggars beggar - beggary beggari begging beg - begin begin beginners beginn - beginning begin beginnings begin - begins begin begnawn begnawn - begone begon begot begot - begotten begotten begrimed begrim - begs beg beguil beguil - beguile beguil beguiled beguil - beguiles beguil beguiling beguil - begun begun behalf behalf - behalfs behalf behav behav - behaved behav behavedst behavedst - behavior behavior behaviors behavior - behaviour behaviour behaviours behaviour - behead behead beheaded behead - beheld beheld behest behest - behests behest behind behind - behold behold beholder behold - beholders behold beholdest beholdest - beholding behold beholds behold - behoof behoof behooffull behoofful - behooves behoov behove behov - behoves behov behowls behowl - being be bel bel - belarius belariu belch belch - belching belch beldam beldam - beldame beldam beldams beldam - belee bele belgia belgia - belie beli belied beli - belief belief beliest beliest - believ believ believe believ - believed believ believes believ - believest believest believing believ - belike belik bell bell - bellario bellario belle bell - bellied belli bellies belli - bellman bellman bellona bellona - bellow bellow bellowed bellow - bellowing bellow bellows bellow - bells bell belly belli - bellyful belly belman belman - belmont belmont belock belock - belong belong belonging belong - belongings belong belongs belong - belov belov beloved belov - beloving belov below below - belt belt belzebub belzebub - bemadding bemad bemet bemet - bemete bemet bemoan bemoan - bemoaned bemoan bemock bemock - bemoil bemoil bemonster bemonst - ben ben bench bench - bencher bencher benches bench - bend bend bended bend - bending bend bends bend - bene bene beneath beneath - benedicite benedicit benedick benedick - benediction benedict benedictus benedictu - benefactors benefactor benefice benefic - beneficial benefici benefit benefit - benefited benefit benefits benefit - benetted benet benevolence benevol - benevolences benevol benied beni - benison benison bennet bennet - bent bent bentii bentii - bentivolii bentivolii bents bent - benumbed benumb benvolio benvolio - bepaint bepaint bepray beprai - bequeath bequeath bequeathed bequeath - bequeathing bequeath bequest bequest - ber ber berard berard - berattle berattl beray berai - bere bere bereave bereav - bereaved bereav bereaves bereav - bereft bereft bergamo bergamo - bergomask bergomask berhym berhym - berhyme berhym berkeley berkelei - bermoothes bermooth bernardo bernardo - berod berod berowne berown - berri berri berries berri - berrord berrord berry berri - bertram bertram berwick berwick - bescreen bescreen beseech beseech - beseeched beseech beseechers beseech - beseeching beseech beseek beseek - beseem beseem beseemeth beseemeth - beseeming beseem beseems beseem - beset beset beshrew beshrew - beside besid besides besid - besieg besieg besiege besieg - besieged besieg beslubber beslubb - besmear besmear besmeared besmear - besmirch besmirch besom besom - besort besort besotted besot - bespake bespak bespeak bespeak - bespice bespic bespoke bespok - bespotted bespot bess bess - bessy bessi best best - bestained bestain bested best - bestial bestial bestir bestir - bestirr bestirr bestow bestow - bestowed bestow bestowing bestow - bestows bestow bestraught bestraught - bestrew bestrew bestrid bestrid - bestride bestrid bestrides bestrid - bet bet betake betak - beteem beteem bethink bethink - bethought bethought bethrothed bethroth - bethump bethump betid betid - betide betid betideth betideth - betime betim betimes betim - betoken betoken betook betook - betossed betoss betray betrai - betrayed betrai betraying betrai - betrays betrai betrims betrim - betroth betroth betrothed betroth - betroths betroth bett bett - betted bet better better - bettered better bettering better - betters better betting bet - bettre bettr between between - betwixt betwixt bevel bevel - beverage beverag bevis bevi - bevy bevi bewail bewail - bewailed bewail bewailing bewail - bewails bewail beware bewar - bewasted bewast beweep beweep - bewept bewept bewet bewet - bewhored bewhor bewitch bewitch - bewitched bewitch bewitchment bewitch - bewray bewrai beyond beyond - bezonian bezonian bezonians bezonian - bianca bianca bianco bianco - bias bia bibble bibbl - bickerings bicker bid bid - bidden bidden bidding bid - biddings bid biddy biddi - bide bide bides bide - biding bide bids bid - bien bien bier bier - bifold bifold big big - bigamy bigami biggen biggen - bigger bigger bigness big - bigot bigot bilberry bilberri - bilbo bilbo bilboes bilbo - bilbow bilbow bill bill - billeted billet billets billet - billiards billiard billing bill - billow billow billows billow - bills bill bin bin - bind bind bindeth bindeth - binding bind binds bind - biondello biondello birch birch - bird bird birding bird - birdlime birdlim birds bird - birnam birnam birth birth - birthday birthdai birthdom birthdom - birthplace birthplac birthright birthright - birthrights birthright births birth - bis bi biscuit biscuit - bishop bishop bishops bishop - bisson bisson bit bit - bitch bitch bite bite - biter biter bites bite - biting bite bits bit - bitt bitt bitten bitten - bitter bitter bitterest bitterest - bitterly bitterli bitterness bitter - blab blab blabb blabb - blabbing blab blabs blab - black black blackamoor blackamoor - blackamoors blackamoor blackberries blackberri - blackberry blackberri blacker blacker - blackest blackest blackfriars blackfriar - blackheath blackheath blackmere blackmer - blackness black blacks black - bladder bladder bladders bladder - blade blade bladed blade - blades blade blains blain - blam blam blame blame - blamed blame blameful blame - blameless blameless blames blame - blanc blanc blanca blanca - blanch blanch blank blank - blanket blanket blanks blank - blaspheme blasphem blaspheming blasphem - blasphemous blasphem blasphemy blasphemi - blast blast blasted blast - blasting blast blastments blastment - blasts blast blaz blaz - blaze blaze blazes blaze - blazing blaze blazon blazon - blazoned blazon blazoning blazon - bleach bleach bleaching bleach - bleak bleak blear blear - bleared blear bleat bleat - bleated bleat bleats bleat - bled bled bleed bleed - bleedest bleedest bleedeth bleedeth - bleeding bleed bleeds bleed - blemish blemish blemishes blemish - blench blench blenches blench - blend blend blended blend - blent blent bless bless - blessed bless blessedly blessedli - blessedness blessed blesses bless - blesseth blesseth blessing bless - blessings bless blest blest - blew blew blind blind - blinded blind blindfold blindfold - blinding blind blindly blindli - blindness blind blinds blind - blink blink blinking blink - bliss bliss blist blist - blister blister blisters blister - blithe blith blithild blithild - bloat bloat block block - blockish blockish blocks block - blois bloi blood blood - blooded blood bloodhound bloodhound - bloodied bloodi bloodier bloodier - bloodiest bloodiest bloodily bloodili - bloodless bloodless bloods blood - bloodshed bloodsh bloodshedding bloodshed - bloodstained bloodstain bloody bloodi - bloom bloom blooms bloom - blossom blossom blossoming blossom - blossoms blossom blot blot - blots blot blotted blot - blotting blot blount blount - blow blow blowed blow - blowers blower blowest blowest - blowing blow blown blown - blows blow blowse blows - blubb blubb blubber blubber - blubbering blubber blue blue - bluecaps bluecap bluest bluest - blunt blunt blunted blunt - blunter blunter bluntest bluntest - blunting blunt bluntly bluntli - bluntness blunt blunts blunt - blur blur blurr blurr - blurs blur blush blush - blushes blush blushest blushest - blushing blush blust blust - bluster bluster blusterer bluster - blusters bluster bo bo - boar boar board board - boarded board boarding board - boards board boarish boarish - boars boar boast boast - boasted boast boastful boast - boasting boast boasts boast - boat boat boats boat - boatswain boatswain bob bob - bobb bobb boblibindo boblibindo - bobtail bobtail bocchus bocchu - bode bode boded bode - bodements bodement bodes bode - bodg bodg bodied bodi - bodies bodi bodiless bodiless - bodily bodili boding bode - bodkin bodkin body bodi - bodykins bodykin bog bog - boggle boggl boggler boggler - bogs bog bohemia bohemia - bohemian bohemian bohun bohun - boil boil boiling boil - boils boil boist boist - boisterous boister boisterously boister - boitier boitier bold bold - bolden bolden bolder bolder - boldest boldest boldly boldli - boldness bold bolds bold - bolingbroke bolingbrok bolster bolster - bolt bolt bolted bolt - bolter bolter bolters bolter - bolting bolt bolts bolt - bombard bombard bombards bombard - bombast bombast bon bon - bona bona bond bond - bondage bondag bonded bond - bondmaid bondmaid bondman bondman - bondmen bondmen bonds bond - bondslave bondslav bone bone - boneless boneless bones bone - bonfire bonfir bonfires bonfir - bonjour bonjour bonne bonn - bonnet bonnet bonneted bonnet - bonny bonni bonos bono - bonto bonto bonville bonvil - bood bood book book - bookish bookish books book - boon boon boor boor - boorish boorish boors boor - boot boot booted boot - booties booti bootless bootless - boots boot booty booti - bor bor bora bora - borachio borachio bordeaux bordeaux - border border bordered border - borderers border borders border - bore bore boreas borea - bores bore boring bore - born born borne born - borough borough boroughs borough - borrow borrow borrowed borrow - borrower borrow borrowing borrow - borrows borrow bosko bosko - boskos bosko bosky boski - bosom bosom bosoms bosom - boson boson boss boss - bosworth bosworth botch botch - botcher botcher botches botch - botchy botchi both both - bots bot bottle bottl - bottled bottl bottles bottl - bottom bottom bottomless bottomless - bottoms bottom bouciqualt bouciqualt - bouge boug bough bough - boughs bough bought bought - bounce bounc bouncing bounc - bound bound bounded bound - bounden bounden boundeth boundeth - bounding bound boundless boundless - bounds bound bounteous bounteou - bounteously bounteous bounties bounti - bountiful bounti bountifully bountifulli - bounty bounti bourbier bourbier - bourbon bourbon bourchier bourchier - bourdeaux bourdeaux bourn bourn - bout bout bouts bout - bove bove bow bow - bowcase bowcas bowed bow - bowels bowel bower bower - bowing bow bowl bowl - bowler bowler bowling bowl - bowls bowl bows bow - bowsprit bowsprit bowstring bowstr - box box boxes box - boy boi boyet boyet - boyish boyish boys boi - brabant brabant brabantio brabantio - brabble brabbl brabbler brabbler - brac brac brace brace - bracelet bracelet bracelets bracelet - brach brach bracy braci - brag brag bragg bragg - braggardism braggard braggards braggard - braggart braggart braggarts braggart - bragged brag bragging brag - bragless bragless brags brag - braid braid braided braid - brain brain brained brain - brainford brainford brainish brainish - brainless brainless brains brain - brainsick brainsick brainsickly brainsickli - brake brake brakenbury brakenburi - brakes brake brambles brambl - bran bran branch branch - branches branch branchless branchless - brand brand branded brand - brandish brandish brandon brandon - brands brand bras bra - brass brass brassy brassi - brat brat brats brat - brav brav brave brave - braved brave bravely brave - braver braver bravery braveri - braves brave bravest bravest - braving brave brawl brawl - brawler brawler brawling brawl - brawls brawl brawn brawn - brawns brawn bray brai - braying brai braz braz - brazen brazen brazier brazier - breach breach breaches breach - bread bread breadth breadth - break break breaker breaker - breakfast breakfast breaking break - breaks break breast breast - breasted breast breasting breast - breastplate breastplat breasts breast - breath breath breathe breath - breathed breath breather breather - breathers breather breathes breath - breathest breathest breathing breath - breathless breathless breaths breath - brecknock brecknock bred bred - breech breech breeches breech - breeching breech breed breed - breeder breeder breeders breeder - breeding breed breeds breed - breese brees breeze breez - breff breff bretagne bretagn - brethen brethen bretheren bretheren - brethren brethren brevis brevi - brevity breviti brew brew - brewage brewag brewer brewer - brewers brewer brewing brew - brews brew briareus briareu - briars briar brib brib - bribe bribe briber briber - bribes bribe brick brick - bricklayer bricklay bricks brick - bridal bridal bride bride - bridegroom bridegroom bridegrooms bridegroom - brides bride bridge bridg - bridgenorth bridgenorth bridges bridg - bridget bridget bridle bridl - bridled bridl brief brief - briefer briefer briefest briefest - briefly briefli briefness brief - brier brier briers brier - brigandine brigandin bright bright - brighten brighten brightest brightest - brightly brightli brightness bright - brim brim brimful brim - brims brim brimstone brimston - brinded brind brine brine - bring bring bringer bringer - bringeth bringeth bringing bring - bringings bring brings bring - brinish brinish brink brink - brisk brisk brisky briski - bristle bristl bristled bristl - bristly bristli bristol bristol - bristow bristow britain britain - britaine britain britaines britain - british british briton briton - britons briton brittany brittani - brittle brittl broach broach - broached broach broad broad - broader broader broadsides broadsid - brocas broca brock brock - brogues brogu broil broil - broiling broil broils broil - broke broke broken broken - brokenly brokenli broker broker - brokers broker brokes broke - broking broke brooch brooch - brooches brooch brood brood - brooded brood brooding brood - brook brook brooks brook - broom broom broomstaff broomstaff - broth broth brothel brothel - brother brother brotherhood brotherhood - brotherhoods brotherhood brotherly brotherli - brothers brother broths broth - brought brought brow brow - brown brown browner browner - brownist brownist browny browni - brows brow browse brows - browsing brows bruis brui - bruise bruis bruised bruis - bruises bruis bruising bruis - bruit bruit bruited bruit - brundusium brundusium brunt brunt - brush brush brushes brush - brute brute brutish brutish - brutus brutu bubble bubbl - bubbles bubbl bubbling bubbl - bubukles bubukl buck buck - bucket bucket buckets bucket - bucking buck buckingham buckingham - buckle buckl buckled buckl - buckler buckler bucklers buckler - bucklersbury bucklersburi buckles buckl - buckram buckram bucks buck - bud bud budded bud - budding bud budge budg - budger budger budget budget - buds bud buff buff - buffet buffet buffeting buffet - buffets buffet bug bug - bugbear bugbear bugle bugl - bugs bug build build - builded build buildeth buildeth - building build buildings build - builds build built built - bulk bulk bulks bulk - bull bull bullcalf bullcalf - bullen bullen bullens bullen - bullet bullet bullets bullet - bullocks bullock bulls bull - bully bulli bulmer bulmer - bulwark bulwark bulwarks bulwark - bum bum bumbast bumbast - bump bump bumper bumper - bums bum bunch bunch - bunches bunch bundle bundl - bung bung bunghole bunghol - bungle bungl bunting bunt - buoy buoi bur bur - burbolt burbolt burd burd - burden burden burdened burden - burdening burden burdenous burden - burdens burden burgh burgh - burgher burgher burghers burgher - burglary burglari burgomasters burgomast - burgonet burgonet burgundy burgundi - burial burial buried buri - burier burier buriest buriest - burly burli burn burn - burned burn burnet burnet - burneth burneth burning burn - burnish burnish burns burn - burnt burnt burr burr - burrows burrow burs bur - burst burst bursting burst - bursts burst burthen burthen - burthens burthen burton burton - bury buri burying buri - bush bush bushels bushel - bushes bush bushy bushi - busied busi busily busili - busines busin business busi - businesses busi buskin buskin - busky buski buss buss - busses buss bussing buss - bustle bustl bustling bustl - busy busi but but - butcheed butche butcher butcher - butchered butcher butcheries butcheri - butcherly butcherli butchers butcher - butchery butcheri butler butler - butt butt butter butter - buttered butter butterflies butterfli - butterfly butterfli butterwoman butterwoman - buttery butteri buttock buttock - buttocks buttock button button - buttonhole buttonhol buttons button - buttress buttress buttry buttri - butts butt buxom buxom - buy bui buyer buyer - buying bui buys bui - buzz buzz buzzard buzzard - buzzards buzzard buzzers buzzer - buzzing buzz by by - bye bye byzantium byzantium - c c ca ca - cabbage cabbag cabileros cabilero - cabin cabin cabins cabin - cable cabl cables cabl - cackling cackl cacodemon cacodemon - caddis caddi caddisses caddiss - cade cade cadence cadenc - cadent cadent cades cade - cadmus cadmu caduceus caduceu - cadwal cadwal cadwallader cadwallad - caelius caeliu caelo caelo - caesar caesar caesarion caesarion - caesars caesar cage cage - caged cage cagion cagion - cain cain caithness caith - caitiff caitiff caitiffs caitiff - caius caiu cak cak - cake cake cakes cake - calaber calab calais calai - calamities calam calamity calam - calchas calcha calculate calcul - calen calen calendar calendar - calendars calendar calf calf - caliban caliban calibans caliban - calipolis calipoli cality caliti - caliver caliv call call - callat callat called call - callet callet calling call - calls call calm calm - calmest calmest calmly calmli - calmness calm calms calm - calpurnia calpurnia calumniate calumni - calumniating calumni calumnious calumni - calumny calumni calve calv - calved calv calves calv - calveskins calveskin calydon calydon - cam cam cambio cambio - cambria cambria cambric cambric - cambrics cambric cambridge cambridg - cambyses cambys came came - camel camel camelot camelot - camels camel camest camest - camillo camillo camlet camlet - camomile camomil camp camp - campeius campeiu camping camp - camps camp can can - canakin canakin canaries canari - canary canari cancel cancel - cancell cancel cancelled cancel - cancelling cancel cancels cancel - cancer cancer candidatus candidatu - candied candi candle candl - candles candl candlesticks candlestick - candy candi canidius canidiu - cank cank canker canker - cankerblossom cankerblossom cankers canker - cannibally cannib cannibals cannib - cannon cannon cannoneer cannon - cannons cannon cannot cannot - canon canon canoniz canoniz - canonize canon canonized canon - canons canon canopied canopi - canopies canopi canopy canopi - canst canst canstick canstick - canterbury canterburi cantle cantl - cantons canton canus canu - canvas canva canvass canvass - canzonet canzonet cap cap - capability capabl capable capabl - capacities capac capacity capac - caparison caparison capdv capdv - cape cape capel capel - capels capel caper caper - capers caper capet capet - caphis caphi capilet capilet - capitaine capitain capital capit - capite capit capitol capitol - capitulate capitul capocchia capocchia - capon capon capons capon - capp capp cappadocia cappadocia - capriccio capriccio capricious caprici - caps cap capt capt - captain captain captains captain - captainship captainship captious captiou - captivate captiv captivated captiv - captivates captiv captive captiv - captives captiv captivity captiv - captum captum capucius capuciu - capulet capulet capulets capulet - car car carack carack - caracks carack carat carat - caraways carawai carbonado carbonado - carbuncle carbuncl carbuncled carbuncl - carbuncles carbuncl carcanet carcanet - carcase carcas carcases carcas - carcass carcass carcasses carcass - card card cardecue cardecu - carded card carders carder - cardinal cardin cardinally cardin - cardinals cardin cardmaker cardmak - cards card carduus carduu - care care cared care - career career careers career - careful care carefully carefulli - careless careless carelessly carelessli - carelessness careless cares care - caret caret cargo cargo - carl carl carlisle carlisl - carlot carlot carman carman - carmen carmen carnal carnal - carnally carnal carnarvonshire carnarvonshir - carnation carnat carnations carnat - carol carol carous carou - carouse carous caroused carous - carouses carous carousing carous - carp carp carpenter carpent - carper carper carpet carpet - carpets carpet carping carp - carriage carriag carriages carriag - carried carri carrier carrier - carriers carrier carries carri - carrion carrion carrions carrion - carry carri carrying carri - cars car cart cart - carters carter carthage carthag - carts cart carv carv - carve carv carved carv - carver carver carves carv - carving carv cas ca - casa casa casaer casaer - casca casca case case - casement casement casements casement - cases case cash cash - cashier cashier casing case - cask cask casket casket - casketed casket caskets casket - casque casqu casques casqu - cassado cassado cassandra cassandra - cassibelan cassibelan cassio cassio - cassius cassiu cassocks cassock - cast cast castalion castalion - castaway castawai castaways castawai - casted cast caster caster - castigate castig castigation castig - castile castil castiliano castiliano - casting cast castle castl - castles castl casts cast - casual casual casually casual - casualties casualti casualty casualti - cat cat cataian cataian - catalogue catalogu cataplasm cataplasm - cataracts cataract catarrhs catarrh - catastrophe catastroph catch catch - catcher catcher catches catch - catching catch cate cate - catechising catechis catechism catech - catechize catech cater cater - caterpillars caterpillar caters cater - caterwauling caterwaul cates cate - catesby catesbi cathedral cathedr - catlike catlik catling catl - catlings catl cato cato - cats cat cattle cattl - caucasus caucasu caudle caudl - cauf cauf caught caught - cauldron cauldron caus cau - cause caus caused caus - causeless causeless causer causer - causes caus causest causest - causeth causeth cautel cautel - cautelous cautel cautels cautel - cauterizing cauter caution caution - cautions caution cavaleiro cavaleiro - cavalery cavaleri cavaliers cavali - cave cave cavern cavern - caverns cavern caves cave - caveto caveto caviary caviari - cavil cavil cavilling cavil - cawdor cawdor cawdron cawdron - cawing caw ce ce - ceas cea cease ceas - ceases ceas ceaseth ceaseth - cedar cedar cedars cedar - cedius cediu celebrate celebr - celebrated celebr celebrates celebr - celebration celebr celerity celer - celestial celesti celia celia - cell cell cellar cellar - cellarage cellarag celsa celsa - cement cement censer censer - censor censor censorinus censorinu - censur censur censure censur - censured censur censurers censur - censures censur censuring censur - centaur centaur centaurs centaur - centre centr cents cent - centuries centuri centurion centurion - centurions centurion century centuri - cerberus cerberu cerecloth cerecloth - cerements cerement ceremonial ceremoni - ceremonies ceremoni ceremonious ceremoni - ceremoniously ceremoni ceremony ceremoni - ceres cere cerns cern - certain certain certainer certain - certainly certainli certainties certainti - certainty certainti certes cert - certificate certif certified certifi - certifies certifi certify certifi - ces ce cesario cesario - cess cess cesse cess - cestern cestern cetera cetera - cette cett chaces chace - chaf chaf chafe chafe - chafed chafe chafes chafe - chaff chaff chaffless chaffless - chafing chafe chain chain - chains chain chair chair - chairs chair chalic chalic - chalice chalic chalices chalic - chalk chalk chalks chalk - chalky chalki challeng challeng - challenge challeng challenged challeng - challenger challeng challengers challeng - challenges challeng cham cham - chamber chamber chamberers chamber - chamberlain chamberlain chamberlains chamberlain - chambermaid chambermaid chambermaids chambermaid - chambers chamber chameleon chameleon - champ champ champagne champagn - champain champain champains champain - champion champion champions champion - chanc chanc chance chanc - chanced chanc chancellor chancellor - chances chanc chandler chandler - chang chang change chang - changeable changeabl changed chang - changeful chang changeling changel - changelings changel changer changer - changes chang changest changest - changing chang channel channel - channels channel chanson chanson - chant chant chanticleer chanticl - chanting chant chantries chantri - chantry chantri chants chant - chaos chao chap chap - chape chape chapel chapel - chapeless chapeless chapels chapel - chaplain chaplain chaplains chaplain - chapless chapless chaplet chaplet - chapmen chapmen chaps chap - chapter chapter character charact - charactered charact characterless characterless - characters charact charactery characteri - characts charact charbon charbon - chare chare chares chare - charg charg charge charg - charged charg chargeful charg - charges charg chargeth chargeth - charging charg chariest chariest - chariness chari charing chare - chariot chariot chariots chariot - charitable charit charitably charit - charities chariti charity chariti - charlemain charlemain charles charl - charm charm charmed charm - charmer charmer charmeth charmeth - charmian charmian charming charm - charmingly charmingli charms charm - charneco charneco charnel charnel - charolois charoloi charon charon - charter charter charters charter - chartreux chartreux chary chari - charybdis charybdi chas cha - chase chase chased chase - chaser chaser chaseth chaseth - chasing chase chaste chast - chastely chast chastis chasti - chastise chastis chastised chastis - chastisement chastis chastity chastiti - chat chat chatham chatham - chatillon chatillon chats chat - chatt chatt chattels chattel - chatter chatter chattering chatter - chattles chattl chaud chaud - chaunted chaunt chaw chaw - chawdron chawdron che che - cheap cheap cheapen cheapen - cheaper cheaper cheapest cheapest - cheaply cheapli cheapside cheapsid - cheat cheat cheated cheat - cheater cheater cheaters cheater - cheating cheat cheats cheat - check check checked check - checker checker checking check - checks check cheek cheek - cheeks cheek cheer cheer - cheered cheer cheerer cheerer - cheerful cheer cheerfully cheerfulli - cheering cheer cheerless cheerless - cheerly cheerli cheers cheer - cheese chees chequer chequer - cher cher cherish cherish - cherished cherish cherisher cherish - cherishes cherish cherishing cherish - cherries cherri cherry cherri - cherrypit cherrypit chertsey chertsei - cherub cherub cherubims cherubim - cherubin cherubin cherubins cherubin - cheshu cheshu chess chess - chest chest chester chester - chestnut chestnut chestnuts chestnut - chests chest chetas cheta - chev chev cheval cheval - chevalier chevali chevaliers chevali - cheveril cheveril chew chew - chewed chew chewet chewet - chewing chew chez chez - chi chi chick chick - chicken chicken chickens chicken - chicurmurco chicurmurco chid chid - chidden chidden chide chide - chiders chider chides chide - chiding chide chief chief - chiefest chiefest chiefly chiefli - chien chien child child - childed child childeric childer - childhood childhood childhoods childhood - childing child childish childish - childishness childish childlike childlik - childness child children children - chill chill chilling chill - chime chime chimes chime - chimney chimnei chimneypiece chimneypiec - chimneys chimnei chimurcho chimurcho - chin chin china china - chine chine chines chine - chink chink chinks chink - chins chin chipp chipp - chipper chipper chips chip - chiron chiron chirping chirp - chirrah chirrah chirurgeonly chirurgeonli - chisel chisel chitopher chitoph - chivalrous chivalr chivalry chivalri - choice choic choicely choic - choicest choicest choir choir - choirs choir chok chok - choke choke choked choke - chokes choke choking choke - choler choler choleric choler - cholers choler chollors chollor - choose choos chooser chooser - chooses choos chooseth chooseth - choosing choos chop chop - chopine chopin choplogic choplog - chopp chopp chopped chop - chopping chop choppy choppi - chops chop chopt chopt - chor chor choristers chorist - chorus choru chose chose - chosen chosen chough chough - choughs chough chrish chrish - christ christ christen christen - christendom christendom christendoms christendom - christening christen christenings christen - christian christian christianlike christianlik - christians christian christmas christma - christom christom christopher christoph - christophero christophero chronicle chronicl - chronicled chronicl chronicler chronicl - chroniclers chronicl chronicles chronicl - chrysolite chrysolit chuck chuck - chucks chuck chud chud - chuffs chuff church church - churches church churchman churchman - churchmen churchmen churchyard churchyard - churchyards churchyard churl churl - churlish churlish churlishly churlishli - churls churl churn churn - chus chu cicatrice cicatric - cicatrices cicatric cicely cice - cicero cicero ciceter cicet - ciel ciel ciitzens ciitzen - cilicia cilicia cimber cimber - cimmerian cimmerian cinable cinabl - cincture cinctur cinders cinder - cine cine cinna cinna - cinque cinqu cipher cipher - ciphers cipher circa circa - circe circ circle circl - circled circl circlets circlet - circling circl circuit circuit - circum circum circumcised circumcis - circumference circumfer circummur circummur - circumscrib circumscrib circumscribed circumscrib - circumscription circumscript circumspect circumspect - circumstance circumst circumstanced circumstanc - circumstances circumst circumstantial circumstanti - circumvent circumv circumvention circumvent - cistern cistern citadel citadel - cital cital cite cite - cited cite cites cite - cities citi citing cite - citizen citizen citizens citizen - cittern cittern city citi - civet civet civil civil - civility civil civilly civilli - clack clack clad clad - claim claim claiming claim - claims claim clamb clamb - clamber clamber clammer clammer - clamor clamor clamorous clamor - clamors clamor clamour clamour - clamours clamour clang clang - clangor clangor clap clap - clapp clapp clapped clap - clapper clapper clapping clap - claps clap clare clare - clarence clarenc claret claret - claribel claribel clasp clasp - clasps clasp clatter clatter - claud claud claudio claudio - claudius claudiu clause claus - claw claw clawed claw - clawing claw claws claw - clay clai clays clai - clean clean cleanliest cleanliest - cleanly cleanli cleans clean - cleanse cleans cleansing cleans - clear clear clearer clearer - clearest clearest clearly clearli - clearness clear clears clear - cleave cleav cleaving cleav - clef clef cleft cleft - cleitus cleitu clemency clemenc - clement clement cleomenes cleomen - cleopatpa cleopatpa cleopatra cleopatra - clepeth clepeth clept clept - clerestories clerestori clergy clergi - clergyman clergyman clergymen clergymen - clerk clerk clerkly clerkli - clerks clerk clew clew - client client clients client - cliff cliff clifford clifford - cliffords clifford cliffs cliff - clifton clifton climate climat - climature climatur climb climb - climbed climb climber climber - climbeth climbeth climbing climb - climbs climb clime clime - cling cling clink clink - clinking clink clinquant clinquant - clip clip clipp clipp - clipper clipper clippeth clippeth - clipping clip clipt clipt - clitus clitu clo clo - cloak cloak cloakbag cloakbag - cloaks cloak clock clock - clocks clock clod clod - cloddy cloddi clodpole clodpol - clog clog clogging clog - clogs clog cloister cloister - cloistress cloistress cloquence cloquenc - clos clo close close - closed close closely close - closeness close closer closer - closes close closest closest - closet closet closing close - closure closur cloten cloten - clotens cloten cloth cloth - clothair clothair clotharius clothariu - clothe cloth clothes cloth - clothier clothier clothiers clothier - clothing cloth cloths cloth - clotpoles clotpol clotpoll clotpol - cloud cloud clouded cloud - cloudiness cloudi clouds cloud - cloudy cloudi clout clout - clouted clout clouts clout - cloven cloven clover clover - cloves clove clovest clovest - clowder clowder clown clown - clownish clownish clowns clown - cloy cloi cloyed cloi - cloying cloi cloyless cloyless - cloyment cloyment cloys cloi - club club clubs club - cluck cluck clung clung - clust clust clusters cluster - clutch clutch clyster clyster - cneius cneiu cnemies cnemi - co co coach coach - coaches coach coachmakers coachmak - coact coact coactive coactiv - coagulate coagul coal coal - coals coal coarse coars - coarsely coars coast coast - coasting coast coasts coast - coat coat coated coat - coats coat cobble cobbl - cobbled cobbl cobbler cobbler - cobham cobham cobloaf cobloaf - cobweb cobweb cobwebs cobweb - cock cock cockatrice cockatric - cockatrices cockatric cockle cockl - cockled cockl cockney cocknei - cockpit cockpit cocks cock - cocksure cocksur coctus coctu - cocytus cocytu cod cod - codding cod codling codl - codpiece codpiec codpieces codpiec - cods cod coelestibus coelestibu - coesar coesar coeur coeur - coffer coffer coffers coffer - coffin coffin coffins coffin - cog cog cogging cog - cogitation cogit cogitations cogit - cognition cognit cognizance cogniz - cogscomb cogscomb cohabitants cohabit - coher coher cohere coher - coherence coher coherent coher - cohorts cohort coif coif - coign coign coil coil - coin coin coinage coinag - coiner coiner coining coin - coins coin col col - colbrand colbrand colchos colcho - cold cold colder colder - coldest coldest coldly coldli - coldness cold coldspur coldspur - colebrook colebrook colic colic - collar collar collars collar - collateral collater colleagued colleagu - collect collect collected collect - collection collect college colleg - colleges colleg collied colli - collier collier colliers collier - collop collop collusion collus - colme colm colmekill colmekil - coloquintida coloquintida color color - colors color colossus colossu - colour colour colourable colour - coloured colour colouring colour - colours colour colt colt - colted colt colts colt - columbine columbin columbines columbin - colville colvil com com - comagene comagen comart comart - comb comb combat combat - combatant combat combatants combat - combated combat combating combat - combin combin combinate combin - combination combin combine combin - combined combin combless combless - combustion combust come come - comedian comedian comedians comedian - comedy comedi comeliness comeli - comely come comer comer - comers comer comes come - comest comest comet comet - cometh cometh comets comet - comfect comfect comfit comfit - comfits comfit comfort comfort - comfortable comfort comforted comfort - comforter comfort comforting comfort - comfortless comfortless comforts comfort - comic comic comical comic - coming come comings come - cominius cominiu comma comma - command command commande command - commanded command commander command - commanders command commanding command - commandment command commandments command - commands command comme comm - commenc commenc commence commenc - commenced commenc commencement commenc - commences commenc commencing commenc - commend commend commendable commend - commendation commend commendations commend - commended commend commending commend - commends commend comment comment - commentaries commentari commenting comment - comments comment commerce commerc - commingled commingl commiseration commiser - commission commiss commissioners commission - commissions commiss commit commit - commits commit committ committ - committed commit committing commit - commix commix commixed commix - commixtion commixt commixture commixtur - commodious commodi commodities commod - commodity commod common common - commonalty commonalti commoner common - commoners common commonly commonli - commons common commonweal commonw - commonwealth commonwealth commotion commot - commotions commot commune commun - communicat communicat communicate commun - communication commun communities commun - community commun comonty comonti - compact compact companies compani - companion companion companions companion - companionship companionship company compani - compar compar comparative compar - compare compar compared compar - comparing compar comparison comparison - comparisons comparison compartner compartn - compass compass compasses compass - compassing compass compassion compass - compassionate compassion compeers compeer - compel compel compell compel - compelled compel compelling compel - compels compel compensation compens - competence compet competency compet - competent compet competitor competitor - competitors competitor compil compil - compile compil compiled compil - complain complain complainer complain - complainest complainest complaining complain - complainings complain complains complain - complaint complaint complaints complaint - complement complement complements complement - complete complet complexion complexion - complexioned complexion complexions complexion - complices complic complies compli - compliment compliment complimental compliment - compliments compliment complot complot - complots complot complotted complot - comply compli compos compo - compose compos composed compos - composition composit compost compost - composture compostur composure composur - compound compound compounded compound - compounds compound comprehend comprehend - comprehended comprehend comprehends comprehend - compremises compremis compris compri - comprising compris compromis compromi - compromise compromis compt compt - comptible comptibl comptrollers comptrol - compulsatory compulsatori compulsion compuls - compulsive compuls compunctious compuncti - computation comput comrade comrad - comrades comrad comutual comutu - con con concave concav - concavities concav conceal conceal - concealed conceal concealing conceal - concealment conceal concealments conceal - conceals conceal conceit conceit - conceited conceit conceitless conceitless - conceits conceit conceiv conceiv - conceive conceiv conceived conceiv - conceives conceiv conceiving conceiv - conception concept conceptions concept - conceptious concepti concern concern - concernancy concern concerneth concerneth - concerning concern concernings concern - concerns concern conclave conclav - conclud conclud conclude conclud - concluded conclud concludes conclud - concluding conclud conclusion conclus - conclusions conclus concolinel concolinel - concord concord concubine concubin - concupiscible concupisc concupy concupi - concur concur concurring concur - concurs concur condemn condemn - condemnation condemn condemned condemn - condemning condemn condemns condemn - condescend condescend condign condign - condition condit conditionally condition - conditions condit condole condol - condolement condol condoling condol - conduce conduc conduct conduct - conducted conduct conducting conduct - conductor conductor conduit conduit - conduits conduit conected conect - coney conei confection confect - confectionary confectionari confections confect - confederacy confederaci confederate confeder - confederates confeder confer confer - conference confer conferr conferr - conferring confer confess confess - confessed confess confesses confess - confesseth confesseth confessing confess - confession confess confessions confess - confessor confessor confidence confid - confident confid confidently confid - confin confin confine confin - confined confin confineless confineless - confiners confin confines confin - confining confin confirm confirm - confirmation confirm confirmations confirm - confirmed confirm confirmer confirm - confirmers confirm confirming confirm - confirmities confirm confirms confirm - confiscate confisc confiscated confisc - confiscation confisc confixed confix - conflict conflict conflicting conflict - conflicts conflict confluence confluenc - conflux conflux conform conform - conformable conform confound confound - confounded confound confounding confound - confounds confound confront confront - confronted confront confus confu - confused confus confusedly confusedli - confusion confus confusions confus - confutation confut confutes confut - congeal congeal congealed congeal - congealment congeal congee conge - conger conger congest congest - congied congi congratulate congratul - congreeing congre congreeted congreet - congregate congreg congregated congreg - congregation congreg congregations congreg - congruent congruent congruing congru - conies coni conjectural conjectur - conjecture conjectur conjectures conjectur - conjoin conjoin conjoined conjoin - conjoins conjoin conjointly conjointli - conjunct conjunct conjunction conjunct - conjunctive conjunct conjur conjur - conjuration conjur conjurations conjur - conjure conjur conjured conjur - conjurer conjur conjurers conjur - conjures conjur conjuring conjur - conjuro conjuro conn conn - connected connect connive conniv - conqu conqu conquer conquer - conquered conquer conquering conquer - conqueror conqueror conquerors conqueror - conquers conquer conquest conquest - conquests conquest conquring conqur - conrade conrad cons con - consanguineous consanguin consanguinity consanguin - conscienc conscienc conscience conscienc - consciences conscienc conscionable conscion - consecrate consecr consecrated consecr - consecrations consecr consent consent - consented consent consenting consent - consents consent consequence consequ - consequences consequ consequently consequ - conserve conserv conserved conserv - conserves conserv consider consid - considerance consider considerate consider - consideration consider considerations consider - considered consid considering consid - considerings consid considers consid - consign consign consigning consign - consist consist consisteth consisteth - consisting consist consistory consistori - consists consist consolate consol - consolation consol consonancy conson - consonant conson consort consort - consorted consort consortest consortest - conspectuities conspectu conspir conspir - conspiracy conspiraci conspirant conspir - conspirator conspir conspirators conspir - conspire conspir conspired conspir - conspirers conspir conspires conspir - conspiring conspir constable constabl - constables constabl constance constanc - constancies constanc constancy constanc - constant constant constantine constantin - constantinople constantinopl constantly constantli - constellation constel constitution constitut - constrain constrain constrained constrain - constraineth constraineth constrains constrain - constraint constraint constring constr - construction construct construe constru - consul consul consuls consul - consulship consulship consulships consulship - consult consult consulting consult - consults consult consum consum - consume consum consumed consum - consumes consum consuming consum - consummate consumm consummation consumm - consumption consumpt consumptions consumpt - contagion contagion contagious contagi - contain contain containing contain - contains contain contaminate contamin - contaminated contamin contemn contemn - contemned contemn contemning contemn - contemns contemn contemplate contempl - contemplation contempl contemplative contempl - contempt contempt contemptible contempt - contempts contempt contemptuous contemptu - contemptuously contemptu contend contend - contended contend contending contend - contendon contendon content content - contenta contenta contented content - contenteth contenteth contention content - contentious contenti contentless contentless - contento contento contents content - contest contest contestation contest - continence contin continency contin - continent contin continents contin - continu continu continual continu - continually continu continuance continu - continuantly continuantli continuate continu - continue continu continued continu - continuer continu continues continu - continuing continu contract contract - contracted contract contracting contract - contraction contract contradict contradict - contradicted contradict contradiction contradict - contradicts contradict contraries contrari - contrarieties contrarieti contrariety contrarieti - contrarious contrari contrariously contrari - contrary contrari contre contr - contribution contribut contributors contributor - contrite contrit contriv contriv - contrive contriv contrived contriv - contriver contriv contrives contriv - contriving contriv control control - controll control controller control - controlling control controlment control - controls control controversy controversi - contumelious contumeli contumeliously contumeli - contumely contum contusions contus - convenience conveni conveniences conveni - conveniency conveni convenient conveni - conveniently conveni convented convent - conventicles conventicl convents convent - convers conver conversant convers - conversation convers conversations convers - converse convers conversed convers - converses convers conversing convers - conversion convers convert convert - converted convert convertest convertest - converting convert convertite convertit - convertites convertit converts convert - convey convei conveyance convey - conveyances convey conveyers convey - conveying convei convict convict - convicted convict convince convinc - convinced convinc convinces convinc - convive conviv convocation convoc - convoy convoi convulsions convuls - cony coni cook cook - cookery cookeri cooks cook - cool cool cooled cool - cooling cool cools cool - coop coop coops coop - cop cop copatain copatain - cope cope cophetua cophetua - copied copi copies copi - copious copiou copper copper - copperspur copperspur coppice coppic - copulation copul copulatives copul - copy copi cor cor - coragio coragio coral coral - coram coram corambus corambu - coranto coranto corantos coranto - corbo corbo cord cord - corded cord cordelia cordelia - cordial cordial cordis cordi - cords cord core core - corin corin corinth corinth - corinthian corinthian coriolanus coriolanu - corioli corioli cork cork - corky corki cormorant cormor - corn corn cornelia cornelia - cornelius corneliu corner corner - corners corner cornerstone cornerston - cornets cornet cornish cornish - corns corn cornuto cornuto - cornwall cornwal corollary corollari - coronal coron coronation coron - coronet coronet coronets coronet - corporal corpor corporals corpor - corporate corpor corpse corps - corpulent corpul correct correct - corrected correct correcting correct - correction correct correctioner correction - corrects correct correspondence correspond - correspondent correspond corresponding correspond - corresponsive correspons corrigible corrig - corrival corriv corrivals corriv - corroborate corrobor corrosive corros - corrupt corrupt corrupted corrupt - corrupter corrupt corrupters corrupt - corruptible corrupt corruptibly corrupt - corrupting corrupt corruption corrupt - corruptly corruptli corrupts corrupt - corse cors corses cors - corslet corslet cosmo cosmo - cost cost costard costard - costermongers costermong costlier costlier - costly costli costs cost - cot cot cote cote - coted cote cotsall cotsal - cotsole cotsol cotswold cotswold - cottage cottag cottages cottag - cotus cotu couch couch - couched couch couching couch - couchings couch coude coud - cough cough coughing cough - could could couldst couldst - coulter coulter council council - councillor councillor councils council - counsel counsel counsell counsel - counsellor counsellor counsellors counsellor - counselor counselor counselors counselor - counsels counsel count count - counted count countenanc countenanc - countenance counten countenances counten - counter counter counterchange counterchang - countercheck countercheck counterfeit counterfeit - counterfeited counterfeit counterfeiting counterfeit - counterfeitly counterfeitli counterfeits counterfeit - countermand countermand countermands countermand - countermines countermin counterpart counterpart - counterpoints counterpoint counterpois counterpoi - counterpoise counterpois counters counter - countervail countervail countess countess - countesses countess counties counti - counting count countless countless - countries countri countrv countrv - country countri countryman countryman - countrymen countrymen counts count - county counti couper couper - couple coupl coupled coupl - couplement couplement couples coupl - couplet couplet couplets couplet - cour cour courage courag - courageous courag courageously courag - courages courag courier courier - couriers courier couronne couronn - cours cour course cours - coursed cours courser courser - coursers courser courses cours - coursing cours court court - courted court courteous courteou - courteously courteous courtesan courtesan - courtesies courtesi courtesy courtesi - courtezan courtezan courtezans courtezan - courtier courtier courtiers courtier - courtlike courtlik courtly courtli - courtney courtnei courts court - courtship courtship cousin cousin - cousins cousin couterfeit couterfeit - coutume coutum covenant coven - covenants coven covent covent - coventry coventri cover cover - covered cover covering cover - coverlet coverlet covers cover - covert covert covertly covertli - coverture covertur covet covet - coveted covet coveting covet - covetings covet covetous covet - covetously covet covetousness covet - covets covet cow cow - coward coward cowarded coward - cowardice cowardic cowardly cowardli - cowards coward cowardship cowardship - cowish cowish cowl cowl - cowslip cowslip cowslips cowslip - cox cox coxcomb coxcomb - coxcombs coxcomb coy coi - coystrill coystril coz coz - cozen cozen cozenage cozenag - cozened cozen cozener cozen - cozeners cozen cozening cozen - coziers cozier crab crab - crabbed crab crabs crab - crack crack cracked crack - cracker cracker crackers cracker - cracking crack cracks crack - cradle cradl cradled cradl - cradles cradl craft craft - crafted craft craftied crafti - craftier craftier craftily craftili - crafts craft craftsmen craftsmen - crafty crafti cram cram - cramm cramm cramp cramp - cramps cramp crams cram - cranking crank cranks crank - cranmer cranmer crannied cranni - crannies cranni cranny cranni - crants crant crare crare - crash crash crassus crassu - crav crav crave crave - craved crave craven craven - cravens craven craves crave - craveth craveth craving crave - crawl crawl crawling crawl - crawls crawl craz craz - crazed craze crazy crazi - creaking creak cream cream - create creat created creat - creates creat creating creat - creation creation creator creator - creature creatur creatures creatur - credence credenc credent credent - credible credibl credit credit - creditor creditor creditors creditor - credo credo credulity credul - credulous credul creed creed - creek creek creeks creek - creep creep creeping creep - creeps creep crept crept - crescent crescent crescive cresciv - cressets cresset cressid cressid - cressida cressida cressids cressid - cressy cressi crest crest - crested crest crestfall crestfal - crestless crestless crests crest - cretan cretan crete crete - crevice crevic crew crew - crews crew crib crib - cribb cribb cribs crib - cricket cricket crickets cricket - cried cri criedst criedst - crier crier cries cri - criest criest crieth crieth - crime crime crimeful crime - crimeless crimeless crimes crime - criminal crimin crimson crimson - cringe cring cripple crippl - crisp crisp crisped crisp - crispian crispian crispianus crispianu - crispin crispin critic critic - critical critic critics critic - croak croak croaking croak - croaks croak crocodile crocodil - cromer cromer cromwell cromwel - crone crone crook crook - crookback crookback crooked crook - crooking crook crop crop - cropp cropp crosby crosbi - cross cross crossed cross - crosses cross crossest crossest - crossing cross crossings cross - crossly crossli crossness cross - crost crost crotchets crotchet - crouch crouch crouching crouch - crow crow crowd crowd - crowded crowd crowding crowd - crowds crowd crowflowers crowflow - crowing crow crowkeeper crowkeep - crown crown crowned crown - crowner crowner crownet crownet - crownets crownet crowning crown - crowns crown crows crow - crudy crudi cruel cruel - cruell cruell crueller crueller - cruelly cruelli cruels cruel - cruelty cruelti crum crum - crumble crumbl crumbs crumb - crupper crupper crusadoes crusado - crush crush crushed crush - crushest crushest crushing crush - crust crust crusts crust - crusty crusti crutch crutch - crutches crutch cry cry - crying cry crystal crystal - crystalline crystallin crystals crystal - cub cub cubbert cubbert - cubiculo cubiculo cubit cubit - cubs cub cuckold cuckold - cuckoldly cuckoldli cuckolds cuckold - cuckoo cuckoo cucullus cucullu - cudgel cudgel cudgeled cudgel - cudgell cudgel cudgelling cudgel - cudgels cudgel cue cue - cues cue cuff cuff - cuffs cuff cuique cuiqu - cull cull culling cull - cullion cullion cullionly cullionli - cullions cullion culpable culpabl - culverin culverin cum cum - cumber cumber cumberland cumberland - cunning cun cunningly cunningli - cunnings cun cuore cuor - cup cup cupbearer cupbear - cupboarding cupboard cupid cupid - cupids cupid cuppele cuppel - cups cup cur cur - curan curan curate curat - curb curb curbed curb - curbing curb curbs curb - curd curd curdied curdi - curds curd cure cure - cured cure cureless cureless - curer curer cures cure - curfew curfew curing cure - curio curio curiosity curios - curious curiou curiously curious - curl curl curled curl - curling curl curls curl - currance curranc currants currant - current current currents current - currish currish curry curri - curs cur curse curs - cursed curs curses curs - cursies cursi cursing curs - cursorary cursorari curst curst - curster curster curstest curstest - curstness curst cursy cursi - curtail curtail curtain curtain - curtains curtain curtal curtal - curtis curti curtle curtl - curtsied curtsi curtsies curtsi - curtsy curtsi curvet curvet - curvets curvet cushes cush - cushion cushion cushions cushion - custalorum custalorum custard custard - custody custodi custom custom - customary customari customed custom - customer custom customers custom - customs custom custure custur - cut cut cutler cutler - cutpurse cutpurs cutpurses cutpurs - cuts cut cutter cutter - cutting cut cuttle cuttl - cxsar cxsar cyclops cyclop - cydnus cydnu cygnet cygnet - cygnets cygnet cym cym - cymbals cymbal cymbeline cymbelin - cyme cyme cynic cynic - cynthia cynthia cypress cypress - cypriot cypriot cyprus cypru - cyrus cyru cytherea cytherea - d d dabbled dabbl - dace dace dad dad - daedalus daedalu daemon daemon - daff daff daffed daf - daffest daffest daffodils daffodil - dagger dagger daggers dagger - dagonet dagonet daily daili - daintier daintier dainties dainti - daintiest daintiest daintily daintili - daintiness dainti daintry daintri - dainty dainti daisied daisi - daisies daisi daisy daisi - dale dale dalliance dallianc - dallied dalli dallies dalli - dally dalli dallying dalli - dalmatians dalmatian dam dam - damage damag damascus damascu - damask damask damasked damask - dame dame dames dame - damm damm damn damn - damnable damnabl damnably damnabl - damnation damnat damned damn - damns damn damoiselle damoisel - damon damon damosella damosella - damp damp dams dam - damsel damsel damsons damson - dan dan danc danc - dance danc dancer dancer - dances danc dancing danc - dandle dandl dandy dandi - dane dane dang dang - danger danger dangerous danger - dangerously danger dangers danger - dangling dangl daniel daniel - danish danish dank dank - dankish dankish danskers dansker - daphne daphn dappled dappl - dapples dappl dar dar - dardan dardan dardanian dardanian - dardanius dardaniu dare dare - dared dare dareful dare - dares dare darest darest - daring dare darius dariu - dark dark darken darken - darkening darken darkens darken - darker darker darkest darkest - darkling darkl darkly darkli - darkness dark darling darl - darlings darl darnel darnel - darraign darraign dart dart - darted dart darter darter - dartford dartford darting dart - darts dart dash dash - dashes dash dashing dash - dastard dastard dastards dastard - dat dat datchet datchet - date date dated date - dateless dateless dates date - daub daub daughter daughter - daughters daughter daunt daunt - daunted daunt dauntless dauntless - dauphin dauphin daventry daventri - davy davi daw daw - dawn dawn dawning dawn - daws daw day dai - daylight daylight days dai - dazzle dazzl dazzled dazzl - dazzling dazzl de de - dead dead deadly deadli - deaf deaf deafing deaf - deafness deaf deafs deaf - deal deal dealer dealer - dealers dealer dealest dealest - dealing deal dealings deal - deals deal dealt dealt - dean dean deanery deaneri - dear dear dearer dearer - dearest dearest dearly dearli - dearness dear dears dear - dearth dearth dearths dearth - death death deathbed deathb - deathful death deaths death - deathsman deathsman deathsmen deathsmen - debarred debar debase debas - debate debat debated debat - debatement debat debateth debateth - debating debat debauch debauch - debile debil debility debil - debitor debitor debonair debonair - deborah deborah debosh debosh - debt debt debted debt - debtor debtor debtors debtor - debts debt debuty debuti - decay decai decayed decai - decayer decay decaying decai - decays decai deceas decea - decease deceas deceased deceas - deceit deceit deceitful deceit - deceits deceit deceiv deceiv - deceivable deceiv deceive deceiv - deceived deceiv deceiver deceiv - deceivers deceiv deceives deceiv - deceivest deceivest deceiveth deceiveth - deceiving deceiv december decemb - decent decent deceptious decepti - decerns decern decide decid - decides decid decimation decim - decipher deciph deciphers deciph - decision decis decius deciu - deck deck decking deck - decks deck deckt deckt - declare declar declares declar - declension declens declensions declens - declin declin decline declin - declined declin declines declin - declining declin decoct decoct - decorum decorum decreas decrea - decrease decreas decreasing decreas - decree decre decreed decre - decrees decre decrepit decrepit - dedicate dedic dedicated dedic - dedicates dedic dedication dedic - deed deed deedless deedless - deeds deed deem deem - deemed deem deep deep - deeper deeper deepest deepest - deeply deepli deeps deep - deepvow deepvow deer deer - deesse deess defac defac - deface defac defaced defac - defacer defac defacers defac - defacing defac defam defam - default default defeat defeat - defeated defeat defeats defeat - defeatures defeatur defect defect - defective defect defects defect - defence defenc defences defenc - defend defend defendant defend - defended defend defender defend - defenders defend defending defend - defends defend defense defens - defensible defens defensive defens - defer defer deferr deferr - defiance defianc deficient defici - defied defi defies defi - defil defil defile defil - defiler defil defiles defil - defiling defil define defin - definement defin definite definit - definitive definit definitively definit - deflow deflow deflower deflow - deflowered deflow deform deform - deformed deform deformities deform - deformity deform deftly deftli - defunct defunct defunction defunct - defuse defus defy defi - defying defi degenerate degener - degraded degrad degree degre - degrees degre deified deifi - deifying deifi deign deign - deigned deign deiphobus deiphobu - deities deiti deity deiti - deja deja deject deject - dejected deject delabreth delabreth - delay delai delayed delai - delaying delai delays delai - delectable delect deliberate deliber - delicate delic delicates delic - delicious delici deliciousness delici - delight delight delighted delight - delightful delight delights delight - delinquents delinqu deliv deliv - deliver deliv deliverance deliver - delivered deliv delivering deliv - delivers deliv delivery deliveri - delphos delpho deluded delud - deluding delud deluge delug - delve delv delver delver - delves delv demand demand - demanded demand demanding demand - demands demand demean demean - demeanor demeanor demeanour demeanour - demerits demerit demesnes demesn - demetrius demetriu demi demi - demigod demigod demise demis - demoiselles demoisel demon demon - demonstrable demonstr demonstrate demonstr - demonstrated demonstr demonstrating demonstr - demonstration demonstr demonstrative demonstr - demure demur demurely demur - demuring demur den den - denay denai deni deni - denial denial denials denial - denied deni denier denier - denies deni deniest deniest - denis deni denmark denmark - dennis denni denny denni - denote denot denoted denot - denotement denot denounc denounc - denounce denounc denouncing denounc - dens den denunciation denunci - deny deni denying deni - deo deo depart depart - departed depart departest departest - departing depart departure departur - depeche depech depend depend - dependant depend dependants depend - depended depend dependence depend - dependences depend dependency depend - dependent depend dependents depend - depender depend depending depend - depends depend deplore deplor - deploring deplor depopulate depopul - depos depo depose depos - deposed depos deposing depos - depositaries depositari deprav deprav - depravation deprav deprave deprav - depraved deprav depraves deprav - depress depress depriv depriv - deprive depriv depth depth - depths depth deputation deput - depute deput deputed deput - deputies deputi deputing deput - deputy deputi deracinate deracin - derby derbi dercetas derceta - dere dere derides derid - derision deris deriv deriv - derivation deriv derivative deriv - derive deriv derived deriv - derives deriv derogate derog - derogately derog derogation derog - des de desartless desartless - descant descant descend descend - descended descend descending descend - descends descend descension descens - descent descent descents descent - describe describ described describ - describes describ descried descri - description descript descriptions descript - descry descri desdemon desdemon - desdemona desdemona desert desert - deserts desert deserv deserv - deserve deserv deserved deserv - deservedly deservedli deserver deserv - deservers deserv deserves deserv - deservest deservest deserving deserv - deservings deserv design design - designment design designments design - designs design desir desir - desire desir desired desir - desirers desir desires desir - desirest desirest desiring desir - desirous desir desist desist - desk desk desolate desol - desolation desol desp desp - despair despair despairing despair - despairs despair despatch despatch - desperate desper desperately desper - desperation desper despis despi - despise despis despised despis - despiser despis despiseth despiseth - despising despis despite despit - despiteful despit despoiled despoil - dest dest destin destin - destined destin destinies destini - destiny destini destitute destitut - destroy destroi destroyed destroi - destroyer destroy destroyers destroy - destroying destroi destroys destroi - destruction destruct destructions destruct - det det detain detain - detains detain detect detect - detected detect detecting detect - detection detect detector detector - detects detect detention detent - determin determin determinate determin - determination determin determinations determin - determine determin determined determin - determines determin detest detest - detestable detest detested detest - detesting detest detests detest - detract detract detraction detract - detractions detract deucalion deucalion - deuce deuc deum deum - deux deux devant devant - devesting devest device devic - devices devic devil devil - devilish devilish devils devil - devis devi devise devis - devised devis devises devis - devising devis devoid devoid - devonshire devonshir devote devot - devoted devot devotion devot - devour devour devoured devour - devourers devour devouring devour - devours devour devout devout - devoutly devoutli dew dew - dewberries dewberri dewdrops dewdrop - dewlap dewlap dewlapp dewlapp - dews dew dewy dewi - dexter dexter dexteriously dexteri - dexterity dexter di di - diable diabl diablo diablo - diadem diadem dial dial - dialect dialect dialogue dialogu - dialogued dialogu dials dial - diameter diamet diamond diamond - diamonds diamond dian dian - diana diana diaper diaper - dibble dibbl dic dic - dice dice dicers dicer - dich dich dick dick - dickens dicken dickon dickon - dicky dicki dictator dictat - diction diction dictynna dictynna - did did diddle diddl - didest didest dido dido - didst didst die die - died di diedst diedst - dies di diest diest - diet diet dieted diet - dieter dieter dieu dieu - diff diff differ differ - difference differ differences differ - differency differ different differ - differing differ differs differ - difficile difficil difficult difficult - difficulties difficulti difficulty difficulti - diffidence diffid diffidences diffid - diffus diffu diffused diffus - diffusest diffusest dig dig - digest digest digested digest - digestion digest digestions digest - digg digg digging dig - dighton dighton dignified dignifi - dignifies dignifi dignify dignifi - dignities digniti dignity digniti - digress digress digressing digress - digression digress digs dig - digt digt dilate dilat - dilated dilat dilations dilat - dilatory dilatori dild dild - dildos dildo dilemma dilemma - dilemmas dilemma diligence dilig - diligent dilig diluculo diluculo - dim dim dimension dimens - dimensions dimens diminish diminish - diminishing diminish diminution diminut - diminutive diminut diminutives diminut - dimm dimm dimmed dim - dimming dim dimpled dimpl - dimples dimpl dims dim - din din dine dine - dined dine diner diner - dines dine ding ding - dining dine dinner dinner - dinners dinner dinnertime dinnertim - dint dint diomed diom - diomede diomed diomedes diomed - dion dion dip dip - dipp dipp dipping dip - dips dip dir dir - dire dire direct direct - directed direct directing direct - direction direct directions direct - directitude directitud directive direct - directly directli directs direct - direful dire direness dire - direst direst dirge dirg - dirges dirg dirt dirt - dirty dirti dis di - disability disabl disable disabl - disabled disabl disabling disabl - disadvantage disadvantag disagree disagre - disallow disallow disanimates disanim - disannul disannul disannuls disannul - disappointed disappoint disarm disarm - disarmed disarm disarmeth disarmeth - disarms disarm disaster disast - disasters disast disastrous disastr - disbench disbench disbranch disbranch - disburdened disburden disburs disbur - disburse disburs disbursed disburs - discandy discandi discandying discandi - discard discard discarded discard - discase discas discased discas - discern discern discerner discern - discerning discern discernings discern - discerns discern discharg discharg - discharge discharg discharged discharg - discharging discharg discipled discipl - disciples discipl disciplin disciplin - discipline disciplin disciplined disciplin - disciplines disciplin disclaim disclaim - disclaiming disclaim disclaims disclaim - disclos disclo disclose disclos - disclosed disclos discloses disclos - discolour discolour discoloured discolour - discolours discolour discomfit discomfit - discomfited discomfit discomfiture discomfitur - discomfort discomfort discomfortable discomfort - discommend discommend disconsolate disconsol - discontent discont discontented discont - discontentedly discontentedli discontenting discont - discontents discont discontinue discontinu - discontinued discontinu discord discord - discordant discord discords discord - discourse discours discoursed discours - discourser discours discourses discours - discoursive discours discourtesy discourtesi - discov discov discover discov - discovered discov discoverers discover - discoveries discoveri discovering discov - discovers discov discovery discoveri - discredit discredit discredited discredit - discredits discredit discreet discreet - discreetly discreetli discretion discret - discretions discret discuss discuss - disdain disdain disdained disdain - disdaineth disdaineth disdainful disdain - disdainfully disdainfulli disdaining disdain - disdains disdain disdnguish disdnguish - diseas disea disease diseas - diseased diseas diseases diseas - disedg disedg disembark disembark - disfigure disfigur disfigured disfigur - disfurnish disfurnish disgorge disgorg - disgrac disgrac disgrace disgrac - disgraced disgrac disgraceful disgrac - disgraces disgrac disgracing disgrac - disgracious disgraci disguis disgui - disguise disguis disguised disguis - disguiser disguis disguises disguis - disguising disguis dish dish - dishabited dishabit dishclout dishclout - dishearten dishearten disheartens dishearten - dishes dish dishonest dishonest - dishonestly dishonestli dishonesty dishonesti - dishonor dishonor dishonorable dishonor - dishonors dishonor dishonour dishonour - dishonourable dishonour dishonoured dishonour - dishonours dishonour disinherit disinherit - disinherited disinherit disjoin disjoin - disjoining disjoin disjoins disjoin - disjoint disjoint disjunction disjunct - dislik dislik dislike dislik - disliken disliken dislikes dislik - dislimns dislimn dislocate disloc - dislodg dislodg disloyal disloy - disloyalty disloyalti dismal dismal - dismantle dismantl dismantled dismantl - dismask dismask dismay dismai - dismayed dismai dismemb dismemb - dismember dismemb dismes dism - dismiss dismiss dismissed dismiss - dismissing dismiss dismission dismiss - dismount dismount dismounted dismount - disnatur disnatur disobedience disobedi - disobedient disobedi disobey disobei - disobeys disobei disorb disorb - disorder disord disordered disord - disorderly disorderli disorders disord - disparage disparag disparagement disparag - disparagements disparag dispark dispark - dispatch dispatch dispensation dispens - dispense dispens dispenses dispens - dispers disper disperse dispers - dispersed dispers dispersedly dispersedli - dispersing dispers dispiteous dispit - displac displac displace displac - displaced displac displant displant - displanting displant display displai - displayed displai displeas displea - displease displeas displeased displeas - displeasing displeas displeasure displeasur - displeasures displeasur disponge dispong - disport disport disports disport - dispos dispo dispose dispos - disposed dispos disposer dispos - disposing dispos disposition disposit - dispositions disposit dispossess dispossess - dispossessing dispossess disprais disprai - dispraise disprais dispraising disprais - dispraisingly dispraisingli dispropertied disproperti - disproportion disproport disproportioned disproport - disprov disprov disprove disprov - disproved disprov dispursed dispurs - disputable disput disputation disput - disputations disput dispute disput - disputed disput disputes disput - disputing disput disquantity disquant - disquiet disquiet disquietly disquietli - disrelish disrelish disrobe disrob - disseat disseat dissemble dissembl - dissembled dissembl dissembler dissembl - dissemblers dissembl dissembling dissembl - dissembly dissembl dissension dissens - dissensions dissens dissentious dissenti - dissever dissev dissipation dissip - dissolute dissolut dissolutely dissolut - dissolution dissolut dissolutions dissolut - dissolv dissolv dissolve dissolv - dissolved dissolv dissolves dissolv - dissuade dissuad dissuaded dissuad - distaff distaff distaffs distaff - distain distain distains distain - distance distanc distant distant - distaste distast distasted distast - distasteful distast distemp distemp - distemper distemp distemperature distemperatur - distemperatures distemperatur distempered distemp - distempering distemp distil distil - distill distil distillation distil - distilled distil distills distil - distilment distil distinct distinct - distinction distinct distinctly distinctli - distingue distingu distinguish distinguish - distinguishes distinguish distinguishment distinguish - distract distract distracted distract - distractedly distractedli distraction distract - distractions distract distracts distract - distrain distrain distraught distraught - distress distress distressed distress - distresses distress distressful distress - distribute distribut distributed distribut - distribution distribut distrust distrust - distrustful distrust disturb disturb - disturbed disturb disturbers disturb - disturbing disturb disunite disunit - disvalued disvalu disvouch disvouch - dit dit ditch ditch - ditchers ditcher ditches ditch - dites dite ditties ditti - ditty ditti diurnal diurnal - div div dive dive - diver diver divers diver - diversely divers diversity divers - divert divert diverted divert - diverts divert dives dive - divest divest dividable divid - dividant divid divide divid - divided divid divides divid - divideth divideth divin divin - divination divin divine divin - divinely divin divineness divin - diviner divin divines divin - divinest divinest divining divin - divinity divin division divis - divisions divis divorc divorc - divorce divorc divorced divorc - divorcement divorc divorcing divorc - divulg divulg divulge divulg - divulged divulg divulging divulg - dizy dizi dizzy dizzi - do do doating doat - dobbin dobbin dock dock - docks dock doct doct - doctor doctor doctors doctor - doctrine doctrin document document - dodge dodg doe doe - doer doer doers doer - does doe doest doest - doff doff dog dog - dogberry dogberri dogfish dogfish - dogg dogg dogged dog - dogs dog doigts doigt - doing do doings do - doit doit doits doit - dolabella dolabella dole dole - doleful dole doll doll - dollar dollar dollars dollar - dolor dolor dolorous dolor - dolour dolour dolours dolour - dolphin dolphin dolt dolt - dolts dolt domestic domest - domestics domest dominance domin - dominations domin dominator domin - domine domin domineer domin - domineering domin dominical domin - dominion dominion dominions dominion - domitius domitiu dommelton dommelton - don don donalbain donalbain - donation donat donc donc - doncaster doncast done done - dong dong donn donn - donne donn donner donner - donnerai donnerai doom doom - doomsday doomsdai door door - doorkeeper doorkeep doors door - dorcas dorca doreus doreu - doricles doricl dormouse dormous - dorothy dorothi dorset dorset - dorsetshire dorsetshir dost dost - dotage dotag dotant dotant - dotard dotard dotards dotard - dote dote doted dote - doters doter dotes dote - doteth doteth doth doth - doting dote double doubl - doubled doubl doubleness doubl - doubler doubler doublet doublet - doublets doublet doubling doubl - doubly doubli doubt doubt - doubted doubt doubtful doubt - doubtfully doubtfulli doubting doubt - doubtless doubtless doubts doubt - doug doug dough dough - doughty doughti doughy doughi - douglas dougla dout dout - doute dout douts dout - dove dove dovehouse dovehous - dover dover doves dove - dow dow dowager dowag - dowdy dowdi dower dower - dowerless dowerless dowers dower - dowlas dowla dowle dowl - down down downfall downfal - downright downright downs down - downstairs downstair downtrod downtrod - downward downward downwards downward - downy downi dowries dowri - dowry dowri dowsabel dowsabel - doxy doxi dozed doze - dozen dozen dozens dozen - dozy dozi drab drab - drabbing drab drabs drab - drachma drachma drachmas drachma - draff draff drag drag - dragg dragg dragged drag - dragging drag dragon dragon - dragonish dragonish dragons dragon - drain drain drained drain - drains drain drake drake - dram dram dramatis dramati - drank drank draught draught - draughts draught drave drave - draw draw drawbridge drawbridg - drawer drawer drawers drawer - draweth draweth drawing draw - drawling drawl drawn drawn - draws draw drayman drayman - draymen draymen dread dread - dreaded dread dreadful dread - dreadfully dreadfulli dreading dread - dreads dread dream dream - dreamer dreamer dreamers dreamer - dreaming dream dreams dream - dreamt dreamt drearning drearn - dreary dreari dreg dreg - dregs dreg drench drench - drenched drench dress dress - dressed dress dresser dresser - dressing dress dressings dress - drest drest drew drew - dribbling dribbl dried dri - drier drier dries dri - drift drift drily drili - drink drink drinketh drinketh - drinking drink drinkings drink - drinks drink driv driv - drive drive drivelling drivel - driven driven drives drive - driveth driveth driving drive - drizzle drizzl drizzled drizzl - drizzles drizzl droit droit - drollery drolleri dromio dromio - dromios dromio drone drone - drones drone droop droop - droopeth droopeth drooping droop - droops droop drop drop - dropheir dropheir droplets droplet - dropp dropp dropper dropper - droppeth droppeth dropping drop - droppings drop drops drop - dropsied dropsi dropsies dropsi - dropsy dropsi dropt dropt - dross dross drossy drossi - drought drought drove drove - droven droven drovier drovier - drown drown drowned drown - drowning drown drowns drown - drows drow drowse drows - drowsily drowsili drowsiness drowsi - drowsy drowsi drudge drudg - drudgery drudgeri drudges drudg - drug drug drugg drugg - drugs drug drum drum - drumble drumbl drummer drummer - drumming drum drums drum - drunk drunk drunkard drunkard - drunkards drunkard drunken drunken - drunkenly drunkenli drunkenness drunken - dry dry dryness dryness - dst dst du du - dub dub dubb dubb - ducat ducat ducats ducat - ducdame ducdam duchess duchess - duchies duchi duchy duchi - duck duck ducking duck - ducks duck dudgeon dudgeon - due due duellist duellist - duello duello duer duer - dues due duff duff - dug dug dugs dug - duke duke dukedom dukedom - dukedoms dukedom dukes duke - dulcet dulcet dulche dulch - dull dull dullard dullard - duller duller dullest dullest - dulling dull dullness dull - dulls dull dully dulli - dulness dul duly duli - dumain dumain dumb dumb - dumbe dumb dumbly dumbl - dumbness dumb dump dump - dumps dump dun dun - duncan duncan dung dung - dungeon dungeon dungeons dungeon - dunghill dunghil dunghills dunghil - dungy dungi dunnest dunnest - dunsinane dunsinan dunsmore dunsmor - dunstable dunstabl dupp dupp - durance duranc during dure - durst durst dusky duski - dust dust dusted dust - dusty dusti dutch dutch - dutchman dutchman duteous duteou - duties duti dutiful duti - duty duti dwarf dwarf - dwarfish dwarfish dwell dwell - dwellers dweller dwelling dwell - dwells dwell dwelt dwelt - dwindle dwindl dy dy - dye dye dyed dy - dyer dyer dying dy - e e each each - eager eager eagerly eagerli - eagerness eager eagle eagl - eagles eagl eaning ean - eanlings eanl ear ear - earing ear earl earl - earldom earldom earlier earlier - earliest earliest earliness earli - earls earl early earli - earn earn earned earn - earnest earnest earnestly earnestli - earnestness earnest earns earn - ears ear earth earth - earthen earthen earthlier earthlier - earthly earthli earthquake earthquak - earthquakes earthquak earthy earthi - eas ea ease eas - eased eas easeful eas - eases eas easier easier - easiest easiest easiliest easiliest - easily easili easiness easi - easing eas east east - eastcheap eastcheap easter easter - eastern eastern eastward eastward - easy easi eat eat - eaten eaten eater eater - eaters eater eating eat - eats eat eaux eaux - eaves eav ebb ebb - ebbing eb ebbs ebb - ebon ebon ebony eboni - ebrew ebrew ecce ecc - echapper echapp echo echo - echoes echo eclips eclip - eclipse eclips eclipses eclips - ecolier ecoli ecoutez ecoutez - ecstacy ecstaci ecstasies ecstasi - ecstasy ecstasi ecus ecu - eden eden edg edg - edgar edgar edge edg - edged edg edgeless edgeless - edges edg edict edict - edicts edict edifice edific - edifices edific edified edifi - edifies edifi edition edit - edm edm edmund edmund - edmunds edmund edmundsbury edmundsburi - educate educ educated educ - education educ edward edward - eel eel eels eel - effect effect effected effect - effectless effectless effects effect - effectual effectu effectually effectu - effeminate effemin effigies effigi - effus effu effuse effus - effusion effus eftest eftest - egal egal egally egal - eget eget egeus egeu - egg egg eggs egg - eggshell eggshel eglamour eglamour - eglantine eglantin egma egma - ego ego egregious egregi - egregiously egregi egress egress - egypt egypt egyptian egyptian - egyptians egyptian eie eie - eight eight eighteen eighteen - eighth eighth eightpenny eightpenni - eighty eighti eisel eisel - either either eject eject - eke ek el el - elbe elb elbow elbow - elbows elbow eld eld - elder elder elders elder - eldest eldest eleanor eleanor - elect elect elected elect - election elect elegancy eleg - elegies elegi element element - elements element elephant eleph - elephants eleph elevated elev - eleven eleven eleventh eleventh - elf elf elflocks elflock - eliads eliad elinor elinor - elizabeth elizabeth ell ell - elle ell ellen ellen - elm elm eloquence eloqu - eloquent eloqu else els - elsewhere elsewher elsinore elsinor - eltham eltham elves elv - elvish elvish ely eli - elysium elysium em em - emballing embal embalm embalm - embalms embalm embark embark - embarked embark embarquements embarqu - embassade embassad embassage embassag - embassies embassi embassy embassi - embattailed embattail embattl embattl - embattle embattl embay embai - embellished embellish embers ember - emblaze emblaz emblem emblem - emblems emblem embodied embodi - embold embold emboldens embolden - emboss emboss embossed emboss - embounded embound embowel embowel - embowell embowel embrac embrac - embrace embrac embraced embrac - embracement embrac embracements embrac - embraces embrac embracing embrac - embrasures embrasur embroider embroid - embroidery embroideri emhracing emhrac - emilia emilia eminence emin - eminent emin eminently emin - emmanuel emmanuel emnity emniti - empale empal emperal emper - emperess emperess emperial emperi - emperor emperor empery emperi - emphasis emphasi empire empir - empirics empir empiricutic empiricut - empleached empleach employ emploi - employed emploi employer employ - employment employ employments employ - empoison empoison empress empress - emptied empti emptier emptier - empties empti emptiness empti - empty empti emptying empti - emulate emul emulation emul - emulations emul emulator emul - emulous emul en en - enact enact enacted enact - enacts enact enactures enactur - enamell enamel enamelled enamel - enamour enamour enamoured enamour - enanmour enanmour encamp encamp - encamped encamp encave encav - enceladus enceladu enchaf enchaf - enchafed enchaf enchant enchant - enchanted enchant enchanting enchant - enchantingly enchantingli enchantment enchant - enchantress enchantress enchants enchant - enchas encha encircle encircl - encircled encircl enclos enclo - enclose enclos enclosed enclos - encloses enclos encloseth encloseth - enclosing enclos enclouded encloud - encompass encompass encompassed encompass - encompasseth encompasseth encompassment encompass - encore encor encorporal encorpor - encount encount encounter encount - encountered encount encounters encount - encourage encourag encouraged encourag - encouragement encourag encrimsoned encrimson - encroaching encroach encumb encumb - end end endamage endamag - endamagement endamag endanger endang - endart endart endear endear - endeared endear endeavour endeavour - endeavours endeavour ended end - ender ender ending end - endings end endite endit - endless endless endow endow - endowed endow endowments endow - endows endow ends end - endu endu endue endu - endur endur endurance endur - endure endur endured endur - endures endur enduring endur - endymion endymion eneas enea - enemies enemi enemy enemi - enernies enerni enew enew - enfeebled enfeebl enfeebles enfeebl - enfeoff enfeoff enfetter enfett - enfoldings enfold enforc enforc - enforce enforc enforced enforc - enforcedly enforcedli enforcement enforc - enforces enforc enforcest enforcest - enfranched enfranch enfranchis enfranchi - enfranchise enfranchis enfranchised enfranchis - enfranchisement enfranchis enfreed enfre - enfreedoming enfreedom engag engag - engage engag engaged engag - engagements engag engaging engag - engaol engaol engend engend - engender engend engenders engend - engilds engild engine engin - engineer engin enginer engin - engines engin engirt engirt - england england english english - englishman englishman englishmen englishmen - engluts englut englutted englut - engraffed engraf engraft engraft - engrafted engraft engrav engrav - engrave engrav engross engross - engrossed engross engrossest engrossest - engrossing engross engrossments engross - enguard enguard enigma enigma - enigmatical enigmat enjoin enjoin - enjoined enjoin enjoy enjoi - enjoyed enjoi enjoyer enjoy - enjoying enjoi enjoys enjoi - enkindle enkindl enkindled enkindl - enlard enlard enlarg enlarg - enlarge enlarg enlarged enlarg - enlargement enlarg enlargeth enlargeth - enlighten enlighten enlink enlink - enmesh enmesh enmities enmiti - enmity enmiti ennoble ennobl - ennobled ennobl enobarb enobarb - enobarbus enobarbu enon enon - enormity enorm enormous enorm - enough enough enow enow - enpatron enpatron enpierced enpierc - enquir enquir enquire enquir - enquired enquir enrag enrag - enrage enrag enraged enrag - enrages enrag enrank enrank - enrapt enrapt enrich enrich - enriched enrich enriches enrich - enridged enridg enrings enr - enrob enrob enrobe enrob - enroll enrol enrolled enrol - enrooted enroot enrounded enround - enschedul enschedul ensconce ensconc - ensconcing ensconc enseamed enseam - ensear ensear enseigne enseign - enseignez enseignez ensemble ensembl - enshelter enshelt enshielded enshield - enshrines enshrin ensign ensign - ensigns ensign enskied enski - ensman ensman ensnare ensnar - ensnared ensnar ensnareth ensnareth - ensteep ensteep ensu ensu - ensue ensu ensued ensu - ensues ensu ensuing ensu - enswathed enswath ent ent - entail entail entame entam - entangled entangl entangles entangl - entendre entendr enter enter - entered enter entering enter - enterprise enterpris enterprises enterpris - enters enter entertain entertain - entertained entertain entertainer entertain - entertaining entertain entertainment entertain - entertainments entertain enthrall enthral - enthralled enthral enthron enthron - enthroned enthron entice entic - enticements entic enticing entic - entire entir entirely entir - entitle entitl entitled entitl - entitling entitl entomb entomb - entombed entomb entrails entrail - entrance entranc entrances entranc - entrap entrap entrapp entrapp - entre entr entreat entreat - entreated entreat entreaties entreati - entreating entreat entreatments entreat - entreats entreat entreaty entreati - entrench entrench entry entri - entwist entwist envelop envelop - envenom envenom envenomed envenom - envenoms envenom envied envi - envies envi envious enviou - enviously envious environ environ - environed environ envoy envoi - envy envi envying envi - enwheel enwheel enwombed enwomb - enwraps enwrap ephesian ephesian - ephesians ephesian ephesus ephesu - epicure epicur epicurean epicurean - epicures epicur epicurism epicur - epicurus epicuru epidamnum epidamnum - epidaurus epidauru epigram epigram - epilepsy epilepsi epileptic epilept - epilogue epilogu epilogues epilogu - epistles epistl epistrophus epistrophu - epitaph epitaph epitaphs epitaph - epithet epithet epitheton epitheton - epithets epithet epitome epitom - equal equal equalities equal - equality equal equall equal - equally equal equalness equal - equals equal equinoctial equinocti - equinox equinox equipage equipag - equity equiti equivocal equivoc - equivocate equivoc equivocates equivoc - equivocation equivoc equivocator equivoc - er er erbear erbear - erbearing erbear erbears erbear - erbeat erbeat erblows erblow - erboard erboard erborne erborn - ercame ercam ercast ercast - ercharg ercharg ercharged ercharg - ercharging ercharg ercles ercl - ercome ercom ercover ercov - ercrows ercrow erdoing erdo - ere er erebus erebu - erect erect erected erect - erecting erect erection erect - erects erect erewhile erewhil - erflourish erflourish erflow erflow - erflowing erflow erflows erflow - erfraught erfraught erga erga - ergalled ergal erglanced erglanc - ergo ergo ergone ergon - ergrow ergrow ergrown ergrown - ergrowth ergrowth erhang erhang - erhanging erhang erhasty erhasti - erhear erhear erheard erheard - eringoes eringo erjoy erjoi - erleap erleap erleaps erleap - erleavens erleaven erlook erlook - erlooking erlook ermaster ermast - ermengare ermengar ermount ermount - ern ern ernight ernight - eros ero erpaid erpaid - erparted erpart erpast erpast - erpays erpai erpeer erpeer - erperch erperch erpicturing erpictur - erpingham erpingham erposting erpost - erpow erpow erpress erpress - erpressed erpress err err - errand errand errands errand - errant errant errate errat - erraught erraught erreaches erreach - erred er errest errest - erring er erroneous erron - error error errors error - errs err errule errul - errun errun erset erset - ershade ershad ershades ershad - ershine ershin ershot ershot - ersized ersiz erskip erskip - erslips erslip erspreads erspread - erst erst erstare erstar - erstep erstep erstunk erstunk - ersway erswai ersways erswai - erswell erswel erta erta - ertake ertak erteemed erteem - erthrow erthrow erthrown erthrown - erthrows erthrow ertook ertook - ertop ertop ertopping ertop - ertrip ertrip erturn erturn - erudition erudit eruption erupt - eruptions erupt ervalues ervalu - erwalk erwalk erwatch erwatch - erween erween erweens erween - erweigh erweigh erweighs erweigh - erwhelm erwhelm erwhelmed erwhelm - erworn erworn es es - escalus escalu escap escap - escape escap escaped escap - escapes escap eschew eschew - escoted escot esill esil - especial especi especially especi - esperance esper espials espial - espied espi espies espi - espous espou espouse espous - espy espi esquire esquir - esquires esquir essay essai - essays essai essence essenc - essential essenti essentially essenti - esses ess essex essex - est est establish establish - established establish estate estat - estates estat esteem esteem - esteemed esteem esteemeth esteemeth - esteeming esteem esteems esteem - estimable estim estimate estim - estimation estim estimations estim - estime estim estranged estrang - estridge estridg estridges estridg - et et etc etc - etceteras etcetera ete et - eternal etern eternally etern - eterne etern eternity etern - eterniz eterniz etes et - ethiop ethiop ethiope ethiop - ethiopes ethiop ethiopian ethiopian - etna etna eton eton - etre etr eunuch eunuch - eunuchs eunuch euphrates euphrat - euphronius euphroniu euriphile euriphil - europa europa europe europ - ev ev evade evad - evades evad evans evan - evasion evas evasions evas - eve ev even even - evening even evenly evenli - event event eventful event - events event ever ever - everlasting everlast everlastingly everlastingli - evermore evermor every everi - everyone everyon everything everyth - everywhere everywher evidence evid - evidences evid evident evid - evil evil evilly evilli - evils evil evitate evit - ewe ew ewer ewer - ewers ewer ewes ew - exact exact exacted exact - exactest exactest exacting exact - exaction exact exactions exact - exactly exactli exacts exact - exalt exalt exalted exalt - examin examin examination examin - examinations examin examine examin - examined examin examines examin - exampl exampl example exampl - exampled exampl examples exampl - exasperate exasper exasperates exasper - exceed exce exceeded exceed - exceedeth exceedeth exceeding exceed - exceedingly exceedingli exceeds exce - excel excel excelled excel - excellence excel excellencies excel - excellency excel excellent excel - excellently excel excelling excel - excels excel except except - excepted except excepting except - exception except exceptions except - exceptless exceptless excess excess - excessive excess exchang exchang - exchange exchang exchanged exchang - exchequer exchequ exchequers exchequ - excite excit excited excit - excitements excit excites excit - exclaim exclaim exclaims exclaim - exclamation exclam exclamations exclam - excludes exclud excommunicate excommun - excommunication excommun excrement excrement - excrements excrement excursion excurs - excursions excurs excus excu - excusable excus excuse excus - excused excus excuses excus - excusez excusez excusing excus - execrable execr execrations execr - execute execut executed execut - executing execut execution execut - executioner execution executioners execution - executor executor executors executor - exempt exempt exempted exempt - exequies exequi exercise exercis - exercises exercis exeter exet - exeunt exeunt exhal exhal - exhalation exhal exhalations exhal - exhale exhal exhales exhal - exhaust exhaust exhibit exhibit - exhibiters exhibit exhibition exhibit - exhort exhort exhortation exhort - exigent exig exil exil - exile exil exiled exil - exion exion exist exist - exists exist exit exit - exits exit exorciser exorcis - exorcisms exorc exorcist exorcist - expect expect expectance expect - expectancy expect expectation expect - expectations expect expected expect - expecters expect expecting expect - expects expect expedience expedi - expedient expedi expediently expedi - expedition expedit expeditious expediti - expel expel expell expel - expelling expel expels expel - expend expend expense expens - expenses expens experienc experienc - experience experi experiences experi - experiment experi experimental experiment - experiments experi expert expert - expertness expert expiate expiat - expiation expiat expir expir - expiration expir expire expir - expired expir expires expir - expiring expir explication explic - exploit exploit exploits exploit - expos expo expose expos - exposing expos exposition exposit - expositor expositor expostulate expostul - expostulation expostul exposture expostur - exposure exposur expound expound - expounded expound express express - expressed express expresseth expresseth - expressing express expressive express - expressly expressli expressure expressur - expuls expul expulsion expuls - exquisite exquisit exsufflicate exsuffl - extant extant extemporal extempor - extemporally extempor extempore extempor - extend extend extended extend - extends extend extent extent - extenuate extenu extenuated extenu - extenuates extenu extenuation extenu - exterior exterior exteriorly exteriorli - exteriors exterior extermin extermin - extern extern external extern - extinct extinct extincted extinct - extincture extinctur extinguish extinguish - extirp extirp extirpate extirp - extirped extirp extol extol - extoll extol extolment extol - exton exton extort extort - extorted extort extortion extort - extortions extort extra extra - extract extract extracted extract + a a aaron aaron + abaissiez abaissiez abandon abandon + abandoned abandon abase abas + abash abash abate abat + abated abat abatement abat + abatements abat abates abat + abbess abbess abbey abbei + abbeys abbei abbominable abbomin + abbot abbot abbots abbot + abbreviated abbrevi abed ab + abel abel aberga aberga + abergavenny abergavenni abet abet + abetting abet abhominable abhomin + abhor abhor abhorr abhorr + abhorred abhor abhorring abhor + abhors abhor abhorson abhorson + abide abid abides abid + abilities abil ability abil + abject abject abjectly abjectli + abjects abject abjur abjur + abjure abjur able abl + abler abler aboard aboard + abode abod aboded abod + abodements abod aboding abod + abominable abomin abominably abomin + abominations abomin abortive abort + abortives abort abound abound + abounding abound about about + above abov abr abr + abraham abraham abram abram + abreast abreast abridg abridg + abridge abridg abridged abridg + abridgment abridg abroach abroach + abroad abroad abrogate abrog + abrook abrook abrupt abrupt + abruption abrupt abruptly abruptli + absence absenc absent absent + absey absei absolute absolut + absolutely absolut absolv absolv + absolver absolv abstains abstain + abstemious abstemi abstinence abstin + abstract abstract absurd absurd + absyrtus absyrtu abundance abund + abundant abund abundantly abundantli + abus abu abuse abus + abused abus abuser abus + abuses abus abusing abus + abutting abut aby abi + abysm abysm ac ac + academe academ academes academ + accent accent accents accent + accept accept acceptable accept + acceptance accept accepted accept + accepts accept access access + accessary accessari accessible access + accidence accid accident accid + accidental accident accidentally accident + accidents accid accite accit + accited accit accites accit + acclamations acclam accommodate accommod + accommodated accommod accommodation accommod + accommodations accommod accommodo accommodo + accompanied accompani accompany accompani + accompanying accompani accomplices accomplic + accomplish accomplish accomplished accomplish + accomplishing accomplish accomplishment accomplish + accompt accompt accord accord + accordant accord accorded accord + accordeth accordeth according accord + accordingly accordingli accords accord + accost accost accosted accost + account account accountant account + accounted account accounts account + accoutred accoutr accoutrement accoutr + accoutrements accoutr accrue accru + accumulate accumul accumulated accumul + accumulation accumul accurs accur + accursed accurs accurst accurst + accus accu accusation accus + accusations accus accusative accus + accusativo accusativo accuse accus + accused accus accuser accus + accusers accus accuses accus + accuseth accuseth accusing accus + accustom accustom accustomed accustom + ace ac acerb acerb + ache ach acheron acheron + aches ach achiev achiev + achieve achiev achieved achiev + achievement achiev achievements achiev + achiever achiev achieves achiev + achieving achiev achilles achil + aching ach achitophel achitophel + acknowledg acknowledg acknowledge acknowledg + acknowledged acknowledg acknowledgment acknowledg + acknown acknown acold acold + aconitum aconitum acordo acordo + acorn acorn acquaint acquaint + acquaintance acquaint acquainted acquaint + acquaints acquaint acquir acquir + acquire acquir acquisition acquisit + acquit acquit acquittance acquitt + acquittances acquitt acquitted acquit + acre acr acres acr + across across act act + actaeon actaeon acted act + acting act action action + actions action actium actium + active activ actively activ + activity activ actor actor + actors actor acts act + actual actual acture actur + acute acut acutely acut + ad ad adage adag + adallas adalla adam adam + adamant adam add add + added ad adder adder + adders adder addeth addeth + addict addict addicted addict + addiction addict adding ad + addition addit additions addit + addle addl address address + addressing address addrest addrest + adds add adhere adher + adheres adher adieu adieu + adieus adieu adjacent adjac + adjoin adjoin adjoining adjoin + adjourn adjourn adjudg adjudg + adjudged adjudg adjunct adjunct + administer administ administration administr + admir admir admirable admir + admiral admir admiration admir + admire admir admired admir + admirer admir admiring admir + admiringly admiringli admission admiss + admit admit admits admit + admittance admitt admitted admit + admitting admit admonish admonish + admonishing admonish admonishment admonish + admonishments admonish admonition admonit + ado ado adonis adoni + adopt adopt adopted adopt + adoptedly adoptedli adoption adopt + adoptious adopti adopts adopt + ador ador adoration ador + adorations ador adore ador + adorer ador adores ador + adorest adorest adoreth adoreth + adoring ador adorn adorn + adorned adorn adornings adorn + adornment adorn adorns adorn + adown adown adramadio adramadio + adrian adrian adriana adriana + adriano adriano adriatic adriat + adsum adsum adulation adul + adulterate adulter adulterates adulter + adulterers adulter adulteress adulteress + adulteries adulteri adulterous adulter + adultery adulteri adultress adultress + advanc advanc advance advanc + advanced advanc advancement advanc + advancements advanc advances advanc + advancing advanc advantage advantag + advantageable advantag advantaged advantag + advantageous advantag advantages advantag + advantaging advantag advent advent + adventur adventur adventure adventur + adventures adventur adventuring adventur + adventurous adventur adventurously adventur + adversaries adversari adversary adversari + adverse advers adversely advers + adversities advers adversity advers + advertis adverti advertise advertis + advertised advertis advertisement advertis + advertising advertis advice advic + advis advi advise advis + advised advis advisedly advisedli + advises advis advisings advis + advocate advoc advocation advoc + aeacida aeacida aeacides aeacid + aedile aedil aediles aedil + aegeon aegeon aegion aegion + aegles aegl aemelia aemelia + aemilia aemilia aemilius aemiliu + aeneas aenea aeolus aeolu + aer aer aerial aerial + aery aeri aesculapius aesculapiu + aeson aeson aesop aesop + aetna aetna afar afar + afear afear afeard afeard + affability affabl affable affabl + affair affair affaire affair + affairs affair affect affect + affectation affect affectations affect + affected affect affectedly affectedli + affecteth affecteth affecting affect + affection affect affectionate affection + affectionately affection affections affect + affects affect affeer affeer + affianc affianc affiance affianc + affianced affianc affied affi + affin affin affined affin + affinity affin affirm affirm + affirmation affirm affirmatives affirm + afflict afflict afflicted afflict + affliction afflict afflictions afflict + afflicts afflict afford afford + affordeth affordeth affords afford + affray affrai affright affright + affrighted affright affrights affright + affront affront affronted affront + affy affi afield afield + afire afir afloat afloat + afoot afoot afore afor + aforehand aforehand aforesaid aforesaid + afraid afraid afresh afresh + afric afric africa africa + african african afront afront + after after afternoon afternoon + afterward afterward afterwards afterward + ag ag again again + against against agamemmon agamemmon + agamemnon agamemnon agate agat + agaz agaz age ag + aged ag agenor agenor + agent agent agents agent + ages ag aggravate aggrav + aggrief aggrief agile agil + agincourt agincourt agitation agit + aglet aglet agnize agniz + ago ago agone agon + agony agoni agree agre + agreed agre agreeing agre + agreement agreement agrees agre + agrippa agrippa aground aground + ague agu aguecheek aguecheek + agued agu agueface aguefac + agues agu ah ah + aha aha ahungry ahungri + ai ai aialvolio aialvolio + aiaria aiaria aid aid + aidance aidanc aidant aidant + aided aid aiding aid + aidless aidless aids aid + ail ail aim aim + aimed aim aimest aimest + aiming aim aims aim + ainsi ainsi aio aio + air air aired air + airless airless airs air + airy airi ajax ajax + akilling akil al al + alabaster alabast alack alack + alacrity alacr alarbus alarbu + alarm alarm alarms alarm + alarum alarum alarums alarum + alas ala alb alb + alban alban albans alban + albany albani albeit albeit + albion albion alchemist alchemist + alchemy alchemi alcibiades alcibiad + alcides alcid alder alder + alderman alderman aldermen aldermen + ale al alecto alecto + alehouse alehous alehouses alehous + alencon alencon alengon alengon + aleppo aleppo ales al + alewife alewif alexander alexand + alexanders alexand alexandria alexandria + alexandrian alexandrian alexas alexa + alias alia alice alic + alien alien aliena aliena + alight alight alighted alight + alights alight aliis alii + alike alik alisander alisand + alive aliv all all + alla alla allay allai + allayed allai allaying allai + allayment allay allayments allay + allays allai allegation alleg + allegations alleg allege alleg + alleged alleg allegiance allegi + allegiant allegi alley allei + alleys allei allhallowmas allhallowma + alliance allianc allicholy allicholi + allied alli allies alli + alligant allig alligator allig + allons allon allot allot + allots allot allotted allot + allottery allotteri allow allow + allowance allow allowed allow + allowing allow allows allow + allur allur allure allur + allurement allur alluring allur + allusion allus ally alli + allycholly allycholli almain almain + almanac almanac almanack almanack + almanacs almanac almighty almighti + almond almond almost almost + alms alm almsman almsman + aloes alo aloft aloft + alone alon along along + alonso alonso aloof aloof + aloud aloud alphabet alphabet + alphabetical alphabet alphonso alphonso + alps alp already alreadi + also also alt alt + altar altar altars altar + alter alter alteration alter + altered alter alters alter + althaea althaea although although + altitude altitud altogether altogeth + alton alton alway alwai + always alwai am am + amaimon amaimon amain amain + amaking amak amamon amamon + amaz amaz amaze amaz + amazed amaz amazedly amazedli + amazedness amazed amazement amaz + amazes amaz amazeth amazeth + amazing amaz amazon amazon + amazonian amazonian amazons amazon + ambassador ambassador ambassadors ambassador + amber amber ambiguides ambiguid + ambiguities ambigu ambiguous ambigu + ambition ambit ambitions ambit + ambitious ambiti ambitiously ambiti + amble ambl ambled ambl + ambles ambl ambling ambl + ambo ambo ambuscadoes ambuscado + ambush ambush amen amen + amend amend amended amend + amendment amend amends amend + amerce amerc america america + ames am amiable amiabl + amid amid amidst amidst + amiens amien amis ami + amiss amiss amities amiti + amity amiti amnipotent amnipot + among among amongst amongst + amorous amor amorously amor + amort amort amount amount + amounts amount amour amour + amphimacus amphimacu ample ampl + ampler ampler amplest amplest + amplified amplifi amplify amplifi + amply ampli ampthill ampthil + amurath amurath amyntas amynta + an an anatomiz anatomiz + anatomize anatom anatomy anatomi + ancestor ancestor ancestors ancestor + ancestry ancestri anchises anchis + anchor anchor anchorage anchorag + anchored anchor anchoring anchor + anchors anchor anchovies anchovi + ancient ancient ancientry ancientri + ancients ancient ancus ancu + and and andirons andiron + andpholus andpholu andren andren + andrew andrew andromache andromach + andronici andronici andronicus andronicu + anew anew ang ang + angel angel angelica angelica + angelical angel angelo angelo + angels angel anger anger + angerly angerli angers anger + anges ang angiers angier + angl angl anglais anglai + angle angl angler angler + angleterre angleterr angliae anglia + angling angl anglish anglish + angrily angrili angry angri + anguish anguish angus angu + animal anim animals anim + animis animi anjou anjou + ankle ankl anna anna + annals annal anne ann + annex annex annexed annex + annexions annexion annexment annex + annothanize annothan announces announc + annoy annoi annoyance annoy + annoying annoi annual annual + anoint anoint anointed anoint + anon anon another anoth + anselmo anselmo answer answer + answerable answer answered answer + answerest answerest answering answer + answers answer ant ant + ante ant antenor antenor + antenorides antenorid anteroom anteroom + anthem anthem anthems anthem + anthony anthoni anthropophagi anthropophagi + anthropophaginian anthropophaginian antiates antiat + antic antic anticipate anticip + anticipates anticip anticipatest anticipatest + anticipating anticip anticipation anticip + antick antick anticly anticli + antics antic antidote antidot + antidotes antidot antigonus antigonu + antiopa antiopa antipathy antipathi + antipholus antipholu antipholuses antipholus + antipodes antipod antiquary antiquari + antique antiqu antiquity antiqu + antium antium antoniad antoniad + antonio antonio antonius antoniu + antony antoni antres antr + anvil anvil any ani + anybody anybodi anyone anyon + anything anyth anywhere anywher + ap ap apace apac + apart apart apartment apart + apartments apart ape ap + apemantus apemantu apennines apennin + apes ap apiece apiec + apish apish apollinem apollinem + apollo apollo apollodorus apollodoru + apology apolog apoplex apoplex + apoplexy apoplexi apostle apostl + apostles apostl apostrophas apostropha + apoth apoth apothecary apothecari + appal appal appall appal + appalled appal appals appal + apparel apparel apparell apparel + apparelled apparel apparent appar + apparently appar apparition apparit + apparitions apparit appeach appeach + appeal appeal appeals appeal + appear appear appearance appear + appeared appear appeareth appeareth + appearing appear appears appear + appeas appea appease appeas + appeased appeas appelant appel + appele appel appelee appele + appeles appel appelez appelez + appellant appel appellants appel + appelons appelon appendix appendix + apperil apperil appertain appertain + appertaining appertain appertainings appertain + appertains appertain appertinent appertin + appertinents appertin appetite appetit + appetites appetit applaud applaud + applauded applaud applauding applaud + applause applaus applauses applaus + apple appl apples appl + appletart appletart appliance applianc + appliances applianc applications applic + applied appli applies appli + apply appli applying appli + appoint appoint appointed appoint + appointment appoint appointments appoint + appoints appoint apprehend apprehend + apprehended apprehend apprehends apprehend + apprehension apprehens apprehensions apprehens + apprehensive apprehens apprendre apprendr + apprenne apprenn apprenticehood apprenticehood + appris appri approach approach + approachers approach approaches approach + approacheth approacheth approaching approach + approbation approb approof approof + appropriation appropri approv approv + approve approv approved approv + approvers approv approves approv + appurtenance appurten appurtenances appurten + apricocks apricock april april + apron apron aprons apron + apt apt apter apter + aptest aptest aptly aptli + aptness apt aqua aqua + aquilon aquilon aquitaine aquitain + arabia arabia arabian arabian + araise arais arbitrate arbitr + arbitrating arbitr arbitrator arbitr + arbitrement arbitr arbors arbor + arbour arbour arc arc + arch arch archbishop archbishop + archbishopric archbishopr archdeacon archdeacon + arched arch archelaus archelau + archer archer archers archer + archery archeri archibald archibald + archidamus archidamu architect architect + arcu arcu arde ard + arden arden ardent ardent + ardour ardour are ar + argal argal argier argier + argo argo argosies argosi + argosy argosi argu argu + argue argu argued argu + argues argu arguing argu + argument argument arguments argument + argus argu ariachne ariachn + ariadne ariadn ariel ariel + aries ari aright aright + arinado arinado arinies arini + arion arion arise aris + arises aris ariseth ariseth + arising aris aristode aristod + aristotle aristotl arithmetic arithmet + arithmetician arithmetician ark ark + arm arm arma arma + armado armado armadoes armado + armagnac armagnac arme arm + armed arm armenia armenia + armies armi armigero armigero + arming arm armipotent armipot + armor armor armour armour + armourer armour armourers armour + armours armour armoury armouri + arms arm army armi + arn arn aroint aroint + arose aros arouse arous + aroused arous arragon arragon + arraign arraign arraigned arraign + arraigning arraign arraignment arraign + arrant arrant arras arra + array arrai arrearages arrearag + arrest arrest arrested arrest + arrests arrest arriv arriv + arrival arriv arrivance arriv + arrive arriv arrived arriv + arrives arriv arriving arriv + arrogance arrog arrogancy arrog + arrogant arrog arrow arrow + arrows arrow art art + artemidorus artemidoru arteries arteri + arthur arthur article articl + articles articl articulate articul + artificer artific artificial artifici + artillery artilleri artire artir + artist artist artists artist + artless artless artois artoi + arts art artus artu + arviragus arviragu as as + asaph asaph ascanius ascaniu + ascend ascend ascended ascend + ascendeth ascendeth ascends ascend + ascension ascens ascent ascent + ascribe ascrib ascribes ascrib + ash ash asham asham + ashamed asham asher asher + ashes ash ashford ashford + ashore ashor ashouting ashout + ashy ashi asia asia + aside asid ask ask + askance askanc asked ask + asker asker asketh asketh + asking ask asks ask + aslant aslant asleep asleep + asmath asmath asp asp + aspect aspect aspects aspect + aspen aspen aspersion aspers + aspic aspic aspicious aspici + aspics aspic aspir aspir + aspiration aspir aspire aspir + aspiring aspir asquint asquint + ass ass assail assail + assailable assail assailant assail + assailants assail assailed assail + assaileth assaileth assailing assail + assails assail assassination assassin + assault assault assaulted assault + assaults assault assay assai + assaying assai assays assai + assemblance assembl assemble assembl + assembled assembl assemblies assembl + assembly assembl assent assent + asses ass assez assez + assign assign assigned assign + assigns assign assinico assinico + assist assist assistance assist + assistances assist assistant assist + assistants assist assisted assist + assisting assist associate associ + associated associ associates associ + assuage assuag assubjugate assubjug + assum assum assume assum + assumes assum assumption assumpt + assur assur assurance assur + assure assur assured assur + assuredly assuredli assures assur + assyrian assyrian astonish astonish + astonished astonish astraea astraea + astray astrai astrea astrea + astronomer astronom astronomers astronom + astronomical astronom astronomy astronomi + asunder asund at at + atalanta atalanta ate at + ates at athenian athenian + athenians athenian athens athen + athol athol athversary athversari + athwart athwart atlas atla + atomies atomi atomy atomi + atone aton atonement aton + atonements aton atropos atropo + attach attach attached attach + attachment attach attain attain + attainder attaind attains attain + attaint attaint attainted attaint + attainture attaintur attempt attempt + attemptable attempt attempted attempt + attempting attempt attempts attempt + attend attend attendance attend + attendant attend attendants attend + attended attend attendents attend + attendeth attendeth attending attend + attends attend attent attent + attention attent attentive attent + attentivenes attentiven attest attest + attested attest attir attir + attire attir attired attir + attires attir attorney attornei + attorneyed attornei attorneys attornei + attorneyship attorneyship attract attract + attraction attract attractive attract + attracts attract attribute attribut + attributed attribut attributes attribut + attribution attribut attributive attribut + atwain atwain au au + aubrey aubrei auburn auburn + aucun aucun audacious audaci + audaciously audaci audacity audac + audible audibl audience audienc + audis audi audit audit + auditor auditor auditors auditor + auditory auditori audre audr + audrey audrei aufidius aufidiu + aufidiuses aufidius auger auger + aught aught augment augment + augmentation augment augmented augment + augmenting augment augurer augur + augurers augur augures augur + auguring augur augurs augur + augury auguri august august + augustus augustu auld auld + aumerle aumerl aunchient aunchient + aunt aunt aunts aunt + auricular auricular aurora aurora + auspicious auspici aussi aussi + austere auster austerely auster + austereness auster austerity auster + austria austria aut aut + authentic authent author author + authorities author authority author + authorized author authorizing author + authors author autolycus autolycu + autre autr autumn autumn + auvergne auvergn avail avail + avails avail avarice avaric + avaricious avarici avaunt avaunt + ave av aveng aveng + avenge aveng avenged aveng + averring aver avert avert + aves av avez avez + avis avi avoid avoid + avoided avoid avoiding avoid + avoids avoid avoirdupois avoirdupoi + avouch avouch avouched avouch + avouches avouch avouchment avouch + avow avow aw aw + await await awaits await + awak awak awake awak + awaked awak awaken awaken + awakened awaken awakens awaken + awakes awak awaking awak + award award awards award + awasy awasi away awai + awe aw aweary aweari + aweless aweless awful aw + awhile awhil awkward awkward + awl awl awooing awoo + awork awork awry awri + axe ax axle axl + axletree axletre ay ay + aye ay ayez ayez + ayli ayli azur azur + azure azur b b + ba ba baa baa + babbl babbl babble babbl + babbling babbl babe babe + babes babe babies babi + baboon baboon baboons baboon + baby babi babylon babylon + bacare bacar bacchanals bacchan + bacchus bacchu bach bach + bachelor bachelor bachelors bachelor + back back backbite backbit + backbitten backbitten backing back + backs back backward backward + backwardly backwardli backwards backward + bacon bacon bacons bacon + bad bad bade bade + badge badg badged badg + badges badg badly badli + badness bad baes bae + baffl baffl baffle baffl + baffled baffl bag bag + baggage baggag bagot bagot + bagpipe bagpip bags bag + bail bail bailiff bailiff + baillez baillez baily baili + baisant baisant baisees baise + baiser baiser bait bait + baited bait baiting bait + baitings bait baits bait + bajazet bajazet bak bak + bake bake baked bake + baker baker bakers baker + bakes bake baking bake + bal bal balanc balanc + balance balanc balcony balconi + bald bald baldrick baldrick + bale bale baleful bale + balk balk ball ball + ballad ballad ballads ballad + ballast ballast ballasting ballast + ballet ballet ballow ballow + balls ball balm balm + balms balm balmy balmi + balsam balsam balsamum balsamum + balth balth balthasar balthasar + balthazar balthazar bames bame + ban ban banbury banburi + band band bandied bandi + banding band bandit bandit + banditti banditti banditto banditto + bands band bandy bandi + bandying bandi bane bane + banes bane bang bang + bangor bangor banish banish + banished banish banishers banish + banishment banish banister banist + bank bank bankrout bankrout + bankrupt bankrupt bankrupts bankrupt + banks bank banner banner + bannerets banneret banners banner + banning ban banns bann + banquet banquet banqueted banquet + banqueting banquet banquets banquet + banquo banquo bans ban + baptism baptism baptista baptista + baptiz baptiz bar bar + barbarian barbarian barbarians barbarian + barbarism barbar barbarous barbar + barbary barbari barbason barbason + barbed barb barber barber + barbermonger barbermong bard bard + bardolph bardolph bards bard + bare bare bared bare + barefac barefac barefaced barefac + barefoot barefoot bareheaded barehead + barely bare bareness bare + barful bar bargain bargain + bargains bargain barge barg + bargulus bargulu baring bare + bark bark barking bark + barkloughly barkloughli barks bark + barky barki barley barlei + barm barm barn barn + barnacles barnacl barnardine barnardin + barne barn barnes barn + barnet barnet barns barn + baron baron barons baron + barony baroni barr barr + barrabas barraba barrel barrel + barrels barrel barren barren + barrenly barrenli barrenness barren + barricado barricado barricadoes barricado + barrow barrow bars bar + barson barson barter barter + bartholomew bartholomew bas ba + basan basan base base + baseless baseless basely base + baseness base baser baser + bases base basest basest + bashful bash bashfulness bash + basilisco basilisco basilisk basilisk + basilisks basilisk basimecu basimecu + basin basin basingstoke basingstok + basins basin basis basi + bask bask basket basket + baskets basket bass bass + bassanio bassanio basset basset + bassianus bassianu basta basta + bastard bastard bastardizing bastard + bastardly bastardli bastards bastard + bastardy bastardi basted bast + bastes bast bastinado bastinado + basting bast bat bat + batailles batail batch batch + bate bate bated bate + bates bate bath bath + bathe bath bathed bath + bathing bath baths bath + bating bate batler batler + bats bat batt batt + battalia battalia battalions battalion + batten batten batter batter + battering batter batters batter + battery batteri battle battl + battled battl battlefield battlefield + battlements battlement battles battl + batty batti bauble baubl + baubles baubl baubling baubl + baulk baulk bavin bavin + bawcock bawcock bawd bawd + bawdry bawdri bawds bawd + bawdy bawdi bawl bawl + bawling bawl bay bai + baying bai baynard baynard + bayonne bayonn bays bai + be be beach beach + beached beach beachy beachi + beacon beacon bead bead + beaded bead beadle beadl + beadles beadl beads bead + beadsmen beadsmen beagle beagl + beagles beagl beak beak + beaks beak beam beam + beamed beam beams beam + bean bean beans bean + bear bear beard beard + bearded beard beardless beardless + beards beard bearer bearer + bearers bearer bearest bearest + beareth beareth bearing bear + bears bear beast beast + beastliest beastliest beastliness beastli + beastly beastli beasts beast + beat beat beated beat + beaten beaten beating beat + beatrice beatric beats beat + beau beau beaufort beaufort + beaumond beaumond beaumont beaumont + beauteous beauteou beautied beauti + beauties beauti beautified beautifi + beautiful beauti beautify beautifi + beauty beauti beaver beaver + beavers beaver became becam + because becaus bechanc bechanc + bechance bechanc bechanced bechanc + beck beck beckon beckon + beckons beckon becks beck + becom becom become becom + becomed becom becomes becom + becoming becom becomings becom + bed bed bedabbled bedabbl + bedash bedash bedaub bedaub + bedazzled bedazzl bedchamber bedchamb + bedclothes bedcloth bedded bed + bedeck bedeck bedecking bedeck + bedew bedew bedfellow bedfellow + bedfellows bedfellow bedford bedford + bedlam bedlam bedrench bedrench + bedrid bedrid beds bed + bedtime bedtim bedward bedward + bee bee beef beef + beefs beef beehives beehiv + been been beer beer + bees bee beest beest + beetle beetl beetles beetl + beeves beev befall befal + befallen befallen befalls befal + befell befel befits befit + befitted befit befitting befit + befor befor before befor + beforehand beforehand befortune befortun + befriend befriend befriended befriend + befriends befriend beg beg + began began beget beget + begets beget begetting beget + begg begg beggar beggar + beggared beggar beggarly beggarli + beggarman beggarman beggars beggar + beggary beggari begging beg + begin begin beginners beginn + beginning begin beginnings begin + begins begin begnawn begnawn + begone begon begot begot + begotten begotten begrimed begrim + begs beg beguil beguil + beguile beguil beguiled beguil + beguiles beguil beguiling beguil + begun begun behalf behalf + behalfs behalf behav behav + behaved behav behavedst behavedst + behavior behavior behaviors behavior + behaviour behaviour behaviours behaviour + behead behead beheaded behead + beheld beheld behest behest + behests behest behind behind + behold behold beholder behold + beholders behold beholdest beholdest + beholding behold beholds behold + behoof behoof behooffull behoofful + behooves behoov behove behov + behoves behov behowls behowl + being be bel bel + belarius belariu belch belch + belching belch beldam beldam + beldame beldam beldams beldam + belee bele belgia belgia + belie beli belied beli + belief belief beliest beliest + believ believ believe believ + believed believ believes believ + believest believest believing believ + belike belik bell bell + bellario bellario belle bell + bellied belli bellies belli + bellman bellman bellona bellona + bellow bellow bellowed bellow + bellowing bellow bellows bellow + bells bell belly belli + bellyful belly belman belman + belmont belmont belock belock + belong belong belonging belong + belongings belong belongs belong + belov belov beloved belov + beloving belov below below + belt belt belzebub belzebub + bemadding bemad bemet bemet + bemete bemet bemoan bemoan + bemoaned bemoan bemock bemock + bemoil bemoil bemonster bemonst + ben ben bench bench + bencher bencher benches bench + bend bend bended bend + bending bend bends bend + bene bene beneath beneath + benedicite benedicit benedick benedick + benediction benedict benedictus benedictu + benefactors benefactor benefice benefic + beneficial benefici benefit benefit + benefited benefit benefits benefit + benetted benet benevolence benevol + benevolences benevol benied beni + benison benison bennet bennet + bent bent bentii bentii + bentivolii bentivolii bents bent + benumbed benumb benvolio benvolio + bepaint bepaint bepray beprai + bequeath bequeath bequeathed bequeath + bequeathing bequeath bequest bequest + ber ber berard berard + berattle berattl beray berai + bere bere bereave bereav + bereaved bereav bereaves bereav + bereft bereft bergamo bergamo + bergomask bergomask berhym berhym + berhyme berhym berkeley berkelei + bermoothes bermooth bernardo bernardo + berod berod berowne berown + berri berri berries berri + berrord berrord berry berri + bertram bertram berwick berwick + bescreen bescreen beseech beseech + beseeched beseech beseechers beseech + beseeching beseech beseek beseek + beseem beseem beseemeth beseemeth + beseeming beseem beseems beseem + beset beset beshrew beshrew + beside besid besides besid + besieg besieg besiege besieg + besieged besieg beslubber beslubb + besmear besmear besmeared besmear + besmirch besmirch besom besom + besort besort besotted besot + bespake bespak bespeak bespeak + bespice bespic bespoke bespok + bespotted bespot bess bess + bessy bessi best best + bestained bestain bested best + bestial bestial bestir bestir + bestirr bestirr bestow bestow + bestowed bestow bestowing bestow + bestows bestow bestraught bestraught + bestrew bestrew bestrid bestrid + bestride bestrid bestrides bestrid + bet bet betake betak + beteem beteem bethink bethink + bethought bethought bethrothed bethroth + bethump bethump betid betid + betide betid betideth betideth + betime betim betimes betim + betoken betoken betook betook + betossed betoss betray betrai + betrayed betrai betraying betrai + betrays betrai betrims betrim + betroth betroth betrothed betroth + betroths betroth bett bett + betted bet better better + bettered better bettering better + betters better betting bet + bettre bettr between between + betwixt betwixt bevel bevel + beverage beverag bevis bevi + bevy bevi bewail bewail + bewailed bewail bewailing bewail + bewails bewail beware bewar + bewasted bewast beweep beweep + bewept bewept bewet bewet + bewhored bewhor bewitch bewitch + bewitched bewitch bewitchment bewitch + bewray bewrai beyond beyond + bezonian bezonian bezonians bezonian + bianca bianca bianco bianco + bias bia bibble bibbl + bickerings bicker bid bid + bidden bidden bidding bid + biddings bid biddy biddi + bide bide bides bide + biding bide bids bid + bien bien bier bier + bifold bifold big big + bigamy bigami biggen biggen + bigger bigger bigness big + bigot bigot bilberry bilberri + bilbo bilbo bilboes bilbo + bilbow bilbow bill bill + billeted billet billets billet + billiards billiard billing bill + billow billow billows billow + bills bill bin bin + bind bind bindeth bindeth + binding bind binds bind + biondello biondello birch birch + bird bird birding bird + birdlime birdlim birds bird + birnam birnam birth birth + birthday birthdai birthdom birthdom + birthplace birthplac birthright birthright + birthrights birthright births birth + bis bi biscuit biscuit + bishop bishop bishops bishop + bisson bisson bit bit + bitch bitch bite bite + biter biter bites bite + biting bite bits bit + bitt bitt bitten bitten + bitter bitter bitterest bitterest + bitterly bitterli bitterness bitter + blab blab blabb blabb + blabbing blab blabs blab + black black blackamoor blackamoor + blackamoors blackamoor blackberries blackberri + blackberry blackberri blacker blacker + blackest blackest blackfriars blackfriar + blackheath blackheath blackmere blackmer + blackness black blacks black + bladder bladder bladders bladder + blade blade bladed blade + blades blade blains blain + blam blam blame blame + blamed blame blameful blame + blameless blameless blames blame + blanc blanc blanca blanca + blanch blanch blank blank + blanket blanket blanks blank + blaspheme blasphem blaspheming blasphem + blasphemous blasphem blasphemy blasphemi + blast blast blasted blast + blasting blast blastments blastment + blasts blast blaz blaz + blaze blaze blazes blaze + blazing blaze blazon blazon + blazoned blazon blazoning blazon + bleach bleach bleaching bleach + bleak bleak blear blear + bleared blear bleat bleat + bleated bleat bleats bleat + bled bled bleed bleed + bleedest bleedest bleedeth bleedeth + bleeding bleed bleeds bleed + blemish blemish blemishes blemish + blench blench blenches blench + blend blend blended blend + blent blent bless bless + blessed bless blessedly blessedli + blessedness blessed blesses bless + blesseth blesseth blessing bless + blessings bless blest blest + blew blew blind blind + blinded blind blindfold blindfold + blinding blind blindly blindli + blindness blind blinds blind + blink blink blinking blink + bliss bliss blist blist + blister blister blisters blister + blithe blith blithild blithild + bloat bloat block block + blockish blockish blocks block + blois bloi blood blood + blooded blood bloodhound bloodhound + bloodied bloodi bloodier bloodier + bloodiest bloodiest bloodily bloodili + bloodless bloodless bloods blood + bloodshed bloodsh bloodshedding bloodshed + bloodstained bloodstain bloody bloodi + bloom bloom blooms bloom + blossom blossom blossoming blossom + blossoms blossom blot blot + blots blot blotted blot + blotting blot blount blount + blow blow blowed blow + blowers blower blowest blowest + blowing blow blown blown + blows blow blowse blows + blubb blubb blubber blubber + blubbering blubber blue blue + bluecaps bluecap bluest bluest + blunt blunt blunted blunt + blunter blunter bluntest bluntest + blunting blunt bluntly bluntli + bluntness blunt blunts blunt + blur blur blurr blurr + blurs blur blush blush + blushes blush blushest blushest + blushing blush blust blust + bluster bluster blusterer bluster + blusters bluster bo bo + boar boar board board + boarded board boarding board + boards board boarish boarish + boars boar boast boast + boasted boast boastful boast + boasting boast boasts boast + boat boat boats boat + boatswain boatswain bob bob + bobb bobb boblibindo boblibindo + bobtail bobtail bocchus bocchu + bode bode boded bode + bodements bodement bodes bode + bodg bodg bodied bodi + bodies bodi bodiless bodiless + bodily bodili boding bode + bodkin bodkin body bodi + bodykins bodykin bog bog + boggle boggl boggler boggler + bogs bog bohemia bohemia + bohemian bohemian bohun bohun + boil boil boiling boil + boils boil boist boist + boisterous boister boisterously boister + boitier boitier bold bold + bolden bolden bolder bolder + boldest boldest boldly boldli + boldness bold bolds bold + bolingbroke bolingbrok bolster bolster + bolt bolt bolted bolt + bolter bolter bolters bolter + bolting bolt bolts bolt + bombard bombard bombards bombard + bombast bombast bon bon + bona bona bond bond + bondage bondag bonded bond + bondmaid bondmaid bondman bondman + bondmen bondmen bonds bond + bondslave bondslav bone bone + boneless boneless bones bone + bonfire bonfir bonfires bonfir + bonjour bonjour bonne bonn + bonnet bonnet bonneted bonnet + bonny bonni bonos bono + bonto bonto bonville bonvil + bood bood book book + bookish bookish books book + boon boon boor boor + boorish boorish boors boor + boot boot booted boot + booties booti bootless bootless + boots boot booty booti + bor bor bora bora + borachio borachio bordeaux bordeaux + border border bordered border + borderers border borders border + bore bore boreas borea + bores bore boring bore + born born borne born + borough borough boroughs borough + borrow borrow borrowed borrow + borrower borrow borrowing borrow + borrows borrow bosko bosko + boskos bosko bosky boski + bosom bosom bosoms bosom + boson boson boss boss + bosworth bosworth botch botch + botcher botcher botches botch + botchy botchi both both + bots bot bottle bottl + bottled bottl bottles bottl + bottom bottom bottomless bottomless + bottoms bottom bouciqualt bouciqualt + bouge boug bough bough + boughs bough bought bought + bounce bounc bouncing bounc + bound bound bounded bound + bounden bounden boundeth boundeth + bounding bound boundless boundless + bounds bound bounteous bounteou + bounteously bounteous bounties bounti + bountiful bounti bountifully bountifulli + bounty bounti bourbier bourbier + bourbon bourbon bourchier bourchier + bourdeaux bourdeaux bourn bourn + bout bout bouts bout + bove bove bow bow + bowcase bowcas bowed bow + bowels bowel bower bower + bowing bow bowl bowl + bowler bowler bowling bowl + bowls bowl bows bow + bowsprit bowsprit bowstring bowstr + box box boxes box + boy boi boyet boyet + boyish boyish boys boi + brabant brabant brabantio brabantio + brabble brabbl brabbler brabbler + brac brac brace brace + bracelet bracelet bracelets bracelet + brach brach bracy braci + brag brag bragg bragg + braggardism braggard braggards braggard + braggart braggart braggarts braggart + bragged brag bragging brag + bragless bragless brags brag + braid braid braided braid + brain brain brained brain + brainford brainford brainish brainish + brainless brainless brains brain + brainsick brainsick brainsickly brainsickli + brake brake brakenbury brakenburi + brakes brake brambles brambl + bran bran branch branch + branches branch branchless branchless + brand brand branded brand + brandish brandish brandon brandon + brands brand bras bra + brass brass brassy brassi + brat brat brats brat + brav brav brave brave + braved brave bravely brave + braver braver bravery braveri + braves brave bravest bravest + braving brave brawl brawl + brawler brawler brawling brawl + brawls brawl brawn brawn + brawns brawn bray brai + braying brai braz braz + brazen brazen brazier brazier + breach breach breaches breach + bread bread breadth breadth + break break breaker breaker + breakfast breakfast breaking break + breaks break breast breast + breasted breast breasting breast + breastplate breastplat breasts breast + breath breath breathe breath + breathed breath breather breather + breathers breather breathes breath + breathest breathest breathing breath + breathless breathless breaths breath + brecknock brecknock bred bred + breech breech breeches breech + breeching breech breed breed + breeder breeder breeders breeder + breeding breed breeds breed + breese brees breeze breez + breff breff bretagne bretagn + brethen brethen bretheren bretheren + brethren brethren brevis brevi + brevity breviti brew brew + brewage brewag brewer brewer + brewers brewer brewing brew + brews brew briareus briareu + briars briar brib brib + bribe bribe briber briber + bribes bribe brick brick + bricklayer bricklay bricks brick + bridal bridal bride bride + bridegroom bridegroom bridegrooms bridegroom + brides bride bridge bridg + bridgenorth bridgenorth bridges bridg + bridget bridget bridle bridl + bridled bridl brief brief + briefer briefer briefest briefest + briefly briefli briefness brief + brier brier briers brier + brigandine brigandin bright bright + brighten brighten brightest brightest + brightly brightli brightness bright + brim brim brimful brim + brims brim brimstone brimston + brinded brind brine brine + bring bring bringer bringer + bringeth bringeth bringing bring + bringings bring brings bring + brinish brinish brink brink + brisk brisk brisky briski + bristle bristl bristled bristl + bristly bristli bristol bristol + bristow bristow britain britain + britaine britain britaines britain + british british briton briton + britons briton brittany brittani + brittle brittl broach broach + broached broach broad broad + broader broader broadsides broadsid + brocas broca brock brock + brogues brogu broil broil + broiling broil broils broil + broke broke broken broken + brokenly brokenli broker broker + brokers broker brokes broke + broking broke brooch brooch + brooches brooch brood brood + brooded brood brooding brood + brook brook brooks brook + broom broom broomstaff broomstaff + broth broth brothel brothel + brother brother brotherhood brotherhood + brotherhoods brotherhood brotherly brotherli + brothers brother broths broth + brought brought brow brow + brown brown browner browner + brownist brownist browny browni + brows brow browse brows + browsing brows bruis brui + bruise bruis bruised bruis + bruises bruis bruising bruis + bruit bruit bruited bruit + brundusium brundusium brunt brunt + brush brush brushes brush + brute brute brutish brutish + brutus brutu bubble bubbl + bubbles bubbl bubbling bubbl + bubukles bubukl buck buck + bucket bucket buckets bucket + bucking buck buckingham buckingham + buckle buckl buckled buckl + buckler buckler bucklers buckler + bucklersbury bucklersburi buckles buckl + buckram buckram bucks buck + bud bud budded bud + budding bud budge budg + budger budger budget budget + buds bud buff buff + buffet buffet buffeting buffet + buffets buffet bug bug + bugbear bugbear bugle bugl + bugs bug build build + builded build buildeth buildeth + building build buildings build + builds build built built + bulk bulk bulks bulk + bull bull bullcalf bullcalf + bullen bullen bullens bullen + bullet bullet bullets bullet + bullocks bullock bulls bull + bully bulli bulmer bulmer + bulwark bulwark bulwarks bulwark + bum bum bumbast bumbast + bump bump bumper bumper + bums bum bunch bunch + bunches bunch bundle bundl + bung bung bunghole bunghol + bungle bungl bunting bunt + buoy buoi bur bur + burbolt burbolt burd burd + burden burden burdened burden + burdening burden burdenous burden + burdens burden burgh burgh + burgher burgher burghers burgher + burglary burglari burgomasters burgomast + burgonet burgonet burgundy burgundi + burial burial buried buri + burier burier buriest buriest + burly burli burn burn + burned burn burnet burnet + burneth burneth burning burn + burnish burnish burns burn + burnt burnt burr burr + burrows burrow burs bur + burst burst bursting burst + bursts burst burthen burthen + burthens burthen burton burton + bury buri burying buri + bush bush bushels bushel + bushes bush bushy bushi + busied busi busily busili + busines busin business busi + businesses busi buskin buskin + busky buski buss buss + busses buss bussing buss + bustle bustl bustling bustl + busy busi but but + butcheed butche butcher butcher + butchered butcher butcheries butcheri + butcherly butcherli butchers butcher + butchery butcheri butler butler + butt butt butter butter + buttered butter butterflies butterfli + butterfly butterfli butterwoman butterwoman + buttery butteri buttock buttock + buttocks buttock button button + buttonhole buttonhol buttons button + buttress buttress buttry buttri + butts butt buxom buxom + buy bui buyer buyer + buying bui buys bui + buzz buzz buzzard buzzard + buzzards buzzard buzzers buzzer + buzzing buzz by by + bye bye byzantium byzantium + c c ca ca + cabbage cabbag cabileros cabilero + cabin cabin cabins cabin + cable cabl cables cabl + cackling cackl cacodemon cacodemon + caddis caddi caddisses caddiss + cade cade cadence cadenc + cadent cadent cades cade + cadmus cadmu caduceus caduceu + cadwal cadwal cadwallader cadwallad + caelius caeliu caelo caelo + caesar caesar caesarion caesarion + caesars caesar cage cage + caged cage cagion cagion + cain cain caithness caith + caitiff caitiff caitiffs caitiff + caius caiu cak cak + cake cake cakes cake + calaber calab calais calai + calamities calam calamity calam + calchas calcha calculate calcul + calen calen calendar calendar + calendars calendar calf calf + caliban caliban calibans caliban + calipolis calipoli cality caliti + caliver caliv call call + callat callat called call + callet callet calling call + calls call calm calm + calmest calmest calmly calmli + calmness calm calms calm + calpurnia calpurnia calumniate calumni + calumniating calumni calumnious calumni + calumny calumni calve calv + calved calv calves calv + calveskins calveskin calydon calydon + cam cam cambio cambio + cambria cambria cambric cambric + cambrics cambric cambridge cambridg + cambyses cambys came came + camel camel camelot camelot + camels camel camest camest + camillo camillo camlet camlet + camomile camomil camp camp + campeius campeiu camping camp + camps camp can can + canakin canakin canaries canari + canary canari cancel cancel + cancell cancel cancelled cancel + cancelling cancel cancels cancel + cancer cancer candidatus candidatu + candied candi candle candl + candles candl candlesticks candlestick + candy candi canidius canidiu + cank cank canker canker + cankerblossom cankerblossom cankers canker + cannibally cannib cannibals cannib + cannon cannon cannoneer cannon + cannons cannon cannot cannot + canon canon canoniz canoniz + canonize canon canonized canon + canons canon canopied canopi + canopies canopi canopy canopi + canst canst canstick canstick + canterbury canterburi cantle cantl + cantons canton canus canu + canvas canva canvass canvass + canzonet canzonet cap cap + capability capabl capable capabl + capacities capac capacity capac + caparison caparison capdv capdv + cape cape capel capel + capels capel caper caper + capers caper capet capet + caphis caphi capilet capilet + capitaine capitain capital capit + capite capit capitol capitol + capitulate capitul capocchia capocchia + capon capon capons capon + capp capp cappadocia cappadocia + capriccio capriccio capricious caprici + caps cap capt capt + captain captain captains captain + captainship captainship captious captiou + captivate captiv captivated captiv + captivates captiv captive captiv + captives captiv captivity captiv + captum captum capucius capuciu + capulet capulet capulets capulet + car car carack carack + caracks carack carat carat + caraways carawai carbonado carbonado + carbuncle carbuncl carbuncled carbuncl + carbuncles carbuncl carcanet carcanet + carcase carcas carcases carcas + carcass carcass carcasses carcass + card card cardecue cardecu + carded card carders carder + cardinal cardin cardinally cardin + cardinals cardin cardmaker cardmak + cards card carduus carduu + care care cared care + career career careers career + careful care carefully carefulli + careless careless carelessly carelessli + carelessness careless cares care + caret caret cargo cargo + carl carl carlisle carlisl + carlot carlot carman carman + carmen carmen carnal carnal + carnally carnal carnarvonshire carnarvonshir + carnation carnat carnations carnat + carol carol carous carou + carouse carous caroused carous + carouses carous carousing carous + carp carp carpenter carpent + carper carper carpet carpet + carpets carpet carping carp + carriage carriag carriages carriag + carried carri carrier carrier + carriers carrier carries carri + carrion carrion carrions carrion + carry carri carrying carri + cars car cart cart + carters carter carthage carthag + carts cart carv carv + carve carv carved carv + carver carver carves carv + carving carv cas ca + casa casa casaer casaer + casca casca case case + casement casement casements casement + cases case cash cash + cashier cashier casing case + cask cask casket casket + casketed casket caskets casket + casque casqu casques casqu + cassado cassado cassandra cassandra + cassibelan cassibelan cassio cassio + cassius cassiu cassocks cassock + cast cast castalion castalion + castaway castawai castaways castawai + casted cast caster caster + castigate castig castigation castig + castile castil castiliano castiliano + casting cast castle castl + castles castl casts cast + casual casual casually casual + casualties casualti casualty casualti + cat cat cataian cataian + catalogue catalogu cataplasm cataplasm + cataracts cataract catarrhs catarrh + catastrophe catastroph catch catch + catcher catcher catches catch + catching catch cate cate + catechising catechis catechism catech + catechize catech cater cater + caterpillars caterpillar caters cater + caterwauling caterwaul cates cate + catesby catesbi cathedral cathedr + catlike catlik catling catl + catlings catl cato cato + cats cat cattle cattl + caucasus caucasu caudle caudl + cauf cauf caught caught + cauldron cauldron caus cau + cause caus caused caus + causeless causeless causer causer + causes caus causest causest + causeth causeth cautel cautel + cautelous cautel cautels cautel + cauterizing cauter caution caution + cautions caution cavaleiro cavaleiro + cavalery cavaleri cavaliers cavali + cave cave cavern cavern + caverns cavern caves cave + caveto caveto caviary caviari + cavil cavil cavilling cavil + cawdor cawdor cawdron cawdron + cawing caw ce ce + ceas cea cease ceas + ceases ceas ceaseth ceaseth + cedar cedar cedars cedar + cedius cediu celebrate celebr + celebrated celebr celebrates celebr + celebration celebr celerity celer + celestial celesti celia celia + cell cell cellar cellar + cellarage cellarag celsa celsa + cement cement censer censer + censor censor censorinus censorinu + censur censur censure censur + censured censur censurers censur + censures censur censuring censur + centaur centaur centaurs centaur + centre centr cents cent + centuries centuri centurion centurion + centurions centurion century centuri + cerberus cerberu cerecloth cerecloth + cerements cerement ceremonial ceremoni + ceremonies ceremoni ceremonious ceremoni + ceremoniously ceremoni ceremony ceremoni + ceres cere cerns cern + certain certain certainer certain + certainly certainli certainties certainti + certainty certainti certes cert + certificate certif certified certifi + certifies certifi certify certifi + ces ce cesario cesario + cess cess cesse cess + cestern cestern cetera cetera + cette cett chaces chace + chaf chaf chafe chafe + chafed chafe chafes chafe + chaff chaff chaffless chaffless + chafing chafe chain chain + chains chain chair chair + chairs chair chalic chalic + chalice chalic chalices chalic + chalk chalk chalks chalk + chalky chalki challeng challeng + challenge challeng challenged challeng + challenger challeng challengers challeng + challenges challeng cham cham + chamber chamber chamberers chamber + chamberlain chamberlain chamberlains chamberlain + chambermaid chambermaid chambermaids chambermaid + chambers chamber chameleon chameleon + champ champ champagne champagn + champain champain champains champain + champion champion champions champion + chanc chanc chance chanc + chanced chanc chancellor chancellor + chances chanc chandler chandler + chang chang change chang + changeable changeabl changed chang + changeful chang changeling changel + changelings changel changer changer + changes chang changest changest + changing chang channel channel + channels channel chanson chanson + chant chant chanticleer chanticl + chanting chant chantries chantri + chantry chantri chants chant + chaos chao chap chap + chape chape chapel chapel + chapeless chapeless chapels chapel + chaplain chaplain chaplains chaplain + chapless chapless chaplet chaplet + chapmen chapmen chaps chap + chapter chapter character charact + charactered charact characterless characterless + characters charact charactery characteri + characts charact charbon charbon + chare chare chares chare + charg charg charge charg + charged charg chargeful charg + charges charg chargeth chargeth + charging charg chariest chariest + chariness chari charing chare + chariot chariot chariots chariot + charitable charit charitably charit + charities chariti charity chariti + charlemain charlemain charles charl + charm charm charmed charm + charmer charmer charmeth charmeth + charmian charmian charming charm + charmingly charmingli charms charm + charneco charneco charnel charnel + charolois charoloi charon charon + charter charter charters charter + chartreux chartreux chary chari + charybdis charybdi chas cha + chase chase chased chase + chaser chaser chaseth chaseth + chasing chase chaste chast + chastely chast chastis chasti + chastise chastis chastised chastis + chastisement chastis chastity chastiti + chat chat chatham chatham + chatillon chatillon chats chat + chatt chatt chattels chattel + chatter chatter chattering chatter + chattles chattl chaud chaud + chaunted chaunt chaw chaw + chawdron chawdron che che + cheap cheap cheapen cheapen + cheaper cheaper cheapest cheapest + cheaply cheapli cheapside cheapsid + cheat cheat cheated cheat + cheater cheater cheaters cheater + cheating cheat cheats cheat + check check checked check + checker checker checking check + checks check cheek cheek + cheeks cheek cheer cheer + cheered cheer cheerer cheerer + cheerful cheer cheerfully cheerfulli + cheering cheer cheerless cheerless + cheerly cheerli cheers cheer + cheese chees chequer chequer + cher cher cherish cherish + cherished cherish cherisher cherish + cherishes cherish cherishing cherish + cherries cherri cherry cherri + cherrypit cherrypit chertsey chertsei + cherub cherub cherubims cherubim + cherubin cherubin cherubins cherubin + cheshu cheshu chess chess + chest chest chester chester + chestnut chestnut chestnuts chestnut + chests chest chetas cheta + chev chev cheval cheval + chevalier chevali chevaliers chevali + cheveril cheveril chew chew + chewed chew chewet chewet + chewing chew chez chez + chi chi chick chick + chicken chicken chickens chicken + chicurmurco chicurmurco chid chid + chidden chidden chide chide + chiders chider chides chide + chiding chide chief chief + chiefest chiefest chiefly chiefli + chien chien child child + childed child childeric childer + childhood childhood childhoods childhood + childing child childish childish + childishness childish childlike childlik + childness child children children + chill chill chilling chill + chime chime chimes chime + chimney chimnei chimneypiece chimneypiec + chimneys chimnei chimurcho chimurcho + chin chin china china + chine chine chines chine + chink chink chinks chink + chins chin chipp chipp + chipper chipper chips chip + chiron chiron chirping chirp + chirrah chirrah chirurgeonly chirurgeonli + chisel chisel chitopher chitoph + chivalrous chivalr chivalry chivalri + choice choic choicely choic + choicest choicest choir choir + choirs choir chok chok + choke choke choked choke + chokes choke choking choke + choler choler choleric choler + cholers choler chollors chollor + choose choos chooser chooser + chooses choos chooseth chooseth + choosing choos chop chop + chopine chopin choplogic choplog + chopp chopp chopped chop + chopping chop choppy choppi + chops chop chopt chopt + chor chor choristers chorist + chorus choru chose chose + chosen chosen chough chough + choughs chough chrish chrish + christ christ christen christen + christendom christendom christendoms christendom + christening christen christenings christen + christian christian christianlike christianlik + christians christian christmas christma + christom christom christopher christoph + christophero christophero chronicle chronicl + chronicled chronicl chronicler chronicl + chroniclers chronicl chronicles chronicl + chrysolite chrysolit chuck chuck + chucks chuck chud chud + chuffs chuff church church + churches church churchman churchman + churchmen churchmen churchyard churchyard + churchyards churchyard churl churl + churlish churlish churlishly churlishli + churls churl churn churn + chus chu cicatrice cicatric + cicatrices cicatric cicely cice + cicero cicero ciceter cicet + ciel ciel ciitzens ciitzen + cilicia cilicia cimber cimber + cimmerian cimmerian cinable cinabl + cincture cinctur cinders cinder + cine cine cinna cinna + cinque cinqu cipher cipher + ciphers cipher circa circa + circe circ circle circl + circled circl circlets circlet + circling circl circuit circuit + circum circum circumcised circumcis + circumference circumfer circummur circummur + circumscrib circumscrib circumscribed circumscrib + circumscription circumscript circumspect circumspect + circumstance circumst circumstanced circumstanc + circumstances circumst circumstantial circumstanti + circumvent circumv circumvention circumvent + cistern cistern citadel citadel + cital cital cite cite + cited cite cites cite + cities citi citing cite + citizen citizen citizens citizen + cittern cittern city citi + civet civet civil civil + civility civil civilly civilli + clack clack clad clad + claim claim claiming claim + claims claim clamb clamb + clamber clamber clammer clammer + clamor clamor clamorous clamor + clamors clamor clamour clamour + clamours clamour clang clang + clangor clangor clap clap + clapp clapp clapped clap + clapper clapper clapping clap + claps clap clare clare + clarence clarenc claret claret + claribel claribel clasp clasp + clasps clasp clatter clatter + claud claud claudio claudio + claudius claudiu clause claus + claw claw clawed claw + clawing claw claws claw + clay clai clays clai + clean clean cleanliest cleanliest + cleanly cleanli cleans clean + cleanse cleans cleansing cleans + clear clear clearer clearer + clearest clearest clearly clearli + clearness clear clears clear + cleave cleav cleaving cleav + clef clef cleft cleft + cleitus cleitu clemency clemenc + clement clement cleomenes cleomen + cleopatpa cleopatpa cleopatra cleopatra + clepeth clepeth clept clept + clerestories clerestori clergy clergi + clergyman clergyman clergymen clergymen + clerk clerk clerkly clerkli + clerks clerk clew clew + client client clients client + cliff cliff clifford clifford + cliffords clifford cliffs cliff + clifton clifton climate climat + climature climatur climb climb + climbed climb climber climber + climbeth climbeth climbing climb + climbs climb clime clime + cling cling clink clink + clinking clink clinquant clinquant + clip clip clipp clipp + clipper clipper clippeth clippeth + clipping clip clipt clipt + clitus clitu clo clo + cloak cloak cloakbag cloakbag + cloaks cloak clock clock + clocks clock clod clod + cloddy cloddi clodpole clodpol + clog clog clogging clog + clogs clog cloister cloister + cloistress cloistress cloquence cloquenc + clos clo close close + closed close closely close + closeness close closer closer + closes close closest closest + closet closet closing close + closure closur cloten cloten + clotens cloten cloth cloth + clothair clothair clotharius clothariu + clothe cloth clothes cloth + clothier clothier clothiers clothier + clothing cloth cloths cloth + clotpoles clotpol clotpoll clotpol + cloud cloud clouded cloud + cloudiness cloudi clouds cloud + cloudy cloudi clout clout + clouted clout clouts clout + cloven cloven clover clover + cloves clove clovest clovest + clowder clowder clown clown + clownish clownish clowns clown + cloy cloi cloyed cloi + cloying cloi cloyless cloyless + cloyment cloyment cloys cloi + club club clubs club + cluck cluck clung clung + clust clust clusters cluster + clutch clutch clyster clyster + cneius cneiu cnemies cnemi + co co coach coach + coaches coach coachmakers coachmak + coact coact coactive coactiv + coagulate coagul coal coal + coals coal coarse coars + coarsely coars coast coast + coasting coast coasts coast + coat coat coated coat + coats coat cobble cobbl + cobbled cobbl cobbler cobbler + cobham cobham cobloaf cobloaf + cobweb cobweb cobwebs cobweb + cock cock cockatrice cockatric + cockatrices cockatric cockle cockl + cockled cockl cockney cocknei + cockpit cockpit cocks cock + cocksure cocksur coctus coctu + cocytus cocytu cod cod + codding cod codling codl + codpiece codpiec codpieces codpiec + cods cod coelestibus coelestibu + coesar coesar coeur coeur + coffer coffer coffers coffer + coffin coffin coffins coffin + cog cog cogging cog + cogitation cogit cogitations cogit + cognition cognit cognizance cogniz + cogscomb cogscomb cohabitants cohabit + coher coher cohere coher + coherence coher coherent coher + cohorts cohort coif coif + coign coign coil coil + coin coin coinage coinag + coiner coiner coining coin + coins coin col col + colbrand colbrand colchos colcho + cold cold colder colder + coldest coldest coldly coldli + coldness cold coldspur coldspur + colebrook colebrook colic colic + collar collar collars collar + collateral collater colleagued colleagu + collect collect collected collect + collection collect college colleg + colleges colleg collied colli + collier collier colliers collier + collop collop collusion collus + colme colm colmekill colmekil + coloquintida coloquintida color color + colors color colossus colossu + colour colour colourable colour + coloured colour colouring colour + colours colour colt colt + colted colt colts colt + columbine columbin columbines columbin + colville colvil com com + comagene comagen comart comart + comb comb combat combat + combatant combat combatants combat + combated combat combating combat + combin combin combinate combin + combination combin combine combin + combined combin combless combless + combustion combust come come + comedian comedian comedians comedian + comedy comedi comeliness comeli + comely come comer comer + comers comer comes come + comest comest comet comet + cometh cometh comets comet + comfect comfect comfit comfit + comfits comfit comfort comfort + comfortable comfort comforted comfort + comforter comfort comforting comfort + comfortless comfortless comforts comfort + comic comic comical comic + coming come comings come + cominius cominiu comma comma + command command commande command + commanded command commander command + commanders command commanding command + commandment command commandments command + commands command comme comm + commenc commenc commence commenc + commenced commenc commencement commenc + commences commenc commencing commenc + commend commend commendable commend + commendation commend commendations commend + commended commend commending commend + commends commend comment comment + commentaries commentari commenting comment + comments comment commerce commerc + commingled commingl commiseration commiser + commission commiss commissioners commission + commissions commiss commit commit + commits commit committ committ + committed commit committing commit + commix commix commixed commix + commixtion commixt commixture commixtur + commodious commodi commodities commod + commodity commod common common + commonalty commonalti commoner common + commoners common commonly commonli + commons common commonweal commonw + commonwealth commonwealth commotion commot + commotions commot commune commun + communicat communicat communicate commun + communication commun communities commun + community commun comonty comonti + compact compact companies compani + companion companion companions companion + companionship companionship company compani + compar compar comparative compar + compare compar compared compar + comparing compar comparison comparison + comparisons comparison compartner compartn + compass compass compasses compass + compassing compass compassion compass + compassionate compassion compeers compeer + compel compel compell compel + compelled compel compelling compel + compels compel compensation compens + competence compet competency compet + competent compet competitor competitor + competitors competitor compil compil + compile compil compiled compil + complain complain complainer complain + complainest complainest complaining complain + complainings complain complains complain + complaint complaint complaints complaint + complement complement complements complement + complete complet complexion complexion + complexioned complexion complexions complexion + complices complic complies compli + compliment compliment complimental compliment + compliments compliment complot complot + complots complot complotted complot + comply compli compos compo + compose compos composed compos + composition composit compost compost + composture compostur composure composur + compound compound compounded compound + compounds compound comprehend comprehend + comprehended comprehend comprehends comprehend + compremises compremis compris compri + comprising compris compromis compromi + compromise compromis compt compt + comptible comptibl comptrollers comptrol + compulsatory compulsatori compulsion compuls + compulsive compuls compunctious compuncti + computation comput comrade comrad + comrades comrad comutual comutu + con con concave concav + concavities concav conceal conceal + concealed conceal concealing conceal + concealment conceal concealments conceal + conceals conceal conceit conceit + conceited conceit conceitless conceitless + conceits conceit conceiv conceiv + conceive conceiv conceived conceiv + conceives conceiv conceiving conceiv + conception concept conceptions concept + conceptious concepti concern concern + concernancy concern concerneth concerneth + concerning concern concernings concern + concerns concern conclave conclav + conclud conclud conclude conclud + concluded conclud concludes conclud + concluding conclud conclusion conclus + conclusions conclus concolinel concolinel + concord concord concubine concubin + concupiscible concupisc concupy concupi + concur concur concurring concur + concurs concur condemn condemn + condemnation condemn condemned condemn + condemning condemn condemns condemn + condescend condescend condign condign + condition condit conditionally condition + conditions condit condole condol + condolement condol condoling condol + conduce conduc conduct conduct + conducted conduct conducting conduct + conductor conductor conduit conduit + conduits conduit conected conect + coney conei confection confect + confectionary confectionari confections confect + confederacy confederaci confederate confeder + confederates confeder confer confer + conference confer conferr conferr + conferring confer confess confess + confessed confess confesses confess + confesseth confesseth confessing confess + confession confess confessions confess + confessor confessor confidence confid + confident confid confidently confid + confin confin confine confin + confined confin confineless confineless + confiners confin confines confin + confining confin confirm confirm + confirmation confirm confirmations confirm + confirmed confirm confirmer confirm + confirmers confirm confirming confirm + confirmities confirm confirms confirm + confiscate confisc confiscated confisc + confiscation confisc confixed confix + conflict conflict conflicting conflict + conflicts conflict confluence confluenc + conflux conflux conform conform + conformable conform confound confound + confounded confound confounding confound + confounds confound confront confront + confronted confront confus confu + confused confus confusedly confusedli + confusion confus confusions confus + confutation confut confutes confut + congeal congeal congealed congeal + congealment congeal congee conge + conger conger congest congest + congied congi congratulate congratul + congreeing congre congreeted congreet + congregate congreg congregated congreg + congregation congreg congregations congreg + congruent congruent congruing congru + conies coni conjectural conjectur + conjecture conjectur conjectures conjectur + conjoin conjoin conjoined conjoin + conjoins conjoin conjointly conjointli + conjunct conjunct conjunction conjunct + conjunctive conjunct conjur conjur + conjuration conjur conjurations conjur + conjure conjur conjured conjur + conjurer conjur conjurers conjur + conjures conjur conjuring conjur + conjuro conjuro conn conn + connected connect connive conniv + conqu conqu conquer conquer + conquered conquer conquering conquer + conqueror conqueror conquerors conqueror + conquers conquer conquest conquest + conquests conquest conquring conqur + conrade conrad cons con + consanguineous consanguin consanguinity consanguin + conscienc conscienc conscience conscienc + consciences conscienc conscionable conscion + consecrate consecr consecrated consecr + consecrations consecr consent consent + consented consent consenting consent + consents consent consequence consequ + consequences consequ consequently consequ + conserve conserv conserved conserv + conserves conserv consider consid + considerance consider considerate consider + consideration consider considerations consider + considered consid considering consid + considerings consid considers consid + consign consign consigning consign + consist consist consisteth consisteth + consisting consist consistory consistori + consists consist consolate consol + consolation consol consonancy conson + consonant conson consort consort + consorted consort consortest consortest + conspectuities conspectu conspir conspir + conspiracy conspiraci conspirant conspir + conspirator conspir conspirators conspir + conspire conspir conspired conspir + conspirers conspir conspires conspir + conspiring conspir constable constabl + constables constabl constance constanc + constancies constanc constancy constanc + constant constant constantine constantin + constantinople constantinopl constantly constantli + constellation constel constitution constitut + constrain constrain constrained constrain + constraineth constraineth constrains constrain + constraint constraint constring constr + construction construct construe constru + consul consul consuls consul + consulship consulship consulships consulship + consult consult consulting consult + consults consult consum consum + consume consum consumed consum + consumes consum consuming consum + consummate consumm consummation consumm + consumption consumpt consumptions consumpt + contagion contagion contagious contagi + contain contain containing contain + contains contain contaminate contamin + contaminated contamin contemn contemn + contemned contemn contemning contemn + contemns contemn contemplate contempl + contemplation contempl contemplative contempl + contempt contempt contemptible contempt + contempts contempt contemptuous contemptu + contemptuously contemptu contend contend + contended contend contending contend + contendon contendon content content + contenta contenta contented content + contenteth contenteth contention content + contentious contenti contentless contentless + contento contento contents content + contest contest contestation contest + continence contin continency contin + continent contin continents contin + continu continu continual continu + continually continu continuance continu + continuantly continuantli continuate continu + continue continu continued continu + continuer continu continues continu + continuing continu contract contract + contracted contract contracting contract + contraction contract contradict contradict + contradicted contradict contradiction contradict + contradicts contradict contraries contrari + contrarieties contrarieti contrariety contrarieti + contrarious contrari contrariously contrari + contrary contrari contre contr + contribution contribut contributors contributor + contrite contrit contriv contriv + contrive contriv contrived contriv + contriver contriv contrives contriv + contriving contriv control control + controll control controller control + controlling control controlment control + controls control controversy controversi + contumelious contumeli contumeliously contumeli + contumely contum contusions contus + convenience conveni conveniences conveni + conveniency conveni convenient conveni + conveniently conveni convented convent + conventicles conventicl convents convent + convers conver conversant convers + conversation convers conversations convers + converse convers conversed convers + converses convers conversing convers + conversion convers convert convert + converted convert convertest convertest + converting convert convertite convertit + convertites convertit converts convert + convey convei conveyance convey + conveyances convey conveyers convey + conveying convei convict convict + convicted convict convince convinc + convinced convinc convinces convinc + convive conviv convocation convoc + convoy convoi convulsions convuls + cony coni cook cook + cookery cookeri cooks cook + cool cool cooled cool + cooling cool cools cool + coop coop coops coop + cop cop copatain copatain + cope cope cophetua cophetua + copied copi copies copi + copious copiou copper copper + copperspur copperspur coppice coppic + copulation copul copulatives copul + copy copi cor cor + coragio coragio coral coral + coram coram corambus corambu + coranto coranto corantos coranto + corbo corbo cord cord + corded cord cordelia cordelia + cordial cordial cordis cordi + cords cord core core + corin corin corinth corinth + corinthian corinthian coriolanus coriolanu + corioli corioli cork cork + corky corki cormorant cormor + corn corn cornelia cornelia + cornelius corneliu corner corner + corners corner cornerstone cornerston + cornets cornet cornish cornish + corns corn cornuto cornuto + cornwall cornwal corollary corollari + coronal coron coronation coron + coronet coronet coronets coronet + corporal corpor corporals corpor + corporate corpor corpse corps + corpulent corpul correct correct + corrected correct correcting correct + correction correct correctioner correction + corrects correct correspondence correspond + correspondent correspond corresponding correspond + corresponsive correspons corrigible corrig + corrival corriv corrivals corriv + corroborate corrobor corrosive corros + corrupt corrupt corrupted corrupt + corrupter corrupt corrupters corrupt + corruptible corrupt corruptibly corrupt + corrupting corrupt corruption corrupt + corruptly corruptli corrupts corrupt + corse cors corses cors + corslet corslet cosmo cosmo + cost cost costard costard + costermongers costermong costlier costlier + costly costli costs cost + cot cot cote cote + coted cote cotsall cotsal + cotsole cotsol cotswold cotswold + cottage cottag cottages cottag + cotus cotu couch couch + couched couch couching couch + couchings couch coude coud + cough cough coughing cough + could could couldst couldst + coulter coulter council council + councillor councillor councils council + counsel counsel counsell counsel + counsellor counsellor counsellors counsellor + counselor counselor counselors counselor + counsels counsel count count + counted count countenanc countenanc + countenance counten countenances counten + counter counter counterchange counterchang + countercheck countercheck counterfeit counterfeit + counterfeited counterfeit counterfeiting counterfeit + counterfeitly counterfeitli counterfeits counterfeit + countermand countermand countermands countermand + countermines countermin counterpart counterpart + counterpoints counterpoint counterpois counterpoi + counterpoise counterpois counters counter + countervail countervail countess countess + countesses countess counties counti + counting count countless countless + countries countri countrv countrv + country countri countryman countryman + countrymen countrymen counts count + county counti couper couper + couple coupl coupled coupl + couplement couplement couples coupl + couplet couplet couplets couplet + cour cour courage courag + courageous courag courageously courag + courages courag courier courier + couriers courier couronne couronn + cours cour course cours + coursed cours courser courser + coursers courser courses cours + coursing cours court court + courted court courteous courteou + courteously courteous courtesan courtesan + courtesies courtesi courtesy courtesi + courtezan courtezan courtezans courtezan + courtier courtier courtiers courtier + courtlike courtlik courtly courtli + courtney courtnei courts court + courtship courtship cousin cousin + cousins cousin couterfeit couterfeit + coutume coutum covenant coven + covenants coven covent covent + coventry coventri cover cover + covered cover covering cover + coverlet coverlet covers cover + covert covert covertly covertli + coverture covertur covet covet + coveted covet coveting covet + covetings covet covetous covet + covetously covet covetousness covet + covets covet cow cow + coward coward cowarded coward + cowardice cowardic cowardly cowardli + cowards coward cowardship cowardship + cowish cowish cowl cowl + cowslip cowslip cowslips cowslip + cox cox coxcomb coxcomb + coxcombs coxcomb coy coi + coystrill coystril coz coz + cozen cozen cozenage cozenag + cozened cozen cozener cozen + cozeners cozen cozening cozen + coziers cozier crab crab + crabbed crab crabs crab + crack crack cracked crack + cracker cracker crackers cracker + cracking crack cracks crack + cradle cradl cradled cradl + cradles cradl craft craft + crafted craft craftied crafti + craftier craftier craftily craftili + crafts craft craftsmen craftsmen + crafty crafti cram cram + cramm cramm cramp cramp + cramps cramp crams cram + cranking crank cranks crank + cranmer cranmer crannied cranni + crannies cranni cranny cranni + crants crant crare crare + crash crash crassus crassu + crav crav crave crave + craved crave craven craven + cravens craven craves crave + craveth craveth craving crave + crawl crawl crawling crawl + crawls crawl craz craz + crazed craze crazy crazi + creaking creak cream cream + create creat created creat + creates creat creating creat + creation creation creator creator + creature creatur creatures creatur + credence credenc credent credent + credible credibl credit credit + creditor creditor creditors creditor + credo credo credulity credul + credulous credul creed creed + creek creek creeks creek + creep creep creeping creep + creeps creep crept crept + crescent crescent crescive cresciv + cressets cresset cressid cressid + cressida cressida cressids cressid + cressy cressi crest crest + crested crest crestfall crestfal + crestless crestless crests crest + cretan cretan crete crete + crevice crevic crew crew + crews crew crib crib + cribb cribb cribs crib + cricket cricket crickets cricket + cried cri criedst criedst + crier crier cries cri + criest criest crieth crieth + crime crime crimeful crime + crimeless crimeless crimes crime + criminal crimin crimson crimson + cringe cring cripple crippl + crisp crisp crisped crisp + crispian crispian crispianus crispianu + crispin crispin critic critic + critical critic critics critic + croak croak croaking croak + croaks croak crocodile crocodil + cromer cromer cromwell cromwel + crone crone crook crook + crookback crookback crooked crook + crooking crook crop crop + cropp cropp crosby crosbi + cross cross crossed cross + crosses cross crossest crossest + crossing cross crossings cross + crossly crossli crossness cross + crost crost crotchets crotchet + crouch crouch crouching crouch + crow crow crowd crowd + crowded crowd crowding crowd + crowds crowd crowflowers crowflow + crowing crow crowkeeper crowkeep + crown crown crowned crown + crowner crowner crownet crownet + crownets crownet crowning crown + crowns crown crows crow + crudy crudi cruel cruel + cruell cruell crueller crueller + cruelly cruelli cruels cruel + cruelty cruelti crum crum + crumble crumbl crumbs crumb + crupper crupper crusadoes crusado + crush crush crushed crush + crushest crushest crushing crush + crust crust crusts crust + crusty crusti crutch crutch + crutches crutch cry cry + crying cry crystal crystal + crystalline crystallin crystals crystal + cub cub cubbert cubbert + cubiculo cubiculo cubit cubit + cubs cub cuckold cuckold + cuckoldly cuckoldli cuckolds cuckold + cuckoo cuckoo cucullus cucullu + cudgel cudgel cudgeled cudgel + cudgell cudgel cudgelling cudgel + cudgels cudgel cue cue + cues cue cuff cuff + cuffs cuff cuique cuiqu + cull cull culling cull + cullion cullion cullionly cullionli + cullions cullion culpable culpabl + culverin culverin cum cum + cumber cumber cumberland cumberland + cunning cun cunningly cunningli + cunnings cun cuore cuor + cup cup cupbearer cupbear + cupboarding cupboard cupid cupid + cupids cupid cuppele cuppel + cups cup cur cur + curan curan curate curat + curb curb curbed curb + curbing curb curbs curb + curd curd curdied curdi + curds curd cure cure + cured cure cureless cureless + curer curer cures cure + curfew curfew curing cure + curio curio curiosity curios + curious curiou curiously curious + curl curl curled curl + curling curl curls curl + currance curranc currants currant + current current currents current + currish currish curry curri + curs cur curse curs + cursed curs curses curs + cursies cursi cursing curs + cursorary cursorari curst curst + curster curster curstest curstest + curstness curst cursy cursi + curtail curtail curtain curtain + curtains curtain curtal curtal + curtis curti curtle curtl + curtsied curtsi curtsies curtsi + curtsy curtsi curvet curvet + curvets curvet cushes cush + cushion cushion cushions cushion + custalorum custalorum custard custard + custody custodi custom custom + customary customari customed custom + customer custom customers custom + customs custom custure custur + cut cut cutler cutler + cutpurse cutpurs cutpurses cutpurs + cuts cut cutter cutter + cutting cut cuttle cuttl + cxsar cxsar cyclops cyclop + cydnus cydnu cygnet cygnet + cygnets cygnet cym cym + cymbals cymbal cymbeline cymbelin + cyme cyme cynic cynic + cynthia cynthia cypress cypress + cypriot cypriot cyprus cypru + cyrus cyru cytherea cytherea + d d dabbled dabbl + dace dace dad dad + daedalus daedalu daemon daemon + daff daff daffed daf + daffest daffest daffodils daffodil + dagger dagger daggers dagger + dagonet dagonet daily daili + daintier daintier dainties dainti + daintiest daintiest daintily daintili + daintiness dainti daintry daintri + dainty dainti daisied daisi + daisies daisi daisy daisi + dale dale dalliance dallianc + dallied dalli dallies dalli + dally dalli dallying dalli + dalmatians dalmatian dam dam + damage damag damascus damascu + damask damask damasked damask + dame dame dames dame + damm damm damn damn + damnable damnabl damnably damnabl + damnation damnat damned damn + damns damn damoiselle damoisel + damon damon damosella damosella + damp damp dams dam + damsel damsel damsons damson + dan dan danc danc + dance danc dancer dancer + dances danc dancing danc + dandle dandl dandy dandi + dane dane dang dang + danger danger dangerous danger + dangerously danger dangers danger + dangling dangl daniel daniel + danish danish dank dank + dankish dankish danskers dansker + daphne daphn dappled dappl + dapples dappl dar dar + dardan dardan dardanian dardanian + dardanius dardaniu dare dare + dared dare dareful dare + dares dare darest darest + daring dare darius dariu + dark dark darken darken + darkening darken darkens darken + darker darker darkest darkest + darkling darkl darkly darkli + darkness dark darling darl + darlings darl darnel darnel + darraign darraign dart dart + darted dart darter darter + dartford dartford darting dart + darts dart dash dash + dashes dash dashing dash + dastard dastard dastards dastard + dat dat datchet datchet + date date dated date + dateless dateless dates date + daub daub daughter daughter + daughters daughter daunt daunt + daunted daunt dauntless dauntless + dauphin dauphin daventry daventri + davy davi daw daw + dawn dawn dawning dawn + daws daw day dai + daylight daylight days dai + dazzle dazzl dazzled dazzl + dazzling dazzl de de + dead dead deadly deadli + deaf deaf deafing deaf + deafness deaf deafs deaf + deal deal dealer dealer + dealers dealer dealest dealest + dealing deal dealings deal + deals deal dealt dealt + dean dean deanery deaneri + dear dear dearer dearer + dearest dearest dearly dearli + dearness dear dears dear + dearth dearth dearths dearth + death death deathbed deathb + deathful death deaths death + deathsman deathsman deathsmen deathsmen + debarred debar debase debas + debate debat debated debat + debatement debat debateth debateth + debating debat debauch debauch + debile debil debility debil + debitor debitor debonair debonair + deborah deborah debosh debosh + debt debt debted debt + debtor debtor debtors debtor + debts debt debuty debuti + decay decai decayed decai + decayer decay decaying decai + decays decai deceas decea + decease deceas deceased deceas + deceit deceit deceitful deceit + deceits deceit deceiv deceiv + deceivable deceiv deceive deceiv + deceived deceiv deceiver deceiv + deceivers deceiv deceives deceiv + deceivest deceivest deceiveth deceiveth + deceiving deceiv december decemb + decent decent deceptious decepti + decerns decern decide decid + decides decid decimation decim + decipher deciph deciphers deciph + decision decis decius deciu + deck deck decking deck + decks deck deckt deckt + declare declar declares declar + declension declens declensions declens + declin declin decline declin + declined declin declines declin + declining declin decoct decoct + decorum decorum decreas decrea + decrease decreas decreasing decreas + decree decre decreed decre + decrees decre decrepit decrepit + dedicate dedic dedicated dedic + dedicates dedic dedication dedic + deed deed deedless deedless + deeds deed deem deem + deemed deem deep deep + deeper deeper deepest deepest + deeply deepli deeps deep + deepvow deepvow deer deer + deesse deess defac defac + deface defac defaced defac + defacer defac defacers defac + defacing defac defam defam + default default defeat defeat + defeated defeat defeats defeat + defeatures defeatur defect defect + defective defect defects defect + defence defenc defences defenc + defend defend defendant defend + defended defend defender defend + defenders defend defending defend + defends defend defense defens + defensible defens defensive defens + defer defer deferr deferr + defiance defianc deficient defici + defied defi defies defi + defil defil defile defil + defiler defil defiles defil + defiling defil define defin + definement defin definite definit + definitive definit definitively definit + deflow deflow deflower deflow + deflowered deflow deform deform + deformed deform deformities deform + deformity deform deftly deftli + defunct defunct defunction defunct + defuse defus defy defi + defying defi degenerate degener + degraded degrad degree degre + degrees degre deified deifi + deifying deifi deign deign + deigned deign deiphobus deiphobu + deities deiti deity deiti + deja deja deject deject + dejected deject delabreth delabreth + delay delai delayed delai + delaying delai delays delai + delectable delect deliberate deliber + delicate delic delicates delic + delicious delici deliciousness delici + delight delight delighted delight + delightful delight delights delight + delinquents delinqu deliv deliv + deliver deliv deliverance deliver + delivered deliv delivering deliv + delivers deliv delivery deliveri + delphos delpho deluded delud + deluding delud deluge delug + delve delv delver delver + delves delv demand demand + demanded demand demanding demand + demands demand demean demean + demeanor demeanor demeanour demeanour + demerits demerit demesnes demesn + demetrius demetriu demi demi + demigod demigod demise demis + demoiselles demoisel demon demon + demonstrable demonstr demonstrate demonstr + demonstrated demonstr demonstrating demonstr + demonstration demonstr demonstrative demonstr + demure demur demurely demur + demuring demur den den + denay denai deni deni + denial denial denials denial + denied deni denier denier + denies deni deniest deniest + denis deni denmark denmark + dennis denni denny denni + denote denot denoted denot + denotement denot denounc denounc + denounce denounc denouncing denounc + dens den denunciation denunci + deny deni denying deni + deo deo depart depart + departed depart departest departest + departing depart departure departur + depeche depech depend depend + dependant depend dependants depend + depended depend dependence depend + dependences depend dependency depend + dependent depend dependents depend + depender depend depending depend + depends depend deplore deplor + deploring deplor depopulate depopul + depos depo depose depos + deposed depos deposing depos + depositaries depositari deprav deprav + depravation deprav deprave deprav + depraved deprav depraves deprav + depress depress depriv depriv + deprive depriv depth depth + depths depth deputation deput + depute deput deputed deput + deputies deputi deputing deput + deputy deputi deracinate deracin + derby derbi dercetas derceta + dere dere derides derid + derision deris deriv deriv + derivation deriv derivative deriv + derive deriv derived deriv + derives deriv derogate derog + derogately derog derogation derog + des de desartless desartless + descant descant descend descend + descended descend descending descend + descends descend descension descens + descent descent descents descent + describe describ described describ + describes describ descried descri + description descript descriptions descript + descry descri desdemon desdemon + desdemona desdemona desert desert + deserts desert deserv deserv + deserve deserv deserved deserv + deservedly deservedli deserver deserv + deservers deserv deserves deserv + deservest deservest deserving deserv + deservings deserv design design + designment design designments design + designs design desir desir + desire desir desired desir + desirers desir desires desir + desirest desirest desiring desir + desirous desir desist desist + desk desk desolate desol + desolation desol desp desp + despair despair despairing despair + despairs despair despatch despatch + desperate desper desperately desper + desperation desper despis despi + despise despis despised despis + despiser despis despiseth despiseth + despising despis despite despit + despiteful despit despoiled despoil + dest dest destin destin + destined destin destinies destini + destiny destini destitute destitut + destroy destroi destroyed destroi + destroyer destroy destroyers destroy + destroying destroi destroys destroi + destruction destruct destructions destruct + det det detain detain + detains detain detect detect + detected detect detecting detect + detection detect detector detector + detects detect detention detent + determin determin determinate determin + determination determin determinations determin + determine determin determined determin + determines determin detest detest + detestable detest detested detest + detesting detest detests detest + detract detract detraction detract + detractions detract deucalion deucalion + deuce deuc deum deum + deux deux devant devant + devesting devest device devic + devices devic devil devil + devilish devilish devils devil + devis devi devise devis + devised devis devises devis + devising devis devoid devoid + devonshire devonshir devote devot + devoted devot devotion devot + devour devour devoured devour + devourers devour devouring devour + devours devour devout devout + devoutly devoutli dew dew + dewberries dewberri dewdrops dewdrop + dewlap dewlap dewlapp dewlapp + dews dew dewy dewi + dexter dexter dexteriously dexteri + dexterity dexter di di + diable diabl diablo diablo + diadem diadem dial dial + dialect dialect dialogue dialogu + dialogued dialogu dials dial + diameter diamet diamond diamond + diamonds diamond dian dian + diana diana diaper diaper + dibble dibbl dic dic + dice dice dicers dicer + dich dich dick dick + dickens dicken dickon dickon + dicky dicki dictator dictat + diction diction dictynna dictynna + did did diddle diddl + didest didest dido dido + didst didst die die + died di diedst diedst + dies di diest diest + diet diet dieted diet + dieter dieter dieu dieu + diff diff differ differ + difference differ differences differ + differency differ different differ + differing differ differs differ + difficile difficil difficult difficult + difficulties difficulti difficulty difficulti + diffidence diffid diffidences diffid + diffus diffu diffused diffus + diffusest diffusest dig dig + digest digest digested digest + digestion digest digestions digest + digg digg digging dig + dighton dighton dignified dignifi + dignifies dignifi dignify dignifi + dignities digniti dignity digniti + digress digress digressing digress + digression digress digs dig + digt digt dilate dilat + dilated dilat dilations dilat + dilatory dilatori dild dild + dildos dildo dilemma dilemma + dilemmas dilemma diligence dilig + diligent dilig diluculo diluculo + dim dim dimension dimens + dimensions dimens diminish diminish + diminishing diminish diminution diminut + diminutive diminut diminutives diminut + dimm dimm dimmed dim + dimming dim dimpled dimpl + dimples dimpl dims dim + din din dine dine + dined dine diner diner + dines dine ding ding + dining dine dinner dinner + dinners dinner dinnertime dinnertim + dint dint diomed diom + diomede diomed diomedes diomed + dion dion dip dip + dipp dipp dipping dip + dips dip dir dir + dire dire direct direct + directed direct directing direct + direction direct directions direct + directitude directitud directive direct + directly directli directs direct + direful dire direness dire + direst direst dirge dirg + dirges dirg dirt dirt + dirty dirti dis di + disability disabl disable disabl + disabled disabl disabling disabl + disadvantage disadvantag disagree disagre + disallow disallow disanimates disanim + disannul disannul disannuls disannul + disappointed disappoint disarm disarm + disarmed disarm disarmeth disarmeth + disarms disarm disaster disast + disasters disast disastrous disastr + disbench disbench disbranch disbranch + disburdened disburden disburs disbur + disburse disburs disbursed disburs + discandy discandi discandying discandi + discard discard discarded discard + discase discas discased discas + discern discern discerner discern + discerning discern discernings discern + discerns discern discharg discharg + discharge discharg discharged discharg + discharging discharg discipled discipl + disciples discipl disciplin disciplin + discipline disciplin disciplined disciplin + disciplines disciplin disclaim disclaim + disclaiming disclaim disclaims disclaim + disclos disclo disclose disclos + disclosed disclos discloses disclos + discolour discolour discoloured discolour + discolours discolour discomfit discomfit + discomfited discomfit discomfiture discomfitur + discomfort discomfort discomfortable discomfort + discommend discommend disconsolate disconsol + discontent discont discontented discont + discontentedly discontentedli discontenting discont + discontents discont discontinue discontinu + discontinued discontinu discord discord + discordant discord discords discord + discourse discours discoursed discours + discourser discours discourses discours + discoursive discours discourtesy discourtesi + discov discov discover discov + discovered discov discoverers discover + discoveries discoveri discovering discov + discovers discov discovery discoveri + discredit discredit discredited discredit + discredits discredit discreet discreet + discreetly discreetli discretion discret + discretions discret discuss discuss + disdain disdain disdained disdain + disdaineth disdaineth disdainful disdain + disdainfully disdainfulli disdaining disdain + disdains disdain disdnguish disdnguish + diseas disea disease diseas + diseased diseas diseases diseas + disedg disedg disembark disembark + disfigure disfigur disfigured disfigur + disfurnish disfurnish disgorge disgorg + disgrac disgrac disgrace disgrac + disgraced disgrac disgraceful disgrac + disgraces disgrac disgracing disgrac + disgracious disgraci disguis disgui + disguise disguis disguised disguis + disguiser disguis disguises disguis + disguising disguis dish dish + dishabited dishabit dishclout dishclout + dishearten dishearten disheartens dishearten + dishes dish dishonest dishonest + dishonestly dishonestli dishonesty dishonesti + dishonor dishonor dishonorable dishonor + dishonors dishonor dishonour dishonour + dishonourable dishonour dishonoured dishonour + dishonours dishonour disinherit disinherit + disinherited disinherit disjoin disjoin + disjoining disjoin disjoins disjoin + disjoint disjoint disjunction disjunct + dislik dislik dislike dislik + disliken disliken dislikes dislik + dislimns dislimn dislocate disloc + dislodg dislodg disloyal disloy + disloyalty disloyalti dismal dismal + dismantle dismantl dismantled dismantl + dismask dismask dismay dismai + dismayed dismai dismemb dismemb + dismember dismemb dismes dism + dismiss dismiss dismissed dismiss + dismissing dismiss dismission dismiss + dismount dismount dismounted dismount + disnatur disnatur disobedience disobedi + disobedient disobedi disobey disobei + disobeys disobei disorb disorb + disorder disord disordered disord + disorderly disorderli disorders disord + disparage disparag disparagement disparag + disparagements disparag dispark dispark + dispatch dispatch dispensation dispens + dispense dispens dispenses dispens + dispers disper disperse dispers + dispersed dispers dispersedly dispersedli + dispersing dispers dispiteous dispit + displac displac displace displac + displaced displac displant displant + displanting displant display displai + displayed displai displeas displea + displease displeas displeased displeas + displeasing displeas displeasure displeasur + displeasures displeasur disponge dispong + disport disport disports disport + dispos dispo dispose dispos + disposed dispos disposer dispos + disposing dispos disposition disposit + dispositions disposit dispossess dispossess + dispossessing dispossess disprais disprai + dispraise disprais dispraising disprais + dispraisingly dispraisingli dispropertied disproperti + disproportion disproport disproportioned disproport + disprov disprov disprove disprov + disproved disprov dispursed dispurs + disputable disput disputation disput + disputations disput dispute disput + disputed disput disputes disput + disputing disput disquantity disquant + disquiet disquiet disquietly disquietli + disrelish disrelish disrobe disrob + disseat disseat dissemble dissembl + dissembled dissembl dissembler dissembl + dissemblers dissembl dissembling dissembl + dissembly dissembl dissension dissens + dissensions dissens dissentious dissenti + dissever dissev dissipation dissip + dissolute dissolut dissolutely dissolut + dissolution dissolut dissolutions dissolut + dissolv dissolv dissolve dissolv + dissolved dissolv dissolves dissolv + dissuade dissuad dissuaded dissuad + distaff distaff distaffs distaff + distain distain distains distain + distance distanc distant distant + distaste distast distasted distast + distasteful distast distemp distemp + distemper distemp distemperature distemperatur + distemperatures distemperatur distempered distemp + distempering distemp distil distil + distill distil distillation distil + distilled distil distills distil + distilment distil distinct distinct + distinction distinct distinctly distinctli + distingue distingu distinguish distinguish + distinguishes distinguish distinguishment distinguish + distract distract distracted distract + distractedly distractedli distraction distract + distractions distract distracts distract + distrain distrain distraught distraught + distress distress distressed distress + distresses distress distressful distress + distribute distribut distributed distribut + distribution distribut distrust distrust + distrustful distrust disturb disturb + disturbed disturb disturbers disturb + disturbing disturb disunite disunit + disvalued disvalu disvouch disvouch + dit dit ditch ditch + ditchers ditcher ditches ditch + dites dite ditties ditti + ditty ditti diurnal diurnal + div div dive dive + diver diver divers diver + diversely divers diversity divers + divert divert diverted divert + diverts divert dives dive + divest divest dividable divid + dividant divid divide divid + divided divid divides divid + divideth divideth divin divin + divination divin divine divin + divinely divin divineness divin + diviner divin divines divin + divinest divinest divining divin + divinity divin division divis + divisions divis divorc divorc + divorce divorc divorced divorc + divorcement divorc divorcing divorc + divulg divulg divulge divulg + divulged divulg divulging divulg + dizy dizi dizzy dizzi + do do doating doat + dobbin dobbin dock dock + docks dock doct doct + doctor doctor doctors doctor + doctrine doctrin document document + dodge dodg doe doe + doer doer doers doer + does doe doest doest + doff doff dog dog + dogberry dogberri dogfish dogfish + dogg dogg dogged dog + dogs dog doigts doigt + doing do doings do + doit doit doits doit + dolabella dolabella dole dole + doleful dole doll doll + dollar dollar dollars dollar + dolor dolor dolorous dolor + dolour dolour dolours dolour + dolphin dolphin dolt dolt + dolts dolt domestic domest + domestics domest dominance domin + dominations domin dominator domin + domine domin domineer domin + domineering domin dominical domin + dominion dominion dominions dominion + domitius domitiu dommelton dommelton + don don donalbain donalbain + donation donat donc donc + doncaster doncast done done + dong dong donn donn + donne donn donner donner + donnerai donnerai doom doom + doomsday doomsdai door door + doorkeeper doorkeep doors door + dorcas dorca doreus doreu + doricles doricl dormouse dormous + dorothy dorothi dorset dorset + dorsetshire dorsetshir dost dost + dotage dotag dotant dotant + dotard dotard dotards dotard + dote dote doted dote + doters doter dotes dote + doteth doteth doth doth + doting dote double doubl + doubled doubl doubleness doubl + doubler doubler doublet doublet + doublets doublet doubling doubl + doubly doubli doubt doubt + doubted doubt doubtful doubt + doubtfully doubtfulli doubting doubt + doubtless doubtless doubts doubt + doug doug dough dough + doughty doughti doughy doughi + douglas dougla dout dout + doute dout douts dout + dove dove dovehouse dovehous + dover dover doves dove + dow dow dowager dowag + dowdy dowdi dower dower + dowerless dowerless dowers dower + dowlas dowla dowle dowl + down down downfall downfal + downright downright downs down + downstairs downstair downtrod downtrod + downward downward downwards downward + downy downi dowries dowri + dowry dowri dowsabel dowsabel + doxy doxi dozed doze + dozen dozen dozens dozen + dozy dozi drab drab + drabbing drab drabs drab + drachma drachma drachmas drachma + draff draff drag drag + dragg dragg dragged drag + dragging drag dragon dragon + dragonish dragonish dragons dragon + drain drain drained drain + drains drain drake drake + dram dram dramatis dramati + drank drank draught draught + draughts draught drave drave + draw draw drawbridge drawbridg + drawer drawer drawers drawer + draweth draweth drawing draw + drawling drawl drawn drawn + draws draw drayman drayman + draymen draymen dread dread + dreaded dread dreadful dread + dreadfully dreadfulli dreading dread + dreads dread dream dream + dreamer dreamer dreamers dreamer + dreaming dream dreams dream + dreamt dreamt drearning drearn + dreary dreari dreg dreg + dregs dreg drench drench + drenched drench dress dress + dressed dress dresser dresser + dressing dress dressings dress + drest drest drew drew + dribbling dribbl dried dri + drier drier dries dri + drift drift drily drili + drink drink drinketh drinketh + drinking drink drinkings drink + drinks drink driv driv + drive drive drivelling drivel + driven driven drives drive + driveth driveth driving drive + drizzle drizzl drizzled drizzl + drizzles drizzl droit droit + drollery drolleri dromio dromio + dromios dromio drone drone + drones drone droop droop + droopeth droopeth drooping droop + droops droop drop drop + dropheir dropheir droplets droplet + dropp dropp dropper dropper + droppeth droppeth dropping drop + droppings drop drops drop + dropsied dropsi dropsies dropsi + dropsy dropsi dropt dropt + dross dross drossy drossi + drought drought drove drove + droven droven drovier drovier + drown drown drowned drown + drowning drown drowns drown + drows drow drowse drows + drowsily drowsili drowsiness drowsi + drowsy drowsi drudge drudg + drudgery drudgeri drudges drudg + drug drug drugg drugg + drugs drug drum drum + drumble drumbl drummer drummer + drumming drum drums drum + drunk drunk drunkard drunkard + drunkards drunkard drunken drunken + drunkenly drunkenli drunkenness drunken + dry dry dryness dryness + dst dst du du + dub dub dubb dubb + ducat ducat ducats ducat + ducdame ducdam duchess duchess + duchies duchi duchy duchi + duck duck ducking duck + ducks duck dudgeon dudgeon + due due duellist duellist + duello duello duer duer + dues due duff duff + dug dug dugs dug + duke duke dukedom dukedom + dukedoms dukedom dukes duke + dulcet dulcet dulche dulch + dull dull dullard dullard + duller duller dullest dullest + dulling dull dullness dull + dulls dull dully dulli + dulness dul duly duli + dumain dumain dumb dumb + dumbe dumb dumbly dumbl + dumbness dumb dump dump + dumps dump dun dun + duncan duncan dung dung + dungeon dungeon dungeons dungeon + dunghill dunghil dunghills dunghil + dungy dungi dunnest dunnest + dunsinane dunsinan dunsmore dunsmor + dunstable dunstabl dupp dupp + durance duranc during dure + durst durst dusky duski + dust dust dusted dust + dusty dusti dutch dutch + dutchman dutchman duteous duteou + duties duti dutiful duti + duty duti dwarf dwarf + dwarfish dwarfish dwell dwell + dwellers dweller dwelling dwell + dwells dwell dwelt dwelt + dwindle dwindl dy dy + dye dye dyed dy + dyer dyer dying dy + e e each each + eager eager eagerly eagerli + eagerness eager eagle eagl + eagles eagl eaning ean + eanlings eanl ear ear + earing ear earl earl + earldom earldom earlier earlier + earliest earliest earliness earli + earls earl early earli + earn earn earned earn + earnest earnest earnestly earnestli + earnestness earnest earns earn + ears ear earth earth + earthen earthen earthlier earthlier + earthly earthli earthquake earthquak + earthquakes earthquak earthy earthi + eas ea ease eas + eased eas easeful eas + eases eas easier easier + easiest easiest easiliest easiliest + easily easili easiness easi + easing eas east east + eastcheap eastcheap easter easter + eastern eastern eastward eastward + easy easi eat eat + eaten eaten eater eater + eaters eater eating eat + eats eat eaux eaux + eaves eav ebb ebb + ebbing eb ebbs ebb + ebon ebon ebony eboni + ebrew ebrew ecce ecc + echapper echapp echo echo + echoes echo eclips eclip + eclipse eclips eclipses eclips + ecolier ecoli ecoutez ecoutez + ecstacy ecstaci ecstasies ecstasi + ecstasy ecstasi ecus ecu + eden eden edg edg + edgar edgar edge edg + edged edg edgeless edgeless + edges edg edict edict + edicts edict edifice edific + edifices edific edified edifi + edifies edifi edition edit + edm edm edmund edmund + edmunds edmund edmundsbury edmundsburi + educate educ educated educ + education educ edward edward + eel eel eels eel + effect effect effected effect + effectless effectless effects effect + effectual effectu effectually effectu + effeminate effemin effigies effigi + effus effu effuse effus + effusion effus eftest eftest + egal egal egally egal + eget eget egeus egeu + egg egg eggs egg + eggshell eggshel eglamour eglamour + eglantine eglantin egma egma + ego ego egregious egregi + egregiously egregi egress egress + egypt egypt egyptian egyptian + egyptians egyptian eie eie + eight eight eighteen eighteen + eighth eighth eightpenny eightpenni + eighty eighti eisel eisel + either either eject eject + eke ek el el + elbe elb elbow elbow + elbows elbow eld eld + elder elder elders elder + eldest eldest eleanor eleanor + elect elect elected elect + election elect elegancy eleg + elegies elegi element element + elements element elephant eleph + elephants eleph elevated elev + eleven eleven eleventh eleventh + elf elf elflocks elflock + eliads eliad elinor elinor + elizabeth elizabeth ell ell + elle ell ellen ellen + elm elm eloquence eloqu + eloquent eloqu else els + elsewhere elsewher elsinore elsinor + eltham eltham elves elv + elvish elvish ely eli + elysium elysium em em + emballing embal embalm embalm + embalms embalm embark embark + embarked embark embarquements embarqu + embassade embassad embassage embassag + embassies embassi embassy embassi + embattailed embattail embattl embattl + embattle embattl embay embai + embellished embellish embers ember + emblaze emblaz emblem emblem + emblems emblem embodied embodi + embold embold emboldens embolden + emboss emboss embossed emboss + embounded embound embowel embowel + embowell embowel embrac embrac + embrace embrac embraced embrac + embracement embrac embracements embrac + embraces embrac embracing embrac + embrasures embrasur embroider embroid + embroidery embroideri emhracing emhrac + emilia emilia eminence emin + eminent emin eminently emin + emmanuel emmanuel emnity emniti + empale empal emperal emper + emperess emperess emperial emperi + emperor emperor empery emperi + emphasis emphasi empire empir + empirics empir empiricutic empiricut + empleached empleach employ emploi + employed emploi employer employ + employment employ employments employ + empoison empoison empress empress + emptied empti emptier emptier + empties empti emptiness empti + empty empti emptying empti + emulate emul emulation emul + emulations emul emulator emul + emulous emul en en + enact enact enacted enact + enacts enact enactures enactur + enamell enamel enamelled enamel + enamour enamour enamoured enamour + enanmour enanmour encamp encamp + encamped encamp encave encav + enceladus enceladu enchaf enchaf + enchafed enchaf enchant enchant + enchanted enchant enchanting enchant + enchantingly enchantingli enchantment enchant + enchantress enchantress enchants enchant + enchas encha encircle encircl + encircled encircl enclos enclo + enclose enclos enclosed enclos + encloses enclos encloseth encloseth + enclosing enclos enclouded encloud + encompass encompass encompassed encompass + encompasseth encompasseth encompassment encompass + encore encor encorporal encorpor + encount encount encounter encount + encountered encount encounters encount + encourage encourag encouraged encourag + encouragement encourag encrimsoned encrimson + encroaching encroach encumb encumb + end end endamage endamag + endamagement endamag endanger endang + endart endart endear endear + endeared endear endeavour endeavour + endeavours endeavour ended end + ender ender ending end + endings end endite endit + endless endless endow endow + endowed endow endowments endow + endows endow ends end + endu endu endue endu + endur endur endurance endur + endure endur endured endur + endures endur enduring endur + endymion endymion eneas enea + enemies enemi enemy enemi + enernies enerni enew enew + enfeebled enfeebl enfeebles enfeebl + enfeoff enfeoff enfetter enfett + enfoldings enfold enforc enforc + enforce enforc enforced enforc + enforcedly enforcedli enforcement enforc + enforces enforc enforcest enforcest + enfranched enfranch enfranchis enfranchi + enfranchise enfranchis enfranchised enfranchis + enfranchisement enfranchis enfreed enfre + enfreedoming enfreedom engag engag + engage engag engaged engag + engagements engag engaging engag + engaol engaol engend engend + engender engend engenders engend + engilds engild engine engin + engineer engin enginer engin + engines engin engirt engirt + england england english english + englishman englishman englishmen englishmen + engluts englut englutted englut + engraffed engraf engraft engraft + engrafted engraft engrav engrav + engrave engrav engross engross + engrossed engross engrossest engrossest + engrossing engross engrossments engross + enguard enguard enigma enigma + enigmatical enigmat enjoin enjoin + enjoined enjoin enjoy enjoi + enjoyed enjoi enjoyer enjoy + enjoying enjoi enjoys enjoi + enkindle enkindl enkindled enkindl + enlard enlard enlarg enlarg + enlarge enlarg enlarged enlarg + enlargement enlarg enlargeth enlargeth + enlighten enlighten enlink enlink + enmesh enmesh enmities enmiti + enmity enmiti ennoble ennobl + ennobled ennobl enobarb enobarb + enobarbus enobarbu enon enon + enormity enorm enormous enorm + enough enough enow enow + enpatron enpatron enpierced enpierc + enquir enquir enquire enquir + enquired enquir enrag enrag + enrage enrag enraged enrag + enrages enrag enrank enrank + enrapt enrapt enrich enrich + enriched enrich enriches enrich + enridged enridg enrings enr + enrob enrob enrobe enrob + enroll enrol enrolled enrol + enrooted enroot enrounded enround + enschedul enschedul ensconce ensconc + ensconcing ensconc enseamed enseam + ensear ensear enseigne enseign + enseignez enseignez ensemble ensembl + enshelter enshelt enshielded enshield + enshrines enshrin ensign ensign + ensigns ensign enskied enski + ensman ensman ensnare ensnar + ensnared ensnar ensnareth ensnareth + ensteep ensteep ensu ensu + ensue ensu ensued ensu + ensues ensu ensuing ensu + enswathed enswath ent ent + entail entail entame entam + entangled entangl entangles entangl + entendre entendr enter enter + entered enter entering enter + enterprise enterpris enterprises enterpris + enters enter entertain entertain + entertained entertain entertainer entertain + entertaining entertain entertainment entertain + entertainments entertain enthrall enthral + enthralled enthral enthron enthron + enthroned enthron entice entic + enticements entic enticing entic + entire entir entirely entir + entitle entitl entitled entitl + entitling entitl entomb entomb + entombed entomb entrails entrail + entrance entranc entrances entranc + entrap entrap entrapp entrapp + entre entr entreat entreat + entreated entreat entreaties entreati + entreating entreat entreatments entreat + entreats entreat entreaty entreati + entrench entrench entry entri + entwist entwist envelop envelop + envenom envenom envenomed envenom + envenoms envenom envied envi + envies envi envious enviou + enviously envious environ environ + environed environ envoy envoi + envy envi envying envi + enwheel enwheel enwombed enwomb + enwraps enwrap ephesian ephesian + ephesians ephesian ephesus ephesu + epicure epicur epicurean epicurean + epicures epicur epicurism epicur + epicurus epicuru epidamnum epidamnum + epidaurus epidauru epigram epigram + epilepsy epilepsi epileptic epilept + epilogue epilogu epilogues epilogu + epistles epistl epistrophus epistrophu + epitaph epitaph epitaphs epitaph + epithet epithet epitheton epitheton + epithets epithet epitome epitom + equal equal equalities equal + equality equal equall equal + equally equal equalness equal + equals equal equinoctial equinocti + equinox equinox equipage equipag + equity equiti equivocal equivoc + equivocate equivoc equivocates equivoc + equivocation equivoc equivocator equivoc + er er erbear erbear + erbearing erbear erbears erbear + erbeat erbeat erblows erblow + erboard erboard erborne erborn + ercame ercam ercast ercast + ercharg ercharg ercharged ercharg + ercharging ercharg ercles ercl + ercome ercom ercover ercov + ercrows ercrow erdoing erdo + ere er erebus erebu + erect erect erected erect + erecting erect erection erect + erects erect erewhile erewhil + erflourish erflourish erflow erflow + erflowing erflow erflows erflow + erfraught erfraught erga erga + ergalled ergal erglanced erglanc + ergo ergo ergone ergon + ergrow ergrow ergrown ergrown + ergrowth ergrowth erhang erhang + erhanging erhang erhasty erhasti + erhear erhear erheard erheard + eringoes eringo erjoy erjoi + erleap erleap erleaps erleap + erleavens erleaven erlook erlook + erlooking erlook ermaster ermast + ermengare ermengar ermount ermount + ern ern ernight ernight + eros ero erpaid erpaid + erparted erpart erpast erpast + erpays erpai erpeer erpeer + erperch erperch erpicturing erpictur + erpingham erpingham erposting erpost + erpow erpow erpress erpress + erpressed erpress err err + errand errand errands errand + errant errant errate errat + erraught erraught erreaches erreach + erred er errest errest + erring er erroneous erron + error error errors error + errs err errule errul + errun errun erset erset + ershade ershad ershades ershad + ershine ershin ershot ershot + ersized ersiz erskip erskip + erslips erslip erspreads erspread + erst erst erstare erstar + erstep erstep erstunk erstunk + ersway erswai ersways erswai + erswell erswel erta erta + ertake ertak erteemed erteem + erthrow erthrow erthrown erthrown + erthrows erthrow ertook ertook + ertop ertop ertopping ertop + ertrip ertrip erturn erturn + erudition erudit eruption erupt + eruptions erupt ervalues ervalu + erwalk erwalk erwatch erwatch + erween erween erweens erween + erweigh erweigh erweighs erweigh + erwhelm erwhelm erwhelmed erwhelm + erworn erworn es es + escalus escalu escap escap + escape escap escaped escap + escapes escap eschew eschew + escoted escot esill esil + especial especi especially especi + esperance esper espials espial + espied espi espies espi + espous espou espouse espous + espy espi esquire esquir + esquires esquir essay essai + essays essai essence essenc + essential essenti essentially essenti + esses ess essex essex + est est establish establish + established establish estate estat + estates estat esteem esteem + esteemed esteem esteemeth esteemeth + esteeming esteem esteems esteem + estimable estim estimate estim + estimation estim estimations estim + estime estim estranged estrang + estridge estridg estridges estridg + et et etc etc + etceteras etcetera ete et + eternal etern eternally etern + eterne etern eternity etern + eterniz eterniz etes et + ethiop ethiop ethiope ethiop + ethiopes ethiop ethiopian ethiopian + etna etna eton eton + etre etr eunuch eunuch + eunuchs eunuch euphrates euphrat + euphronius euphroniu euriphile euriphil + europa europa europe europ + ev ev evade evad + evades evad evans evan + evasion evas evasions evas + eve ev even even + evening even evenly evenli + event event eventful event + events event ever ever + everlasting everlast everlastingly everlastingli + evermore evermor every everi + everyone everyon everything everyth + everywhere everywher evidence evid + evidences evid evident evid + evil evil evilly evilli + evils evil evitate evit + ewe ew ewer ewer + ewers ewer ewes ew + exact exact exacted exact + exactest exactest exacting exact + exaction exact exactions exact + exactly exactli exacts exact + exalt exalt exalted exalt + examin examin examination examin + examinations examin examine examin + examined examin examines examin + exampl exampl example exampl + exampled exampl examples exampl + exasperate exasper exasperates exasper + exceed exce exceeded exceed + exceedeth exceedeth exceeding exceed + exceedingly exceedingli exceeds exce + excel excel excelled excel + excellence excel excellencies excel + excellency excel excellent excel + excellently excel excelling excel + excels excel except except + excepted except excepting except + exception except exceptions except + exceptless exceptless excess excess + excessive excess exchang exchang + exchange exchang exchanged exchang + exchequer exchequ exchequers exchequ + excite excit excited excit + excitements excit excites excit + exclaim exclaim exclaims exclaim + exclamation exclam exclamations exclam + excludes exclud excommunicate excommun + excommunication excommun excrement excrement + excrements excrement excursion excurs + excursions excurs excus excu + excusable excus excuse excus + excused excus excuses excus + excusez excusez excusing excus + execrable execr execrations execr + execute execut executed execut + executing execut execution execut + executioner execution executioners execution + executor executor executors executor + exempt exempt exempted exempt + exequies exequi exercise exercis + exercises exercis exeter exet + exeunt exeunt exhal exhal + exhalation exhal exhalations exhal + exhale exhal exhales exhal + exhaust exhaust exhibit exhibit + exhibiters exhibit exhibition exhibit + exhort exhort exhortation exhort + exigent exig exil exil + exile exil exiled exil + exion exion exist exist + exists exist exit exit + exits exit exorciser exorcis + exorcisms exorc exorcist exorcist + expect expect expectance expect + expectancy expect expectation expect + expectations expect expected expect + expecters expect expecting expect + expects expect expedience expedi + expedient expedi expediently expedi + expedition expedit expeditious expediti + expel expel expell expel + expelling expel expels expel + expend expend expense expens + expenses expens experienc experienc + experience experi experiences experi + experiment experi experimental experiment + experiments experi expert expert + expertness expert expiate expiat + expiation expiat expir expir + expiration expir expire expir + expired expir expires expir + expiring expir explication explic + exploit exploit exploits exploit + expos expo expose expos + exposing expos exposition exposit + expositor expositor expostulate expostul + expostulation expostul exposture expostur + exposure exposur expound expound + expounded expound express express + expressed express expresseth expresseth + expressing express expressive express + expressly expressli expressure expressur + expuls expul expulsion expuls + exquisite exquisit exsufflicate exsuffl + extant extant extemporal extempor + extemporally extempor extempore extempor + extend extend extended extend + extends extend extent extent + extenuate extenu extenuated extenu + extenuates extenu extenuation extenu + exterior exterior exteriorly exteriorli + exteriors exterior extermin extermin + extern extern external extern + extinct extinct extincted extinct + extincture extinctur extinguish extinguish + extirp extirp extirpate extirp + extirped extirp extol extol + extoll extol extolment extol + exton exton extort extort + extorted extort extortion extort + extortions extort extra extra + extract extract extracted extract extracting extract extraordinarily extraordinarili - extraordinary extraordinari extraught extraught - extravagancy extravag extravagant extravag - extreme extrem extremely extrem - extremes extrem extremest extremest - extremities extrem extremity extrem - exuent exuent exult exult - exultation exult ey ey - eyas eya eyases eyas - eye ey eyeball eyebal - eyeballs eyebal eyebrow eyebrow - eyebrows eyebrow eyed ei - eyeless eyeless eyelid eyelid - eyelids eyelid eyes ey - eyesight eyesight eyestrings eyestr - eying ei eyne eyn - eyrie eyri fa fa - fabian fabian fable fabl - fables fabl fabric fabric - fabulous fabul fac fac - face face faced face - facere facer faces face - faciant faciant facile facil - facility facil facinerious facineri - facing face facit facit - fact fact faction faction - factionary factionari factions faction - factious factiou factor factor - factors factor faculties faculti - faculty faculti fade fade - faded fade fadeth fadeth - fadge fadg fading fade - fadings fade fadom fadom - fadoms fadom fagot fagot - fagots fagot fail fail - failing fail fails fail - fain fain faint faint - fainted faint fainter fainter - fainting faint faintly faintli - faintness faint faints faint - fair fair fairer fairer - fairest fairest fairies fairi - fairing fair fairings fair - fairly fairli fairness fair - fairs fair fairwell fairwel - fairy fairi fais fai - fait fait faites fait - faith faith faithful faith - faithfull faithful faithfully faithfulli - faithless faithless faiths faith - faitors faitor fal fal - falchion falchion falcon falcon - falconbridge falconbridg falconer falcon - falconers falcon fall fall - fallacy fallaci fallen fallen - falleth falleth falliable falliabl - fallible fallibl falling fall - fallow fallow fallows fallow - falls fall fally falli - falorous falor false fals - falsehood falsehood falsely fals - falseness fals falser falser - falsify falsifi falsing fals - falstaff falstaff falstaffs falstaff - falter falter fam fam - fame fame famed fame - familiar familiar familiarity familiar - familiarly familiarli familiars familiar - family famili famine famin - famish famish famished famish - famous famou famoused famous - famously famous fan fan - fanatical fanat fancies fanci - fancy fanci fane fane - fanes fane fang fang - fangled fangl fangless fangless - fangs fang fann fann - fanning fan fans fan - fantasied fantasi fantasies fantasi - fantastic fantast fantastical fantast - fantastically fantast fantasticoes fantastico - fantasy fantasi fap fap - far far farborough farborough - farced farc fardel fardel - fardels fardel fare fare - fares fare farewell farewel - farewells farewel fariner farin - faring fare farm farm - farmer farmer farmhouse farmhous - farms farm farre farr - farrow farrow farther farther - farthest farthest farthing farth - farthingale farthingal farthingales farthingal - farthings farth fartuous fartuou - fas fa fashion fashion - fashionable fashion fashioning fashion - fashions fashion fast fast - fasted fast fasten fasten - fastened fasten faster faster - fastest fastest fasting fast - fastly fastli fastolfe fastolf - fasts fast fat fat - fatal fatal fatally fatal - fate fate fated fate - fates fate father father - fathered father fatherless fatherless - fatherly fatherli fathers father - fathom fathom fathomless fathomless - fathoms fathom fatigate fatig - fatness fat fats fat - fatted fat fatter fatter - fattest fattest fatting fat - fatuus fatuu fauconbridge fauconbridg - faulconbridge faulconbridg fault fault - faultiness faulti faultless faultless - faults fault faulty faulti - fausse fauss fauste faust - faustuses faustus faut faut - favor favor favorable favor - favorably favor favors favor - favour favour favourable favour - favoured favour favouredly favouredli - favourer favour favourers favour - favouring favour favourite favourit - favourites favourit favours favour - favout favout fawn fawn - fawneth fawneth fawning fawn - fawns fawn fay fai - fe fe fealty fealti - fear fear feared fear - fearest fearest fearful fear - fearfull fearful fearfully fearfulli - fearfulness fear fearing fear - fearless fearless fears fear - feast feast feasted feast - feasting feast feasts feast - feat feat feated feat - feater feater feather feather - feathered feather feathers feather - featly featli feats feat - featur featur feature featur - featured featur featureless featureless - features featur february februari - fecks feck fed fed - fedary fedari federary federari - fee fee feeble feebl - feebled feebl feebleness feebl - feebling feebl feebly feebli - feed feed feeder feeder - feeders feeder feedeth feedeth - feeding feed feeds feed - feel feel feeler feeler - feeling feel feelingly feelingli - feels feel fees fee - feet feet fehemently fehement - feign feign feigned feign - feigning feign feil feil - feith feith felicitate felicit - felicity felic fell fell - fellest fellest fellies felli - fellow fellow fellowly fellowli - fellows fellow fellowship fellowship - fellowships fellowship fells fell - felon felon felonious feloni - felony feloni felt felt - female femal females femal - feminine feminin fen fen - fenc fenc fence fenc - fencer fencer fencing fenc - fends fend fennel fennel - fenny fenni fens fen - fenton fenton fer fer - ferdinand ferdinand fere fere - fernseed fernse ferrara ferrara - ferrers ferrer ferret ferret - ferry ferri ferryman ferryman - fertile fertil fertility fertil - fervency fervenc fervour fervour - fery feri fest fest - feste fest fester fester - festinate festin festinately festin - festival festiv festivals festiv - fet fet fetch fetch - fetches fetch fetching fetch - fetlock fetlock fetlocks fetlock - fett fett fetter fetter - fettering fetter fetters fetter - fettle fettl feu feu - feud feud fever fever - feverous fever fevers fever - few few fewer fewer - fewest fewest fewness few - fickle fickl fickleness fickl - fico fico fiction fiction - fiddle fiddl fiddler fiddler - fiddlestick fiddlestick fidele fidel - fidelicet fidelicet fidelity fidel - fidius fidiu fie fie - field field fielded field - fields field fiend fiend - fiends fiend fierce fierc - fiercely fierc fierceness fierc - fiery fieri fife fife - fifes fife fifteen fifteen - fifteens fifteen fifteenth fifteenth - fifth fifth fifty fifti - fiftyfold fiftyfold fig fig - fight fight fighter fighter - fightest fightest fighteth fighteth - fighting fight fights fight - figo figo figs fig - figur figur figure figur - figured figur figures figur - figuring figur fike fike - fil fil filberts filbert - filch filch filches filch - filching filch file file - filed file files file - filial filial filius filiu - fill fill filled fill - fillet fillet filling fill - fillip fillip fills fill - filly filli film film - fils fil filth filth - filths filth filthy filthi - fin fin finally final - finch finch find find - finder finder findeth findeth - finding find findings find - finds find fine fine - fineless fineless finely fine - finem finem fineness fine - finer finer fines fine - finest finest fing fing - finger finger fingering finger - fingers finger fingre fingr - fingres fingr finical finic - finish finish finished finish - finisher finish finless finless - finn finn fins fin - finsbury finsburi fir fir - firago firago fire fire - firebrand firebrand firebrands firebrand - fired fire fires fire - firework firework fireworks firework - firing fire firk firk - firm firm firmament firmament - firmly firmli firmness firm - first first firstlings firstl - fish fish fisher fisher - fishermen fishermen fishers fisher - fishes fish fishified fishifi - fishmonger fishmong fishpond fishpond - fisnomy fisnomi fist fist - fisting fist fists fist - fistula fistula fit fit - fitchew fitchew fitful fit - fitly fitli fitment fitment - fitness fit fits fit - fitted fit fitter fitter - fittest fittest fitteth fitteth - fitting fit fitzwater fitzwat - five five fivepence fivep - fives five fix fix - fixed fix fixes fix - fixeth fixeth fixing fix - fixture fixtur fl fl - flag flag flagging flag - flagon flagon flagons flagon - flags flag flail flail - flakes flake flaky flaki - flam flam flame flame - flamen flamen flamens flamen - flames flame flaming flame - flaminius flaminiu flanders flander - flannel flannel flap flap - flaring flare flash flash - flashes flash flashing flash - flask flask flat flat - flatly flatli flatness flat - flats flat flatt flatt - flatter flatter flattered flatter - flatterer flatter flatterers flatter - flatterest flatterest flatteries flatteri - flattering flatter flatters flatter - flattery flatteri flaunts flaunt - flavio flavio flavius flaviu - flaw flaw flaws flaw - flax flax flaxen flaxen - flay flai flaying flai - flea flea fleance fleanc - fleas flea flecked fleck - fled fled fledge fledg - flee flee fleec fleec - fleece fleec fleeces fleec - fleer fleer fleering fleer - fleers fleer fleet fleet - fleeter fleeter fleeting fleet - fleming fleme flemish flemish - flesh flesh fleshes flesh - fleshly fleshli fleshment fleshment - fleshmonger fleshmong flew flew - flexible flexibl flexure flexur - flibbertigibbet flibbertigibbet flickering flicker - flidge flidg fliers flier - flies fli flieth flieth - flight flight flights flight - flighty flighti flinch flinch - fling fling flint flint - flints flint flinty flinti - flirt flirt float float - floated float floating float - flock flock flocks flock - flood flood floodgates floodgat - floods flood floor floor - flora flora florence florenc - florentine florentin florentines florentin - florentius florentiu florizel florizel - flote flote floulish floulish - flour flour flourish flourish - flourishes flourish flourisheth flourisheth - flourishing flourish flout flout - flouted flout flouting flout - flouts flout flow flow - flowed flow flower flower - flowerets floweret flowers flower - flowing flow flown flown - flows flow fluellen fluellen - fluent fluent flung flung - flush flush flushing flush - fluster fluster flute flute - flutes flute flutter flutter - flux flux fluxive fluxiv - fly fly flying fly - fo fo foal foal - foals foal foam foam - foamed foam foaming foam - foams foam foamy foami - fob fob focative foc - fodder fodder foe foe - foeman foeman foemen foemen - foes foe fog fog - foggy foggi fogs fog - foh foh foi foi - foil foil foiled foil - foils foil foin foin - foining foin foins foin - fois foi foison foison - foisons foison foist foist - foix foix fold fold - folded fold folds fold - folio folio folk folk - folks folk follies folli - follow follow followed follow - follower follow followers follow - followest followest following follow - follows follow folly folli - fond fond fonder fonder - fondly fondli fondness fond - font font fontibell fontibel - food food fool fool - fooleries fooleri foolery fooleri - foolhardy foolhardi fooling fool - foolish foolish foolishly foolishli - foolishness foolish fools fool - foot foot football footbal - footboy footboi footboys footboi - footed foot footfall footfal - footing foot footman footman - footmen footmen footpath footpath - footsteps footstep footstool footstool - fopp fopp fopped fop - foppery fopperi foppish foppish - fops fop for for - forage forag foragers forag - forbade forbad forbear forbear - forbearance forbear forbears forbear - forbid forbid forbidden forbidden - forbiddenly forbiddenli forbids forbid - forbod forbod forborne forborn - forc forc force forc - forced forc forceful forc - forceless forceless forces forc - forcible forcibl forcibly forcibl - forcing forc ford ford - fordid fordid fordo fordo - fordoes fordo fordone fordon - fore fore forecast forecast - forefather forefath forefathers forefath - forefinger forefing forego forego - foregone foregon forehand forehand - forehead forehead foreheads forehead - forehorse forehors foreign foreign - foreigner foreign foreigners foreign - foreknowing foreknow foreknowledge foreknowledg - foremost foremost forenamed forenam - forenoon forenoon forerun forerun - forerunner forerunn forerunning forerun - foreruns forerun foresaid foresaid - foresaw foresaw foresay foresai - foresee forese foreseeing forese - foresees forese foreshow foreshow - foreskirt foreskirt forespent foresp - forest forest forestall forestal - forestalled forestal forester forest - foresters forest forests forest - foretell foretel foretelling foretel - foretells foretel forethink forethink - forethought forethought foretold foretold - forever forev foreward foreward - forewarn forewarn forewarned forewarn - forewarning forewarn forfeit forfeit - forfeited forfeit forfeiters forfeit - forfeiting forfeit forfeits forfeit - forfeiture forfeitur forfeitures forfeitur - forfend forfend forfended forfend - forg forg forgave forgav - forge forg forged forg - forgeries forgeri forgery forgeri - forges forg forget forget - forgetful forget forgetfulness forget - forgetive forget forgets forget - forgetting forget forgive forgiv - forgiven forgiven forgiveness forgiv - forgo forgo forgoing forgo - forgone forgon forgot forgot - forgotten forgotten fork fork - forked fork forks fork - forlorn forlorn form form - formal formal formally formal - formed form former former - formerly formerli formless formless - forms form fornication fornic - fornications fornic fornicatress fornicatress - forres forr forrest forrest - forsake forsak forsaken forsaken - forsaketh forsaketh forslow forslow - forsook forsook forsooth forsooth - forspent forspent forspoke forspok - forswear forswear forswearing forswear - forswore forswor forsworn forsworn - fort fort forted fort - forth forth forthcoming forthcom - forthlight forthlight forthright forthright - forthwith forthwith fortification fortif - fortifications fortif fortified fortifi - fortifies fortifi fortify fortifi - fortinbras fortinbra fortitude fortitud - fortnight fortnight fortress fortress - fortresses fortress forts fort - fortun fortun fortuna fortuna - fortunate fortun fortunately fortun - fortune fortun fortuned fortun - fortunes fortun fortward fortward - forty forti forum forum - forward forward forwarding forward - forwardness forward forwards forward - forwearied forweari fosset fosset - fost fost foster foster - fostered foster fought fought - foughten foughten foul foul - fouler fouler foulest foulest - foully foulli foulness foul - found found foundation foundat - foundations foundat founded found - founder founder fount fount - fountain fountain fountains fountain - founts fount four four - fourscore fourscor fourteen fourteen - fourth fourth foutra foutra - fowl fowl fowler fowler - fowling fowl fowls fowl - fox fox foxes fox - foxship foxship fracted fract - fraction fraction fractions fraction - fragile fragil fragment fragment - fragments fragment fragrant fragrant - frail frail frailer frailer - frailties frailti frailty frailti - fram fram frame frame - framed frame frames frame - frampold frampold fran fran - francais francai france franc - frances franc franchise franchis - franchised franchis franchisement franchis - franchises franchis franciae francia - francis franci francisca francisca - franciscan franciscan francisco francisco - frank frank franker franker - frankfort frankfort franklin franklin - franklins franklin frankly frankli - frankness frank frantic frantic - franticly franticli frateretto frateretto - fratrum fratrum fraud fraud - fraudful fraud fraught fraught - fraughtage fraughtag fraughting fraught - fray frai frays frai - freckl freckl freckled freckl - freckles freckl frederick frederick - free free freed freed - freedom freedom freedoms freedom - freehearted freeheart freelier freelier - freely freeli freeman freeman - freemen freemen freeness freeness - freer freer frees free - freestone freeston freetown freetown - freeze freez freezes freez - freezing freez freezings freez - french french frenchman frenchman - frenchmen frenchmen frenchwoman frenchwoman - frenzy frenzi frequent frequent - frequents frequent fresh fresh - fresher fresher freshes fresh - freshest freshest freshly freshli - freshness fresh fret fret - fretful fret frets fret - fretted fret fretten fretten - fretting fret friar friar - friars friar friday fridai - fridays fridai friend friend - friended friend friending friend - friendless friendless friendliness friendli - friendly friendli friends friend - friendship friendship friendships friendship - frieze friez fright fright - frighted fright frightened frighten - frightful fright frighting fright - frights fright fringe fring - fringed fring frippery fripperi - frisk frisk fritters fritter - frivolous frivol fro fro - frock frock frog frog - frogmore frogmor froissart froissart - frolic frolic from from - front front fronted front - frontier frontier frontiers frontier - fronting front frontlet frontlet - fronts front frost frost - frosts frost frosty frosti - froth froth froward froward - frown frown frowning frown - frowningly frowningli frowns frown - froze froze frozen frozen - fructify fructifi frugal frugal - fruit fruit fruiterer fruiter - fruitful fruit fruitfully fruitfulli - fruitfulness fruit fruition fruition - fruitless fruitless fruits fruit - frush frush frustrate frustrat - frutify frutifi fry fry - fubb fubb fuel fuel - fugitive fugit fulfil fulfil - fulfill fulfil fulfilling fulfil - fulfils fulfil full full - fullam fullam fuller fuller - fullers fuller fullest fullest - fullness full fully fulli - fulness ful fulsome fulsom - fulvia fulvia fum fum - fumble fumbl fumbles fumbl - fumblest fumblest fumbling fumbl - fume fume fumes fume - fuming fume fumiter fumit - fumitory fumitori fun fun - function function functions function - fundamental fundament funeral funer - funerals funer fur fur - furbish furbish furies furi - furious furiou furlongs furlong - furnace furnac furnaces furnac - furnish furnish furnished furnish - furnishings furnish furniture furnitur - furnival furniv furor furor - furr furr furrow furrow - furrowed furrow furrows furrow - furth furth further further - furtherance further furtherer further - furthermore furthermor furthest furthest - fury furi furze furz - furzes furz fust fust - fustian fustian fustilarian fustilarian - fusty fusti fut fut - future futur futurity futur - g g gabble gabbl - gaberdine gaberdin gabriel gabriel - gad gad gadding gad - gads gad gadshill gadshil - gag gag gage gage - gaged gage gagg gagg - gaging gage gagne gagn - gain gain gained gain - gainer gainer gaingiving gaingiv - gains gain gainsaid gainsaid - gainsay gainsai gainsaying gainsai - gainsays gainsai gainst gainst - gait gait gaited gait - galathe galath gale gale - galen galen gales gale - gall gall gallant gallant - gallantly gallantli gallantry gallantri - gallants gallant galled gall - gallery galleri galley gallei - galleys gallei gallia gallia - gallian gallian galliard galliard - galliasses galliass gallimaufry gallimaufri - galling gall gallons gallon - gallop gallop galloping gallop - gallops gallop gallow gallow - galloway gallowai gallowglasses gallowglass - gallows gallow gallowses gallows - galls gall gallus gallu - gam gam gambol gambol - gambold gambold gambols gambol - gamboys gamboi game game - gamers gamer games game - gamesome gamesom gamester gamest - gaming game gammon gammon - gamut gamut gan gan - gangren gangren ganymede ganymed - gaol gaol gaoler gaoler - gaolers gaoler gaols gaol - gap gap gape gape - gapes gape gaping gape - gar gar garb garb - garbage garbag garboils garboil - garcon garcon gard gard - garde gard garden garden - gardener garden gardeners garden - gardens garden gardez gardez - gardiner gardin gardon gardon - gargantua gargantua gargrave gargrav - garish garish garland garland - garlands garland garlic garlic - garment garment garments garment - garmet garmet garner garner - garners garner garnish garnish - garnished garnish garret garret - garrison garrison garrisons garrison - gart gart garter garter - garterd garterd gartering garter - garters garter gascony gasconi - gash gash gashes gash - gaskins gaskin gasp gasp - gasping gasp gasted gast - gastness gast gat gat - gate gate gated gate - gates gate gath gath - gather gather gathered gather - gathering gather gathers gather - gatories gatori gatory gatori - gaud gaud gaudeo gaudeo - gaudy gaudi gauge gaug - gaul gaul gaultree gaultre - gaunt gaunt gauntlet gauntlet - gauntlets gauntlet gav gav - gave gave gavest gavest - gawded gawd gawds gawd - gawsey gawsei gay gai - gayness gay gaz gaz - gaze gaze gazed gaze - gazer gazer gazers gazer - gazes gaze gazeth gazeth - gazing gaze gear gear - geck geck geese gees - geffrey geffrei geld geld - gelded geld gelding geld - gelida gelida gelidus gelidu - gelt gelt gem gem - geminy gemini gems gem - gen gen gender gender - genders gender general gener - generally gener generals gener - generation gener generations gener - generative gener generosity generos - generous gener genitive genit - genitivo genitivo genius geniu - gennets gennet genoa genoa - genoux genoux gens gen - gent gent gentilhomme gentilhomm - gentility gentil gentle gentl - gentlefolks gentlefolk gentleman gentleman - gentlemanlike gentlemanlik gentlemen gentlemen - gentleness gentl gentler gentler - gentles gentl gentlest gentlest - gentlewoman gentlewoman gentlewomen gentlewomen - gently gentli gentry gentri - george georg gerard gerard - germaines germain germains germain - german german germane german - germans german germany germani - gertrude gertrud gest gest - gests gest gesture gestur - gestures gestur get get - getrude getrud gets get - getter getter getting get - ghastly ghastli ghost ghost - ghosted ghost ghostly ghostli - ghosts ghost gi gi - giant giant giantess giantess - giantlike giantlik giants giant - gib gib gibber gibber - gibbet gibbet gibbets gibbet - gibe gibe giber giber - gibes gibe gibing gibe - gibingly gibingli giddily giddili - giddiness giddi giddy giddi - gift gift gifts gift - gig gig giglets giglet - giglot giglot gilbert gilbert - gild gild gilded gild - gilding gild gilliams gilliam - gillian gillian gills gill - gillyvors gillyvor gilt gilt - gimmal gimmal gimmers gimmer - gin gin ging ging - ginger ginger gingerbread gingerbread - gingerly gingerli ginn ginn - gins gin gioucestershire gioucestershir - gipes gipe gipsies gipsi - gipsy gipsi gird gird - girded gird girdle girdl - girdled girdl girdles girdl - girdling girdl girl girl - girls girl girt girt - girth girth gis gi - giv giv give give - given given giver giver - givers giver gives give - givest givest giveth giveth - giving give givings give - glad glad gladded glad - gladding glad gladly gladli - gladness glad glamis glami - glanc glanc glance glanc - glanced glanc glances glanc - glancing glanc glanders glander - glansdale glansdal glare glare - glares glare glass glass - glasses glass glassy glassi - glaz glaz glazed glaze - gleams gleam glean glean - gleaned glean gleaning glean - gleeful gleeful gleek gleek - gleeking gleek gleeks gleek - glend glend glendower glendow - glib glib glide glide - glided glide glides glide - glideth glideth gliding glide - glimmer glimmer glimmering glimmer - glimmers glimmer glimpse glimps - glimpses glimps glist glist - glistening glisten glister glister - glistering glister glisters glister - glitt glitt glittering glitter - globe globe globes globe - glooming gloom gloomy gloomi - glories glori glorified glorifi - glorify glorifi glorious gloriou - gloriously glorious glory glori - glose glose gloss gloss - glosses gloss glou glou - glouceste gloucest gloucester gloucest - gloucestershire gloucestershir glove glove - glover glover gloves glove - glow glow glowed glow - glowing glow glowworm glowworm - gloz gloz gloze gloze - glozes gloze glu glu - glue glue glued glu - glues glue glut glut - glutt glutt glutted glut - glutton glutton gluttoning glutton - gluttony gluttoni gnarled gnarl - gnarling gnarl gnat gnat - gnats gnat gnaw gnaw - gnawing gnaw gnawn gnawn - gnaws gnaw go go - goad goad goaded goad - goads goad goal goal - goat goat goatish goatish - goats goat gobbets gobbet - gobbo gobbo goblet goblet - goblets goblet goblin goblin - goblins goblin god god - godded god godden godden - goddess goddess goddesses goddess - goddild goddild godfather godfath - godfathers godfath godhead godhead - godlike godlik godliness godli - godly godli godmother godmoth - gods god godson godson - goer goer goers goer - goes goe goest goest - goeth goeth goffe goff - gogs gog going go - gold gold golden golden - goldenly goldenli goldsmith goldsmith - goldsmiths goldsmith golgotha golgotha - goliases golias goliath goliath - gon gon gondola gondola - gondolier gondoli gone gone - goneril goneril gong gong - gonzago gonzago gonzalo gonzalo - good good goodfellow goodfellow - goodlier goodlier goodliest goodliest - goodly goodli goodman goodman - goodness good goodnight goodnight - goodrig goodrig goods good - goodwife goodwif goodwill goodwil - goodwin goodwin goodwins goodwin - goodyear goodyear goodyears goodyear - goose goos gooseberry gooseberri - goosequills goosequil goot goot - gor gor gorbellied gorbelli - gorboduc gorboduc gordian gordian - gore gore gored gore - gorg gorg gorge gorg - gorgeous gorgeou gorget gorget - gorging gorg gorgon gorgon - gormandize gormand gormandizing gormand - gory gori gosling gosl - gospel gospel gospels gospel - goss goss gossamer gossam - gossip gossip gossiping gossip - gossiplike gossiplik gossips gossip - got got goth goth - goths goth gotten gotten - gourd gourd gout gout - gouts gout gouty gouti - govern govern governance govern - governed govern governess gover - government govern governor governor - governors governor governs govern - gower gower gown gown - gowns gown grac grac - grace grace graced grace - graceful grace gracefully gracefulli - graceless graceless graces grace - gracing grace gracious graciou - graciously gracious gradation gradat - graff graff graffing graf - graft graft grafted graft - grafters grafter grain grain - grained grain grains grain - gramercies gramerci gramercy gramerci - grammar grammar grand grand - grandam grandam grandame grandam - grandchild grandchild grande grand - grandeur grandeur grandfather grandfath - grandjurors grandjuror grandmother grandmoth - grandpre grandpr grandsir grandsir - grandsire grandsir grandsires grandsir - grange grang grant grant - granted grant granting grant - grants grant grape grape - grapes grape grapple grappl - grapples grappl grappling grappl - grasp grasp grasped grasp - grasps grasp grass grass - grasshoppers grasshopp grassy grassi - grate grate grated grate - grateful grate grates grate - gratiano gratiano gratify gratifi - gratii gratii gratillity gratil - grating grate gratis grati - gratitude gratitud gratulate gratul - grav grav grave grave - gravediggers gravedigg gravel gravel - graveless graveless gravell gravel - gravely grave graven graven - graveness grave graver graver - graves grave gravest gravest - gravestone graveston gravities graviti - gravity graviti gravy gravi - gray grai graymalkin graymalkin - graz graz graze graze - grazed graze grazing graze - grease greas greases greas - greasily greasili greasy greasi - great great greater greater - greatest greatest greatly greatli - greatness great grecian grecian - grecians grecian gree gree - greece greec greed greed - greedily greedili greediness greedi - greedy greedi greeing gree - greek greek greekish greekish - greeks greek green green - greener greener greenly greenli - greens green greensleeves greensleev - greenwich greenwich greenwood greenwood - greet greet greeted greet - greeting greet greetings greet - greets greet greg greg - gregory gregori gremio gremio - grew grew grey grei - greybeard greybeard greybeards greybeard - greyhound greyhound greyhounds greyhound - grief grief griefs grief - griev griev grievance grievanc - grievances grievanc grieve griev - grieved griev grieves griev - grievest grievest grieving griev - grievingly grievingli grievous grievou - grievously grievous griffin griffin - griffith griffith grim grim - grime grime grimly grimli - grin grin grind grind - grinding grind grindstone grindston - grinning grin grip grip - gripe gripe gripes gripe - griping gripe grise grise - grisly grisli grissel grissel - grize grize grizzle grizzl - grizzled grizzl groan groan - groaning groan groans groan - groat groat groats groat - groin groin groom groom - grooms groom grop grop - groping grope gros gro - gross gross grosser grosser - grossly grossli grossness gross - ground ground grounded ground - groundlings groundl grounds ground - grove grove grovel grovel - grovelling grovel groves grove - grow grow groweth groweth - growing grow grown grown - grows grow growth growth - grub grub grubb grubb - grubs grub grudge grudg - grudged grudg grudges grudg - grudging grudg gruel gruel - grumble grumbl grumblest grumblest - grumbling grumbl grumblings grumbl - grumio grumio grund grund - grunt grunt gualtier gualtier - guard guard guardage guardag - guardant guardant guarded guard - guardian guardian guardians guardian - guards guard guardsman guardsman - gud gud gudgeon gudgeon - guerdon guerdon guerra guerra - guess guess guesses guess - guessingly guessingli guest guest - guests guest guiana guiana - guichard guichard guide guid - guided guid guider guider - guiderius guideriu guides guid - guiding guid guidon guidon - guienne guienn guil guil - guildenstern guildenstern guilders guilder - guildford guildford guildhall guildhal - guile guil guiled guil - guileful guil guilfords guilford - guilt guilt guiltian guiltian - guiltier guiltier guiltily guiltili - guiltiness guilti guiltless guiltless - guilts guilt guilty guilti - guinea guinea guinever guinev - guise guis gul gul - gules gule gulf gulf - gulfs gulf gull gull - gulls gull gum gum - gumm gumm gums gum - gun gun gunner gunner - gunpowder gunpowd guns gun - gurnet gurnet gurney gurnei - gust gust gusts gust - gusty gusti guts gut - gutter gutter guy gui - guynes guyn guysors guysor - gypsy gypsi gyve gyve - gyved gyve gyves gyve - h h ha ha - haberdasher haberdash habiliment habili - habiliments habili habit habit - habitation habit habited habit - habits habit habitude habitud - hack hack hacket hacket - hackney hacknei hacks hack - had had hadst hadst - haec haec haeres haer - hag hag hagar hagar - haggard haggard haggards haggard - haggish haggish haggled haggl - hags hag hail hail - hailed hail hailstone hailston - hailstones hailston hair hair - hairless hairless hairs hair - hairy hairi hal hal - halberd halberd halberds halberd - halcyon halcyon hale hale - haled hale hales hale - half half halfcan halfcan - halfpence halfpenc halfpenny halfpenni - halfpennyworth halfpennyworth halfway halfwai - halidom halidom hall hall - halloa halloa halloing hallo - hallond hallond halloo halloo - hallooing halloo hallow hallow - hallowed hallow hallowmas hallowma - hallown hallown hals hal - halt halt halter halter - halters halter halting halt - halts halt halves halv - ham ham hames hame - hamlet hamlet hammer hammer - hammered hammer hammering hammer - hammers hammer hamper hamper - hampton hampton hams ham - hamstring hamstr hand hand - handed hand handful hand - handicraft handicraft handicraftsmen handicraftsmen - handing hand handiwork handiwork - handkercher handkerch handkerchers handkerch - handkerchief handkerchief handle handl - handled handl handles handl - handless handless handlest handlest - handling handl handmaid handmaid - handmaids handmaid hands hand - handsaw handsaw handsome handsom - handsomely handsom handsomeness handsom - handwriting handwrit handy handi - hang hang hanged hang - hangers hanger hangeth hangeth - hanging hang hangings hang - hangman hangman hangmen hangmen - hangs hang hannibal hannib - hap hap hapless hapless - haply hapli happ happ - happen happen happened happen - happier happier happies happi - happiest happiest happily happili - happiness happi happy happi - haps hap harbinger harbing - harbingers harbing harbor harbor - harbour harbour harbourage harbourag - harbouring harbour harbours harbour - harcourt harcourt hard hard - harder harder hardest hardest - hardiest hardiest hardiment hardiment - hardiness hardi hardly hardli - hardness hard hardocks hardock - hardy hardi hare hare - harelip harelip hares hare - harfleur harfleur hark hark - harlot harlot harlotry harlotri - harlots harlot harm harm - harmed harm harmful harm - harming harm harmless harmless - harmonious harmoni harmony harmoni - harms harm harness har - harp harp harper harper - harpier harpier harping harp - harpy harpi harried harri - harrow harrow harrows harrow - harry harri harsh harsh - harshly harshli harshness harsh - hart hart harts hart - harum harum harvest harvest - has ha hast hast - haste hast hasted hast - hasten hasten hastes hast - hastily hastili hasting hast - hastings hast hasty hasti - hat hat hatch hatch - hatches hatch hatchet hatchet - hatching hatch hatchment hatchment - hate hate hated hate - hateful hate hater hater - haters hater hates hate - hateth hateth hatfield hatfield - hath hath hating hate - hatred hatr hats hat - haud haud hauf hauf - haught haught haughtiness haughti - haughty haughti haunch haunch - haunches haunch haunt haunt - haunted haunt haunting haunt - haunts haunt hautboy hautboi - hautboys hautboi have have - haven haven havens haven - haver haver having have - havings have havior havior - haviour haviour havoc havoc - hawk hawk hawking hawk - hawks hawk hawthorn hawthorn - hawthorns hawthorn hay hai - hazard hazard hazarded hazard - hazards hazard hazel hazel - hazelnut hazelnut he he - head head headborough headborough - headed head headier headier - heading head headland headland - headless headless headlong headlong - heads head headsman headsman - headstrong headstrong heady headi - heal heal healed heal - healing heal heals heal - health health healthful health - healths health healthsome healthsom - healthy healthi heap heap - heaping heap heaps heap - hear hear heard heard - hearer hearer hearers hearer - hearest hearest heareth heareth - hearing hear hearings hear - heark heark hearken hearken - hearkens hearken hears hear - hearsay hearsai hearse hears - hearsed hears hearst hearst - heart heart heartache heartach - heartbreak heartbreak heartbreaking heartbreak - hearted heart hearten hearten - hearth hearth hearths hearth - heartily heartili heartiness hearti - heartless heartless heartlings heartl - heartly heartli hearts heart - heartsick heartsick heartstrings heartstr - hearty hearti heat heat - heated heat heath heath - heathen heathen heathenish heathenish - heating heat heats heat - heauties heauti heav heav - heave heav heaved heav - heaven heaven heavenly heavenli - heavens heaven heaves heav - heavier heavier heaviest heaviest - heavily heavili heaviness heavi - heaving heav heavings heav - heavy heavi hebona hebona - hebrew hebrew hecate hecat - hectic hectic hector hector - hectors hector hecuba hecuba - hedg hedg hedge hedg - hedgehog hedgehog hedgehogs hedgehog - hedges hedg heed heed - heeded heed heedful heed - heedfull heedful heedfully heedfulli - heedless heedless heel heel - heels heel hefted heft - hefts heft heifer heifer - heifers heifer heigh heigh - height height heighten heighten - heinous heinou heinously heinous - heir heir heiress heiress - heirless heirless heirs heir - held held helen helen - helena helena helenus helenu - helias helia helicons helicon - hell hell hellespont hellespont - hellfire hellfir hellish hellish - helm helm helmed helm - helmet helmet helmets helmet - helms helm help help - helper helper helpers helper - helpful help helping help - helpless helpless helps help - helter helter hem hem - heme heme hemlock hemlock - hemm hemm hemp hemp - hempen hempen hems hem - hen hen hence henc - henceforth henceforth henceforward henceforward - henchman henchman henri henri - henricus henricu henry henri - hens hen hent hent - henton henton her her - herald herald heraldry heraldri - heralds herald herb herb - herbert herbert herblets herblet - herbs herb herculean herculean - hercules hercul herd herd - herds herd herdsman herdsman - herdsmen herdsmen here here - hereabout hereabout hereabouts hereabout - hereafter hereaft hereby herebi - hereditary hereditari hereford hereford - herefordshire herefordshir herein herein - hereof hereof heresies heresi - heresy heresi heretic heret - heretics heret hereto hereto - hereupon hereupon heritage heritag - heritier heriti hermes herm - hermia hermia hermione hermion - hermit hermit hermitage hermitag - hermits hermit herne hern - hero hero herod herod - herods herod heroes hero - heroic heroic heroical heroic - herring her herrings her - hers her herself herself - hesperides hesperid hesperus hesperu - hest hest hests hest - heure heur heureux heureux - hew hew hewgh hewgh - hewing hew hewn hewn - hews hew hey hei - heyday heydai hibocrates hibocr - hic hic hiccups hiccup - hick hick hid hid - hidden hidden hide hide - hideous hideou hideously hideous - hideousness hideous hides hide - hidest hidest hiding hide - hie hie hied hi - hiems hiem hies hi - hig hig high high - higher higher highest highest - highly highli highmost highmost - highness high hight hight - highway highwai highways highwai - hilding hild hildings hild - hill hill hillo hillo - hilloa hilloa hills hill - hilt hilt hilts hilt - hily hili him him - himself himself hinc hinc - hinckley hincklei hind hind - hinder hinder hindered hinder - hinders hinder hindmost hindmost - hinds hind hing hing - hinge hing hinges hing - hint hint hip hip - hipp hipp hipparchus hipparchu - hippolyta hippolyta hips hip - hir hir hire hire - hired hire hiren hiren - hirtius hirtiu his hi - hisperia hisperia hiss hiss - hisses hiss hissing hiss - hist hist historical histor - history histori hit hit - hither hither hitherto hitherto - hitherward hitherward hitherwards hitherward - hits hit hitting hit - hive hive hives hive - hizzing hizz ho ho - hoa hoa hoar hoar - hoard hoard hoarded hoard - hoarding hoard hoars hoar - hoarse hoars hoary hoari - hob hob hobbididence hobbidid - hobby hobbi hobbyhorse hobbyhors - hobgoblin hobgoblin hobnails hobnail - hoc hoc hod hod - hodge hodg hog hog - hogs hog hogshead hogshead - hogsheads hogshead hois hoi - hoise hois hoist hoist - hoisted hoist hoists hoist - holborn holborn hold hold - holden holden holder holder - holdeth holdeth holdfast holdfast - holding hold holds hold - hole hole holes hole - holidam holidam holidame holidam - holiday holidai holidays holidai - holier holier holiest holiest - holily holili holiness holi - holla holla holland holland - hollander holland hollanders holland - holloa holloa holloaing holloa - hollow hollow hollowly hollowli - hollowness hollow holly holli - holmedon holmedon holofernes holofern - holp holp holy holi - homage homag homager homag - home home homely home - homes home homespuns homespun - homeward homeward homewards homeward - homicide homicid homicides homicid - homily homili hominem hominem - hommes homm homo homo - honest honest honester honest - honestest honestest honestly honestli - honesty honesti honey honei - honeycomb honeycomb honeying honei - honeyless honeyless honeysuckle honeysuckl - honeysuckles honeysuckl honi honi - honneur honneur honor honor - honorable honor honorably honor + extraordinary extraordinari extraught extraught + extravagancy extravag extravagant extravag + extreme extrem extremely extrem + extremes extrem extremest extremest + extremities extrem extremity extrem + exuent exuent exult exult + exultation exult ey ey + eyas eya eyases eyas + eye ey eyeball eyebal + eyeballs eyebal eyebrow eyebrow + eyebrows eyebrow eyed ei + eyeless eyeless eyelid eyelid + eyelids eyelid eyes ey + eyesight eyesight eyestrings eyestr + eying ei eyne eyn + eyrie eyri fa fa + fabian fabian fable fabl + fables fabl fabric fabric + fabulous fabul fac fac + face face faced face + facere facer faces face + faciant faciant facile facil + facility facil facinerious facineri + facing face facit facit + fact fact faction faction + factionary factionari factions faction + factious factiou factor factor + factors factor faculties faculti + faculty faculti fade fade + faded fade fadeth fadeth + fadge fadg fading fade + fadings fade fadom fadom + fadoms fadom fagot fagot + fagots fagot fail fail + failing fail fails fail + fain fain faint faint + fainted faint fainter fainter + fainting faint faintly faintli + faintness faint faints faint + fair fair fairer fairer + fairest fairest fairies fairi + fairing fair fairings fair + fairly fairli fairness fair + fairs fair fairwell fairwel + fairy fairi fais fai + fait fait faites fait + faith faith faithful faith + faithfull faithful faithfully faithfulli + faithless faithless faiths faith + faitors faitor fal fal + falchion falchion falcon falcon + falconbridge falconbridg falconer falcon + falconers falcon fall fall + fallacy fallaci fallen fallen + falleth falleth falliable falliabl + fallible fallibl falling fall + fallow fallow fallows fallow + falls fall fally falli + falorous falor false fals + falsehood falsehood falsely fals + falseness fals falser falser + falsify falsifi falsing fals + falstaff falstaff falstaffs falstaff + falter falter fam fam + fame fame famed fame + familiar familiar familiarity familiar + familiarly familiarli familiars familiar + family famili famine famin + famish famish famished famish + famous famou famoused famous + famously famous fan fan + fanatical fanat fancies fanci + fancy fanci fane fane + fanes fane fang fang + fangled fangl fangless fangless + fangs fang fann fann + fanning fan fans fan + fantasied fantasi fantasies fantasi + fantastic fantast fantastical fantast + fantastically fantast fantasticoes fantastico + fantasy fantasi fap fap + far far farborough farborough + farced farc fardel fardel + fardels fardel fare fare + fares fare farewell farewel + farewells farewel fariner farin + faring fare farm farm + farmer farmer farmhouse farmhous + farms farm farre farr + farrow farrow farther farther + farthest farthest farthing farth + farthingale farthingal farthingales farthingal + farthings farth fartuous fartuou + fas fa fashion fashion + fashionable fashion fashioning fashion + fashions fashion fast fast + fasted fast fasten fasten + fastened fasten faster faster + fastest fastest fasting fast + fastly fastli fastolfe fastolf + fasts fast fat fat + fatal fatal fatally fatal + fate fate fated fate + fates fate father father + fathered father fatherless fatherless + fatherly fatherli fathers father + fathom fathom fathomless fathomless + fathoms fathom fatigate fatig + fatness fat fats fat + fatted fat fatter fatter + fattest fattest fatting fat + fatuus fatuu fauconbridge fauconbridg + faulconbridge faulconbridg fault fault + faultiness faulti faultless faultless + faults fault faulty faulti + fausse fauss fauste faust + faustuses faustus faut faut + favor favor favorable favor + favorably favor favors favor + favour favour favourable favour + favoured favour favouredly favouredli + favourer favour favourers favour + favouring favour favourite favourit + favourites favourit favours favour + favout favout fawn fawn + fawneth fawneth fawning fawn + fawns fawn fay fai + fe fe fealty fealti + fear fear feared fear + fearest fearest fearful fear + fearfull fearful fearfully fearfulli + fearfulness fear fearing fear + fearless fearless fears fear + feast feast feasted feast + feasting feast feasts feast + feat feat feated feat + feater feater feather feather + feathered feather feathers feather + featly featli feats feat + featur featur feature featur + featured featur featureless featureless + features featur february februari + fecks feck fed fed + fedary fedari federary federari + fee fee feeble feebl + feebled feebl feebleness feebl + feebling feebl feebly feebli + feed feed feeder feeder + feeders feeder feedeth feedeth + feeding feed feeds feed + feel feel feeler feeler + feeling feel feelingly feelingli + feels feel fees fee + feet feet fehemently fehement + feign feign feigned feign + feigning feign feil feil + feith feith felicitate felicit + felicity felic fell fell + fellest fellest fellies felli + fellow fellow fellowly fellowli + fellows fellow fellowship fellowship + fellowships fellowship fells fell + felon felon felonious feloni + felony feloni felt felt + female femal females femal + feminine feminin fen fen + fenc fenc fence fenc + fencer fencer fencing fenc + fends fend fennel fennel + fenny fenni fens fen + fenton fenton fer fer + ferdinand ferdinand fere fere + fernseed fernse ferrara ferrara + ferrers ferrer ferret ferret + ferry ferri ferryman ferryman + fertile fertil fertility fertil + fervency fervenc fervour fervour + fery feri fest fest + feste fest fester fester + festinate festin festinately festin + festival festiv festivals festiv + fet fet fetch fetch + fetches fetch fetching fetch + fetlock fetlock fetlocks fetlock + fett fett fetter fetter + fettering fetter fetters fetter + fettle fettl feu feu + feud feud fever fever + feverous fever fevers fever + few few fewer fewer + fewest fewest fewness few + fickle fickl fickleness fickl + fico fico fiction fiction + fiddle fiddl fiddler fiddler + fiddlestick fiddlestick fidele fidel + fidelicet fidelicet fidelity fidel + fidius fidiu fie fie + field field fielded field + fields field fiend fiend + fiends fiend fierce fierc + fiercely fierc fierceness fierc + fiery fieri fife fife + fifes fife fifteen fifteen + fifteens fifteen fifteenth fifteenth + fifth fifth fifty fifti + fiftyfold fiftyfold fig fig + fight fight fighter fighter + fightest fightest fighteth fighteth + fighting fight fights fight + figo figo figs fig + figur figur figure figur + figured figur figures figur + figuring figur fike fike + fil fil filberts filbert + filch filch filches filch + filching filch file file + filed file files file + filial filial filius filiu + fill fill filled fill + fillet fillet filling fill + fillip fillip fills fill + filly filli film film + fils fil filth filth + filths filth filthy filthi + fin fin finally final + finch finch find find + finder finder findeth findeth + finding find findings find + finds find fine fine + fineless fineless finely fine + finem finem fineness fine + finer finer fines fine + finest finest fing fing + finger finger fingering finger + fingers finger fingre fingr + fingres fingr finical finic + finish finish finished finish + finisher finish finless finless + finn finn fins fin + finsbury finsburi fir fir + firago firago fire fire + firebrand firebrand firebrands firebrand + fired fire fires fire + firework firework fireworks firework + firing fire firk firk + firm firm firmament firmament + firmly firmli firmness firm + first first firstlings firstl + fish fish fisher fisher + fishermen fishermen fishers fisher + fishes fish fishified fishifi + fishmonger fishmong fishpond fishpond + fisnomy fisnomi fist fist + fisting fist fists fist + fistula fistula fit fit + fitchew fitchew fitful fit + fitly fitli fitment fitment + fitness fit fits fit + fitted fit fitter fitter + fittest fittest fitteth fitteth + fitting fit fitzwater fitzwat + five five fivepence fivep + fives five fix fix + fixed fix fixes fix + fixeth fixeth fixing fix + fixture fixtur fl fl + flag flag flagging flag + flagon flagon flagons flagon + flags flag flail flail + flakes flake flaky flaki + flam flam flame flame + flamen flamen flamens flamen + flames flame flaming flame + flaminius flaminiu flanders flander + flannel flannel flap flap + flaring flare flash flash + flashes flash flashing flash + flask flask flat flat + flatly flatli flatness flat + flats flat flatt flatt + flatter flatter flattered flatter + flatterer flatter flatterers flatter + flatterest flatterest flatteries flatteri + flattering flatter flatters flatter + flattery flatteri flaunts flaunt + flavio flavio flavius flaviu + flaw flaw flaws flaw + flax flax flaxen flaxen + flay flai flaying flai + flea flea fleance fleanc + fleas flea flecked fleck + fled fled fledge fledg + flee flee fleec fleec + fleece fleec fleeces fleec + fleer fleer fleering fleer + fleers fleer fleet fleet + fleeter fleeter fleeting fleet + fleming fleme flemish flemish + flesh flesh fleshes flesh + fleshly fleshli fleshment fleshment + fleshmonger fleshmong flew flew + flexible flexibl flexure flexur + flibbertigibbet flibbertigibbet flickering flicker + flidge flidg fliers flier + flies fli flieth flieth + flight flight flights flight + flighty flighti flinch flinch + fling fling flint flint + flints flint flinty flinti + flirt flirt float float + floated float floating float + flock flock flocks flock + flood flood floodgates floodgat + floods flood floor floor + flora flora florence florenc + florentine florentin florentines florentin + florentius florentiu florizel florizel + flote flote floulish floulish + flour flour flourish flourish + flourishes flourish flourisheth flourisheth + flourishing flourish flout flout + flouted flout flouting flout + flouts flout flow flow + flowed flow flower flower + flowerets floweret flowers flower + flowing flow flown flown + flows flow fluellen fluellen + fluent fluent flung flung + flush flush flushing flush + fluster fluster flute flute + flutes flute flutter flutter + flux flux fluxive fluxiv + fly fly flying fly + fo fo foal foal + foals foal foam foam + foamed foam foaming foam + foams foam foamy foami + fob fob focative foc + fodder fodder foe foe + foeman foeman foemen foemen + foes foe fog fog + foggy foggi fogs fog + foh foh foi foi + foil foil foiled foil + foils foil foin foin + foining foin foins foin + fois foi foison foison + foisons foison foist foist + foix foix fold fold + folded fold folds fold + folio folio folk folk + folks folk follies folli + follow follow followed follow + follower follow followers follow + followest followest following follow + follows follow folly folli + fond fond fonder fonder + fondly fondli fondness fond + font font fontibell fontibel + food food fool fool + fooleries fooleri foolery fooleri + foolhardy foolhardi fooling fool + foolish foolish foolishly foolishli + foolishness foolish fools fool + foot foot football footbal + footboy footboi footboys footboi + footed foot footfall footfal + footing foot footman footman + footmen footmen footpath footpath + footsteps footstep footstool footstool + fopp fopp fopped fop + foppery fopperi foppish foppish + fops fop for for + forage forag foragers forag + forbade forbad forbear forbear + forbearance forbear forbears forbear + forbid forbid forbidden forbidden + forbiddenly forbiddenli forbids forbid + forbod forbod forborne forborn + forc forc force forc + forced forc forceful forc + forceless forceless forces forc + forcible forcibl forcibly forcibl + forcing forc ford ford + fordid fordid fordo fordo + fordoes fordo fordone fordon + fore fore forecast forecast + forefather forefath forefathers forefath + forefinger forefing forego forego + foregone foregon forehand forehand + forehead forehead foreheads forehead + forehorse forehors foreign foreign + foreigner foreign foreigners foreign + foreknowing foreknow foreknowledge foreknowledg + foremost foremost forenamed forenam + forenoon forenoon forerun forerun + forerunner forerunn forerunning forerun + foreruns forerun foresaid foresaid + foresaw foresaw foresay foresai + foresee forese foreseeing forese + foresees forese foreshow foreshow + foreskirt foreskirt forespent foresp + forest forest forestall forestal + forestalled forestal forester forest + foresters forest forests forest + foretell foretel foretelling foretel + foretells foretel forethink forethink + forethought forethought foretold foretold + forever forev foreward foreward + forewarn forewarn forewarned forewarn + forewarning forewarn forfeit forfeit + forfeited forfeit forfeiters forfeit + forfeiting forfeit forfeits forfeit + forfeiture forfeitur forfeitures forfeitur + forfend forfend forfended forfend + forg forg forgave forgav + forge forg forged forg + forgeries forgeri forgery forgeri + forges forg forget forget + forgetful forget forgetfulness forget + forgetive forget forgets forget + forgetting forget forgive forgiv + forgiven forgiven forgiveness forgiv + forgo forgo forgoing forgo + forgone forgon forgot forgot + forgotten forgotten fork fork + forked fork forks fork + forlorn forlorn form form + formal formal formally formal + formed form former former + formerly formerli formless formless + forms form fornication fornic + fornications fornic fornicatress fornicatress + forres forr forrest forrest + forsake forsak forsaken forsaken + forsaketh forsaketh forslow forslow + forsook forsook forsooth forsooth + forspent forspent forspoke forspok + forswear forswear forswearing forswear + forswore forswor forsworn forsworn + fort fort forted fort + forth forth forthcoming forthcom + forthlight forthlight forthright forthright + forthwith forthwith fortification fortif + fortifications fortif fortified fortifi + fortifies fortifi fortify fortifi + fortinbras fortinbra fortitude fortitud + fortnight fortnight fortress fortress + fortresses fortress forts fort + fortun fortun fortuna fortuna + fortunate fortun fortunately fortun + fortune fortun fortuned fortun + fortunes fortun fortward fortward + forty forti forum forum + forward forward forwarding forward + forwardness forward forwards forward + forwearied forweari fosset fosset + fost fost foster foster + fostered foster fought fought + foughten foughten foul foul + fouler fouler foulest foulest + foully foulli foulness foul + found found foundation foundat + foundations foundat founded found + founder founder fount fount + fountain fountain fountains fountain + founts fount four four + fourscore fourscor fourteen fourteen + fourth fourth foutra foutra + fowl fowl fowler fowler + fowling fowl fowls fowl + fox fox foxes fox + foxship foxship fracted fract + fraction fraction fractions fraction + fragile fragil fragment fragment + fragments fragment fragrant fragrant + frail frail frailer frailer + frailties frailti frailty frailti + fram fram frame frame + framed frame frames frame + frampold frampold fran fran + francais francai france franc + frances franc franchise franchis + franchised franchis franchisement franchis + franchises franchis franciae francia + francis franci francisca francisca + franciscan franciscan francisco francisco + frank frank franker franker + frankfort frankfort franklin franklin + franklins franklin frankly frankli + frankness frank frantic frantic + franticly franticli frateretto frateretto + fratrum fratrum fraud fraud + fraudful fraud fraught fraught + fraughtage fraughtag fraughting fraught + fray frai frays frai + freckl freckl freckled freckl + freckles freckl frederick frederick + free free freed freed + freedom freedom freedoms freedom + freehearted freeheart freelier freelier + freely freeli freeman freeman + freemen freemen freeness freeness + freer freer frees free + freestone freeston freetown freetown + freeze freez freezes freez + freezing freez freezings freez + french french frenchman frenchman + frenchmen frenchmen frenchwoman frenchwoman + frenzy frenzi frequent frequent + frequents frequent fresh fresh + fresher fresher freshes fresh + freshest freshest freshly freshli + freshness fresh fret fret + fretful fret frets fret + fretted fret fretten fretten + fretting fret friar friar + friars friar friday fridai + fridays fridai friend friend + friended friend friending friend + friendless friendless friendliness friendli + friendly friendli friends friend + friendship friendship friendships friendship + frieze friez fright fright + frighted fright frightened frighten + frightful fright frighting fright + frights fright fringe fring + fringed fring frippery fripperi + frisk frisk fritters fritter + frivolous frivol fro fro + frock frock frog frog + frogmore frogmor froissart froissart + frolic frolic from from + front front fronted front + frontier frontier frontiers frontier + fronting front frontlet frontlet + fronts front frost frost + frosts frost frosty frosti + froth froth froward froward + frown frown frowning frown + frowningly frowningli frowns frown + froze froze frozen frozen + fructify fructifi frugal frugal + fruit fruit fruiterer fruiter + fruitful fruit fruitfully fruitfulli + fruitfulness fruit fruition fruition + fruitless fruitless fruits fruit + frush frush frustrate frustrat + frutify frutifi fry fry + fubb fubb fuel fuel + fugitive fugit fulfil fulfil + fulfill fulfil fulfilling fulfil + fulfils fulfil full full + fullam fullam fuller fuller + fullers fuller fullest fullest + fullness full fully fulli + fulness ful fulsome fulsom + fulvia fulvia fum fum + fumble fumbl fumbles fumbl + fumblest fumblest fumbling fumbl + fume fume fumes fume + fuming fume fumiter fumit + fumitory fumitori fun fun + function function functions function + fundamental fundament funeral funer + funerals funer fur fur + furbish furbish furies furi + furious furiou furlongs furlong + furnace furnac furnaces furnac + furnish furnish furnished furnish + furnishings furnish furniture furnitur + furnival furniv furor furor + furr furr furrow furrow + furrowed furrow furrows furrow + furth furth further further + furtherance further furtherer further + furthermore furthermor furthest furthest + fury furi furze furz + furzes furz fust fust + fustian fustian fustilarian fustilarian + fusty fusti fut fut + future futur futurity futur + g g gabble gabbl + gaberdine gaberdin gabriel gabriel + gad gad gadding gad + gads gad gadshill gadshil + gag gag gage gage + gaged gage gagg gagg + gaging gage gagne gagn + gain gain gained gain + gainer gainer gaingiving gaingiv + gains gain gainsaid gainsaid + gainsay gainsai gainsaying gainsai + gainsays gainsai gainst gainst + gait gait gaited gait + galathe galath gale gale + galen galen gales gale + gall gall gallant gallant + gallantly gallantli gallantry gallantri + gallants gallant galled gall + gallery galleri galley gallei + galleys gallei gallia gallia + gallian gallian galliard galliard + galliasses galliass gallimaufry gallimaufri + galling gall gallons gallon + gallop gallop galloping gallop + gallops gallop gallow gallow + galloway gallowai gallowglasses gallowglass + gallows gallow gallowses gallows + galls gall gallus gallu + gam gam gambol gambol + gambold gambold gambols gambol + gamboys gamboi game game + gamers gamer games game + gamesome gamesom gamester gamest + gaming game gammon gammon + gamut gamut gan gan + gangren gangren ganymede ganymed + gaol gaol gaoler gaoler + gaolers gaoler gaols gaol + gap gap gape gape + gapes gape gaping gape + gar gar garb garb + garbage garbag garboils garboil + garcon garcon gard gard + garde gard garden garden + gardener garden gardeners garden + gardens garden gardez gardez + gardiner gardin gardon gardon + gargantua gargantua gargrave gargrav + garish garish garland garland + garlands garland garlic garlic + garment garment garments garment + garmet garmet garner garner + garners garner garnish garnish + garnished garnish garret garret + garrison garrison garrisons garrison + gart gart garter garter + garterd garterd gartering garter + garters garter gascony gasconi + gash gash gashes gash + gaskins gaskin gasp gasp + gasping gasp gasted gast + gastness gast gat gat + gate gate gated gate + gates gate gath gath + gather gather gathered gather + gathering gather gathers gather + gatories gatori gatory gatori + gaud gaud gaudeo gaudeo + gaudy gaudi gauge gaug + gaul gaul gaultree gaultre + gaunt gaunt gauntlet gauntlet + gauntlets gauntlet gav gav + gave gave gavest gavest + gawded gawd gawds gawd + gawsey gawsei gay gai + gayness gay gaz gaz + gaze gaze gazed gaze + gazer gazer gazers gazer + gazes gaze gazeth gazeth + gazing gaze gear gear + geck geck geese gees + geffrey geffrei geld geld + gelded geld gelding geld + gelida gelida gelidus gelidu + gelt gelt gem gem + geminy gemini gems gem + gen gen gender gender + genders gender general gener + generally gener generals gener + generation gener generations gener + generative gener generosity generos + generous gener genitive genit + genitivo genitivo genius geniu + gennets gennet genoa genoa + genoux genoux gens gen + gent gent gentilhomme gentilhomm + gentility gentil gentle gentl + gentlefolks gentlefolk gentleman gentleman + gentlemanlike gentlemanlik gentlemen gentlemen + gentleness gentl gentler gentler + gentles gentl gentlest gentlest + gentlewoman gentlewoman gentlewomen gentlewomen + gently gentli gentry gentri + george georg gerard gerard + germaines germain germains germain + german german germane german + germans german germany germani + gertrude gertrud gest gest + gests gest gesture gestur + gestures gestur get get + getrude getrud gets get + getter getter getting get + ghastly ghastli ghost ghost + ghosted ghost ghostly ghostli + ghosts ghost gi gi + giant giant giantess giantess + giantlike giantlik giants giant + gib gib gibber gibber + gibbet gibbet gibbets gibbet + gibe gibe giber giber + gibes gibe gibing gibe + gibingly gibingli giddily giddili + giddiness giddi giddy giddi + gift gift gifts gift + gig gig giglets giglet + giglot giglot gilbert gilbert + gild gild gilded gild + gilding gild gilliams gilliam + gillian gillian gills gill + gillyvors gillyvor gilt gilt + gimmal gimmal gimmers gimmer + gin gin ging ging + ginger ginger gingerbread gingerbread + gingerly gingerli ginn ginn + gins gin gioucestershire gioucestershir + gipes gipe gipsies gipsi + gipsy gipsi gird gird + girded gird girdle girdl + girdled girdl girdles girdl + girdling girdl girl girl + girls girl girt girt + girth girth gis gi + giv giv give give + given given giver giver + givers giver gives give + givest givest giveth giveth + giving give givings give + glad glad gladded glad + gladding glad gladly gladli + gladness glad glamis glami + glanc glanc glance glanc + glanced glanc glances glanc + glancing glanc glanders glander + glansdale glansdal glare glare + glares glare glass glass + glasses glass glassy glassi + glaz glaz glazed glaze + gleams gleam glean glean + gleaned glean gleaning glean + gleeful gleeful gleek gleek + gleeking gleek gleeks gleek + glend glend glendower glendow + glib glib glide glide + glided glide glides glide + glideth glideth gliding glide + glimmer glimmer glimmering glimmer + glimmers glimmer glimpse glimps + glimpses glimps glist glist + glistening glisten glister glister + glistering glister glisters glister + glitt glitt glittering glitter + globe globe globes globe + glooming gloom gloomy gloomi + glories glori glorified glorifi + glorify glorifi glorious gloriou + gloriously glorious glory glori + glose glose gloss gloss + glosses gloss glou glou + glouceste gloucest gloucester gloucest + gloucestershire gloucestershir glove glove + glover glover gloves glove + glow glow glowed glow + glowing glow glowworm glowworm + gloz gloz gloze gloze + glozes gloze glu glu + glue glue glued glu + glues glue glut glut + glutt glutt glutted glut + glutton glutton gluttoning glutton + gluttony gluttoni gnarled gnarl + gnarling gnarl gnat gnat + gnats gnat gnaw gnaw + gnawing gnaw gnawn gnawn + gnaws gnaw go go + goad goad goaded goad + goads goad goal goal + goat goat goatish goatish + goats goat gobbets gobbet + gobbo gobbo goblet goblet + goblets goblet goblin goblin + goblins goblin god god + godded god godden godden + goddess goddess goddesses goddess + goddild goddild godfather godfath + godfathers godfath godhead godhead + godlike godlik godliness godli + godly godli godmother godmoth + gods god godson godson + goer goer goers goer + goes goe goest goest + goeth goeth goffe goff + gogs gog going go + gold gold golden golden + goldenly goldenli goldsmith goldsmith + goldsmiths goldsmith golgotha golgotha + goliases golias goliath goliath + gon gon gondola gondola + gondolier gondoli gone gone + goneril goneril gong gong + gonzago gonzago gonzalo gonzalo + good good goodfellow goodfellow + goodlier goodlier goodliest goodliest + goodly goodli goodman goodman + goodness good goodnight goodnight + goodrig goodrig goods good + goodwife goodwif goodwill goodwil + goodwin goodwin goodwins goodwin + goodyear goodyear goodyears goodyear + goose goos gooseberry gooseberri + goosequills goosequil goot goot + gor gor gorbellied gorbelli + gorboduc gorboduc gordian gordian + gore gore gored gore + gorg gorg gorge gorg + gorgeous gorgeou gorget gorget + gorging gorg gorgon gorgon + gormandize gormand gormandizing gormand + gory gori gosling gosl + gospel gospel gospels gospel + goss goss gossamer gossam + gossip gossip gossiping gossip + gossiplike gossiplik gossips gossip + got got goth goth + goths goth gotten gotten + gourd gourd gout gout + gouts gout gouty gouti + govern govern governance govern + governed govern governess gover + government govern governor governor + governors governor governs govern + gower gower gown gown + gowns gown grac grac + grace grace graced grace + graceful grace gracefully gracefulli + graceless graceless graces grace + gracing grace gracious graciou + graciously gracious gradation gradat + graff graff graffing graf + graft graft grafted graft + grafters grafter grain grain + grained grain grains grain + gramercies gramerci gramercy gramerci + grammar grammar grand grand + grandam grandam grandame grandam + grandchild grandchild grande grand + grandeur grandeur grandfather grandfath + grandjurors grandjuror grandmother grandmoth + grandpre grandpr grandsir grandsir + grandsire grandsir grandsires grandsir + grange grang grant grant + granted grant granting grant + grants grant grape grape + grapes grape grapple grappl + grapples grappl grappling grappl + grasp grasp grasped grasp + grasps grasp grass grass + grasshoppers grasshopp grassy grassi + grate grate grated grate + grateful grate grates grate + gratiano gratiano gratify gratifi + gratii gratii gratillity gratil + grating grate gratis grati + gratitude gratitud gratulate gratul + grav grav grave grave + gravediggers gravedigg gravel gravel + graveless graveless gravell gravel + gravely grave graven graven + graveness grave graver graver + graves grave gravest gravest + gravestone graveston gravities graviti + gravity graviti gravy gravi + gray grai graymalkin graymalkin + graz graz graze graze + grazed graze grazing graze + grease greas greases greas + greasily greasili greasy greasi + great great greater greater + greatest greatest greatly greatli + greatness great grecian grecian + grecians grecian gree gree + greece greec greed greed + greedily greedili greediness greedi + greedy greedi greeing gree + greek greek greekish greekish + greeks greek green green + greener greener greenly greenli + greens green greensleeves greensleev + greenwich greenwich greenwood greenwood + greet greet greeted greet + greeting greet greetings greet + greets greet greg greg + gregory gregori gremio gremio + grew grew grey grei + greybeard greybeard greybeards greybeard + greyhound greyhound greyhounds greyhound + grief grief griefs grief + griev griev grievance grievanc + grievances grievanc grieve griev + grieved griev grieves griev + grievest grievest grieving griev + grievingly grievingli grievous grievou + grievously grievous griffin griffin + griffith griffith grim grim + grime grime grimly grimli + grin grin grind grind + grinding grind grindstone grindston + grinning grin grip grip + gripe gripe gripes gripe + griping gripe grise grise + grisly grisli grissel grissel + grize grize grizzle grizzl + grizzled grizzl groan groan + groaning groan groans groan + groat groat groats groat + groin groin groom groom + grooms groom grop grop + groping grope gros gro + gross gross grosser grosser + grossly grossli grossness gross + ground ground grounded ground + groundlings groundl grounds ground + grove grove grovel grovel + grovelling grovel groves grove + grow grow groweth groweth + growing grow grown grown + grows grow growth growth + grub grub grubb grubb + grubs grub grudge grudg + grudged grudg grudges grudg + grudging grudg gruel gruel + grumble grumbl grumblest grumblest + grumbling grumbl grumblings grumbl + grumio grumio grund grund + grunt grunt gualtier gualtier + guard guard guardage guardag + guardant guardant guarded guard + guardian guardian guardians guardian + guards guard guardsman guardsman + gud gud gudgeon gudgeon + guerdon guerdon guerra guerra + guess guess guesses guess + guessingly guessingli guest guest + guests guest guiana guiana + guichard guichard guide guid + guided guid guider guider + guiderius guideriu guides guid + guiding guid guidon guidon + guienne guienn guil guil + guildenstern guildenstern guilders guilder + guildford guildford guildhall guildhal + guile guil guiled guil + guileful guil guilfords guilford + guilt guilt guiltian guiltian + guiltier guiltier guiltily guiltili + guiltiness guilti guiltless guiltless + guilts guilt guilty guilti + guinea guinea guinever guinev + guise guis gul gul + gules gule gulf gulf + gulfs gulf gull gull + gulls gull gum gum + gumm gumm gums gum + gun gun gunner gunner + gunpowder gunpowd guns gun + gurnet gurnet gurney gurnei + gust gust gusts gust + gusty gusti guts gut + gutter gutter guy gui + guynes guyn guysors guysor + gypsy gypsi gyve gyve + gyved gyve gyves gyve + h h ha ha + haberdasher haberdash habiliment habili + habiliments habili habit habit + habitation habit habited habit + habits habit habitude habitud + hack hack hacket hacket + hackney hacknei hacks hack + had had hadst hadst + haec haec haeres haer + hag hag hagar hagar + haggard haggard haggards haggard + haggish haggish haggled haggl + hags hag hail hail + hailed hail hailstone hailston + hailstones hailston hair hair + hairless hairless hairs hair + hairy hairi hal hal + halberd halberd halberds halberd + halcyon halcyon hale hale + haled hale hales hale + half half halfcan halfcan + halfpence halfpenc halfpenny halfpenni + halfpennyworth halfpennyworth halfway halfwai + halidom halidom hall hall + halloa halloa halloing hallo + hallond hallond halloo halloo + hallooing halloo hallow hallow + hallowed hallow hallowmas hallowma + hallown hallown hals hal + halt halt halter halter + halters halter halting halt + halts halt halves halv + ham ham hames hame + hamlet hamlet hammer hammer + hammered hammer hammering hammer + hammers hammer hamper hamper + hampton hampton hams ham + hamstring hamstr hand hand + handed hand handful hand + handicraft handicraft handicraftsmen handicraftsmen + handing hand handiwork handiwork + handkercher handkerch handkerchers handkerch + handkerchief handkerchief handle handl + handled handl handles handl + handless handless handlest handlest + handling handl handmaid handmaid + handmaids handmaid hands hand + handsaw handsaw handsome handsom + handsomely handsom handsomeness handsom + handwriting handwrit handy handi + hang hang hanged hang + hangers hanger hangeth hangeth + hanging hang hangings hang + hangman hangman hangmen hangmen + hangs hang hannibal hannib + hap hap hapless hapless + haply hapli happ happ + happen happen happened happen + happier happier happies happi + happiest happiest happily happili + happiness happi happy happi + haps hap harbinger harbing + harbingers harbing harbor harbor + harbour harbour harbourage harbourag + harbouring harbour harbours harbour + harcourt harcourt hard hard + harder harder hardest hardest + hardiest hardiest hardiment hardiment + hardiness hardi hardly hardli + hardness hard hardocks hardock + hardy hardi hare hare + harelip harelip hares hare + harfleur harfleur hark hark + harlot harlot harlotry harlotri + harlots harlot harm harm + harmed harm harmful harm + harming harm harmless harmless + harmonious harmoni harmony harmoni + harms harm harness har + harp harp harper harper + harpier harpier harping harp + harpy harpi harried harri + harrow harrow harrows harrow + harry harri harsh harsh + harshly harshli harshness harsh + hart hart harts hart + harum harum harvest harvest + has ha hast hast + haste hast hasted hast + hasten hasten hastes hast + hastily hastili hasting hast + hastings hast hasty hasti + hat hat hatch hatch + hatches hatch hatchet hatchet + hatching hatch hatchment hatchment + hate hate hated hate + hateful hate hater hater + haters hater hates hate + hateth hateth hatfield hatfield + hath hath hating hate + hatred hatr hats hat + haud haud hauf hauf + haught haught haughtiness haughti + haughty haughti haunch haunch + haunches haunch haunt haunt + haunted haunt haunting haunt + haunts haunt hautboy hautboi + hautboys hautboi have have + haven haven havens haven + haver haver having have + havings have havior havior + haviour haviour havoc havoc + hawk hawk hawking hawk + hawks hawk hawthorn hawthorn + hawthorns hawthorn hay hai + hazard hazard hazarded hazard + hazards hazard hazel hazel + hazelnut hazelnut he he + head head headborough headborough + headed head headier headier + heading head headland headland + headless headless headlong headlong + heads head headsman headsman + headstrong headstrong heady headi + heal heal healed heal + healing heal heals heal + health health healthful health + healths health healthsome healthsom + healthy healthi heap heap + heaping heap heaps heap + hear hear heard heard + hearer hearer hearers hearer + hearest hearest heareth heareth + hearing hear hearings hear + heark heark hearken hearken + hearkens hearken hears hear + hearsay hearsai hearse hears + hearsed hears hearst hearst + heart heart heartache heartach + heartbreak heartbreak heartbreaking heartbreak + hearted heart hearten hearten + hearth hearth hearths hearth + heartily heartili heartiness hearti + heartless heartless heartlings heartl + heartly heartli hearts heart + heartsick heartsick heartstrings heartstr + hearty hearti heat heat + heated heat heath heath + heathen heathen heathenish heathenish + heating heat heats heat + heauties heauti heav heav + heave heav heaved heav + heaven heaven heavenly heavenli + heavens heaven heaves heav + heavier heavier heaviest heaviest + heavily heavili heaviness heavi + heaving heav heavings heav + heavy heavi hebona hebona + hebrew hebrew hecate hecat + hectic hectic hector hector + hectors hector hecuba hecuba + hedg hedg hedge hedg + hedgehog hedgehog hedgehogs hedgehog + hedges hedg heed heed + heeded heed heedful heed + heedfull heedful heedfully heedfulli + heedless heedless heel heel + heels heel hefted heft + hefts heft heifer heifer + heifers heifer heigh heigh + height height heighten heighten + heinous heinou heinously heinous + heir heir heiress heiress + heirless heirless heirs heir + held held helen helen + helena helena helenus helenu + helias helia helicons helicon + hell hell hellespont hellespont + hellfire hellfir hellish hellish + helm helm helmed helm + helmet helmet helmets helmet + helms helm help help + helper helper helpers helper + helpful help helping help + helpless helpless helps help + helter helter hem hem + heme heme hemlock hemlock + hemm hemm hemp hemp + hempen hempen hems hem + hen hen hence henc + henceforth henceforth henceforward henceforward + henchman henchman henri henri + henricus henricu henry henri + hens hen hent hent + henton henton her her + herald herald heraldry heraldri + heralds herald herb herb + herbert herbert herblets herblet + herbs herb herculean herculean + hercules hercul herd herd + herds herd herdsman herdsman + herdsmen herdsmen here here + hereabout hereabout hereabouts hereabout + hereafter hereaft hereby herebi + hereditary hereditari hereford hereford + herefordshire herefordshir herein herein + hereof hereof heresies heresi + heresy heresi heretic heret + heretics heret hereto hereto + hereupon hereupon heritage heritag + heritier heriti hermes herm + hermia hermia hermione hermion + hermit hermit hermitage hermitag + hermits hermit herne hern + hero hero herod herod + herods herod heroes hero + heroic heroic heroical heroic + herring her herrings her + hers her herself herself + hesperides hesperid hesperus hesperu + hest hest hests hest + heure heur heureux heureux + hew hew hewgh hewgh + hewing hew hewn hewn + hews hew hey hei + heyday heydai hibocrates hibocr + hic hic hiccups hiccup + hick hick hid hid + hidden hidden hide hide + hideous hideou hideously hideous + hideousness hideous hides hide + hidest hidest hiding hide + hie hie hied hi + hiems hiem hies hi + hig hig high high + higher higher highest highest + highly highli highmost highmost + highness high hight hight + highway highwai highways highwai + hilding hild hildings hild + hill hill hillo hillo + hilloa hilloa hills hill + hilt hilt hilts hilt + hily hili him him + himself himself hinc hinc + hinckley hincklei hind hind + hinder hinder hindered hinder + hinders hinder hindmost hindmost + hinds hind hing hing + hinge hing hinges hing + hint hint hip hip + hipp hipp hipparchus hipparchu + hippolyta hippolyta hips hip + hir hir hire hire + hired hire hiren hiren + hirtius hirtiu his hi + hisperia hisperia hiss hiss + hisses hiss hissing hiss + hist hist historical histor + history histori hit hit + hither hither hitherto hitherto + hitherward hitherward hitherwards hitherward + hits hit hitting hit + hive hive hives hive + hizzing hizz ho ho + hoa hoa hoar hoar + hoard hoard hoarded hoard + hoarding hoard hoars hoar + hoarse hoars hoary hoari + hob hob hobbididence hobbidid + hobby hobbi hobbyhorse hobbyhors + hobgoblin hobgoblin hobnails hobnail + hoc hoc hod hod + hodge hodg hog hog + hogs hog hogshead hogshead + hogsheads hogshead hois hoi + hoise hois hoist hoist + hoisted hoist hoists hoist + holborn holborn hold hold + holden holden holder holder + holdeth holdeth holdfast holdfast + holding hold holds hold + hole hole holes hole + holidam holidam holidame holidam + holiday holidai holidays holidai + holier holier holiest holiest + holily holili holiness holi + holla holla holland holland + hollander holland hollanders holland + holloa holloa holloaing holloa + hollow hollow hollowly hollowli + hollowness hollow holly holli + holmedon holmedon holofernes holofern + holp holp holy holi + homage homag homager homag + home home homely home + homes home homespuns homespun + homeward homeward homewards homeward + homicide homicid homicides homicid + homily homili hominem hominem + hommes homm homo homo + honest honest honester honest + honestest honestest honestly honestli + honesty honesti honey honei + honeycomb honeycomb honeying honei + honeyless honeyless honeysuckle honeysuckl + honeysuckles honeysuckl honi honi + honneur honneur honor honor + honorable honor honorably honor honorato honorato honorificabilitudinitatibus honorificabilitudinitatibu - honors honor honour honour - honourable honour honourably honour - honoured honour honourest honourest - honourible honour honouring honour - honours honour hoo hoo - hood hood hooded hood - hoodman hoodman hoods hood - hoodwink hoodwink hoof hoof - hoofs hoof hook hook - hooking hook hooks hook - hoop hoop hoops hoop - hoot hoot hooted hoot - hooting hoot hoots hoot - hop hop hope hope - hopeful hope hopeless hopeless - hopes hope hopest hopest - hoping hope hopkins hopkin - hoppedance hopped hor hor - horace horac horatio horatio - horizon horizon horn horn - hornbook hornbook horned horn - horner horner horning horn - hornpipes hornpip horns horn - horologe horolog horrible horribl - horribly horribl horrid horrid - horrider horrid horridly horridli - horror horror horrors horror - hors hor horse hors - horseback horseback horsed hors - horsehairs horsehair horseman horseman - horsemanship horsemanship horsemen horsemen - horses hors horseway horsewai - horsing hors hortensio hortensio - hortensius hortensiu horum horum - hose hose hospitable hospit - hospital hospit hospitality hospit - host host hostage hostag - hostages hostag hostess hostess - hostile hostil hostility hostil - hostilius hostiliu hosts host - hot hot hotly hotli - hotspur hotspur hotter hotter - hottest hottest hound hound - hounds hound hour hour - hourly hourli hours hour - hous hou house hous - household household householder household - householders household households household - housekeeper housekeep housekeepers housekeep - housekeeping housekeep houseless houseless - houses hous housewife housewif - housewifery housewiferi housewives housew - hovel hovel hover hover - hovered hover hovering hover - hovers hover how how - howbeit howbeit howe how - howeer howeer however howev - howl howl howled howl - howlet howlet howling howl - howls howl howsoe howso - howsoever howsoev howsome howsom - hoxes hox hoy hoi - hoyday hoydai hubert hubert - huddled huddl huddling huddl - hue hue hued hu - hues hue hug hug - huge huge hugely huge - hugeness huge hugg hugg - hugger hugger hugh hugh - hugs hug hujus huju - hulk hulk hulks hulk - hull hull hulling hull - hullo hullo hum hum - human human humane human - humanely human humanity human - humble humbl humbled humbl - humbleness humbl humbler humbler - humbles humbl humblest humblest - humbling humbl humbly humbl - hume hume humh humh - humidity humid humility humil - humming hum humor humor - humorous humor humors humor - humour humour humourists humourist - humours humour humphrey humphrei - humphry humphri hums hum - hundred hundr hundreds hundr - hundredth hundredth hung hung - hungarian hungarian hungary hungari - hunger hunger hungerford hungerford - hungerly hungerli hungry hungri - hunt hunt hunted hunt - hunter hunter hunters hunter - hunteth hunteth hunting hunt - huntington huntington huntress huntress - hunts hunt huntsman huntsman - huntsmen huntsmen hurdle hurdl - hurl hurl hurling hurl - hurls hurl hurly hurli - hurlyburly hurlyburli hurricano hurricano - hurricanoes hurricano hurried hurri - hurries hurri hurry hurri - hurt hurt hurting hurt - hurtled hurtl hurtless hurtless - hurtling hurtl hurts hurt - husband husband husbanded husband - husbandless husbandless husbandry husbandri - husbands husband hush hush - hushes hush husht husht - husks husk huswife huswif - huswifes huswif hutch hutch - hybla hybla hydra hydra - hyen hyen hymen hymen - hymenaeus hymenaeu hymn hymn - hymns hymn hyperboles hyperbol - hyperbolical hyperbol hyperion hyperion - hypocrisy hypocrisi hypocrite hypocrit - hypocrites hypocrit hyrcan hyrcan - hyrcania hyrcania hyrcanian hyrcanian - hyssop hyssop hysterica hysterica - i i iachimo iachimo - iaculis iaculi iago iago - iament iament ibat ibat - icarus icaru ice ic - iceland iceland ici ici - icicle icicl icicles icicl - icy ici idea idea - ideas idea idem idem - iden iden ides id - idiot idiot idiots idiot - idle idl idleness idl - idles idl idly idli - idol idol idolatrous idolatr - idolatry idolatri ield ield - if if ifs if - ignis igni ignoble ignobl - ignobly ignobl ignominious ignomini - ignominy ignomini ignomy ignomi - ignorance ignor ignorant ignor - ii ii iii iii - iiii iiii il il - ilbow ilbow ild ild - ilion ilion ilium ilium - ill ill illegitimate illegitim - illiterate illiter illness ill - illo illo ills ill - illume illum illumin illumin - illuminate illumin illumineth illumineth - illusion illus illusions illus - illustrate illustr illustrated illustr - illustrious illustri illyria illyria - illyrian illyrian ils il - im im image imag - imagery imageri images imag - imagin imagin imaginary imaginari - imagination imagin imaginations imagin - imagine imagin imagining imagin - imaginings imagin imbar imbar - imbecility imbecil imbrue imbru - imitari imitari imitate imit - imitated imit imitation imit - imitations imit immaculate immacul - immanity imman immask immask - immaterial immateri immediacy immediaci - immediate immedi immediately immedi - imminence immin imminent immin - immoderate immoder immoderately immoder - immodest immodest immoment immoment - immortal immort immortaliz immortaliz - immortally immort immur immur - immured immur immures immur - imogen imogen imp imp - impaint impaint impair impair - impairing impair impale impal - impaled impal impanelled impanel - impart impart imparted impart - impartial imparti impartment impart - imparts impart impasted impast - impatience impati impatient impati - impatiently impati impawn impawn - impeach impeach impeached impeach - impeachment impeach impeachments impeach - impedes imped impediment impedi - impediments impedi impenetrable impenetr - imperator imper imperceiverant imperceiver - imperfect imperfect imperfection imperfect - imperfections imperfect imperfectly imperfectli - imperial imperi imperious imperi - imperiously imperi impertinency impertin - impertinent impertin impeticos impetico - impetuosity impetuos impetuous impetu - impieties impieti impiety impieti - impious impiou implacable implac - implements implement implies impli - implor implor implorators implor - implore implor implored implor - imploring implor impon impon - import import importance import - importancy import important import - importantly importantli imported import - importeth importeth importing import - importless importless imports import - importun importun importunacy importunaci - importunate importun importune importun - importunes importun importunity importun - impos impo impose impos - imposed impos imposition imposit - impositions imposit impossibilities imposs - impossibility imposs impossible imposs - imposthume imposthum impostor impostor - impostors impostor impotence impot - impotent impot impounded impound - impregnable impregn imprese impres - impress impress impressed impress - impressest impressest impression impress - impressure impressur imprimendum imprimendum - imprimis imprimi imprint imprint - imprinted imprint imprison imprison - imprisoned imprison imprisoning imprison - imprisonment imprison improbable improb - improper improp improve improv - improvident improvid impudence impud - impudency impud impudent impud - impudently impud impudique impudiqu - impugn impugn impugns impugn - impure impur imputation imput - impute imput in in - inaccessible inaccess inaidable inaid - inaudible inaud inauspicious inauspici - incaged incag incantations incant - incapable incap incardinate incardin - incarnadine incarnadin incarnate incarn - incarnation incarn incens incen - incense incens incensed incens - incensement incens incenses incens - incensing incens incertain incertain - incertainties incertainti incertainty incertainti - incessant incess incessantly incessantli - incest incest incestuous incestu - inch inch incharitable incharit - inches inch incidency incid - incident incid incision incis - incite incit incites incit - incivil incivil incivility incivil - inclin inclin inclinable inclin - inclination inclin incline inclin - inclined inclin inclines inclin - inclining inclin inclips inclip - include includ included includ - includes includ inclusive inclus - incomparable incompar incomprehensible incomprehens - inconsiderate inconsider inconstancy inconst - inconstant inconst incontinency incontin - incontinent incontin incontinently incontin - inconvenience inconveni inconveniences inconveni - inconvenient inconveni incony inconi - incorporate incorpor incorps incorp - incorrect incorrect increas increa - increase increas increases increas - increaseth increaseth increasing increas - incredible incred incredulous incredul - incur incur incurable incur - incurr incurr incurred incur - incursions incurs ind ind - inde ind indebted indebt - indeed inde indent indent - indented indent indenture indentur - indentures indentur index index - indexes index india india - indian indian indict indict - indicted indict indictment indict - indies indi indifferency indiffer - indifferent indiffer indifferently indiffer - indigent indig indigest indigest - indigested indigest indign indign - indignation indign indignations indign - indigne indign indignities indign - indignity indign indirect indirect - indirection indirect indirections indirect - indirectly indirectli indiscreet indiscreet - indiscretion indiscret indispos indispo - indisposition indisposit indissoluble indissolubl - indistinct indistinct indistinguish indistinguish - indistinguishable indistinguish indited indit - individable individ indrench indrench - indu indu indubitate indubit - induc induc induce induc - induced induc inducement induc - induction induct inductions induct - indue indu indued indu - indues indu indulgence indulg - indulgences indulg indulgent indulg - indurance indur industrious industri - industriously industri industry industri - inequality inequ inestimable inestim - inevitable inevit inexecrable inexecr - inexorable inexor inexplicable inexplic - infallible infal infallibly infal - infamonize infamon infamous infam - infamy infami infancy infanc - infant infant infants infant - infect infect infected infect - infecting infect infection infect - infections infect infectious infecti - infectiously infecti infects infect - infer infer inference infer - inferior inferior inferiors inferior - infernal infern inferr inferr - inferreth inferreth inferring infer - infest infest infidel infidel - infidels infidel infinite infinit - infinitely infinit infinitive infinit - infirm infirm infirmities infirm - infirmity infirm infixed infix - infixing infix inflam inflam - inflame inflam inflaming inflam - inflammation inflamm inflict inflict - infliction inflict influence influenc - influences influenc infold infold - inform inform informal inform - information inform informations inform - informed inform informer inform - informs inform infortunate infortun - infring infr infringe infring - infringed infring infus infu - infuse infus infused infus - infusing infus infusion infus - ingener ingen ingenious ingeni - ingeniously ingeni inglorious inglori - ingots ingot ingraffed ingraf - ingraft ingraft ingrate ingrat - ingrated ingrat ingrateful ingrat - ingratitude ingratitud ingratitudes ingratitud - ingredient ingredi ingredients ingredi - ingross ingross inhabit inhabit - inhabitable inhabit inhabitants inhabit - inhabited inhabit inhabits inhabit - inhearse inhears inhearsed inhears - inherent inher inherit inherit - inheritance inherit inherited inherit - inheriting inherit inheritor inheritor - inheritors inheritor inheritrix inheritrix - inherits inherit inhibited inhibit - inhibition inhibit inhoop inhoop - inhuman inhuman iniquities iniqu - iniquity iniqu initiate initi - injointed injoint injunction injunct - injunctions injunct injur injur - injure injur injurer injur - injuries injuri injurious injuri - injury injuri injustice injustic - ink ink inkhorn inkhorn - inkle inkl inkles inkl - inkling inkl inky inki - inlaid inlaid inland inland - inlay inlai inly inli - inmost inmost inn inn - inner inner innkeeper innkeep - innocence innoc innocency innoc - innocent innoc innocents innoc - innovation innov innovator innov - inns inn innumerable innumer - inoculate inocul inordinate inordin - inprimis inprimi inquir inquir - inquire inquir inquiry inquiri - inquisition inquisit inquisitive inquisit - inroads inroad insane insan - insanie insani insatiate insati - insconce insconc inscrib inscrib - inscription inscript inscriptions inscript - inscroll inscrol inscrutable inscrut - insculp insculp insculpture insculptur - insensible insens inseparable insepar - inseparate insepar insert insert - inserted insert inset inset - inshell inshel inshipp inshipp - inside insid insinewed insinew - insinuate insinu insinuateth insinuateth - insinuating insinu insinuation insinu - insisted insist insisting insist - insisture insistur insociable insoci - insolence insol insolent insol - insomuch insomuch inspir inspir - inspiration inspir inspirations inspir - inspire inspir inspired inspir - install instal installed instal - instalment instal instance instanc - instances instanc instant instant - instantly instantli instate instat - instead instead insteeped insteep - instigate instig instigated instig - instigation instig instigations instig - instigator instig instinct instinct - instinctively instinct institute institut - institutions institut instruct instruct - instructed instruct instruction instruct - instructions instruct instructs instruct - instrument instrument instrumental instrument - instruments instrument insubstantial insubstanti - insufficience insuffici insufficiency insuffici - insult insult insulted insult - insulting insult insultment insult - insults insult insupportable insupport - insuppressive insuppress insurrection insurrect - insurrections insurrect int int - integer integ integritas integrita - integrity integr intellect intellect - intellects intellect intellectual intellectu - intelligence intellig intelligencer intelligenc - intelligencing intelligenc intelligent intellig - intelligis intelligi intelligo intelligo - intemperance intemper intemperate intemper - intend intend intended intend - intendeth intendeth intending intend - intendment intend intends intend - intenible inten intent intent - intention intent intentively intent - intents intent inter inter - intercept intercept intercepted intercept - intercepter intercept interception intercept - intercepts intercept intercession intercess - intercessors intercessor interchained interchain - interchang interchang interchange interchang - interchangeably interchang interchangement interchang - interchanging interchang interdiction interdict - interest interest interim interim - interims interim interior interior - interjections interject interjoin interjoin - interlude interlud intermingle intermingl - intermission intermiss intermissive intermiss - intermit intermit intermix intermix - intermixed intermix interpose interpos - interposer interpos interposes interpos - interpret interpret interpretation interpret - interpreted interpret interpreter interpret - interpreters interpret interprets interpret - interr interr interred inter - interrogatories interrogatori interrupt interrupt - interrupted interrupt interrupter interrupt - interruptest interruptest interruption interrupt - interrupts interrupt intertissued intertissu - intervallums intervallum interview interview - intestate intest intestine intestin - intil intil intimate intim - intimation intim intitled intitl - intituled intitul into into - intolerable intoler intoxicates intox - intreasured intreasur intreat intreat - intrench intrench intrenchant intrench - intricate intric intrinse intrins - intrinsicate intrins intrude intrud - intruder intrud intruding intrud - intrusion intrus inundation inund - inure inur inurn inurn - invade invad invades invad - invasion invas invasive invas - invectively invect invectives invect - inveigled inveigl invent invent - invented invent invention invent - inventions invent inventor inventor - inventorially inventori inventoried inventori - inventors inventor inventory inventori - inverness inver invert invert - invest invest invested invest - investing invest investments invest - inveterate inveter invincible invinc - inviolable inviol invised invis - invisible invis invitation invit - invite invit invited invit - invites invit inviting invit - invitis inviti invocate invoc - invocation invoc invoke invok - invoked invok invulnerable invulner - inward inward inwardly inwardli - inwardness inward inwards inward - ionia ionia ionian ionian - ipse ips ipswich ipswich - ira ira irae ira - iras ira ire ir - ireful ir ireland ireland - iris iri irish irish - irishman irishman irishmen irishmen - irks irk irksome irksom - iron iron irons iron - irreconcil irreconcil irrecoverable irrecover - irregular irregular irregulous irregul - irreligious irreligi irremovable irremov - irreparable irrepar irresolute irresolut - irrevocable irrevoc is is - isabel isabel isabella isabella - isbel isbel isbels isbel - iscariot iscariot ise is - ish ish isidore isidor - isis isi island island - islander island islanders island - islands island isle isl - isles isl israel israel - issu issu issue issu - issued issu issueless issueless - issues issu issuing issu - ist ist ista ista - it it italian italian - italy itali itch itch - itches itch itching itch - item item items item - iteration iter ithaca ithaca - its it itself itself - itshall itshal iv iv - ivory ivori ivy ivi - iwis iwi ix ix - j j jacet jacet - jack jack jackanapes jackanap - jacks jack jacksauce jacksauc - jackslave jackslav jacob jacob - jade jade jaded jade - jades jade jail jail - jakes jake jamany jamani - james jame jamy jami - jane jane jangled jangl - jangling jangl january januari - janus janu japhet japhet - jaquenetta jaquenetta jaques jaqu - jar jar jarring jar - jars jar jarteer jarteer - jasons jason jaunce jaunc - jauncing jaunc jaundice jaundic - jaundies jaundi jaw jaw - jawbone jawbon jaws jaw - jay jai jays jai - jc jc je je - jealous jealou jealousies jealousi - jealousy jealousi jeer jeer - jeering jeer jelly jelli - jenny jenni jeopardy jeopardi - jephtha jephtha jephthah jephthah - jerkin jerkin jerkins jerkin - jerks jerk jeronimy jeronimi - jerusalem jerusalem jeshu jeshu - jesses jess jessica jessica - jest jest jested jest - jester jester jesters jester - jesting jest jests jest - jesu jesu jesus jesu - jet jet jets jet - jew jew jewel jewel - jeweller jewel jewels jewel - jewess jewess jewish jewish - jewry jewri jews jew - jezebel jezebel jig jig - jigging jig jill jill - jills jill jingling jingl - joan joan job job - jockey jockei jocund jocund - jog jog jogging jog - john john johns john - join join joinder joinder - joined join joiner joiner - joineth joineth joins join - joint joint jointed joint - jointing joint jointly jointli - jointress jointress joints joint - jointure jointur jollity jolliti - jolly jolli jolt jolt - joltheads jolthead jordan jordan - joseph joseph joshua joshua - jot jot jour jour - jourdain jourdain journal journal - journey journei journeying journei - journeyman journeyman journeymen journeymen - journeys journei jove jove - jovem jovem jovial jovial - jowl jowl jowls jowl - joy joi joyed joi - joyful joy joyfully joyfulli - joyless joyless joyous joyou - joys joi juan juan - jud jud judas juda - judases judas jude jude - judg judg judge judg - judged judg judgement judgement - judges judg judgest judgest - judging judg judgment judgment - judgments judgment judicious judici - jug jug juggle juggl - juggled juggl juggler juggler - jugglers juggler juggling juggl - jugs jug juice juic - juiced juic jul jul - jule jule julia julia - juliet juliet julietta julietta - julio julio julius juliu - july juli jump jump - jumpeth jumpeth jumping jump - jumps jump june june - junes june junior junior - junius juniu junkets junket - juno juno jupiter jupit - jure jure jurement jurement - jurisdiction jurisdict juror juror - jurors juror jury juri - jurymen jurymen just just - justeius justeiu justest justest - justice justic justicer justic - justicers justic justices justic - justification justif justified justifi - justify justifi justle justl - justled justl justles justl - justling justl justly justli - justness just justs just - jutting jut jutty jutti - juvenal juven kam kam - kate kate kated kate - kates kate katharine katharin - katherina katherina katherine katherin - kecksies kecksi keech keech - keel keel keels keel - keen keen keenness keen - keep keep keepdown keepdown - keeper keeper keepers keeper - keepest keepest keeping keep - keeps keep keiser keiser - ken ken kendal kendal - kennel kennel kent kent - kentish kentish kentishman kentishman - kentishmen kentishmen kept kept - kerchief kerchief kerely kere - kern kern kernal kernal - kernel kernel kernels kernel - kerns kern kersey kersei - kettle kettl kettledrum kettledrum - kettledrums kettledrum key kei - keys kei kibe kibe - kibes kibe kick kick - kicked kick kickshaws kickshaw - kickshawses kickshaws kicky kicki - kid kid kidney kidnei - kikely kike kildare kildar - kill kill killed kill - killer killer killeth killeth - killing kill killingworth killingworth - kills kill kiln kiln - kimbolton kimbolton kin kin - kind kind kinder kinder - kindest kindest kindle kindl - kindled kindl kindless kindless - kindlier kindlier kindling kindl - kindly kindli kindness kind - kindnesses kind kindred kindr - kindreds kindr kinds kind - kine kine king king - kingdom kingdom kingdoms kingdom - kingly kingli kings king - kinred kinr kins kin - kinsman kinsman kinsmen kinsmen - kinswoman kinswoman kirtle kirtl - kirtles kirtl kiss kiss - kissed kiss kisses kiss - kissing kiss kitchen kitchen - kitchens kitchen kite kite - kites kite kitten kitten - kj kj kl kl - klll klll knack knack - knacks knack knapp knapp - knav knav knave knave - knaveries knaveri knavery knaveri - knaves knave knavish knavish - knead knead kneaded knead - kneading knead knee knee - kneel kneel kneeling kneel - kneels kneel knees knee - knell knell knew knew - knewest knewest knife knife - knight knight knighted knight - knighthood knighthood knighthoods knighthood - knightly knightli knights knight - knit knit knits knit - knitters knitter knitteth knitteth - knives knive knobs knob - knock knock knocking knock - knocks knock knog knog - knoll knoll knot knot - knots knot knotted knot - knotty knotti know know - knower knower knowest knowest - knowing know knowingly knowingli - knowings know knowledge knowledg - known known knows know - l l la la - laban laban label label - labell label labienus labienu - labio labio labor labor - laboring labor labors labor - labour labour laboured labour - labourer labour labourers labour - labouring labour labours labour - laboursome laboursom labras labra - labyrinth labyrinth lac lac - lace lace laced lace - lacedaemon lacedaemon laces lace - lacies laci lack lack - lackbeard lackbeard lacked lack - lackey lackei lackeying lackei - lackeys lackei lacking lack - lacks lack lad lad - ladder ladder ladders ladder - lade lade laden laden - ladies ladi lading lade - lads lad lady ladi - ladybird ladybird ladyship ladyship - ladyships ladyship laer laer - laertes laert lafeu lafeu - lag lag lagging lag - laid laid lain lain - laissez laissez lake lake - lakes lake lakin lakin - lam lam lamb lamb - lambert lambert lambkin lambkin - lambkins lambkin lambs lamb - lame lame lamely lame - lameness lame lament lament - lamentable lament lamentably lament - lamentation lament lamentations lament - lamented lament lamenting lament - lamentings lament laments lament - lames lame laming lame - lammas lamma lammastide lammastid - lamound lamound lamp lamp - lampass lampass lamps lamp - lanc lanc lancaster lancast - lance lanc lances lanc - lanceth lanceth lanch lanch - land land landed land - landing land landless landless - landlord landlord landmen landmen - lands land lane lane - lanes lane langage langag - langley langlei langton langton - language languag languageless languageless - languages languag langues langu - languish languish languished languish - languishes languish languishing languish - languishings languish languishment languish - languor languor lank lank - lantern lantern lanterns lantern - lanthorn lanthorn lap lap - lapis lapi lapland lapland - lapp lapp laps lap - lapse laps lapsed laps - lapsing laps lapwing lapw - laquais laquai larded lard - larder larder larding lard - lards lard large larg - largely larg largeness larg - larger larger largess largess - largest largest lark lark - larks lark larron larron - lartius lartiu larum larum - larums larum las la - lascivious lascivi lash lash - lass lass lasses lass - last last lasted last - lasting last lastly lastli - lasts last latch latch - latches latch late late - lated late lately late - later later latest latest - lath lath latin latin - latten latten latter latter - lattice lattic laud laud - laudable laudabl laudis laudi - laugh laugh laughable laughabl - laughed laugh laugher laugher - laughest laughest laughing laugh - laughs laugh laughter laughter - launce launc launcelot launcelot - launces launc launch launch - laund laund laundress laundress - laundry laundri laur laur - laura laura laurel laurel - laurels laurel laurence laurenc - laus lau lavache lavach - lave lave lavee lave - lavender lavend lavina lavina - lavinia lavinia lavish lavish - lavishly lavishli lavolt lavolt - lavoltas lavolta law law - lawful law lawfully lawfulli - lawless lawless lawlessly lawlessli - lawn lawn lawns lawn - lawrence lawrenc laws law - lawyer lawyer lawyers lawyer - lay lai layer layer - layest layest laying lai - lays lai lazar lazar - lazars lazar lazarus lazaru - lazy lazi lc lc - ld ld ldst ldst - le le lead lead - leaden leaden leader leader - leaders leader leadest leadest - leading lead leads lead - leaf leaf leagu leagu - league leagu leagued leagu - leaguer leaguer leagues leagu - leah leah leak leak - leaky leaki lean lean - leander leander leaner leaner - leaning lean leanness lean - leans lean leap leap - leaped leap leaping leap - leaps leap leapt leapt - lear lear learn learn - learned learn learnedly learnedli - learning learn learnings learn - learns learn learnt learnt - leas lea lease leas - leases leas leash leash - leasing leas least least - leather leather leathern leathern - leav leav leave leav - leaven leaven leavening leaven - leaver leaver leaves leav - leaving leav leavy leavi - lecher lecher lecherous lecher - lechers lecher lechery lecheri - lecon lecon lecture lectur - lectures lectur led led - leda leda leech leech - leeches leech leek leek - leeks leek leer leer - leers leer lees lee - leese lees leet leet - leets leet left left - leg leg legacies legaci - legacy legaci legate legat - legatine legatin lege lege - legerity leger leges lege - legg legg legion legion - legions legion legitimate legitim - legitimation legitim legs leg - leicester leicest leicestershire leicestershir - leiger leiger leigers leiger - leisure leisur leisurely leisur - leisures leisur leman leman - lemon lemon lena lena - lend lend lender lender - lending lend lendings lend - lends lend length length - lengthen lengthen lengthens lengthen - lengths length lenity leniti - lennox lennox lent lent - lenten lenten lentus lentu - leo leo leon leon - leonardo leonardo leonati leonati - leonato leonato leonatus leonatu - leontes leont leopard leopard - leopards leopard leper leper - leperous leper lepidus lepidu - leprosy leprosi lequel lequel - lers ler les le - less less lessen lessen - lessens lessen lesser lesser - lesson lesson lessoned lesson - lessons lesson lest lest - lestrake lestrak let let - lethargied lethargi lethargies lethargi - lethargy lethargi lethe leth - lets let lett lett - letter letter letters letter - letting let lettuce lettuc - leur leur leve leve - level level levell level - levelled level levels level - leven leven levers lever - leviathan leviathan leviathans leviathan - levied levi levies levi - levity leviti levy levi - levying levi lewd lewd - lewdly lewdli lewdness lewd - lewdsters lewdster lewis lewi - liable liabl liar liar - liars liar libbard libbard - libelling libel libels libel - liberal liber liberality liber - liberte libert liberties liberti - libertine libertin libertines libertin - liberty liberti library librari - libya libya licence licenc - licens licen license licens - licentious licenti lichas licha - licio licio lick lick - licked lick licker licker - lictors lictor lid lid - lids lid lie lie - lied li lief lief - liefest liefest liege lieg - liegeman liegeman liegemen liegemen - lien lien lies li - liest liest lieth lieth - lieu lieu lieutenant lieuten - lieutenantry lieutenantri lieutenants lieuten - lieve liev life life - lifeblood lifeblood lifeless lifeless - lifelings lifel lift lift - lifted lift lifter lifter - lifteth lifteth lifting lift - lifts lift lig lig - ligarius ligariu liggens liggen - light light lighted light - lighten lighten lightens lighten - lighter lighter lightest lightest - lightly lightli lightness light - lightning lightn lightnings lightn - lights light lik lik - like like liked like - likeliest likeliest likelihood likelihood - likelihoods likelihood likely like - likeness like liker liker - likes like likest likest - likewise likewis liking like - likings like lilies lili - lily lili lim lim - limander limand limb limb - limbeck limbeck limbecks limbeck - limber limber limbo limbo - limbs limb lime lime - limed lime limehouse limehous - limekilns limekiln limit limit - limitation limit limited limit - limits limit limn limn - limp limp limping limp - limps limp lin lin - lincoln lincoln lincolnshire lincolnshir - line line lineal lineal - lineally lineal lineament lineament - lineaments lineament lined line - linen linen linens linen - lines line ling ling - lingare lingar linger linger - lingered linger lingers linger - linguist linguist lining line - link link links link - linsey linsei linstock linstock - linta linta lion lion - lionel lionel lioness lioness - lions lion lip lip - lipp lipp lips lip - lipsbury lipsburi liquid liquid - liquor liquor liquorish liquorish - liquors liquor lirra lirra - lisbon lisbon lisp lisp - lisping lisp list list - listen listen listening listen - lists list literatured literatur - lither lither litter litter - little littl littlest littlest - liv liv live live - lived live livelier liveli - livelihood livelihood livelong livelong - lively live liver liver - liveries liveri livers liver - livery liveri lives live - livest livest liveth liveth - livia livia living live - livings live lizard lizard - lizards lizard ll ll - lll lll llous llou - lnd lnd lo lo - loa loa loach loach - load load loaden loaden - loading load loads load - loaf loaf loam loam - loan loan loath loath - loathe loath loathed loath - loather loather loathes loath - loathing loath loathly loathli - loathness loath loathsome loathsom - loathsomeness loathsom loathsomest loathsomest - loaves loav lob lob - lobbies lobbi lobby lobbi - local local lochaber lochab - lock lock locked lock - locking lock lockram lockram - locks lock locusts locust - lode lode lodg lodg - lodge lodg lodged lodg - lodgers lodger lodges lodg - lodging lodg lodgings lodg - lodovico lodovico lodowick lodowick - lofty lofti log log - logger logger loggerhead loggerhead - loggerheads loggerhead loggets logget - logic logic logs log - loins loin loiter loiter - loiterer loiter loiterers loiter - loitering loiter lolling loll - lolls loll lombardy lombardi - london london londoners london - lone lone loneliness loneli - lonely lone long long - longaville longavil longboat longboat - longed long longer longer - longest longest longeth longeth - longing long longings long - longly longli longs long - longtail longtail loo loo - loof loof look look - looked look looker looker - lookers looker lookest lookest - looking look looks look - loon loon loop loop - loos loo loose loos - loosed loos loosely loos - loosen loosen loosing loos - lop lop lopp lopp - loquitur loquitur lord lord - lorded lord lording lord - lordings lord lordliness lordli - lordly lordli lords lord - lordship lordship lordships lordship - lorenzo lorenzo lorn lorn - lorraine lorrain lorship lorship - los lo lose lose - loser loser losers loser - loses lose losest losest - loseth loseth losing lose - loss loss losses loss - lost lost lot lot - lots lot lott lott - lottery lotteri loud loud - louder louder loudly loudli - lour lour loureth loureth - louring lour louse lous - louses lous lousy lousi - lout lout louted lout - louts lout louvre louvr - lov lov love love - loved love lovedst lovedst - lovel lovel lovelier loveli - loveliness loveli lovell lovel - lovely love lover lover - lovered lover lovers lover - loves love lovest lovest - loveth loveth loving love - lovingly lovingli low low - lowe low lower lower - lowest lowest lowing low - lowliness lowli lowly lowli - lown lown lowness low - loyal loyal loyally loyal - loyalties loyalti loyalty loyalti - lozel lozel lt lt - lubber lubber lubberly lubberli - luc luc luccicos luccico - luce luce lucentio lucentio - luces luce lucetta lucetta - luciana luciana lucianus lucianu - lucifer lucif lucifier lucifi - lucilius luciliu lucina lucina - lucio lucio lucius luciu - luck luck luckier luckier - luckiest luckiest luckily luckili - luckless luckless lucky lucki - lucre lucr lucrece lucrec - lucretia lucretia lucullius luculliu - lucullus lucullu lucy luci - lud lud ludlow ludlow - lug lug lugg lugg - luggage luggag luke luke - lukewarm lukewarm lull lull - lulla lulla lullaby lullabi - lulls lull lumbert lumbert - lump lump lumpish lumpish - luna luna lunacies lunaci - lunacy lunaci lunatic lunat - lunatics lunat lunes lune - lungs lung lupercal luperc - lurch lurch lure lure - lurk lurk lurketh lurketh - lurking lurk lurks lurk - luscious lusciou lush lush - lust lust lusted lust - luster luster lustful lust - lustier lustier lustiest lustiest - lustig lustig lustihood lustihood - lustily lustili lustre lustr - lustrous lustrou lusts lust - lusty lusti lute lute - lutes lute lutestring lutestr - lutheran lutheran luxurious luxuri - luxuriously luxuri luxury luxuri - ly ly lycaonia lycaonia - lycurguses lycurgus lydia lydia - lye lye lyen lyen - lying ly lym lym - lymoges lymog lynn lynn - lysander lysand m m - ma ma maan maan - mab mab macbeth macbeth - maccabaeus maccabaeu macdonwald macdonwald - macduff macduff mace mace - macedon macedon maces mace - machiavel machiavel machination machin - machinations machin machine machin - mack mack macmorris macmorri - maculate macul maculation macul - mad mad madam madam - madame madam madams madam - madcap madcap madded mad - madding mad made made - madeira madeira madly madli - madman madman madmen madmen - madness mad madonna madonna - madrigals madrig mads mad - maecenas maecena maggot maggot - maggots maggot magic magic - magical magic magician magician - magistrate magistr magistrates magistr - magnanimity magnanim magnanimous magnanim - magni magni magnifi magnifi - magnificence magnific magnificent magnific - magnifico magnifico magnificoes magnifico - magnus magnu mahomet mahomet - mahu mahu maid maid - maiden maiden maidenhead maidenhead - maidenheads maidenhead maidenhood maidenhood - maidenhoods maidenhood maidenliest maidenliest - maidenly maidenli maidens maiden - maidhood maidhood maids maid - mail mail mailed mail - mails mail maim maim - maimed maim maims maim - main main maincourse maincours - maine main mainly mainli - mainmast mainmast mains main - maintain maintain maintained maintain - maintains maintain maintenance mainten - mais mai maison maison - majestas majesta majestee majeste - majestic majest majestical majest - majestically majest majesties majesti - majesty majesti major major - majority major mak mak - make make makeless makeless - maker maker makers maker - makes make makest makest - maketh maketh making make - makings make mal mal - mala mala maladies maladi - malady maladi malapert malapert - malcolm malcolm malcontent malcont - malcontents malcont male male - maledictions maledict malefactions malefact - malefactor malefactor malefactors malefactor - males male malevolence malevol - malevolent malevol malhecho malhecho - malice malic malicious malici - maliciously malici malign malign - malignancy malign malignant malign - malignantly malignantli malkin malkin - mall mall mallard mallard - mallet mallet mallows mallow - malmsey malmsei malt malt - maltworms maltworm malvolio malvolio - mamillius mamilliu mammering mammer - mammet mammet mammets mammet - mammock mammock man man - manacle manacl manacles manacl - manage manag managed manag - manager manag managing manag - manakin manakin manchus manchu - mandate mandat mandragora mandragora - mandrake mandrak mandrakes mandrak - mane mane manent manent - manes mane manet manet - manfully manfulli mangle mangl - mangled mangl mangles mangl - mangling mangl mangy mangi - manhood manhood manhoods manhood - manifest manifest manifested manifest - manifests manifest manifold manifold - manifoldly manifoldli manka manka - mankind mankind manlike manlik - manly manli mann mann - manna manna manner manner - mannerly mannerli manners manner - manningtree manningtre mannish mannish - manor manor manors manor - mans man mansion mansion - mansionry mansionri mansions mansion - manslaughter manslaught mantle mantl - mantled mantl mantles mantl - mantua mantua mantuan mantuan - manual manual manure manur - manured manur manus manu - many mani map map - mapp mapp maps map - mar mar marble marbl - marbled marbl marcade marcad - marcellus marcellu march march - marches march marcheth marcheth - marching march marchioness marchio - marchpane marchpan marcians marcian - marcius marciu marcus marcu - mardian mardian mare mare - mares mare marg marg - margarelon margarelon margaret margaret - marge marg margent margent - margery margeri maria maria - marian marian mariana mariana - maries mari marigold marigold - mariner marin mariners marin - maritime maritim marjoram marjoram - mark mark marked mark - market market marketable market - marketplace marketplac markets market - marking mark markman markman - marks mark marl marl - marle marl marmoset marmoset - marquess marquess marquis marqui - marr marr marriage marriag - marriages marriag married marri - marries marri marring mar - marrow marrow marrowless marrowless - marrows marrow marry marri - marrying marri mars mar - marseilles marseil marsh marsh - marshal marshal marshalsea marshalsea - marshalship marshalship mart mart - marted mart martem martem - martext martext martial martial - martin martin martino martino - martius martiu martlemas martlema - martlet martlet marts mart - martyr martyr martyrs martyr - marullus marullu marv marv - marvel marvel marvell marvel - marvellous marvel marvellously marvel - marvels marvel mary mari - mas ma masculine masculin - masham masham mask mask - masked mask masker masker - maskers masker masking mask - masks mask mason mason - masonry masonri masons mason - masque masqu masquers masquer - masques masqu masquing masqu - mass mass massacre massacr - massacres massacr masses mass - massy massi mast mast - mastcr mastcr master master - masterdom masterdom masterest masterest - masterless masterless masterly masterli - masterpiece masterpiec masters master - mastership mastership mastic mastic - mastiff mastiff mastiffs mastiff - masts mast match match - matches match matcheth matcheth - matching match matchless matchless - mate mate mated mate - mater mater material materi - mates mate mathematics mathemat - matin matin matron matron - matrons matron matter matter - matters matter matthew matthew - mattock mattock mattress mattress - mature matur maturity matur - maud maud maudlin maudlin - maugre maugr maul maul - maund maund mauri mauri - mauritania mauritania mauvais mauvai - maw maw maws maw - maxim maxim may mai - mayday maydai mayest mayest - mayor mayor maypole maypol - mayst mayst maz maz - maze maze mazed maze - mazes maze mazzard mazzard - me me meacock meacock - mead mead meadow meadow - meadows meadow meads mead - meagre meagr meal meal - meals meal mealy meali - mean mean meanders meander - meaner meaner meanest meanest - meaneth meaneth meaning mean - meanings mean meanly meanli - means mean meant meant - meantime meantim meanwhile meanwhil - measles measl measur measur - measurable measur measure measur - measured measur measureless measureless - measures measur measuring measur - meat meat meats meat - mechanic mechan mechanical mechan - mechanicals mechan mechanics mechan - mechante mechant med med - medal medal meddle meddl - meddler meddler meddling meddl - mede mede medea medea - media media mediation mediat - mediators mediat medice medic - medicinal medicin medicine medicin - medicines medicin meditate medit - meditates medit meditating medit - meditation medit meditations medit - mediterranean mediterranean mediterraneum mediterraneum - medlar medlar medlars medlar - meed meed meeds meed - meek meek meekly meekli - meekness meek meet meet - meeter meeter meetest meetest - meeting meet meetings meet - meetly meetli meetness meet - meets meet meg meg - mehercle mehercl meilleur meilleur - meiny meini meisen meisen - melancholies melancholi melancholy melancholi - melford melford mell mell - mellifluous melliflu mellow mellow - mellowing mellow melodious melodi - melody melodi melt melt - melted melt melteth melteth - melting melt melts melt - melun melun member member - members member memento memento - memorable memor memorandums memorandum - memorial memori memorials memori - memories memori memoriz memoriz - memorize memor memory memori - memphis memphi men men - menac menac menace menac - menaces menac menaphon menaphon - menas mena mend mend - mended mend mender mender - mending mend mends mend - menecrates menecr menelaus menelau - menenius meneniu mental mental - menteith menteith mention mention - mentis menti menton menton - mephostophilus mephostophilu mer mer - mercatante mercatant mercatio mercatio - mercenaries mercenari mercenary mercenari - mercer mercer merchandise merchandis - merchandized merchand merchant merchant - merchants merchant mercies merci - merciful merci mercifully mercifulli - merciless merciless mercurial mercuri - mercuries mercuri mercury mercuri - mercutio mercutio mercy merci - mere mere mered mere - merely mere merest merest - meridian meridian merit merit - merited merit meritorious meritori - merits merit merlin merlin - mermaid mermaid mermaids mermaid - merops merop merrier merrier - merriest merriest merrily merrili - merriman merriman merriment merriment - merriments merriment merriness merri - merry merri mervailous mervail - mes me mesh mesh - meshes mesh mesopotamia mesopotamia - mess mess message messag - messages messag messala messala - messaline messalin messenger messeng - messengers messeng messes mess - messina messina met met - metal metal metals metal - metamorphis metamorphi metamorphoses metamorphos - metaphor metaphor metaphysical metaphys - metaphysics metaphys mete mete - metellus metellu meteor meteor - meteors meteor meteyard meteyard - metheglin metheglin metheglins metheglin - methink methink methinks methink - method method methods method - methought methought methoughts methought - metre metr metres metr - metropolis metropoli mette mett - mettle mettl mettled mettl - meus meu mew mew - mewed mew mewling mewl - mexico mexico mi mi - mice mice michael michael - michaelmas michaelma micher micher - miching mich mickle mickl - microcosm microcosm mid mid - midas mida middest middest - middle middl middleham middleham - midnight midnight midriff midriff - midst midst midsummer midsumm - midway midwai midwife midwif - midwives midwiv mienne mienn - might might mightful might - mightier mightier mightiest mightiest - mightily mightili mightiness mighti - mightst mightst mighty mighti - milan milan milch milch - mild mild milder milder - mildest mildest mildew mildew - mildews mildew mildly mildli - mildness mild mile mile - miles mile milford milford - militarist militarist military militari - milk milk milking milk - milkmaid milkmaid milks milk - milksops milksop milky milki - mill mill mille mill - miller miller milliner millin - million million millioned million - millions million mills mill - millstones millston milo milo - mimic mimic minc minc - mince minc minces minc - mincing minc mind mind - minded mind minding mind - mindless mindless minds mind - mine mine mineral miner - minerals miner minerva minerva - mines mine mingle mingl - mingled mingl mingling mingl - minikin minikin minim minim - minime minim minimo minimo - minimus minimu mining mine - minion minion minions minion - minist minist minister minist - ministers minist ministration ministr - minnow minnow minnows minnow - minola minola minority minor - minos mino minotaurs minotaur - minstrel minstrel minstrels minstrel - minstrelsy minstrelsi mint mint - mints mint minute minut - minutely minut minutes minut - minx minx mio mio - mir mir mirable mirabl - miracle miracl miracles miracl - miraculous miracul miranda miranda - mire mire mirror mirror - mirrors mirror mirth mirth - mirthful mirth miry miri - mis mi misadventur misadventur - misadventure misadventur misanthropos misanthropo - misapplied misappli misbecame misbecam - misbecom misbecom misbecome misbecom - misbegot misbegot misbegotten misbegotten - misbeliever misbeliev misbelieving misbeliev - misbhav misbhav miscall miscal - miscalled miscal miscarried miscarri - miscarries miscarri miscarry miscarri - miscarrying miscarri mischance mischanc - mischances mischanc mischief mischief - mischiefs mischief mischievous mischiev - misconceived misconceiv misconst misconst - misconster misconst misconstruction misconstruct - misconstrued misconstru misconstrues misconstru - miscreant miscreant miscreate miscreat - misdeed misde misdeeds misde - misdemean misdemean misdemeanours misdemeanour - misdoubt misdoubt misdoubteth misdoubteth - misdoubts misdoubt misenum misenum - miser miser miserable miser - miserably miser misericorde misericord - miseries miseri misers miser - misery miseri misfortune misfortun - misfortunes misfortun misgive misgiv - misgives misgiv misgiving misgiv - misgoverned misgovern misgovernment misgovern - misgraffed misgraf misguide misguid - mishap mishap mishaps mishap - misheard misheard misinterpret misinterpret - mislead mislead misleader mislead - misleaders mislead misleading mislead - misled misl mislike mislik - misord misord misplac misplac - misplaced misplac misplaces misplac - mispris mispri misprised mispris - misprision mispris misprizing mispriz - misproud misproud misquote misquot - misreport misreport miss miss - missed miss misses miss - misshap misshap misshapen misshapen - missheathed missheath missing miss - missingly missingli missions mission - missive missiv missives missiv - misspoke misspok mist mist - mista mista mistak mistak - mistake mistak mistaken mistaken - mistakes mistak mistaketh mistaketh - mistaking mistak mistakings mistak - mistemp mistemp mistempered mistemp - misterm misterm mistful mist - misthink misthink misthought misthought - mistletoe mistleto mistook mistook - mistreadings mistread mistress mistress - mistresses mistress mistresss mistresss - mistriship mistriship mistrust mistrust - mistrusted mistrust mistrustful mistrust - mistrusting mistrust mists mist - misty misti misus misu - misuse misus misused misus - misuses misus mites mite - mithridates mithrid mitigate mitig - mitigation mitig mix mix - mixed mix mixture mixtur - mixtures mixtur mm mm - mnd mnd moan moan - moans moan moat moat - moated moat mobled mobl - mock mock mockable mockabl - mocker mocker mockeries mockeri - mockers mocker mockery mockeri - mocking mock mocks mock - mockvater mockvat mockwater mockwat - model model modena modena - moderate moder moderately moder - moderation moder modern modern - modest modest modesties modesti - modestly modestli modesty modesti - modicums modicum modo modo - module modul moe moe - moi moi moiety moieti - moist moist moisten moisten - moisture moistur moldwarp moldwarp - mole mole molehill molehil - moles mole molest molest - molestation molest mollification mollif - mollis molli molten molten - molto molto mome mome - moment moment momentary momentari - moming mome mon mon - monachum monachum monarch monarch - monarchies monarchi monarchize monarch - monarcho monarcho monarchs monarch - monarchy monarchi monast monast - monastery monasteri monastic monast - monday mondai monde mond - money monei moneys monei - mong mong monger monger - mongers monger monging mong - mongrel mongrel mongrels mongrel - mongst mongst monk monk - monkey monkei monkeys monkei - monks monk monmouth monmouth - monopoly monopoli mons mon - monsieur monsieur monsieurs monsieur - monster monster monsters monster - monstrous monstrou monstrously monstrous - monstrousness monstrous monstruosity monstruos - montacute montacut montage montag - montague montagu montagues montagu - montano montano montant montant - montez montez montferrat montferrat - montgomery montgomeri month month - monthly monthli months month - montjoy montjoi monument monument - monumental monument monuments monument - mood mood moods mood - moody moodi moon moon - moonbeams moonbeam moonish moonish - moonlight moonlight moons moon - moonshine moonshin moonshines moonshin - moor moor moorfields moorfield - moors moor moorship moorship - mop mop mope mope - moping mope mopping mop - mopsa mopsa moral moral - moraler moral morality moral - moralize moral mordake mordak - more more moreover moreov - mores more morgan morgan - mori mori morisco morisco - morn morn morning morn - mornings morn morocco morocco - morris morri morrow morrow - morrows morrow morsel morsel - morsels morsel mort mort - mortal mortal mortality mortal - mortally mortal mortals mortal - mortar mortar mortgaged mortgag - mortified mortifi mortifying mortifi - mortimer mortim mortimers mortim - mortis morti mortise mortis - morton morton mose mose - moss moss mossgrown mossgrown - most most mote mote - moth moth mother mother - mothers mother moths moth - motion motion motionless motionless - motions motion motive motiv - motives motiv motley motlei - mots mot mought mought - mould mould moulded mould - mouldeth mouldeth moulds mould - mouldy mouldi moult moult - moulten moulten mounch mounch - mounseur mounseur mounsieur mounsieur - mount mount mountain mountain - mountaineer mountain mountaineers mountain - mountainous mountain mountains mountain - mountant mountant mountanto mountanto - mountebank mountebank mountebanks mountebank - mounted mount mounteth mounteth - mounting mount mounts mount - mourn mourn mourned mourn - mourner mourner mourners mourner - mournful mourn mournfully mournfulli - mourning mourn mourningly mourningli - mournings mourn mourns mourn - mous mou mouse mous - mousetrap mousetrap mousing mous - mouth mouth mouthed mouth - mouths mouth mov mov - movables movabl move move - moveable moveabl moveables moveabl - moved move mover mover - movers mover moves move - moveth moveth moving move - movingly movingli movousus movousu - mow mow mowbray mowbrai - mower mower mowing mow - mows mow moy moi - moys moi moyses moys - mrs mr much much - muck muck mud mud - mudded mud muddied muddi - muddy muddi muffins muffin - muffl muffl muffle muffl - muffled muffl muffler muffler - muffling muffl mugger mugger - mugs mug mulberries mulberri - mulberry mulberri mule mule - mules mule muleteers mulet - mulier mulier mulieres mulier - muliteus muliteu mull mull - mulmutius mulmutiu multiplied multipli - multiply multipli multiplying multipli - multipotent multipot multitude multitud - multitudes multitud multitudinous multitudin - mum mum mumble mumbl - mumbling mumbl mummers mummer - mummy mummi mun mun - munch munch muniments muniment - munition munit murd murd - murder murder murdered murder - murderer murder murderers murder - murdering murder murderous murder - murders murder mure mure - murk murk murkiest murkiest - murky murki murmur murmur - murmurers murmur murmuring murmur - murrain murrain murray murrai - murrion murrion murther murther - murtherer murther murtherers murther - murthering murther murtherous murther - murthers murther mus mu - muscadel muscadel muscovites muscovit - muscovits muscovit muscovy muscovi - muse muse muses muse - mush mush mushrooms mushroom - music music musical music - musician musician musicians musician - musics music musing muse - musings muse musk musk - musket musket muskets musket - muskos musko muss muss - mussel mussel mussels mussel - must must mustachio mustachio - mustard mustard mustardseed mustardse - muster muster mustering muster - musters muster musty musti - mutability mutabl mutable mutabl - mutation mutat mutations mutat - mute mute mutes mute - mutest mutest mutine mutin - mutineer mutin mutineers mutin - mutines mutin mutinies mutini - mutinous mutin mutiny mutini - mutius mutiu mutter mutter - muttered mutter mutton mutton - muttons mutton mutual mutual - mutualities mutual mutually mutual - muzzl muzzl muzzle muzzl - muzzled muzzl mv mv - mww mww my my - mynheers mynheer myrmidon myrmidon - myrmidons myrmidon myrtle myrtl - myself myself myst myst - mysteries mysteri mystery mysteri - n n nag nag - nage nage nags nag - naiads naiad nail nail - nails nail nak nak - naked nake nakedness naked - nal nal nam nam - name name named name - nameless nameless namely name - names name namest namest - naming name nan nan - nance nanc nap nap - nape nape napes nape - napkin napkin napkins napkin - naples napl napless napless - napping nap naps nap - narbon narbon narcissus narcissu - narines narin narrow narrow - narrowly narrowli naso naso - nasty nasti nathaniel nathaniel - natifs natif nation nation - nations nation native nativ - nativity nativ natur natur - natural natur naturalize natur - naturally natur nature natur - natured natur natures natur - natus natu naught naught - naughtily naughtili naughty naughti - navarre navarr nave nave - navel navel navigation navig - navy navi nay nai - nayward nayward nayword nayword - nazarite nazarit ne ne - neaf neaf neamnoins neamnoin - neanmoins neanmoin neapolitan neapolitan - neapolitans neapolitan near near - nearer nearer nearest nearest - nearly nearli nearness near - neat neat neatly neatli - neb neb nebour nebour - nebuchadnezzar nebuchadnezzar nec nec - necessaries necessari necessarily necessarili - necessary necessari necessitied necess - necessities necess necessity necess - neck neck necklace necklac - necks neck nectar nectar - ned ned nedar nedar - need need needed need - needer needer needful need - needfull needful needing need - needle needl needles needl - needless needless needly needli - needs need needy needi - neer neer neeze neez - nefas nefa negation negat - negative neg negatives neg - neglect neglect neglected neglect - neglecting neglect neglectingly neglectingli - neglection neglect negligence neglig - negligent neglig negotiate negoti - negotiations negoti negro negro - neigh neigh neighbors neighbor - neighbour neighbour neighbourhood neighbourhood - neighbouring neighbour neighbourly neighbourli - neighbours neighbour neighing neigh - neighs neigh neither neither - nell nell nemean nemean - nemesis nemesi neoptolemus neoptolemu - nephew nephew nephews nephew - neptune neptun ner ner - nereides nereid nerissa nerissa - nero nero neroes nero - ners ner nerve nerv - nerves nerv nervii nervii - nervy nervi nessus nessu - nest nest nestor nestor - nests nest net net - nether nether netherlands netherland - nets net nettle nettl - nettled nettl nettles nettl - neuter neuter neutral neutral - nev nev never never - nevil nevil nevils nevil - new new newborn newborn - newer newer newest newest - newgate newgat newly newli - newness new news new - newsmongers newsmong newt newt - newts newt next next - nibbling nibbl nicanor nicanor - nice nice nicely nice - niceness nice nicer nicer - nicety niceti nicholas nichola - nick nick nickname nicknam - nicks nick niece niec - nieces niec niggard niggard - niggarding niggard niggardly niggardli - nigh nigh night night - nightcap nightcap nightcaps nightcap - nighted night nightgown nightgown - nightingale nightingal nightingales nightingal - nightly nightli nightmare nightmar - nights night nightwork nightwork - nihil nihil nile nile - nill nill nilus nilu - nimble nimbl nimbleness nimbl - nimbler nimbler nimbly nimbl - nine nine nineteen nineteen - ning ning ningly ningli - ninny ninni ninth ninth - ninus ninu niobe niob - niobes niob nip nip - nipp nipp nipping nip - nipple nippl nips nip - nit nit nly nly - nnight nnight nnights nnight - no no noah noah - nob nob nobility nobil - nobis nobi noble nobl - nobleman nobleman noblemen noblemen - nobleness nobl nobler nobler - nobles nobl noblesse nobless - noblest noblest nobly nobli - nobody nobodi noces noce - nod nod nodded nod - nodding nod noddle noddl - noddles noddl noddy noddi - nods nod noes noe - nointed noint nois noi - noise nois noiseless noiseless - noisemaker noisemak noises nois - noisome noisom nole nole - nominate nomin nominated nomin - nomination nomin nominativo nominativo - non non nonage nonag - nonce nonc none none - nonino nonino nonny nonni - nonpareil nonpareil nonsuits nonsuit - nony noni nook nook - nooks nook noon noon - noonday noondai noontide noontid - nor nor norbery norberi - norfolk norfolk norman norman - normandy normandi normans norman - north north northampton northampton - northamptonshire northamptonshir northerly northerli - northern northern northgate northgat - northumberland northumberland northumberlands northumberland - northward northward norway norwai - norways norwai norwegian norwegian - norweyan norweyan nos no - nose nose nosegays nosegai - noseless noseless noses nose - noster noster nostra nostra - nostril nostril nostrils nostril - not not notable notabl - notably notabl notary notari - notch notch note note - notebook notebook noted note - notedly notedli notes note - notest notest noteworthy noteworthi - nothing noth nothings noth - notice notic notify notifi - noting note notion notion - notorious notori notoriously notori - notre notr notwithstanding notwithstand - nought nought noun noun - nouns noun nourish nourish - nourished nourish nourisher nourish - nourishes nourish nourisheth nourisheth - nourishing nourish nourishment nourish - nous nou novel novel - novelties novelti novelty novelti - noverbs noverb novi novi - novice novic novices novic - novum novum now now - nowhere nowher noyance noyanc - ns ns nt nt - nubibus nubibu numa numa - numb numb number number - numbered number numbering number - numberless numberless numbers number - numbness numb nun nun - nuncio nuncio nuncle nuncl - nunnery nunneri nuns nun - nuntius nuntiu nuptial nuptial - nurs nur nurse nurs - nursed nurs nurser nurser - nursery nurseri nurses nurs - nurseth nurseth nursh nursh - nursing nurs nurtur nurtur - nurture nurtur nut nut - nuthook nuthook nutmeg nutmeg - nutmegs nutmeg nutriment nutriment - nuts nut nutshell nutshel - ny ny nym nym - nymph nymph nymphs nymph - o o oak oak - oaken oaken oaks oak - oared oar oars oar - oatcake oatcak oaten oaten - oath oath oathable oathabl - oaths oath oats oat - ob ob obduracy obduraci - obdurate obdur obedience obedi - obedient obedi obeisance obeis - oberon oberon obey obei - obeyed obei obeying obei - obeys obei obidicut obidicut - object object objected object - objections object objects object - oblation oblat oblations oblat - obligation oblig obligations oblig - obliged oblig oblique obliqu - oblivion oblivion oblivious oblivi - obloquy obloqui obscene obscen - obscenely obscen obscur obscur - obscure obscur obscured obscur - obscurely obscur obscures obscur - obscuring obscur obscurity obscur - obsequies obsequi obsequious obsequi - obsequiously obsequi observ observ - observance observ observances observ - observancy observ observant observ - observants observ observation observ - observe observ observed observ - observer observ observers observ - observing observ observingly observingli - obsque obsqu obstacle obstacl - obstacles obstacl obstinacy obstinaci - obstinate obstin obstinately obstin - obstruct obstruct obstruction obstruct - obstructions obstruct obtain obtain - obtained obtain obtaining obtain - occasion occas occasions occas - occident occid occidental occident - occulted occult occupat occupat - occupation occup occupations occup - occupied occupi occupies occupi - occupy occupi occurrence occurr - occurrences occurr occurrents occurr - ocean ocean oceans ocean - octavia octavia octavius octaviu - ocular ocular od od - odd odd oddest oddest - oddly oddli odds odd - ode od odes od - odious odiou odoriferous odorifer - odorous odor odour odour - odours odour ods od - oeillades oeillad oes oe - oeuvres oeuvr of of - ofephesus ofephesu off off - offal offal offence offenc - offenceful offenc offences offenc - offend offend offended offend - offendendo offendendo offender offend - offenders offend offendeth offendeth - offending offend offendress offendress - offends offend offense offens - offenseless offenseless offenses offens - offensive offens offer offer - offered offer offering offer - offerings offer offers offer - offert offert offic offic - office offic officed offic - officer offic officers offic - offices offic official offici - officious offici offspring offspr - oft oft often often - oftener often oftentimes oftentim - oh oh oil oil - oils oil oily oili - old old oldcastle oldcastl - olden olden older older - oldest oldest oldness old - olive oliv oliver oliv - olivers oliv olives oliv - olivia olivia olympian olympian - olympus olympu oman oman - omans oman omen omen - ominous omin omission omiss - omit omit omittance omitt - omitted omit omitting omit - omne omn omnes omn - omnipotent omnipot on on - once onc one on - ones on oneyers oney - ongles ongl onion onion - onions onion only onli - onset onset onward onward - onwards onward oo oo - ooze ooz oozes ooz - oozy oozi op op - opal opal ope op - open open opener open - opening open openly openli - openness open opens open - operant oper operate oper - operation oper operations oper - operative oper opes op - oph oph ophelia ophelia - opinion opinion opinions opinion - opportune opportun opportunities opportun - opportunity opportun oppos oppo - oppose oppos opposed oppos - opposeless opposeless opposer oppos - opposers oppos opposes oppos - opposing oppos opposite opposit - opposites opposit opposition opposit - oppositions opposit oppress oppress - oppressed oppress oppresses oppress - oppresseth oppresseth oppressing oppress - oppression oppress oppressor oppressor - opprest opprest opprobriously opprobri - oppugnancy oppugn opulency opul - opulent opul or or - oracle oracl oracles oracl - orange orang oration orat - orator orat orators orat - oratory oratori orb orb - orbed orb orbs orb - orchard orchard orchards orchard - ord ord ordain ordain - ordained ordain ordaining ordain - order order ordered order - ordering order orderless orderless - orderly orderli orders order - ordinance ordin ordinant ordin - ordinaries ordinari ordinary ordinari - ordnance ordnanc ords ord - ordure ordur ore or - organ organ organs organ - orgillous orgil orient orient - orifex orifex origin origin - original origin orisons orison - ork ork orlando orlando - orld orld orleans orlean - ornament ornament ornaments ornament - orodes orod orphan orphan - orphans orphan orpheus orpheu - orsino orsino ort ort - orthography orthographi orts ort - oscorbidulchos oscorbidulcho osier osier - osiers osier osprey osprei - osr osr osric osric - ossa ossa ost ost - ostent ostent ostentare ostentar - ostentation ostent ostents ostent - ostler ostler ostlers ostler - ostrich ostrich osw osw - oswald oswald othello othello - other other othergates otherg - others other otherwhere otherwher - otherwhiles otherwhil otherwise otherwis - otter otter ottoman ottoman - ottomites ottomit oublie oubli - ouches ouch ought ought - oui oui ounce ounc - ounces ounc ouphes ouph - our our ours our - ourself ourself ourselves ourselv - ousel ousel out out - outbids outbid outbrave outbrav - outbraves outbrav outbreak outbreak - outcast outcast outcries outcri - outcry outcri outdar outdar - outdare outdar outdares outdar - outdone outdon outfac outfac - outface outfac outfaced outfac - outfacing outfac outfly outfli - outfrown outfrown outgo outgo - outgoes outgo outgrown outgrown - outjest outjest outlaw outlaw - outlawry outlawri outlaws outlaw - outliv outliv outlive outliv - outlives outliv outliving outliv - outlook outlook outlustres outlustr - outpriz outpriz outrage outrag - outrageous outrag outrages outrag - outran outran outright outright - outroar outroar outrun outrun - outrunning outrun outruns outrun - outscold outscold outscorn outscorn - outsell outsel outsells outsel - outside outsid outsides outsid - outspeaks outspeak outsport outsport - outstare outstar outstay outstai - outstood outstood outstretch outstretch - outstretched outstretch outstrike outstrik - outstrip outstrip outstripped outstrip - outswear outswear outvenoms outvenom - outward outward outwardly outwardli - outwards outward outwear outwear - outweighs outweigh outwent outwent - outworn outworn outworths outworth - oven oven over over - overawe overaw overbear overbear - overblown overblown overboard overboard - overbold overbold overborne overborn - overbulk overbulk overbuys overbui - overcame overcam overcast overcast - overcharg overcharg overcharged overcharg - overcome overcom overcomes overcom - overdone overdon overearnest overearnest - overfar overfar overflow overflow - overflown overflown overglance overgl - overgo overgo overgone overgon - overgorg overgorg overgrown overgrown - overhead overhead overhear overhear - overheard overheard overhold overhold - overjoyed overjoi overkind overkind - overland overland overleather overleath - overlive overl overlook overlook - overlooking overlook overlooks overlook - overmaster overmast overmounting overmount - overmuch overmuch overpass overpass - overpeer overp overpeering overp - overplus overplu overrul overrul - overrun overrun overscutch overscutch - overset overset overshades overshad - overshine overshin overshines overshin - overshot overshot oversights oversight - overspread overspread overstain overstain - overswear overswear overt overt - overta overta overtake overtak - overtaketh overtaketh overthrow overthrow - overthrown overthrown overthrows overthrow - overtook overtook overtopp overtopp - overture overtur overturn overturn - overwatch overwatch overween overween - overweening overween overweigh overweigh - overwhelm overwhelm overwhelming overwhelm - overworn overworn ovid ovid - ovidius ovidiu ow ow - owe ow owed ow - owedst owedst owen owen - owes ow owest owest - oweth oweth owing ow - owl owl owls owl - own own owner owner - owners owner owning own - owns own owy owi - ox ox oxen oxen - oxford oxford oxfordshire oxfordshir - oxlips oxlip oyes oy - oyster oyster p p - pabble pabbl pabylon pabylon - pac pac pace pace - paced pace paces pace - pacified pacifi pacify pacifi - pacing pace pack pack - packet packet packets packet - packhorses packhors packing pack - packings pack packs pack - packthread packthread pacorus pacoru - paction paction pad pad - paddle paddl paddling paddl - paddock paddock padua padua - pagan pagan pagans pagan - page page pageant pageant - pageants pageant pages page - pah pah paid paid - pail pail pailfuls pail - pails pail pain pain - pained pain painful pain - painfully painfulli pains pain - paint paint painted paint - painter painter painting paint - paintings paint paints paint - pair pair paired pair - pairs pair pajock pajock - pal pal palabras palabra - palace palac palaces palac - palamedes palamed palate palat - palates palat palatine palatin - palating palat pale pale - paled pale paleness pale - paler paler pales pale - palestine palestin palfrey palfrei - palfreys palfrei palisadoes palisado - pall pall pallabris pallabri - pallas palla pallets pallet - palm palm palmer palmer - palmers palmer palms palm - palmy palmi palpable palpabl - palsied palsi palsies palsi - palsy palsi palt palt - palter palter paltry paltri - paly pali pamp pamp - pamper pamper pamphlets pamphlet - pan pan pancackes pancack - pancake pancak pancakes pancak - pandar pandar pandars pandar - pandarus pandaru pander pander - panderly panderli panders pander - pandulph pandulph panel panel - pang pang panging pang - pangs pang pannier pannier - pannonians pannonian pansa pansa - pansies pansi pant pant - pantaloon pantaloon panted pant - pantheon pantheon panther panther - panthino panthino panting pant - pantingly pantingli pantler pantler - pantry pantri pants pant - pap pap papal papal - paper paper papers paper - paphlagonia paphlagonia paphos papho - papist papist paps pap - par par parable parabl - paracelsus paracelsu paradise paradis - paradox paradox paradoxes paradox - paragon paragon paragons paragon - parallel parallel parallels parallel - paramour paramour paramours paramour - parapets parapet paraquito paraquito - parasite parasit parasites parasit - parca parca parcel parcel - parcell parcel parcels parcel - parch parch parched parch - parching parch parchment parchment - pard pard pardon pardon - pardona pardona pardoned pardon - pardoner pardon pardoning pardon - pardonne pardonn pardonner pardonn - pardonnez pardonnez pardons pardon - pare pare pared pare - parel parel parent parent - parentage parentag parents parent - parfect parfect paring pare - parings pare paris pari - parish parish parishioners parishion - parisians parisian paritors paritor - park park parks park - parle parl parler parler - parles parl parley parlei - parlez parlez parliament parliament - parlors parlor parlour parlour - parlous parlou parmacity parmac - parolles parol parricide parricid - parricides parricid parrot parrot - parrots parrot parsley parslei - parson parson part part - partake partak partaken partaken - partaker partak partakers partak - parted part parthia parthia - parthian parthian parthians parthian - parti parti partial partial - partialize partial partially partial - participate particip participation particip - particle particl particular particular - particularities particular particularize particular - particularly particularli particulars particular - parties parti parting part - partisan partisan partisans partisan - partition partit partizan partizan - partlet partlet partly partli - partner partner partners partner - partridge partridg parts part - party parti pas pa - pash pash pashed pash - pashful pash pass pass - passable passabl passado passado - passage passag passages passag - passant passant passed pass - passenger passeng passengers passeng - passes pass passeth passeth - passing pass passio passio - passion passion passionate passion - passioning passion passions passion - passive passiv passport passport - passy passi past past - paste past pasterns pastern - pasties pasti pastime pastim - pastimes pastim pastoral pastor - pastorals pastor pastors pastor - pastry pastri pasture pastur - pastures pastur pasty pasti - pat pat patay patai - patch patch patchery patcheri - patches patch pate pate - pated pate patent patent - patents patent paternal patern - pates pate path path - pathetical pathet paths path - pathway pathwai pathways pathwai - patience patienc patient patient - patiently patient patients patient - patines patin patrician patrician - patricians patrician patrick patrick - patrimony patrimoni patroclus patroclu - patron patron patronage patronag - patroness patro patrons patron - patrum patrum patter patter - pattern pattern patterns pattern - pattle pattl pauca pauca - paucas pauca paul paul - paulina paulina paunch paunch - paunches paunch pause paus - pauser pauser pauses paus - pausingly pausingli pauvres pauvr - pav pav paved pave - pavement pavement pavilion pavilion - pavilions pavilion pavin pavin - paw paw pawn pawn - pawns pawn paws paw - pax pax pay pai - payest payest paying pai - payment payment payments payment - pays pai paysan paysan - paysans paysan pe pe - peace peac peaceable peaceabl - peaceably peaceabl peaceful peac - peacemakers peacemak peaces peac - peach peach peaches peach - peacock peacock peacocks peacock - peak peak peaking peak - peal peal peals peal - pear pear peard peard - pearl pearl pearls pearl - pears pear peas pea - peasant peasant peasantry peasantri - peasants peasant peascod peascod - pease peas peaseblossom peaseblossom - peat peat peaten peaten - peating peat pebble pebbl - pebbled pebbl pebbles pebbl - peck peck pecks peck - peculiar peculiar pecus pecu - pedant pedant pedantical pedant - pedascule pedascul pede pede - pedestal pedest pedigree pedigre - pedlar pedlar pedlars pedlar - pedro pedro peds ped - peel peel peep peep - peeped peep peeping peep - peeps peep peer peer - peereth peereth peering peer - peerless peerless peers peer - peesel peesel peevish peevish - peevishly peevishli peflur peflur - peg peg pegasus pegasu - pegs peg peise peis - peised peis peize peiz - pelf pelf pelican pelican - pelion pelion pell pell - pella pella pelleted pellet - peloponnesus peloponnesu pelt pelt - pelting pelt pembroke pembrok - pen pen penalties penalti - penalty penalti penance penanc - pence penc pencil pencil - pencill pencil pencils pencil - pendant pendant pendent pendent - pendragon pendragon pendulous pendul - penelope penelop penetrable penetr - penetrate penetr penetrative penetr - penitence penit penitent penit - penitential penitenti penitently penit - penitents penit penker penker - penknife penknif penn penn - penned pen penning pen - pennons pennon penny penni - pennyworth pennyworth pennyworths pennyworth - pens pen pense pens - pension pension pensioners pension - pensive pensiv pensived pensiv - pensively pensiv pent pent - pentecost pentecost penthesilea penthesilea - penthouse penthous penurious penuri - penury penuri peopl peopl - people peopl peopled peopl - peoples peopl pepin pepin - pepper pepper peppercorn peppercorn - peppered pepper per per - peradventure peradventur peradventures peradventur - perceiv perceiv perceive perceiv - perceived perceiv perceives perceiv - perceiveth perceiveth perch perch - perchance perchanc percies perci - percussion percuss percy perci - perdie perdi perdita perdita - perdition perdit perdonato perdonato - perdu perdu perdurable perdur - perdurably perdur perdy perdi - pere pere peregrinate peregrin - peremptorily peremptorili peremptory peremptori - perfect perfect perfected perfect - perfecter perfect perfectest perfectest - perfection perfect perfections perfect - perfectly perfectli perfectness perfect - perfidious perfidi perfidiously perfidi - perforce perforc perform perform - performance perform performances perform - performed perform performer perform - performers perform performing perform - performs perform perfum perfum - perfume perfum perfumed perfum - perfumer perfum perfumes perfum - perge perg perhaps perhap - periapts periapt perigort perigort - perigouna perigouna peril peril - perilous peril perils peril - period period periods period - perish perish perished perish - perishest perishest perisheth perisheth - perishing perish periwig periwig - perjur perjur perjure perjur - perjured perjur perjuries perjuri - perjury perjuri perk perk - perkes perk permafoy permafoi - permanent perman permission permiss - permissive permiss permit permit - permitted permit pernicious pernici - perniciously pernici peroration peror - perpend perpend perpendicular perpendicular - perpendicularly perpendicularli perpetual perpetu - perpetually perpetu perpetuity perpetu - perplex perplex perplexed perplex - perplexity perplex pers per - persecuted persecut persecutions persecut - persecutor persecutor perseus perseu - persever persev perseverance persever - persevers persev persia persia - persian persian persist persist - persisted persist persistency persist - persistive persist persists persist - person person personae persona - personage personag personages personag - personal person personally person - personate person personated person - personates person personating person - persons person perspective perspect - perspectively perspect perspectives perspect - perspicuous perspicu persuade persuad - persuaded persuad persuades persuad - persuading persuad persuasion persuas - persuasions persuas pert pert - pertain pertain pertaining pertain - pertains pertain pertaunt pertaunt - pertinent pertin pertly pertli - perturb perturb perturbation perturb - perturbations perturb perturbed perturb - perus peru perusal perus - peruse perus perused perus - perusing perus perverse pervers - perversely pervers perverseness pervers - pervert pervert perverted pervert - peseech peseech pest pest - pester pester pestiferous pestifer - pestilence pestil pestilent pestil - pet pet petar petar - peter peter petit petit - petition petit petitionary petitionari - petitioner petition petitioners petition - petitions petit peto peto - petrarch petrarch petruchio petruchio - petter petter petticoat petticoat - petticoats petticoat pettiness petti - pettish pettish pettitoes pettito - petty petti peu peu - pew pew pewter pewter - pewterer pewter phaethon phaethon - phaeton phaeton phantasime phantasim - phantasimes phantasim phantasma phantasma - pharamond pharamond pharaoh pharaoh - pharsalia pharsalia pheasant pheasant - pheazar pheazar phebe phebe - phebes phebe pheebus pheebu - pheeze pheez phibbus phibbu - philadelphos philadelpho philario philario - philarmonus philarmonu philemon philemon - philip philip philippan philippan - philippe philipp philippi philippi - phillida phillida philo philo - philomel philomel philomela philomela - philosopher philosoph philosophers philosoph - philosophical philosoph philosophy philosophi - philostrate philostr philotus philotu - phlegmatic phlegmat phoebe phoeb - phoebus phoebu phoenicia phoenicia - phoenicians phoenician phoenix phoenix - phorbus phorbu photinus photinu - phrase phrase phraseless phraseless - phrases phrase phrygia phrygia - phrygian phrygian phrynia phrynia - physic physic physical physic - physician physician physicians physician - physics physic pia pia - pibble pibbl pible pibl - picardy picardi pick pick - pickaxe pickax pickaxes pickax - pickbone pickbon picked pick - pickers picker picking pick - pickle pickl picklock picklock - pickpurse pickpurs picks pick - pickt pickt pickthanks pickthank - pictur pictur picture pictur - pictured pictur pictures pictur - pid pid pie pie - piec piec piece piec - pieces piec piecing piec - pied pi piedness pied - pier pier pierc pierc - pierce pierc pierced pierc - pierces pierc pierceth pierceth - piercing pierc piercy pierci - piers pier pies pi - piety pieti pig pig - pigeon pigeon pigeons pigeon - pight pight pigmy pigmi - pigrogromitus pigrogromitu pike pike - pikes pike pil pil - pilate pilat pilates pilat - pilchers pilcher pile pile - piles pile pilf pilf - pilfering pilfer pilgrim pilgrim - pilgrimage pilgrimag pilgrims pilgrim - pill pill pillage pillag - pillagers pillag pillar pillar - pillars pillar pillicock pillicock - pillory pillori pillow pillow - pillows pillow pills pill - pilot pilot pilots pilot - pimpernell pimpernel pin pin - pinch pinch pinched pinch - pinches pinch pinching pinch - pindarus pindaru pine pine - pined pine pines pine - pinfold pinfold pining pine - pinion pinion pink pink - pinn pinn pinnace pinnac - pins pin pinse pins - pint pint pintpot pintpot - pioned pion pioneers pioneer - pioner pioner pioners pioner - pious piou pip pip - pipe pipe piper piper - pipers piper pipes pipe - piping pipe pippin pippin - pippins pippin pirate pirat - pirates pirat pisa pisa - pisanio pisanio pish pish - pismires pismir piss piss - pissing piss pistol pistol - pistols pistol pit pit - pitch pitch pitched pitch - pitcher pitcher pitchers pitcher - pitchy pitchi piteous piteou - piteously piteous pitfall pitfal - pith pith pithless pithless - pithy pithi pitie piti - pitied piti pities piti - pitiful piti pitifully pitifulli - pitiless pitiless pits pit - pittance pittanc pittie pitti - pittikins pittikin pity piti - pitying piti pius piu - plac plac place place - placed place placentio placentio - places place placeth placeth - placid placid placing place - plack plack placket placket - plackets placket plagu plagu - plague plagu plagued plagu - plagues plagu plaguing plagu - plaguy plagui plain plain - plainer plainer plainest plainest - plaining plain plainings plain - plainly plainli plainness plain - plains plain plainsong plainsong - plaintful plaint plaintiff plaintiff - plaintiffs plaintiff plaints plaint - planched planch planet planet - planetary planetari planets planet - planks plank plant plant - plantage plantag plantagenet plantagenet - plantagenets plantagenet plantain plantain - plantation plantat planted plant - planteth planteth plants plant - plash plash plashy plashi - plast plast plaster plaster - plasterer plaster plat plat - plate plate plated plate - plates plate platform platform - platforms platform plats plat - platted plat plausible plausibl - plausive plausiv plautus plautu - play plai played plai - player player players player - playeth playeth playfellow playfellow - playfellows playfellow playhouse playhous - playing plai plays plai - plea plea pleach pleach - pleached pleach plead plead - pleaded plead pleader pleader - pleaders pleader pleading plead - pleads plead pleas plea - pleasance pleasanc pleasant pleasant - pleasantly pleasantli please pleas - pleased pleas pleaser pleaser - pleasers pleaser pleases pleas - pleasest pleasest pleaseth pleaseth - pleasing pleas pleasure pleasur - pleasures pleasur plebeians plebeian - plebeii plebeii plebs pleb - pledge pledg pledges pledg - pleines plein plenitude plenitud - plenteous plenteou plenteously plenteous - plenties plenti plentiful plenti - plentifully plentifulli plenty plenti - pless pless plessed pless - plessing pless pliant pliant - plied pli plies pli - plight plight plighted plight - plighter plighter plod plod - plodded plod plodders plodder - plodding plod plods plod - plood plood ploody ploodi - plot plot plots plot - plotted plot plotter plotter - plough plough ploughed plough - ploughman ploughman ploughmen ploughmen - plow plow plows plow - pluck pluck plucked pluck - plucker plucker plucking pluck - plucks pluck plue plue - plum plum plume plume - plumed plume plumes plume - plummet plummet plump plump - plumpy plumpi plums plum - plung plung plunge plung - plunged plung plural plural - plurisy plurisi plus plu - pluto pluto plutus plutu - ply ply po po - pocket pocket pocketing pocket - pockets pocket pocky pocki - pody podi poem poem - poesy poesi poet poet - poetical poetic poetry poetri - poets poet poictiers poictier - poinards poinard poins poin - point point pointblank pointblank - pointed point pointing point - points point pois poi - poise pois poising pois - poison poison poisoned poison - poisoner poison poisoning poison - poisonous poison poisons poison - poke poke poking poke - pol pol polack polack - polacks polack poland poland - pold pold pole pole - poleaxe poleax polecat polecat - polecats polecat polemon polemon - poles pole poli poli - policies polici policy polici - polish polish polished polish - politic polit politician politician - politicians politician politicly politicli - polixenes polixen poll poll - polluted pollut pollution pollut - polonius poloniu poltroons poltroon - polusion polus polydamus polydamu - polydore polydor polyxena polyxena - pomander pomand pomegranate pomegran - pomewater pomewat pomfret pomfret - pomgarnet pomgarnet pommel pommel - pomp pomp pompeius pompeiu - pompey pompei pompion pompion - pompous pompou pomps pomp - pond pond ponder ponder - ponderous ponder ponds pond - poniard poniard poniards poniard - pont pont pontic pontic - pontifical pontif ponton ponton - pooh pooh pool pool - poole pool poop poop - poor poor poorer poorer - poorest poorest poorly poorli - pop pop pope pope - popedom popedom popilius popiliu - popingay popingai popish popish - popp popp poppy poppi - pops pop popular popular - popularity popular populous popul - porch porch porches porch - pore pore poring pore - pork pork porn porn - porpentine porpentin porridge porridg - porringer porring port port - portable portabl portage portag - portal portal portance portanc - portcullis portculli portend portend - portends portend portent portent - portentous portent portents portent - porter porter porters porter - portia portia portion portion + honors honor honour honour + honourable honour honourably honour + honoured honour honourest honourest + honourible honour honouring honour + honours honour hoo hoo + hood hood hooded hood + hoodman hoodman hoods hood + hoodwink hoodwink hoof hoof + hoofs hoof hook hook + hooking hook hooks hook + hoop hoop hoops hoop + hoot hoot hooted hoot + hooting hoot hoots hoot + hop hop hope hope + hopeful hope hopeless hopeless + hopes hope hopest hopest + hoping hope hopkins hopkin + hoppedance hopped hor hor + horace horac horatio horatio + horizon horizon horn horn + hornbook hornbook horned horn + horner horner horning horn + hornpipes hornpip horns horn + horologe horolog horrible horribl + horribly horribl horrid horrid + horrider horrid horridly horridli + horror horror horrors horror + hors hor horse hors + horseback horseback horsed hors + horsehairs horsehair horseman horseman + horsemanship horsemanship horsemen horsemen + horses hors horseway horsewai + horsing hors hortensio hortensio + hortensius hortensiu horum horum + hose hose hospitable hospit + hospital hospit hospitality hospit + host host hostage hostag + hostages hostag hostess hostess + hostile hostil hostility hostil + hostilius hostiliu hosts host + hot hot hotly hotli + hotspur hotspur hotter hotter + hottest hottest hound hound + hounds hound hour hour + hourly hourli hours hour + hous hou house hous + household household householder household + householders household households household + housekeeper housekeep housekeepers housekeep + housekeeping housekeep houseless houseless + houses hous housewife housewif + housewifery housewiferi housewives housew + hovel hovel hover hover + hovered hover hovering hover + hovers hover how how + howbeit howbeit howe how + howeer howeer however howev + howl howl howled howl + howlet howlet howling howl + howls howl howsoe howso + howsoever howsoev howsome howsom + hoxes hox hoy hoi + hoyday hoydai hubert hubert + huddled huddl huddling huddl + hue hue hued hu + hues hue hug hug + huge huge hugely huge + hugeness huge hugg hugg + hugger hugger hugh hugh + hugs hug hujus huju + hulk hulk hulks hulk + hull hull hulling hull + hullo hullo hum hum + human human humane human + humanely human humanity human + humble humbl humbled humbl + humbleness humbl humbler humbler + humbles humbl humblest humblest + humbling humbl humbly humbl + hume hume humh humh + humidity humid humility humil + humming hum humor humor + humorous humor humors humor + humour humour humourists humourist + humours humour humphrey humphrei + humphry humphri hums hum + hundred hundr hundreds hundr + hundredth hundredth hung hung + hungarian hungarian hungary hungari + hunger hunger hungerford hungerford + hungerly hungerli hungry hungri + hunt hunt hunted hunt + hunter hunter hunters hunter + hunteth hunteth hunting hunt + huntington huntington huntress huntress + hunts hunt huntsman huntsman + huntsmen huntsmen hurdle hurdl + hurl hurl hurling hurl + hurls hurl hurly hurli + hurlyburly hurlyburli hurricano hurricano + hurricanoes hurricano hurried hurri + hurries hurri hurry hurri + hurt hurt hurting hurt + hurtled hurtl hurtless hurtless + hurtling hurtl hurts hurt + husband husband husbanded husband + husbandless husbandless husbandry husbandri + husbands husband hush hush + hushes hush husht husht + husks husk huswife huswif + huswifes huswif hutch hutch + hybla hybla hydra hydra + hyen hyen hymen hymen + hymenaeus hymenaeu hymn hymn + hymns hymn hyperboles hyperbol + hyperbolical hyperbol hyperion hyperion + hypocrisy hypocrisi hypocrite hypocrit + hypocrites hypocrit hyrcan hyrcan + hyrcania hyrcania hyrcanian hyrcanian + hyssop hyssop hysterica hysterica + i i iachimo iachimo + iaculis iaculi iago iago + iament iament ibat ibat + icarus icaru ice ic + iceland iceland ici ici + icicle icicl icicles icicl + icy ici idea idea + ideas idea idem idem + iden iden ides id + idiot idiot idiots idiot + idle idl idleness idl + idles idl idly idli + idol idol idolatrous idolatr + idolatry idolatri ield ield + if if ifs if + ignis igni ignoble ignobl + ignobly ignobl ignominious ignomini + ignominy ignomini ignomy ignomi + ignorance ignor ignorant ignor + ii ii iii iii + iiii iiii il il + ilbow ilbow ild ild + ilion ilion ilium ilium + ill ill illegitimate illegitim + illiterate illiter illness ill + illo illo ills ill + illume illum illumin illumin + illuminate illumin illumineth illumineth + illusion illus illusions illus + illustrate illustr illustrated illustr + illustrious illustri illyria illyria + illyrian illyrian ils il + im im image imag + imagery imageri images imag + imagin imagin imaginary imaginari + imagination imagin imaginations imagin + imagine imagin imagining imagin + imaginings imagin imbar imbar + imbecility imbecil imbrue imbru + imitari imitari imitate imit + imitated imit imitation imit + imitations imit immaculate immacul + immanity imman immask immask + immaterial immateri immediacy immediaci + immediate immedi immediately immedi + imminence immin imminent immin + immoderate immoder immoderately immoder + immodest immodest immoment immoment + immortal immort immortaliz immortaliz + immortally immort immur immur + immured immur immures immur + imogen imogen imp imp + impaint impaint impair impair + impairing impair impale impal + impaled impal impanelled impanel + impart impart imparted impart + impartial imparti impartment impart + imparts impart impasted impast + impatience impati impatient impati + impatiently impati impawn impawn + impeach impeach impeached impeach + impeachment impeach impeachments impeach + impedes imped impediment impedi + impediments impedi impenetrable impenetr + imperator imper imperceiverant imperceiver + imperfect imperfect imperfection imperfect + imperfections imperfect imperfectly imperfectli + imperial imperi imperious imperi + imperiously imperi impertinency impertin + impertinent impertin impeticos impetico + impetuosity impetuos impetuous impetu + impieties impieti impiety impieti + impious impiou implacable implac + implements implement implies impli + implor implor implorators implor + implore implor implored implor + imploring implor impon impon + import import importance import + importancy import important import + importantly importantli imported import + importeth importeth importing import + importless importless imports import + importun importun importunacy importunaci + importunate importun importune importun + importunes importun importunity importun + impos impo impose impos + imposed impos imposition imposit + impositions imposit impossibilities imposs + impossibility imposs impossible imposs + imposthume imposthum impostor impostor + impostors impostor impotence impot + impotent impot impounded impound + impregnable impregn imprese impres + impress impress impressed impress + impressest impressest impression impress + impressure impressur imprimendum imprimendum + imprimis imprimi imprint imprint + imprinted imprint imprison imprison + imprisoned imprison imprisoning imprison + imprisonment imprison improbable improb + improper improp improve improv + improvident improvid impudence impud + impudency impud impudent impud + impudently impud impudique impudiqu + impugn impugn impugns impugn + impure impur imputation imput + impute imput in in + inaccessible inaccess inaidable inaid + inaudible inaud inauspicious inauspici + incaged incag incantations incant + incapable incap incardinate incardin + incarnadine incarnadin incarnate incarn + incarnation incarn incens incen + incense incens incensed incens + incensement incens incenses incens + incensing incens incertain incertain + incertainties incertainti incertainty incertainti + incessant incess incessantly incessantli + incest incest incestuous incestu + inch inch incharitable incharit + inches inch incidency incid + incident incid incision incis + incite incit incites incit + incivil incivil incivility incivil + inclin inclin inclinable inclin + inclination inclin incline inclin + inclined inclin inclines inclin + inclining inclin inclips inclip + include includ included includ + includes includ inclusive inclus + incomparable incompar incomprehensible incomprehens + inconsiderate inconsider inconstancy inconst + inconstant inconst incontinency incontin + incontinent incontin incontinently incontin + inconvenience inconveni inconveniences inconveni + inconvenient inconveni incony inconi + incorporate incorpor incorps incorp + incorrect incorrect increas increa + increase increas increases increas + increaseth increaseth increasing increas + incredible incred incredulous incredul + incur incur incurable incur + incurr incurr incurred incur + incursions incurs ind ind + inde ind indebted indebt + indeed inde indent indent + indented indent indenture indentur + indentures indentur index index + indexes index india india + indian indian indict indict + indicted indict indictment indict + indies indi indifferency indiffer + indifferent indiffer indifferently indiffer + indigent indig indigest indigest + indigested indigest indign indign + indignation indign indignations indign + indigne indign indignities indign + indignity indign indirect indirect + indirection indirect indirections indirect + indirectly indirectli indiscreet indiscreet + indiscretion indiscret indispos indispo + indisposition indisposit indissoluble indissolubl + indistinct indistinct indistinguish indistinguish + indistinguishable indistinguish indited indit + individable individ indrench indrench + indu indu indubitate indubit + induc induc induce induc + induced induc inducement induc + induction induct inductions induct + indue indu indued indu + indues indu indulgence indulg + indulgences indulg indulgent indulg + indurance indur industrious industri + industriously industri industry industri + inequality inequ inestimable inestim + inevitable inevit inexecrable inexecr + inexorable inexor inexplicable inexplic + infallible infal infallibly infal + infamonize infamon infamous infam + infamy infami infancy infanc + infant infant infants infant + infect infect infected infect + infecting infect infection infect + infections infect infectious infecti + infectiously infecti infects infect + infer infer inference infer + inferior inferior inferiors inferior + infernal infern inferr inferr + inferreth inferreth inferring infer + infest infest infidel infidel + infidels infidel infinite infinit + infinitely infinit infinitive infinit + infirm infirm infirmities infirm + infirmity infirm infixed infix + infixing infix inflam inflam + inflame inflam inflaming inflam + inflammation inflamm inflict inflict + infliction inflict influence influenc + influences influenc infold infold + inform inform informal inform + information inform informations inform + informed inform informer inform + informs inform infortunate infortun + infring infr infringe infring + infringed infring infus infu + infuse infus infused infus + infusing infus infusion infus + ingener ingen ingenious ingeni + ingeniously ingeni inglorious inglori + ingots ingot ingraffed ingraf + ingraft ingraft ingrate ingrat + ingrated ingrat ingrateful ingrat + ingratitude ingratitud ingratitudes ingratitud + ingredient ingredi ingredients ingredi + ingross ingross inhabit inhabit + inhabitable inhabit inhabitants inhabit + inhabited inhabit inhabits inhabit + inhearse inhears inhearsed inhears + inherent inher inherit inherit + inheritance inherit inherited inherit + inheriting inherit inheritor inheritor + inheritors inheritor inheritrix inheritrix + inherits inherit inhibited inhibit + inhibition inhibit inhoop inhoop + inhuman inhuman iniquities iniqu + iniquity iniqu initiate initi + injointed injoint injunction injunct + injunctions injunct injur injur + injure injur injurer injur + injuries injuri injurious injuri + injury injuri injustice injustic + ink ink inkhorn inkhorn + inkle inkl inkles inkl + inkling inkl inky inki + inlaid inlaid inland inland + inlay inlai inly inli + inmost inmost inn inn + inner inner innkeeper innkeep + innocence innoc innocency innoc + innocent innoc innocents innoc + innovation innov innovator innov + inns inn innumerable innumer + inoculate inocul inordinate inordin + inprimis inprimi inquir inquir + inquire inquir inquiry inquiri + inquisition inquisit inquisitive inquisit + inroads inroad insane insan + insanie insani insatiate insati + insconce insconc inscrib inscrib + inscription inscript inscriptions inscript + inscroll inscrol inscrutable inscrut + insculp insculp insculpture insculptur + insensible insens inseparable insepar + inseparate insepar insert insert + inserted insert inset inset + inshell inshel inshipp inshipp + inside insid insinewed insinew + insinuate insinu insinuateth insinuateth + insinuating insinu insinuation insinu + insisted insist insisting insist + insisture insistur insociable insoci + insolence insol insolent insol + insomuch insomuch inspir inspir + inspiration inspir inspirations inspir + inspire inspir inspired inspir + install instal installed instal + instalment instal instance instanc + instances instanc instant instant + instantly instantli instate instat + instead instead insteeped insteep + instigate instig instigated instig + instigation instig instigations instig + instigator instig instinct instinct + instinctively instinct institute institut + institutions institut instruct instruct + instructed instruct instruction instruct + instructions instruct instructs instruct + instrument instrument instrumental instrument + instruments instrument insubstantial insubstanti + insufficience insuffici insufficiency insuffici + insult insult insulted insult + insulting insult insultment insult + insults insult insupportable insupport + insuppressive insuppress insurrection insurrect + insurrections insurrect int int + integer integ integritas integrita + integrity integr intellect intellect + intellects intellect intellectual intellectu + intelligence intellig intelligencer intelligenc + intelligencing intelligenc intelligent intellig + intelligis intelligi intelligo intelligo + intemperance intemper intemperate intemper + intend intend intended intend + intendeth intendeth intending intend + intendment intend intends intend + intenible inten intent intent + intention intent intentively intent + intents intent inter inter + intercept intercept intercepted intercept + intercepter intercept interception intercept + intercepts intercept intercession intercess + intercessors intercessor interchained interchain + interchang interchang interchange interchang + interchangeably interchang interchangement interchang + interchanging interchang interdiction interdict + interest interest interim interim + interims interim interior interior + interjections interject interjoin interjoin + interlude interlud intermingle intermingl + intermission intermiss intermissive intermiss + intermit intermit intermix intermix + intermixed intermix interpose interpos + interposer interpos interposes interpos + interpret interpret interpretation interpret + interpreted interpret interpreter interpret + interpreters interpret interprets interpret + interr interr interred inter + interrogatories interrogatori interrupt interrupt + interrupted interrupt interrupter interrupt + interruptest interruptest interruption interrupt + interrupts interrupt intertissued intertissu + intervallums intervallum interview interview + intestate intest intestine intestin + intil intil intimate intim + intimation intim intitled intitl + intituled intitul into into + intolerable intoler intoxicates intox + intreasured intreasur intreat intreat + intrench intrench intrenchant intrench + intricate intric intrinse intrins + intrinsicate intrins intrude intrud + intruder intrud intruding intrud + intrusion intrus inundation inund + inure inur inurn inurn + invade invad invades invad + invasion invas invasive invas + invectively invect invectives invect + inveigled inveigl invent invent + invented invent invention invent + inventions invent inventor inventor + inventorially inventori inventoried inventori + inventors inventor inventory inventori + inverness inver invert invert + invest invest invested invest + investing invest investments invest + inveterate inveter invincible invinc + inviolable inviol invised invis + invisible invis invitation invit + invite invit invited invit + invites invit inviting invit + invitis inviti invocate invoc + invocation invoc invoke invok + invoked invok invulnerable invulner + inward inward inwardly inwardli + inwardness inward inwards inward + ionia ionia ionian ionian + ipse ips ipswich ipswich + ira ira irae ira + iras ira ire ir + ireful ir ireland ireland + iris iri irish irish + irishman irishman irishmen irishmen + irks irk irksome irksom + iron iron irons iron + irreconcil irreconcil irrecoverable irrecover + irregular irregular irregulous irregul + irreligious irreligi irremovable irremov + irreparable irrepar irresolute irresolut + irrevocable irrevoc is is + isabel isabel isabella isabella + isbel isbel isbels isbel + iscariot iscariot ise is + ish ish isidore isidor + isis isi island island + islander island islanders island + islands island isle isl + isles isl israel israel + issu issu issue issu + issued issu issueless issueless + issues issu issuing issu + ist ist ista ista + it it italian italian + italy itali itch itch + itches itch itching itch + item item items item + iteration iter ithaca ithaca + its it itself itself + itshall itshal iv iv + ivory ivori ivy ivi + iwis iwi ix ix + j j jacet jacet + jack jack jackanapes jackanap + jacks jack jacksauce jacksauc + jackslave jackslav jacob jacob + jade jade jaded jade + jades jade jail jail + jakes jake jamany jamani + james jame jamy jami + jane jane jangled jangl + jangling jangl january januari + janus janu japhet japhet + jaquenetta jaquenetta jaques jaqu + jar jar jarring jar + jars jar jarteer jarteer + jasons jason jaunce jaunc + jauncing jaunc jaundice jaundic + jaundies jaundi jaw jaw + jawbone jawbon jaws jaw + jay jai jays jai + jc jc je je + jealous jealou jealousies jealousi + jealousy jealousi jeer jeer + jeering jeer jelly jelli + jenny jenni jeopardy jeopardi + jephtha jephtha jephthah jephthah + jerkin jerkin jerkins jerkin + jerks jerk jeronimy jeronimi + jerusalem jerusalem jeshu jeshu + jesses jess jessica jessica + jest jest jested jest + jester jester jesters jester + jesting jest jests jest + jesu jesu jesus jesu + jet jet jets jet + jew jew jewel jewel + jeweller jewel jewels jewel + jewess jewess jewish jewish + jewry jewri jews jew + jezebel jezebel jig jig + jigging jig jill jill + jills jill jingling jingl + joan joan job job + jockey jockei jocund jocund + jog jog jogging jog + john john johns john + join join joinder joinder + joined join joiner joiner + joineth joineth joins join + joint joint jointed joint + jointing joint jointly jointli + jointress jointress joints joint + jointure jointur jollity jolliti + jolly jolli jolt jolt + joltheads jolthead jordan jordan + joseph joseph joshua joshua + jot jot jour jour + jourdain jourdain journal journal + journey journei journeying journei + journeyman journeyman journeymen journeymen + journeys journei jove jove + jovem jovem jovial jovial + jowl jowl jowls jowl + joy joi joyed joi + joyful joy joyfully joyfulli + joyless joyless joyous joyou + joys joi juan juan + jud jud judas juda + judases judas jude jude + judg judg judge judg + judged judg judgement judgement + judges judg judgest judgest + judging judg judgment judgment + judgments judgment judicious judici + jug jug juggle juggl + juggled juggl juggler juggler + jugglers juggler juggling juggl + jugs jug juice juic + juiced juic jul jul + jule jule julia julia + juliet juliet julietta julietta + julio julio julius juliu + july juli jump jump + jumpeth jumpeth jumping jump + jumps jump june june + junes june junior junior + junius juniu junkets junket + juno juno jupiter jupit + jure jure jurement jurement + jurisdiction jurisdict juror juror + jurors juror jury juri + jurymen jurymen just just + justeius justeiu justest justest + justice justic justicer justic + justicers justic justices justic + justification justif justified justifi + justify justifi justle justl + justled justl justles justl + justling justl justly justli + justness just justs just + jutting jut jutty jutti + juvenal juven kam kam + kate kate kated kate + kates kate katharine katharin + katherina katherina katherine katherin + kecksies kecksi keech keech + keel keel keels keel + keen keen keenness keen + keep keep keepdown keepdown + keeper keeper keepers keeper + keepest keepest keeping keep + keeps keep keiser keiser + ken ken kendal kendal + kennel kennel kent kent + kentish kentish kentishman kentishman + kentishmen kentishmen kept kept + kerchief kerchief kerely kere + kern kern kernal kernal + kernel kernel kernels kernel + kerns kern kersey kersei + kettle kettl kettledrum kettledrum + kettledrums kettledrum key kei + keys kei kibe kibe + kibes kibe kick kick + kicked kick kickshaws kickshaw + kickshawses kickshaws kicky kicki + kid kid kidney kidnei + kikely kike kildare kildar + kill kill killed kill + killer killer killeth killeth + killing kill killingworth killingworth + kills kill kiln kiln + kimbolton kimbolton kin kin + kind kind kinder kinder + kindest kindest kindle kindl + kindled kindl kindless kindless + kindlier kindlier kindling kindl + kindly kindli kindness kind + kindnesses kind kindred kindr + kindreds kindr kinds kind + kine kine king king + kingdom kingdom kingdoms kingdom + kingly kingli kings king + kinred kinr kins kin + kinsman kinsman kinsmen kinsmen + kinswoman kinswoman kirtle kirtl + kirtles kirtl kiss kiss + kissed kiss kisses kiss + kissing kiss kitchen kitchen + kitchens kitchen kite kite + kites kite kitten kitten + kj kj kl kl + klll klll knack knack + knacks knack knapp knapp + knav knav knave knave + knaveries knaveri knavery knaveri + knaves knave knavish knavish + knead knead kneaded knead + kneading knead knee knee + kneel kneel kneeling kneel + kneels kneel knees knee + knell knell knew knew + knewest knewest knife knife + knight knight knighted knight + knighthood knighthood knighthoods knighthood + knightly knightli knights knight + knit knit knits knit + knitters knitter knitteth knitteth + knives knive knobs knob + knock knock knocking knock + knocks knock knog knog + knoll knoll knot knot + knots knot knotted knot + knotty knotti know know + knower knower knowest knowest + knowing know knowingly knowingli + knowings know knowledge knowledg + known known knows know + l l la la + laban laban label label + labell label labienus labienu + labio labio labor labor + laboring labor labors labor + labour labour laboured labour + labourer labour labourers labour + labouring labour labours labour + laboursome laboursom labras labra + labyrinth labyrinth lac lac + lace lace laced lace + lacedaemon lacedaemon laces lace + lacies laci lack lack + lackbeard lackbeard lacked lack + lackey lackei lackeying lackei + lackeys lackei lacking lack + lacks lack lad lad + ladder ladder ladders ladder + lade lade laden laden + ladies ladi lading lade + lads lad lady ladi + ladybird ladybird ladyship ladyship + ladyships ladyship laer laer + laertes laert lafeu lafeu + lag lag lagging lag + laid laid lain lain + laissez laissez lake lake + lakes lake lakin lakin + lam lam lamb lamb + lambert lambert lambkin lambkin + lambkins lambkin lambs lamb + lame lame lamely lame + lameness lame lament lament + lamentable lament lamentably lament + lamentation lament lamentations lament + lamented lament lamenting lament + lamentings lament laments lament + lames lame laming lame + lammas lamma lammastide lammastid + lamound lamound lamp lamp + lampass lampass lamps lamp + lanc lanc lancaster lancast + lance lanc lances lanc + lanceth lanceth lanch lanch + land land landed land + landing land landless landless + landlord landlord landmen landmen + lands land lane lane + lanes lane langage langag + langley langlei langton langton + language languag languageless languageless + languages languag langues langu + languish languish languished languish + languishes languish languishing languish + languishings languish languishment languish + languor languor lank lank + lantern lantern lanterns lantern + lanthorn lanthorn lap lap + lapis lapi lapland lapland + lapp lapp laps lap + lapse laps lapsed laps + lapsing laps lapwing lapw + laquais laquai larded lard + larder larder larding lard + lards lard large larg + largely larg largeness larg + larger larger largess largess + largest largest lark lark + larks lark larron larron + lartius lartiu larum larum + larums larum las la + lascivious lascivi lash lash + lass lass lasses lass + last last lasted last + lasting last lastly lastli + lasts last latch latch + latches latch late late + lated late lately late + later later latest latest + lath lath latin latin + latten latten latter latter + lattice lattic laud laud + laudable laudabl laudis laudi + laugh laugh laughable laughabl + laughed laugh laugher laugher + laughest laughest laughing laugh + laughs laugh laughter laughter + launce launc launcelot launcelot + launces launc launch launch + laund laund laundress laundress + laundry laundri laur laur + laura laura laurel laurel + laurels laurel laurence laurenc + laus lau lavache lavach + lave lave lavee lave + lavender lavend lavina lavina + lavinia lavinia lavish lavish + lavishly lavishli lavolt lavolt + lavoltas lavolta law law + lawful law lawfully lawfulli + lawless lawless lawlessly lawlessli + lawn lawn lawns lawn + lawrence lawrenc laws law + lawyer lawyer lawyers lawyer + lay lai layer layer + layest layest laying lai + lays lai lazar lazar + lazars lazar lazarus lazaru + lazy lazi lc lc + ld ld ldst ldst + le le lead lead + leaden leaden leader leader + leaders leader leadest leadest + leading lead leads lead + leaf leaf leagu leagu + league leagu leagued leagu + leaguer leaguer leagues leagu + leah leah leak leak + leaky leaki lean lean + leander leander leaner leaner + leaning lean leanness lean + leans lean leap leap + leaped leap leaping leap + leaps leap leapt leapt + lear lear learn learn + learned learn learnedly learnedli + learning learn learnings learn + learns learn learnt learnt + leas lea lease leas + leases leas leash leash + leasing leas least least + leather leather leathern leathern + leav leav leave leav + leaven leaven leavening leaven + leaver leaver leaves leav + leaving leav leavy leavi + lecher lecher lecherous lecher + lechers lecher lechery lecheri + lecon lecon lecture lectur + lectures lectur led led + leda leda leech leech + leeches leech leek leek + leeks leek leer leer + leers leer lees lee + leese lees leet leet + leets leet left left + leg leg legacies legaci + legacy legaci legate legat + legatine legatin lege lege + legerity leger leges lege + legg legg legion legion + legions legion legitimate legitim + legitimation legitim legs leg + leicester leicest leicestershire leicestershir + leiger leiger leigers leiger + leisure leisur leisurely leisur + leisures leisur leman leman + lemon lemon lena lena + lend lend lender lender + lending lend lendings lend + lends lend length length + lengthen lengthen lengthens lengthen + lengths length lenity leniti + lennox lennox lent lent + lenten lenten lentus lentu + leo leo leon leon + leonardo leonardo leonati leonati + leonato leonato leonatus leonatu + leontes leont leopard leopard + leopards leopard leper leper + leperous leper lepidus lepidu + leprosy leprosi lequel lequel + lers ler les le + less less lessen lessen + lessens lessen lesser lesser + lesson lesson lessoned lesson + lessons lesson lest lest + lestrake lestrak let let + lethargied lethargi lethargies lethargi + lethargy lethargi lethe leth + lets let lett lett + letter letter letters letter + letting let lettuce lettuc + leur leur leve leve + level level levell level + levelled level levels level + leven leven levers lever + leviathan leviathan leviathans leviathan + levied levi levies levi + levity leviti levy levi + levying levi lewd lewd + lewdly lewdli lewdness lewd + lewdsters lewdster lewis lewi + liable liabl liar liar + liars liar libbard libbard + libelling libel libels libel + liberal liber liberality liber + liberte libert liberties liberti + libertine libertin libertines libertin + liberty liberti library librari + libya libya licence licenc + licens licen license licens + licentious licenti lichas licha + licio licio lick lick + licked lick licker licker + lictors lictor lid lid + lids lid lie lie + lied li lief lief + liefest liefest liege lieg + liegeman liegeman liegemen liegemen + lien lien lies li + liest liest lieth lieth + lieu lieu lieutenant lieuten + lieutenantry lieutenantri lieutenants lieuten + lieve liev life life + lifeblood lifeblood lifeless lifeless + lifelings lifel lift lift + lifted lift lifter lifter + lifteth lifteth lifting lift + lifts lift lig lig + ligarius ligariu liggens liggen + light light lighted light + lighten lighten lightens lighten + lighter lighter lightest lightest + lightly lightli lightness light + lightning lightn lightnings lightn + lights light lik lik + like like liked like + likeliest likeliest likelihood likelihood + likelihoods likelihood likely like + likeness like liker liker + likes like likest likest + likewise likewis liking like + likings like lilies lili + lily lili lim lim + limander limand limb limb + limbeck limbeck limbecks limbeck + limber limber limbo limbo + limbs limb lime lime + limed lime limehouse limehous + limekilns limekiln limit limit + limitation limit limited limit + limits limit limn limn + limp limp limping limp + limps limp lin lin + lincoln lincoln lincolnshire lincolnshir + line line lineal lineal + lineally lineal lineament lineament + lineaments lineament lined line + linen linen linens linen + lines line ling ling + lingare lingar linger linger + lingered linger lingers linger + linguist linguist lining line + link link links link + linsey linsei linstock linstock + linta linta lion lion + lionel lionel lioness lioness + lions lion lip lip + lipp lipp lips lip + lipsbury lipsburi liquid liquid + liquor liquor liquorish liquorish + liquors liquor lirra lirra + lisbon lisbon lisp lisp + lisping lisp list list + listen listen listening listen + lists list literatured literatur + lither lither litter litter + little littl littlest littlest + liv liv live live + lived live livelier liveli + livelihood livelihood livelong livelong + lively live liver liver + liveries liveri livers liver + livery liveri lives live + livest livest liveth liveth + livia livia living live + livings live lizard lizard + lizards lizard ll ll + lll lll llous llou + lnd lnd lo lo + loa loa loach loach + load load loaden loaden + loading load loads load + loaf loaf loam loam + loan loan loath loath + loathe loath loathed loath + loather loather loathes loath + loathing loath loathly loathli + loathness loath loathsome loathsom + loathsomeness loathsom loathsomest loathsomest + loaves loav lob lob + lobbies lobbi lobby lobbi + local local lochaber lochab + lock lock locked lock + locking lock lockram lockram + locks lock locusts locust + lode lode lodg lodg + lodge lodg lodged lodg + lodgers lodger lodges lodg + lodging lodg lodgings lodg + lodovico lodovico lodowick lodowick + lofty lofti log log + logger logger loggerhead loggerhead + loggerheads loggerhead loggets logget + logic logic logs log + loins loin loiter loiter + loiterer loiter loiterers loiter + loitering loiter lolling loll + lolls loll lombardy lombardi + london london londoners london + lone lone loneliness loneli + lonely lone long long + longaville longavil longboat longboat + longed long longer longer + longest longest longeth longeth + longing long longings long + longly longli longs long + longtail longtail loo loo + loof loof look look + looked look looker looker + lookers looker lookest lookest + looking look looks look + loon loon loop loop + loos loo loose loos + loosed loos loosely loos + loosen loosen loosing loos + lop lop lopp lopp + loquitur loquitur lord lord + lorded lord lording lord + lordings lord lordliness lordli + lordly lordli lords lord + lordship lordship lordships lordship + lorenzo lorenzo lorn lorn + lorraine lorrain lorship lorship + los lo lose lose + loser loser losers loser + loses lose losest losest + loseth loseth losing lose + loss loss losses loss + lost lost lot lot + lots lot lott lott + lottery lotteri loud loud + louder louder loudly loudli + lour lour loureth loureth + louring lour louse lous + louses lous lousy lousi + lout lout louted lout + louts lout louvre louvr + lov lov love love + loved love lovedst lovedst + lovel lovel lovelier loveli + loveliness loveli lovell lovel + lovely love lover lover + lovered lover lovers lover + loves love lovest lovest + loveth loveth loving love + lovingly lovingli low low + lowe low lower lower + lowest lowest lowing low + lowliness lowli lowly lowli + lown lown lowness low + loyal loyal loyally loyal + loyalties loyalti loyalty loyalti + lozel lozel lt lt + lubber lubber lubberly lubberli + luc luc luccicos luccico + luce luce lucentio lucentio + luces luce lucetta lucetta + luciana luciana lucianus lucianu + lucifer lucif lucifier lucifi + lucilius luciliu lucina lucina + lucio lucio lucius luciu + luck luck luckier luckier + luckiest luckiest luckily luckili + luckless luckless lucky lucki + lucre lucr lucrece lucrec + lucretia lucretia lucullius luculliu + lucullus lucullu lucy luci + lud lud ludlow ludlow + lug lug lugg lugg + luggage luggag luke luke + lukewarm lukewarm lull lull + lulla lulla lullaby lullabi + lulls lull lumbert lumbert + lump lump lumpish lumpish + luna luna lunacies lunaci + lunacy lunaci lunatic lunat + lunatics lunat lunes lune + lungs lung lupercal luperc + lurch lurch lure lure + lurk lurk lurketh lurketh + lurking lurk lurks lurk + luscious lusciou lush lush + lust lust lusted lust + luster luster lustful lust + lustier lustier lustiest lustiest + lustig lustig lustihood lustihood + lustily lustili lustre lustr + lustrous lustrou lusts lust + lusty lusti lute lute + lutes lute lutestring lutestr + lutheran lutheran luxurious luxuri + luxuriously luxuri luxury luxuri + ly ly lycaonia lycaonia + lycurguses lycurgus lydia lydia + lye lye lyen lyen + lying ly lym lym + lymoges lymog lynn lynn + lysander lysand m m + ma ma maan maan + mab mab macbeth macbeth + maccabaeus maccabaeu macdonwald macdonwald + macduff macduff mace mace + macedon macedon maces mace + machiavel machiavel machination machin + machinations machin machine machin + mack mack macmorris macmorri + maculate macul maculation macul + mad mad madam madam + madame madam madams madam + madcap madcap madded mad + madding mad made made + madeira madeira madly madli + madman madman madmen madmen + madness mad madonna madonna + madrigals madrig mads mad + maecenas maecena maggot maggot + maggots maggot magic magic + magical magic magician magician + magistrate magistr magistrates magistr + magnanimity magnanim magnanimous magnanim + magni magni magnifi magnifi + magnificence magnific magnificent magnific + magnifico magnifico magnificoes magnifico + magnus magnu mahomet mahomet + mahu mahu maid maid + maiden maiden maidenhead maidenhead + maidenheads maidenhead maidenhood maidenhood + maidenhoods maidenhood maidenliest maidenliest + maidenly maidenli maidens maiden + maidhood maidhood maids maid + mail mail mailed mail + mails mail maim maim + maimed maim maims maim + main main maincourse maincours + maine main mainly mainli + mainmast mainmast mains main + maintain maintain maintained maintain + maintains maintain maintenance mainten + mais mai maison maison + majestas majesta majestee majeste + majestic majest majestical majest + majestically majest majesties majesti + majesty majesti major major + majority major mak mak + make make makeless makeless + maker maker makers maker + makes make makest makest + maketh maketh making make + makings make mal mal + mala mala maladies maladi + malady maladi malapert malapert + malcolm malcolm malcontent malcont + malcontents malcont male male + maledictions maledict malefactions malefact + malefactor malefactor malefactors malefactor + males male malevolence malevol + malevolent malevol malhecho malhecho + malice malic malicious malici + maliciously malici malign malign + malignancy malign malignant malign + malignantly malignantli malkin malkin + mall mall mallard mallard + mallet mallet mallows mallow + malmsey malmsei malt malt + maltworms maltworm malvolio malvolio + mamillius mamilliu mammering mammer + mammet mammet mammets mammet + mammock mammock man man + manacle manacl manacles manacl + manage manag managed manag + manager manag managing manag + manakin manakin manchus manchu + mandate mandat mandragora mandragora + mandrake mandrak mandrakes mandrak + mane mane manent manent + manes mane manet manet + manfully manfulli mangle mangl + mangled mangl mangles mangl + mangling mangl mangy mangi + manhood manhood manhoods manhood + manifest manifest manifested manifest + manifests manifest manifold manifold + manifoldly manifoldli manka manka + mankind mankind manlike manlik + manly manli mann mann + manna manna manner manner + mannerly mannerli manners manner + manningtree manningtre mannish mannish + manor manor manors manor + mans man mansion mansion + mansionry mansionri mansions mansion + manslaughter manslaught mantle mantl + mantled mantl mantles mantl + mantua mantua mantuan mantuan + manual manual manure manur + manured manur manus manu + many mani map map + mapp mapp maps map + mar mar marble marbl + marbled marbl marcade marcad + marcellus marcellu march march + marches march marcheth marcheth + marching march marchioness marchio + marchpane marchpan marcians marcian + marcius marciu marcus marcu + mardian mardian mare mare + mares mare marg marg + margarelon margarelon margaret margaret + marge marg margent margent + margery margeri maria maria + marian marian mariana mariana + maries mari marigold marigold + mariner marin mariners marin + maritime maritim marjoram marjoram + mark mark marked mark + market market marketable market + marketplace marketplac markets market + marking mark markman markman + marks mark marl marl + marle marl marmoset marmoset + marquess marquess marquis marqui + marr marr marriage marriag + marriages marriag married marri + marries marri marring mar + marrow marrow marrowless marrowless + marrows marrow marry marri + marrying marri mars mar + marseilles marseil marsh marsh + marshal marshal marshalsea marshalsea + marshalship marshalship mart mart + marted mart martem martem + martext martext martial martial + martin martin martino martino + martius martiu martlemas martlema + martlet martlet marts mart + martyr martyr martyrs martyr + marullus marullu marv marv + marvel marvel marvell marvel + marvellous marvel marvellously marvel + marvels marvel mary mari + mas ma masculine masculin + masham masham mask mask + masked mask masker masker + maskers masker masking mask + masks mask mason mason + masonry masonri masons mason + masque masqu masquers masquer + masques masqu masquing masqu + mass mass massacre massacr + massacres massacr masses mass + massy massi mast mast + mastcr mastcr master master + masterdom masterdom masterest masterest + masterless masterless masterly masterli + masterpiece masterpiec masters master + mastership mastership mastic mastic + mastiff mastiff mastiffs mastiff + masts mast match match + matches match matcheth matcheth + matching match matchless matchless + mate mate mated mate + mater mater material materi + mates mate mathematics mathemat + matin matin matron matron + matrons matron matter matter + matters matter matthew matthew + mattock mattock mattress mattress + mature matur maturity matur + maud maud maudlin maudlin + maugre maugr maul maul + maund maund mauri mauri + mauritania mauritania mauvais mauvai + maw maw maws maw + maxim maxim may mai + mayday maydai mayest mayest + mayor mayor maypole maypol + mayst mayst maz maz + maze maze mazed maze + mazes maze mazzard mazzard + me me meacock meacock + mead mead meadow meadow + meadows meadow meads mead + meagre meagr meal meal + meals meal mealy meali + mean mean meanders meander + meaner meaner meanest meanest + meaneth meaneth meaning mean + meanings mean meanly meanli + means mean meant meant + meantime meantim meanwhile meanwhil + measles measl measur measur + measurable measur measure measur + measured measur measureless measureless + measures measur measuring measur + meat meat meats meat + mechanic mechan mechanical mechan + mechanicals mechan mechanics mechan + mechante mechant med med + medal medal meddle meddl + meddler meddler meddling meddl + mede mede medea medea + media media mediation mediat + mediators mediat medice medic + medicinal medicin medicine medicin + medicines medicin meditate medit + meditates medit meditating medit + meditation medit meditations medit + mediterranean mediterranean mediterraneum mediterraneum + medlar medlar medlars medlar + meed meed meeds meed + meek meek meekly meekli + meekness meek meet meet + meeter meeter meetest meetest + meeting meet meetings meet + meetly meetli meetness meet + meets meet meg meg + mehercle mehercl meilleur meilleur + meiny meini meisen meisen + melancholies melancholi melancholy melancholi + melford melford mell mell + mellifluous melliflu mellow mellow + mellowing mellow melodious melodi + melody melodi melt melt + melted melt melteth melteth + melting melt melts melt + melun melun member member + members member memento memento + memorable memor memorandums memorandum + memorial memori memorials memori + memories memori memoriz memoriz + memorize memor memory memori + memphis memphi men men + menac menac menace menac + menaces menac menaphon menaphon + menas mena mend mend + mended mend mender mender + mending mend mends mend + menecrates menecr menelaus menelau + menenius meneniu mental mental + menteith menteith mention mention + mentis menti menton menton + mephostophilus mephostophilu mer mer + mercatante mercatant mercatio mercatio + mercenaries mercenari mercenary mercenari + mercer mercer merchandise merchandis + merchandized merchand merchant merchant + merchants merchant mercies merci + merciful merci mercifully mercifulli + merciless merciless mercurial mercuri + mercuries mercuri mercury mercuri + mercutio mercutio mercy merci + mere mere mered mere + merely mere merest merest + meridian meridian merit merit + merited merit meritorious meritori + merits merit merlin merlin + mermaid mermaid mermaids mermaid + merops merop merrier merrier + merriest merriest merrily merrili + merriman merriman merriment merriment + merriments merriment merriness merri + merry merri mervailous mervail + mes me mesh mesh + meshes mesh mesopotamia mesopotamia + mess mess message messag + messages messag messala messala + messaline messalin messenger messeng + messengers messeng messes mess + messina messina met met + metal metal metals metal + metamorphis metamorphi metamorphoses metamorphos + metaphor metaphor metaphysical metaphys + metaphysics metaphys mete mete + metellus metellu meteor meteor + meteors meteor meteyard meteyard + metheglin metheglin metheglins metheglin + methink methink methinks methink + method method methods method + methought methought methoughts methought + metre metr metres metr + metropolis metropoli mette mett + mettle mettl mettled mettl + meus meu mew mew + mewed mew mewling mewl + mexico mexico mi mi + mice mice michael michael + michaelmas michaelma micher micher + miching mich mickle mickl + microcosm microcosm mid mid + midas mida middest middest + middle middl middleham middleham + midnight midnight midriff midriff + midst midst midsummer midsumm + midway midwai midwife midwif + midwives midwiv mienne mienn + might might mightful might + mightier mightier mightiest mightiest + mightily mightili mightiness mighti + mightst mightst mighty mighti + milan milan milch milch + mild mild milder milder + mildest mildest mildew mildew + mildews mildew mildly mildli + mildness mild mile mile + miles mile milford milford + militarist militarist military militari + milk milk milking milk + milkmaid milkmaid milks milk + milksops milksop milky milki + mill mill mille mill + miller miller milliner millin + million million millioned million + millions million mills mill + millstones millston milo milo + mimic mimic minc minc + mince minc minces minc + mincing minc mind mind + minded mind minding mind + mindless mindless minds mind + mine mine mineral miner + minerals miner minerva minerva + mines mine mingle mingl + mingled mingl mingling mingl + minikin minikin minim minim + minime minim minimo minimo + minimus minimu mining mine + minion minion minions minion + minist minist minister minist + ministers minist ministration ministr + minnow minnow minnows minnow + minola minola minority minor + minos mino minotaurs minotaur + minstrel minstrel minstrels minstrel + minstrelsy minstrelsi mint mint + mints mint minute minut + minutely minut minutes minut + minx minx mio mio + mir mir mirable mirabl + miracle miracl miracles miracl + miraculous miracul miranda miranda + mire mire mirror mirror + mirrors mirror mirth mirth + mirthful mirth miry miri + mis mi misadventur misadventur + misadventure misadventur misanthropos misanthropo + misapplied misappli misbecame misbecam + misbecom misbecom misbecome misbecom + misbegot misbegot misbegotten misbegotten + misbeliever misbeliev misbelieving misbeliev + misbhav misbhav miscall miscal + miscalled miscal miscarried miscarri + miscarries miscarri miscarry miscarri + miscarrying miscarri mischance mischanc + mischances mischanc mischief mischief + mischiefs mischief mischievous mischiev + misconceived misconceiv misconst misconst + misconster misconst misconstruction misconstruct + misconstrued misconstru misconstrues misconstru + miscreant miscreant miscreate miscreat + misdeed misde misdeeds misde + misdemean misdemean misdemeanours misdemeanour + misdoubt misdoubt misdoubteth misdoubteth + misdoubts misdoubt misenum misenum + miser miser miserable miser + miserably miser misericorde misericord + miseries miseri misers miser + misery miseri misfortune misfortun + misfortunes misfortun misgive misgiv + misgives misgiv misgiving misgiv + misgoverned misgovern misgovernment misgovern + misgraffed misgraf misguide misguid + mishap mishap mishaps mishap + misheard misheard misinterpret misinterpret + mislead mislead misleader mislead + misleaders mislead misleading mislead + misled misl mislike mislik + misord misord misplac misplac + misplaced misplac misplaces misplac + mispris mispri misprised mispris + misprision mispris misprizing mispriz + misproud misproud misquote misquot + misreport misreport miss miss + missed miss misses miss + misshap misshap misshapen misshapen + missheathed missheath missing miss + missingly missingli missions mission + missive missiv missives missiv + misspoke misspok mist mist + mista mista mistak mistak + mistake mistak mistaken mistaken + mistakes mistak mistaketh mistaketh + mistaking mistak mistakings mistak + mistemp mistemp mistempered mistemp + misterm misterm mistful mist + misthink misthink misthought misthought + mistletoe mistleto mistook mistook + mistreadings mistread mistress mistress + mistresses mistress mistresss mistresss + mistriship mistriship mistrust mistrust + mistrusted mistrust mistrustful mistrust + mistrusting mistrust mists mist + misty misti misus misu + misuse misus misused misus + misuses misus mites mite + mithridates mithrid mitigate mitig + mitigation mitig mix mix + mixed mix mixture mixtur + mixtures mixtur mm mm + mnd mnd moan moan + moans moan moat moat + moated moat mobled mobl + mock mock mockable mockabl + mocker mocker mockeries mockeri + mockers mocker mockery mockeri + mocking mock mocks mock + mockvater mockvat mockwater mockwat + model model modena modena + moderate moder moderately moder + moderation moder modern modern + modest modest modesties modesti + modestly modestli modesty modesti + modicums modicum modo modo + module modul moe moe + moi moi moiety moieti + moist moist moisten moisten + moisture moistur moldwarp moldwarp + mole mole molehill molehil + moles mole molest molest + molestation molest mollification mollif + mollis molli molten molten + molto molto mome mome + moment moment momentary momentari + moming mome mon mon + monachum monachum monarch monarch + monarchies monarchi monarchize monarch + monarcho monarcho monarchs monarch + monarchy monarchi monast monast + monastery monasteri monastic monast + monday mondai monde mond + money monei moneys monei + mong mong monger monger + mongers monger monging mong + mongrel mongrel mongrels mongrel + mongst mongst monk monk + monkey monkei monkeys monkei + monks monk monmouth monmouth + monopoly monopoli mons mon + monsieur monsieur monsieurs monsieur + monster monster monsters monster + monstrous monstrou monstrously monstrous + monstrousness monstrous monstruosity monstruos + montacute montacut montage montag + montague montagu montagues montagu + montano montano montant montant + montez montez montferrat montferrat + montgomery montgomeri month month + monthly monthli months month + montjoy montjoi monument monument + monumental monument monuments monument + mood mood moods mood + moody moodi moon moon + moonbeams moonbeam moonish moonish + moonlight moonlight moons moon + moonshine moonshin moonshines moonshin + moor moor moorfields moorfield + moors moor moorship moorship + mop mop mope mope + moping mope mopping mop + mopsa mopsa moral moral + moraler moral morality moral + moralize moral mordake mordak + more more moreover moreov + mores more morgan morgan + mori mori morisco morisco + morn morn morning morn + mornings morn morocco morocco + morris morri morrow morrow + morrows morrow morsel morsel + morsels morsel mort mort + mortal mortal mortality mortal + mortally mortal mortals mortal + mortar mortar mortgaged mortgag + mortified mortifi mortifying mortifi + mortimer mortim mortimers mortim + mortis morti mortise mortis + morton morton mose mose + moss moss mossgrown mossgrown + most most mote mote + moth moth mother mother + mothers mother moths moth + motion motion motionless motionless + motions motion motive motiv + motives motiv motley motlei + mots mot mought mought + mould mould moulded mould + mouldeth mouldeth moulds mould + mouldy mouldi moult moult + moulten moulten mounch mounch + mounseur mounseur mounsieur mounsieur + mount mount mountain mountain + mountaineer mountain mountaineers mountain + mountainous mountain mountains mountain + mountant mountant mountanto mountanto + mountebank mountebank mountebanks mountebank + mounted mount mounteth mounteth + mounting mount mounts mount + mourn mourn mourned mourn + mourner mourner mourners mourner + mournful mourn mournfully mournfulli + mourning mourn mourningly mourningli + mournings mourn mourns mourn + mous mou mouse mous + mousetrap mousetrap mousing mous + mouth mouth mouthed mouth + mouths mouth mov mov + movables movabl move move + moveable moveabl moveables moveabl + moved move mover mover + movers mover moves move + moveth moveth moving move + movingly movingli movousus movousu + mow mow mowbray mowbrai + mower mower mowing mow + mows mow moy moi + moys moi moyses moys + mrs mr much much + muck muck mud mud + mudded mud muddied muddi + muddy muddi muffins muffin + muffl muffl muffle muffl + muffled muffl muffler muffler + muffling muffl mugger mugger + mugs mug mulberries mulberri + mulberry mulberri mule mule + mules mule muleteers mulet + mulier mulier mulieres mulier + muliteus muliteu mull mull + mulmutius mulmutiu multiplied multipli + multiply multipli multiplying multipli + multipotent multipot multitude multitud + multitudes multitud multitudinous multitudin + mum mum mumble mumbl + mumbling mumbl mummers mummer + mummy mummi mun mun + munch munch muniments muniment + munition munit murd murd + murder murder murdered murder + murderer murder murderers murder + murdering murder murderous murder + murders murder mure mure + murk murk murkiest murkiest + murky murki murmur murmur + murmurers murmur murmuring murmur + murrain murrain murray murrai + murrion murrion murther murther + murtherer murther murtherers murther + murthering murther murtherous murther + murthers murther mus mu + muscadel muscadel muscovites muscovit + muscovits muscovit muscovy muscovi + muse muse muses muse + mush mush mushrooms mushroom + music music musical music + musician musician musicians musician + musics music musing muse + musings muse musk musk + musket musket muskets musket + muskos musko muss muss + mussel mussel mussels mussel + must must mustachio mustachio + mustard mustard mustardseed mustardse + muster muster mustering muster + musters muster musty musti + mutability mutabl mutable mutabl + mutation mutat mutations mutat + mute mute mutes mute + mutest mutest mutine mutin + mutineer mutin mutineers mutin + mutines mutin mutinies mutini + mutinous mutin mutiny mutini + mutius mutiu mutter mutter + muttered mutter mutton mutton + muttons mutton mutual mutual + mutualities mutual mutually mutual + muzzl muzzl muzzle muzzl + muzzled muzzl mv mv + mww mww my my + mynheers mynheer myrmidon myrmidon + myrmidons myrmidon myrtle myrtl + myself myself myst myst + mysteries mysteri mystery mysteri + n n nag nag + nage nage nags nag + naiads naiad nail nail + nails nail nak nak + naked nake nakedness naked + nal nal nam nam + name name named name + nameless nameless namely name + names name namest namest + naming name nan nan + nance nanc nap nap + nape nape napes nape + napkin napkin napkins napkin + naples napl napless napless + napping nap naps nap + narbon narbon narcissus narcissu + narines narin narrow narrow + narrowly narrowli naso naso + nasty nasti nathaniel nathaniel + natifs natif nation nation + nations nation native nativ + nativity nativ natur natur + natural natur naturalize natur + naturally natur nature natur + natured natur natures natur + natus natu naught naught + naughtily naughtili naughty naughti + navarre navarr nave nave + navel navel navigation navig + navy navi nay nai + nayward nayward nayword nayword + nazarite nazarit ne ne + neaf neaf neamnoins neamnoin + neanmoins neanmoin neapolitan neapolitan + neapolitans neapolitan near near + nearer nearer nearest nearest + nearly nearli nearness near + neat neat neatly neatli + neb neb nebour nebour + nebuchadnezzar nebuchadnezzar nec nec + necessaries necessari necessarily necessarili + necessary necessari necessitied necess + necessities necess necessity necess + neck neck necklace necklac + necks neck nectar nectar + ned ned nedar nedar + need need needed need + needer needer needful need + needfull needful needing need + needle needl needles needl + needless needless needly needli + needs need needy needi + neer neer neeze neez + nefas nefa negation negat + negative neg negatives neg + neglect neglect neglected neglect + neglecting neglect neglectingly neglectingli + neglection neglect negligence neglig + negligent neglig negotiate negoti + negotiations negoti negro negro + neigh neigh neighbors neighbor + neighbour neighbour neighbourhood neighbourhood + neighbouring neighbour neighbourly neighbourli + neighbours neighbour neighing neigh + neighs neigh neither neither + nell nell nemean nemean + nemesis nemesi neoptolemus neoptolemu + nephew nephew nephews nephew + neptune neptun ner ner + nereides nereid nerissa nerissa + nero nero neroes nero + ners ner nerve nerv + nerves nerv nervii nervii + nervy nervi nessus nessu + nest nest nestor nestor + nests nest net net + nether nether netherlands netherland + nets net nettle nettl + nettled nettl nettles nettl + neuter neuter neutral neutral + nev nev never never + nevil nevil nevils nevil + new new newborn newborn + newer newer newest newest + newgate newgat newly newli + newness new news new + newsmongers newsmong newt newt + newts newt next next + nibbling nibbl nicanor nicanor + nice nice nicely nice + niceness nice nicer nicer + nicety niceti nicholas nichola + nick nick nickname nicknam + nicks nick niece niec + nieces niec niggard niggard + niggarding niggard niggardly niggardli + nigh nigh night night + nightcap nightcap nightcaps nightcap + nighted night nightgown nightgown + nightingale nightingal nightingales nightingal + nightly nightli nightmare nightmar + nights night nightwork nightwork + nihil nihil nile nile + nill nill nilus nilu + nimble nimbl nimbleness nimbl + nimbler nimbler nimbly nimbl + nine nine nineteen nineteen + ning ning ningly ningli + ninny ninni ninth ninth + ninus ninu niobe niob + niobes niob nip nip + nipp nipp nipping nip + nipple nippl nips nip + nit nit nly nly + nnight nnight nnights nnight + no no noah noah + nob nob nobility nobil + nobis nobi noble nobl + nobleman nobleman noblemen noblemen + nobleness nobl nobler nobler + nobles nobl noblesse nobless + noblest noblest nobly nobli + nobody nobodi noces noce + nod nod nodded nod + nodding nod noddle noddl + noddles noddl noddy noddi + nods nod noes noe + nointed noint nois noi + noise nois noiseless noiseless + noisemaker noisemak noises nois + noisome noisom nole nole + nominate nomin nominated nomin + nomination nomin nominativo nominativo + non non nonage nonag + nonce nonc none none + nonino nonino nonny nonni + nonpareil nonpareil nonsuits nonsuit + nony noni nook nook + nooks nook noon noon + noonday noondai noontide noontid + nor nor norbery norberi + norfolk norfolk norman norman + normandy normandi normans norman + north north northampton northampton + northamptonshire northamptonshir northerly northerli + northern northern northgate northgat + northumberland northumberland northumberlands northumberland + northward northward norway norwai + norways norwai norwegian norwegian + norweyan norweyan nos no + nose nose nosegays nosegai + noseless noseless noses nose + noster noster nostra nostra + nostril nostril nostrils nostril + not not notable notabl + notably notabl notary notari + notch notch note note + notebook notebook noted note + notedly notedli notes note + notest notest noteworthy noteworthi + nothing noth nothings noth + notice notic notify notifi + noting note notion notion + notorious notori notoriously notori + notre notr notwithstanding notwithstand + nought nought noun noun + nouns noun nourish nourish + nourished nourish nourisher nourish + nourishes nourish nourisheth nourisheth + nourishing nourish nourishment nourish + nous nou novel novel + novelties novelti novelty novelti + noverbs noverb novi novi + novice novic novices novic + novum novum now now + nowhere nowher noyance noyanc + ns ns nt nt + nubibus nubibu numa numa + numb numb number number + numbered number numbering number + numberless numberless numbers number + numbness numb nun nun + nuncio nuncio nuncle nuncl + nunnery nunneri nuns nun + nuntius nuntiu nuptial nuptial + nurs nur nurse nurs + nursed nurs nurser nurser + nursery nurseri nurses nurs + nurseth nurseth nursh nursh + nursing nurs nurtur nurtur + nurture nurtur nut nut + nuthook nuthook nutmeg nutmeg + nutmegs nutmeg nutriment nutriment + nuts nut nutshell nutshel + ny ny nym nym + nymph nymph nymphs nymph + o o oak oak + oaken oaken oaks oak + oared oar oars oar + oatcake oatcak oaten oaten + oath oath oathable oathabl + oaths oath oats oat + ob ob obduracy obduraci + obdurate obdur obedience obedi + obedient obedi obeisance obeis + oberon oberon obey obei + obeyed obei obeying obei + obeys obei obidicut obidicut + object object objected object + objections object objects object + oblation oblat oblations oblat + obligation oblig obligations oblig + obliged oblig oblique obliqu + oblivion oblivion oblivious oblivi + obloquy obloqui obscene obscen + obscenely obscen obscur obscur + obscure obscur obscured obscur + obscurely obscur obscures obscur + obscuring obscur obscurity obscur + obsequies obsequi obsequious obsequi + obsequiously obsequi observ observ + observance observ observances observ + observancy observ observant observ + observants observ observation observ + observe observ observed observ + observer observ observers observ + observing observ observingly observingli + obsque obsqu obstacle obstacl + obstacles obstacl obstinacy obstinaci + obstinate obstin obstinately obstin + obstruct obstruct obstruction obstruct + obstructions obstruct obtain obtain + obtained obtain obtaining obtain + occasion occas occasions occas + occident occid occidental occident + occulted occult occupat occupat + occupation occup occupations occup + occupied occupi occupies occupi + occupy occupi occurrence occurr + occurrences occurr occurrents occurr + ocean ocean oceans ocean + octavia octavia octavius octaviu + ocular ocular od od + odd odd oddest oddest + oddly oddli odds odd + ode od odes od + odious odiou odoriferous odorifer + odorous odor odour odour + odours odour ods od + oeillades oeillad oes oe + oeuvres oeuvr of of + ofephesus ofephesu off off + offal offal offence offenc + offenceful offenc offences offenc + offend offend offended offend + offendendo offendendo offender offend + offenders offend offendeth offendeth + offending offend offendress offendress + offends offend offense offens + offenseless offenseless offenses offens + offensive offens offer offer + offered offer offering offer + offerings offer offers offer + offert offert offic offic + office offic officed offic + officer offic officers offic + offices offic official offici + officious offici offspring offspr + oft oft often often + oftener often oftentimes oftentim + oh oh oil oil + oils oil oily oili + old old oldcastle oldcastl + olden olden older older + oldest oldest oldness old + olive oliv oliver oliv + olivers oliv olives oliv + olivia olivia olympian olympian + olympus olympu oman oman + omans oman omen omen + ominous omin omission omiss + omit omit omittance omitt + omitted omit omitting omit + omne omn omnes omn + omnipotent omnipot on on + once onc one on + ones on oneyers oney + ongles ongl onion onion + onions onion only onli + onset onset onward onward + onwards onward oo oo + ooze ooz oozes ooz + oozy oozi op op + opal opal ope op + open open opener open + opening open openly openli + openness open opens open + operant oper operate oper + operation oper operations oper + operative oper opes op + oph oph ophelia ophelia + opinion opinion opinions opinion + opportune opportun opportunities opportun + opportunity opportun oppos oppo + oppose oppos opposed oppos + opposeless opposeless opposer oppos + opposers oppos opposes oppos + opposing oppos opposite opposit + opposites opposit opposition opposit + oppositions opposit oppress oppress + oppressed oppress oppresses oppress + oppresseth oppresseth oppressing oppress + oppression oppress oppressor oppressor + opprest opprest opprobriously opprobri + oppugnancy oppugn opulency opul + opulent opul or or + oracle oracl oracles oracl + orange orang oration orat + orator orat orators orat + oratory oratori orb orb + orbed orb orbs orb + orchard orchard orchards orchard + ord ord ordain ordain + ordained ordain ordaining ordain + order order ordered order + ordering order orderless orderless + orderly orderli orders order + ordinance ordin ordinant ordin + ordinaries ordinari ordinary ordinari + ordnance ordnanc ords ord + ordure ordur ore or + organ organ organs organ + orgillous orgil orient orient + orifex orifex origin origin + original origin orisons orison + ork ork orlando orlando + orld orld orleans orlean + ornament ornament ornaments ornament + orodes orod orphan orphan + orphans orphan orpheus orpheu + orsino orsino ort ort + orthography orthographi orts ort + oscorbidulchos oscorbidulcho osier osier + osiers osier osprey osprei + osr osr osric osric + ossa ossa ost ost + ostent ostent ostentare ostentar + ostentation ostent ostents ostent + ostler ostler ostlers ostler + ostrich ostrich osw osw + oswald oswald othello othello + other other othergates otherg + others other otherwhere otherwher + otherwhiles otherwhil otherwise otherwis + otter otter ottoman ottoman + ottomites ottomit oublie oubli + ouches ouch ought ought + oui oui ounce ounc + ounces ounc ouphes ouph + our our ours our + ourself ourself ourselves ourselv + ousel ousel out out + outbids outbid outbrave outbrav + outbraves outbrav outbreak outbreak + outcast outcast outcries outcri + outcry outcri outdar outdar + outdare outdar outdares outdar + outdone outdon outfac outfac + outface outfac outfaced outfac + outfacing outfac outfly outfli + outfrown outfrown outgo outgo + outgoes outgo outgrown outgrown + outjest outjest outlaw outlaw + outlawry outlawri outlaws outlaw + outliv outliv outlive outliv + outlives outliv outliving outliv + outlook outlook outlustres outlustr + outpriz outpriz outrage outrag + outrageous outrag outrages outrag + outran outran outright outright + outroar outroar outrun outrun + outrunning outrun outruns outrun + outscold outscold outscorn outscorn + outsell outsel outsells outsel + outside outsid outsides outsid + outspeaks outspeak outsport outsport + outstare outstar outstay outstai + outstood outstood outstretch outstretch + outstretched outstretch outstrike outstrik + outstrip outstrip outstripped outstrip + outswear outswear outvenoms outvenom + outward outward outwardly outwardli + outwards outward outwear outwear + outweighs outweigh outwent outwent + outworn outworn outworths outworth + oven oven over over + overawe overaw overbear overbear + overblown overblown overboard overboard + overbold overbold overborne overborn + overbulk overbulk overbuys overbui + overcame overcam overcast overcast + overcharg overcharg overcharged overcharg + overcome overcom overcomes overcom + overdone overdon overearnest overearnest + overfar overfar overflow overflow + overflown overflown overglance overgl + overgo overgo overgone overgon + overgorg overgorg overgrown overgrown + overhead overhead overhear overhear + overheard overheard overhold overhold + overjoyed overjoi overkind overkind + overland overland overleather overleath + overlive overl overlook overlook + overlooking overlook overlooks overlook + overmaster overmast overmounting overmount + overmuch overmuch overpass overpass + overpeer overp overpeering overp + overplus overplu overrul overrul + overrun overrun overscutch overscutch + overset overset overshades overshad + overshine overshin overshines overshin + overshot overshot oversights oversight + overspread overspread overstain overstain + overswear overswear overt overt + overta overta overtake overtak + overtaketh overtaketh overthrow overthrow + overthrown overthrown overthrows overthrow + overtook overtook overtopp overtopp + overture overtur overturn overturn + overwatch overwatch overween overween + overweening overween overweigh overweigh + overwhelm overwhelm overwhelming overwhelm + overworn overworn ovid ovid + ovidius ovidiu ow ow + owe ow owed ow + owedst owedst owen owen + owes ow owest owest + oweth oweth owing ow + owl owl owls owl + own own owner owner + owners owner owning own + owns own owy owi + ox ox oxen oxen + oxford oxford oxfordshire oxfordshir + oxlips oxlip oyes oy + oyster oyster p p + pabble pabbl pabylon pabylon + pac pac pace pace + paced pace paces pace + pacified pacifi pacify pacifi + pacing pace pack pack + packet packet packets packet + packhorses packhors packing pack + packings pack packs pack + packthread packthread pacorus pacoru + paction paction pad pad + paddle paddl paddling paddl + paddock paddock padua padua + pagan pagan pagans pagan + page page pageant pageant + pageants pageant pages page + pah pah paid paid + pail pail pailfuls pail + pails pail pain pain + pained pain painful pain + painfully painfulli pains pain + paint paint painted paint + painter painter painting paint + paintings paint paints paint + pair pair paired pair + pairs pair pajock pajock + pal pal palabras palabra + palace palac palaces palac + palamedes palamed palate palat + palates palat palatine palatin + palating palat pale pale + paled pale paleness pale + paler paler pales pale + palestine palestin palfrey palfrei + palfreys palfrei palisadoes palisado + pall pall pallabris pallabri + pallas palla pallets pallet + palm palm palmer palmer + palmers palmer palms palm + palmy palmi palpable palpabl + palsied palsi palsies palsi + palsy palsi palt palt + palter palter paltry paltri + paly pali pamp pamp + pamper pamper pamphlets pamphlet + pan pan pancackes pancack + pancake pancak pancakes pancak + pandar pandar pandars pandar + pandarus pandaru pander pander + panderly panderli panders pander + pandulph pandulph panel panel + pang pang panging pang + pangs pang pannier pannier + pannonians pannonian pansa pansa + pansies pansi pant pant + pantaloon pantaloon panted pant + pantheon pantheon panther panther + panthino panthino panting pant + pantingly pantingli pantler pantler + pantry pantri pants pant + pap pap papal papal + paper paper papers paper + paphlagonia paphlagonia paphos papho + papist papist paps pap + par par parable parabl + paracelsus paracelsu paradise paradis + paradox paradox paradoxes paradox + paragon paragon paragons paragon + parallel parallel parallels parallel + paramour paramour paramours paramour + parapets parapet paraquito paraquito + parasite parasit parasites parasit + parca parca parcel parcel + parcell parcel parcels parcel + parch parch parched parch + parching parch parchment parchment + pard pard pardon pardon + pardona pardona pardoned pardon + pardoner pardon pardoning pardon + pardonne pardonn pardonner pardonn + pardonnez pardonnez pardons pardon + pare pare pared pare + parel parel parent parent + parentage parentag parents parent + parfect parfect paring pare + parings pare paris pari + parish parish parishioners parishion + parisians parisian paritors paritor + park park parks park + parle parl parler parler + parles parl parley parlei + parlez parlez parliament parliament + parlors parlor parlour parlour + parlous parlou parmacity parmac + parolles parol parricide parricid + parricides parricid parrot parrot + parrots parrot parsley parslei + parson parson part part + partake partak partaken partaken + partaker partak partakers partak + parted part parthia parthia + parthian parthian parthians parthian + parti parti partial partial + partialize partial partially partial + participate particip participation particip + particle particl particular particular + particularities particular particularize particular + particularly particularli particulars particular + parties parti parting part + partisan partisan partisans partisan + partition partit partizan partizan + partlet partlet partly partli + partner partner partners partner + partridge partridg parts part + party parti pas pa + pash pash pashed pash + pashful pash pass pass + passable passabl passado passado + passage passag passages passag + passant passant passed pass + passenger passeng passengers passeng + passes pass passeth passeth + passing pass passio passio + passion passion passionate passion + passioning passion passions passion + passive passiv passport passport + passy passi past past + paste past pasterns pastern + pasties pasti pastime pastim + pastimes pastim pastoral pastor + pastorals pastor pastors pastor + pastry pastri pasture pastur + pastures pastur pasty pasti + pat pat patay patai + patch patch patchery patcheri + patches patch pate pate + pated pate patent patent + patents patent paternal patern + pates pate path path + pathetical pathet paths path + pathway pathwai pathways pathwai + patience patienc patient patient + patiently patient patients patient + patines patin patrician patrician + patricians patrician patrick patrick + patrimony patrimoni patroclus patroclu + patron patron patronage patronag + patroness patro patrons patron + patrum patrum patter patter + pattern pattern patterns pattern + pattle pattl pauca pauca + paucas pauca paul paul + paulina paulina paunch paunch + paunches paunch pause paus + pauser pauser pauses paus + pausingly pausingli pauvres pauvr + pav pav paved pave + pavement pavement pavilion pavilion + pavilions pavilion pavin pavin + paw paw pawn pawn + pawns pawn paws paw + pax pax pay pai + payest payest paying pai + payment payment payments payment + pays pai paysan paysan + paysans paysan pe pe + peace peac peaceable peaceabl + peaceably peaceabl peaceful peac + peacemakers peacemak peaces peac + peach peach peaches peach + peacock peacock peacocks peacock + peak peak peaking peak + peal peal peals peal + pear pear peard peard + pearl pearl pearls pearl + pears pear peas pea + peasant peasant peasantry peasantri + peasants peasant peascod peascod + pease peas peaseblossom peaseblossom + peat peat peaten peaten + peating peat pebble pebbl + pebbled pebbl pebbles pebbl + peck peck pecks peck + peculiar peculiar pecus pecu + pedant pedant pedantical pedant + pedascule pedascul pede pede + pedestal pedest pedigree pedigre + pedlar pedlar pedlars pedlar + pedro pedro peds ped + peel peel peep peep + peeped peep peeping peep + peeps peep peer peer + peereth peereth peering peer + peerless peerless peers peer + peesel peesel peevish peevish + peevishly peevishli peflur peflur + peg peg pegasus pegasu + pegs peg peise peis + peised peis peize peiz + pelf pelf pelican pelican + pelion pelion pell pell + pella pella pelleted pellet + peloponnesus peloponnesu pelt pelt + pelting pelt pembroke pembrok + pen pen penalties penalti + penalty penalti penance penanc + pence penc pencil pencil + pencill pencil pencils pencil + pendant pendant pendent pendent + pendragon pendragon pendulous pendul + penelope penelop penetrable penetr + penetrate penetr penetrative penetr + penitence penit penitent penit + penitential penitenti penitently penit + penitents penit penker penker + penknife penknif penn penn + penned pen penning pen + pennons pennon penny penni + pennyworth pennyworth pennyworths pennyworth + pens pen pense pens + pension pension pensioners pension + pensive pensiv pensived pensiv + pensively pensiv pent pent + pentecost pentecost penthesilea penthesilea + penthouse penthous penurious penuri + penury penuri peopl peopl + people peopl peopled peopl + peoples peopl pepin pepin + pepper pepper peppercorn peppercorn + peppered pepper per per + peradventure peradventur peradventures peradventur + perceiv perceiv perceive perceiv + perceived perceiv perceives perceiv + perceiveth perceiveth perch perch + perchance perchanc percies perci + percussion percuss percy perci + perdie perdi perdita perdita + perdition perdit perdonato perdonato + perdu perdu perdurable perdur + perdurably perdur perdy perdi + pere pere peregrinate peregrin + peremptorily peremptorili peremptory peremptori + perfect perfect perfected perfect + perfecter perfect perfectest perfectest + perfection perfect perfections perfect + perfectly perfectli perfectness perfect + perfidious perfidi perfidiously perfidi + perforce perforc perform perform + performance perform performances perform + performed perform performer perform + performers perform performing perform + performs perform perfum perfum + perfume perfum perfumed perfum + perfumer perfum perfumes perfum + perge perg perhaps perhap + periapts periapt perigort perigort + perigouna perigouna peril peril + perilous peril perils peril + period period periods period + perish perish perished perish + perishest perishest perisheth perisheth + perishing perish periwig periwig + perjur perjur perjure perjur + perjured perjur perjuries perjuri + perjury perjuri perk perk + perkes perk permafoy permafoi + permanent perman permission permiss + permissive permiss permit permit + permitted permit pernicious pernici + perniciously pernici peroration peror + perpend perpend perpendicular perpendicular + perpendicularly perpendicularli perpetual perpetu + perpetually perpetu perpetuity perpetu + perplex perplex perplexed perplex + perplexity perplex pers per + persecuted persecut persecutions persecut + persecutor persecutor perseus perseu + persever persev perseverance persever + persevers persev persia persia + persian persian persist persist + persisted persist persistency persist + persistive persist persists persist + person person personae persona + personage personag personages personag + personal person personally person + personate person personated person + personates person personating person + persons person perspective perspect + perspectively perspect perspectives perspect + perspicuous perspicu persuade persuad + persuaded persuad persuades persuad + persuading persuad persuasion persuas + persuasions persuas pert pert + pertain pertain pertaining pertain + pertains pertain pertaunt pertaunt + pertinent pertin pertly pertli + perturb perturb perturbation perturb + perturbations perturb perturbed perturb + perus peru perusal perus + peruse perus perused perus + perusing perus perverse pervers + perversely pervers perverseness pervers + pervert pervert perverted pervert + peseech peseech pest pest + pester pester pestiferous pestifer + pestilence pestil pestilent pestil + pet pet petar petar + peter peter petit petit + petition petit petitionary petitionari + petitioner petition petitioners petition + petitions petit peto peto + petrarch petrarch petruchio petruchio + petter petter petticoat petticoat + petticoats petticoat pettiness petti + pettish pettish pettitoes pettito + petty petti peu peu + pew pew pewter pewter + pewterer pewter phaethon phaethon + phaeton phaeton phantasime phantasim + phantasimes phantasim phantasma phantasma + pharamond pharamond pharaoh pharaoh + pharsalia pharsalia pheasant pheasant + pheazar pheazar phebe phebe + phebes phebe pheebus pheebu + pheeze pheez phibbus phibbu + philadelphos philadelpho philario philario + philarmonus philarmonu philemon philemon + philip philip philippan philippan + philippe philipp philippi philippi + phillida phillida philo philo + philomel philomel philomela philomela + philosopher philosoph philosophers philosoph + philosophical philosoph philosophy philosophi + philostrate philostr philotus philotu + phlegmatic phlegmat phoebe phoeb + phoebus phoebu phoenicia phoenicia + phoenicians phoenician phoenix phoenix + phorbus phorbu photinus photinu + phrase phrase phraseless phraseless + phrases phrase phrygia phrygia + phrygian phrygian phrynia phrynia + physic physic physical physic + physician physician physicians physician + physics physic pia pia + pibble pibbl pible pibl + picardy picardi pick pick + pickaxe pickax pickaxes pickax + pickbone pickbon picked pick + pickers picker picking pick + pickle pickl picklock picklock + pickpurse pickpurs picks pick + pickt pickt pickthanks pickthank + pictur pictur picture pictur + pictured pictur pictures pictur + pid pid pie pie + piec piec piece piec + pieces piec piecing piec + pied pi piedness pied + pier pier pierc pierc + pierce pierc pierced pierc + pierces pierc pierceth pierceth + piercing pierc piercy pierci + piers pier pies pi + piety pieti pig pig + pigeon pigeon pigeons pigeon + pight pight pigmy pigmi + pigrogromitus pigrogromitu pike pike + pikes pike pil pil + pilate pilat pilates pilat + pilchers pilcher pile pile + piles pile pilf pilf + pilfering pilfer pilgrim pilgrim + pilgrimage pilgrimag pilgrims pilgrim + pill pill pillage pillag + pillagers pillag pillar pillar + pillars pillar pillicock pillicock + pillory pillori pillow pillow + pillows pillow pills pill + pilot pilot pilots pilot + pimpernell pimpernel pin pin + pinch pinch pinched pinch + pinches pinch pinching pinch + pindarus pindaru pine pine + pined pine pines pine + pinfold pinfold pining pine + pinion pinion pink pink + pinn pinn pinnace pinnac + pins pin pinse pins + pint pint pintpot pintpot + pioned pion pioneers pioneer + pioner pioner pioners pioner + pious piou pip pip + pipe pipe piper piper + pipers piper pipes pipe + piping pipe pippin pippin + pippins pippin pirate pirat + pirates pirat pisa pisa + pisanio pisanio pish pish + pismires pismir piss piss + pissing piss pistol pistol + pistols pistol pit pit + pitch pitch pitched pitch + pitcher pitcher pitchers pitcher + pitchy pitchi piteous piteou + piteously piteous pitfall pitfal + pith pith pithless pithless + pithy pithi pitie piti + pitied piti pities piti + pitiful piti pitifully pitifulli + pitiless pitiless pits pit + pittance pittanc pittie pitti + pittikins pittikin pity piti + pitying piti pius piu + plac plac place place + placed place placentio placentio + places place placeth placeth + placid placid placing place + plack plack placket placket + plackets placket plagu plagu + plague plagu plagued plagu + plagues plagu plaguing plagu + plaguy plagui plain plain + plainer plainer plainest plainest + plaining plain plainings plain + plainly plainli plainness plain + plains plain plainsong plainsong + plaintful plaint plaintiff plaintiff + plaintiffs plaintiff plaints plaint + planched planch planet planet + planetary planetari planets planet + planks plank plant plant + plantage plantag plantagenet plantagenet + plantagenets plantagenet plantain plantain + plantation plantat planted plant + planteth planteth plants plant + plash plash plashy plashi + plast plast plaster plaster + plasterer plaster plat plat + plate plate plated plate + plates plate platform platform + platforms platform plats plat + platted plat plausible plausibl + plausive plausiv plautus plautu + play plai played plai + player player players player + playeth playeth playfellow playfellow + playfellows playfellow playhouse playhous + playing plai plays plai + plea plea pleach pleach + pleached pleach plead plead + pleaded plead pleader pleader + pleaders pleader pleading plead + pleads plead pleas plea + pleasance pleasanc pleasant pleasant + pleasantly pleasantli please pleas + pleased pleas pleaser pleaser + pleasers pleaser pleases pleas + pleasest pleasest pleaseth pleaseth + pleasing pleas pleasure pleasur + pleasures pleasur plebeians plebeian + plebeii plebeii plebs pleb + pledge pledg pledges pledg + pleines plein plenitude plenitud + plenteous plenteou plenteously plenteous + plenties plenti plentiful plenti + plentifully plentifulli plenty plenti + pless pless plessed pless + plessing pless pliant pliant + plied pli plies pli + plight plight plighted plight + plighter plighter plod plod + plodded plod plodders plodder + plodding plod plods plod + plood plood ploody ploodi + plot plot plots plot + plotted plot plotter plotter + plough plough ploughed plough + ploughman ploughman ploughmen ploughmen + plow plow plows plow + pluck pluck plucked pluck + plucker plucker plucking pluck + plucks pluck plue plue + plum plum plume plume + plumed plume plumes plume + plummet plummet plump plump + plumpy plumpi plums plum + plung plung plunge plung + plunged plung plural plural + plurisy plurisi plus plu + pluto pluto plutus plutu + ply ply po po + pocket pocket pocketing pocket + pockets pocket pocky pocki + pody podi poem poem + poesy poesi poet poet + poetical poetic poetry poetri + poets poet poictiers poictier + poinards poinard poins poin + point point pointblank pointblank + pointed point pointing point + points point pois poi + poise pois poising pois + poison poison poisoned poison + poisoner poison poisoning poison + poisonous poison poisons poison + poke poke poking poke + pol pol polack polack + polacks polack poland poland + pold pold pole pole + poleaxe poleax polecat polecat + polecats polecat polemon polemon + poles pole poli poli + policies polici policy polici + polish polish polished polish + politic polit politician politician + politicians politician politicly politicli + polixenes polixen poll poll + polluted pollut pollution pollut + polonius poloniu poltroons poltroon + polusion polus polydamus polydamu + polydore polydor polyxena polyxena + pomander pomand pomegranate pomegran + pomewater pomewat pomfret pomfret + pomgarnet pomgarnet pommel pommel + pomp pomp pompeius pompeiu + pompey pompei pompion pompion + pompous pompou pomps pomp + pond pond ponder ponder + ponderous ponder ponds pond + poniard poniard poniards poniard + pont pont pontic pontic + pontifical pontif ponton ponton + pooh pooh pool pool + poole pool poop poop + poor poor poorer poorer + poorest poorest poorly poorli + pop pop pope pope + popedom popedom popilius popiliu + popingay popingai popish popish + popp popp poppy poppi + pops pop popular popular + popularity popular populous popul + porch porch porches porch + pore pore poring pore + pork pork porn porn + porpentine porpentin porridge porridg + porringer porring port port + portable portabl portage portag + portal portal portance portanc + portcullis portculli portend portend + portends portend portent portent + portentous portent portents portent + porter porter porters porter + portia portia portion portion portly portli portotartarossa portotartarossa - portrait portrait portraiture portraitur - ports port portugal portug - pose pose posied posi - posies posi position posit - positive posit positively posit - posse poss possess possess - possessed possess possesses possess - possesseth possesseth possessing possess - possession possess possessions possess - possessor possessor posset posset - possets posset possibilities possibl - possibility possibl possible possibl - possibly possibl possitable possit - post post poste post - posted post posterior posterior - posteriors posterior posterity poster - postern postern posterns postern - posters poster posthorse posthors - posthorses posthors posthumus posthumu - posting post postmaster postmast - posts post postscript postscript - posture postur postures postur - posy posi pot pot - potable potabl potations potat - potato potato potatoes potato - potch potch potency potenc - potent potent potentates potent - potential potenti potently potent - potents potent pothecary pothecari - pother pother potion potion - potions potion potpan potpan - pots pot potter potter - potting pot pottle pottl - pouch pouch poulter poulter - poultice poultic poultney poultnei - pouncet pouncet pound pound - pounds pound pour pour - pourest pourest pouring pour - pourquoi pourquoi pours pour - pout pout poverty poverti - pow pow powd powd - powder powder power power - powerful power powerfully powerfulli - powerless powerless powers power - pox pox poys poi - poysam poysam prabbles prabbl - practic practic practice practic - practiced practic practicer practic - practices practic practicing practic - practis practi practisants practis - practise practis practiser practis - practisers practis practises practis - practising practis praeclarissimus praeclarissimu - praemunire praemunir praetor praetor - praetors praetor pragging prag - prague pragu prain prain - prains prain prais prai - praise prais praised prais - praises prais praisest praisest - praiseworthy praiseworthi praising prais - prancing pranc prank prank - pranks prank prat prat - prate prate prated prate - prater prater prating prate - prattle prattl prattler prattler - prattling prattl prave prave - prawls prawl prawns prawn - pray prai prayer prayer - prayers prayer praying prai - prays prai pre pre - preach preach preached preach - preachers preacher preaches preach - preaching preach preachment preachment - pread pread preambulate preambul - precedence preced precedent preced - preceding preced precept precept - preceptial precepti precepts precept - precinct precinct precious preciou - preciously precious precipice precipic - precipitating precipit precipitation precipit - precise precis precisely precis - preciseness precis precisian precisian - precor precor precurse precurs - precursors precursor predeceased predeceas - predecessor predecessor predecessors predecessor - predestinate predestin predicament predica - predict predict prediction predict - predictions predict predominance predomin - predominant predomin predominate predomin - preeches preech preeminence preemin - preface prefac prefer prefer - preferment prefer preferments prefer - preferr preferr preferreth preferreth - preferring prefer prefers prefer - prefiguring prefigur prefix prefix - prefixed prefix preformed preform - pregnancy pregnanc pregnant pregnant - pregnantly pregnantli prejudicates prejud - prejudice prejudic prejudicial prejudici - prelate prelat premeditated premedit - premeditation premedit premised premis - premises premis prenez prenez - prenominate prenomin prentice prentic - prentices prentic preordinance preordin - prepar prepar preparation prepar - preparations prepar prepare prepar - prepared prepar preparedly preparedli - prepares prepar preparing prepar - prepost prepost preposterous preposter - preposterously preposter prerogatifes prerogatif - prerogative prerog prerogatived prerogativ - presage presag presagers presag - presages presag presageth presageth - presaging presag prescience prescienc - prescribe prescrib prescript prescript - prescription prescript prescriptions prescript - prescripts prescript presence presenc - presences presenc present present - presentation present presented present - presenter present presenters present - presenteth presenteth presenting present - presently present presentment present - presents present preserv preserv - preservation preserv preservative preserv - preserve preserv preserved preserv - preserver preserv preservers preserv - preserving preserv president presid - press press pressed press - presser presser presses press - pressing press pressure pressur - pressures pressur prest prest - prester prester presume presum - presumes presum presuming presum - presumption presumpt presumptuous presumptu - presuppos presuppo pret pret - pretence pretenc pretences pretenc - pretend pretend pretended pretend - pretending pretend pretense pretens - pretext pretext pretia pretia - prettier prettier prettiest prettiest - prettily prettili prettiness pretti - pretty pretti prevail prevail - prevailed prevail prevaileth prevaileth - prevailing prevail prevailment prevail - prevails prevail prevent prevent - prevented prevent prevention prevent - preventions prevent prevents prevent - prey prei preyful prey - preys prei priam priam - priami priami priamus priamu - pribbles pribbl price price - prick prick pricked prick - pricket pricket pricking prick - pricks prick pricksong pricksong - pride pride prides pride - pridge pridg prie prie - pried pri prief prief - pries pri priest priest - priesthood priesthood priests priest - prig prig primal primal - prime prime primer primer - primero primero primest primest - primitive primit primo primo - primogenity primogen primrose primros - primroses primros primy primi - prince princ princely princ - princes princ princess princess - principal princip principalities princip - principality princip principle principl - principles principl princox princox - prings pring print print - printed print printing print - printless printless prints print - prioress prioress priories priori - priority prioriti priory priori - priscian priscian prison prison - prisoner prison prisoners prison - prisonment prison prisonnier prisonni - prisons prison pristine pristin - prithe prith prithee prithe - privacy privaci private privat - privately privat privates privat - privilage privilag privileg privileg - privilege privileg privileged privileg - privileges privileg privilegio privilegio - privily privili privity priviti - privy privi priz priz - prize prize prized prize - prizer prizer prizes prize - prizest prizest prizing prize - pro pro probable probabl - probal probal probation probat - proceed proce proceeded proceed - proceeders proceed proceeding proceed - proceedings proceed proceeds proce - process process procession process - proclaim proclaim proclaimed proclaim - proclaimeth proclaimeth proclaims proclaim - proclamation proclam proclamations proclam - proconsul proconsul procrastinate procrastin - procreant procreant procreants procreant - procreation procreat procrus procru - proculeius proculeiu procur procur - procurator procur procure procur - procured procur procures procur - procuring procur prodigal prodig - prodigality prodig prodigally prodig - prodigals prodig prodigies prodigi - prodigious prodigi prodigiously prodigi - prodigy prodigi proditor proditor - produc produc produce produc - produced produc produces produc - producing produc proface profac - profan profan profanation profan - profane profan profaned profan - profanely profan profaneness profan - profaners profan profaning profan - profess profess professed profess - professes profess profession profess - professions profess professors professor - proffer proffer proffered proffer - profferer proffer proffers proffer - proficient profici profit profit - profitable profit profitably profit - profited profit profiting profit - profitless profitless profits profit - profound profound profoundest profoundest - profoundly profoundli progenitors progenitor - progeny progeni progne progn - prognosticate prognost prognostication prognost - progress progress progression progress - prohibit prohibit prohibition prohibit - project project projection project - projects project prolixious prolixi - prolixity prolix prologue prologu - prologues prologu prolong prolong - prolongs prolong promethean promethean - prometheus prometheu promis promi - promise promis promised promis - promises promis promiseth promiseth - promising promis promontory promontori - promotion promot promotions promot - prompt prompt prompted prompt - promptement promptement prompter prompter - prompting prompt prompts prompt - prompture promptur promulgate promulg - prone prone prononcer prononc - prononcez prononcez pronoun pronoun - pronounc pronounc pronounce pronounc - pronounced pronounc pronouncing pronounc - pronouns pronoun proof proof - proofs proof prop prop - propagate propag propagation propag - propend propend propension propens - proper proper properer proper - properly properli propertied properti - properties properti property properti - prophecies propheci prophecy propheci - prophesied prophesi prophesier prophesi - prophesy prophesi prophesying prophesi - prophet prophet prophetess prophetess - prophetic prophet prophetically prophet - prophets prophet propinquity propinqu - propontic propont proportion proport - proportionable proportion proportions proport - propos propo propose propos - proposed propos proposer propos - proposes propos proposing propos - proposition proposit propositions proposit - propounded propound propp propp - propre propr propriety proprieti - props prop propugnation propugn - prorogue prorogu prorogued prorogu - proscription proscript proscriptions proscript - prose prose prosecute prosecut - prosecution prosecut proselytes proselyt - proserpina proserpina prosp prosp - prospect prospect prosper prosper - prosperity prosper prospero prospero - prosperous prosper prosperously prosper - prospers prosper prostitute prostitut - prostrate prostrat protect protect - protected protect protection protect - protector protector protectors protector - protectorship protectorship protectress protectress - protects protect protest protest - protestation protest protestations protest - protested protest protester protest - protesting protest protests protest - proteus proteu protheus protheu - protract protract protractive protract - proud proud prouder prouder - proudest proudest proudlier proudlier - proudly proudli prouds proud - prov prov provand provand - prove prove proved prove - provender provend proverb proverb - proverbs proverb proves prove - proveth proveth provide provid - provided provid providence provid - provident provid providently provid - provider provid provides provid - province provinc provinces provinc - provincial provinci proving prove - provision provis proviso proviso - provocation provoc provok provok - provoke provok provoked provok - provoker provok provokes provok - provoketh provoketh provoking provok - provost provost prowess prowess - prudence prudenc prudent prudent - prun prun prune prune - prunes prune pruning prune - pry pry prying pry - psalm psalm psalmist psalmist - psalms psalm psalteries psalteri - ptolemies ptolemi ptolemy ptolemi - public public publican publican - publication public publicly publicli - publicola publicola publish publish - published publish publisher publish - publishing publish publius publiu - pucelle pucel puck puck - pudder pudder pudding pud - puddings pud puddle puddl - puddled puddl pudency pudenc - pueritia pueritia puff puff - puffing puf puffs puff - pugging pug puis pui - puissance puissanc puissant puissant - puke puke puking puke - pulcher pulcher puling pule - pull pull puller puller - pullet pullet pulling pull - pulls pull pulpit pulpit - pulpiter pulpit pulpits pulpit - pulse puls pulsidge pulsidg - pump pump pumpion pumpion - pumps pump pun pun - punched punch punish punish - punished punish punishes punish - punishment punish punishments punish - punk punk punto punto - puny puni pupil pupil - pupils pupil puppet puppet - puppets puppet puppies puppi - puppy puppi pur pur - purblind purblind purchas purcha - purchase purchas purchased purchas - purchases purchas purchaseth purchaseth - purchasing purchas pure pure - purely pure purer purer - purest purest purg purg - purgation purgat purgative purg - purgatory purgatori purge purg - purged purg purgers purger - purging purg purifies purifi - purifying purifi puritan puritan - purity puriti purlieus purlieu - purple purpl purpled purpl - purples purpl purport purport - purpos purpo purpose purpos - purposed purpos purposely purpos - purposes purpos purposeth purposeth - purposing purpos purr purr - purs pur purse purs - pursents pursent purses purs - pursu pursu pursue pursu - pursued pursu pursuers pursuer - pursues pursu pursuest pursuest - pursueth pursueth pursuing pursu - pursuit pursuit pursuivant pursuiv - pursuivants pursuiv pursy pursi - purus puru purveyor purveyor - push push pushes push - pusillanimity pusillanim put put - putrefy putrefi putrified putrifi - puts put putter putter - putting put puttock puttock - puzzel puzzel puzzle puzzl - puzzled puzzl puzzles puzzl - py py pygmalion pygmalion - pygmies pygmi pygmy pygmi - pyramid pyramid pyramides pyramid - pyramids pyramid pyramis pyrami - pyramises pyramis pyramus pyramu - pyrenean pyrenean pyrrhus pyrrhu - pythagoras pythagora qu qu - quadrangle quadrangl quae quae - quaff quaff quaffing quaf - quagmire quagmir quail quail - quailing quail quails quail - quaint quaint quaintly quaintli - quak quak quake quak - quakes quak qualification qualif - qualified qualifi qualifies qualifi - qualify qualifi qualifying qualifi - qualite qualit qualities qualiti - quality qualiti qualm qualm - qualmish qualmish quam quam - quand quand quando quando - quantities quantiti quantity quantiti - quare quar quarrel quarrel - quarrell quarrel quarreller quarrel - quarrelling quarrel quarrelous quarrel - quarrels quarrel quarrelsome quarrelsom - quarries quarri quarry quarri - quart quart quarter quarter - quartered quarter quartering quarter - quarters quarter quarts quart - quasi quasi quat quat - quatch quatch quay quai - que que quean quean - queas quea queasiness queasi - queasy queasi queen queen - queens queen quell quell - queller queller quench quench - quenched quench quenching quench - quenchless quenchless quern quern - quest quest questant questant - question question questionable question - questioned question questioning question - questionless questionless questions question - questrists questrist quests quest - queubus queubu qui qui - quick quick quicken quicken - quickens quicken quicker quicker - quicklier quicklier quickly quickli - quickness quick quicksand quicksand - quicksands quicksand quicksilverr quicksilverr - quid quid quiddities quidditi - quiddits quiddit quier quier - quiet quiet quieter quieter - quietly quietli quietness quiet - quietus quietu quill quill - quillets quillet quills quill - quilt quilt quinapalus quinapalu - quince quinc quinces quinc - quintain quintain quintessence quintess - quintus quintu quip quip - quips quip quire quir - quiring quir quirk quirk - quirks quirk quis qui - quit quit quite quit - quits quit quittance quittanc - quitted quit quitting quit - quiver quiver quivering quiver - quivers quiver quo quo - quod quod quoifs quoif - quoint quoint quoit quoit - quoits quoit quondam quondam - quoniam quoniam quote quot - quoted quot quotes quot - quoth quoth quotidian quotidian - r r rabbit rabbit - rabble rabbl rabblement rabblement - race race rack rack - rackers racker racket racket - rackets racket racking rack - racks rack radiance radianc - radiant radiant radish radish - rafe rafe raft raft - rag rag rage rage - rages rage rageth rageth - ragg ragg ragged rag - raggedness ragged raging rage - ragozine ragozin rags rag - rah rah rail rail - railed rail railer railer - railest railest raileth raileth - railing rail rails rail - raiment raiment rain rain - rainbow rainbow raineth raineth - raining rain rainold rainold - rains rain rainy raini - rais rai raise rais - raised rais raises rais - raising rais raisins raisin - rak rak rake rake - rakers raker rakes rake - ral ral rald rald - ralph ralph ram ram - rambures rambur ramm ramm - rampallian rampallian rampant rampant - ramping ramp rampir rampir - ramps ramp rams ram - ramsey ramsei ramston ramston - ran ran rance ranc - rancorous rancor rancors rancor - rancour rancour random random - rang rang range rang - ranged rang rangers ranger - ranges rang ranging rang - rank rank ranker ranker - rankest rankest ranking rank - rankle rankl rankly rankli - rankness rank ranks rank - ransack ransack ransacking ransack - ransom ransom ransomed ransom - ransoming ransom ransomless ransomless - ransoms ransom rant rant - ranting rant rap rap - rape rape rapes rape - rapier rapier rapiers rapier - rapine rapin raps rap - rapt rapt rapture raptur - raptures raptur rar rar - rare rare rarely rare - rareness rare rarer rarer - rarest rarest rarities rariti - rarity rariti rascal rascal - rascalliest rascalliest rascally rascal - rascals rascal rased rase - rash rash rasher rasher - rashly rashli rashness rash - rat rat ratcatcher ratcatch - ratcliff ratcliff rate rate - rated rate rately rate - rates rate rather rather - ratherest ratherest ratified ratifi - ratifiers ratifi ratify ratifi - rating rate rational ration - ratolorum ratolorum rats rat - ratsbane ratsban rattle rattl - rattles rattl rattling rattl - rature ratur raught raught - rav rav rave rave - ravel ravel raven raven - ravening raven ravenous raven - ravens raven ravenspurgh ravenspurgh - raves rave ravin ravin - raving rave ravish ravish - ravished ravish ravisher ravish - ravishing ravish ravishments ravish - raw raw rawer rawer - rawly rawli rawness raw - ray rai rayed rai - rays rai raz raz - raze raze razed raze - razes raze razeth razeth - razing raze razor razor - razorable razor razors razor - razure razur re re - reach reach reaches reach - reacheth reacheth reaching reach - read read reader reader - readiest readiest readily readili - readiness readi reading read - readins readin reads read - ready readi real real - really realli realm realm - realms realm reap reap - reapers reaper reaping reap - reaps reap rear rear - rears rear rearward rearward - reason reason reasonable reason - reasonably reason reasoned reason - reasoning reason reasonless reasonless - reasons reason reave reav - rebate rebat rebato rebato - rebeck rebeck rebel rebel - rebell rebel rebelling rebel - rebellion rebellion rebellious rebelli - rebels rebel rebound rebound - rebuk rebuk rebuke rebuk - rebukeable rebuk rebuked rebuk - rebukes rebuk rebus rebu - recall recal recant recant - recantation recant recanter recant - recanting recant receipt receipt - receipts receipt receiv receiv - receive receiv received receiv - receiver receiv receives receiv - receivest receivest receiveth receiveth - receiving receiv receptacle receptacl - rechate rechat reciprocal reciproc - reciprocally reciproc recite recit - recited recit reciterai reciterai - reck reck recking reck - reckless reckless reckon reckon - reckoned reckon reckoning reckon - reckonings reckon recks reck - reclaim reclaim reclaims reclaim - reclusive reclus recognizance recogniz - recognizances recogniz recoil recoil - recoiling recoil recollected recollect - recomforted recomfort recomforture recomfortur - recommend recommend recommended recommend - recommends recommend recompens recompen - recompense recompens reconcil reconcil - reconcile reconcil reconciled reconcil - reconcilement reconcil reconciler reconcil - reconciles reconcil reconciliation reconcili - record record recordation record - recorded record recorder record - recorders record records record - recount recount recounted recount - recounting recount recountments recount - recounts recount recourse recours - recov recov recover recov - recoverable recover recovered recov - recoveries recoveri recovers recov - recovery recoveri recreant recreant - recreants recreant recreate recreat - recreation recreat rectify rectifi - rector rector rectorship rectorship - recure recur recured recur - red red redbreast redbreast - redder redder reddest reddest - rede rede redeem redeem - redeemed redeem redeemer redeem - redeeming redeem redeems redeem - redeliver redeliv redemption redempt - redime redim redness red - redoubled redoubl redoubted redoubt - redound redound redress redress - redressed redress redresses redress - reduce reduc reechy reechi - reed reed reeds reed - reek reek reeking reek - reeks reek reeky reeki - reel reel reeleth reeleth - reeling reel reels reel - refell refel refer refer - reference refer referr referr - referred refer refigured refigur - refin refin refined refin - reflect reflect reflecting reflect - reflection reflect reflex reflex - reform reform reformation reform - reformed reform refractory refractori - refrain refrain refresh refresh - refreshing refresh reft reft - refts reft refuge refug - refus refu refusal refus - refuse refus refused refus - refusest refusest refusing refus - reg reg regal regal - regalia regalia regan regan - regard regard regardance regard - regarded regard regardfully regardfulli - regarding regard regards regard - regenerate regener regent regent - regentship regentship regia regia - regiment regiment regiments regiment - regina regina region region - regions region regist regist - register regist registers regist - regreet regreet regreets regreet - regress regress reguerdon reguerdon - regular regular rehears rehear - rehearsal rehears rehearse rehears - reign reign reigned reign - reignier reignier reigning reign - reigns reign rein rein - reinforc reinforc reinforce reinforc - reinforcement reinforc reins rein - reiterate reiter reject reject - rejected reject rejoic rejoic - rejoice rejoic rejoices rejoic - rejoiceth rejoiceth rejoicing rejoic - rejoicingly rejoicingli rejoindure rejoindur - rejourn rejourn rel rel - relapse relaps relate relat - relates relat relation relat - relations relat relative rel - releas relea release releas - released releas releasing releas - relent relent relenting relent - relents relent reliances relianc - relics relic relief relief - reliev reliev relieve reliev - relieved reliev relieves reliev - relieving reliev religion religion - religions religion religious religi - religiously religi relinquish relinquish - reliques reliqu reliquit reliquit - relish relish relume relum - rely reli relying reli - remain remain remainder remaind - remainders remaind remained remain - remaineth remaineth remaining remain - remains remain remark remark - remarkable remark remediate remedi - remedied remedi remedies remedi - remedy remedi rememb rememb - remember rememb remembered rememb - remembers rememb remembrance remembr - remembrancer remembranc remembrances remembr - remercimens remercimen remiss remiss - remission remiss remissness remiss - remit remit remnant remnant - remnants remnant remonstrance remonstr - remorse remors remorseful remors - remorseless remorseless remote remot - remotion remot remov remov - remove remov removed remov - removedness removed remover remov - removes remov removing remov - remunerate remuner remuneration remuner - rence renc rend rend - render render rendered render - renders render rendezvous rendezv - renegado renegado renege reneg - reneges reneg renew renew - renewed renew renewest renewest - renounce renounc renouncement renounc - renouncing renounc renowmed renowm - renown renown renowned renown - rent rent rents rent - repaid repaid repair repair - repaired repair repairing repair - repairs repair repass repass - repast repast repasture repastur - repay repai repaying repai - repays repai repeal repeal - repealing repeal repeals repeal - repeat repeat repeated repeat - repeating repeat repeats repeat - repel repel repent repent - repentance repent repentant repent - repented repent repenting repent - repents repent repetition repetit - repetitions repetit repin repin - repine repin repining repin - replant replant replenish replenish - replenished replenish replete replet - replication replic replied repli - replies repli repliest repliest - reply repli replying repli - report report reported report - reporter report reportest reportest - reporting report reportingly reportingli - reports report reposal repos - repose repos reposeth reposeth - reposing repos repossess repossess - reprehend reprehend reprehended reprehend - reprehending reprehend represent repres - representing repres reprieve repriev - reprieves repriev reprisal repris - reproach reproach reproaches reproach - reproachful reproach reproachfully reproachfulli - reprobate reprob reprobation reprob - reproof reproof reprov reprov - reprove reprov reproveable reprov - reproves reprov reproving reprov - repugn repugn repugnancy repugn - repugnant repugn repulse repuls - repulsed repuls repurchas repurcha - repured repur reputation reput - repute reput reputed reput - reputeless reputeless reputes reput - reputing reput request request - requested request requesting request - requests request requiem requiem - requir requir require requir - required requir requires requir - requireth requireth requiring requir - requisite requisit requisites requisit - requit requit requital requit - requite requit requited requit - requites requit rer rer - rere rere rers rer - rescu rescu rescue rescu - rescued rescu rescues rescu - rescuing rescu resemblance resembl - resemble resembl resembled resembl - resembles resembl resembleth resembleth - resembling resembl reserv reserv - reservation reserv reserve reserv - reserved reserv reserves reserv - reside resid residence resid - resident resid resides resid - residing resid residue residu - resign resign resignation resign - resist resist resistance resist - resisted resist resisting resist - resists resist resolute resolut - resolutely resolut resolutes resolut - resolution resolut resolv resolv - resolve resolv resolved resolv - resolvedly resolvedli resolves resolv - resolveth resolveth resort resort - resorted resort resounding resound - resounds resound respeaking respeak - respect respect respected respect - respecting respect respective respect - respectively respect respects respect - respice respic respite respit - respites respit responsive respons - respose respos ress ress - rest rest rested rest - resteth resteth restful rest - resting rest restitution restitut - restless restless restor restor - restoration restor restorative restor - restore restor restored restor - restores restor restoring restor - restrain restrain restrained restrain - restraining restrain restrains restrain - restraint restraint rests rest - resty resti resum resum - resume resum resumes resum - resurrections resurrect retail retail - retails retail retain retain - retainers retain retaining retain - retell retel retention retent - retentive retent retinue retinu - retir retir retire retir - retired retir retirement retir - retires retir retiring retir - retold retold retort retort - retorts retort retourne retourn - retract retract retreat retreat - retrograde retrograd rets ret - return return returned return - returnest returnest returneth returneth - returning return returns return - revania revania reveal reveal - reveals reveal revel revel - reveler revel revell revel - reveller revel revellers revel - revelling revel revelry revelri - revels revel reveng reveng - revenge reveng revenged reveng - revengeful reveng revengement reveng - revenger reveng revengers reveng - revenges reveng revenging reveng - revengingly revengingli revenue revenu - revenues revenu reverb reverb - reverberate reverber reverbs reverb - reverenc reverenc reverence rever - reverend reverend reverent rever - reverently rever revers rever - reverse revers reversion revers - reverted revert review review - reviewest reviewest revil revil - revile revil revisits revisit - reviv reviv revive reviv - revives reviv reviving reviv - revok revok revoke revok - revokement revok revolt revolt - revolted revolt revolting revolt - revolts revolt revolution revolut - revolutions revolut revolve revolv - revolving revolv reward reward - rewarded reward rewarder reward - rewarding reward rewards reward - reword reword reworded reword - rex rex rey rei - reynaldo reynaldo rford rford - rful rful rfull rfull - rhapsody rhapsodi rheims rheim - rhenish rhenish rhesus rhesu - rhetoric rhetor rheum rheum - rheumatic rheumat rheums rheum - rheumy rheumi rhinoceros rhinocero - rhodes rhode rhodope rhodop - rhubarb rhubarb rhym rhym - rhyme rhyme rhymers rhymer - rhymes rhyme rhyming rhyme - rialto rialto rib rib - ribald ribald riband riband - ribands riband ribaudred ribaudr - ribb ribb ribbed rib - ribbon ribbon ribbons ribbon - ribs rib rice rice - rich rich richard richard - richer richer riches rich - richest richest richly richli - richmond richmond richmonds richmond - rid rid riddance riddanc - ridden ridden riddle riddl - riddles riddl riddling riddl - ride ride rider rider - riders rider rides ride - ridest ridest rideth rideth - ridge ridg ridges ridg - ridiculous ridicul riding ride - rids rid rien rien - ries ri rifle rifl - rift rift rifted rift - rig rig rigg rigg - riggish riggish right right - righteous righteou righteously righteous - rightful right rightfully rightfulli - rightly rightli rights right - rigol rigol rigorous rigor - rigorously rigor rigour rigour - ril ril rim rim - rin rin rinaldo rinaldo - rind rind ring ring - ringing ring ringleader ringlead - ringlets ringlet rings ring - ringwood ringwood riot riot - rioter rioter rioting riot - riotous riotou riots riot - rip rip ripe ripe - ripely ripe ripen ripen - ripened ripen ripeness ripe - ripening ripen ripens ripen - riper riper ripest ripest - riping ripe ripp ripp - ripping rip rise rise - risen risen rises rise - riseth riseth rish rish - rising rise rite rite - rites rite rivage rivag - rival rival rivality rival - rivall rival rivals rival - rive rive rived rive - rivelled rivel river river - rivers river rivet rivet - riveted rivet rivets rivet - rivo rivo rj rj - rless rless road road - roads road roam roam - roaming roam roan roan - roar roar roared roar - roarers roarer roaring roar - roars roar roast roast - roasted roast rob rob - roba roba robas roba - robb robb robbed rob - robber robber robbers robber - robbery robberi robbing rob - robe robe robed robe - robert robert robes robe - robin robin robs rob - robustious robusti rochester rochest - rochford rochford rock rock - rocks rock rocky rocki - rod rod rode rode - roderigo roderigo rods rod - roe roe roes roe - roger roger rogero rogero - rogue rogu roguery rogueri - rogues rogu roguish roguish - roi roi roisting roist - roll roll rolled roll - rolling roll rolls roll - rom rom romage romag - roman roman romano romano - romanos romano romans roman - rome rome romeo romeo - romish romish rondure rondur - ronyon ronyon rood rood - roof roof roofs roof - rook rook rooks rook - rooky rooki room room - rooms room root root - rooted root rootedly rootedli - rooteth rooteth rooting root - roots root rope rope - ropery roperi ropes rope - roping rope ros ro - rosalind rosalind rosalinda rosalinda - rosalinde rosalind rosaline rosalin - roscius rosciu rose rose - rosed rose rosemary rosemari - rosencrantz rosencrantz roses rose - ross ross rosy rosi - rot rot rote rote - roted rote rother rother - rotherham rotherham rots rot - rotted rot rotten rotten - rottenness rotten rotting rot - rotundity rotund rouen rouen - rough rough rougher rougher - roughest roughest roughly roughli - roughness rough round round - rounded round roundel roundel - rounder rounder roundest roundest - rounding round roundly roundli - rounds round roundure roundur - rous rou rouse rous - roused rous rousillon rousillon - rously rousli roussi roussi - rout rout routed rout - routs rout rove rove - rover rover row row - rowel rowel rowland rowland - rowlands rowland roy roi - royal royal royalize royal - royally royal royalties royalti - royalty royalti roynish roynish - rs rs rt rt - rub rub rubb rubb - rubbing rub rubbish rubbish - rubies rubi rubious rubiou - rubs rub ruby rubi - rud rud rudand rudand - rudder rudder ruddiness ruddi - ruddock ruddock ruddy ruddi - rude rude rudely rude - rudeness rude ruder ruder - rudesby rudesbi rudest rudest - rudiments rudiment rue rue - rued ru ruff ruff - ruffian ruffian ruffians ruffian - ruffle ruffl ruffling ruffl - ruffs ruff rug rug - rugby rugbi rugemount rugemount - rugged rug ruin ruin - ruinate ruinat ruined ruin - ruining ruin ruinous ruinou - ruins ruin rul rul - rule rule ruled rule - ruler ruler rulers ruler - rules rule ruling rule - rumble rumbl ruminaies ruminai - ruminat ruminat ruminate rumin - ruminated rumin ruminates rumin - rumination rumin rumor rumor - rumour rumour rumourer rumour - rumours rumour rump rump - run run runagate runag - runagates runag runaway runawai - runaways runawai rung rung - runn runn runner runner - runners runner running run - runs run rupture ruptur - ruptures ruptur rural rural - rush rush rushes rush - rushing rush rushling rushl - rushy rushi russet russet - russia russia russian russian - russians russian rust rust - rusted rust rustic rustic - rustically rustic rustics rustic - rustle rustl rustling rustl - rusts rust rusty rusti - rut rut ruth ruth - ruthful ruth ruthless ruthless - rutland rutland ruttish ruttish - ry ry rye rye - rything ryth s s - sa sa saba saba - sabbath sabbath sable sabl - sables sabl sack sack - sackbuts sackbut sackcloth sackcloth - sacked sack sackerson sackerson - sacks sack sacrament sacrament - sacred sacr sacrific sacrif - sacrifice sacrific sacrificers sacrific - sacrifices sacrific sacrificial sacrifici - sacrificing sacrif sacrilegious sacrilegi - sacring sacr sad sad - sadder sadder saddest saddest - saddle saddl saddler saddler - saddles saddl sadly sadli - sadness sad saf saf - safe safe safeguard safeguard - safely safe safer safer - safest safest safeties safeti - safety safeti saffron saffron - sag sag sage sage - sagittary sagittari said said - saidst saidst sail sail - sailing sail sailmaker sailmak - sailor sailor sailors sailor - sails sail sain sain - saint saint sainted saint - saintlike saintlik saints saint - saith saith sake sake - sakes sake sala sala - salad salad salamander salamand - salary salari sale sale - salerio salerio salicam salicam - salique saliqu salisbury salisburi - sall sall sallet sallet - sallets sallet sallies salli - sallow sallow sally salli - salmon salmon salmons salmon - salt salt salter salter - saltiers saltier saltness salt - saltpetre saltpetr salutation salut - salutations salut salute salut - saluted salut salutes salut - saluteth saluteth salv salv - salvation salvat salve salv - salving salv same same - samingo samingo samp samp - sampire sampir sample sampl - sampler sampler sampson sampson - samson samson samsons samson - sancta sancta sanctified sanctifi - sanctifies sanctifi sanctify sanctifi - sanctimonies sanctimoni sanctimonious sanctimoni - sanctimony sanctimoni sanctities sanctiti - sanctity sanctiti sanctuarize sanctuar - sanctuary sanctuari sand sand - sandal sandal sandbag sandbag - sanded sand sands sand - sandy sandi sandys sandi - sang sang sanguine sanguin - sanguis sangui sanity saniti - sans san santrailles santrail - sap sap sapient sapient - sapit sapit sapless sapless - sapling sapl sapphire sapphir - sapphires sapphir saracens saracen - sarcenet sarcenet sard sard - sardians sardian sardinia sardinia - sardis sardi sarum sarum - sat sat satan satan - satchel satchel sate sate - sated sate satiate satiat - satiety satieti satin satin - satire satir satirical satir - satis sati satisfaction satisfact - satisfied satisfi satisfies satisfi - satisfy satisfi satisfying satisfi - saturday saturdai saturdays saturdai - saturn saturn saturnine saturnin - saturninus saturninu satyr satyr - satyrs satyr sauc sauc - sauce sauc sauced sauc - saucers saucer sauces sauc - saucily saucili sauciness sauci - saucy sauci sauf sauf - saunder saunder sav sav - savage savag savagely savag - savageness savag savagery savageri - savages savag save save - saved save saves save - saving save saviour saviour - savory savori savour savour - savouring savour savours savour - savoury savouri savoy savoi - saw saw sawed saw - sawest sawest sawn sawn - sawpit sawpit saws saw - sawyer sawyer saxons saxon - saxony saxoni saxton saxton - say sai sayest sayest - saying sai sayings sai - says sai sayst sayst - sblood sblood sc sc - scab scab scabbard scabbard - scabs scab scaffold scaffold - scaffoldage scaffoldag scal scal - scald scald scalded scald - scalding scald scale scale - scaled scale scales scale - scaling scale scall scall - scalp scalp scalps scalp - scaly scali scamble scambl - scambling scambl scamels scamel - scan scan scandal scandal - scandaliz scandaliz scandalous scandal - scandy scandi scann scann - scant scant scanted scant - scanter scanter scanting scant - scantling scantl scants scant - scap scap scape scape - scaped scape scapes scape - scapeth scapeth scar scar - scarce scarc scarcely scarc - scarcity scarciti scare scare - scarecrow scarecrow scarecrows scarecrow - scarf scarf scarfed scarf - scarfs scarf scaring scare - scarlet scarlet scarr scarr - scarre scarr scars scar - scarus scaru scath scath - scathe scath scathful scath - scatt scatt scatter scatter - scattered scatter scattering scatter - scatters scatter scelera scelera - scelerisque scelerisqu scene scene - scenes scene scent scent - scented scent scept scept - scepter scepter sceptre sceptr - sceptred sceptr sceptres sceptr - schedule schedul schedules schedul - scholar scholar scholarly scholarli - scholars scholar school school - schoolboy schoolboi schoolboys schoolboi - schoolfellows schoolfellow schooling school - schoolmaster schoolmast schoolmasters schoolmast - schools school sciatica sciatica - sciaticas sciatica science scienc - sciences scienc scimitar scimitar - scion scion scions scion - scissors scissor scoff scoff - scoffer scoffer scoffing scof - scoffs scoff scoggin scoggin - scold scold scolding scold - scolds scold sconce sconc - scone scone scope scope - scopes scope scorch scorch - scorched scorch score score - scored score scores score - scoring score scorn scorn - scorned scorn scornful scorn - scornfully scornfulli scorning scorn - scorns scorn scorpion scorpion - scorpions scorpion scot scot - scotch scotch scotches scotch - scotland scotland scots scot - scottish scottish scoundrels scoundrel - scour scour scoured scour - scourg scourg scourge scourg - scouring scour scout scout - scouts scout scowl scowl - scrap scrap scrape scrape - scraping scrape scraps scrap - scratch scratch scratches scratch - scratching scratch scream scream - screams scream screech screech - screeching screech screen screen - screens screen screw screw - screws screw scribbl scribbl - scribbled scribbl scribe scribe - scribes scribe scrimers scrimer - scrip scrip scrippage scrippag - scripture scriptur scriptures scriptur - scrivener scriven scroll scroll - scrolls scroll scroop scroop - scrowl scrowl scroyles scroyl - scrubbed scrub scruple scrupl - scruples scrupl scrupulous scrupul - scuffles scuffl scuffling scuffl - scullion scullion sculls scull - scum scum scurril scurril - scurrility scurril scurrilous scurril - scurvy scurvi scuse scuse - scut scut scutcheon scutcheon - scutcheons scutcheon scylla scylla - scythe scyth scythed scyth - scythia scythia scythian scythian - sdeath sdeath se se - sea sea seacoal seacoal - seafaring seafar seal seal - sealed seal sealing seal - seals seal seam seam - seamen seamen seamy seami - seaport seaport sear sear - searce searc search search - searchers searcher searches search - searcheth searcheth searching search - seared sear seas sea - seasick seasick seaside seasid - season season seasoned season - seasons season seat seat - seated seat seats seat - sebastian sebastian second second - secondarily secondarili secondary secondari - seconded second seconds second - secrecy secreci secret secret - secretaries secretari secretary secretari - secretly secretli secrets secret - sect sect sectary sectari - sects sect secundo secundo - secure secur securely secur - securing secur security secur - sedg sedg sedge sedg - sedges sedg sedgy sedgi - sedition sedit seditious sediti - seduc seduc seduce seduc - seduced seduc seducer seduc - seducing seduc see see - seed seed seeded seed - seedness seed seeds seed - seedsman seedsman seein seein - seeing see seek seek - seeking seek seeks seek - seel seel seeling seel - seely seeli seem seem - seemed seem seemers seemer - seemest seemest seemeth seemeth - seeming seem seemingly seemingli - seemly seemli seems seem - seen seen seer seer - sees see seese sees - seest seest seethe seeth - seethes seeth seething seeth - seeting seet segregation segreg - seigneur seigneur seigneurs seigneur - seiz seiz seize seiz - seized seiz seizes seiz - seizeth seizeth seizing seiz - seizure seizur seld seld - seldom seldom select select - seleucus seleucu self self - selfsame selfsam sell sell - seller seller selling sell - sells sell selves selv - semblable semblabl semblably semblabl - semblance semblanc semblances semblanc - semblative sembl semi semi - semicircle semicircl semiramis semirami - semper semper sempronius semproniu - senate senat senator senat - senators senat send send - sender sender sendeth sendeth - sending send sends send - seneca seneca senior senior - seniory seniori senis seni - sennet sennet senoys senoi - sense sens senseless senseless - senses sens sensible sensibl - sensibly sensibl sensual sensual - sensuality sensual sent sent - sentenc sentenc sentence sentenc - sentences sentenc sententious sententi - sentinel sentinel sentinels sentinel - separable separ separate separ - separated separ separates separ - separation separ septentrion septentrion - sepulchre sepulchr sepulchres sepulchr - sepulchring sepulchr sequel sequel - sequence sequenc sequent sequent - sequest sequest sequester sequest - sequestration sequestr sere sere - serenis sereni serge serg - sergeant sergeant serious seriou - seriously serious sermon sermon - sermons sermon serpent serpent - serpentine serpentin serpents serpent - serpigo serpigo serv serv - servant servant servanted servant - servants servant serve serv - served serv server server - serves serv serveth serveth - service servic serviceable servic - services servic servile servil - servility servil servilius serviliu - serving serv servingman servingman - servingmen servingmen serviteur serviteur - servitor servitor servitors servitor - servitude servitud sessa sessa - session session sessions session - sestos sesto set set - setebos setebo sets set - setter setter setting set - settle settl settled settl - settlest settlest settling settl - sev sev seven seven - sevenfold sevenfold sevennight sevennight - seventeen seventeen seventh seventh - seventy seventi sever sever - several sever severally sever - severals sever severe sever - severed sever severely sever - severest severest severing sever - severity sever severn severn - severs sever sew sew - seward seward sewer sewer - sewing sew sex sex - sexes sex sexton sexton - sextus sextu seymour seymour - seyton seyton sfoot sfoot - sh sh shackle shackl - shackles shackl shade shade - shades shade shadow shadow - shadowed shadow shadowing shadow - shadows shadow shadowy shadowi - shady shadi shafalus shafalu - shaft shaft shafts shaft - shag shag shak shak - shake shake shaked shake - shaken shaken shakes shake - shaking shake shales shale - shall shall shallenge shalleng - shallow shallow shallowest shallowest - shallowly shallowli shallows shallow - shalt shalt sham sham - shambles shambl shame shame - shamed shame shameful shame - shamefully shamefulli shameless shameless - shames shame shamest shamest - shaming shame shank shank - shanks shank shap shap - shape shape shaped shape - shapeless shapeless shapen shapen - shapes shape shaping shape - shar shar shard shard - sharded shard shards shard - share share shared share - sharers sharer shares share - sharing share shark shark - sharp sharp sharpen sharpen - sharpened sharpen sharpens sharpen - sharper sharper sharpest sharpest - sharply sharpli sharpness sharp - sharps sharp shatter shatter - shav shav shave shave - shaven shaven shaw shaw - she she sheaf sheaf - sheal sheal shear shear - shearers shearer shearing shear - shearman shearman shears shear - sheath sheath sheathe sheath - sheathed sheath sheathes sheath - sheathing sheath sheaved sheav - sheaves sheav shed shed - shedding shed sheds shed - sheen sheen sheep sheep - sheepcote sheepcot sheepcotes sheepcot - sheeps sheep sheepskins sheepskin - sheer sheer sheet sheet - sheeted sheet sheets sheet - sheffield sheffield shelf shelf - shell shell shells shell - shelt shelt shelter shelter - shelters shelter shelves shelv - shelving shelv shelvy shelvi - shent shent shepherd shepherd - shepherdes shepherd shepherdess shepherdess - shepherdesses shepherdess shepherds shepherd - sher sher sheriff sheriff - sherris sherri shes she - sheweth sheweth shield shield - shielded shield shields shield - shift shift shifted shift - shifting shift shifts shift - shilling shill shillings shill - shin shin shine shine - shines shine shineth shineth - shining shine shins shin - shiny shini ship ship - shipboard shipboard shipman shipman - shipmaster shipmast shipmen shipmen - shipp shipp shipped ship - shipping ship ships ship - shipt shipt shipwreck shipwreck - shipwrecking shipwreck shipwright shipwright - shipwrights shipwright shire shire - shirley shirlei shirt shirt - shirts shirt shive shive - shiver shiver shivering shiver - shivers shiver shoal shoal - shoals shoal shock shock - shocks shock shod shod - shoe shoe shoeing shoe - shoemaker shoemak shoes shoe - shog shog shone shone - shook shook shoon shoon - shoot shoot shooter shooter - shootie shooti shooting shoot - shoots shoot shop shop - shops shop shore shore - shores shore shorn shorn - short short shortcake shortcak - shorten shorten shortened shorten - shortens shorten shorter shorter - shortly shortli shortness short - shot shot shotten shotten - shoughs shough should should - shoulder shoulder shouldering shoulder - shoulders shoulder shouldst shouldst - shout shout shouted shout - shouting shout shouts shout - shov shov shove shove - shovel shovel shovels shovel - show show showed show - shower shower showers shower - showest showest showing show - shown shown shows show - shreds shred shrew shrew - shrewd shrewd shrewdly shrewdli - shrewdness shrewd shrewish shrewish - shrewishly shrewishli shrewishness shrewish - shrews shrew shrewsbury shrewsburi - shriek shriek shrieking shriek - shrieks shriek shrieve shriev - shrift shrift shrill shrill - shriller shriller shrills shrill - shrilly shrilli shrimp shrimp - shrine shrine shrink shrink - shrinking shrink shrinks shrink - shriv shriv shrive shrive - shriver shriver shrives shrive - shriving shrive shroud shroud - shrouded shroud shrouding shroud - shrouds shroud shrove shrove - shrow shrow shrows shrow - shrub shrub shrubs shrub - shrug shrug shrugs shrug - shrunk shrunk shudd shudd - shudders shudder shuffl shuffl - shuffle shuffl shuffled shuffl - shuffling shuffl shun shun - shunless shunless shunn shunn - shunned shun shunning shun - shuns shun shut shut - shuts shut shuttle shuttl - shy shy shylock shylock - si si sibyl sibyl - sibylla sibylla sibyls sibyl - sicil sicil sicilia sicilia - sicilian sicilian sicilius siciliu - sicils sicil sicily sicili - sicinius siciniu sick sick - sicken sicken sickens sicken - sicker sicker sickle sickl - sicklemen sicklemen sicklied sickli - sickliness sickli sickly sickli - sickness sick sicles sicl - sicyon sicyon side side - sided side sides side - siege sieg sieges sieg - sienna sienna sies si - sieve siev sift sift - sifted sift sigeia sigeia - sigh sigh sighed sigh - sighing sigh sighs sigh - sight sight sighted sight - sightless sightless sightly sightli - sights sight sign sign - signal signal signet signet - signieur signieur significant signific - significants signific signified signifi - signifies signifi signify signifi - signifying signifi signior signior - signiories signiori signiors signior - signiory signiori signor signor - signories signori signs sign - signum signum silenc silenc - silence silenc silenced silenc - silencing silenc silent silent - silently silent silius siliu - silk silk silken silken - silkman silkman silks silk - silliest silliest silliness silli - silling sill silly silli - silva silva silver silver - silvered silver silverly silverli - silvia silvia silvius silviu - sima sima simile simil - similes simil simois simoi - simon simon simony simoni - simp simp simpcox simpcox - simple simpl simpleness simpl - simpler simpler simples simpl - simplicity simplic simply simpli - simular simular simulation simul - sin sin since sinc - sincere sincer sincerely sincer - sincerity sincer sinel sinel - sinew sinew sinewed sinew - sinews sinew sinewy sinewi - sinful sin sinfully sinfulli - sing sing singe sing - singeing sing singer singer - singes sing singeth singeth - singing sing single singl - singled singl singleness singl - singly singli sings sing - singular singular singulariter singularit - singularities singular singularity singular - singuled singul sinister sinist - sink sink sinking sink - sinks sink sinn sinn - sinner sinner sinners sinner - sinning sin sinon sinon - sins sin sip sip - sipping sip sir sir - sire sire siren siren - sirrah sirrah sirs sir - sist sist sister sister - sisterhood sisterhood sisterly sisterli - sisters sister sit sit - sith sith sithence sithenc - sits sit sitting sit - situate situat situation situat - situations situat siward siward - six six sixpence sixpenc - sixpences sixpenc sixpenny sixpenni - sixteen sixteen sixth sixth - sixty sixti siz siz - size size sizes size - sizzle sizzl skains skain - skamble skambl skein skein - skelter skelter skies ski - skilful skil skilfully skilfulli - skill skill skilless skilless - skillet skillet skillful skill - skills skill skim skim - skimble skimbl skin skin - skinker skinker skinny skinni - skins skin skip skip - skipp skipp skipper skipper - skipping skip skirmish skirmish - skirmishes skirmish skirr skirr - skirted skirt skirts skirt - skittish skittish skulking skulk - skull skull skulls skull - sky sky skyey skyei - skyish skyish slab slab - slack slack slackly slackli - slackness slack slain slain - slake slake sland sland - slander slander slandered slander - slanderer slander slanderers slander - slandering slander slanderous slander - slanders slander slash slash - slaught slaught slaughter slaughter - slaughtered slaughter slaughterer slaughter - slaughterman slaughterman slaughtermen slaughtermen - slaughterous slaughter slaughters slaughter - slave slave slaver slaver - slavery slaveri slaves slave - slavish slavish slay slai - slayeth slayeth slaying slai - slays slai sleave sleav - sledded sled sleek sleek - sleekly sleekli sleep sleep - sleeper sleeper sleepers sleeper - sleepest sleepest sleeping sleep - sleeps sleep sleepy sleepi - sleeve sleev sleeves sleev - sleid sleid sleided sleid - sleight sleight sleights sleight - slender slender slenderer slender - slenderly slenderli slept slept - slew slew slewest slewest - slice slice slid slid - slide slide slides slide - sliding slide slight slight - slighted slight slightest slightest - slightly slightli slightness slight - slights slight slily slili - slime slime slimy slimi - slings sling slink slink - slip slip slipp slipp - slipper slipper slippers slipper - slippery slipperi slips slip - slish slish slit slit - sliver sliver slobb slobb - slomber slomber slop slop - slope slope slops slop - sloth sloth slothful sloth - slough slough slovenly slovenli - slovenry slovenri slow slow - slower slower slowly slowli - slowness slow slubber slubber - slug slug sluggard sluggard - sluggardiz sluggardiz sluggish sluggish - sluic sluic slumb slumb - slumber slumber slumbers slumber - slumbery slumberi slunk slunk - slut slut sluts slut - sluttery slutteri sluttish sluttish - sluttishness sluttish sly sly - slys sly smack smack - smacking smack smacks smack - small small smaller smaller - smallest smallest smallness small - smalus smalu smart smart - smarting smart smartly smartli - smatch smatch smatter smatter - smear smear smell smell - smelling smell smells smell - smelt smelt smil smil - smile smile smiled smile - smiles smile smilest smilest - smilets smilet smiling smile - smilingly smilingli smirch smirch - smirched smirch smit smit - smite smite smites smite - smith smith smithfield smithfield - smock smock smocks smock - smok smok smoke smoke - smoked smoke smokes smoke - smoking smoke smoky smoki - smooth smooth smoothed smooth - smoothing smooth smoothly smoothli - smoothness smooth smooths smooth - smote smote smoth smoth - smother smother smothered smother - smothering smother smug smug - smulkin smulkin smutch smutch - snaffle snaffl snail snail - snails snail snake snake - snakes snake snaky snaki - snap snap snapp snapp - snapper snapper snar snar - snare snare snares snare - snarl snarl snarleth snarleth - snarling snarl snatch snatch - snatchers snatcher snatches snatch - snatching snatch sneak sneak - sneaking sneak sneap sneap - sneaping sneap sneck sneck - snip snip snipe snipe - snipt snipt snore snore - snores snore snoring snore - snorting snort snout snout - snow snow snowballs snowbal - snowed snow snowy snowi - snuff snuff snuffs snuff - snug snug so so - soak soak soaking soak - soaks soak soar soar - soaring soar soars soar - sob sob sobbing sob - sober sober soberly soberli - sobriety sobrieti sobs sob - sociable sociabl societies societi - society societi socks sock - socrates socrat sod sod - sodden sodden soe soe - soever soever soft soft - soften soften softens soften - softer softer softest softest - softly softli softness soft - soil soil soiled soil - soilure soilur soit soit - sojourn sojourn sol sol - sola sola solace solac - solanio solanio sold sold - soldat soldat solder solder - soldest soldest soldier soldier - soldiers soldier soldiership soldiership - sole sole solely sole - solem solem solemn solemn - solemness solem solemnities solemn - solemnity solemn solemniz solemniz - solemnize solemn solemnized solemn - solemnly solemnli soles sole - solicit solicit solicitation solicit - solicited solicit soliciting solicit - solicitings solicit solicitor solicitor - solicits solicit solid solid - solidares solidar solidity solid - solinus solinu solitary solitari - solomon solomon solon solon - solum solum solus solu - solyman solyman some some - somebody somebodi someone someon - somerset somerset somerville somervil - something someth sometime sometim - sometimes sometim somever somev - somewhat somewhat somewhere somewher - somewhither somewhith somme somm - son son sonance sonanc - song song songs song - sonnet sonnet sonneting sonnet - sonnets sonnet sons son - sont sont sonties sonti - soon soon sooner sooner - soonest soonest sooth sooth - soothe sooth soothers soother - soothing sooth soothsay soothsai - soothsayer soothsay sooty sooti - sop sop sophister sophist - sophisticated sophist sophy sophi - sops sop sorcerer sorcer - sorcerers sorcer sorceress sorceress - sorceries sorceri sorcery sorceri - sore sore sorel sorel - sorely sore sorer sorer - sores sore sorrier sorrier - sorriest sorriest sorrow sorrow - sorrowed sorrow sorrowest sorrowest - sorrowful sorrow sorrowing sorrow - sorrows sorrow sorry sorri - sort sort sortance sortanc - sorted sort sorting sort - sorts sort sossius sossiu - sot sot soto soto - sots sot sottish sottish - soud soud sought sought - soul soul sould sould - soulless soulless souls soul - sound sound sounded sound - sounder sounder soundest soundest - sounding sound soundless soundless - soundly soundli soundness sound - soundpost soundpost sounds sound - sour sour source sourc - sources sourc sourest sourest - sourly sourli sours sour - sous sou souse sous - south south southam southam - southampton southampton southerly southerli - southern southern southward southward - southwark southwark southwell southwel - souviendrai souviendrai sov sov - sovereign sovereign sovereignest sovereignest - sovereignly sovereignli sovereignty sovereignti - sovereignvours sovereignvour sow sow - sowing sow sowl sowl - sowter sowter space space - spaces space spacious spaciou - spade spade spades spade - spain spain spak spak - spake spake spakest spakest - span span spangle spangl - spangled spangl spaniard spaniard - spaniel spaniel spaniels spaniel - spanish spanish spann spann - spans span spar spar - spare spare spares spare - sparing spare sparingly sparingli - spark spark sparkle sparkl - sparkles sparkl sparkling sparkl - sparks spark sparrow sparrow - sparrows sparrow sparta sparta - spartan spartan spavin spavin - spavins spavin spawn spawn - speak speak speaker speaker - speakers speaker speakest speakest - speaketh speaketh speaking speak - speaks speak spear spear - speargrass speargrass spears spear - special special specialities special - specially special specialties specialti - specialty specialti specify specifi - speciously specious spectacle spectacl - spectacled spectacl spectacles spectacl - spectators spectat spectatorship spectatorship - speculation specul speculations specul - speculative specul sped sped - speech speech speeches speech - speechless speechless speed speed - speeded speed speedier speedier - speediest speediest speedily speedili - speediness speedi speeding speed - speeds speed speedy speedi - speens speen spell spell - spelling spell spells spell - spelt spelt spencer spencer - spend spend spendest spendest - spending spend spends spend - spendthrift spendthrift spent spent - sperato sperato sperm sperm - spero spero sperr sperr - spher spher sphere sphere - sphered sphere spheres sphere - spherical spheric sphery spheri - sphinx sphinx spice spice - spiced spice spicery spiceri - spices spice spider spider - spiders spider spied spi - spies spi spieth spieth - spightfully spightfulli spigot spigot - spill spill spilling spill - spills spill spilt spilt - spilth spilth spin spin - spinii spinii spinners spinner - spinster spinster spinsters spinster - spire spire spirit spirit - spirited spirit spiritless spiritless - spirits spirit spiritual spiritu - spiritualty spiritualti spirt spirt - spit spit spital spital - spite spite spited spite - spiteful spite spites spite - spits spit spitted spit - spitting spit splay splai - spleen spleen spleenful spleen - spleens spleen spleeny spleeni - splendour splendour splenitive splenit - splinter splinter splinters splinter - split split splits split - splitted split splitting split - spoil spoil spoils spoil - spok spok spoke spoke - spoken spoken spokes spoke - spokesman spokesman sponge spong - spongy spongi spoon spoon - spoons spoon sport sport - sportful sport sporting sport - sportive sportiv sports sport - spot spot spotless spotless - spots spot spotted spot - spousal spousal spouse spous - spout spout spouting spout - spouts spout sprag sprag - sprang sprang sprat sprat - sprawl sprawl spray sprai - sprays sprai spread spread - spreading spread spreads spread - sprighted spright sprightful spright - sprightly sprightli sprigs sprig - spring spring springe spring - springes spring springeth springeth - springhalt springhalt springing spring - springs spring springtime springtim - sprinkle sprinkl sprinkles sprinkl - sprite sprite sprited sprite - spritely sprite sprites sprite - spriting sprite sprout sprout - spruce spruce sprung sprung - spun spun spur spur - spurio spurio spurn spurn - spurns spurn spurr spurr - spurrer spurrer spurring spur - spurs spur spy spy - spying spy squabble squabbl - squadron squadron squadrons squadron - squand squand squar squar - square squar squarer squarer - squares squar squash squash - squeak squeak squeaking squeak - squeal squeal squealing squeal - squeezes squeez squeezing squeez - squele squel squier squier - squints squint squiny squini - squire squir squires squir - squirrel squirrel st st - stab stab stabb stabb - stabbed stab stabbing stab - stable stabl stableness stabl - stables stabl stablish stablish - stablishment stablish stabs stab - stacks stack staff staff - stafford stafford staffords stafford - staffordshire staffordshir stag stag - stage stage stages stage - stagger stagger staggering stagger - staggers stagger stags stag - staid staid staider staider - stain stain stained stain - staines stain staineth staineth - staining stain stainless stainless - stains stain stair stair - stairs stair stake stake - stakes stake stale stale - staled stale stalk stalk - stalking stalk stalks stalk - stall stall stalling stall - stalls stall stamford stamford - stammer stammer stamp stamp - stamped stamp stamps stamp - stanch stanch stanchless stanchless - stand stand standard standard - standards standard stander stander - standers stander standest standest - standeth standeth standing stand - stands stand staniel staniel - stanley stanlei stanze stanz - stanzo stanzo stanzos stanzo - staple stapl staples stapl - star star stare stare - stared stare stares stare - staring stare starings stare - stark stark starkly starkli - starlight starlight starling starl - starr starr starry starri - stars star start start - started start starting start - startingly startingli startle startl - startles startl starts start - starv starv starve starv - starved starv starvelackey starvelackei - starveling starvel starveth starveth - starving starv state state - statelier stateli stately state - states state statesman statesman - statesmen statesmen statilius statiliu - station station statist statist - statists statist statue statu - statues statu stature statur - statures statur statute statut - statutes statut stave stave - staves stave stay stai - stayed stai stayest stayest - staying stai stays stai - stead stead steaded stead - steadfast steadfast steadier steadier - steads stead steal steal - stealer stealer stealers stealer - stealing steal steals steal - stealth stealth stealthy stealthi - steed steed steeds steed - steel steel steeled steel - steely steeli steep steep - steeped steep steeple steepl - steeples steepl steeps steep - steepy steepi steer steer - steerage steerag steering steer - steers steer stelled stell - stem stem stemming stem - stench stench step step - stepdame stepdam stephano stephano - stephen stephen stepmothers stepmoth - stepp stepp stepping step - steps step sterile steril - sterility steril sterling sterl - stern stern sternage sternag - sterner sterner sternest sternest - sternness stern steterat steterat - stew stew steward steward - stewards steward stewardship stewardship - stewed stew stews stew - stick stick sticking stick - stickler stickler sticks stick - stiff stiff stiffen stiffen - stiffly stiffli stifle stifl - stifled stifl stifles stifl - stigmatic stigmat stigmatical stigmat - stile stile still still - stiller stiller stillest stillest - stillness still stilly stilli - sting sting stinging sting - stingless stingless stings sting - stink stink stinking stink - stinkingly stinkingli stinks stink - stint stint stinted stint - stints stint stir stir - stirr stirr stirred stir - stirrer stirrer stirrers stirrer - stirreth stirreth stirring stir - stirrup stirrup stirrups stirrup - stirs stir stitchery stitcheri - stitches stitch stithied stithi - stithy stithi stoccadoes stoccado - stoccata stoccata stock stock - stockfish stockfish stocking stock - stockings stock stockish stockish - stocks stock stog stog - stogs stog stoics stoic - stokesly stokesli stol stol - stole stole stolen stolen - stolest stolest stomach stomach - stomachers stomach stomaching stomach - stomachs stomach ston ston - stone stone stonecutter stonecutt - stones stone stonish stonish - stony stoni stood stood - stool stool stools stool - stoop stoop stooping stoop - stoops stoop stop stop - stope stope stopp stopp - stopped stop stopping stop - stops stop stor stor - store store storehouse storehous - storehouses storehous stores store - stories stori storm storm - stormed storm storming storm - storms storm stormy stormi - story stori stoup stoup - stoups stoup stout stout - stouter stouter stoutly stoutli - stoutness stout stover stover - stow stow stowage stowag - stowed stow strachy strachi - stragglers straggler straggling straggl - straight straight straightest straightest - straightway straightwai strain strain - strained strain straining strain - strains strain strait strait - straited strait straiter straiter - straitly straitli straitness strait - straits strait strand strand - strange strang strangely strang - strangeness strang stranger stranger - strangers stranger strangest strangest - strangle strangl strangled strangl - strangler strangler strangles strangl - strangling strangl strappado strappado - straps strap stratagem stratagem - stratagems stratagem stratford stratford - strato strato straw straw - strawberries strawberri strawberry strawberri - straws straw strawy strawi - stray strai straying strai - strays strai streak streak - streaks streak stream stream - streamers streamer streaming stream - streams stream streching strech - street street streets street - strength strength strengthen strengthen - strengthened strengthen strengthless strengthless - strengths strength stretch stretch - stretched stretch stretches stretch - stretching stretch strew strew - strewing strew strewings strew - strewments strewment stricken stricken - strict strict stricter stricter - strictest strictest strictly strictli - stricture strictur stride stride - strides stride striding stride - strife strife strifes strife - strik strik strike strike - strikers striker strikes strike - strikest strikest striking strike - string string stringless stringless - strings string strip strip - stripes stripe stripling stripl - striplings stripl stripp stripp - stripping strip striv striv - strive strive strives strive - striving strive strok strok - stroke stroke strokes stroke - strond strond stronds strond - strong strong stronger stronger - strongest strongest strongly strongli - strooke strook strossers strosser - strove strove strown strown - stroy stroi struck struck - strucken strucken struggle struggl - struggles struggl struggling struggl - strumpet strumpet strumpeted strumpet - strumpets strumpet strung strung - strut strut struts strut - strutted strut strutting strut - stubble stubbl stubborn stubborn - stubbornest stubbornest stubbornly stubbornli - stubbornness stubborn stuck stuck - studded stud student student - students student studied studi - studies studi studious studiou - studiously studious studs stud - study studi studying studi - stuff stuff stuffing stuf - stuffs stuff stumble stumbl - stumbled stumbl stumblest stumblest - stumbling stumbl stump stump - stumps stump stung stung - stupefy stupefi stupid stupid - stupified stupifi stuprum stuprum - sturdy sturdi sty sty - styga styga stygian stygian - styl styl style style - styx styx su su - sub sub subcontracted subcontract - subdu subdu subdue subdu - subdued subdu subduements subduement - subdues subdu subduing subdu - subject subject subjected subject - subjection subject subjects subject - submerg submerg submission submiss - submissive submiss submit submit - submits submit submitting submit - suborn suborn subornation suborn - suborned suborn subscrib subscrib - subscribe subscrib subscribed subscrib - subscribes subscrib subscription subscript - subsequent subsequ subsidies subsidi - subsidy subsidi subsist subsist - subsisting subsist substance substanc - substances substanc substantial substanti - substitute substitut substituted substitut - substitutes substitut substitution substitut - subtile subtil subtilly subtilli - subtle subtl subtleties subtleti - subtlety subtleti subtly subtli - subtractors subtractor suburbs suburb - subversion subvers subverts subvert - succedant succed succeed succe - succeeded succeed succeeders succeed - succeeding succeed succeeds succe - success success successantly successantli - successes success successful success - successfully successfulli succession success - successive success successively success - successor successor successors successor - succour succour succours succour - such such suck suck - sucker sucker suckers sucker - sucking suck suckle suckl - sucks suck sudden sudden - suddenly suddenli sue sue - sued su suerly suerli - sues sue sueth sueth - suff suff suffer suffer - sufferance suffer sufferances suffer - suffered suffer suffering suffer - suffers suffer suffic suffic - suffice suffic sufficed suffic - suffices suffic sufficeth sufficeth - sufficiency suffici sufficient suffici - sufficiently suffici sufficing suffic - sufficit sufficit suffigance suffig - suffocate suffoc suffocating suffoc - suffocation suffoc suffolk suffolk - suffrage suffrag suffrages suffrag - sug sug sugar sugar - sugarsop sugarsop suggest suggest - suggested suggest suggesting suggest - suggestion suggest suggestions suggest - suggests suggest suis sui - suit suit suitable suitabl - suited suit suiting suit - suitor suitor suitors suitor - suits suit suivez suivez - sullen sullen sullens sullen - sullied sulli sullies sulli - sully sulli sulph sulph - sulpherous sulpher sulphur sulphur - sulphurous sulphur sultan sultan - sultry sultri sum sum - sumless sumless summ summ - summa summa summary summari - summer summer summers summer - summit summit summon summon - summoners summon summons summon - sumpter sumpter sumptuous sumptuou - sumptuously sumptuous sums sum - sun sun sunbeams sunbeam - sunburning sunburn sunburnt sunburnt - sund sund sunday sundai - sundays sundai sunder sunder - sunders sunder sundry sundri - sung sung sunk sunk - sunken sunken sunny sunni - sunrising sunris suns sun - sunset sunset sunshine sunshin - sup sup super super - superficial superfici superficially superfici - superfluity superflu superfluous superflu - superfluously superflu superflux superflux - superior superior supernal supern - supernatural supernatur superpraise superprais - superscript superscript superscription superscript - superserviceable superservic superstition superstit - superstitious superstiti superstitiously superstiti - supersubtle supersubtl supervise supervis - supervisor supervisor supp supp - supper supper suppers supper - suppertime suppertim supping sup - supplant supplant supple suppl - suppler suppler suppliance supplianc - suppliant suppliant suppliants suppliant - supplicant supplic supplication supplic - supplications supplic supplie suppli - supplied suppli supplies suppli - suppliest suppliest supply suppli - supplyant supplyant supplying suppli - supplyment supplyment support support - supportable support supportance support - supported support supporter support - supporters support supporting support - supportor supportor suppos suppo - supposal suppos suppose suppos - supposed suppos supposes suppos - supposest supposest supposing suppos - supposition supposit suppress suppress - suppressed suppress suppresseth suppresseth - supremacy supremaci supreme suprem - sups sup sur sur - surance suranc surcease surceas - surd surd sure sure - surecard surecard surely sure - surer surer surest surest - sureties sureti surety sureti - surfeit surfeit surfeited surfeit - surfeiter surfeit surfeiting surfeit - surfeits surfeit surge surg - surgeon surgeon surgeons surgeon - surgere surger surgery surgeri - surges surg surly surli - surmis surmi surmise surmis - surmised surmis surmises surmis - surmount surmount surmounted surmount - surmounts surmount surnam surnam - surname surnam surnamed surnam - surpasseth surpasseth surpassing surpass - surplice surplic surplus surplu - surpris surpri surprise surpris - surprised surpris surrender surrend - surrey surrei surreys surrei - survey survei surveyest surveyest - surveying survei surveyor surveyor - surveyors surveyor surveys survei - survive surviv survives surviv - survivor survivor susan susan - suspect suspect suspected suspect - suspecting suspect suspects suspect - suspend suspend suspense suspens - suspicion suspicion suspicions suspicion - suspicious suspici suspiration suspir - suspire suspir sust sust - sustain sustain sustaining sustain - sutler sutler sutton sutton - suum suum swabber swabber - swaddling swaddl swag swag - swagg swagg swagger swagger - swaggerer swagger swaggerers swagger - swaggering swagger swain swain - swains swain swallow swallow - swallowed swallow swallowing swallow - swallows swallow swam swam - swan swan swans swan - sward sward sware sware - swarm swarm swarming swarm - swart swart swarth swarth - swarths swarth swarthy swarthi - swashers swasher swashing swash - swath swath swathing swath - swathling swathl sway swai - swaying swai sways swai - swear swear swearer swearer - swearers swearer swearest swearest - swearing swear swearings swear - swears swear sweat sweat - sweaten sweaten sweating sweat - sweats sweat sweaty sweati - sweep sweep sweepers sweeper - sweeps sweep sweet sweet - sweeten sweeten sweetens sweeten - sweeter sweeter sweetest sweetest - sweetheart sweetheart sweeting sweet - sweetly sweetli sweetmeats sweetmeat - sweetness sweet sweets sweet - swell swell swelling swell - swellings swell swells swell - swelter swelter sweno sweno - swept swept swerve swerv - swerver swerver swerving swerv - swift swift swifter swifter - swiftest swiftest swiftly swiftli - swiftness swift swill swill - swills swill swim swim - swimmer swimmer swimmers swimmer - swimming swim swims swim - swine swine swineherds swineherd - swing swing swinge swing - swinish swinish swinstead swinstead - switches switch swits swit - switzers switzer swol swol - swoll swoll swoln swoln - swoon swoon swooned swoon - swooning swoon swoons swoon - swoop swoop swoopstake swoopstak - swor swor sword sword - sworder sworder swords sword - swore swore sworn sworn - swounded swound swounds swound - swum swum swung swung - sy sy sycamore sycamor - sycorax sycorax sylla sylla - syllable syllabl syllables syllabl - syllogism syllog symbols symbol - sympathise sympathis sympathiz sympathiz - sympathize sympath sympathized sympath - sympathy sympathi synagogue synagogu - synod synod synods synod - syracuse syracus syracusian syracusian - syracusians syracusian syria syria - syrups syrup t t - ta ta taber taber - table tabl tabled tabl - tables tabl tablet tablet - tabor tabor taborer tabor - tabors tabor tabourines tabourin - taciturnity taciturn tack tack - tackle tackl tackled tackl - tackles tackl tackling tackl - tacklings tackl taddle taddl - tadpole tadpol taffeta taffeta - taffety taffeti tag tag - tagrag tagrag tah tah - tail tail tailor tailor - tailors tailor tails tail - taint taint tainted taint - tainting taint taints taint - tainture taintur tak tak - take take taken taken - taker taker takes take - takest takest taketh taketh - taking take tal tal - talbot talbot talbotites talbotit - talbots talbot tale tale - talent talent talents talent - taleporter taleport tales tale - talk talk talked talk - talker talker talkers talker - talkest talkest talking talk - talks talk tall tall - taller taller tallest tallest - tallies talli tallow tallow - tally talli talons talon - tam tam tambourines tambourin - tame tame tamed tame - tamely tame tameness tame - tamer tamer tames tame - taming tame tamora tamora - tamworth tamworth tan tan - tang tang tangle tangl - tangled tangl tank tank - tanlings tanl tann tann - tanned tan tanner tanner - tanquam tanquam tanta tanta - tantaene tantaen tap tap - tape tape taper taper - tapers taper tapestries tapestri - tapestry tapestri taphouse taphous - tapp tapp tapster tapster - tapsters tapster tar tar - tardied tardi tardily tardili - tardiness tardi tardy tardi - tarentum tarentum targe targ - targes targ target target - targets target tarpeian tarpeian - tarquin tarquin tarquins tarquin - tarr tarr tarre tarr - tarriance tarrianc tarried tarri - tarries tarri tarry tarri - tarrying tarri tart tart - tartar tartar tartars tartar - tartly tartli tartness tart - task task tasker tasker - tasking task tasks task - tassel tassel taste tast - tasted tast tastes tast - tasting tast tatt tatt - tatter tatter tattered tatter - tatters tatter tattle tattl - tattling tattl tattlings tattl - taught taught taunt taunt - taunted taunt taunting taunt - tauntingly tauntingli taunts taunt - taurus tauru tavern tavern - taverns tavern tavy tavi - tawdry tawdri tawny tawni - tax tax taxation taxat - taxations taxat taxes tax - taxing tax tc tc - te te teach teach - teacher teacher teachers teacher - teaches teach teachest teachest - teacheth teacheth teaching teach - team team tear tear - tearful tear tearing tear - tears tear tearsheet tearsheet - teat teat tedious tediou - tediously tedious tediousness tedious - teem teem teeming teem - teems teem teen teen - teeth teeth teipsum teipsum - telamon telamon telamonius telamoniu - tell tell teller teller - telling tell tells tell - tellus tellu temp temp - temper temper temperality temper - temperance temper temperate temper - temperately temper tempers temper - tempest tempest tempests tempest - tempestuous tempestu temple templ - temples templ temporal tempor - temporary temporari temporiz temporiz - temporize tempor temporizer tempor - temps temp tempt tempt - temptation temptat temptations temptat - tempted tempt tempter tempter - tempters tempter tempteth tempteth - tempting tempt tempts tempt - ten ten tenable tenabl - tenant tenant tenantius tenantiu - tenantless tenantless tenants tenant - tench tench tend tend - tendance tendanc tended tend - tender tender tendered tender - tenderly tenderli tenderness tender - tenders tender tending tend - tends tend tenedos tenedo - tenement tenement tenements tenement - tenfold tenfold tennis tenni - tenour tenour tenours tenour - tens ten tent tent - tented tent tenth tenth - tenths tenth tents tent - tenure tenur tenures tenur - tercel tercel tereus tereu - term term termagant termag - termed term terminations termin - termless termless terms term - terra terra terrace terrac - terram terram terras terra - terre terr terrene terren - terrestrial terrestri terrible terribl - terribly terribl territories territori - territory territori terror terror - terrors terror tertian tertian - tertio tertio test test - testament testament tested test - tester tester testern testern - testify testifi testimonied testimoni - testimonies testimoni testimony testimoni - testiness testi testril testril - testy testi tetchy tetchi - tether tether tetter tetter - tevil tevil tewksbury tewksburi - text text tgv tgv - th th thaes thae - thames thame than than - thane thane thanes thane - thank thank thanked thank - thankful thank thankfully thankfulli - thankfulness thank thanking thank - thankings thank thankless thankless - thanks thank thanksgiving thanksgiv - thasos thaso that that - thatch thatch thaw thaw - thawing thaw thaws thaw - the the theatre theatr - theban theban thebes thebe - thee thee theft theft - thefts theft thein thein - their their theirs their - theise theis them them - theme theme themes theme - themselves themselv then then - thence thenc thenceforth thenceforth - theoric theoric there there - thereabout thereabout thereabouts thereabout - thereafter thereaft thereat thereat - thereby therebi therefore therefor - therein therein thereof thereof - thereon thereon thereto thereto - thereunto thereunto thereupon thereupon - therewith therewith therewithal therewith - thersites thersit these these - theseus theseu thessalian thessalian - thessaly thessali thetis theti - thews thew they thei - thick thick thicken thicken - thickens thicken thicker thicker - thickest thickest thicket thicket - thickskin thickskin thief thief - thievery thieveri thieves thiev - thievish thievish thigh thigh - thighs thigh thimble thimbl - thimbles thimbl thin thin - thine thine thing thing - things thing think think - thinkest thinkest thinking think - thinkings think thinks think - thinkst thinkst thinly thinli - third third thirdly thirdli - thirds third thirst thirst - thirsting thirst thirsts thirst - thirsty thirsti thirteen thirteen - thirties thirti thirtieth thirtieth - thirty thirti this thi - thisby thisbi thisne thisn - thistle thistl thistles thistl - thither thither thitherward thitherward - thoas thoa thomas thoma - thorn thorn thorns thorn - thorny thorni thorough thorough - thoroughly thoroughli those those - thou thou though though - thought thought thoughtful thought - thoughts thought thousand thousand - thousands thousand thracian thracian - thraldom thraldom thrall thrall - thralled thrall thralls thrall - thrash thrash thrasonical thrason - thread thread threadbare threadbar - threaden threaden threading thread - threat threat threaten threaten - threatening threaten threatens threaten - threatest threatest threats threat - three three threefold threefold - threepence threepenc threepile threepil - threes three threescore threescor - thresher thresher threshold threshold - threw threw thrice thrice - thrift thrift thriftless thriftless - thrifts thrift thrifty thrifti - thrill thrill thrilling thrill - thrills thrill thrive thrive - thrived thrive thrivers thriver - thrives thrive thriving thrive - throat throat throats throat - throbbing throb throbs throb - throca throca throe throe - throes throe thromuldo thromuldo - thron thron throne throne - throned throne thrones throne - throng throng thronging throng - throngs throng throstle throstl - throttle throttl through through - throughfare throughfar throughfares throughfar - throughly throughli throughout throughout - throw throw thrower thrower - throwest throwest throwing throw - thrown thrown throws throw - thrum thrum thrumm thrumm - thrush thrush thrust thrust - thrusteth thrusteth thrusting thrust - thrusts thrust thumb thumb - thumbs thumb thump thump - thund thund thunder thunder - thunderbolt thunderbolt thunderbolts thunderbolt - thunderer thunder thunders thunder - thunderstone thunderston thunderstroke thunderstrok - thurio thurio thursday thursdai - thus thu thwack thwack - thwart thwart thwarted thwart - thwarting thwart thwartings thwart - thy thy thyme thyme - thymus thymu thyreus thyreu - thyself thyself ti ti - tib tib tiber tiber - tiberio tiberio tibey tibei - ticed tice tick tick - tickl tickl tickle tickl - tickled tickl tickles tickl - tickling tickl ticklish ticklish - tiddle tiddl tide tide - tides tide tidings tide - tidy tidi tie tie - tied ti ties ti - tiff tiff tiger tiger - tigers tiger tight tight - tightly tightli tike tike - til til tile tile - till till tillage tillag - tilly tilli tilt tilt - tilter tilter tilth tilth - tilting tilt tilts tilt - tiltyard tiltyard tim tim - timandra timandra timber timber - time time timeless timeless - timelier timeli timely time - times time timon timon - timor timor timorous timor - timorously timor tinct tinct - tincture tinctur tinctures tinctur - tinder tinder tingling tingl - tinker tinker tinkers tinker - tinsel tinsel tiny tini - tip tip tipp tipp - tippling tippl tips tip - tipsy tipsi tiptoe tipto - tir tir tire tire - tired tire tires tire - tirest tirest tiring tire - tirra tirra tirrits tirrit - tis ti tish tish - tisick tisick tissue tissu - titan titan titania titania - tithe tith tithed tith - tithing tith titinius titiniu - title titl titled titl - titleless titleless titles titl - tittle tittl tittles tittl - titular titular titus titu - tn tn to to - toad toad toads toad - toadstool toadstool toast toast - toasted toast toasting toast - toasts toast toaze toaz - toby tobi tock tock - tod tod today todai - todpole todpol tods tod - toe toe toes toe - tofore tofor toge toge - toged toge together togeth - toil toil toiled toil - toiling toil toils toil - token token tokens token - told told toledo toledo - tolerable toler toll toll - tolling toll tom tom - tomb tomb tombe tomb - tombed tomb tombless tombless - tomboys tomboi tombs tomb - tomorrow tomorrow tomyris tomyri - ton ton tongs tong - tongu tongu tongue tongu - tongued tongu tongueless tongueless - tongues tongu tonight tonight - too too took took - tool tool tools tool - tooth tooth toothache toothach - toothpick toothpick toothpicker toothpick - top top topas topa - topful top topgallant topgal - topless topless topmast topmast - topp topp topping top - topple toppl topples toppl - tops top topsail topsail - topsy topsi torch torch - torchbearer torchbear torchbearers torchbear - torcher torcher torches torch - torchlight torchlight tore tore - torment torment tormenta tormenta - tormente torment tormented torment - tormenting torment tormentors tormentor - torments torment torn torn - torrent torrent tortive tortiv - tortoise tortois tortur tortur - torture tortur tortured tortur - torturer tortur torturers tortur - tortures tortur torturest torturest - torturing tortur toryne toryn - toss toss tossed toss - tosseth tosseth tossing toss - tot tot total total - totally total tott tott - tottered totter totters totter - tou tou touch touch - touched touch touches touch - toucheth toucheth touching touch - touchstone touchston tough tough - tougher tougher toughness tough - touraine tourain tournaments tournament - tours tour tous tou - tout tout touze touz - tow tow toward toward - towardly towardli towards toward - tower tower towering tower - towers tower town town - towns town township township - townsman townsman townsmen townsmen - towton towton toy toi - toys toi trace trace - traces trace track track - tract tract tractable tractabl - trade trade traded trade - traders trader trades trade - tradesman tradesman tradesmen tradesmen - trading trade tradition tradit - traditional tradit traduc traduc - traduced traduc traducement traduc - traffic traffic traffickers traffick - traffics traffic tragedian tragedian - tragedians tragedian tragedies tragedi - tragedy tragedi tragic tragic - tragical tragic trail trail - train train trained train - training train trains train - trait trait traitor traitor - traitorly traitorli traitorous traitor - traitorously traitor traitors traitor - traitress traitress traject traject - trammel trammel trample trampl - trampled trampl trampling trampl - tranc tranc trance tranc - tranio tranio tranquil tranquil - tranquillity tranquil transcendence transcend - transcends transcend transferred transfer - transfigur transfigur transfix transfix - transform transform transformation transform - transformations transform transformed transform - transgress transgress transgresses transgress - transgressing transgress transgression transgress - translate translat translated translat - translates translat translation translat - transmigrates transmigr transmutation transmut - transparent transpar transport transport - transportance transport transported transport - transporting transport transports transport - transpose transpos transshape transshap - trap trap trapp trapp - trappings trap traps trap - trash trash travail travail - travails travail travel travel - traveler travel traveling travel - travell travel travelled travel - traveller travel travellers travel - travellest travellest travelling travel - travels travel travers traver - traverse travers tray trai - treacherous treacher treacherously treacher - treachers treacher treachery treacheri - tread tread treading tread - treads tread treason treason - treasonable treason treasonous treason - treasons treason treasure treasur - treasurer treasur treasures treasur - treasuries treasuri treasury treasuri - treat treat treaties treati - treatise treatis treats treat - treaty treati treble trebl - trebled trebl trebles trebl - trebonius treboniu tree tree - trees tree tremble trembl - trembled trembl trembles trembl - tremblest tremblest trembling trembl - tremblingly tremblingli tremor tremor - trempling trempl trench trench - trenchant trenchant trenched trench - trencher trencher trenchering trencher - trencherman trencherman trenchers trencher - trenches trench trenching trench - trent trent tres tre - trespass trespass trespasses trespass - tressel tressel tresses tress - treys trei trial trial - trials trial trib trib - tribe tribe tribes tribe - tribulation tribul tribunal tribun - tribune tribun tribunes tribun - tributaries tributari tributary tributari - tribute tribut tributes tribut - trice trice trick trick - tricking trick trickling trickl - tricks trick tricksy tricksi - trident trident tried tri - trier trier trifle trifl - trifled trifl trifler trifler - trifles trifl trifling trifl - trigon trigon trill trill - trim trim trimly trimli - trimm trimm trimmed trim - trimming trim trims trim - trinculo trinculo trinculos trinculo - trinkets trinket trip trip - tripartite tripartit tripe tripe - triple tripl triplex triplex - tripoli tripoli tripolis tripoli - tripp tripp tripping trip - trippingly trippingli trips trip - tristful trist triton triton - triumph triumph triumphant triumphant - triumphantly triumphantli triumpher triumpher - triumphers triumpher triumphing triumph - triumphs triumph triumvir triumvir - triumvirate triumvir triumvirs triumvir - triumviry triumviri trivial trivial - troat troat trod trod - trodden trodden troiant troiant - troien troien troilus troilu - troiluses troilus trojan trojan - trojans trojan troll troll - tromperies tromperi trompet trompet - troop troop trooping troop - troops troop trop trop - trophies trophi trophy trophi - tropically tropic trot trot - troth troth trothed troth - troths troth trots trot - trotting trot trouble troubl - troubled troubl troubler troubler - troubles troubl troublesome troublesom - troublest troublest troublous troublou - trough trough trout trout - trouts trout trovato trovato - trow trow trowel trowel - trowest trowest troy troi - troyan troyan troyans troyan - truant truant truce truce - truckle truckl trudge trudg - true true trueborn trueborn - truepenny truepenni truer truer - truest truest truie truie - trull trull trulls trull - truly truli trump trump - trumpery trumperi trumpet trumpet - trumpeter trumpet trumpeters trumpet - trumpets trumpet truncheon truncheon - truncheoners truncheon trundle trundl - trunk trunk trunks trunk - trust trust trusted trust - truster truster trusters truster - trusting trust trusts trust - trusty trusti truth truth - truths truth try try - ts ts tu tu - tuae tuae tub tub - tubal tubal tubs tub - tuck tuck tucket tucket - tuesday tuesdai tuft tuft - tufts tuft tug tug - tugg tugg tugging tug - tuition tuition tullus tullu - tully tulli tumble tumbl - tumbled tumbl tumbler tumbler - tumbling tumbl tumult tumult - tumultuous tumultu tun tun - tune tune tuneable tuneabl - tuned tune tuners tuner - tunes tune tunis tuni - tuns tun tupping tup - turban turban turbans turban - turbulence turbul turbulent turbul - turd turd turf turf - turfy turfi turk turk - turkey turkei turkeys turkei - turkish turkish turks turk - turlygod turlygod turmoil turmoil - turmoiled turmoil turn turn - turnbull turnbul turncoat turncoat - turncoats turncoat turned turn - turneth turneth turning turn - turnips turnip turns turn - turph turph turpitude turpitud - turquoise turquois turret turret - turrets turret turtle turtl - turtles turtl turvy turvi - tuscan tuscan tush tush - tut tut tutor tutor - tutored tutor tutors tutor - tutto tutto twain twain - twang twang twangling twangl - twas twa tway twai - tweaks tweak tween tween - twelfth twelfth twelve twelv - twelvemonth twelvemonth twentieth twentieth - twenty twenti twere twere - twice twice twig twig - twiggen twiggen twigs twig - twilight twilight twill twill - twilled twill twin twin - twine twine twink twink - twinkle twinkl twinkled twinkl - twinkling twinkl twinn twinn - twins twin twire twire - twist twist twisted twist - twit twit twits twit - twitting twit twixt twixt - two two twofold twofold - twopence twopenc twopences twopenc - twos two twould twould - tyb tyb tybalt tybalt - tybalts tybalt tyburn tyburn - tying ty tyke tyke - tymbria tymbria type type - types type typhon typhon - tyrannical tyrann tyrannically tyrann - tyrannize tyrann tyrannous tyrann - tyranny tyranni tyrant tyrant - tyrants tyrant tyrian tyrian - tyrrel tyrrel u u - ubique ubiqu udders udder - udge udg uds ud - uglier uglier ugliest ugliest - ugly ugli ulcer ulcer - ulcerous ulcer ulysses ulyss - um um umber umber - umbra umbra umbrage umbrag - umfrevile umfrevil umpire umpir - umpires umpir un un - unable unabl unaccommodated unaccommod - unaccompanied unaccompani unaccustom unaccustom - unaching unach unacquainted unacquaint - unactive unact unadvis unadvi - unadvised unadvis unadvisedly unadvisedli - unagreeable unagre unanel unanel - unanswer unansw unappeas unappea - unapproved unapprov unapt unapt - unaptness unapt unarm unarm - unarmed unarm unarms unarm - unassail unassail unassailable unassail - unattainted unattaint unattempted unattempt - unattended unattend unauspicious unauspici - unauthorized unauthor unavoided unavoid - unawares unawar unback unback - unbak unbak unbanded unband - unbar unbar unbarb unbarb - unbashful unbash unbated unbat - unbatter unbatt unbecoming unbecom - unbefitting unbefit unbegot unbegot - unbegotten unbegotten unbelieved unbeliev - unbend unbend unbent unbent - unbewail unbewail unbid unbid - unbidden unbidden unbind unbind - unbinds unbind unbitted unbit - unbless unbless unblest unblest - unbloodied unbloodi unblown unblown - unbodied unbodi unbolt unbolt - unbolted unbolt unbonneted unbonnet - unbookish unbookish unborn unborn - unbosom unbosom unbound unbound - unbounded unbound unbow unbow - unbowed unbow unbrac unbrac - unbraced unbrac unbraided unbraid - unbreathed unbreath unbred unbr - unbreech unbreech unbridled unbridl - unbroke unbrok unbruis unbrui - unbruised unbruis unbuckle unbuckl - unbuckles unbuckl unbuckling unbuckl - unbuild unbuild unburden unburden - unburdens unburden unburied unburi - unburnt unburnt unburthen unburthen - unbutton unbutton unbuttoning unbutton - uncapable uncap uncape uncap - uncase uncas uncasing uncas - uncaught uncaught uncertain uncertain - uncertainty uncertainti unchain unchain - unchanging unchang uncharge uncharg - uncharged uncharg uncharitably uncharit - unchary unchari unchaste unchast - uncheck uncheck unchilded unchild - uncivil uncivil unclaim unclaim - unclasp unclasp uncle uncl - unclean unclean uncleanliness uncleanli - uncleanly uncleanli uncleanness unclean - uncles uncl unclew unclew - unclog unclog uncoined uncoin - uncolted uncolt uncomeliness uncomeli - uncomfortable uncomfort uncompassionate uncompassion - uncomprehensive uncomprehens unconfinable unconfin - unconfirm unconfirm unconfirmed unconfirm - unconquer unconqu unconquered unconqu - unconsidered unconsid unconstant unconst - unconstrain unconstrain unconstrained unconstrain - uncontemn uncontemn uncontroll uncontrol - uncorrected uncorrect uncounted uncount - uncouple uncoupl uncourteous uncourt - uncouth uncouth uncover uncov - uncovered uncov uncropped uncrop - uncross uncross uncrown uncrown - unction unction unctuous unctuou - uncuckolded uncuckold uncurable uncur - uncurbable uncurb uncurbed uncurb - uncurls uncurl uncurrent uncurr - uncurse uncurs undaunted undaunt - undeaf undeaf undeck undeck - undeeded undeed under under - underbearing underbear underborne underborn - undercrest undercrest underfoot underfoot - undergo undergo undergoes undergo - undergoing undergo undergone undergon - underground underground underhand underhand - underlings underl undermine undermin - underminers undermin underneath underneath - underprizing underpr underprop underprop - understand understand understandeth understandeth - understanding understand understandings understand - understands understand understood understood - underta underta undertake undertak - undertakeing undertak undertaker undertak - undertakes undertak undertaking undertak - undertakings undertak undertook undertook - undervalu undervalu undervalued undervalu - underwent underw underwrit underwrit - underwrite underwrit undescried undescri - undeserved undeserv undeserver undeserv - undeservers undeserv undeserving undeserv - undetermin undetermin undid undid - undinted undint undiscernible undiscern - undiscover undiscov undishonoured undishonour - undispos undispo undistinguishable undistinguish - undistinguished undistinguish undividable undivid - undivided undivid undivulged undivulg - undo undo undoes undo - undoing undo undone undon - undoubted undoubt undoubtedly undoubtedli - undream undream undress undress - undressed undress undrown undrown - unduteous undut undutiful unduti - une un uneared unear - unearned unearn unearthly unearthli - uneasines uneasin uneasy uneasi - uneath uneath uneducated uneduc - uneffectual uneffectu unelected unelect - unequal unequ uneven uneven - unexamin unexamin unexecuted unexecut - unexpected unexpect unexperienc unexperienc - unexperient unexperi unexpressive unexpress - unfair unfair unfaithful unfaith - unfallible unfal unfam unfam - unfashionable unfashion unfasten unfasten - unfather unfath unfathered unfath - unfed unf unfeed unfe - unfeeling unfeel unfeigned unfeign - unfeignedly unfeignedli unfellowed unfellow - unfelt unfelt unfenced unfenc - unfilial unfili unfill unfil - unfinish unfinish unfirm unfirm - unfit unfit unfitness unfit - unfix unfix unfledg unfledg - unfold unfold unfolded unfold - unfoldeth unfoldeth unfolding unfold - unfolds unfold unfool unfool - unforc unforc unforced unforc - unforfeited unforfeit unfortified unfortifi - unfortunate unfortun unfought unfought - unfrequented unfrequ unfriended unfriend - unfurnish unfurnish ungain ungain - ungalled ungal ungart ungart - ungarter ungart ungenitur ungenitur - ungentle ungentl ungentleness ungentl - ungently ungent ungird ungird - ungodly ungodli ungor ungor - ungot ungot ungotten ungotten - ungovern ungovern ungracious ungraci - ungrateful ungrat ungravely ungrav - ungrown ungrown unguarded unguard - unguem unguem unguided unguid - unhack unhack unhair unhair - unhallow unhallow unhallowed unhallow - unhand unhand unhandled unhandl - unhandsome unhandsom unhang unhang - unhappied unhappi unhappily unhappili - unhappiness unhappi unhappy unhappi - unhardened unharden unharm unharm - unhatch unhatch unheard unheard - unhearts unheart unheedful unheed - unheedfully unheedfulli unheedy unheedi - unhelpful unhelp unhidden unhidden - unholy unholi unhop unhop - unhopefullest unhopefullest unhorse unhors - unhospitable unhospit unhous unhou - unhoused unhous unhurtful unhurt - unicorn unicorn unicorns unicorn - unimproved unimprov uninhabitable uninhabit - uninhabited uninhabit unintelligent unintellig - union union unions union - unite unit united unit - unity uniti universal univers - universe univers universities univers - university univers unjointed unjoint - unjust unjust unjustice unjustic - unjustly unjustli unkennel unkennel - unkept unkept unkind unkind - unkindest unkindest unkindly unkindli - unkindness unkind unking unk - unkinglike unkinglik unkiss unkiss - unknit unknit unknowing unknow - unknown unknown unlace unlac - unlaid unlaid unlawful unlaw - unlawfully unlawfulli unlearn unlearn - unlearned unlearn unless unless - unlesson unlesson unletter unlett - unlettered unlett unlick unlick - unlike unlik unlikely unlik - unlimited unlimit unlineal unlin - unlink unlink unload unload - unloaded unload unloading unload - unloads unload unlock unlock - unlocks unlock unlook unlook - unlooked unlook unloos unloo - unloose unloos unlov unlov - unloving unlov unluckily unluckili - unlucky unlucki unmade unmad - unmake unmak unmanly unmanli - unmann unmann unmanner unmann - unmannerd unmannerd unmannerly unmannerli - unmarried unmarri unmask unmask - unmasked unmask unmasking unmask - unmasks unmask unmast unmast - unmatch unmatch unmatchable unmatch - unmatched unmatch unmeasurable unmeasur - unmeet unmeet unmellowed unmellow - unmerciful unmerci unmeritable unmerit - unmeriting unmerit unminded unmind - unmindfull unmindful unmingled unmingl - unmitigable unmitig unmitigated unmitig - unmix unmix unmoan unmoan - unmov unmov unmoved unmov - unmoving unmov unmuffles unmuffl - unmuffling unmuffl unmusical unmus - unmuzzle unmuzzl unmuzzled unmuzzl - unnatural unnatur unnaturally unnatur - unnaturalness unnatur unnecessarily unnecessarili - unnecessary unnecessari unneighbourly unneighbourli - unnerved unnerv unnoble unnobl - unnoted unnot unnumb unnumb - unnumber unnumb unowed unow - unpack unpack unpaid unpaid - unparagon unparagon unparallel unparallel - unpartial unparti unpath unpath - unpaved unpav unpay unpai - unpeaceable unpeac unpeg unpeg - unpeople unpeopl unpeopled unpeopl - unperfect unperfect unperfectness unperfect - unpick unpick unpin unpin - unpink unpink unpitied unpiti - unpitifully unpitifulli unplagu unplagu - unplausive unplaus unpleas unplea - unpleasant unpleas unpleasing unpleas - unpolicied unpolici unpolish unpolish - unpolished unpolish unpolluted unpollut - unpossess unpossess unpossessing unpossess - unpossible unposs unpractis unpracti - unpregnant unpregn unpremeditated unpremedit - unprepar unprepar unprepared unprepar - unpress unpress unprevailing unprevail - unprevented unprev unpriz unpriz - unprizable unpriz unprofitable unprofit - unprofited unprofit unproper unprop - unproperly unproperli unproportion unproport - unprovide unprovid unprovided unprovid - unprovident unprovid unprovokes unprovok - unprun unprun unpruned unprun - unpublish unpublish unpurged unpurg - unpurpos unpurpo unqualitied unqual - unqueen unqueen unquestion unquest - unquestionable unquestion unquiet unquiet - unquietly unquietli unquietness unquiet - unraised unrais unrak unrak - unread unread unready unreadi - unreal unreal unreasonable unreason - unreasonably unreason unreclaimed unreclaim - unreconciled unreconcil unreconciliable unreconcili - unrecounted unrecount unrecuring unrecur - unregarded unregard unregist unregist - unrelenting unrel unremovable unremov - unremovably unremov unreprievable unrepriev - unresolv unresolv unrespected unrespect - unrespective unrespect unrest unrest - unrestor unrestor unrestrained unrestrain - unreveng unreveng unreverend unreverend - unreverent unrever unrevers unrev - unrewarded unreward unrighteous unright - unrightful unright unripe unrip - unripp unripp unrivall unrival - unroll unrol unroof unroof - unroosted unroost unroot unroot - unrough unrough unruly unruli - unsafe unsaf unsaluted unsalut - unsanctified unsanctifi unsatisfied unsatisfi - unsavoury unsavouri unsay unsai - unscalable unscal unscann unscann - unscarr unscarr unschool unschool - unscorch unscorch unscour unscour - unscratch unscratch unseal unseal - unseam unseam unsearch unsearch - unseason unseason unseasonable unseason - unseasonably unseason unseasoned unseason - unseconded unsecond unsecret unsecret - unseduc unseduc unseeing unse - unseeming unseem unseemly unseemli - unseen unseen unseminar unseminar - unseparable unsepar unserviceable unservic - unset unset unsettle unsettl - unsettled unsettl unsever unsev - unsex unsex unshak unshak - unshaked unshak unshaken unshaken - unshaped unshap unshapes unshap - unsheath unsheath unsheathe unsheath - unshorn unshorn unshout unshout - unshown unshown unshrinking unshrink - unshrubb unshrubb unshunn unshunn - unshunnable unshunn unsifted unsift - unsightly unsightli unsinew unsinew - unsisting unsist unskilful unskil - unskilfully unskilfulli unskillful unskil - unslipping unslip unsmirched unsmirch - unsoil unsoil unsolicited unsolicit - unsorted unsort unsought unsought - unsound unsound unsounded unsound - unspeak unspeak unspeakable unspeak - unspeaking unspeak unsphere unspher - unspoke unspok unspoken unspoken - unspotted unspot unsquar unsquar - unstable unstabl unstaid unstaid - unstain unstain unstained unstain - unstanched unstanch unstate unstat - unsteadfast unsteadfast unstooping unstoop - unstringed unstring unstuff unstuff - unsubstantial unsubstanti unsuitable unsuit - unsuiting unsuit unsullied unsulli - unsunn unsunn unsur unsur - unsure unsur unsuspected unsuspect - unsway unswai unswayable unsway - unswayed unswai unswear unswear - unswept unswept unsworn unsworn - untainted untaint untalk untalk - untangle untangl untangled untangl - untasted untast untaught untaught - untempering untemp untender untend - untent untent untented untent - unthankful unthank unthankfulness unthank - unthink unthink unthought unthought - unthread unthread unthrift unthrift - unthrifts unthrift unthrifty unthrifti - untie unti untied unti - until until untimber untimb - untimely untim untir untir - untirable untir untired untir - untitled untitl unto unto - untold untold untouch untouch - untoward untoward untowardly untowardli - untraded untrad untrain untrain - untrained untrain untread untread - untreasur untreasur untried untri - untrimmed untrim untrod untrod - untrodden untrodden untroubled untroubl - untrue untru untrussing untruss - untruth untruth untruths untruth - untucked untuck untun untun - untune untun untuneable untun - untutor untutor untutored untutor - untwine untwin unurg unurg - unus unu unused unus - unusual unusu unvalued unvalu - unvanquish unvanquish unvarnish unvarnish - unveil unveil unveiling unveil - unvenerable unvener unvex unvex - unviolated unviol unvirtuous unvirtu - unvisited unvisit unvulnerable unvulner - unwares unwar unwarily unwarili - unwash unwash unwatch unwatch - unwearied unweari unwed unw - unwedgeable unwedg unweeded unweed - unweighed unweigh unweighing unweigh - unwelcome unwelcom unwept unwept - unwhipp unwhipp unwholesome unwholesom - unwieldy unwieldi unwilling unwil - unwillingly unwillingli unwillingness unwilling - unwind unwind unwiped unwip - unwise unwis unwisely unwis - unwish unwish unwished unwish - unwitted unwit unwittingly unwittingli - unwonted unwont unwooed unwoo - unworthier unworthi unworthiest unworthiest - unworthily unworthili unworthiness unworthi - unworthy unworthi unwrung unwrung - unyok unyok unyoke unyok - up up upbraid upbraid - upbraided upbraid upbraidings upbraid - upbraids upbraid uphoarded uphoard - uphold uphold upholdeth upholdeth - upholding uphold upholds uphold - uplift uplift uplifted uplift - upmost upmost upon upon - upper upper uprear uprear - upreared uprear upright upright - uprighteously upright uprightness upright - uprise upris uprising upris - uproar uproar uproars uproar - uprous uprou upshoot upshoot - upshot upshot upside upsid - upspring upspr upstairs upstair - upstart upstart upturned upturn - upward upward upwards upward - urchin urchin urchinfield urchinfield - urchins urchin urg urg - urge urg urged urg - urgent urgent urges urg - urgest urgest urging urg - urinal urin urinals urin - urine urin urn urn - urns urn urs ur - ursa ursa ursley urslei - ursula ursula urswick urswick - us us usage usag - usance usanc usances usanc - use us used us - useful us useless useless - user user uses us - usest usest useth useth - usher usher ushered usher - ushering usher ushers usher - using us usual usual - usually usual usurer usur - usurers usur usuries usuri - usuring usur usurp usurp - usurpation usurp usurped usurp - usurper usurp usurpers usurp - usurping usurp usurpingly usurpingli - usurps usurp usury usuri - ut ut utensil utensil - utensils utensil utility util - utmost utmost utt utt - utter utter utterance utter - uttered utter uttereth uttereth - uttering utter utterly utterli - uttermost uttermost utters utter - uy uy v v - va va vacancy vacanc - vacant vacant vacation vacat - vade vade vagabond vagabond - vagabonds vagabond vagram vagram - vagrom vagrom vail vail - vailed vail vailing vail - vaillant vaillant vain vain - vainer vainer vainglory vainglori - vainly vainli vainness vain - vais vai valanc valanc - valance valanc vale vale - valence valenc valentine valentin - valentinus valentinu valentio valentio - valeria valeria valerius valeriu - vales vale valiant valiant - valiantly valiantli valiantness valiant - validity valid vallant vallant - valley vallei valleys vallei - vally valli valor valor - valorous valor valorously valor - valour valour valu valu - valuation valuat value valu - valued valu valueless valueless - values valu valuing valu - vane vane vanish vanish - vanished vanish vanishes vanish - vanishest vanishest vanishing vanish - vanities vaniti vanity vaniti - vanquish vanquish vanquished vanquish - vanquisher vanquish vanquishest vanquishest - vanquisheth vanquisheth vant vant - vantage vantag vantages vantag - vantbrace vantbrac vapians vapian - vapor vapor vaporous vapor - vapour vapour vapours vapour - vara vara variable variabl - variance varianc variation variat - variations variat varied vari - variest variest variety varieti - varld varld varlet varlet - varletry varletri varlets varlet - varletto varletto varnish varnish - varrius varriu varro varro - vary vari varying vari - vassal vassal vassalage vassalag - vassals vassal vast vast - vastidity vastid vasty vasti - vat vat vater vater - vaudemont vaudemont vaughan vaughan - vault vault vaultages vaultag - vaulted vault vaulting vault - vaults vault vaulty vaulti - vaumond vaumond vaunt vaunt - vaunted vaunt vaunter vaunter - vaunting vaunt vauntingly vauntingli - vaunts vaunt vauvado vauvado - vaux vaux vaward vaward - ve ve veal veal - vede vede vehemence vehem - vehemency vehem vehement vehement - vehor vehor veil veil - veiled veil veiling veil - vein vein veins vein - vell vell velure velur - velutus velutu velvet velvet - vendible vendibl venerable vener - venereal vener venetia venetia - venetian venetian venetians venetian - veneys venei venge veng - vengeance vengeanc vengeances vengeanc - vengeful veng veni veni - venial venial venice venic - venison venison venit venit - venom venom venomous venom - venomously venom vent vent - ventages ventag vented vent - ventidius ventidiu ventricle ventricl - vents vent ventur ventur - venture ventur ventured ventur - ventures ventur venturing ventur - venturous ventur venue venu - venus venu venuto venuto - ver ver verb verb - verba verba verbal verbal - verbatim verbatim verbosity verbos - verdict verdict verdun verdun - verdure verdur vere vere - verefore verefor verg verg - verge verg vergers verger - verges verg verier verier - veriest veriest verified verifi - verify verifi verily verili - veritable verit verite verit - verities veriti verity veriti - vermilion vermilion vermin vermin - vernon vernon verona verona - veronesa veronesa versal versal - verse vers verses vers - versing vers vert vert - very veri vesper vesper - vessel vessel vessels vessel - vestal vestal vestments vestment - vesture vestur vetch vetch - vetches vetch veux veux - vex vex vexation vexat - vexations vexat vexed vex - vexes vex vexest vexest - vexeth vexeth vexing vex - vi vi via via - vial vial vials vial - viand viand viands viand - vic vic vicar vicar - vice vice vicegerent viceger - vicentio vicentio viceroy viceroi - viceroys viceroi vices vice - vici vici vicious viciou - viciousness vicious vict vict - victims victim victor victor - victoress victoress victories victori - victorious victori victors victor - victory victori victual victual - victuall victual victuals victual - videlicet videlicet video video - vides vide videsne videsn - vidi vidi vie vie - vied vi vienna vienna - view view viewest viewest - vieweth vieweth viewing view - viewless viewless views view - vigil vigil vigilance vigil - vigilant vigil vigitant vigit - vigour vigour vii vii - viii viii vile vile - vilely vile vileness vile - viler viler vilest vilest - vill vill village villag - villager villag villagery villageri - villages villag villain villain - villainies villaini villainous villain - villainously villain villains villain - villainy villaini villanies villani - villanous villan villany villani - villiago villiago villian villian - villianda villianda villians villian - vinaigre vinaigr vincentio vincentio - vincere vincer vindicative vindic - vine vine vinegar vinegar - vines vine vineyard vineyard - vineyards vineyard vint vint - vintner vintner viol viol - viola viola violate violat - violated violat violates violat - violation violat violator violat - violence violenc violent violent - violenta violenta violenteth violenteth - violently violent violet violet - violets violet viper viper - viperous viper vipers viper - vir vir virgilia virgilia - virgin virgin virginal virgin - virginalling virginal virginity virgin - virginius virginiu virgins virgin - virgo virgo virtue virtu - virtues virtu virtuous virtuou - virtuously virtuous visag visag - visage visag visages visag - visard visard viscount viscount - visible visibl visibly visibl - vision vision visions vision - visit visit visitation visit - visitations visit visited visit - visiting visit visitings visit - visitor visitor visitors visitor - visits visit visor visor - vita vita vitae vita - vital vital vitement vitement - vitruvio vitruvio vitx vitx - viva viva vivant vivant - vive vive vixen vixen - viz viz vizaments vizament - vizard vizard vizarded vizard - vizards vizard vizor vizor - vlouting vlout vocation vocat - vocativo vocativo vocatur vocatur - voce voce voic voic - voice voic voices voic - void void voided void - voiding void voke voke - volable volabl volant volant - volivorco volivorco volley vollei - volquessen volquessen volsce volsc - volsces volsc volscian volscian - volscians volscian volt volt - voltemand voltemand volubility volubl - voluble volubl volume volum - volumes volum volumnia volumnia - volumnius volumniu voluntaries voluntari - voluntary voluntari voluptuously voluptu - voluptuousness voluptu vomissement vomiss - vomit vomit vomits vomit - vor vor vore vore - vortnight vortnight vot vot - votaries votari votarist votarist - votarists votarist votary votari - votre votr vouch vouch - voucher voucher vouchers voucher - vouches vouch vouching vouch - vouchsaf vouchsaf vouchsafe vouchsaf - vouchsafed vouchsaf vouchsafes vouchsaf - vouchsafing vouchsaf voudrais voudrai - vour vour vous vou - voutsafe voutsaf vow vow - vowed vow vowel vowel - vowels vowel vowing vow - vows vow vox vox - voyage voyag voyages voyag - vraiment vraiment vulcan vulcan - vulgar vulgar vulgarly vulgarli - vulgars vulgar vulgo vulgo - vulnerable vulner vulture vultur - vultures vultur vurther vurther - w w wad wad - waddled waddl wade wade - waded wade wafer wafer - waft waft waftage waftag - wafting waft wafts waft - wag wag wage wage - wager wager wagers wager - wages wage wagging wag - waggish waggish waggling waggl - waggon waggon waggoner waggon - wagon wagon wagoner wagon - wags wag wagtail wagtail - wail wail wailful wail - wailing wail wails wail - wain wain wainropes wainrop - wainscot wainscot waist waist - wait wait waited wait - waiter waiter waiteth waiteth - waiting wait waits wait - wak wak wake wake - waked wake wakefield wakefield - waken waken wakened waken - wakes wake wakest wakest - waking wake wales wale - walk walk walked walk - walking walk walks walk - wall wall walled wall - wallet wallet wallets wallet - wallon wallon walloon walloon - wallow wallow walls wall - walnut walnut walter walter - wan wan wand wand - wander wander wanderer wander - wanderers wander wandering wander - wanders wander wands wand - wane wane waned wane - wanes wane waning wane - wann wann want want - wanted want wanteth wanteth - wanting want wanton wanton - wantonly wantonli wantonness wanton - wantons wanton wants want - wappen wappen war war - warble warbl warbling warbl - ward ward warded ward - warden warden warder warder - warders warder wardrobe wardrob - wardrop wardrop wards ward - ware ware wares ware - warily warili warkworth warkworth - warlike warlik warm warm - warmed warm warmer warmer - warming warm warms warm - warmth warmth warn warn - warned warn warning warn - warnings warn warns warn - warp warp warped warp - warr warr warrant warrant - warranted warrant warranteth warranteth - warrantise warrantis warrantize warrant - warrants warrant warranty warranti - warren warren warrener warren - warring war warrior warrior - warriors warrior wars war - wart wart warwick warwick - warwickshire warwickshir wary wari - was wa wash wash - washed wash washer washer - washes wash washford washford - washing wash wasp wasp - waspish waspish wasps wasp - wassail wassail wassails wassail - wast wast waste wast - wasted wast wasteful wast - wasters waster wastes wast - wasting wast wat wat - watch watch watched watch - watchers watcher watches watch - watchful watch watching watch - watchings watch watchman watchman - watchmen watchmen watchword watchword - water water waterdrops waterdrop - watered water waterfly waterfli - waterford waterford watering water - waterish waterish waterpots waterpot - waterrugs waterrug waters water - waterton waterton watery wateri - wav wav wave wave - waved wave waver waver - waverer waver wavering waver - waves wave waving wave - waw waw wawl wawl - wax wax waxed wax - waxen waxen waxes wax - waxing wax way wai - waylaid waylaid waylay waylai - ways wai wayward wayward - waywarder wayward waywardness wayward - we we weak weak - weaken weaken weakens weaken - weaker weaker weakest weakest - weakling weakl weakly weakli - weakness weak weal weal - wealsmen wealsmen wealth wealth - wealthiest wealthiest wealthily wealthili - wealthy wealthi wealtlly wealtlli - wean wean weapon weapon - weapons weapon wear wear - wearer wearer wearers wearer - wearied weari wearies weari - weariest weariest wearily wearili - weariness weari wearing wear - wearisome wearisom wears wear - weary weari weasel weasel - weather weather weathercock weathercock - weathers weather weav weav - weave weav weaver weaver - weavers weaver weaves weav - weaving weav web web - wed wed wedded wed - wedding wed wedg wedg - wedged wedg wedges wedg - wedlock wedlock wednesday wednesdai - weed weed weeded weed - weeder weeder weeding weed - weeds weed weedy weedi - week week weeke week - weekly weekli weeks week - ween ween weening ween - weep weep weeper weeper - weeping weep weepingly weepingli - weepings weep weeps weep - weet weet weigh weigh - weighed weigh weighing weigh - weighs weigh weight weight - weightier weightier weightless weightless - weights weight weighty weighti - weird weird welcom welcom - welcome welcom welcomer welcom - welcomes welcom welcomest welcomest - welfare welfar welkin welkin - well well wells well - welsh welsh welshman welshman - welshmen welshmen welshwomen welshwomen - wench wench wenches wench - wenching wench wend wend - went went wept wept - weraday weradai were were - wert wert west west - western western westminster westminst - westmoreland westmoreland westward westward - wet wet wether wether - wetting wet wezand wezand - whale whale whales whale - wharf wharf wharfs wharf - what what whate whate - whatever whatev whatsoe whatso - whatsoever whatsoev whatsome whatsom - whe whe wheat wheat - wheaten wheaten wheel wheel - wheeling wheel wheels wheel - wheer wheer wheeson wheeson - wheezing wheez whelk whelk - whelks whelk whelm whelm - whelp whelp whelped whelp - whelps whelp when when - whenas whena whence whenc - whencesoever whencesoev whene whene - whenever whenev whensoever whensoev - where where whereabout whereabout - whereas wherea whereat whereat - whereby wherebi wherefore wherefor - wherein wherein whereinto whereinto - whereof whereof whereon whereon - whereout whereout whereso whereso - wheresoe whereso wheresoever wheresoev - wheresome wheresom whereto whereto - whereuntil whereuntil whereunto whereunto - whereupon whereupon wherever wherev - wherewith wherewith wherewithal wherewith - whet whet whether whether - whetstone whetston whetted whet - whew whew whey whei - which which whiff whiff - whiffler whiffler while while - whiles while whilst whilst - whin whin whine whine - whined whine whinid whinid - whining whine whip whip - whipp whipp whippers whipper - whipping whip whips whip - whipster whipster whipstock whipstock - whipt whipt whirl whirl - whirled whirl whirligig whirligig - whirling whirl whirlpool whirlpool - whirls whirl whirlwind whirlwind - whirlwinds whirlwind whisp whisp - whisper whisper whispering whisper - whisperings whisper whispers whisper - whist whist whistle whistl - whistles whistl whistling whistl - whit whit white white - whitehall whitehal whitely white - whiteness white whiter whiter - whites white whitest whitest - whither whither whiting white - whitmore whitmor whitsters whitster - whitsun whitsun whittle whittl - whizzing whizz who who - whoa whoa whoe whoe - whoever whoever whole whole - wholesom wholesom wholesome wholesom - wholly wholli whom whom - whoobub whoobub whoop whoop - whooping whoop whor whor - whore whore whoremaster whoremast - whoremasterly whoremasterli whoremonger whoremong - whores whore whoreson whoreson - whoresons whoreson whoring whore - whorish whorish whose whose - whoso whoso whosoe whoso - whosoever whosoev why why - wi wi wick wick - wicked wick wickednes wickedn - wickedness wicked wicket wicket - wicky wicki wid wid - wide wide widens widen - wider wider widow widow - widowed widow widower widow - widowhood widowhood widows widow - wield wield wife wife - wight wight wights wight - wild wild wildcats wildcat - wilder wilder wilderness wilder - wildest wildest wildfire wildfir - wildly wildli wildness wild - wilds wild wiles wile - wilful wil wilfull wilful - wilfully wilfulli wilfulnes wilfuln - wilfulness wil will will - willed will willers willer - willeth willeth william william - williams william willing will - willingly willingli willingness willing - willoughby willoughbi willow willow - wills will wilt wilt - wiltshire wiltshir wimpled wimpl - win win wince winc - winch winch winchester winchest - wincot wincot wind wind - winded wind windgalls windgal - winding wind windlasses windlass - windmill windmil window window - windows window windpipe windpip - winds wind windsor windsor - windy windi wine wine - wing wing winged wing - wingfield wingfield wingham wingham - wings wing wink wink - winking wink winks wink - winner winner winners winner - winning win winnow winnow - winnowed winnow winnows winnow - wins win winter winter - winterly winterli winters winter - wip wip wipe wipe - wiped wipe wipes wipe - wiping wipe wire wire - wires wire wiry wiri - wisdom wisdom wisdoms wisdom - wise wise wiselier wiseli - wisely wise wiser wiser - wisest wisest wish wish - wished wish wisher wisher - wishers wisher wishes wish - wishest wishest wisheth wisheth - wishful wish wishing wish - wishtly wishtli wisp wisp - wist wist wit wit - witb witb witch witch - witchcraft witchcraft witches witch - witching witch with with - withal withal withdraw withdraw - withdrawing withdraw withdrawn withdrawn - withdrew withdrew wither wither - withered wither withering wither - withers wither withheld withheld - withhold withhold withholds withhold - within within withold withold - without without withstand withstand - withstanding withstand withstood withstood - witless witless witness wit - witnesses wit witnesseth witnesseth - witnessing wit wits wit - witted wit wittenberg wittenberg - wittiest wittiest wittily wittili - witting wit wittingly wittingli - wittol wittol wittolly wittolli - witty witti wiv wiv - wive wive wived wive - wives wive wiving wive - wizard wizard wizards wizard - wo wo woe woe - woeful woeful woefull woeful - woefullest woefullest woes woe - woful woful wolf wolf - wolfish wolfish wolsey wolsei - wolves wolv wolvish wolvish - woman woman womanhood womanhood - womanish womanish womankind womankind - womanly womanli womb womb - wombs womb womby wombi - women women won won - woncot woncot wond wond - wonder wonder wondered wonder - wonderful wonder wonderfully wonderfulli - wondering wonder wonders wonder - wondrous wondrou wondrously wondrous - wont wont wonted wont - woo woo wood wood - woodbine woodbin woodcock woodcock - woodcocks woodcock wooden wooden - woodland woodland woodman woodman - woodmonger woodmong woods wood - woodstock woodstock woodville woodvil - wooed woo wooer wooer - wooers wooer wooes wooe - woof woof wooing woo - wooingly wooingli wool wool - woollen woollen woolly woolli - woolsack woolsack woolsey woolsei - woolward woolward woos woo - wor wor worcester worcest - word word words word - wore wore worins worin - work work workers worker - working work workings work - workman workman workmanly workmanli - workmanship workmanship workmen workmen - works work worky worki - world world worldlings worldl - worldly worldli worlds world - worm worm worms worm - wormwood wormwood wormy wormi - worn worn worried worri - worries worri worry worri - worrying worri worse wors - worser worser worship worship - worshipful worship worshipfully worshipfulli - worshipp worshipp worshipper worshipp - worshippers worshipp worshippest worshippest - worships worship worst worst - worsted worst wort wort - worth worth worthied worthi - worthier worthier worthies worthi - worthiest worthiest worthily worthili - worthiness worthi worthless worthless - worths worth worthy worthi - worts wort wot wot - wots wot wotting wot - wouid wouid would would - wouldest wouldest wouldst wouldst - wound wound wounded wound - wounding wound woundings wound - woundless woundless wounds wound - wouns woun woven woven - wow wow wrack wrack - wrackful wrack wrangle wrangl - wrangler wrangler wranglers wrangler - wrangling wrangl wrap wrap - wrapp wrapp wraps wrap - wrapt wrapt wrath wrath - wrathful wrath wrathfully wrathfulli - wraths wrath wreak wreak - wreakful wreak wreaks wreak - wreath wreath wreathed wreath - wreathen wreathen wreaths wreath - wreck wreck wrecked wreck - wrecks wreck wren wren - wrench wrench wrenching wrench - wrens wren wrest wrest - wrested wrest wresting wrest - wrestle wrestl wrestled wrestl - wrestler wrestler wrestling wrestl - wretch wretch wretchcd wretchcd - wretched wretch wretchedness wretched - wretches wretch wring wring - wringer wringer wringing wring - wrings wring wrinkle wrinkl - wrinkled wrinkl wrinkles wrinkl - wrist wrist wrists wrist - writ writ write write - writer writer writers writer - writes write writhled writhl - writing write writings write - writs writ written written - wrong wrong wronged wrong - wronger wronger wrongful wrong - wrongfully wrongfulli wronging wrong - wrongly wrongli wrongs wrong - wronk wronk wrote wrote - wroth wroth wrought wrought - wrung wrung wry wry - wrying wry wt wt - wul wul wye wye - x x xanthippe xanthipp - xi xi xii xii - xiii xiii xiv xiv - xv xv y y - yard yard yards yard - yare yare yarely yare - yarn yarn yaughan yaughan - yaw yaw yawn yawn - yawning yawn ycleped yclepe - ycliped yclipe ye ye - yea yea yead yead - year year yearly yearli - yearn yearn yearns yearn - years year yeas yea - yeast yeast yedward yedward - yell yell yellow yellow - yellowed yellow yellowing yellow - yellowness yellow yellows yellow - yells yell yelping yelp - yeoman yeoman yeomen yeomen - yerk yerk yes ye - yesterday yesterdai yesterdays yesterdai - yesternight yesternight yesty yesti - yet yet yew yew - yicld yicld yield yield - yielded yield yielder yielder - yielders yielder yielding yield - yields yield yok yok - yoke yoke yoked yoke - yokefellow yokefellow yokes yoke - yoketh yoketh yon yon - yond yond yonder yonder - yongrey yongrei yore yore - yorick yorick york york - yorkists yorkist yorks york - yorkshire yorkshir you you - young young younger younger - youngest youngest youngling youngl - younglings youngl youngly youngli - younker younker your your - yours your yourself yourself - yourselves yourselv youth youth - youthful youth youths youth - youtli youtli zanies zani - zany zani zeal zeal - zealous zealou zeals zeal - zed zed zenelophon zenelophon - zenith zenith zephyrs zephyr - zir zir zo zo - zodiac zodiac zodiacs zodiac - zone zone zounds zound - zwagger zwagger + portrait portrait portraiture portraitur + ports port portugal portug + pose pose posied posi + posies posi position posit + positive posit positively posit + posse poss possess possess + possessed possess possesses possess + possesseth possesseth possessing possess + possession possess possessions possess + possessor possessor posset posset + possets posset possibilities possibl + possibility possibl possible possibl + possibly possibl possitable possit + post post poste post + posted post posterior posterior + posteriors posterior posterity poster + postern postern posterns postern + posters poster posthorse posthors + posthorses posthors posthumus posthumu + posting post postmaster postmast + posts post postscript postscript + posture postur postures postur + posy posi pot pot + potable potabl potations potat + potato potato potatoes potato + potch potch potency potenc + potent potent potentates potent + potential potenti potently potent + potents potent pothecary pothecari + pother pother potion potion + potions potion potpan potpan + pots pot potter potter + potting pot pottle pottl + pouch pouch poulter poulter + poultice poultic poultney poultnei + pouncet pouncet pound pound + pounds pound pour pour + pourest pourest pouring pour + pourquoi pourquoi pours pour + pout pout poverty poverti + pow pow powd powd + powder powder power power + powerful power powerfully powerfulli + powerless powerless powers power + pox pox poys poi + poysam poysam prabbles prabbl + practic practic practice practic + practiced practic practicer practic + practices practic practicing practic + practis practi practisants practis + practise practis practiser practis + practisers practis practises practis + practising practis praeclarissimus praeclarissimu + praemunire praemunir praetor praetor + praetors praetor pragging prag + prague pragu prain prain + prains prain prais prai + praise prais praised prais + praises prais praisest praisest + praiseworthy praiseworthi praising prais + prancing pranc prank prank + pranks prank prat prat + prate prate prated prate + prater prater prating prate + prattle prattl prattler prattler + prattling prattl prave prave + prawls prawl prawns prawn + pray prai prayer prayer + prayers prayer praying prai + prays prai pre pre + preach preach preached preach + preachers preacher preaches preach + preaching preach preachment preachment + pread pread preambulate preambul + precedence preced precedent preced + preceding preced precept precept + preceptial precepti precepts precept + precinct precinct precious preciou + preciously precious precipice precipic + precipitating precipit precipitation precipit + precise precis precisely precis + preciseness precis precisian precisian + precor precor precurse precurs + precursors precursor predeceased predeceas + predecessor predecessor predecessors predecessor + predestinate predestin predicament predica + predict predict prediction predict + predictions predict predominance predomin + predominant predomin predominate predomin + preeches preech preeminence preemin + preface prefac prefer prefer + preferment prefer preferments prefer + preferr preferr preferreth preferreth + preferring prefer prefers prefer + prefiguring prefigur prefix prefix + prefixed prefix preformed preform + pregnancy pregnanc pregnant pregnant + pregnantly pregnantli prejudicates prejud + prejudice prejudic prejudicial prejudici + prelate prelat premeditated premedit + premeditation premedit premised premis + premises premis prenez prenez + prenominate prenomin prentice prentic + prentices prentic preordinance preordin + prepar prepar preparation prepar + preparations prepar prepare prepar + prepared prepar preparedly preparedli + prepares prepar preparing prepar + prepost prepost preposterous preposter + preposterously preposter prerogatifes prerogatif + prerogative prerog prerogatived prerogativ + presage presag presagers presag + presages presag presageth presageth + presaging presag prescience prescienc + prescribe prescrib prescript prescript + prescription prescript prescriptions prescript + prescripts prescript presence presenc + presences presenc present present + presentation present presented present + presenter present presenters present + presenteth presenteth presenting present + presently present presentment present + presents present preserv preserv + preservation preserv preservative preserv + preserve preserv preserved preserv + preserver preserv preservers preserv + preserving preserv president presid + press press pressed press + presser presser presses press + pressing press pressure pressur + pressures pressur prest prest + prester prester presume presum + presumes presum presuming presum + presumption presumpt presumptuous presumptu + presuppos presuppo pret pret + pretence pretenc pretences pretenc + pretend pretend pretended pretend + pretending pretend pretense pretens + pretext pretext pretia pretia + prettier prettier prettiest prettiest + prettily prettili prettiness pretti + pretty pretti prevail prevail + prevailed prevail prevaileth prevaileth + prevailing prevail prevailment prevail + prevails prevail prevent prevent + prevented prevent prevention prevent + preventions prevent prevents prevent + prey prei preyful prey + preys prei priam priam + priami priami priamus priamu + pribbles pribbl price price + prick prick pricked prick + pricket pricket pricking prick + pricks prick pricksong pricksong + pride pride prides pride + pridge pridg prie prie + pried pri prief prief + pries pri priest priest + priesthood priesthood priests priest + prig prig primal primal + prime prime primer primer + primero primero primest primest + primitive primit primo primo + primogenity primogen primrose primros + primroses primros primy primi + prince princ princely princ + princes princ princess princess + principal princip principalities princip + principality princip principle principl + principles principl princox princox + prings pring print print + printed print printing print + printless printless prints print + prioress prioress priories priori + priority prioriti priory priori + priscian priscian prison prison + prisoner prison prisoners prison + prisonment prison prisonnier prisonni + prisons prison pristine pristin + prithe prith prithee prithe + privacy privaci private privat + privately privat privates privat + privilage privilag privileg privileg + privilege privileg privileged privileg + privileges privileg privilegio privilegio + privily privili privity priviti + privy privi priz priz + prize prize prized prize + prizer prizer prizes prize + prizest prizest prizing prize + pro pro probable probabl + probal probal probation probat + proceed proce proceeded proceed + proceeders proceed proceeding proceed + proceedings proceed proceeds proce + process process procession process + proclaim proclaim proclaimed proclaim + proclaimeth proclaimeth proclaims proclaim + proclamation proclam proclamations proclam + proconsul proconsul procrastinate procrastin + procreant procreant procreants procreant + procreation procreat procrus procru + proculeius proculeiu procur procur + procurator procur procure procur + procured procur procures procur + procuring procur prodigal prodig + prodigality prodig prodigally prodig + prodigals prodig prodigies prodigi + prodigious prodigi prodigiously prodigi + prodigy prodigi proditor proditor + produc produc produce produc + produced produc produces produc + producing produc proface profac + profan profan profanation profan + profane profan profaned profan + profanely profan profaneness profan + profaners profan profaning profan + profess profess professed profess + professes profess profession profess + professions profess professors professor + proffer proffer proffered proffer + profferer proffer proffers proffer + proficient profici profit profit + profitable profit profitably profit + profited profit profiting profit + profitless profitless profits profit + profound profound profoundest profoundest + profoundly profoundli progenitors progenitor + progeny progeni progne progn + prognosticate prognost prognostication prognost + progress progress progression progress + prohibit prohibit prohibition prohibit + project project projection project + projects project prolixious prolixi + prolixity prolix prologue prologu + prologues prologu prolong prolong + prolongs prolong promethean promethean + prometheus prometheu promis promi + promise promis promised promis + promises promis promiseth promiseth + promising promis promontory promontori + promotion promot promotions promot + prompt prompt prompted prompt + promptement promptement prompter prompter + prompting prompt prompts prompt + prompture promptur promulgate promulg + prone prone prononcer prononc + prononcez prononcez pronoun pronoun + pronounc pronounc pronounce pronounc + pronounced pronounc pronouncing pronounc + pronouns pronoun proof proof + proofs proof prop prop + propagate propag propagation propag + propend propend propension propens + proper proper properer proper + properly properli propertied properti + properties properti property properti + prophecies propheci prophecy propheci + prophesied prophesi prophesier prophesi + prophesy prophesi prophesying prophesi + prophet prophet prophetess prophetess + prophetic prophet prophetically prophet + prophets prophet propinquity propinqu + propontic propont proportion proport + proportionable proportion proportions proport + propos propo propose propos + proposed propos proposer propos + proposes propos proposing propos + proposition proposit propositions proposit + propounded propound propp propp + propre propr propriety proprieti + props prop propugnation propugn + prorogue prorogu prorogued prorogu + proscription proscript proscriptions proscript + prose prose prosecute prosecut + prosecution prosecut proselytes proselyt + proserpina proserpina prosp prosp + prospect prospect prosper prosper + prosperity prosper prospero prospero + prosperous prosper prosperously prosper + prospers prosper prostitute prostitut + prostrate prostrat protect protect + protected protect protection protect + protector protector protectors protector + protectorship protectorship protectress protectress + protects protect protest protest + protestation protest protestations protest + protested protest protester protest + protesting protest protests protest + proteus proteu protheus protheu + protract protract protractive protract + proud proud prouder prouder + proudest proudest proudlier proudlier + proudly proudli prouds proud + prov prov provand provand + prove prove proved prove + provender provend proverb proverb + proverbs proverb proves prove + proveth proveth provide provid + provided provid providence provid + provident provid providently provid + provider provid provides provid + province provinc provinces provinc + provincial provinci proving prove + provision provis proviso proviso + provocation provoc provok provok + provoke provok provoked provok + provoker provok provokes provok + provoketh provoketh provoking provok + provost provost prowess prowess + prudence prudenc prudent prudent + prun prun prune prune + prunes prune pruning prune + pry pry prying pry + psalm psalm psalmist psalmist + psalms psalm psalteries psalteri + ptolemies ptolemi ptolemy ptolemi + public public publican publican + publication public publicly publicli + publicola publicola publish publish + published publish publisher publish + publishing publish publius publiu + pucelle pucel puck puck + pudder pudder pudding pud + puddings pud puddle puddl + puddled puddl pudency pudenc + pueritia pueritia puff puff + puffing puf puffs puff + pugging pug puis pui + puissance puissanc puissant puissant + puke puke puking puke + pulcher pulcher puling pule + pull pull puller puller + pullet pullet pulling pull + pulls pull pulpit pulpit + pulpiter pulpit pulpits pulpit + pulse puls pulsidge pulsidg + pump pump pumpion pumpion + pumps pump pun pun + punched punch punish punish + punished punish punishes punish + punishment punish punishments punish + punk punk punto punto + puny puni pupil pupil + pupils pupil puppet puppet + puppets puppet puppies puppi + puppy puppi pur pur + purblind purblind purchas purcha + purchase purchas purchased purchas + purchases purchas purchaseth purchaseth + purchasing purchas pure pure + purely pure purer purer + purest purest purg purg + purgation purgat purgative purg + purgatory purgatori purge purg + purged purg purgers purger + purging purg purifies purifi + purifying purifi puritan puritan + purity puriti purlieus purlieu + purple purpl purpled purpl + purples purpl purport purport + purpos purpo purpose purpos + purposed purpos purposely purpos + purposes purpos purposeth purposeth + purposing purpos purr purr + purs pur purse purs + pursents pursent purses purs + pursu pursu pursue pursu + pursued pursu pursuers pursuer + pursues pursu pursuest pursuest + pursueth pursueth pursuing pursu + pursuit pursuit pursuivant pursuiv + pursuivants pursuiv pursy pursi + purus puru purveyor purveyor + push push pushes push + pusillanimity pusillanim put put + putrefy putrefi putrified putrifi + puts put putter putter + putting put puttock puttock + puzzel puzzel puzzle puzzl + puzzled puzzl puzzles puzzl + py py pygmalion pygmalion + pygmies pygmi pygmy pygmi + pyramid pyramid pyramides pyramid + pyramids pyramid pyramis pyrami + pyramises pyramis pyramus pyramu + pyrenean pyrenean pyrrhus pyrrhu + pythagoras pythagora qu qu + quadrangle quadrangl quae quae + quaff quaff quaffing quaf + quagmire quagmir quail quail + quailing quail quails quail + quaint quaint quaintly quaintli + quak quak quake quak + quakes quak qualification qualif + qualified qualifi qualifies qualifi + qualify qualifi qualifying qualifi + qualite qualit qualities qualiti + quality qualiti qualm qualm + qualmish qualmish quam quam + quand quand quando quando + quantities quantiti quantity quantiti + quare quar quarrel quarrel + quarrell quarrel quarreller quarrel + quarrelling quarrel quarrelous quarrel + quarrels quarrel quarrelsome quarrelsom + quarries quarri quarry quarri + quart quart quarter quarter + quartered quarter quartering quarter + quarters quarter quarts quart + quasi quasi quat quat + quatch quatch quay quai + que que quean quean + queas quea queasiness queasi + queasy queasi queen queen + queens queen quell quell + queller queller quench quench + quenched quench quenching quench + quenchless quenchless quern quern + quest quest questant questant + question question questionable question + questioned question questioning question + questionless questionless questions question + questrists questrist quests quest + queubus queubu qui qui + quick quick quicken quicken + quickens quicken quicker quicker + quicklier quicklier quickly quickli + quickness quick quicksand quicksand + quicksands quicksand quicksilverr quicksilverr + quid quid quiddities quidditi + quiddits quiddit quier quier + quiet quiet quieter quieter + quietly quietli quietness quiet + quietus quietu quill quill + quillets quillet quills quill + quilt quilt quinapalus quinapalu + quince quinc quinces quinc + quintain quintain quintessence quintess + quintus quintu quip quip + quips quip quire quir + quiring quir quirk quirk + quirks quirk quis qui + quit quit quite quit + quits quit quittance quittanc + quitted quit quitting quit + quiver quiver quivering quiver + quivers quiver quo quo + quod quod quoifs quoif + quoint quoint quoit quoit + quoits quoit quondam quondam + quoniam quoniam quote quot + quoted quot quotes quot + quoth quoth quotidian quotidian + r r rabbit rabbit + rabble rabbl rabblement rabblement + race race rack rack + rackers racker racket racket + rackets racket racking rack + racks rack radiance radianc + radiant radiant radish radish + rafe rafe raft raft + rag rag rage rage + rages rage rageth rageth + ragg ragg ragged rag + raggedness ragged raging rage + ragozine ragozin rags rag + rah rah rail rail + railed rail railer railer + railest railest raileth raileth + railing rail rails rail + raiment raiment rain rain + rainbow rainbow raineth raineth + raining rain rainold rainold + rains rain rainy raini + rais rai raise rais + raised rais raises rais + raising rais raisins raisin + rak rak rake rake + rakers raker rakes rake + ral ral rald rald + ralph ralph ram ram + rambures rambur ramm ramm + rampallian rampallian rampant rampant + ramping ramp rampir rampir + ramps ramp rams ram + ramsey ramsei ramston ramston + ran ran rance ranc + rancorous rancor rancors rancor + rancour rancour random random + rang rang range rang + ranged rang rangers ranger + ranges rang ranging rang + rank rank ranker ranker + rankest rankest ranking rank + rankle rankl rankly rankli + rankness rank ranks rank + ransack ransack ransacking ransack + ransom ransom ransomed ransom + ransoming ransom ransomless ransomless + ransoms ransom rant rant + ranting rant rap rap + rape rape rapes rape + rapier rapier rapiers rapier + rapine rapin raps rap + rapt rapt rapture raptur + raptures raptur rar rar + rare rare rarely rare + rareness rare rarer rarer + rarest rarest rarities rariti + rarity rariti rascal rascal + rascalliest rascalliest rascally rascal + rascals rascal rased rase + rash rash rasher rasher + rashly rashli rashness rash + rat rat ratcatcher ratcatch + ratcliff ratcliff rate rate + rated rate rately rate + rates rate rather rather + ratherest ratherest ratified ratifi + ratifiers ratifi ratify ratifi + rating rate rational ration + ratolorum ratolorum rats rat + ratsbane ratsban rattle rattl + rattles rattl rattling rattl + rature ratur raught raught + rav rav rave rave + ravel ravel raven raven + ravening raven ravenous raven + ravens raven ravenspurgh ravenspurgh + raves rave ravin ravin + raving rave ravish ravish + ravished ravish ravisher ravish + ravishing ravish ravishments ravish + raw raw rawer rawer + rawly rawli rawness raw + ray rai rayed rai + rays rai raz raz + raze raze razed raze + razes raze razeth razeth + razing raze razor razor + razorable razor razors razor + razure razur re re + reach reach reaches reach + reacheth reacheth reaching reach + read read reader reader + readiest readiest readily readili + readiness readi reading read + readins readin reads read + ready readi real real + really realli realm realm + realms realm reap reap + reapers reaper reaping reap + reaps reap rear rear + rears rear rearward rearward + reason reason reasonable reason + reasonably reason reasoned reason + reasoning reason reasonless reasonless + reasons reason reave reav + rebate rebat rebato rebato + rebeck rebeck rebel rebel + rebell rebel rebelling rebel + rebellion rebellion rebellious rebelli + rebels rebel rebound rebound + rebuk rebuk rebuke rebuk + rebukeable rebuk rebuked rebuk + rebukes rebuk rebus rebu + recall recal recant recant + recantation recant recanter recant + recanting recant receipt receipt + receipts receipt receiv receiv + receive receiv received receiv + receiver receiv receives receiv + receivest receivest receiveth receiveth + receiving receiv receptacle receptacl + rechate rechat reciprocal reciproc + reciprocally reciproc recite recit + recited recit reciterai reciterai + reck reck recking reck + reckless reckless reckon reckon + reckoned reckon reckoning reckon + reckonings reckon recks reck + reclaim reclaim reclaims reclaim + reclusive reclus recognizance recogniz + recognizances recogniz recoil recoil + recoiling recoil recollected recollect + recomforted recomfort recomforture recomfortur + recommend recommend recommended recommend + recommends recommend recompens recompen + recompense recompens reconcil reconcil + reconcile reconcil reconciled reconcil + reconcilement reconcil reconciler reconcil + reconciles reconcil reconciliation reconcili + record record recordation record + recorded record recorder record + recorders record records record + recount recount recounted recount + recounting recount recountments recount + recounts recount recourse recours + recov recov recover recov + recoverable recover recovered recov + recoveries recoveri recovers recov + recovery recoveri recreant recreant + recreants recreant recreate recreat + recreation recreat rectify rectifi + rector rector rectorship rectorship + recure recur recured recur + red red redbreast redbreast + redder redder reddest reddest + rede rede redeem redeem + redeemed redeem redeemer redeem + redeeming redeem redeems redeem + redeliver redeliv redemption redempt + redime redim redness red + redoubled redoubl redoubted redoubt + redound redound redress redress + redressed redress redresses redress + reduce reduc reechy reechi + reed reed reeds reed + reek reek reeking reek + reeks reek reeky reeki + reel reel reeleth reeleth + reeling reel reels reel + refell refel refer refer + reference refer referr referr + referred refer refigured refigur + refin refin refined refin + reflect reflect reflecting reflect + reflection reflect reflex reflex + reform reform reformation reform + reformed reform refractory refractori + refrain refrain refresh refresh + refreshing refresh reft reft + refts reft refuge refug + refus refu refusal refus + refuse refus refused refus + refusest refusest refusing refus + reg reg regal regal + regalia regalia regan regan + regard regard regardance regard + regarded regard regardfully regardfulli + regarding regard regards regard + regenerate regener regent regent + regentship regentship regia regia + regiment regiment regiments regiment + regina regina region region + regions region regist regist + register regist registers regist + regreet regreet regreets regreet + regress regress reguerdon reguerdon + regular regular rehears rehear + rehearsal rehears rehearse rehears + reign reign reigned reign + reignier reignier reigning reign + reigns reign rein rein + reinforc reinforc reinforce reinforc + reinforcement reinforc reins rein + reiterate reiter reject reject + rejected reject rejoic rejoic + rejoice rejoic rejoices rejoic + rejoiceth rejoiceth rejoicing rejoic + rejoicingly rejoicingli rejoindure rejoindur + rejourn rejourn rel rel + relapse relaps relate relat + relates relat relation relat + relations relat relative rel + releas relea release releas + released releas releasing releas + relent relent relenting relent + relents relent reliances relianc + relics relic relief relief + reliev reliev relieve reliev + relieved reliev relieves reliev + relieving reliev religion religion + religions religion religious religi + religiously religi relinquish relinquish + reliques reliqu reliquit reliquit + relish relish relume relum + rely reli relying reli + remain remain remainder remaind + remainders remaind remained remain + remaineth remaineth remaining remain + remains remain remark remark + remarkable remark remediate remedi + remedied remedi remedies remedi + remedy remedi rememb rememb + remember rememb remembered rememb + remembers rememb remembrance remembr + remembrancer remembranc remembrances remembr + remercimens remercimen remiss remiss + remission remiss remissness remiss + remit remit remnant remnant + remnants remnant remonstrance remonstr + remorse remors remorseful remors + remorseless remorseless remote remot + remotion remot remov remov + remove remov removed remov + removedness removed remover remov + removes remov removing remov + remunerate remuner remuneration remuner + rence renc rend rend + render render rendered render + renders render rendezvous rendezv + renegado renegado renege reneg + reneges reneg renew renew + renewed renew renewest renewest + renounce renounc renouncement renounc + renouncing renounc renowmed renowm + renown renown renowned renown + rent rent rents rent + repaid repaid repair repair + repaired repair repairing repair + repairs repair repass repass + repast repast repasture repastur + repay repai repaying repai + repays repai repeal repeal + repealing repeal repeals repeal + repeat repeat repeated repeat + repeating repeat repeats repeat + repel repel repent repent + repentance repent repentant repent + repented repent repenting repent + repents repent repetition repetit + repetitions repetit repin repin + repine repin repining repin + replant replant replenish replenish + replenished replenish replete replet + replication replic replied repli + replies repli repliest repliest + reply repli replying repli + report report reported report + reporter report reportest reportest + reporting report reportingly reportingli + reports report reposal repos + repose repos reposeth reposeth + reposing repos repossess repossess + reprehend reprehend reprehended reprehend + reprehending reprehend represent repres + representing repres reprieve repriev + reprieves repriev reprisal repris + reproach reproach reproaches reproach + reproachful reproach reproachfully reproachfulli + reprobate reprob reprobation reprob + reproof reproof reprov reprov + reprove reprov reproveable reprov + reproves reprov reproving reprov + repugn repugn repugnancy repugn + repugnant repugn repulse repuls + repulsed repuls repurchas repurcha + repured repur reputation reput + repute reput reputed reput + reputeless reputeless reputes reput + reputing reput request request + requested request requesting request + requests request requiem requiem + requir requir require requir + required requir requires requir + requireth requireth requiring requir + requisite requisit requisites requisit + requit requit requital requit + requite requit requited requit + requites requit rer rer + rere rere rers rer + rescu rescu rescue rescu + rescued rescu rescues rescu + rescuing rescu resemblance resembl + resemble resembl resembled resembl + resembles resembl resembleth resembleth + resembling resembl reserv reserv + reservation reserv reserve reserv + reserved reserv reserves reserv + reside resid residence resid + resident resid resides resid + residing resid residue residu + resign resign resignation resign + resist resist resistance resist + resisted resist resisting resist + resists resist resolute resolut + resolutely resolut resolutes resolut + resolution resolut resolv resolv + resolve resolv resolved resolv + resolvedly resolvedli resolves resolv + resolveth resolveth resort resort + resorted resort resounding resound + resounds resound respeaking respeak + respect respect respected respect + respecting respect respective respect + respectively respect respects respect + respice respic respite respit + respites respit responsive respons + respose respos ress ress + rest rest rested rest + resteth resteth restful rest + resting rest restitution restitut + restless restless restor restor + restoration restor restorative restor + restore restor restored restor + restores restor restoring restor + restrain restrain restrained restrain + restraining restrain restrains restrain + restraint restraint rests rest + resty resti resum resum + resume resum resumes resum + resurrections resurrect retail retail + retails retail retain retain + retainers retain retaining retain + retell retel retention retent + retentive retent retinue retinu + retir retir retire retir + retired retir retirement retir + retires retir retiring retir + retold retold retort retort + retorts retort retourne retourn + retract retract retreat retreat + retrograde retrograd rets ret + return return returned return + returnest returnest returneth returneth + returning return returns return + revania revania reveal reveal + reveals reveal revel revel + reveler revel revell revel + reveller revel revellers revel + revelling revel revelry revelri + revels revel reveng reveng + revenge reveng revenged reveng + revengeful reveng revengement reveng + revenger reveng revengers reveng + revenges reveng revenging reveng + revengingly revengingli revenue revenu + revenues revenu reverb reverb + reverberate reverber reverbs reverb + reverenc reverenc reverence rever + reverend reverend reverent rever + reverently rever revers rever + reverse revers reversion revers + reverted revert review review + reviewest reviewest revil revil + revile revil revisits revisit + reviv reviv revive reviv + revives reviv reviving reviv + revok revok revoke revok + revokement revok revolt revolt + revolted revolt revolting revolt + revolts revolt revolution revolut + revolutions revolut revolve revolv + revolving revolv reward reward + rewarded reward rewarder reward + rewarding reward rewards reward + reword reword reworded reword + rex rex rey rei + reynaldo reynaldo rford rford + rful rful rfull rfull + rhapsody rhapsodi rheims rheim + rhenish rhenish rhesus rhesu + rhetoric rhetor rheum rheum + rheumatic rheumat rheums rheum + rheumy rheumi rhinoceros rhinocero + rhodes rhode rhodope rhodop + rhubarb rhubarb rhym rhym + rhyme rhyme rhymers rhymer + rhymes rhyme rhyming rhyme + rialto rialto rib rib + ribald ribald riband riband + ribands riband ribaudred ribaudr + ribb ribb ribbed rib + ribbon ribbon ribbons ribbon + ribs rib rice rice + rich rich richard richard + richer richer riches rich + richest richest richly richli + richmond richmond richmonds richmond + rid rid riddance riddanc + ridden ridden riddle riddl + riddles riddl riddling riddl + ride ride rider rider + riders rider rides ride + ridest ridest rideth rideth + ridge ridg ridges ridg + ridiculous ridicul riding ride + rids rid rien rien + ries ri rifle rifl + rift rift rifted rift + rig rig rigg rigg + riggish riggish right right + righteous righteou righteously righteous + rightful right rightfully rightfulli + rightly rightli rights right + rigol rigol rigorous rigor + rigorously rigor rigour rigour + ril ril rim rim + rin rin rinaldo rinaldo + rind rind ring ring + ringing ring ringleader ringlead + ringlets ringlet rings ring + ringwood ringwood riot riot + rioter rioter rioting riot + riotous riotou riots riot + rip rip ripe ripe + ripely ripe ripen ripen + ripened ripen ripeness ripe + ripening ripen ripens ripen + riper riper ripest ripest + riping ripe ripp ripp + ripping rip rise rise + risen risen rises rise + riseth riseth rish rish + rising rise rite rite + rites rite rivage rivag + rival rival rivality rival + rivall rival rivals rival + rive rive rived rive + rivelled rivel river river + rivers river rivet rivet + riveted rivet rivets rivet + rivo rivo rj rj + rless rless road road + roads road roam roam + roaming roam roan roan + roar roar roared roar + roarers roarer roaring roar + roars roar roast roast + roasted roast rob rob + roba roba robas roba + robb robb robbed rob + robber robber robbers robber + robbery robberi robbing rob + robe robe robed robe + robert robert robes robe + robin robin robs rob + robustious robusti rochester rochest + rochford rochford rock rock + rocks rock rocky rocki + rod rod rode rode + roderigo roderigo rods rod + roe roe roes roe + roger roger rogero rogero + rogue rogu roguery rogueri + rogues rogu roguish roguish + roi roi roisting roist + roll roll rolled roll + rolling roll rolls roll + rom rom romage romag + roman roman romano romano + romanos romano romans roman + rome rome romeo romeo + romish romish rondure rondur + ronyon ronyon rood rood + roof roof roofs roof + rook rook rooks rook + rooky rooki room room + rooms room root root + rooted root rootedly rootedli + rooteth rooteth rooting root + roots root rope rope + ropery roperi ropes rope + roping rope ros ro + rosalind rosalind rosalinda rosalinda + rosalinde rosalind rosaline rosalin + roscius rosciu rose rose + rosed rose rosemary rosemari + rosencrantz rosencrantz roses rose + ross ross rosy rosi + rot rot rote rote + roted rote rother rother + rotherham rotherham rots rot + rotted rot rotten rotten + rottenness rotten rotting rot + rotundity rotund rouen rouen + rough rough rougher rougher + roughest roughest roughly roughli + roughness rough round round + rounded round roundel roundel + rounder rounder roundest roundest + rounding round roundly roundli + rounds round roundure roundur + rous rou rouse rous + roused rous rousillon rousillon + rously rousli roussi roussi + rout rout routed rout + routs rout rove rove + rover rover row row + rowel rowel rowland rowland + rowlands rowland roy roi + royal royal royalize royal + royally royal royalties royalti + royalty royalti roynish roynish + rs rs rt rt + rub rub rubb rubb + rubbing rub rubbish rubbish + rubies rubi rubious rubiou + rubs rub ruby rubi + rud rud rudand rudand + rudder rudder ruddiness ruddi + ruddock ruddock ruddy ruddi + rude rude rudely rude + rudeness rude ruder ruder + rudesby rudesbi rudest rudest + rudiments rudiment rue rue + rued ru ruff ruff + ruffian ruffian ruffians ruffian + ruffle ruffl ruffling ruffl + ruffs ruff rug rug + rugby rugbi rugemount rugemount + rugged rug ruin ruin + ruinate ruinat ruined ruin + ruining ruin ruinous ruinou + ruins ruin rul rul + rule rule ruled rule + ruler ruler rulers ruler + rules rule ruling rule + rumble rumbl ruminaies ruminai + ruminat ruminat ruminate rumin + ruminated rumin ruminates rumin + rumination rumin rumor rumor + rumour rumour rumourer rumour + rumours rumour rump rump + run run runagate runag + runagates runag runaway runawai + runaways runawai rung rung + runn runn runner runner + runners runner running run + runs run rupture ruptur + ruptures ruptur rural rural + rush rush rushes rush + rushing rush rushling rushl + rushy rushi russet russet + russia russia russian russian + russians russian rust rust + rusted rust rustic rustic + rustically rustic rustics rustic + rustle rustl rustling rustl + rusts rust rusty rusti + rut rut ruth ruth + ruthful ruth ruthless ruthless + rutland rutland ruttish ruttish + ry ry rye rye + rything ryth s s + sa sa saba saba + sabbath sabbath sable sabl + sables sabl sack sack + sackbuts sackbut sackcloth sackcloth + sacked sack sackerson sackerson + sacks sack sacrament sacrament + sacred sacr sacrific sacrif + sacrifice sacrific sacrificers sacrific + sacrifices sacrific sacrificial sacrifici + sacrificing sacrif sacrilegious sacrilegi + sacring sacr sad sad + sadder sadder saddest saddest + saddle saddl saddler saddler + saddles saddl sadly sadli + sadness sad saf saf + safe safe safeguard safeguard + safely safe safer safer + safest safest safeties safeti + safety safeti saffron saffron + sag sag sage sage + sagittary sagittari said said + saidst saidst sail sail + sailing sail sailmaker sailmak + sailor sailor sailors sailor + sails sail sain sain + saint saint sainted saint + saintlike saintlik saints saint + saith saith sake sake + sakes sake sala sala + salad salad salamander salamand + salary salari sale sale + salerio salerio salicam salicam + salique saliqu salisbury salisburi + sall sall sallet sallet + sallets sallet sallies salli + sallow sallow sally salli + salmon salmon salmons salmon + salt salt salter salter + saltiers saltier saltness salt + saltpetre saltpetr salutation salut + salutations salut salute salut + saluted salut salutes salut + saluteth saluteth salv salv + salvation salvat salve salv + salving salv same same + samingo samingo samp samp + sampire sampir sample sampl + sampler sampler sampson sampson + samson samson samsons samson + sancta sancta sanctified sanctifi + sanctifies sanctifi sanctify sanctifi + sanctimonies sanctimoni sanctimonious sanctimoni + sanctimony sanctimoni sanctities sanctiti + sanctity sanctiti sanctuarize sanctuar + sanctuary sanctuari sand sand + sandal sandal sandbag sandbag + sanded sand sands sand + sandy sandi sandys sandi + sang sang sanguine sanguin + sanguis sangui sanity saniti + sans san santrailles santrail + sap sap sapient sapient + sapit sapit sapless sapless + sapling sapl sapphire sapphir + sapphires sapphir saracens saracen + sarcenet sarcenet sard sard + sardians sardian sardinia sardinia + sardis sardi sarum sarum + sat sat satan satan + satchel satchel sate sate + sated sate satiate satiat + satiety satieti satin satin + satire satir satirical satir + satis sati satisfaction satisfact + satisfied satisfi satisfies satisfi + satisfy satisfi satisfying satisfi + saturday saturdai saturdays saturdai + saturn saturn saturnine saturnin + saturninus saturninu satyr satyr + satyrs satyr sauc sauc + sauce sauc sauced sauc + saucers saucer sauces sauc + saucily saucili sauciness sauci + saucy sauci sauf sauf + saunder saunder sav sav + savage savag savagely savag + savageness savag savagery savageri + savages savag save save + saved save saves save + saving save saviour saviour + savory savori savour savour + savouring savour savours savour + savoury savouri savoy savoi + saw saw sawed saw + sawest sawest sawn sawn + sawpit sawpit saws saw + sawyer sawyer saxons saxon + saxony saxoni saxton saxton + say sai sayest sayest + saying sai sayings sai + says sai sayst sayst + sblood sblood sc sc + scab scab scabbard scabbard + scabs scab scaffold scaffold + scaffoldage scaffoldag scal scal + scald scald scalded scald + scalding scald scale scale + scaled scale scales scale + scaling scale scall scall + scalp scalp scalps scalp + scaly scali scamble scambl + scambling scambl scamels scamel + scan scan scandal scandal + scandaliz scandaliz scandalous scandal + scandy scandi scann scann + scant scant scanted scant + scanter scanter scanting scant + scantling scantl scants scant + scap scap scape scape + scaped scape scapes scape + scapeth scapeth scar scar + scarce scarc scarcely scarc + scarcity scarciti scare scare + scarecrow scarecrow scarecrows scarecrow + scarf scarf scarfed scarf + scarfs scarf scaring scare + scarlet scarlet scarr scarr + scarre scarr scars scar + scarus scaru scath scath + scathe scath scathful scath + scatt scatt scatter scatter + scattered scatter scattering scatter + scatters scatter scelera scelera + scelerisque scelerisqu scene scene + scenes scene scent scent + scented scent scept scept + scepter scepter sceptre sceptr + sceptred sceptr sceptres sceptr + schedule schedul schedules schedul + scholar scholar scholarly scholarli + scholars scholar school school + schoolboy schoolboi schoolboys schoolboi + schoolfellows schoolfellow schooling school + schoolmaster schoolmast schoolmasters schoolmast + schools school sciatica sciatica + sciaticas sciatica science scienc + sciences scienc scimitar scimitar + scion scion scions scion + scissors scissor scoff scoff + scoffer scoffer scoffing scof + scoffs scoff scoggin scoggin + scold scold scolding scold + scolds scold sconce sconc + scone scone scope scope + scopes scope scorch scorch + scorched scorch score score + scored score scores score + scoring score scorn scorn + scorned scorn scornful scorn + scornfully scornfulli scorning scorn + scorns scorn scorpion scorpion + scorpions scorpion scot scot + scotch scotch scotches scotch + scotland scotland scots scot + scottish scottish scoundrels scoundrel + scour scour scoured scour + scourg scourg scourge scourg + scouring scour scout scout + scouts scout scowl scowl + scrap scrap scrape scrape + scraping scrape scraps scrap + scratch scratch scratches scratch + scratching scratch scream scream + screams scream screech screech + screeching screech screen screen + screens screen screw screw + screws screw scribbl scribbl + scribbled scribbl scribe scribe + scribes scribe scrimers scrimer + scrip scrip scrippage scrippag + scripture scriptur scriptures scriptur + scrivener scriven scroll scroll + scrolls scroll scroop scroop + scrowl scrowl scroyles scroyl + scrubbed scrub scruple scrupl + scruples scrupl scrupulous scrupul + scuffles scuffl scuffling scuffl + scullion scullion sculls scull + scum scum scurril scurril + scurrility scurril scurrilous scurril + scurvy scurvi scuse scuse + scut scut scutcheon scutcheon + scutcheons scutcheon scylla scylla + scythe scyth scythed scyth + scythia scythia scythian scythian + sdeath sdeath se se + sea sea seacoal seacoal + seafaring seafar seal seal + sealed seal sealing seal + seals seal seam seam + seamen seamen seamy seami + seaport seaport sear sear + searce searc search search + searchers searcher searches search + searcheth searcheth searching search + seared sear seas sea + seasick seasick seaside seasid + season season seasoned season + seasons season seat seat + seated seat seats seat + sebastian sebastian second second + secondarily secondarili secondary secondari + seconded second seconds second + secrecy secreci secret secret + secretaries secretari secretary secretari + secretly secretli secrets secret + sect sect sectary sectari + sects sect secundo secundo + secure secur securely secur + securing secur security secur + sedg sedg sedge sedg + sedges sedg sedgy sedgi + sedition sedit seditious sediti + seduc seduc seduce seduc + seduced seduc seducer seduc + seducing seduc see see + seed seed seeded seed + seedness seed seeds seed + seedsman seedsman seein seein + seeing see seek seek + seeking seek seeks seek + seel seel seeling seel + seely seeli seem seem + seemed seem seemers seemer + seemest seemest seemeth seemeth + seeming seem seemingly seemingli + seemly seemli seems seem + seen seen seer seer + sees see seese sees + seest seest seethe seeth + seethes seeth seething seeth + seeting seet segregation segreg + seigneur seigneur seigneurs seigneur + seiz seiz seize seiz + seized seiz seizes seiz + seizeth seizeth seizing seiz + seizure seizur seld seld + seldom seldom select select + seleucus seleucu self self + selfsame selfsam sell sell + seller seller selling sell + sells sell selves selv + semblable semblabl semblably semblabl + semblance semblanc semblances semblanc + semblative sembl semi semi + semicircle semicircl semiramis semirami + semper semper sempronius semproniu + senate senat senator senat + senators senat send send + sender sender sendeth sendeth + sending send sends send + seneca seneca senior senior + seniory seniori senis seni + sennet sennet senoys senoi + sense sens senseless senseless + senses sens sensible sensibl + sensibly sensibl sensual sensual + sensuality sensual sent sent + sentenc sentenc sentence sentenc + sentences sentenc sententious sententi + sentinel sentinel sentinels sentinel + separable separ separate separ + separated separ separates separ + separation separ septentrion septentrion + sepulchre sepulchr sepulchres sepulchr + sepulchring sepulchr sequel sequel + sequence sequenc sequent sequent + sequest sequest sequester sequest + sequestration sequestr sere sere + serenis sereni serge serg + sergeant sergeant serious seriou + seriously serious sermon sermon + sermons sermon serpent serpent + serpentine serpentin serpents serpent + serpigo serpigo serv serv + servant servant servanted servant + servants servant serve serv + served serv server server + serves serv serveth serveth + service servic serviceable servic + services servic servile servil + servility servil servilius serviliu + serving serv servingman servingman + servingmen servingmen serviteur serviteur + servitor servitor servitors servitor + servitude servitud sessa sessa + session session sessions session + sestos sesto set set + setebos setebo sets set + setter setter setting set + settle settl settled settl + settlest settlest settling settl + sev sev seven seven + sevenfold sevenfold sevennight sevennight + seventeen seventeen seventh seventh + seventy seventi sever sever + several sever severally sever + severals sever severe sever + severed sever severely sever + severest severest severing sever + severity sever severn severn + severs sever sew sew + seward seward sewer sewer + sewing sew sex sex + sexes sex sexton sexton + sextus sextu seymour seymour + seyton seyton sfoot sfoot + sh sh shackle shackl + shackles shackl shade shade + shades shade shadow shadow + shadowed shadow shadowing shadow + shadows shadow shadowy shadowi + shady shadi shafalus shafalu + shaft shaft shafts shaft + shag shag shak shak + shake shake shaked shake + shaken shaken shakes shake + shaking shake shales shale + shall shall shallenge shalleng + shallow shallow shallowest shallowest + shallowly shallowli shallows shallow + shalt shalt sham sham + shambles shambl shame shame + shamed shame shameful shame + shamefully shamefulli shameless shameless + shames shame shamest shamest + shaming shame shank shank + shanks shank shap shap + shape shape shaped shape + shapeless shapeless shapen shapen + shapes shape shaping shape + shar shar shard shard + sharded shard shards shard + share share shared share + sharers sharer shares share + sharing share shark shark + sharp sharp sharpen sharpen + sharpened sharpen sharpens sharpen + sharper sharper sharpest sharpest + sharply sharpli sharpness sharp + sharps sharp shatter shatter + shav shav shave shave + shaven shaven shaw shaw + she she sheaf sheaf + sheal sheal shear shear + shearers shearer shearing shear + shearman shearman shears shear + sheath sheath sheathe sheath + sheathed sheath sheathes sheath + sheathing sheath sheaved sheav + sheaves sheav shed shed + shedding shed sheds shed + sheen sheen sheep sheep + sheepcote sheepcot sheepcotes sheepcot + sheeps sheep sheepskins sheepskin + sheer sheer sheet sheet + sheeted sheet sheets sheet + sheffield sheffield shelf shelf + shell shell shells shell + shelt shelt shelter shelter + shelters shelter shelves shelv + shelving shelv shelvy shelvi + shent shent shepherd shepherd + shepherdes shepherd shepherdess shepherdess + shepherdesses shepherdess shepherds shepherd + sher sher sheriff sheriff + sherris sherri shes she + sheweth sheweth shield shield + shielded shield shields shield + shift shift shifted shift + shifting shift shifts shift + shilling shill shillings shill + shin shin shine shine + shines shine shineth shineth + shining shine shins shin + shiny shini ship ship + shipboard shipboard shipman shipman + shipmaster shipmast shipmen shipmen + shipp shipp shipped ship + shipping ship ships ship + shipt shipt shipwreck shipwreck + shipwrecking shipwreck shipwright shipwright + shipwrights shipwright shire shire + shirley shirlei shirt shirt + shirts shirt shive shive + shiver shiver shivering shiver + shivers shiver shoal shoal + shoals shoal shock shock + shocks shock shod shod + shoe shoe shoeing shoe + shoemaker shoemak shoes shoe + shog shog shone shone + shook shook shoon shoon + shoot shoot shooter shooter + shootie shooti shooting shoot + shoots shoot shop shop + shops shop shore shore + shores shore shorn shorn + short short shortcake shortcak + shorten shorten shortened shorten + shortens shorten shorter shorter + shortly shortli shortness short + shot shot shotten shotten + shoughs shough should should + shoulder shoulder shouldering shoulder + shoulders shoulder shouldst shouldst + shout shout shouted shout + shouting shout shouts shout + shov shov shove shove + shovel shovel shovels shovel + show show showed show + shower shower showers shower + showest showest showing show + shown shown shows show + shreds shred shrew shrew + shrewd shrewd shrewdly shrewdli + shrewdness shrewd shrewish shrewish + shrewishly shrewishli shrewishness shrewish + shrews shrew shrewsbury shrewsburi + shriek shriek shrieking shriek + shrieks shriek shrieve shriev + shrift shrift shrill shrill + shriller shriller shrills shrill + shrilly shrilli shrimp shrimp + shrine shrine shrink shrink + shrinking shrink shrinks shrink + shriv shriv shrive shrive + shriver shriver shrives shrive + shriving shrive shroud shroud + shrouded shroud shrouding shroud + shrouds shroud shrove shrove + shrow shrow shrows shrow + shrub shrub shrubs shrub + shrug shrug shrugs shrug + shrunk shrunk shudd shudd + shudders shudder shuffl shuffl + shuffle shuffl shuffled shuffl + shuffling shuffl shun shun + shunless shunless shunn shunn + shunned shun shunning shun + shuns shun shut shut + shuts shut shuttle shuttl + shy shy shylock shylock + si si sibyl sibyl + sibylla sibylla sibyls sibyl + sicil sicil sicilia sicilia + sicilian sicilian sicilius siciliu + sicils sicil sicily sicili + sicinius siciniu sick sick + sicken sicken sickens sicken + sicker sicker sickle sickl + sicklemen sicklemen sicklied sickli + sickliness sickli sickly sickli + sickness sick sicles sicl + sicyon sicyon side side + sided side sides side + siege sieg sieges sieg + sienna sienna sies si + sieve siev sift sift + sifted sift sigeia sigeia + sigh sigh sighed sigh + sighing sigh sighs sigh + sight sight sighted sight + sightless sightless sightly sightli + sights sight sign sign + signal signal signet signet + signieur signieur significant signific + significants signific signified signifi + signifies signifi signify signifi + signifying signifi signior signior + signiories signiori signiors signior + signiory signiori signor signor + signories signori signs sign + signum signum silenc silenc + silence silenc silenced silenc + silencing silenc silent silent + silently silent silius siliu + silk silk silken silken + silkman silkman silks silk + silliest silliest silliness silli + silling sill silly silli + silva silva silver silver + silvered silver silverly silverli + silvia silvia silvius silviu + sima sima simile simil + similes simil simois simoi + simon simon simony simoni + simp simp simpcox simpcox + simple simpl simpleness simpl + simpler simpler simples simpl + simplicity simplic simply simpli + simular simular simulation simul + sin sin since sinc + sincere sincer sincerely sincer + sincerity sincer sinel sinel + sinew sinew sinewed sinew + sinews sinew sinewy sinewi + sinful sin sinfully sinfulli + sing sing singe sing + singeing sing singer singer + singes sing singeth singeth + singing sing single singl + singled singl singleness singl + singly singli sings sing + singular singular singulariter singularit + singularities singular singularity singular + singuled singul sinister sinist + sink sink sinking sink + sinks sink sinn sinn + sinner sinner sinners sinner + sinning sin sinon sinon + sins sin sip sip + sipping sip sir sir + sire sire siren siren + sirrah sirrah sirs sir + sist sist sister sister + sisterhood sisterhood sisterly sisterli + sisters sister sit sit + sith sith sithence sithenc + sits sit sitting sit + situate situat situation situat + situations situat siward siward + six six sixpence sixpenc + sixpences sixpenc sixpenny sixpenni + sixteen sixteen sixth sixth + sixty sixti siz siz + size size sizes size + sizzle sizzl skains skain + skamble skambl skein skein + skelter skelter skies ski + skilful skil skilfully skilfulli + skill skill skilless skilless + skillet skillet skillful skill + skills skill skim skim + skimble skimbl skin skin + skinker skinker skinny skinni + skins skin skip skip + skipp skipp skipper skipper + skipping skip skirmish skirmish + skirmishes skirmish skirr skirr + skirted skirt skirts skirt + skittish skittish skulking skulk + skull skull skulls skull + sky sky skyey skyei + skyish skyish slab slab + slack slack slackly slackli + slackness slack slain slain + slake slake sland sland + slander slander slandered slander + slanderer slander slanderers slander + slandering slander slanderous slander + slanders slander slash slash + slaught slaught slaughter slaughter + slaughtered slaughter slaughterer slaughter + slaughterman slaughterman slaughtermen slaughtermen + slaughterous slaughter slaughters slaughter + slave slave slaver slaver + slavery slaveri slaves slave + slavish slavish slay slai + slayeth slayeth slaying slai + slays slai sleave sleav + sledded sled sleek sleek + sleekly sleekli sleep sleep + sleeper sleeper sleepers sleeper + sleepest sleepest sleeping sleep + sleeps sleep sleepy sleepi + sleeve sleev sleeves sleev + sleid sleid sleided sleid + sleight sleight sleights sleight + slender slender slenderer slender + slenderly slenderli slept slept + slew slew slewest slewest + slice slice slid slid + slide slide slides slide + sliding slide slight slight + slighted slight slightest slightest + slightly slightli slightness slight + slights slight slily slili + slime slime slimy slimi + slings sling slink slink + slip slip slipp slipp + slipper slipper slippers slipper + slippery slipperi slips slip + slish slish slit slit + sliver sliver slobb slobb + slomber slomber slop slop + slope slope slops slop + sloth sloth slothful sloth + slough slough slovenly slovenli + slovenry slovenri slow slow + slower slower slowly slowli + slowness slow slubber slubber + slug slug sluggard sluggard + sluggardiz sluggardiz sluggish sluggish + sluic sluic slumb slumb + slumber slumber slumbers slumber + slumbery slumberi slunk slunk + slut slut sluts slut + sluttery slutteri sluttish sluttish + sluttishness sluttish sly sly + slys sly smack smack + smacking smack smacks smack + small small smaller smaller + smallest smallest smallness small + smalus smalu smart smart + smarting smart smartly smartli + smatch smatch smatter smatter + smear smear smell smell + smelling smell smells smell + smelt smelt smil smil + smile smile smiled smile + smiles smile smilest smilest + smilets smilet smiling smile + smilingly smilingli smirch smirch + smirched smirch smit smit + smite smite smites smite + smith smith smithfield smithfield + smock smock smocks smock + smok smok smoke smoke + smoked smoke smokes smoke + smoking smoke smoky smoki + smooth smooth smoothed smooth + smoothing smooth smoothly smoothli + smoothness smooth smooths smooth + smote smote smoth smoth + smother smother smothered smother + smothering smother smug smug + smulkin smulkin smutch smutch + snaffle snaffl snail snail + snails snail snake snake + snakes snake snaky snaki + snap snap snapp snapp + snapper snapper snar snar + snare snare snares snare + snarl snarl snarleth snarleth + snarling snarl snatch snatch + snatchers snatcher snatches snatch + snatching snatch sneak sneak + sneaking sneak sneap sneap + sneaping sneap sneck sneck + snip snip snipe snipe + snipt snipt snore snore + snores snore snoring snore + snorting snort snout snout + snow snow snowballs snowbal + snowed snow snowy snowi + snuff snuff snuffs snuff + snug snug so so + soak soak soaking soak + soaks soak soar soar + soaring soar soars soar + sob sob sobbing sob + sober sober soberly soberli + sobriety sobrieti sobs sob + sociable sociabl societies societi + society societi socks sock + socrates socrat sod sod + sodden sodden soe soe + soever soever soft soft + soften soften softens soften + softer softer softest softest + softly softli softness soft + soil soil soiled soil + soilure soilur soit soit + sojourn sojourn sol sol + sola sola solace solac + solanio solanio sold sold + soldat soldat solder solder + soldest soldest soldier soldier + soldiers soldier soldiership soldiership + sole sole solely sole + solem solem solemn solemn + solemness solem solemnities solemn + solemnity solemn solemniz solemniz + solemnize solemn solemnized solemn + solemnly solemnli soles sole + solicit solicit solicitation solicit + solicited solicit soliciting solicit + solicitings solicit solicitor solicitor + solicits solicit solid solid + solidares solidar solidity solid + solinus solinu solitary solitari + solomon solomon solon solon + solum solum solus solu + solyman solyman some some + somebody somebodi someone someon + somerset somerset somerville somervil + something someth sometime sometim + sometimes sometim somever somev + somewhat somewhat somewhere somewher + somewhither somewhith somme somm + son son sonance sonanc + song song songs song + sonnet sonnet sonneting sonnet + sonnets sonnet sons son + sont sont sonties sonti + soon soon sooner sooner + soonest soonest sooth sooth + soothe sooth soothers soother + soothing sooth soothsay soothsai + soothsayer soothsay sooty sooti + sop sop sophister sophist + sophisticated sophist sophy sophi + sops sop sorcerer sorcer + sorcerers sorcer sorceress sorceress + sorceries sorceri sorcery sorceri + sore sore sorel sorel + sorely sore sorer sorer + sores sore sorrier sorrier + sorriest sorriest sorrow sorrow + sorrowed sorrow sorrowest sorrowest + sorrowful sorrow sorrowing sorrow + sorrows sorrow sorry sorri + sort sort sortance sortanc + sorted sort sorting sort + sorts sort sossius sossiu + sot sot soto soto + sots sot sottish sottish + soud soud sought sought + soul soul sould sould + soulless soulless souls soul + sound sound sounded sound + sounder sounder soundest soundest + sounding sound soundless soundless + soundly soundli soundness sound + soundpost soundpost sounds sound + sour sour source sourc + sources sourc sourest sourest + sourly sourli sours sour + sous sou souse sous + south south southam southam + southampton southampton southerly southerli + southern southern southward southward + southwark southwark southwell southwel + souviendrai souviendrai sov sov + sovereign sovereign sovereignest sovereignest + sovereignly sovereignli sovereignty sovereignti + sovereignvours sovereignvour sow sow + sowing sow sowl sowl + sowter sowter space space + spaces space spacious spaciou + spade spade spades spade + spain spain spak spak + spake spake spakest spakest + span span spangle spangl + spangled spangl spaniard spaniard + spaniel spaniel spaniels spaniel + spanish spanish spann spann + spans span spar spar + spare spare spares spare + sparing spare sparingly sparingli + spark spark sparkle sparkl + sparkles sparkl sparkling sparkl + sparks spark sparrow sparrow + sparrows sparrow sparta sparta + spartan spartan spavin spavin + spavins spavin spawn spawn + speak speak speaker speaker + speakers speaker speakest speakest + speaketh speaketh speaking speak + speaks speak spear spear + speargrass speargrass spears spear + special special specialities special + specially special specialties specialti + specialty specialti specify specifi + speciously specious spectacle spectacl + spectacled spectacl spectacles spectacl + spectators spectat spectatorship spectatorship + speculation specul speculations specul + speculative specul sped sped + speech speech speeches speech + speechless speechless speed speed + speeded speed speedier speedier + speediest speediest speedily speedili + speediness speedi speeding speed + speeds speed speedy speedi + speens speen spell spell + spelling spell spells spell + spelt spelt spencer spencer + spend spend spendest spendest + spending spend spends spend + spendthrift spendthrift spent spent + sperato sperato sperm sperm + spero spero sperr sperr + spher spher sphere sphere + sphered sphere spheres sphere + spherical spheric sphery spheri + sphinx sphinx spice spice + spiced spice spicery spiceri + spices spice spider spider + spiders spider spied spi + spies spi spieth spieth + spightfully spightfulli spigot spigot + spill spill spilling spill + spills spill spilt spilt + spilth spilth spin spin + spinii spinii spinners spinner + spinster spinster spinsters spinster + spire spire spirit spirit + spirited spirit spiritless spiritless + spirits spirit spiritual spiritu + spiritualty spiritualti spirt spirt + spit spit spital spital + spite spite spited spite + spiteful spite spites spite + spits spit spitted spit + spitting spit splay splai + spleen spleen spleenful spleen + spleens spleen spleeny spleeni + splendour splendour splenitive splenit + splinter splinter splinters splinter + split split splits split + splitted split splitting split + spoil spoil spoils spoil + spok spok spoke spoke + spoken spoken spokes spoke + spokesman spokesman sponge spong + spongy spongi spoon spoon + spoons spoon sport sport + sportful sport sporting sport + sportive sportiv sports sport + spot spot spotless spotless + spots spot spotted spot + spousal spousal spouse spous + spout spout spouting spout + spouts spout sprag sprag + sprang sprang sprat sprat + sprawl sprawl spray sprai + sprays sprai spread spread + spreading spread spreads spread + sprighted spright sprightful spright + sprightly sprightli sprigs sprig + spring spring springe spring + springes spring springeth springeth + springhalt springhalt springing spring + springs spring springtime springtim + sprinkle sprinkl sprinkles sprinkl + sprite sprite sprited sprite + spritely sprite sprites sprite + spriting sprite sprout sprout + spruce spruce sprung sprung + spun spun spur spur + spurio spurio spurn spurn + spurns spurn spurr spurr + spurrer spurrer spurring spur + spurs spur spy spy + spying spy squabble squabbl + squadron squadron squadrons squadron + squand squand squar squar + square squar squarer squarer + squares squar squash squash + squeak squeak squeaking squeak + squeal squeal squealing squeal + squeezes squeez squeezing squeez + squele squel squier squier + squints squint squiny squini + squire squir squires squir + squirrel squirrel st st + stab stab stabb stabb + stabbed stab stabbing stab + stable stabl stableness stabl + stables stabl stablish stablish + stablishment stablish stabs stab + stacks stack staff staff + stafford stafford staffords stafford + staffordshire staffordshir stag stag + stage stage stages stage + stagger stagger staggering stagger + staggers stagger stags stag + staid staid staider staider + stain stain stained stain + staines stain staineth staineth + staining stain stainless stainless + stains stain stair stair + stairs stair stake stake + stakes stake stale stale + staled stale stalk stalk + stalking stalk stalks stalk + stall stall stalling stall + stalls stall stamford stamford + stammer stammer stamp stamp + stamped stamp stamps stamp + stanch stanch stanchless stanchless + stand stand standard standard + standards standard stander stander + standers stander standest standest + standeth standeth standing stand + stands stand staniel staniel + stanley stanlei stanze stanz + stanzo stanzo stanzos stanzo + staple stapl staples stapl + star star stare stare + stared stare stares stare + staring stare starings stare + stark stark starkly starkli + starlight starlight starling starl + starr starr starry starri + stars star start start + started start starting start + startingly startingli startle startl + startles startl starts start + starv starv starve starv + starved starv starvelackey starvelackei + starveling starvel starveth starveth + starving starv state state + statelier stateli stately state + states state statesman statesman + statesmen statesmen statilius statiliu + station station statist statist + statists statist statue statu + statues statu stature statur + statures statur statute statut + statutes statut stave stave + staves stave stay stai + stayed stai stayest stayest + staying stai stays stai + stead stead steaded stead + steadfast steadfast steadier steadier + steads stead steal steal + stealer stealer stealers stealer + stealing steal steals steal + stealth stealth stealthy stealthi + steed steed steeds steed + steel steel steeled steel + steely steeli steep steep + steeped steep steeple steepl + steeples steepl steeps steep + steepy steepi steer steer + steerage steerag steering steer + steers steer stelled stell + stem stem stemming stem + stench stench step step + stepdame stepdam stephano stephano + stephen stephen stepmothers stepmoth + stepp stepp stepping step + steps step sterile steril + sterility steril sterling sterl + stern stern sternage sternag + sterner sterner sternest sternest + sternness stern steterat steterat + stew stew steward steward + stewards steward stewardship stewardship + stewed stew stews stew + stick stick sticking stick + stickler stickler sticks stick + stiff stiff stiffen stiffen + stiffly stiffli stifle stifl + stifled stifl stifles stifl + stigmatic stigmat stigmatical stigmat + stile stile still still + stiller stiller stillest stillest + stillness still stilly stilli + sting sting stinging sting + stingless stingless stings sting + stink stink stinking stink + stinkingly stinkingli stinks stink + stint stint stinted stint + stints stint stir stir + stirr stirr stirred stir + stirrer stirrer stirrers stirrer + stirreth stirreth stirring stir + stirrup stirrup stirrups stirrup + stirs stir stitchery stitcheri + stitches stitch stithied stithi + stithy stithi stoccadoes stoccado + stoccata stoccata stock stock + stockfish stockfish stocking stock + stockings stock stockish stockish + stocks stock stog stog + stogs stog stoics stoic + stokesly stokesli stol stol + stole stole stolen stolen + stolest stolest stomach stomach + stomachers stomach stomaching stomach + stomachs stomach ston ston + stone stone stonecutter stonecutt + stones stone stonish stonish + stony stoni stood stood + stool stool stools stool + stoop stoop stooping stoop + stoops stoop stop stop + stope stope stopp stopp + stopped stop stopping stop + stops stop stor stor + store store storehouse storehous + storehouses storehous stores store + stories stori storm storm + stormed storm storming storm + storms storm stormy stormi + story stori stoup stoup + stoups stoup stout stout + stouter stouter stoutly stoutli + stoutness stout stover stover + stow stow stowage stowag + stowed stow strachy strachi + stragglers straggler straggling straggl + straight straight straightest straightest + straightway straightwai strain strain + strained strain straining strain + strains strain strait strait + straited strait straiter straiter + straitly straitli straitness strait + straits strait strand strand + strange strang strangely strang + strangeness strang stranger stranger + strangers stranger strangest strangest + strangle strangl strangled strangl + strangler strangler strangles strangl + strangling strangl strappado strappado + straps strap stratagem stratagem + stratagems stratagem stratford stratford + strato strato straw straw + strawberries strawberri strawberry strawberri + straws straw strawy strawi + stray strai straying strai + strays strai streak streak + streaks streak stream stream + streamers streamer streaming stream + streams stream streching strech + street street streets street + strength strength strengthen strengthen + strengthened strengthen strengthless strengthless + strengths strength stretch stretch + stretched stretch stretches stretch + stretching stretch strew strew + strewing strew strewings strew + strewments strewment stricken stricken + strict strict stricter stricter + strictest strictest strictly strictli + stricture strictur stride stride + strides stride striding stride + strife strife strifes strife + strik strik strike strike + strikers striker strikes strike + strikest strikest striking strike + string string stringless stringless + strings string strip strip + stripes stripe stripling stripl + striplings stripl stripp stripp + stripping strip striv striv + strive strive strives strive + striving strive strok strok + stroke stroke strokes stroke + strond strond stronds strond + strong strong stronger stronger + strongest strongest strongly strongli + strooke strook strossers strosser + strove strove strown strown + stroy stroi struck struck + strucken strucken struggle struggl + struggles struggl struggling struggl + strumpet strumpet strumpeted strumpet + strumpets strumpet strung strung + strut strut struts strut + strutted strut strutting strut + stubble stubbl stubborn stubborn + stubbornest stubbornest stubbornly stubbornli + stubbornness stubborn stuck stuck + studded stud student student + students student studied studi + studies studi studious studiou + studiously studious studs stud + study studi studying studi + stuff stuff stuffing stuf + stuffs stuff stumble stumbl + stumbled stumbl stumblest stumblest + stumbling stumbl stump stump + stumps stump stung stung + stupefy stupefi stupid stupid + stupified stupifi stuprum stuprum + sturdy sturdi sty sty + styga styga stygian stygian + styl styl style style + styx styx su su + sub sub subcontracted subcontract + subdu subdu subdue subdu + subdued subdu subduements subduement + subdues subdu subduing subdu + subject subject subjected subject + subjection subject subjects subject + submerg submerg submission submiss + submissive submiss submit submit + submits submit submitting submit + suborn suborn subornation suborn + suborned suborn subscrib subscrib + subscribe subscrib subscribed subscrib + subscribes subscrib subscription subscript + subsequent subsequ subsidies subsidi + subsidy subsidi subsist subsist + subsisting subsist substance substanc + substances substanc substantial substanti + substitute substitut substituted substitut + substitutes substitut substitution substitut + subtile subtil subtilly subtilli + subtle subtl subtleties subtleti + subtlety subtleti subtly subtli + subtractors subtractor suburbs suburb + subversion subvers subverts subvert + succedant succed succeed succe + succeeded succeed succeeders succeed + succeeding succeed succeeds succe + success success successantly successantli + successes success successful success + successfully successfulli succession success + successive success successively success + successor successor successors successor + succour succour succours succour + such such suck suck + sucker sucker suckers sucker + sucking suck suckle suckl + sucks suck sudden sudden + suddenly suddenli sue sue + sued su suerly suerli + sues sue sueth sueth + suff suff suffer suffer + sufferance suffer sufferances suffer + suffered suffer suffering suffer + suffers suffer suffic suffic + suffice suffic sufficed suffic + suffices suffic sufficeth sufficeth + sufficiency suffici sufficient suffici + sufficiently suffici sufficing suffic + sufficit sufficit suffigance suffig + suffocate suffoc suffocating suffoc + suffocation suffoc suffolk suffolk + suffrage suffrag suffrages suffrag + sug sug sugar sugar + sugarsop sugarsop suggest suggest + suggested suggest suggesting suggest + suggestion suggest suggestions suggest + suggests suggest suis sui + suit suit suitable suitabl + suited suit suiting suit + suitor suitor suitors suitor + suits suit suivez suivez + sullen sullen sullens sullen + sullied sulli sullies sulli + sully sulli sulph sulph + sulpherous sulpher sulphur sulphur + sulphurous sulphur sultan sultan + sultry sultri sum sum + sumless sumless summ summ + summa summa summary summari + summer summer summers summer + summit summit summon summon + summoners summon summons summon + sumpter sumpter sumptuous sumptuou + sumptuously sumptuous sums sum + sun sun sunbeams sunbeam + sunburning sunburn sunburnt sunburnt + sund sund sunday sundai + sundays sundai sunder sunder + sunders sunder sundry sundri + sung sung sunk sunk + sunken sunken sunny sunni + sunrising sunris suns sun + sunset sunset sunshine sunshin + sup sup super super + superficial superfici superficially superfici + superfluity superflu superfluous superflu + superfluously superflu superflux superflux + superior superior supernal supern + supernatural supernatur superpraise superprais + superscript superscript superscription superscript + superserviceable superservic superstition superstit + superstitious superstiti superstitiously superstiti + supersubtle supersubtl supervise supervis + supervisor supervisor supp supp + supper supper suppers supper + suppertime suppertim supping sup + supplant supplant supple suppl + suppler suppler suppliance supplianc + suppliant suppliant suppliants suppliant + supplicant supplic supplication supplic + supplications supplic supplie suppli + supplied suppli supplies suppli + suppliest suppliest supply suppli + supplyant supplyant supplying suppli + supplyment supplyment support support + supportable support supportance support + supported support supporter support + supporters support supporting support + supportor supportor suppos suppo + supposal suppos suppose suppos + supposed suppos supposes suppos + supposest supposest supposing suppos + supposition supposit suppress suppress + suppressed suppress suppresseth suppresseth + supremacy supremaci supreme suprem + sups sup sur sur + surance suranc surcease surceas + surd surd sure sure + surecard surecard surely sure + surer surer surest surest + sureties sureti surety sureti + surfeit surfeit surfeited surfeit + surfeiter surfeit surfeiting surfeit + surfeits surfeit surge surg + surgeon surgeon surgeons surgeon + surgere surger surgery surgeri + surges surg surly surli + surmis surmi surmise surmis + surmised surmis surmises surmis + surmount surmount surmounted surmount + surmounts surmount surnam surnam + surname surnam surnamed surnam + surpasseth surpasseth surpassing surpass + surplice surplic surplus surplu + surpris surpri surprise surpris + surprised surpris surrender surrend + surrey surrei surreys surrei + survey survei surveyest surveyest + surveying survei surveyor surveyor + surveyors surveyor surveys survei + survive surviv survives surviv + survivor survivor susan susan + suspect suspect suspected suspect + suspecting suspect suspects suspect + suspend suspend suspense suspens + suspicion suspicion suspicions suspicion + suspicious suspici suspiration suspir + suspire suspir sust sust + sustain sustain sustaining sustain + sutler sutler sutton sutton + suum suum swabber swabber + swaddling swaddl swag swag + swagg swagg swagger swagger + swaggerer swagger swaggerers swagger + swaggering swagger swain swain + swains swain swallow swallow + swallowed swallow swallowing swallow + swallows swallow swam swam + swan swan swans swan + sward sward sware sware + swarm swarm swarming swarm + swart swart swarth swarth + swarths swarth swarthy swarthi + swashers swasher swashing swash + swath swath swathing swath + swathling swathl sway swai + swaying swai sways swai + swear swear swearer swearer + swearers swearer swearest swearest + swearing swear swearings swear + swears swear sweat sweat + sweaten sweaten sweating sweat + sweats sweat sweaty sweati + sweep sweep sweepers sweeper + sweeps sweep sweet sweet + sweeten sweeten sweetens sweeten + sweeter sweeter sweetest sweetest + sweetheart sweetheart sweeting sweet + sweetly sweetli sweetmeats sweetmeat + sweetness sweet sweets sweet + swell swell swelling swell + swellings swell swells swell + swelter swelter sweno sweno + swept swept swerve swerv + swerver swerver swerving swerv + swift swift swifter swifter + swiftest swiftest swiftly swiftli + swiftness swift swill swill + swills swill swim swim + swimmer swimmer swimmers swimmer + swimming swim swims swim + swine swine swineherds swineherd + swing swing swinge swing + swinish swinish swinstead swinstead + switches switch swits swit + switzers switzer swol swol + swoll swoll swoln swoln + swoon swoon swooned swoon + swooning swoon swoons swoon + swoop swoop swoopstake swoopstak + swor swor sword sword + sworder sworder swords sword + swore swore sworn sworn + swounded swound swounds swound + swum swum swung swung + sy sy sycamore sycamor + sycorax sycorax sylla sylla + syllable syllabl syllables syllabl + syllogism syllog symbols symbol + sympathise sympathis sympathiz sympathiz + sympathize sympath sympathized sympath + sympathy sympathi synagogue synagogu + synod synod synods synod + syracuse syracus syracusian syracusian + syracusians syracusian syria syria + syrups syrup t t + ta ta taber taber + table tabl tabled tabl + tables tabl tablet tablet + tabor tabor taborer tabor + tabors tabor tabourines tabourin + taciturnity taciturn tack tack + tackle tackl tackled tackl + tackles tackl tackling tackl + tacklings tackl taddle taddl + tadpole tadpol taffeta taffeta + taffety taffeti tag tag + tagrag tagrag tah tah + tail tail tailor tailor + tailors tailor tails tail + taint taint tainted taint + tainting taint taints taint + tainture taintur tak tak + take take taken taken + taker taker takes take + takest takest taketh taketh + taking take tal tal + talbot talbot talbotites talbotit + talbots talbot tale tale + talent talent talents talent + taleporter taleport tales tale + talk talk talked talk + talker talker talkers talker + talkest talkest talking talk + talks talk tall tall + taller taller tallest tallest + tallies talli tallow tallow + tally talli talons talon + tam tam tambourines tambourin + tame tame tamed tame + tamely tame tameness tame + tamer tamer tames tame + taming tame tamora tamora + tamworth tamworth tan tan + tang tang tangle tangl + tangled tangl tank tank + tanlings tanl tann tann + tanned tan tanner tanner + tanquam tanquam tanta tanta + tantaene tantaen tap tap + tape tape taper taper + tapers taper tapestries tapestri + tapestry tapestri taphouse taphous + tapp tapp tapster tapster + tapsters tapster tar tar + tardied tardi tardily tardili + tardiness tardi tardy tardi + tarentum tarentum targe targ + targes targ target target + targets target tarpeian tarpeian + tarquin tarquin tarquins tarquin + tarr tarr tarre tarr + tarriance tarrianc tarried tarri + tarries tarri tarry tarri + tarrying tarri tart tart + tartar tartar tartars tartar + tartly tartli tartness tart + task task tasker tasker + tasking task tasks task + tassel tassel taste tast + tasted tast tastes tast + tasting tast tatt tatt + tatter tatter tattered tatter + tatters tatter tattle tattl + tattling tattl tattlings tattl + taught taught taunt taunt + taunted taunt taunting taunt + tauntingly tauntingli taunts taunt + taurus tauru tavern tavern + taverns tavern tavy tavi + tawdry tawdri tawny tawni + tax tax taxation taxat + taxations taxat taxes tax + taxing tax tc tc + te te teach teach + teacher teacher teachers teacher + teaches teach teachest teachest + teacheth teacheth teaching teach + team team tear tear + tearful tear tearing tear + tears tear tearsheet tearsheet + teat teat tedious tediou + tediously tedious tediousness tedious + teem teem teeming teem + teems teem teen teen + teeth teeth teipsum teipsum + telamon telamon telamonius telamoniu + tell tell teller teller + telling tell tells tell + tellus tellu temp temp + temper temper temperality temper + temperance temper temperate temper + temperately temper tempers temper + tempest tempest tempests tempest + tempestuous tempestu temple templ + temples templ temporal tempor + temporary temporari temporiz temporiz + temporize tempor temporizer tempor + temps temp tempt tempt + temptation temptat temptations temptat + tempted tempt tempter tempter + tempters tempter tempteth tempteth + tempting tempt tempts tempt + ten ten tenable tenabl + tenant tenant tenantius tenantiu + tenantless tenantless tenants tenant + tench tench tend tend + tendance tendanc tended tend + tender tender tendered tender + tenderly tenderli tenderness tender + tenders tender tending tend + tends tend tenedos tenedo + tenement tenement tenements tenement + tenfold tenfold tennis tenni + tenour tenour tenours tenour + tens ten tent tent + tented tent tenth tenth + tenths tenth tents tent + tenure tenur tenures tenur + tercel tercel tereus tereu + term term termagant termag + termed term terminations termin + termless termless terms term + terra terra terrace terrac + terram terram terras terra + terre terr terrene terren + terrestrial terrestri terrible terribl + terribly terribl territories territori + territory territori terror terror + terrors terror tertian tertian + tertio tertio test test + testament testament tested test + tester tester testern testern + testify testifi testimonied testimoni + testimonies testimoni testimony testimoni + testiness testi testril testril + testy testi tetchy tetchi + tether tether tetter tetter + tevil tevil tewksbury tewksburi + text text tgv tgv + th th thaes thae + thames thame than than + thane thane thanes thane + thank thank thanked thank + thankful thank thankfully thankfulli + thankfulness thank thanking thank + thankings thank thankless thankless + thanks thank thanksgiving thanksgiv + thasos thaso that that + thatch thatch thaw thaw + thawing thaw thaws thaw + the the theatre theatr + theban theban thebes thebe + thee thee theft theft + thefts theft thein thein + their their theirs their + theise theis them them + theme theme themes theme + themselves themselv then then + thence thenc thenceforth thenceforth + theoric theoric there there + thereabout thereabout thereabouts thereabout + thereafter thereaft thereat thereat + thereby therebi therefore therefor + therein therein thereof thereof + thereon thereon thereto thereto + thereunto thereunto thereupon thereupon + therewith therewith therewithal therewith + thersites thersit these these + theseus theseu thessalian thessalian + thessaly thessali thetis theti + thews thew they thei + thick thick thicken thicken + thickens thicken thicker thicker + thickest thickest thicket thicket + thickskin thickskin thief thief + thievery thieveri thieves thiev + thievish thievish thigh thigh + thighs thigh thimble thimbl + thimbles thimbl thin thin + thine thine thing thing + things thing think think + thinkest thinkest thinking think + thinkings think thinks think + thinkst thinkst thinly thinli + third third thirdly thirdli + thirds third thirst thirst + thirsting thirst thirsts thirst + thirsty thirsti thirteen thirteen + thirties thirti thirtieth thirtieth + thirty thirti this thi + thisby thisbi thisne thisn + thistle thistl thistles thistl + thither thither thitherward thitherward + thoas thoa thomas thoma + thorn thorn thorns thorn + thorny thorni thorough thorough + thoroughly thoroughli those those + thou thou though though + thought thought thoughtful thought + thoughts thought thousand thousand + thousands thousand thracian thracian + thraldom thraldom thrall thrall + thralled thrall thralls thrall + thrash thrash thrasonical thrason + thread thread threadbare threadbar + threaden threaden threading thread + threat threat threaten threaten + threatening threaten threatens threaten + threatest threatest threats threat + three three threefold threefold + threepence threepenc threepile threepil + threes three threescore threescor + thresher thresher threshold threshold + threw threw thrice thrice + thrift thrift thriftless thriftless + thrifts thrift thrifty thrifti + thrill thrill thrilling thrill + thrills thrill thrive thrive + thrived thrive thrivers thriver + thrives thrive thriving thrive + throat throat throats throat + throbbing throb throbs throb + throca throca throe throe + throes throe thromuldo thromuldo + thron thron throne throne + throned throne thrones throne + throng throng thronging throng + throngs throng throstle throstl + throttle throttl through through + throughfare throughfar throughfares throughfar + throughly throughli throughout throughout + throw throw thrower thrower + throwest throwest throwing throw + thrown thrown throws throw + thrum thrum thrumm thrumm + thrush thrush thrust thrust + thrusteth thrusteth thrusting thrust + thrusts thrust thumb thumb + thumbs thumb thump thump + thund thund thunder thunder + thunderbolt thunderbolt thunderbolts thunderbolt + thunderer thunder thunders thunder + thunderstone thunderston thunderstroke thunderstrok + thurio thurio thursday thursdai + thus thu thwack thwack + thwart thwart thwarted thwart + thwarting thwart thwartings thwart + thy thy thyme thyme + thymus thymu thyreus thyreu + thyself thyself ti ti + tib tib tiber tiber + tiberio tiberio tibey tibei + ticed tice tick tick + tickl tickl tickle tickl + tickled tickl tickles tickl + tickling tickl ticklish ticklish + tiddle tiddl tide tide + tides tide tidings tide + tidy tidi tie tie + tied ti ties ti + tiff tiff tiger tiger + tigers tiger tight tight + tightly tightli tike tike + til til tile tile + till till tillage tillag + tilly tilli tilt tilt + tilter tilter tilth tilth + tilting tilt tilts tilt + tiltyard tiltyard tim tim + timandra timandra timber timber + time time timeless timeless + timelier timeli timely time + times time timon timon + timor timor timorous timor + timorously timor tinct tinct + tincture tinctur tinctures tinctur + tinder tinder tingling tingl + tinker tinker tinkers tinker + tinsel tinsel tiny tini + tip tip tipp tipp + tippling tippl tips tip + tipsy tipsi tiptoe tipto + tir tir tire tire + tired tire tires tire + tirest tirest tiring tire + tirra tirra tirrits tirrit + tis ti tish tish + tisick tisick tissue tissu + titan titan titania titania + tithe tith tithed tith + tithing tith titinius titiniu + title titl titled titl + titleless titleless titles titl + tittle tittl tittles tittl + titular titular titus titu + tn tn to to + toad toad toads toad + toadstool toadstool toast toast + toasted toast toasting toast + toasts toast toaze toaz + toby tobi tock tock + tod tod today todai + todpole todpol tods tod + toe toe toes toe + tofore tofor toge toge + toged toge together togeth + toil toil toiled toil + toiling toil toils toil + token token tokens token + told told toledo toledo + tolerable toler toll toll + tolling toll tom tom + tomb tomb tombe tomb + tombed tomb tombless tombless + tomboys tomboi tombs tomb + tomorrow tomorrow tomyris tomyri + ton ton tongs tong + tongu tongu tongue tongu + tongued tongu tongueless tongueless + tongues tongu tonight tonight + too too took took + tool tool tools tool + tooth tooth toothache toothach + toothpick toothpick toothpicker toothpick + top top topas topa + topful top topgallant topgal + topless topless topmast topmast + topp topp topping top + topple toppl topples toppl + tops top topsail topsail + topsy topsi torch torch + torchbearer torchbear torchbearers torchbear + torcher torcher torches torch + torchlight torchlight tore tore + torment torment tormenta tormenta + tormente torment tormented torment + tormenting torment tormentors tormentor + torments torment torn torn + torrent torrent tortive tortiv + tortoise tortois tortur tortur + torture tortur tortured tortur + torturer tortur torturers tortur + tortures tortur torturest torturest + torturing tortur toryne toryn + toss toss tossed toss + tosseth tosseth tossing toss + tot tot total total + totally total tott tott + tottered totter totters totter + tou tou touch touch + touched touch touches touch + toucheth toucheth touching touch + touchstone touchston tough tough + tougher tougher toughness tough + touraine tourain tournaments tournament + tours tour tous tou + tout tout touze touz + tow tow toward toward + towardly towardli towards toward + tower tower towering tower + towers tower town town + towns town township township + townsman townsman townsmen townsmen + towton towton toy toi + toys toi trace trace + traces trace track track + tract tract tractable tractabl + trade trade traded trade + traders trader trades trade + tradesman tradesman tradesmen tradesmen + trading trade tradition tradit + traditional tradit traduc traduc + traduced traduc traducement traduc + traffic traffic traffickers traffick + traffics traffic tragedian tragedian + tragedians tragedian tragedies tragedi + tragedy tragedi tragic tragic + tragical tragic trail trail + train train trained train + training train trains train + trait trait traitor traitor + traitorly traitorli traitorous traitor + traitorously traitor traitors traitor + traitress traitress traject traject + trammel trammel trample trampl + trampled trampl trampling trampl + tranc tranc trance tranc + tranio tranio tranquil tranquil + tranquillity tranquil transcendence transcend + transcends transcend transferred transfer + transfigur transfigur transfix transfix + transform transform transformation transform + transformations transform transformed transform + transgress transgress transgresses transgress + transgressing transgress transgression transgress + translate translat translated translat + translates translat translation translat + transmigrates transmigr transmutation transmut + transparent transpar transport transport + transportance transport transported transport + transporting transport transports transport + transpose transpos transshape transshap + trap trap trapp trapp + trappings trap traps trap + trash trash travail travail + travails travail travel travel + traveler travel traveling travel + travell travel travelled travel + traveller travel travellers travel + travellest travellest travelling travel + travels travel travers traver + traverse travers tray trai + treacherous treacher treacherously treacher + treachers treacher treachery treacheri + tread tread treading tread + treads tread treason treason + treasonable treason treasonous treason + treasons treason treasure treasur + treasurer treasur treasures treasur + treasuries treasuri treasury treasuri + treat treat treaties treati + treatise treatis treats treat + treaty treati treble trebl + trebled trebl trebles trebl + trebonius treboniu tree tree + trees tree tremble trembl + trembled trembl trembles trembl + tremblest tremblest trembling trembl + tremblingly tremblingli tremor tremor + trempling trempl trench trench + trenchant trenchant trenched trench + trencher trencher trenchering trencher + trencherman trencherman trenchers trencher + trenches trench trenching trench + trent trent tres tre + trespass trespass trespasses trespass + tressel tressel tresses tress + treys trei trial trial + trials trial trib trib + tribe tribe tribes tribe + tribulation tribul tribunal tribun + tribune tribun tribunes tribun + tributaries tributari tributary tributari + tribute tribut tributes tribut + trice trice trick trick + tricking trick trickling trickl + tricks trick tricksy tricksi + trident trident tried tri + trier trier trifle trifl + trifled trifl trifler trifler + trifles trifl trifling trifl + trigon trigon trill trill + trim trim trimly trimli + trimm trimm trimmed trim + trimming trim trims trim + trinculo trinculo trinculos trinculo + trinkets trinket trip trip + tripartite tripartit tripe tripe + triple tripl triplex triplex + tripoli tripoli tripolis tripoli + tripp tripp tripping trip + trippingly trippingli trips trip + tristful trist triton triton + triumph triumph triumphant triumphant + triumphantly triumphantli triumpher triumpher + triumphers triumpher triumphing triumph + triumphs triumph triumvir triumvir + triumvirate triumvir triumvirs triumvir + triumviry triumviri trivial trivial + troat troat trod trod + trodden trodden troiant troiant + troien troien troilus troilu + troiluses troilus trojan trojan + trojans trojan troll troll + tromperies tromperi trompet trompet + troop troop trooping troop + troops troop trop trop + trophies trophi trophy trophi + tropically tropic trot trot + troth troth trothed troth + troths troth trots trot + trotting trot trouble troubl + troubled troubl troubler troubler + troubles troubl troublesome troublesom + troublest troublest troublous troublou + trough trough trout trout + trouts trout trovato trovato + trow trow trowel trowel + trowest trowest troy troi + troyan troyan troyans troyan + truant truant truce truce + truckle truckl trudge trudg + true true trueborn trueborn + truepenny truepenni truer truer + truest truest truie truie + trull trull trulls trull + truly truli trump trump + trumpery trumperi trumpet trumpet + trumpeter trumpet trumpeters trumpet + trumpets trumpet truncheon truncheon + truncheoners truncheon trundle trundl + trunk trunk trunks trunk + trust trust trusted trust + truster truster trusters truster + trusting trust trusts trust + trusty trusti truth truth + truths truth try try + ts ts tu tu + tuae tuae tub tub + tubal tubal tubs tub + tuck tuck tucket tucket + tuesday tuesdai tuft tuft + tufts tuft tug tug + tugg tugg tugging tug + tuition tuition tullus tullu + tully tulli tumble tumbl + tumbled tumbl tumbler tumbler + tumbling tumbl tumult tumult + tumultuous tumultu tun tun + tune tune tuneable tuneabl + tuned tune tuners tuner + tunes tune tunis tuni + tuns tun tupping tup + turban turban turbans turban + turbulence turbul turbulent turbul + turd turd turf turf + turfy turfi turk turk + turkey turkei turkeys turkei + turkish turkish turks turk + turlygod turlygod turmoil turmoil + turmoiled turmoil turn turn + turnbull turnbul turncoat turncoat + turncoats turncoat turned turn + turneth turneth turning turn + turnips turnip turns turn + turph turph turpitude turpitud + turquoise turquois turret turret + turrets turret turtle turtl + turtles turtl turvy turvi + tuscan tuscan tush tush + tut tut tutor tutor + tutored tutor tutors tutor + tutto tutto twain twain + twang twang twangling twangl + twas twa tway twai + tweaks tweak tween tween + twelfth twelfth twelve twelv + twelvemonth twelvemonth twentieth twentieth + twenty twenti twere twere + twice twice twig twig + twiggen twiggen twigs twig + twilight twilight twill twill + twilled twill twin twin + twine twine twink twink + twinkle twinkl twinkled twinkl + twinkling twinkl twinn twinn + twins twin twire twire + twist twist twisted twist + twit twit twits twit + twitting twit twixt twixt + two two twofold twofold + twopence twopenc twopences twopenc + twos two twould twould + tyb tyb tybalt tybalt + tybalts tybalt tyburn tyburn + tying ty tyke tyke + tymbria tymbria type type + types type typhon typhon + tyrannical tyrann tyrannically tyrann + tyrannize tyrann tyrannous tyrann + tyranny tyranni tyrant tyrant + tyrants tyrant tyrian tyrian + tyrrel tyrrel u u + ubique ubiqu udders udder + udge udg uds ud + uglier uglier ugliest ugliest + ugly ugli ulcer ulcer + ulcerous ulcer ulysses ulyss + um um umber umber + umbra umbra umbrage umbrag + umfrevile umfrevil umpire umpir + umpires umpir un un + unable unabl unaccommodated unaccommod + unaccompanied unaccompani unaccustom unaccustom + unaching unach unacquainted unacquaint + unactive unact unadvis unadvi + unadvised unadvis unadvisedly unadvisedli + unagreeable unagre unanel unanel + unanswer unansw unappeas unappea + unapproved unapprov unapt unapt + unaptness unapt unarm unarm + unarmed unarm unarms unarm + unassail unassail unassailable unassail + unattainted unattaint unattempted unattempt + unattended unattend unauspicious unauspici + unauthorized unauthor unavoided unavoid + unawares unawar unback unback + unbak unbak unbanded unband + unbar unbar unbarb unbarb + unbashful unbash unbated unbat + unbatter unbatt unbecoming unbecom + unbefitting unbefit unbegot unbegot + unbegotten unbegotten unbelieved unbeliev + unbend unbend unbent unbent + unbewail unbewail unbid unbid + unbidden unbidden unbind unbind + unbinds unbind unbitted unbit + unbless unbless unblest unblest + unbloodied unbloodi unblown unblown + unbodied unbodi unbolt unbolt + unbolted unbolt unbonneted unbonnet + unbookish unbookish unborn unborn + unbosom unbosom unbound unbound + unbounded unbound unbow unbow + unbowed unbow unbrac unbrac + unbraced unbrac unbraided unbraid + unbreathed unbreath unbred unbr + unbreech unbreech unbridled unbridl + unbroke unbrok unbruis unbrui + unbruised unbruis unbuckle unbuckl + unbuckles unbuckl unbuckling unbuckl + unbuild unbuild unburden unburden + unburdens unburden unburied unburi + unburnt unburnt unburthen unburthen + unbutton unbutton unbuttoning unbutton + uncapable uncap uncape uncap + uncase uncas uncasing uncas + uncaught uncaught uncertain uncertain + uncertainty uncertainti unchain unchain + unchanging unchang uncharge uncharg + uncharged uncharg uncharitably uncharit + unchary unchari unchaste unchast + uncheck uncheck unchilded unchild + uncivil uncivil unclaim unclaim + unclasp unclasp uncle uncl + unclean unclean uncleanliness uncleanli + uncleanly uncleanli uncleanness unclean + uncles uncl unclew unclew + unclog unclog uncoined uncoin + uncolted uncolt uncomeliness uncomeli + uncomfortable uncomfort uncompassionate uncompassion + uncomprehensive uncomprehens unconfinable unconfin + unconfirm unconfirm unconfirmed unconfirm + unconquer unconqu unconquered unconqu + unconsidered unconsid unconstant unconst + unconstrain unconstrain unconstrained unconstrain + uncontemn uncontemn uncontroll uncontrol + uncorrected uncorrect uncounted uncount + uncouple uncoupl uncourteous uncourt + uncouth uncouth uncover uncov + uncovered uncov uncropped uncrop + uncross uncross uncrown uncrown + unction unction unctuous unctuou + uncuckolded uncuckold uncurable uncur + uncurbable uncurb uncurbed uncurb + uncurls uncurl uncurrent uncurr + uncurse uncurs undaunted undaunt + undeaf undeaf undeck undeck + undeeded undeed under under + underbearing underbear underborne underborn + undercrest undercrest underfoot underfoot + undergo undergo undergoes undergo + undergoing undergo undergone undergon + underground underground underhand underhand + underlings underl undermine undermin + underminers undermin underneath underneath + underprizing underpr underprop underprop + understand understand understandeth understandeth + understanding understand understandings understand + understands understand understood understood + underta underta undertake undertak + undertakeing undertak undertaker undertak + undertakes undertak undertaking undertak + undertakings undertak undertook undertook + undervalu undervalu undervalued undervalu + underwent underw underwrit underwrit + underwrite underwrit undescried undescri + undeserved undeserv undeserver undeserv + undeservers undeserv undeserving undeserv + undetermin undetermin undid undid + undinted undint undiscernible undiscern + undiscover undiscov undishonoured undishonour + undispos undispo undistinguishable undistinguish + undistinguished undistinguish undividable undivid + undivided undivid undivulged undivulg + undo undo undoes undo + undoing undo undone undon + undoubted undoubt undoubtedly undoubtedli + undream undream undress undress + undressed undress undrown undrown + unduteous undut undutiful unduti + une un uneared unear + unearned unearn unearthly unearthli + uneasines uneasin uneasy uneasi + uneath uneath uneducated uneduc + uneffectual uneffectu unelected unelect + unequal unequ uneven uneven + unexamin unexamin unexecuted unexecut + unexpected unexpect unexperienc unexperienc + unexperient unexperi unexpressive unexpress + unfair unfair unfaithful unfaith + unfallible unfal unfam unfam + unfashionable unfashion unfasten unfasten + unfather unfath unfathered unfath + unfed unf unfeed unfe + unfeeling unfeel unfeigned unfeign + unfeignedly unfeignedli unfellowed unfellow + unfelt unfelt unfenced unfenc + unfilial unfili unfill unfil + unfinish unfinish unfirm unfirm + unfit unfit unfitness unfit + unfix unfix unfledg unfledg + unfold unfold unfolded unfold + unfoldeth unfoldeth unfolding unfold + unfolds unfold unfool unfool + unforc unforc unforced unforc + unforfeited unforfeit unfortified unfortifi + unfortunate unfortun unfought unfought + unfrequented unfrequ unfriended unfriend + unfurnish unfurnish ungain ungain + ungalled ungal ungart ungart + ungarter ungart ungenitur ungenitur + ungentle ungentl ungentleness ungentl + ungently ungent ungird ungird + ungodly ungodli ungor ungor + ungot ungot ungotten ungotten + ungovern ungovern ungracious ungraci + ungrateful ungrat ungravely ungrav + ungrown ungrown unguarded unguard + unguem unguem unguided unguid + unhack unhack unhair unhair + unhallow unhallow unhallowed unhallow + unhand unhand unhandled unhandl + unhandsome unhandsom unhang unhang + unhappied unhappi unhappily unhappili + unhappiness unhappi unhappy unhappi + unhardened unharden unharm unharm + unhatch unhatch unheard unheard + unhearts unheart unheedful unheed + unheedfully unheedfulli unheedy unheedi + unhelpful unhelp unhidden unhidden + unholy unholi unhop unhop + unhopefullest unhopefullest unhorse unhors + unhospitable unhospit unhous unhou + unhoused unhous unhurtful unhurt + unicorn unicorn unicorns unicorn + unimproved unimprov uninhabitable uninhabit + uninhabited uninhabit unintelligent unintellig + union union unions union + unite unit united unit + unity uniti universal univers + universe univers universities univers + university univers unjointed unjoint + unjust unjust unjustice unjustic + unjustly unjustli unkennel unkennel + unkept unkept unkind unkind + unkindest unkindest unkindly unkindli + unkindness unkind unking unk + unkinglike unkinglik unkiss unkiss + unknit unknit unknowing unknow + unknown unknown unlace unlac + unlaid unlaid unlawful unlaw + unlawfully unlawfulli unlearn unlearn + unlearned unlearn unless unless + unlesson unlesson unletter unlett + unlettered unlett unlick unlick + unlike unlik unlikely unlik + unlimited unlimit unlineal unlin + unlink unlink unload unload + unloaded unload unloading unload + unloads unload unlock unlock + unlocks unlock unlook unlook + unlooked unlook unloos unloo + unloose unloos unlov unlov + unloving unlov unluckily unluckili + unlucky unlucki unmade unmad + unmake unmak unmanly unmanli + unmann unmann unmanner unmann + unmannerd unmannerd unmannerly unmannerli + unmarried unmarri unmask unmask + unmasked unmask unmasking unmask + unmasks unmask unmast unmast + unmatch unmatch unmatchable unmatch + unmatched unmatch unmeasurable unmeasur + unmeet unmeet unmellowed unmellow + unmerciful unmerci unmeritable unmerit + unmeriting unmerit unminded unmind + unmindfull unmindful unmingled unmingl + unmitigable unmitig unmitigated unmitig + unmix unmix unmoan unmoan + unmov unmov unmoved unmov + unmoving unmov unmuffles unmuffl + unmuffling unmuffl unmusical unmus + unmuzzle unmuzzl unmuzzled unmuzzl + unnatural unnatur unnaturally unnatur + unnaturalness unnatur unnecessarily unnecessarili + unnecessary unnecessari unneighbourly unneighbourli + unnerved unnerv unnoble unnobl + unnoted unnot unnumb unnumb + unnumber unnumb unowed unow + unpack unpack unpaid unpaid + unparagon unparagon unparallel unparallel + unpartial unparti unpath unpath + unpaved unpav unpay unpai + unpeaceable unpeac unpeg unpeg + unpeople unpeopl unpeopled unpeopl + unperfect unperfect unperfectness unperfect + unpick unpick unpin unpin + unpink unpink unpitied unpiti + unpitifully unpitifulli unplagu unplagu + unplausive unplaus unpleas unplea + unpleasant unpleas unpleasing unpleas + unpolicied unpolici unpolish unpolish + unpolished unpolish unpolluted unpollut + unpossess unpossess unpossessing unpossess + unpossible unposs unpractis unpracti + unpregnant unpregn unpremeditated unpremedit + unprepar unprepar unprepared unprepar + unpress unpress unprevailing unprevail + unprevented unprev unpriz unpriz + unprizable unpriz unprofitable unprofit + unprofited unprofit unproper unprop + unproperly unproperli unproportion unproport + unprovide unprovid unprovided unprovid + unprovident unprovid unprovokes unprovok + unprun unprun unpruned unprun + unpublish unpublish unpurged unpurg + unpurpos unpurpo unqualitied unqual + unqueen unqueen unquestion unquest + unquestionable unquestion unquiet unquiet + unquietly unquietli unquietness unquiet + unraised unrais unrak unrak + unread unread unready unreadi + unreal unreal unreasonable unreason + unreasonably unreason unreclaimed unreclaim + unreconciled unreconcil unreconciliable unreconcili + unrecounted unrecount unrecuring unrecur + unregarded unregard unregist unregist + unrelenting unrel unremovable unremov + unremovably unremov unreprievable unrepriev + unresolv unresolv unrespected unrespect + unrespective unrespect unrest unrest + unrestor unrestor unrestrained unrestrain + unreveng unreveng unreverend unreverend + unreverent unrever unrevers unrev + unrewarded unreward unrighteous unright + unrightful unright unripe unrip + unripp unripp unrivall unrival + unroll unrol unroof unroof + unroosted unroost unroot unroot + unrough unrough unruly unruli + unsafe unsaf unsaluted unsalut + unsanctified unsanctifi unsatisfied unsatisfi + unsavoury unsavouri unsay unsai + unscalable unscal unscann unscann + unscarr unscarr unschool unschool + unscorch unscorch unscour unscour + unscratch unscratch unseal unseal + unseam unseam unsearch unsearch + unseason unseason unseasonable unseason + unseasonably unseason unseasoned unseason + unseconded unsecond unsecret unsecret + unseduc unseduc unseeing unse + unseeming unseem unseemly unseemli + unseen unseen unseminar unseminar + unseparable unsepar unserviceable unservic + unset unset unsettle unsettl + unsettled unsettl unsever unsev + unsex unsex unshak unshak + unshaked unshak unshaken unshaken + unshaped unshap unshapes unshap + unsheath unsheath unsheathe unsheath + unshorn unshorn unshout unshout + unshown unshown unshrinking unshrink + unshrubb unshrubb unshunn unshunn + unshunnable unshunn unsifted unsift + unsightly unsightli unsinew unsinew + unsisting unsist unskilful unskil + unskilfully unskilfulli unskillful unskil + unslipping unslip unsmirched unsmirch + unsoil unsoil unsolicited unsolicit + unsorted unsort unsought unsought + unsound unsound unsounded unsound + unspeak unspeak unspeakable unspeak + unspeaking unspeak unsphere unspher + unspoke unspok unspoken unspoken + unspotted unspot unsquar unsquar + unstable unstabl unstaid unstaid + unstain unstain unstained unstain + unstanched unstanch unstate unstat + unsteadfast unsteadfast unstooping unstoop + unstringed unstring unstuff unstuff + unsubstantial unsubstanti unsuitable unsuit + unsuiting unsuit unsullied unsulli + unsunn unsunn unsur unsur + unsure unsur unsuspected unsuspect + unsway unswai unswayable unsway + unswayed unswai unswear unswear + unswept unswept unsworn unsworn + untainted untaint untalk untalk + untangle untangl untangled untangl + untasted untast untaught untaught + untempering untemp untender untend + untent untent untented untent + unthankful unthank unthankfulness unthank + unthink unthink unthought unthought + unthread unthread unthrift unthrift + unthrifts unthrift unthrifty unthrifti + untie unti untied unti + until until untimber untimb + untimely untim untir untir + untirable untir untired untir + untitled untitl unto unto + untold untold untouch untouch + untoward untoward untowardly untowardli + untraded untrad untrain untrain + untrained untrain untread untread + untreasur untreasur untried untri + untrimmed untrim untrod untrod + untrodden untrodden untroubled untroubl + untrue untru untrussing untruss + untruth untruth untruths untruth + untucked untuck untun untun + untune untun untuneable untun + untutor untutor untutored untutor + untwine untwin unurg unurg + unus unu unused unus + unusual unusu unvalued unvalu + unvanquish unvanquish unvarnish unvarnish + unveil unveil unveiling unveil + unvenerable unvener unvex unvex + unviolated unviol unvirtuous unvirtu + unvisited unvisit unvulnerable unvulner + unwares unwar unwarily unwarili + unwash unwash unwatch unwatch + unwearied unweari unwed unw + unwedgeable unwedg unweeded unweed + unweighed unweigh unweighing unweigh + unwelcome unwelcom unwept unwept + unwhipp unwhipp unwholesome unwholesom + unwieldy unwieldi unwilling unwil + unwillingly unwillingli unwillingness unwilling + unwind unwind unwiped unwip + unwise unwis unwisely unwis + unwish unwish unwished unwish + unwitted unwit unwittingly unwittingli + unwonted unwont unwooed unwoo + unworthier unworthi unworthiest unworthiest + unworthily unworthili unworthiness unworthi + unworthy unworthi unwrung unwrung + unyok unyok unyoke unyok + up up upbraid upbraid + upbraided upbraid upbraidings upbraid + upbraids upbraid uphoarded uphoard + uphold uphold upholdeth upholdeth + upholding uphold upholds uphold + uplift uplift uplifted uplift + upmost upmost upon upon + upper upper uprear uprear + upreared uprear upright upright + uprighteously upright uprightness upright + uprise upris uprising upris + uproar uproar uproars uproar + uprous uprou upshoot upshoot + upshot upshot upside upsid + upspring upspr upstairs upstair + upstart upstart upturned upturn + upward upward upwards upward + urchin urchin urchinfield urchinfield + urchins urchin urg urg + urge urg urged urg + urgent urgent urges urg + urgest urgest urging urg + urinal urin urinals urin + urine urin urn urn + urns urn urs ur + ursa ursa ursley urslei + ursula ursula urswick urswick + us us usage usag + usance usanc usances usanc + use us used us + useful us useless useless + user user uses us + usest usest useth useth + usher usher ushered usher + ushering usher ushers usher + using us usual usual + usually usual usurer usur + usurers usur usuries usuri + usuring usur usurp usurp + usurpation usurp usurped usurp + usurper usurp usurpers usurp + usurping usurp usurpingly usurpingli + usurps usurp usury usuri + ut ut utensil utensil + utensils utensil utility util + utmost utmost utt utt + utter utter utterance utter + uttered utter uttereth uttereth + uttering utter utterly utterli + uttermost uttermost utters utter + uy uy v v + va va vacancy vacanc + vacant vacant vacation vacat + vade vade vagabond vagabond + vagabonds vagabond vagram vagram + vagrom vagrom vail vail + vailed vail vailing vail + vaillant vaillant vain vain + vainer vainer vainglory vainglori + vainly vainli vainness vain + vais vai valanc valanc + valance valanc vale vale + valence valenc valentine valentin + valentinus valentinu valentio valentio + valeria valeria valerius valeriu + vales vale valiant valiant + valiantly valiantli valiantness valiant + validity valid vallant vallant + valley vallei valleys vallei + vally valli valor valor + valorous valor valorously valor + valour valour valu valu + valuation valuat value valu + valued valu valueless valueless + values valu valuing valu + vane vane vanish vanish + vanished vanish vanishes vanish + vanishest vanishest vanishing vanish + vanities vaniti vanity vaniti + vanquish vanquish vanquished vanquish + vanquisher vanquish vanquishest vanquishest + vanquisheth vanquisheth vant vant + vantage vantag vantages vantag + vantbrace vantbrac vapians vapian + vapor vapor vaporous vapor + vapour vapour vapours vapour + vara vara variable variabl + variance varianc variation variat + variations variat varied vari + variest variest variety varieti + varld varld varlet varlet + varletry varletri varlets varlet + varletto varletto varnish varnish + varrius varriu varro varro + vary vari varying vari + vassal vassal vassalage vassalag + vassals vassal vast vast + vastidity vastid vasty vasti + vat vat vater vater + vaudemont vaudemont vaughan vaughan + vault vault vaultages vaultag + vaulted vault vaulting vault + vaults vault vaulty vaulti + vaumond vaumond vaunt vaunt + vaunted vaunt vaunter vaunter + vaunting vaunt vauntingly vauntingli + vaunts vaunt vauvado vauvado + vaux vaux vaward vaward + ve ve veal veal + vede vede vehemence vehem + vehemency vehem vehement vehement + vehor vehor veil veil + veiled veil veiling veil + vein vein veins vein + vell vell velure velur + velutus velutu velvet velvet + vendible vendibl venerable vener + venereal vener venetia venetia + venetian venetian venetians venetian + veneys venei venge veng + vengeance vengeanc vengeances vengeanc + vengeful veng veni veni + venial venial venice venic + venison venison venit venit + venom venom venomous venom + venomously venom vent vent + ventages ventag vented vent + ventidius ventidiu ventricle ventricl + vents vent ventur ventur + venture ventur ventured ventur + ventures ventur venturing ventur + venturous ventur venue venu + venus venu venuto venuto + ver ver verb verb + verba verba verbal verbal + verbatim verbatim verbosity verbos + verdict verdict verdun verdun + verdure verdur vere vere + verefore verefor verg verg + verge verg vergers verger + verges verg verier verier + veriest veriest verified verifi + verify verifi verily verili + veritable verit verite verit + verities veriti verity veriti + vermilion vermilion vermin vermin + vernon vernon verona verona + veronesa veronesa versal versal + verse vers verses vers + versing vers vert vert + very veri vesper vesper + vessel vessel vessels vessel + vestal vestal vestments vestment + vesture vestur vetch vetch + vetches vetch veux veux + vex vex vexation vexat + vexations vexat vexed vex + vexes vex vexest vexest + vexeth vexeth vexing vex + vi vi via via + vial vial vials vial + viand viand viands viand + vic vic vicar vicar + vice vice vicegerent viceger + vicentio vicentio viceroy viceroi + viceroys viceroi vices vice + vici vici vicious viciou + viciousness vicious vict vict + victims victim victor victor + victoress victoress victories victori + victorious victori victors victor + victory victori victual victual + victuall victual victuals victual + videlicet videlicet video video + vides vide videsne videsn + vidi vidi vie vie + vied vi vienna vienna + view view viewest viewest + vieweth vieweth viewing view + viewless viewless views view + vigil vigil vigilance vigil + vigilant vigil vigitant vigit + vigour vigour vii vii + viii viii vile vile + vilely vile vileness vile + viler viler vilest vilest + vill vill village villag + villager villag villagery villageri + villages villag villain villain + villainies villaini villainous villain + villainously villain villains villain + villainy villaini villanies villani + villanous villan villany villani + villiago villiago villian villian + villianda villianda villians villian + vinaigre vinaigr vincentio vincentio + vincere vincer vindicative vindic + vine vine vinegar vinegar + vines vine vineyard vineyard + vineyards vineyard vint vint + vintner vintner viol viol + viola viola violate violat + violated violat violates violat + violation violat violator violat + violence violenc violent violent + violenta violenta violenteth violenteth + violently violent violet violet + violets violet viper viper + viperous viper vipers viper + vir vir virgilia virgilia + virgin virgin virginal virgin + virginalling virginal virginity virgin + virginius virginiu virgins virgin + virgo virgo virtue virtu + virtues virtu virtuous virtuou + virtuously virtuous visag visag + visage visag visages visag + visard visard viscount viscount + visible visibl visibly visibl + vision vision visions vision + visit visit visitation visit + visitations visit visited visit + visiting visit visitings visit + visitor visitor visitors visitor + visits visit visor visor + vita vita vitae vita + vital vital vitement vitement + vitruvio vitruvio vitx vitx + viva viva vivant vivant + vive vive vixen vixen + viz viz vizaments vizament + vizard vizard vizarded vizard + vizards vizard vizor vizor + vlouting vlout vocation vocat + vocativo vocativo vocatur vocatur + voce voce voic voic + voice voic voices voic + void void voided void + voiding void voke voke + volable volabl volant volant + volivorco volivorco volley vollei + volquessen volquessen volsce volsc + volsces volsc volscian volscian + volscians volscian volt volt + voltemand voltemand volubility volubl + voluble volubl volume volum + volumes volum volumnia volumnia + volumnius volumniu voluntaries voluntari + voluntary voluntari voluptuously voluptu + voluptuousness voluptu vomissement vomiss + vomit vomit vomits vomit + vor vor vore vore + vortnight vortnight vot vot + votaries votari votarist votarist + votarists votarist votary votari + votre votr vouch vouch + voucher voucher vouchers voucher + vouches vouch vouching vouch + vouchsaf vouchsaf vouchsafe vouchsaf + vouchsafed vouchsaf vouchsafes vouchsaf + vouchsafing vouchsaf voudrais voudrai + vour vour vous vou + voutsafe voutsaf vow vow + vowed vow vowel vowel + vowels vowel vowing vow + vows vow vox vox + voyage voyag voyages voyag + vraiment vraiment vulcan vulcan + vulgar vulgar vulgarly vulgarli + vulgars vulgar vulgo vulgo + vulnerable vulner vulture vultur + vultures vultur vurther vurther + w w wad wad + waddled waddl wade wade + waded wade wafer wafer + waft waft waftage waftag + wafting waft wafts waft + wag wag wage wage + wager wager wagers wager + wages wage wagging wag + waggish waggish waggling waggl + waggon waggon waggoner waggon + wagon wagon wagoner wagon + wags wag wagtail wagtail + wail wail wailful wail + wailing wail wails wail + wain wain wainropes wainrop + wainscot wainscot waist waist + wait wait waited wait + waiter waiter waiteth waiteth + waiting wait waits wait + wak wak wake wake + waked wake wakefield wakefield + waken waken wakened waken + wakes wake wakest wakest + waking wake wales wale + walk walk walked walk + walking walk walks walk + wall wall walled wall + wallet wallet wallets wallet + wallon wallon walloon walloon + wallow wallow walls wall + walnut walnut walter walter + wan wan wand wand + wander wander wanderer wander + wanderers wander wandering wander + wanders wander wands wand + wane wane waned wane + wanes wane waning wane + wann wann want want + wanted want wanteth wanteth + wanting want wanton wanton + wantonly wantonli wantonness wanton + wantons wanton wants want + wappen wappen war war + warble warbl warbling warbl + ward ward warded ward + warden warden warder warder + warders warder wardrobe wardrob + wardrop wardrop wards ward + ware ware wares ware + warily warili warkworth warkworth + warlike warlik warm warm + warmed warm warmer warmer + warming warm warms warm + warmth warmth warn warn + warned warn warning warn + warnings warn warns warn + warp warp warped warp + warr warr warrant warrant + warranted warrant warranteth warranteth + warrantise warrantis warrantize warrant + warrants warrant warranty warranti + warren warren warrener warren + warring war warrior warrior + warriors warrior wars war + wart wart warwick warwick + warwickshire warwickshir wary wari + was wa wash wash + washed wash washer washer + washes wash washford washford + washing wash wasp wasp + waspish waspish wasps wasp + wassail wassail wassails wassail + wast wast waste wast + wasted wast wasteful wast + wasters waster wastes wast + wasting wast wat wat + watch watch watched watch + watchers watcher watches watch + watchful watch watching watch + watchings watch watchman watchman + watchmen watchmen watchword watchword + water water waterdrops waterdrop + watered water waterfly waterfli + waterford waterford watering water + waterish waterish waterpots waterpot + waterrugs waterrug waters water + waterton waterton watery wateri + wav wav wave wave + waved wave waver waver + waverer waver wavering waver + waves wave waving wave + waw waw wawl wawl + wax wax waxed wax + waxen waxen waxes wax + waxing wax way wai + waylaid waylaid waylay waylai + ways wai wayward wayward + waywarder wayward waywardness wayward + we we weak weak + weaken weaken weakens weaken + weaker weaker weakest weakest + weakling weakl weakly weakli + weakness weak weal weal + wealsmen wealsmen wealth wealth + wealthiest wealthiest wealthily wealthili + wealthy wealthi wealtlly wealtlli + wean wean weapon weapon + weapons weapon wear wear + wearer wearer wearers wearer + wearied weari wearies weari + weariest weariest wearily wearili + weariness weari wearing wear + wearisome wearisom wears wear + weary weari weasel weasel + weather weather weathercock weathercock + weathers weather weav weav + weave weav weaver weaver + weavers weaver weaves weav + weaving weav web web + wed wed wedded wed + wedding wed wedg wedg + wedged wedg wedges wedg + wedlock wedlock wednesday wednesdai + weed weed weeded weed + weeder weeder weeding weed + weeds weed weedy weedi + week week weeke week + weekly weekli weeks week + ween ween weening ween + weep weep weeper weeper + weeping weep weepingly weepingli + weepings weep weeps weep + weet weet weigh weigh + weighed weigh weighing weigh + weighs weigh weight weight + weightier weightier weightless weightless + weights weight weighty weighti + weird weird welcom welcom + welcome welcom welcomer welcom + welcomes welcom welcomest welcomest + welfare welfar welkin welkin + well well wells well + welsh welsh welshman welshman + welshmen welshmen welshwomen welshwomen + wench wench wenches wench + wenching wench wend wend + went went wept wept + weraday weradai were were + wert wert west west + western western westminster westminst + westmoreland westmoreland westward westward + wet wet wether wether + wetting wet wezand wezand + whale whale whales whale + wharf wharf wharfs wharf + what what whate whate + whatever whatev whatsoe whatso + whatsoever whatsoev whatsome whatsom + whe whe wheat wheat + wheaten wheaten wheel wheel + wheeling wheel wheels wheel + wheer wheer wheeson wheeson + wheezing wheez whelk whelk + whelks whelk whelm whelm + whelp whelp whelped whelp + whelps whelp when when + whenas whena whence whenc + whencesoever whencesoev whene whene + whenever whenev whensoever whensoev + where where whereabout whereabout + whereas wherea whereat whereat + whereby wherebi wherefore wherefor + wherein wherein whereinto whereinto + whereof whereof whereon whereon + whereout whereout whereso whereso + wheresoe whereso wheresoever wheresoev + wheresome wheresom whereto whereto + whereuntil whereuntil whereunto whereunto + whereupon whereupon wherever wherev + wherewith wherewith wherewithal wherewith + whet whet whether whether + whetstone whetston whetted whet + whew whew whey whei + which which whiff whiff + whiffler whiffler while while + whiles while whilst whilst + whin whin whine whine + whined whine whinid whinid + whining whine whip whip + whipp whipp whippers whipper + whipping whip whips whip + whipster whipster whipstock whipstock + whipt whipt whirl whirl + whirled whirl whirligig whirligig + whirling whirl whirlpool whirlpool + whirls whirl whirlwind whirlwind + whirlwinds whirlwind whisp whisp + whisper whisper whispering whisper + whisperings whisper whispers whisper + whist whist whistle whistl + whistles whistl whistling whistl + whit whit white white + whitehall whitehal whitely white + whiteness white whiter whiter + whites white whitest whitest + whither whither whiting white + whitmore whitmor whitsters whitster + whitsun whitsun whittle whittl + whizzing whizz who who + whoa whoa whoe whoe + whoever whoever whole whole + wholesom wholesom wholesome wholesom + wholly wholli whom whom + whoobub whoobub whoop whoop + whooping whoop whor whor + whore whore whoremaster whoremast + whoremasterly whoremasterli whoremonger whoremong + whores whore whoreson whoreson + whoresons whoreson whoring whore + whorish whorish whose whose + whoso whoso whosoe whoso + whosoever whosoev why why + wi wi wick wick + wicked wick wickednes wickedn + wickedness wicked wicket wicket + wicky wicki wid wid + wide wide widens widen + wider wider widow widow + widowed widow widower widow + widowhood widowhood widows widow + wield wield wife wife + wight wight wights wight + wild wild wildcats wildcat + wilder wilder wilderness wilder + wildest wildest wildfire wildfir + wildly wildli wildness wild + wilds wild wiles wile + wilful wil wilfull wilful + wilfully wilfulli wilfulnes wilfuln + wilfulness wil will will + willed will willers willer + willeth willeth william william + williams william willing will + willingly willingli willingness willing + willoughby willoughbi willow willow + wills will wilt wilt + wiltshire wiltshir wimpled wimpl + win win wince winc + winch winch winchester winchest + wincot wincot wind wind + winded wind windgalls windgal + winding wind windlasses windlass + windmill windmil window window + windows window windpipe windpip + winds wind windsor windsor + windy windi wine wine + wing wing winged wing + wingfield wingfield wingham wingham + wings wing wink wink + winking wink winks wink + winner winner winners winner + winning win winnow winnow + winnowed winnow winnows winnow + wins win winter winter + winterly winterli winters winter + wip wip wipe wipe + wiped wipe wipes wipe + wiping wipe wire wire + wires wire wiry wiri + wisdom wisdom wisdoms wisdom + wise wise wiselier wiseli + wisely wise wiser wiser + wisest wisest wish wish + wished wish wisher wisher + wishers wisher wishes wish + wishest wishest wisheth wisheth + wishful wish wishing wish + wishtly wishtli wisp wisp + wist wist wit wit + witb witb witch witch + witchcraft witchcraft witches witch + witching witch with with + withal withal withdraw withdraw + withdrawing withdraw withdrawn withdrawn + withdrew withdrew wither wither + withered wither withering wither + withers wither withheld withheld + withhold withhold withholds withhold + within within withold withold + without without withstand withstand + withstanding withstand withstood withstood + witless witless witness wit + witnesses wit witnesseth witnesseth + witnessing wit wits wit + witted wit wittenberg wittenberg + wittiest wittiest wittily wittili + witting wit wittingly wittingli + wittol wittol wittolly wittolli + witty witti wiv wiv + wive wive wived wive + wives wive wiving wive + wizard wizard wizards wizard + wo wo woe woe + woeful woeful woefull woeful + woefullest woefullest woes woe + woful woful wolf wolf + wolfish wolfish wolsey wolsei + wolves wolv wolvish wolvish + woman woman womanhood womanhood + womanish womanish womankind womankind + womanly womanli womb womb + wombs womb womby wombi + women women won won + woncot woncot wond wond + wonder wonder wondered wonder + wonderful wonder wonderfully wonderfulli + wondering wonder wonders wonder + wondrous wondrou wondrously wondrous + wont wont wonted wont + woo woo wood wood + woodbine woodbin woodcock woodcock + woodcocks woodcock wooden wooden + woodland woodland woodman woodman + woodmonger woodmong woods wood + woodstock woodstock woodville woodvil + wooed woo wooer wooer + wooers wooer wooes wooe + woof woof wooing woo + wooingly wooingli wool wool + woollen woollen woolly woolli + woolsack woolsack woolsey woolsei + woolward woolward woos woo + wor wor worcester worcest + word word words word + wore wore worins worin + work work workers worker + working work workings work + workman workman workmanly workmanli + workmanship workmanship workmen workmen + works work worky worki + world world worldlings worldl + worldly worldli worlds world + worm worm worms worm + wormwood wormwood wormy wormi + worn worn worried worri + worries worri worry worri + worrying worri worse wors + worser worser worship worship + worshipful worship worshipfully worshipfulli + worshipp worshipp worshipper worshipp + worshippers worshipp worshippest worshippest + worships worship worst worst + worsted worst wort wort + worth worth worthied worthi + worthier worthier worthies worthi + worthiest worthiest worthily worthili + worthiness worthi worthless worthless + worths worth worthy worthi + worts wort wot wot + wots wot wotting wot + wouid wouid would would + wouldest wouldest wouldst wouldst + wound wound wounded wound + wounding wound woundings wound + woundless woundless wounds wound + wouns woun woven woven + wow wow wrack wrack + wrackful wrack wrangle wrangl + wrangler wrangler wranglers wrangler + wrangling wrangl wrap wrap + wrapp wrapp wraps wrap + wrapt wrapt wrath wrath + wrathful wrath wrathfully wrathfulli + wraths wrath wreak wreak + wreakful wreak wreaks wreak + wreath wreath wreathed wreath + wreathen wreathen wreaths wreath + wreck wreck wrecked wreck + wrecks wreck wren wren + wrench wrench wrenching wrench + wrens wren wrest wrest + wrested wrest wresting wrest + wrestle wrestl wrestled wrestl + wrestler wrestler wrestling wrestl + wretch wretch wretchcd wretchcd + wretched wretch wretchedness wretched + wretches wretch wring wring + wringer wringer wringing wring + wrings wring wrinkle wrinkl + wrinkled wrinkl wrinkles wrinkl + wrist wrist wrists wrist + writ writ write write + writer writer writers writer + writes write writhled writhl + writing write writings write + writs writ written written + wrong wrong wronged wrong + wronger wronger wrongful wrong + wrongfully wrongfulli wronging wrong + wrongly wrongli wrongs wrong + wronk wronk wrote wrote + wroth wroth wrought wrought + wrung wrung wry wry + wrying wry wt wt + wul wul wye wye + x x xanthippe xanthipp + xi xi xii xii + xiii xiii xiv xiv + xv xv y y + yard yard yards yard + yare yare yarely yare + yarn yarn yaughan yaughan + yaw yaw yawn yawn + yawning yawn ycleped yclepe + ycliped yclipe ye ye + yea yea yead yead + year year yearly yearli + yearn yearn yearns yearn + years year yeas yea + yeast yeast yedward yedward + yell yell yellow yellow + yellowed yellow yellowing yellow + yellowness yellow yellows yellow + yells yell yelping yelp + yeoman yeoman yeomen yeomen + yerk yerk yes ye + yesterday yesterdai yesterdays yesterdai + yesternight yesternight yesty yesti + yet yet yew yew + yicld yicld yield yield + yielded yield yielder yielder + yielders yielder yielding yield + yields yield yok yok + yoke yoke yoked yoke + yokefellow yokefellow yokes yoke + yoketh yoketh yon yon + yond yond yonder yonder + yongrey yongrei yore yore + yorick yorick york york + yorkists yorkist yorks york + yorkshire yorkshir you you + young young younger younger + youngest youngest youngling youngl + younglings youngl youngly youngli + younker younker your your + yours your yourself yourself + yourselves yourselv youth youth + youthful youth youths youth + youtli youtli zanies zani + zany zani zeal zeal + zealous zealou zeals zeal + zed zed zenelophon zenelophon + zenith zenith zephyrs zephyr + zir zir zo zo + zodiac zodiac zodiacs zodiac + zone zone zounds zound + zwagger zwagger } diff --git a/third_party/sqlite/src/ext/fts5/test/fts5prefix.test b/third_party/sqlite/src/ext/fts5/test/fts5prefix.test index 01d0fe5d14baa..896d90c7b41da 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5prefix.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5prefix.test @@ -34,12 +34,12 @@ do_execsql_test 1.1 { #------------------------------------------------------------------------- -# Check that prefix indexes really do index n-character prefixes, not +# Check that prefix indexes really do index n-character prefixes, not # n-byte prefixes. Use the ascii tokenizer so as not to be confused by # diacritic removal. # -do_execsql_test 2.0 { - CREATE VIRTUAL TABLE t1 USING fts5(x, tokenize = ascii, prefix = 2) +do_execsql_test 2.0 { + CREATE VIRTUAL TABLE t1 USING fts5(x, tokenize = ascii, prefix = 2) } do_test 2.1 { @@ -242,8 +242,8 @@ proc rnddoc {n} { set doc } set cols [list] -for {set i 1} {$i<250} {incr i} { - lappend cols "c$i" +for {set i 1} {$i<250} {incr i} { + lappend cols "c$i" lappend vals "'[rnddoc 10]'" } diff --git a/third_party/sqlite/src/ext/fts5/test/fts5rank.test b/third_party/sqlite/src/ext/fts5/test/fts5rank.test index a70c5d68e347a..eca4f9d6791c1 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5rank.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5rank.test @@ -51,7 +51,7 @@ do_execsql_test 2.0 { INSERT INTO tt VALUES('x a a x x'); } -proc firstinst {cmd} { +proc firstinst {cmd} { foreach {p c o} [$cmd xInst 0] {} return $o } @@ -138,12 +138,12 @@ foreach_detail_mode $::testprefix { do_execsql_test 4.1 { DROP TABLE IF EXISTS VTest; CREATE virtual TABLE VTest USING FTS5( - Title, AUthor, tokenize ='porter unicode61 remove_diacritics 1', + Title, AUthor, tokenize ='porter unicode61 remove_diacritics 1', columnsize='1', detail=full ); INSERT INTO VTest (Title, Author) VALUES ('wrinkle in time', 'Bill Smith'); - SELECT * FROM VTest WHERE + SELECT * FROM VTest WHERE VTest MATCH 'wrinkle in time OR a wrinkle in time' ORDER BY rank; } {{wrinkle in time} {Bill Smith}} diff --git a/third_party/sqlite/src/ext/fts5/test/fts5restart.test b/third_party/sqlite/src/ext/fts5/test/fts5restart.test index 0dd7d694540bd..9260993dcec42 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5restart.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5restart.test @@ -98,8 +98,8 @@ do_execsql_test 3.2 { } $lRowid #------------------------------------------------------------------------- -# Remove the row that an FTS5 cursor is currently pointing to. And -# various other similar things. Check that this does not disturb +# Remove the row that an FTS5 cursor is currently pointing to. And +# various other similar things. Check that this does not disturb # ongoing scans. # do_execsql_test 4.0 { diff --git a/third_party/sqlite/src/ext/fts5/test/fts5rowid.test b/third_party/sqlite/src/ext/fts5/test/fts5rowid.test index 19590cdf0d819..167438d424a29 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5rowid.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5rowid.test @@ -35,14 +35,14 @@ do_execsql_test 1.3 { do_catchsql_test 1.4 { SELECT fts5_rowid('nosucharg'); -} {1 {first arg to fts5_rowid() must be 'segment'}} +} {1 {first arg to fts5_rowid() must be 'segment'}} #------------------------------------------------------------------------- # Tests of the fts5_decode() function. # reset_db -do_execsql_test 2.1 { +do_execsql_test 2.1 { CREATE VIRTUAL TABLE x1 USING fts5(a, b); INSERT INTO x1(x1, rank) VALUES('pgsz', 32); } {} diff --git a/third_party/sqlite/src/ext/fts5/test/fts5simple.test b/third_party/sqlite/src/ext/fts5/test/fts5simple.test index 5ac413c8853ec..4c31bd1af0d0c 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5simple.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5simple.test @@ -176,11 +176,11 @@ do_execsql_test 6.1 { INSERT INTO xyz VALUES('x', 'y', 'z'); } -do_catchsql_test 6.2 { - SELECT * FROM xyz WHERE xyz MATCH '' +do_catchsql_test 6.2 { + SELECT * FROM xyz WHERE xyz MATCH '' } {1 {fts5: syntax error near ""}} -do_catchsql_test 6.3 { - SELECT * FROM xyz WHERE xyz MATCH NULL +do_catchsql_test 6.3 { + SELECT * FROM xyz WHERE xyz MATCH NULL } {1 {fts5: syntax error near ""}} #------------------------------------------------------------------------- @@ -189,12 +189,12 @@ do_execsql_test 7.1 { CREATE VIRTUAL TABLE ft2 USING fts5(content); INSERT INTO ft2(rowid, content) VALUES(1, 'a b c'); INSERT INTO ft2(rowid, content) VALUES(2, 'a b d'); -} +} do_catchsql_test 7.2 { BEGIN; UPDATE ft2 SET rowid=2 WHERE rowid=1; -} {1 {constraint failed}} +} {1 {constraint failed}} do_execsql_test 7.3 { COMMIT; @@ -334,8 +334,8 @@ do_execsql_test 14.1 { INSERT INTO ttt(rowid, x) VALUES(3, 'a b c'); COMMIT; } -do_test 14.2 { - fts5_level_segs ttt +do_test 14.2 { + fts5_level_segs ttt } {1} #------------------------------------------------------------------------- diff --git a/third_party/sqlite/src/ext/fts5/test/fts5simple2.test b/third_party/sqlite/src/ext/fts5/test/fts5simple2.test index a6c17894730ee..56e6b63e8c072 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5simple2.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5simple2.test @@ -272,7 +272,7 @@ do_execsql_test 15.1 { CREATE VIRTUAL TABLE t1 USING fts5(x, detail=none); BEGIN; INSERT INTO t1(rowid, x) VALUES(1, 'sqlite'); - INSERT INTO t1(rowid, x) VALUES(2, 'sqlite'); + INSERT INTO t1(rowid, x) VALUES(2, 'sqlite'); COMMIT; } {} @@ -363,11 +363,11 @@ do_execsql_test 17.4 { } do_execsql_test 17.5 { SELECT * FROM t2('x:b* OR y:a*') } do_execsql_test 17.5 { COMMIT ; SELECT * FROM t2('x:b* OR y:a*') } -do_execsql_test 17.6 { +do_execsql_test 17.6 { SELECT * FROM t2('x:b* OR y:a*') WHERE rowid>55 } #db eval {SELECT rowid, fts5_decode_none(rowid, block) aS r FROM t2_data} {puts $r} - + finish_test diff --git a/third_party/sqlite/src/ext/fts5/test/fts5simple3.test b/third_party/sqlite/src/ext/fts5/test/fts5simple3.test index c755ea0567dac..cfcaa251a81a4 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5simple3.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5simple3.test @@ -55,11 +55,11 @@ foreach_detail_mode $testprefix { } execsql "CREATE VIRTUAL TABLE t2 USING fts5(detail=%DETAIL%,[join $cols ,])" } {} - + do_test 2.2 { execsql "INSERT INTO t2 VALUES([join $vals ,])" } {} - + foreach {tn q res} { 1 { c1:val1 } 1 2 { c300:val300 } 1 @@ -109,7 +109,7 @@ do_execsql_test 4.5 { INSERT INTO t2 VALUES('ab'); INSERT INTO t2 VALUES('cd'); INSERT INTO t2 VALUES('ef'); -} +} do_execsql_test 4.6 { SELECT * FROM t2('ab + xyz'); } diff --git a/third_party/sqlite/src/ext/fts5/test/fts5synonym.test b/third_party/sqlite/src/ext/fts5/test/fts5synonym.test index 62436631235c8..7280a793e3c36 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5synonym.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5synonym.test @@ -174,7 +174,7 @@ do_execsql_test 4.2.3 { } {2} do_test 5.0 { - execsql { + execsql { CREATE VIRTUAL TABLE t1 USING fts5(a, b, tokenize=tclnum, detail=%DETAIL%) } foreach {rowid a b} { @@ -227,9 +227,9 @@ foreach {tn q res} { } 4 {5 + 1} { - 2 {[5 1] 3 4 i} {2 2 v two 4} - 3 {[5 i] 5 2 four 4 1} {iii ii five two 1} - 4 {ii four 4 one 5 three five} {one [5 1] iii 4 3} + 2 {[5 1] 3 4 i} {2 2 v two 4} + 3 {[5 i] 5 2 four 4 1} {iii ii five two 1} + 4 {ii four 4 one 5 three five} {one [5 1] iii 4 3} 5 {three i [v i] four 4 1} {ii five five five iii} } @@ -263,10 +263,10 @@ sqlite3_fts5_register_matchinfo db foreach {tn q res} { 1 {one} { - 1 {1 11 7 2 12 6} 2 {2 11 7 0 12 6} - 3 {2 11 7 1 12 6} 4 {1 11 7 2 12 6} - 5 {3 11 7 0 12 6} 6 {0 11 7 2 12 6} - 7 {0 11 7 3 12 6} 8 {1 11 7 0 12 6} + 1 {1 11 7 2 12 6} 2 {2 11 7 0 12 6} + 3 {2 11 7 1 12 6} 4 {1 11 7 2 12 6} + 5 {3 11 7 0 12 6} 6 {0 11 7 2 12 6} + 7 {0 11 7 3 12 6} 8 {1 11 7 0 12 6} 9 {1 11 7 2 12 6} } } { @@ -303,7 +303,7 @@ if {[fts5_expr_ok "NEAR(y q)" t1]} { } do_test 6.0.3 { - execsql { + execsql { CREATE VIRTUAL TABLE t2 USING fts5(a, b, tokenize=tcl, detail=%DETAIL%) } foreach {rowid a b} { diff --git a/third_party/sqlite/src/ext/fts5/test/fts5synonym2.test b/third_party/sqlite/src/ext/fts5/test/fts5synonym2.test index 7e92822c33f6b..ea576a34887cd 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5synonym2.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5synonym2.test @@ -31,8 +31,8 @@ proc fts5_test_bothlist {cmd} { for {set i 0} {$i < [$cmd xPhraseCount]} {incr i} { set bFirst 1 - $cmd xPhraseColumnForeach $i c { - lappend CL $i.$c + $cmd xPhraseColumnForeach $i c { + lappend CL $i.$c if {$bFirst} { $cmd xPhraseForeach $i c o { lappend PL $i.$c.$o } } set bFirst 0 } @@ -46,7 +46,7 @@ proc fts5_rowid {cmd} { expr [$cmd xColumnText -1] } sqlite3_fts5_create_function db fts5_rowid fts5_rowid do_execsql_test 1.$tok.0.1 " - CREATE VIRTUAL TABLE ss USING fts5(a, b, + CREATE VIRTUAL TABLE ss USING fts5(a, b, tokenize='tclnum $tok', detail=%DETAIL%); INSERT INTO ss(ss, rank) VALUES('rank', 'fts5_rowid()'); " diff --git a/third_party/sqlite/src/ext/fts5/test/fts5tok1.test b/third_party/sqlite/src/ext/fts5/test/fts5tok1.test index 6ba170062e2b2..d3d7242429bb1 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5tok1.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5tok1.test @@ -30,8 +30,8 @@ do_execsql_test 1.0 { foreach {tn tbl} {1 t1 2 t2 3 t3} { do_execsql_test 1.$tn.1 "SELECT input, * FROM $tbl ('one two three')" { - {one two three} one 0 3 0 - {one two three} two 4 7 1 + {one two three} one 0 3 0 + {one two three} two 4 7 1 {one two three} three 8 13 2 } @@ -81,8 +81,8 @@ do_execsql_test 1.11 { do_execsql_test 1.12 { SELECT input, * FROM t1 WHERE input < 'b' AND input = 'a b c'; } { - {a b c} a 0 1 0 - {a b c} b 2 3 1 + {a b c} a 0 1 0 + {a b c} b 2 3 1 {a b c} c 4 5 2 } @@ -94,8 +94,8 @@ do_execsql_test 1.13.1 { do_execsql_test 1.13.2 { SELECT c1.*, input, t1.* FROM c1, t1 WHERE input = x AND c1.rowid=t1.rowid; } { - {a b c} {a b c} a 0 1 0 - {d e f} {d e f} e 2 3 1 + {a b c} {a b c} a 0 1 0 + {d e f} {d e f} e 2 3 1 } diff --git a/third_party/sqlite/src/ext/fts5/test/fts5tokenizer.test b/third_party/sqlite/src/ext/fts5/test/fts5tokenizer.test index f68aa19a1057b..4899bcb500283 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5tokenizer.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5tokenizer.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# Tests focusing on the built-in fts5 tokenizers. +# Tests focusing on the built-in fts5 tokenizers. # source [file join [file dirname [info script]] fts5_common.tcl] @@ -57,13 +57,13 @@ do_execsql_test 2.0 { } do_execsql_test 2.1 { SELECT rowid FROM ft1 WHERE ft1 MATCH 'embedding' } 1 do_execsql_test 2.2 { SELECT rowid FROM ft1 WHERE ft1 MATCH 'database' } 1 -do_execsql_test 2.3 { - SELECT rowid FROM ft1 WHERE ft1 MATCH 'database embedding' +do_execsql_test 2.3 { + SELECT rowid FROM ft1 WHERE ft1 MATCH 'database embedding' } 1 -proc tcl_create {args} { +proc tcl_create {args} { set ::targs $args - error "failed" + error "failed" } sqlite3_fts5_create_tokenizer db tcl tcl_create @@ -121,7 +121,7 @@ do_test 5.1.1 { CREATE VIRTUAL TABLE a1 USING fts5(x, tokenize=`ascii separators '\u1234'`); INSERT INTO a1 VALUES('abc\u1234def'); " - execsql { SELECT rowid FROM a1 WHERE a1 MATCH 'def' } + execsql { SELECT rowid FROM a1 WHERE a1 MATCH 'def' } } {} do_test 5.1.2 { @@ -130,7 +130,7 @@ do_test 5.1.2 { x, tokenize=`unicode61 separators '\u1234'`); INSERT INTO a2 VALUES('abc\u1234def'); " - execsql { SELECT rowid FROM a2 WHERE a2 MATCH 'def' } + execsql { SELECT rowid FROM a2 WHERE a2 MATCH 'def' } } {1} do_catchsql_test 5.2 { @@ -141,7 +141,7 @@ do_catchsql_test 5.3 { } {1 {error in tokenizer constructor}} #------------------------------------------------------------------------- -# Test that the ASCII and unicode61 tokenizers both handle SQLITE_DONE +# Test that the ASCII and unicode61 tokenizers both handle SQLITE_DONE # correctly. # @@ -236,7 +236,7 @@ do_execsql_test 8.2 [subst { CREATE VIRTUAL TABLE e6 USING fts5(x, tokenize="unicode61 separators '\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07'" ); - INSERT INTO e6 VALUES('the\u0E01quick\u0E01brown\u0E01fox\u0E01' + INSERT INTO e6 VALUES('the\u0E01quick\u0E01brown\u0E01fox\u0E01' || 'jumped\u0E01over\u0E01the\u0E01lazy\u0E01dog' ); INSERT INTO e6 VALUES('\u0E08\u0E07\u0E09'); diff --git a/third_party/sqlite/src/ext/fts5/test/fts5unicode2.test b/third_party/sqlite/src/ext/fts5/test/fts5unicode2.test index 8e5bb8e22b9c5..ba1a6d31a7d15 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5unicode2.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5unicode2.test @@ -95,7 +95,7 @@ set docs [list { Added the sqlite3_db_readonly() interface. } { Added the SQLITE_FCNTL_PRAGMA file control, giving VFS implementations the - ability to add new PRAGMA statements or to override built-in PRAGMAs. + ability to add new PRAGMA statements or to override built-in PRAGMAs. } { Queries of the form: "SELECT max(x), y FROM table" returns the value of y on the same row that contains the maximum x value. @@ -104,16 +104,16 @@ set docs [list { } { Documented support for the FTS4 content option. This feature has actually been in the code since version 3.7.9 but is only now considered to be - officially supported. + officially supported. } { Pending statements no longer block ROLLBACK. Instead, the pending statement - will return SQLITE_ABORT upon next access after the ROLLBACK. + will return SQLITE_ABORT upon next access after the ROLLBACK. } { Improvements to the handling of CSV inputs in the command-line shell } { Fix a bug introduced in version 3.7.10 that might cause a LEFT JOIN to be incorrectly converted into an INNER JOIN if the WHERE clause indexable terms - connected by OR. + connected by OR. }] set map(a) [list "\u00C4" "\u00E4"] ; # LATIN LETTER A WITH DIAERESIS @@ -126,12 +126,12 @@ set map(h) [list "\u1E26" "\u1E27"] ; # LATIN LETTER H WITH DIAERESIS set map(w) [list "\u1E84" "\u1E85"] ; # LATIN LETTER W WITH DIAERESIS set map(x) [list "\u1E8C" "\u1E8D"] ; # LATIN LETTER X WITH DIAERESIS foreach k [array names map] { - lappend mappings [string toupper $k] [lindex $map($k) 0] + lappend mappings [string toupper $k] [lindex $map($k) 0] lappend mappings $k [lindex $map($k) 1] } -proc mapdoc {doc} { +proc mapdoc {doc} { set doc [regsub -all {[[:space:]]+} $doc " "] - string map $::mappings [string trim $doc] + string map $::mappings [string trim $doc] } do_test 2.0 { @@ -152,11 +152,11 @@ do_test 2.1 { foreach {tn query snippet} { 2 "row" { - ...returns the value of y on the same [row] that contains + ...returns the value of y on the same [row] that contains the maximum x value. } 3 "ROW" { - ...returns the value of y on the same [row] that contains + ...returns the value of y on the same [row] that contains the maximum x value. } 4 "rollback" { @@ -173,14 +173,14 @@ foreach {tn query snippet} { } { do_test 2.$tn { set q [mapdoc $query] - execsql { - SELECT snippet(t2, -1, '[', ']', '...', 15) FROM t2 WHERE t2 MATCH $q + execsql { + SELECT snippet(t2, -1, '[', ']', '...', 15) FROM t2 WHERE t2 MATCH $q } } [list [mapdoc $snippet]] } #------------------------------------------------------------------------- -# Make sure the unicode61 tokenizer does not crash if it is passed a +# Make sure the unicode61 tokenizer does not crash if it is passed a # NULL pointer. reset_db do_execsql_test 3.1 { @@ -271,7 +271,7 @@ do_test 4.3 { do_test 4.4 { sqlite3_exec_hex db { - CREATE VIRTUAL TABLE t9 USING fts5(a, b, + CREATE VIRTUAL TABLE t9 USING fts5(a, b, tokenize="unicode61 separators '%C09004'" ); INSERT INTO t9(a) VALUES('abc%88def %89ghi%90'); @@ -285,17 +285,17 @@ breakpoint do_unicode_token_test3 5.1 {tokenchars {}} { sqlite3_reset sqlite3_column_int } { - sqlite3 sqlite3 - reset reset - sqlite3 sqlite3 - column column + sqlite3 sqlite3 + reset reset + sqlite3 sqlite3 + column column int int } do_unicode_token_test3 5.2 {tokenchars _} { sqlite3_reset sqlite3_column_int } { - sqlite3_reset sqlite3_reset + sqlite3_reset sqlite3_reset sqlite3_column_int sqlite3_column_int } @@ -317,7 +317,7 @@ do_unicode_token_test3 5.4 {tokenchars xyz} { do_unicode_token_test3 5.5 {tokenchars _} {separators zyx} { sqlite3_resetxsqlite3_column_intyhonda_phantom } { - sqlite3_reset sqlite3_reset + sqlite3_reset sqlite3_reset sqlite3_column_int sqlite3_column_int honda_phantom honda_phantom } @@ -337,7 +337,7 @@ do_unicode_token_test3 5.7 \ \u2445timer \u2445timer \ ] -# Check that it is not possible to add a standalone diacritic codepoint +# Check that it is not possible to add a standalone diacritic codepoint # to either separators or tokenchars. do_unicode_token_test3 5.8 "separators \u0301" \ "hello\u0301world \u0301helloworld" \ @@ -367,14 +367,14 @@ proc do_tokenize {tokenizer txt} { set res } -# Argument $lCodepoint must be a list of codepoints (integers) that +# Argument $lCodepoint must be a list of codepoints (integers) that # correspond to whitespace characters. This command creates a string -# $W from the codepoints, then tokenizes "${W}hello{$W}world${W}" +# $W from the codepoints, then tokenizes "${W}hello{$W}world${W}" # using tokenizer $tokenizer. The test passes if the tokenizer successfully # extracts the two 5 character tokens. # proc do_isspace_test {tn tokenizer lCp} { - set whitespace [format [string repeat %c [llength $lCp]] {*}$lCp] + set whitespace [format [string repeat %c [llength $lCp]] {*}$lCp] set txt "${whitespace}hello${whitespace}world${whitespace}" uplevel [list do_test $tn [list do_tokenize $tokenizer $txt] {hello world}] } @@ -382,7 +382,7 @@ proc do_isspace_test {tn tokenizer lCp} { set tokenizers [list unicode61] #ifcapable icu { lappend tokenizers icu } -# Some tests to check that the tokenizers can both identify white-space +# Some tests to check that the tokenizers can both identify white-space # codepoints. All codepoints tested below are of type "Zs" in the # UnicodeData.txt file. foreach T $tokenizers { @@ -496,7 +496,7 @@ foreach {tn sql} { CREATE VIRTUAL TABLE t7 USING fts4(tokenize=unicode61 `separators=x\xC4`); } } { - do_execsql_test 9.$tn.0 { + do_execsql_test 9.$tn.0 { DROP TABLE IF EXISTS t5; DROP TABLE IF EXISTS t5aux; DROP TABLE IF EXISTS t6; @@ -511,7 +511,7 @@ foreach {tn sql} { INSERT INTO t5 VALUES('one two three/four.five.six'); SELECT * FROM t5aux; } { - four.five.six * 1 1 four.five.six 0 1 1 + four.five.six * 1 1 four.five.six 0 1 1 {one two three} * 1 1 {one two three} 0 1 1 } @@ -520,7 +520,7 @@ foreach {tn sql} { INSERT INTO t6 VALUES('alpha=beta"gamma/delta[epsilon]zeta'); SELECT * FROM t6aux; } { - {alpha=beta"gamma} * 1 1 {alpha=beta"gamma} 0 1 1 + {alpha=beta"gamma} * 1 1 {alpha=beta"gamma} 0 1 1 {delta[epsilon]zeta} * 1 1 {delta[epsilon]zeta} 0 1 1 } @@ -529,8 +529,8 @@ foreach {tn sql} { INSERT INTO t7 VALUES('alephxbeth\xC4gimel'); SELECT * FROM t7aux; } { - aleph * 1 1 aleph 0 1 1 - beth * 1 1 beth 0 1 1 + aleph * 1 1 aleph 0 1 1 + beth * 1 1 beth 0 1 1 gimel * 1 1 gimel 0 1 1 } } @@ -549,10 +549,10 @@ do_execsql_test 10.1 { CREATE VIRTUAL TABLE t1aux USING fts4aux(t1); SELECT * FROM t1aux; } { - .single=word * 1 1 .single=word 0 1 1 - four * 1 1 four 0 1 1 - one * 1 1 one 0 1 1 - three * 1 1 three 0 1 1 + .single=word * 1 1 .single=word 0 1 1 + four * 1 1 four 0 1 1 + one * 1 1 one 0 1 1 + three * 1 1 three 0 1 1 two * 1 1 two 0 1 1 } @@ -566,13 +566,13 @@ do_execsql_test 10.2 { CREATE VIRTUAL TABLE t2aux USING fts4aux(t2); SELECT * FROM t2aux; } { - one * 1 1 one 0 1 1 - onebtwoathree * 1 1 onebtwoathree 0 1 1 - three * 1 1 three 0 1 1 + one * 1 1 one 0 1 1 + onebtwoathree * 1 1 onebtwoathree 0 1 1 + three * 1 1 three 0 1 1 two * 1 1 two 0 1 1 } -# Test that the tokenchars and separators options work with the +# Test that the tokenchars and separators options work with the # fts3tokenize table. # do_execsql_test 11.1 { diff --git a/third_party/sqlite/src/ext/fts5/test/fts5unicode3.test b/third_party/sqlite/src/ext/fts5/test/fts5unicode3.test index 876ad27461f32..361fc1198403e 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5unicode3.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5unicode3.test @@ -91,7 +91,7 @@ do_execsql_test 1.2 { UNION ALL SELECT i+1 FROM ii WHERE i<100000 ) - SELECT count(*), min(i) FROM ii + SELECT count(*), min(i) FROM ii WHERE fts5_fold(i,1)!=CAST(tcl_fold(i,1) AS int); } {0 {}} @@ -101,7 +101,7 @@ do_execsql_test 1.3 { UNION ALL SELECT i+1 FROM ii WHERE i<100000 ) - SELECT count(*), min(i) FROM ii + SELECT count(*), min(i) FROM ii WHERE fts5_isalnum(i)!=CAST(tcl_isalnum(i) AS int); } {0 {}} diff --git a/third_party/sqlite/src/ext/fts5/test/fts5update.test b/third_party/sqlite/src/ext/fts5/test/fts5update.test index 399c7ffb11492..8124447c8acb9 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5update.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5update.test @@ -22,15 +22,15 @@ ifcapable !fts5 { } set docs { - "eight zero iv eight 7" "ix one 8 one three ii one" - "1 9 9 three viii" "5 zero ii 6 nine ix 3" - "3 zero 5 2 seven nine" "two eight viii eight 1" - "4 six two 5 9 vii" "viii ii four 8 i i iv" - "vii 0 iv seven 7 viii" "five 1 nine vi seven" - "1 zero zero iii 1" "one one six 6 nine seven" - "one v 4 zero 4 iii ii" "2 3 eight six ix" - "six iv 7 three 5" "ix zero 0 8 ii 7 3" - "four six nine 2 vii 3" "five viii 5 8 0 7" + "eight zero iv eight 7" "ix one 8 one three ii one" + "1 9 9 three viii" "5 zero ii 6 nine ix 3" + "3 zero 5 2 seven nine" "two eight viii eight 1" + "4 six two 5 9 vii" "viii ii four 8 i i iv" + "vii 0 iv seven 7 viii" "five 1 nine vi seven" + "1 zero zero iii 1" "one one six 6 nine seven" + "one v 4 zero 4 iii ii" "2 3 eight six ix" + "six iv 7 three 5" "ix zero 0 8 ii 7 3" + "four six nine 2 vii 3" "five viii 5 8 0 7" } foreach_detail_mode $::testprefix { diff --git a/third_party/sqlite/src/ext/fts5/test/fts5version.test b/third_party/sqlite/src/ext/fts5/test/fts5version.test index 7e4d74d114d9e..dc2ab8589aa39 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5version.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5version.test @@ -38,7 +38,7 @@ do_execsql_test 1.3 { do_execsql_test 1.4 { UPDATE t1_config set v=5 WHERE k='version'; -} +} do_test 1.5 { db close diff --git a/third_party/sqlite/src/ext/fts5/test/fts5vocab.test b/third_party/sqlite/src/ext/fts5/test/fts5vocab.test index 5e0499fbf9479..6e13fd4bc65f5 100644 --- a/third_party/sqlite/src/ext/fts5/test/fts5vocab.test +++ b/third_party/sqlite/src/ext/fts5/test/fts5vocab.test @@ -128,17 +128,17 @@ do_execsql_test 2.0 { } set res_row [star_from_row { - a 10 20 b 9 14 c 9 20 d 9 19 - e 8 13 f 10 20 g 7 14 x 1 1 + a 10 20 b 9 14 c 9 20 d 9 19 + e 8 13 f 10 20 g 7 14 x 1 1 y 1 1 }] set res_col [star_from_col { a a 6 11 a b 7 9 - b a 6 7 b b 7 7 - c a 6 12 c b 5 8 - d a 4 6 d b 9 13 - e a 6 7 e b 6 6 - f a 9 10 f b 7 10 + b a 6 7 b b 7 7 + c a 6 12 c b 5 8 + d a 4 6 d b 9 13 + e a 6 7 e b 6 6 + f a 9 10 f b 7 10 g a 5 7 g b 5 7 x a 1 1 y b 1 1 }] @@ -187,7 +187,7 @@ do_catchsql_test 4.1 { } {1 {wrong number of vtable arguments}} #------------------------------------------------------------------------- -# Test fts5vocab tables created in the temp schema. +# Test fts5vocab tables created in the temp schema. # reset_db forcedelete test.db2 @@ -298,7 +298,7 @@ foreach {term} { j jj jjj } { set resr [db eval { - SELECT $term, + SELECT $term, sum(cont(one || ' ' || two, $term) > 0), sum(cont(one || ' ' || two, $term)) FROM tx @@ -408,12 +408,12 @@ do_execsql_test 8.0 { set resr [star_from_row {a 3 3 b 3 3 c 3 3 d 3 3 e 3 3 f 3 3 g 3 3 h 3 3 i 3 3}] set resc [star_from_col { - a a 1 1 a b 1 1 a c 1 1 b a 1 1 - b b 1 1 b c 1 1 c a 1 1 c b 1 1 + a a 1 1 a b 1 1 a c 1 1 b a 1 1 + b b 1 1 b c 1 1 c a 1 1 c b 1 1 c c 1 1 d a 1 1 d b 1 1 d c 1 1 - e a 1 1 e b 1 1 e c 1 1 f a 1 1 - f b 1 1 f c 1 1 g a 1 1 g b 1 1 - g c 1 1 h a 1 1 h b 1 1 h c 1 1 + e a 1 1 e b 1 1 e c 1 1 f a 1 1 + f b 1 1 f c 1 1 g a 1 1 g b 1 1 + g c 1 1 h a 1 1 h b 1 1 h c 1 1 i a 1 1 i b 1 1 i c 1 1 }] if {[detail_is_none]} { set resc [row_to_col $resr] } @@ -423,7 +423,7 @@ do_execsql_test 8.1.2 { SELECT * FROM x1_c } $resc do_execsql_test 8.2 { PRAGMA writable_schema = 1; - UPDATE sqlite_master + UPDATE sqlite_master SET sql = 'CREATE VIRTUAL TABLE x1 USING fts5(a, detail=%DETAIL%)' WHERE name = 'x1'; } @@ -436,8 +436,8 @@ do_execsql_test 8.2.1 { SELECT * FROM x1_r } $resr if {[detail_is_none]} { do_execsql_test 8.2.2 { SELECT * FROM x1_c } $resc } else { - do_catchsql_test 8.2.2 { - SELECT * FROM x1_c + do_catchsql_test 8.2.2 { + SELECT * FROM x1_c } {1 {database disk image is malformed}} } @@ -468,7 +468,7 @@ do_execsql_test 9.3 { do_execsql_test 9.4 { SELECT * FROM rrr ORDER BY term DESC } { - ghi 2 2 def 2 2 abc 2 2 + ghi 2 2 def 2 2 abc 2 2 } do_test 9.5 { set e2 [db eval { EXPLAIN SELECT * FROM rrr ORDER BY term ASC }] diff --git a/third_party/sqlite/src/ext/fts5/tool/fts5speed.tcl b/third_party/sqlite/src/ext/fts5/tool/fts5speed.tcl index 0f38638c26ae5..b9ddea94ff304 100644 --- a/third_party/sqlite/src/ext/fts5/tool/fts5speed.tcl +++ b/third_party/sqlite/src/ext/fts5/tool/fts5speed.tcl @@ -52,7 +52,7 @@ puts "sql: $sql" puts "nRepeat: $nRepeat" if {[regexp matchinfo $sql]} { sqlite3_fts5_register_matchinfo db - db eval $sql + db eval $sql } else { puts "result: [db eval $sql]" } diff --git a/third_party/sqlite/src/ext/fts5/tool/fts5txt2db.tcl b/third_party/sqlite/src/ext/fts5/tool/fts5txt2db.tcl index 4766b00b06b5c..8338191587348 100644 --- a/third_party/sqlite/src/ext/fts5/tool/fts5txt2db.tcl +++ b/third_party/sqlite/src/ext/fts5/tool/fts5txt2db.tcl @@ -8,7 +8,7 @@ # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # -proc process_cmdline {} { +proc process_cmdline {} { cmdline::process ::A $::argv { {fts5 "use fts5 (this is the default)"} {fts4 "use fts4"} @@ -27,7 +27,7 @@ proc process_cmdline {} { inserted into the column value for each row. For example, setting the -colsize option to "5 10" creates an FTS table with 2 columns, with roughly 5 and 10 tokens per row in each, respectively. - + Each "FILE" argument should be a text file. The contents of these text files is split on whitespace characters to form a list of tokens. The first N1 tokens are used for the first column of the first row, where N1 is the first @@ -48,14 +48,14 @@ namespace eval cmdline { puts stderr "Error: $msg" puts stderr "" } - + set L [list] foreach o $O { if {[llength $o]==1} { lappend L [string toupper $o] } } - + puts stderr "Usage: $::argv0 ?SWITCHES? $L" puts stderr "" puts stderr "Switches are:" @@ -72,17 +72,17 @@ namespace eval cmdline { puts stderr $E exit -1 } - + proc process {avar lArgs O E} { upvar $avar A set zTrailing "" ;# True if ... is present in $O set lPosargs [list] - + # Populate A() with default values. Also, for each switch in the command # line spec, set an entry in the idx() array as follows: # - # {tblname t1 "table name to use"} - # -> [set idx(-tblname) {tblname t1 "table name to use"} + # {tblname t1 "table name to use"} + # -> [set idx(-tblname) {tblname t1 "table name to use"} # # For each position parameter, append its name to $lPosargs. If the ... # specifier is present, set $zTrailing to the name of the prefix. @@ -111,7 +111,7 @@ namespace eval cmdline { } } } - + # Set explicitly specified option values # set nArg [llength $lArgs] @@ -121,10 +121,10 @@ namespace eval cmdline { set c [array names idx "${opt}*"] if {[llength $c]==0} { cmdline_error $O $E "Unrecognized option: $opt"} if {[llength $c]>1} { cmdline_error $O $E "Ambiguous option: $opt"} - + if {[llength $idx($c)]==3} { if {$i==[llength $lArgs]-1} { - cmdline_error $O $E "Option requires argument: $c" + cmdline_error $O $E "Option requires argument: $c" } incr i set A([lindex $idx($c) 0]) [lindex $lArgs $i] @@ -132,7 +132,7 @@ namespace eval cmdline { set A([lindex $idx($c) 0]) 1 } } - + # Deal with position arguments. # set nPosarg [llength $lPosargs] diff --git a/third_party/sqlite/src/ext/fts5/tool/loadfts5.tcl b/third_party/sqlite/src/ext/fts5/tool/loadfts5.tcl index 96fd69260ec2a..e57585751c212 100644 --- a/third_party/sqlite/src/ext/fts5/tool/loadfts5.tcl +++ b/third_party/sqlite/src/ext/fts5/tool/loadfts5.tcl @@ -94,7 +94,7 @@ for {set i 0} {$i < $nOpt} {incr i} { if { [incr i]>=$nOpt } usage set O(trans) [lindex $argv $i] } - + -automerge { if { [incr i]>=$nOpt } usage set O(automerge) [lindex $argv $i] diff --git a/third_party/sqlite/src/ext/fts5/tool/mkfts5c.tcl b/third_party/sqlite/src/ext/fts5/tool/mkfts5c.tcl index 797811d46e201..41c6f8f2f7f5c 100644 --- a/third_party/sqlite/src/ext/fts5/tool/mkfts5c.tcl +++ b/third_party/sqlite/src/ext/fts5/tool/mkfts5c.tcl @@ -24,9 +24,9 @@ set G(src) [string map [list %dir% $srcdir] { set G(hdr) { -#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) +#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) -#if !defined(NDEBUG) && !defined(SQLITE_DEBUG) +#if !defined(NDEBUG) && !defined(SQLITE_DEBUG) # define NDEBUG 1 #endif #if defined(NDEBUG) && defined(SQLITE_DEBUG) @@ -36,7 +36,7 @@ set G(hdr) { } set G(footer) { - + #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) */ } @@ -58,7 +58,7 @@ proc fts5_source_id {zDir} { set top [file dirname [file dirname $zDir]] set uuid [string trim [readfile [file join $top manifest.uuid]]] - set L [split [readfile [file join $top manifest]]] + set L [split [readfile [file join $top manifest]]] set date [lindex $L [expr [lsearch -exact $L D]+1]] set date [string range $date 0 [string last . $date]-1] set date [string map {T { }} $date] @@ -88,8 +88,8 @@ proc fts5c_printfile {zIn} { foreach line [split $data "\n"] { if {[regexp {^#include.*fts5} $line]} { set line "/* $line */" - } elseif { - ![regexp { sqlite3Fts5Init\(} $line] + } elseif { + ![regexp { sqlite3Fts5Init\(} $line] && [regexp {^(const )?[a-zA-Z][a-zA-Z0-9]* [*]?sqlite3Fts5} $line] } { set line "static $line" diff --git a/third_party/sqlite/src/ext/icu/README.txt b/third_party/sqlite/src/ext/icu/README.txt index d744f74981d7f..2e7480faac630 100644 --- a/third_party/sqlite/src/ext/icu/README.txt +++ b/third_party/sqlite/src/ext/icu/README.txt @@ -4,16 +4,16 @@ integration of the "International Components for Unicode" library with SQLite. Documentation follows. 1. Features - + 1.1 SQL Scalars upper() and lower() 1.2 Unicode Aware LIKE Operator 1.3 ICU Collation Sequences 1.4 SQL REGEXP Operator - + 2. Compilation and Usage - + 3. Bugs, Problems and Security Issues - + 3.1 The "case_sensitive_like" Pragma 3.2 The SQLITE_MAX_LIKE_PATTERN_LENGTH Macro 3.3 Collation Sequence Security Issue @@ -23,10 +23,10 @@ SQLite. Documentation follows. 1.1 SQL Scalars upper() and lower() - SQLite's built-in implementations of these two functions only + SQLite's built-in implementations of these two functions only provide case mapping for the 26 letters used in the English language. The ICU based functions provided by this extension - provide case mapping, where defined, for the full range of + provide case mapping, where defined, for the full range of unicode characters. ICU provides two types of case mapping, "general" case mapping and @@ -36,7 +36,7 @@ SQLite. Documentation follows. http://www.icu-project.org/userguide/caseMappings.html http://www.icu-project.org/userguide/posix.html#case_mappings - To utilise "general" case mapping, the upper() or lower() scalar + To utilise "general" case mapping, the upper() or lower() scalar functions are invoked with one argument: upper('ABC') -> 'abc' @@ -57,7 +57,7 @@ SQLite. Documentation follows. operator understands case equivalence for the 26 letters of the English language alphabet. The implementation of LIKE included in this extension uses the ICU function u_foldCase() to provide case - independent comparisons for the full range of unicode characters. + independent comparisons for the full range of unicode characters. The U_FOLD_CASE_DEFAULT flag is passed to u_foldCase(), meaning the dotless 'I' character used in the Turkish language is considered @@ -66,9 +66,9 @@ SQLite. Documentation follows. 1.3 ICU Collation Sequences - A special SQL scalar function, icu_load_collation() is provided that + A special SQL scalar function, icu_load_collation() is provided that may be used to register ICU collation sequences with SQLite. It - is always called with exactly two arguments, the ICU locale + is always called with exactly two arguments, the ICU locale identifying the collation sequence to ICU, and the name of the SQLite collation sequence to create. For example, to create an SQLite collation sequence named "turkish" using Turkish language @@ -87,7 +87,7 @@ SQLite. Documentation follows. australian_penpal_name TEXT COLLATE australian, turkish_penpal_name TEXT COLLATE turkish ); - + 1.4 SQL REGEXP Operator This extension provides an implementation of the SQL binary @@ -143,13 +143,13 @@ SQLite. Documentation follows. SQLITE_MAX_LIKE_PATTERN_LENGTH macro as the maximum length of a pattern in bytes (irrespective of encoding). The default value is defined in internal header file "limits.h". - - The ICU extension LIKE implementation suffers from the same + + The ICU extension LIKE implementation suffers from the same problem and uses the same solution. However, since the ICU extension code does not include the SQLite file "limits.h", modifying the default value therein does not affect the ICU extension. The default value of SQLITE_MAX_LIKE_PATTERN_LENGTH used by - the ICU extension LIKE operator is 50000, defined in source + the ICU extension LIKE operator is 50000, defined in source file "icu.c". 3.3 Collation Sequence Security Issue diff --git a/third_party/sqlite/src/ext/icu/icu.c b/third_party/sqlite/src/ext/icu/icu.c index 7c37812d86aed..1a5627079f958 100644 --- a/third_party/sqlite/src/ext/icu/icu.c +++ b/third_party/sqlite/src/ext/icu/icu.c @@ -11,9 +11,9 @@ ************************************************************************* ** $Id: icu.c,v 1.7 2007/12/13 21:54:11 drh Exp $ ** -** This file implements an integration between the ICU library -** ("International Components for Unicode", an open-source library -** for handling unicode data) and SQLite. The integration uses +** This file implements an integration between the ICU library +** ("International Components for Unicode", an open-source library +** for handling unicode data) and SQLite. The integration uses ** ICU to provide the following to SQLite: ** ** * An implementation of the SQL regexp() function (and hence REGEXP @@ -24,7 +24,7 @@ ** ** * Integration of ICU and SQLite collation sequences. ** -** * An implementation of the LIKE operator that uses ICU to +** * An implementation of the LIKE operator that uses ICU to ** provide case-independent matching. */ @@ -94,7 +94,7 @@ static const unsigned char icuUtf8Trans1[] = { /* ** Compare two UTF-8 strings for equality where the first string is -** a "LIKE" expression. Return true (1) if they are the same and +** a "LIKE" expression. Return true (1) if they are the same and ** false (0) if they are different. */ static int icuLikeCompare( @@ -126,7 +126,7 @@ static int icuLikeCompare( uint8_t c; /* Skip any MATCH_ALL or MATCH_ONE characters that follow a - ** MATCH_ALL. For each MATCH_ONE, skip one character in the + ** MATCH_ALL. For each MATCH_ONE, skip one character in the ** test string. */ while( (c=*zPattern) == MATCH_ALL || c == MATCH_ONE ){ @@ -179,15 +179,15 @@ static int icuLikeCompare( ** ** A LIKE B ** -** is implemented as like(B, A). If there is an escape character E, +** is implemented as like(B, A). If there is an escape character E, ** ** A LIKE B ESCAPE E ** ** is mapped to like(B, A, E). */ static void icuLikeFunc( - sqlite3_context *context, - int argc, + sqlite3_context *context, + int argc, sqlite3_value **argv ){ const unsigned char *zA = sqlite3_value_text(argv[0]); @@ -213,7 +213,7 @@ static void icuLikeFunc( if( zE==0 ) return; U8_NEXT(zE, i, nE, uEsc); if( i!=nE){ - sqlite3_result_error(context, + sqlite3_result_error(context, "ESCAPE expression must be a single character", -1); return; } @@ -228,7 +228,7 @@ static void icuLikeFunc( ** This function is called when an ICU function called from within ** the implementation of an SQL scalar function returns an error. ** -** The scalar function context passed as the first argument is +** The scalar function context passed as the first argument is ** loaded with an error message based on the following two args. */ static void icuFunctionError( @@ -254,7 +254,7 @@ static void icuRegexpDelete(void *p){ /* ** Implementation of SQLite REGEXP operator. This scalar function takes ** two arguments. The first is a regular expression pattern to compile -** the second is a string to match against that pattern. If either +** the second is a string to match against that pattern. If either ** argument is an SQL NULL, then NULL Is returned. Otherwise, the result ** is 1 if the string matches the pattern, or 0 otherwise. ** @@ -278,8 +278,8 @@ static void icuRegexpFunc(sqlite3_context *p, int nArg, sqlite3_value **apArg){ (void)nArg; /* Unused parameter */ - /* If the left hand side of the regexp operator is NULL, - ** then the result is also NULL. + /* If the left hand side of the regexp operator is NULL, + ** then the result is also NULL. */ if( !zString ){ return; @@ -317,7 +317,7 @@ static void icuRegexpFunc(sqlite3_context *p, int nArg, sqlite3_value **apArg){ } /* Set the text that the regular expression operates on to a NULL - ** pointer. This is not really necessary, but it is tidier than + ** pointer. This is not really necessary, but it is tidier than ** leaving the regular expression object configured with an invalid ** pointer after this function returns. */ @@ -328,7 +328,7 @@ static void icuRegexpFunc(sqlite3_context *p, int nArg, sqlite3_value **apArg){ } /* -** Implementations of scalar functions for case mapping - upper() and +** Implementations of scalar functions for case mapping - upper() and ** lower(). Function upper() converts its input to upper-case (ABC). ** Function lower() converts to lower-case (abc). ** @@ -336,7 +336,7 @@ static void icuRegexpFunc(sqlite3_context *p, int nArg, sqlite3_value **apArg){ ** "language specific". Refer to ICU documentation for the differences ** between the two. ** -** To utilise "general" case mapping, the upper() or lower() scalar +** To utilise "general" case mapping, the upper() or lower() scalar ** functions are invoked with one argument: ** ** upper('ABC') -> 'abc' @@ -442,7 +442,7 @@ static int icuCollationColl( /* ** Implementation of the scalar function icu_load_collation(). ** -** This scalar function is used to add ICU collation based collation +** This scalar function is used to add ICU collation based collation ** types to an SQLite database connection. It is intended to be called ** as follows: ** @@ -453,8 +453,8 @@ static int icuCollationColl( ** collation sequence to create. */ static void icuLoadCollation( - sqlite3_context *p, - int nArg, + sqlite3_context *p, + int nArg, sqlite3_value **apArg ){ sqlite3 *db = (sqlite3 *)sqlite3_user_data(p); @@ -480,7 +480,7 @@ static void icuLoadCollation( } assert(p); - rc = sqlite3_create_collation_v2(db, zName, SQLITE_UTF16, (void *)pUCollator, + rc = sqlite3_create_collation_v2(db, zName, SQLITE_UTF16, (void *)pUCollator, icuCollationColl, icuCollationDel ); if( rc!=SQLITE_OK ){ @@ -516,11 +516,11 @@ int sqlite3IcuInit(sqlite3 *db){ int rc = SQLITE_OK; int i; - + for(i=0; rc==SQLITE_OK && i<(int)(sizeof(scalars)/sizeof(scalars[0])); i++){ const struct IcuScalar *p = &scalars[i]; rc = sqlite3_create_function( - db, p->zName, p->nArg, p->enc, + db, p->zName, p->nArg, p->enc, p->iContext ? (void*)db : (void*)0, p->xFunc, 0, 0 ); @@ -534,7 +534,7 @@ int sqlite3IcuInit(sqlite3 *db){ __declspec(dllexport) #endif int sqlite3_icu_init( - sqlite3 *db, + sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi ){ diff --git a/third_party/sqlite/src/ext/misc/amatch.c b/third_party/sqlite/src/ext/misc/amatch.c index efe76566ee694..822e8f30c94a8 100644 --- a/third_party/sqlite/src/ext/misc/amatch.c +++ b/third_party/sqlite/src/ext/misc/amatch.c @@ -24,32 +24,32 @@ ** ); ** ** When it is created, the new amatch table must be supplied with the -** the name of a table V and columns V.W and V.L such that +** the name of a table V and columns V.W and V.L such that ** ** SELECT W FROM V WHERE L=$language ** ** returns the allowed vocabulary for the match. If the "vocabulary_language" ** or L columnname is left unspecified or is an empty string, then no -** filtering of the vocabulary by language is performed. +** filtering of the vocabulary by language is performed. ** ** For efficiency, it is essential that the vocabulary table be indexed: ** ** CREATE vocab_index ON V(W) ** -** A separate edit-cost-table provides scoring information that defines +** A separate edit-cost-table provides scoring information that defines ** what it means for one string to be "close" to another. ** ** The edit-cost-table must contain exactly four columns (more precisely, ** the statement "SELECT * FROM " must return records ** that consist of four columns). It does not matter what the columns are -** named. +** named. ** ** Each row in the edit-cost-table represents a single character -** transformation going from user input to the vocabulary. The leftmost +** transformation going from user input to the vocabulary. The leftmost ** column of the row (column 0) contains an integer identifier of the ** language to which the transformation rule belongs (see "MULTIPLE LANGUAGES" ** below). The second column of the row (column 1) contains the input -** character or characters - the characters of user input. The third +** character or characters - the characters of user input. The third ** column contains characters as they appear in the vocabulary table. ** And the fourth column contains the integer cost of making the ** transformation. For example: @@ -63,10 +63,10 @@ ** The first row inserted into the edit-cost-table by the SQL script ** above indicates that the cost of having an extra 'a' in the vocabulary ** table that is missing in the user input 100. (All costs are integers. -** Overall cost must not exceed 16777216.) The second INSERT statement +** Overall cost must not exceed 16777216.) The second INSERT statement ** creates a rule saying that the cost of having a single letter 'b' in ** user input which is missing in the vocabulary table is 87. The third -** INSERT statement mean that the cost of matching an 'o' in user input +** INSERT statement mean that the cost of matching an 'o' in user input ** against an 'oe' in the vocabulary table is 38. And so forth. ** ** The following rules are special: @@ -110,7 +110,7 @@ ** It is important to put some kind of a limit on the amatch output. This ** can be either in the form of a LIMIT clause at the end of the query, ** or better, a "distanceAMATCH_MX_COST ){ - *pzErr = sqlite3_mprintf("%s: cost must be between 1 and %d", + *pzErr = sqlite3_mprintf("%s: cost must be between 1 and %d", p->zClassName, AMATCH_MX_COST ); rc = SQLITE_ERROR; }else if( nFrom>AMATCH_MX_LENGTH || nTo>AMATCH_MX_LENGTH ){ - *pzErr = sqlite3_mprintf("%s: maximum string length is %d", + *pzErr = sqlite3_mprintf("%s: maximum string length is %d", p->zClassName, AMATCH_MX_LENGTH ); - rc = SQLITE_ERROR; + rc = SQLITE_ERROR; }else if( iLang<0 || iLang>AMATCH_MX_LANGID ){ - *pzErr = sqlite3_mprintf("%s: iLang must be between 0 and %d", + *pzErr = sqlite3_mprintf("%s: iLang must be between 0 and %d", p->zClassName, AMATCH_MX_LANGID ); - rc = SQLITE_ERROR; + rc = SQLITE_ERROR; }else if( strcmp(zFrom,"")==0 && strcmp(zTo,"?")==0 ){ if( p->rIns==0 || p->rIns>rCost ) p->rIns = rCost; @@ -692,7 +692,7 @@ static int amatchLoadRules( sqlite3_free(zSql); /* All rules are now in a singly linked list starting at pHead. This - ** block sorts them by cost and then sets amatch_vtab.pRule to point to + ** block sorts them by cost and then sets amatch_vtab.pRule to point to ** point to the head of the sorted list. */ if( rc==SQLITE_OK ){ @@ -726,7 +726,7 @@ static int amatchLoadRules( /* ** This function converts an SQL quoted string into an unquoted string -** and returns a pointer to a buffer allocated using sqlite3_malloc() +** and returns a pointer to a buffer allocated using sqlite3_malloc() ** containing the result. The caller should eventually free this buffer ** using sqlite3_free. ** @@ -975,7 +975,7 @@ static int amatchClose(sqlite3_vtab_cursor *cur){ ** Render a 24-bit unsigned integer as a 4-byte base-64 number. */ static void amatchEncodeInt(int x, char *z){ - static const char a[] = + static const char a[] = "0123456789" "ABCDEFGHIJ" "KLMNOPQRST" @@ -1036,7 +1036,7 @@ static void amatchAddWord( amatch_avl *pOther; int nBase, nTail; char zBuf[4]; - + if( rCost>pCur->rLimit ){ return; } @@ -1217,11 +1217,11 @@ static int amatchNext(sqlite3_vtab_cursor *cur){ zNext[i] = 0; zBuf[nWord] = 0; if( p->rIns>0 ){ - amatchAddWord(pCur, pWord->rCost+p->rIns, pWord->nMatch, + amatchAddWord(pCur, pWord->rCost+p->rIns, pWord->nMatch, zBuf, zNext); } if( p->rSub>0 ){ - amatchAddWord(pCur, pWord->rCost+p->rSub, pWord->nMatch+nNextIn, + amatchAddWord(pCur, pWord->rCost+p->rSub, pWord->nMatch+nNextIn, zBuf, zNext); } if( p->rIns<0 && p->rSub<0 ) break; @@ -1254,7 +1254,7 @@ static int amatchNext(sqlite3_vtab_cursor *cur){ ** prior to any amatchColumn, amatchRowid, or amatchEof call. */ static int amatchFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -1348,7 +1348,7 @@ static int amatchEof(sqlite3_vtab_cursor *cur){ ** bit 3: Term like (C) found ** ** If bit-1 is set, $str is always in filter.argv[0]. If bit-2 is set -** then $value is in filter.argv[0] if bit-1 is clear and is in +** then $value is in filter.argv[0] if bit-1 is clear and is in ** filter.argv[1] if bit-1 is set. If bit-3 is set, then $ruleid is ** in filter.argv[0] if bit-1 and bit-2 are both zero, is in ** filter.argv[1] if exactly one of bit-1 and bit-2 are set, and is in @@ -1368,7 +1368,7 @@ static int amatchBestIndex( pConstraint = pIdxInfo->aConstraint; for(i=0; inConstraint; i++, pConstraint++){ if( pConstraint->usable==0 ) continue; - if( (iPlan & 1)==0 + if( (iPlan & 1)==0 && pConstraint->iColumn==0 && pConstraint->op==SQLITE_INDEX_CONSTRAINT_MATCH ){ @@ -1410,12 +1410,12 @@ static int amatchBestIndex( pIdxInfo->orderByConsumed = 1; } pIdxInfo->estimatedCost = (double)10000; - + return SQLITE_OK; } /* -** The xUpdate() method. +** The xUpdate() method. ** ** This implementation disallows DELETE and UPDATE. The only thing ** allowed is INSERT into the "command" column. @@ -1430,12 +1430,12 @@ static int amatchUpdate( const unsigned char *zCmd; (void)pRowid; if( argc==1 ){ - pVTab->zErrMsg = sqlite3_mprintf("DELETE from %s is not allowed", + pVTab->zErrMsg = sqlite3_mprintf("DELETE from %s is not allowed", p->zSelf); return SQLITE_ERROR; } if( sqlite3_value_type(argv[0])!=SQLITE_NULL ){ - pVTab->zErrMsg = sqlite3_mprintf("UPDATE of %s is not allowed", + pVTab->zErrMsg = sqlite3_mprintf("UPDATE of %s is not allowed", p->zSelf); return SQLITE_ERROR; } @@ -1449,7 +1449,7 @@ static int amatchUpdate( } zCmd = sqlite3_value_text(argv[2+AMATCH_COL_COMMAND]); if( zCmd==0 ) return SQLITE_OK; - + return SQLITE_OK; } @@ -1491,8 +1491,8 @@ static sqlite3_module amatchModule = { __declspec(dllexport) #endif int sqlite3_amatch_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/misc/carray.c b/third_party/sqlite/src/ext/misc/carray.c index 2fdff0cd3afc1..e371b8886377f 100644 --- a/third_party/sqlite/src/ext/misc/carray.c +++ b/third_party/sqlite/src/ext/misc/carray.c @@ -38,7 +38,7 @@ ** ctype TEXT HIDDEN ** ); ** -** If the hidden columns "pointer" and "count" are unconstrained, then +** If the hidden columns "pointer" and "count" are unconstrained, then ** the virtual table has no rows. Otherwise, the virtual table interprets ** the integer value of "pointer" as a pointer to the array and "count" ** as the number of elements in the array. The virtual table steps through @@ -226,7 +226,7 @@ static int carrayEof(sqlite3_vtab_cursor *cur){ ** to the first row of output. */ static int carrayFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -319,7 +319,7 @@ static int carrayBestIndex( } /* -** This following structure defines all the methods for the +** This following structure defines all the methods for the ** carray virtual table. */ static sqlite3_module carrayModule = { @@ -379,8 +379,8 @@ static void inttoptrFunc( __declspec(dllexport) #endif int sqlite3_carray_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/misc/closure.c b/third_party/sqlite/src/ext/misc/closure.c index 510c46ec9086b..3b168d8a80017 100644 --- a/third_party/sqlite/src/ext/misc/closure.c +++ b/third_party/sqlite/src/ext/misc/closure.c @@ -11,7 +11,7 @@ ************************************************************************* ** ** This file contains code for a virtual table that finds the transitive -** closure of a parent/child relationship in a real table. The virtual +** closure of a parent/child relationship in a real table. The virtual ** table is called "transitive_closure". ** ** A transitive_closure virtual table is created like this: @@ -22,15 +22,15 @@ ** parentcolumn= -- P ** ); ** -** When it is created, the new transitive_closure table may be supplied +** When it is created, the new transitive_closure table may be supplied ** with default values for the name of a table T and columns T.X and T.P. -** The T.X and T.P columns must contain integers. The ideal case is for +** The T.X and T.P columns must contain integers. The ideal case is for ** T.X to be the INTEGER PRIMARY KEY. The T.P column should reference ** the T.X column. The row referenced by T.P is the parent of the current row. ** ** The tablename, idcolumn, and parentcolumn supplied by the CREATE VIRTUAL ** TABLE statement may be overridden in individual queries by including -** terms like tablename='newtable', idcolumn='id2', or +** terms like tablename='newtable', idcolumn='id2', or ** parentcolumn='parent3' in the WHERE clause of the query. ** ** For efficiency, it is essential that there be an index on the P column: @@ -86,7 +86,7 @@ ** The "ct1.depth<=2" term could be a strict equality "ct1.depth=2" in ** order to find only the grandchildren of ?1, not ?1 itself or the ** children of ?1. -** +** ** The root=?1 term must be supplied in WHERE clause or else the query ** of the ct1 virtual table will return an empty set. The tablename, ** idcolumn, and parentcolumn attributes can be overridden in the WHERE @@ -352,8 +352,8 @@ static void closureAvlDestroy(closure_avl *p, void (*xDestroy)(closure_avl*)){ ** End of the AVL Tree implementation ******************************************************************************/ -/* -** A closure virtual-table object +/* +** A closure virtual-table object */ struct closure_vtab { sqlite3_vtab base; /* Base class - must be first */ @@ -410,7 +410,7 @@ static closure_avl *queuePull(closure_queue *pQueue){ /* ** This function converts an SQL quoted string into an unquoted string -** and returns a pointer to a buffer allocated using sqlite3_malloc() +** and returns a pointer to a buffer allocated using sqlite3_malloc() ** containing the result. The caller should eventually free this buffer ** using sqlite3_free. ** @@ -650,12 +650,12 @@ static int closureInsertNode( ** ** This routine actually computes the closure. ** -** See the comment at the beginning of closureBestIndex() for a +** See the comment at the beginning of closureBestIndex() for a ** description of the meaning of idxNum. The idxStr parameter is ** not used. */ static int closureFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -805,7 +805,7 @@ static int closureEof(sqlite3_vtab_cursor *cur){ ** (D) idcolumn = $idcolumn ** (E) parentcolumn = $parentcolumn ** -** +** ** ** idxNum meaning ** ---------- ------------------------------------------------------ @@ -838,7 +838,7 @@ static int closureBestIndex( seenMatch = 1; } if( pConstraint->usable==0 ) continue; - if( (iPlan & 1)==0 + if( (iPlan & 1)==0 && pConstraint->iColumn==CLOSURE_COL_ROOT && pConstraint->op==SQLITE_INDEX_CONSTRAINT_EQ ){ @@ -902,7 +902,7 @@ static int closureBestIndex( } if( seenMatch && (iPlan&1)==0 ) rCost *= 1e30; pIdxInfo->estimatedCost = rCost; - + return SQLITE_OK; } @@ -944,8 +944,8 @@ static sqlite3_module closureModule = { __declspec(dllexport) #endif int sqlite3_closure_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/misc/compress.c b/third_party/sqlite/src/ext/misc/compress.c index bf38d4c93cfef..73406bc9a1c67 100644 --- a/third_party/sqlite/src/ext/misc/compress.c +++ b/third_party/sqlite/src/ext/misc/compress.c @@ -97,8 +97,8 @@ static void uncompressFunc( __declspec(dllexport) #endif int sqlite3_compress_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/misc/csv.c b/third_party/sqlite/src/ext/misc/csv.c index f887784ab858d..6e4af0c882fb7 100644 --- a/third_party/sqlite/src/ext/misc/csv.c +++ b/third_party/sqlite/src/ext/misc/csv.c @@ -167,7 +167,7 @@ static int csv_getc(CsvReader *p){ return p->zIn[p->iIn++]; } -/* Increase the size of p->z and append character c to the end. +/* Increase the size of p->z and append character c to the end. ** Return 0 on success and non-zero if there is an OOM error */ static CSV_NOINLINE int csv_resize_and_append(CsvReader *p, char c){ char *zNew; @@ -268,9 +268,9 @@ static char *csv_read_one_field(CsvReader *p){ /* Forward references to the various virtual table methods implemented ** in this file. */ -static int csvtabCreate(sqlite3*, void*, int, const char*const*, +static int csvtabCreate(sqlite3*, void*, int, const char*const*, sqlite3_vtab**,char**); -static int csvtabConnect(sqlite3*, void*, int, const char*const*, +static int csvtabConnect(sqlite3*, void*, int, const char*const*, sqlite3_vtab**,char**); static int csvtabBestIndex(sqlite3_vtab*,sqlite3_index_info*); static int csvtabDisconnect(sqlite3_vtab*); @@ -427,7 +427,7 @@ static int csv_boolean(const char *z){ ** columns=N Assume the CSV file contains N columns. ** ** Only available if compiled with SQLITE_TEST: -** +** ** testflags=N Bitmask of test flags. Optional ** ** If schema= is omitted, then the columns are named "c0", "c1", "c2", @@ -453,7 +453,7 @@ static int csvtabConnect( CsvReader sRdr; /* A CSV file reader used to store an error ** message and/or to count the number of columns */ static const char *azParam[] = { - "filename", "data", "schema", + "filename", "data", "schema", }; char *azPValue[3]; /* Parameter values */ # define CSV_FILENAME (azPValue[0]) @@ -716,7 +716,7 @@ static int csvtabEof(sqlite3_vtab_cursor *cur){ ** the beginning. */ static int csvtabFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -766,7 +766,7 @@ static int csvtabBestIndex( unsigned char op; if( pIdxInfo->aConstraint[i].usable==0 ) continue; op = pIdxInfo->aConstraint[i].op; - if( op==SQLITE_INDEX_CONSTRAINT_EQ + if( op==SQLITE_INDEX_CONSTRAINT_EQ || op==SQLITE_INDEX_CONSTRAINT_LIKE || op==SQLITE_INDEX_CONSTRAINT_GLOB ){ @@ -843,17 +843,17 @@ static sqlite3_module CsvModuleFauxWrite = { #ifdef _WIN32 __declspec(dllexport) #endif -/* +/* ** This routine is called when the extension is loaded. The new ** CSV virtual table module is registered with the calling database ** connection. */ int sqlite3_csv_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ -#ifndef SQLITE_OMIT_VIRTUALTABLE +#ifndef SQLITE_OMIT_VIRTUALTABLE int rc; SQLITE_EXTENSION_INIT2(pApi); rc = sqlite3_create_module(db, "csv", &CsvModule, 0); diff --git a/third_party/sqlite/src/ext/misc/eval.c b/third_party/sqlite/src/ext/misc/eval.c index 71b6b69f20a73..2a036a91fd265 100644 --- a/third_party/sqlite/src/ext/misc/eval.c +++ b/third_party/sqlite/src/ext/misc/eval.c @@ -33,7 +33,7 @@ struct EvalResult { */ static int callback(void *pCtx, int argc, char **argv, char **colnames){ struct EvalResult *p = (struct EvalResult*)pCtx; - int i; + int i; for(i=0; i" must return records ** that consist of four columns). It does not matter what the columns are -** named. +** named. ** ** Each row in the fuzzer data table represents a single character ** transformation. The left most column of the row (column 0) contains an ** integer value - the identifier of the ruleset to which the transformation ** rule belongs (see "MULTIPLE RULE SETS" below). The second column of the -** row (column 0) contains the input character or characters. The third +** row (column 0) contains the input character or characters. The third ** column contains the output character or characters. And the fourth column ** contains the integer cost of making the transformation. For example: ** @@ -43,8 +43,8 @@ ** INSERT INTO f_data(ruleset, cFrom, cTo, Cost) VALUES(0, 'oe', 'o', 40); ** ** The first row inserted into the fuzzer data table by the SQL script -** above indicates that the cost of inserting a letter 'a' is 100. (All -** costs are integers. We recommend that costs be scaled so that the +** above indicates that the cost of inserting a letter 'a' is 100. (All +** costs are integers. We recommend that costs be scaled so that the ** average cost is around 100.) The second INSERT statement creates a rule ** saying that the cost of deleting a single letter 'b' is 87. The third ** and fourth INSERT statements mean that the cost of transforming a @@ -53,7 +53,7 @@ ** ** The contents of the fuzzer data table are loaded into main memory when ** a fuzzer table is first created, and may be internally reloaded by the -** system at any subsequent time. Therefore, the fuzzer data table should be +** system at any subsequent time. Therefore, the fuzzer data table should be ** populated before the fuzzer table is created and not modified thereafter. ** If you do need to modify the contents of the fuzzer data table, it is ** recommended that the associated fuzzer table be dropped, the fuzzer data @@ -73,7 +73,7 @@ ** (called "distance") and appear in order of increasing cost. No string ** is output more than once. If there are multiple ways to transform the ** target string into the output string then the lowest cost transform is -** the one that is returned. In the example, the search is limited to +** the one that is returned. In the example, the search is limited to ** strings with a total distance of less than 200. ** ** The fuzzer is a read-only table. Any attempt to DELETE, INSERT, or @@ -82,7 +82,7 @@ ** It is important to put some kind of a limit on the fuzzer output. This ** can be either in the form of a LIMIT clause at the end of the query, ** or better, a "distanceFUZZER_MX_COST ){ - *pzErr = sqlite3_mprintf("%s: cost must be between 1 and %d", + *pzErr = sqlite3_mprintf("%s: cost must be between 1 and %d", p->zClassName, FUZZER_MX_COST ); rc = SQLITE_ERROR; }else if( nFrom>FUZZER_MX_LENGTH || nTo>FUZZER_MX_LENGTH ){ - *pzErr = sqlite3_mprintf("%s: maximum string length is %d", + *pzErr = sqlite3_mprintf("%s: maximum string length is %d", p->zClassName, FUZZER_MX_LENGTH ); - rc = SQLITE_ERROR; + rc = SQLITE_ERROR; }else if( iRuleset<0 || iRuleset>FUZZER_MX_RULEID ){ - *pzErr = sqlite3_mprintf("%s: ruleset must be between 0 and %d", + *pzErr = sqlite3_mprintf("%s: ruleset must be between 0 and %d", p->zClassName, FUZZER_MX_RULEID ); - rc = SQLITE_ERROR; + rc = SQLITE_ERROR; }else{ pRule = sqlite3_malloc( sizeof(*pRule) + nFrom + nTo ); @@ -401,7 +401,7 @@ static int fuzzerLoadRules( sqlite3_free(zSql); /* All rules are now in a singly linked list starting at pHead. This - ** block sorts them by cost and then sets fuzzer_vtab.pRule to point to + ** block sorts them by cost and then sets fuzzer_vtab.pRule to point to ** point to the head of the sorted list. */ if( rc==SQLITE_OK ){ @@ -435,7 +435,7 @@ static int fuzzerLoadRules( /* ** This function converts an SQL quoted string into an unquoted string -** and returns a pointer to a buffer allocated using sqlite3_malloc() +** and returns a pointer to a buffer allocated using sqlite3_malloc() ** containing the result. The caller should eventually free this buffer ** using sqlite3_free. ** @@ -631,7 +631,7 @@ static int fuzzerRender( }else{ memcpy(z, pStem->zBasis, n); memcpy(&z[n], pRule->zTo, pRule->nTo); - memcpy(&z[n+pRule->nTo], &pStem->zBasis[n+pRule->nFrom], + memcpy(&z[n+pRule->nTo], &pStem->zBasis[n+pRule->nFrom], pStem->nBasis-n-pRule->nFrom+1); } @@ -707,9 +707,9 @@ static int fuzzerSeen(fuzzer_cursor *pCur, fuzzer_stem *pStem){ /* ** If argument pRule is NULL, this function returns false. ** -** Otherwise, it returns true if rule pRule should be skipped. A rule +** Otherwise, it returns true if rule pRule should be skipped. A rule ** should be skipped if it does not belong to rule-set iRuleset, or if -** applying it to stem pStem would create a string longer than +** applying it to stem pStem would create a string longer than ** FUZZER_MX_OUTPUT_LENGTH bytes. */ static int fuzzerSkipRule( @@ -804,7 +804,7 @@ static fuzzer_stem *fuzzerLowestCostStem(fuzzer_cursor *pCur){ pBest = pX; iBest = i; } - } + } if( pBest ){ pCur->aQueue[iBest] = pBest->pNext; pBest->pNext = 0; @@ -965,7 +965,7 @@ static int fuzzerNext(sqlite3_vtab_cursor *cur){ ** prior to any fuzzerColumn, fuzzerRowid, or fuzzerEof call. */ static int fuzzerFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -1067,7 +1067,7 @@ static int fuzzerEof(sqlite3_vtab_cursor *cur){ ** bit 3: Term like (C) found ** ** If bit-1 is set, $str is always in filter.argv[0]. If bit-2 is set -** then $value is in filter.argv[0] if bit-1 is clear and is in +** then $value is in filter.argv[0] if bit-1 is clear and is in ** filter.argv[1] if bit-1 is set. If bit-3 is set, then $ruleid is ** in filter.argv[0] if bit-1 and bit-2 are both zero, is in ** filter.argv[1] if exactly one of bit-1 and bit-2 are set, and is in @@ -1089,7 +1089,7 @@ static int fuzzerBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ seenMatch = 1; } if( pConstraint->usable==0 ) continue; - if( (iPlan & 1)==0 + if( (iPlan & 1)==0 && pConstraint->iColumn==0 && pConstraint->op==SQLITE_INDEX_CONSTRAINT_MATCH ){ @@ -1135,7 +1135,7 @@ static int fuzzerBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ } if( seenMatch && (iPlan&1)==0 ) rCost = 1e99; pIdxInfo->estimatedCost = rCost; - + return SQLITE_OK; } @@ -1147,7 +1147,7 @@ static sqlite3_module fuzzerModule = { fuzzerConnect, fuzzerConnect, fuzzerBestIndex, - fuzzerDisconnect, + fuzzerDisconnect, fuzzerDisconnect, fuzzerOpen, /* xOpen - open a cursor */ fuzzerClose, /* xClose - close a cursor */ @@ -1172,8 +1172,8 @@ static sqlite3_module fuzzerModule = { __declspec(dllexport) #endif int sqlite3_fuzzer_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/misc/ieee754.c b/third_party/sqlite/src/ext/misc/ieee754.c index 20c5e6143347c..8fbb4e538f235 100644 --- a/third_party/sqlite/src/ext/misc/ieee754.c +++ b/third_party/sqlite/src/ext/misc/ieee754.c @@ -114,8 +114,8 @@ static void ieee754func( __declspec(dllexport) #endif int sqlite3_ieee_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/misc/json1.c b/third_party/sqlite/src/ext/misc/json1.c index 3063f9f261a8b..2f0a3e26364ce 100644 --- a/third_party/sqlite/src/ext/misc/json1.c +++ b/third_party/sqlite/src/ext/misc/json1.c @@ -200,7 +200,7 @@ static void jsonReset(JsonString *p){ } -/* Report an out-of-memory (OOM) condition +/* Report an out-of-memory (OOM) condition */ static void jsonOom(JsonString *p){ p->bErr = 1; @@ -317,7 +317,7 @@ static void jsonAppendString(JsonString *p, const char *zIn, u32 N){ } /* -** Append a function parameter value to the JSON string under +** Append a function parameter value to the JSON string under ** construction. */ static void jsonAppendValue( @@ -362,7 +362,7 @@ static void jsonAppendValue( */ static void jsonResult(JsonString *p){ if( p->bErr==0 ){ - sqlite3_result_text64(p->pCtx, p->zBuf, p->nUsed, + sqlite3_result_text64(p->pCtx, p->zBuf, p->nUsed, p->bStatic ? SQLITE_TRANSIENT : sqlite3_free, SQLITE_UTF8); jsonZero(p); @@ -568,7 +568,7 @@ static void jsonReturn( if( pNode->jnFlags & JNODE_RAW ){ sqlite3_result_text(pCtx, pNode->u.zJContent, pNode->n, SQLITE_TRANSIENT); - }else + }else #endif assert( (pNode->jnFlags & JNODE_RAW)==0 ); if( (pNode->jnFlags & JNODE_ESCAPE)==0 ){ @@ -1162,7 +1162,7 @@ static void jsonWrongNumArgs( char *zMsg = sqlite3_mprintf("json_%s() needs an odd number of arguments", zFuncName); sqlite3_result_error(pCtx, zMsg, -1); - sqlite3_free(zMsg); + sqlite3_free(zMsg); } @@ -1230,7 +1230,7 @@ static void jsonTest1Func( /* ** Implementation of the json_QUOTE(VALUE) function. Return a JSON value -** corresponding to the SQL value input. Mostly this means putting +** corresponding to the SQL value input. Mostly this means putting ** double-quotes around strings and returning the unquoted string "null" ** when given a NULL input. */ @@ -1277,7 +1277,7 @@ static void jsonArrayFunc( ** json_array_length(JSON) ** json_array_length(JSON, PATH) ** -** Return the number of elements in the top-level JSON array. +** Return the number of elements in the top-level JSON array. ** Return 0 if the input is not a well-formed JSON array. */ static void jsonArrayLengthFunc( @@ -1721,7 +1721,7 @@ static int jsonEachConnect( UNUSED_PARAM(argv); UNUSED_PARAM(argc); UNUSED_PARAM(pAux); - rc = sqlite3_declare_vtab(db, + rc = sqlite3_declare_vtab(db, "CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path," "json HIDDEN,root HIDDEN)"); if( rc==SQLITE_OK ){ @@ -1899,7 +1899,7 @@ static int jsonEachColumn( break; } case JEACH_ID: { - sqlite3_result_int64(ctx, + sqlite3_result_int64(ctx, (sqlite3_int64)p->i + ((pThis->jnFlags & JNODE_LABEL)!=0)); break; } @@ -2195,7 +2195,7 @@ int sqlite3Json1Init(sqlite3 *db){ #endif for(i=0; ipStmt, 1, (char*)p->zPrefix, p->nPrefix, SQLITE_STATIC); @@ -232,7 +232,7 @@ static void nextCharFunc( } if( argc>=5 && (zCollName = sqlite3_value_text(argv[4]))!=0 - && zCollName[0]!=0 + && zCollName[0]!=0 ){ zColl = sqlite3_mprintf("collate \"%w\"", zCollName); if( zColl==0 ){ @@ -290,8 +290,8 @@ static void nextCharFunc( __declspec(dllexport) #endif int sqlite3_nextchar_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/misc/percentile.c b/third_party/sqlite/src/ext/misc/percentile.c index a5d7e84913a9c..5b76777505cf3 100644 --- a/third_party/sqlite/src/ext/misc/percentile.c +++ b/third_party/sqlite/src/ext/misc/percentile.c @@ -206,8 +206,8 @@ static void percentFinal(sqlite3_context *pCtx){ __declspec(dllexport) #endif int sqlite3_percentile_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/misc/regexp.c b/third_party/sqlite/src/ext/misc/regexp.c index b4a8ab5c04235..9001fef6fd9c4 100644 --- a/third_party/sqlite/src/ext/misc/regexp.c +++ b/third_party/sqlite/src/ext/misc/regexp.c @@ -141,7 +141,7 @@ static void re_add_state(ReStateSet *pSet, int newState){ /* Extract the next unicode character from *pzIn and return it. Advance ** *pzIn to the first byte past the end of the character returned. To -** be clear: this routine converts utf8 to unicode. This routine is +** be clear: this routine converts utf8 to unicode. This routine is ** optimized for the common case where the next character is a single byte. */ static unsigned re_next_char(ReInput *p){ @@ -212,7 +212,7 @@ static int re_match(ReCompiled *pRe, const unsigned char *zIn, int nIn){ /* Look for the initial prefix match, if there is one. */ if( pRe->nInit ){ unsigned char x = pRe->zInit[0]; - while( in.i+pRe->nInit<=in.mx + while( in.i+pRe->nInit<=in.mx && (zIn[in.i]!=x || strncmp((const char*)zIn+in.i, (const char*)pRe->zInit, pRe->nInit)!=0) ){ @@ -319,7 +319,7 @@ static int re_match(ReCompiled *pRe, const unsigned char *zIn, int nIn){ } if( pRe->aOp[x]==RE_OP_CC_EXC ) hit = !hit; if( hit ) re_add_state(pNext, x+n); - break; + break; } } } @@ -480,7 +480,7 @@ static const char *re_subcompile_string(ReCompiled *p){ iStart = p->nState; switch( c ){ case '|': - case '$': + case '$': case ')': { p->sIn.i--; return 0; @@ -496,7 +496,7 @@ static const char *re_subcompile_string(ReCompiled *p){ if( rePeek(p)=='*' ){ re_append(p, RE_OP_ANYSTAR, 0); p->sIn.i++; - }else{ + }else{ re_append(p, RE_OP_ANY, 0); } break; @@ -668,7 +668,7 @@ const char *re_compile(ReCompiled **ppRe, const char *zIn, int noCase){ /* The following is a performance optimization. If the regex begins with ** ".*" (if the input regex lacks an initial "^") and afterwards there are ** one or more matching characters, enter those matching characters into - ** zInit[]. The re_match() routine can then search ahead in the input + ** zInit[]. The re_match() routine can then search ahead in the input ** string looking for the initial match without having to run the whole ** regex engine over the string. Do not worry able trying to match ** unicode characters beyond plane 0 - those are very rare and this is @@ -705,8 +705,8 @@ const char *re_compile(ReCompiled **ppRe, const char *zIn, int noCase){ ** is implemented as regexp(B,A). */ static void re_sql_func( - sqlite3_context *context, - int argc, + sqlite3_context *context, + int argc, sqlite3_value **argv ){ ReCompiled *pRe; /* Compiled regular expression */ @@ -748,8 +748,8 @@ static void re_sql_func( __declspec(dllexport) #endif int sqlite3_regexp_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/misc/remember.c b/third_party/sqlite/src/ext/misc/remember.c index 587d44a12cdc9..6e6d0fdc85872 100644 --- a/third_party/sqlite/src/ext/misc/remember.c +++ b/third_party/sqlite/src/ext/misc/remember.c @@ -56,8 +56,8 @@ static void rememberFunc( __declspec(dllexport) #endif int sqlite3_remember_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/misc/rot13.c b/third_party/sqlite/src/ext/misc/rot13.c index 68fdf60b0f0a2..021441a00a088 100644 --- a/third_party/sqlite/src/ext/misc/rot13.c +++ b/third_party/sqlite/src/ext/misc/rot13.c @@ -35,7 +35,7 @@ static unsigned char rot13(unsigned char c){ /* ** Implementation of the rot13() function. ** -** Rotate ASCII alphabetic characters by 13 character positions. +** Rotate ASCII alphabetic characters by 13 character positions. ** Non-ASCII characters are unchanged. rot13(rot13(X)) should always ** equal X. */ @@ -74,7 +74,7 @@ static void rot13func( ** ** x=y COLLATE rot13 ** -** Then +** Then ** ** rot13(x)=rot13(y) COLLATE binary */ @@ -98,8 +98,8 @@ static int rot13CollFunc( __declspec(dllexport) #endif int sqlite3_rot_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/misc/scrub.c b/third_party/sqlite/src/ext/misc/scrub.c index 92718e23d1b09..88316a2a80c11 100644 --- a/third_party/sqlite/src/ext/misc/scrub.c +++ b/third_party/sqlite/src/ext/misc/scrub.c @@ -117,7 +117,7 @@ static u8 *scrubBackupRead(ScrubState *p, int pgno, u8 *pBuf){ scrubBackupErr(p, "read failed for page %d", pgno); p->rcErr = SQLITE_IOERR; } - return pOut; + return pOut; } /* Write a page to the destination database */ @@ -309,7 +309,7 @@ static void scrubBackupFreelist(ScrubState *p, int pgno, u32 nFree){ if( p->rcErr ) return; aBuf = scrubBackupAllocPage(p); if( aBuf==0 ) return; - + while( pgno && nFree){ a = scrubBackupRead(p, pgno, aBuf); if( a==0 ) break; @@ -363,9 +363,9 @@ static void scrubBackupOverflow(ScrubState *p, int pgno, u32 nByte){ scrubBackupWrite(p, pgno, a); pgno = scrubBackupInt32(a); } - sqlite3_free(aBuf); + sqlite3_free(aBuf); } - + /* ** Copy B-Tree page pgno, and all of its children, from source to destination. @@ -383,7 +383,7 @@ static void scrubBackupBtree(ScrubState *p, int pgno, int iDepth){ u32 x, y; int ln = 0; - + if( p->rcErr ) return; if( iDepth>50 ){ scrubBackupErr(p, "corrupt: b-tree too deep at page %d", pgno); @@ -409,7 +409,7 @@ static void scrubBackupBtree(ScrubState *p, int pgno, int iDepth){ if( y>x ){ ln=__LINE__; goto btree_corrupt; } if( y0 && pc1 ) sqlite3_free(a); + if( pgno>1 ) sqlite3_free(a); } /* @@ -523,7 +523,7 @@ int sqlite3_scrub_backup( if( s.page1==0 ) goto scrub_abort; s.szUsable = s.szPage - s.page1[20]; - /* Copy the freelist */ + /* Copy the freelist */ n = scrubBackupInt32(&s.page1[36]); i = scrubBackupInt32(&s.page1[32]); if( n ) scrubBackupFreelist(&s, i, n); @@ -544,8 +544,8 @@ int sqlite3_scrub_backup( sqlite3_finalize(pStmt); /* If the last page of the input db file is a free-list leaf, then the - ** backup file on disk is still smaller than the size indicated within - ** the database header. In this case, write a page of zeroes to the + ** backup file on disk is still smaller than the size indicated within + ** the database header. In this case, write a page of zeroes to the ** last page of the backup database so that SQLite does not mistakenly ** think the db is corrupt. */ if( s.iLastPageaConstraintUsage[stepIdx].omit = !SQLITE_SERIES_CONSTRAINT_VERIFY; } if( (idxNum & 3)==3 ){ - /* Both start= and stop= boundaries are available. This is the + /* Both start= and stop= boundaries are available. This is the ** the preferred case */ pIdxInfo->estimatedCost = (double)(2 - ((idxNum&4)!=0)); pIdxInfo->estimatedRows = 1000; @@ -363,7 +363,7 @@ static int seriesBestIndex( } /* -** This following structure defines all the methods for the +** This following structure defines all the methods for the ** generate_series virtual table. */ static sqlite3_module seriesModule = { @@ -395,8 +395,8 @@ static sqlite3_module seriesModule = { __declspec(dllexport) #endif int sqlite3_series_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/misc/showauth.c b/third_party/sqlite/src/ext/misc/showauth.c index 87a9a6843c4dc..7fe1bb53e3762 100644 --- a/third_party/sqlite/src/ext/misc/showauth.c +++ b/third_party/sqlite/src/ext/misc/showauth.c @@ -91,8 +91,8 @@ static int authCallback( __declspec(dllexport) #endif int sqlite3_showauth_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/misc/spellfix.c b/third_party/sqlite/src/ext/misc/spellfix.c index 1ac1712f4e985..727886f5c3d7d 100644 --- a/third_party/sqlite/src/ext/misc/spellfix.c +++ b/third_party/sqlite/src/ext/misc/spellfix.c @@ -109,9 +109,9 @@ static const unsigned char midClass[] = { /* u */ CCLASS_VOWEL, /* v */ CCLASS_B, /* w */ CCLASS_B, /* x */ CCLASS_C, /* y */ CCLASS_VOWEL, /* z */ CCLASS_C, /* { */ CCLASS_OTHER, /* | */ CCLASS_OTHER, /* } */ CCLASS_OTHER, - /* ~ */ CCLASS_OTHER, /* */ CCLASS_OTHER, + /* ~ */ CCLASS_OTHER, /* */ CCLASS_OTHER, }; -/* +/* ** This tables gives the character class for ASCII characters that form the ** initial character of a word. The only difference from midClass is with ** the letters H, W, and Y. @@ -159,7 +159,7 @@ static const unsigned char initClass[] = { /* u */ CCLASS_VOWEL, /* v */ CCLASS_B, /* w */ CCLASS_B, /* x */ CCLASS_C, /* y */ CCLASS_Y, /* z */ CCLASS_C, /* { */ CCLASS_OTHER, /* | */ CCLASS_OTHER, /* } */ CCLASS_OTHER, - /* ~ */ CCLASS_OTHER, /* */ CCLASS_OTHER, + /* ~ */ CCLASS_OTHER, /* */ CCLASS_OTHER, }; /* @@ -183,7 +183,7 @@ static const unsigned char className[] = ".ABCDHLRMY9 ?"; ** ** Space to hold the result is obtained from sqlite3_malloc() ** -** Return NULL if memory allocation fails. +** Return NULL if memory allocation fails. */ static unsigned char *phoneticHash(const unsigned char *zIn, int nIn){ unsigned char *zOut = sqlite3_malloc64( nIn + 1 ); @@ -196,7 +196,7 @@ static unsigned char *phoneticHash(const unsigned char *zIn, int nIn){ if( zOut==0 ) return 0; if( nIn>2 ){ switch( zIn[0] ){ - case 'g': + case 'g': case 'k': { if( zIn[1]=='n' ){ zIn++; nIn--; } break; @@ -217,7 +217,7 @@ static unsigned char *phoneticHash(const unsigned char *zIn, int nIn){ if( c==CCLASS_OTHER && cPrev!=CCLASS_DIGIT ) continue; aClass = midClass; if( c==CCLASS_VOWEL && (cPrevX==CCLASS_R || cPrevX==CCLASS_L) ){ - continue; /* No vowels beside L or R */ + continue; /* No vowels beside L or R */ } if( (c==CCLASS_R || c==CCLASS_L) && cPrevX==CCLASS_VOWEL ){ nOut--; /* No vowels beside L or R */ @@ -345,7 +345,7 @@ static int substituteCost(char cPrev, char cFrom, char cTo){ ** Negative values indicate an error: ** -1 One of the inputs is NULL ** -2 Non-ASCII characters on input -** -3 Unable to allocate memory +** -3 Unable to allocate memory ** ** If pnMatch is not NULL, then *pnMatch is set to the number of bytes ** of zB that matched the pattern in zA. If zA does not end with a '*', @@ -526,7 +526,7 @@ static void editdistSqlFunc( }else{ sqlite3_result_error(context, "NULL input to editdist()", -1); } - }else{ + }else{ sqlite3_result_int(context, res); } } @@ -560,7 +560,7 @@ struct EditDist3Cost { }; /* -** Edit costs for a particular language ID +** Edit costs for a particular language ID */ struct EditDist3Lang { int iLang; /* Language ID */ @@ -717,7 +717,7 @@ static int editDist3ConfigLoad( memcpy(pCost->a, zFrom, nFrom); memcpy(pCost->a + nFrom, zTo, nTo); pCost->pNext = pLang->pCost; - pLang->pCost = pCost; + pLang->pCost = pCost; } } rc2 = sqlite3_finalize(pStmt); @@ -876,7 +876,7 @@ static void updateCost( } /* -** How much stack space (int bytes) to use for Wagner matrix in +** How much stack space (int bytes) to use for Wagner matrix in ** editDist3Core(). If more space than this is required, the entire ** matrix is taken from the heap. To reduce the load on the memory ** allocator, make this value as large as practical for the @@ -894,7 +894,7 @@ static void updateCost( ** (not bytes) in z2 that matched the search pattern in *pFrom. If pFrom does ** not contain the pattern for a prefix-search, then this is always the number ** of characters in z2. If pFrom does contain a prefix search pattern, then -** it is the number of characters in the prefix of z2 that was deemed to +** it is the number of characters in the prefix of z2 that was deemed to ** match pFrom. */ static int editDist3Core( @@ -1033,7 +1033,7 @@ static int editDist3Core( if( f.isPrefix ){ for(i2=1; i2<=n2; i2++){ int b = m[szRow*i2-1]; - if( b<=res ){ + if( b<=res ){ res = b; n = i2 - 1; } @@ -1110,7 +1110,7 @@ static void editDist3SqlFunc( }else{ sqlite3_result_int(context, dist); } - } + } } /* @@ -1690,7 +1690,7 @@ static int translen_to_charlen(const char *zIn, int nIn, int nTrans){ /* ** spellfix1_translit(X) ** -** Convert a string that contains non-ASCII Roman characters into +** Convert a string that contains non-ASCII Roman characters into ** pure ASCII. */ static void transliterateSqlFunc( @@ -1821,7 +1821,7 @@ struct spellfix1_cursor { int iScore; /* Score for sorting */ int iMatchlen; /* Value of matchlen column (or -1) */ char zHash[SPELLFIX_MX_HASH]; /* the phonehash used for this match */ - } *a; + } *a; }; /* @@ -1948,7 +1948,7 @@ static int spellfix1Init( if( pNew->zTableName==0 ){ rc = SQLITE_NOMEM; }else{ - rc = sqlite3_declare_vtab(db, + rc = sqlite3_declare_vtab(db, "CREATE TABLE x(word,rank,distance,langid, " "score, matchlen, phonehash HIDDEN, " "top HIDDEN, scope HIDDEN, srchcnt HIDDEN, " @@ -1992,7 +1992,7 @@ static int spellfix1Init( continue; } *pzErr = sqlite3_mprintf("bad argument to spellfix1(): \"%s\"", argv[i]); - rc = SQLITE_ERROR; + rc = SQLITE_ERROR; } } @@ -2106,7 +2106,7 @@ static int spellfix1BestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ if( pConstraint->usable==0 ) continue; /* Terms of the form: word MATCH $str */ - if( (iPlan & SPELLFIX_IDXNUM_MATCH)==0 + if( (iPlan & SPELLFIX_IDXNUM_MATCH)==0 && pConstraint->iColumn==SPELLFIX_COL_WORD && pConstraint->op==SQLITE_INDEX_CONSTRAINT_MATCH ){ @@ -2343,7 +2343,7 @@ static void spellfix1RunQuery(MatchQuery *p, const char *zQuery, int nQuery){ break; } pCur->nSearch++; - + /* If there is a "distance < $dist" or "distance <= $dist" constraint, ** check if this row meets it. If not, jump back up to the top of the ** loop to process the next row. Otherwise, if the row does match the @@ -2557,7 +2557,7 @@ static int spellfix1FilterForFullScan( ** prior to any spellfix1Column, spellfix1Rowid, or spellfix1Eof call. */ static int spellfix1Filter( - sqlite3_vtab_cursor *cur, + sqlite3_vtab_cursor *cur, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -2760,7 +2760,7 @@ static int spellfix1Update( /* Inserts of the form: INSERT INTO table(command) VALUES('xyzzy'); ** cause zWord to be NULL, so we look at the "command" column to see ** what special actions to take */ - const char *zCmd = + const char *zCmd = (const char*)sqlite3_value_text(argv[SPELLFIX_COL_COMMAND+2]); if( zCmd==0 ){ pVTab->zErrMsg = sqlite3_mprintf("NOT NULL constraint failed: %s.word", @@ -2849,7 +2849,7 @@ static int spellfix1Rename(sqlite3_vtab *pVTab, const char *zNew){ if( zNewName==0 ){ return SQLITE_NOMEM; } - spellfix1DbExec(&rc, db, + spellfix1DbExec(&rc, db, "ALTER TABLE \"%w\".\"%w_vocab\" RENAME TO \"%w_vocab\"", p->zDbName, p->zTableName, zNewName ); @@ -2933,8 +2933,8 @@ static int spellfix1Register(sqlite3 *db){ __declspec(dllexport) #endif int sqlite3_spellfix_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ SQLITE_EXTENSION_INIT2(pApi); diff --git a/third_party/sqlite/src/ext/misc/vfslog.c b/third_party/sqlite/src/ext/misc/vfslog.c index b55b06fcf3a74..263037ef77d13 100644 --- a/third_party/sqlite/src/ext/misc/vfslog.c +++ b/third_party/sqlite/src/ext/misc/vfslog.c @@ -20,9 +20,9 @@ ** ** Each database connection creates a separate log file in the same ** directory as the original database and named after the original -** database. A unique suffix is added to avoid name collisions. +** database. A unique suffix is added to avoid name collisions. ** Separate log files are used so that concurrent processes do not -** try to write log operations to the same file at the same instant, +** try to write log operations to the same file at the same instant, ** resulting in overwritten or comingled log text. ** ** Each individual log file records operations by a single database @@ -183,7 +183,7 @@ static sqlite3_uint64 vlog_time(){ static sqlite3_uint64 vlog_time(){ FILETIME ft; sqlite3_uint64 u64time = 0; - + GetSystemTimeAsFileTime(&ft); u64time |= ft.dwHighDateTime; @@ -272,7 +272,7 @@ static VLogLog *vlogLogOpen(const char *zFilename){ if( nName>8 && strcmp(zFilename+nName-8,"-journal")==0 ){ nName -= 8; isJournal = 1; - }else if( nName>12 + }else if( nName>12 && sqlite3_strglob("-mj??????9??", zFilename+nName-12)==0 ){ return 0; /* Do not log master journal files */ } @@ -357,7 +357,7 @@ static void vlogSignature(unsigned char *p, int n, char *zCksum){ int i; if( n<=16 ){ for(i=0; ixFullPathname(REALVFS(pVfs), zPath, nOut, zOut); @@ -698,7 +698,7 @@ static void *vlogDlOpen(sqlite3_vfs *pVfs, const char *zPath){ /* ** Populate the buffer zErrMsg (size nByte bytes) with a human readable -** utf-8 string describing the most recent error encountered associated +** utf-8 string describing the most recent error encountered associated ** with dynamic libraries. */ static void vlogDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){ @@ -720,7 +720,7 @@ static void vlogDlClose(sqlite3_vfs *pVfs, void *pHandle){ } /* -** Populate the buffer pointed to by zBufOut with nByte bytes of +** Populate the buffer pointed to by zBufOut with nByte bytes of ** random data. */ static int vlogRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ @@ -728,7 +728,7 @@ static int vlogRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ } /* -** Sleep for nMicro microseconds. Return the number of microseconds +** Sleep for nMicro microseconds. Return the number of microseconds ** actually slept. */ static int vlogSleep(sqlite3_vfs *pVfs, int nMicro){ diff --git a/third_party/sqlite/src/ext/misc/vfsstat.c b/third_party/sqlite/src/ext/misc/vfsstat.c index 14753d277d628..9b103b93f82d6 100644 --- a/third_party/sqlite/src/ext/misc/vfsstat.c +++ b/third_party/sqlite/src/ext/misc/vfsstat.c @@ -46,7 +46,7 @@ SQLITE_EXTENSION_INIT1 ** SELECT * FROM vfsstat WHERE count>0; ** ** LIMITATIONS: -** +** ** This module increments counters without using mutex protection. So if ** two or more threads try to use this module at the same time, race conditions ** may occur which mess up the counts. This is harmless, other than giving @@ -82,7 +82,7 @@ static const char *azFile[] = { ** Stat types */ #define VFSSTAT_BYTESIN 0 /* Bytes read in */ -#define VFSSTAT_BYTESOUT 1 /* Bytes written out */ +#define VFSSTAT_BYTESOUT 1 /* Bytes written out */ #define VFSSTAT_READ 2 /* Read requests */ #define VFSSTAT_WRITE 3 /* Write requests */ #define VFSSTAT_SYNC 4 /* Syncs */ @@ -248,9 +248,9 @@ static int vstatClose(sqlite3_file *pFile){ ** Read data from an vstat-file. */ static int vstatRead( - sqlite3_file *pFile, - void *zBuf, - int iAmt, + sqlite3_file *pFile, + void *zBuf, + int iAmt, sqlite_int64 iOfst ){ int rc; @@ -482,9 +482,9 @@ static int vstatDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ ** is available, or false otherwise. */ static int vstatAccess( - sqlite3_vfs *pVfs, - const char *zPath, - int flags, + sqlite3_vfs *pVfs, + const char *zPath, + int flags, int *pResOut ){ int rc; @@ -499,9 +499,9 @@ static int vstatAccess( ** of at least (INST_MAX_PATHNAME+1) bytes. */ static int vstatFullPathname( - sqlite3_vfs *pVfs, - const char *zPath, - int nOut, + sqlite3_vfs *pVfs, + const char *zPath, + int nOut, char *zOut ){ STATCNT(VFSSTAT_ANY,VFSSTAT_FULLPATH)++; @@ -517,7 +517,7 @@ static void *vstatDlOpen(sqlite3_vfs *pVfs, const char *zPath){ /* ** Populate the buffer zErrMsg (size nByte bytes) with a human readable -** utf-8 string describing the most recent error encountered associated +** utf-8 string describing the most recent error encountered associated ** with dynamic libraries. */ static void vstatDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){ @@ -539,7 +539,7 @@ static void vstatDlClose(sqlite3_vfs *pVfs, void *pHandle){ } /* -** Populate the buffer pointed to by zBufOut with nByte bytes of +** Populate the buffer pointed to by zBufOut with nByte bytes of ** random data. */ static int vstatRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ @@ -548,7 +548,7 @@ static int vstatRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ } /* -** Sleep for nMicro microseconds. Return the number of microseconds +** Sleep for nMicro microseconds. Return the number of microseconds ** actually slept. */ static int vstatSleep(sqlite3_vfs *pVfs, int nMicro){ @@ -575,7 +575,7 @@ static int vstatCurrentTimeInt64(sqlite3_vfs *pVfs, sqlite3_int64 *p){ /* ** A virtual table for accessing the stats collected by this VFS shim */ -static int vstattabConnect(sqlite3*, void*, int, const char*const*, +static int vstattabConnect(sqlite3*, void*, int, const char*const*, sqlite3_vtab**,char**); static int vstattabBestIndex(sqlite3_vtab*,sqlite3_index_info*); static int vstattabDisconnect(sqlite3_vtab*); @@ -607,7 +607,7 @@ static int vstattabConnect( int rc; /* Column numbers */ -#define VSTAT_COLUMN_FILE 0 +#define VSTAT_COLUMN_FILE 0 #define VSTAT_COLUMN_STAT 1 #define VSTAT_COLUMN_COUNT 2 @@ -710,7 +710,7 @@ static int vstattabEof(sqlite3_vtab_cursor *cur){ ** the beginning. */ static int vstattabFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -792,15 +792,15 @@ static int vstatRegister( #ifdef _WIN32 __declspec(dllexport) #endif -/* +/* ** This routine is called when the extension is loaded. ** ** Register the new VFS. Make arrangement to register the virtual table ** for each new database connection. */ int sqlite3_vfsstat_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/misc/wholenumber.c b/third_party/sqlite/src/ext/misc/wholenumber.c index 63369c6ac474e..85ae6e11eff60 100644 --- a/third_party/sqlite/src/ext/misc/wholenumber.c +++ b/third_party/sqlite/src/ext/misc/wholenumber.c @@ -143,7 +143,7 @@ static int wholenumberEof(sqlite3_vtab_cursor *cur){ ** 10 value >= $argv0 AND value <= $argv1 */ static int wholenumberFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -237,7 +237,7 @@ static sqlite3_module wholenumberModule = { wholenumberConnect, wholenumberConnect, wholenumberBestIndex, - wholenumberDisconnect, + wholenumberDisconnect, wholenumberDisconnect, wholenumberOpen, /* xOpen - open a cursor */ wholenumberClose, /* xClose - close a cursor */ @@ -261,8 +261,8 @@ static sqlite3_module wholenumberModule = { __declspec(dllexport) #endif int sqlite3_wholenumber_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc = SQLITE_OK; diff --git a/third_party/sqlite/src/ext/rbu/rbu.c b/third_party/sqlite/src/ext/rbu/rbu.c index a3efad0d44e5d..46ee72cce39e0 100644 --- a/third_party/sqlite/src/ext/rbu/rbu.c +++ b/third_party/sqlite/src/ext/rbu/rbu.c @@ -10,7 +10,7 @@ ** ************************************************************************* ** -** This file contains a command-line application that uses the RBU +** This file contains a command-line application that uses the RBU ** extension. See the usage() function below for an explanation. */ @@ -23,7 +23,7 @@ ** Print a usage message and exit. */ void usage(const char *zArgv0){ - fprintf(stderr, + fprintf(stderr, "Usage: %s ?OPTIONS? TARGET-DB RBU-DB\n" "\n" "Where options are:\n" diff --git a/third_party/sqlite/src/ext/rbu/rbu1.test b/third_party/sqlite/src/ext/rbu/rbu1.test index cd4172888602d..ff8de86ce0b2e 100644 --- a/third_party/sqlite/src/ext/rbu/rbu1.test +++ b/third_party/sqlite/src/ext/rbu/rbu1.test @@ -23,7 +23,7 @@ sqlite3_config_uri 1 # proc create_rbu1 {filename} { forcedelete $filename - sqlite3 rbu1 $filename + sqlite3 rbu1 $filename rbu1 eval { CREATE TABLE data_t1(a, b, c, rbu_control); INSERT INTO data_t1 VALUES(1, 2, 3, 0); @@ -42,7 +42,7 @@ proc create_rbu1 {filename} { # proc create_rbu4 {filename} { forcedelete $filename - sqlite3 rbu1 $filename + sqlite3 rbu1 $filename rbu1 eval { CREATE TABLE data_t1(a, b, c, rbu_control); INSERT INTO data_t1 VALUES(1, 2, 3, 0); @@ -62,7 +62,7 @@ proc create_rbu4 {filename} { # proc create_rbu4b {filename} { forcedelete $filename - sqlite3 rbu1 $filename + sqlite3 rbu1 $filename rbu1 eval { CREATE TABLE data_t1(c, b, '(a)', rbu_control); INSERT INTO data_t1 VALUES(3, 2, 1, 0); @@ -82,7 +82,7 @@ proc create_rbu4b {filename} { # proc create_rbu5 {filename} { forcedelete $filename - sqlite3 rbu5 $filename + sqlite3 rbu5 $filename rbu5 eval { CREATE TABLE data_t1(a, b, c, d, rbu_control); INSERT INTO data_t1 VALUES(1, NULL, NULL, 5, '...x'); -- SET d = 5 @@ -137,80 +137,80 @@ foreach {tn3 create_vfs destroy_vfs} { eval $create_vfs foreach {tn2 cmd} { - 1 run_rbu + 1 run_rbu 2 step_rbu 3 step_rbu_uri 4 step_rbu_state } { foreach {tn schema} { 1 { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); } - 2 { + 2 { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); CREATE INDEX i1 ON t1(b); } - 3 { + 3 { CREATE TABLE t1(a PRIMARY KEY, b, c) WITHOUT ROWID; } - 4 { + 4 { CREATE TABLE t1(a PRIMARY KEY, b, c) WITHOUT ROWID; CREATE INDEX i1 ON t1(b); } - 5 { + 5 { CREATE TABLE t1(a, b, c, PRIMARY KEY(a, c)) WITHOUT ROWID; CREATE INDEX i1 ON t1(b); } - 6 { + 6 { CREATE TABLE t1(a, b, c, PRIMARY KEY(c)) WITHOUT ROWID; CREATE INDEX i1 ON t1(b, a); } - 7 { + 7 { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); CREATE INDEX i1 ON t1(b, c); CREATE INDEX i2 ON t1(c, b); CREATE INDEX i3 ON t1(a, b, c, a, b, c); } - 8 { + 8 { CREATE TABLE t1(a PRIMARY KEY, b, c); CREATE INDEX i1 ON t1(b, c); CREATE INDEX i2 ON t1(c, b); CREATE INDEX i3 ON t1(a, b, c, a, b, c); } - 9 { + 9 { CREATE TABLE t1(a, b, c, PRIMARY KEY(a, c)); CREATE INDEX i1 ON t1(b); } - 10 { + 10 { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); CREATE INDEX i1 ON t1(b DESC); } - 11 { + 11 { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); CREATE INDEX i1 ON t1(b DESC, a ASC, c DESC); } - 12 { - CREATE TABLE t1(a INT PRIMARY KEY DESC, b, c) WITHOUT ROWID; + 12 { + CREATE TABLE t1(a INT PRIMARY KEY DESC, b, c) WITHOUT ROWID; } - 13 { - CREATE TABLE t1(a INT, b, c, PRIMARY KEY(a DESC)) WITHOUT ROWID; + 13 { + CREATE TABLE t1(a INT, b, c, PRIMARY KEY(a DESC)) WITHOUT ROWID; } - 14 { + 14 { CREATE TABLE t1(a, b, c, PRIMARY KEY(a DESC, c)) WITHOUT ROWID; CREATE INDEX i1 ON t1(b); } - 15 { + 15 { CREATE TABLE t1(a, b, c, PRIMARY KEY(a, c DESC)) WITHOUT ROWID; CREATE INDEX i1 ON t1(b); } - 16 { + 16 { CREATE TABLE t1(a, b, c, PRIMARY KEY(c DESC, a)) WITHOUT ROWID; CREATE INDEX i1 ON t1(b DESC, c, a); } @@ -226,21 +226,21 @@ foreach {tn3 create_vfs destroy_vfs} { } {SQLITE_DONE} do_execsql_test $tn3.1.$tn2.$tn.2 { SELECT * FROM t1 ORDER BY a ASC } { - 1 2 3 - 2 two three + 1 2 3 + 2 two three 3 {} 8.2 } do_execsql_test $tn3.1.$tn2.$tn.3 { SELECT * FROM t1 ORDER BY b ASC } { 3 {} 8.2 - 1 2 3 - 2 two three + 1 2 3 + 2 two three } do_execsql_test $tn3.1.$tn2.$tn.4 { SELECT * FROM t1 ORDER BY c ASC } { - 1 2 3 + 1 2 3 3 {} 8.2 - 2 two three + 2 two three } - + do_execsql_test $tn3.1.$tn2.$tn.5 { PRAGMA integrity_check } ok if {$cmd=="step_rbu_state"} { @@ -285,31 +285,31 @@ foreach {tn3 create_vfs destroy_vfs} { } {0 SQLITE_OK} #------------------------------------------------------------------------- - # Check that if a UNIQUE constraint is violated the current and all - # subsequent [rbu step] calls return SQLITE_CONSTRAINT. And that the RBU - # transaction is rolled back by the [rbu close] that deletes the rbu + # Check that if a UNIQUE constraint is violated the current and all + # subsequent [rbu step] calls return SQLITE_CONSTRAINT. And that the RBU + # transaction is rolled back by the [rbu close] that deletes the rbu # handle. # foreach {tn errcode errmsg schema} { 1 SQLITE_CONSTRAINT "UNIQUE constraint failed: t1.a" { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); INSERT INTO t1 VALUES(3, 2, 1); - } + } 2 SQLITE_CONSTRAINT "UNIQUE constraint failed: t1.c" { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c UNIQUE); INSERT INTO t1 VALUES(4, 2, 'three'); - } + } 3 SQLITE_CONSTRAINT "UNIQUE constraint failed: t1.a" { CREATE TABLE t1(a PRIMARY KEY, b, c); INSERT INTO t1 VALUES(3, 2, 1); - } + } 4 SQLITE_CONSTRAINT "UNIQUE constraint failed: t1.c" { CREATE TABLE t1(a PRIMARY KEY, b, c UNIQUE); INSERT INTO t1 VALUES(4, 2, 'three'); - } + } } { reset_db @@ -325,7 +325,7 @@ foreach {tn3 create_vfs destroy_vfs} { do_test $tn3.3.$tn.2 { rbu step } $errcode - do_test $tn3.3.$tn.3 { + do_test $tn3.3.$tn.3 { list [catch { rbu close } msg] $msg } [list 1 "$errcode - $errmsg"] @@ -386,19 +386,19 @@ foreach {tn3 create_vfs destroy_vfs} { create_rbu4 rbu.db set check [dbfilecksum rbu.db] forcedelete state.db - + do_test $tn3.4.$tn2.$tn.1 { $cmd test.db rbu.db } {SQLITE_DONE} - + do_execsql_test $tn3.4.$tn2.$tn.2 { SELECT * FROM t1 ORDER BY a ASC; } { - 1 2 3 + 1 2 3 3 8 9 6 hello xyz } - + do_execsql_test $tn3.4.$tn2.$tn.3 { PRAGMA integrity_check } ok if {$cmd=="step_rbu_state"} { @@ -435,11 +435,11 @@ foreach {tn3 create_vfs destroy_vfs} { create_rbu4b rbu.db set check [dbfilecksum rbu.db] forcedelete state.db - + do_test $tn3.5.$tn2.$tn.1 { $cmd test.db rbu.db } {SQLITE_DONE} - + do_execsql_test $tn3.5.$tn2.$tn.2 { SELECT * FROM t1 ORDER BY "(a)" ASC; } { @@ -447,7 +447,7 @@ foreach {tn3 create_vfs destroy_vfs} { 9 8 3 xyz hello 6 } - + do_execsql_test $tn3.4.$tn2.$tn.3 { PRAGMA integrity_check } ok if {$cmd=="step_rbu_state"} { @@ -502,7 +502,7 @@ foreach {tn3 create_vfs destroy_vfs} { INSERT INTO t1 VALUES(2, 5, 6, 7); INSERT INTO t1 VALUES(3, 8, 9, 10); } - + create_rbu5 rbu.db set check [dbfilecksum rbu.db] forcedelete state.db @@ -510,7 +510,7 @@ foreach {tn3 create_vfs destroy_vfs} { do_test $tn3.5.$tn2.$tn.1 { $cmd test.db rbu.db } {SQLITE_DONE} - + do_execsql_test $tn3.5.$tn2.$tn.2 { SELECT * FROM t1 ORDER BY a ASC; } { @@ -518,7 +518,7 @@ foreach {tn3 create_vfs destroy_vfs} { 2 5 10 5 3 11 9 10 } - + do_execsql_test $tn3.6.$tn2.$tn.3 { PRAGMA integrity_check } ok if {$cmd=="step_rbu_state"} { @@ -533,7 +533,7 @@ foreach {tn3 create_vfs destroy_vfs} { #------------------------------------------------------------------------- # Test some error cases: - # + # # * A virtual table with no rbu_rowid column. # * A no-PK table with no rbu_rowid column. # * A PK table with an rbu_rowid column. @@ -546,22 +546,22 @@ foreach {tn3 create_vfs destroy_vfs} { CREATE TABLE t1(a, b); CREATE TABLE rbu.data_t1(a, b, rbu_control); } {SQLITE_ERROR - table data_t1 requires rbu_rowid column} - + 2 { CREATE VIRTUAL TABLE t1 USING fts4(a, b); CREATE TABLE rbu.data_t1(a, b, rbu_control); } {SQLITE_ERROR - table data_t1 requires rbu_rowid column} - + 3 { CREATE TABLE t1(a PRIMARY KEY, b); CREATE TABLE rbu.data_t1(a, b, rbu_rowid, rbu_control); } {SQLITE_ERROR - table data_t1 may not have rbu_rowid column} - + 4 { CREATE TABLE t1(a INTEGER PRIMARY KEY, b); CREATE TABLE rbu.data_t1(a, b, rbu_rowid, rbu_control); } {SQLITE_ERROR - table data_t1 may not have rbu_rowid column} - + 5 { CREATE TABLE t1(a, b PRIMARY KEY) WITHOUT ROWID; CREATE TABLE rbu.data_t1(a, b, rbu_rowid, rbu_control); diff --git a/third_party/sqlite/src/ext/rbu/rbu10.test b/third_party/sqlite/src/ext/rbu/rbu10.test index 04aab00a0db6a..852fe27c7602a 100644 --- a/third_party/sqlite/src/ext/rbu/rbu10.test +++ b/third_party/sqlite/src/ext/rbu/rbu10.test @@ -18,8 +18,8 @@ set ::testprefix rbu10 #-------------------------------------------------------------------- -# Test that UPDATE commands work even if the input columns are in a -# different order to the output columns. +# Test that UPDATE commands work even if the input columns are in a +# different order to the output columns. # do_execsql_test 1.0 { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); @@ -45,7 +45,7 @@ do_test 1.1 { } {1 b xxx} #-------------------------------------------------------------------- -# Test that the hidden languageid column of an fts4 table can be +# Test that the hidden languageid column of an fts4 table can be # written. # ifcapable fts3 { @@ -65,8 +65,8 @@ ifcapable fts3 { a b 23 10 a b 24 100 }] - - # Or not - this data_xxx table has no langid column, so langid + + # Or not - this data_xxx table has no langid column, so langid # defaults to 0. # do_test 2.2 { @@ -81,7 +81,7 @@ ifcapable fts3 { a b 24 100 a b 25 0 }] - + # Update langid. # do_test 2.3 { @@ -100,7 +100,7 @@ ifcapable fts3 { } #-------------------------------------------------------------------- -# Test that if writing a hidden virtual table column is an error, +# Test that if writing a hidden virtual table column is an error, # attempting to do so via rbu is also an error. # ifcapable fts3 { diff --git a/third_party/sqlite/src/ext/rbu/rbu11.test b/third_party/sqlite/src/ext/rbu/rbu11.test index fdc701aceb336..77b7a094a3104 100644 --- a/third_party/sqlite/src/ext/rbu/rbu11.test +++ b/third_party/sqlite/src/ext/rbu/rbu11.test @@ -54,7 +54,7 @@ do_execsql_test 2.1 { } {wal} do_test 2.2 { - db_save + db_save db close forcedelete rbu.db @@ -66,7 +66,7 @@ do_test 2.2 { } dbo close - db_restore + db_restore hexio_write test.db 18 0101 file exists test.db-wal } {1} @@ -81,7 +81,7 @@ do_test 2.4 { } {1 {SQLITE_ERROR - cannot update wal mode database}} #-------------------------------------------------------------------- -# Test a constraint violation message with an unusual table name. +# Test a constraint violation message with an unusual table name. # Specifically, one for which the first character is a codepoint # smaller than 30 (character '0'). # @@ -161,7 +161,7 @@ do_test 4.5.2 { do_test 4.5.3 { sqlite3 dbo rbu.db dbo eval { DELETE FROM rbu_state WHERE k = 100 } - dbo close + dbo close } {} # Also, check that an invalid state value in the rbu_state table is @@ -179,7 +179,7 @@ do_test 4.6.2 { do_test 4.6.3 { sqlite3 dbo rbu.db dbo eval { UPDATE rbu_state SET v = v*-1 WHERE k = 1 } - dbo close + dbo close } {} do_test 4.7.1 { diff --git a/third_party/sqlite/src/ext/rbu/rbu12.test b/third_party/sqlite/src/ext/rbu/rbu12.test index a83d0891a30b7..20b1d9e90959b 100644 --- a/third_party/sqlite/src/ext/rbu/rbu12.test +++ b/third_party/sqlite/src/ext/rbu/rbu12.test @@ -68,8 +68,8 @@ do_multiclient_test tn { # It is stuck in a permanent SQLITE_BUSY state at this point. # do_test 1.$tn.7 { rbu step } {SQLITE_BUSY} - do_test 1.$tn.8 { - list [catch { rbu close } msg] $msg + do_test 1.$tn.8 { + list [catch { rbu close } msg] $msg } {1 SQLITE_BUSY} do_test 1.$tn.9.1 { sql2 { BEGIN EXCLUSIVE } } {} @@ -78,7 +78,7 @@ do_multiclient_test tn { rbu step } {SQLITE_BUSY} do_test 1.$tn.9.3 { - list [catch { rbu close } msg] $msg + list [catch { rbu close } msg] $msg } {1 {SQLITE_BUSY - database is locked}} do_test 1.$tn.9.4 { sql2 COMMIT } {} @@ -88,7 +88,7 @@ do_multiclient_test tn { rbu step } {SQLITE_BUSY} do_test 1.$tn.10.3 { - list [catch { rbu close } msg] $msg + list [catch { rbu close } msg] $msg } {1 SQLITE_BUSY} do_test 1.$tn.10.4 { sql2 COMMIT } {} @@ -132,14 +132,14 @@ do_multiclient_test tn { do_test 2.$tn.2 { sql2 { BEGIN IMMEDIATE } } {} - do_test 2.$tn.3 { + do_test 2.$tn.3 { sqlite3rbu rbu test.db rbu.db - rbu step + rbu step } {SQLITE_BUSY} do_test 2.$tn.4 { list [catch { rbu close } msg] $msg } {1 SQLITE_BUSY} - do_test 2.$tn.5 { + do_test 2.$tn.5 { sql2 { SELECT * FROM xx ; COMMIT } } {1 2 3 4 5 6 7 8 9} @@ -151,12 +151,12 @@ do_multiclient_test tn { do_test 2.$tn.7 { sql2 { BEGIN EXCLUSIVE } } {} - do_test 2.$tn.8 { + do_test 2.$tn.8 { sqlite3rbu rbu test.db rbu.db - rbu step + rbu step } {SQLITE_BUSY} do_test 2.$tn.9 { list [catch { rbu close } msg] $msg } {1 SQLITE_BUSY} - do_test 2.$tn.10 { + do_test 2.$tn.10 { sql2 { SELECT * FROM xx ; COMMIT } } {1 2 3 4 5 6 7 8 9} @@ -180,13 +180,13 @@ do_multiclient_test tn { sql1 $setup_sql # Check the initial database contains table "xx" with a single row. - # Also save the current values of "PRAGMA data-version" for [db1] + # Also save the current values of "PRAGMA data-version" for [db1] # and [db2]. # do_test 2.$tn.1 { list [sql1 { SELECT count(*) FROM xx }] [sql2 { SELECT count(*) FROM xx }] } {1 1} - set V1 [sql1 {PRAGMA data_version}] + set V1 [sql1 {PRAGMA data_version}] set V2 [sql2 {PRAGMA data_version}] # Check the values of data-version have not magically changed. @@ -195,7 +195,7 @@ do_multiclient_test tn { list [sql1 {PRAGMA data_version}] [sql2 {PRAGMA data_version}] } [list $V1 $V2] - # Start stepping the RBU. From the point of view of [db1] and [db2], the + # Start stepping the RBU. From the point of view of [db1] and [db2], the # data-version values remain unchanged until the database contents are # modified. At which point the values are incremented. # @@ -216,7 +216,7 @@ do_multiclient_test tn { list [sql1 {SELECT count(*) FROM xx}] [sql2 {SELECT count(*) FROM xx}] } {3 3} - set V1 [sql1 {PRAGMA data_version}] + set V1 [sql1 {PRAGMA data_version}] set V2 [sql2 {PRAGMA data_version}] # Finish applying the RBU (i.e. do the incremental checkpoint). Check that diff --git a/third_party/sqlite/src/ext/rbu/rbu14.test b/third_party/sqlite/src/ext/rbu/rbu14.test index d4f97ac32c213..c4c3be6be567b 100644 --- a/third_party/sqlite/src/ext/rbu/rbu14.test +++ b/third_party/sqlite/src/ext/rbu/rbu14.test @@ -63,9 +63,9 @@ foreach {tn schema} { ('t1', 50, NULL, NULL, 1), -- delete from t1 ('t2', 51, NULL, NULL, 1); -- delete from t2 - CREATE VIEW rbu.data_t1 AS + CREATE VIEW rbu.data_t1 AS SELECT a, b, c, rbu_control FROM stuff WHERE tbl='t1'; - CREATE VIEW rbu.data_t2 AS + CREATE VIEW rbu.data_t2 AS SELECT a, b, c, rbu_control FROM stuff WHERE tbl='t2'; } diff --git a/third_party/sqlite/src/ext/rbu/rbu3.test b/third_party/sqlite/src/ext/rbu/rbu3.test index 995b3123fd0ee..7d418d892140f 100644 --- a/third_party/sqlite/src/ext/rbu/rbu3.test +++ b/third_party/sqlite/src/ext/rbu/rbu3.test @@ -140,7 +140,7 @@ do_execsql_test 2.5 { #------------------------------------------------------------------------- -# Test that sqlite3rbu_create_vfs() returns an error if the requested +# Test that sqlite3rbu_create_vfs() returns an error if the requested # parent VFS is unknown. # # And that nothing disasterous happens if a VFS name passed to @@ -157,12 +157,12 @@ do_test 3.2 { } {} #------------------------------------------------------------------------- -# Test that it is an error to specify an explicit VFS that does not +# Test that it is an error to specify an explicit VFS that does not # include rbu VFS functionality. # do_test 4.1 { testvfs tvfs - sqlite3rbu rbu file:test.db?vfs=tvfs rbu.db + sqlite3rbu rbu file:test.db?vfs=tvfs rbu.db list [catch { rbu step } msg] $msg } {0 SQLITE_ERROR} do_test 4.2 { diff --git a/third_party/sqlite/src/ext/rbu/rbu5.test b/third_party/sqlite/src/ext/rbu/rbu5.test index 8e4ae8cb695d6..94e38031040bc 100644 --- a/third_party/sqlite/src/ext/rbu/rbu5.test +++ b/third_party/sqlite/src/ext/rbu/rbu5.test @@ -27,7 +27,7 @@ proc pkcols {db tbl} { return $ret } -# Return a list of all columns for table $tbl in the database opened by +# Return a list of all columns for table $tbl in the database opened by # database handle $db. # proc allcols {db tbl} { @@ -89,7 +89,7 @@ proc generate_rbu_db {target rbu sql} { dbRbu eval $sql dbRbu function ucontrol ucontrol - + # Evaluate the SQL script to modify the contents of copy.db. set ret [datacksum dbRbu] @@ -105,7 +105,7 @@ proc generate_rbu_db {target rbu sql} { set where [list] foreach c $pk { lappend where "main.$tbl.$c IS orig.$tbl.$c" } set where [join $where " AND "] - + # A WHERE clause to test that all columns match. # set where2 [list] @@ -115,35 +115,35 @@ proc generate_rbu_db {target rbu sql} { # Create a data_xxx table in the RBU update database. dbRbu eval " - CREATE TABLE rbu.data_$tbl AS SELECT *, '' AS rbu_control + CREATE TABLE rbu.data_$tbl AS SELECT *, '' AS rbu_control FROM main.$tbl LIMIT 0 " # Find all new rows INSERTed by the script. dbRbu eval " - INSERT INTO rbu.data_$tbl + INSERT INTO rbu.data_$tbl SELECT *, 0 AS rbu_control FROM main.$tbl WHERE NOT EXISTS ( SELECT 1 FROM orig.$tbl WHERE $where ) " - + # Find all old rows DELETEd by the script. dbRbu eval " - INSERT INTO rbu.data_$tbl + INSERT INTO rbu.data_$tbl SELECT *, 1 AS rbu_control FROM orig.$tbl WHERE NOT EXISTS ( SELECT 1 FROM main.$tbl WHERE $where ) " - + # Find all rows UPDATEd by the script. set origcols [list] foreach c $cols { lappend origcols "main.$tbl.$c" } set origcols [join $origcols ,] dbRbu eval " INSERT INTO rbu.data_$tbl - SELECT $origcols, $ucontrol AS rbu_control + SELECT $origcols, $ucontrol AS rbu_control FROM orig.$tbl, main.$tbl WHERE $where AND NOT ($where2) " @@ -203,7 +203,7 @@ foreach {tn idx} { } $cksum do_test 1.$tn.$cmd.2 { - db eval { PRAGMA integrity_check } + db eval { PRAGMA integrity_check } } {ok} db close @@ -291,7 +291,7 @@ foreach {tn idx} { } $cksum do_test 2.$tn.$cmd.2 { - db eval { PRAGMA integrity_check } + db eval { PRAGMA integrity_check } } {ok} db close diff --git a/third_party/sqlite/src/ext/rbu/rbu6.test b/third_party/sqlite/src/ext/rbu/rbu6.test index f05721574ada2..ad8dd78dc1a3c 100644 --- a/third_party/sqlite/src/ext/rbu/rbu6.test +++ b/third_party/sqlite/src/ext/rbu/rbu6.test @@ -41,7 +41,7 @@ proc setup_test {} { rbu close } -# Test the outcome of some other client writing the db while the *-oal +# Test the outcome of some other client writing the db while the *-oal # file is being generated. Once this has happened, the update cannot be # progressed. # diff --git a/third_party/sqlite/src/ext/rbu/rbu7.test b/third_party/sqlite/src/ext/rbu/rbu7.test index f773c9e5a9f06..c2f2211bcec3e 100644 --- a/third_party/sqlite/src/ext/rbu/rbu7.test +++ b/third_party/sqlite/src/ext/rbu/rbu7.test @@ -21,7 +21,7 @@ set ::testprefix rbu7 # Test index: # -# 1.*: That affinities are correctly applied to values within the +# 1.*: That affinities are correctly applied to values within the # RBU database. # # 2.*: Tests for multi-column primary keys. @@ -90,7 +90,7 @@ foreach {tn tbl} { sqlite3rbu rbu test.db rbu.db rbu step set rc [rbu close] - } + } set rc } {SQLITE_DONE} diff --git a/third_party/sqlite/src/ext/rbu/rbu9.test b/third_party/sqlite/src/ext/rbu/rbu9.test index 3ce649d2504ae..4524b0a1517f8 100644 --- a/third_party/sqlite/src/ext/rbu/rbu9.test +++ b/third_party/sqlite/src/ext/rbu/rbu9.test @@ -52,7 +52,7 @@ do_test 1.2.1 { rbu close } {SQLITE_DONE} -do_execsql_test 1.2.2 { SELECT rowid, * FROM f1 } { +do_execsql_test 1.2.2 { SELECT rowid, * FROM f1 } { 12 d e f 13 g h X 14 x y z @@ -74,10 +74,10 @@ proc run_rbu {target rbu} { foreach {tn idx} { 1 { } - 2 { + 2 { CREATE INDEX i1 ON t1(a); } - 3 { + 3 { CREATE INDEX i1 ON t1(b, c); CREATE INDEX i2 ON t1(c, b); CREATE INDEX i3 ON t1(a, a, a, b, b, b, c, c, c); @@ -94,7 +94,7 @@ foreach {tn idx} { } db eval $idx - + do_test 2.$tn.2 { forcedelete rbu.db sqlite3 db2 rbu.db @@ -107,9 +107,9 @@ foreach {tn idx} { } db2 close } {} - + run_rbu test.db rbu.db - + do_execsql_test 2.$tn.3 { SELECT rowid, a, b, c FROM t1 ORDER BY rowid; } { @@ -119,7 +119,7 @@ foreach {tn idx} { 3 x y z 4 X Y Z } - + integrity_check 2.$tn.4 } diff --git a/third_party/sqlite/src/ext/rbu/rbuB.test b/third_party/sqlite/src/ext/rbu/rbuB.test index c007fb7d9a25d..bbc10a30838be 100644 --- a/third_party/sqlite/src/ext/rbu/rbuB.test +++ b/third_party/sqlite/src/ext/rbu/rbuB.test @@ -56,7 +56,7 @@ do_execsql_test 1.4 { db close sqlite3_shutdown -test_sqlite3_log +test_sqlite3_log sqlite3_initialize finish_test diff --git a/third_party/sqlite/src/ext/rbu/rbuC.test b/third_party/sqlite/src/ext/rbu/rbuC.test index 89fd01518f0e6..e3083222b5af0 100644 --- a/third_party/sqlite/src/ext/rbu/rbuC.test +++ b/third_party/sqlite/src/ext/rbu/rbuC.test @@ -66,7 +66,7 @@ foreach {tn schema} { INSERT INTO t1 VALUES(2, 'b', 'c', 'd'); INSERT INTO t1 VALUES(3, 'c', 'd', 'e'); } - + do_execsql_test 2.$tn.1 { ATTACH 'rbu.db' AS rbu; CREATE TABLE rbu.data_t1(i, a, b, c, rbu_control); @@ -74,11 +74,11 @@ foreach {tn schema} { INSERT INTO data_t1 VALUES(3, 'c', 'd', 'e', 2); INSERT INTO data_t1 VALUES(4, 'd', 'e', 'f', 2); } - + do_test 2.$tn.2 { step_rbu test.db rbu.db } {SQLITE_DONE} - + do_execsql_test 2.$tn.3 { SELECT * FROM t1 ORDER BY i } { @@ -87,7 +87,7 @@ foreach {tn schema} { 3 c d e 4 d e f } - + integrity_check 2.$tn.4 } @@ -111,7 +111,7 @@ foreach {tn schema} { INSERT INTO t1 VALUES('b', 'c', 'd'); INSERT INTO t1 VALUES('c', 'd', 'e'); } - + do_execsql_test 3.$tn.1 { ATTACH 'rbu.db' AS rbu; CREATE TABLE rbu.data_t1(rbu_rowid, a, b, c, rbu_control); @@ -119,11 +119,11 @@ foreach {tn schema} { INSERT INTO data_t1 VALUES(3, 'c', 'd', 'e', 2); INSERT INTO data_t1 VALUES(4, 'd', 'e', 'f', 2); } - + do_test 3.$tn.2 { step_rbu test.db rbu.db } {SQLITE_DONE} - + do_execsql_test 3.$tn.3 { SELECT rowid, * FROM t1 ORDER BY 1 } { @@ -132,7 +132,7 @@ foreach {tn schema} { 3 c d e 4 d e f } - + integrity_check 3.$tn.4 } diff --git a/third_party/sqlite/src/ext/rbu/rbucrash.test b/third_party/sqlite/src/ext/rbu/rbucrash.test index 40993ac61d079..f148af2832fcd 100644 --- a/third_party/sqlite/src/ext/rbu/rbucrash.test +++ b/third_party/sqlite/src/ext/rbu/rbucrash.test @@ -47,7 +47,7 @@ db_save_and_close # # Check that the same number of steps are required to apply the rbu # update using many calls to sqlite3rbu_step() on a single rbu handle -# as required to apply it using a series of rbu handles, on each of +# as required to apply it using a series of rbu handles, on each of # which sqlite3rbu_step() is called once. # do_test 1.1 { @@ -78,7 +78,7 @@ do_test 1.2 { # 1. This process starts the rbu update and calls sqlite3rbu_step() # $nPre times. Then closes the rbu update handle. # -# 2. A second process resumes the rbu update and attempts to call +# 2. A second process resumes the rbu update and attempts to call # sqlite3rbu_step() $nStep times before closing the handle. A # crash is simulated during each xSync() of file test.db2. # @@ -109,7 +109,7 @@ proc do_rbu_crash_test {tn nPre nStep} { if {$nPre>0} { sqlite3rbu rbu test.db file:test.db2 set i 0 - for {set i 0} {$i < $nPre} {incr i} { + for {set i 0} {$i < $nPre} {incr i} { if {[rbu step]!="SQLITE_OK"} break } rbu close diff --git a/third_party/sqlite/src/ext/rbu/rbudiff.test b/third_party/sqlite/src/ext/rbu/rbudiff.test index 6f6af828047ec..97e89b57a47d0 100644 --- a/third_party/sqlite/src/ext/rbu/rbudiff.test +++ b/third_party/sqlite/src/ext/rbu/rbudiff.test @@ -65,9 +65,9 @@ proc test_rbucount {sql} { } { set a [tmpdb eval "SELECT count(*) FROM [sqlesc $name]"] set b [tmpdb eval {SELECT cnt FROM rbu_count WHERE tbl = $name}] - if {$a != $b} { + if {$a != $b} { tmpdb close - error "rbu_count error - tbl = $name" + error "rbu_count error - tbl = $name" } } tmpdb close @@ -80,8 +80,8 @@ proc rbudiff_cksum {db1} { sqlite3 dbtmp $db1 foreach tbl [dbtmp eval {SELECT name FROM sqlite_master WHERE type='table'}] { set cols [list] - dbtmp eval "PRAGMA table_info = [sqlesc $tbl]" { - lappend cols "quote( $name )" + dbtmp eval "PRAGMA table_info = [sqlesc $tbl]" { + lappend cols "quote( $name )" } append txt [dbtmp eval \ "SELECT [join $cols {||'.'||}] FROM [sqlesc $tbl] ORDER BY 1" @@ -97,7 +97,7 @@ foreach {tn init mod} { CREATE TABLE t1(a PRIMARY KEY, b, c); INSERT INTO t1 VALUES(1, 2, 3); INSERT INTO t1 VALUES(4, 5, 6); - + CREATE TABLE t2(a, b, c, PRIMARY KEY(b, c)); INSERT INTO t2 VALUES(1, 2, 3); INSERT INTO t2 VALUES(4, 5, 6); @@ -105,7 +105,7 @@ foreach {tn init mod} { INSERT INTO t1 VALUES(7, 8, 9); DELETE FROM t1 WHERE a=4; UPDATE t1 SET c = 11 WHERE a = 1; - + INSERT INTO t2 VALUES(7, 8, 9); DELETE FROM t2 WHERE a=4; UPDATE t2 SET c = 11 WHERE a = 1; @@ -285,11 +285,11 @@ tablE t1 USING FTs5(c); sqlite3 db test.db sqlite3 db2 test.db2 - do_test 3.$tn.2 { + do_test 3.$tn.2 { db2 eval { SELECT * FROM t1 ORDER BY rowid } } [db eval { SELECT * FROM t1 ORDER BY rowid }] - do_test 3.$tn.3 { + do_test 3.$tn.3 { db2 eval { INSERT INTO t1(t1) VALUES('integrity-check') } } {} diff --git a/third_party/sqlite/src/ext/rbu/rbudor.test b/third_party/sqlite/src/ext/rbu/rbudor.test index dcee7ac381eb0..f69468c30e29a 100644 --- a/third_party/sqlite/src/ext/rbu/rbudor.test +++ b/third_party/sqlite/src/ext/rbu/rbudor.test @@ -29,7 +29,7 @@ do_execsql_test 1.0 { do_test 1.1 { forcedelete rbu.db - sqlite3 rbu rbu.db + sqlite3 rbu rbu.db rbu eval { CREATE TABLE data_t1(a, b, rbu_control); INSERT INTO data_t1 VALUES(2, $bigB, 0); @@ -52,7 +52,7 @@ do_test 1.3 { } {SQLITE_DONE} do_execsql_test 1.4 { - SELECT * FROM t1 + SELECT * FROM t1 } [list 1 $bigA 2 $bigB] finish_test diff --git a/third_party/sqlite/src/ext/rbu/rbufault.test b/third_party/sqlite/src/ext/rbu/rbufault.test index 3f30fb233bfb5..c00f501076731 100644 --- a/third_party/sqlite/src/ext/rbu/rbufault.test +++ b/third_party/sqlite/src/ext/rbu/rbufault.test @@ -111,15 +111,15 @@ foreach {tn2 setup sql expect} { foreach {tn f reslist} { 1 oom-tra* { - {0 SQLITE_DONE} - {1 {SQLITE_NOMEM - out of memory}} - {1 SQLITE_NOMEM} - {1 SQLITE_IOERR_NOMEM} + {0 SQLITE_DONE} + {1 {SQLITE_NOMEM - out of memory}} + {1 SQLITE_NOMEM} + {1 SQLITE_IOERR_NOMEM} {1 {SQLITE_NOMEM - unable to open a temporary database file for storing temporary tables}} } - + 2 ioerr-* { - {0 SQLITE_DONE} + {0 SQLITE_DONE} {1 {SQLITE_IOERR - disk I/O error}} {1 SQLITE_IOERR} {1 SQLITE_IOERR_WRITE} @@ -131,7 +131,7 @@ foreach {tn2 setup sql expect} { } 3 shmerr-* { - {0 SQLITE_DONE} + {0 SQLITE_DONE} {1 {SQLITE_IOERR - disk I/O error}} {1 SQLITE_IOERR} } @@ -175,23 +175,23 @@ foreach {tn2 setup sql expect} { for {set iStep 0} {$iStep<=21} {incr iStep} { - + forcedelete test.db-journal test.db-wal rbu.db-journal rbu.db-wal - + copy_if_exists test.db.bak test.db copy_if_exists rbu.db.bak rbu.db - + sqlite3rbu rbu test.db rbu.db for {set x 0} {$x < $::iStep} {incr x} { rbu step } rbu close - + # sqlite3 x rbu.db ; puts "XYZ [x eval { SELECT * FROM rbu_state } ]" ; x close - + copy_if_exists test.db test.db.bak.2 copy_if_exists test.db-wal test.db.bak.2-wal copy_if_exists test.db-oal test.db.bak.2-oal copy_if_exists rbu.db rbu.db.bak.2 - + do_faultsim_test 3.$tn.$iStep -faults $::f -prep { catch { db close } forcedelete test.db-journal test.db-wal rbu.db-journal rbu.db-wal @@ -207,7 +207,7 @@ foreach {tn2 setup sql expect} { if {$testresult=="SQLITE_OK"} {set testresult "SQLITE_DONE"} faultsim_test_result {*}$::reslist - + if {$testrc==0} { # No error occurred. If the RBU has not already been fully applied, # apply the rest of it now. Then ensure that the final state of the diff --git a/third_party/sqlite/src/ext/rbu/rbufault2.test b/third_party/sqlite/src/ext/rbu/rbufault2.test index ec89397fdc9dd..8e6a476b7cbaf 100644 --- a/third_party/sqlite/src/ext/rbu/rbufault2.test +++ b/third_party/sqlite/src/ext/rbu/rbufault2.test @@ -31,8 +31,8 @@ do_execsql_test 1.0 { } db close -forcecopy test.db test.db-bak -forcecopy rbu.db rbu.db-bak +forcecopy test.db test.db-bak +forcecopy rbu.db rbu.db-bak do_faultsim_test 1 -faults oom* -prep { forcecopy test.db-bak test.db @@ -48,7 +48,7 @@ do_faultsim_test 1 -faults oom* -prep { {1 SQLITE_CONSTRAINT} \ {1 SQLITE_NOMEM} \ {1 {SQLITE_NOMEM - unable to open a temporary database file for storing temporary tables}} \ - {1 {SQLITE_NOMEM - out of memory}} + {1 {SQLITE_NOMEM - out of memory}} } diff --git a/third_party/sqlite/src/ext/rbu/rbufault3.test b/third_party/sqlite/src/ext/rbu/rbufault3.test index e72eb14f7d3aa..58e045143a56e 100644 --- a/third_party/sqlite/src/ext/rbu/rbufault3.test +++ b/third_party/sqlite/src/ext/rbu/rbufault3.test @@ -25,20 +25,20 @@ foreach {fault errlist} { ioerr-* { {1 {SQLITE_IOERR - disk I/O error}} - {1 SQLITE_IOERR} - {1 SQLITE_IOERR_WRITE} - {1 SQLITE_IOERR_FSYNC} - {1 SQLITE_IOERR_READ} - {1 {SQLITE_IOERR - unable to open database: test.db2}} - {1 {SQLITE_ERROR - unable to open database: test.db2}} + {1 SQLITE_IOERR} + {1 SQLITE_IOERR_WRITE} + {1 SQLITE_IOERR_FSYNC} + {1 SQLITE_IOERR_READ} + {1 {SQLITE_IOERR - unable to open database: test.db2}} + {1 {SQLITE_ERROR - unable to open database: test.db2}} {1 {SQLITE_ERROR - SQL logic error or missing database}} } cantopen* { - {1 {SQLITE_CANTOPEN - unable to open database: test.db2}} - {1 {SQLITE_CANTOPEN - unable to open database: test.db2}} - {1 {SQLITE_CANTOPEN - unable to open database file}} - {1 SQLITE_CANTOPEN} + {1 {SQLITE_CANTOPEN - unable to open database: test.db2}} + {1 {SQLITE_CANTOPEN - unable to open database: test.db2}} + {1 {SQLITE_CANTOPEN - unable to open database file}} + {1 SQLITE_CANTOPEN} } } { diff --git a/third_party/sqlite/src/ext/rbu/rbufault4.test b/third_party/sqlite/src/ext/rbu/rbufault4.test index fe6cc90dc93df..507a36181ecbb 100644 --- a/third_party/sqlite/src/ext/rbu/rbufault4.test +++ b/third_party/sqlite/src/ext/rbu/rbufault4.test @@ -31,7 +31,7 @@ for {set tn 1} {1} {incr tn} { sqlite3rbu_vacuum rbu test.db test.db2 for {set i 0} {$i < $tn} {incr i} { rbu step } set rc [rbu close] - if {$rc!="SQLITE_OK"} { + if {$rc!="SQLITE_OK"} { if {$rc!="SQLITE_DONE"} {error $rc} break } diff --git a/third_party/sqlite/src/ext/rbu/rbufts.test b/third_party/sqlite/src/ext/rbu/rbufts.test index d5c9fe560979c..d067de1ecec3b 100644 --- a/third_party/sqlite/src/ext/rbu/rbufts.test +++ b/third_party/sqlite/src/ext/rbu/rbufts.test @@ -64,9 +64,9 @@ do_test 1.1.2 { INSERT INTO data_t1 VALUES(30, 'x y z', NULL, '.x.'); -- update INSERT INTO data_t1 VALUES(50, '1 2 3', 'x y z', 0); -- insert - CREATE VIEW data0_xx AS - SELECT i AS rbu_rowid, a, b, - CASE WHEN rbu_control IN (0, 1) + CREATE VIEW data0_xx AS + SELECT i AS rbu_rowid, a, b, + CASE WHEN rbu_control IN (0, 1) THEN rbu_control ELSE substr(rbu_control, 2) END AS rbu_control FROM data_t1; } @@ -104,7 +104,7 @@ do_execsql_test 1.2.4 { } {2 {x y z} {d e f} 3 {y y y} {1 1 1}} #------------------------------------------------------------------------- -# Test the outcome of attempting to delete or update a row within a +# Test the outcome of attempting to delete or update a row within a # contentless FTS table using RBU. An error. # reset_db diff --git a/third_party/sqlite/src/ext/rbu/rbuprogress.test b/third_party/sqlite/src/ext/rbu/rbuprogress.test index af202829c1357..8376b00801499 100644 --- a/third_party/sqlite/src/ext/rbu/rbuprogress.test +++ b/third_party/sqlite/src/ext/rbu/rbuprogress.test @@ -16,7 +16,7 @@ set ::testprefix rbuprogress proc create_db_file {filename sql} { forcedelete $filename - sqlite3 tmpdb $filename + sqlite3 tmpdb $filename tmpdb eval $sql tmpdb close } @@ -81,7 +81,7 @@ proc do_sp_test {tn bReopen target rbu reslist} { } # One step to clean up the temporary tables used to update the only - # target table in the rbu database. And one more to move the *-oal + # target table in the rbu database. And one more to move the *-oal # file to *-wal. After each of these steps, the progress remains # at "10000 0". # @@ -102,7 +102,7 @@ proc do_sp_test {tn bReopen target rbu reslist} { } # Do the checkpoint. - while {[rbu step]=="SQLITE_OK"} { + while {[rbu step]=="SQLITE_OK"} { foreach {a b} [rbu bp_progress] {} if {[set a]!=10000 || [set b]<=0 || [set b]>10000} { rbu close @@ -130,23 +130,23 @@ foreach {bReopen} { 0 1 } { CREATE TABLE data_t1(a, b, c, rbu_control); INSERT INTO data_t1 VALUES(4, 4, 4, 0); INSERT INTO data_t1 VALUES(5, 5, 5, 0); - + CREATE TABLE rbu_count(tbl, cnt); INSERT INTO rbu_count VALUES('data_t1', 2); } } {} do_sp_test 2.$bReopen.1.1 $bReopen test.db rbu.db {5000 10000} - + reset_db do_test 2.$bReopen.2.0 { execsql { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c) } create_rbu1 rbu.db } {rbu.db} do_sp_test 2.$bReopen.2.1 $bReopen test.db rbu.db {3333 6666 10000} - + reset_db do_test 2.$bReopen.3.0 { - execsql { + execsql { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); CREATE INDEX i1 ON t1(b); INSERT INTO t1 VALUES(1, 1, 1); @@ -158,16 +158,16 @@ foreach {bReopen} { 0 1 } { INSERT INTO data_t1 VALUES(4, 4, 4, 0); INSERT INTO data_t1 VALUES(2, NULL, NULL, 1); INSERT INTO data_t1 VALUES(5, NULL, NULL, 1); - + CREATE TABLE rbu_count(tbl, cnt); INSERT INTO rbu_count VALUES('data_t1', 3); } } {} do_sp_test 2.$bReopen.3.1 $bReopen test.db rbu.db {1666 3333 6000 8000 10000} - + reset_db do_test 2.$bReopen.4.0 { - execsql { + execsql { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); CREATE INDEX i1 ON t1(b); INSERT INTO t1 VALUES(1, 1, 1); @@ -177,16 +177,16 @@ foreach {bReopen} { 0 1 } { create_db_file rbu.db { CREATE TABLE data_t1(a, b, c, rbu_control); INSERT INTO data_t1 VALUES(2, 4, 4, '.xx'); - + CREATE TABLE rbu_count(tbl, cnt); INSERT INTO rbu_count VALUES('data_t1', 1); } } {} do_sp_test 2.$bReopen.4.1 $bReopen test.db rbu.db {3333 6666 10000} - + reset_db do_test 2.$bReopen.5.0 { - execsql { + execsql { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); CREATE INDEX i1 ON t1(b); INSERT INTO t1 VALUES(1, 1, 1); @@ -196,7 +196,7 @@ foreach {bReopen} { 0 1 } { create_db_file rbu.db { CREATE TABLE data_t1(a, b, c, rbu_control); INSERT INTO data_t1 VALUES(4, NULL, 4, '.xx'); - + CREATE TABLE rbu_count(tbl, cnt); INSERT INTO rbu_count VALUES('data_t1', 1); } @@ -205,7 +205,7 @@ foreach {bReopen} { 0 1 } { reset_db do_test 2.$bReopen.6.0 { - execsql { + execsql { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); CREATE INDEX i1 ON t1(b); INSERT INTO t1 VALUES(1, 1, 1); @@ -231,7 +231,7 @@ proc do_phase2_test {tn bReopen target rbu nStep} { # Build the OAL/WAL file: sqlite3rbu rbu $target $rbu - while {[lindex [rbu bp_progress] 0]<10000} { + while {[lindex [rbu bp_progress] 0]<10000} { set rc [rbu step] if {"SQLITE_OK" != [set rc]} { rbu close } } @@ -255,7 +255,7 @@ proc do_phase2_test {tn bReopen target rbu nStep} { set rc [rbu step] if {[set rc] != "SQLITE_DONE"} { - error "Have [set rc], expected SQLITE_DONE" + error "Have [set rc], expected SQLITE_DONE" } rbu close @@ -280,7 +280,7 @@ foreach bReopen {0 1} { INSERT INTO data_t2 VALUES(1, 2, 0); INSERT INTO data_t3 VALUES(1, 2, 0); INSERT INTO data_t4 VALUES(1, 2, 0); - + CREATE TABLE rbu_count(tbl, cnt); INSERT INTO rbu_count VALUES('data_t1', 1); INSERT INTO rbu_count VALUES('data_t2', 1); @@ -305,8 +305,8 @@ foreach {bReopen} { 0 1 } { INSERT INTO data0_t1 VALUES(15, 15, 15, 0); INSERT INTO data0_t1 VALUES(20, 20, 20, 0); CREATE TABLE rbu_count(tbl, cnt); - INSERT INTO rbu_count VALUES('data0_t1', 2); - } + INSERT INTO rbu_count VALUES('data0_t1', 2); + } {2500 5000 7500 10000} {1666 3333 5000 6666 8333 10000} @@ -314,8 +314,8 @@ foreach {bReopen} { 0 1 } { CREATE TABLE data0_t1(a, b, c, rbu_control); INSERT INTO data0_t1 VALUES(10, 10, 10, 2); CREATE TABLE rbu_count(tbl, cnt); - INSERT INTO rbu_count VALUES('data0_t1', 1); - } + INSERT INTO rbu_count VALUES('data0_t1', 1); + } {3333 6666 10000} {2000 4000 6000 8000 10000} @@ -324,8 +324,8 @@ foreach {bReopen} { 0 1 } { INSERT INTO data0_t1 VALUES(7, 7, 7, 2); INSERT INTO data0_t1 VALUES(10, 10, 10, 2); CREATE TABLE rbu_count(tbl, cnt); - INSERT INTO rbu_count VALUES('data0_t1', 2); - } + INSERT INTO rbu_count VALUES('data0_t1', 2); + } {2500 4000 6000 8000 10000} {1666 2500 3750 5000 6250 7500 8750 10000} @@ -352,11 +352,11 @@ foreach {bReopen} { 0 1 } { foreach {bReopen} { 0 1 } { foreach {tn tbl} { - nopk { + nopk { CREATE TABLE t1(a, b, c); CREATE INDEX t1c ON t1(c); } - vtab { + vtab { CREATE VIRTUAL TABLE t1 USING fts5(a, b, c); } } { @@ -369,8 +369,8 @@ foreach {bReopen} { 0 1 } { INSERT INTO data0_t1 VALUES(15, 15, 15, 4, 0); INSERT INTO data0_t1 VALUES(20, 20, 20, 5, 0); CREATE TABLE rbu_count(tbl, cnt); - INSERT INTO rbu_count VALUES('data0_t1', 2); - } + INSERT INTO rbu_count VALUES('data0_t1', 2); + } {2500 5000 7500 10000} {5000 10000} @@ -379,8 +379,8 @@ foreach {bReopen} { 0 1 } { INSERT INTO data0_t1 VALUES(0, 7, 7, 7, 2); INSERT INTO data0_t1 VALUES(2, 10, 10, 10, 2); CREATE TABLE rbu_count(tbl, cnt); - INSERT INTO rbu_count VALUES('data0_t1', 2); - } + INSERT INTO rbu_count VALUES('data0_t1', 2); + } {2500 4000 6000 8000 10000} {5000 10000} @@ -389,8 +389,8 @@ foreach {bReopen} { 0 1 } { INSERT INTO data0_t1 VALUES(1, NULL, NULL, NULL, 1); INSERT INTO data0_t1 VALUES(2, NULL, NULL, 7, '..x'); CREATE TABLE rbu_count(tbl, cnt); - INSERT INTO rbu_count VALUES('data0_t1', 2); - } + INSERT INTO rbu_count VALUES('data0_t1', 2); + } {2500 4000 6000 8000 10000} {5000 10000} } { diff --git a/third_party/sqlite/src/ext/rbu/rburesume.test b/third_party/sqlite/src/ext/rbu/rburesume.test index d03894e1353da..5dc3c0e915927 100644 --- a/third_party/sqlite/src/ext/rbu/rburesume.test +++ b/third_party/sqlite/src/ext/rbu/rburesume.test @@ -41,7 +41,7 @@ do_test 1.1 { # 1. Restores the db to the state it was in following test case 1.0 # 2. Opens an RBU vacuum and steps it $n times. # 3. Closes the RBU vacuum handled opened in (2). -# 4. Opens a second RBU vacuum handle, resumes and completes the vacuum op. +# 4. Opens a second RBU vacuum handle, resumes and completes the vacuum op. # # The loop runs until $n is large enough that step (2) vacuums the entire # database. @@ -65,7 +65,7 @@ for {set n 1} {$n < 5000} {incr n} { do_test 1.2.$n.2 { sqlite3 db2 test.db - db2 eval { + db2 eval { SELECT count(*) FROM t1; PRAGMA integrity_check; } @@ -79,7 +79,7 @@ for {set n 1} {$n < 5000} {incr n} { # 2. Opens an RBU vacuum and steps it $n times. # 3. Takes a copy of all database files and the state db. # 4. Opens a second RBU vacuum handle on the copy, resumes and completes the -# vacuum op. +# vacuum op. # # The loop runs until $n is large enough that step (2) vacuums the entire # database. @@ -116,7 +116,7 @@ for {set n 1} {$n < 5000} {incr n} { do_test 1.3.$n.2 { sqlite3 db2 test.db2 - db2 eval { + db2 eval { SELECT count(*) FROM t1; PRAGMA integrity_check; } @@ -131,7 +131,7 @@ for {set n 1} {$n < 5000} {incr n} { # 2. Opens an RBU vacuum and steps it $n times. # 3. Takes a copy of all database files and the state db. # 4. Opens a second RBU vacuum handle on the copy, resumes and completes the -# vacuum op. +# vacuum op. # # The loop runs until $n is large enough that step (3) vacuums the entire # database. @@ -175,7 +175,7 @@ for {set n 1} {$n < 5000} {incr n} { do_test 1.4.$n.2 { sqlite3 db2 test.db2 - db2 eval { + db2 eval { SELECT count(*) FROM t1; PRAGMA integrity_check; } @@ -191,7 +191,7 @@ do_test 2.0 { WITH s(i) AS ( VALUES(1) UNION ALL SELECT i+1 FROM s WHERE i<10 ) - INSERT INTO data_t1 + INSERT INTO data_t1 SELECT randomblob(50), randomblob(75), randomblob(100), 0 FROM s; } db2 close @@ -242,7 +242,7 @@ for {set n 1} {$n < 5000} {incr n} { do_test 2.$n.2 { sqlite3 db2 test.db2 - db2 eval { + db2 eval { SELECT count(*) FROM t1; PRAGMA integrity_check; } diff --git a/third_party/sqlite/src/ext/rbu/rbusave.test b/third_party/sqlite/src/ext/rbu/rbusave.test index 1bb71a8e052e1..eb94b621341dc 100644 --- a/third_party/sqlite/src/ext/rbu/rbusave.test +++ b/third_party/sqlite/src/ext/rbu/rbusave.test @@ -49,8 +49,8 @@ do_test 1.1 { proc test_to_bak {} { foreach f { - test.db test.db-wal test.db-oal test.db-journal - test.db2 test.db2-wal test.db2-oal test.db2-journal + test.db test.db-wal test.db-oal test.db-journal + test.db2 test.db2-wal test.db2-oal test.db2-journal } { set t [string map {test bak} $f] forcedelete $t diff --git a/third_party/sqlite/src/ext/rbu/rbuvacuum.test b/third_party/sqlite/src/ext/rbu/rbuvacuum.test index 86f4aa770e623..2066125a891a5 100644 --- a/third_party/sqlite/src/ext/rbu/rbuvacuum.test +++ b/third_party/sqlite/src/ext/rbu/rbuvacuum.test @@ -50,7 +50,7 @@ foreach step {0 1} { do_execsql_test 1.2.4 { PRAGMA page_count; } {3} - + # Add an index to the table. do_execsql_test 1.3.1 { CREATE INDEX t1b ON t1(b); @@ -88,7 +88,7 @@ foreach step {0 1} { do_execsql_test 1.4.3 { PRAGMA page_count; } {10} - + # WITHOUT ROWID table with an index. do_execsql_test 1.4.1 { CREATE INDEX t2c ON t2(c); @@ -147,7 +147,7 @@ foreach step {0 1} { CREATE INDEX t4a ON t4(a); CREATE INDEX t4b ON t4(b); CREATE INDEX t4c ON t4(c); - + INSERT INTO t4 VALUES('j', 'k', 'l'); DELETE FROM t4 WHERE a='g'; } @@ -319,7 +319,7 @@ for {set i 1} 1 {incr i} { execsql { INSERT INTO tx VALUES(20, 20) } do_test 2.2.$i.1 { - sqlite3rbu_vacuum rbu test.db state.db + sqlite3rbu_vacuum rbu test.db state.db rbu step } {SQLITE_BUSY} do_test 2.2.$i.2 { diff --git a/third_party/sqlite/src/ext/rbu/rbuvacuum2.test b/third_party/sqlite/src/ext/rbu/rbuvacuum2.test index 0a1fe3da94a56..8a2cd4117326f 100644 --- a/third_party/sqlite/src/ext/rbu/rbuvacuum2.test +++ b/third_party/sqlite/src/ext/rbu/rbuvacuum2.test @@ -18,7 +18,7 @@ source [file join [file dirname [info script]] rbu_common.tcl] foreach step {0 1} { set ::testprefix rbuvacuum2-$step - + #------------------------------------------------------------------------- # Test that a database that contains fts3 tables can be vacuumed. # @@ -28,13 +28,13 @@ foreach step {0 1} { CREATE VIRTUAL TABLE t1 USING fts3(z, y); INSERT INTO t1 VALUES('fix this issue', 'at some point'); } - + do_rbu_vacuum_test 1.2 $step - + do_execsql_test 1.3 { SELECT * FROM t1; } {{fix this issue} {at some point}} - + do_execsql_test 1.4 { SELECT rowid FROM t1 WHERE t1 MATCH 'fix'; } {1} @@ -56,7 +56,7 @@ foreach step {0 1} { {a b c} {x y z} } } - + #------------------------------------------------------------------------- # Test that a database that contains fts5 tables can be vacuumed. # @@ -66,13 +66,13 @@ foreach step {0 1} { CREATE VIRTUAL TABLE t1 USING fts5(z, y); INSERT INTO t1 VALUES('fix this issue', 'at some point'); } - + do_rbu_vacuum_test 2.2 $step - + do_execsql_test 2.3 { SELECT * FROM t1; } {{fix this issue} {at some point}} - + do_execsql_test 2.4 { SELECT rowid FROM t1 ('fix'); } {1} @@ -106,13 +106,13 @@ foreach step {0 1} { INSERT INTO rt VALUES(2, 50, 60); INSERT INTO rt VALUES(3, 55, 65); } - + do_rbu_vacuum_test 3.2 $step - + do_execsql_test 3.3 { SELECT * FROM rt; } {1 45.0 55.0 2 50.0 60.0 3 55.0 65.0} - + do_execsql_test 3.4.1 { SELECT rowid FROM rt WHERE x2>51 AND x1 < 51 } {1 2} @@ -157,9 +157,9 @@ foreach step {0 1} { } } } - + #------------------------------------------------------------------------- -# Test that passing a NULL value as the second argument to +# Test that passing a NULL value as the second argument to # sqlite3rbu_vacuum() causes it to: # # * Use -vacuum as the state db, and diff --git a/third_party/sqlite/src/ext/rbu/sqlite3rbu.c b/third_party/sqlite/src/ext/rbu/sqlite3rbu.c index 48c69115ee5a5..c4fcf0597fff3 100644 --- a/third_party/sqlite/src/ext/rbu/sqlite3rbu.c +++ b/third_party/sqlite/src/ext/rbu/sqlite3rbu.c @@ -11,7 +11,7 @@ ************************************************************************* ** ** -** OVERVIEW +** OVERVIEW ** ** The RBU extension requires that the RBU update be packaged as an ** SQLite database. The tables it expects to find are described in @@ -19,34 +19,34 @@ ** that the user wishes to write to, a corresponding data_xyz table is ** created in the RBU database and populated with one row for each row to ** update, insert or delete from the target table. -** +** ** The update proceeds in three stages: -** +** ** 1) The database is updated. The modified database pages are written ** to a *-oal file. A *-oal file is just like a *-wal file, except ** that it is named "-oal" instead of "-wal". ** Because regular SQLite clients do not look for file named ** "-oal", they go on using the original database in ** rollback mode while the *-oal file is being generated. -** +** ** During this stage RBU does not update the database by writing ** directly to the target tables. Instead it creates "imposter" ** tables using the SQLITE_TESTCTRL_IMPOSTER interface that it uses ** to update each b-tree individually. All updates required by each ** b-tree are completed before moving on to the next, and all ** updates are done in sorted key order. -** +** ** 2) The "-oal" file is moved to the equivalent "-wal" ** location using a call to rename(2). Before doing this the RBU ** module takes an EXCLUSIVE lock on the database file, ensuring ** that there are no other active readers. -** +** ** Once the EXCLUSIVE lock is released, any other database readers ** detect the new *-wal file and read the database in wal mode. At ** this point they see the new version of the database - including ** the updates made as part of the RBU update. -** -** 3) The new *-wal file is checkpointed. This proceeds in the same way +** +** 3) The new *-wal file is checkpointed. This proceeds in the same way ** as a regular database checkpoint, except that a single frame is ** checkpointed each time sqlite3rbu_step() is called. If the RBU ** handle is closed before the entire *-wal file is checkpointed, @@ -55,7 +55,7 @@ ** the future. ** ** POTENTIAL PROBLEMS -** +** ** The rename() call might not be portable. And RBU is not currently ** syncing the directory after renaming the file. ** @@ -77,7 +77,7 @@ ** fields are collected. This means we're probably writing a lot more ** data to disk when saving the state of an ongoing update to the RBU ** update database than is strictly necessary. -** +** */ #include @@ -111,17 +111,17 @@ ** RBU_STATE_STAGE: ** May be set to integer values 1, 2, 4 or 5. As follows: ** 1: the *-rbu file is currently under construction. -** 2: the *-rbu file has been constructed, but not yet moved +** 2: the *-rbu file has been constructed, but not yet moved ** to the *-wal path. ** 4: the checkpoint is underway. ** 5: the rbu update has been checkpointed. ** ** RBU_STATE_TBL: -** Only valid if STAGE==1. The target database name of the table +** Only valid if STAGE==1. The target database name of the table ** currently being written. ** ** RBU_STATE_IDX: -** Only valid if STAGE==1. The target database name of the index +** Only valid if STAGE==1. The target database name of the index ** currently being written, or NULL if the main table is currently being ** updated. ** @@ -141,7 +141,7 @@ ** be continued if this happens). ** ** RBU_STATE_COOKIE: -** Valid if STAGE==1. The current change-counter cookie value in the +** Valid if STAGE==1. The current change-counter cookie value in the ** target db file. ** ** RBU_STATE_OALSZ: @@ -218,7 +218,7 @@ struct RbuUpdateStmt { ** the target database that require updating. For each such table, the ** iterator visits, in order: ** -** * the table itself, +** * the table itself, ** * each index of the table (zero or more points to visit), and ** * a special "cleanup table" state. ** @@ -227,7 +227,7 @@ struct RbuUpdateStmt { ** it points to an array of flags nTblCol elements in size. The flag is ** set for each column that is either a part of the PK or a part of an ** index. Or clear otherwise. -** +** */ struct RbuObjIter { sqlite3_stmt *pTblIter; /* Iterate through tables */ @@ -306,7 +306,7 @@ struct RbuFrame { ** ** nPhaseOneStep: ** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to +** a running estimate of the number of b-tree operations required to ** finish populating the *-oal file. This allows the sqlite3_bp_progress() ** API to calculate the permyriadage progress of populating the *-oal file ** using the formula: @@ -326,7 +326,7 @@ struct RbuFrame { ** ** * the RBU update contains any UPDATE operations. If the PK specified ** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the +** no b-tree operations are required on index b-trees. Or if the ** specified PK does exist, then (nIndex*2) such operations are ** required (one delete and one insert on each index b-tree). ** @@ -665,7 +665,7 @@ static void rbuFossilDeltaFunc( /* ** Prepare the SQL statement in buffer zSql against database handle db. ** If successful, set *ppStmt to point to the new statement and return -** SQLITE_OK. +** SQLITE_OK. ** ** Otherwise, if an error does occur, set *ppStmt to NULL and return ** an SQLite error code. Additionally, set output variable *pzErrmsg to @@ -673,7 +673,7 @@ static void rbuFossilDeltaFunc( ** of the caller to (eventually) free this buffer using sqlite3_free(). */ static int prepareAndCollectError( - sqlite3 *db, + sqlite3 *db, sqlite3_stmt **ppStmt, char **pzErrmsg, const char *zSql @@ -705,9 +705,9 @@ static int resetAndCollectError(sqlite3_stmt *pStmt, char **pzErrmsg){ /* ** Unless it is NULL, argument zSql points to a buffer allocated using ** sqlite3_malloc containing an SQL statement. This function prepares the SQL -** statement against database db and frees the buffer. If statement -** compilation is successful, *ppStmt is set to point to the new statement -** handle and SQLITE_OK is returned. +** statement against database db and frees the buffer. If statement +** compilation is successful, *ppStmt is set to point to the new statement +** handle and SQLITE_OK is returned. ** ** Otherwise, if an error occurs, *ppStmt is set to NULL and an error code ** returned. In this case, *pzErrmsg may also be set to point to an error @@ -718,7 +718,7 @@ static int resetAndCollectError(sqlite3_stmt *pStmt, char **pzErrmsg){ ** In this case SQLITE_NOMEM is returned and *ppStmt set to NULL. */ static int prepareFreeAndCollectError( - sqlite3 *db, + sqlite3 *db, sqlite3_stmt **ppStmt, char **pzErrmsg, char *zSql @@ -773,7 +773,7 @@ static void rbuObjIterClearStatements(RbuObjIter *pIter){ sqlite3_free(pUp); pUp = pTmp; } - + pIter->pSelect = 0; pIter->pInsert = 0; pIter->pDelete = 0; @@ -797,16 +797,16 @@ static void rbuObjIterFinalize(RbuObjIter *pIter){ /* ** Advance the iterator to the next position. ** -** If no error occurs, SQLITE_OK is returned and the iterator is left -** pointing to the next entry. Otherwise, an error code and message is -** left in the RBU handle passed as the first argument. A copy of the +** If no error occurs, SQLITE_OK is returned and the iterator is left +** pointing to the next entry. Otherwise, an error code and message is +** left in the RBU handle passed as the first argument. A copy of the ** error code is returned. */ static int rbuObjIterNext(sqlite3rbu *p, RbuObjIter *pIter){ int rc = p->rc; if( rc==SQLITE_OK ){ - /* Free any SQLite statements used while processing the previous object */ + /* Free any SQLite statements used while processing the previous object */ rbuObjIterClearStatements(pIter); if( pIter->zIdx==0 ){ rc = sqlite3_exec(p->dbMain, @@ -865,7 +865,7 @@ static int rbuObjIterNext(sqlite3rbu *p, RbuObjIter *pIter){ ** The implementation of the rbu_target_name() SQL function. This function ** accepts one or two arguments. The first argument is the name of a table - ** the name of a table in the RBU database. The second, if it is present, is 1 -** for a view or 0 for a table. +** for a view or 0 for a table. ** ** For a non-vacuum RBU handle, if the table name matches the pattern: ** @@ -912,16 +912,16 @@ static void rbuTargetNameFunc( /* ** Initialize the iterator structure passed as the second argument. ** -** If no error occurs, SQLITE_OK is returned and the iterator is left -** pointing to the first entry. Otherwise, an error code and message is -** left in the RBU handle passed as the first argument. A copy of the +** If no error occurs, SQLITE_OK is returned and the iterator is left +** pointing to the first entry. Otherwise, an error code and message is +** left in the RBU handle passed as the first argument. A copy of the ** error code is returned. */ static int rbuObjIterFirst(sqlite3rbu *p, RbuObjIter *pIter){ int rc; memset(pIter, 0, sizeof(RbuObjIter)); - rc = prepareFreeAndCollectError(p->dbRbu, &pIter->pTblIter, &p->zErrmsg, + rc = prepareFreeAndCollectError(p->dbRbu, &pIter->pTblIter, &p->zErrmsg, sqlite3_mprintf( "SELECT rbu_target_name(name, type='view') AS target, name " "FROM sqlite_master " @@ -949,7 +949,7 @@ static int rbuObjIterFirst(sqlite3rbu *p, RbuObjIter *pIter){ ** ** If an error has already occurred (p->rc is already set to something other ** than SQLITE_OK), then this function returns NULL without modifying the -** stored error code. In this case it still calls sqlite3_free() on any +** stored error code. In this case it still calls sqlite3_free() on any ** printf() parameters associated with %z conversions. */ static char *rbuMPrintf(sqlite3rbu *p, const char *zFmt, ...){ @@ -995,12 +995,12 @@ static int rbuMPrintfExec(sqlite3rbu *p, sqlite3 *db, const char *zFmt, ...){ } /* -** Attempt to allocate and return a pointer to a zeroed block of nByte -** bytes. +** Attempt to allocate and return a pointer to a zeroed block of nByte +** bytes. ** -** If an error (i.e. an OOM condition) occurs, return NULL and leave an -** error code in the rbu handle passed as the first argument. Or, if an -** error has already occurred when this function is called, return NULL +** If an error (i.e. an OOM condition) occurs, return NULL and leave an +** error code in the rbu handle passed as the first argument. Or, if an +** error has already occurred when this function is called, return NULL ** immediately without attempting the allocation or modifying the stored ** error code. */ @@ -1096,7 +1096,7 @@ static void rbuFinalize(sqlite3rbu *p, sqlite3_stmt *pStmt){ ** RBU_PK_VTAB: Table is a virtual table. ** ** Argument *piPk is also of type (int*), and also points to an output -** parameter. Unless the table has an external primary key index +** parameter. Unless the table has an external primary key index ** (i.e. unless *peType is set to 3), then *piPk is set to zero. Or, ** if the table does have an external primary key index, then *piPk ** is set to the root page number of the primary key index before @@ -1131,7 +1131,7 @@ static void rbuTableType( /* ** 0) SELECT count(*) FROM sqlite_master where name=%Q AND IsVirtual(%Q) ** 1) PRAGMA index_list = ? - ** 2) SELECT count(*) FROM sqlite_master where name=%Q + ** 2) SELECT count(*) FROM sqlite_master where name=%Q ** 3) PRAGMA table_info = ? */ sqlite3_stmt *aStmt[4] = {0, 0, 0, 0}; @@ -1140,7 +1140,7 @@ static void rbuTableType( *piPk = 0; assert( p->rc==SQLITE_OK ); - p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[0], &p->zErrmsg, + p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[0], &p->zErrmsg, sqlite3_mprintf( "SELECT (sql LIKE 'create virtual%%'), rootpage" " FROM sqlite_master" @@ -1156,7 +1156,7 @@ static void rbuTableType( } *piTnum = sqlite3_column_int(aStmt[0], 1); - p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[1], &p->zErrmsg, + p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[1], &p->zErrmsg, sqlite3_mprintf("PRAGMA index_list=%Q",zTab) ); if( p->rc ) goto rbuTableType_end; @@ -1164,7 +1164,7 @@ static void rbuTableType( const u8 *zOrig = sqlite3_column_text(aStmt[1], 3); const u8 *zIdx = sqlite3_column_text(aStmt[1], 1); if( zOrig && zIdx && zOrig[0]=='p' ){ - p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[2], &p->zErrmsg, + p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[2], &p->zErrmsg, sqlite3_mprintf( "SELECT rootpage FROM sqlite_master WHERE name = %Q", zIdx )); @@ -1180,7 +1180,7 @@ static void rbuTableType( } } - p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[3], &p->zErrmsg, + p->rc = prepareFreeAndCollectError(p->dbMain, &aStmt[3], &p->zErrmsg, sqlite3_mprintf("PRAGMA table_info=%Q",zTab) ); if( p->rc==SQLITE_OK ){ @@ -1249,7 +1249,7 @@ static void rbuObjIterCacheIndexedCols(sqlite3rbu *p, RbuObjIter *pIter){ ** the table (not index) that the iterator currently points to. ** ** Return SQLITE_OK if successful, or an SQLite error code otherwise. If -** an error does occur, an error code and error message are also left in +** an error does occur, an error code and error message are also left in ** the RBU handle. */ static int rbuObjIterCacheTableInfo(sqlite3rbu *p, RbuObjIter *pIter){ @@ -1271,7 +1271,7 @@ static int rbuObjIterCacheTableInfo(sqlite3rbu *p, RbuObjIter *pIter){ if( p->rc ) return p->rc; if( pIter->zIdx==0 ) pIter->iTnum = iTnum; - assert( pIter->eType==RBU_PK_NONE || pIter->eType==RBU_PK_IPK + assert( pIter->eType==RBU_PK_NONE || pIter->eType==RBU_PK_IPK || pIter->eType==RBU_PK_EXTERNAL || pIter->eType==RBU_PK_WITHOUT_ROWID || pIter->eType==RBU_PK_VTAB ); @@ -1279,7 +1279,7 @@ static int rbuObjIterCacheTableInfo(sqlite3rbu *p, RbuObjIter *pIter){ /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - p->rc = prepareFreeAndCollectError(p->dbRbu, &pStmt, &p->zErrmsg, + p->rc = prepareFreeAndCollectError(p->dbRbu, &pStmt, &p->zErrmsg, sqlite3_mprintf("SELECT * FROM '%q'", pIter->zDataTbl) ); if( p->rc==SQLITE_OK ){ @@ -1315,7 +1315,7 @@ static int rbuObjIterCacheTableInfo(sqlite3rbu *p, RbuObjIter *pIter){ ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if( p->rc==SQLITE_OK ){ - p->rc = prepareFreeAndCollectError(p->dbMain, &pStmt, &p->zErrmsg, + p->rc = prepareFreeAndCollectError(p->dbMain, &pStmt, &p->zErrmsg, sqlite3_mprintf("PRAGMA table_info(%Q)", pIter->zTbl) ); } @@ -1357,8 +1357,8 @@ static int rbuObjIterCacheTableInfo(sqlite3rbu *p, RbuObjIter *pIter){ } /* -** This function constructs and returns a pointer to a nul-terminated -** string containing some SQL clause or list based on one or more of the +** This function constructs and returns a pointer to a nul-terminated +** string containing some SQL clause or list based on one or more of the ** column names currently stored in the pIter->azTblCol[] array. */ static char *rbuObjIterGetCollist( @@ -1377,23 +1377,23 @@ static char *rbuObjIterGetCollist( } /* -** This function is used to create a SELECT list (the list of SQL -** expressions that follows a SELECT keyword) for a SELECT statement -** used to read from an data_xxx or rbu_tmp_xxx table while updating the -** index object currently indicated by the iterator object passed as the -** second argument. A "PRAGMA index_xinfo = " statement is used +** This function is used to create a SELECT list (the list of SQL +** expressions that follows a SELECT keyword) for a SELECT statement +** used to read from an data_xxx or rbu_tmp_xxx table while updating the +** index object currently indicated by the iterator object passed as the +** second argument. A "PRAGMA index_xinfo = " statement is used ** to obtain the required information. ** ** If the index is of the following form: ** ** CREATE INDEX i1 ON t1(c, b COLLATE nocase); ** -** and "t1" is a table with an explicit INTEGER PRIMARY KEY column +** and "t1" is a table with an explicit INTEGER PRIMARY KEY column ** "ipk", the returned string is: ** ** "`c` COLLATE 'BINARY', `b` COLLATE 'NOCASE', `ipk` COLLATE 'BINARY'" ** -** As well as the returned string, three other malloc'd strings are +** As well as the returned string, three other malloc'd strings are ** returned via output parameters. As follows: ** ** pzImposterCols: ... @@ -1455,11 +1455,11 @@ static char *rbuObjIterGetIndexCols( zRet = sqlite3_mprintf("%z%s\"%w\" COLLATE %Q", zRet, zCom, zCol, zCollate); if( pIter->bUnique==0 || sqlite3_column_int(pXInfo, 5) ){ const char *zOrder = (bDesc ? " DESC" : ""); - zImpPK = sqlite3_mprintf("%z%s\"rbu_imp_%d%w\"%s", + zImpPK = sqlite3_mprintf("%z%s\"rbu_imp_%d%w\"%s", zImpPK, zCom, nBind, zCol, zOrder ); } - zImpCols = sqlite3_mprintf("%z%s\"rbu_imp_%d%w\" %s COLLATE %Q", + zImpCols = sqlite3_mprintf("%z%s\"rbu_imp_%d%w\" %s COLLATE %Q", zImpCols, zCom, nBind, zCol, zType, zCollate ); zWhere = sqlite3_mprintf( @@ -1505,7 +1505,7 @@ static char *rbuObjIterGetIndexCols( ** the text ", old._rowid_" to the returned value. */ static char *rbuObjIterGetOldlist( - sqlite3rbu *p, + sqlite3rbu *p, RbuObjIter *pIter, const char *zObj ){ @@ -1546,7 +1546,7 @@ static char *rbuObjIterGetOldlist( ** "b = ?1 AND c = ?2" */ static char *rbuObjIterGetWhere( - sqlite3rbu *p, + sqlite3rbu *p, RbuObjIter *pIter ){ char *zList = 0; @@ -1561,7 +1561,7 @@ static char *rbuObjIterGetWhere( zSep = " AND "; } } - zList = rbuMPrintf(p, + zList = rbuMPrintf(p, "_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)", zList ); @@ -1601,7 +1601,7 @@ static void rbuBadControlError(sqlite3rbu *p){ ** ** The memory for the returned string is obtained from sqlite3_malloc(). ** It is the responsibility of the caller to eventually free it using -** sqlite3_free(). +** sqlite3_free(). ** ** If an OOM error is encountered when allocating space for the new ** string, an error code is left in the rbu handle passed as the first @@ -1625,19 +1625,19 @@ static char *rbuObjIterGetSetlist( for(i=0; inTblCol; i++){ char c = zMask[pIter->aiSrcOrder[i]]; if( c=='x' ){ - zList = rbuMPrintf(p, "%z%s\"%w\"=?%d", + zList = rbuMPrintf(p, "%z%s\"%w\"=?%d", zList, zSep, pIter->azTblCol[i], i+1 ); zSep = ", "; } else if( c=='d' ){ - zList = rbuMPrintf(p, "%z%s\"%w\"=rbu_delta(\"%w\", ?%d)", + zList = rbuMPrintf(p, "%z%s\"%w\"=rbu_delta(\"%w\", ?%d)", zList, zSep, pIter->azTblCol[i], pIter->azTblCol[i], i+1 ); zSep = ", "; } else if( c=='f' ){ - zList = rbuMPrintf(p, "%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)", + zList = rbuMPrintf(p, "%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)", zList, zSep, pIter->azTblCol[i], pIter->azTblCol[i], i+1 ); zSep = ", "; @@ -1655,7 +1655,7 @@ static char *rbuObjIterGetSetlist( ** ** The memory for the returned string is obtained from sqlite3_malloc(). ** It is the responsibility of the caller to eventually free it using -** sqlite3_free(). +** sqlite3_free(). ** ** If an OOM error is encountered when allocating space for the new ** string, an error code is left in the rbu handle passed as the first @@ -1679,8 +1679,8 @@ static char *rbuObjIterGetBindlist(sqlite3rbu *p, int nBind){ } /* -** The iterator currently points to a table (not index) of type -** RBU_PK_WITHOUT_ROWID. This function creates the PRIMARY KEY +** The iterator currently points to a table (not index) of type +** RBU_PK_WITHOUT_ROWID. This function creates the PRIMARY KEY ** declaration for the corresponding imposter table. For example, ** if the iterator points to a table created as: ** @@ -1697,7 +1697,7 @@ static char *rbuWithoutRowidPK(sqlite3rbu *p, RbuObjIter *pIter){ const char *zSep = "PRIMARY KEY("; sqlite3_stmt *pXList = 0; /* PRAGMA index_list = (pIter->zTbl) */ sqlite3_stmt *pXInfo = 0; /* PRAGMA index_xinfo = */ - + p->rc = prepareFreeAndCollectError(p->dbMain, &pXList, &p->zErrmsg, sqlite3_mprintf("PRAGMA main.index_list = %Q", pIter->zTbl) ); @@ -1735,7 +1735,7 @@ static char *rbuWithoutRowidPK(sqlite3rbu *p, RbuObjIter *pIter){ ** a table b-tree where the table has an external primary key. If the ** iterator passed as the second argument does not currently point to ** a table (not index) with an external primary key, this function is a -** no-op. +** no-op. ** ** Assuming the iterator does point to a table with an external PK, this ** function creates a WITHOUT ROWID imposter table named "rbu_imposter2" @@ -1762,7 +1762,7 @@ static void rbuCreateImposterTable2(sqlite3rbu *p, RbuObjIter *pIter){ /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - p->rc = prepareAndCollectError(p->dbMain, &pQuery, &p->zErrmsg, + p->rc = prepareAndCollectError(p->dbMain, &pQuery, &p->zErrmsg, "SELECT name FROM sqlite_master WHERE rootpage = ?" ); if( p->rc==SQLITE_OK ){ @@ -1784,7 +1784,7 @@ static void rbuCreateImposterTable2(sqlite3rbu *p, RbuObjIter *pIter){ int iCid = sqlite3_column_int(pXInfo, 1); int bDesc = sqlite3_column_int(pXInfo, 3); const char *zCollate = (const char*)sqlite3_column_text(pXInfo, 4); - zCols = rbuMPrintf(p, "%z%sc%d %s COLLATE %s", zCols, zComma, + zCols = rbuMPrintf(p, "%z%sc%d %s COLLATE %s", zCols, zComma, iCid, pIter->azTblType[iCid], zCollate ); zPk = rbuMPrintf(p, "%z%sc%d%s", zPk, zComma, iCid, bDesc?" DESC":""); @@ -1796,7 +1796,7 @@ static void rbuCreateImposterTable2(sqlite3rbu *p, RbuObjIter *pIter){ sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 1, tnum); rbuMPrintfExec(p, p->dbMain, - "CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID", + "CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID", zCols, zPk ); sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 0, 0); @@ -1804,7 +1804,7 @@ static void rbuCreateImposterTable2(sqlite3rbu *p, RbuObjIter *pIter){ } /* -** If an error has already occurred when this function is called, it +** If an error has already occurred when this function is called, it ** immediately returns zero (without doing any work). Or, if an error ** occurs during the execution of this function, it sets the error code ** in the sqlite3rbu object indicated by the first argument and returns @@ -1817,9 +1817,9 @@ static void rbuCreateImposterTable2(sqlite3rbu *p, RbuObjIter *pIter){ ** an imposter table are created, or zero otherwise. ** ** An imposter table is required in all cases except RBU_PK_VTAB. Only -** virtual tables are written to directly. The imposter table has the -** same schema as the actual target table (less any UNIQUE constraints). -** More precisely, the "same schema" means the same columns, types, +** virtual tables are written to directly. The imposter table has the +** same schema as the actual target table (less any UNIQUE constraints). +** More precisely, the "same schema" means the same columns, types, ** collation sequences. For tables that do not have an external PRIMARY ** KEY, it also means the same PRIMARY KEY declaration. */ @@ -1845,7 +1845,7 @@ static void rbuCreateImposterTable(sqlite3rbu *p, RbuObjIter *pIter){ ** "PRIMARY KEY" to the imposter table column declaration. */ zPk = "PRIMARY KEY "; } - zSql = rbuMPrintf(p, "%z%s\"%w\" %s %sCOLLATE %s%s", + zSql = rbuMPrintf(p, "%z%s\"%w\" %s %sCOLLATE %s%s", zSql, zComma, zCol, pIter->azTblType[iCol], zPk, zColl, (pIter->abNotNull[iCol] ? " NOT NULL" : "") ); @@ -1860,8 +1860,8 @@ static void rbuCreateImposterTable(sqlite3rbu *p, RbuObjIter *pIter){ } sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 1, tnum); - rbuMPrintfExec(p, p->dbMain, "CREATE TABLE \"rbu_imp_%w\"(%z)%s", - pIter->zTbl, zSql, + rbuMPrintfExec(p, p->dbMain, "CREATE TABLE \"rbu_imp_%w\"(%z)%s", + pIter->zTbl, zSql, (pIter->eType==RBU_PK_WITHOUT_ROWID ? " WITHOUT ROWID" : "") ); sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 0, 0); @@ -1875,12 +1875,12 @@ static void rbuCreateImposterTable(sqlite3rbu *p, RbuObjIter *pIter){ ** INSERT INTO rbu_tmp_xxx VALUES(?, ?, ? ...); ** ** The number of bound variables is equal to the number of columns in -** the target table, plus one (for the rbu_control column), plus one more -** (for the rbu_rowid column) if the target table is an implicit IPK or +** the target table, plus one (for the rbu_control column), plus one more +** (for the rbu_rowid column) if the target table is an implicit IPK or ** virtual table. */ static void rbuObjIterPrepareTmpInsert( - sqlite3rbu *p, + sqlite3rbu *p, RbuObjIter *pIter, const char *zCollist, const char *zRbuRowid @@ -1891,14 +1891,14 @@ static void rbuObjIterPrepareTmpInsert( assert( pIter->pTmpInsert==0 ); p->rc = prepareFreeAndCollectError( p->dbRbu, &pIter->pTmpInsert, &p->zErrmsg, sqlite3_mprintf( - "INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)", + "INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)", p->zStateDb, pIter->zDataTbl, zCollist, zRbuRowid, zBind )); } } static void rbuTmpInsertFunc( - sqlite3_context *pCtx, + sqlite3_context *pCtx, int nVal, sqlite3_value **apVal ){ @@ -1907,8 +1907,8 @@ static void rbuTmpInsertFunc( int i; assert( sqlite3_value_int(apVal[0])!=0 - || p->objiter.eType==RBU_PK_EXTERNAL - || p->objiter.eType==RBU_PK_NONE + || p->objiter.eType==RBU_PK_EXTERNAL + || p->objiter.eType==RBU_PK_NONE ); if( sqlite3_value_int(apVal[0])!=0 ){ p->nPhaseOneStep += p->objiter.nIndex; @@ -1928,12 +1928,12 @@ static void rbuTmpInsertFunc( } /* -** Ensure that the SQLite statement handles required to update the -** target database object currently indicated by the iterator passed +** Ensure that the SQLite statement handles required to update the +** target database object currently indicated by the iterator passed ** as the second argument are available. */ static int rbuObjIterPrepareAll( - sqlite3rbu *p, + sqlite3rbu *p, RbuObjIter *pIter, int nOffset /* Add "LIMIT -1 OFFSET $nOffset" to SELECT */ ){ @@ -1996,7 +1996,7 @@ static int rbuObjIterPrepareAll( if( rbuIsVacuum(p) ){ zSql = sqlite3_mprintf( "SELECT %s, 0 AS rbu_control FROM '%q' ORDER BY %s%s", - zCollist, + zCollist, pIter->zDataTbl, zCollist, zLimit ); @@ -2015,8 +2015,8 @@ static int rbuObjIterPrepareAll( "SELECT %s, rbu_control FROM '%q' " "WHERE typeof(rbu_control)='integer' AND rbu_control!=1 " "ORDER BY %s%s", - zCollist, p->zStateDb, pIter->zDataTbl, - zCollist, pIter->zDataTbl, + zCollist, p->zStateDb, pIter->zDataTbl, + zCollist, pIter->zDataTbl, zCollist, zLimit ); } @@ -2051,7 +2051,7 @@ static int rbuObjIterPrepareAll( if( p->rc==SQLITE_OK ){ p->rc = prepareFreeAndCollectError(p->dbMain, &pIter->pInsert, pz, sqlite3_mprintf( - "INSERT INTO \"%s%w\"(%s%s) VALUES(%s)", + "INSERT INTO \"%s%w\"(%s%s) VALUES(%s)", zWrite, zTbl, zCollist, (bRbuRowid ? ", _rowid_" : ""), zBindings ) ); @@ -2124,8 +2124,8 @@ static int rbuObjIterPrepareAll( } p->rc = prepareFreeAndCollectError(p->dbRbu, &pIter->pSelect, pz, sqlite3_mprintf( - "SELECT %s,%s rbu_control%s FROM '%q'%s", - zCollist, + "SELECT %s,%s rbu_control%s FROM '%q'%s", + zCollist, (rbuIsVacuum(p) ? "0 AS " : ""), zRbuRowid, pIter->zDataTbl, zLimit @@ -2141,16 +2141,16 @@ static int rbuObjIterPrepareAll( sqlite3_free(zCollist); sqlite3_free(zLimit); } - + return p->rc; } /* ** Set output variable *ppStmt to point to an UPDATE statement that may ** be used to update the imposter table for the main table b-tree of the -** table object that pIter currently points to, assuming that the +** table object that pIter currently points to, assuming that the ** rbu_control column of the data_xyz table contains zMask. -** +** ** If the zMask string does not specify any columns to update, then this ** is not an error. Output variable *ppStmt is set to NULL in this case. */ @@ -2177,7 +2177,7 @@ static int rbuGetUpdateStmt( *pp = pUp->pNext; pUp->pNext = pIter->pRbuUpdate; pIter->pRbuUpdate = pUp; - *ppStmt = pUp->pUpdate; + *ppStmt = pUp->pUpdate; return SQLITE_OK; } nUp++; @@ -2207,7 +2207,7 @@ static int rbuGetUpdateStmt( const char *zPrefix = ""; if( pIter->eType!=RBU_PK_VTAB ) zPrefix = "rbu_imp_"; - zUpdate = sqlite3_mprintf("UPDATE \"%s%w\" SET %s WHERE %s", + zUpdate = sqlite3_mprintf("UPDATE \"%s%w\" SET %s WHERE %s", zPrefix, pIter->zTbl, zSet, zWhere ); p->rc = prepareFreeAndCollectError( @@ -2223,8 +2223,8 @@ static int rbuGetUpdateStmt( } static sqlite3 *rbuOpenDbhandle( - sqlite3rbu *p, - const char *zName, + sqlite3rbu *p, + const char *zName, int bUseVfs ){ sqlite3 *db = 0; @@ -2252,8 +2252,8 @@ static void rbuFreeState(RbuState *p){ } /* -** Allocate an RbuState object and load the contents of the rbu_state -** table into it. Return a pointer to the new object. It is the +** Allocate an RbuState object and load the contents of the rbu_state +** table into it. Return a pointer to the new object. It is the ** responsibility of the caller to eventually free the object using ** sqlite3_free(). ** @@ -2269,7 +2269,7 @@ static RbuState *rbuLoadState(sqlite3rbu *p){ pRet = (RbuState*)rbuMalloc(p, sizeof(RbuState)); if( pRet==0 ) return 0; - rc = prepareFreeAndCollectError(p->dbRbu, &pStmt, &p->zErrmsg, + rc = prepareFreeAndCollectError(p->dbRbu, &pStmt, &p->zErrmsg, sqlite3_mprintf("SELECT k, v FROM %s.rbu_state", p->zStateDb) ); while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ @@ -2375,7 +2375,7 @@ static void rbuOpenDatabase(sqlite3rbu *p, int *pbRetry){ p->rc = prepareAndCollectError(p->dbRbu, &pCnt, &p->zErrmsg, "SELECT count(*) FROM stat.sqlite_master" ); - if( p->rc==SQLITE_OK + if( p->rc==SQLITE_OK && sqlite3_step(pCnt)==SQLITE_ROW && 1==sqlite3_column_int(pCnt, 0) ){ @@ -2388,7 +2388,7 @@ static void rbuOpenDatabase(sqlite3rbu *p, int *pbRetry){ p->rc = SQLITE_ERROR; p->zErrmsg = sqlite3_mprintf("invalid state database"); } - + if( p->rc==SQLITE_OK ){ p->rc = sqlite3_exec(p->dbRbu, "COMMIT", 0, 0, 0); } @@ -2442,7 +2442,7 @@ static void rbuOpenDatabase(sqlite3rbu *p, int *pbRetry){ if( *zExtra=='\0' ) zExtra = 0; } - zTarget = sqlite3_mprintf("file:%s-vacuum?rbu_memory=1%s%s", + zTarget = sqlite3_mprintf("file:%s-vacuum?rbu_memory=1%s%s", sqlite3_db_filename(p->dbRbu, "main"), (zExtra==0 ? "" : "&"), (zExtra==0 ? "" : zExtra) ); @@ -2457,19 +2457,19 @@ static void rbuOpenDatabase(sqlite3rbu *p, int *pbRetry){ } if( p->rc==SQLITE_OK ){ - p->rc = sqlite3_create_function(p->dbMain, + p->rc = sqlite3_create_function(p->dbMain, "rbu_tmp_insert", -1, SQLITE_UTF8, (void*)p, rbuTmpInsertFunc, 0, 0 ); } if( p->rc==SQLITE_OK ){ - p->rc = sqlite3_create_function(p->dbMain, + p->rc = sqlite3_create_function(p->dbMain, "rbu_fossil_delta", 2, SQLITE_UTF8, 0, rbuFossilDeltaFunc, 0, 0 ); } if( p->rc==SQLITE_OK ){ - p->rc = sqlite3_create_function(p->dbRbu, + p->rc = sqlite3_create_function(p->dbRbu, "rbu_target_name", -1, SQLITE_UTF8, (void*)p, rbuTargetNameFunc, 0, 0 ); } @@ -2479,7 +2479,7 @@ static void rbuOpenDatabase(sqlite3rbu *p, int *pbRetry){ } rbuMPrintfExec(p, p->dbMain, "SELECT * FROM sqlite_master"); - /* Mark the database file just opened as an RBU target database. If + /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if( p->rc==SQLITE_OK ){ @@ -2527,10 +2527,10 @@ static void rbuFileSuffix3(const char *zBase, char *z){ } /* -** Return the current wal-index header checksum for the target database +** Return the current wal-index header checksum for the target database ** as a 64-bit integer. ** -** The checksum is store in the first page of xShmMap memory as an 8-byte +** The checksum is store in the first page of xShmMap memory as an 8-byte ** blob starting at byte offset 40. */ static i64 rbuShmChecksum(sqlite3rbu *p){ @@ -2548,11 +2548,11 @@ static i64 rbuShmChecksum(sqlite3rbu *p){ /* ** This function is called as part of initializing or reinitializing an -** incremental checkpoint. +** incremental checkpoint. ** -** It populates the sqlite3rbu.aFrame[] array with the set of -** (wal frame -> db page) copy operations required to checkpoint the -** current wal file, and obtains the set of shm locks required to safely +** It populates the sqlite3rbu.aFrame[] array with the set of +** (wal frame -> db page) copy operations required to checkpoint the +** current wal file, and obtains the set of shm locks required to safely ** perform the copy operations directly on the file-system. ** ** If argument pState is not NULL, then the incremental checkpoint is @@ -2587,19 +2587,19 @@ static void rbuSetupCheckpoint(sqlite3rbu *p, RbuState *pState){ ** would be read/written are recorded in the sqlite3rbu.aFrame[] ** array. ** - ** * Calls to xShmLock(UNLOCK) to release the exclusive shm WRITER, + ** * Calls to xShmLock(UNLOCK) to release the exclusive shm WRITER, ** READ0 and CHECKPOINT locks taken as part of the checkpoint are ** no-ops. These locks will not be released until the connection ** is closed. ** - ** * Attempting to xSync() the database file causes an SQLITE_INTERNAL + ** * Attempting to xSync() the database file causes an SQLITE_INTERNAL ** error. ** ** As a result, unless an error (i.e. OOM or SQLITE_BUSY) occurs, the ** checkpoint below fails with SQLITE_INTERNAL, and leaves the aFrame[] - ** array populated with a set of (frame -> page) mappings. Because the - ** WRITER, CHECKPOINT and READ0 locks are still held, it is safe to copy - ** data from the wal file into the database file according to the + ** array populated with a set of (frame -> page) mappings. Because the + ** WRITER, CHECKPOINT and READ0 locks are still held, it is safe to copy + ** data from the wal file into the database file according to the ** contents of aFrame[]. */ if( p->rc==SQLITE_OK ){ @@ -2658,7 +2658,7 @@ static int rbuCaptureWalRead(sqlite3rbu *pRbu, i64 iOff, int iAmt){ /* ** Called when a page of data is written to offset iOff of the database -** file while the rbu handle is in capture mode. Record the page number +** file while the rbu handle is in capture mode. Record the page number ** of the page being written in the aFrame[] array. */ static int rbuCaptureDbWrite(sqlite3rbu *pRbu, i64 iOff){ @@ -2726,7 +2726,7 @@ static LPWSTR rbuWinUtf8ToUnicode(const char *zFilename){ ** The RBU handle is currently in RBU_STAGE_OAL state, with a SHARED lock ** on the database file. This proc moves the *-oal file to the *-wal path, ** then reopens the database file (this time in vanilla, non-oal, WAL mode). -** If an error occurs, leave an error code and error message in the rbu +** If an error occurs, leave an error code and error message in the rbu ** handle. */ static void rbuMoveOalFile(sqlite3rbu *p){ @@ -2748,7 +2748,7 @@ static void rbuMoveOalFile(sqlite3rbu *p){ }else{ /* Move the *-oal file to *-wal. At this point connection p->db is ** holding a SHARED lock on the target database file (because it is - ** in WAL mode). So no other connection may be writing the db. + ** in WAL mode). So no other connection may be writing the db. ** ** In order to ensure that there are no database readers, an EXCLUSIVE ** lock is obtained here before the *-oal is moved to *-wal. @@ -2906,8 +2906,8 @@ static void rbuStepOneOp(sqlite3rbu *p, int eType){ /* If this is an INSERT into a table b-tree and the table has an ** explicit INTEGER PRIMARY KEY, check that this is not an attempt ** to write a NULL into the IPK column. That is not permitted. */ - if( eType==RBU_INSERT - && pIter->zIdx==0 && pIter->eType==RBU_PK_IPK && pIter->abTblPk[i] + if( eType==RBU_INSERT + && pIter->zIdx==0 && pIter->eType==RBU_PK_IPK && pIter->abTblPk[i] && sqlite3_column_type(pIter->pSelect, i)==SQLITE_NULL ){ p->rc = SQLITE_MISMATCH; @@ -2924,18 +2924,18 @@ static void rbuStepOneOp(sqlite3rbu *p, int eType){ if( p->rc ) return; } if( pIter->zIdx==0 ){ - if( pIter->eType==RBU_PK_VTAB - || pIter->eType==RBU_PK_NONE - || (pIter->eType==RBU_PK_EXTERNAL && rbuIsVacuum(p)) + if( pIter->eType==RBU_PK_VTAB + || pIter->eType==RBU_PK_NONE + || (pIter->eType==RBU_PK_EXTERNAL && rbuIsVacuum(p)) ){ - /* For a virtual table, or a table with no primary key, the + /* For a virtual table, or a table with no primary key, the ** SELECT statement is: ** ** SELECT , rbu_control, rbu_rowid FROM .... ** ** Hence column_value(pIter->nCol+1). */ - assertColumnName(pIter->pSelect, pIter->nCol+1, + assertColumnName(pIter->pSelect, pIter->nCol+1, rbuIsVacuum(p) ? "rowid" : "rbu_rowid" ); pVal = sqlite3_column_value(pIter->pSelect, pIter->nCol+1); @@ -2999,8 +2999,8 @@ static int rbuStep(sqlite3rbu *p){ p->rc = sqlite3_bind_value(pUpdate, i+1, pVal); } } - if( p->rc==SQLITE_OK - && (pIter->eType==RBU_PK_VTAB || pIter->eType==RBU_PK_NONE) + if( p->rc==SQLITE_OK + && (pIter->eType==RBU_PK_VTAB || pIter->eType==RBU_PK_NONE) ){ /* Bind the rbu_rowid value to column _rowid_ */ assertColumnName(pIter->pSelect, pIter->nCol+1, "rbu_rowid"); @@ -3030,7 +3030,7 @@ static void rbuIncrSchemaCookie(sqlite3rbu *p){ int iCookie = 1000000; sqlite3_stmt *pStmt; - p->rc = prepareAndCollectError(dbread, &pStmt, &p->zErrmsg, + p->rc = prepareAndCollectError(dbread, &pStmt, &p->zErrmsg, "PRAGMA schema_version" ); if( p->rc==SQLITE_OK ){ @@ -3062,7 +3062,7 @@ static void rbuSaveState(sqlite3rbu *p, int eStage){ int rc; assert( p->zErrmsg==0 ); - rc = prepareFreeAndCollectError(p->dbRbu, &pInsert, &p->zErrmsg, + rc = prepareFreeAndCollectError(p->dbRbu, &pInsert, &p->zErrmsg, sqlite3_mprintf( "INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES " "(%d, %d), " @@ -3076,9 +3076,9 @@ static void rbuSaveState(sqlite3rbu *p, int eStage){ "(%d, %lld) ", p->zStateDb, RBU_STATE_STAGE, eStage, - RBU_STATE_TBL, p->objiter.zTbl, - RBU_STATE_IDX, p->objiter.zIdx, - RBU_STATE_ROW, p->nStep, + RBU_STATE_TBL, p->objiter.zTbl, + RBU_STATE_IDX, p->objiter.zIdx, + RBU_STATE_ROW, p->nStep, RBU_STATE_PROGRESS, p->nProgress, RBU_STATE_CKPT, p->iWalCksum, RBU_STATE_COOKIE, (i64)pFd->iCookie, @@ -3098,7 +3098,7 @@ static void rbuSaveState(sqlite3rbu *p, int eStage){ /* -** The second argument passed to this function is the name of a PRAGMA +** The second argument passed to this function is the name of a PRAGMA ** setting - "page_size", "auto_vacuum", "user_version" or "application_id". ** This function executes the following on sqlite3rbu.dbRbu: ** @@ -3117,7 +3117,7 @@ static void rbuSaveState(sqlite3rbu *p, int eStage){ static void rbuCopyPragma(sqlite3rbu *p, const char *zPragma){ if( p->rc==SQLITE_OK ){ sqlite3_stmt *pPragma = 0; - p->rc = prepareFreeAndCollectError(p->dbRbu, &pPragma, &p->zErrmsg, + p->rc = prepareFreeAndCollectError(p->dbRbu, &pPragma, &p->zErrmsg, sqlite3_mprintf("PRAGMA main.%s", zPragma) ); if( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pPragma) ){ @@ -3130,7 +3130,7 @@ static void rbuCopyPragma(sqlite3rbu *p, const char *zPragma){ } /* -** The RBU handle passed as the only argument has just been opened and +** The RBU handle passed as the only argument has just been opened and ** the state database is empty. If this RBU handle was opened for an ** RBU vacuum operation, create the schema in the target db. */ @@ -3141,7 +3141,7 @@ static void rbuCreateTargetSchema(sqlite3rbu *p){ assert( rbuIsVacuum(p) ); p->rc = sqlite3_exec(p->dbMain, "PRAGMA writable_schema=1", 0,0, &p->zErrmsg); if( p->rc==SQLITE_OK ){ - p->rc = prepareAndCollectError(p->dbRbu, &pSql, &p->zErrmsg, + p->rc = prepareAndCollectError(p->dbRbu, &pSql, &p->zErrmsg, "SELECT sql FROM sqlite_master WHERE sql!='' AND rootpage!=0" " AND name!='sqlite_sequence' " " ORDER BY type DESC" @@ -3156,13 +3156,13 @@ static void rbuCreateTargetSchema(sqlite3rbu *p){ if( p->rc!=SQLITE_OK ) return; if( p->rc==SQLITE_OK ){ - p->rc = prepareAndCollectError(p->dbRbu, &pSql, &p->zErrmsg, - "SELECT * FROM sqlite_master WHERE rootpage=0 OR rootpage IS NULL" + p->rc = prepareAndCollectError(p->dbRbu, &pSql, &p->zErrmsg, + "SELECT * FROM sqlite_master WHERE rootpage=0 OR rootpage IS NULL" ); } if( p->rc==SQLITE_OK ){ - p->rc = prepareAndCollectError(p->dbMain, &pInsert, &p->zErrmsg, + p->rc = prepareAndCollectError(p->dbMain, &pInsert, &p->zErrmsg, "INSERT INTO sqlite_master VALUES(?,?,?,?,?)" ); } @@ -3203,11 +3203,11 @@ int sqlite3rbu_step(sqlite3rbu *p){ while( p->rc==SQLITE_OK && pIter->zTbl ){ if( pIter->bCleanup ){ - /* Clean up the rbu_tmp_xxx table for the previous table. It + /* Clean up the rbu_tmp_xxx table for the previous table. It ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if( rbuIsVacuum(p)==0 && pIter->abIndexed ){ - rbuMPrintfExec(p, p->dbRbu, + rbuMPrintfExec(p, p->dbRbu, "DELETE FROM %s.'rbu_tmp_%q'", p->zStateDb, pIter->zDataTbl ); } @@ -3257,10 +3257,10 @@ int sqlite3rbu_step(sqlite3rbu *p){ if( p->rc==SQLITE_OK ){ if( p->nStep>=p->nFrame ){ sqlite3_file *pDb = p->pTargetFd->pReal; - + /* Sync the db file */ p->rc = pDb->pMethods->xSync(pDb, SQLITE_SYNC_NORMAL); - + /* Update nBackfill */ if( p->rc==SQLITE_OK ){ void volatile *ptr; @@ -3269,7 +3269,7 @@ int sqlite3rbu_step(sqlite3rbu *p){ ((u32 volatile*)ptr)[24] = p->iMaxFrame; } } - + if( p->rc==SQLITE_OK ){ p->eStage = RBU_STAGE_DONE; p->rc = SQLITE_DONE; @@ -3320,9 +3320,9 @@ static void rbuSetupOal(sqlite3rbu *p, RbuState *pState){ RbuObjIter *pIter = &p->objiter; int rc = SQLITE_OK; - while( rc==SQLITE_OK && pIter->zTbl && (pIter->bCleanup + while( rc==SQLITE_OK && pIter->zTbl && (pIter->bCleanup || rbuStrCompare(pIter->zIdx, pState->zIdx) - || rbuStrCompare(pIter->zTbl, pState->zTbl) + || rbuStrCompare(pIter->zTbl, pState->zTbl) )){ rc = rbuObjIterNext(p, pIter); } @@ -3394,7 +3394,7 @@ static void rbuDeleteVfs(sqlite3rbu *p){ ** the number of auxilliary indexes on the table. */ static void rbuIndexCntFunc( - sqlite3_context *pCtx, + sqlite3_context *pCtx, int nVal, sqlite3_value **apVal ){ @@ -3404,8 +3404,8 @@ static void rbuIndexCntFunc( int rc; assert( nVal==1 ); - - rc = prepareFreeAndCollectError(p->dbMain, &pStmt, &zErrmsg, + + rc = prepareFreeAndCollectError(p->dbMain, &pStmt, &zErrmsg, sqlite3_mprintf("SELECT count(*) FROM sqlite_master " "WHERE type='index' AND tbl_name = %Q", sqlite3_value_text(apVal[0])) ); @@ -3439,7 +3439,7 @@ static void rbuIndexCntFunc( ** and the cnt column the number of rows it contains. ** ** sqlite3rbu.nPhaseOneStep is initialized to the sum of (1 + nIndex) * cnt -** for all rows in the rbu_count table, where nIndex is the number of +** for all rows in the rbu_count table, where nIndex is the number of ** indexes on the corresponding target database table. */ static void rbuInitPhaseOneSteps(sqlite3rbu *p){ @@ -3449,10 +3449,10 @@ static void rbuInitPhaseOneSteps(sqlite3rbu *p){ p->nPhaseOneStep = -1; - p->rc = sqlite3_create_function(p->dbRbu, + p->rc = sqlite3_create_function(p->dbRbu, "rbu_index_cnt", 1, SQLITE_UTF8, (void*)p, rbuIndexCntFunc, 0, 0 ); - + /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if( p->rc==SQLITE_OK ){ @@ -3466,7 +3466,7 @@ static void rbuInitPhaseOneSteps(sqlite3rbu *p){ } p->rc = sqlite3_finalize(pStmt); } - + if( p->rc==SQLITE_OK && bExists ){ p->rc = prepareAndCollectError(p->dbRbu, &pStmt, &p->zErrmsg, "SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))" @@ -3484,7 +3484,7 @@ static void rbuInitPhaseOneSteps(sqlite3rbu *p){ static sqlite3rbu *openRbuHandle( - const char *zTarget, + const char *zTarget, const char *zRbu, const char *zState ){ @@ -3522,7 +3522,7 @@ static sqlite3rbu *openRbuHandle( ** to be a wal-mode db. But, this may have happened due to an earlier ** RBU vacuum operation leaving an old wal file in the directory. ** If this is the case, it will have been checkpointed and deleted - ** when the handle was closed and a second attempt to open the + ** when the handle was closed and a second attempt to open the ** database may succeed. */ rbuOpenDatabase(p, &bRetry); if( bRetry ){ @@ -3535,7 +3535,7 @@ static sqlite3rbu *openRbuHandle( assert( pState || p->rc!=SQLITE_OK ); if( p->rc==SQLITE_OK ){ - if( pState->eStage==0 ){ + if( pState->eStage==0 ){ rbuDeleteOalFile(p); rbuInitPhaseOneSteps(p); p->eStage = RBU_STAGE_OAL; @@ -3559,15 +3559,15 @@ static sqlite3rbu *openRbuHandle( } } - if( p->rc==SQLITE_OK + if( p->rc==SQLITE_OK && (p->eStage==RBU_STAGE_OAL || p->eStage==RBU_STAGE_MOVE) && pState->eStage!=0 ){ rbu_file *pFd = (rbuIsVacuum(p) ? p->pRbuFd : p->pTargetFd); - if( pFd->iCookie!=pState->iCookie ){ + if( pFd->iCookie!=pState->iCookie ){ /* At this point (pTargetFd->iCookie) contains the value of the - ** change-counter cookie (the thing that gets incremented when a - ** transaction is committed in rollback mode) currently stored on + ** change-counter cookie (the thing that gets incremented when a + ** transaction is committed in rollback mode) currently stored on ** page 1 of the database file. */ p->rc = SQLITE_BUSY; p->zErrmsg = sqlite3_mprintf("database modified during rbu %s", @@ -3604,7 +3604,7 @@ static sqlite3rbu *openRbuHandle( } /* Check if the main database is a zipvfs db. If it is, set the upper - ** level pager to use "journal_mode=off". This prevents it from + ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if( p->rc==SQLITE_OK ){ int frc = sqlite3_file_control(db, "main", SQLITE_FCNTL_ZIPVFS, 0); @@ -3650,10 +3650,10 @@ static sqlite3rbu *rbuMisuseError(void){ } /* -** Open and return a new RBU handle. +** Open and return a new RBU handle. */ sqlite3rbu *sqlite3rbu_open( - const char *zTarget, + const char *zTarget, const char *zRbu, const char *zState ){ @@ -3666,7 +3666,7 @@ sqlite3rbu *sqlite3rbu_open( ** Open a handle to begin or resume an RBU VACUUM operation. */ sqlite3rbu *sqlite3rbu_vacuum( - const char *zTarget, + const char *zTarget, const char *zState ){ if( zTarget==0 ){ return rbuMisuseError(); } @@ -3728,8 +3728,8 @@ int sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){ rbuObjIterFinalize(&p->objiter); /* If this is an RBU vacuum handle and the vacuum has either finished - ** successfully or encountered an error, delete the contents of the - ** state table. This causes the next call to sqlite3rbu_vacuum() + ** successfully or encountered an error, delete the contents of the + ** state table. This causes the next call to sqlite3rbu_vacuum() ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if( rbuIsVacuum(p) && p->rc!=SQLITE_OK && p->dbRbu ){ @@ -3757,7 +3757,7 @@ int sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){ } /* -** Return the total number of key-value operations (inserts, deletes or +** Return the total number of key-value operations (inserts, deletes or ** updates) that have been performed on the target database since the ** current RBU update was started. */ @@ -3861,7 +3861,7 @@ int sqlite3rbu_savestate(sqlite3rbu *p){ ** Beginning of RBU VFS shim methods. The VFS shim modifies the behaviour ** of a standard VFS in the following ways: ** -** 1. Whenever the first page of a main database file is read or +** 1. Whenever the first page of a main database file is read or ** written, the value of the change-counter cookie is stored in ** rbu_file.iCookie. Similarly, the value of the "write-version" ** database header field is stored in rbu_file.iWriteVer. This ensures @@ -3869,15 +3869,15 @@ int sqlite3rbu_savestate(sqlite3rbu *p){ ** ** 2. Whenever an SQLITE_OPEN_WAL file is opened, the (rbu_file.pWalFd) ** member variable of the associated database file descriptor is set -** to point to the new file. A mutex protected linked list of all main -** db fds opened using a particular RBU VFS is maintained at +** to point to the new file. A mutex protected linked list of all main +** db fds opened using a particular RBU VFS is maintained at ** rbu_vfs.pMain to facilitate this. ** -** 3. Using a new file-control "SQLITE_FCNTL_RBU", a main db rbu_file +** 3. Using a new file-control "SQLITE_FCNTL_RBU", a main db rbu_file ** object can be marked as the target database of an RBU update. This ** turns on the following extra special behaviour: ** -** 3a. If xAccess() is called to check if there exists a *-wal file +** 3a. If xAccess() is called to check if there exists a *-wal file ** associated with an RBU target database currently in RBU_STAGE_OAL ** stage (preparing the *-oal file), the following special handling ** applies: @@ -3890,26 +3890,26 @@ int sqlite3rbu_savestate(sqlite3rbu *p){ ** ** Then, when xOpen() is called to open the *-wal file associated with ** the RBU target in RBU_STAGE_OAL stage, instead of opening the *-wal -** file, the rbu vfs opens the corresponding *-oal file instead. +** file, the rbu vfs opens the corresponding *-oal file instead. ** ** 3b. The *-shm pages returned by xShmMap() for a target db file in ** RBU_STAGE_OAL mode are actually stored in heap memory. This is to ** avoid creating a *-shm file on disk. Additionally, xShmLock() calls ** are no-ops on target database files in RBU_STAGE_OAL mode. This is -** because assert() statements in some VFS implementations fail if +** because assert() statements in some VFS implementations fail if ** xShmLock() is called before xShmMap(). ** ** 3c. If an EXCLUSIVE lock is attempted on a target database file in any -** mode except RBU_STAGE_DONE (all work completed and checkpointed), it +** mode except RBU_STAGE_DONE (all work completed and checkpointed), it ** fails with an SQLITE_BUSY error. This is to stop RBU connections ** from automatically checkpointing a *-wal (or *-oal) file from within ** sqlite3_close(). ** ** 3d. In RBU_STAGE_CAPTURE mode, all xRead() calls on the wal file, and -** all xWrite() calls on the target database file perform no IO. +** all xWrite() calls on the target database file perform no IO. ** Instead the frame and page numbers that would be read and written ** are recorded. Additionally, successful attempts to obtain exclusive -** xShmLock() WRITER, CHECKPOINTER and READ0 locks on the target +** xShmLock() WRITER, CHECKPOINTER and READ0 locks on the target ** database file are recorded. xShmLock() calls to unlock the same ** locks are no-ops (so that once obtained, these locks are never ** relinquished). Finally, calls to xSync() on the target database @@ -3962,7 +3962,7 @@ static int rbuVfsClose(sqlite3_file *pFile){ /* -** Read and return an unsigned 32-bit big-endian integer from the buffer +** Read and return an unsigned 32-bit big-endian integer from the buffer ** passed as the only argument. */ static u32 rbuGetU32(u8 *aBuf){ @@ -3992,9 +3992,9 @@ static void rbuPutU16(u8 *aBuf, u16 iVal){ ** Read data from an rbuVfs-file. */ static int rbuVfsRead( - sqlite3_file *pFile, - void *zBuf, - int iAmt, + sqlite3_file *pFile, + void *zBuf, + int iAmt, sqlite_int64 iOfst ){ rbu_file *p = (rbu_file*)pFile; @@ -4005,20 +4005,20 @@ static int rbuVfsRead( assert( p->openFlags & SQLITE_OPEN_WAL ); rc = rbuCaptureWalRead(p->pRbu, iOfst, iAmt); }else{ - if( pRbu && pRbu->eStage==RBU_STAGE_OAL - && (p->openFlags & SQLITE_OPEN_WAL) - && iOfst>=pRbu->iOalSz + if( pRbu && pRbu->eStage==RBU_STAGE_OAL + && (p->openFlags & SQLITE_OPEN_WAL) + && iOfst>=pRbu->iOalSz ){ rc = SQLITE_OK; memset(zBuf, 0, iAmt); }else{ rc = p->pReal->pMethods->xRead(p->pReal, zBuf, iAmt, iOfst); #if 1 - /* If this is being called to read the first page of the target - ** database as part of an rbu vacuum operation, synthesize the + /* If this is being called to read the first page of the target + ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ - if( pRbu && rbuIsVacuum(pRbu) + if( pRbu && rbuIsVacuum(pRbu) && rc==SQLITE_IOERR_SHORT_READ && iOfst==0 && (p->openFlags & SQLITE_OPEN_MAIN_DB) && pRbu->rc==SQLITE_OK @@ -4058,9 +4058,9 @@ static int rbuVfsRead( ** Write data to an rbuVfs-file. */ static int rbuVfsWrite( - sqlite3_file *pFile, - const void *zBuf, - int iAmt, + sqlite3_file *pFile, + const void *zBuf, + int iAmt, sqlite_int64 iOfst ){ rbu_file *p = (rbu_file*)pFile; @@ -4071,8 +4071,8 @@ static int rbuVfsWrite( assert( p->openFlags & SQLITE_OPEN_MAIN_DB ); rc = rbuCaptureDbWrite(p->pRbu, iOfst); }else{ - if( pRbu && pRbu->eStage==RBU_STAGE_OAL - && (p->openFlags & SQLITE_OPEN_WAL) + if( pRbu && pRbu->eStage==RBU_STAGE_OAL + && (p->openFlags & SQLITE_OPEN_WAL) && iOfst>=pRbu->iOalSz ){ pRbu->iOalSz = iAmt + iOfst; @@ -4121,10 +4121,10 @@ static int rbuVfsFileSize(sqlite3_file *pFile, sqlite_int64 *pSize){ /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existance of a *-wal file. rbuVfsRead() contains ** similar logic. */ - if( rc==SQLITE_OK && *pSize==0 - && p->pRbu && rbuIsVacuum(p->pRbu) + if( rc==SQLITE_OK && *pSize==0 + && p->pRbu && rbuIsVacuum(p->pRbu) && (p->openFlags & SQLITE_OPEN_MAIN_DB) ){ *pSize = 1024; @@ -4141,10 +4141,10 @@ static int rbuVfsLock(sqlite3_file *pFile, int eLock){ int rc = SQLITE_OK; assert( p->openFlags & (SQLITE_OPEN_MAIN_DB|SQLITE_OPEN_TEMP_DB) ); - if( eLock==SQLITE_LOCK_EXCLUSIVE + if( eLock==SQLITE_LOCK_EXCLUSIVE && (p->bNolock || (pRbu && pRbu->eStage!=RBU_STAGE_DONE)) ){ - /* Do not allow EXCLUSIVE locks. Preventing SQLite from taking this + /* Do not allow EXCLUSIVE locks. Preventing SQLite from taking this ** prevents it from checkpointing the database from sqlite3_close(). */ rc = SQLITE_BUSY; }else{ @@ -4256,8 +4256,8 @@ static int rbuVfsShmLock(sqlite3_file *pFile, int ofst, int n, int flags){ assert( p->openFlags & (SQLITE_OPEN_MAIN_DB|SQLITE_OPEN_TEMP_DB) ); if( pRbu && (pRbu->eStage==RBU_STAGE_OAL || pRbu->eStage==RBU_STAGE_MOVE) ){ /* Magic number 1 is the WAL_CKPT_LOCK lock. Preventing SQLite from - ** taking this lock also prevents any checkpoints from occurring. - ** todo: really, it's not clear why this might occur, as + ** taking this lock also prevents any checkpoints from occurring. + ** todo: really, it's not clear why this might occur, as ** wal_autocheckpoint ought to be turned off. */ if( ofst==WAL_LOCK_CKPT && n==1 ) rc = SQLITE_BUSY; }else{ @@ -4284,10 +4284,10 @@ static int rbuVfsShmLock(sqlite3_file *pFile, int ofst, int n, int flags){ ** Obtain a pointer to a mapping of a single 32KiB page of the *-shm file. */ static int rbuVfsShmMap( - sqlite3_file *pFile, - int iRegion, - int szRegion, - int isWrite, + sqlite3_file *pFile, + int iRegion, + int szRegion, + int isWrite, void volatile **pp ){ rbu_file *p = (rbu_file*)pFile; @@ -4295,7 +4295,7 @@ static int rbuVfsShmMap( int eStage = (p->pRbu ? p->pRbu->eStage : 0); /* If not in RBU_STAGE_OAL, allow this call to pass through. Or, if this - ** rbu is in the RBU_STAGE_OAL state, use heap memory for *-shm space + ** rbu is in the RBU_STAGE_OAL state, use heap memory for *-shm space ** instead of a file on disk. */ assert( p->openFlags & (SQLITE_OPEN_MAIN_DB|SQLITE_OPEN_TEMP_DB) ); if( eStage==RBU_STAGE_OAL || eStage==RBU_STAGE_MOVE ){ @@ -4362,7 +4362,7 @@ static int rbuVfsShmUnmap(sqlite3_file *pFile, int delFlag){ } /* -** Given that zWal points to a buffer containing a wal file name passed to +** Given that zWal points to a buffer containing a wal file name passed to ** either the xOpen() or xAccess() VFS method, return a pointer to the ** file-handle opened by the same database connection on the corresponding ** database file. @@ -4375,12 +4375,12 @@ static rbu_file *rbuFindMaindb(rbu_vfs *pRbuVfs, const char *zWal){ return pDb; } -/* -** A main database named zName has just been opened. The following +/* +** A main database named zName has just been opened. The following ** function returns a pointer to a buffer owned by SQLite that contains ** the name of the *-wal file this db connection will use. SQLite ** happens to pass a pointer to this buffer when using xAccess() -** or xOpen() to operate on the *-wal file. +** or xOpen() to operate on the *-wal file. */ static const char *rbuMainToWal(const char *zName, int flags){ int n = (int)strlen(zName); @@ -4458,7 +4458,7 @@ static int rbuVfsOpen( if( pDb->pRbu && pDb->pRbu->eStage==RBU_STAGE_OAL ){ /* This call is to open a *-wal file. Intead, open the *-oal. This ** code ensures that the string passed to xOpen() is terminated by a - ** pair of '\0' bytes in case the VFS attempts to extract a URI + ** pair of '\0' bytes in case the VFS attempts to extract a URI ** parameter from it. */ const char *zBase = zName; size_t nCopy; @@ -4485,8 +4485,8 @@ static int rbuVfsOpen( } } - if( oflags & SQLITE_OPEN_MAIN_DB - && sqlite3_uri_boolean(zName, "rbu_memory", 0) + if( oflags & SQLITE_OPEN_MAIN_DB + && sqlite3_uri_boolean(zName, "rbu_memory", 0) ){ assert( oflags & SQLITE_OPEN_MAIN_DB ); oflags = SQLITE_OPEN_TEMP_DB | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | @@ -4528,9 +4528,9 @@ static int rbuVfsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ ** is available, or false otherwise. */ static int rbuVfsAccess( - sqlite3_vfs *pVfs, - const char *zPath, - int flags, + sqlite3_vfs *pVfs, + const char *zPath, + int flags, int *pResOut ){ rbu_vfs *pRbuVfs = (rbu_vfs*)pVfs; @@ -4546,7 +4546,7 @@ static int rbuVfsAccess( ** a) if the *-wal file does exist, return SQLITE_CANTOPEN. This ** ensures that the RBU extension never tries to update a database ** in wal mode, even if the first page of the database file has - ** been damaged. + ** been damaged. ** ** b) if the *-wal file does not exist, claim that it does anyway, ** causing SQLite to call xOpen() to open it. This call will also @@ -4573,9 +4573,9 @@ static int rbuVfsAccess( ** of at least (DEVSYM_MAX_PATHNAME+1) bytes. */ static int rbuVfsFullPathname( - sqlite3_vfs *pVfs, - const char *zPath, - int nOut, + sqlite3_vfs *pVfs, + const char *zPath, + int nOut, char *zOut ){ sqlite3_vfs *pRealVfs = ((rbu_vfs*)pVfs)->pRealVfs; @@ -4593,7 +4593,7 @@ static void *rbuVfsDlOpen(sqlite3_vfs *pVfs, const char *zPath){ /* ** Populate the buffer zErrMsg (size nByte bytes) with a human readable -** utf-8 string describing the most recent error encountered associated +** utf-8 string describing the most recent error encountered associated ** with dynamic libraries. */ static void rbuVfsDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){ @@ -4605,8 +4605,8 @@ static void rbuVfsDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){ ** Return a pointer to the symbol zSymbol in the dynamic library pHandle. */ static void (*rbuVfsDlSym( - sqlite3_vfs *pVfs, - void *pArg, + sqlite3_vfs *pVfs, + void *pArg, const char *zSym ))(void){ sqlite3_vfs *pRealVfs = ((rbu_vfs*)pVfs)->pRealVfs; @@ -4623,7 +4623,7 @@ static void rbuVfsDlClose(sqlite3_vfs *pVfs, void *pHandle){ #endif /* SQLITE_OMIT_LOAD_EXTENSION */ /* -** Populate the buffer pointed to by zBufOut with nByte bytes of +** Populate the buffer pointed to by zBufOut with nByte bytes of ** random data. */ static int rbuVfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ @@ -4632,7 +4632,7 @@ static int rbuVfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ } /* -** Sleep for nMicro microseconds. Return the number of microseconds +** Sleep for nMicro microseconds. Return the number of microseconds ** actually slept. */ static int rbuVfsSleep(sqlite3_vfs *pVfs, int nMicro){ diff --git a/third_party/sqlite/src/ext/rbu/sqlite3rbu.h b/third_party/sqlite/src/ext/rbu/sqlite3rbu.h index 12112c14e191f..5ca14bf962fc3 100644 --- a/third_party/sqlite/src/ext/rbu/sqlite3rbu.h +++ b/third_party/sqlite/src/ext/rbu/sqlite3rbu.h @@ -10,42 +10,42 @@ ** ************************************************************************* ** -** This file contains the public interface for the RBU extension. +** This file contains the public interface for the RBU extension. */ /* ** SUMMARY ** -** Writing a transaction containing a large number of operations on +** Writing a transaction containing a large number of operations on ** b-tree indexes that are collectively larger than the available cache -** memory can be very inefficient. +** memory can be very inefficient. ** ** The problem is that in order to update a b-tree, the leaf page (at least) ** containing the entry being inserted or deleted must be modified. If the -** working set of leaves is larger than the available cache memory, then a -** single leaf that is modified more than once as part of the transaction +** working set of leaves is larger than the available cache memory, then a +** single leaf that is modified more than once as part of the transaction ** may be loaded from or written to the persistent media multiple times. ** Additionally, because the index updates are likely to be applied in -** random order, access to pages within the database is also likely to be in +** random order, access to pages within the database is also likely to be in ** random order, which is itself quite inefficient. ** ** One way to improve the situation is to sort the operations on each index ** by index key before applying them to the b-tree. This leads to an IO ** pattern that resembles a single linear scan through the index b-tree, -** and all but guarantees each modified leaf page is loaded and stored +** and all but guarantees each modified leaf page is loaded and stored ** exactly once. SQLite uses this trick to improve the performance of ** CREATE INDEX commands. This extension allows it to be used to improve ** the performance of large transactions on existing databases. ** -** Additionally, this extension allows the work involved in writing the -** large transaction to be broken down into sub-transactions performed -** sequentially by separate processes. This is useful if the system cannot -** guarantee that a single update process will run for long enough to apply -** the entire update, for example because the update is being applied on a -** mobile device that is frequently rebooted. Even after the writer process +** Additionally, this extension allows the work involved in writing the +** large transaction to be broken down into sub-transactions performed +** sequentially by separate processes. This is useful if the system cannot +** guarantee that a single update process will run for long enough to apply +** the entire update, for example because the update is being applied on a +** mobile device that is frequently rebooted. Even after the writer process ** has committed one or more sub-transactions, other database clients continue -** to read from the original database snapshot. In other words, partially -** applied transactions are not visible to other clients. +** to read from the original database snapshot. In other words, partially +** applied transactions are not visible to other clients. ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction @@ -61,9 +61,9 @@ ** ** * INSERT statements may not use any default values. ** -** * UPDATE and DELETE statements must identify their target rows by +** * UPDATE and DELETE statements must identify their target rows by ** non-NULL PRIMARY KEY values. Rows with NULL values stored in PRIMARY -** KEY fields may not be updated or deleted. If the table being written +** KEY fields may not be updated or deleted. If the table being written ** has no PRIMARY KEY, affected rows must be identified by rowid. ** ** * UPDATE statements may not modify PRIMARY KEY columns. @@ -80,10 +80,10 @@ ** PREPARATION ** ** An "RBU update" is stored as a separate SQLite database. A database -** containing an RBU update is an "RBU database". For each table in the +** containing an RBU update is an "RBU database". For each table in the ** target database to be updated, the RBU database should contain a table ** named "data_" containing the same set of columns as the -** target table, and one more - "rbu_control". The data_% table should +** target table, and one more - "rbu_control". The data_% table should ** have no PRIMARY KEY or UNIQUE constraints, but each column should have ** the same type as the corresponding column in the target database. ** The "rbu_control" column should have no type at all. For example, if @@ -98,22 +98,22 @@ ** The order of the columns in the data_% table does not matter. ** ** Instead of a regular table, the RBU database may also contain virtual -** tables or view named using the data_ naming scheme. +** tables or view named using the data_ naming scheme. ** -** Instead of the plain data_ naming scheme, RBU database tables +** Instead of the plain data_ naming scheme, RBU database tables ** may also be named data_, where is any sequence ** of zero or more numeric characters (0-9). This can be significant because -** tables within the RBU database are always processed in order sorted by +** tables within the RBU database are always processed in order sorted by ** name. By judicious selection of the portion of the names ** of the RBU tables the user can therefore control the order in which they ** are processed. This can be useful, for example, to ensure that "external ** content" FTS4 tables are updated before their underlying content tables. ** ** If the target database table is a virtual table or a table that has no -** PRIMARY KEY declaration, the data_% table must also contain a column -** named "rbu_rowid". This column is mapped to the tables implicit primary -** key column - "rowid". Virtual tables for which the "rowid" column does -** not function like a primary key value cannot be updated using RBU. For +** PRIMARY KEY declaration, the data_% table must also contain a column +** named "rbu_rowid". This column is mapped to the tables implicit primary +** key column - "rowid". Virtual tables for which the "rowid" column does +** not function like a primary key value cannot be updated using RBU. For ** example, if the target db contains either of the following: ** ** CREATE VIRTUAL TABLE x1 USING fts3(a, b); @@ -136,35 +136,35 @@ ** CREATE TABLE data_ft1(a, b, langid, rbu_rowid, rbu_control); ** CREATE TABLE data_ft1(a, b, rbu_rowid, rbu_control); ** -** For each row to INSERT into the target database as part of the RBU +** For each row to INSERT into the target database as part of the RBU ** update, the corresponding data_% table should contain a single record ** with the "rbu_control" column set to contain integer value 0. The -** other columns should be set to the values that make up the new record -** to insert. +** other columns should be set to the values that make up the new record +** to insert. ** -** If the target database table has an INTEGER PRIMARY KEY, it is not -** possible to insert a NULL value into the IPK column. Attempting to +** If the target database table has an INTEGER PRIMARY KEY, it is not +** possible to insert a NULL value into the IPK column. Attempting to ** do so results in an SQLITE_MISMATCH error. ** -** For each row to DELETE from the target database as part of the RBU +** For each row to DELETE from the target database as part of the RBU ** update, the corresponding data_% table should contain a single record ** with the "rbu_control" column set to contain integer value 1. The ** real primary key values of the row to delete should be stored in the ** corresponding columns of the data_% table. The values stored in the ** other columns are not used. ** -** For each row to UPDATE from the target database as part of the RBU +** For each row to UPDATE from the target database as part of the RBU ** update, the corresponding data_% table should contain a single record ** with the "rbu_control" column set to contain a value of type text. -** The real primary key values identifying the row to update should be +** The real primary key values identifying the row to update should be ** stored in the corresponding columns of the data_% table row, as should -** the new values of all columns being update. The text value in the +** the new values of all columns being update. The text value in the ** "rbu_control" column must contain the same number of characters as ** there are columns in the target database table, and must consist entirely -** of 'x' and '.' characters (or in some special cases 'd' - see below). For +** of 'x' and '.' characters (or in some special cases 'd' - see below). For ** each column that is being updated, the corresponding character is set to ** 'x'. For those that remain as they are, the corresponding character of the -** rbu_control value should be set to '.'. For example, given the tables +** rbu_control value should be set to '.'. For example, given the tables ** above, the update statement: ** ** UPDATE t1 SET c = 'usa' WHERE a = 4; @@ -178,30 +178,30 @@ ** target table with the value stored in the corresponding data_% column, the ** user-defined SQL function "rbu_delta()" is invoked and the result stored in ** the target table column. rbu_delta() is invoked with two arguments - the -** original value currently stored in the target table column and the +** original value currently stored in the target table column and the ** value specified in the data_xxx table. ** ** For example, this row: ** ** INSERT INTO data_t1(a, b, c, rbu_control) VALUES(4, NULL, 'usa', '..d'); ** -** is similar to an UPDATE statement such as: +** is similar to an UPDATE statement such as: ** ** UPDATE t1 SET c = rbu_delta(c, 'usa') WHERE a = 4; ** -** Finally, if an 'f' character appears in place of a 'd' or 's' in an +** Finally, if an 'f' character appears in place of a 'd' or 's' in an ** ota_control string, the contents of the data_xxx table column is assumed ** to be a "fossil delta" - a patch to be applied to a blob value in the ** format used by the fossil source-code management system. In this case -** the existing value within the target database table must be of type BLOB. +** the existing value within the target database table must be of type BLOB. ** It is replaced by the result of applying the specified fossil delta to ** itself. ** ** If the target database table is a virtual table or a table with no PRIMARY -** KEY, the rbu_control value should not include a character corresponding +** KEY, the rbu_control value should not include a character corresponding ** to the rbu_rowid value. For example, this: ** -** INSERT INTO data_ft1(a, b, rbu_rowid, rbu_control) +** INSERT INTO data_ft1(a, b, rbu_rowid, rbu_control) ** VALUES(NULL, 'usa', 12, '.x'); ** ** causes a result similar to: @@ -211,14 +211,14 @@ ** The data_xxx tables themselves should have no PRIMARY KEY declarations. ** However, RBU is more efficient if reading the rows in from each data_xxx ** table in "rowid" order is roughly the same as reading them sorted by -** the PRIMARY KEY of the corresponding target database table. In other -** words, rows should be sorted using the destination table PRIMARY KEY +** the PRIMARY KEY of the corresponding target database table. In other +** words, rows should be sorted using the destination table PRIMARY KEY ** fields before they are inserted into the data_xxx tables. ** ** USAGE ** -** The API declared below allows an application to apply an RBU update -** stored on disk to an existing target database. Essentially, the +** The API declared below allows an application to apply an RBU update +** stored on disk to an existing target database. Essentially, the ** application: ** ** 1) Opens an RBU handle using the sqlite3rbu_open() function. @@ -229,24 +229,24 @@ ** ** 3) Calls the sqlite3rbu_step() function one or more times on ** the new handle. Each call to sqlite3rbu_step() performs a single -** b-tree operation, so thousands of calls may be required to apply +** b-tree operation, so thousands of calls may be required to apply ** a complete update. ** ** 4) Calls sqlite3rbu_close() to close the RBU update handle. If ** sqlite3rbu_step() has been called enough times to completely ** apply the update to the target database, then the RBU database -** is marked as fully applied. Otherwise, the state of the RBU -** update application is saved in the RBU database for later +** is marked as fully applied. Otherwise, the state of the RBU +** update application is saved in the RBU database for later ** resumption. ** ** See comments below for more detail on APIs. ** ** If an update is only partially applied to the target database by the -** time sqlite3rbu_close() is called, various state information is saved +** time sqlite3rbu_close() is called, various state information is saved ** within the RBU database. This allows subsequent processes to automatically ** resume the RBU update from where it left off. ** -** To remove all RBU extension state information, returning an RBU database +** To remove all RBU extension state information, returning an RBU database ** to its original contents, it is sufficient to drop all tables that begin ** with the prefix "rbu_" ** @@ -282,21 +282,21 @@ typedef struct sqlite3rbu sqlite3rbu; ** the path to the RBU database. Each call to this function must be matched ** by a call to sqlite3rbu_close(). When opening the databases, RBU passes ** the SQLITE_CONFIG_URI flag to sqlite3_open_v2(). So if either zTarget -** or zRbu begin with "file:", it will be interpreted as an SQLite +** or zRbu begin with "file:", it will be interpreted as an SQLite ** database URI, not a regular file name. ** -** If the zState argument is passed a NULL value, the RBU extension stores -** the current state of the update (how many rows have been updated, which +** If the zState argument is passed a NULL value, the RBU extension stores +** the current state of the update (how many rows have been updated, which ** indexes are yet to be updated etc.) within the RBU database itself. This ** can be convenient, as it means that the RBU application does not need to -** organize removing a separate state file after the update is concluded. -** Or, if zState is non-NULL, it must be a path to a database file in which +** organize removing a separate state file after the update is concluded. +** Or, if zState is non-NULL, it must be a path to a database file in which ** the RBU extension can store the state of the update. ** ** When resuming an RBU update, the zState argument must be passed the same ** value as when the RBU update was started. ** -** Once the RBU update is finished, the RBU extension does not +** Once the RBU update is finished, the RBU extension does not ** automatically remove any zState database file, even if it created it. ** ** By default, RBU uses the default VFS to access the files on disk. To @@ -309,7 +309,7 @@ typedef struct sqlite3rbu sqlite3rbu; ** the zipvfs_create_vfs() API below for details on using RBU with zipvfs. */ sqlite3rbu *sqlite3rbu_open( - const char *zTarget, + const char *zTarget, const char *zRbu, const char *zState ); @@ -319,13 +319,13 @@ sqlite3rbu *sqlite3rbu_open( ** An RBU vacuum is similar to SQLite's built-in VACUUM command, except ** that it can be suspended and resumed like an RBU update. ** -** The second argument to this function identifies a database in which -** to store the state of the RBU vacuum operation if it is suspended. The +** The second argument to this function identifies a database in which +** to store the state of the RBU vacuum operation if it is suspended. The ** first time sqlite3rbu_vacuum() is called, to start an RBU vacuum ** operation, the state database should either not exist or be empty -** (contain no tables). If an RBU vacuum is suspended by calling +** (contain no tables). If an RBU vacuum is suspended by calling ** sqlite3rbu_close() on the RBU handle before sqlite3rbu_step() has -** returned SQLITE_DONE, the vacuum state is stored in the state database. +** returned SQLITE_DONE, the vacuum state is stored in the state database. ** The vacuum can be resumed by calling this function to open a new RBU ** handle specifying the same target and state databases. ** @@ -339,21 +339,21 @@ sqlite3rbu *sqlite3rbu_open( ** is completed, even if it created it. However, if the call to ** sqlite3rbu_close() returns any value other than SQLITE_OK, the contents ** of the state tables within the state database are zeroed. This way, -** the next call to sqlite3rbu_vacuum() opens a handle that starts a +** the next call to sqlite3rbu_vacuum() opens a handle that starts a ** new RBU vacuum operation. ** ** As with sqlite3rbu_open(), Zipvfs users should rever to the comment -** describing the sqlite3rbu_create_vfs() API function below for -** a description of the complications associated with using RBU with +** describing the sqlite3rbu_create_vfs() API function below for +** a description of the complications associated with using RBU with ** zipvfs databases. */ sqlite3rbu *sqlite3rbu_vacuum( - const char *zTarget, + const char *zTarget, const char *zState ); /* -** Internally, each RBU connection uses a separate SQLite database +** Internally, each RBU connection uses a separate SQLite database ** connection to access the target and rbu update databases. This ** API allows the application direct access to these database handles. ** @@ -364,10 +364,10 @@ sqlite3rbu *sqlite3rbu_vacuum( ** following scenarios: ** ** * If any target tables are virtual tables, it may be necessary to -** call sqlite3_create_module() on the target database handle to +** call sqlite3_create_module() on the target database handle to ** register the required virtual table implementations. ** -** * If the data_xxx tables in the RBU source database are virtual +** * If the data_xxx tables in the RBU source database are virtual ** tables, the application may need to call sqlite3_create_module() on ** the rbu update db handle to any required virtual table ** implementations. @@ -386,12 +386,12 @@ sqlite3rbu *sqlite3rbu_vacuum( sqlite3 *sqlite3rbu_db(sqlite3rbu*, int bRbu); /* -** Do some work towards applying the RBU update to the target db. +** Do some work towards applying the RBU update to the target db. ** -** Return SQLITE_DONE if the update has been completely applied, or +** Return SQLITE_DONE if the update has been completely applied, or ** SQLITE_OK if no error occurs but there remains work to do to apply -** the RBU update. If an error does occur, some other error code is -** returned. +** the RBU update. If an error does occur, some other error code is +** returned. ** ** Once a call to sqlite3rbu_step() has returned a value other than ** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops @@ -404,7 +404,7 @@ int sqlite3rbu_step(sqlite3rbu *pRbu); ** ** If a power failure or application crash occurs during an update, following ** system recovery RBU may resume the update from the point at which the state -** was last saved. In other words, from the most recent successful call to +** was last saved. In other words, from the most recent successful call to ** sqlite3rbu_close() or this function. ** ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. @@ -412,7 +412,7 @@ int sqlite3rbu_step(sqlite3rbu *pRbu); int sqlite3rbu_savestate(sqlite3rbu *pRbu); /* -** Close an RBU handle. +** Close an RBU handle. ** ** If the RBU update has been completely applied, mark the RBU database ** as fully applied. Otherwise, assuming no error has occurred, save the @@ -422,24 +422,24 @@ int sqlite3rbu_savestate(sqlite3rbu *pRbu); ** or sqlite3rbu_open() call, or if one occurs within this function, an ** SQLite error code is returned. Additionally, *pzErrmsg may be set to ** point to a buffer containing a utf-8 formatted English language error -** message. It is the responsibility of the caller to eventually free any +** message. It is the responsibility of the caller to eventually free any ** such buffer using sqlite3_free(). ** ** Otherwise, if no error occurs, this function returns SQLITE_OK if the -** update has been partially applied, or SQLITE_DONE if it has been +** update has been partially applied, or SQLITE_DONE if it has been ** completely applied. */ int sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg); /* -** Return the total number of key-value operations (inserts, deletes or +** Return the total number of key-value operations (inserts, deletes or ** updates) that have been performed on the target database since the ** current RBU update was started. */ sqlite3_int64 sqlite3rbu_progress(sqlite3rbu *pRbu); /* -** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100) +** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100) ** progress indications for the two stages of an RBU update. This API may ** be useful for driving GUI progress indicators and similar. ** @@ -452,16 +452,16 @@ sqlite3_int64 sqlite3rbu_progress(sqlite3rbu *pRbu); ** The update is visible to non-RBU clients during stage 2. During stage 1 ** non-RBU reader clients may see the original database. ** -** If this API is called during stage 2 of the update, output variable +** If this API is called during stage 2 of the update, output variable ** (*pnOne) is set to 10000 to indicate that stage 1 has finished and (*pnTwo) ** to a value between 0 and 10000 to indicate the permyriadage progress of -** stage 2. A value of 5000 indicates that stage 2 is half finished, +** stage 2. A value of 5000 indicates that stage 2 is half finished, ** 9000 indicates that it is 90% finished, and so on. ** -** If this API is called during stage 1 of the update, output variable +** If this API is called during stage 1 of the update, output variable ** (*pnTwo) is set to 0 to indicate that stage 2 has not yet started. The -** value to which (*pnOne) is set depends on whether or not the RBU -** database contains an "rbu_count" table. The rbu_count table, if it +** value to which (*pnOne) is set depends on whether or not the RBU +** database contains an "rbu_count" table. The rbu_count table, if it ** exists, must contain the same columns as the following: ** ** CREATE TABLE rbu_count(tbl TEXT PRIMARY KEY, cnt INTEGER) WITHOUT ROWID; @@ -520,20 +520,20 @@ int sqlite3rbu_state(sqlite3rbu *pRbu); /* ** Create an RBU VFS named zName that accesses the underlying file-system -** via existing VFS zParent. Or, if the zParent parameter is passed NULL, +** via existing VFS zParent. Or, if the zParent parameter is passed NULL, ** then the new RBU VFS uses the default system VFS to access the file-system. -** The new object is registered as a non-default VFS with SQLite before +** The new object is registered as a non-default VFS with SQLite before ** returning. ** ** Part of the RBU implementation uses a custom VFS object. Usually, this -** object is created and deleted automatically by RBU. +** object is created and deleted automatically by RBU. ** ** The exception is for applications that also use zipvfs. In this case, ** the custom VFS must be explicitly created by the user before the RBU ** handle is opened. The RBU VFS should be installed so that the zipvfs -** VFS uses the RBU VFS, which in turn uses any other VFS layers in use +** VFS uses the RBU VFS, which in turn uses any other VFS layers in use ** (for example multiplexor) to access the file-system. For example, -** to assemble an RBU enabled VFS stack that uses both zipvfs and +** to assemble an RBU enabled VFS stack that uses both zipvfs and ** multiplexor (error checking omitted): ** ** // Create a VFS named "multiplex" (not the default). @@ -555,9 +555,9 @@ int sqlite3rbu_state(sqlite3rbu *pRbu); ** may be used by RBU clients. Attempting to use RBU with a zipvfs VFS stack ** that does not include the RBU layer results in an error. ** -** The overhead of adding the "rbu" VFS to the system is negligible for -** non-RBU users. There is no harm in an application accessing the -** file-system via "rbu" all the time, even if it only uses RBU functionality +** The overhead of adding the "rbu" VFS to the system is negligible for +** non-RBU users. There is no harm in an application accessing the +** file-system via "rbu" all the time, even if it only uses RBU functionality ** occasionally. */ int sqlite3rbu_create_vfs(const char *zName, const char *zParent); diff --git a/third_party/sqlite/src/ext/rbu/test_rbu.c b/third_party/sqlite/src/ext/rbu/test_rbu.c index b1a2252741ee0..6effee35ca141 100644 --- a/third_party/sqlite/src/ext/rbu/test_rbu.c +++ b/third_party/sqlite/src/ext/rbu/test_rbu.c @@ -27,7 +27,7 @@ #endif #include -/* From main.c */ +/* From main.c */ extern const char *sqlite3ErrName(int); extern int sqlite3TestMakePointerStr(Tcl_Interp*, char*, void*); @@ -335,7 +335,7 @@ static int SQLITE_TCLAPI test_sqlite3rbu_internal_test( return TCL_OK; } -int SqliteRbu_Init(Tcl_Interp *interp){ +int SqliteRbu_Init(Tcl_Interp *interp){ static struct { char *zName; Tcl_ObjCmdProc *xProc; diff --git a/third_party/sqlite/src/ext/rtree/README b/third_party/sqlite/src/ext/rtree/README index 3736f45c5fd96..4fc488daeed07 100644 --- a/third_party/sqlite/src/ext/rtree/README +++ b/third_party/sqlite/src/ext/rtree/README @@ -1,7 +1,7 @@ -This directory contains an SQLite extension that implements a virtual -table type that allows users to create, query and manipulate r-tree[1] -data structures inside of SQLite databases. Users create, populate +This directory contains an SQLite extension that implements a virtual +table type that allows users to create, query and manipulate r-tree[1] +data structures inside of SQLite databases. Users create, populate and query r-tree structures using ordinary SQL statements. 1. SQL Interface @@ -21,13 +21,13 @@ and query r-tree structures using ordinary SQL statements. 1.1 Table Creation. All r-tree virtual tables have an odd number of columns between - 3 and 11. Unlike regular SQLite tables, r-tree tables are strongly - typed. + 3 and 11. Unlike regular SQLite tables, r-tree tables are strongly + typed. - The leftmost column is always the pimary key and contains 64-bit + The leftmost column is always the pimary key and contains 64-bit integer values. Each subsequent column contains a 32-bit real - value. For each pair of real values, the first (leftmost) must be - less than or equal to the second. R-tree tables may be + value. For each pair of real values, the first (leftmost) must be + less than or equal to the second. R-tree tables may be constructed using the following syntax: CREATE VIRTUAL TABLE USING rtree() @@ -51,7 +51,7 @@ and query r-tree structures using ordinary SQL statements. DROP TABLE ; Dropping the main r-tree table automatically drops the automatically - created tables. + created tables. 1.2 Data Manipulation (INSERT, UPDATE, DELETE). @@ -72,7 +72,7 @@ and query r-tree structures using ordinary SQL statements. stored in the (N*2)th column is greater than that stored in the (N*2+1)th column fails with an SQLITE_CONSTRAINT error. - * When a record is inserted, values are always converted to + * When a record is inserted, values are always converted to the required type (64-bit integer or 32-bit real) as if they were part of an SQL CAST expression. Non-numeric strings are converted to zero. @@ -83,12 +83,12 @@ and query r-tree structures using ordinary SQL statements. by regular tables. However, some query patterns are more efficient than others. - R-trees support fast lookup by primary key value (O(logN), like + R-trees support fast lookup by primary key value (O(logN), like regular tables). Any combination of equality and range (<, <=, >, >=) constraints on spatial data columns may be used to optimize other queries. This - is the key advantage to using r-tree tables instead of creating + is the key advantage to using r-tree tables instead of creating indices on regular tables. 1.4 Introspection and Analysis. @@ -112,7 +112,7 @@ and query r-tree structures using ordinary SQL statements. 3. REFERENCES - [1] Atonin Guttman, "R-trees - A Dynamic Index Structure For Spatial + [1] Atonin Guttman, "R-trees - A Dynamic Index Structure For Spatial Searching", University of California Berkeley, 1984. [2] Norbert Beckmann, Hans-Peter Kriegel, Ralf Schneider, Bernhard Seeger, diff --git a/third_party/sqlite/src/ext/rtree/rtree.c b/third_party/sqlite/src/ext/rtree/rtree.c index 205939ddc6bf6..6d42aea6971bb 100644 --- a/third_party/sqlite/src/ext/rtree/rtree.c +++ b/third_party/sqlite/src/ext/rtree/rtree.c @@ -17,7 +17,7 @@ ** Database Format of R-Tree Tables ** -------------------------------- ** -** The data structure for a single virtual r-tree table is stored in three +** The data structure for a single virtual r-tree table is stored in three ** native SQLite tables declared as follows. In each case, the '%' character ** in the table name is replaced with the user-supplied name of the r-tree ** table. @@ -42,7 +42,7 @@ ** of the node contain the tree depth as a big-endian integer. ** For non-root nodes, the first 2 bytes are left unused. ** -** 2. The next 2 bytes contain the number of entries currently +** 2. The next 2 bytes contain the number of entries currently ** stored in the node. ** ** 3. The remainder of the node contains the node entries. Each entry @@ -94,7 +94,7 @@ typedef struct RtreeSearchPoint RtreeSearchPoint; #define RTREE_MAX_DIMENSIONS 5 /* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is +** ever contain very many entries, so a fixed number of buckets is ** used. */ #define HASHSIZE 97 @@ -103,13 +103,13 @@ typedef struct RtreeSearchPoint RtreeSearchPoint; ** the number of rows in the virtual table to calculate the costs of ** various strategies. If possible, this estimate is loaded from the ** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use +** Otherwise, if no sqlite_stat1 entry is available, use ** RTREE_DEFAULT_ROWEST. */ #define RTREE_DEFAULT_ROWEST 1048576 #define RTREE_MIN_ROWEST 100 -/* +/* ** An rtree virtual-table object. */ struct Rtree { @@ -123,14 +123,14 @@ struct Rtree { u8 inWrTrans; /* True if inside write transaction */ int iDepth; /* Current depth of the r-tree structure */ char *zDb; /* Name of database containing r-tree table */ - char *zName; /* Name of r-tree table */ + char *zName; /* Name of r-tree table */ u32 nBusy; /* Current number of users of this structure */ i64 nRowEst; /* Estimated number of rows in this table */ u32 nCursor; /* Number of open cursors */ /* List of nodes removed during a CondenseTree operation. List is ** linked together via the pointer normally used for hash chains - - ** RtreeNode.pNext. RtreeNode.iNode stores the depth of the sub-tree + ** RtreeNode.pNext. RtreeNode.iNode stores the depth of the sub-tree ** headed by the node (leaf nodes have RtreeNode.iNode==0). */ RtreeNode *pDeleted; @@ -153,7 +153,7 @@ struct Rtree { sqlite3_stmt *pWriteParent; sqlite3_stmt *pDeleteParent; - RtreeNode *aHash[HASHSIZE]; /* Hash table of in-memory nodes. */ + RtreeNode *aHash[HASHSIZE]; /* Hash table of in-memory nodes. */ }; /* Possible values for Rtree.eCoordType: */ @@ -193,7 +193,7 @@ struct RtreeSearchPoint { }; /* -** The minimum number of cells allowed for a node is a third of the +** The minimum number of cells allowed for a node is a third of the ** maximum. In Gutman's notation: ** ** m = M/3 @@ -208,7 +208,7 @@ struct RtreeSearchPoint { /* ** The smallest possible node-size is (512-64)==448 bytes. And the largest ** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since +** Therefore all non-root nodes must contain at least 3 entries. Since ** 2^40 is greater than 2^64, an r-tree structure always has a depth of ** 40 or less. */ @@ -222,7 +222,7 @@ struct RtreeSearchPoint { */ #define RTREE_CACHE_SZ 5 -/* +/* ** An rtree cursor object. */ struct RtreeCursor { @@ -294,7 +294,7 @@ struct RtreeConstraint { #define RTREE_QUERY 0x47 /* G: New-style sqlite3_rtree_query_callback() */ -/* +/* ** An rtree structure node. */ struct RtreeNode { @@ -309,7 +309,7 @@ struct RtreeNode { /* Return the number of cells in a node */ #define NCELL(pNode) readInt16(&(pNode)->zData[2]) -/* +/* ** A single cell from a node, deserialized */ struct RtreeCell { @@ -324,11 +324,11 @@ struct RtreeCell { ** sqlite3_rtree_query_callback() and which appear on the right of MATCH ** operators in order to constrain a search. ** -** xGeom and xQueryFunc are the callback functions. Exactly one of +** xGeom and xQueryFunc are the callback functions. Exactly one of ** xGeom and xQueryFunc fields is non-NULL, depending on whether the ** SQL function was created using sqlite3_rtree_geometry_callback() or ** sqlite3_rtree_query_callback(). -** +** ** This object is deleted automatically by the destructor mechanism in ** sqlite3_create_function_v2(). */ @@ -443,9 +443,9 @@ static void readCoord(u8 *p, RtreeCoord *pCoord){ pCoord->u = *(u32*)p; #else pCoord->u = ( - (((u32)p[0]) << 24) + - (((u32)p[1]) << 16) + - (((u32)p[2]) << 8) + + (((u32)p[0]) << 24) + + (((u32)p[1]) << 16) + + (((u32)p[2]) << 8) + (((u32)p[3]) << 0) ); #endif @@ -465,13 +465,13 @@ static i64 readInt64(u8 *p){ return x; #else return ( - (((i64)p[0]) << 56) + - (((i64)p[1]) << 48) + - (((i64)p[2]) << 40) + - (((i64)p[3]) << 32) + - (((i64)p[4]) << 24) + - (((i64)p[5]) << 16) + - (((i64)p[6]) << 8) + + (((i64)p[0]) << 56) + + (((i64)p[1]) << 48) + + (((i64)p[2]) << 40) + + (((i64)p[3]) << 32) + + (((i64)p[4]) << 24) + + (((i64)p[5]) << 16) + + (((i64)p[6]) << 8) + (((i64)p[7]) << 0) ); #endif @@ -701,7 +701,7 @@ static int nodeAcquire( } /* If no error has occurred so far, check if the "number of entries" - ** field on the node is too large. If so, set the return code to + ** field on the node is too large. If so, set the return code to ** SQLITE_CORRUPT_VTAB. */ if( pNode && rc==SQLITE_OK ){ @@ -891,7 +891,7 @@ static int rtreeInit( sqlite3 *, void *, int, const char *const*, sqlite3_vtab **, char **, int ); -/* +/* ** Rtree virtual table module xCreate method. */ static int rtreeCreate( @@ -904,7 +904,7 @@ static int rtreeCreate( return rtreeInit(db, pAux, argc, argv, ppVtab, pzErr, 1); } -/* +/* ** Rtree virtual table module xConnect method. */ static int rtreeConnect( @@ -946,7 +946,7 @@ static void rtreeRelease(Rtree *pRtree){ } } -/* +/* ** Rtree virtual table module xDisconnect method. */ static int rtreeDisconnect(sqlite3_vtab *pVtab){ @@ -954,7 +954,7 @@ static int rtreeDisconnect(sqlite3_vtab *pVtab){ return SQLITE_OK; } -/* +/* ** Rtree virtual table module xDestroy method. */ static int rtreeDestroy(sqlite3_vtab *pVtab){ @@ -964,7 +964,7 @@ static int rtreeDestroy(sqlite3_vtab *pVtab){ "DROP TABLE '%q'.'%q_node';" "DROP TABLE '%q'.'%q_rowid';" "DROP TABLE '%q'.'%q_parent';", - pRtree->zDb, pRtree->zName, + pRtree->zDb, pRtree->zName, pRtree->zDb, pRtree->zName, pRtree->zDb, pRtree->zName ); @@ -982,7 +982,7 @@ static int rtreeDestroy(sqlite3_vtab *pVtab){ return rc; } -/* +/* ** Rtree virtual table module xOpen method. */ static int rtreeOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){ @@ -1021,7 +1021,7 @@ static void freeCursorConstraints(RtreeCursor *pCsr){ } } -/* +/* ** Rtree virtual table module xClose method. */ static int rtreeClose(sqlite3_vtab_cursor *cur){ @@ -1041,7 +1041,7 @@ static int rtreeClose(sqlite3_vtab_cursor *cur){ /* ** Rtree virtual table module xEof method. ** -** Return non-zero if the cursor does not currently point to a valid +** Return non-zero if the cursor does not currently point to a valid ** record (i.e if the scan has finished), or zero otherwise. */ static int rtreeEof(sqlite3_vtab_cursor *cur){ @@ -1097,7 +1097,7 @@ static int rtreeEof(sqlite3_vtab_cursor *cur){ /* ** Check the RTree node or entry given by pCellData and p against the MATCH -** constraint pConstraint. +** constraint pConstraint. */ static int rtreeCallbackConstraint( RtreeConstraint *pConstraint, /* The constraint to test */ @@ -1170,7 +1170,7 @@ static int rtreeCallbackConstraint( return rc; } -/* +/* ** Check the internal RTree node given by pCellData against constraint p. ** If this constraint cannot be satisfied by any child within the node, ** set *peWithin to NOT_WITHIN. @@ -1188,7 +1188,7 @@ static void rtreeNonleafConstraint( */ pCellData += 8 + 4*(p->iCoord&0xfe); - assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE + assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE || p->op==RTREE_GT || p->op==RTREE_EQ ); assert( ((((char*)pCellData) - (char*)0)&3)==0 ); /* 4-byte aligned */ switch( p->op ){ @@ -1228,7 +1228,7 @@ static void rtreeLeafConstraint( ){ RtreeDValue xN; /* Coordinate value converted to a double */ - assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE + assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE || p->op==RTREE_GT || p->op==RTREE_EQ ); pCellData += 8 + p->iCoord*4; assert( ((((char*)pCellData) - (char*)0)&3)==0 ); /* 4-byte aligned */ @@ -1244,12 +1244,12 @@ static void rtreeLeafConstraint( } /* -** One of the cells in node pNode is guaranteed to have a 64-bit +** One of the cells in node pNode is guaranteed to have a 64-bit ** integer value equal to iRowid. Return the index of this cell. */ static int nodeRowidIndex( - Rtree *pRtree, - RtreeNode *pNode, + Rtree *pRtree, + RtreeNode *pNode, i64 iRowid, int *piIndex ){ @@ -1390,7 +1390,7 @@ static RtreeSearchPoint *rtreeSearchPointNew( pFirst = rtreeSearchPointFirst(pCur); pCur->anQueue[iLevel]++; if( pFirst==0 - || pFirst->rScore>rScore + || pFirst->rScore>rScore || (pFirst->rScore==rScore && pFirst->iLevel>iLevel) ){ if( pCur->bPoint ){ @@ -1563,7 +1563,7 @@ static int rtreeStepToLeaf(RtreeCursor *pCur){ return SQLITE_OK; } -/* +/* ** Rtree virtual table module xNext method. */ static int rtreeNext(sqlite3_vtab_cursor *pVtabCursor){ @@ -1577,7 +1577,7 @@ static int rtreeNext(sqlite3_vtab_cursor *pVtabCursor){ return rc; } -/* +/* ** Rtree virtual table module xRowid method. */ static int rtreeRowid(sqlite3_vtab_cursor *pVtabCursor, sqlite_int64 *pRowid){ @@ -1591,7 +1591,7 @@ static int rtreeRowid(sqlite3_vtab_cursor *pVtabCursor, sqlite_int64 *pRowid){ return rc; } -/* +/* ** Rtree virtual table module xColumn method. */ static int rtreeColumn(sqlite3_vtab_cursor *cur, sqlite3_context *ctx, int i){ @@ -1621,8 +1621,8 @@ static int rtreeColumn(sqlite3_vtab_cursor *cur, sqlite3_context *ctx, int i){ return SQLITE_OK; } -/* -** Use nodeAcquire() to obtain the leaf node containing the record with +/* +** Use nodeAcquire() to obtain the leaf node containing the record with ** rowid iRowid. If successful, set *ppLeaf to point to the node and ** return SQLITE_OK. If there is no such record in the table, set ** *ppLeaf to 0 and return SQLITE_OK. If an error occurs, set *ppLeaf @@ -1697,11 +1697,11 @@ static int deserializeGeometry(sqlite3_value *pValue, RtreeConstraint *pCons){ return SQLITE_OK; } -/* +/* ** Rtree virtual table module xFilter method. */ static int rtreeFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -1741,8 +1741,8 @@ static int rtreeFilter( pCsr->atEOF = 1; } }else{ - /* Normal case - r-tree scan. Set up the RtreeCursor.aConstraint array - ** with the configured constraints. + /* Normal case - r-tree scan. Set up the RtreeCursor.aConstraint array + ** with the configured constraints. */ rc = nodeAcquire(pRtree, 1, 0, &pRoot); if( rc==SQLITE_OK && argc>0 ){ @@ -1803,7 +1803,7 @@ static int rtreeFilter( /* ** Rtree virtual table module xBestIndex method. There are three -** table scan strategies to choose from (in order from most to +** table scan strategies to choose from (in order from most to ** least desirable): ** ** idxNum idxStr Strategy @@ -1813,8 +1813,8 @@ static int rtreeFilter( ** ------------------------------------------------ ** ** If strategy 1 is used, then idxStr is not meaningful. If strategy -** 2 is used, idxStr is formatted to contain 2 bytes for each -** constraint used. The first two bytes of idxStr correspond to +** 2 is used, idxStr is formatted to contain 2 bytes for each +** constraint used. The first two bytes of idxStr correspond to ** the constraint in sqlite3_index_info.aConstraintUsage[] with ** (argvIndex==1) etc. ** @@ -1860,8 +1860,8 @@ static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ for(ii=0; iinConstraint && iIdx<(int)(sizeof(zIdxStr)-1); ii++){ struct sqlite3_index_constraint *p = &pIdxInfo->aConstraint[ii]; - if( bMatch==0 && p->usable - && p->iColumn==0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ + if( bMatch==0 && p->usable + && p->iColumn==0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ ){ /* We have an equality constraint on the rowid. Use strategy 1. */ int jj; @@ -1874,11 +1874,11 @@ static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ pIdxInfo->aConstraintUsage[jj].omit = 1; /* This strategy involves a two rowid lookups on an B-Tree structures - ** and then a linear search of an R-Tree node. This should be - ** considered almost as quick as a direct rowid lookup (for which + ** and then a linear search of an R-Tree node. This should be + ** considered almost as quick as a direct rowid lookup (for which ** sqlite uses an internal cost of 0.0). It is expected to return ** a single row. - */ + */ pIdxInfo->estimatedCost = 30.0; pIdxInfo->estimatedRows = 1; return SQLITE_OK; @@ -1894,7 +1894,7 @@ static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ case SQLITE_INDEX_CONSTRAINT_GE: op = RTREE_GE; break; default: assert( p->op==SQLITE_INDEX_CONSTRAINT_MATCH ); - op = RTREE_MATCH; + op = RTREE_MATCH; break; } zIdxStr[iIdx++] = op; @@ -1990,8 +1990,8 @@ static int cellContains(Rtree *pRtree, RtreeCell *p1, RtreeCell *p2){ for(ii=0; iinDim2; ii+=2){ RtreeCoord *a1 = &p1->aCoord[ii]; RtreeCoord *a2 = &p2->aCoord[ii]; - if( (!isInt && (a2[0].fa1[1].f)) - || ( isInt && (a2[0].ia1[1].i)) + if( (!isInt && (a2[0].fa1[1].f)) + || ( isInt && (a2[0].ia1[1].i)) ){ return 0; } @@ -2012,9 +2012,9 @@ static RtreeDValue cellGrowth(Rtree *pRtree, RtreeCell *p, RtreeCell *pCell){ } static RtreeDValue cellOverlap( - Rtree *pRtree, - RtreeCell *p, - RtreeCell *aCell, + Rtree *pRtree, + RtreeCell *p, + RtreeCell *aCell, int nCell ){ int ii; @@ -2123,7 +2123,7 @@ static int AdjustTree( cellUnion(pRtree, &cell, pCell); nodeOverwriteCell(pRtree, pParent, &cell, iCell); } - + p = pParent; } return SQLITE_OK; @@ -2154,7 +2154,7 @@ static int rtreeInsertCell(Rtree *, RtreeNode *, RtreeCell *, int); /* ** Arguments aIdx, aDistance and aSpare all point to arrays of size -** nIdx. The aIdx array contains the set of integers from 0 to +** nIdx. The aIdx array contains the set of integers from 0 to ** (nIdx-1) in no particular order. This function sorts the values ** in aIdx according to the indexed values in aDistance. For ** example, assuming the inputs: @@ -2170,9 +2170,9 @@ static int rtreeInsertCell(Rtree *, RtreeNode *, RtreeCell *, int); ** sorting algorithm. */ static void SortByDistance( - int *aIdx, - int nIdx, - RtreeDValue *aDistance, + int *aIdx, + int nIdx, + RtreeDValue *aDistance, int *aSpare ){ if( nIdx>1 ){ @@ -2226,7 +2226,7 @@ static void SortByDistance( /* ** Arguments aIdx, aCell and aSpare all point to arrays of size -** nIdx. The aIdx array contains the set of integers from 0 to +** nIdx. The aIdx array contains the set of integers from 0 to ** (nIdx-1) in no particular order. This function sorts the values ** in aIdx according to dimension iDim of the cells in aCell. The ** minimum value of dimension iDim is considered first, the @@ -2237,10 +2237,10 @@ static void SortByDistance( */ static void SortByDimension( Rtree *pRtree, - int *aIdx, - int nIdx, - int iDim, - RtreeCell *aCell, + int *aIdx, + int nIdx, + int iDim, + RtreeCell *aCell, int *aSpare ){ if( nIdx>1 ){ @@ -2337,8 +2337,8 @@ static int splitNodeStartree( int nLeft; for( - nLeft=RTREE_MINCELLS(pRtree); - nLeft<=(nCell-RTREE_MINCELLS(pRtree)); + nLeft=RTREE_MINCELLS(pRtree); + nLeft<=(nCell-RTREE_MINCELLS(pRtree)); nLeft++ ){ RtreeCell left; @@ -2393,9 +2393,9 @@ static int splitNodeStartree( static int updateMapping( - Rtree *pRtree, - i64 iRowid, - RtreeNode *pNode, + Rtree *pRtree, + i64 iRowid, + RtreeNode *pNode, int iHeight ){ int (*xSetMapping)(Rtree *, sqlite3_int64, sqlite3_int64); @@ -2431,7 +2431,7 @@ static int SplitNode( RtreeCell leftbbox; RtreeCell rightbbox; - /* Allocate an array and populate it with a copy of pCell and + /* Allocate an array and populate it with a copy of pCell and ** all cells from node pLeft. Then zero the original node. */ aCell = sqlite3_malloc((sizeof(RtreeCell)+sizeof(int))*(nCell+1)); @@ -2548,14 +2548,14 @@ splitnode_out: } /* -** If node pLeaf is not the root of the r-tree and its pParent pointer is +** If node pLeaf is not the root of the r-tree and its pParent pointer is ** still NULL, load all ancestor nodes of pLeaf into memory and populate ** the pLeaf->pParent chain all the way up to the root node. ** ** This operation is required when a row is deleted (or updated - an update ** is implemented as a delete followed by an insert). SQLite provides the ** rowid of the row to delete, which can be used to find the leaf on which -** the entry resides (argument pLeaf). Once the leaf is located, this +** the entry resides (argument pLeaf). Once the leaf is located, this ** function is called to determine its ancestry. */ static int fixLeafParent(Rtree *pRtree, RtreeNode *pLeaf){ @@ -2626,7 +2626,7 @@ static int removeNode(Rtree *pRtree, RtreeNode *pNode, int iHeight){ if( SQLITE_OK!=(rc = sqlite3_reset(pRtree->pDeleteParent)) ){ return rc; } - + /* Remove the node from the in-memory hash table and link it into ** the Rtree.pDeleted list. Its contents will be re-inserted later on. */ @@ -2641,9 +2641,9 @@ static int removeNode(Rtree *pRtree, RtreeNode *pNode, int iHeight){ static int fixBoundingBox(Rtree *pRtree, RtreeNode *pNode){ RtreeNode *pParent = pNode->pParent; - int rc = SQLITE_OK; + int rc = SQLITE_OK; if( pParent ){ - int ii; + int ii; int nCell = NCELL(pNode); RtreeCell box; /* Bounding box for pNode */ nodeGetCell(pRtree, pNode, 0, &box); @@ -2698,9 +2698,9 @@ static int deleteCell(Rtree *pRtree, RtreeNode *pNode, int iCell, int iHeight){ } static int Reinsert( - Rtree *pRtree, - RtreeNode *pNode, - RtreeCell *pCell, + Rtree *pRtree, + RtreeNode *pNode, + RtreeCell *pCell, int iHeight ){ int *aOrder; @@ -2754,7 +2754,7 @@ static int Reinsert( for(ii=0; iinDim; iDim++){ - RtreeDValue coord = (DCOORD(aCell[ii].aCoord[iDim*2+1]) - + RtreeDValue coord = (DCOORD(aCell[ii].aCoord[iDim*2+1]) - DCOORD(aCell[ii].aCoord[iDim*2])); aDistance[ii] += (coord-aCenterCoord[iDim])*(coord-aCenterCoord[iDim]); } @@ -2799,7 +2799,7 @@ static int Reinsert( } /* -** Insert cell pCell into node pNode. Node pNode is the head of a +** Insert cell pCell into node pNode. Node pNode is the head of a ** subtree iHeight high (leaf nodes have iHeight==0). */ static int rtreeInsertCell( @@ -2889,8 +2889,8 @@ static int rtreeDeleteRowid(Rtree *pRtree, sqlite3_int64 iDelete){ /* Obtain a reference to the root node to initialize Rtree.iDepth */ rc = nodeAcquire(pRtree, 1, 0, &pRoot); - /* Obtain a reference to the leaf node that contains the entry - ** about to be deleted. + /* Obtain a reference to the leaf node that contains the entry + ** about to be deleted. */ if( rc==SQLITE_OK ){ rc = findLeafNode(pRtree, iDelete, &pLeaf, 0); @@ -2917,11 +2917,11 @@ static int rtreeDeleteRowid(Rtree *pRtree, sqlite3_int64 iDelete){ } /* Check if the root node now has exactly one child. If so, remove - ** it, schedule the contents of the child for reinsertion and + ** it, schedule the contents of the child for reinsertion and ** reduce the tree height by one. ** ** This is equivalent to copying the contents of the child into - ** the root node (the operation that Gutman's paper says to perform + ** the root node (the operation that Gutman's paper says to perform ** in this scenario). */ if( rc==SQLITE_OK && pRtree->iDepth>0 && NCELL(pRoot)==1 ){ @@ -2990,8 +2990,8 @@ static RtreeValue rtreeValueUp(sqlite3_value *v){ #endif /* !defined(SQLITE_RTREE_INT_ONLY) */ /* -** A constraint has failed while inserting a row into an rtree table. -** Assuming no OOM error occurs, this function sets the error message +** A constraint has failed while inserting a row into an rtree table. +** Assuming no OOM error occurs, this function sets the error message ** (at pRtree->base.zErrMsg) to an appropriate value and returns ** SQLITE_CONSTRAINT. ** @@ -3004,7 +3004,7 @@ static RtreeValue rtreeValueUp(sqlite3_value *v){ */ static int rtreeConstraintError(Rtree *pRtree, int iCol){ sqlite3_stmt *pStmt = 0; - char *zSql; + char *zSql; int rc; assert( iCol==0 || iCol%2 ); @@ -3041,9 +3041,9 @@ static int rtreeConstraintError(Rtree *pRtree, int iCol){ ** The xUpdate method for rtree module virtual tables. */ static int rtreeUpdate( - sqlite3_vtab *pVtab, - int nData, - sqlite3_value **azData, + sqlite3_vtab *pVtab, + int nData, + sqlite3_value **azData, sqlite_int64 *pRowid ){ Rtree *pRtree = (Rtree *)pVtab; @@ -3103,7 +3103,7 @@ static int rtreeUpdate( } } - /* If a rowid value was supplied, check if it is already present in + /* If a rowid value was supplied, check if it is already present in ** the table. If so, the constraint has failed. */ if( sqlite3_value_type(azData[2])!=SQLITE_NULL ){ cell.iRowid = sqlite3_value_int64(azData[2]); @@ -3199,8 +3199,8 @@ static int rtreeRename(sqlite3_vtab *pVtab, const char *zNewName){ "ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";" "ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";" "ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";" - , pRtree->zDb, pRtree->zName, zNewName - , pRtree->zDb, pRtree->zName, zNewName + , pRtree->zDb, pRtree->zName, zNewName + , pRtree->zDb, pRtree->zName, zNewName , pRtree->zDb, pRtree->zName, zNewName ); if( zSql ){ @@ -3282,10 +3282,10 @@ static sqlite3_module rtreeModule = { }; static int rtreeSqlInit( - Rtree *pRtree, - sqlite3 *db, - const char *zDb, - const char *zPrefix, + Rtree *pRtree, + sqlite3 *db, + const char *zDb, + const char *zPrefix, int isCreate ){ int rc = SQLITE_OK; @@ -3343,7 +3343,7 @@ static int rtreeSqlInit( for(i=0; i*2 coordinates. */ static void rtreenode(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){ @@ -3584,7 +3584,7 @@ static void rtreenode(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){ zText = sqlite3_mprintf("{%s}", zCell); } } - + sqlite3_result_text(ctx, zText, -1, sqlite3_free); } @@ -3599,10 +3599,10 @@ static void rtreenode(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){ */ static void rtreedepth(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){ UNUSED_PARAMETER(nArg); - if( sqlite3_value_type(apArg[0])!=SQLITE_BLOB + if( sqlite3_value_type(apArg[0])!=SQLITE_BLOB || sqlite3_value_bytes(apArg[0])<2 ){ - sqlite3_result_error(ctx, "Invalid argument to rtreedepth()", -1); + sqlite3_result_error(ctx, "Invalid argument to rtreedepth()", -1); }else{ u8 *zBlob = (u8 *)sqlite3_value_blob(apArg[0]); sqlite3_result_int(ctx, readInt16(zBlob)); @@ -3611,7 +3611,7 @@ static void rtreedepth(sqlite3_context *ctx, int nArg, sqlite3_value **apArg){ /* ** Register the r-tree module with database handle db. This creates the -** virtual table module "rtree" and the debugging/analysis scalar +** virtual table module "rtree" and the debugging/analysis scalar ** function "rtreenode". */ int sqlite3RtreeInit(sqlite3 *db){ @@ -3730,7 +3730,7 @@ int sqlite3_rtree_geometry_callback( pGeomCtx->xQueryFunc = 0; pGeomCtx->xDestructor = 0; pGeomCtx->pContext = pContext; - return sqlite3_create_function_v2(db, zGeom, -1, SQLITE_ANY, + return sqlite3_create_function_v2(db, zGeom, -1, SQLITE_ANY, (void *)pGeomCtx, geomCallback, 0, 0, rtreeFreeCallback ); } @@ -3755,7 +3755,7 @@ int sqlite3_rtree_query_callback( pGeomCtx->xQueryFunc = xQueryFunc; pGeomCtx->xDestructor = xDestructor; pGeomCtx->pContext = pContext; - return sqlite3_create_function_v2(db, zQueryFunc, -1, SQLITE_ANY, + return sqlite3_create_function_v2(db, zQueryFunc, -1, SQLITE_ANY, (void *)pGeomCtx, geomCallback, 0, 0, rtreeFreeCallback ); } diff --git a/third_party/sqlite/src/ext/rtree/rtree1.test b/third_party/sqlite/src/ext/rtree/rtree1.test index 9dc101a7b2231..5496d6439aef5 100644 --- a/third_party/sqlite/src/ext/rtree/rtree1.test +++ b/third_party/sqlite/src/ext/rtree/rtree1.test @@ -59,8 +59,8 @@ do_test rtree-1.1.2 { execsql { SELECT name FROM sqlite_master ORDER BY name } } {t1 t1_node t1_parent t1_rowid} do_test rtree-1.1.3 { - execsql { - DROP TABLE t1; + execsql { + DROP TABLE t1; SELECT name FROM sqlite_master ORDER BY name; } } {} @@ -82,8 +82,8 @@ do_test rtree-1.2.3 { execsql { SELECT name FROM aux.sqlite_master ORDER BY name } } {{a" "b} {a" "b_node} {a" "b_parent} {a" "b_rowid}} do_test rtree-1.2.4 { - execsql { - DROP TABLE aux.'a" "b'; + execsql { + DROP TABLE aux.'a" "b'; SELECT name FROM aux.sqlite_master ORDER BY name; } } {} @@ -103,7 +103,7 @@ for {set nCol 1} {$nCol<[llength $cols]} {incr nCol} { if {$nCol > 11} { set X {1 {Too many columns for an rtree table}} } do_test rtree-1.3.$nCol { - catchsql " + catchsql " CREATE VIRTUAL TABLE t1 USING rtree($columns); " } $X @@ -170,10 +170,10 @@ do_test rtree-1.6.1 { } {} #---------------------------------------------------------------------------- -# Test cases rtree-2.* +# Test cases rtree-2.* # do_test rtree-2.1.1 { - execsql { + execsql { CREATE VIRTUAL TABLE t1 USING rtree(ii, x1, x2, y1, y2); SELECT * FROM t1; } @@ -215,13 +215,13 @@ do_test rtree-2.X { # focus of these tests. # do_test rtree-3.1.1 { - execsql { + execsql { CREATE VIRTUAL TABLE t1 USING rtree(ii, x1, x2, y1, y2); SELECT * FROM t1; } } {} do_test rtree-3.1.2 { - execsql_intout { + execsql_intout { INSERT INTO t1 VALUES(5, 1, 3, 2, 4); SELECT * FROM t1; } @@ -248,7 +248,7 @@ do_test rtree-5.1.1 { execsql { CREATE VIRTUAL TABLE t2 USING rtree(ii, x1, x2) } } {} do_test rtree-5.1.2 { - execsql_intout { + execsql_intout { INSERT INTO t2 VALUES(1, 10, 20); INSERT INTO t2 VALUES(2, 30, 40); INSERT INTO t2 VALUES(3, 50, 60); @@ -256,19 +256,19 @@ do_test rtree-5.1.2 { } } {1 10 20 2 30 40 3 50 60} do_test rtree-5.1.3 { - execsql_intout { + execsql_intout { DELETE FROM t2 WHERE ii=2; SELECT * FROM t2 ORDER BY ii; } } {1 10 20 3 50 60} do_test rtree-5.1.4 { - execsql_intout { + execsql_intout { DELETE FROM t2 WHERE ii=1; SELECT * FROM t2 ORDER BY ii; } } {3 50 60} do_test rtree-5.1.5 { - execsql { + execsql { DELETE FROM t2 WHERE ii=3; SELECT * FROM t2 ORDER BY ii; } @@ -332,7 +332,7 @@ do_test rtree-7.1.7 { # An error midway through a rename operation. do_test rtree-7.2.1 { - execsql { + execsql { CREATE TABLE t4_node(a); } catchsql { ALTER TABLE "abc 123" RENAME TO t4 } @@ -341,7 +341,7 @@ do_test rtree-7.2.2 { execsql_intout { SELECT * FROM "abc 123" } } {1 2 3 4 5 6 7} do_test rtree-7.2.3 { - execsql { + execsql { DROP TABLE t4_node; CREATE TABLE t4_rowid(a); } @@ -408,13 +408,13 @@ do_test rtree-9.2 { } {1600} do_test rtree-9.3 { execsql { - SELECT count(*) FROM bar b1, bar b2, foo s1 + SELECT count(*) FROM bar b1, bar b2, foo s1 WHERE b1.minX <= b2.maxX AND s1.id = b1.id; } } {1600} #------------------------------------------------------------------------- -# Ticket #3970: Check that the error message is meaningful when a +# Ticket #3970: Check that the error message is meaningful when a # keyword is used as a column name. # do_test rtree-10.1 { @@ -423,7 +423,7 @@ do_test rtree-10.1 { #------------------------------------------------------------------------- # Test last_insert_rowid(). -# +# do_test rtree-11.1 { execsql { CREATE VIRTUAL TABLE t8 USING rtree(idx, x1, x2, y1, y2); @@ -528,7 +528,7 @@ foreach {tn sql_template testdata} { reset_db do_execsql_test 13.1 { CREATE VIRTUAL TABLE t9 USING rtree(id, xmin, xmax); - INSERT INTO t9 VALUES(1,0,0); + INSERT INTO t9 VALUES(1,0,0); INSERT INTO t9 VALUES(2,0,0); SELECT * FROM t9 WHERE id IN (1, 2); } {1 0.0 0.0 2 0.0 0.0} diff --git a/third_party/sqlite/src/ext/rtree/rtree2.test b/third_party/sqlite/src/ext/rtree/rtree2.test index f5d15cc6b935d..1d730b0896ffd 100644 --- a/third_party/sqlite/src/ext/rtree/rtree2.test +++ b/third_party/sqlite/src/ext/rtree/rtree2.test @@ -14,7 +14,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] rtree_util.tcl] source $testdir/tester.tcl @@ -34,19 +34,19 @@ if {[info exists G(isquick)] && $G(isquick)} { foreach module {rtree_i32 rtree} { for {set nDim 1} {$nDim <= 5} {incr nDim} { - + do_test rtree2-$module.$nDim.1 { set cols [list] foreach c [list c0 c1 c2 c3 c4 c5 c6 c7 c8 c9] { lappend cols "$c REAL" } set cols [join [lrange $cols 0 [expr {$nDim*2-1}]] ", "] - execsql " + execsql " CREATE VIRTUAL TABLE t1 USING ${module}(ii, $cols); CREATE TABLE t2 (ii, $cols); " } {} - + do_test rtree2-$module.$nDim.2 { db transaction { for {set ii 0} {$ii < $::NROW} {incr ii} { @@ -70,7 +70,7 @@ foreach module {rtree_i32 rtree} { #} } } - + set t1 [execsql {SELECT * FROM t1 ORDER BY ii}] set t2 [execsql {SELECT * FROM t2 ORDER BY ii}] set rc [expr {$t1 eq $t2}] @@ -80,11 +80,11 @@ foreach module {rtree_i32 rtree} { } set rc } {1} - + do_test rtree2-$module.$nDim.3 { rtree_check db t1 } 0 - + set OPS [list < > <= >= =] for {set ii 0} {$ii < $::NSELECT} {incr ii} { do_test rtree2-$module.$nDim.4.$ii.1 { @@ -101,7 +101,7 @@ foreach module {rtree_i32 rtree} { lappend where "$col $op $val" } set where [join $where " AND "] - + set t1 [execsql "SELECT * FROM t1 WHERE $where ORDER BY ii"] set t2 [execsql "SELECT * FROM t2 WHERE $where ORDER BY ii"] set rc [expr {$t1 eq $t2}] @@ -117,13 +117,13 @@ foreach module {rtree_i32 rtree} { set rc } {1} } - + for {set ii 0} {$ii < $::NROW} {incr ii $::NDEL} { #puts [rtree_treedump db t1] do_test rtree2-$module.$nDim.5.$ii.1 { execsql "DELETE FROM t2 WHERE ii <= $::ii" execsql "DELETE FROM t1 WHERE ii <= $::ii" - + set t1 [execsql {SELECT * FROM t1 ORDER BY ii}] set t2 [execsql {SELECT * FROM t2 ORDER BY ii}] set rc [expr {$t1 eq $t2}] @@ -137,7 +137,7 @@ foreach module {rtree_i32 rtree} { rtree_check db t1 } {0} } - + do_test rtree2-$module.$nDim.6 { execsql { DROP TABLE t1; diff --git a/third_party/sqlite/src/ext/rtree/rtree3.test b/third_party/sqlite/src/ext/rtree/rtree3.test index 1d863c6cc2c47..b0a4831cd7ac5 100644 --- a/third_party/sqlite/src/ext/rtree/rtree3.test +++ b/third_party/sqlite/src/ext/rtree/rtree3.test @@ -15,7 +15,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source $testdir/tester.tcl source $testdir/malloc_common.tcl ifcapable !rtree { @@ -25,7 +25,7 @@ ifcapable !rtree { # Test summary: # -# rtree3-1: Test OOM in simple CREATE TABLE, INSERT, DELETE and SELECT +# rtree3-1: Test OOM in simple CREATE TABLE, INSERT, DELETE and SELECT # commands on an almost empty table. # # rtree3-2: Test OOM in a DROP TABLE command. @@ -75,7 +75,7 @@ do_test rtree3-2.prep { do_faultsim_test rtree3-2 -faults oom* -prep { faultsim_restore_and_reopen } -body { - execsql { DROP TABLE rt } + execsql { DROP TABLE rt } } do_malloc_test rtree3-3.prep { @@ -108,7 +108,7 @@ do_faultsim_test rtree3-3b -faults oom* -prep { db eval { DELETE FROM rt WHERE x1<($f*10.0) AND x1>($f*10.5) } } db eval COMMIT -} +} do_test rtree3-4.prep { faultsim_delete_and_reopen @@ -205,7 +205,7 @@ do_faultsim_test rtree3-8 -faults oom-* -prep { catch { db close } } -body { sqlite3 db test.db -} +} do_faultsim_test rtree3-9 -faults oom-* -prep { sqlite3 db :memory: @@ -218,7 +218,7 @@ do_faultsim_test rtree3-9 -faults oom-* -prep { do_test rtree3-10.prep { faultsim_delete_and_reopen - execsql { + execsql { CREATE VIRTUAL TABLE rt USING rtree(ii, x1, x2, y1, y2, z1, z2); INSERT INTO rt VALUES(1, 10, 10, 10, 11, 11, 11); INSERT INTO rt VALUES(2, 5, 6, 6, 7, 7, 8); @@ -238,7 +238,7 @@ do_faultsim_test rtree3-10 -faults oom-* -prep { do_test rtree3-11.prep { faultsim_delete_and_reopen - execsql { + execsql { CREATE VIRTUAL TABLE rt USING rtree(ii, x1, x2, y1, y2); INSERT INTO rt VALUES(1, 2, 3, 4, 5); } diff --git a/third_party/sqlite/src/ext/rtree/rtree4.test b/third_party/sqlite/src/ext/rtree/rtree4.test index a3872b0735694..7ea1c40297fc5 100644 --- a/third_party/sqlite/src/ext/rtree/rtree4.test +++ b/third_party/sqlite/src/ext/rtree/rtree4.test @@ -14,7 +14,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source $testdir/tester.tcl ifcapable !rtree { @@ -29,11 +29,11 @@ if {[info exists G(isquick)] && $G(isquick)} { ifcapable !rtree_int_only { # Return a floating point number between -X and X. - # + # proc rand {X} { return [expr {int((rand()-0.5)*1024.0*$X)/512.0}] } - + # Return a positive floating point number less than or equal to X # proc randincr {X} { @@ -44,11 +44,11 @@ ifcapable !rtree_int_only { } } else { # For rtree_int_only, return an number between -X and X. - # + # proc rand {X} { return [expr {int((rand()-0.5)*2*$X)}] } - + # Return a positive integer less than or equal to X # proc randincr {X} { @@ -58,7 +58,7 @@ ifcapable !rtree_int_only { } } } - + # Scramble the $inlist into a random order. # proc scramble {inlist} { @@ -213,7 +213,7 @@ for {set nDim 1} {$nDim<=5} {incr nDim} { list $where [db eval "SELECT id FROM rx $where ORDER BY id"] } [list $where [db eval "SELECT id FROM bx $where ORDER BY id"]] - # Do a contained-in query with surplus contraints where the + # Do a contained-in query with surplus contraints where the # constraints appear in a random order. # set where {} diff --git a/third_party/sqlite/src/ext/rtree/rtree5.test b/third_party/sqlite/src/ext/rtree/rtree5.test index 8ff90b0cb7071..020515f6daeb2 100644 --- a/third_party/sqlite/src/ext/rtree/rtree5.test +++ b/third_party/sqlite/src/ext/rtree/rtree5.test @@ -15,7 +15,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source $testdir/tester.tcl ifcapable !rtree { @@ -29,50 +29,50 @@ do_test rtree5-1.0 { do_test rtree5-1.1 { execsql { INSERT INTO t1 VALUES(1, 5, 10, 4, 11.2) } } {} -do_test rtree5-1.2 { +do_test rtree5-1.2 { execsql { SELECT * FROM t1 } } {1 5 10 4 11} -do_test rtree5-1.3 { +do_test rtree5-1.3 { execsql { SELECT typeof(x1) FROM t1 } } {integer} -do_test rtree5-1.4 { +do_test rtree5-1.4 { execsql { SELECT x1==5 FROM t1 } } {1} -do_test rtree5-1.5 { +do_test rtree5-1.5 { execsql { SELECT x1==5.2 FROM t1 } } {0} -do_test rtree5-1.6 { +do_test rtree5-1.6 { execsql { SELECT x1==5.0 FROM t1 } } {1} -do_test rtree5-1.7 { +do_test rtree5-1.7 { execsql { SELECT count(*) FROM t1 WHERE x1==5 } } {1} ifcapable !rtree_int_only { - do_test rtree5-1.8 { + do_test rtree5-1.8 { execsql { SELECT count(*) FROM t1 WHERE x1==5.2 } } {0} } -do_test rtree5-1.9 { +do_test rtree5-1.9 { execsql { SELECT count(*) FROM t1 WHERE x1==5.0 } } {1} -do_test rtree5-1.10 { +do_test rtree5-1.10 { execsql { SELECT (1<<31)-5, (1<<31)-1, -1*(1<<31), -1*(1<<31)+5 } } {2147483643 2147483647 -2147483648 -2147483643} -do_test rtree5-1.11 { - execsql { - INSERT INTO t1 VALUES(2, (1<<31)-5, (1<<31)-1, -1*(1<<31), -1*(1<<31)+5) +do_test rtree5-1.11 { + execsql { + INSERT INTO t1 VALUES(2, (1<<31)-5, (1<<31)-1, -1*(1<<31), -1*(1<<31)+5) } } {} -do_test rtree5-1.12 { +do_test rtree5-1.12 { execsql { SELECT * FROM t1 WHERE id=2 } } {2 2147483643 2147483647 -2147483648 -2147483643} -do_test rtree5-1.13 { - execsql { - SELECT * FROM t1 WHERE - x1=2147483643 AND x2=2147483647 AND +do_test rtree5-1.13 { + execsql { + SELECT * FROM t1 WHERE + x1=2147483643 AND x2=2147483647 AND y1=-2147483648 AND y2=-2147483643 } } {2 2147483643 2147483647 -2147483648 -2147483643} diff --git a/third_party/sqlite/src/ext/rtree/rtree6.test b/third_party/sqlite/src/ext/rtree/rtree6.test index c9c87e8ad917f..994a460d2c53b 100644 --- a/third_party/sqlite/src/ext/rtree/rtree6.test +++ b/third_party/sqlite/src/ext/rtree/rtree6.test @@ -8,12 +8,12 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source $testdir/tester.tcl ifcapable {!rtree || rtree_int_only} { @@ -74,73 +74,73 @@ do_test rtree6-1.5 { do_eqp_test rtree6.2.1 { SELECT * FROM t1,t2 WHERE k=+ii AND x1<10 } { - 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 2:C0} + 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 2:C0} 0 1 1 {SEARCH TABLE t2 USING INTEGER PRIMARY KEY (rowid=?)} } do_eqp_test rtree6.2.2 { SELECT * FROM t1,t2 WHERE k=ii AND x1<10 } { - 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 2:C0} + 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 2:C0} 0 1 1 {SEARCH TABLE t2 USING INTEGER PRIMARY KEY (rowid=?)} } do_eqp_test rtree6.2.3 { SELECT * FROM t1,t2 WHERE k=ii } { - 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 2:} + 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 2:} 0 1 1 {SEARCH TABLE t2 USING INTEGER PRIMARY KEY (rowid=?)} } do_eqp_test rtree6.2.4.1 { SELECT * FROM t1,t2 WHERE v=+ii and x1<10 and x2>10 } { - 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 2:C0E1} + 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 2:C0E1} 0 1 1 {SEARCH TABLE t2 USING AUTOMATIC COVERING INDEX (v=?)} } do_eqp_test rtree6.2.4.2 { SELECT * FROM t1,t2 WHERE v=10 and x1<10 and x2>10 } { - 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 2:C0E1} + 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 2:C0E1} 0 1 1 {SEARCH TABLE t2 USING AUTOMATIC PARTIAL COVERING INDEX (v=?)} } do_eqp_test rtree6.2.5 { SELECT * FROM t1,t2 WHERE k=ii AND x10.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + SELECT * FROM t3 WHERE + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5; } {1 1.0 1.0 2.0 2.0} do_test rtree6.3.2 { rtree_strategy { - SELECT * FROM t3 WHERE - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 + SELECT * FROM t3 WHERE + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 } } {E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0} do_test rtree6.3.3 { rtree_strategy { - SELECT * FROM t3 WHERE - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + SELECT * FROM t3 WHERE + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 } } {E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0} @@ -149,12 +149,12 @@ do_execsql_test rtree6-3.4 { SELECT * FROM t3 WHERE x1>0.5 AND x1>0.8 AND x1>1.1 } {} do_execsql_test rtree6-3.5 { - SELECT * FROM t3 WHERE - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND - x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + SELECT * FROM t3 WHERE + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND + x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>0.5 AND x1>1.1 } {} diff --git a/third_party/sqlite/src/ext/rtree/rtree7.test b/third_party/sqlite/src/ext/rtree/rtree7.test index 4eee4c219a61c..25be950059e68 100644 --- a/third_party/sqlite/src/ext/rtree/rtree7.test +++ b/third_party/sqlite/src/ext/rtree/rtree7.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # Test that nothing goes wrong if an rtree table is created, then the # database page-size is modified. At one point (3.6.22), this was causing # malfunctions. @@ -16,7 +16,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source $testdir/tester.tcl ifcapable !rtree||!vacuum { @@ -47,7 +47,7 @@ do_test rtree7-1.2 { execsql_intout { SELECT * FROM rt } } {1 1 2 3 4} do_test rtree7-1.3 { - execsql_intout { + execsql_intout { PRAGMA page_size = 2048; VACUUM; SELECT * FROM rt; @@ -60,7 +60,7 @@ do_test rtree7-1.4 { execsql_intout { SELECT sum(x1), sum(x2), sum(y1), sum(y2) FROM rt } } {51 102 153 204} do_test rtree7-1.5 { - execsql_intout { + execsql_intout { PRAGMA page_size = 512; VACUUM; SELECT sum(x1), sum(x2), sum(y1), sum(y2) FROM rt diff --git a/third_party/sqlite/src/ext/rtree/rtree8.test b/third_party/sqlite/src/ext/rtree/rtree8.test index 578a1468b8bda..381603875cc54 100644 --- a/third_party/sqlite/src/ext/rtree/rtree8.test +++ b/third_party/sqlite/src/ext/rtree/rtree8.test @@ -8,12 +8,12 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source $testdir/tester.tcl ifcapable !rtree { finish_test ; return } @@ -37,7 +37,7 @@ do_test rtree8-1.1.1 { } {} do_test rtree8-1.1.2 { set res [list] - db eval { SELECT * FROM t1 } { + db eval { SELECT * FROM t1 } { lappend res $x1 $x2 if {$id==3} { db eval { DELETE FROM t1 WHERE id>3 } } } @@ -59,8 +59,8 @@ proc nested_select {n} { do_test rtree8-1.2.1 { populate_t1 50 } {} do_test rtree8-1.2.2 { nested_select 1 } {51} -# This test runs many SELECT queries simultaneously against a large -# table, causing a collision in the hash-table used to store r-tree +# This test runs many SELECT queries simultaneously against a large +# table, causing a collision in the hash-table used to store r-tree # nodes internally. # populate_t1 1500 @@ -72,12 +72,12 @@ do_test rtree8-1.3.2 { set stmt [sqlite3_prepare db "SELECT * FROM t1 WHERE id = $row" -1 tail] sqlite3_step $stmt lappend res_list [sqlite3_column_int $stmt 0] - lappend stmt_list $stmt + lappend stmt_list $stmt } } {} do_test rtree8-1.3.3 { set res_list } $rowids do_execsql_test rtree8-1.3.4 { SELECT count(*) FROM t1 } {1500} -do_test rtree8-1.3.5 { +do_test rtree8-1.3.5 { foreach stmt $stmt_list { sqlite3_finalize $stmt } } {} @@ -92,18 +92,18 @@ populate_t1 50 do_execsql_test rtree8-2.1.1 { SELECT max(nodeno) FROM t1_node } {5} do_execsql_test rtree8-2.1.2 { DELETE FROM t1_node } {} for {set i 1} {$i <= 50} {incr i} { - do_catchsql_test rtree8-2.1.3.$i { - SELECT * FROM t1 WHERE id = $i + do_catchsql_test rtree8-2.1.3.$i { + SELECT * FROM t1 WHERE id = $i } {1 {database disk image is malformed}} } -do_catchsql_test rtree8-2.1.4 { +do_catchsql_test rtree8-2.1.4 { SELECT * FROM t1 } {1 {database disk image is malformed}} -do_catchsql_test rtree8-2.1.5 { +do_catchsql_test rtree8-2.1.5 { DELETE FROM t1 } {1 {database disk image is malformed}} -do_execsql_test rtree8-2.1.6 { +do_execsql_test rtree8-2.1.6 { DROP TABLE t1; CREATE VIRTUAL TABLE t1 USING rtree_i32(id, x1, x2); } {} @@ -116,7 +116,7 @@ do_execsql_test rtree8-2.2.1 { do_catchsql_test rtree8-2.2.2 { DELETE FROM t1 WHERE id=25 } {1 {database disk image is malformed}} -do_execsql_test rtree8-2.2.3 { +do_execsql_test rtree8-2.2.3 { DROP TABLE t1; CREATE VIRTUAL TABLE t1 USING rtree_i32(id, x1, x2); } {} @@ -124,10 +124,10 @@ do_execsql_test rtree8-2.2.3 { #------------------------------------------------------------------------- # Test that trying to use the MATCH operator with the r-tree module does -# not confuse it. +# not confuse it. # populate_t1 10 -do_catchsql_test rtree8-3.1 { +do_catchsql_test rtree8-3.1 { SELECT * FROM t1 WHERE x1 MATCH '1234' } {1 {SQL logic error or missing database}} @@ -145,8 +145,8 @@ do_catchsql_test rtree8-4.2 { #------------------------------------------------------------------------- # Delete half of a lopsided tree. # -do_execsql_test rtree8-5.1 { - CREATE VIRTUAL TABLE t2 USING rtree_i32(id, x1, x2) +do_execsql_test rtree8-5.1 { + CREATE VIRTUAL TABLE t2 USING rtree_i32(id, x1, x2) } {} do_test rtree8-5.2 { execsql BEGIN diff --git a/third_party/sqlite/src/ext/rtree/rtree9.test b/third_party/sqlite/src/ext/rtree/rtree9.test index 571341b2a9374..53d72017a6b19 100644 --- a/third_party/sqlite/src/ext/rtree/rtree9.test +++ b/third_party/sqlite/src/ext/rtree/rtree9.test @@ -10,11 +10,11 @@ #*********************************************************************** # This file contains tests for the r-tree module. Specifically, it tests # that custom r-tree queries (geometry callbacks) work. -# +# 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 } @@ -52,7 +52,7 @@ do_execsql_test rtree9-2.2 { do_execsql_test rtree9-3.1 { CREATE VIRTUAL TABLE rt32 USING rtree_i32(id, x1, x2, y1, y2, z1, z2); -} {} +} {} for {set i 0} {$i < 1000} {incr i} { set x [expr $i%10] set y [expr ($i/10)%10] @@ -76,8 +76,8 @@ for {set x 2} {$x<200} {incr x 2} { } {1 {SQL logic error or missing database}} } do_catchsql_test rtree9-4.3 { - SELECT id FROM rt WHERE id MATCH CAST( - (cube(5.5, 5.5, 5.5, 1, 1, 1) || X'1234567812345678') AS blob + SELECT id FROM rt WHERE id MATCH CAST( + (cube(5.5, 5.5, 5.5, 1, 1, 1) || X'1234567812345678') AS blob ) } {1 {SQL logic error or missing database}} diff --git a/third_party/sqlite/src/ext/rtree/rtreeA.test b/third_party/sqlite/src/ext/rtree/rtreeA.test index 84644e9ede67f..1cc5ff9588f78 100644 --- a/third_party/sqlite/src/ext/rtree/rtreeA.test +++ b/third_party/sqlite/src/ext/rtree/rtreeA.test @@ -11,11 +11,11 @@ # This file contains tests for the r-tree module. Specifically, it tests # that corrupt or inconsistent databases do not cause crashes in the r-tree # module. -# +# if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source $testdir/tester.tcl ifcapable !rtree { finish_test ; return } @@ -117,7 +117,7 @@ do_corruption_tests rtreeA-1.2 -error "database disk image is malformed" { } #------------------------------------------------------------------------- -# Test the libraries response if some of the entries in the %_node table +# Test the libraries response if some of the entries in the %_node table # are the wrong size. # create_t1 @@ -166,7 +166,7 @@ do_corruption_tests rtreeA-3.2 { create_t1 populate_t1 -do_test rtreeA-3.3.0 { +do_test rtreeA-3.3.0 { execsql { DELETE FROM t1 WHERE rowid = 0 } set_tree_depth t1 65535 } {65535} @@ -181,7 +181,7 @@ do_corruption_tests rtreeA-3.3 { # create_t1 populate_t1 -do_test rtreeA-4.1.0 { +do_test rtreeA-4.1.0 { set_entry_count t1 1 4000 } {4000} do_corruption_tests rtreeA-4.1 { @@ -208,7 +208,7 @@ do_corruption_tests rtreeA-5.1 { # create_t1 populate_t1 -do_execsql_test rtreeA-6.1.0 { +do_execsql_test rtreeA-6.1.0 { UPDATE t1_parent set parentnode = parentnode+1 } {} do_corruption_tests rtreeA-6.1 { diff --git a/third_party/sqlite/src/ext/rtree/rtreeB.test b/third_party/sqlite/src/ext/rtree/rtreeB.test index aeb308eca7eba..5e10604c04f2a 100644 --- a/third_party/sqlite/src/ext/rtree/rtreeB.test +++ b/third_party/sqlite/src/ext/rtree/rtreeB.test @@ -10,11 +10,11 @@ #*********************************************************************** # Make sure the rtreenode() testing function can handle entries with # 64-bit rowids. -# +# if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source $testdir/tester.tcl ifcapable !rtree { finish_test ; return } @@ -30,7 +30,7 @@ ifcapable rtree_int_only { 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 { +} else { do_test rtreeB-1.1 { db eval { CREATE VIRTUAL TABLE t1 USING rtree(ii, x0, y0, x1, y1); diff --git a/third_party/sqlite/src/ext/rtree/rtreeC.test b/third_party/sqlite/src/ext/rtree/rtreeC.test index a26c401e0d84c..cf83abd22f028 100644 --- a/third_party/sqlite/src/ext/rtree/rtreeC.test +++ b/third_party/sqlite/src/ext/rtree/rtreeC.test @@ -10,11 +10,11 @@ #*********************************************************************** # Make sure the rtreenode() testing function can handle entries with # 64-bit rowids. -# +# if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source $testdir/tester.tcl ifcapable !rtree { finish_test ; return } set testprefix rtreeC @@ -25,7 +25,7 @@ do_execsql_test 1.0 { } do_eqp_test 1.1 { - SELECT * FROM r_tree, t + SELECT * FROM r_tree, t WHERE t.x>=min_x AND t.x<=max_x AND t.y>=min_y AND t.x<=max_y } { 0 0 1 {SCAN TABLE t} @@ -52,7 +52,7 @@ do_eqp_test 1.5 { SELECT * FROM t, r_tree } { 0 0 1 {SCAN TABLE r_tree VIRTUAL TABLE INDEX 2:} - 0 1 0 {SCAN TABLE t} + 0 1 0 {SCAN TABLE t} } do_execsql_test 2.0 { @@ -78,7 +78,7 @@ db close sqlite3 db test.db do_eqp_test 2.1 { - SELECT * FROM r_tree, t + SELECT * FROM r_tree, t WHERE t.x>=min_x AND t.x<=max_x AND t.y>=min_y AND t.x<=max_y } { 0 0 1 {SCAN TABLE t} @@ -105,7 +105,7 @@ do_eqp_test 2.5 { SELECT * FROM t, r_tree } { 0 0 1 {SCAN TABLE r_tree VIRTUAL TABLE INDEX 2:} - 0 1 0 {SCAN TABLE t} + 0 1 0 {SCAN TABLE t} } #------------------------------------------------------------------------- @@ -118,7 +118,7 @@ do_execsql_test 3.1 { } do_eqp_test 3.2.1 { SELECT * FROM t1 CROSS JOIN t2 } { - 0 0 0 {SCAN TABLE t1} + 0 0 0 {SCAN TABLE t1} 0 1 1 {SCAN TABLE t2} } do_eqp_test 3.2.2 { SELECT * FROM t2 CROSS JOIN t1 } { @@ -127,10 +127,10 @@ do_eqp_test 3.2.2 { SELECT * FROM t2 CROSS JOIN t1 } { do_eqp_test 3.3.1 { SELECT * FROM t1 CROSS JOIN t3 } { 0 0 0 {SCAN TABLE t1} - 0 1 1 {SCAN TABLE t3 VIRTUAL TABLE INDEX 2:} + 0 1 1 {SCAN TABLE t3 VIRTUAL TABLE INDEX 2:} } do_eqp_test 3.3.2 { SELECT * FROM t3 CROSS JOIN t1 } { - 0 0 0 {SCAN TABLE t3 VIRTUAL TABLE INDEX 2:} + 0 0 0 {SCAN TABLE t3 VIRTUAL TABLE INDEX 2:} 0 1 1 {SCAN TABLE t1} } @@ -187,7 +187,7 @@ do_execsql_test 5.1 { do_eqp_test 5.2 { SELECT * FROM t1, rt WHERE x==id; } { - 0 0 0 {SCAN TABLE t1} + 0 0 0 {SCAN TABLE t1} 0 1 1 {SCAN TABLE rt VIRTUAL TABLE INDEX 1:} } @@ -203,7 +203,7 @@ sqlite3 db test.db do_eqp_test 5.4 { SELECT * FROM t1, rt WHERE x==id; } { - 0 0 1 {SCAN TABLE rt VIRTUAL TABLE INDEX 2:} + 0 0 1 {SCAN TABLE rt VIRTUAL TABLE INDEX 2:} 0 1 0 {SEARCH TABLE t1 USING INDEX sqlite_autoindex_t1_1 (x=?)} } @@ -215,7 +215,7 @@ sqlite3 db test.db do_eqp_test 5.6 { SELECT * FROM t1, rt WHERE x==id; } { - 0 0 0 {SCAN TABLE t1} + 0 0 0 {SCAN TABLE t1} 0 1 1 {SCAN TABLE rt VIRTUAL TABLE INDEX 1:} } @@ -239,7 +239,7 @@ do_test 5.7 { do_eqp_test 5.8 { SELECT * FROM t1, rt WHERE x==id; } { - 0 0 0 {SCAN TABLE t1} + 0 0 0 {SCAN TABLE t1} 0 1 1 {SCAN TABLE rt VIRTUAL TABLE INDEX 1:} } @@ -259,7 +259,7 @@ ifcapable rtree { db close sqlite3 db test.db do_execsql_test 6.2 { SELECT * FROM t1 } {1} - + do_test 6.3 { sqlite3 db2 test.db db2 eval { DROP TABLE sqlite_stat1 } @@ -303,24 +303,24 @@ proc do_eqp_execsql_test {tn sql res} { } do_eqp_execsql_test 7.1 { - SELECT id FROM xdir, rt, ydir + SELECT id FROM xdir, rt, ydir ON (y1 BETWEEN ymin AND ymax) WHERE (x1 BETWEEN xmin AND xmax); } { - 0 0 0 {SCAN TABLE xdir} - 0 1 2 {SCAN TABLE ydir} + 0 0 0 {SCAN TABLE xdir} + 0 1 2 {SCAN TABLE ydir} 0 2 1 {SCAN TABLE rt VIRTUAL TABLE INDEX 2:B2D3B0D1} 2 4 } do_eqp_execsql_test 7.2 { - SELECT * FROM xdir, rt LEFT JOIN ydir + SELECT * FROM xdir, rt LEFT JOIN ydir ON (y1 BETWEEN ymin AND ymax) WHERE (x1 BETWEEN xmin AND xmax); } { - 0 0 0 {SCAN TABLE xdir} + 0 0 0 {SCAN TABLE xdir} 0 1 1 {SCAN TABLE rt VIRTUAL TABLE INDEX 2:B0D1} - 0 2 2 {SCAN TABLE ydir} + 0 2 2 {SCAN TABLE ydir} 5 1 2 7 12 14 {} 5 2 2 7 8 12 10 @@ -328,24 +328,24 @@ do_eqp_execsql_test 7.2 { } do_eqp_execsql_test 7.3 { - SELECT id FROM xdir, rt CROSS JOIN ydir + SELECT id FROM xdir, rt CROSS JOIN ydir ON (y1 BETWEEN ymin AND ymax) WHERE (x1 BETWEEN xmin AND xmax); } { - 0 0 0 {SCAN TABLE xdir} + 0 0 0 {SCAN TABLE xdir} 0 1 1 {SCAN TABLE rt VIRTUAL TABLE INDEX 2:B0D1} - 0 2 2 {SCAN TABLE ydir} + 0 2 2 {SCAN TABLE ydir} 2 4 } do_eqp_execsql_test 7.4 { - SELECT id FROM rt, xdir CROSS JOIN ydir + SELECT id FROM rt, xdir CROSS JOIN ydir ON (y1 BETWEEN ymin AND ymax) WHERE (x1 BETWEEN xmin AND xmax); } { - 0 0 1 {SCAN TABLE xdir} + 0 0 1 {SCAN TABLE xdir} 0 1 0 {SCAN TABLE rt VIRTUAL TABLE INDEX 2:B0D1} - 0 2 2 {SCAN TABLE ydir} + 0 2 2 {SCAN TABLE ydir} 2 4 } diff --git a/third_party/sqlite/src/ext/rtree/rtreeD.test b/third_party/sqlite/src/ext/rtree/rtreeD.test index d846fc61ff77d..753ab74dfecf7 100644 --- a/third_party/sqlite/src/ext/rtree/rtreeD.test +++ b/third_party/sqlite/src/ext/rtree/rtreeD.test @@ -15,7 +15,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] rtree_util.tcl] source $testdir/tester.tcl source $testdir/lock_common.tcl @@ -26,7 +26,7 @@ ifcapable !rtree||!builtin_test { set testprefix rtreeD #------------------------------------------------------------------------- -# Test that if an SQLITE_BUSY is encountered within the vtable +# Test that if an SQLITE_BUSY is encountered within the vtable # constructor, a relevant error message is returned. # do_multiclient_test tn { diff --git a/third_party/sqlite/src/ext/rtree/rtreeE.test b/third_party/sqlite/src/ext/rtree/rtreeE.test index 3e5ba3a67fa93..e16c8b24e1ec2 100644 --- a/third_party/sqlite/src/ext/rtree/rtreeE.test +++ b/third_party/sqlite/src/ext/rtree/rtreeE.test @@ -10,11 +10,11 @@ #*********************************************************************** # This file contains tests for the r-tree module. Specifically, it tests # that new-style custom r-tree queries (geometry callbacks) work. -# +# 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 } @@ -28,7 +28,7 @@ register_circle_geom db do_execsql_test rtreeE-1.1 { PRAGMA page_size=512; CREATE VIRTUAL TABLE rt1 USING rtree(id,x0,x1,y0,y1); - + /* A tight pattern of small boxes near 0,0 */ WITH RECURSIVE x(x) AS (VALUES(0) UNION ALL SELECT x+1 FROM x WHERE x<4), diff --git a/third_party/sqlite/src/ext/rtree/rtreeF.test b/third_party/sqlite/src/ext/rtree/rtreeF.test index c9620d34f7e95..058d39d1059ba 100644 --- a/third_party/sqlite/src/ext/rtree/rtreeF.test +++ b/third_party/sqlite/src/ext/rtree/rtreeF.test @@ -19,15 +19,15 @@ # CREATE TABLE t1(x); # CREATE TABLE t2(y); # CREATE VIRTUAL TABLE t3 USING rtree(a,b,c); -# CREATE TRIGGER t2del AFTER DELETE ON t2 WHEN (SELECT 1 from t1) BEGIN -# DELETE FROM t3 WHERE a=old.y; +# CREATE TRIGGER t2del AFTER DELETE ON t2 WHEN (SELECT 1 from t1) BEGIN +# DELETE FROM t3 WHERE a=old.y; # END; # DELETE FROM t2 WHERE y=1; -# +# if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source $testdir/tester.tcl ifcapable !rtree { finish_test ; return } @@ -35,8 +35,8 @@ do_execsql_test rtreeF-1.1 { CREATE TABLE t1(x); CREATE TABLE t2(y); CREATE VIRTUAL TABLE t3 USING rtree(a,b,c); - CREATE TRIGGER t2dwl AFTER DELETE ON t2 WHEN (SELECT 1 from t1) BEGIN - DELETE FROM t3 WHERE a=old.y; + CREATE TRIGGER t2dwl AFTER DELETE ON t2 WHEN (SELECT 1 from t1) BEGIN + DELETE FROM t3 WHERE a=old.y; END; INSERT INTO t1(x) VALUES(999); diff --git a/third_party/sqlite/src/ext/rtree/rtreeG.test b/third_party/sqlite/src/ext/rtree/rtreeG.test index bffd17ecaacd4..8759d6ec6da75 100644 --- a/third_party/sqlite/src/ext/rtree/rtreeG.test +++ b/third_party/sqlite/src/ext/rtree/rtreeG.test @@ -14,7 +14,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source $testdir/tester.tcl ifcapable !rtree { finish_test ; return } diff --git a/third_party/sqlite/src/ext/rtree/rtree_util.tcl b/third_party/sqlite/src/ext/rtree/rtree_util.tcl index 50a1b58065111..cf9ad2fc649ff 100644 --- a/third_party/sqlite/src/ext/rtree/rtree_util.tcl +++ b/third_party/sqlite/src/ext/rtree/rtree_util.tcl @@ -33,14 +33,14 @@ proc rtree_depth {db zTab} { proc rtree_nodedepth {db zTab iNode} { set iDepth [rtree_depth $db $zTab] - + set ii $iNode while {$ii != 1} { set sql "SELECT parentnode FROM ${zTab}_parent WHERE nodeno = $ii" set ii [db one $sql] incr iDepth -1 } - + return $iDepth } @@ -76,32 +76,32 @@ proc rtree_mincells {db zTab} { return [expr {int($nMax/3)}] } -# An integrity check for the rtree $zTab accessible via database +# An integrity check for the rtree $zTab accessible via database # connection $db. # proc rtree_check {db zTab} { array unset ::checked - + # Check each r-tree node. set rc [catch { rtree_node_check $db $zTab 1 [rtree_depth $db $zTab] } msg] if {$rc && $msg ne ""} { error $msg } - # Check that the _rowid and _parent tables have the right + # Check that the _rowid and _parent tables have the right # number of entries. set nNode [$db one "SELECT count(*) FROM ${zTab}_node"] set nRow [$db one "SELECT count(*) FROM ${zTab}"] set nRowid [$db one "SELECT count(*) FROM ${zTab}_rowid"] set nParent [$db one "SELECT count(*) FROM ${zTab}_parent"] - if {$nNode != ($nParent+1)} { + if {$nNode != ($nParent+1)} { error "Wrong number of entries in ${zTab}_parent" } - if {$nRow != $nRowid} { + if {$nRow != $nRowid} { error "Wrong number of entries in ${zTab}_rowid" } - + return $rc } @@ -135,9 +135,9 @@ proc rtree_node_check {db zTab iNode iDepth} { } } - set mapping_table "${zTab}_parent" + set mapping_table "${zTab}_parent" set mapping_sql "SELECT parentnode FROM $mapping_table WHERE rowid = \$rowid" - if {$iDepth==0} { + if {$iDepth==0} { set mapping_table "${zTab}_rowid" set mapping_sql "SELECT nodeno FROM $mapping_table WHERE rowid = \$rowid" } diff --git a/third_party/sqlite/src/ext/rtree/sqlite3rtree.h b/third_party/sqlite/src/ext/rtree/sqlite3rtree.h index f683fc610af1e..8035d5ffe73c4 100644 --- a/third_party/sqlite/src/ext/rtree/sqlite3rtree.h +++ b/third_party/sqlite/src/ext/rtree/sqlite3rtree.h @@ -59,7 +59,7 @@ struct sqlite3_rtree_geometry { }; /* -** Register a 2nd-generation geometry callback named zScore that can be +** Register a 2nd-generation geometry callback named zScore that can be ** used as part of an R-Tree geometry query as follows: ** ** SELECT ... FROM WHERE MATCH $zQueryFunc(... params ...) @@ -74,7 +74,7 @@ int sqlite3_rtree_query_callback( /* -** A pointer to a structure of the following type is passed as the +** A pointer to a structure of the following type is passed as the ** argument to scored geometry callback registered using ** sqlite3_rtree_query_callback(). ** diff --git a/third_party/sqlite/src/ext/rtree/tkt3363.test b/third_party/sqlite/src/ext/rtree/tkt3363.test index db05ed527a125..cb4e948a45517 100644 --- a/third_party/sqlite/src/ext/rtree/tkt3363.test +++ b/third_party/sqlite/src/ext/rtree/tkt3363.test @@ -36,13 +36,13 @@ do_test tkt3363.1.2 { } {} do_test tkt3363.1.3 { - execsql { + execsql { SELECT count(*) FROM t1 WHERE +y2>4000425.0; } } {7} do_test tkt3363.1.4 { - execsql { + execsql { SELECT count(*) FROM t1 WHERE y2>4000425.0; } } {7} diff --git a/third_party/sqlite/src/ext/rtree/viewrtree.tcl b/third_party/sqlite/src/ext/rtree/viewrtree.tcl index 794677f5a371c..98b5a84040949 100644 --- a/third_party/sqlite/src/ext/rtree/viewrtree.tcl +++ b/third_party/sqlite/src/ext/rtree/viewrtree.tcl @@ -35,8 +35,8 @@ label .title -anchor w -text "Node 1:" -background white -borderwidth 0 set rtree_tables [list] db eval { - SELECT name - FROM sqlite_master + SELECT name + FROM sqlite_master WHERE type='table' AND sql LIKE '%virtual%table%using%rtree%' } { set nCol [expr [llength [db eval "pragma table_info($name)"]]/6] diff --git a/third_party/sqlite/src/ext/session/changeset.c b/third_party/sqlite/src/ext/session/changeset.c index edb43ff8e52d6..88db9da1b47f3 100644 --- a/third_party/sqlite/src/ext/session/changeset.c +++ b/third_party/sqlite/src/ext/session/changeset.c @@ -73,7 +73,7 @@ static void readFile(const char *zFilename, int *pSz, void **ppBuf){ ** digits. */ static const char hexdigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' + '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; /* @@ -412,5 +412,5 @@ int main(int argc, char **argv){ /* If nothing else matches, show the usage comment */ usage(argv[0]); sqlite3_free(pBuf); - return 0; + return 0; } diff --git a/third_party/sqlite/src/ext/session/session1.test b/third_party/sqlite/src/ext/session/session1.test index c96c248c5e86d..d134ebed80bff 100644 --- a/third_party/sqlite/src/ext/session/session1.test +++ b/third_party/sqlite/src/ext/session/session1.test @@ -13,7 +13,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} @@ -71,7 +71,7 @@ if {$tn==1} { } #------------------------------------------------------------------------- -# Simple changeset tests. Also test the sqlite3changeset_invert() +# Simple changeset tests. Also test the sqlite3changeset_invert() # function. # do_test $tn.2.1.1 { @@ -118,7 +118,7 @@ do_test $tn.2.3.1 { execsql { INSERT INTO t1 VALUES(2, 'Ayutthaya') } execsql { INSERT INTO t1 VALUES(3, 'Thonburi') } S attach t1 - execsql { + execsql { UPDATE t1 SET x = 10 WHERE x = 1; UPDATE t1 SET y = 'Surin' WHERE x = 2; UPDATE t1 SET x = 20, y = 'Thapae' WHERE x = 3; @@ -126,18 +126,18 @@ do_test $tn.2.3.1 { } {} do_changeset_test $tn.2.3.2 S { - {INSERT t1 0 X. {} {i 10 t Sukhothai}} - {DELETE t1 0 X. {i 1 t Sukhothai} {}} - {UPDATE t1 0 X. {i 2 t Ayutthaya} {{} {} t Surin}} - {DELETE t1 0 X. {i 3 t Thonburi} {}} - {INSERT t1 0 X. {} {i 20 t Thapae}} + {INSERT t1 0 X. {} {i 10 t Sukhothai}} + {DELETE t1 0 X. {i 1 t Sukhothai} {}} + {UPDATE t1 0 X. {i 2 t Ayutthaya} {{} {} t Surin}} + {DELETE t1 0 X. {i 3 t Thonburi} {}} + {INSERT t1 0 X. {} {i 20 t Thapae}} } do_changeset_invert_test $tn.2.3.3 S { - {DELETE t1 0 X. {i 10 t Sukhothai} {}} - {INSERT t1 0 X. {} {i 1 t Sukhothai}} - {UPDATE t1 0 X. {i 2 t Surin} {{} {} t Ayutthaya}} - {INSERT t1 0 X. {} {i 3 t Thonburi}} + {DELETE t1 0 X. {i 10 t Sukhothai} {}} + {INSERT t1 0 X. {} {i 1 t Sukhothai}} + {UPDATE t1 0 X. {i 2 t Surin} {{} {} t Ayutthaya}} + {INSERT t1 0 X. {} {i 3 t Thonburi}} {DELETE t1 0 X. {i 20 t Thapae} {}} } do_test $tn.2.3.4 { S delete } {} @@ -154,7 +154,7 @@ do_test $tn.2.4.4 { S delete } {} #------------------------------------------------------------------------- # Test the application of simple changesets. These tests also test that -# the conflict callback is invoked correctly. For these tests, the +# the conflict callback is invoked correctly. For these tests, the # conflict callback always returns OMIT. # db close @@ -162,9 +162,9 @@ forcedelete test.db test.db2 sqlite3 db test.db sqlite3 db2 test.db2 -proc xConflict {args} { +proc xConflict {args} { lappend ::xConflict $args - return "" + return "" } proc bgerror {args} { set ::background_error $args } @@ -206,11 +206,11 @@ proc do_db2_test {testname sql {result {}}} { # do_test $tn.3.1.0 { execsql { CREATE TABLE t1(a PRIMARY KEY, b NOT NULL) %WR% } db2 - execsql { + execsql { CREATE TABLE t1(a PRIMARY KEY, b) %WR%; INSERT INTO t1 VALUES(1, 'one'); INSERT INTO t1 VALUES(2, 'two'); - } db + } db } {} do_db2_test $tn.3.1.1 "INSERT INTO t1 VALUES(6, 'VI')" do_conflict_test $tn.3.1.2 -tables t1 -sql { @@ -320,14 +320,14 @@ foreach {tn2 conflict_return after} { do_test $tn.4.$tn2.1 { foreach db {db db2} { - execsql { + execsql { CREATE TABLE t1(a, b, c, PRIMARY KEY(a))%WR%; INSERT INTO t1 VALUES(1, 2, 3); INSERT INTO t1 VALUES(4, 5, 6); INSERT INTO t1 VALUES(7, 8, 9); } $db } - execsql { + execsql { REPLACE INTO t1 VALUES(4, 5, 7); REPLACE INTO t1 VALUES(10, 'x', 'x'); } db2 @@ -361,7 +361,7 @@ foreach {tn2 conflict_return} { # Add some rows to [db2]. These rows will cause conflicts later # on when the changeset from [db] is applied to it. - execsql { + execsql { INSERT INTO "'foolish name'" VALUES('one', 'one', 'ii'); INSERT INTO "'foolish name'" VALUES('one', 'two', 'i'); INSERT INTO "'foolish name'" VALUES('two', 'two', 'ii'); @@ -391,7 +391,7 @@ foreach {tn2 conflict_return} { execsql $schema db execsql $schema db2 - execsql { + execsql { UPDATE d1 SET y = 'TWO' WHERE "z""z" = 2; } db2 @@ -454,7 +454,7 @@ do_iterator_test $tn.7.1 * { INSERT INTO aux.t1 VALUES('three', 3); INSERT INTO aux.t1 VALUES('four', 4); } { - {INSERT t1 0 X. {} {t two i 2}} + {INSERT t1 0 X. {} {t two i 2}} {INSERT t1 0 X. {} {t one i 1}} } @@ -510,15 +510,15 @@ do_execsql_test $tn.9.1 { CREATE TABLE t7(a, b, c, d, e PRIMARY KEY, f, g)%WR%; INSERT INTO t7 VALUES(1, 1, 1, 1, 1, 1, 1); } -do_test $tn.9.2 { - sqlite3session S db main +do_test $tn.9.2 { + sqlite3session S db main S attach * execsql { UPDATE t7 SET b=2, d=2 } } {} do_changeset_test $tn.9.2 S {{UPDATE t7 0 ....X.. {{} {} i 1 {} {} i 1 i 1 {} {} {} {}} {{} {} i 2 {} {} i 2 {} {} {} {} {} {}}}} S delete catch { db2 close } - + #------------------------------------------------------------------------- # Test a really long table name. # @@ -531,7 +531,7 @@ do_test $tn.10.1.1 { " sqlite3session S db main S attach $tblname - execsql " + execsql " INSERT INTO $tblname VALUES('uvw', 'abc'); DELETE FROM $tblname WHERE a = 'xyz'; " @@ -572,7 +572,7 @@ do_test $tn.10.1.1 { " sqlite3session S db main S attach $tblname - execsql " + execsql " INSERT INTO $tblname VALUES('uvw', 'abc'); DELETE FROM $tblname WHERE a = 'xyz'; " diff --git a/third_party/sqlite/src/ext/session/session2.test b/third_party/sqlite/src/ext/session/session2.test index cd8c2869e79b5..d74ed60cce07a 100644 --- a/third_party/sqlite/src/ext/session/session2.test +++ b/third_party/sqlite/src/ext/session/session2.test @@ -14,7 +14,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} @@ -34,7 +34,7 @@ proc test_reset {} { ########################################################################## test_reset -do_execsql_test 1.0 { +do_execsql_test 1.0 { CREATE TABLE t1(a PRIMARY KEY, b); INSERT INTO t1 VALUES('i', 'one'); } @@ -42,7 +42,7 @@ do_iterator_test 1.1 t1 { DELETE FROM t1 WHERE a = 'i'; INSERT INTO t1 VALUES('ii', 'two'); } { - {DELETE t1 0 X. {t i t one} {}} + {DELETE t1 0 X. {t i t one} {}} {INSERT t1 0 X. {} {t ii t two}} } @@ -71,7 +71,7 @@ do_iterator_test 1.4 t1 { # set set_of_tests { - 1 { INSERT INTO %T1% VALUES(1, 2) } + 1 { INSERT INTO %T1% VALUES(1, 2) } 2 { INSERT INTO %T2% VALUES(1, NULL); @@ -80,7 +80,7 @@ set set_of_tests { DELETE FROM %T2% WHERE a = 2; INSERT INTO %T2% VALUES(4, NULL); UPDATE %T2% SET b=0 WHERE b=1; - } + } 3 { INSERT INTO %T3% SELECT *, NULL FROM %T2% } @@ -93,18 +93,18 @@ set set_of_tests { 6 { UPDATE %T1% SET a = 32 } - 7 { - INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; - INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; - INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; - INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; - INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; - INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; - INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; - INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; - INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; - INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; - INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; + 7 { + INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; + INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; + INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; + INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; + INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; + INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; + INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; + INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; + INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; + INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; + INSERT INTO %T1% SELECT randomblob(32), randomblob(32) FROM %T1%; DELETE FROM %T1% WHERE (rowid%3)==0; } @@ -136,7 +136,7 @@ set set_of_tests { DELETE FROM %T1% WHERE 1; -- Insert many rows with real primary keys. Enough to force the session - -- objects hash table to resize. + -- objects hash table to resize. INSERT INTO %T1% VALUES(0.1, 0.1); INSERT INTO %T1% SELECT a+0.1, b+0.1 FROM %T1%; INSERT INTO %T1% SELECT a+0.2, b+0.2 FROM %T1%; @@ -172,11 +172,11 @@ set set_of_tests { 18 { DELETE FROM %T4% WHERE 1 } - 19 { + 19 { INSERT INTO t1 VALUES('', ''); INSERT INTO t1 VALUES(X'', X''); } - 20 { + 20 { DELETE FROM t1; INSERT INTO t1 VALUES('', NULL); } @@ -251,7 +251,7 @@ foreach {tn sql changeset} { INSERT INTO t1 VALUES(NULL); INSERT INTO t1 VALUES(456); } { - {INSERT t1 0 X {} {i 456}} + {INSERT t1 0 X {} {i 456}} {INSERT t1 0 X {} {i 123}} } @@ -264,10 +264,10 @@ foreach {tn sql changeset} { 3 { DELETE FROM t1 } { } - 4 { + 4 { INSERT INTO t3 VALUES(NULL, NULL) } { - {INSERT t3 0 .X {} {n {} i 1}} + {INSERT t3 0 .X {} {n {} i 1}} } 5 { INSERT INTO t2 VALUES(1, 2, NULL) } { } @@ -294,10 +294,10 @@ do_execsql_test 5.0 { foreach {tn sql changeset} { 1 { INSERT INTO t1 VALUES(35) } { {INSERT t1 0 X {} {i 35}} } 2 { INSERT INTO t2 VALUES(36, 37) } { {INSERT t2 0 .X {} {i 36 i 37}} } - 3 { + 3 { DELETE FROM t1 WHERE 1; UPDATE t2 SET x = 34; - } { + } { {DELETE t1 0 X {i 35} {}} {UPDATE t2 0 .X {i 36 i 37} {i 34 {} {}}} } @@ -306,7 +306,7 @@ foreach {tn sql changeset} { } #------------------------------------------------------------------------- -# The next block of tests verify that the "indirect" flag is set +# The next block of tests verify that the "indirect" flag is set # correctly within changesets. The indirect flag is set for a change # if either of the following are true: # @@ -314,8 +314,8 @@ foreach {tn sql changeset} { # indirect flag to true, or # * The change was made by a trigger. # -# If the same row is updated more than once during a session, then the -# change is considered indirect only if all changes meet the criteria +# If the same row is updated more than once during a session, then the +# change is considered indirect only if all changes meet the criteria # above. # test_reset @@ -414,7 +414,7 @@ do_iterator_test 6.1.8 * { UPDATE t4 SET a = 'two' WHERE b = 1; } { {INSERT t3 1 .X {} {t two i 1}} - {INSERT t4 0 .X {} {t two i 1}} + {INSERT t4 0 .X {} {t two i 1}} } sqlite3session S db main @@ -480,7 +480,7 @@ do_test 7.2.2 { do_test 7.2.3 { execsql { SELECT * FROM t1 } db2 } {1 one} #------------------------------------------------------------------------- -# Test that if a conflict-handler returns ABORT, application of the +# Test that if a conflict-handler returns ABORT, application of the # changeset is rolled back and the sqlite3changeset_apply() method returns # SQLITE_ABORT. # @@ -496,7 +496,7 @@ foreach {tn conflict_return apply_return} { proc xConflict {args} [list return $conflict_return] do_test 8.$tn.0 { - do_common_sql { + do_common_sql { CREATE TABLE t1(x, y, PRIMARY KEY(x, y)); INSERT INTO t1 VALUES('x', 'y'); } @@ -536,7 +536,7 @@ foreach {tn conflict_return apply_return} { # each change in the changeset. # test_reset -proc xConflict {type args} { +proc xConflict {type args} { if {$type == "CONFLICT"} { return REPLACE } return OMIT } diff --git a/third_party/sqlite/src/ext/session/session3.test b/third_party/sqlite/src/ext/session/session3.test index ba316348ef2a3..87ef94ef1e9f0 100644 --- a/third_party/sqlite/src/ext/session/session3.test +++ b/third_party/sqlite/src/ext/session/session3.test @@ -11,11 +11,11 @@ # This file implements regression tests for the session module. More # specifically, it focuses on testing the session modules response to # database schema modifications and mismatches. -# +# if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} @@ -24,7 +24,7 @@ set testprefix session3 #------------------------------------------------------------------------- # These tests - session3-1.* - verify that the session module behaves -# correctly when confronted with a schema mismatch when applying a +# correctly when confronted with a schema mismatch when applying a # changeset (in function sqlite3changeset_apply()). # # session3-1.1.*: Table does not exist in target db. @@ -69,7 +69,7 @@ do_test 1.2.2 { } {5 6 {} 7 8 {}} do_test 1.3.0 { - execsql { + execsql { DROP TABLE t1; CREATE TABLE t1(a, b PRIMARY KEY); } db2 @@ -94,7 +94,7 @@ do_test 1.3.1 { # # In all of these scenarios, the call to sqlite3session_changeset() will # return SQLITE_SCHEMA. Also: -# +# # session3-2.4.*: Table is dropped and recreated with an identical schema. # In this case sqlite3session_changeset() returns SQLITE_OK. # @@ -125,7 +125,7 @@ do_test 2.2.1 { do_test 2.2.2 { S delete sqlite3session S db main - execsql { + execsql { DROP TABLE t2; CREATE TABLE t2(a, b PRIMARY KEY, c); } @@ -140,7 +140,7 @@ do_test 2.2.2 { do_test 2.2.3 { S delete sqlite3session S db main - execsql { + execsql { DROP TABLE t2; CREATE TABLE t2(a, b PRIMARY KEY, c); } @@ -156,7 +156,7 @@ do_test 2.2.3 { do_test 2.2.4 { S delete sqlite3session S db main - execsql { + execsql { DROP TABLE t2; CREATE TABLE t2(a, b PRIMARY KEY, c); } @@ -173,7 +173,7 @@ do_test 2.2.4 { do_test 2.3 { S delete sqlite3session S db main - execsql { + execsql { DROP TABLE t2; CREATE TABLE t2(a, b PRIMARY KEY); } @@ -189,7 +189,7 @@ do_test 2.3 { do_test 2.4 { S delete sqlite3session S db main - execsql { + execsql { DROP TABLE t2; CREATE TABLE t2(a, b PRIMARY KEY); } diff --git a/third_party/sqlite/src/ext/session/session4.test b/third_party/sqlite/src/ext/session/session4.test index 120a230b577d4..7e5b6c774077a 100644 --- a/third_party/sqlite/src/ext/session/session4.test +++ b/third_party/sqlite/src/ext/session/session4.test @@ -8,12 +8,12 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for the session module. -# +# This file implements regression tests for the session module. +# if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} diff --git a/third_party/sqlite/src/ext/session/session5.test b/third_party/sqlite/src/ext/session/session5.test index 9b8f9ffe12f95..e2ab5bbad70bf 100644 --- a/third_party/sqlite/src/ext/session/session5.test +++ b/third_party/sqlite/src/ext/session/session5.test @@ -8,13 +8,13 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for the session module. +# This file implements regression tests for the session module. # Specifically, for the sqlite3changeset_concat() command. -# +# if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} @@ -23,11 +23,11 @@ set testprefix session5 # Organization of tests: # -# session5-1.*: Simple tests to check the concat() function produces +# session5-1.*: Simple tests to check the concat() function produces # correct results. # # session5-2.*: More complicated tests. -# +# # session5-3.*: Schema mismatch errors. # # session5-4.*: Test the concat cases that indicate that the database @@ -140,7 +140,7 @@ do_concat_test 1.2.7 { #------------------------------------------------------------------------- # Test cases session5-2.* - more complex tests. # -db function indirect indirect +db function indirect indirect proc indirect {{x -1}} { S indirect $x s_prev indirect $x @@ -165,11 +165,11 @@ do_concat_test 2.1 { INSERT INTO def SELECT d, e, f+4 FROM def; } { DELETE FROM def WHERE rowid>4; -} { - INSERT INTO def SELECT d, e, f+4 FROM def; +} { + INSERT INTO def SELECT d, e, f+4 FROM def; } { INSERT INTO abc VALUES(22, 44, -1); -} { +} { UPDATE abc SET c=-2 WHERE c=-1; UPDATE abc SET c=-3 WHERE c=-2; } { @@ -220,7 +220,7 @@ do_test 2.3.0 { catch {db close} forcedelete test.db sqlite3 db test.db - + set sql1 "" set sql2 "" for {set i 1} {$i < 120} {incr i} { @@ -314,7 +314,7 @@ do_test 3.1 { execsql { CREATE TABLE t1(a PRIMARY KEY, b) } set c1 [changeset_from_sql { INSERT INTO t1 VALUES(1, 2) }] - execsql { + execsql { DROP TABLE t1; CREATE TABLE t1(a PRIMARY KEY, b, c); } @@ -330,7 +330,7 @@ do_test 3.2 { execsql { CREATE TABLE t1(a PRIMARY KEY, b) } set c1 [changeset_from_sql { INSERT INTO t1 VALUES(1, 2) }] - execsql { + execsql { DROP TABLE t1; CREATE TABLE t1(a, b PRIMARY KEY); } diff --git a/third_party/sqlite/src/ext/session/session6.test b/third_party/sqlite/src/ext/session/session6.test index 8a1f172cde6d8..119571b1843c3 100644 --- a/third_party/sqlite/src/ext/session/session6.test +++ b/third_party/sqlite/src/ext/session/session6.test @@ -15,7 +15,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} diff --git a/third_party/sqlite/src/ext/session/session8.test b/third_party/sqlite/src/ext/session/session8.test index 9f70fe2829bf3..ea091d296f8cc 100644 --- a/third_party/sqlite/src/ext/session/session8.test +++ b/third_party/sqlite/src/ext/session/session8.test @@ -13,7 +13,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} @@ -47,7 +47,7 @@ proc do_then_undo {tn sql} { db eval $sql set ck2 [udbcksum db main] - + set invert [sqlite3changeset_invert [S changeset]] S delete sqlite3changeset_apply db $invert noop diff --git a/third_party/sqlite/src/ext/session/session9.test b/third_party/sqlite/src/ext/session/session9.test index ebb88ffade730..44a0ca6a096e6 100644 --- a/third_party/sqlite/src/ext/session/session9.test +++ b/third_party/sqlite/src/ext/session/session9.test @@ -15,7 +15,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} @@ -31,7 +31,7 @@ proc populate_db {} { PRAGMA foreign_keys = 1; CREATE TABLE p1(a PRIMARY KEY, b); CREATE TABLE c1(a PRIMARY KEY, b REFERENCES p1); - CREATE TABLE c2(a PRIMARY KEY, + CREATE TABLE c2(a PRIMARY KEY, b REFERENCES p1 DEFERRABLE INITIALLY DEFERRED ); @@ -133,8 +133,8 @@ foreach {tn open noclose close} { #-------------------------------------------------------------------- # Test that a cyclic relationship can be inserted and deleted. # -# This situation does not come up in practice, but testing it serves to -# show that it does not matter which order parent and child keys +# This situation does not come up in practice, but testing it serves to +# show that it does not matter which order parent and child keys # are processed in internally when applying a changeset. # drop_all_tables @@ -145,7 +145,7 @@ do_execsql_test 3.1 { } # Create changesets as follows: -# +# # $cc1 - Insert a row into t1. # $cc2 - Insert a row into t2. # $cc - Combination of $cc1 and $cc2. @@ -177,8 +177,8 @@ do_test 3.2 { # Now modify the database schema to create a cyclic foreign key dependency # between tables t1 and t2. This means that although changesets $cc and # $ccdel can be applied, none of the others may without violating the -# foreign key constraints. -# +# foreign key constraints. +# do_test 3.3 { drop_all_tables @@ -221,7 +221,7 @@ do_test 3.5.2 { } {1 SQLITE_CONSTRAINT} #-------------------------------------------------------------------- -# Test that if a change that affects FK processing is not applied +# Test that if a change that affects FK processing is not applied # due to a separate constraint, SQLite does not get confused and # increment FK counters anyway. # @@ -245,15 +245,15 @@ do_execsql_test 4.3.1 { PRAGMA defer_foreign_keys = 1; INSERT INTO c1 VALUES(1, 1); } -do_catchsql_test 4.3.2 { - INSERT INTO c1 VALUES(1, 'x') +do_catchsql_test 4.3.2 { + INSERT INTO c1 VALUES(1, 'x') } {1 {UNIQUE constraint failed: c1.a}} do_catchsql_test 4.3.3 { COMMIT } {0 {}} do_catchsql_test 4.3.4 { BEGIN ; COMMIT } {0 {}} #-------------------------------------------------------------------- -# Test that if a DELETE change cannot be applied due to an +# Test that if a DELETE change cannot be applied due to an # SQLITE_CONSTRAINT error thrown by a trigger program, things do not # go awry. diff --git a/third_party/sqlite/src/ext/session/sessionA.test b/third_party/sqlite/src/ext/session/sessionA.test index 0e0a14e38a91c..991b39d0796f5 100644 --- a/third_party/sqlite/src/ext/session/sessionA.test +++ b/third_party/sqlite/src/ext/session/sessionA.test @@ -14,7 +14,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} @@ -43,7 +43,7 @@ do_test 2.1 { set ::table_filter(t3) 1 sqlite3session S db main - S table_filter tbl_filter + S table_filter tbl_filter execsql { INSERT INTO t1 VALUES('a', 'b'); @@ -63,7 +63,7 @@ do_test 2.1 { } {a b e f} #------------------------------------------------------------------------- -# Test that filter callbacks passed to sqlite3changeset_apply() are +# Test that filter callbacks passed to sqlite3changeset_apply() are # invoked correctly. # reset_db @@ -74,7 +74,7 @@ do_execsql_test 3.1 { do_test 3.2 { execsql BEGIN - set ::cs [changeset_from_sql { + set ::cs [changeset_from_sql { INSERT INTO t1 VALUES(1, 2); INSERT INTO t2 VALUES('x', 'y'); }] @@ -82,8 +82,8 @@ do_test 3.2 { set {} {} } {} -proc filter {x y} { - return [string equal $x $y] +proc filter {x y} { + return [string equal $x $y] } do_test 3.3 { diff --git a/third_party/sqlite/src/ext/session/sessionB.test b/third_party/sqlite/src/ext/session/sessionB.test index eae41f76ad179..21553a7332e6a 100644 --- a/third_party/sqlite/src/ext/session/sessionB.test +++ b/third_party/sqlite/src/ext/session/sessionB.test @@ -15,7 +15,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} @@ -23,12 +23,12 @@ ifcapable !session {finish_test; return} set testprefix sessionB # -# 1.*: Test that the blobs returned by the session_patchset() API are +# 1.*: Test that the blobs returned by the session_patchset() API are # as expected. Also the sqlite3_changeset_iter functions. # # 2.*: Test that patchset blobs are handled by sqlite3changeset_apply(). # -# 3.*: Test that sqlite3changeset_invert() works with patchset blobs. +# 3.*: Test that sqlite3changeset_invert() works with patchset blobs. # Correct behaviour is to return SQLITE_CORRUPT. proc do_sql2patchset_test {tn sql res} { @@ -81,7 +81,7 @@ do_sql2patchset_test 1.5 { INSERT INTO t1 VALUES(X'61626364', NULL, NULL, 4.2); INSERT INTO t1 VALUES(4.2, NULL, NULL, X'61626364'); } { - {INSERT t1 0 X..X {} {f 4.2 n {} n {} b abcd}} + {INSERT t1 0 X..X {} {f 4.2 n {} n {} b abcd}} {INSERT t1 0 X..X {} {b abcd n {} n {} f 4.2}} } @@ -104,7 +104,7 @@ do_sql2patchset_test 1.7 { do_sql2patchset_test 1.8 { DELETE FROM t1; } { - {DELETE t1 0 X..X {f 4.2 {} {} {} {} b abcd} {}} + {DELETE t1 0 X..X {f 4.2 {} {} {} {} b abcd} {}} {DELETE t1 0 X..X {b abcd {} {} {} {} f 4.2} {}} } @@ -208,7 +208,7 @@ do_patchconcat_test 4.1.2 { } { INSERT INTO t1 VALUES(4, 5, 6); } { - {INSERT t1 0 X.. {} {i 1 i 2 i 3}} + {INSERT t1 0 X.. {} {i 1 i 2 i 3}} {INSERT t1 0 X.. {} {i 4 i 5 i 6}} } @@ -222,7 +222,7 @@ do_patchconcat_test 4.2.2 { } { UPDATE t1 SET z = 'def' WHERE x=4 } { - {UPDATE t1 0 X.. {i 1 {} {} {} {}} {{} {} {} {} t abc}} + {UPDATE t1 0 X.. {i 1 {} {} {} {}} {{} {} {} {} t abc}} {UPDATE t1 0 X.. {i 4 {} {} {} {}} {{} {} {} {} t def}} } @@ -231,7 +231,7 @@ do_patchconcat_test 4.2.3 { } { DELETE FROM t1 WHERE x=4; } { - {DELETE t1 0 X.. {i 1 {} {} {} {}} {}} + {DELETE t1 0 X.. {i 1 {} {} {} {}} {}} {DELETE t1 0 X.. {i 4 {} {} {} {}} {}} } @@ -244,7 +244,7 @@ do_execsql_test 4.3.1 { INSERT INTO t2 VALUES('.', 2, 2, '.'); } -# INSERT + INSERT +# INSERT + INSERT do_patchconcat_test 4.3.2 -revert { INSERT INTO t2 VALUES('a', 'a', 'a', 'a'); } { @@ -253,7 +253,7 @@ do_patchconcat_test 4.3.2 -revert { {INSERT t2 0 .XX. {} {t a t a t a t a}} } -# INSERT + DELETE +# INSERT + DELETE do_patchconcat_test 4.3.3 { INSERT INTO t2 VALUES('a', 'a', 'a', 'a'); } { @@ -294,7 +294,7 @@ do_patchconcat_test 4.3.7 { } { INSERT INTO t2 VALUES('x', 1, 2, '.'); } { - {DELETE t2 0 .XX. {{} {} i 1 i 1 {} {}} {}} + {DELETE t2 0 .XX. {{} {} i 1 i 1 {} {}} {}} {UPDATE t2 0 .XX. {{} {} i 1 i 2 {} {}} {t x {} {} {} {} t .}} } @@ -304,7 +304,7 @@ do_patchconcat_test 4.3.8 -revert { } { UPDATE t2 SET a=5 WHERE b=1 AND c=2; } { - {DELETE t2 0 .XX. {{} {} i 1 i 2 {} {}} {}} + {DELETE t2 0 .XX. {{} {} i 1 i 2 {} {}} {}} } # DELETE + UPDATE @@ -313,17 +313,17 @@ do_patchconcat_test 4.3.9 -revert { } { DELETE FROM t2 WHERE b=1; } { - {DELETE t2 0 .XX. {{} {} i 1 i 1 {} {}} {}} - {DELETE t2 0 .XX. {{} {} i 1 i 2 {} {}} {}} + {DELETE t2 0 .XX. {{} {} i 1 i 1 {} {}} {}} + {DELETE t2 0 .XX. {{} {} i 1 i 2 {} {}} {}} } #------------------------------------------------------------------------- # More rigorous testing of the _patchset(), _apply and _concat() APIs. # -# The inputs to each test are a populate database and a list of DML +# The inputs to each test are a populate database and a list of DML # statements. This test determines that the final database is the same # if: -# +# # 1) the statements are executed directly on the database. # # 2) a single patchset is collected while executing the statements and @@ -366,15 +366,15 @@ proc do_patchset_test {tn tstcmd lSql} { forcecopy test.db $fname } - # Execute the SQL statements on [db]. Collect a patchset for each - # individual statement, as well as a single patchset for the entire + # Execute the SQL statements on [db]. Collect a patchset for each + # individual statement, as well as a single patchset for the entire # operation. sqlite3session S db main S attach * - foreach sql $lSql { + foreach sql $lSql { sqlite3session T db main T attach * - db eval $sql + db eval $sql lappend lPatch [T $tstcmd] T delete } @@ -389,7 +389,7 @@ proc do_patchset_test {tn tstcmd lSql} { sqlite3changeset_apply db2 $patchset noop uplevel [list do_test $tn.1 { databasecksum db2 } $cksum ] db2 close - + # 2. Apply each of the single-statement patchsets to test.db3 sqlite3 db2 test.db3 foreach p $lPatch { @@ -467,7 +467,7 @@ do_patchset_changeset_test 5.1 { } { UPDATE t1 SET c=c+1; DELETE FROM t1 WHERE (a%2); -} +} do_patchset_changeset_test 5.2 { CREATE TABLE t1(a PRIMARY KEY, b, c); diff --git a/third_party/sqlite/src/ext/session/sessionC.test b/third_party/sqlite/src/ext/session/sessionC.test index 390a31deb63da..dd48c5f8af19f 100644 --- a/third_party/sqlite/src/ext/session/sessionC.test +++ b/third_party/sqlite/src/ext/session/sessionC.test @@ -13,7 +13,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} @@ -27,7 +27,7 @@ set testprefix sessionC # program raises a constraint somehow. # # UPDATE: The above is no longer true, as "PRAGMA defer_foreign_keys" -# now disables "RESTRICT" processing. The test below has been rewritten +# now disables "RESTRICT" processing. The test below has been rewritten # to use a trigger instead of a foreign key to test this case. # do_execsql_test 1.0 { @@ -73,7 +73,7 @@ do_test 1.3.1 { set msg } {} do_execsql_test 1.3.2 { SELECT * FROM c } {1 one 3 three 2 two 4 one} -do_execsql_test 1.3.3 { +do_execsql_test 1.3.3 { SELECT * FROM p; } {one 1 1 two 2 2 three 3 3} diff --git a/third_party/sqlite/src/ext/session/sessionD.test b/third_party/sqlite/src/ext/session/sessionD.test index b8572782e266d..4749e74617d44 100644 --- a/third_party/sqlite/src/ext/session/sessionD.test +++ b/third_party/sqlite/src/ext/session/sessionD.test @@ -13,7 +13,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} @@ -32,8 +32,8 @@ proc scksum {db dbname} { set txt [$db eval "SELECT * FROM $master ORDER BY type,name,sql"] foreach tab $alltab { set cols [list] - db eval "PRAGMA $dbname.table_info = $tab" x { - lappend cols "quote($x(name))" + db eval "PRAGMA $dbname.table_info = $tab" x { + lappend cols "quote($x(name))" } set cols [join $cols ,] append txt [db eval "SELECT $cols FROM $tab ORDER BY $cols"] @@ -148,20 +148,20 @@ do_diff_test 2.4 { INSERT INTO t1 VALUES('hvkzyipambwdqlvwv','',-458331.50,X'DA51ED5E84'); INSERT INTO t1 VALUES(X'C5C6B5DD','jjxrath',40917,830244); INSERT INTO t1 VALUES(-204877.54,X'1704C253D5F3AFA8',155120.88,NULL); - INSERT INTO t1 + INSERT INTO t1 VALUES('ckmqmzoeuvxisxqy',X'EB5A5D3A1DD22FD1','tidhjcbvbppdt',-642987.37); INSERT INTO t1 VALUES(-851726,-161992,-469943,-159541); INSERT INTO t1 VALUES(X'4A6A667F858938',185083,X'7A',NULL); INSERT INTO aux.t1 VALUES(415075.74,'auawczkb',X'',X'57B4FAAF2595'); INSERT INTO aux.t1 VALUES(727637,711560,-181340,'hphuo'); - INSERT INTO aux.t1 + INSERT INTO aux.t1 VALUES(-921322.81,662959,'lvlgwdgxaurr','ajjrzrbhqflsutnymgc'); INSERT INTO aux.t1 VALUES(-146061,-377892,X'4E','gepvpvvuhszpxabbb'); INSERT INTO aux.t1 VALUES(-851726,-161992,-469943,-159541); INSERT INTO aux.t1 VALUES(X'4A6A667F858938',185083,X'7A',NULL); INSERT INTO aux.t1 VALUES(-204877.54,X'1704C253D5F3AFA8',155120.88, 4); - INSERT INTO aux.t1 + INSERT INTO aux.t1 VALUES('ckmqmzoeuvxisxqy',X'EB5A5D3A1DD22FD1','tidgtsplhjcbvbppdt',-642987.3); } @@ -187,8 +187,8 @@ do_empty_diff_test 3.1 #------------------------------------------------------------------------- # Test some error cases: -# -# 1) schema mismatches between the two dbs, and +# +# 1) schema mismatches between the two dbs, and # 2) tables with no primary keys. This is not actually an error, but # should not add any changes to the session object. # diff --git a/third_party/sqlite/src/ext/session/sessionE.test b/third_party/sqlite/src/ext/session/sessionE.test index 27e530ec7f741..0e5fe3ee1f1d3 100644 --- a/third_party/sqlite/src/ext/session/sessionE.test +++ b/third_party/sqlite/src/ext/session/sessionE.test @@ -18,7 +18,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} diff --git a/third_party/sqlite/src/ext/session/sessionF.test b/third_party/sqlite/src/ext/session/sessionF.test index ba57bf85ec927..14dd888c3882f 100644 --- a/third_party/sqlite/src/ext/session/sessionF.test +++ b/third_party/sqlite/src/ext/session/sessionF.test @@ -18,7 +18,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} @@ -52,8 +52,8 @@ foreach {tn setup result} { 1 { S attach * } { - {INSERT t2 0 X. {} {i 2 t two}} - {INSERT t1 0 X. {} {i 1 t one}} + {INSERT t2 0 X. {} {i 2 t two}} + {INSERT t1 0 X. {} {i 1 t one}} {INSERT t3 0 X. {} {i 3 t three}} } @@ -61,8 +61,8 @@ foreach {tn setup result} { S attach t1 S attach * } { - {INSERT t1 0 X. {} {i 1 t one}} - {INSERT t2 0 X. {} {i 2 t two}} + {INSERT t1 0 X. {} {i 1 t one}} + {INSERT t2 0 X. {} {i 2 t two}} {INSERT t3 0 X. {} {i 3 t three}} } @@ -72,8 +72,8 @@ foreach {tn setup result} { S attach t1 } { {INSERT t3 0 X. {} {i 3 t three}} - {INSERT t2 0 X. {} {i 2 t two}} - {INSERT t1 0 X. {} {i 1 t one}} + {INSERT t2 0 X. {} {i 2 t two}} + {INSERT t1 0 X. {} {i 1 t one}} } } { execsql { @@ -100,9 +100,9 @@ foreach {tn setup result} { 1 { S attach * } { - {INSERT t2 0 X. {} {i 4 t four}} + {INSERT t2 0 X. {} {i 4 t four}} {INSERT t2 0 X. {} {i 5 t five}} - {INSERT t1 0 X. {} {i 1 t one}} + {INSERT t1 0 X. {} {i 1 t one}} {INSERT t3 0 X. {} {i 6 t six}} } @@ -110,8 +110,8 @@ foreach {tn setup result} { S attach t1 S attach * } { - {INSERT t1 0 X. {} {i 1 t one}} - {INSERT t2 0 X. {} {i 4 t four}} + {INSERT t1 0 X. {} {i 1 t one}} + {INSERT t2 0 X. {} {i 4 t four}} {INSERT t2 0 X. {} {i 5 t five}} {INSERT t3 0 X. {} {i 6 t six}} } @@ -122,9 +122,9 @@ foreach {tn setup result} { S attach t1 } { {INSERT t3 0 X. {} {i 6 t six}} - {INSERT t2 0 X. {} {i 4 t four}} + {INSERT t2 0 X. {} {i 4 t four}} {INSERT t2 0 X. {} {i 5 t five}} - {INSERT t1 0 X. {} {i 1 t one}} + {INSERT t1 0 X. {} {i 1 t one}} } } { execsql { @@ -158,10 +158,10 @@ foreach {tn setup result} { 1 { S attach * } { - {DELETE t2 0 X. {i 4 t four} {}} - {DELETE t2 0 X. {i 5 t five} {}} + {DELETE t2 0 X. {i 4 t four} {}} + {DELETE t2 0 X. {i 5 t five} {}} {DELETE t1 0 X. {i 1 t one} {}} - {DELETE t3 0 X. {i 6 t six} {}} + {DELETE t3 0 X. {i 6 t six} {}} } 2 { @@ -169,9 +169,9 @@ foreach {tn setup result} { S attach * } { {DELETE t1 0 X. {i 1 t one} {}} - {DELETE t2 0 X. {i 4 t four} {}} - {DELETE t2 0 X. {i 5 t five} {}} - {DELETE t3 0 X. {i 6 t six} {}} + {DELETE t2 0 X. {i 4 t four} {}} + {DELETE t2 0 X. {i 5 t five} {}} + {DELETE t3 0 X. {i 6 t six} {}} } 3 { @@ -179,9 +179,9 @@ foreach {tn setup result} { S attach t2 S attach t1 } { - {DELETE t3 0 X. {i 6 t six} {}} - {DELETE t2 0 X. {i 4 t four} {}} - {DELETE t2 0 X. {i 5 t five} {}} + {DELETE t3 0 X. {i 6 t six} {}} + {DELETE t2 0 X. {i 4 t four} {}} + {DELETE t2 0 X. {i 5 t five} {}} {DELETE t1 0 X. {i 1 t one} {}} } } { @@ -223,8 +223,8 @@ foreach {tn setup1 sql1 setup2 sql2 result} { INSERT INTO t1 VALUES(3, 'three'); INSERT INTO t2 VALUES(4, 'four'); } { - {INSERT t1 0 X. {} {i 1 t one}} - {INSERT t1 0 X. {} {i 3 t three}} + {INSERT t1 0 X. {} {i 1 t one}} + {INSERT t1 0 X. {} {i 3 t three}} {INSERT t2 0 X. {} {i 2 t two}} {INSERT t2 0 X. {} {i 4 t four}} } @@ -243,8 +243,8 @@ foreach {tn setup1 sql1 setup2 sql2 result} { } { {INSERT t2 0 X. {} {i 2 t two}} {INSERT t2 0 X. {} {i 4 t four}} - {INSERT t1 0 X. {} {i 1 t one}} - {INSERT t1 0 X. {} {i 3 t three}} + {INSERT t1 0 X. {} {i 1 t one}} + {INSERT t1 0 X. {} {i 3 t three}} } 1 { @@ -260,8 +260,8 @@ foreach {tn setup1 sql1 setup2 sql2 result} { } { {INSERT t2 0 X. {} {i 2 t two}} {INSERT t2 0 X. {} {i 4 t four}} - {INSERT t1 0 X. {} {i 3 t three}} - {INSERT t3 0 X. {} {i 5 t five}} + {INSERT t1 0 X. {} {i 3 t three}} + {INSERT t3 0 X. {} {i 5 t five}} } } { diff --git a/third_party/sqlite/src/ext/session/sessionG.test b/third_party/sqlite/src/ext/session/sessionG.test index 5c057350e44af..d28ea0de914cb 100644 --- a/third_party/sqlite/src/ext/session/sessionG.test +++ b/third_party/sqlite/src/ext/session/sessionG.test @@ -17,7 +17,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} diff --git a/third_party/sqlite/src/ext/session/session_common.tcl b/third_party/sqlite/src/ext/session/session_common.tcl index d4804d924fdd3..ebb3aa41fca9a 100644 --- a/third_party/sqlite/src/ext/session/session_common.tcl +++ b/third_party/sqlite/src/ext/session/session_common.tcl @@ -45,9 +45,9 @@ proc do_conflict_test {tn args} { } array set O $args - proc xConflict {args} [subst -nocommands { + proc xConflict {args} [subst -nocommands { lappend ::xConflict [set args] - return $O(-policy) + return $O(-policy) }] proc bgerror {args} { set ::background_error $args } @@ -128,7 +128,7 @@ proc do_iterator_test {tn tbl_list sql res} { S delete } -# Compare the contents of all tables in [db1] and [db2]. Throw an error if +# Compare the contents of all tables in [db1] and [db2]. Throw an error if # they are not identical, or return an empty string if they are. # proc compare_db {db1 db2} { @@ -137,10 +137,10 @@ proc compare_db {db1 db2} { set lot1 [$db1 eval $sql] set lot2 [$db2 eval $sql] - if {$lot1 != $lot2} { + if {$lot1 != $lot2} { puts $lot1 puts $lot2 - error "databases contain different tables" + error "databases contain different tables" } foreach tbl $lot1 { @@ -154,10 +154,10 @@ proc compare_db {db1 db2} { set sql "SELECT * FROM $tbl ORDER BY [join $col1 ,]" set data1 [$db1 eval $sql] set data2 [$db2 eval $sql] - if {$data1 != $data2} { + if {$data1 != $data2} { puts "$data1" puts "$data2" - error "table $tbl data mismatch" + error "table $tbl data mismatch" } } diff --git a/third_party/sqlite/src/ext/session/session_speed_test.c b/third_party/sqlite/src/ext/session/session_speed_test.c index 14b97ea07b687..f18bb306e44e3 100644 --- a/third_party/sqlite/src/ext/session/session_speed_test.c +++ b/third_party/sqlite/src/ext/session/session_speed_test.c @@ -46,7 +46,7 @@ struct CmdLineOption { #define CMDLINE_NONE(x,y,z) {x, y, CMDLINE_BARE, z} static void option_requires_argument_error(CmdLineOption *pOpt){ - fprintf(stderr, "Option requires a%s argument: %s\n", + fprintf(stderr, "Option requires a%s argument: %s\n", pOpt->eType==CMDLINE_INTEGER ? "n integer" : pOpt->eType==CMDLINE_STRING ? " string" : " boolean", pOpt->zText @@ -60,7 +60,7 @@ static void ambiguous_option_error(const char *zArg){ } static void unknown_option_error( - const char *zArg, + const char *zArg, CmdLineOption *aOpt, const char *zHelp ){ @@ -110,8 +110,8 @@ static int get_boolean_option(CmdLineOption *pOpt, const char *zArg){ } static void parse_command_line( - int argc, - char **argv, + int argc, + char **argv, int iStart, CmdLineOption *aOpt, void *pStruct, @@ -189,7 +189,7 @@ static void parse_command_line( fprintf(stdout, "\n"); } } -/* +/* ** End of generic command line parser. *************************************************************************/ @@ -208,9 +208,9 @@ static int xConflict(void *pCtx, int eConflict, sqlite3_changeset_iter *p){ } static void run_test( - sqlite3 *db, - sqlite3 *db2, - int nRow, + sqlite3 *db, + sqlite3 *db2, + int nRow, const char *zSql ){ sqlite3_session *pSession = 0; @@ -271,7 +271,7 @@ int main(int argc, char **argv){ CmdLineOption aOpt[] = { CMDLINE_INT32( "-rows", "number of rows in test", offsetof(struct Options, nRow) ), - CMDLINE_BOOL("-without-rowid", "use WITHOUT ROWID tables", + CMDLINE_BOOL("-without-rowid", "use WITHOUT ROWID tables", offsetof(struct Options, bWithoutRowid) ), CMDLINE_BOOL("-integer", "use integer data (instead of text/blobs)", offsetof(struct Options, bInteger) ), diff --git a/third_party/sqlite/src/ext/session/sessionat.test b/third_party/sqlite/src/ext/session/sessionat.test index a96cbcae424f4..2f4f5add4ff90 100644 --- a/third_party/sqlite/src/ext/session/sessionat.test +++ b/third_party/sqlite/src/ext/session/sessionat.test @@ -10,13 +10,13 @@ #*********************************************************************** # # Tests for the sessions module. Specifically, that a changeset can -# be applied after ALTER TABLE ADD COLUMN has been used to add +# be applied after ALTER TABLE ADD COLUMN has been used to add # columns to tables. # if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} @@ -49,7 +49,7 @@ proc reset_test {} { # ?.3.*: Test some INSERT, UPDATE and DELETE operations that do not # require conflict handling. # -# ?.4.*: Test some INSERT, UPDATE and DELETE operations that do require +# ?.4.*: Test some INSERT, UPDATE and DELETE operations that do require # conflict handling. # # ?.5.*: Test that attempting to concat two changesets with different @@ -124,7 +124,7 @@ eval [string map [list %WR% $trailing] { # 4.1: INSERT statements # 4.2: DELETE statements # 4.3: UPDATE statements - # + # do_execsql_test $tn.4.1.0 { CREATE TABLE t4(x INTEGER PRIMARY KEY, y) %WR%; } @@ -189,7 +189,7 @@ eval [string map [list %WR% $trailing] { {UPDATE t5 DATA {{} {} i 3 i 3} {{} {} i 9 {} {}} {i 3 i 8 i 3}} {UPDATE t5 CONSTRAINT {{} {} i 2 i 2} {{} {} i 10 {} {}}} } - + #----------------------------------------------------------------------- do_execsql_test $tn.5.0 { CREATE TABLE t6(a, b, c, PRIMARY KEY(a, b)) %WR%; diff --git a/third_party/sqlite/src/ext/session/sessionfault.test b/third_party/sqlite/src/ext/session/sessionfault.test index be6c4568ce658..2da51a105be8f 100644 --- a/third_party/sqlite/src/ext/session/sessionfault.test +++ b/third_party/sqlite/src/ext/session/sessionfault.test @@ -14,7 +14,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} @@ -34,7 +34,7 @@ db2 close #------------------------------------------------------------------------- # Test OOM error handling when collecting and applying a simple changeset. # -# Test 1.1 attaches tables individually by name to the session object. +# Test 1.1 attaches tables individually by name to the session object. # Whereas test 1.2 passes NULL to sqlite3session_attach() to attach all # tables. # @@ -73,16 +73,16 @@ do_faultsim_test 1.2 -faults oom-* -prep { catch { S delete } faultsim_test_result {0 {}} {1 SQLITE_NOMEM} faultsim_integrity_check - if {$testrc==0} { + if {$testrc==0} { proc xConflict {args} { return "OMIT" } sqlite3 db2 test.db2 sqlite3changeset_apply db2 $::changeset xConflict - compare_db db db2 + compare_db db db2 } } #------------------------------------------------------------------------- -# The following block of tests - 2.* - are designed to check +# The following block of tests - 2.* - are designed to check # the handling of faults in the sqlite3changeset_apply() function. # catch {db close} @@ -152,9 +152,9 @@ do_faultsim_test 3 -faults oom-* -prep { set {} {} } -test { faultsim_test_result {0 {}} {1 SQLITE_NOMEM} - if {$testrc==0} { + if {$testrc==0} { sqlite3changeset_apply db2 [S changeset] xConflict - compare_db db db2 + compare_db db db2 } catch { S delete } faultsim_integrity_check @@ -213,7 +213,7 @@ do_faultsim_test 4 -faults oom-* -prep { } #------------------------------------------------------------------------- -# This block of tests verifies that OOM faults in the +# This block of tests verifies that OOM faults in the # sqlite3changeset_invert() function are handled correctly. # catch {db close} @@ -243,8 +243,8 @@ do_faultsim_test 5.1 -faults oom* -body { set x [list] sqlite3session_foreach c $::inverse { lappend x $c } foreach c { - {DELETE t1 0 .X {t xxx t yyy} {}} - {INSERT t1 0 .X {} {t string i 1}} + {DELETE t1 0 .X {t xxx t yyy} {}} + {INSERT t1 0 .X {} {t string i 1}} {UPDATE t1 0 .X {i 20 i 2} {i 4 {} {}}} } { lappend y $c } if {$x != $y} { error "changeset no good" } @@ -399,8 +399,8 @@ faultsim_delete_and_reopen do_test 8.prep { sqlite3session S db main S attach * - execsql { - CREATE TABLE t1(a, b, PRIMARY KEY(a)); + execsql { + CREATE TABLE t1(a, b, PRIMARY KEY(a)); INSERT INTO t1 VALUES(1, 2); INSERT INTO t1 VALUES(3, 4); INSERT INTO t1 VALUES(5, 6); @@ -410,8 +410,8 @@ do_test 8.prep { } {} set expected [normalize_list { - {INSERT t1 0 X. {} {i 1 i 2}} - {INSERT t1 0 X. {} {i 3 i 4}} + {INSERT t1 0 X. {} {i 1 i 2}} + {INSERT t1 0 X. {} {i 3 i 4}} {INSERT t1 0 X. {} {i 5 i 6}} }] do_faultsim_test 8.1 -faults oom* -body { @@ -431,7 +431,7 @@ do_faultsim_test 8.2 -faults oom* -body { faultsim_delete_and_reopen do_test 9.1.prep { - execsql { + execsql { PRAGMA encoding = 'utf16'; CREATE TABLE t1(a PRIMARY KEY, b); } @@ -467,7 +467,7 @@ do_faultsim_test 9.1 -faults oom-transient -prep { faultsim_delete_and_reopen do_test 9.2.prep { - execsql { + execsql { PRAGMA encoding = 'utf16'; CREATE TABLE t1(a PRIMARY KEY, b); INSERT INTO t1 VALUES('abcdefghij', 'ABCDEFGHIJKLMNOPQRSTUV'); @@ -503,7 +503,7 @@ do_faultsim_test 9.2 -faults oom-transient -prep { } #------------------------------------------------------------------------- -# Test that if a conflict-handler encounters an OOM in +# Test that if a conflict-handler encounters an OOM in # sqlite3_value_text() but goes on to return SQLITE_CHANGESET_REPLACE # anyway, the OOM is picked up by the sessions module. set bigstr [string repeat abcdefghij 100] @@ -539,7 +539,7 @@ db close do_faultsim_test 10 -faults oom-tra* -prep { faultsim_restore_and_reopen } -body { - sqlite3changeset_apply_replace_all db $::C + sqlite3changeset_apply_replace_all db $::C } -test { faultsim_test_result {0 {}} {1 SQLITE_NOMEM} if {$testrc==0} { @@ -560,7 +560,7 @@ do_test 11.prep { BEGIN; } - set ::cs [changeset_from_sql { + set ::cs [changeset_from_sql { INSERT INTO t1 VALUES(1, 2); INSERT INTO t2 VALUES('x', 'y'); }] @@ -569,7 +569,7 @@ do_test 11.prep { set {} {} } {} -proc filter {x} { return [string equal t1 $x] } +proc filter {x} { return [string equal t1 $x] } faultsim_save_and_close do_faultsim_test 11 -faults oom-tra* -prep { diff --git a/third_party/sqlite/src/ext/session/sessionfault2.test b/third_party/sqlite/src/ext/session/sessionfault2.test index ffdc57b9bc5d8..b250c8d769904 100644 --- a/third_party/sqlite/src/ext/session/sessionfault2.test +++ b/third_party/sqlite/src/ext/session/sessionfault2.test @@ -14,7 +14,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} diff --git a/third_party/sqlite/src/ext/session/sessionwor.test b/third_party/sqlite/src/ext/session/sessionwor.test index d906a92b6211c..72c46f18cae5d 100644 --- a/third_party/sqlite/src/ext/session/sessionwor.test +++ b/third_party/sqlite/src/ext/session/sessionwor.test @@ -15,7 +15,7 @@ if {![info exists testdir]} { set testdir [file join [file dirname [info script]] .. .. test] -} +} source [file join [file dirname [info script]] session_common.tcl] source $testdir/tester.tcl ifcapable !session {finish_test; return} diff --git a/third_party/sqlite/src/ext/session/sqlite3session.c b/third_party/sqlite/src/ext/session/sqlite3session.c index 8dde8501a3967..785924aef2633 100644 --- a/third_party/sqlite/src/ext/session/sqlite3session.c +++ b/third_party/sqlite/src/ext/session/sqlite3session.c @@ -61,7 +61,7 @@ struct SessionBuffer { }; /* -** An object of this type is used internally as an abstraction for +** An object of this type is used internally as an abstraction for ** input data. Input data may be supplied either as a single large buffer ** (e.g. sqlite3changeset_start()) or using a stream function (e.g. ** sqlite3changeset_start_strm()). @@ -120,11 +120,11 @@ struct SessionTable { SessionChange **apChange; /* Hash table buckets */ }; -/* +/* ** RECORD FORMAT: ** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the +** The following record format is similar to (but not compatible with) that +** used in SQLite database files. This format is used as part of the ** change-set binary format, and so must be architecture independent. ** ** Unlike the SQLite database record format, each field is self-contained - @@ -158,7 +158,7 @@ struct SessionTable { ** Real values: ** An 8-byte big-endian IEEE 754-2008 real value. ** -** Varint values are encoded in the same way as varints in the SQLite +** Varint values are encoded in the same way as varints in the SQLite ** record format. ** ** CHANGESET FORMAT: @@ -190,7 +190,7 @@ struct SessionTable { ** ** The new.* record that is part of each INSERT change contains the values ** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted +** DELETE change contains the values that made up the row that was deleted ** from the database. In the changeset format, the records that are part ** of INSERT or DELETE changes never contain any undefined (type byte 0x00) ** fields. @@ -199,8 +199,8 @@ struct SessionTable { ** associated with table columns that are not PRIMARY KEY columns and are ** not modified by the UPDATE change are set to "undefined". Other fields ** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new +** change records took place. Within the new.* record, fields associated +** with table columns modified by the UPDATE change contain the new ** values. Fields associated with table columns that are not modified ** are set to "undefined". ** @@ -226,7 +226,7 @@ struct SessionTable { ** ** As in the changeset format, each field of the single record that is part ** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE +** table column, counting from left to right within the CREATE TABLE ** statement. ** ** For a DELETE change, all fields within the record except those associated @@ -256,7 +256,7 @@ struct SessionChange { }; /* -** Write a varint with value iVal into the buffer at aBuf. Return the +** Write a varint with value iVal into the buffer at aBuf. Return the ** number of bytes written. */ static int sessionVarintPut(u8 *aBuf, int iVal){ @@ -271,7 +271,7 @@ static int sessionVarintLen(int iVal){ } /* -** Read a varint value from aBuf[] into *piVal. Return the number of +** Read a varint value from aBuf[] into *piVal. Return the number of ** bytes read. */ static int sessionVarintGet(u8 *aBuf, int *piVal){ @@ -310,13 +310,13 @@ static void sessionPutI64(u8 *aBuf, sqlite3_int64 i){ ** This function is used to serialize the contents of value pValue (see ** comment titled "RECORD FORMAT" above). ** -** If it is non-NULL, the serialized form of the value is written to +** If it is non-NULL, the serialized form of the value is written to ** buffer aBuf. *pnWrite is set to the number of bytes written before ** returning. Or, if aBuf is NULL, the only thing this function does is ** set *pnWrite. ** ** If no error occurs, SQLITE_OK is returned. Or, if an OOM error occurs -** within a call to sqlite3_value_text() (may fail if the db is utf-16)) +** within a call to sqlite3_value_text() (may fail if the db is utf-16)) ** SQLITE_NOMEM is returned. */ static int sessionSerializeValue( @@ -328,16 +328,16 @@ static int sessionSerializeValue( if( pValue ){ int eType; /* Value type (SQLITE_NULL, TEXT etc.) */ - + eType = sqlite3_value_type(pValue); if( aBuf ) aBuf[0] = eType; - + switch( eType ){ - case SQLITE_NULL: + case SQLITE_NULL: nByte = 1; break; - - case SQLITE_INTEGER: + + case SQLITE_INTEGER: case SQLITE_FLOAT: if( aBuf ){ /* TODO: SQLite does something special to deal with mixed-endian @@ -354,14 +354,14 @@ static int sessionSerializeValue( } sessionPutI64(&aBuf[1], i); } - nByte = 9; + nByte = 9; break; - + default: { u8 *z; int n; int nVarint; - + assert( eType==SQLITE_TEXT || eType==SQLITE_BLOB ); if( eType==SQLITE_TEXT ){ z = (u8 *)sqlite3_value_text(pValue); @@ -371,12 +371,12 @@ static int sessionSerializeValue( n = sqlite3_value_bytes(pValue); if( z==0 && (eType!=SQLITE_BLOB || n>0) ) return SQLITE_NOMEM; nVarint = sessionVarintLen(n); - + if( aBuf ){ sessionVarintPut(&aBuf[1], n); if( n ) memcpy(&aBuf[nVarint + 1], z, n); } - + nByte = 1 + nVarint + n; break; } @@ -418,7 +418,7 @@ static unsigned int sessionHashAppendI64(unsigned int h, i64 i){ } /* -** Append the hash of the blob passed via the second and third arguments to +** Append the hash of the blob passed via the second and third arguments to ** the hash-key value passed as the first. Return the new hash-key value. */ static unsigned int sessionHashAppendBlob(unsigned int h, int n, const u8 *z){ @@ -437,7 +437,7 @@ static unsigned int sessionHashAppendType(unsigned int h, int eType){ /* ** This function may only be called from within a pre-update callback. -** It calculates a hash based on the primary key values of the old.* or +** It calculates a hash based on the primary key values of the old.* or ** new.* row currently available and, assuming no error occurs, writes it to ** *piHash before returning. If the primary key contains one or more NULL ** values, *pbNullPK is set to true before returning. @@ -543,12 +543,12 @@ static unsigned int sessionChangeHash( int isPK = pTab->abPK[i]; if( bPkOnly && isPK==0 ) continue; - /* It is not possible for eType to be SQLITE_NULL here. The session + /* It is not possible for eType to be SQLITE_NULL here. The session ** module does not record changes for rows with NULL values stored in ** primary key columns. */ - assert( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT - || eType==SQLITE_TEXT || eType==SQLITE_BLOB - || eType==SQLITE_NULL || eType==0 + assert( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT + || eType==SQLITE_TEXT || eType==SQLITE_BLOB + || eType==SQLITE_NULL || eType==0 ); assert( !isPK || (eType!=0 && eType!=SQLITE_NULL) ); @@ -559,7 +559,7 @@ static unsigned int sessionChangeHash( h = sessionHashAppendI64(h, sessionGetI64(a)); a += 8; }else{ - int n; + int n; a += sessionVarintGet(a, &n); h = sessionHashAppendBlob(h, n, a); a += n; @@ -574,7 +574,7 @@ static unsigned int sessionChangeHash( /* ** Arguments aLeft and aRight are pointers to change records for table pTab. ** This function returns true if the two records apply to the same row (i.e. -** have the same values stored in the primary key columns), or false +** have the same values stored in the primary key columns), or false ** otherwise. */ static int sessionChangeEqual( @@ -611,17 +611,17 @@ static int sessionChangeEqual( ** Arguments aLeft and aRight both point to buffers containing change ** records with nCol columns. This function "merges" the two records into ** a single records which is written to the buffer at *paOut. *paOut is -** then set to point to one byte after the last byte written before +** then set to point to one byte after the last byte written before ** returning. ** -** The merging of records is done as follows: For each column, if the +** The merging of records is done as follows: For each column, if the ** aRight record contains a value for the column, copy the value from ** their. Otherwise, if aLeft contains a value, copy it. If neither ** record contains a value for a given column, then neither does the ** output record. */ static void sessionMergeRecord( - u8 **paOut, + u8 **paOut, int nCol, u8 *aLeft, u8 *aRight @@ -651,13 +651,13 @@ static void sessionMergeRecord( /* ** This is a helper function used by sessionMergeUpdate(). ** -** When this function is called, both *paOne and *paTwo point to a value -** within a change record. Before it returns, both have been advanced so +** When this function is called, both *paOne and *paTwo point to a value +** within a change record. Before it returns, both have been advanced so ** as to point to the next value in the record. ** ** If, when this function is called, *paTwo points to a valid value (i.e. ** *paTwo[0] is not 0x00 - the "no value" placeholder), a copy of the *paTwo -** pointer is returned and *pnVal is set to the number of bytes in the +** pointer is returned and *pnVal is set to the number of bytes in the ** serialized value. Otherwise, a copy of *paOne is returned and *pnVal ** set to the number of bytes in the value at *paOne. If *paOne points ** to the "no value" placeholder, *pnVal is set to 1. In other words: @@ -756,8 +756,8 @@ static int sessionMergeUpdate( aOld = sessionMergeValue(&aOld1, &aOld2, &nOld); aNew = sessionMergeValue(&aNew1, &aNew2, &nNew); - if( bPatchset==0 - && (pTab->abPK[i] || (nOld==nNew && 0==memcmp(aOld, aNew, nNew))) + if( bPatchset==0 + && (pTab->abPK[i] || (nOld==nNew && 0==memcmp(aOld, aNew, nNew))) ){ *(aOut++) = '\0'; }else{ @@ -847,7 +847,7 @@ static int sessionPreupdateEqual( } /* -** If required, grow the hash table used to store changes on table pTab +** If required, grow the hash table used to store changes on table pTab ** (part of the session pSession). If a fatal OOM error occurs, set the ** session object to failed and return SQLITE_ERROR. Otherwise, return ** SQLITE_OK. @@ -975,7 +975,7 @@ static int sessionTableInfo( *pzTab = (char *)pAlloc; pAlloc += nThis+1; } - + i = 0; while( SQLITE_ROW==sqlite3_step(pStmt) ){ int nName = sqlite3_column_bytes(pStmt, 1); @@ -988,7 +988,7 @@ static int sessionTableInfo( i++; } rc = sqlite3_reset(pStmt); - + } /* If successful, populate the output variables. Otherwise, zero them and @@ -1018,14 +1018,14 @@ static int sessionTableInfo( ** If an error occurs, an error code is stored in sqlite3_session.rc and ** non-zero returned. Or, if no error occurs but the table has no primary ** key, sqlite3_session.rc is left set to SQLITE_OK and non-zero returned to -** indicate that updates on this table should be ignored. SessionTable.abPK +** indicate that updates on this table should be ignored. SessionTable.abPK ** is set to NULL in this case. */ static int sessionInitTable(sqlite3_session *pSession, SessionTable *pTab){ if( pTab->nCol==0 ){ u8 *abPK; assert( pTab->azCol==0 || pTab->abPK==0 ); - pSession->rc = sessionTableInfo(pSession->db, pSession->zDb, + pSession->rc = sessionTableInfo(pSession->db, pSession->zDb, pTab->zName, &pTab->nCol, 0, &pTab->azCol, &abPK ); if( pSession->rc==SQLITE_OK ){ @@ -1042,7 +1042,7 @@ static int sessionInitTable(sqlite3_session *pSession, SessionTable *pTab){ } /* -** This function is only called from with a pre-update-hook reporting a +** This function is only called from with a pre-update-hook reporting a ** change on table pTab (attached to session pSession). The type of change ** (UPDATE, INSERT, DELETE) is specified by the first argument. ** @@ -1054,8 +1054,8 @@ static void sessionPreupdateOneChange( sqlite3_session *pSession, /* Session object pTab is attached to */ SessionTable *pTab /* Table that change applies to */ ){ - int iHash; - int bNull = 0; + int iHash; + int bNull = 0; int rc = SQLITE_OK; if( pSession->rc ) return; @@ -1063,7 +1063,7 @@ static void sessionPreupdateOneChange( /* Load table details if required */ if( sessionInitTable(pSession, pTab) ) return; - /* Check the number of columns in this xPreUpdate call matches the + /* Check the number of columns in this xPreUpdate call matches the ** number of columns in the table. */ if( pTab->nCol!=pSession->hook.xCount(pSession->hook.pCtx) ){ pSession->rc = SQLITE_SCHEMA; @@ -1096,10 +1096,10 @@ static void sessionPreupdateOneChange( SessionChange *pChange; /* New change object */ int nByte; /* Number of bytes to allocate */ int i; /* Used to iterate through columns */ - + assert( rc==SQLITE_OK ); pTab->nEntry++; - + /* Figure out how large an allocation is required */ nByte = sizeof(SessionChange); for(i=0; inCol; i++){ @@ -1117,7 +1117,7 @@ static void sessionPreupdateOneChange( rc = sessionSerializeValue(0, p, &nByte); if( rc!=SQLITE_OK ) goto error_out; } - + /* Allocate the change object */ pChange = (SessionChange *)sqlite3_malloc(nByte); if( !pChange ){ @@ -1127,7 +1127,7 @@ static void sessionPreupdateOneChange( memset(pChange, 0, sizeof(SessionChange)); pChange->aRecord = (u8 *)&pChange[1]; } - + /* Populate the change object. None of the preupdate_old(), ** preupdate_new() or SerializeValue() calls below may fail as all ** required values and encodings have already been cached in memory. @@ -1155,8 +1155,8 @@ static void sessionPreupdateOneChange( }else if( pC->bIndirect ){ /* If the existing change is considered "indirect", but this current ** change is "direct", mark the change object as direct. */ - if( pSession->hook.xDepth(pSession->hook.pCtx)==0 - && pSession->bIndirect==0 + if( pSession->hook.xDepth(pSession->hook.pCtx)==0 + && pSession->bIndirect==0 ){ pC->bIndirect = 0; } @@ -1171,7 +1171,7 @@ static void sessionPreupdateOneChange( } static int sessionFindTable( - sqlite3_session *pSession, + sqlite3_session *pSession, const char *zName, SessionTable **ppTab ){ @@ -1188,7 +1188,7 @@ static int sessionFindTable( /* If there is a table-filter configured, invoke it. If it returns 0, ** do not automatically add the new table. */ if( pSession->xTableFilter==0 - || pSession->xTableFilter(pSession->pFilterCtx, zName) + || pSession->xTableFilter(pSession->pFilterCtx, zName) ){ rc = sqlite3session_attach(pSession, zName); if( rc==SQLITE_OK ){ @@ -1223,8 +1223,8 @@ static void xPreUpdate( for(pSession=(sqlite3_session *)pCtx; pSession; pSession=pSession->pNext){ SessionTable *pTab; - /* If this session is attached to a different database ("main", "temp" - ** etc.), or if it is not currently enabled, there is nothing to do. Skip + /* If this session is attached to a different database ("main", "temp" + ** etc.), or if it is not currently enabled, there is nothing to do. Skip ** to the next session object attached to this database. */ if( pSession->bEnable==0 ) continue; if( pSession->rc ) continue; @@ -1315,7 +1315,7 @@ static void sessionDiffHooks( static char *sessionExprComparePK( int nCol, - const char *zDb1, const char *zDb2, + const char *zDb1, const char *zDb2, const char *zTab, const char **azCol, u8 *abPK ){ @@ -1338,7 +1338,7 @@ static char *sessionExprComparePK( static char *sessionExprCompareOther( int nCol, - const char *zDb1, const char *zDb2, + const char *zDb1, const char *zDb2, const char *zTab, const char **azCol, u8 *abPK ){ @@ -1415,9 +1415,9 @@ static int sessionDiffFindNew( } static int sessionDiffFindModified( - sqlite3_session *pSession, - SessionTable *pTab, - const char *zFrom, + sqlite3_session *pSession, + SessionTable *pTab, + const char *zFrom, const char *zExpr ){ int rc = SQLITE_OK; @@ -1515,7 +1515,7 @@ int sqlite3session_diff( } if( rc==SQLITE_OK ){ - zExpr = sessionExprComparePK(pTo->nCol, + zExpr = sessionExprComparePK(pTo->nCol, zDb, zFrom, pTo->zName, pTo->azCol, pTo->abPK ); } @@ -1570,7 +1570,7 @@ int sqlite3session_create( memcpy(pNew->zDb, zDb, nDb+1); sessionPreupdateHooks(pNew); - /* Add the new session object to the linked list of session objects + /* Add the new session object to the linked list of session objects ** attached to database handle $db. Do this under the cover of the db ** handle mutex. */ sqlite3_mutex_enter(sqlite3_db_mutex(db)); @@ -1628,7 +1628,7 @@ void sqlite3session_delete(sqlite3_session *pSession){ } sqlite3_mutex_leave(sqlite3_db_mutex(db)); - /* Delete all attached table objects. And the contents of their + /* Delete all attached table objects. And the contents of their ** associated hash-tables. */ sessionDeleteTable(pSession->pTable); @@ -1640,7 +1640,7 @@ void sqlite3session_delete(sqlite3_session *pSession){ ** Set a table filter on a Session Object. */ void sqlite3session_table_filter( - sqlite3_session *pSession, + sqlite3_session *pSession, int(*xFilter)(void*, const char*), void *pCtx /* First argument passed to xFilter */ ){ @@ -1684,7 +1684,7 @@ int sqlite3session_attach( rc = SQLITE_NOMEM; }else{ /* Populate the new SessionTable object and link it into the list. - ** The new object must be linked onto the end of the list, not + ** The new object must be linked onto the end of the list, not ** simply added to the start of it in order to ensure that tables ** appear in the correct order when a changeset or patchset is ** eventually generated. */ @@ -1752,8 +1752,8 @@ static void sessionAppendValue(SessionBuffer *p, sqlite3_value *pVal, int *pRc){ } /* -** This function is a no-op if *pRc is other than SQLITE_OK when it is -** called. Otherwise, append a single byte to the buffer. +** This function is a no-op if *pRc is other than SQLITE_OK when it is +** called. Otherwise, append a single byte to the buffer. ** ** If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before ** returning. @@ -1765,8 +1765,8 @@ static void sessionAppendByte(SessionBuffer *p, u8 v, int *pRc){ } /* -** This function is a no-op if *pRc is other than SQLITE_OK when it is -** called. Otherwise, append a single varint to the buffer. +** This function is a no-op if *pRc is other than SQLITE_OK when it is +** called. Otherwise, append a single varint to the buffer. ** ** If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before ** returning. @@ -1778,16 +1778,16 @@ static void sessionAppendVarint(SessionBuffer *p, int v, int *pRc){ } /* -** This function is a no-op if *pRc is other than SQLITE_OK when it is -** called. Otherwise, append a blob of data to the buffer. +** This function is a no-op if *pRc is other than SQLITE_OK when it is +** called. Otherwise, append a blob of data to the buffer. ** ** If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before ** returning. */ static void sessionAppendBlob( - SessionBuffer *p, - const u8 *aBlob, - int nBlob, + SessionBuffer *p, + const u8 *aBlob, + int nBlob, int *pRc ){ if( nBlob>0 && 0==sessionBufferGrow(p, nBlob, pRc) ){ @@ -1797,7 +1797,7 @@ static void sessionAppendBlob( } /* -** This function is a no-op if *pRc is other than SQLITE_OK when it is +** This function is a no-op if *pRc is other than SQLITE_OK when it is ** called. Otherwise, append a string to the buffer. All bytes in the string ** up to (but not including) the nul-terminator are written to the buffer. ** @@ -1805,8 +1805,8 @@ static void sessionAppendBlob( ** returning. */ static void sessionAppendStr( - SessionBuffer *p, - const char *zStr, + SessionBuffer *p, + const char *zStr, int *pRc ){ int nStr = sqlite3Strlen30(zStr); @@ -1817,7 +1817,7 @@ static void sessionAppendStr( } /* -** This function is a no-op if *pRc is other than SQLITE_OK when it is +** This function is a no-op if *pRc is other than SQLITE_OK when it is ** called. Otherwise, append the string representation of integer iVal ** to the buffer. No nul-terminator is written. ** @@ -1835,9 +1835,9 @@ static void sessionAppendInteger( } /* -** This function is a no-op if *pRc is other than SQLITE_OK when it is +** This function is a no-op if *pRc is other than SQLITE_OK when it is ** called. Otherwise, append the string zStr enclosed in quotes (") and -** with any embedded quote characters escaped to the buffer. No +** with any embedded quote characters escaped to the buffer. No ** nul-terminator byte is written. ** ** If an OOM condition is encountered, set *pRc to SQLITE_NOMEM before @@ -1910,8 +1910,8 @@ static void sessionAppendCol( /* ** -** This function appends an update change to the buffer (see the comments -** under "CHANGESET FORMAT" at the top of the file). An update change +** This function appends an update change to the buffer (see the comments +** under "CHANGESET FORMAT" at the top of the file). An update change ** consists of: ** ** 1 byte: SQLITE_UPDATE (0x17) @@ -1926,10 +1926,10 @@ static void sessionAppendCol( ** If all of the old.* values are equal to their corresponding new.* value ** (i.e. nothing has changed), then no data at all is appended to the buffer. ** -** Otherwise, the old.* record contains all primary key values and the -** original values of any fields that have been modified. The new.* record +** Otherwise, the old.* record contains all primary key values and the +** original values of any fields that have been modified. The new.* record ** contains the new values of only those fields that have been modified. -*/ +*/ static int sessionAppendUpdate( SessionBuffer *pBuf, /* Buffer to append to */ int bPatchset, /* True for "patchset", 0 for "changeset" */ @@ -1980,8 +1980,8 @@ static int sessionAppendUpdate( int nHdr = 1 + sessionVarintGet(&pCsr[1], &n); assert( eType==SQLITE_TEXT || eType==SQLITE_BLOB ); nAdvance = nHdr + n; - if( eType==sqlite3_column_type(pStmt, i) - && n==sqlite3_column_bytes(pStmt, i) + if( eType==sqlite3_column_type(pStmt, i) + && n==sqlite3_column_bytes(pStmt, i) && (n==0 || 0==memcmp(&pCsr[nHdr], sqlite3_column_blob(pStmt, i), n)) ){ break; @@ -2194,7 +2194,7 @@ static int sessionSelectBind( /* ** This function is a no-op if *pRc is set to other than SQLITE_OK when it -** is called. Otherwise, append a serialized table header (part of the binary +** is called. Otherwise, append a serialized table header (part of the binary ** changeset format) to buffer *pBuf. If an error occurs, set *pRc to an ** SQLite error code before returning. */ @@ -2218,7 +2218,7 @@ static void sessionAppendTableHdr( ** ** If no error occurs, SQLITE_OK is returned and the new changeset/patchset ** stored in output variables *pnChangeset and *ppChangeset. Or, if an error -** occurs, an SQLite error code is returned and both output variables set +** occurs, an SQLite error code is returned and both output variables set ** to 0. */ static int sessionGenerateChangeset( @@ -2303,10 +2303,10 @@ static int sessionGenerateChangeset( /* If the buffer is now larger than SESSIONS_STRM_CHUNK_SIZE, pass ** its contents to the xOutput() callback. */ - if( xOutput - && rc==SQLITE_OK - && buf.nBuf>nNoop - && buf.nBuf>SESSIONS_STRM_CHUNK_SIZE + if( xOutput + && rc==SQLITE_OK + && buf.nBuf>nNoop + && buf.nBuf>SESSIONS_STRM_CHUNK_SIZE ){ rc = xOutput(pOut, (void*)buf.aBuf, buf.nBuf); nNoop = -1; @@ -2341,10 +2341,10 @@ static int sessionGenerateChangeset( } /* -** Obtain a changeset object containing all changes recorded by the +** Obtain a changeset object containing all changes recorded by the ** session object passed as the first argument. ** -** It is the responsibility of the caller to eventually free the buffer +** It is the responsibility of the caller to eventually free the buffer ** using sqlite3_free(). */ int sqlite3session_changeset( @@ -2378,10 +2378,10 @@ int sqlite3session_patchset_strm( } /* -** Obtain a patchset object containing all changes recorded by the +** Obtain a patchset object containing all changes recorded by the ** session object passed as the first argument. ** -** It is the responsibility of the caller to eventually free the buffer +** It is the responsibility of the caller to eventually free the buffer ** using sqlite3_free(). */ int sqlite3session_patchset( @@ -2567,7 +2567,7 @@ static void sessionSkipRecord( /* ** This function sets the value of the sqlite3_value object passed as the -** first argument to a copy of the string or blob held in the aData[] +** first argument to a copy of the string or blob held in the aData[] ** buffer. SQLITE_OK is returned if successful, or SQLITE_NOMEM if an OOM ** error occurs. */ @@ -2578,7 +2578,7 @@ static int sessionValueSetStr( u8 enc /* String encoding (0 for blobs) */ ){ /* In theory this code could just pass SQLITE_TRANSIENT as the final - ** argument to sqlite3ValueSetStr() and have the copy created + ** argument to sqlite3ValueSetStr() and have the copy created ** automatically. But doing so makes it difficult to detect any OOM ** error. Hence the code to create the copy externally. */ u8 *aCopy = sqlite3_malloc(nData+1); @@ -2672,7 +2672,7 @@ static int sessionReadRecord( ** + array of PK flags (1 byte per column), ** + table name (nul terminated). ** -** This function ensures that all of the above is present in the input +** This function ensures that all of the above is present in the input ** buffer (i.e. that it can be accessed without any calls to xInput()). ** If successful, SQLITE_OK is returned. Otherwise, an SQLite error code. ** The input pointer is not moved. @@ -2744,8 +2744,8 @@ static int sessionChangesetBufferRecord( ** + array of PK flags (1 byte per column), ** + table name (nul terminated). ** -** This function decodes the table-header and populates the p->nCol, -** p->zTab and p->abPK[] variables accordingly. The p->apValue[] array is +** This function decodes the table-header and populates the p->nCol, +** p->zTab and p->abPK[] variables accordingly. The p->apValue[] array is ** also allocated or resized according to the new value of p->nCol. The ** input pointer is left pointing to the byte following the table header. ** @@ -2794,9 +2794,9 @@ static int sessionChangesetReadTblhdr(sqlite3_changeset_iter *p){ ** record is written to *paRec before returning and the number of bytes in ** the record to *pnRec. ** -** Either way, this function returns SQLITE_ROW if the iterator is -** successfully advanced to the next change in the changeset, an SQLite -** error code if an error occurs, or SQLITE_DONE if there are no further +** Either way, this function returns SQLITE_ROW if the iterator is +** successfully advanced to the next change in the changeset, an SQLite +** error code if an error occurs, or SQLITE_DONE if there are no further ** changes in the changeset. */ static int sessionChangesetNext( @@ -2850,7 +2850,7 @@ static int sessionChangesetNext( return (p->rc = SQLITE_CORRUPT_BKPT); } - if( paRec ){ + if( paRec ){ int nVal; /* Number of values to buffer */ if( p->bPatchset==0 && op==SQLITE_UPDATE ){ nVal = p->nCol * 2; @@ -3011,7 +3011,7 @@ int sqlite3changeset_new( /* ** This function may only be called with a changeset iterator that has been -** passed to an SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT +** passed to an SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT ** conflict-handler function. Otherwise, SQLITE_MISUSE is returned. ** ** If successful, *ppValue is set to point to an sqlite3_value structure @@ -3358,7 +3358,7 @@ static int sessionDeleteRow( } /* -** Formulate and prepare a statement to UPDATE a row from database db. +** Formulate and prepare a statement to UPDATE a row from database db. ** Assuming a table structure like this: ** ** CREATE TABLE x(a, b, c, d, PRIMARY KEY(a, c)); @@ -3370,7 +3370,7 @@ static int sessionDeleteRow( ** b = CASE WHEN ?5 THEN ?6 ELSE b END, ** c = CASE WHEN ?8 THEN ?9 ELSE c END, ** d = CASE WHEN ?11 THEN ?12 ELSE d END -** WHERE a = ?1 AND c = ?7 AND (?13 OR +** WHERE a = ?1 AND c = ?7 AND (?13 OR ** (?5==0 OR b IS ?4) AND (?11==0 OR d IS ?10) AND ** ) ** @@ -3515,7 +3515,7 @@ static int sessionInsertRow( } /* -** A wrapper around sqlite3_bind_value() that detects an extra problem. +** A wrapper around sqlite3_bind_value() that detects an extra problem. ** See comments in the body of this function for details. */ static int sessionBindValue( @@ -3538,15 +3538,15 @@ static int sessionBindValue( } /* -** Iterator pIter must point to an SQLITE_INSERT entry. This function +** Iterator pIter must point to an SQLITE_INSERT entry. This function ** transfers new.* values from the current iterator entry to statement ** pStmt. The table being inserted into has nCol columns. ** -** New.* value $i from the iterator is bound to variable ($i+1) of +** New.* value $i from the iterator is bound to variable ($i+1) of ** statement pStmt. If parameter abPK is NULL, all values from 0 to (nCol-1) ** are transfered to the statement. Otherwise, if abPK is not NULL, it points -** to an array nCol elements in size. In this case only those values for -** which abPK[$i] is true are read from the iterator and bound to the +** to an array nCol elements in size. In this case only those values for +** which abPK[$i] is true are read from the iterator and bound to the ** statement. ** ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. @@ -3562,8 +3562,8 @@ static int sessionBindRow( int rc = SQLITE_OK; /* Neither sqlite3changeset_old or sqlite3changeset_new can fail if the - ** argument iterator points to a suitable entry. Make sure that xValue - ** is one of these to guarantee that it is safe to ignore the return + ** argument iterator points to a suitable entry. Make sure that xValue + ** is one of these to guarantee that it is safe to ignore the return ** in the code below. */ assert( xValue==sqlite3changeset_old || xValue==sqlite3changeset_new ); @@ -3581,18 +3581,18 @@ static int sessionBindRow( ** SQL statement pSelect is as generated by the sessionSelectRow() function. ** This function binds the primary key values from the change that changeset ** iterator pIter points to to the SELECT and attempts to seek to the table -** entry. If a row is found, the SELECT statement left pointing at the row +** entry. If a row is found, the SELECT statement left pointing at the row ** and SQLITE_ROW is returned. Otherwise, if no row is found and no error ** has occured, the statement is reset and SQLITE_OK is returned. If an ** error occurs, the statement is reset and an SQLite error code is returned. ** -** If this function returns SQLITE_ROW, the caller must eventually reset() +** If this function returns SQLITE_ROW, the caller must eventually reset() ** statement pSelect. If any other value is returned, the statement does ** not require a reset(). ** ** If the iterator currently points to an INSERT record, bind values from the ** new.* record to the SELECT statement. Or, if it points to a DELETE or -** UPDATE, bind values from the old.* record. +** UPDATE, bind values from the old.* record. */ static int sessionSeekToRow( sqlite3 *db, /* Database handle */ @@ -3606,7 +3606,7 @@ static int sessionSeekToRow( const char *zDummy; /* Unused */ sqlite3changeset_op(pIter, &zDummy, &nCol, &op, 0); - rc = sessionBindRow(pIter, + rc = sessionBindRow(pIter, op==SQLITE_INSERT ? sqlite3changeset_new : sqlite3changeset_old, nCol, abPK, pSelect ); @@ -3650,7 +3650,7 @@ static int sessionSeekToRow( ** is set to non-zero before returning SQLITE_OK. ** ** If the conflict handler returns SQLITE_CHANGESET_ABORT, SQLITE_ABORT is -** returned. Or, if the conflict handler returns an invalid value, +** returned. Or, if the conflict handler returns an invalid value, ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, ** this function returns SQLITE_OK. */ @@ -3737,16 +3737,16 @@ static int sessionConflictHandler( ** to true before returning. In this case the caller will invoke this function ** again, this time with pbRetry set to NULL. ** -** If argument pbReplace is NULL and a CHANGESET_CONFLICT conflict is +** If argument pbReplace is NULL and a CHANGESET_CONFLICT conflict is ** encountered invoke the conflict handler with CHANGESET_CONSTRAINT instead. ** Or, if pbReplace is not NULL, invoke it with CHANGESET_CONFLICT. If such ** an invocation returns SQLITE_CHANGESET_REPLACE, set *pbReplace to true ** before retrying. In this case the caller attempts to remove the conflicting -** row before invoking this function again, this time with pbReplace set +** row before invoking this function again, this time with pbReplace set ** to NULL. ** ** If any conflict handler returns SQLITE_CHANGESET_ABORT, this function -** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is +** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is ** returned. */ static int sessionApplyOneOp( @@ -3865,7 +3865,7 @@ static int sessionApplyOneOp( ** the conflict handler callback. ** ** The difference between this function and sessionApplyOne() is that this -** function handles the case where the conflict-handler is invoked and +** function handles the case where the conflict-handler is invoked and ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be ** retried in some manner. */ @@ -3886,7 +3886,7 @@ static int sessionApplyOneWithRetry( /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and ** a row with the correct PK is present in the db, but one or more other - ** fields do not contain the expected values) and the conflict handler + ** fields do not contain the expected values) and the conflict handler ** returned SQLITE_CHANGESET_REPLACE. In this case retry the operation, ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ @@ -3904,7 +3904,7 @@ static int sessionApplyOneWithRetry( assert( pIter->op==SQLITE_INSERT ); rc = sqlite3_exec(db, "SAVEPOINT replace_op", 0, 0, 0); if( rc==SQLITE_OK ){ - rc = sessionBindRow(pIter, + rc = sessionBindRow(pIter, sqlite3changeset_new, pApply->nCol, pApply->abPK, pApply->pDelete); sqlite3_bind_int(pApply->pDelete, pApply->nCol+1, 1); } @@ -3927,7 +3927,7 @@ static int sessionApplyOneWithRetry( ** Retry the changes accumulated in the pApply->constraints buffer. */ static int sessionRetryConstraints( - sqlite3 *db, + sqlite3 *db, int bPatchset, const char *zTab, SessionApplyCtx *pApply, @@ -3975,7 +3975,7 @@ static int sessionRetryConstraints( /* ** Argument pIter is a changeset iterator that has been initialized, but -** not yet passed to sqlite3changeset_next(). This function applies the +** not yet passed to sqlite3changeset_next(). This function applies the ** changeset to the main database attached to handle "db". The supplied ** conflict handler callback is invoked to resolve any conflicts encountered ** while applying the change. @@ -4014,7 +4014,7 @@ static int sessionChangesetApply( int nCol; int op; const char *zNew; - + sqlite3changeset_op(pIter, &zNew, &nCol, &op, 0); if( zTab==0 || sqlite3_strnicmp(zNew, zTab, nTab+1) ){ @@ -4027,14 +4027,14 @@ static int sessionChangesetApply( sqlite3_free((char*)sApply.azCol); /* cast works around VC++ bug */ sqlite3_finalize(sApply.pDelete); - sqlite3_finalize(sApply.pUpdate); + sqlite3_finalize(sApply.pUpdate); sqlite3_finalize(sApply.pInsert); sqlite3_finalize(sApply.pSelect); memset(&sApply, 0, sizeof(sApply)); sApply.db = db; sApply.bDeferConstraints = 1; - /* If an xFilter() callback was specified, invoke it now. If the + /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ schemaMismatch = (xFilter && (0==xFilter(pCtx, zNew))); @@ -4058,18 +4058,18 @@ static int sessionChangesetApply( for(i=0; iop; - /* + /* ** op1=INSERT, op2=INSERT -> Unsupported. Discard op2. ** op1=INSERT, op2=UPDATE -> INSERT. ** op1=INSERT, op2=DELETE -> (none) @@ -4252,7 +4252,7 @@ static int sessionChangeMerge( ** op1=DELETE, op2=INSERT -> UPDATE. ** op1=DELETE, op2=UPDATE -> Unsupported. Discard op2. ** op1=DELETE, op2=DELETE -> Unsupported. Discard op2. - */ + */ if( (op1==SQLITE_INSERT && op2==SQLITE_INSERT) || (op1==SQLITE_UPDATE && op2==SQLITE_INSERT) || (op1==SQLITE_DELETE && op2==SQLITE_UPDATE) @@ -4391,7 +4391,7 @@ static int sessionChangesetToHash( /* The new object must be linked on to the end of the list, not ** simply added to the start of it. This is to ensure that the - ** tables within the output of sqlite3changegroup_output() are in + ** tables within the output of sqlite3changegroup_output() are in ** the right order. */ for(ppTab=&pGrp->pList; *ppTab; ppTab=&(*ppTab)->pNext); *ppTab = pTab; @@ -4409,7 +4409,7 @@ static int sessionChangesetToHash( pTab, (pIter->bPatchset && op==SQLITE_DELETE), aRec, pTab->nChange ); - /* Search for existing entry. If found, remove it from the hash table. + /* Search for existing entry. If found, remove it from the hash table. ** Code below may link it back in. */ for(pp=&pTab->apChange[iHash]; *pp; pp=&(*pp)->pNext){ @@ -4427,7 +4427,7 @@ static int sessionChangesetToHash( } } - rc = sessionChangeMerge(pTab, + rc = sessionChangeMerge(pTab, pIter->bPatchset, pExist, op, bIndirect, aRec, nRec, &pChange ); if( rc ) break; @@ -4448,7 +4448,7 @@ static int sessionChangesetToHash( ** ** If xOutput is not NULL, then the changeset/patchset is returned to the ** user via one or more calls to xOutput, as with the other streaming -** interfaces. +** interfaces. ** ** Or, if xOutput is NULL, then (*ppOut) is populated with a pointer to a ** buffer containing the output changeset before this function returns. In @@ -4473,7 +4473,7 @@ static int sessionChangegroupOutput( assert( xOutput==0 || (ppOut==0 && pnOut==0) ); /* Create the serialized output changeset based on the contents of the - ** hash tables attached to the SessionTable objects in list p->pList. + ** hash tables attached to the SessionTable objects in list p->pList. */ for(pTab=pGrp->pList; rc==SQLITE_OK && pTab; pTab=pTab->pNext){ int i; @@ -4577,7 +4577,7 @@ int sqlite3changegroup_add_strm( */ int sqlite3changegroup_output_strm( sqlite3_changegroup *pGrp, - int (*xOutput)(void *pOut, const void *pData, int nData), + int (*xOutput)(void *pOut, const void *pData, int nData), void *pOut ){ return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0); @@ -4593,7 +4593,7 @@ void sqlite3changegroup_delete(sqlite3_changegroup *pGrp){ } } -/* +/* ** Combine two changesets together. */ int sqlite3changeset_concat( diff --git a/third_party/sqlite/src/ext/session/sqlite3session.h b/third_party/sqlite/src/ext/session/sqlite3session.h index 0882cf34cf835..0bb362e240130 100644 --- a/third_party/sqlite/src/ext/session/sqlite3session.h +++ b/third_party/sqlite/src/ext/session/sqlite3session.h @@ -43,7 +43,7 @@ typedef struct sqlite3_changeset_iter sqlite3_changeset_iter; ** is not possible for an application to register a pre-update hook on a ** database handle that has one or more session objects attached. Nor is ** it possible to create a session object attached to a database handle for -** which a pre-update hook is already defined. The results of attempting +** which a pre-update hook is already defined. The results of attempting ** either of these things are undefined. ** ** The session object will be used to create changesets for tables in @@ -60,13 +60,13 @@ int sqlite3session_create( /* ** CAPI3REF: Delete A Session Object ** -** Delete a session object previously allocated using +** Delete a session object previously allocated using ** [sqlite3session_create()]. Once a session object has been deleted, the ** results of attempting to use pSession with any other session module ** function are undefined. ** ** Session objects must be deleted before the database handle to which they -** are attached is closed. Refer to the documentation for +** are attached is closed. Refer to the documentation for ** [sqlite3session_create()] for details. */ void sqlite3session_delete(sqlite3_session *pSession); @@ -83,10 +83,10 @@ void sqlite3session_delete(sqlite3_session *pSession); ** the eventual changesets. ** ** Passing zero to this function disables the session. Passing a value -** greater than zero enables it. Passing a value less than zero is a +** greater than zero enables it. Passing a value less than zero is a ** no-op, and may be used to query the current state of the session. ** -** The return value indicates the final state of the session object: 0 if +** The return value indicates the final state of the session object: 0 if ** the session is disabled, or 1 if it is enabled. */ int sqlite3session_enable(sqlite3_session *pSession, int bEnable); @@ -100,7 +100,7 @@ int sqlite3session_enable(sqlite3_session *pSession, int bEnable); **
          **
        • The session object "indirect" flag is set when the change is ** made, or -**
        • The change is made by an SQL trigger or foreign key action +**
        • The change is made by an SQL trigger or foreign key action ** instead of directly as a result of a users SQL statement. **
        ** @@ -112,10 +112,10 @@ int sqlite3session_enable(sqlite3_session *pSession, int bEnable); ** flag. If the second argument passed to this function is zero, then the ** indirect flag is cleared. If it is greater than zero, the indirect flag ** is set. Passing a value less than zero does not modify the current value -** of the indirect flag, and may be used to query the current state of the +** of the indirect flag, and may be used to query the current state of the ** indirect flag for the specified session object. ** -** The return value indicates the final state of the indirect flag: 0 if +** The return value indicates the final state of the indirect flag: 0 if ** it is clear, or 1 if it is set. */ int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect); @@ -124,20 +124,20 @@ int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect); ** CAPI3REF: Attach A Table To A Session Object ** ** If argument zTab is not NULL, then it is the name of a table to attach -** to the session object passed as the first argument. All subsequent changes -** made to the table while the session object is enabled will be recorded. See +** to the session object passed as the first argument. All subsequent changes +** made to the table while the session object is enabled will be recorded. See ** documentation for [sqlite3session_changeset()] for further details. ** ** Or, if argument zTab is NULL, then changes are recorded for all tables -** in the database. If additional tables are added to the database (by -** executing "CREATE TABLE" statements) after this call is made, changes for +** in the database. If additional tables are added to the database (by +** executing "CREATE TABLE" statements) after this call is made, changes for ** the new tables are also recorded. ** ** Changes can only be recorded for tables that have a PRIMARY KEY explicitly -** defined as part of their CREATE TABLE statement. It does not matter if the +** defined as part of their CREATE TABLE statement. It does not matter if the ** PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias) or not. The PRIMARY ** KEY may consist of a single column, or may be a composite key. -** +** ** It is not an error if the named table does not exist in the database. Nor ** is it an error if the named table does not have a PRIMARY KEY. However, ** no changes will be recorded in either of these scenarios. @@ -145,7 +145,7 @@ int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect); ** Changes are not recorded for individual rows that have NULL values stored ** in one or more of their PRIMARY KEY columns. ** -** SQLITE_OK is returned if the call completes without error. Or, if an error +** SQLITE_OK is returned if the call completes without error. Or, if an error ** occurs, an SQLite error code (e.g. SQLITE_NOMEM) is returned. */ int sqlite3session_attach( @@ -156,10 +156,10 @@ int sqlite3session_attach( /* ** CAPI3REF: Set a table filter on a Session Object. ** -** The second argument (xFilter) is the "filter callback". For changes to rows +** The second argument (xFilter) is the "filter callback". For changes to rows ** in tables that are not attached to the Session object, the filter is called -** to determine whether changes to the table's rows should be tracked or not. -** If xFilter returns 0, changes is not tracked. Note that once a table is +** to determine whether changes to the table's rows should be tracked or not. +** If xFilter returns 0, changes is not tracked. Note that once a table is ** attached, xFilter will not be called again. */ void sqlite3session_table_filter( @@ -174,9 +174,9 @@ void sqlite3session_table_filter( /* ** CAPI3REF: Generate A Changeset From A Session Object ** -** Obtain a changeset containing changes to the tables attached to the -** session object passed as the first argument. If successful, -** set *ppChangeset to point to a buffer containing the changeset +** Obtain a changeset containing changes to the tables attached to the +** session object passed as the first argument. If successful, +** set *ppChangeset to point to a buffer containing the changeset ** and *pnChangeset to the size of the changeset in bytes before returning ** SQLITE_OK. If an error occurs, set both *ppChangeset and *pnChangeset to ** zero and return an SQLite error code. @@ -191,7 +191,7 @@ void sqlite3session_table_filter( ** modifies the values of primary key columns. If such a change is made, it ** is represented in a changeset as a DELETE followed by an INSERT. ** -** Changes are not recorded for rows that have NULL values stored in one or +** Changes are not recorded for rows that have NULL values stored in one or ** more of their PRIMARY KEY columns. If such a row is inserted or deleted, ** no corresponding change is present in the changesets returned by this ** function. If an existing row with one or more NULL values stored in @@ -244,14 +244,14 @@ void sqlite3session_table_filter( **
          **
        • For each record generated by an insert, the database is queried ** for a row with a matching primary key. If one is found, an INSERT -** change is added to the changeset. If no such row is found, no change +** change is added to the changeset. If no such row is found, no change ** is added to the changeset. ** -**
        • For each record generated by an update or delete, the database is +**
        • For each record generated by an update or delete, the database is ** queried for a row with a matching primary key. If such a row is ** found and one or more of the non-primary key fields have been -** modified from their original values, an UPDATE change is added to -** the changeset. Or, if no such row is found in the table, a DELETE +** modified from their original values, an UPDATE change is added to +** the changeset. Or, if no such row is found in the table, a DELETE ** change is added to the changeset. If there is a row with a matching ** primary key in the database, but all fields contain their original ** values, no change is added to the changeset. @@ -259,7 +259,7 @@ void sqlite3session_table_filter( ** ** This means, amongst other things, that if a row is inserted and then later ** deleted while a session object is active, neither the insert nor the delete -** will be present in the changeset. Or if a row is deleted and then later a +** will be present in the changeset. Or if a row is deleted and then later a ** row with the same primary key values inserted while a session object is ** active, the resulting changeset will contain an UPDATE change instead of ** a DELETE and an INSERT. @@ -268,10 +268,10 @@ void sqlite3session_table_filter( ** it does not accumulate records when rows are inserted, updated or deleted. ** This may appear to have some counter-intuitive effects if a single row ** is written to more than once during a session. For example, if a row -** is inserted while a session object is enabled, then later deleted while +** is inserted while a session object is enabled, then later deleted while ** the same session object is disabled, no INSERT record will appear in the ** changeset, even though the delete took place while the session was disabled. -** Or, if one field of a row is updated while a session is disabled, and +** Or, if one field of a row is updated while a session is disabled, and ** another field of the same row is updated while the session is enabled, the ** resulting changeset will contain an UPDATE change that updates both fields. */ @@ -282,7 +282,7 @@ int sqlite3session_changeset( ); /* -** CAPI3REF: Load The Difference Between Tables Into A Session +** CAPI3REF: Load The Difference Between Tables Into A Session ** ** If it is not already attached to the session object passed as the first ** argument, this function attaches table zTbl in the same manner as the @@ -291,7 +291,7 @@ int sqlite3session_changeset( ** an error). ** ** Argument zFromDb must be the name of a database ("main", "temp" etc.) -** attached to the same database handle as the session object that contains +** attached to the same database handle as the session object that contains ** a table compatible with the table attached to the session by this function. ** A table is considered compatible if it: ** @@ -307,25 +307,25 @@ int sqlite3session_changeset( ** APIs, tables without PRIMARY KEYs are simply ignored. ** ** This function adds a set of changes to the session object that could be -** used to update the table in database zFrom (call this the "from-table") -** so that its content is the same as the table attached to the session +** used to update the table in database zFrom (call this the "from-table") +** so that its content is the same as the table attached to the session ** object (call this the "to-table"). Specifically: ** **
            -**
          • For each row (primary key) that exists in the to-table but not in +**
          • For each row (primary key) that exists in the to-table but not in ** the from-table, an INSERT record is added to the session object. ** -**
          • For each row (primary key) that exists in the to-table but not in +**
          • For each row (primary key) that exists in the to-table but not in ** the from-table, a DELETE record is added to the session object. ** -**
          • For each row (primary key) that exists in both tables, but features +**
          • For each row (primary key) that exists in both tables, but features ** different non-PK values in each, an UPDATE record is added to the -** session. +** session. **
          ** ** To clarify, if this function is called and then a changeset constructed -** using [sqlite3session_changeset()], then after applying that changeset to -** database zFrom the contents of the two compatible tables would be +** using [sqlite3session_changeset()], then after applying that changeset to +** database zFrom the contents of the two compatible tables would be ** identical. ** ** It an error if database zFrom does not exist or does not contain the @@ -333,7 +333,7 @@ int sqlite3session_changeset( ** ** If the operation successful, SQLITE_OK is returned. Otherwise, an SQLite ** error code. In this case, if argument pzErrMsg is not NULL, *pzErrMsg -** may be set to point to a buffer containing an English language error +** may be set to point to a buffer containing an English language error ** message. It is the responsibility of the caller to free this buffer using ** sqlite3_free(). */ @@ -351,19 +351,19 @@ int sqlite3session_diff( ** The differences between a patchset and a changeset are that: ** **
            -**
          • DELETE records consist of the primary key fields only. The +**
          • DELETE records consist of the primary key fields only. The ** original values of other fields are omitted. -**
          • The original values of any modified fields are omitted from +**
          • The original values of any modified fields are omitted from ** UPDATE records. **
          ** -** A patchset blob may be used with up to date versions of all -** sqlite3changeset_xxx API functions except for sqlite3changeset_invert(), +** A patchset blob may be used with up to date versions of all +** sqlite3changeset_xxx API functions except for sqlite3changeset_invert(), ** which returns SQLITE_CORRUPT if it is passed a patchset. Similarly, ** attempting to use a patchset blob with old versions of the -** sqlite3changeset_xxx APIs also provokes an SQLITE_CORRUPT error. +** sqlite3changeset_xxx APIs also provokes an SQLITE_CORRUPT error. ** -** Because the non-primary key "old.*" fields are omitted, no +** Because the non-primary key "old.*" fields are omitted, no ** SQLITE_CHANGESET_DATA conflicts can be detected or reported if a patchset ** is passed to the sqlite3changeset_apply() API. Other conflict types work ** in the same way as for changesets. @@ -382,29 +382,29 @@ int sqlite3session_patchset( /* ** CAPI3REF: Test if a changeset has recorded any changes. ** -** Return non-zero if no changes to attached tables have been recorded by -** the session object passed as the first argument. Otherwise, if one or +** Return non-zero if no changes to attached tables have been recorded by +** the session object passed as the first argument. Otherwise, if one or ** more changes have been recorded, return zero. ** ** Even if this function returns zero, it is possible that calling ** [sqlite3session_changeset()] on the session handle may still return a -** changeset that contains no changes. This can happen when a row in -** an attached table is modified and then later on the original values +** changeset that contains no changes. This can happen when a row in +** an attached table is modified and then later on the original values ** are restored. However, if this function returns non-zero, then it is -** guaranteed that a call to sqlite3session_changeset() will return a +** guaranteed that a call to sqlite3session_changeset() will return a ** changeset containing zero changes. */ int sqlite3session_isempty(sqlite3_session *pSession); /* -** CAPI3REF: Create An Iterator To Traverse A Changeset +** CAPI3REF: Create An Iterator To Traverse A Changeset ** ** Create an iterator used to iterate through the contents of a changeset. ** If successful, *pp is set to point to the iterator handle and SQLITE_OK ** is returned. Otherwise, if an error occurs, *pp is set to zero and an ** SQLite error code is returned. ** -** The following functions can be used to advance and query a changeset +** The following functions can be used to advance and query a changeset ** iterator created by this function: ** **
            @@ -421,12 +421,12 @@ int sqlite3session_isempty(sqlite3_session *pSession); ** ** Assuming the changeset blob was created by one of the ** [sqlite3session_changeset()], [sqlite3changeset_concat()] or -** [sqlite3changeset_invert()] functions, all changes within the changeset -** that apply to a single table are grouped together. This means that when -** an application iterates through a changeset using an iterator created by -** this function, all changes that relate to a single table are visited -** consecutively. There is no chance that the iterator will visit a change -** the applies to table X, then one for table Y, and then later on visit +** [sqlite3changeset_invert()] functions, all changes within the changeset +** that apply to a single table are grouped together. This means that when +** an application iterates through a changeset using an iterator created by +** this function, all changes that relate to a single table are visited +** consecutively. There is no chance that the iterator will visit a change +** the applies to table X, then one for table Y, and then later on visit ** another change for table X. */ int sqlite3changeset_start( @@ -450,12 +450,12 @@ int sqlite3changeset_start( ** point to the first change in the changeset. Each subsequent call advances ** the iterator to point to the next change in the changeset (if any). If ** no error occurs and the iterator points to a valid change after a call -** to sqlite3changeset_next() has advanced it, SQLITE_ROW is returned. +** to sqlite3changeset_next() has advanced it, SQLITE_ROW is returned. ** Otherwise, if all changes in the changeset have already been visited, ** SQLITE_DONE is returned. ** -** If an error occurs, an SQLite error code is returned. Possible error -** codes include SQLITE_CORRUPT (if the changeset buffer is corrupt) or +** If an error occurs, an SQLite error code is returned. Possible error +** codes include SQLITE_CORRUPT (if the changeset buffer is corrupt) or ** SQLITE_NOMEM. */ int sqlite3changeset_next(sqlite3_changeset_iter *pIter); @@ -472,14 +472,14 @@ int sqlite3changeset_next(sqlite3_changeset_iter *pIter); ** If argument pzTab is not NULL, then *pzTab is set to point to a ** nul-terminated utf-8 encoded string containing the name of the table ** affected by the current change. The buffer remains valid until either -** sqlite3changeset_next() is called on the iterator or until the -** conflict-handler function returns. If pnCol is not NULL, then *pnCol is +** sqlite3changeset_next() is called on the iterator or until the +** conflict-handler function returns. If pnCol is not NULL, then *pnCol is ** set to the number of columns in the table affected by the change. If ** pbIncorrect is not NULL, then *pbIndirect is set to true (1) if the change ** is an indirect change, or false (0) otherwise. See the documentation for ** [sqlite3session_indirect()] for a description of direct and indirect -** changes. Finally, if pOp is not NULL, then *pOp is set to one of -** [SQLITE_INSERT], [SQLITE_DELETE] or [SQLITE_UPDATE], depending on the +** changes. Finally, if pOp is not NULL, then *pOp is set to one of +** [SQLITE_INSERT], [SQLITE_DELETE] or [SQLITE_UPDATE], depending on the ** type of change that the iterator currently points to. ** ** If no error occurs, SQLITE_OK is returned. If an error does occur, an @@ -531,7 +531,7 @@ int sqlite3changeset_pk( ** The pIter argument passed to this function may either be an iterator ** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator ** created by [sqlite3changeset_start()]. In the latter case, the most recent -** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. +** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. ** Furthermore, it may only be called if the type of change that the iterator ** currently points to is either [SQLITE_DELETE] or [SQLITE_UPDATE]. Otherwise, ** this function returns [SQLITE_MISUSE] and sets *ppValue to NULL. @@ -541,9 +541,9 @@ int sqlite3changeset_pk( ** [SQLITE_RANGE] is returned and *ppValue is set to NULL. ** ** If successful, this function sets *ppValue to point to a protected -** sqlite3_value object containing the iVal'th value from the vector of +** sqlite3_value object containing the iVal'th value from the vector of ** original row values stored as part of the UPDATE or DELETE change and -** returns SQLITE_OK. The name of the function comes from the fact that this +** returns SQLITE_OK. The name of the function comes from the fact that this ** is similar to the "old.*" columns available to update or delete triggers. ** ** If some other error occurs (e.g. an OOM condition), an SQLite error code @@ -561,7 +561,7 @@ int sqlite3changeset_old( ** The pIter argument passed to this function may either be an iterator ** passed to a conflict-handler by [sqlite3changeset_apply()], or an iterator ** created by [sqlite3changeset_start()]. In the latter case, the most recent -** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. +** call to [sqlite3changeset_next()] must have returned SQLITE_ROW. ** Furthermore, it may only be called if the type of change that the iterator ** currently points to is either [SQLITE_UPDATE] or [SQLITE_INSERT]. Otherwise, ** this function returns [SQLITE_MISUSE] and sets *ppValue to NULL. @@ -571,12 +571,12 @@ int sqlite3changeset_old( ** [SQLITE_RANGE] is returned and *ppValue is set to NULL. ** ** If successful, this function sets *ppValue to point to a protected -** sqlite3_value object containing the iVal'th value from the vector of +** sqlite3_value object containing the iVal'th value from the vector of ** new row values stored as part of the UPDATE or INSERT change and ** returns SQLITE_OK. If the change is an UPDATE and does not include -** a new value for the requested column, *ppValue is set to NULL and -** SQLITE_OK returned. The name of the function comes from the fact that -** this is similar to the "new.*" columns available to update or delete +** a new value for the requested column, *ppValue is set to NULL and +** SQLITE_OK returned. The name of the function comes from the fact that +** this is similar to the "new.*" columns available to update or delete ** triggers. ** ** If some other error occurs (e.g. an OOM condition), an SQLite error code @@ -602,7 +602,7 @@ int sqlite3changeset_new( ** [SQLITE_RANGE] is returned and *ppValue is set to NULL. ** ** If successful, this function sets *ppValue to point to a protected -** sqlite3_value object containing the iVal'th value from the +** sqlite3_value object containing the iVal'th value from the ** "conflicting row" associated with the current conflict-handler callback ** and returns SQLITE_OK. ** @@ -644,7 +644,7 @@ int sqlite3changeset_fk_conflicts( ** call has no effect. ** ** If an error was encountered within a call to an sqlite3changeset_xxx() -** function (for example an [SQLITE_CORRUPT] in [sqlite3changeset_next()] or an +** function (for example an [SQLITE_CORRUPT] in [sqlite3changeset_next()] or an ** [SQLITE_NOMEM] in [sqlite3changeset_new()]) then an error code corresponding ** to that error is returned by this function. Otherwise, SQLITE_OK is ** returned. This is to allow the following pattern (pseudo-code): @@ -655,7 +655,7 @@ int sqlite3changeset_fk_conflicts( ** } ** rc = sqlite3changeset_finalize(); ** if( rc!=SQLITE_OK ){ -** // An error has occurred +** // An error has occurred ** } */ int sqlite3changeset_finalize(sqlite3_changeset_iter *pIter); @@ -682,7 +682,7 @@ int sqlite3changeset_finalize(sqlite3_changeset_iter *pIter); ** zeroed and an SQLite error code returned. ** ** It is the responsibility of the caller to eventually call sqlite3_free() -** on the *ppOut pointer to free the buffer allocation following a successful +** on the *ppOut pointer to free the buffer allocation following a successful ** call to this function. ** ** WARNING/TODO: This function currently assumes that the input is a valid @@ -696,11 +696,11 @@ int sqlite3changeset_invert( /* ** CAPI3REF: Concatenate Two Changeset Objects ** -** This function is used to concatenate two changesets, A and B, into a +** This function is used to concatenate two changesets, A and B, into a ** single changeset. The result is a changeset equivalent to applying -** changeset A followed by changeset B. +** changeset A followed by changeset B. ** -** This function combines the two input changesets using an +** This function combines the two input changesets using an ** sqlite3_changegroup object. Calling it produces similar results as the ** following code fragment: ** @@ -742,7 +742,7 @@ typedef struct sqlite3_changegroup sqlite3_changegroup; ** ** If successful, this function returns SQLITE_OK and populates (*pp) with ** a pointer to a new sqlite3_changegroup object before returning. The caller -** should eventually free the returned object using a call to +** should eventually free the returned object using a call to ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL. ** @@ -754,7 +754,7 @@ typedef struct sqlite3_changegroup sqlite3_changegroup; **
          • Zero or more changesets (or patchsets) are added to the object ** by calling sqlite3changegroup_add(). ** -**
          • The result of combining all input changesets together is obtained +**
          • The result of combining all input changesets together is obtained ** by the application via a call to sqlite3changegroup_output(). ** **
          • The object is deleted using a call to sqlite3changegroup_delete(). @@ -763,7 +763,7 @@ typedef struct sqlite3_changegroup sqlite3_changegroup; ** Any number of calls to add() and output() may be made between the calls to ** new() and delete(), and in any order. ** -** As well as the regular sqlite3changegroup_add() and +** As well as the regular sqlite3changegroup_add() and ** sqlite3changegroup_output() functions, also available are the streaming ** versions sqlite3changegroup_add_strm() and sqlite3changegroup_output_strm(). */ @@ -773,7 +773,7 @@ int sqlite3changegroup_new(sqlite3_changegroup **pp); ** CAPI3REF: Add A Changeset To A Changegroup ** ** Add all changes within the changeset (or patchset) in buffer pData (size -** nData bytes) to the changegroup. +** nData bytes) to the changegroup. ** ** If the buffer contains a patchset, then all prior calls to this function ** on the same changegroup object must also have specified patchsets. Or, if @@ -800,7 +800,7 @@ int sqlite3changegroup_new(sqlite3_changegroup **pp); ** changeset was recorded immediately after the changesets already ** added to the changegroup. **
    • INSERT UPDATE -** The INSERT change remains in the changegroup. The values in the +** The INSERT change remains in the changegroup. The values in the ** INSERT change are modified as if the row was inserted by the ** existing change and then updated according to the new change. **
      INSERT DELETE @@ -811,17 +811,17 @@ int sqlite3changegroup_new(sqlite3_changegroup **pp); ** changeset was recorded immediately after the changesets already ** added to the changegroup. **
      UPDATE UPDATE -** The existing UPDATE remains within the changegroup. It is amended -** so that the accompanying values are as if the row was updated once +** The existing UPDATE remains within the changegroup. It is amended +** so that the accompanying values are as if the row was updated once ** by the existing change and then again by the new change. **
      UPDATE DELETE ** The existing UPDATE is replaced by the new DELETE within the ** changegroup. **
      DELETE INSERT ** If one or more of the column values in the row inserted by the -** new change differ from those in the row deleted by the existing +** new change differ from those in the row deleted by the existing ** change, the existing DELETE is replaced by an UPDATE within the -** changegroup. Otherwise, if the inserted row is exactly the same +** changegroup. Otherwise, if the inserted row is exactly the same ** as the deleted row, the existing DELETE is simply discarded. **
      DELETE UPDATE ** The new change is ignored. This case does not occur if the new @@ -865,7 +865,7 @@ int sqlite3changegroup_add(sqlite3_changegroup*, int nData, void *pData); ** ** If an error occurs, an SQLite error code is returned and the output ** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK -** is returned and the output variables are set to the size of and a +** is returned and the output variables are set to the size of and a ** pointer to the output buffer, respectively. In this case it is the ** responsibility of the caller to eventually free the buffer using a ** call to sqlite3_free(). @@ -893,21 +893,21 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** change in the changeset, the filter callback is invoked with ** the table name as the second argument, and a copy of the context pointer ** passed as the sixth argument to this function as the first. If the "filter -** callback" returns zero, then no attempt is made to apply any changes to +** callback" returns zero, then no attempt is made to apply any changes to ** the table. Otherwise, if the return value is non-zero or the xFilter ** argument to this function is NULL, all changes related to the table are ** attempted. ** -** For each table that is not excluded by the filter callback, this function -** tests that the target database contains a compatible table. A table is +** For each table that is not excluded by the filter callback, this function +** tests that the target database contains a compatible table. A table is ** considered compatible if all of the following are true: ** **
        -**
      • The table has the same name as the name recorded in the +**
      • The table has the same name as the name recorded in the ** changeset, and -**
      • The table has at least as many columns as recorded in the +**
      • The table has at least as many columns as recorded in the ** changeset, and -**
      • The table has primary key columns in the same position as +**
      • The table has primary key columns in the same position as ** recorded in the changeset. **
      ** @@ -916,11 +916,11 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** via the sqlite3_log() mechanism with the error code SQLITE_SCHEMA. At most ** one such warning is issued for each table in the changeset. ** -** For each change for which there is a compatible table, an attempt is made -** to modify the table contents according to the UPDATE, INSERT or DELETE -** change. If a change cannot be applied cleanly, the conflict handler -** function passed as the fifth argument to sqlite3changeset_apply() may be -** invoked. A description of exactly when the conflict handler is invoked for +** For each change for which there is a compatible table, an attempt is made +** to modify the table contents according to the UPDATE, INSERT or DELETE +** change. If a change cannot be applied cleanly, the conflict handler +** function passed as the fifth argument to sqlite3changeset_apply() may be +** invoked. A description of exactly when the conflict handler is invoked for ** each type of change is below. ** ** Unlike the xFilter argument, xConflict may not be passed NULL. The results @@ -928,23 +928,23 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** argument are undefined. ** ** Each time the conflict handler function is invoked, it must return one -** of [SQLITE_CHANGESET_OMIT], [SQLITE_CHANGESET_ABORT] or +** of [SQLITE_CHANGESET_OMIT], [SQLITE_CHANGESET_ABORT] or ** [SQLITE_CHANGESET_REPLACE]. SQLITE_CHANGESET_REPLACE may only be returned ** if the second argument passed to the conflict handler is either ** SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT. If the conflict-handler ** returns an illegal value, any changes already made are rolled back and -** the call to sqlite3changeset_apply() returns SQLITE_MISUSE. Different +** the call to sqlite3changeset_apply() returns SQLITE_MISUSE. Different ** actions are taken by sqlite3changeset_apply() depending on the value ** returned by each invocation of the conflict-handler function. Refer to -** the documentation for the three +** the documentation for the three ** [SQLITE_CHANGESET_OMIT|available return values] for details. ** **
      **
      DELETE Changes
      -** For each DELETE change, this function checks if the target database -** contains a row with the same primary key value (or values) as the -** original row values stored in the changeset. If it does, and the values -** stored in all non-primary key columns also match the values stored in +** For each DELETE change, this function checks if the target database +** contains a row with the same primary key value (or values) as the +** original row values stored in the changeset. If it does, and the values +** stored in all non-primary key columns also match the values stored in ** the changeset the row is deleted from the target database. ** ** If a row with matching primary key values is found, but one or more of @@ -973,22 +973,22 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** database table, the trailing fields are populated with their default ** values. ** -** If the attempt to insert the row fails because the database already +** If the attempt to insert the row fails because the database already ** contains a row with the same primary key values, the conflict handler -** function is invoked with the second argument set to +** function is invoked with the second argument set to ** [SQLITE_CHANGESET_CONFLICT]. ** ** If the attempt to insert the row fails because of some other constraint -** violation (e.g. NOT NULL or UNIQUE), the conflict handler function is +** violation (e.g. NOT NULL or UNIQUE), the conflict handler function is ** invoked with the second argument set to [SQLITE_CHANGESET_CONSTRAINT]. -** This includes the case where the INSERT operation is re-attempted because -** an earlier call to the conflict handler function returned +** This includes the case where the INSERT operation is re-attempted because +** an earlier call to the conflict handler function returned ** [SQLITE_CHANGESET_REPLACE]. ** **
      UPDATE Changes
      -** For each UPDATE change, this function checks if the target database -** contains a row with the same primary key value (or values) as the -** original row values stored in the changeset. If it does, and the values +** For each UPDATE change, this function checks if the target database +** contains a row with the same primary key value (or values) as the +** original row values stored in the changeset. If it does, and the values ** stored in all modified non-primary key columns also match the values ** stored in the changeset the row is updated within the target database. ** @@ -1004,12 +1004,12 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** the conflict-handler function is invoked with [SQLITE_CHANGESET_NOTFOUND] ** passed as the second argument. ** -** If the UPDATE operation is attempted, but SQLite returns -** SQLITE_CONSTRAINT, the conflict-handler function is invoked with +** If the UPDATE operation is attempted, but SQLite returns +** SQLITE_CONSTRAINT, the conflict-handler function is invoked with ** [SQLITE_CHANGESET_CONSTRAINT] passed as the second argument. -** This includes the case where the UPDATE operation is attempted after +** This includes the case where the UPDATE operation is attempted after ** an earlier call to the conflict handler function returned -** [SQLITE_CHANGESET_REPLACE]. +** [SQLITE_CHANGESET_REPLACE]. **
      ** ** It is safe to execute SQL statements, including those that write to the @@ -1020,7 +1020,7 @@ void sqlite3changegroup_delete(sqlite3_changegroup*); ** All changes made by this function are enclosed in a savepoint transaction. ** If any other error (aside from a constraint failure when attempting to ** write to the target database) occurs, then the savepoint transaction is -** rolled back, restoring the target database to its original state, and an +** rolled back, restoring the target database to its original state, and an ** SQLite error code returned. */ int sqlite3changeset_apply( @@ -1039,7 +1039,7 @@ int sqlite3changeset_apply( void *pCtx /* First argument passed to xConflict */ ); -/* +/* ** CAPI3REF: Constants Passed To The Conflict Handler ** ** Values that may be passed as the second argument to a conflict-handler. @@ -1048,32 +1048,32 @@ int sqlite3changeset_apply( **
      SQLITE_CHANGESET_DATA
      ** The conflict handler is invoked with CHANGESET_DATA as the second argument ** when processing a DELETE or UPDATE change if a row with the required -** PRIMARY KEY fields is present in the database, but one or more other -** (non primary-key) fields modified by the update do not contain the +** PRIMARY KEY fields is present in the database, but one or more other +** (non primary-key) fields modified by the update do not contain the ** expected "before" values. -** +** ** The conflicting row, in this case, is the database row with the matching ** primary key. -** +** **
      SQLITE_CHANGESET_NOTFOUND
      ** The conflict handler is invoked with CHANGESET_NOTFOUND as the second ** argument when processing a DELETE or UPDATE change if a row with the ** required PRIMARY KEY fields is not present in the database. -** +** ** There is no conflicting row in this case. The results of invoking the ** sqlite3changeset_conflict() API are undefined. -** +** **
      SQLITE_CHANGESET_CONFLICT
      ** CHANGESET_CONFLICT is passed as the second argument to the conflict -** handler while processing an INSERT change if the operation would result +** handler while processing an INSERT change if the operation would result ** in duplicate primary key values. -** +** ** The conflicting row in this case is the database row with the matching ** primary key. ** **
      SQLITE_CHANGESET_FOREIGN_KEY
      ** If foreign key handling is enabled, and applying a changeset leaves the -** database in a state containing foreign key violations, the conflict +** database in a state containing foreign key violations, the conflict ** handler is invoked with CHANGESET_FOREIGN_KEY as the second argument ** exactly once before the changeset is committed. If the conflict handler ** returns CHANGESET_OMIT, the changes, including those that caused the @@ -1083,12 +1083,12 @@ int sqlite3changeset_apply( ** No current or conflicting row information is provided. The only function ** it is possible to call on the supplied sqlite3_changeset_iter handle ** is sqlite3changeset_fk_conflicts(). -** +** **
      SQLITE_CHANGESET_CONSTRAINT
      -** If any other constraint violation occurs while applying a change (i.e. -** a UNIQUE, CHECK or NOT NULL constraint), the conflict handler is +** If any other constraint violation occurs while applying a change (i.e. +** a UNIQUE, CHECK or NOT NULL constraint), the conflict handler is ** invoked with CHANGESET_CONSTRAINT as the second argument. -** +** ** There is no conflicting row in this case. The results of invoking the ** sqlite3changeset_conflict() API are undefined. ** @@ -1100,7 +1100,7 @@ int sqlite3changeset_apply( #define SQLITE_CHANGESET_CONSTRAINT 4 #define SQLITE_CHANGESET_FOREIGN_KEY 5 -/* +/* ** CAPI3REF: Constants Returned By The Conflict Handler ** ** A conflict handler callback must return one of the following three values. @@ -1108,13 +1108,13 @@ int sqlite3changeset_apply( **
      **
      SQLITE_CHANGESET_OMIT
      ** If a conflict handler returns this value no special action is taken. The -** change that caused the conflict is not applied. The session module +** change that caused the conflict is not applied. The session module ** continues to the next change in the changeset. ** **
      SQLITE_CHANGESET_REPLACE
      ** This value may only be returned if the second argument to the conflict ** handler was SQLITE_CHANGESET_DATA or SQLITE_CHANGESET_CONFLICT. If this -** is not the case, any changes applied so far are rolled back and the +** is not the case, any changes applied so far are rolled back and the ** call to sqlite3changeset_apply() returns SQLITE_MISUSE. ** ** If CHANGESET_REPLACE is returned by an SQLITE_CHANGESET_DATA conflict @@ -1127,7 +1127,7 @@ int sqlite3changeset_apply( ** the original row is restored to the database before continuing. ** **
      SQLITE_CHANGESET_ABORT
      -** If this value is returned, any changes applied so far are rolled back +** If this value is returned, any changes applied so far are rolled back ** and the call to sqlite3changeset_apply() returns SQLITE_ABORT. **
      */ @@ -1138,24 +1138,24 @@ int sqlite3changeset_apply( /* ** CAPI3REF: Streaming Versions of API functions. ** -** The six streaming API xxx_strm() functions serve similar purposes to the +** The six streaming API xxx_strm() functions serve similar purposes to the ** corresponding non-streaming API functions: ** ** ** -**
      Streaming functionNon-streaming equivalent
      sqlite3changeset_apply_str[sqlite3changeset_apply] -**
      sqlite3changeset_concat_str[sqlite3changeset_concat] -**
      sqlite3changeset_invert_str[sqlite3changeset_invert] -**
      sqlite3changeset_start_str[sqlite3changeset_start] -**
      sqlite3session_changeset_str[sqlite3session_changeset] -**
      sqlite3session_patchset_str[sqlite3session_patchset] +**
      sqlite3changeset_apply_str[sqlite3changeset_apply] +**
      sqlite3changeset_concat_str[sqlite3changeset_concat] +**
      sqlite3changeset_invert_str[sqlite3changeset_invert] +**
      sqlite3changeset_start_str[sqlite3changeset_start] +**
      sqlite3session_changeset_str[sqlite3session_changeset] +**
      sqlite3session_patchset_str[sqlite3session_patchset] **
      ** ** Non-streaming functions that accept changesets (or patchsets) as input -** require that the entire changeset be stored in a single buffer in memory. -** Similarly, those that return a changeset or patchset do so by returning -** a pointer to a single large buffer allocated using sqlite3_malloc(). -** Normally this is convenient. However, if an application running in a +** require that the entire changeset be stored in a single buffer in memory. +** Similarly, those that return a changeset or patchset do so by returning +** a pointer to a single large buffer allocated using sqlite3_malloc(). +** Normally this is convenient. However, if an application running in a ** low-memory environment is required to handle very large changesets, the ** large contiguous memory allocations required can become onerous. ** @@ -1177,12 +1177,12 @@ int sqlite3changeset_apply( ** ** ** Each time the xInput callback is invoked by the sessions module, the first -** argument passed is a copy of the supplied pIn context pointer. The second -** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no -** error occurs the xInput method should copy up to (*pnData) bytes of data -** into the buffer and set (*pnData) to the actual number of bytes copied -** before returning SQLITE_OK. If the input is completely exhausted, (*pnData) -** should be set to zero to indicate this. Or, if an error occurs, an SQLite +** argument passed is a copy of the supplied pIn context pointer. The second +** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no +** error occurs the xInput method should copy up to (*pnData) bytes of data +** into the buffer and set (*pnData) to the actual number of bytes copied +** before returning SQLITE_OK. If the input is completely exhausted, (*pnData) +** should be set to zero to indicate this. Or, if an error occurs, an SQLite ** error code should be returned. In all cases, if an xInput callback returns ** an error, all processing is abandoned and the streaming API function ** returns a copy of the error code to the caller. @@ -1190,7 +1190,7 @@ int sqlite3changeset_apply( ** In the case of sqlite3changeset_start_strm(), the xInput callback may be ** invoked by the sessions module at any point during the lifetime of the ** iterator. If such an xInput callback returns an error, the iterator enters -** an error state, whereby all subsequent calls to iterator functions +** an error state, whereby all subsequent calls to iterator functions ** immediately fail with the same error code as returned by xInput. ** ** Similarly, streaming API functions that return changesets (or patchsets) @@ -1220,7 +1220,7 @@ int sqlite3changeset_apply( ** is immediately abandoned and the streaming API function returns a copy ** of the xOutput error code to the application. ** -** The sessions module never invokes an xOutput callback with the third +** The sessions module never invokes an xOutput callback with the third ** parameter set to a value less than or equal to zero. Other than this, ** no guarantees are made as to the size of the chunks of data returned. */ @@ -1268,12 +1268,12 @@ int sqlite3session_patchset_strm( int (*xOutput)(void *pOut, const void *pData, int nData), void *pOut ); -int sqlite3changegroup_add_strm(sqlite3_changegroup*, +int sqlite3changegroup_add_strm(sqlite3_changegroup*, int (*xInput)(void *pIn, void *pData, int *pnData), void *pIn ); int sqlite3changegroup_output_strm(sqlite3_changegroup*, - int (*xOutput)(void *pOut, const void *pData, int nData), + int (*xOutput)(void *pOut, const void *pData, int nData), void *pOut ); diff --git a/third_party/sqlite/src/ext/session/test_session.c b/third_party/sqlite/src/ext/session/test_session.c index 411354cc02d41..aa248d38d7a3c 100644 --- a/third_party/sqlite/src/ext/session/test_session.c +++ b/third_party/sqlite/src/ext/session/test_session.c @@ -49,9 +49,9 @@ static int dbHandleFromObj(Tcl_Interp *interp, Tcl_Obj *pObj, sqlite3 **pDb){ ** The following code is copied byte-for-byte from the sessions module ** documentation. It is used by some of the sessions modules tests to ** ensure that the example in the documentation does actually work. -*/ +*/ /* -** Argument zSql points to a buffer containing an SQL script to execute +** Argument zSql points to a buffer containing an SQL script to execute ** against the database handle passed as the first argument. As well as ** executing the SQL script, this function collects a changeset recording ** all changes made to the "main" database file. Assuming no error occurs, @@ -247,7 +247,7 @@ static int SQLITE_TCLAPI test_session_cmd( Tcl_WrongNumArgs(interp, 1, objv, "SUBCOMMAND ..."); return TCL_ERROR; } - rc = Tcl_GetIndexFromObjStruct(interp, + rc = Tcl_GetIndexFromObjStruct(interp, objv[1], aSub, sizeof(aSub[0]), "sub-command", 0, &iSub ); if( rc!=TCL_OK ) return rc; @@ -285,7 +285,7 @@ static int SQLITE_TCLAPI test_session_cmd( } } if( rc==SQLITE_OK ){ - Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(o.p, o.n)); + Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(o.p, o.n)); } sqlite3_free(o.p); if( rc!=SQLITE_OK ){ @@ -320,7 +320,7 @@ static int SQLITE_TCLAPI test_session_cmd( Tcl_SetObjResult(interp, Tcl_NewBooleanObj(val)); break; } - + case 6: { /* table_filter */ if( p->pFilterScript ) Tcl_DecrRefCount(p->pFilterScript); p->interp = interp; @@ -332,7 +332,7 @@ static int SQLITE_TCLAPI test_session_cmd( case 8: { /* diff */ char *zErr = 0; - rc = sqlite3session_diff(pSession, + rc = sqlite3session_diff(pSession, Tcl_GetString(objv[2]), Tcl_GetString(objv[3]), &zErr @@ -466,7 +466,7 @@ static int test_filter_handler( Tcl_IncrRefCount(pEval); if( TCL_OK!=Tcl_ListObjAppendElement(0, pEval, Tcl_NewStringObj(zTab, -1)) - || TCL_OK!=Tcl_EvalObjEx(interp, pEval, TCL_EVAL_GLOBAL) + || TCL_OK!=Tcl_EvalObjEx(interp, pEval, TCL_EVAL_GLOBAL) || TCL_OK!=Tcl_GetIntFromObj(interp, Tcl_GetObjResult(interp), &res) ){ Tcl_BackgroundError(interp); @@ -474,7 +474,7 @@ static int test_filter_handler( Tcl_DecrRefCount(pEval); return res; -} +} static int test_conflict_handler( void *pCtx, /* Pointer to TestConflictHandler structure */ @@ -505,13 +505,13 @@ static int test_conflict_handler( /* Append the operation type. */ Tcl_ListObjAppendElement(0, pEval, Tcl_NewStringObj( op==SQLITE_INSERT ? "INSERT" : - op==SQLITE_UPDATE ? "UPDATE" : + op==SQLITE_UPDATE ? "UPDATE" : "DELETE", -1 )); - + /* Append the table name. */ Tcl_ListObjAppendElement(0, pEval, Tcl_NewStringObj(zTab, -1)); - + /* Append the conflict type. */ switch( eConf ){ case SQLITE_CHANGESET_DATA: @@ -527,7 +527,7 @@ static int test_conflict_handler( Tcl_ListObjAppendElement(interp, pEval,Tcl_NewStringObj("CONSTRAINT",-1)); break; } - + /* If this is not an INSERT, append the old row */ if( op!=SQLITE_INSERT ){ int i; @@ -570,8 +570,8 @@ static int test_conflict_handler( /*********************************************************************** ** This block is purely for testing some error conditions. */ - if( eConf==SQLITE_CHANGESET_CONSTRAINT - || eConf==SQLITE_CHANGESET_NOTFOUND + if( eConf==SQLITE_CHANGESET_CONSTRAINT + || eConf==SQLITE_CHANGESET_NOTFOUND ){ sqlite3_value *pVal; int rc = sqlite3changeset_conflict(pIter, 0, &pVal); @@ -606,7 +606,7 @@ static int test_conflict_handler( assert( rc==SQLITE_RANGE ); } if( eConf!=SQLITE_CHANGESET_FOREIGN_KEY ){ - /* eConf!=FOREIGN_KEY is always true at this point. The condition is + /* eConf!=FOREIGN_KEY is always true at this point. The condition is ** just there to make it clearer what is being tested. */ int nDummy; int rc = sqlite3changeset_fk_conflicts(pIter, &nDummy); @@ -636,9 +636,9 @@ static int test_conflict_handler( } /* -** The conflict handler used by sqlite3changeset_apply_replace_all(). +** The conflict handler used by sqlite3changeset_apply_replace_all(). ** This conflict handler calls sqlite3_value_text16() on all available -** sqlite3_value objects and then returns CHANGESET_REPLACE, or +** sqlite3_value objects and then returns CHANGESET_REPLACE, or ** CHANGESET_OMIT if REPLACE is not applicable. This is used to test the ** effect of a malloc failure within an sqlite3_value_xxx() function ** invoked by a conflict-handler callback. @@ -732,7 +732,7 @@ static int SQLITE_TCLAPI test_sqlite3changeset_apply( sStr.nStream = test_tcl_integer(interp, SESSION_STREAM_TCL_VAR); if( objc!=4 && objc!=5 ){ - Tcl_WrongNumArgs(interp, 1, objv, + Tcl_WrongNumArgs(interp, 1, objv, "DB CHANGESET CONFLICT-SCRIPT ?FILTER-SCRIPT?" ); return TCL_ERROR; @@ -748,7 +748,7 @@ static int SQLITE_TCLAPI test_sqlite3changeset_apply( ctx.interp = interp; if( sStr.nStream==0 ){ - rc = sqlite3changeset_apply(db, nChangeset, pChangeset, + rc = sqlite3changeset_apply(db, nChangeset, pChangeset, (objc==5) ? test_filter_handler : 0, test_conflict_handler, (void *)&ctx ); }else{ @@ -767,7 +767,7 @@ static int SQLITE_TCLAPI test_sqlite3changeset_apply( } /* -** sqlite3changeset_apply_replace_all DB CHANGESET +** sqlite3changeset_apply_replace_all DB CHANGESET */ static int SQLITE_TCLAPI test_sqlite3changeset_apply_replace_all( void * clientData, @@ -961,7 +961,7 @@ static int SQLITE_TCLAPI test_sqlite3session_foreach( pVar = Tcl_NewObj(); Tcl_ListObjAppendElement(0, pVar, Tcl_NewStringObj( op==SQLITE_INSERT ? "INSERT" : - op==SQLITE_UPDATE ? "UPDATE" : + op==SQLITE_UPDATE ? "UPDATE" : "DELETE", -1 )); @@ -1029,7 +1029,7 @@ int TestSession_Init(Tcl_Interp *interp){ { "sqlite3changeset_invert", test_sqlite3changeset_invert }, { "sqlite3changeset_concat", test_sqlite3changeset_concat }, { "sqlite3changeset_apply", test_sqlite3changeset_apply }, - { "sqlite3changeset_apply_replace_all", + { "sqlite3changeset_apply_replace_all", test_sqlite3changeset_apply_replace_all }, { "sql_exec_changeset", test_sql_exec_changeset }, }; diff --git a/third_party/sqlite/src/ext/userauth/sqlite3userauth.h b/third_party/sqlite/src/ext/userauth/sqlite3userauth.h index 619477cac9b15..a27cb4d89d9b8 100644 --- a/third_party/sqlite/src/ext/userauth/sqlite3userauth.h +++ b/third_party/sqlite/src/ext/userauth/sqlite3userauth.h @@ -62,7 +62,7 @@ int sqlite3_user_add( ** The sqlite3_user_change() interface can be used to change a users ** login credentials or admin privilege. Any user can change their own ** login credentials. Only an admin user can change another users login -** credentials or admin privilege setting. No user may change their own +** credentials or admin privilege setting. No user may change their own ** admin privilege setting. */ int sqlite3_user_change( diff --git a/third_party/sqlite/src/ext/userauth/user-auth.txt b/third_party/sqlite/src/ext/userauth/user-auth.txt index ba4eabc1370b7..6918e8a225bb1 100644 --- a/third_party/sqlite/src/ext/userauth/user-auth.txt +++ b/third_party/sqlite/src/ext/userauth/user-auth.txt @@ -17,7 +17,7 @@ activated: const char *aPW, /* Password or credentials */ int nPW /* Number of bytes in aPW[] */ ); - + int sqlite3_user_add( sqlite3 *db, /* Database connection */ const char *zUsername, /* Username to be added */ @@ -25,7 +25,7 @@ activated: int nPW, /* Number of bytes in aPW[] */ int isAdmin /* True to give new user admin privilege */ ); - + int sqlite3_user_change( sqlite3 *db, /* Database connection */ const char *zUsername, /* Username to change */ @@ -33,7 +33,7 @@ activated: int nPW, /* Number of bytes in aPW[] */ int isAdmin /* Modified admin privilege for the user */ ); - + int sqlite3_user_delete( sqlite3 *db, /* Database connection */ const char *zUsername /* Username to remove */ @@ -45,13 +45,13 @@ By default a database does not require authentication. The sqlite3_open(), sqlite3_open16(), and sqlite3_open_v2() interfaces work as before: they open a new database connection. However, if the database being opened requires authentication, then attempts to read -or write from the database will fail with an SQLITE_AUTH error until -after sqlite3_user_authenticate() has been called successfully. The -sqlite3_user_authenticate() call will return SQLITE_OK if the +or write from the database will fail with an SQLITE_AUTH error until +after sqlite3_user_authenticate() has been called successfully. The +sqlite3_user_authenticate() call will return SQLITE_OK if the authentication credentials are accepted and SQLITE_ERROR if not. Calling sqlite3_user_authenticate() on a no-authentication-required -database connection is a harmless no-op. +database connection is a harmless no-op. If the database is encrypted, then sqlite3_key_v2() must be called first, with the correct decryption key, prior to invoking sqlite3_user_authenticate(). @@ -113,7 +113,7 @@ database. The sqlite3_user_change() interface can be used to change a users login credentials or admin privilege. Any user can change their own password. Only an admin user can change another users login -credentials or admin privilege setting. No user may change their own +credentials or admin privilege setting. No user may change their own admin privilege setting. The sqlite3_set_authorizer() callback is modified to take a 7th parameter diff --git a/third_party/sqlite/src/ext/userauth/userauth.c b/third_party/sqlite/src/ext/userauth/userauth.c index a3d346c05c690..1b6feaa0aad67 100644 --- a/third_party/sqlite/src/ext/userauth/userauth.c +++ b/third_party/sqlite/src/ext/userauth/userauth.c @@ -243,7 +243,7 @@ int sqlite3_user_add( if( db->auth.authLevel68 belong =0x0f055112 Fossil checkout - ->68 belong =0x0f055113 Fossil global configuration - +>68 belong =0x0f055112 Fossil checkout - +>68 belong =0x0f055113 Fossil global configuration - >68 belong =0x0f055111 Fossil repository - >68 belong =0x42654462 Bentley Systems BeSQLite Database - >68 belong =0x42654c6e Bentley Systems Localization File - diff --git a/third_party/sqlite/src/main.mk b/third_party/sqlite/src/main.mk index a8e8ffe275626..f1a3fa96463c3 100644 --- a/third_party/sqlite/src/main.mk +++ b/third_party/sqlite/src/main.mk @@ -19,7 +19,7 @@ # EXE The suffix to add to executable files. ".exe" for windows # and "" for Unix. # -# TCC C Compiler and options for use in building executables that +# TCC C Compiler and options for use in building executables that # will run on the target platform. This is usually the same # as BCC, unless you are cross-compiling. # @@ -43,7 +43,7 @@ # This is how we compile # -TCCX = $(TCC) $(OPTS) -I. -I$(TOP)/src -I$(TOP) +TCCX = $(TCC) $(OPTS) -I. -I$(TOP)/src -I$(TOP) TCCX += -I$(TOP)/ext/rtree -I$(TOP)/ext/icu -I$(TOP)/ext/fts3 TCCX += -I$(TOP)/ext/async -I$(TOP)/ext/userauth TCCX += -I$(TOP)/ext/session @@ -231,7 +231,7 @@ SRC += \ $(TOP)/ext/session/sqlite3session.h SRC += \ $(TOP)/ext/userauth/userauth.c \ - $(TOP)/ext/userauth/sqlite3userauth.h + $(TOP)/ext/userauth/sqlite3userauth.h SRC += \ $(TOP)/ext/rbu/sqlite3rbu.c \ $(TOP)/ext/rbu/sqlite3rbu.h @@ -245,7 +245,7 @@ FTS5_HDR = \ $(TOP)/ext/fts5/fts5.h \ $(TOP)/ext/fts5/fts5Int.h \ fts5parse.h - + FTS5_SRC = \ $(TOP)/ext/fts5/fts5_aux.c \ $(TOP)/ext/fts5/fts5_buffer.c \ @@ -345,7 +345,7 @@ TESTSRC += \ $(TOP)/ext/misc/vfslog.c \ $(TOP)/ext/fts5/fts5_tcl.c \ $(TOP)/ext/fts5/fts5_test_mi.c \ - $(TOP)/ext/fts5/fts5_test_tok.c + $(TOP)/ext/fts5/fts5_test_tok.c #TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c @@ -396,7 +396,7 @@ TESTSRC2 = \ $(TOP)/ext/fts3/fts3_write.c \ $(TOP)/ext/async/sqlite3async.c \ $(TOP)/ext/session/sqlite3session.c \ - $(TOP)/ext/session/test_session.c + $(TOP)/ext/session/test_session.c # Header files used by all library source files. # @@ -448,7 +448,7 @@ EXTHDR += \ EXTHDR += \ $(TOP)/ext/fts5/fts5Int.h \ fts5parse.h \ - $(TOP)/ext/fts5/fts5.h + $(TOP)/ext/fts5/fts5.h EXTHDR += \ $(TOP)/ext/userauth/sqlite3userauth.h @@ -728,7 +728,7 @@ rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR) -fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon +fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon cp $(TOP)/ext/fts5/fts5parse.y . rm -f fts5parse.h ./lemon $(OPTS) fts5parse.y @@ -845,7 +845,7 @@ smoketest: $(TESTPROGS) fuzzcheck$(EXE) # The next two rules are used to support the "threadtest" target. Building # threadtest runs a few thread-safety tests that are implemented in C. This # target is invoked by the releasetest.tcl script. -# +# THREADTEST3_SRC = $(TOP)/test/threadtest3.c \ $(TOP)/test/tt3_checkpoint.c \ $(TOP)/test/tt3_index.c \ @@ -902,15 +902,15 @@ wordcount$(EXE): $(TOP)/test/wordcount.c sqlite3.c $(TOP)/test/wordcount.c sqlite3.c speedtest1$(EXE): $(TOP)/test/speedtest1.c sqlite3.c - $(TCCX) -I. $(ST_OPT) -o speedtest1$(EXE) $(TOP)/test/speedtest1.c sqlite3.c $(THREADLIB) + $(TCCX) -I. $(ST_OPT) -o speedtest1$(EXE) $(TOP)/test/speedtest1.c sqlite3.c $(THREADLIB) kvtest$(EXE): $(TOP)/test/kvtest.c sqlite3.c - $(TCCX) -I. $(KV_OPT) -o kvtest$(EXE) $(TOP)/test/kvtest.c sqlite3.c $(THREADLIB) + $(TCCX) -I. $(KV_OPT) -o kvtest$(EXE) $(TOP)/test/kvtest.c sqlite3.c $(THREADLIB) dbselftest$(EXE): $(TOP)/test/dbselftest.c sqlite3.c $(TCCX) -I. $(DBSELFTEST_OPT) -o dbselftest$(EXE) $(TOP)/test/dbselftest.c sqlite3.c $(THREADLIB) -rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.o +rbu$(EXE): $(TOP)/ext/rbu/rbu.c $(TOP)/ext/rbu/sqlite3rbu.c sqlite3.o $(TCC) -I. -o rbu$(EXE) $(TOP)/ext/rbu/rbu.c sqlite3.o \ $(THREADLIB) @@ -942,7 +942,7 @@ install: sqlite3 libsqlite3.a sqlite3.h mv libsqlite3.a /usr/lib mv sqlite3.h /usr/include -clean: +clean: rm -f *.o sqlite3 sqlite3.exe libsqlite3.a sqlite3.h opcodes.* rm -f lemon lemon.exe lempar.c parse.* sqlite*.tar.gz rm -f mkkeywordhash mkkeywordhash.exe keywordhash.h diff --git a/third_party/sqlite/src/mptest/crash02.subtest b/third_party/sqlite/src/mptest/crash02.subtest index 86f64ddbe77f9..3ea28f1f37e9c 100644 --- a/third_party/sqlite/src/mptest/crash02.subtest +++ b/third_party/sqlite/src/mptest/crash02.subtest @@ -1,6 +1,6 @@ /* ** This script is called from crash01.test and config02.test and perhaps other -** script. After the database file has been set up, make a big rollback +** script. After the database file has been set up, make a big rollback ** journal in client 1, then crash client 1. ** Then in the other clients, do an integrity check. */ diff --git a/third_party/sqlite/src/mptest/mptest.c b/third_party/sqlite/src/mptest/mptest.c index 5022b009e6bf7..477e01b506967 100644 --- a/third_party/sqlite/src/mptest/mptest.c +++ b/third_party/sqlite/src/mptest/mptest.c @@ -9,7 +9,7 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** +** ** This is a program used for testing SQLite, and specifically for testing ** the ability of independent processes to access the same SQLite database ** concurrently. @@ -266,7 +266,7 @@ static void fatalError(const char *zFormat, ...){ } } sqlite3_close(g.db); - exit(1); + exit(1); } @@ -927,7 +927,7 @@ static void runScript( */ if( strcmp(zCmd, "sleep")==0 ){ sqlite3_sleep(atoi(azArg[0])); - }else + }else /* ** --exit N @@ -1331,7 +1331,7 @@ int SQLITE_CDECL main(int argc, char **argv){ }else{ g.pLog = stdout; } - + sqlite3_config(SQLITE_CONFIG_LOG, sqlErrorCallback, 0); if( zClient ){ iClient = atoi(zClient); @@ -1366,7 +1366,7 @@ int SQLITE_CDECL main(int argc, char **argv){ rc = sqlite3_open_v2(g.zDbFile, &g.db, openFlags, g.zVfs); if( rc ) fatalError("cannot open [%s]", g.zDbFile); if( iTmout>0 ) sqlite3_busy_timeout(g.db, iTmout); - + if( zJMode ){ #if defined(_WIN32) if( sqlite3_stricmp(zJMode,"persist")==0 diff --git a/third_party/sqlite/src/sqlite3.1 b/third_party/sqlite/src/sqlite3.1 index 80353b0eecd98..77b53667aed25 100644 --- a/third_party/sqlite/src/sqlite3.1 +++ b/third_party/sqlite/src/sqlite3.1 @@ -16,7 +16,7 @@ .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME -.B sqlite3 +.B sqlite3 \- A command line interface for SQLite version 3 .SH SYNOPSIS @@ -46,7 +46,7 @@ does exist, it will be opened. For example, to create a new database file named "mydata.db", create a table named "memos" and insert a couple of records into that table: .sp -$ +$ .B sqlite3 mydata.db .br SQLite version 3.8.8 @@ -84,7 +84,7 @@ semi-colons. For example: .sp -$ +$ .B sqlite3 -line mydata.db 'select * from memos where priority > 20;' .br text = lunch with Christine @@ -265,7 +265,7 @@ continue prompt = " ...> " .sp .fi -o If the file +o If the file .B ~/.sqliterc exists, it is processed first. can be found in the user's home directory, it is diff --git a/third_party/sqlite/src/src/alter.c b/third_party/sqlite/src/src/alter.c index 067cbb896db5b..a7201780979e2 100644 --- a/third_party/sqlite/src/src/alter.c +++ b/third_party/sqlite/src/src/alter.c @@ -22,9 +22,9 @@ /* -** This function is used by SQL generated to implement the +** This function is used by SQL generated to implement the ** ALTER TABLE command. The first argument is the text of a CREATE TABLE or -** CREATE INDEX command. The second is a table name. The table name in +** CREATE INDEX command. The second is a table name. The table name in ** the CREATE TABLE or CREATE INDEX statement is replaced with the third ** argument and the result returned. Examples: ** @@ -52,7 +52,7 @@ static void renameTableFunc( UNUSED_PARAMETER(NotUsed); - /* The principle used to locate the table name in the CREATE TABLE + /* The principle used to locate the table name in the CREATE TABLE ** statement is that the table name is the first non-space token that ** is immediately followed by a TK_LP or TK_USING token. */ @@ -86,7 +86,7 @@ static void renameTableFunc( /* ** This C function implements an SQL user function that is used by SQL code ** generated by the ALTER TABLE ... RENAME command to modify the definition -** of any foreign key constraints that use the table being renamed as the +** of any foreign key constraints that use the table being renamed as the ** parent table. It is passed three arguments: ** ** 1) The complete text of the CREATE TABLE statement being modified, @@ -131,7 +131,7 @@ static void renameParentFunc( if( zParent==0 ) break; sqlite3Dequote(zParent); if( 0==sqlite3StrICmp((const char *)zOld, zParent) ){ - char *zOut = sqlite3MPrintf(db, "%s%.*s\"%w\"", + char *zOut = sqlite3MPrintf(db, "%s%.*s\"%w\"", (zOutput?zOutput:""), (int)(z-zInput), zInput, (const char *)zNew ); sqlite3DbFree(db, zOutput); @@ -142,7 +142,7 @@ static void renameParentFunc( } } - zResult = sqlite3MPrintf(db, "%s%s", (zOutput?zOutput:""), zInput), + zResult = sqlite3MPrintf(db, "%s%s", (zOutput?zOutput:""), zInput), sqlite3_result_text(context, zResult, -1, SQLITE_DYNAMIC); sqlite3DbFree(db, zOutput); } @@ -150,9 +150,9 @@ static void renameParentFunc( #ifndef SQLITE_OMIT_TRIGGER /* This function is used by SQL generated to implement the -** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER -** statement. The second is a table name. The table name in the CREATE -** TRIGGER statement is replaced with the third argument and the result +** ALTER TABLE command. The first argument is the text of a CREATE TRIGGER +** statement. The second is a table name. The table name in the CREATE +** TRIGGER statement is replaced with the third argument and the result ** returned. This is analagous to renameTableFunc() above, except for CREATE ** TRIGGER, not CREATE INDEX and CREATE TABLE. */ @@ -174,7 +174,7 @@ static void renameTriggerFunc( UNUSED_PARAMETER(NotUsed); - /* The principle used to locate the table name in the CREATE TRIGGER + /* The principle used to locate the table name in the CREATE TRIGGER ** statement is that the table name is the first token that is immediately ** preceded by either TK_ON or TK_DOT and immediately followed by one ** of TK_WHEN, TK_BEGIN or TK_FOR. @@ -201,12 +201,12 @@ static void renameTriggerFunc( assert( len>0 ); /* Variable 'dist' stores the number of tokens read since the most - ** recent TK_DOT or TK_ON. This means that when a WHEN, FOR or BEGIN + ** recent TK_DOT or TK_ON. This means that when a WHEN, FOR or BEGIN ** token is read and 'dist' equals 2, the condition stated above ** to be met. ** ** Note that ON cannot be a database, table or column name, so - ** there is no need to worry about syntax like + ** there is no need to worry about syntax like ** "CREATE TRIGGER ... ON ON.ON BEGIN ..." etc. */ dist++; @@ -246,16 +246,16 @@ void sqlite3AlterFunctions(void){ ** ** name= OR name= OR ... ** -** If argument zWhere is NULL, then a pointer string containing the text +** If argument zWhere is NULL, then a pointer string containing the text ** "name=" is returned, where is the quoted version ** of the string passed as argument zConstant. The returned buffer is ** allocated using sqlite3DbMalloc(). It is the responsibility of the ** caller to ensure that it is eventually freed. ** -** If argument zWhere is not NULL, then the string returned is +** If argument zWhere is not NULL, then the string returned is ** " OR name=", where is the contents of zWhere. ** In this case zWhere is passed to sqlite3DbFree() before returning. -** +** */ static char *whereOrName(sqlite3 *db, char *zWhere, char *zConstant){ char *zNew; @@ -288,7 +288,7 @@ static char *whereForeignKeys(Parse *pParse, Table *pTab){ /* ** Generate the text of a WHERE expression which can be used to select all ** temporary triggers on table pTab from the sqlite_temp_master table. If -** table pTab has no temporary triggers, or is itself stored in the +** table pTab has no temporary triggers, or is itself stored in the ** temporary database, NULL is returned. */ static char *whereTempTriggers(Parse *pParse, Table *pTab){ @@ -296,9 +296,9 @@ static char *whereTempTriggers(Parse *pParse, Table *pTab){ char *zWhere = 0; const Schema *pTempSchema = pParse->db->aDb[1].pSchema; /* Temp db schema */ - /* If the table is not located in the temp-db (in which case NULL is + /* If the table is not located in the temp-db (in which case NULL is ** returned, loop through the tables list of triggers. For each trigger - ** that is not part of the temp-db schema, add a clause to the WHERE + ** that is not part of the temp-db schema, add a clause to the WHERE ** expression being built up in zWhere. */ if( pTab->pSchema!=pTempSchema ){ @@ -322,7 +322,7 @@ static char *whereTempTriggers(Parse *pParse, Table *pTab){ ** pTab from the database, including triggers and temporary triggers. ** Argument zName is the name of the table in the database schema at ** the time the generated code is executed. This can be different from -** pTab->zName if this function is being called to code part of an +** pTab->zName if this function is being called to code part of an ** "ALTER TABLE RENAME TO" statement. */ static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){ @@ -357,8 +357,8 @@ static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){ sqlite3VdbeAddParseSchemaOp(v, iDb, zWhere); #ifndef SQLITE_OMIT_TRIGGER - /* Now, if the table is not stored in the temp database, reload any temp - ** triggers. Don't use IN(...) in case SQLITE_OMIT_SUBQUERY is defined. + /* Now, if the table is not stored in the temp database, reload any temp + ** triggers. Don't use IN(...) in case SQLITE_OMIT_SUBQUERY is defined. */ if( (zWhere=whereTempTriggers(pParse, pTab))!=0 ){ sqlite3VdbeAddParseSchemaOp(v, 1, zWhere); @@ -383,8 +383,8 @@ static int isSystemTable(Parse *pParse, const char *zName){ } /* -** Generate code to implement the "ALTER TABLE xxx RENAME TO yyy" -** command. +** Generate code to implement the "ALTER TABLE xxx RENAME TO yyy" +** command. */ void sqlite3AlterRenameTable( Parse *pParse, /* Parser context. */ @@ -394,7 +394,7 @@ void sqlite3AlterRenameTable( int iDb; /* Database that contains the table */ char *zDb; /* Name of database iDb */ Table *pTab; /* Table being renamed */ - char *zName = 0; /* NULL-terminated version of pName */ + char *zName = 0; /* NULL-terminated version of pName */ sqlite3 *db = pParse->db; /* Database connection */ int nTabName; /* Number of UTF-8 characters in zTabName */ const char *zTabName; /* Original name of the table */ @@ -405,7 +405,7 @@ void sqlite3AlterRenameTable( VTable *pVTab = 0; /* Non-zero if this is a v-tab with an xRename() */ int savedDbFlags; /* Saved value of db->flags */ - savedDbFlags = db->flags; + savedDbFlags = db->flags; if( NEVER(db->mallocFailed) ) goto exit_rename_table; assert( pSrc->nSrc==1 ); assert( sqlite3BtreeHoldsAllMutexes(pParse->db) ); @@ -424,7 +424,7 @@ void sqlite3AlterRenameTable( ** in database iDb. If so, this is an error. */ if( sqlite3FindTable(db, zName, zDb) || sqlite3FindIndex(db, zName, zDb) ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "there is already another table or index with this name: %s", zName); goto exit_rename_table; } @@ -465,7 +465,7 @@ void sqlite3AlterRenameTable( } #endif - /* Begin a transaction for database iDb. + /* Begin a transaction for database iDb. ** Then modify the schema cookie (since the ALTER TABLE modifies the ** schema). Open a statement transaction if the table is a virtual ** table. @@ -497,11 +497,11 @@ void sqlite3AlterRenameTable( #if !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER) if( db->flags&SQLITE_ForeignKeys ){ - /* If foreign-key support is enabled, rewrite the CREATE TABLE + /* If foreign-key support is enabled, rewrite the CREATE TABLE ** statements corresponding to all child tables of foreign key constraints ** for which the renamed table is the parent table. */ if( (zWhere=whereForeignKeys(pParse, pTab))!=0 ){ - sqlite3NestedParse(pParse, + sqlite3NestedParse(pParse, "UPDATE \"%w\".%s SET " "sql = sqlite_rename_parent(sql, %Q, %Q) " "WHERE %s;", zDb, MASTER_NAME, zTabName, zName, zWhere); @@ -527,8 +527,8 @@ void sqlite3AlterRenameTable( "'sqlite_autoindex_' || %Q || substr(name,%d+18) " "ELSE name END " "WHERE tbl_name=%Q COLLATE nocase AND " - "(type='table' OR type='index' OR type='trigger');", - zDb, MASTER_NAME, zName, zName, zName, + "(type='table' OR type='index' OR type='trigger');", + zDb, MASTER_NAME, zName, zName, zName, #ifndef SQLITE_OMIT_TRIGGER zName, #endif @@ -536,7 +536,7 @@ void sqlite3AlterRenameTable( ); #ifndef SQLITE_OMIT_AUTOINCREMENT - /* If the sqlite_sequence table exists in this database, then update + /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ if( sqlite3FindTable(db, "sqlite_sequence", zDb) ){ @@ -552,7 +552,7 @@ void sqlite3AlterRenameTable( ** the temp database. */ if( (zWhere=whereTempTriggers(pParse, pTab))!=0 ){ - sqlite3NestedParse(pParse, + sqlite3NestedParse(pParse, "UPDATE sqlite_temp_master SET " "sql = sqlite_rename_trigger(sql, %Q), " "tbl_name = %Q " @@ -625,7 +625,7 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ } #endif - /* If the default value for the new column was specified with a + /* If the default value for the new column was specified with a ** literal NULL, then set pDflt to 0. This simplifies checking ** for an SQL NULL default below. */ @@ -647,12 +647,12 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ return; } if( (db->flags&SQLITE_ForeignKeys) && pNew->pFKey && pDflt ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "Cannot add a REFERENCES column with non-NULL default value"); return; } if( pCol->notNull && !pDflt ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "Cannot add a NOT NULL column with default value NULL"); return; } @@ -685,10 +685,10 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ *zEnd-- = '\0'; } db->flags |= SQLITE_PreferBuiltin; - sqlite3NestedParse(pParse, + sqlite3NestedParse(pParse, "UPDATE \"%w\".%s SET " "sql = substr(sql,1,%d) || ', ' || %Q || substr(sql,%d) " - "WHERE type = 'table' AND name = %Q", + "WHERE type = 'table' AND name = %Q", zDb, MASTER_NAME, pNew->addColOffset, zCol, pNew->addColOffset+1, zTab ); @@ -715,14 +715,14 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ /* ** This function is called by the parser after the table-name in -** an "ALTER TABLE ADD" statement is parsed. Argument +** an "ALTER TABLE ADD" statement is parsed. Argument ** pSrc is the full-name of the table being altered. ** ** This routine makes a (partial) copy of the Table structure ** for the table being altered and sets Parse.pNewTable to point ** to it. Routines called by the parser as the column definition -** is parsed (i.e. sqlite3AddColumn()) add the new Column data to -** the copy. The copy of the Table structure is deleted by tokenize.c +** is parsed (i.e. sqlite3AddColumn()) add the new Column data to +** the copy. The copy of the Table structure is deleted by tokenize.c ** after parsing is finished. ** ** Routine sqlite3AlterFinishAddColumn() will be called to complete diff --git a/third_party/sqlite/src/src/analyze.c b/third_party/sqlite/src/src/analyze.c index 890ae7c3b2da8..661a6d829478a 100644 --- a/third_party/sqlite/src/src/analyze.c +++ b/third_party/sqlite/src/src/analyze.c @@ -49,7 +49,7 @@ ** integer is the average number of rows in the index that have the same ** value in the first column of the index. The third integer is the average ** number of rows in the index that have the same value for the first two -** columns. The N-th integer (for N>1) is the average number of rows in +** columns. The N-th integer (for N>1) is the average number of rows in ** the index which have the same value for the first N-1 columns. For ** a K-column index, there will be K+1 integers in the stat column. If ** the index is unique, then the last integer will be 1. @@ -59,7 +59,7 @@ ** must be separated from the last integer by a single space. If the ** "unordered" keyword is present, then the query planner assumes that ** the index is unordered and will not use the index for a range query. -** +** ** If the sqlite_stat1.idx column is NULL, then the sqlite_stat1.stat ** column contains a single integer which is the (estimated) number of ** rows in the table identified by sqlite_stat1.tbl. @@ -117,9 +117,9 @@ ** number of entries that are strictly less than the sample. The first ** integer in nLt contains the number of entries in the index where the ** left-most column is less than the left-most column of the sample. -** The K-th integer in the nLt entry is the number of index entries +** The K-th integer in the nLt entry is the number of index entries ** where the first K columns are less than the first K columns of the -** sample. The nDLt column is like nLt except that it contains the +** sample. The nDLt column is like nLt except that it contains the ** number of distinct entries in the index that are less than the ** sample. ** @@ -212,9 +212,9 @@ static void openStatTable( Table *pStat; if( (pStat = sqlite3FindTable(db, zTab, pDb->zDbSName))==0 ){ if( aTable[i].zCols ){ - /* The sqlite_statN table does not exist. Create it. Note that a - ** side-effect of the CREATE TABLE statement is to leave the rootpage - ** of the new table in register pParse->regRoot. This is important + /* The sqlite_statN table does not exist. Create it. Note that a + ** side-effect of the CREATE TABLE statement is to leave the rootpage + ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ sqlite3NestedParse(pParse, "CREATE TABLE %Q.%s(%s)", pDb->zDbSName, zTab, aTable[i].zCols @@ -223,7 +223,7 @@ static void openStatTable( aCreateTbl[i] = OPFLAG_P2ISREG; } }else{ - /* The table already exists. If zWhere is not NULL, delete all entries + /* The table already exists. If zWhere is not NULL, delete all entries ** associated with the table zWhere. If zWhere is NULL, delete the ** entire contents of the table. */ aRoot[i] = pStat->tnum; @@ -278,7 +278,7 @@ struct Stat4Sample { int iCol; /* If !isPSample, the reason for inclusion */ u32 iHash; /* Tiebreaker hash */ #endif -}; +}; struct Stat4Accum { tRowcnt nRow; /* Number of rows in the entire table */ tRowcnt nPSample; /* How often to do a periodic sample */ @@ -386,7 +386,7 @@ static void stat4Destructor(void *pOld){ ** PRIMARY KEY of the table. The covering index that implements the ** original WITHOUT ROWID table as N==K as a special case. ** -** This routine allocates the Stat4Accum object in heap memory. The return +** This routine allocates the Stat4Accum object in heap memory. The return ** value is a pointer to the Stat4Accum object. The datatype of the ** return value is BLOB, but it is really just a pointer to the Stat4Accum ** object. @@ -416,7 +416,7 @@ static void statInit( assert( nKeyCol>0 ); /* Allocate the space required for the Stat4Accum object */ - n = sizeof(*p) + n = sizeof(*p) + sizeof(tRowcnt)*nColUp /* Stat4Accum.anEq */ + sizeof(tRowcnt)*nColUp /* Stat4Accum.anDLt */ #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 @@ -449,7 +449,7 @@ static void statInit( p->nPSample = (tRowcnt)(sqlite3_value_int64(argv[2])/(mxSample/3+1) + 1); p->current.anLt = &p->current.anEq[nColUp]; p->iPrn = 0x689e962d*(u32)nCol ^ 0xd0944565*(u32)sqlite3_value_int(argv[2]); - + /* Set up the Stat4Accum.a[] and aBest[] arrays */ p->a = (struct Stat4Sample*)&p->current.anLt[nColUp]; p->aBest = &p->a[mxSample]; @@ -460,7 +460,7 @@ static void statInit( p->a[i].anDLt = (tRowcnt *)pSpace; pSpace += (sizeof(tRowcnt) * nColUp); } assert( (pSpace - (u8*)p)==n ); - + for(i=0; iaBest[i].iCol = i; } @@ -486,19 +486,19 @@ static const FuncDef statInitFuncdef = { #ifdef SQLITE_ENABLE_STAT4 /* -** pNew and pOld are both candidate non-periodic samples selected for -** the same column (pNew->iCol==pOld->iCol). Ignoring this column and +** pNew and pOld are both candidate non-periodic samples selected for +** the same column (pNew->iCol==pOld->iCol). Ignoring this column and ** considering only any trailing columns and the sample hash value, this ** function returns true if sample pNew is to be preferred over pOld. ** In other words, if we assume that the cardinalities of the selected ** column for pNew and pOld are equal, is pNew to be preferred over pOld. ** ** This function assumes that for each argument sample, the contents of -** the anEq[] array from pSample->anEq[pSample->iCol+1] onwards are valid. +** the anEq[] array from pSample->anEq[pSample->iCol+1] onwards are valid. */ static int sampleIsBetterPost( - Stat4Accum *pAccum, - Stat4Sample *pNew, + Stat4Accum *pAccum, + Stat4Sample *pNew, Stat4Sample *pOld ){ int nCol = pAccum->nCol; @@ -518,11 +518,11 @@ static int sampleIsBetterPost( ** Return true if pNew is to be preferred over pOld. ** ** This function assumes that for each argument sample, the contents of -** the anEq[] array from pSample->anEq[pSample->iCol] onwards are valid. +** the anEq[] array from pSample->anEq[pSample->iCol] onwards are valid. */ static int sampleIsBetter( - Stat4Accum *pAccum, - Stat4Sample *pNew, + Stat4Accum *pAccum, + Stat4Sample *pNew, Stat4Sample *pOld ){ tRowcnt nEqNew = pNew->anEq[pNew->iCol]; @@ -558,7 +558,7 @@ static void sampleInsert(Stat4Accum *p, Stat4Sample *pNew, int nEqZero){ Stat4Sample *pUpgrade = 0; assert( pNew->anEq[pNew->iCol]>0 ); - /* This sample is being added because the prefix that ends in column + /* This sample is being added because the prefix that ends in column ** iCol occurs many times in the table. However, if we have already ** added a sample that shares this prefix, there is no need to add ** this one. Instead, upgrade the priority of the highest priority @@ -602,7 +602,7 @@ static void sampleInsert(Stat4Accum *p, Stat4Sample *pNew, int nEqZero){ ** for the last sample in the p->a[] array. Otherwise, the samples would ** be out of order. */ #ifdef SQLITE_ENABLE_STAT4 - assert( p->nSample==0 + assert( p->nSample==0 || pNew->anLt[p->nCol-1] > p->a[p->nSample-1].anLt[p->nCol-1] ); #endif @@ -670,11 +670,11 @@ static void samplePushPrevious(Stat4Accum *p, int iChng){ p->current.isPSample = 1; sampleInsert(p, &p->current, 0); p->current.isPSample = 0; - }else + }else /* Or if it is a non-periodic sample. Add it in this case too. */ - if( p->nSamplemxSample - || sampleIsBetter(p, &p->current, &p->a[p->iMin]) + if( p->nSamplemxSample + || sampleIsBetter(p, &p->current, &p->a[p->iMin]) ){ sampleInsert(p, &p->current, 0); } @@ -818,9 +818,9 @@ static void statGet( /* STAT3 and STAT4 have a parameter on this routine. */ int eCall = sqlite3_value_int(argv[1]); assert( argc==2 ); - assert( eCall==STAT_GET_STAT1 || eCall==STAT_GET_NEQ + assert( eCall==STAT_GET_STAT1 || eCall==STAT_GET_NEQ || eCall==STAT_GET_ROWID || eCall==STAT_GET_NLT - || eCall==STAT_GET_NDLT + || eCall==STAT_GET_NDLT ); if( eCall==STAT_GET_STAT1 ) #else @@ -830,20 +830,20 @@ static void statGet( /* Return the value to store in the "stat" column of the sqlite_stat1 ** table for this index. ** - ** The value is a string composed of a list of integers describing - ** the index. The first integer in the list is the total number of - ** entries in the index. There is one additional integer in the list + ** The value is a string composed of a list of integers describing + ** the index. The first integer in the list is the total number of + ** entries in the index. There is one additional integer in the list ** for each indexed column. This additional integer is an estimate of ** the number of rows matched by a stabbing query on the index using ** a key with the corresponding number of fields. In other words, - ** if the index is on columns (a,b) and the sqlite_stat1 value is + ** if the index is on columns (a,b) and the sqlite_stat1 value is ** "100 10 2", then SQLite estimates that: ** ** * the index contains 100 rows, ** * "WHERE a=?" matches 10 rows, and ** * "WHERE a=? AND b=?" matches 2 rows. ** - ** If D is the count of distinct values and K is the total number of + ** If D is the count of distinct values and K is the total number of ** rows, then each estimate is computed as: ** ** I = (K+D-1)/D @@ -893,7 +893,7 @@ static void statGet( case STAT_GET_NEQ: aCnt = p->a[p->iGet].anEq; break; case STAT_GET_NLT: aCnt = p->a[p->iGet].anLt; break; default: { - aCnt = p->a[p->iGet].anDLt; + aCnt = p->a[p->iGet].anDLt; p->iGet++; break; } @@ -1005,7 +1005,7 @@ static void analyzeOneTable( } #endif - /* Establish a read-lock on the table at the shared-cache level. + /* Establish a read-lock on the table at the shared-cache level. ** Open a read-only cursor on the table. Also allocate a cursor number ** to use for scanning indexes (iIdxCur). No index cursor is opened at ** this time though. */ @@ -1071,9 +1071,9 @@ static void analyzeOneTable( ** end_of_scan: */ - /* Make sure there are enough memory cells allocated to accommodate + /* Make sure there are enough memory cells allocated to accommodate ** the regPrev array and a trailing rowid (the rowid slot is required - ** when building a record to insert into the sample column of + ** when building a record to insert into the sample column of ** the sqlite_stat4 table. */ pParse->nMem = MAX(pParse->nMem, regPrev+nColTest); @@ -1084,7 +1084,7 @@ static void analyzeOneTable( VdbeComment((v, "%s", pIdx->zName)); /* Invoke the stat_init() function. The arguments are: - ** + ** ** (1) the number of columns in the index including the rowid ** (or for a WITHOUT ROWID table, the number of PK columns), ** (2) the number of columns in the key without the rowid/pk @@ -1135,7 +1135,7 @@ static void analyzeOneTable( addrNextRow = sqlite3VdbeCurrentAddr(v); if( nColTest==1 && pIdx->nKeyCol==1 && IsUniqueIndex(pIdx) ){ /* For a single-column UNIQUE index, once we have found a non-NULL - ** row, we know that all the rest will be distinct, so skip + ** row, we know that all the rest will be distinct, so skip ** subsequent distinctness tests. */ sqlite3VdbeAddOp2(v, OP_NotNull, regPrev, endDistinctTest); VdbeCoverage(v); @@ -1144,15 +1144,15 @@ static void analyzeOneTable( char *pColl = (char*)sqlite3LocateCollSeq(pParse, pIdx->azColl[i]); sqlite3VdbeAddOp2(v, OP_Integer, i, regChng); sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regTemp); - aGotoChng[i] = + aGotoChng[i] = sqlite3VdbeAddOp4(v, OP_Ne, regTemp, 0, regPrev+i, pColl, P4_COLLSEQ); sqlite3VdbeChangeP5(v, SQLITE_NULLEQ); VdbeCoverage(v); } sqlite3VdbeAddOp2(v, OP_Integer, nColTest, regChng); sqlite3VdbeGoto(v, endDistinctTest); - - + + /* ** chng_addr_0: ** regPrev(0) = idx(0) @@ -1168,7 +1168,7 @@ static void analyzeOneTable( sqlite3VdbeResolveLabel(v, endDistinctTest); sqlite3DbFree(db, aGotoChng); } - + /* ** chng_addr_N: ** regRowid = idx(rowid) // STAT34 only @@ -1400,7 +1400,7 @@ void sqlite3Analyze(Parse *pParse, Token *pName1, Token *pName2){ } sqlite3DbFree(db, z); } - } + } } v = sqlite3GetVdbe(pParse); if( v ) sqlite3VdbeAddOp0(v, OP_Expire); @@ -1483,7 +1483,7 @@ static void decodeIntArray( /* ** This callback is invoked once for each index when reading the -** sqlite_stat1 table. +** sqlite_stat1 table. ** ** argv[0] = name of the table ** argv[1] = name of the index (might be NULL) @@ -1521,7 +1521,7 @@ static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){ tRowcnt *aiRowEst = 0; int nCol = pIndex->nKeyCol+1; #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 - /* Index.aiRowEst may already be set here if there are duplicate + /* Index.aiRowEst may already be set here if there are duplicate ** sqlite_stat1 entries for this index. In that case just clobber ** the old data with the new instead of allocating a new array. */ if( pIndex->aiRowEst==0 ){ @@ -1573,7 +1573,7 @@ void sqlite3DeleteIndexSamples(sqlite3 *db, Index *pIdx){ #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 /* ** Populate the pIdx->aAvgEq[] array based on the samples currently -** stored in pIdx->aSample[]. +** stored in pIdx->aSample[]. */ static void initAvgEq(Index *pIdx){ if( pIdx ){ @@ -1609,12 +1609,12 @@ static void initAvgEq(Index *pIdx){ pIdx->nRowEst0 = nRow; /* Set nSum to the number of distinct (iCol+1) field prefixes that - ** occur in the stat4 table for this index. Set sumEq to the sum of - ** the nEq values for column iCol for the same set (adding the value + ** occur in the stat4 table for this index. Set sumEq to the sum of + ** the nEq values for column iCol for the same set (adding the value ** only once where there exist duplicate prefixes). */ for(i=0; inSample-1) - || aSample[i].anDLt[iCol]!=aSample[i+1].anDLt[iCol] + || aSample[i].anDLt[iCol]!=aSample[i+1].anDLt[iCol] ){ sumEq += aSample[i].anEq[iCol]; nSum100 += 100; @@ -1648,7 +1648,7 @@ static Index *findIndexOrPrimaryKey( } /* -** Load the content from either the sqlite_stat4 or sqlite_stat3 table +** Load the content from either the sqlite_stat4 or sqlite_stat3 table ** into the relevant Index.aSample[] arrays. ** ** Arguments zSql1 and zSql2 must point to SQL statements that return @@ -1747,7 +1747,7 @@ static int loadStatTbl( if( zIndex==0 ) continue; pIdx = findIndexOrPrimaryKey(db, zIndex, zDb); if( pIdx==0 ) continue; - /* This next condition is true if data has already been loaded from + /* This next condition is true if data has already been loaded from ** the sqlite_stat4 table. In this case ignore stat3 data. */ nCol = pIdx->nSampleCol; if( bStat3 && nCol>1 ) continue; @@ -1783,7 +1783,7 @@ static int loadStatTbl( } /* -** Load content from the sqlite_stat4 and sqlite_stat3 tables into +** Load content from the sqlite_stat4 and sqlite_stat3 tables into ** the Index.aSample[] arrays of all indices. */ static int loadStat4(sqlite3 *db, const char *zDb){ @@ -1792,7 +1792,7 @@ static int loadStat4(sqlite3 *db, const char *zDb){ assert( db->lookaside.bDisable ); if( sqlite3FindTable(db, "sqlite_stat4", zDb) ){ rc = loadStatTbl(db, 0, - "SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx", + "SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx", "SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4", zDb ); @@ -1800,7 +1800,7 @@ static int loadStat4(sqlite3 *db, const char *zDb){ if( rc==SQLITE_OK && sqlite3FindTable(db, "sqlite_stat3", zDb) ){ rc = loadStatTbl(db, 1, - "SELECT idx,count(*) FROM %Q.sqlite_stat3 GROUP BY idx", + "SELECT idx,count(*) FROM %Q.sqlite_stat3 GROUP BY idx", "SELECT idx,neq,nlt,ndlt,sqlite_record(sample) FROM %Q.sqlite_stat3", zDb ); @@ -1817,11 +1817,11 @@ static int loadStat4(sqlite3 *db, const char *zDb){ ** Index.aSample[] arrays. ** ** If the sqlite_stat1 table is not present in the database, SQLITE_ERROR -** is returned. In this case, even if SQLITE_ENABLE_STAT3/4 was defined -** during compilation and the sqlite_stat3/4 table is present, no data is +** is returned. In this case, even if SQLITE_ENABLE_STAT3/4 was defined +** during compilation and the sqlite_stat3/4 table is present, no data is ** read from it. ** -** If SQLITE_ENABLE_STAT3/4 was defined during compilation and the +** If SQLITE_ENABLE_STAT3/4 was defined during compilation and the ** sqlite_stat4 table is not present in the database, SQLITE_ERROR is ** returned. However, in this case, data is read from the sqlite_stat1 ** table (if it is present) before returning. @@ -1854,7 +1854,7 @@ int sqlite3AnalysisLoad(sqlite3 *db, int iDb){ sInfo.db = db; sInfo.zDatabase = db->aDb[iDb].zDbSName; if( sqlite3FindTable(db, "sqlite_stat1", sInfo.zDatabase)!=0 ){ - zSql = sqlite3MPrintf(db, + zSql = sqlite3MPrintf(db, "SELECT tbl,idx,stat FROM %Q.sqlite_stat1", sInfo.zDatabase); if( zSql==0 ){ rc = SQLITE_NOMEM_BKPT; diff --git a/third_party/sqlite/src/src/attach.c b/third_party/sqlite/src/src/attach.c index 393c46ccb6836..3908655a4097d 100644 --- a/third_party/sqlite/src/src/attach.c +++ b/third_party/sqlite/src/src/attach.c @@ -87,7 +87,7 @@ static void attachFunc( ** * Specified database name already being used. */ if( db->nDb>=db->aLimit[SQLITE_LIMIT_ATTACHED]+2 ){ - zErrDyn = sqlite3MPrintf(db, "too many attached databases - max %d", + zErrDyn = sqlite3MPrintf(db, "too many attached databases - max %d", db->aLimit[SQLITE_LIMIT_ATTACHED] ); goto attach_error; @@ -147,7 +147,7 @@ static void attachFunc( if( !aNew->pSchema ){ rc = SQLITE_NOMEM_BKPT; }else if( aNew->pSchema->file_format && aNew->pSchema->enc!=ENC(db) ){ - zErrDyn = sqlite3MPrintf(db, + zErrDyn = sqlite3MPrintf(db, "attached databases must use the same text encoding as main database"); rc = SQLITE_ERROR; } @@ -182,7 +182,7 @@ static void attachFunc( zErrDyn = sqlite3DbStrDup(db, "Invalid key value"); rc = SQLITE_ERROR; break; - + case SQLITE_TEXT: case SQLITE_BLOB: nKey = sqlite3_value_bytes(argv[2]); @@ -202,7 +202,7 @@ static void attachFunc( #endif /* If the file was opened successfully, read the schema for the new database. - ** If this fails, or if opening the file failed, then close the file and + ** If this fails, or if opening the file failed, then close the file and ** remove the entry from the db->aDb[] array. i.e. put everything back the way ** we found it. */ @@ -239,7 +239,7 @@ static void attachFunc( } goto attach_error; } - + return; attach_error: @@ -330,7 +330,7 @@ static void codeAttach( memset(&sName, 0, sizeof(NameContext)); sName.pParse = pParse; - if( + if( SQLITE_OK!=(rc = resolveAttachExpr(&sName, pFilename)) || SQLITE_OK!=(rc = resolveAttachExpr(&sName, pDbname)) || SQLITE_OK!=(rc = resolveAttachExpr(&sName, pKey)) @@ -366,14 +366,14 @@ static void codeAttach( (char *)pFunc, P4_FUNCDEF); assert( pFunc->nArg==-1 || (pFunc->nArg&0xff)==pFunc->nArg ); sqlite3VdbeChangeP5(v, (u8)(pFunc->nArg)); - + /* Code an OP_Expire. For an ATTACH statement, set P1 to true (expire this ** statement only). For DETACH, set it to false (expire all existing ** statements). */ sqlite3VdbeAddOp1(v, OP_Expire, (type==SQLITE_ATTACH)); } - + attach_end: sqlite3ExprDelete(db, pFilename); sqlite3ExprDelete(db, pDbname); diff --git a/third_party/sqlite/src/src/auth.c b/third_party/sqlite/src/src/auth.c index 77a95d4a8f49d..a3820b87dbcd2 100644 --- a/third_party/sqlite/src/src/auth.c +++ b/third_party/sqlite/src/src/auth.c @@ -132,10 +132,10 @@ int sqlite3AuthReadCol( /* ** The pExpr should be a TK_COLUMN expression. The table referred to -** is in pTabList or else it is the NEW or OLD table of a trigger. +** is in pTabList or else it is the NEW or OLD table of a trigger. ** Check to see if it is OK to read this particular column. ** -** If the auth function returns SQLITE_IGNORE, change the TK_COLUMN +** If the auth function returns SQLITE_IGNORE, change the TK_COLUMN ** instruction into a TK_NULL. If the auth function returns SQLITE_DENY, ** then generate an error. */ @@ -238,7 +238,7 @@ int sqlite3AuthCheck( */ void sqlite3AuthContextPush( Parse *pParse, - AuthContext *pContext, + AuthContext *pContext, const char *zContext ){ assert( pParse ); diff --git a/third_party/sqlite/src/src/backup.c b/third_party/sqlite/src/src/backup.c index 165144d965745..37b9a9af10e95 100644 --- a/third_party/sqlite/src/src/backup.c +++ b/third_party/sqlite/src/src/backup.c @@ -9,7 +9,7 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() +** This file contains the implementation of the sqlite3_backup_XXX() ** API functions and the related features. */ #include "sqliteInt.h" @@ -46,15 +46,15 @@ struct sqlite3_backup { ** Once it has been created using backup_init(), a single sqlite3_backup ** structure may be accessed via two groups of thread-safe entry points: ** -** * Via the sqlite3_backup_XXX() API function backup_step() and +** * Via the sqlite3_backup_XXX() API function backup_step() and ** backup_finish(). Both these functions obtain the source database -** handle mutex and the mutex associated with the source BtShared +** handle mutex and the mutex associated with the source BtShared ** structure, in that order. ** ** * Via the BackupUpdate() and BackupRestart() functions, which are ** invoked by the pager layer to report various state changes in ** the page cache associated with the source database. The mutex -** associated with the source database BtShared structure will always +** associated with the source database BtShared structure will always ** be held when either of these functions are invoked. ** ** The other sqlite3_backup_XXX() API functions, backup_remaining() and @@ -75,8 +75,8 @@ struct sqlite3_backup { ** in connection handle pDb. If such a database cannot be found, return ** a NULL pointer and write an error message to pErrorDb. ** -** If the "temp" database is requested, it may need to be opened by this -** function. If an error occurs while doing so, return 0 and write an +** If the "temp" database is requested, it may need to be opened by this +** function. If an error occurs while doing so, return 0 and write an ** error message to pErrorDb. */ static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){ @@ -119,7 +119,7 @@ static int setDestPgsz(sqlite3_backup *p){ /* ** Check that there is no open read-transaction on the b-tree passed as the ** second argument. If there is not, return SQLITE_OK. Otherwise, if there -** is an open read-transaction, return SQLITE_ERROR and leave an error +** is an open read-transaction, return SQLITE_ERROR and leave an error ** message in database handle db. */ static int checkReadTransaction(sqlite3 *db, Btree *p){ @@ -189,13 +189,13 @@ sqlite3_backup *sqlite3_backup_init( p->iNext = 1; p->isAttached = 0; - if( 0==p->pSrc || 0==p->pDest - || checkReadTransaction(pDestDb, p->pDest)!=SQLITE_OK + if( 0==p->pSrc || 0==p->pDest + || checkReadTransaction(pDestDb, p->pDest)!=SQLITE_OK ){ /* One (or both) of the named databases did not exist or an OOM ** error was hit. Or there is a transaction open on the destination - ** database. The error has already been written into the pDestDb - ** handle. All that is left to do here is free the sqlite3_backup + ** database. The error has already been written into the pDestDb + ** handle. All that is left to do here is free the sqlite3_backup ** structure. */ sqlite3_free(p); p = 0; @@ -211,7 +211,7 @@ sqlite3_backup *sqlite3_backup_init( } /* -** Argument rc is an SQLite error code. Return true if this error is +** Argument rc is an SQLite error code. Return true if this error is ** considered fatal if encountered during a backup operation. All errors ** are considered fatal except for SQLITE_BUSY and SQLITE_LOCKED. */ @@ -220,8 +220,8 @@ static int isFatalError(int rc){ } /* -** Parameter zSrcData points to a buffer containing the data for -** page iSrcPg from the source database. Copy this data into the +** Parameter zSrcData points to a buffer containing the data for +** page iSrcPg from the source database. Copy this data into the ** destination database. */ static int backupOnePage( @@ -252,7 +252,7 @@ static int backupOnePage( assert( zSrcData ); /* Catch the case where the destination is an in-memory database and the - ** page sizes of the source and destination differ. + ** page sizes of the source and destination differ. */ if( nSrcPgsz!=nDestPgsz && sqlite3PagerIsMemdb(pDestPager) ){ rc = SQLITE_READONLY; @@ -278,7 +278,7 @@ static int backupOnePage( } #endif - /* This loop runs once for each destination page spanned by the source + /* This loop runs once for each destination page spanned by the source ** page. For each iteration, variable iOff is set to the byte offset ** of the destination page. */ @@ -297,7 +297,7 @@ static int backupOnePage( ** Then clear the Btree layer MemPage.isInit flag. Both this module ** and the pager code use this trick (clearing the first byte ** of the page 'extra' space to invalidate the Btree layers - ** cached parse of the page). MemPage.isInit is marked + ** cached parse of the page). MemPage.isInit is marked ** "MUST BE FIRST" for this purpose. */ memcpy(zOut, zIn, nCopy); @@ -317,7 +317,7 @@ static int backupOnePage( ** exactly iSize bytes. If pFile is not larger than iSize bytes, then ** this function is a no-op. ** -** Return SQLITE_OK if everything is successful, or an SQLite error +** Return SQLITE_OK if everything is successful, or an SQLite error ** code if an error occurs. */ static int backupTruncateFile(sqlite3_file *pFile, i64 iSize){ @@ -398,7 +398,7 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){ /* Lock the destination database, if it is not locked already. */ if( SQLITE_OK==rc && p->bDestLocked==0 - && SQLITE_OK==(rc = sqlite3BtreeBeginTrans(p->pDest, 2)) + && SQLITE_OK==(rc = sqlite3BtreeBeginTrans(p->pDest, 2)) ){ p->bDestLocked = 1; sqlite3BtreeGetMeta(p->pDest, BTREE_SCHEMA_VERSION, &p->iDestSchema); @@ -412,7 +412,7 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){ if( SQLITE_OK==rc && destMode==PAGER_JOURNALMODE_WAL && pgszSrc!=pgszDest ){ rc = SQLITE_READONLY; } - + /* Now that there is a read-lock on the source database, query the ** source pager for the number of pages in the database. */ @@ -439,7 +439,7 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){ attachBackupObject(p); } } - + /* Update the schema version field in the destination database. This ** is to make sure that the schema-version really does change in ** the case where the source and destination databases have the @@ -465,12 +465,12 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){ int nDestTruncate; /* Set nDestTruncate to the final number of pages in the destination ** database. The complication here is that the destination page - ** size may be different to the source page size. + ** size may be different to the source page size. ** - ** If the source page size is smaller than the destination page size, + ** If the source page size is smaller than the destination page size, ** round up. In this case the call to sqlite3OsTruncate() below will ** fix the size of the file. However it is important to call - ** sqlite3PagerTruncateImage() here so that any pages in the + ** sqlite3PagerTruncateImage() here so that any pages in the ** destination file that lie beyond the nDestTruncate page mark are ** journalled by PagerCommitPhaseOne() before they are destroyed ** by the file truncation. @@ -494,7 +494,7 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){ ** ** * The destination may need to be truncated, and ** - ** * Data stored on the pages immediately following the + ** * Data stored on the pages immediately following the ** pending-byte page in the source database may need to be ** copied into the destination database. */ @@ -506,7 +506,7 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){ i64 iEnd; assert( pFile ); - assert( nDestTruncate==0 + assert( nDestTruncate==0 || (i64)nDestTruncate*(i64)pgszDest >= iSize || ( nDestTruncate==(int)(PENDING_BYTE_PAGE(p->pDest->pBt)-1) && iSize>=PENDING_BYTE && iSize<=PENDING_BYTE+pgszDest @@ -516,7 +516,7 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){ ** database has been stored in the journal for pDestPager and the ** journal synced to disk. So at this point we may safely modify ** the database file in any way, knowing that if a power failure - ** occurs, the original database will be reconstructed from the + ** occurs, the original database will be reconstructed from the ** journal file. */ sqlite3PagerPagecount(pDestPager, &nDstPage); for(iPg=nDestTruncate; rc==SQLITE_OK && iPg<=(Pgno)nDstPage; iPg++){ @@ -536,8 +536,8 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){ /* Write the extra pages and truncate the database file as required */ iEnd = MIN(PENDING_BYTE + pgszDest, iSize); for( - iOff=PENDING_BYTE+pgszSrc; - rc==SQLITE_OK && iOffpDest, 0)) @@ -570,7 +570,7 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){ } } } - + /* If bCloseTrans is true, then this function opened a read transaction ** on the source database. Close the read transaction here. There is ** no need to check the return values of the btree methods here, as @@ -582,7 +582,7 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){ TESTONLY( rc2 |= ) sqlite3BtreeCommitPhaseTwo(p->pSrc, 0); assert( rc2==SQLITE_OK ); } - + if( rc==SQLITE_IOERR_NOMEM ){ rc = SQLITE_NOMEM_BKPT; } @@ -662,7 +662,7 @@ int sqlite3_backup_remaining(sqlite3_backup *p){ } /* -** Return the total number of pages in the source database as of the most +** Return the total number of pages in the source database as of the most ** recent call to sqlite3_backup_step(). */ int sqlite3_backup_pagecount(sqlite3_backup *p){ @@ -677,7 +677,7 @@ int sqlite3_backup_pagecount(sqlite3_backup *p){ /* ** This function is called after the contents of page iPage of the -** source database have been modified. If page iPage has already been +** source database have been modified. If page iPage has already been ** copied into the destination database, then the data written to the ** destination is now invalidated. The destination copy of iPage needs ** to be updated with the new data before the backup operation is @@ -720,7 +720,7 @@ void sqlite3BackupUpdate(sqlite3_backup *pBackup, Pgno iPage, const u8 *aData){ ** Restart the backup process. This is called when the pager layer ** detects that the database has been modified by an external database ** connection. In this case there is no way of knowing which of the -** pages that have been copied into the destination database are still +** pages that have been copied into the destination database are still ** valid and which are not, so the entire process needs to be restarted. ** ** It is assumed that the mutex associated with the BtShared object @@ -740,8 +740,8 @@ void sqlite3BackupRestart(sqlite3_backup *pBackup){ ** Copy the complete content of pBtFrom into pBtTo. A transaction ** must be active for both files. ** -** The size of file pTo may be reduced by this operation. If anything -** goes wrong, the transaction on pTo is rolled back. If successful, the +** The size of file pTo may be reduced by this operation. If anything +** goes wrong, the transaction on pTo is rolled back. If successful, the ** transaction is committed before returning. */ int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){ @@ -777,9 +777,9 @@ int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){ /* 0x7FFFFFFF is the hard limit for the number of pages in a database ** file. By passing this as the number of pages to copy to - ** sqlite3_backup_step(), we can guarantee that the copy finishes + ** sqlite3_backup_step(), we can guarantee that the copy finishes ** within a single call (unless an error occurs). The assert() statement - ** checks this assumption - (p->rc) should be set to either SQLITE_DONE + ** checks this assumption - (p->rc) should be set to either SQLITE_DONE ** or an error code. */ sqlite3_backup_step(&b, 0x7FFFFFFF); assert( b.rc!=SQLITE_OK ); diff --git a/third_party/sqlite/src/src/bitvec.c b/third_party/sqlite/src/src/bitvec.c index bd4a09429b284..222a22bf72003 100644 --- a/third_party/sqlite/src/src/bitvec.c +++ b/third_party/sqlite/src/src/bitvec.c @@ -17,8 +17,8 @@ ** property. Usually only a few pages are meet either condition. ** So the bitmap is usually sparse and has low cardinality. ** But sometimes (for example when during a DROP of a large table) most -** or all of the pages in a database can get journalled. In those cases, -** the bitmap becomes dense with high cardinality. The algorithm needs +** or all of the pages in a database can get journalled. In those cases, +** the bitmap becomes dense with high cardinality. The algorithm needs ** to handle both cases well. ** ** The size of the bitmap is fixed when the object is created. @@ -39,13 +39,13 @@ /* Size of the Bitvec structure in bytes. */ #define BITVEC_SZ 512 -/* Round the union size down to the nearest pointer boundary, since that's how +/* Round the union size down to the nearest pointer boundary, since that's how ** it will be aligned within the Bitvec struct. */ #define BITVEC_USIZE \ (((BITVEC_SZ-(3*sizeof(u32)))/sizeof(Bitvec*))*sizeof(Bitvec*)) -/* Type of the array "element" for the bitmap representation. -** Should be a power of 2, and ideally, evenly divide into BITVEC_USIZE. +/* Type of the array "element" for the bitmap representation. +** Should be a power of 2, and ideally, evenly divide into BITVEC_USIZE. ** Setting this to the "natural word" size of your CPU may improve ** performance. */ #define BITVEC_TELEM u8 @@ -58,12 +58,12 @@ /* Number of u32 values in hash table. */ #define BITVEC_NINT (BITVEC_USIZE/sizeof(u32)) -/* Maximum number of entries in hash table before +/* Maximum number of entries in hash table before ** sub-dividing and re-hashing. */ #define BITVEC_MXHASH (BITVEC_NINT/2) /* Hashing function for the aHash representation. -** Empirical testing showed that the *37 multiplier -** (an arbitrary prime)in the hash function provided +** Empirical testing showed that the *37 multiplier +** (an arbitrary prime)in the hash function provided ** no fewer collisions than the no-op *1. */ #define BITVEC_HASH(X) (((X)*1)%BITVEC_NINT) @@ -109,7 +109,7 @@ struct Bitvec { /* ** Create a new bitmap object able to handle bits between 0 and iSize, -** inclusive. Return a pointer to the new object. Return NULL if +** inclusive. Return a pointer to the new object. Return NULL if ** malloc fails. */ Bitvec *sqlite3BitvecCreate(u32 iSize){ @@ -365,7 +365,7 @@ int sqlite3BitvecBuiltinTest(int sz, int *aOp){ break; } case 3: - case 4: + case 4: default: { nx = 2; sqlite3_randomness(sizeof(i), &i); diff --git a/third_party/sqlite/src/src/btmutex.c b/third_party/sqlite/src/src/btmutex.c index ddffb67fa4ecf..b2c0e895e89be 100644 --- a/third_party/sqlite/src/src/btmutex.c +++ b/third_party/sqlite/src/src/btmutex.c @@ -289,10 +289,10 @@ void sqlite3BtreeEnterAll(sqlite3 *db){ #ifndef SQLITE_OMIT_INCRBLOB /* -** Enter a mutex on a Btree given a cursor owned by that Btree. +** Enter a mutex on a Btree given a cursor owned by that Btree. ** -** These entry points are used by incremental I/O only. Enter() is required -** any time OMIT_SHARED_CACHE is not defined, regardless of whether or not +** These entry points are used by incremental I/O only. Enter() is required +** any time OMIT_SHARED_CACHE is not defined, regardless of whether or not ** the build is threadsafe. Leave() is only required by threadsafe builds. */ void sqlite3BtreeEnterCursor(BtCursor *pCur){ diff --git a/third_party/sqlite/src/src/btree.c b/third_party/sqlite/src/src/btree.c index 3335ced417ca0..30e734a1ab1ce 100644 --- a/third_party/sqlite/src/src/btree.c +++ b/third_party/sqlite/src/src/btree.c @@ -51,7 +51,7 @@ int sqlite3BtreeTrace=1; /* True to enable tracing */ #define BTALLOC_LE 2 /* Allocate any page <= the parameter */ /* -** Macro IfNotOmitAV(x) returns (x) if SQLITE_OMIT_AUTOVACUUM is not +** Macro IfNotOmitAV(x) returns (x) if SQLITE_OMIT_AUTOVACUUM is not ** defined, or 0 if it is. For example: ** ** bIncrVacuum = IfNotOmitAV(pBtShared->incrVacuum); @@ -66,7 +66,7 @@ int sqlite3BtreeTrace=1; /* True to enable tracing */ /* ** A list of BtShared objects that are eligible for participation ** in shared cache. This variable has file scope during normal builds, -** but the test harness needs to access it so we make it global for +** but the test harness needs to access it so we make it global for ** test builds. ** ** Access to this variable is protected by SQLITE_MUTEX_STATIC_MASTER. @@ -101,7 +101,7 @@ int sqlite3_enable_shared_cache(int enable){ ** manipulate entries in the BtShared.pLock linked list used to store ** shared-cache table level locks. If the library is compiled with the ** shared-cache feature disabled, then there is only ever one user - ** of each BtShared structure and so this locking is not necessary. + ** of each BtShared structure and so this locking is not necessary. ** So define the lock related functions as no-ops. */ #define querySharedCacheTableLock(a,b,c) SQLITE_OK @@ -118,15 +118,15 @@ int sqlite3_enable_shared_cache(int enable){ /* **** This function is only used as part of an assert() statement. *** ** -** Check to see if pBtree holds the required locks to read or write to the +** Check to see if pBtree holds the required locks to read or write to the ** table with root page iRoot. Return 1 if it does and 0 if not. ** -** For example, when writing to a table with root-page iRoot via +** For example, when writing to a table with root-page iRoot via ** Btree connection pBtree: ** ** assert( hasSharedCacheTableLock(pBtree, iRoot, 0, WRITE_LOCK) ); ** -** When writing to an index that resides in a sharable database, the +** When writing to an index that resides in a sharable database, the ** caller should have first obtained a lock specifying the root page of ** the corresponding table. This makes things a bit more complicated, ** as this module treats each table as a separate structure. To determine @@ -148,7 +148,7 @@ static int hasSharedCacheTableLock( BtLock *pLock; /* If this database is not shareable, or if the client is reading - ** and has the read-uncommitted flag set, then no lock is required. + ** and has the read-uncommitted flag set, then no lock is required. ** Return true immediately. */ if( (pBtree->sharable==0) @@ -188,13 +188,13 @@ static int hasSharedCacheTableLock( iTab = iRoot; } - /* Search for the required lock. Either a write-lock on root-page iTab, a + /* Search for the required lock. Either a write-lock on root-page iTab, a ** write-lock on the schema table, or (if the client is reading) a ** read-lock on iTab will suffice. Return 1 if any of these are found. */ for(pLock=pBtree->pBt->pLock; pLock; pLock=pLock->pNext){ - if( pLock->pBtree==pBtree + if( pLock->pBtree==pBtree && (pLock->iTable==iTab || (pLock->eLock==WRITE_LOCK && pLock->iTable==1)) - && pLock->eLock>=eLockType + && pLock->eLock>=eLockType ){ return 1; } @@ -227,7 +227,7 @@ static int hasSharedCacheTableLock( static int hasReadConflicts(Btree *pBtree, Pgno iRoot){ BtCursor *p; for(p=pBtree->pBt->pCursor; p; p=p->pNext){ - if( p->pgnoRoot==iRoot + if( p->pgnoRoot==iRoot && p->pBtree!=pBtree && 0==(p->pBtree->db->flags & SQLITE_ReadUncommitted) ){ @@ -239,7 +239,7 @@ static int hasReadConflicts(Btree *pBtree, Pgno iRoot){ #endif /* #ifdef SQLITE_DEBUG */ /* -** Query to see if Btree handle p may obtain a lock of type eLock +** Query to see if Btree handle p may obtain a lock of type eLock ** (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return ** SQLITE_OK if the lock may be obtained (by calling ** setSharedCacheTableLock()), or SQLITE_LOCKED if not. @@ -252,14 +252,14 @@ static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){ assert( eLock==READ_LOCK || eLock==WRITE_LOCK ); assert( p->db!=0 ); assert( !(p->db->flags&SQLITE_ReadUncommitted)||eLock==WRITE_LOCK||iTab==1 ); - + /* If requesting a write-lock, then the Btree must have an open write - ** transaction on this file. And, obviously, for this to be so there + ** transaction on this file. And, obviously, for this to be so there ** must be an open write transaction on the file itself. */ assert( eLock==READ_LOCK || (p==pBt->pWriter && p->inTrans==TRANS_WRITE) ); assert( eLock==READ_LOCK || pBt->inTransaction==TRANS_WRITE ); - + /* This routine is a no-op if the shared-cache is not enabled */ if( !p->sharable ){ return SQLITE_OK; @@ -274,7 +274,7 @@ static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){ } for(pIter=pBt->pLock; pIter; pIter=pIter->pNext){ - /* The condition (pIter->eLock!=eLock) in the following if(...) + /* The condition (pIter->eLock!=eLock) in the following if(...) ** statement is a simplification of: ** ** (eLock==WRITE_LOCK || pIter->eLock==WRITE_LOCK) @@ -301,7 +301,7 @@ static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){ #ifndef SQLITE_OMIT_SHARED_CACHE /* ** Add a lock on the table with root-page iTable to the shared-btree used -** by Btree handle p. Parameter eLock must be either READ_LOCK or +** by Btree handle p. Parameter eLock must be either READ_LOCK or ** WRITE_LOCK. ** ** This function assumes the following: @@ -313,7 +313,7 @@ static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){ ** with the requested lock (i.e. querySharedCacheTableLock() has ** already been called and returned SQLITE_OK). ** -** SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM +** SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM ** is returned if a malloc attempt fails. */ static int setSharedCacheTableLock(Btree *p, Pgno iTable, u8 eLock){ @@ -327,11 +327,11 @@ static int setSharedCacheTableLock(Btree *p, Pgno iTable, u8 eLock){ /* A connection with the read-uncommitted flag set will never try to ** obtain a read-lock using this function. The only read-lock obtained - ** by a connection in read-uncommitted mode is on the sqlite_master + ** by a connection in read-uncommitted mode is on the sqlite_master ** table, and that lock is obtained in BtreeBeginTrans(). */ assert( 0==(p->db->flags&SQLITE_ReadUncommitted) || eLock==WRITE_LOCK ); - /* This function should only be called on a sharable b-tree after it + /* This function should only be called on a sharable b-tree after it ** has been determined that no other b-tree holds a conflicting lock. */ assert( p->sharable ); assert( SQLITE_OK==querySharedCacheTableLock(p, iTable, eLock) ); @@ -376,7 +376,7 @@ static int setSharedCacheTableLock(Btree *p, Pgno iTable, u8 eLock){ ** Release all the table locks (locks obtained via calls to ** the setSharedCacheTableLock() procedure) held by Btree object p. ** -** This function assumes that Btree p has an open read or write +** This function assumes that Btree p has an open read or write ** transaction. If it does not, then the BTS_PENDING flag ** may be incorrectly cleared. */ @@ -408,7 +408,7 @@ static void clearAllSharedCacheTableLocks(Btree *p){ pBt->pWriter = 0; pBt->btsFlags &= ~(BTS_EXCLUSIVE|BTS_PENDING); }else if( pBt->nTransaction==2 ){ - /* This function is called when Btree p is concluding its + /* This function is called when Btree p is concluding its ** transaction. If there currently exists a writer, and p is not ** that writer, then the number of locks held by connections other ** than the writer must be about to drop to zero. In this case @@ -452,7 +452,7 @@ static int cursorHoldsMutex(BtCursor *p){ } /* Verify that the cursor and the BtShared agree about what is the current -** database connetion. This is important in shared-cache mode. If the database +** database connetion. This is important in shared-cache mode. If the database ** connection pointers get out-of-sync, it is possible for routines like ** btreeInitPage() to reference an stale connection pointer that references a ** a connection that has already closed. This routine is used inside assert() @@ -522,8 +522,8 @@ static void invalidateIncrblobCursors( #endif /* SQLITE_OMIT_INCRBLOB */ /* -** Set bit pgno of the BtShared.pHasContent bitvec. This is called -** when a page that previously contained data becomes a free-list leaf +** Set bit pgno of the BtShared.pHasContent bitvec. This is called +** when a page that previously contained data becomes a free-list leaf ** page. ** ** The BtShared.pHasContent bitvec exists to work around an obscure @@ -549,7 +549,7 @@ static void invalidateIncrblobCursors( ** may be lost. In the event of a rollback, it may not be possible ** to restore the database to its original configuration. ** -** The solution is the BtShared.pHasContent bitvec. Whenever a page is +** The solution is the BtShared.pHasContent bitvec. Whenever a page is ** moved to become a free-list leaf page, the corresponding bit is ** set in the bitvec. Whenever a leaf page is extracted from the free-list, ** optimization 2 above is omitted if the corresponding bit is already @@ -608,13 +608,13 @@ static void btreeReleaseAllCursorPages(BtCursor *pCur){ ** The cursor passed as the only argument must point to a valid entry ** when this function is called (i.e. have eState==CURSOR_VALID). This ** function saves the current cursor key in variables pCur->nKey and -** pCur->pKey. SQLITE_OK is returned if successful or an SQLite error +** pCur->pKey. SQLITE_OK is returned if successful or an SQLite error ** code otherwise. ** ** If the cursor is open on an intkey table, then the integer key ** (the rowid) is stored in pCur->nKey and pCur->pKey is left set to -** NULL. If the cursor is open on a non-intkey table, then pCur->pKey is -** set to point to a malloced buffer pCur->nKey bytes in size containing +** NULL. If the cursor is open on a non-intkey table, then pCur->pKey is +** set to point to a malloced buffer pCur->nKey bytes in size containing ** the key. */ static int saveCursorKey(BtCursor *pCur){ @@ -647,11 +647,11 @@ static int saveCursorKey(BtCursor *pCur){ } /* -** Save the current cursor position in the variables BtCursor.nKey +** Save the current cursor position in the variables BtCursor.nKey ** and BtCursor.pKey. The cursor's state is set to CURSOR_REQUIRESEEK. ** ** The caller must ensure that the cursor is valid (has eState==CURSOR_VALID) -** prior to calling this routine. +** prior to calling this routine. */ static int saveCursorPosition(BtCursor *pCur){ int rc; @@ -687,7 +687,7 @@ static int SQLITE_NOINLINE saveCursorsOnList(BtCursor*,Pgno,BtCursor*); ** routine is called just before cursor pExcept is used to modify the ** table, for example in BtreeDelete() or BtreeInsert(). ** -** If there are two or more cursors on the same btree, then all such +** If there are two or more cursors on the same btree, then all such ** cursors should have their BTCF_Multiple flag set. The btreeCursor() ** routine enforces that rule. This routine only needs to be called in ** the uncommon case when pExpect has the BTCF_Multiple flag set. @@ -786,9 +786,9 @@ moveto_done: /* ** Restore the cursor to the position it was in (or as close to as possible) -** when saveCursorPosition() was called. Note that this call deletes the +** when saveCursorPosition() was called. Note that this call deletes the ** saved position info stored by saveCursorPosition(), so there can be -** at most one effective restoreCursorPosition() call after each +** at most one effective restoreCursorPosition() call after each ** saveCursorPosition(). */ static int btreeRestoreCursorPosition(BtCursor *pCur){ @@ -837,7 +837,7 @@ int sqlite3BtreeCursorHasMoved(BtCursor *pCur){ /* ** This routine restores a cursor back to its original position after it ** has been moved by some outside activity (such as a btree rebalance or -** a row having been deleted out from under the cursor). +** a row having been deleted out from under the cursor). ** ** On success, the *pDifferentRow parameter is false if the cursor is left ** pointing at exactly the same row. *pDifferntRow is the row the cursor @@ -903,7 +903,7 @@ static Pgno ptrmapPageno(BtShared *pBt, Pgno pgno){ if( pgno<2 ) return 0; nPagesPerMapPage = (pBt->usableSize/5)+1; iPtrMap = (pgno-2)/nPagesPerMapPage; - ret = (iPtrMap*nPagesPerMapPage) + 2; + ret = (iPtrMap*nPagesPerMapPage) + 2; if( ret==PENDING_BYTE_PAGE(pBt) ){ ret++; } @@ -1242,7 +1242,7 @@ static u16 cellSizePtr(MemPage *pPage, u8 *pCell){ } pIter++; if( pPage->intKey ){ - /* pIter now points at the 64-bit integer key value, a variable length + /* pIter now points at the 64-bit integer key value, a variable length ** integer. The following block moves pIter to point at the first byte ** past the end of the key value. */ pEnd = &pIter[9]; @@ -1486,7 +1486,7 @@ static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){ int top; /* First byte of cell content area */ int rc = SQLITE_OK; /* Integer return code */ int gap; /* First byte of gap between cell pointers and cell content */ - + assert( sqlite3PagerIswriteable(pPage->pDbPage) ); assert( pPage->pBt ); assert( sqlite3_mutex_held(pPage->pBt->mutex) ); @@ -1594,7 +1594,7 @@ static int freeSpace(MemPage *pPage, u16 iStart, u16 iSize){ memset(&data[iStart], 0, iSize); } - /* The list of freeblocks must be in ascending order. Find the + /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = pPage->hdrOffset; @@ -1611,7 +1611,7 @@ static int freeSpace(MemPage *pPage, u16 iStart, u16 iSize){ } if( iFreeBlk>iLast ) return SQLITE_CORRUPT_BKPT; assert( iFreeBlk>iPtr || iFreeBlk==0 ); - + /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none ** iPtr: The address of a pointer to iFreeBlk @@ -1626,7 +1626,7 @@ static int freeSpace(MemPage *pPage, u16 iStart, u16 iSize){ iSize = iEnd - iStart; iFreeBlk = get2byte(&data[iFreeBlk]); } - + /* If iPtr is another freeblock (that is, if iPtr is not the freelist ** pointer in the page header) then check to see if iStart should be ** coalesced onto the end of iPtr. @@ -1725,7 +1725,7 @@ static int decodeFlags(MemPage *pPage, int flagByte){ ** Initialize the auxiliary information for a disk block. ** ** Return SQLITE_OK on success. If we see that the page does -** not contain a well-formed database page, then return +** not contain a well-formed database page, then return ** SQLITE_CORRUPT. Note that a return of SQLITE_OK does not ** guarantee that the page is well-formed. It only shows that ** we failed to detect any corruption. @@ -1785,10 +1785,10 @@ static int btreeInitPage(MemPage *pPage){ assert( pPage->nCell>0 || top==usableSize || CORRUPT_DB ); /* A malformed database page might cause us to read past the end - ** of page when parsing a cell. + ** of page when parsing a cell. ** ** The following block of code checks early to see if a cell extends - ** past the end of a page boundary and causes SQLITE_CORRUPT to be + ** past the end of a page boundary and causes SQLITE_CORRUPT to be ** returned if it does. */ iCellFirst = cellOffset + 2*pPage->nCell; @@ -1812,7 +1812,7 @@ static int btreeInitPage(MemPage *pPage){ } } if( !pPage->leaf ) iCellLast++; - } + } /* Compute the total free space on the page ** EVIDENCE-OF: R-23588-34450 The two-byte integer at offset 1 gives the @@ -1826,7 +1826,7 @@ static int btreeInitPage(MemPage *pPage){ /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return SQLITE_CORRUPT_BKPT; + return SQLITE_CORRUPT_BKPT; } while( 1 ){ if( pc>iCellLast ){ @@ -1854,7 +1854,7 @@ static int btreeInitPage(MemPage *pPage){ ** area, according to the page header, lies within the page. */ if( nFree>usableSize ){ - return SQLITE_CORRUPT_BKPT; + return SQLITE_CORRUPT_BKPT; } pPage->nFree = (u16)(nFree - iCellFirst); pPage->isInit = 1; @@ -1913,7 +1913,7 @@ static MemPage *btreePageFromDbPage(DbPage *pDbPage, Pgno pgno, BtShared *pBt){ pPage->hdrOffset = pgno==1 ? 100 : 0; } assert( pPage->aData==sqlite3PagerGetData(pDbPage) ); - return pPage; + return pPage; } /* @@ -2121,11 +2121,11 @@ static int btreeInvokeBusyHandler(void *pArg){ /* ** Open a database file. -** +** ** zFilename is the name of the database file. If zFilename is NULL ** then an ephemeral database is created. The ephemeral database might ** be exclusively in memory, or it might use a disk-based memory cache. -** Either way, the ephemeral database will be automatically deleted +** Either way, the ephemeral database will be automatically deleted ** when sqlite3BtreeClose() is called. ** ** If zFilename is ":memory:" then an in-memory database is created @@ -2158,7 +2158,7 @@ int sqlite3BtreeOpen( /* True if opening an ephemeral, temporary database */ const int isTempDb = zFilename==0 || zFilename[0]==0; - /* Set the variable isMemdb to true for an in-memory database, or + /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ #ifdef SQLITE_OMIT_MEMORYDB @@ -2277,7 +2277,7 @@ int sqlite3BtreeOpen( assert( sizeof(u32)==4 ); assert( sizeof(u16)==2 ); assert( sizeof(Pgno)==4 ); - + pBt = sqlite3MallocZero( sizeof(*pBt) ); if( pBt==0 ){ rc = SQLITE_NOMEM_BKPT; @@ -2296,7 +2296,7 @@ int sqlite3BtreeOpen( pBt->db = db; sqlite3PagerSetBusyhandler(pBt->pPager, btreeInvokeBusyHandler, pBt); p->pBt = pBt; - + pBt->pCursor = 0; pBt->pPage1 = 0; if( sqlite3PagerIsreadonly(pBt->pPager) ) pBt->btsFlags |= BTS_READ_ONLY; @@ -2338,7 +2338,7 @@ int sqlite3BtreeOpen( if( rc ) goto btree_open_out; pBt->usableSize = pBt->pageSize - nReserve; assert( (pBt->pageSize & 7)==0 ); /* 8-byte alignment of pageSize */ - + #if !defined(SQLITE_OMIT_SHARED_CACHE) && !defined(SQLITE_OMIT_DISKIO) /* Add the new BtShared object to the linked list sharable BtShareds. */ @@ -2467,7 +2467,7 @@ static int removeFromSharingList(BtShared *pBt){ } /* -** Make sure pBt->pTmpSpace points to an allocation of +** Make sure pBt->pTmpSpace points to an allocation of ** MX_CELL_SIZE(pBt) bytes with a 4-byte prefix for a left-child ** pointer. */ @@ -2482,7 +2482,7 @@ static void allocateTempSpace(BtShared *pBt){ ** can mean that fillInCell() only initializes the first 2 or 3 ** bytes of pTmpSpace, but that the first 4 bytes are copied from ** it into a database page. This is not actually a problem, but it - ** does cause a valgrind error when the 1 or 2 bytes of unitialized + ** does cause a valgrind error when the 1 or 2 bytes of unitialized ** data is passed to system call write(). So to avoid this error, ** zero the first 4 bytes of temp space here. ** @@ -2535,7 +2535,7 @@ int sqlite3BtreeClose(Btree *p){ sqlite3BtreeLeave(p); /* If there are still other outstanding references to the shared-btree - ** structure, return now. The remainder of this procedure cleans + ** structure, return now. The remainder of this procedure cleans ** up the shared-btree. */ assert( p->wantToLock==0 && p->locked==0 ); @@ -2641,7 +2641,7 @@ int sqlite3BtreeSetPagerFlags( /* ** Change the default pages size and the number of reserved bytes per page. -** Or, if the page size has already been fixed, return SQLITE_READONLY +** Or, if the page size has already been fixed, return SQLITE_READONLY ** without changing anything. ** ** The page size must be a power of 2 between 512 and 65536. If the page @@ -2702,7 +2702,7 @@ int sqlite3BtreeGetPageSize(Btree *p){ ** held. ** ** This is useful in one special case in the backup API code where it is -** known that the shared b-tree mutex is held, but the mutex on the +** known that the shared b-tree mutex is held, but the mutex on the ** database handle that owns *p is not. In this case if sqlite3BtreeEnter() ** were to be called, it might collide with some other operation on the ** database handle that owns *p, causing undefined behavior. @@ -2760,7 +2760,7 @@ int sqlite3BtreeSecureDelete(Btree *p, int newFlag){ if( newFlag>=0 ){ p->pBt->btsFlags &= ~BTS_SECURE_DELETE; if( newFlag ) p->pBt->btsFlags |= BTS_SECURE_DELETE; - } + } b = (p->pBt->btsFlags & BTS_SECURE_DELETE)!=0; sqlite3BtreeLeave(p); return b; @@ -2769,7 +2769,7 @@ int sqlite3BtreeSecureDelete(Btree *p, int newFlag){ /* ** Change the 'auto-vacuum' property of the database. If the 'autoVacuum' ** parameter is non-zero, then auto-vacuum mode is enabled. If zero, it -** is disabled. The default value for the auto-vacuum property is +** is disabled. The default value for the auto-vacuum property is ** determined by the SQLITE_DEFAULT_AUTOVACUUM macro. */ int sqlite3BtreeSetAutoVacuum(Btree *p, int autoVacuum){ @@ -2793,7 +2793,7 @@ int sqlite3BtreeSetAutoVacuum(Btree *p, int autoVacuum){ } /* -** Return the value of the 'auto-vacuum' property. If auto-vacuum is +** Return the value of the 'auto-vacuum' property. If auto-vacuum is ** enabled 1 is returned. Otherwise 0. */ int sqlite3BtreeGetAutoVacuum(Btree *p){ @@ -2860,7 +2860,7 @@ int sqlite3BtreeGetAutoVacuumSlackPages(Btree *p){ ** SQLITE_OK is returned on success. If the file is not a ** well-formed database file, then SQLITE_CORRUPT is returned. ** SQLITE_BUSY is returned if the database is locked. SQLITE_NOMEM -** is returned if we run out of memory. +** is returned if we run out of memory. */ static int lockBtree(BtShared *pBt){ int rc; /* Result code from subfunctions */ @@ -2877,7 +2877,7 @@ static int lockBtree(BtShared *pBt){ if( rc!=SQLITE_OK ) return rc; /* Do some checking to help insure the file we opened really is - ** a valid database file. + ** a valid database file. */ nPage = nPageHeader = get4byte(28+(u8*)pPage1->aData); sqlite3PagerPagecount(pBt->pPager, &nPageFile); @@ -2912,7 +2912,7 @@ static int lockBtree(BtShared *pBt){ } /* If the write version is set to 2, this database should be accessed - ** in WAL mode. If the log is not already open, open it now. Then + ** in WAL mode. If the log is not already open, open it now. Then ** return SQLITE_OK and return without populating BtShared.pPage1. ** The caller detects this and calls this function again. This is ** required as the version of page 1 currently in the page1 buffer @@ -2964,15 +2964,15 @@ static int lockBtree(BtShared *pBt){ /* EVIDENCE-OF: R-25008-21688 The size of a page is a power of two ** between 512 and 65536 inclusive. */ if( ((pageSize-1)&pageSize)!=0 - || pageSize>SQLITE_MAX_PAGE_SIZE - || pageSize<=256 + || pageSize>SQLITE_MAX_PAGE_SIZE + || pageSize<=256 ){ goto page1_init_failed; } assert( (pageSize & 7)==0 ); /* EVIDENCE-OF: R-59310-51205 The "reserved space" size in the 1-byte ** integer at offset 20 is the number of bytes of space at the end of - ** each page to reserve for extensions. + ** each page to reserve for extensions. ** ** EVIDENCE-OF: R-37497-42412 The size of the reserved region is ** determined by the one-byte unsigned integer found at an offset of 20 @@ -3062,7 +3062,7 @@ static int countValidCursors(BtShared *pBt, int wrOnly){ int r = 0; for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){ if( (wrOnly==0 || (pCur->curFlags & BTCF_WriteFlag)!=0) - && pCur->eState!=CURSOR_FAULT ) r++; + && pCur->eState!=CURSOR_FAULT ) r++; } return r; } @@ -3071,7 +3071,7 @@ static int countValidCursors(BtShared *pBt, int wrOnly){ /* ** If there are no outstanding cursors and we are not in the middle ** of a transaction but there is a read lock on the database, then -** this routine unrefs the first page of the database file which +** this routine unrefs the first page of the database file which ** has the effect of releasing the read lock. ** ** If there is a transaction in progress, this routine is a no-op. @@ -3155,8 +3155,8 @@ int sqlite3BtreeNewDb(Btree *p){ ** upgraded to exclusive by calling this routine a second time - the ** exclusivity flag only works for a new transaction. ** -** A write-transaction must be started before attempting any -** changes to the database. None of the following routines +** A write-transaction must be started before attempting any +** changes to the database. None of the following routines ** will work unless a transaction is started first: ** ** sqlite3BtreeCreateTable() @@ -3170,7 +3170,7 @@ int sqlite3BtreeNewDb(Btree *p){ ** If an initial attempt to acquire the lock fails because of lock contention ** and the database was previously unlocked, then invoke the busy handler ** if there is one. But if there was previously a read-lock, do not -** invoke the busy handler - just return SQLITE_BUSY. SQLITE_BUSY is +** invoke the busy handler - just return SQLITE_BUSY. SQLITE_BUSY is ** returned when there is already a read-lock in order to avoid a deadlock. ** ** Suppose there are two processes A and B. A has a read lock and B has @@ -3206,7 +3206,7 @@ int sqlite3BtreeBeginTrans(Btree *p, int wrflag){ #ifndef SQLITE_OMIT_SHARED_CACHE { sqlite3 *pBlock = 0; - /* If another database handle has already opened a write transaction + /* If another database handle has already opened a write transaction ** on this shared-btree structure and a second write transaction is ** requested, return SQLITE_LOCKED. */ @@ -3231,8 +3231,8 @@ int sqlite3BtreeBeginTrans(Btree *p, int wrflag){ } #endif - /* Any read-only or read-write transaction implies a read-lock on - ** page 1. So if some other shared-cache client already has a write-lock + /* Any read-only or read-write transaction implies a read-lock on + ** page 1. So if some other shared-cache client already has a write-lock ** on page 1, the transaction cannot be opened. */ rc = querySharedCacheTableLock(p, MASTER_ROOT, READ_LOCK); if( SQLITE_OK!=rc ) goto trans_begun; @@ -3243,7 +3243,7 @@ int sqlite3BtreeBeginTrans(Btree *p, int wrflag){ /* Call lockBtree() until either pBt->pPage1 is populated or ** lockBtree() returns something other than SQLITE_OK. lockBtree() ** may return SQLITE_OK but leave pBt->pPage1 set to 0 if after - ** reading page 1 it discovers that the page-size of the database + ** reading page 1 it discovers that the page-size of the database ** file is not pBt->pageSize. In this case lockBtree() will update ** pBt->pageSize to the page-size of the file on disk. */ @@ -3259,7 +3259,7 @@ int sqlite3BtreeBeginTrans(Btree *p, int wrflag){ } } } - + if( rc!=SQLITE_OK ){ unlockBtreeIfUnused(pBt); } @@ -3293,7 +3293,7 @@ int sqlite3BtreeBeginTrans(Btree *p, int wrflag){ /* If the db-size header field is incorrect (as it may be if an old ** client has been writing the database file), update it now. Doing - ** this sooner rather than later means the database size can safely + ** this sooner rather than later means the database size can safely ** re-read the database size from page 1 if a savepoint or transaction ** rollback occurs within the transaction. */ @@ -3364,7 +3364,7 @@ static int setChildPtrmaps(MemPage *pPage){ ** that it points to iTo. Parameter eType describes the type of pointer to ** be modified, as follows: ** -** PTRMAP_BTREE: pPage is a btree-page. The pointer points at a child +** PTRMAP_BTREE: pPage is a btree-page. The pointer points at a child ** page of pPage. ** ** PTRMAP_OVERFLOW1: pPage is a btree-page. The pointer points at an overflow @@ -3412,9 +3412,9 @@ static int modifyPagePointer(MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eType){ } } } - + if( i==nCell ){ - if( eType!=PTRMAP_BTREE || + if( eType!=PTRMAP_BTREE || get4byte(&pPage->aData[pPage->hdrOffset+8])!=iFrom ){ return SQLITE_CORRUPT_BKPT; } @@ -3426,11 +3426,11 @@ static int modifyPagePointer(MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eType){ /* -** Move the open database page pDbPage to location iFreePage in the +** Move the open database page pDbPage to location iFreePage in the ** database. The pDbPage reference remains valid. ** ** The isCommit flag indicates that there is no need to remember that -** the journal needs to be sync()ed before database page pDbPage->pgno +** the journal needs to be sync()ed before database page pDbPage->pgno ** can be written to. The caller has already promised not to write to that ** page. */ @@ -3447,13 +3447,13 @@ static int relocatePage( Pager *pPager = pBt->pPager; int rc; - assert( eType==PTRMAP_OVERFLOW2 || eType==PTRMAP_OVERFLOW1 || + assert( eType==PTRMAP_OVERFLOW2 || eType==PTRMAP_OVERFLOW1 || eType==PTRMAP_BTREE || eType==PTRMAP_ROOTPAGE ); assert( sqlite3_mutex_held(pBt->mutex) ); assert( pDbPage->pBt==pBt ); /* Move page iDbPage from its current location to page number iFreePage */ - TRACE(("AUTOVACUUM: Moving %d to free page %d (ptr page %d type %d)\n", + TRACE(("AUTOVACUUM: Moving %d to free page %d (ptr page %d type %d)\n", iDbPage, iFreePage, iPtrPage, eType)); rc = sqlite3PagerMovepage(pPager, pDbPage->pDbPage, iFreePage, isCommit); if( rc!=SQLITE_OK ){ @@ -3512,19 +3512,19 @@ static int allocateBtreePage(BtShared *, MemPage **, Pgno *, Pgno, u8); /* ** Perform a single step of an incremental-vacuum. If successful, return -** SQLITE_OK. If there is no work to do (and therefore no point in -** calling this function again), return SQLITE_DONE. Or, if an error +** SQLITE_OK. If there is no work to do (and therefore no point in +** calling this function again), return SQLITE_DONE. Or, if an error ** occurs, return some other error code. ** -** More specifically, this function attempts to re-organize the database so +** More specifically, this function attempts to re-organize the database so ** that the last page of the file currently in use is no longer in use. ** ** Parameter nFin is the number of pages that this database would contain ** were this function called until it returns SQLITE_DONE. ** -** If the bCommit parameter is non-zero, this function assumes that the -** caller will keep calling incrVacuumStep() until it returns SQLITE_DONE -** or an error. bCommit is passed true for an auto-vacuum-on-commit +** If the bCommit parameter is non-zero, this function assumes that the +** caller will keep calling incrVacuumStep() until it returns SQLITE_DONE +** or an error. bCommit is passed true for an auto-vacuum-on-commit ** operation, or false for an incremental vacuum. */ static int incrVacuumStep(BtShared *pBt, Pgno nFin, Pgno iLastPg, int bCommit){ @@ -3555,7 +3555,7 @@ static int incrVacuumStep(BtShared *pBt, Pgno nFin, Pgno iLastPg, int bCommit){ if( bCommit==0 ){ /* Remove the page from the files free-list. This is not required ** if bCommit is non-zero. In that case, the free-list will be - ** truncated to zero after this function returns, so it doesn't + ** truncated to zero after this function returns, so it doesn't ** matter if it still contains some garbage entries. */ Pgno iFreePg; @@ -3599,7 +3599,7 @@ static int incrVacuumStep(BtShared *pBt, Pgno nFin, Pgno iLastPg, int bCommit){ releasePage(pFreePg); }while( bCommit && iFreePg>nFin ); assert( iFreePginTrans = TRANS_READ; }else{ - /* If the handle had any kind of transaction open, decrement the - ** transaction count of the shared btree. If the transaction count + /* If the handle had any kind of transaction open, decrement the + ** transaction count of the shared btree. If the transaction count ** reaches 0, set the shared state to TRANS_NONE. The unlockBtreeIfUnused() ** call below will unlock the pager. */ if( p->inTrans!=TRANS_NONE ){ @@ -3838,7 +3838,7 @@ static void btreeEndTransaction(Btree *p){ } } - /* Set the current transaction state to TRANS_NONE and unlock the + /* Set the current transaction state to TRANS_NONE and unlock the ** pager if this call closed the only read or write transaction. */ p->inTrans = TRANS_NONE; unlockBtreeIfUnused(pBt); @@ -3859,12 +3859,12 @@ static void btreeEndTransaction(Btree *p){ ** the rollback journal (which causes the transaction to commit) and ** drop locks. ** -** Normally, if an error occurs while the pager layer is attempting to +** Normally, if an error occurs while the pager layer is attempting to ** finalize the underlying journal file, this function returns an error and ** the upper layer will attempt a rollback. However, if the second argument -** is non-zero then this b-tree transaction is part of a multi-file -** transaction. In this case, the transaction has already been committed -** (by deleting a master journal file) and the caller will ignore this +** is non-zero then this b-tree transaction is part of a multi-file +** transaction. In this case, the transaction has already been committed +** (by deleting a master journal file) and the caller will ignore this ** functions return code. So, even if an error occurs in the pager layer, ** reset the b-tree objects internal state to indicate that the write ** transaction has been closed. This is quite safe, as the pager will have @@ -3879,7 +3879,7 @@ int sqlite3BtreeCommitPhaseTwo(Btree *p, int bCleanup){ sqlite3BtreeEnter(p); btreeIntegrity(p); - /* If the handle has a write-transaction open, commit the shared-btrees + /* If the handle has a write-transaction open, commit the shared-btrees ** transaction and set the shared state to TRANS_READ. */ if( p->inTrans==TRANS_WRITE ){ @@ -3928,15 +3928,15 @@ int sqlite3BtreeCommit(Btree *p){ ** ** This routine gets called when a rollback occurs. If the writeOnly ** flag is true, then only write-cursors need be tripped - read-only -** cursors save their current positions so that they may continue -** following the rollback. Or, if writeOnly is false, all cursors are +** cursors save their current positions so that they may continue +** following the rollback. Or, if writeOnly is false, all cursors are ** tripped. In general, writeOnly is false if the transaction being ** rolled back modified the database schema. In this case b-tree root ** pages may be moved or deleted from the database altogether, making ** it unsafe for read cursors to continue. ** -** If the writeOnly flag is true and an error is encountered while -** saving the current position of a read-only cursor, all cursors, +** If the writeOnly flag is true and an error is encountered while +** saving the current position of a read-only cursor, all cursors, ** including all read-cursors are tripped. ** ** SQLITE_OK is returned if successful, or if an error occurs while @@ -4038,8 +4038,8 @@ int sqlite3BtreeRollback(Btree *p, int tripCode, int writeOnly){ /* ** Start a statement subtransaction. The subtransaction can be rolled -** back independently of the main transaction. You must start a transaction -** before starting a subtransaction. The subtransaction is ended automatically +** back independently of the main transaction. You must start a transaction +** before starting a subtransaction. The subtransaction is ended automatically ** if the main transaction commits or rolls back. ** ** Statement subtransactions are used around individual SQL statements @@ -4076,11 +4076,11 @@ int sqlite3BtreeBeginStmt(Btree *p, int iStatement){ /* ** The second argument to this function, op, is always SAVEPOINT_ROLLBACK ** or SAVEPOINT_RELEASE. This function either releases or rolls back the -** savepoint identified by parameter iSavepoint, depending on the value +** savepoint identified by parameter iSavepoint, depending on the value ** of op. ** ** Normally, iSavepoint is greater than or equal to zero. However, if op is -** SAVEPOINT_ROLLBACK, then iSavepoint may also be -1. In this case the +** SAVEPOINT_ROLLBACK, then iSavepoint may also be -1. In this case the ** contents of the entire transaction are rolled back. This is different ** from a normal transaction rollback, as no locks are released and the ** transaction remains open. @@ -4144,10 +4144,10 @@ int sqlite3BtreeSavepoint(Btree *p, int op, int iSavepoint){ ** is set. If FORDELETE is set, that is a hint to the implementation that ** this cursor will only be used to seek to and delete entries of an index ** as part of a larger DELETE statement. The FORDELETE hint is not used by -** this implementation. But in a hypothetical alternative storage engine +** this implementation. But in a hypothetical alternative storage engine ** in which index entries are automatically deleted when corresponding table ** rows are deleted, the FORDELETE flag is a hint that all SEEK and DELETE -** operations on this cursor can be no-ops and all READ operations can +** operations on this cursor can be no-ops and all READ operations can ** return a null row (2-bytes: 0x01 0x00). ** ** No checking is done to make sure that page iTable really is the @@ -4168,14 +4168,14 @@ static int btreeCursor( BtCursor *pX; /* Looping over other all cursors */ assert( sqlite3BtreeHoldsMutex(p) ); - assert( wrFlag==0 - || wrFlag==BTREE_WRCSR - || wrFlag==(BTREE_WRCSR|BTREE_FORDELETE) + assert( wrFlag==0 + || wrFlag==BTREE_WRCSR + || wrFlag==(BTREE_WRCSR|BTREE_FORDELETE) ); - /* The following assert statements verify that if this is a sharable - ** b-tree database, the connection is holding the required table locks, - ** and that no other connection has any open cursor that conflicts with + /* The following assert statements verify that if this is a sharable + ** b-tree database, the connection is holding the required table locks, + ** and that no other connection has any open cursor that conflicts with ** this lock. */ assert( hasSharedCacheTableLock(p, iTable, pKeyInfo!=0, (wrFlag?2:1)) ); assert( wrFlag==0 || !hasReadConflicts(p, iTable) ); @@ -4370,15 +4370,15 @@ u32 sqlite3BtreePayloadSize(BtCursor *pCur){ /* ** Given the page number of an overflow page in the database (parameter -** ovfl), this function finds the page number of the next page in the +** ovfl), this function finds the page number of the next page in the ** linked list of overflow pages. If possible, it uses the auto-vacuum -** pointer-map data instead of reading the content of page ovfl to do so. +** pointer-map data instead of reading the content of page ovfl to do so. ** ** If an error occurs an SQLite error code is returned. Otherwise: ** -** The page number of the next overflow page in the linked list is -** written to *pPgnoNext. If page ovfl is the last page in its linked -** list, *pPgnoNext is set to zero. +** The page number of the next overflow page in the linked list is +** written to *pPgnoNext. If page ovfl is the last page in its linked +** list, *pPgnoNext is set to zero. ** ** If ppPage is not NULL, and a reference to the MemPage object corresponding ** to page number pOvfl was obtained, then *ppPage is set to point to that @@ -4402,9 +4402,9 @@ static int getOverflowPage( #ifndef SQLITE_OMIT_AUTOVACUUM /* Try to find the next page in the overflow list using the - ** autovacuum pointer-map pages. Guess that the next page in - ** the overflow list is page number (ovfl+1). If that guess turns - ** out to be wrong, fall back to loading the data of page + ** autovacuum pointer-map pages. Guess that the next page in + ** the overflow list is page number (ovfl+1). If that guess turns + ** out to be wrong, fall back to loading the data of page ** number ovfl to determine the next page number. */ if( pBt->autoVacuum ){ @@ -4492,8 +4492,8 @@ static int copyPayload( ** ** If the current cursor entry uses one or more overflow pages ** this function may allocate space for and lazily populate -** the overflow page-list cache array (BtCursor.aOverflow). -** Subsequent calls use this cache to make seeking to the supplied offset +** the overflow page-list cache array (BtCursor.aOverflow). +** Subsequent calls use this cache to make seeking to the supplied offset ** more efficient. ** ** Once an overflow page-list cache has been allocated, it must be @@ -4509,7 +4509,7 @@ static int accessPayload( BtCursor *pCur, /* Cursor pointing to entry to read from */ u32 offset, /* Begin reading this far into payload */ u32 amt, /* Read this many bytes */ - unsigned char *pBuf, /* Write the bytes into this buffer */ + unsigned char *pBuf, /* Write the bytes into this buffer */ int eOp /* zero to read. non-zero to write. */ ){ unsigned char *aPayload; @@ -4634,12 +4634,12 @@ static int accessPayload( #ifdef SQLITE_DIRECT_OVERFLOW_READ /* If all the following are true: ** - ** 1) this is a read operation, and + ** 1) this is a read operation, and ** 2) data is required from the start of this overflow page, and ** 3) there is no open write-transaction, and ** 4) the database is file-backed, and ** 5) the page is not in the WAL file - ** 6) at least 4 bytes have already been read into the output buffer + ** 6) at least 4 bytes have already been read into the output buffer ** ** then data can be read directly from the database file into the ** output buffer, bypassing the page-cache altogether. This speeds @@ -4746,7 +4746,7 @@ int sqlite3BtreePayloadChecked(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){ #endif /* SQLITE_OMIT_INCRBLOB */ /* -** Return a pointer to payload information from the entry that the +** Return a pointer to payload information from the entry that the ** pCur cursor is pointing to. The pointer is to the beginning of ** the key if index btrees (pPage->intKey==0) and is the data for ** table btrees (pPage->intKey==1). The number of bytes of available @@ -4832,7 +4832,7 @@ static int moveToChild(BtCursor *pCur, u32 newPgno){ #if SQLITE_DEBUG /* -** Page pParent is an internal (non-leaf) tree page. This function +** Page pParent is an internal (non-leaf) tree page. This function ** asserts that page number iChild is the left-child if the iIdx'th ** cell in page pParent. Or, if iIdx is equal to the total number of ** cells in pParent, that page number iChild is the right-child of @@ -4849,7 +4849,7 @@ static void assertParentIndex(MemPage *pParent, int iIdx, Pgno iChild){ } } #else -# define assertParentIndex(x,y,z) +# define assertParentIndex(x,y,z) #endif /* @@ -4866,8 +4866,8 @@ static void moveToParent(BtCursor *pCur){ assert( pCur->iPage>0 ); assert( pCur->apPage[pCur->iPage] ); assertParentIndex( - pCur->apPage[pCur->iPage-1], - pCur->aiIdx[pCur->iPage-1], + pCur->apPage[pCur->iPage-1], + pCur->aiIdx[pCur->iPage-1], pCur->apPage[pCur->iPage]->pgno ); testcase( pCur->aiIdx[pCur->iPage-1] > pCur->apPage[pCur->iPage-1]->nCell ); @@ -4881,19 +4881,19 @@ static void moveToParent(BtCursor *pCur){ ** ** If the table has a virtual root page, then the cursor is moved to point ** to the virtual root page instead of the actual root page. A table has a -** virtual root page when the actual root page contains no cells and a +** virtual root page when the actual root page contains no cells and a ** single child page. This can only happen with the table rooted at page 1. ** -** If the b-tree structure is empty, the cursor state is set to +** If the b-tree structure is empty, the cursor state is set to ** CURSOR_INVALID. Otherwise, the cursor is set to point to the first ** cell located on the root (or virtual root) page and the cursor state ** is set to CURSOR_VALID. ** ** If this function returns successfully, it may be assumed that the -** page-header flags indicate that the [virtual] root-page is the expected +** page-header flags indicate that the [virtual] root-page is the expected ** kind of b-tree page (i.e. if when opening the cursor the caller did not ** specify a KeyInfo structure the flags byte is set to 0x05 or 0x0D, -** indicating a table b-tree, or if the caller did specify a KeyInfo +** indicating a table b-tree, or if the caller did specify a KeyInfo ** structure the flags byte is set to 0x02 or 0x0A, indicating an index ** b-tree). */ @@ -4941,19 +4941,19 @@ static int moveToRoot(BtCursor *pCur){ /* If pCur->pKeyInfo is not NULL, then the caller that opened this cursor ** expected to open it on an index b-tree. Otherwise, if pKeyInfo is ** NULL, the caller expects a table b-tree. If this is not the case, - ** return an SQLITE_CORRUPT error. + ** return an SQLITE_CORRUPT error. ** ** Earlier versions of SQLite assumed that this test could not fail ** if the root page was already loaded when this function was called (i.e. - ** if pCur->iPage>=0). But this is not so if the database is corrupted - ** in such a way that page pRoot is linked into a second b-tree table + ** if pCur->iPage>=0). But this is not so if the database is corrupted + ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ assert( pRoot->intKey==1 || pRoot->intKey==0 ); if( pRoot->isInit==0 || (pCur->pKeyInfo==0)!=pRoot->intKey ){ return SQLITE_CORRUPT_BKPT; } -skip_init: +skip_init: pCur->aiIdx[0] = 0; pCur->info.nSize = 0; pCur->curFlags &= ~(BTCF_AtLast|BTCF_ValidNKey|BTCF_ValidOvfl); @@ -5053,14 +5053,14 @@ int sqlite3BtreeFirst(BtCursor *pCur, int *pRes){ */ int sqlite3BtreeLast(BtCursor *pCur, int *pRes){ int rc; - + assert( cursorOwnsBtShared(pCur) ); assert( sqlite3_mutex_held(pCur->pBtree->db->mutex) ); /* If the cursor already points to the last entry, this is a no-op. */ if( CURSOR_VALID==pCur->eState && (pCur->curFlags & BTCF_AtLast)!=0 ){ #ifdef SQLITE_DEBUG - /* This block serves to assert() that the cursor really does point + /* This block serves to assert() that the cursor really does point ** to the last entry in the b-tree. */ int ii; for(ii=0; iiiPage; ii++){ @@ -5086,16 +5086,16 @@ int sqlite3BtreeLast(BtCursor *pCur, int *pRes){ }else{ pCur->curFlags &= ~BTCF_AtLast; } - + } } return rc; } -/* Move the cursor so that it points to an entry near the key +/* Move the cursor so that it points to an entry near the key ** specified by pIdxKey or intKey. Return a success code. ** -** For INTKEY tables, the intKey parameter is used. pIdxKey +** For INTKEY tables, the intKey parameter is used. pIdxKey ** must be NULL. For index tables, pIdxKey is used and intKey ** is ignored. ** @@ -5105,7 +5105,7 @@ int sqlite3BtreeLast(BtCursor *pCur, int *pRes){ ** before or after the key. ** ** An integer is written into *pRes which is the result of -** comparing the key with the entry to which the cursor is +** comparing the key with the entry to which the cursor is ** pointing. The meaning of the integer written into ** *pRes is as follows: ** @@ -5120,7 +5120,7 @@ int sqlite3BtreeLast(BtCursor *pCur, int *pRes){ ** is larger than intKey/pIdxKey. ** ** For index tables, the pIdxKey->eqSeen field is set to 1 if there -** exists an entry in the table that exactly matches pIdxKey. +** exists an entry in the table that exactly matches pIdxKey. */ int sqlite3BtreeMovetoUnpacked( BtCursor *pCur, /* The cursor to be moved */ @@ -5173,8 +5173,8 @@ int sqlite3BtreeMovetoUnpacked( if( pIdxKey ){ xRecordCompare = sqlite3VdbeFindCompare(pIdxKey); pIdxKey->errCode = 0; - assert( pIdxKey->default_rc==1 - || pIdxKey->default_rc==0 + assert( pIdxKey->default_rc==1 + || pIdxKey->default_rc==0 || pIdxKey->default_rc==-1 ); }else{ @@ -5255,9 +5255,9 @@ int sqlite3BtreeMovetoUnpacked( /* The maximum supported page-size is 65536 bytes. This means that ** the maximum number of record bytes stored on an index B-Tree ** page is less than 16384 bytes and may be stored as a 2-byte - ** varint. This information is used to attempt to avoid parsing - ** the entire cell by checking for the cases where the record is - ** stored entirely within the b-tree page by inspecting the first + ** varint. This information is used to attempt to avoid parsing + ** the entire cell by checking for the cases where the record is + ** stored entirely within the b-tree page by inspecting the first ** 2 bytes of the cell. */ nCell = pCell[0]; @@ -5267,10 +5267,10 @@ int sqlite3BtreeMovetoUnpacked( ** b-tree page. */ testcase( pCell+nCell+1==pPage->aDataEnd ); c = xRecordCompare(nCell, (void*)&pCell[1], pIdxKey); - }else if( !(pCell[1] & 0x80) + }else if( !(pCell[1] & 0x80) && (nCell = ((nCell&0x7f)<<7) + pCell[1])<=pPage->maxLocal ){ - /* The record-size field is a 2 byte varint and the record + /* The record-size field is a 2 byte varint and the record ** fits entirely on the main b-tree page. */ testcase( pCell+nCell+2==pPage->aDataEnd ); c = xRecordCompare(nCell, (void*)&pCell[2], pIdxKey); @@ -5278,10 +5278,10 @@ int sqlite3BtreeMovetoUnpacked( /* The record flows over onto one or more overflow pages. In ** this case the whole cell needs to be parsed, a buffer allocated ** and accessPayload() used to retrieve the record into the - ** buffer before VdbeRecordCompare() can be called. + ** buffer before VdbeRecordCompare() can be called. ** ** If the record is corrupt, the xRecordCompare routine may read - ** up to two varints past the end of the buffer. An extra 18 + ** up to two varints past the end of the buffer. An extra 18 ** bytes of padding is allocated at the end of the buffer in ** case this happens. */ void *pCellKey; @@ -5311,7 +5311,7 @@ int sqlite3BtreeMovetoUnpacked( c = xRecordCompare(nCell, pCellKey, pIdxKey); sqlite3_free(pCellKey); } - assert( + assert( (pIdxKey->errCode!=SQLITE_CORRUPT || c==0) && (pIdxKey->errCode!=SQLITE_NOMEM || pCur->pBtree->db->mallocFailed) ); @@ -5427,7 +5427,7 @@ static SQLITE_NOINLINE int btreeNext(BtCursor *pCur, int *pRes){ idx = ++pCur->aiIdx[pCur->iPage]; assert( pPage->isInit ); - /* If the database file is corrupt, it is possible for the value of idx + /* If the database file is corrupt, it is possible for the value of idx ** to be invalid here. This can only occur if a second cursor modifies ** the page while cursor pCur is holding a reference to it. Which can ** only happen if the database is corrupt in such a way as to link the @@ -5592,7 +5592,7 @@ int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){ ** SQLITE_OK is returned on success. Any other return value indicates ** an error. *ppPage is set to NULL in the event of an error. ** -** If the "nearby" parameter is not 0, then an effort is made to +** If the "nearby" parameter is not 0, then an effort is made to ** locate a page close to the page number "nearby". This can be used in an ** attempt to keep related pages close to each other in the database file, ** which in turn can make database access faster. @@ -5634,7 +5634,7 @@ static int allocateBtreePage( Pgno iTrunk; u8 searchList = 0; /* If the free-list must be searched for 'nearby' */ u32 nSearch = 0; /* Count of the number of search attempts */ - + /* If eMode==BTALLOC_EXACT and a query of the pointer-map ** shows that the page 'nearby' is somewhere on the free-list, then ** the entire-list will be searched for that page. @@ -5697,8 +5697,8 @@ static int allocateBtreePage( ** is the number of leaf page pointers to follow. */ k = get4byte(&pTrunk->aData[4]); if( k==0 && !searchList ){ - /* The trunk has no leaves and the list is not being searched. - ** So extract the trunk page itself and use it as the newly + /* The trunk has no leaves and the list is not being searched. + ** So extract the trunk page itself and use it as the newly ** allocated page */ assert( pPrevTrunk==0 ); rc = sqlite3PagerWrite(pTrunk->pDbPage); @@ -5715,8 +5715,8 @@ static int allocateBtreePage( rc = SQLITE_CORRUPT_BKPT; goto end_allocate_page; #ifndef SQLITE_OMIT_AUTOVACUUM - }else if( searchList - && (nearby==iTrunk || (iTrunkaData[0], &pTrunk->aData[0], 4); } }else{ - /* The trunk page is required by the caller but it contains + /* The trunk page is required by the caller but it contains ** pointers to free-list leaves. The first leaf becomes a trunk ** page in this case. */ MemPage *pNewTrunk; Pgno iNewTrunk = get4byte(&pTrunk->aData[8]); - if( iNewTrunk>mxPage ){ + if( iNewTrunk>mxPage ){ rc = SQLITE_CORRUPT_BKPT; goto end_allocate_page; } @@ -5815,8 +5815,8 @@ static int allocateBtreePage( goto end_allocate_page; } testcase( iPage==mxPage ); - if( !searchList - || (iPage==nearby || (iPagepPage1; /* Local reference to page 1 */ MemPage *pPage; /* Page being freed. May be NULL. */ int rc; /* Return Code */ @@ -6029,7 +6029,7 @@ static int freePage2(BtShared *pBt, MemPage *pMemPage, Pgno iPage){ /* If control flows to this point, then it was not possible to add the ** the page being freed as a leaf page of the first trunk in the free-list. - ** Possibly because the free-list is empty, or possibly because the + ** Possibly because the free-list is empty, or possibly because the ** first trunk in the free-list is full. Either way, the page being freed ** will become the new first trunk page in the free-list. */ @@ -6087,15 +6087,15 @@ static int clearCell( assert( pBt->usableSize > 4 ); ovflPageSize = pBt->usableSize - 4; nOvfl = (pInfo->nPayload - pInfo->nLocal + ovflPageSize - 1)/ovflPageSize; - assert( nOvfl>0 || + assert( nOvfl>0 || (CORRUPT_DB && (pInfo->nPayload + ovflPageSize)btreePagecount(pBt) ){ - /* 0 is not a legal page number and page 1 cannot be an - ** overflow page. Therefore if ovflPgno<2 or past the end of the + /* 0 is not a legal page number and page 1 cannot be an + ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ return SQLITE_CORRUPT_BKPT; } @@ -6107,11 +6107,11 @@ static int clearCell( if( ( pOvfl || ((pOvfl = btreePageLookup(pBt, ovflPgno))!=0) ) && sqlite3PagerPageRefcount(pOvfl->pDbPage)!=1 ){ - /* There is no reason any cursor should have an outstanding reference + /* There is no reason any cursor should have an outstanding reference ** to an overflow page belonging to a cell that is being deleted/updated. - ** So if there exists more than one reference to this page, then it - ** must not really be an overflow page and the database must be corrupt. - ** It is helpful to detect this before calling freePage2(), as + ** So if there exists more than one reference to this page, then it + ** must not really be an overflow page and the database must be corrupt. + ** It is helpful to detect this before calling freePage2(), as ** freePage2() may zero the page contents if secure-delete mode is ** enabled. If this 'overflow' page happens to be a page that the ** caller is iterating through or using in some other way, this @@ -6183,7 +6183,7 @@ static int fillInCell( pSrc = pX->pKey; nHeader += putVarint32(&pCell[nHeader], nPayload); } - + /* Fill in the payload */ if( nPayload<=pPage->maxLocal ){ n = nHeader + nPayload; @@ -6236,8 +6236,8 @@ static int fillInCell( if( pBt->autoVacuum ){ do{ pgnoOvfl++; - } while( - PTRMAP_ISPAGE(pBt, pgnoOvfl) || pgnoOvfl==PENDING_BYTE_PAGE(pBt) + } while( + PTRMAP_ISPAGE(pBt, pgnoOvfl) || pgnoOvfl==PENDING_BYTE_PAGE(pBt) ); } #endif @@ -6245,9 +6245,9 @@ static int fillInCell( #ifndef SQLITE_OMIT_AUTOVACUUM /* If the database supports auto-vacuum, and the second or subsequent ** overflow page is being allocated, add an entry to the pointer-map - ** for that page now. + ** for that page now. ** - ** If this is the first overflow page, then write a partial entry + ** If this is the first overflow page, then write a partial entry ** to the pointer-map. If we write nothing to this pointer-map slot, ** then the optimistic overflow chain processing in clearCell() ** may misinterpret the uninitialized values and delete the @@ -6369,8 +6369,8 @@ static void dropCell(MemPage *pPage, int idx, int sz, int *pRC){ ** will not fit, then make a copy of the cell content into pTemp if ** pTemp is not null. Regardless of pTemp, allocate a new entry ** in pPage->apOvfl[] and make it point to the cell content (either -** in pTemp or the original pCell) and also record its index. -** Allocating a new entry in pPage->aCell[] implies that +** in pTemp or the original pCell) and also record its index. +** Allocating a new entry in pPage->aCell[] implies that ** pPage->nOverflow is incremented. ** ** *pRC must be SQLITE_OK when this routine is called. @@ -6511,16 +6511,16 @@ static u16 cachedCellSize(CellArray *p, int N){ } /* -** Array apCell[] contains pointers to nCell b-tree page cells. The +** Array apCell[] contains pointers to nCell b-tree page cells. The ** szCell[] array contains the size in bytes of each cell. This function ** replaces the current contents of page pPg with the contents of the cell ** array. ** ** Some of the cells in apCell[] may currently be stored in pPg. This -** function works around problems caused by this by making a copy of any +** function works around problems caused by this by making a copy of any ** such cells before overwriting the page data. ** -** The MemPage.nFree field is invalidated by this function. It is the +** The MemPage.nFree field is invalidated by this function. It is the ** responsibility of the caller to set it correctly. */ static int rebuildPage( @@ -6569,8 +6569,8 @@ static int rebuildPage( /* ** Array apCell[] contains nCell pointers to b-tree cells. Array szCell -** contains the size in bytes of each such cell. This function attempts to -** add the cells stored in the array to page pPg. If it cannot (because +** contains the size in bytes of each such cell. This function attempts to +** add the cells stored in the array to page pPg. If it cannot (because ** the page needs to be defragmented before the cells will fit), non-zero ** is returned. Otherwise, if the cells are added successfully, zero is ** returned. @@ -6581,7 +6581,7 @@ static int rebuildPage( ** cell in the array. It is the responsibility of the caller to ensure ** that it is safe to overwrite this part of the cell-pointer array. ** -** When this function is called, *ppData points to the start of the +** When this function is called, *ppData points to the start of the ** content area on page pPg. If the size of the content area is extended, ** *ppData is updated to point to the new start of the content area ** before returning. @@ -6630,9 +6630,9 @@ static int pageInsertArray( } /* -** Array apCell[] contains nCell pointers to b-tree cells. Array szCell +** Array apCell[] contains nCell pointers to b-tree cells. Array szCell ** contains the size in bytes of each such cell. This function adds the -** space associated with each cell in the array that is currently stored +** space associated with each cell in the array that is currently stored ** within the body of pPg to the pPg free-list. The cell-pointers and other ** fields of the page are not updated. ** @@ -6842,7 +6842,7 @@ static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){ /* This error condition is now caught prior to reaching this function */ if( NEVER(pPage->nCell==0) ) return SQLITE_CORRUPT_BKPT; - /* Allocate a new page. This page will become the right-sibling of + /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell ** may be inserted. If both these operations are successful, proceed. */ @@ -6863,7 +6863,7 @@ static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){ pNew->nFree = pBt->usableSize - pNew->cellOffset - 2 - szCell; /* If this is an auto-vacuum database, update the pointer map - ** with entries for the new page, and any pointer from the + ** with entries for the new page, and any pointer from the ** cell on the page to an overflow page. If either of these ** operations fails, the return code is set, but the contents ** of the parent page are still manipulated by thh code below. @@ -6877,14 +6877,14 @@ static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){ ptrmapPutOvflPtr(pNew, pCell, &rc); } } - + /* Create a divider cell to insert into pParent. The divider cell ** consists of a 4-byte page number (the page number of pPage) and ** a variable length key value (which must be the same value as the ** largest key on pPage). ** - ** To find the largest key value on pPage, first find the right-most - ** cell on pPage. The first two fields of this cell are the + ** To find the largest key value on pPage, first find the right-most + ** cell on pPage. The first two fields of this cell are the ** record-length (a variable length integer at most 32-bits in size) ** and the key value (a variable length integer, may have any value). ** The first of the while(...) loops below skips over the record-length @@ -6905,7 +6905,7 @@ static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){ /* Set the right-child pointer of pParent to point to the new page. */ put4byte(&pParent->aData[pParent->hdrOffset+8], pgnoNew); - + /* Release the reference to the new page. */ releasePage(pNew); } @@ -6917,7 +6917,7 @@ static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){ #if 0 /* ** This function does not contribute anything to the operation of SQLite. -** it is sometimes activated temporarily while debugging code responsible +** it is sometimes activated temporarily while debugging code responsible ** for setting pointer-map entries. */ static int ptrmapCheckPages(MemPage **apPage, int nPage){ @@ -6932,7 +6932,7 @@ static int ptrmapCheckPages(MemPage **apPage, int nPage){ for(j=0; jnCell; j++){ CellInfo info; u8 *z; - + z = findCell(pPage, j); pPage->xParseCell(pPage, z, &info); if( info.nLocalpgno==1) ? 100 : 0); int rc; int iData; - - + + assert( pFrom->isInit ); assert( pFrom->nFree>=iToHdr ); assert( get2byte(&aFrom[iFromHdr+5]) <= (int)pBt->usableSize ); - + /* Copy the b-tree node content from page pFrom to page pTo. */ iData = get2byte(&aFrom[iFromHdr+5]); memcpy(&aTo[iData], &aFrom[iData], pBt->usableSize-iData); memcpy(&aTo[iToHdr], &aFrom[iFromHdr], pFrom->cellOffset + 2*pFrom->nCell); - + /* Reinitialize page pTo so that the contents of the MemPage structure ** match the new data. The initialization of pTo can actually fail under - ** fairly obscure circumstances, even though it is a copy of initialized + ** fairly obscure circumstances, even though it is a copy of initialized ** page pFrom. */ pTo->isInit = 0; @@ -7004,7 +7004,7 @@ static void copyNodeContent(MemPage *pFrom, MemPage *pTo, int *pRC){ *pRC = rc; return; } - + /* If this is an auto-vacuum database, update the pointer-map entries ** for any b-tree or overflow pages that pTo now contains the pointers to. */ @@ -7019,13 +7019,13 @@ static void copyNodeContent(MemPage *pFrom, MemPage *pTo, int *pRC){ ** (hereafter "the page") and up to 2 siblings so that all pages have about the ** same amount of free space. Usually a single sibling on either side of the ** page are used in the balancing, though both siblings might come from one -** side if the page is the first or last child of its parent. If the page +** side if the page is the first or last child of its parent. If the page ** has fewer than 2 siblings (something which can only happen if the page ** is a root page or a child of a root page) then all available siblings ** participate in the balancing. ** -** The number of siblings of the page might be increased or decreased by -** one or two in an effort to keep pages nearly full but not over full. +** The number of siblings of the page might be increased or decreased by +** one or two in an effort to keep pages nearly full but not over full. ** ** Note that when this routine is called, some of the cells on the page ** might not actually be stored in MemPage.aData[]. This can happen @@ -7036,7 +7036,7 @@ static void copyNodeContent(MemPage *pFrom, MemPage *pTo, int *pRC){ ** inserted into or removed from the parent page (pParent). Doing so ** may cause the parent page to become overfull or underfull. If this ** happens, it is the responsibility of the caller to invoke the correct -** balancing routine to fix this problem (see the balance() routine). +** balancing routine to fix this problem (see the balance() routine). ** ** If this routine fails for any reason, it might leave the database ** in a corrupted state. So if this routine fails, the database should @@ -7051,7 +7051,7 @@ static void copyNodeContent(MemPage *pFrom, MemPage *pTo, int *pRC){ ** of the page-size, the aOvflSpace[] buffer is guaranteed to be large ** enough for all overflow cells. ** -** If aOvflSpace is set to a null pointer, this function returns +** If aOvflSpace is set to a null pointer, this function returns ** SQLITE_NOMEM. */ static int balance_nonroot( @@ -7102,7 +7102,7 @@ static int balance_nonroot( #endif /* At this point pParent may have at most one overflow cell. And if - ** this overflow cell is present, it must be the cell with + ** this overflow cell is present, it must be the cell with ** index iParentIdx. This scenario comes about when this function ** is called (indirectly) from sqlite3BtreeDelete(). */ @@ -7113,11 +7113,11 @@ static int balance_nonroot( return SQLITE_NOMEM_BKPT; } - /* Find the sibling pages to balance. Also locate the cells in pParent - ** that divide the siblings. An attempt is made to find NN siblings on - ** either side of pPage. More siblings are taken from one side, however, + /* Find the sibling pages to balance. Also locate the cells in pParent + ** that divide the siblings. An attempt is made to find NN siblings on + ** either side of pPage. More siblings are taken from one side, however, ** if there are fewer than NN siblings on the other side. If pParent - ** has NB or fewer children then all children of pParent are taken. + ** has NB or fewer children then all children of pParent are taken. ** ** This loop also drops the divider cells from the parent page. This ** way, the remainder of the function does not have to deal with any @@ -7129,7 +7129,7 @@ static int balance_nonroot( nxDiv = 0; }else{ assert( bBulk==0 || bBulk==1 ); - if( iParentIdx==0 ){ + if( iParentIdx==0 ){ nxDiv = 0; }else if( iParentIdx==i ){ nxDiv = i-2+bBulk; @@ -7169,7 +7169,7 @@ static int balance_nonroot( ** This is safe because dropping a cell only overwrites the first ** four bytes of it, and this function does not need the first ** four bytes of the divider cell. So the pointer is safe to use - ** later on. + ** later on. ** ** But not if we are in secure-delete mode. In secure-delete mode, ** the dropCell() routine will overwrite the entire cell with zeroes. @@ -7208,7 +7208,7 @@ static int balance_nonroot( /* EVIDENCE-OF: R-28375-38319 SQLite will never request a scratch buffer ** that is more than 6 times the database page size. */ assert( szScratch<=6*(int)pBt->pageSize ); - b.apCell = sqlite3ScratchMalloc( szScratch ); + b.apCell = sqlite3ScratchMalloc( szScratch ); if( b.apCell==0 ){ rc = SQLITE_NOMEM_BKPT; goto balance_cleanup; @@ -7330,7 +7330,7 @@ static int balance_nonroot( ** Figure out the number of pages needed to hold all b.nCell cells. ** Store this number in "k". Also compute szNew[] which is the total ** size of all cells on the i-th page and cntNew[] which is the index - ** in b.apCell[] of the cell that divides page i from page i+1. + ** in b.apCell[] of the cell that divides page i from page i+1. ** cntNew[k] should equal b.nCell. ** ** Values computed by this block: @@ -7340,7 +7340,7 @@ static int balance_nonroot( ** cntNew[i]: Index in b.apCell[] and b.szCell[] for the first cell to ** the right of the i-th sibling page. ** usableSpace: Number of bytes of space available on each sibling. - ** + ** */ usableSpace = pBt->usableSize - 12 + leafCorrection; for(i=0; ipgno); /* If the sibling pages are not leaves, ensure that the right-child pointer - ** of the right-most new sibling page is set to the value that was + ** of the right-most new sibling page is set to the value that was ** originally in the same field of the right-most old sibling page. */ if( (pageFlags & PTF_LEAF)==0 && nOld!=nNew ){ MemPage *pOld = (nNew>nOld ? apNew : apOld)[nOld-1]; memcpy(&apNew[nNew-1]->aData[8], &pOld->aData[8], 4); } - /* Make any required updates to pointer map entries associated with + /* Make any required updates to pointer map entries associated with ** cells stored on sibling pages following the balance operation. Pointer ** map entries associated with divider cells are set by the insertCell() ** routine. The associated pointer map entries are: @@ -7562,9 +7562,9 @@ static int balance_nonroot( ** b) if the sibling pages are not leaves, the child page associated ** with the cell. ** - ** If the sibling pages are not leaves, then the pointer map entry - ** associated with the right-child of each sibling may also need to be - ** updated. This happens below, after the sibling pages have been + ** If the sibling pages are not leaves, then the pointer map entry + ** associated with the right-child of each sibling may also need to be + ** updated. This happens below, after the sibling pages have been ** populated, not here. */ if( ISAUTOVACUUM ){ @@ -7588,7 +7588,7 @@ static int balance_nonroot( } /* Cell pCell is destined for new sibling page pNew. Originally, it - ** was either part of sibling page iOld (possibly an overflow cell), + ** was either part of sibling page iOld (possibly an overflow cell), ** or else the divider cell to the left of sibling page iOld. So, ** if sibling page iOld had the same page number as pNew, and if ** pCell really was a part of sibling page iOld (not a divider or @@ -7624,9 +7624,9 @@ static int balance_nonroot( if( !pNew->leaf ){ memcpy(&pNew->aData[8], pCell, 4); }else if( leafData ){ - /* If the tree is a leaf-data tree, and the siblings are leaves, - ** then there is no divider cell in b.apCell[]. Instead, the divider - ** cell consists of the integer key for the right-most cell of + /* If the tree is a leaf-data tree, and the siblings are leaves, + ** then there is no divider cell in b.apCell[]. Instead, the divider + ** cell consists of the integer key for the right-most cell of ** the sibling-page assembled above only. */ CellInfo info; @@ -7639,9 +7639,9 @@ static int balance_nonroot( pCell -= 4; /* Obscure case for non-leaf-data trees: If the cell at pCell was ** previously stored on a leaf node, and its reported size was 4 - ** bytes, then it may actually be smaller than this + ** bytes, then it may actually be smaller than this ** (see btreeParseCellPtr(), 4 bytes is the minimum size of - ** any cell). But it is important to pass the correct size to + ** any cell). But it is important to pass the correct size to ** insertCell(), so reparse the cell now. ** ** This can only happen for b-trees used to evaluate "IN (SELECT ...)" @@ -7733,8 +7733,8 @@ static int balance_nonroot( ** b-tree structure by one. This is described as the "balance-shallower" ** sub-algorithm in some documentation. ** - ** If this is an auto-vacuum database, the call to copyNodeContent() - ** sets all pointer-map entries corresponding to database image pages + ** If this is an auto-vacuum database, the call to copyNodeContent() + ** sets all pointer-map entries corresponding to database image pages ** for which the pointer is stored within the content being copied. ** ** It is critical that the child page be defragmented before being @@ -7745,7 +7745,7 @@ static int balance_nonroot( assert( nNew==1 || CORRUPT_DB ); rc = defragmentPage(apNew[0]); testcase( rc!=SQLITE_OK ); - assert( apNew[0]->nFree == + assert( apNew[0]->nFree == (get2byte(&apNew[0]->aData[5])-apNew[0]->cellOffset-apNew[0]->nCell*2) || rc!=SQLITE_OK ); @@ -7774,7 +7774,7 @@ static int balance_nonroot( #if 0 if( ISAUTOVACUUM && rc==SQLITE_OK && apNew[0]->isInit ){ /* The ptrmapCheckPages() contains assert() statements that verify that - ** all pointer map pages are set correctly. This is helpful while + ** all pointer map pages are set correctly. This is helpful while ** debugging. This is usually disabled because a corrupt database may ** cause an assert() statement to fail. */ ptrmapCheckPages(apNew, nNew); @@ -7804,15 +7804,15 @@ balance_cleanup: ** ** A new child page is allocated and the contents of the current root ** page, including overflow cells, are copied into the child. The root -** page is then overwritten to make it an empty page with the right-child +** page is then overwritten to make it an empty page with the right-child ** pointer pointing to the new page. ** -** Before returning, all pointer-map entries corresponding to pages +** Before returning, all pointer-map entries corresponding to pages ** that the new child-page now contains pointers to are updated. The ** entry corresponding to the new right-child pointer of the root ** page is also updated. ** -** If successful, *ppChild is set to contain a reference to the child +** If successful, *ppChild is set to contain a reference to the child ** page and SQLITE_OK is returned. In this case the caller is required ** to call releasePage() on *ppChild exactly once. If an error occurs, ** an error code is returned and *ppChild is set to 0. @@ -7826,7 +7826,7 @@ static int balance_deeper(MemPage *pRoot, MemPage **ppChild){ assert( pRoot->nOverflow>0 ); assert( sqlite3_mutex_held(pBt->mutex) ); - /* Make pRoot, the root page of the b-tree, writable. Allocate a new + /* Make pRoot, the root page of the b-tree, writable. Allocate a new ** page that will become the new right-child of pPage. Copy the contents ** of the node stored on pRoot into the new child page. */ @@ -7867,7 +7867,7 @@ static int balance_deeper(MemPage *pRoot, MemPage **ppChild){ /* ** The page that pCur currently points to has just been modified in ** some way. This function figures out if this modification means the -** tree needs to be balanced, and if so calls the appropriate balancing +** tree needs to be balanced, and if so calls the appropriate balancing ** routine. Balancing routines are: ** ** balance_quick() @@ -7893,7 +7893,7 @@ static int balance(BtCursor *pCur){ ** balance_deeper() function to create a new child for the root-page ** and copy the current contents of the root-page to it. The ** next iteration of the do-loop will balance the child page. - */ + */ assert( balance_deeper_called==0 ); VVA_ONLY( balance_deeper_called++ ); rc = balance_deeper(pPage, &pCur->apPage[1]); @@ -7924,17 +7924,17 @@ static int balance(BtCursor *pCur){ /* Call balance_quick() to create a new sibling of pPage on which ** to store the overflow cell. balance_quick() inserts a new cell ** into pParent, which may cause pParent overflow. If this - ** happens, the next iteration of the do-loop will balance pParent + ** happens, the next iteration of the do-loop will balance pParent ** use either balance_nonroot() or balance_deeper(). Until this ** happens, the overflow cell is stored in the aBalanceQuickSpace[] - ** buffer. + ** buffer. ** ** The purpose of the following assert() is to check that only a ** single call to balance_quick() is made for each call to this ** function. If this were not verified, a subtle bug involving reuse ** of the aBalanceQuickSpace[] might sneak in. */ - assert( balance_quick_called==0 ); + assert( balance_quick_called==0 ); VVA_ONLY( balance_quick_called++ ); rc = balance_quick(pParent, pPage, aBalanceQuickSpace); }else @@ -7945,15 +7945,15 @@ static int balance(BtCursor *pCur){ ** modifying the contents of pParent, which may cause pParent to ** become overfull or underfull. The next iteration of the do-loop ** will balance the parent page to correct this. - ** + ** ** If the parent page becomes overfull, the overflow cell or cells - ** are stored in the pSpace buffer allocated immediately below. + ** are stored in the pSpace buffer allocated immediately below. ** A subsequent iteration of the do-loop will deal with this by ** calling balance_nonroot() (balance_deeper() may be called first, ** but it doesn't deal with overflow cells - just moves them to a - ** different page). Once this subsequent call to balance_nonroot() + ** different page). Once this subsequent call to balance_nonroot() ** has completed, it is safe to release the pSpace buffer used by - ** the previous call, as the overflow cell data will have been + ** the previous call, as the overflow cell data will have been ** copied either into the body of a database page or into the new ** pSpace buffer passed to the latter call to balance_nonroot(). */ @@ -7961,9 +7961,9 @@ static int balance(BtCursor *pCur){ rc = balance_nonroot(pParent, iIdx, pSpace, iPage==1, pCur->hints&BTREE_BULKLOAD); if( pFree ){ - /* If pFree is not NULL, it points to the pSpace buffer used + /* If pFree is not NULL, it points to the pSpace buffer used ** by a previous call to balance_nonroot(). Its contents are - ** now stored either on real database pages or within the + ** now stored either on real database pages or within the ** new pSpace buffer, so it may be safely freed here. */ sqlite3PageFree(pFree); } @@ -8003,7 +8003,7 @@ static int balance(BtCursor *pCur){ ** hold the content of the row. ** ** For an index btree (used for indexes and WITHOUT ROWID tables), the -** key is an arbitrary byte sequence stored in pX.pKey,nKey. The +** key is an arbitrary byte sequence stored in pX.pKey,nKey. The ** pX.pData,nData,nZero fields must be zero. ** ** If the seekResult parameter is non-zero, then a successful call to @@ -8061,8 +8061,8 @@ int sqlite3BtreeInsert( ** ** In some cases, the call to btreeMoveto() below is a no-op. For ** example, when inserting data into a table with auto-generated integer - ** keys, the VDBE layer invokes sqlite3BtreeLast() to figure out the - ** integer key to use. It then calls this function to actually insert the + ** keys, the VDBE layer invokes sqlite3BtreeLast() to figure out the + ** integer key to use. It then calls this function to actually insert the ** data into the intkey B-Tree. In this case btreeMoveto() recognizes ** that the cursor is already where it needs to be and returns without ** doing any work. To avoid thwarting these optimizations, it is important @@ -8075,13 +8075,13 @@ int sqlite3BtreeInsert( if( pCur->pKeyInfo==0 ){ assert( pX->pKey==0 ); - /* If this is an insert into a table b-tree, invalidate any incrblob + /* If this is an insert into a table b-tree, invalidate any incrblob ** cursors open on the row being replaced */ invalidateIncrblobCursors(p, pX->nKey, 0); - /* If BTREE_SAVEPOSITION is set, the cursor must already be pointing + /* If BTREE_SAVEPOSITION is set, the cursor must already be pointing ** to a row with the same key as the new entry being inserted. */ - assert( (flags & BTREE_SAVEPOSITION)==0 || + assert( (flags & BTREE_SAVEPOSITION)==0 || ((pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey) ); /* If the cursor is currently on the last row and we are appending a @@ -8165,7 +8165,7 @@ int sqlite3BtreeInsert( assert( pPage->nOverflow==0 || rc==SQLITE_OK ); assert( rc!=SQLITE_OK || pPage->nCell>0 || pPage->nOverflow>0 ); - /* If no error has occurred and pPage has an overflow cell, call balance() + /* If no error has occurred and pPage has an overflow cell, call balance() ** to redistribute the cells within the tree. Since balance() may move ** the cursor, zero the BtCursor.info.nSize and BTCF_ValidNKey ** variables. @@ -8192,7 +8192,7 @@ int sqlite3BtreeInsert( rc = balance(pCur); /* Must make sure nOverflow is reset to zero even if the balance() - ** fails. Internal data structure corruption will result otherwise. + ** fails. Internal data structure corruption will result otherwise. ** Also, set the cursor state to invalid. This stops saveCursorPosition() ** from trying to save the current position of the cursor. */ pCur->apPage[pCur->iPage]->nOverflow = 0; @@ -8219,7 +8219,7 @@ end_insert: } /* -** Delete the entry that the cursor is pointing to. +** Delete the entry that the cursor is pointing to. ** ** If the BTREE_SAVEPOSITION bit of the flags parameter is zero, then ** the cursor is left pointing at an arbitrary location after the delete. @@ -8237,12 +8237,12 @@ end_insert: */ int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){ Btree *p = pCur->pBtree; - BtShared *pBt = p->pBt; + BtShared *pBt = p->pBt; int rc; /* Return code */ MemPage *pPage; /* Page to delete cell from */ unsigned char *pCell; /* Pointer to cell to delete */ int iCellIdx; /* Index of cell to delete */ - int iCellDepth; /* Depth of node containing pCell */ + int iCellDepth; /* Depth of node containing pCell */ CellInfo info; /* Size of the cell being deleted */ int bSkipnext = 0; /* Leaf cursor in SKIPNEXT state */ u8 bPreserve = flags & BTREE_SAVEPOSITION; /* Keep cursor valid */ @@ -8265,14 +8265,14 @@ int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){ /* If the bPreserve flag is set to true, then the cursor position must ** be preserved following this delete operation. If the current delete ** will cause a b-tree rebalance, then this is done by saving the cursor - ** key and leaving the cursor in CURSOR_REQUIRESEEK state before - ** returning. + ** key and leaving the cursor in CURSOR_REQUIRESEEK state before + ** returning. ** ** Or, if the current delete will not cause a rebalance, then the cursor ** will be left in CURSOR_SKIPNEXT state pointing to the entry immediately ** before or after the deleted entry. In this case set bSkipnext to true. */ if( bPreserve ){ - if( !pPage->leaf + if( !pPage->leaf || (pPage->nFree+cellSizePtr(pPage,pCell)+2)>(int)(pBt->usableSize*2/3) ){ /* A b-tree rebalance will be required after deleting this entry. @@ -8357,7 +8357,7 @@ int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){ ** on the leaf node first. If the balance proceeds far enough up the ** tree that we can be sure that any problem in the internal node has ** been corrected, so be it. Otherwise, after balancing the leaf node, - ** walk the cursor up the tree to the internal node and balance it as + ** walk the cursor up the tree to the internal node and balance it as ** well. */ rc = balance(pCur); if( rc==SQLITE_OK && pCur->iPage>iCellDepth ){ @@ -8506,7 +8506,7 @@ static int btreeCreateTable(Btree *p, int *piTable, int createTabFlags){ } }else{ pRoot = pPageMove; - } + } /* Update the pointer-map and meta-data with the new root-page number. */ ptrmapPut(pBt, pgnoRoot, PTRMAP_ROOTPAGE, 0, &rc); @@ -8659,12 +8659,12 @@ int sqlite3BtreeClearTableOfCursor(BtCursor *pCur){ ** cursors on the table. ** ** If AUTOVACUUM is enabled and the page at iTable is not the last -** root page in the database file, then the last root page +** root page in the database file, then the last root page ** in the database file is moved into the slot formerly occupied by ** iTable and that last slot formerly occupied by the last root page ** is added to the freelist instead of iTable. In this say, all ** root pages are kept at the beginning of the database file, which -** is necessary for AUTOVACUUM to work right. *piMoved is set to the +** is necessary for AUTOVACUUM to work right. *piMoved is set to the ** page number that used to be the last root page in the file before ** the move. If no page gets moved, *piMoved is set to 0. ** The last root page is recorded in meta[3] and the value of @@ -8699,7 +8699,7 @@ static int btreeDropTable(Btree *p, Pgno iTable, int *piMoved){ if( iTable==maxRootPgno ){ /* If the table being dropped is the table with the largest root-page - ** number in the database, put the root page on the free list. + ** number in the database, put the root page on the free list. */ freePage(pPage, &rc); releasePage(pPage); @@ -8708,7 +8708,7 @@ static int btreeDropTable(Btree *p, Pgno iTable, int *piMoved){ } }else{ /* The table being dropped does not have the largest root-page - ** number in the database. So move the page that does into the + ** number in the database. So move the page that does into the ** gap left by the deleted root-page. */ MemPage *pMove; @@ -8750,7 +8750,7 @@ static int btreeDropTable(Btree *p, Pgno iTable, int *piMoved){ releasePage(pPage); } #endif - return rc; + return rc; } int sqlite3BtreeDropTable(Btree *p, int iTable, int *piMoved){ int rc; @@ -8769,7 +8769,7 @@ int sqlite3BtreeDropTable(Btree *p, int iTable, int *piMoved){ ** is the number of free pages currently in the database. Meta[1] ** through meta[15] are available for use by higher layers. Meta[0] ** is read-only, the others are read/write. -** +** ** The schema layer numbers meta values differently. At the schema ** layer (and the SetCookie and ReadCookie opcodes) the number of ** free pages is not visible. So Cookie[0] is the same as Meta[1]. @@ -8840,7 +8840,7 @@ int sqlite3BtreeUpdateMeta(Btree *p, int idx, u32 iMeta){ ** The first argument, pCur, is a cursor opened on some b-tree. Count the ** number of entries in the b-tree and write the result to *pnEntry. ** -** SQLITE_OK is returned if the operation is successfully executed. +** SQLITE_OK is returned if the operation is successfully executed. ** Otherwise, if an error is encountered (i.e. an IO error or database ** corruption) an SQLite error code is returned. */ @@ -8855,13 +8855,13 @@ int sqlite3BtreeCount(BtCursor *pCur, i64 *pnEntry){ rc = moveToRoot(pCur); /* Unless an error occurs, the following loop runs one iteration for each - ** page in the B-Tree structure (not including overflow pages). + ** page in the B-Tree structure (not including overflow pages). */ while( rc==SQLITE_OK ){ int iIdx; /* Index of child node in parent */ MemPage *pPage; /* Current page of the b-tree */ - /* If this is a leaf page or the tree is not an int-key tree, then + /* If this is a leaf page or the tree is not an int-key tree, then ** this page contains countable entries. Increment the entry counter ** accordingly. */ @@ -8870,7 +8870,7 @@ int sqlite3BtreeCount(BtCursor *pCur, i64 *pnEntry){ nEntry += pPage->nCell; } - /* pPage is a leaf node. This loop navigates the cursor so that it + /* pPage is a leaf node. This loop navigates the cursor so that it ** points to the first interior cell that it points to the parent of ** the next page in the tree that has not yet been visited. The ** pCur->aiIdx[pCur->iPage] value is set to the index of the parent cell @@ -8894,7 +8894,7 @@ int sqlite3BtreeCount(BtCursor *pCur, i64 *pnEntry){ pPage = pCur->apPage[pCur->iPage]; } - /* Descend to the child node of the cell that the cursor currently + /* Descend to the child node of the cell that the cursor currently ** points at. This is the right-child if (iIdx==pPage->nCell). */ iIdx = pCur->aiIdx[pCur->iPage]; @@ -8990,7 +8990,7 @@ static int checkRef(IntegrityCk *pCheck, Pgno iPage){ #ifndef SQLITE_OMIT_AUTOVACUUM /* -** Check that the entry in the pointer-map for page iChild maps to +** Check that the entry in the pointer-map for page iChild maps to ** page iParent, pointer type ptrType. If not, append an error message ** to pCheck. */ @@ -9013,7 +9013,7 @@ static void checkPtrmap( if( ePtrmapType!=eType || iPtrmapParent!=iParent ){ checkAppendMsg(pCheck, - "Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)", + "Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)", iChild, eType, iParent, ePtrmapType, iPtrmapParent); } } @@ -9111,7 +9111,7 @@ static void checkList( ** property. ** ** This heap is used for cell overlap and coverage testing. Each u32 -** entry represents the span of a cell or freeblock on a btree page. +** entry represents the span of a cell or freeblock on a btree page. ** The upper 16 bits are the index of the first byte of a range and the ** lower 16 bits are the index of the last byte of that range. */ @@ -9141,7 +9141,7 @@ static int btreeHeapPull(u32 *aHeap, u32 *pOut){ aHeap[j] = x; i = j; } - return 1; + return 1; } #ifndef SQLITE_OMIT_INTEGRITY_CHECK @@ -9149,7 +9149,7 @@ static int btreeHeapPull(u32 *aHeap, u32 *pOut){ ** Do various sanity checks on a single page of a tree. Return ** the tree depth. Root pages return 0. Parents of root pages ** return 1, and so forth. -** +** ** These checks are done: ** ** 1. Make sure that cells and freeblocks do not overlap @@ -9341,7 +9341,7 @@ static int checkTreePage( ** ** EVIDENCE-OF: R-20690-50594 The second field of the b-tree page header ** is the offset of the first freeblock, or zero if there are no - ** freeblocks on the page. + ** freeblocks on the page. */ i = get2byte(&data[hdr+1]); while( i>0 ){ @@ -9361,13 +9361,13 @@ static int checkTreePage( assert( (u32)j<=usableSize-4 ); /* Enforced by btreeInitPage() */ i = j; } - /* Analyze the min-heap looking for overlap between cells and/or + /* Analyze the min-heap looking for overlap between cells and/or ** freeblocks, and counting the number of untracked bytes in nFrag. - ** + ** ** Each min-heap entry is of the form: (start_address<<16)|end_address. ** There is an implied first entry the covers the page header, the cell ** pointer index, and the gap between the cell pointer index and the start - ** of cell content. + ** of cell content. ** ** The loop below pulls entries from the min-heap in order and compares ** the start_address against the previous end_address. If there is an @@ -9506,11 +9506,11 @@ char *sqlite3BtreeIntegrityCheck( /* If the database supports auto-vacuum, make sure no tables contain ** references to pointer-map pages. */ - if( getPageReferenced(&sCheck, i)==0 && + if( getPageReferenced(&sCheck, i)==0 && (PTRMAP_PAGENO(pBt, i)!=i || !pBt->autoVacuum) ){ checkAppendMsg(&sCheck, "Page %d is never used", i); } - if( getPageReferenced(&sCheck, i)!=0 && + if( getPageReferenced(&sCheck, i)!=0 && (PTRMAP_PAGENO(pBt, i)==i && pBt->autoVacuum) ){ checkAppendMsg(&sCheck, "Pointer map page %d is referenced", i); } @@ -9572,7 +9572,7 @@ int sqlite3BtreeIsInTrans(Btree *p){ /* ** Run a checkpoint on the Btree passed as the first argument. ** -** Return SQLITE_LOCKED if this or any other connection has an open +** Return SQLITE_LOCKED if this or any other connection has an open ** transaction on the shared-cache the argument Btree is connected to. ** ** Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART. @@ -9611,20 +9611,20 @@ int sqlite3BtreeIsInBackup(Btree *p){ /* ** This function returns a pointer to a blob of memory associated with ** a single shared-btree. The memory is used by client code for its own -** purposes (for example, to store a high-level schema associated with +** purposes (for example, to store a high-level schema associated with ** the shared-btree). The btree layer manages reference counting issues. ** ** The first time this is called on a shared-btree, nBytes bytes of memory -** are allocated, zeroed, and returned to the caller. For each subsequent +** are allocated, zeroed, and returned to the caller. For each subsequent ** call the nBytes parameter is ignored and a pointer to the same blob -** of memory returned. +** of memory returned. ** ** If the nBytes parameter is 0 and the blob of memory has not yet been ** allocated, a null pointer is returned. If the blob has already been ** allocated, it is returned as normal. ** -** Just before the shared-btree is closed, the function passed as the -** xFree argument when the memory allocation was made is invoked on the +** Just before the shared-btree is closed, the function passed as the +** xFree argument when the memory allocation was made is invoked on the ** blob of allocated memory. The xFree function should not call sqlite3_free() ** on the memory, the btree layer does that. */ @@ -9640,8 +9640,8 @@ void *sqlite3BtreeSchema(Btree *p, int nBytes, void(*xFree)(void *)){ } /* -** Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared -** btree as the argument handle holds an exclusive lock on the +** Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared +** btree as the argument handle holds an exclusive lock on the ** sqlite_master table. Otherwise SQLITE_OK. */ int sqlite3BtreeSchemaLocked(Btree *p){ @@ -9682,11 +9682,11 @@ int sqlite3BtreeLockTable(Btree *p, int iTab, u8 isWriteLock){ #ifndef SQLITE_OMIT_INCRBLOB /* -** Argument pCsr must be a cursor opened for writing on an -** INTKEY table currently pointing at a valid table entry. +** Argument pCsr must be a cursor opened for writing on an +** INTKEY table currently pointing at a valid table entry. ** This function modifies the data stored as part of that entry. ** -** Only the data content may only be modified, it is not possible to +** Only the data content may only be modified, it is not possible to ** change the length of the data stored. If this function is called with ** parameters that attempt to write past the end of the existing data, ** no modifications are made and SQLITE_CORRUPT is returned. @@ -9717,7 +9717,7 @@ int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, void *z){ VVA_ONLY(rc =) saveAllCursors(pCsr->pBt, pCsr->pgnoRoot, pCsr); assert( rc==SQLITE_OK ); - /* Check some assumptions: + /* Check some assumptions: ** (a) the cursor is open for writing, ** (b) there is a read/write transaction open, ** (c) the connection holds a write-lock on the table (if required), @@ -9736,7 +9736,7 @@ int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, void *z){ return accessPayload(pCsr, offset, amt, (unsigned char *)z, 1); } -/* +/* ** Mark this cursor as an incremental blob cursor. */ void sqlite3BtreeIncrblobCursor(BtCursor *pCur){ @@ -9746,14 +9746,14 @@ void sqlite3BtreeIncrblobCursor(BtCursor *pCur){ #endif /* -** Set both the "read version" (single byte at byte offset 18) and +** Set both the "read version" (single byte at byte offset 18) and ** "write version" (single byte at byte offset 19) fields in the database ** header to iVersion. */ int sqlite3BtreeSetVersion(Btree *pBtree, int iVersion){ BtShared *pBt = pBtree->pBt; int rc; /* Return code */ - + assert( iVersion==1 || iVersion==2 ); /* If setting the version fields to 1, do not automatically open the @@ -9811,7 +9811,7 @@ int sqlite3BtreeSharable(Btree *p){ /* ** Return the number of connections to the BtShared object accessed by -** the Btree handle passed as the only argument. For private caches +** the Btree handle passed as the only argument. For private caches ** this is always 1. For shared caches it may be 1 or greater. */ int sqlite3BtreeConnectionCount(Btree *p){ diff --git a/third_party/sqlite/src/src/btree.h b/third_party/sqlite/src/src/btree.h index e0da449575647..8d344d83c7bf6 100644 --- a/third_party/sqlite/src/src/btree.h +++ b/third_party/sqlite/src/src/btree.h @@ -128,7 +128,7 @@ int sqlite3BtreeNewDb(Btree *p); /* ** The second parameter to sqlite3BtreeGetMeta or sqlite3BtreeUpdateMeta -** should be one of the following values. The integer values are assigned +** should be one of the following values. The integer values are assigned ** to constants so that the offset of the corresponding field in an ** SQLite database header may be found using the following formula: ** @@ -199,7 +199,7 @@ int sqlite3BtreeNewDb(Btree *p); #define BTREE_BULKLOAD 0x00000001 /* Used to full index in sorted order */ #define BTREE_SEEK_EQ 0x00000002 /* EQ seeks only - no range seeks */ -/* +/* ** Flags passed as the third argument to sqlite3BtreeCursor(). ** ** For read-only cursors the wrFlag argument is always zero. For read-write @@ -264,13 +264,13 @@ int sqlite3BtreeDelete(BtCursor*, u8 flags); ** key and pData,nData,nZero set to zero. ** ** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. +** the key and passed in the nKey field. The pKey field is zero. ** pData,nData hold the content of the new entry. nZero extra zero bytes ** are appended to the end of the content when constructing the entry. ** ** This object is used to pass information into sqlite3BtreeInsert(). The ** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more +** the information into this object helps to keep the interface more ** organized and understandable, and it also helps the resulting code to ** run a little faster by using fewer registers for parameter passing. */ @@ -340,7 +340,7 @@ void sqlite3BtreeCursorList(Btree*); void sqlite3BtreeEnterCursor(BtCursor*); int sqlite3BtreeConnectionCount(Btree*); #else -# define sqlite3BtreeEnter(X) +# define sqlite3BtreeEnter(X) # define sqlite3BtreeEnterAll(X) # define sqlite3BtreeSharable(X) 0 # define sqlite3BtreeEnterCursor(X) diff --git a/third_party/sqlite/src/src/btreeInt.h b/third_party/sqlite/src/src/btreeInt.h index eb9d1b5ef58d4..dab1694f45a6e 100644 --- a/third_party/sqlite/src/src/btreeInt.h +++ b/third_party/sqlite/src/src/btreeInt.h @@ -29,16 +29,16 @@ ** on Ptr(N) and its subpages have values greater than Key(N-1). And ** so forth. ** -** Finding a particular key requires reading O(log(M)) pages from the +** Finding a particular key requires reading O(log(M)) pages from the ** disk where M is the number of entries in the tree. ** -** In this implementation, a single file can hold one or more separate +** In this implementation, a single file can hold one or more separate ** BTrees. Each BTree is identified by the index of its root page. The ** key and data for any entry are combined to form the "payload". A ** fixed amount of payload can be carried directly on the database ** page. If the payload is larger than the preset amount then surplus ** bytes are stored on overflow pages. The payload for an entry -** and the preceding pointer are combined to form a "Cell". Each +** and the preceding pointer are combined to form a "Cell". Each ** page has a small header which contains the Ptr(N) pointer and other ** information such as the size of key and data. ** @@ -168,7 +168,7 @@ ** contiguous or in order, but cell pointers are contiguous and in order. ** ** Cell content makes use of variable length integers. A variable -** length integer is 1 to 9 bytes where the lower 7 bits of each +** length integer is 1 to 9 bytes where the lower 7 bits of each ** byte are used. The integer consists of all bytes that have bit 8 set and ** the first byte with bit 8 clear. The most significant byte of the integer ** appears first. A variable-length integer may not be more than 9 bytes long. @@ -241,7 +241,7 @@ typedef struct CellInfo CellInfo; ** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The ** header must be exactly 16 bytes including the zero-terminator so ** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read +** the header, then your custom library will not be able to read ** databases generated by the standard tools and the standard tools ** will not be able to read databases created by your custom library. */ @@ -304,7 +304,7 @@ struct MemPage { /* ** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor +** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor ** is opened on the table with root page BtShared.iTable. Locks are removed ** from this list when a transaction is committed or rolled back, or when ** a btree handle is closed. @@ -328,7 +328,7 @@ struct BtLock { ** see the internals of this structure and only deals with pointers to ** this structure. ** -** For some database files, the same underlying database cache might be +** For some database files, the same underlying database cache might be ** shared between multiple connections. In that case, each connection ** has it own instance of this object. But each instance of this object ** points to the same BtShared object. The database cache and the @@ -336,7 +336,7 @@ struct BtLock { ** the BtShared object. ** ** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors +** The pBt pointer itself may not be changed while there exists cursors ** in the referenced BtShared that point back to this Btree since those ** cursors have to go through this Btree to find their BtShared and ** they often do so without holding sqlite3.mutex. @@ -371,7 +371,7 @@ struct Btree { /* ** An instance of this object represents a single database file. -** +** ** A single database file can be in use at the same time by two ** or more database connections. When two or more connections are ** sharing the same database file, each connection has it own @@ -490,7 +490,7 @@ struct CellInfo { ** particular database connection identified BtCursor.pBtree.db. ** ** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. +** found at self->pBt->mutex. ** ** skipNext meaning: ** eState==SKIPNEXT && skipNext>0: Next sqlite3BtreeNext() is no-op. @@ -538,7 +538,7 @@ struct BtCursor { ** Potential values for BtCursor.eState. ** ** CURSOR_INVALID: -** Cursor does not point to a valid entry. This can happen (for example) +** Cursor does not point to a valid entry. This can happen (for example) ** because the table is empty or because BtreeCursorFirst() has not been ** called. ** @@ -551,9 +551,9 @@ struct BtCursor { ** operation should be a no-op. ** ** CURSOR_REQUIRESEEK: -** The table that this cursor was opened on still exists, but has been +** The table that this cursor was opened on still exists, but has been ** modified since the cursor was last used. The cursor position is saved -** in variables BtCursor.pKey and BtCursor.nKey. When a cursor is in +** in variables BtCursor.pKey and BtCursor.nKey. When a cursor is in ** this state, restoreCursorPosition() can be called to attempt to ** seek the cursor to the saved position. ** @@ -570,13 +570,13 @@ struct BtCursor { #define CURSOR_REQUIRESEEK 3 #define CURSOR_FAULT 4 -/* +/* ** The database page the PENDING_BYTE occupies. This page is never used. */ # define PENDING_BYTE_PAGE(pBt) PAGER_MJ_PGNO(pBt) /* -** These macros define the location of the pointer-map entry for a +** These macros define the location of the pointer-map entry for a ** database page. The first argument to each is the number of usable ** bytes on each page of the database (often 1024). The second is the ** page number to look up in the pointer map. @@ -611,10 +611,10 @@ struct BtCursor { ** PTRMAP_ROOTPAGE: The database page is a root-page. The page-number is not ** used in this case. ** -** PTRMAP_FREEPAGE: The database page is an unused (free) page. The page-number +** PTRMAP_FREEPAGE: The database page is an unused (free) page. The page-number ** is not used in this case. ** -** PTRMAP_OVERFLOW1: The database page is the first page in a list of +** PTRMAP_OVERFLOW1: The database page is the first page in a list of ** overflow pages. The page number identifies the page that ** contains the cell with a pointer to this overflow page. ** @@ -636,13 +636,13 @@ struct BtCursor { */ #define btreeIntegrity(p) \ assert( p->pBt->inTransaction!=TRANS_NONE || p->pBt->nTransaction==0 ); \ - assert( p->pBt->inTransaction>=p->inTrans ); + assert( p->pBt->inTransaction>=p->inTrans ); /* ** The ISAUTOVACUUM macro is used within balance_nonroot() to determine ** if the database supports auto-vacuum or not. Because it is used -** within an expression that is an argument to another macro +** within an expression that is an argument to another macro ** (sqliteMallocRaw), it is not possible to use conditional compilation. ** So, this macro is defined instead. */ @@ -659,8 +659,8 @@ struct BtCursor { ** ** 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 +** 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; diff --git a/third_party/sqlite/src/src/build.c b/third_party/sqlite/src/src/build.c index cd9c81be82151..6b0cebca3f462 100644 --- a/third_party/sqlite/src/src/build.c +++ b/third_party/sqlite/src/src/build.c @@ -37,7 +37,7 @@ struct TableLock { }; /* -** Record the fact that we want to lock a table at run-time. +** Record the fact that we want to lock a table at run-time. ** ** The table to be locked has root page iTab and is found in database iDb. ** A read or a write lock can be taken depending on isWritelock. @@ -90,7 +90,7 @@ void sqlite3TableLock( */ static void codeTableLocks(Parse *pParse){ int i; - Vdbe *pVdbe; + Vdbe *pVdbe; pVdbe = sqlite3GetVdbe(pParse); assert( pVdbe!=0 ); /* sqlite3GetVdbe cannot fail: VDBE already allocated */ @@ -145,7 +145,7 @@ void sqlite3FinishCoding(Parse *pParse){ ** vdbe program */ v = sqlite3GetVdbe(pParse); - assert( !pParse->isMultiWrite + assert( !pParse->isMultiWrite || sqlite3VdbeAssertMayAbort(v, pParse->mayAbort)); if( v ){ sqlite3VdbeAddOp0(v, OP_Halt); @@ -167,7 +167,7 @@ void sqlite3FinishCoding(Parse *pParse){ ** transaction on each used database and to verify the schema cookie ** on each used database. */ - if( db->mallocFailed==0 + if( db->mallocFailed==0 && (DbMaskNonZero(pParse->cookieMask) || pParse->pConstExpr) ){ int iDb, i; @@ -197,8 +197,8 @@ void sqlite3FinishCoding(Parse *pParse){ pParse->nVtabLock = 0; #endif - /* Once all the cookies have been verified and transactions opened, - ** obtain the required table-locks. This is a no-op unless the + /* Once all the cookies have been verified and transactions opened, + ** obtain the required table-locks. This is a no-op unless the ** shared-cache feature is enabled. */ codeTableLocks(pParse); @@ -390,7 +390,7 @@ Table *sqlite3LocateTable( ** sqlite3FixSrcList() for details. */ Table *sqlite3LocateTableItem( - Parse *pParse, + Parse *pParse, u32 flags, struct SrcList_item *p ){ @@ -406,7 +406,7 @@ Table *sqlite3LocateTableItem( } /* -** Locate the in-memory structure that describes +** Locate the in-memory structure that describes ** a particular index given the name of that index ** and the name of the database that contains the index. ** Return NULL if not found. @@ -588,10 +588,10 @@ void sqlite3DeleteColumnNames(sqlite3 *db, Table *pTable){ ** ** This routine just deletes the data structure. It does not unlink ** the table data structure from the hash table. But it does destroy -** memory structures of the indices and foreign keys associated with +** memory structures of the indices and foreign keys associated with ** the table. ** -** The db parameter is optional. It is needed if the Table object +** The db parameter is optional. It is needed if the Table object ** contains lookaside memory. (Table objects in the schema do not use ** lookaside memory, but some ephemeral Table objects do.) Or the ** db parameter can be used with db->pnBytesFreed to measure the memory @@ -613,7 +613,7 @@ static void SQLITE_NOINLINE deleteTable(sqlite3 *db, Table *pTable){ assert( pIndex->pSchema==pTable->pSchema || (IsVirtual(pTable) && pIndex->idxType!=SQLITE_IDXTYPE_APPDEF) ); if( (db==0 || db->pnBytesFreed==0) && !IsVirtual(pTable) ){ - char *zName = pIndex->zName; + char *zName = pIndex->zName; TESTONLY ( Index *pOld = ) sqlite3HashInsert( &pIndex->pSchema->idxHash, zName, 0 ); @@ -728,7 +728,7 @@ int sqlite3FindDbName(sqlite3 *db, const char *zName){ /* ** The token *pName contains the name of a database (either "main" or ** "temp" or the name of an attached db). This routine returns the -** index of the named database in db->aDb[], or -1 if the named db +** index of the named database in db->aDb[], or -1 if the named db ** does not exist. */ int sqlite3FindDb(sqlite3 *db, Token *pName){ @@ -744,7 +744,7 @@ int sqlite3FindDb(sqlite3 *db, Token *pName){ ** pName1 and pName2. If the table name was fully qualified, for example: ** ** CREATE TABLE xxx.yyy (...); -** +** ** Then pName1 is set to "xxx" and pName2 "yyy". On the other hand if ** the table name is not fully qualified, i.e.: ** @@ -793,7 +793,7 @@ int sqlite3TwoPartName( ** is reserved for internal use. */ int sqlite3CheckObjectName(Parse *pParse, const char *zName){ - if( !pParse->db->init.busy && pParse->nested==0 + if( !pParse->db->init.busy && pParse->nested==0 && (pParse->db->flags & SQLITE_WriteSchema)==0 && 0==sqlite3StrNICmp(zName, "sqlite_", 7) ){ sqlite3ErrorMsg(pParse, "object name reserved for internal use: %s", zName); @@ -865,7 +865,7 @@ void sqlite3StartTable( iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName); if( iDb<0 ) return; if( !OMIT_TEMPDB && isTemp && pName2->n>0 && iDb!=1 ){ - /* If creating a temp table, the name may not be qualified. Unless + /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ sqlite3ErrorMsg(pParse, "temporary table name must be unqualified"); return; @@ -958,7 +958,7 @@ void sqlite3StartTable( ** the SQLITE_MASTER table. Note in particular that we must go ahead ** and allocate the record number for the table entry now. Before any ** PRIMARY KEY or UNIQUE keywords are parsed. Those keywords will cause - ** indices to be created and the table record must come before the + ** indices to be created and the table record must come before the ** indices. Hence, the record number for the table must be allocated ** now. */ @@ -976,7 +976,7 @@ void sqlite3StartTable( } #endif - /* If the file format and encoding in the database have not been set, + /* If the file format and encoding in the database have not been set, ** set them now. */ reg1 = pParse->regRowid = ++pParse->nMem; @@ -1086,7 +1086,7 @@ void sqlite3AddColumn(Parse *pParse, Token *pName, Token *pType){ memset(pCol, 0, sizeof(p->aCol[0])); pCol->zName = z; sqlite3ColumnPropertiesFromName(p, pCol); - + if( pType->n==0 ){ /* If there is no type specified, columns have the default affinity ** 'BLOB'. */ @@ -1121,11 +1121,11 @@ void sqlite3AddNotNull(Parse *pParse, int onError){ ** Scan the column type name zType (length nType) and return the ** associated affinity type. ** -** This routine does a case-independent search of zType for the +** This routine does a case-independent search of zType for the ** substrings in the following table. If one of the substrings is ** found, the corresponding affinity is returned. If zType contains -** more than one of the substrings, entries toward the top of -** the table take priority. For example, if zType is 'BLOBINT', +** more than one of the substrings, entries toward the top of +** the table take priority. For example, if zType is 'BLOBINT', ** SQLITE_AFF_INTEGER is returned. ** ** Substring | Affinity @@ -1246,7 +1246,7 @@ void sqlite3AddDefaultValue(Parse *pParse, ExprSpan *pSpan){ /* ** Backwards Compatibility Hack: -** +** ** Historical versions of SQLite accepted strings as column names in ** indexes and PRIMARY KEY constraints and in UNIQUE constraints. Example: ** @@ -1269,7 +1269,7 @@ static void sqlite3StringToId(Expr *p){ } /* -** Designate the PRIMARY KEY for the table. pList is a list of names +** Designate the PRIMARY KEY for the table. pList is a list of names ** of columns that form the primary key. If pList is NULL, then the ** most recently added column of the table is the primary key. ** @@ -1299,7 +1299,7 @@ void sqlite3AddPrimaryKey( int nTerm; if( pTab==0 ) goto primary_key_exit; if( pTab->tabFlags & TF_HasPrimaryKey ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "table \"%s\" has more than one primary key", pTab->zName); goto primary_key_exit; } @@ -1397,7 +1397,7 @@ void sqlite3AddCollateType(Parse *pParse, Token *pToken){ Index *pIdx; sqlite3DbFree(db, p->aCol[i].zColl); p->aCol[i].zColl = zColl; - + /* If the column is declared as " PRIMARY KEY COLLATE ", ** then an index may have been created on this column before the ** collation type was added. Correct this if it is the case. @@ -1471,7 +1471,7 @@ void sqlite3ChangeCookie(Parse *pParse, int iDb){ sqlite3 *db = pParse->db; Vdbe *v = pParse->pVdbe; assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); - sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_SCHEMA_VERSION, + sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_SCHEMA_VERSION, db->aDb[iDb].pSchema->schema_cookie+1); } @@ -1492,13 +1492,13 @@ static int identLength(const char *z){ } /* -** The first parameter is a pointer to an output buffer. The second +** The first parameter is a pointer to an output buffer. The second ** parameter is a pointer to an integer that contains the offset at ** which to write into the output buffer. This function copies the ** nul-terminated string pointed to by the third parameter, zSignedIdent, ** to the specified offset in the buffer and updates *pIdx to refer ** to the first byte after the last byte written before returning. -** +** ** If the string zSignedIdent consists entirely of alpha-numeric ** characters, does not begin with a digit and is not an SQL keyword, ** then it is copied to the output buffer exactly as it is. Otherwise, @@ -1542,7 +1542,7 @@ static char *createTableStmt(sqlite3 *db, Table *p){ n += identLength(pCol->zName) + 5; } n += identLength(p->zName); - if( n<50 ){ + if( n<50 ){ zSep = ""; zSep2 = ","; zEnd = ")"; @@ -1583,10 +1583,10 @@ static char *createTableStmt(sqlite3 *db, Table *p){ testcase( pCol->affinity==SQLITE_AFF_NUMERIC ); testcase( pCol->affinity==SQLITE_AFF_INTEGER ); testcase( pCol->affinity==SQLITE_AFF_REAL ); - + zType = azType[pCol->affinity - SQLITE_AFF_BLOB]; len = sqlite3Strlen30(zType); - assert( pCol->affinity==SQLITE_AFF_BLOB + assert( pCol->affinity==SQLITE_AFF_BLOB || pCol->affinity==sqlite3AffinityType(zType, 0) ); memcpy(&zStmt[k], zType, len); k += len; @@ -1714,13 +1714,13 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){ } /* Locate the PRIMARY KEY index. Or, if this table was originally - ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. + ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. */ if( pTab->iPKey>=0 ){ ExprList *pList; Token ipkToken; sqlite3TokenInit(&ipkToken, pTab->aCol[pTab->iPKey].zName); - pList = sqlite3ExprListAppend(pParse, 0, + pList = sqlite3ExprListAppend(pParse, 0, sqlite3ExprAlloc(db, TK_ID, &ipkToken, 0)); if( pList==0 ) return; pList->a[0].sortOrder = pParse->iPkSortOrder; @@ -1825,7 +1825,7 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){ ** the sqlite_master table. We do not want to create it again. ** ** If the pSelect argument is not NULL, it means that this routine -** was called to create a table generated from a +** was called to create a table generated from a ** "CREATE TABLE ... AS SELECT ..." statement. The column names of ** the new table will match the result set of the SELECT. */ @@ -1913,7 +1913,7 @@ void sqlite3EndTable( sqlite3VdbeAddOp1(v, OP_Close, 0); - /* + /* ** Initialize zType for the new view or table. */ if( p->pSelect==0 ){ @@ -1991,12 +1991,12 @@ void sqlite3EndTable( Token *pEnd2 = tabOpts ? &pParse->sLastToken : pEnd; n = (int)(pEnd2->z - pParse->sNameToken.z); if( pEnd2->z[0]!=';' ) n += pEnd2->n; - zStmt = sqlite3MPrintf(db, + zStmt = sqlite3MPrintf(db, "CREATE %s %.*s", zType2, n, pParse->sNameToken.z ); } - /* A slot for the record has already been allocated in the + /* A slot for the record has already been allocated in the ** SQLITE_MASTER table. We just need to update that slot with all ** the information we've collected. */ @@ -2178,7 +2178,7 @@ int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){ ** Actually, the error above is now caught prior to reaching this point. ** But the following test is still important as it does come up ** in the following: - ** + ** ** CREATE TABLE main.ex1(a); ** CREATE TEMP VIEW ex1 AS SELECT a FROM ex1; ** SELECT * FROM temp.ex1; @@ -2219,9 +2219,9 @@ int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){ ** normally holds CHECK constraints on an ordinary table, but for ** a VIEW it holds the list of column names. */ - sqlite3ColumnsFromExprList(pParse, pTable->pCheck, + sqlite3ColumnsFromExprList(pParse, pTable->pCheck, &pTable->nCol, &pTable->aCol); - if( db->mallocFailed==0 + if( db->mallocFailed==0 && pParse->nErr==0 && pTable->nCol==pSel->pEList->nExpr ){ @@ -2249,7 +2249,7 @@ int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){ } pTable->pSchema->schemaFlags |= DB_UnresetViews; #endif /* SQLITE_OMIT_VIEW */ - return nErr; + return nErr; } #endif /* !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE) */ @@ -2285,7 +2285,7 @@ static void sqliteViewResetAll(sqlite3 *db, int idx){ ** on tables and/or indices that are the process of being deleted. ** If you are unlucky, one of those deleted indices or tables might ** have the same rootpage number as the real table or index that is -** being moved. So we cannot stop searching after the first match +** being moved. So we cannot stop searching after the first match ** because the first match might be for one of the deleted indices ** or tables and not the table/index that is actually being moved. ** We must continue looping until all tables and indices with @@ -2322,7 +2322,7 @@ void sqlite3RootPageMoved(sqlite3 *db, int iDb, int iFrom, int iTo){ ** Also write code to modify the sqlite_master table and internal schema ** if a root-page of another table is moved by the btree-layer whilst ** erasing iTable (this can happen with an auto-vacuum database). -*/ +*/ static void destroyRootPage(Parse *pParse, int iTable, int iDb){ Vdbe *v = sqlite3GetVdbe(pParse); int r1 = sqlite3GetTempReg(pParse); @@ -2339,7 +2339,7 @@ static void destroyRootPage(Parse *pParse, int iTable, int iDb){ ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - sqlite3NestedParse(pParse, + sqlite3NestedParse(pParse, "UPDATE %Q.%s SET rootpage=%d WHERE #%d AND rootpage=#%d", pParse->db->aDb[iDb].zDbSName, MASTER_NAME, iTable, r1, r1); #endif @@ -2363,7 +2363,7 @@ static void destroyTable(Parse *pParse, Table *pTab){ #else /* If the database may be auto-vacuum capable (if SQLITE_OMIT_AUTOVACUUM ** is not defined), then it is important to call OP_Destroy on the - ** table and index root-pages in order, starting with the numerically + ** table and index root-pages in order, starting with the numerically ** largest root-page number. This guarantees that none of the root-pages ** to be destroyed is relocated by an earlier OP_Destroy. i.e. if the ** following were coded: @@ -2373,7 +2373,7 @@ static void destroyTable(Parse *pParse, Table *pTab){ ** OP_Destroy 5 0 ** ** and root page 5 happened to be the largest root-page number in the - ** database, then root page 5 would be moved to page 4 by the + ** database, then root page 5 would be moved to page 4 by the ** "OP_Destroy 4 0" opcode. The subsequent "OP_Destroy 5 0" would hit ** a free-list page. */ @@ -2455,7 +2455,7 @@ void sqlite3CodeDropTable(Parse *pParse, Table *pTab, int iDb, int isView){ */ pTrigger = sqlite3TriggerList(pParse, pTab); while( pTrigger ){ - assert( pTrigger->pSchema==pTab->pSchema || + assert( pTrigger->pSchema==pTab->pSchema || pTrigger->pSchema==db->aDb[1].pSchema ); sqlite3DropTriggerPtr(pParse, pTrigger); pTrigger = pTrigger->pNext; @@ -2482,7 +2482,7 @@ void sqlite3CodeDropTable(Parse *pParse, Table *pTab, int iDb, int isView){ ** created in the temp database that refers to a table in another ** database. */ - sqlite3NestedParse(pParse, + sqlite3NestedParse(pParse, "DELETE FROM %Q.%s WHERE tbl_name=%Q and type!='trigger'", pDb->zDbSName, MASTER_NAME, pTab->zName); if( !isView && !IsVirtual(pTab) ){ @@ -2569,7 +2569,7 @@ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, int noErr){ } } #endif - if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 + if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 && sqlite3StrNICmp(pTab->zName, "sqlite_stat", 11)!=0 ){ sqlite3ErrorMsg(pParse, "table %s may not be dropped", pTab->zName); goto exit_drop_table; @@ -2688,8 +2688,8 @@ void sqlite3CreateForeignKey( } } if( j>=p->nCol ){ - sqlite3ErrorMsg(pParse, - "unknown column \"%s\" in foreign key definition", + sqlite3ErrorMsg(pParse, + "unknown column \"%s\" in foreign key definition", pFromCol->a[i].zName); goto fk_end; } @@ -2709,7 +2709,7 @@ void sqlite3CreateForeignKey( pFKey->aAction[1] = (u8)((flags >> 8 ) & 0xff); /* ON UPDATE action */ assert( sqlite3SchemaMutexHeld(db, 0, p->pSchema) ); - pNextTo = (FKey *)sqlite3HashInsert(&p->pSchema->fkeyHash, + pNextTo = (FKey *)sqlite3HashInsert(&p->pSchema->fkeyHash, pFKey->zTo, (void *)pFKey ); if( pNextTo==pFKey ){ @@ -2814,7 +2814,7 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){ sqlite3VdbeAddOp2(v, OP_Next, iTab, addr1+1); VdbeCoverage(v); sqlite3VdbeJumpHere(v, addr1); if( memRootPage<0 ) sqlite3VdbeAddOp2(v, OP_Clear, tnum, iDb); - sqlite3VdbeAddOp4(v, OP_OpenWrite, iIdx, tnum, iDb, + sqlite3VdbeAddOp4(v, OP_OpenWrite, iIdx, tnum, iDb, (char *)pKey, P4_KEYINFO); sqlite3VdbeChangeP5(v, OPFLAG_BULKCSR|((memRootPage>=0)?OPFLAG_P2ISREG:0)); @@ -2878,8 +2878,8 @@ Index *sqlite3AllocateIndexObject( } /* -** Create a new index for an SQL table. pName1.pName2 is the name of the index -** and pTblList is the name of the table that is to be indexed. Both will +** Create a new index for an SQL table. pName1.pName2 is the name of the index +** and pTblList is the name of the table that is to be indexed. Both will ** be NULL for a primary key or an index that is created to satisfy a ** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable ** as the table to be indexed. pParse->pNewTable is a table that is @@ -2887,7 +2887,7 @@ Index *sqlite3AllocateIndexObject( ** ** pList is a list of columns to be indexed. pList will be NULL if this ** is a primary key or unique-constraint on the most recent column added -** to the table currently under construction. +** to the table currently under construction. */ void sqlite3CreateIndex( Parse *pParse, /* All information about this parse */ @@ -2934,7 +2934,7 @@ void sqlite3CreateIndex( */ if( pTblName!=0 ){ - /* Use the two-part index name to determine the database + /* Use the two-part index name to determine the database ** to search for the table. 'Fix' the table name to this db ** before looking up the table. */ @@ -2966,7 +2966,7 @@ void sqlite3CreateIndex( assert( db->mallocFailed==0 || pTab==0 ); if( pTab==0 ) goto exit_create_index; if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "cannot create a TEMP index on non-TEMP table \"%s\"", pTab->zName); goto exit_create_index; @@ -2983,7 +2983,7 @@ void sqlite3CreateIndex( assert( pTab!=0 ); assert( pParse->nErr==0 ); - if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 + if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 && db->init.busy==0 #if SQLITE_USER_AUTHENTICATION && sqlite3UserAuthTable(pTab->zName)==0 @@ -3007,7 +3007,7 @@ void sqlite3CreateIndex( /* ** Find the name of the index. Make sure there is not already another - ** index or table with the same name. + ** index or table with the same name. ** ** Exception: If we are reading the names of permanent indices from the ** sqlite_master table (because some other process changed the schema) and @@ -3100,8 +3100,8 @@ void sqlite3CreateIndex( } } - /* - ** Allocate the index structure. + /* + ** Allocate the index structure. */ nName = sqlite3Strlen30(zName); nExtraCol = pPk ? pPk->nKeyCol : 1; @@ -3212,7 +3212,7 @@ void sqlite3CreateIndex( int x = pPk->aiColumn[j]; assert( x>=0 ); if( hasColumn(pIndex->aiColumn, pIndex->nKeyCol, x) ){ - pIndex->nColumn--; + pIndex->nColumn--; }else{ pIndex->aiColumn[i] = x; pIndex->azColl[i] = pPk->azColl[j]; @@ -3230,7 +3230,7 @@ void sqlite3CreateIndex( /* If this index contains every column of its table, then mark ** it as a covering index */ - assert( HasRowid(pTab) + assert( HasRowid(pTab) || pTab->iPKey<0 || sqlite3ColumnOfIndex(pIndex, pTab->iPKey)>=0 ); if( pTblName!=0 && pIndex->nColumn>=pTab->nCol ){ pIndex->isCovering = 1; @@ -3285,13 +3285,13 @@ void sqlite3CreateIndex( if( pIdx->onError!=pIndex->onError ){ /* This constraint creates the same index as a previous ** constraint specified somewhere in the CREATE TABLE statement. - ** However the ON CONFLICT clauses are different. If both this + ** However the ON CONFLICT clauses are different. If both this ** constraint and the previous equivalent constraint have explicit ** ON CONFLICT clauses this is an error. Otherwise, use the ** explicitly specified behavior for the index. */ if( !(pIdx->onError==OE_Default || pIndex->onError==OE_Default) ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "conflicting ON CONFLICT clauses specified", 0); } if( pIdx->onError==OE_Default ){ @@ -3305,14 +3305,14 @@ void sqlite3CreateIndex( } /* Link the new Index structure to its table and to the other - ** in-memory database structures. + ** in-memory database structures. */ assert( pParse->nErr==0 ); if( db->init.busy ){ Index *p; assert( !IN_DECLARE_VTAB ); assert( sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) ); - p = sqlite3HashInsert(&pIndex->pSchema->idxHash, + p = sqlite3HashInsert(&pIndex->pSchema->idxHash, pIndex->zName, pIndex); if( p ){ assert( p==pIndex ); /* Malloc must have failed */ @@ -3349,9 +3349,9 @@ void sqlite3CreateIndex( sqlite3BeginWriteOperation(pParse, 1, iDb); /* Create the rootpage for the index using CreateIndex. But before - ** doing so, code a Noop instruction and store its address in - ** Index.tnum. This is required in case this index is actually a - ** PRIMARY KEY and the table is actually a WITHOUT ROWID table. In + ** doing so, code a Noop instruction and store its address in + ** Index.tnum. This is required in case this index is actually a + ** PRIMARY KEY and the table is actually a WITHOUT ROWID table. In ** that case the convertToWithoutRowidTable() routine will replace ** the Noop with a Goto to jump over the VDBE code generated below. */ pIndex->tnum = sqlite3VdbeAddOp0(v, OP_Noop); @@ -3374,7 +3374,7 @@ void sqlite3CreateIndex( /* Add an entry in sqlite_master for this index */ - sqlite3NestedParse(pParse, + sqlite3NestedParse(pParse, "INSERT INTO %Q.%s VALUES('index',%Q,%Q,#%d,%Q);", db->aDb[iDb].zDbSName, MASTER_NAME, pIndex->zName, @@ -3402,7 +3402,7 @@ void sqlite3CreateIndex( ** sure all indices labeled OE_Replace come after all those labeled ** OE_Ignore. This is necessary for the correct constraint check ** processing (in sqlite3GenerateConstraintChecks()) as part of - ** UPDATE and INSERT statements. + ** UPDATE and INSERT statements. */ if( db->init.busy || pTblName==0 ){ if( onError!=OE_Replace || pTab->pIndex==0 @@ -3454,7 +3454,7 @@ void sqlite3DefaultRowEst(Index *pIdx){ int nCopy = MIN(ArraySize(aVal), pIdx->nKeyCol); int i; - /* Set the first entry (number of rows in the index) to the estimated + /* Set the first entry (number of rows in the index) to the estimated ** number of rows in the table, or half the number of rows in the table ** for a partial index. But do not let the estimate drop below 10. */ a[0] = pIdx->pTable->nRowLogEst; @@ -3715,7 +3715,7 @@ SrcList *sqlite3SrcListEnlarge( ** database name prefix. Like this: "database.table". The pDatabase ** points to the table name and the pTable points to the database name. ** The SrcList.a[].zName field is filled with the table name which might -** come from pTable (if pDatabase is NULL) or from pDatabase. +** come from pTable (if pDatabase is NULL) or from pDatabase. ** SrcList.a[].zDatabase is filled with the database name from pTable, ** or with NULL if no database is specified. ** @@ -3841,7 +3841,7 @@ SrcList *sqlite3SrcListAppendFromTerm( struct SrcList_item *pItem; sqlite3 *db = pParse->db; if( !p && (pOn || pUsing) ){ - sqlite3ErrorMsg(pParse, "a JOIN clause is required before %s", + sqlite3ErrorMsg(pParse, "a JOIN clause is required before %s", (pOn ? "ON" : "USING") ); goto append_from_error; @@ -3869,7 +3869,7 @@ SrcList *sqlite3SrcListAppendFromTerm( } /* -** Add an INDEXED BY or NOT INDEXED clause to the most recently added +** Add an INDEXED BY or NOT INDEXED clause to the most recently added ** element of the source-list passed as the second argument. */ void sqlite3SrcListIndexedBy(Parse *pParse, SrcList *p, Token *pIndexedBy){ @@ -3880,7 +3880,7 @@ void sqlite3SrcListIndexedBy(Parse *pParse, SrcList *p, Token *pIndexedBy){ assert( pItem->fg.isIndexedBy==0 ); assert( pItem->fg.isTabFunc==0 ); if( pIndexedBy->n==1 && !pIndexedBy->z ){ - /* A "NOT INDEXED" clause was supplied. See parse.y + /* A "NOT INDEXED" clause was supplied. See parse.y ** construct "indexed_opt" for details. */ pItem->fg.notIndexed = 1; }else{ @@ -3993,7 +3993,7 @@ void sqlite3RollbackTransaction(Parse *pParse){ /* ** This function is called by the parser when it parses a command to create, -** release or rollback an SQL savepoint. +** release or rollback an SQL savepoint. */ void sqlite3Savepoint(Parse *pParse, int op, Token *pName){ char *zName = sqlite3NameFromToken(pParse->db, pName); @@ -4020,7 +4020,7 @@ int sqlite3OpenTempDatabase(Parse *pParse){ if( db->aDb[1].pBt==0 && !pParse->explain ){ int rc; Btree *pBt; - static const int flags = + static const int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | @@ -4066,7 +4066,7 @@ void sqlite3CodeVerifySchema(Parse *pParse, int iDb){ } /* -** If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each +** If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each ** attached database. Otherwise, invoke it for the database named zDb only. */ void sqlite3CodeVerifyNamedSchema(Parse *pParse, const char *zDb){ @@ -4112,9 +4112,9 @@ void sqlite3MultiWrite(Parse *pParse){ pToplevel->isMultiWrite = 1; } -/* +/* ** The code generator calls this routine if is discovers that it is -** possible to abort a statement prior to completion. In order to +** possible to abort a statement prior to completion. In order to ** perform this abort without corrupting the database, we need to make ** sure that the statement is protected by a statement transaction. ** @@ -4123,7 +4123,7 @@ void sqlite3MultiWrite(Parse *pParse){ ** such that the abort must occur after the multiwrite. This makes ** some statements involving the REPLACE conflict resolution algorithm ** go a little faster. But taking advantage of this time dependency -** makes it more difficult to prove that the code is correct (in +** makes it more difficult to prove that the code is correct (in ** particular, it prevents us from writing an effective ** implementation of sqlite3AssertMayAbort()) and so we have chosen ** to take the safe route and skip the optimization. @@ -4181,8 +4181,8 @@ void sqlite3UniqueConstraint( } } zErr = sqlite3StrAccumFinish(&errMsg); - sqlite3HaltConstraint(pParse, - IsPrimaryKeyIndex(pIdx) ? SQLITE_CONSTRAINT_PRIMARYKEY + sqlite3HaltConstraint(pParse, + IsPrimaryKeyIndex(pIdx) ? SQLITE_CONSTRAINT_PRIMARYKEY : SQLITE_CONSTRAINT_UNIQUE, onError, zErr, P4_DYNAMIC, P5_ConstraintUnique); } @@ -4194,7 +4194,7 @@ void sqlite3UniqueConstraint( void sqlite3RowidConstraint( Parse *pParse, /* Parsing context */ int onError, /* Conflict resolution algorithm */ - Table *pTab /* The table with the non-unique rowid */ + Table *pTab /* The table with the non-unique rowid */ ){ char *zMsg; int rc; @@ -4373,9 +4373,9 @@ KeyInfo *sqlite3KeyInfoOfIndex(Parse *pParse, Index *pIdx){ } #ifndef SQLITE_OMIT_CTE -/* -** This routine is invoked once per CTE by the parser while parsing a -** WITH clause. +/* +** This routine is invoked once per CTE by the parser while parsing a +** WITH clause. */ With *sqlite3WithAdd( Parse *pParse, /* Parsing context */ diff --git a/third_party/sqlite/src/src/callback.c b/third_party/sqlite/src/src/callback.c index 23511788674ef..2c6c7a122711f 100644 --- a/third_party/sqlite/src/src/callback.c +++ b/third_party/sqlite/src/src/callback.c @@ -1,5 +1,5 @@ /* -** 2005 May 23 +** 2005 May 23 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: @@ -69,8 +69,8 @@ static int synthCollSeq(sqlite3 *db, CollSeq *pColl){ ** This function is responsible for invoking the collation factory callback ** or substituting a collation sequence of a different encoding when the ** requested collation sequence is not available in the desired encoding. -** -** If it is not NULL, then pColl must point to the database native encoding +** +** If it is not NULL, then pColl must point to the database native encoding ** collation sequence with name zName, length nName. ** ** The return value is either the collation sequence to be used in database @@ -116,7 +116,7 @@ CollSeq *sqlite3GetCollSeq( ** that have not been defined by sqlite3_create_collation() etc. ** ** If required, this routine calls the 'collation needed' callback to -** request a definition of the collating sequence. If this doesn't work, +** request a definition of the collating sequence. If this doesn't work, ** an equivalent collating sequence that uses a text encoding different ** from the main database is substituted, if one is available. */ @@ -171,7 +171,7 @@ static CollSeq *findCollSeqEntry( pColl[0].zName[nName] = 0; pDel = sqlite3HashInsert(&db->aCollSeq, pColl[0].zName, pColl); - /* If a malloc() failure occurred in sqlite3HashInsert(), it will + /* If a malloc() failure occurred in sqlite3HashInsert(), it will ** return the pColl pointer to be deleted (because it wasn't added ** to the hash table). */ @@ -229,7 +229,7 @@ CollSeq *sqlite3FindCollSeq( ** 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 +** 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 ** @@ -321,8 +321,8 @@ void sqlite3InsertBuiltinFuncs( } } } - - + + /* ** Locate a user function given a name, a number of arguments and a flag @@ -383,7 +383,7 @@ FuncDef *sqlite3FindFunction( ** have fields overwritten with new information appropriate for the ** new function. But the FuncDefs for built-in functions are read-only. ** So we must not search for built-ins when creating a new function. - */ + */ if( !createFlag && (pBest==0 || (db->flags & SQLITE_PreferBuiltin)!=0) ){ bestScore = 0; h = (sqlite3UpperToLower[(u8)zName[0]] + nName) % SQLITE_FUNC_HASH_SZ; @@ -402,7 +402,7 @@ FuncDef *sqlite3FindFunction( ** exact match for the name, number of arguments and encoding, then add a ** new entry to the hash table and return it. */ - if( createFlag && bestScorezName = (const char*)&pBest[1]; @@ -427,7 +427,7 @@ FuncDef *sqlite3FindFunction( /* ** Free all resources held by the schema structure. The void* argument points -** at a Schema struct. This function does not call sqlite3DbFree(db, ) on the +** at a Schema struct. This function does not call sqlite3DbFree(db, ) on the ** pointer itself, it just cleans up subsidiary resources (i.e. the contents ** of the schema hash tables). ** diff --git a/third_party/sqlite/src/src/complete.c b/third_party/sqlite/src/src/complete.c index bb2c03098e763..ed2e4589c913c 100644 --- a/third_party/sqlite/src/src/complete.c +++ b/third_party/sqlite/src/src/complete.c @@ -66,7 +66,7 @@ extern const char sqlite3IsEbcdicIdChar[]; ** (2) NORMAL We are in the middle of statement which ends with a single ** semicolon. ** -** (3) EXPLAIN The keyword EXPLAIN has been seen at the beginning of +** (3) EXPLAIN The keyword EXPLAIN has been seen at the beginning of ** a statement. ** ** (4) CREATE The keyword CREATE has been seen at the beginning of a diff --git a/third_party/sqlite/src/src/ctime.c b/third_party/sqlite/src/src/ctime.c index 969bbc73d2f29..17b1d90639055 100644 --- a/third_party/sqlite/src/src/ctime.c +++ b/third_party/sqlite/src/src/ctime.c @@ -19,7 +19,7 @@ #include "sqliteInt.h" /* -** An array of names of all compile-time options. This array should +** An array of names of all compile-time options. This array should ** be sorted A-Z. ** ** This array looks large, but in a typical installation actually uses diff --git a/third_party/sqlite/src/src/date.c b/third_party/sqlite/src/src/date.c index a08248ce2f250..3afda608256bb 100644 --- a/third_party/sqlite/src/src/date.c +++ b/third_party/sqlite/src/src/date.c @@ -10,7 +10,7 @@ ** ************************************************************************* ** This file contains the C functions that implement date and time -** functions for SQLite. +** functions for SQLite. ** ** There is only one exported symbol in this file - the function ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file. @@ -19,7 +19,7 @@ ** SQLite processes all times and dates as julian day numbers. The ** dates and times are stored as the number of days since noon ** in Greenwich on November 24, 4714 B.C. according to the Gregorian -** calendar system. +** calendar system. ** ** 1970-01-01 00:00:00 is JD 2440587.5 ** 2000-01-01 00:00:00 is JD 2451544.5 @@ -367,7 +367,7 @@ static void setRawDateNumber(DateTime *p, double r){ ** The following are acceptable forms for the input string: ** ** YYYY-MM-DD HH:MM:SS.FFF +/-HH:MM -** DDDD.DD +** DDDD.DD ** now ** ** In the first form, the +/-HH:MM is always optional. The fractional @@ -377,8 +377,8 @@ static void setRawDateNumber(DateTime *p, double r){ ** as there is a year and date. */ static int parseDateOrTime( - sqlite3_context *context, - const char *zDate, + sqlite3_context *context, + const char *zDate, DateTime *p ){ double r; @@ -399,7 +399,7 @@ static int parseDateOrTime( ** Multiplying this by 86400000 gives 464269060799999 as the maximum value ** for DateTime.iJD. ** -** But some older compilers (ex: gcc 4.2.1 on older Macs) cannot deal with +** But some older compilers (ex: gcc 4.2.1 on older Macs) cannot deal with ** such a large integer literal, so we have to encode it. */ #define INT_464269060799999 ((((i64)0x1a640)<<32)|0x1072fdff) @@ -479,14 +479,14 @@ static void clearYMD_HMS_TZ(DateTime *p){ #ifndef SQLITE_OMIT_LOCALTIME /* ** On recent Windows platforms, the localtime_s() function is available -** as part of the "Secure CRT". It is essentially equivalent to -** localtime_r() available under most POSIX platforms, except that the +** as part of the "Secure CRT". It is essentially equivalent to +** localtime_r() available under most POSIX platforms, except that the ** order of the parameters is reversed. ** ** See http://msdn.microsoft.com/en-us/library/a442x3ye(VS.80).aspx. ** ** If the user has not indicated to use localtime_r() or localtime_s() -** already, check for an MSVC build environment that provides +** already, check for an MSVC build environment that provides ** localtime_s(). */ #if !HAVE_LOCALTIME_R && !HAVE_LOCALTIME_S \ @@ -542,7 +542,7 @@ static int osLocaltime(time_t *t, struct tm *pTm){ /* ** Compute the difference (in milliseconds) between localtime and UTC ** (a.k.a. GMT) for the time value p where p is in UTC. If no error occurs, -** return this value and set *pRc to SQLITE_OK. +** return this value and set *pRc to SQLITE_OK. ** ** Or, if an error does occur, set *pRc to SQLITE_ERROR. The returned value ** is undefined in this case. @@ -868,9 +868,9 @@ static int parseModifier( ** then assume a default value of "now" for argv[0]. */ static int isDate( - sqlite3_context *context, - int argc, - sqlite3_value **argv, + sqlite3_context *context, + int argc, + sqlite3_value **argv, DateTime *p ){ int i, n; diff --git a/third_party/sqlite/src/src/dbstat.c b/third_party/sqlite/src/src/dbstat.c index 13974bb979033..d0c033a788762 100644 --- a/third_party/sqlite/src/src/dbstat.c +++ b/third_party/sqlite/src/src/dbstat.c @@ -27,22 +27,22 @@ /* ** Page paths: -** -** The value of the 'path' column describes the path taken from the -** root-node of the b-tree structure to each page. The value of the +** +** The value of the 'path' column describes the path taken from the +** root-node of the b-tree structure to each page. The value of the ** root-node path is '/'. ** ** The value of the path for the left-most child page of the root of ** a b-tree is '/000/'. (Btrees store content ordered from left to right ** so the pages to the left have smaller keys than the pages to the right.) ** The next to left-most child of the root page is -** '/001', and so on, each sibling page identified by a 3-digit hex +** '/001', and so on, each sibling page identified by a 3-digit hex ** value. The children of the 451st left-most sibling have paths such ** as '/1c2/000/, '/1c2/001/' etc. ** -** Overflow pages are specified by appending a '+' character and a +** Overflow pages are specified by appending a '+' character and a ** six-digit hexadecimal value to the path to the cell they are linked -** from. For example, the three overflow pages in a chain linked from +** from. For example, the three overflow pages in a chain linked from ** the left-most cell of the 450th child of the root page are identified ** by the paths: ** @@ -213,8 +213,8 @@ static int statBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ } - /* Records are always returned in ascending order of (name, path). - ** If this will satisfy the client, set the orderByConsumed flag so that + /* Records are always returned in ascending order of (name, path). + ** If this will satisfy the client, set the orderByConsumed flag so that ** SQLite does not do an external sort. */ if( ( pIdxInfo->nOrderBy==1 @@ -299,7 +299,7 @@ static void getLocalPayload( int nLocal; int nMinLocal; int nMaxLocal; - + if( flags==0x0D ){ /* Table leaf node */ nMinLocal = (nUsable - 12) * 32 / 255 - 23; nMaxLocal = nUsable - 35; @@ -392,7 +392,7 @@ static int statDecodePage(Btree *pBt, StatPage *p){ if( rc!=SQLITE_OK ){ assert( pPg==0 ); return rc; - } + } pCell->aOvfl[j] = sqlite3Get4byte(sqlite3PagerGetData(pPg)); sqlite3PagerUnref(pPg); } @@ -476,7 +476,7 @@ statNextRestart: if( pCell->iOvflnOvfl ){ int nUsable; sqlite3BtreeEnter(pBt); - nUsable = sqlite3BtreeGetPageSize(pBt) - + nUsable = sqlite3BtreeGetPageSize(pBt) - sqlite3BtreeGetReserveNoMutex(pBt); sqlite3BtreeLeave(pBt); pCsr->zName = (char *)sqlite3_column_text(pCsr->pStmt, 0); @@ -572,7 +572,7 @@ static int statEof(sqlite3_vtab_cursor *pCursor){ } static int statFilter( - sqlite3_vtab_cursor *pCursor, + sqlite3_vtab_cursor *pCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -617,8 +617,8 @@ static int statFilter( } static int statColumn( - sqlite3_vtab_cursor *pCursor, - sqlite3_context *ctx, + sqlite3_vtab_cursor *pCursor, + sqlite3_context *ctx, int i ){ StatCursor *pCsr = (StatCursor *)pCursor; diff --git a/third_party/sqlite/src/src/delete.c b/third_party/sqlite/src/src/delete.c index 0683f9b9dd36a..74fffe357e5fd 100644 --- a/third_party/sqlite/src/src/delete.c +++ b/third_party/sqlite/src/src/delete.c @@ -19,7 +19,7 @@ ** (as in the FROM clause of a SELECT statement) in this case it contains ** the name of a single table, as one might find in an INSERT, DELETE, ** or UPDATE statement. Look up that table in the symbol table and -** return a pointer. Set an error message and return NULL if the table +** return a pointer. Set an error message and return NULL if the table ** name is not found or if any other error occurs. ** ** The following fields are initialized appropriate in pSrc: @@ -55,12 +55,12 @@ int sqlite3IsReadOnly(Parse *pParse, Table *pTab, int viewOk){ ** 1) It is a virtual table and no implementation of the xUpdate method ** has been provided, or ** 2) It is a system table (i.e. sqlite_master), this call is not - ** part of a nested parse and writable_schema pragma has not + ** part of a nested parse and writable_schema pragma has not ** been specified. ** ** In either case leave an error message in pParse and return non-zero. */ - if( ( IsVirtual(pTab) + if( ( IsVirtual(pTab) && sqlite3GetVTable(pParse->db, pTab)->pMod->pModule->xUpdate==0 ) || ( (pTab->tabFlags & TF_Readonly)!=0 && (pParse->db->flags & SQLITE_WriteSchema)==0 @@ -106,7 +106,7 @@ void sqlite3MaterializeView( assert( pFrom->a[0].pOn==0 ); assert( pFrom->a[0].pUsing==0 ); } - pSel = sqlite3SelectNew(pParse, 0, pFrom, pWhere, 0, 0, 0, + pSel = sqlite3SelectNew(pParse, 0, pFrom, pWhere, 0, 0, 0, SF_IncludeHidden, 0, 0); sqlite3SelectDestInit(&dest, SRT_EphemTab, iCur); sqlite3Select(pParse, pSel, &dest); @@ -155,11 +155,11 @@ Expr *sqlite3LimitWhere( return pWhere; } - /* Generate a select expression tree to enforce the limit/offset + /* Generate a select expression tree to enforce the limit/offset ** term for the DELETE or UPDATE statement. For example: ** DELETE FROM table_a WHERE col1=1 ORDER BY col2 LIMIT 1 OFFSET 1 ** becomes: - ** DELETE FROM table_a WHERE rowid IN ( + ** DELETE FROM table_a WHERE rowid IN ( ** SELECT rowid FROM table_a WHERE col1=1 ORDER BY col2 LIMIT 1 OFFSET 1 ** ); */ @@ -240,7 +240,7 @@ void sqlite3DeleteFrom( int addrEphOpen = 0; /* Instruction to open the Ephemeral table */ int bComplex; /* True if there are triggers or FKs or ** subqueries in the WHERE clause */ - + #ifndef SQLITE_OMIT_TRIGGER int isView; /* True if attempting to delete from a view */ Trigger *pTrigger; /* List of table triggers, if required */ @@ -288,7 +288,7 @@ void sqlite3DeleteFrom( } iDb = sqlite3SchemaToIndex(db, pTab->pSchema); assert( iDbnDb ); - rcauth = sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, + rcauth = sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, db->aDb[iDb].zDbSName); assert( rcauth==SQLITE_OK || rcauth==SQLITE_DENY || rcauth==SQLITE_IGNORE ); if( rcauth==SQLITE_DENY ){ @@ -349,7 +349,7 @@ void sqlite3DeleteFrom( #ifndef SQLITE_OMIT_TRUNCATE_OPTIMIZATION /* Special case: A DELETE without a WHERE clause deletes everything. ** It is easier just to erase the whole table. Prior to version 3.6.5, - ** this optimization caused the row change count (the value returned by + ** this optimization caused the row change count (the value returned by ** API function sqlite3_count_changes) to be set incorrectly. */ if( rcauth==SQLITE_OK && pWhere==0 @@ -393,7 +393,7 @@ void sqlite3DeleteFrom( addrEphOpen = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, iEphCur, nPk); sqlite3VdbeSetP4KeyInfo(pParse, pPk); } - + /* Construct a query to find the rowid or primary key for every row ** to be deleted, based on the WHERE clause. Set variable eOnePass ** to indicate the strategy used to implement this delete: @@ -407,12 +407,12 @@ void sqlite3DeleteFrom( eOnePass = sqlite3WhereOkOnePass(pWInfo, aiCurOnePass); assert( IsVirtual(pTab)==0 || eOnePass!=ONEPASS_MULTI ); assert( IsVirtual(pTab) || bComplex || eOnePass!=ONEPASS_OFF ); - + /* Keep track of the number of rows to be deleted */ if( db->flags & SQLITE_CountRows ){ sqlite3VdbeAddOp2(v, OP_AddImm, memCnt, 1); } - + /* Extract the rowid or primary key for the current row */ if( pPk ){ for(i=0; ipParse->nMem ) pParse->nMem = iKey; } - + if( eOnePass!=ONEPASS_OFF ){ /* For ONEPASS, no need to store the rowid/primary-key. There is only ** one, so just keep it in its register(s) and fall through to the @@ -456,18 +456,18 @@ void sqlite3DeleteFrom( sqlite3VdbeAddOp2(v, OP_RowSetAdd, iRowSet, iKey); } } - - /* If this DELETE cannot use the ONEPASS strategy, this is the + + /* If this DELETE cannot use the ONEPASS strategy, this is the ** end of the WHERE loop */ if( eOnePass!=ONEPASS_OFF ){ addrBypass = sqlite3VdbeMakeLabel(v); }else{ sqlite3WhereEnd(pWInfo); } - - /* Unless this is a view, open cursors for the table we are + + /* Unless this is a view, open cursors for the table we are ** deleting from and all its indices. If this is a view, then the - ** only effect this statement has is to fire the INSTEAD OF + ** only effect this statement has is to fire the INSTEAD OF ** triggers. */ if( !isView ){ @@ -482,7 +482,7 @@ void sqlite3DeleteFrom( assert( pPk || IsVirtual(pTab) || iIdxCur==iDataCur+1 ); if( eOnePass==ONEPASS_MULTI ) sqlite3VdbeJumpHere(v, iAddrOnce); } - + /* Set up a loop over the rowids/primary-keys that were found in the ** where-clause loop above. */ @@ -501,8 +501,8 @@ void sqlite3DeleteFrom( addrLoop = sqlite3VdbeAddOp3(v, OP_RowSetRead, iRowSet, 0, iKey); VdbeCoverage(v); assert( nKey==1 ); - } - + } + /* Delete the row */ #ifndef SQLITE_OMIT_VIRTUALTABLE if( IsVirtual(pTab) ){ @@ -522,7 +522,7 @@ void sqlite3DeleteFrom( sqlite3GenerateRowDelete(pParse, pTab, pTrigger, iDataCur, iIdxCur, iKey, nKey, count, OE_Default, eOnePass, aiCurOnePass[1]); } - + /* End of the loop over all rowids/primary-keys. */ if( eOnePass!=ONEPASS_OFF ){ sqlite3VdbeResolveLabel(v, addrBypass); @@ -533,7 +533,7 @@ void sqlite3DeleteFrom( }else{ sqlite3VdbeGoto(v, addrLoop); sqlite3VdbeJumpHere(v, addrLoop); - } + } } /* End non-truncate path */ /* Update the sqlite_sequence table by storing the content of the @@ -544,7 +544,7 @@ void sqlite3DeleteFrom( sqlite3AutoincrementEnd(pParse); } - /* Return the number of rows that were deleted. If this routine is + /* Return the number of rows that were deleted. If this routine is ** generating code because of a call to sqlite3NestedParse(), do not ** invoke the callback function. */ @@ -599,7 +599,7 @@ delete_from_cleanup: ** and nPk before reading from it. ** ** If eMode is ONEPASS_MULTI, then this call is being made as part -** of a ONEPASS delete that affects multiple rows. In this case, if +** of a ONEPASS delete that affects multiple rows. In this case, if ** iIdxNoSeek is a valid cursor number (>=0) and is not the same as ** iDataCur, then its position should be preserved following the delete ** operation. Or, if iIdxNoSeek is not a valid cursor number, the @@ -635,7 +635,7 @@ void sqlite3GenerateRowDelete( VdbeModuleComment((v, "BEGIN: GenRowDel(%d,%d,%d,%d)", iDataCur, iIdxCur, iPk, (int)nPk)); - /* Seek cursor iCur to the row to delete. If this row no longer exists + /* Seek cursor iCur to the row to delete. If this row no longer exists ** (this can happen if a trigger program has already deleted it), do ** not attempt to delete it or fire any DELETE triggers. */ iLabel = sqlite3VdbeMakeLabel(v); @@ -645,7 +645,7 @@ void sqlite3GenerateRowDelete( VdbeCoverageIf(v, opSeek==OP_NotExists); VdbeCoverageIf(v, opSeek==OP_NotFound); } - + /* If there are any triggers to fire, allocate a range of registers to ** use for the old.* references in the triggers. */ if( sqlite3FkRequired(pParse, pTab, 0, 0) || pTrigger ){ @@ -662,7 +662,7 @@ void sqlite3GenerateRowDelete( iOld = pParse->nMem+1; pParse->nMem += (1 + pTab->nCol); - /* Populate the OLD.* pseudo-table register array. These values will be + /* Populate the OLD.* pseudo-table register array. These values will be ** used by any BEFORE and AFTER triggers that exist. */ sqlite3VdbeAddOp2(v, OP_Copy, iPk, iOld); for(iCol=0; iColnCol; iCol++){ @@ -675,11 +675,11 @@ void sqlite3GenerateRowDelete( /* Invoke BEFORE DELETE trigger programs. */ addrStart = sqlite3VdbeCurrentAddr(v); - sqlite3CodeRowTrigger(pParse, pTrigger, + sqlite3CodeRowTrigger(pParse, pTrigger, TK_DELETE, 0, TRIGGER_BEFORE, pTab, iOld, onconf, iLabel ); - /* If any BEFORE triggers were coded, then seek the cursor to the + /* If any BEFORE triggers were coded, then seek the cursor to the ** row to be deleted again. It may be that the BEFORE triggers moved ** the cursor or already deleted the row that the cursor was ** pointing to. @@ -696,21 +696,21 @@ void sqlite3GenerateRowDelete( } /* Do FK processing. This call checks that any FK constraints that - ** refer to this table (i.e. constraints attached to other tables) + ** refer to this table (i.e. constraints attached to other tables) ** are not violated by deleting this row. */ sqlite3FkCheck(pParse, pTab, iOld, 0, 0, 0); } /* Delete the index and table entries. Skip this step if pTab is really ** a view (in which case the only effect of the DELETE statement is to - ** fire the INSTEAD OF triggers). + ** fire the INSTEAD OF triggers). ** ** If variable 'count' is non-zero, then this OP_Delete instruction should ** invoke the update-hook. The pre-update-hook, on the other hand should ** be invoked unless table pTab is a system table. The difference is that - ** the update-hook is not invoked for rows removed by REPLACE, but the + ** the update-hook is not invoked for rows removed by REPLACE, but the ** pre-update-hook is. - */ + */ if( pTab->pSelect==0 ){ u8 p5 = 0; sqlite3GenerateRowIndexDelete(pParse, pTab, iDataCur, iIdxCur,0,iIdxNoSeek); @@ -730,16 +730,16 @@ void sqlite3GenerateRowDelete( /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key - ** to the row just deleted. */ + ** to the row just deleted. */ sqlite3FkActions(pParse, pTab, 0, iOld, 0, 0); /* Invoke AFTER DELETE trigger programs. */ - sqlite3CodeRowTrigger(pParse, pTrigger, + sqlite3CodeRowTrigger(pParse, pTrigger, TK_DELETE, 0, TRIGGER_AFTER, pTab, iOld, onconf, iLabel ); /* Jump here if the row had already been deleted before any BEFORE - ** trigger programs were invoked. Or if a trigger program throws a + ** trigger programs were invoked. Or if a trigger program throws a ** RAISE(IGNORE) exception. */ sqlite3VdbeResolveLabel(v, iLabel); VdbeModuleComment((v, "END: GenRowDel()")); @@ -823,7 +823,7 @@ void sqlite3GenerateRowIndexDelete( ** its key into the same sequence of registers and if pPrior and pIdx share ** a column in common, then the register corresponding to that column already ** holds the correct value and the loading of that register is skipped. -** This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK +** This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK ** on a table with multiple indices, and especially with the ROWID or ** PRIMARY KEY columns of the index. */ @@ -847,7 +847,7 @@ int sqlite3GenerateIndexKey( *piPartIdxLabel = sqlite3VdbeMakeLabel(v); pParse->iSelfTab = iDataCur; sqlite3ExprCachePush(pParse); - sqlite3ExprIfFalseDup(pParse, pIdx->pPartIdxWhere, *piPartIdxLabel, + sqlite3ExprIfFalseDup(pParse, pIdx->pPartIdxWhere, *piPartIdxLabel, SQLITE_JUMPIFNULL); }else{ *piPartIdxLabel = 0; diff --git a/third_party/sqlite/src/src/expr.c b/third_party/sqlite/src/src/expr.c index ff4f1b5ade5f0..4608a8e341558 100644 --- a/third_party/sqlite/src/src/expr.c +++ b/third_party/sqlite/src/src/expr.c @@ -30,7 +30,7 @@ char sqlite3TableColumnAffinity(Table *pTab, int iCol){ ** Return the 'affinity' of the expression pExpr if any. ** ** If pExpr is a column, a reference to a column via an 'AS' alias, -** or a sub-select with a column as the return value, then the +** or a sub-select with a column as the return value, then the ** affinity of that column is returned. Otherwise, 0x00 is returned, ** indicating no affinity for the expression. ** @@ -116,7 +116,7 @@ Expr *sqlite3ExprSkipCollate(Expr *pExpr){ assert( pExpr->op==TK_COLLATE ); pExpr = pExpr->pLeft; } - } + } return pExpr; } @@ -182,7 +182,7 @@ CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){ break; } } - if( sqlite3CheckCollSeq(pParse, pColl) ){ + if( sqlite3CheckCollSeq(pParse, pColl) ){ pColl = 0; } return pColl; @@ -278,8 +278,8 @@ static u8 binaryCompareP5(Expr *pExpr1, Expr *pExpr2, int jumpIfNull){ ** it is not considered. */ CollSeq *sqlite3BinaryCompareCollSeq( - Parse *pParse, - Expr *pLeft, + Parse *pParse, + Expr *pLeft, Expr *pRight ){ CollSeq *pColl; @@ -335,7 +335,7 @@ int sqlite3ExprIsVector(Expr *pExpr){ } /* -** If the expression passed as the only argument is of type TK_VECTOR +** If the expression passed as the only argument is of type TK_VECTOR ** return the number of expressions in the vector. Or, if the expression ** is a sub-select, return the number of columns in the sub-select. For ** any other type of expression, return 1. @@ -388,7 +388,7 @@ Expr *sqlite3VectorFieldSubexpr(Expr *pVector, int i){ ** sqlite3ExprCode() will generate all necessary code to compute ** the iField-th column of the vector expression pVector. ** -** It is ok for pVector to be a scalar (as long as iField==0). +** It is ok for pVector to be a scalar (as long as iField==0). ** In that case, this routine works like sqlite3ExprDup(). ** ** The caller owns the returned Expr object and is responsible for @@ -444,7 +444,7 @@ Expr *sqlite3ExprForVectorField( /* ** If expression pExpr is of type TK_SELECT, generate code to evaluate -** it. Return the register in which the result is stored (or, if the +** it. Return the register in which the result is stored (or, if the ** sub-select returns more than one column, the first in an array ** of registers in which the result is stored). ** @@ -466,10 +466,10 @@ static int exprCodeSubselect(Parse *pParse, Expr *pExpr){ ** the register number of a register that contains the value of ** element iField of the vector. ** -** If pVector is a TK_SELECT expression, then code for it must have +** If pVector is a TK_SELECT expression, then code for it must have ** already been generated using the exprCodeSubselect() routine. In this ** case parameter regSelect should be the first in an array of registers -** containing the results of the sub-select. +** containing the results of the sub-select. ** ** If pVector is of type TK_VECTOR, then code for the requested field ** is generated. In this case (*pRegFree) may be set to the number of @@ -532,10 +532,10 @@ static void codeVectorCompare( sqlite3ErrorMsg(pParse, "row value misused"); return; } - assert( pExpr->op==TK_EQ || pExpr->op==TK_NE - || pExpr->op==TK_IS || pExpr->op==TK_ISNOT - || pExpr->op==TK_LT || pExpr->op==TK_GT - || pExpr->op==TK_LE || pExpr->op==TK_GE + assert( pExpr->op==TK_EQ || pExpr->op==TK_NE + || pExpr->op==TK_IS || pExpr->op==TK_ISNOT + || pExpr->op==TK_LT || pExpr->op==TK_GT + || pExpr->op==TK_LE || pExpr->op==TK_GE ); assert( pExpr->op==op || (pExpr->op==TK_IS && op==TK_EQ) || (pExpr->op==TK_ISNOT && op==TK_NE) ); @@ -551,7 +551,7 @@ static void codeVectorCompare( for(i=0; 1 /*Loop exits by "break"*/; i++){ int regFree1 = 0, regFree2 = 0; - Expr *pL, *pR; + Expr *pL, *pR; int r1, r2; assert( i>=0 && i0 ) sqlite3ExprCachePush(pParse); @@ -599,7 +599,7 @@ int sqlite3ExprCheckHeight(Parse *pParse, int nHeight){ int rc = SQLITE_OK; int mxHeight = pParse->db->aLimit[SQLITE_LIMIT_EXPR_DEPTH]; if( nHeight>mxHeight ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "Expression tree is too large (maximum depth %d)", mxHeight ); rc = SQLITE_ERROR; @@ -645,10 +645,10 @@ static void heightOfSelect(Select *p, int *pnHeight){ } /* -** Set the Expr.nHeight variable in the structure passed as an -** argument. An expression with no children, Expr.pList or +** Set the Expr.nHeight variable in the structure passed as an +** argument. An expression with no children, Expr.pList or ** Expr.pSelect member has a height of 1. Any other expression -** has a height equal to the maximum height of any other +** has a height equal to the maximum height of any other ** referenced Expr plus one. ** ** Also propagate EP_Propagate flags up from Expr.x.pList to Expr.flags, @@ -673,7 +673,7 @@ static void exprSetHeight(Expr *p){ ** leave an error in pParse. ** ** Also propagate all EP_Propagate flags from the Expr.x.pList into -** Expr.flags. +** Expr.flags. */ void sqlite3ExprSetHeightAndFlags(Parse *pParse, Expr *p){ if( pParse->nErr ) return; @@ -693,7 +693,7 @@ int sqlite3SelectExprHeight(Select *p){ #else /* ABOVE: Height enforcement enabled. BELOW: Height enforcement off */ /* ** Propagate all EP_Propagate flags from the Expr.x.pList into -** Expr.flags. +** Expr.flags. */ void sqlite3ExprSetHeightAndFlags(Parse *pParse, Expr *p){ if( p && p->x.pList && !ExprHasProperty(p, EP_xIsSelect) ){ @@ -763,7 +763,7 @@ Expr *sqlite3ExprAlloc( } #if SQLITE_MAX_EXPR_DEPTH>0 pNew->nHeight = 1; -#endif +#endif } return pNew; } @@ -932,7 +932,7 @@ Expr *sqlite3ExprFunction(Parse *pParse, ExprList *pList, Token *pToken){ /* ** Assign a variable number to an expression that encodes a wildcard -** in the original SQL statement. +** in the original SQL statement. ** ** Wildcards consisting of a single "?" are assigned the next sequential ** variable number. @@ -1046,7 +1046,7 @@ void sqlite3ExprDelete(sqlite3 *db, Expr *p){ } /* -** Return the number of bytes allocated for the expression structure +** Return the number of bytes allocated for the expression structure ** passed as the first argument. This is always one of EXPR_FULLSIZE, ** EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE. */ @@ -1061,14 +1061,14 @@ static int exprStructSize(Expr *p){ ** to store a copy of an expression or expression tree. They differ in ** how much of the tree is measured. ** -** dupedExprStructSize() Size of only the Expr structure +** dupedExprStructSize() Size of only the Expr structure ** dupedExprNodeSize() Size of Expr + space for token ** dupedExprSize() Expr + token + subtree components ** *************************************************************************** ** -** The dupedExprStructSize() function returns two values OR-ed together: -** (1) the space required for a copy of the Expr structure only and +** The dupedExprStructSize() function returns two values OR-ed together: +** (1) the space required for a copy of the Expr structure only and ** (2) the EP_xxx flags that indicate what the structure size should be. ** The return values is always one of: ** @@ -1099,7 +1099,7 @@ static int dupedExprStructSize(Expr *p, int flags){ nSize = EXPR_FULLSIZE; }else{ assert( !ExprHasProperty(p, EP_TokenOnly|EP_Reduced) ); - assert( !ExprHasProperty(p, EP_FromJoin) ); + assert( !ExprHasProperty(p, EP_FromJoin) ); assert( !ExprHasProperty(p, EP_MemToken) ); assert( !ExprHasProperty(p, EP_NoReduce) ); if( p->pLeft || p->x.pList ){ @@ -1113,7 +1113,7 @@ static int dupedExprStructSize(Expr *p, int flags){ } /* -** This function returns the space in bytes required to store the copy +** This function returns the space in bytes required to store the copy ** of the Expr structure and a copy of the Expr.u.zToken string (if that ** string is defined.) */ @@ -1126,16 +1126,16 @@ static int dupedExprNodeSize(Expr *p, int flags){ } /* -** Return the number of bytes required to create a duplicate of the +** Return the number of bytes required to create a duplicate of the ** expression passed as the first argument. The second argument is a ** mask containing EXPRDUP_XXX flags. ** ** The value returned includes space to create a copy of the Expr struct ** itself and the buffer referred to by Expr.u.zToken, if any. ** -** If the EXPRDUP_REDUCE flag is set, then the return value includes -** space to duplicate all Expr nodes in the tree formed by Expr.pLeft -** and Expr.pRight variables (but not for any structures pointed to or +** If the EXPRDUP_REDUCE flag is set, then the return value includes +** space to duplicate all Expr nodes in the tree formed by Expr.pLeft +** and Expr.pRight variables (but not for any structures pointed to or ** descended from the Expr.x.pList or Expr.x.pSelect variables). */ static int dupedExprSize(Expr *p, int flags){ @@ -1150,8 +1150,8 @@ static int dupedExprSize(Expr *p, int flags){ } /* -** This function is similar to sqlite3ExprDup(), except that if pzBuffer -** is not NULL then *pzBuffer is assumed to point to a buffer large enough +** This function is similar to sqlite3ExprDup(), except that if pzBuffer +** is not NULL then *pzBuffer is assumed to point to a buffer large enough ** to store the copy of expression p, the copies of p->u.zToken ** (if applicable), and the copies of the p->pLeft and p->pRight expressions, ** if any. Before returning, *pzBuffer is set to the first byte past the @@ -1197,7 +1197,7 @@ static Expr *exprDup(sqlite3 *db, Expr *p, int dupFlags, u8 **pzBuffer){ }else{ u32 nSize = (u32)exprStructSize(p); memcpy(zAlloc, p, nSize); - if( nSizemallocFailed flag set. */ @@ -1284,7 +1284,7 @@ static With *withDup(sqlite3 *db, With *p){ ** without effecting the originals. ** ** The expression list, ID, and source lists return by sqlite3ExprListDup(), -** sqlite3IdListDup(), and sqlite3SrcListDup() can not be further expanded +** sqlite3IdListDup(), and sqlite3SrcListDup() can not be further expanded ** by subsequent calls to sqlite*ListAppend() routines. ** ** Any tables that the SrcList might point to are not duplicated. @@ -1313,15 +1313,15 @@ ExprList *sqlite3ExprListDup(sqlite3 *db, ExprList *p, int flags){ if( pItem==0 ){ sqlite3DbFree(db, pNew); return 0; - } + } pOldItem = p->a; for(i=0; inExpr; i++, pItem++, pOldItem++){ Expr *pOldExpr = pOldItem->pExpr; Expr *pNewExpr; pItem->pExpr = sqlite3ExprDup(db, pOldExpr, flags); - if( pOldExpr + if( pOldExpr && pOldExpr->op==TK_SELECT_COLUMN - && (pNewExpr = pItem->pExpr)!=0 + && (pNewExpr = pItem->pExpr)!=0 ){ assert( pNewExpr->iColumn==0 || i>0 ); if( pNewExpr->iColumn==0 ){ @@ -1347,7 +1347,7 @@ ExprList *sqlite3ExprListDup(sqlite3 *db, ExprList *p, int flags){ /* ** If cursors, triggers, views and subqueries are all omitted from -** the build, then none of the following routines, except for +** the build, then none of the following routines, except for ** sqlite3SelectDup(), can be called. sqlite3SelectDup() is sometimes ** called with a NULL argument. */ @@ -1380,7 +1380,7 @@ SrcList *sqlite3SrcListDup(sqlite3 *db, SrcList *p, int flags){ } pNewItem->pIBIndex = pOldItem->pIBIndex; if( pNewItem->fg.isTabFunc ){ - pNewItem->u1.pFuncArg = + pNewItem->u1.pFuncArg = sqlite3ExprListDup(db, pOldItem->u1.pFuncArg, flags); } pTab = pNewItem->pTab = pOldItem->pTab; @@ -1502,7 +1502,7 @@ ExprList *sqlite3ExprListAppend( } return pList; -no_mem: +no_mem: /* Avoid leaking memory if malloc has failed. */ sqlite3ExprDelete(db, pExpr); sqlite3ExprListDelete(db, pList); @@ -1535,8 +1535,8 @@ ExprList *sqlite3ExprListAppendVector( if( NEVER(pColumns==0) ) goto vector_append_error; if( pExpr==0 ) goto vector_append_error; - /* If the RHS is a vector, then we can immediately check to see that - ** the size of the RHS and LHS match. But if the RHS is a SELECT, + /* If the RHS is a vector, then we can immediately check to see that + ** the size of the RHS and LHS match. But if the RHS is a SELECT, ** wildcards ("*") in the result set of the SELECT must be expanded before ** we can do the size check, so defer the size check until code generation. */ @@ -1560,7 +1560,7 @@ ExprList *sqlite3ExprListAppendVector( if( pList && pList->a[iFirst].pExpr ){ Expr *pFirst = pList->a[iFirst].pExpr; assert( pFirst->op==TK_SELECT_COLUMN ); - + /* Store the SELECT statement in pRight so it will be deleted when ** sqlite3ExprListDelete() is called */ pFirst->pRight = pExpr; @@ -1715,7 +1715,7 @@ u32 sqlite3ExprListFlags(const ExprList *pList){ ** in a CREATE TABLE statement. The Walker.eCode value is 5 when parsing ** an existing schema and 4 when processing a new statement. A bound ** parameter raises an error for new statements, but is silently converted -** to NULL for existing schemas. This allows sqlite_master tables that +** to NULL for existing schemas. This allows sqlite_master tables that ** contain a bound parameter because they were generated by older versions ** of SQLite to be parsed by newer versions of SQLite without raising a ** malformed schema error. @@ -1893,7 +1893,7 @@ int sqlite3ExprIsInteger(Expr *p, int *pValue){ ** Return FALSE if there is no chance that the expression can be NULL. ** ** If the expression might be NULL or if the expression is too complex -** to tell return TRUE. +** to tell return TRUE. ** ** This routine is used as an optimization, to skip OP_IsNull opcodes ** when we know that a value cannot be NULL. Hence, a false positive @@ -1974,7 +1974,7 @@ int sqlite3IsRowid(const char *z){ } /* -** pX is the RHS of an IN operator. If pX is a SELECT statement +** pX is the RHS of an IN operator. If pX is a SELECT statement ** that can be simplified to a direct table access, then return ** a pointer to the SELECT statement. If pX is not a SELECT statement, ** or if the SELECT statement needs to be manifested into a transient @@ -2041,7 +2041,7 @@ static void sqlite3SetHasNullFlag(Vdbe *v, int iCur, int regHasNull){ #ifndef SQLITE_OMIT_SUBQUERY /* -** The argument is an IN operator with a list (not a subquery) on the +** The argument is an IN operator with a list (not a subquery) on the ** right-hand side. Return TRUE if that list is constant. */ static int sqlite3InRhsIsConstant(Expr *pIn){ @@ -2101,9 +2101,9 @@ static int sqlite3InRhsIsConstant(Expr *pIn){ ** to be unique - either because it is an INTEGER PRIMARY KEY or due to ** a UNIQUE constraint or index. ** -** When IN_INDEX_MEMBERSHIP is used (and the b-tree will be used -** for fast set membership tests) then an epheremal table must -** be used unless is a single INTEGER PRIMARY KEY column or an +** When IN_INDEX_MEMBERSHIP is used (and the b-tree will be used +** for fast set membership tests) then an epheremal table must +** be used unless is a single INTEGER PRIMARY KEY column or an ** index can be found with the specified as its left-most. ** ** If the IN_INDEX_NOOP_OK and IN_INDEX_MEMBERSHIP are both set and @@ -2115,7 +2115,7 @@ static int sqlite3InRhsIsConstant(Expr *pIn){ ** ** When the b-tree is being used for membership tests, the calling function ** might need to know whether or not the RHS side of the IN operator -** contains a NULL. If prRhsHasNull is not a NULL pointer and +** contains a NULL. If prRhsHasNull is not a NULL pointer and ** if there is any chance that the (...) might contain a NULL value at ** runtime, then a register is allocated and the register number written ** to *prRhsHasNull. If there is no chance that the (...) contains a @@ -2154,9 +2154,9 @@ int sqlite3FindInIndex( assert( pX->op==TK_IN ); mustBeUnique = (inFlags & IN_INDEX_LOOP)!=0; - /* If the RHS of this IN(...) operator is a SELECT, and if it matters + /* If the RHS of this IN(...) operator is a SELECT, and if it matters ** whether or not the SELECT result contains NULL values, check whether - ** or not NULL is actually possible (it may not be, for example, due + ** or not NULL is actually possible (it may not be, for example, due ** to NOT NULL constraints in the schema). If no NULL values are possible, ** set prRhsHasNull to 0 before continuing. */ if( prRhsHasNull && (pX->flags & EP_xIsSelect) ){ @@ -2171,7 +2171,7 @@ int sqlite3FindInIndex( } /* Check to see if an existing table or index can be used to - ** satisfy the query. This is preferable to generating a new + ** satisfy the query. This is preferable to generating a new ** ephemeral table. */ if( pParse->nErr==0 && (p = isCandidateForInOpt(pX))!=0 ){ sqlite3 *db = pParse->db; /* Database connection */ @@ -2205,7 +2205,7 @@ int sqlite3FindInIndex( int affinity_ok = 1; int i; - /* Check that the affinity that will be used to perform each + /* Check that the affinity that will be used to perform each ** comparison is the same as the affinity of each column in table ** on the RHS of the IN operator. If it not, it is not possible to ** use any index of the RHS table. */ @@ -2249,14 +2249,14 @@ int sqlite3FindInIndex( continue; /* This index is not unique over the IN RHS columns */ } } - + colUsed = 0; /* Columns of index used so far */ for(i=0; ipLeft, i); Expr *pRhs = pEList->a[i].pExpr; CollSeq *pReq = sqlite3BinaryCompareCollSeq(pParse, pLhs, pRhs); int j; - + assert( pReq!=0 || pRhs->iColumn==XN_ROWID || pParse->nErr ); for(j=0; jaiColumn[j]!=pRhs->iColumn ) continue; @@ -2272,7 +2272,7 @@ int sqlite3FindInIndex( colUsed |= mCol; if( aiMap ) aiMap[i] = j; } - + assert( i==nExpr || colUsed!=(MASKBIT(nExpr)-1) ); if( colUsed==(MASKBIT(nExpr)-1) ){ /* If we reach this point, that means the index pIdx is usable */ @@ -2287,11 +2287,11 @@ int sqlite3FindInIndex( VdbeComment((v, "%s", pIdx->zName)); assert( IN_INDEX_INDEX_DESC == IN_INDEX_INDEX_ASC+1 ); eType = IN_INDEX_INDEX_ASC + pIdx->aSortOrder[0]; - + if( prRhsHasNull ){ #ifdef SQLITE_ENABLE_COLUMN_USED_MASK i64 mask = (1<nMem; @@ -2353,8 +2353,8 @@ int sqlite3FindInIndex( #ifndef SQLITE_OMIT_SUBQUERY /* -** Argument pExpr is an (?, ?...) IN(...) expression. This -** function allocates and returns a nul-terminated string containing +** Argument pExpr is an (?, ?...) IN(...) expression. This +** function allocates and returns a nul-terminated string containing ** the affinities to be used for each column of the comparison. ** ** It is the responsibility of the caller to ensure that the returned @@ -2387,11 +2387,11 @@ static char *exprINAffinity(Parse *pParse, Expr *pExpr){ #ifndef SQLITE_OMIT_SUBQUERY /* -** Load the Parse object passed as the first argument with an error +** Load the Parse object passed as the first argument with an error ** message of the form: ** ** "sub-select returns N columns - expected M" -*/ +*/ void sqlite3SubselectError(Parse *pParse, int nActual, int nExpect){ const char *zFmt = "sub-select returns %d columns - expected %d"; sqlite3ErrorMsg(pParse, zFmt, nActual, nExpect); @@ -2400,7 +2400,7 @@ void sqlite3SubselectError(Parse *pParse, int nActual, int nExpect){ /* ** Expression pExpr is a vector that has been used in a context where -** it is not permitted. If pExpr is a sub-select vector, this routine +** it is not permitted. If pExpr is a sub-select vector, this routine ** loads the Parse object with a message of the form: ** ** "sub-select returns N columns - expected 1" @@ -2408,7 +2408,7 @@ void sqlite3SubselectError(Parse *pParse, int nActual, int nExpect){ ** Or, if it is a regular scalar vector: ** ** "row value misused" -*/ +*/ void sqlite3VectorErrorMsg(Parse *pParse, Expr *pExpr){ #ifndef SQLITE_OMIT_SUBQUERY if( pExpr->flags & EP_xIsSelect ){ @@ -2493,13 +2493,13 @@ int sqlite3CodeSubselect( Expr *pLeft = pExpr->pLeft; /* the LHS of the IN operator */ KeyInfo *pKeyInfo = 0; /* Key information */ int nVal; /* Size of vector pLeft */ - + nVal = sqlite3ExprVectorSize(pLeft); assert( !isRowid || nVal==1 ); /* Whether this is an 'x IN(SELECT...)' or an 'x IN()' - ** expression it is handled the same way. An ephemeral table is - ** filled with index keys representing the results from the + ** expression it is handled the same way. An ephemeral table is + ** filled with index keys representing the results from the ** SELECT or the . ** ** If the 'x' expression is a column value, or the SELECT... @@ -2511,7 +2511,7 @@ int sqlite3CodeSubselect( ** is used. */ pExpr->iTable = pParse->nTab++; - addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, + addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pExpr->iTable, (isRowid?0:nVal)); pKeyInfo = isRowid ? 0 : sqlite3KeyInfoAlloc(pParse->db, nVal, 1); @@ -2633,7 +2633,7 @@ int sqlite3CodeSubselect( ** If this is an EXISTS, write an integer 0 (not exists) or 1 (exists) ** into a register and return that register number. ** - ** In both cases, the query is augmented with "LIMIT 1". Any + ** In both cases, the query is augmented with "LIMIT 1". Any ** preexisting limit is discarded in place of the new LIMIT 1. */ Select *pSel; /* SELECT statement to encode */ @@ -2689,9 +2689,9 @@ int sqlite3CodeSubselect( #ifndef SQLITE_OMIT_SUBQUERY /* -** Expr pIn is an IN(...) expression. This function checks that the -** sub-select on the RHS of the IN() operator has the same number of -** columns as the vector on the LHS. Or, if the RHS of the IN() is not +** Expr pIn is an IN(...) expression. This function checks that the +** sub-select on the RHS of the IN() operator has the same number of +** columns as the vector on the LHS. Or, if the RHS of the IN() is not ** a sub-query, that the LHS is a vector of size 1. */ int sqlite3ExprCheckIN(Parse *pParse, Expr *pIn){ @@ -2716,18 +2716,18 @@ int sqlite3ExprCheckIN(Parse *pParse, Expr *pIn){ ** x IN (SELECT ...) ** x IN (value, value, ...) ** -** The left-hand side (LHS) is a scalar or vector expression. The +** The left-hand side (LHS) is a scalar or vector expression. The ** right-hand side (RHS) is an array of zero or more scalar values, or a ** subquery. If the RHS is a subquery, the number of result columns must ** match the number of columns in the vector on the LHS. If the RHS is -** a list of values, the LHS must be a scalar. +** a list of values, the LHS must be a scalar. ** ** The IN operator is true if the LHS value is contained within the RHS. -** The result is false if the LHS is definitely not in the RHS. The -** result is NULL if the presence of the LHS in the RHS cannot be +** The result is false if the LHS is definitely not in the RHS. The +** result is NULL if the presence of the LHS in the RHS cannot be ** determined due to NULLs. ** -** This routine generates code that jumps to destIfFalse if the LHS is not +** This routine generates code that jumps to destIfFalse if the LHS is not ** contained within the RHS. If due to NULLs we cannot determine if the LHS ** is contained in the RHS then jump to destIfNull. If the LHS is contained ** within the RHS then fall through. @@ -2756,7 +2756,7 @@ static void sqlite3ExprCodeIN( int destStep6 = 0; /* Start of code for Step 6 */ int addrTruthOp; /* Address of opcode that determines the IN is true */ int destNotNull; /* Jump here if a comparison is not true in step 6 */ - int addrTop; /* Top of the step-6 loop */ + int addrTop; /* Top of the step-6 loop */ pLeft = pExpr->pLeft; if( sqlite3ExprCheckIN(pParse, pExpr) ) return; @@ -2768,7 +2768,7 @@ static void sqlite3ExprCodeIN( if( pParse->db->mallocFailed ) goto sqlite3ExprCodeIN_oom_error; /* Attempt to compute the RHS. After this step, if anything other than - ** IN_INDEX_NOOP is returned, the table opened ith cursor pExpr->iTable + ** IN_INDEX_NOOP is returned, the table opened ith cursor pExpr->iTable ** contains the values that make up the RHS. If IN_INDEX_NOOP is returned, ** the RHS has not yet been coded. */ v = pParse->pVdbe; @@ -2779,7 +2779,7 @@ static void sqlite3ExprCodeIN( destIfFalse==destIfNull ? 0 : &rRhsHasNull, aiMap); assert( pParse->nErr || nVector==1 || eType==IN_INDEX_EPH - || eType==IN_INDEX_INDEX_ASC || eType==IN_INDEX_INDEX_DESC + || eType==IN_INDEX_INDEX_ASC || eType==IN_INDEX_INDEX_DESC ); #ifdef SQLITE_DEBUG /* Confirm that aiMap[] contains nVector integer values between 0 and @@ -2791,8 +2791,8 @@ static void sqlite3ExprCodeIN( } #endif - /* Code the LHS, the from " IN (...)". If the LHS is a - ** vector, then it is stored in an array of nVector registers starting + /* Code the LHS, the from " IN (...)". If the LHS is a + ** vector, then it is stored in an array of nVector registers starting ** at r1. ** ** sqlite3FindInIndex() might have reordered the fields of the LHS vector @@ -2910,7 +2910,7 @@ static void sqlite3ExprCodeIN( } /* Step 5. If we do not care about the difference between NULL and - ** FALSE, then just return false. + ** FALSE, then just return false. */ if( destIfFalse==destIfNull ) sqlite3VdbeGoto(v, destIfFalse); @@ -2972,7 +2972,7 @@ sqlite3ExprCodeIN_oom_error: ** Generate an instruction that will put the floating point ** value described by z[0..n-1] into register iMem. ** -** The z[] string will probably not be zero-terminated. But the +** The z[] string will probably not be zero-terminated. But the ** z[n] character is guaranteed to be something that does not look ** like the continuation of the number. */ @@ -3216,7 +3216,7 @@ void sqlite3ExprCodeGetColumnOfTable( /* ** Generate code that will extract the iColumn-th column from -** table pTab and store the column value in a register. +** table pTab and store the column value in a register. ** ** An effort is made to store the column value in register iReg. This ** is not garanteeed for GetColumn() - the result can be stored in @@ -3244,12 +3244,12 @@ int sqlite3ExprCodeGetColumn( sqlite3ExprCachePinRegister(pParse, p->iReg); return p->iReg; } - } + } assert( v!=0 ); sqlite3ExprCodeGetColumnOfTable(v, pTab, iTable, iColumn, iReg); if( p5 ){ sqlite3VdbeChangeP5(v, p5); - }else{ + }else{ sqlite3ExprCacheStore(pParse, iTable, iColumn, iReg); } return iReg; @@ -3538,7 +3538,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ case TK_BITOR: case TK_SLASH: case TK_LSHIFT: - case TK_RSHIFT: + case TK_RSHIFT: case TK_CONCAT: { assert( TK_AND==OP_And ); testcase( op==TK_AND ); assert( TK_OR==OP_Or ); testcase( op==TK_OR ); @@ -3689,7 +3689,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ char aff; assert( nFarg==1 ); aff = sqlite3ExprAffinity(pFarg->a[0].pExpr); - sqlite3VdbeLoadString(v, target, + sqlite3VdbeLoadString(v, target, aff ? azAff[aff-SQLITE_AFF_BLOB] : "none"); return target; } @@ -3726,7 +3726,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ assert( SQLITE_FUNC_LENGTH==OPFLAG_LENGTHARG ); assert( SQLITE_FUNC_TYPEOF==OPFLAG_TYPEOFARG ); testcase( pDef->funcFlags & OPFLAG_LENGTHARG ); - pFarg->a[0].pExpr->op2 = + pFarg->a[0].pExpr->op2 = pDef->funcFlags & (OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG); } } @@ -3747,7 +3747,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ ** see if it is a column in a virtual table. This is done because ** the left operand of infix functions (the operand we want to ** control overloading) ends up as the second argument to the - ** function. The expression "A glob B" is equivalent to + ** function. The expression "A glob B" is equivalent to ** "glob(B,A). We want to use the A in "A glob B" to test ** for function overloading. But we use the B term in "glob(B,A)". */ @@ -3758,7 +3758,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ } #endif if( pDef->funcFlags & SQLITE_FUNC_NEEDCOLL ){ - if( !pColl ) pColl = db->pDfltColl; + if( !pColl ) pColl = db->pDfltColl; sqlite3VdbeAddOp4(v, OP_CollSeq, 0, 0, 0, (char *)pColl, P4_COLLSEQ); } sqlite3VdbeAddOp4(v, OP_Function0, constMask, r1, target, @@ -3789,7 +3789,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ } assert( pExpr->iTable==0 || pExpr->pLeft->op==TK_SELECT ); if( pExpr->iTable - && pExpr->iTable!=(n = sqlite3ExprVectorSize(pExpr->pLeft)) + && pExpr->iTable!=(n = sqlite3ExprVectorSize(pExpr->pLeft)) ){ sqlite3ErrorMsg(pParse, "%d columns assigned %d values", pExpr->iTable, n); @@ -3826,7 +3826,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ return target; } case TK_SPAN: - case TK_COLLATE: + case TK_COLLATE: case TK_UPLUS: { return sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); } @@ -3841,7 +3841,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ ** ** The expression is implemented using an OP_Param opcode. The p1 ** parameter is set to 0 for an old.rowid reference, or to (i+1) - ** to reference another column of the old.* pseudo-table, where + ** to reference another column of the old.* pseudo-table, where ** i is the index of the column. For a new.rowid reference, p1 is ** set to (n+1), where n is the number of columns in each pseudo-table. ** For a reference to any other column in the new.* pseudo-table, p1 @@ -3855,7 +3855,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ ** ** p1==0 -> old.rowid p1==3 -> new.rowid ** p1==1 -> old.a p1==4 -> new.a - ** p1==2 -> old.b p1==5 -> new.b + ** p1==2 -> old.b p1==5 -> new.b */ Table *pTab = pExpr->pTab; int p1 = pExpr->iTable * (pTab->nCol+1) + 1 + pExpr->iColumn; @@ -3878,7 +3878,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ ** ** EVIDENCE-OF: R-60985-57662 SQLite will convert the value back to ** floating point when extracting it from the record. */ - if( pExpr->iColumn>=0 + if( pExpr->iColumn>=0 && pTab->aCol[pExpr->iColumn].affinity==SQLITE_AFF_REAL ){ sqlite3VdbeAddOp1(v, OP_RealAffinity, target); @@ -3970,14 +3970,14 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ }else{ sqlite3VdbeAddOp2(v, OP_Null, 0, target); } - assert( pParse->db->mallocFailed || pParse->nErr>0 + assert( pParse->db->mallocFailed || pParse->nErr>0 || pParse->iCacheLevel==iCacheLevel ); sqlite3VdbeResolveLabel(v, endLabel); break; } #ifndef SQLITE_OMIT_TRIGGER case TK_RAISE: { - assert( pExpr->affinity==OE_Rollback + assert( pExpr->affinity==OE_Rollback || pExpr->affinity==OE_Abort || pExpr->affinity==OE_Fail || pExpr->affinity==OE_Ignore @@ -4013,8 +4013,8 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ ** Factor out the code of the given expression to initialization time. ** ** If regDest>=0 then the result is always stored in that register and the -** result is not reusable. If regDest<0 then this routine is free to -** store the value whereever it wants. The register where the expression +** result is not reusable. If regDest<0 then this routine is free to +** store the value whereever it wants. The register where the expression ** is stored is returned. When regDest<0, two identical expressions will ** code to the same register. */ @@ -4136,7 +4136,7 @@ void sqlite3ExprCodeFactorable(Parse *pParse, Expr *pExpr, int target){ ** and modify the expression so that the next time it is evaluated, ** the result is a copy of the cache register. ** -** This routine is used for expressions that are used multiple +** This routine is used for expressions that are used multiple ** times. They are evaluated once and the results of the expression ** are reused. */ @@ -4219,7 +4219,7 @@ int sqlite3ExprCodeExprList( ** ** x BETWEEN y AND z ** -** The above is equivalent to +** The above is equivalent to ** ** x>=y AND x<=z ** @@ -4414,7 +4414,7 @@ void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){ } } sqlite3ReleaseTempReg(pParse, regFree1); - sqlite3ReleaseTempReg(pParse, regFree2); + sqlite3ReleaseTempReg(pParse, regFree2); } /* @@ -4552,7 +4552,7 @@ void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){ } #endif default: { - default_expr: + default_expr: if( exprAlwaysFalse(pExpr) ){ sqlite3VdbeGoto(v, dest); }else if( exprAlwaysTrue(pExpr) ){ @@ -4644,7 +4644,7 @@ int sqlite3ExprCompare(Expr *pA, Expr *pB, int iTab){ if( sqlite3ExprListCompare(pA->x.pList, pB->x.pList, iTab) ) return 2; if( ALWAYS((combinedFlags & EP_Reduced)==0) && pA->op!=TK_STRING ){ if( pA->iColumn!=pB->iColumn ) return 2; - if( pA->iTable!=pB->iTable + if( pA->iTable!=pB->iTable && (pA->iTable!=iTab || NEVER(pB->iTable>=0)) ) return 2; } } @@ -4652,7 +4652,7 @@ int sqlite3ExprCompare(Expr *pA, Expr *pB, int iTab){ } /* -** Compare two ExprList objects. Return 0 if they are identical and +** Compare two ExprList objects. Return 0 if they are identical and ** non-zero if they differ in any way. ** ** If any subelement of pB has Expr.iTable==(-1) then it is allowed @@ -4731,7 +4731,7 @@ struct IdxCover { }; /* -** Check to see if there are references to columns in table +** Check to see if there are references to columns in table ** pWalker->u.pIdxCover->iCur can be satisfied using the index ** pWalker->u.pIdxCover->pIdx. */ @@ -4775,7 +4775,7 @@ int sqlite3ExprCoveredByIndex( /* ** An instance of the following structure is used by the tree walker -** to count references to table columns in the arguments of an +** to count references to table columns in the arguments of an ** aggregate function, in order to implement the ** sqlite3FunctionThisSrc() routine. */ @@ -4845,7 +4845,7 @@ static int addAggInfoColumn(sqlite3 *db, AggInfo *pInfo){ &i ); return i; -} +} /* ** Add a new element to the pAggInfo->aFunc[] array. Return the index of @@ -4854,14 +4854,14 @@ static int addAggInfoColumn(sqlite3 *db, AggInfo *pInfo){ static int addAggInfoFunc(sqlite3 *db, AggInfo *pInfo){ int i; pInfo->aFunc = sqlite3ArrayAllocate( - db, + db, pInfo->aFunc, sizeof(pInfo->aFunc[0]), &pInfo->nFunc, &i ); return i; -} +} /* ** This is the xExprCallback for a tree walker. It is used to @@ -4889,7 +4889,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){ assert( !ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced) ); if( pExpr->iTable==pItem->iCursor ){ /* If we reach this point, it means that pExpr refers to a table - ** that is in the FROM clause of the aggregate query. + ** that is in the FROM clause of the aggregate query. ** ** Make an entry for the column in pAggInfo->aCol[] if there ** is not an entry there already. @@ -4903,7 +4903,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){ } } if( (k>=pAggInfo->nColumn) - && (k = addAggInfoColumn(pParse->db, pAggInfo))>=0 + && (k = addAggInfoColumn(pParse->db, pAggInfo))>=0 ){ pCol = &pAggInfo->aCol[k]; pCol->pTab = pExpr->pTab; @@ -4949,7 +4949,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){ if( (pNC->ncFlags & NC_InAggFunc)==0 && pWalker->walkerDepth==pExpr->op2 ){ - /* Check to see if pExpr is a duplicate of another aggregate + /* Check to see if pExpr is a duplicate of another aggregate ** function that is already in the pAggInfo structure */ struct AggInfo_func *pItem = pAggInfo->aFunc; @@ -4970,7 +4970,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){ pItem->iMem = ++pParse->nMem; assert( !ExprHasProperty(pExpr, EP_IntValue) ); pItem->pFunc = sqlite3FindFunction(pParse->db, - pExpr->u.zToken, + pExpr->u.zToken, pExpr->x.pList ? pExpr->x.pList->nExpr : 0, enc, 0); if( pExpr->flags & EP_Distinct ){ pItem->iDistinct = pParse->nTab++; diff --git a/third_party/sqlite/src/src/fault.c b/third_party/sqlite/src/src/fault.c index 5b41b603639f3..500064f85b49f 100644 --- a/third_party/sqlite/src/src/fault.c +++ b/third_party/sqlite/src/src/fault.c @@ -10,17 +10,17 @@ ** ************************************************************************* ** -** This file contains code to support the concept of "benign" +** This file contains code to support the concept of "benign" ** malloc failures (when the xMalloc() or xRealloc() method of the ** sqlite3_mem_methods structure fails to allocate a block of memory -** and returns 0). +** and returns 0). ** ** Most malloc failures are non-benign. After they occur, SQLite ** abandons the current operation and returns an error code (usually ** SQLITE_NOMEM) to the user. However, sometimes a fault is not necessarily -** fatal. For example, if a malloc fails while resizing a hash table, this -** is completely recoverable simply by not carrying out the resize. The -** hash table will continue to function normally. So a malloc failure +** fatal. For example, if a malloc fails while resizing a hash table, this +** is completely recoverable simply by not carrying out the resize. The +** hash table will continue to function normally. So a malloc failure ** during a hash table resize is a benign fault. */ diff --git a/third_party/sqlite/src/src/fkey.c b/third_party/sqlite/src/src/fkey.c index cb78764f513a8..1fbe9185c081b 100644 --- a/third_party/sqlite/src/src/fkey.c +++ b/third_party/sqlite/src/src/fkey.c @@ -23,25 +23,25 @@ ** Foreign keys in SQLite come in two flavours: deferred and immediate. ** If an immediate foreign key constraint is violated, ** SQLITE_CONSTRAINT_FOREIGNKEY is returned and the current -** statement transaction rolled back. If a -** deferred foreign key constraint is violated, no action is taken -** immediately. However if the application attempts to commit the +** statement transaction rolled back. If a +** deferred foreign key constraint is violated, no action is taken +** immediately. However if the application attempts to commit the ** transaction before fixing the constraint violation, the attempt fails. ** ** Deferred constraints are implemented using a simple counter associated -** with the database handle. The counter is set to zero each time a -** database transaction is opened. Each time a statement is executed +** with the database handle. The counter is set to zero each time a +** database transaction is opened. Each time a statement is executed ** that causes a foreign key violation, the counter is incremented. Each ** time a statement is executed that removes an existing violation from ** the database, the counter is decremented. When the transaction is ** committed, the commit fails if the current value of the counter is ** greater than zero. This scheme has two big drawbacks: ** -** * When a commit fails due to a deferred foreign key constraint, +** * When a commit fails due to a deferred foreign key constraint, ** there is no way to tell which foreign constraint is not satisfied, ** or which row it is not satisfied for. ** -** * If the database contains foreign key violations when the +** * If the database contains foreign key violations when the ** transaction is opened, this may cause the mechanism to malfunction. ** ** Despite these problems, this approach is adopted as it seems simpler @@ -53,26 +53,26 @@ ** the parent table for a match. If none is found increment the ** constraint counter. ** -** I.2) For each FK for which the table is the parent table, +** I.2) For each FK for which the table is the parent table, ** search the child table for rows that correspond to the new ** row in the parent table. Decrement the counter for each row ** found (as the constraint is now satisfied). ** ** DELETE operations: ** -** D.1) For each FK for which the table is the child table, -** search the parent table for a row that corresponds to the -** deleted row in the child table. If such a row is not found, +** D.1) For each FK for which the table is the child table, +** search the parent table for a row that corresponds to the +** deleted row in the child table. If such a row is not found, ** decrement the counter. ** -** D.2) For each FK for which the table is the parent table, search -** the child table for rows that correspond to the deleted row +** D.2) For each FK for which the table is the parent table, search +** the child table for rows that correspond to the deleted row ** in the parent table. For each found increment the counter. ** ** UPDATE operations: ** ** An UPDATE command requires that all 4 steps above are taken, but only -** for FK constraints for which the affected columns are actually +** for FK constraints for which the affected columns are actually ** modified (values must be compared at runtime). ** ** Note that I.1 and D.1 are very similar operations, as are I.2 and D.2. @@ -81,10 +81,10 @@ ** For the purposes of immediate FK constraints, the OR REPLACE conflict ** resolution is considered to delete rows before the new row is inserted. ** If a delete caused by OR REPLACE violates an FK constraint, an exception -** is thrown, even if the FK constraint would be satisfied after the new +** is thrown, even if the FK constraint would be satisfied after the new ** row is inserted. ** -** Immediate constraints are usually handled similarly. The only difference +** Immediate constraints are usually handled similarly. The only difference ** is that the counter used is stored as part of each individual statement ** object (struct Vdbe). If, after the statement has run, its immediate ** constraint counter is greater than zero, @@ -95,7 +95,7 @@ ** INSERT violates a foreign key constraint. This is necessary as such ** an INSERT does not open a statement transaction. ** -** TODO: How should dropping a table be handled? How should renaming a +** TODO: How should dropping a table be handled? How should renaming a ** table be handled? ** ** @@ -106,7 +106,7 @@ ** for those two operations needs to know whether or not the operation ** requires any FK processing and, if so, which columns of the original ** row are required by the FK processing VDBE code (i.e. if FKs were -** implemented using triggers, which of the old.* columns would be +** implemented using triggers, which of the old.* columns would be ** accessed). No information is required by the code-generator before ** coding an INSERT operation. The functions used by the UPDATE/DELETE ** generation code to query for this information are: @@ -143,13 +143,13 @@ /* ** A foreign key constraint requires that the key columns in the parent ** table are collectively subject to a UNIQUE or PRIMARY KEY constraint. -** Given that pParent is the parent table for foreign key constraint pFKey, -** search the schema for a unique index on the parent key columns. +** Given that pParent is the parent table for foreign key constraint pFKey, +** search the schema for a unique index on the parent key columns. +** +** If successful, zero is returned. If the parent key is an INTEGER PRIMARY +** KEY column, then output variable *ppIdx is set to NULL. Otherwise, *ppIdx +** is set to point to the unique index. ** -** If successful, zero is returned. If the parent key is an INTEGER PRIMARY -** KEY column, then output variable *ppIdx is set to NULL. Otherwise, *ppIdx -** is set to point to the unique index. -** ** If the parent key consists of a single column (the foreign key constraint ** is not a composite foreign key), output variable *paiCol is set to NULL. ** Otherwise, it is set to point to an allocated array of size N, where @@ -172,8 +172,8 @@ ** PRIMARY KEY, or ** ** 4) No parent key columns were provided explicitly as part of the -** foreign key definition, and the PRIMARY KEY of the parent table -** consists of a different number of columns to the child key in +** foreign key definition, and the PRIMARY KEY of the parent table +** consists of a different number of columns to the child key in ** the child table. ** ** then non-zero is returned, and a "foreign key mismatch" error loaded @@ -197,9 +197,9 @@ int sqlite3FkLocateIndex( assert( !paiCol || *paiCol==0 ); assert( pParse ); - /* If this is a non-composite (single column) foreign key, check if it - ** maps to the INTEGER PRIMARY KEY of table pParent. If so, leave *ppIdx - ** and *paiCol set to zero and return early. + /* If this is a non-composite (single column) foreign key, check if it + ** maps to the INTEGER PRIMARY KEY of table pParent. If so, leave *ppIdx + ** and *paiCol set to zero and return early. ** ** Otherwise, for a composite foreign key (more than one column), allocate ** space for the aiCol array (returned via output parameter *paiCol). @@ -208,7 +208,7 @@ int sqlite3FkLocateIndex( if( nCol==1 ){ /* The FK maps to the IPK if any of the following are true: ** - ** 1) There is an INTEGER PRIMARY KEY column and the FK is implicitly + ** 1) There is an INTEGER PRIMARY KEY column and the FK is implicitly ** mapped to the primary key of table pParent, or ** 2) The FK is explicitly mapped to a column declared as INTEGER ** PRIMARY KEY. @@ -225,14 +225,14 @@ int sqlite3FkLocateIndex( } for(pIdx=pParent->pIndex; pIdx; pIdx=pIdx->pNext){ - if( pIdx->nKeyCol==nCol && IsUniqueIndex(pIdx) && pIdx->pPartIdxWhere==0 ){ + if( pIdx->nKeyCol==nCol && IsUniqueIndex(pIdx) && pIdx->pPartIdxWhere==0 ){ /* pIdx is a UNIQUE index (or a PRIMARY KEY) and has the right number ** of columns. If each indexed column corresponds to a foreign key ** column of pFKey, then this index is a winner. */ if( zKey==0 ){ - /* If zKey is NULL, then this foreign key is implicitly mapped to - ** the PRIMARY KEY of table pParent. The PRIMARY KEY index may be + /* If zKey is NULL, then this foreign key is implicitly mapped to + ** the PRIMARY KEY of table pParent. The PRIMARY KEY index may be ** identified by the test. */ if( IsPrimaryKeyIndex(pIdx) ){ if( aiCol ){ @@ -290,15 +290,15 @@ int sqlite3FkLocateIndex( } /* -** This function is called when a row is inserted into or deleted from the -** child table of foreign key constraint pFKey. If an SQL UPDATE is executed +** This function is called when a row is inserted into or deleted from the +** child table of foreign key constraint pFKey. If an SQL UPDATE is executed ** on the child table of pFKey, this function is invoked twice for each row ** affected - once to "delete" the old row, and then again to "insert" the ** new row. ** ** Each time it is called, this function generates VDBE code to locate the -** row in the parent table that corresponds to the row being inserted into -** or deleted from the child table. If the parent row can be found, no +** row in the parent table that corresponds to the row being inserted into +** or deleted from the child table. If the parent row can be found, no ** special action is taken. Otherwise, if the parent row can *not* be ** found in the parent table: ** @@ -312,7 +312,7 @@ int sqlite3FkLocateIndex( ** ** DELETE deferred Decrement the "deferred constraint counter". ** -** These operations are identified in the comment at the top of this file +** These operations are identified in the comment at the top of this file ** (fkey.c) as "I.1" and "D.1". */ static void fkLookupParent( @@ -335,8 +335,8 @@ static void fkLookupParent( ** outstanding constraints to resolve. If there are not, there is no need ** to check if deleting this row resolves any outstanding violations. ** - ** Check if any of the key columns in the child table row are NULL. If - ** any are, then the constraint is considered satisfied. No need to + ** Check if any of the key columns in the child table row are NULL. If + ** any are, then the constraint is considered satisfied. No need to ** search for a matching row in the parent table. */ if( nIncr<0 ){ sqlite3VdbeAddOp2(v, OP_FkIfZero, pFKey->isDeferred, iOk); @@ -353,8 +353,8 @@ static void fkLookupParent( ** column of the parent table (table pTab). */ int iMustBeInt; /* Address of MustBeInt instruction */ int regTemp = sqlite3GetTempReg(pParse); - - /* Invoke MustBeInt to coerce the child key value to an integer (i.e. + + /* Invoke MustBeInt to coerce the child key value to an integer (i.e. ** apply the affinity of the parent key). If this fails, then there ** is no matching parent key. Before using MustBeInt, make a copy of ** the value. Otherwise, the value inserted into the child key column @@ -362,7 +362,7 @@ static void fkLookupParent( sqlite3VdbeAddOp2(v, OP_SCopy, aiCol[0]+1+regData, regTemp); iMustBeInt = sqlite3VdbeAddOp2(v, OP_MustBeInt, regTemp, 0); VdbeCoverage(v); - + /* If the parent table is the same as the child table, and we are about ** to increment the constraint-counter (i.e. this is an INSERT operation), ** then check if the row being inserted matches itself. If so, do not @@ -371,7 +371,7 @@ static void fkLookupParent( sqlite3VdbeAddOp3(v, OP_Eq, regData, iOk, regTemp); VdbeCoverage(v); sqlite3VdbeChangeP5(v, SQLITE_NOTNULL); } - + sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenRead); sqlite3VdbeAddOp3(v, OP_NotExists, iCur, 0, regTemp); VdbeCoverage(v); sqlite3VdbeGoto(v, iOk); @@ -382,19 +382,19 @@ static void fkLookupParent( int nCol = pFKey->nCol; int regTemp = sqlite3GetTempRange(pParse, nCol); int regRec = sqlite3GetTempReg(pParse); - + sqlite3VdbeAddOp3(v, OP_OpenRead, iCur, pIdx->tnum, iDb); sqlite3VdbeSetP4KeyInfo(pParse, pIdx); for(i=0; idb,pIdx), nCol); sqlite3VdbeAddOp4Int(v, OP_Found, iCur, iOk, regRec, 0); VdbeCoverage(v); - + sqlite3ReleaseTempReg(pParse, regRec); sqlite3ReleaseTempRange(pParse, regTemp, nCol); } } if( !pFKey->isDeferred && !(pParse->db->flags & SQLITE_DeferFKs) - && !pParse->pToplevel - && !pParse->isMultiWrite + && !pParse->pToplevel + && !pParse->isMultiWrite ){ /* Special case: If this is an INSERT statement that will insert exactly ** one row into the table, raise a constraint immediately instead of @@ -505,7 +505,7 @@ static Expr *exprTableColumn( /* ** This function is called to generate code executed when a row is deleted -** from the parent table of foreign key constraint pFKey and, if pFKey is +** from the parent table of foreign key constraint pFKey and, if pFKey is ** deferred, when a row is inserted into the same table. When generating ** code for an SQL UPDATE operation, this function may be called twice - ** once to "delete" the old row and once to "insert" the new row. @@ -532,7 +532,7 @@ static Expr *exprTableColumn( ** ** INSERT deferred Decrement the "deferred constraint counter". ** -** These operations are identified in the comment at the top of this file +** These operations are identified in the comment at the top of this file ** (fkey.c) as "I.2" and "D.2". */ static void fkScanChildren( @@ -575,7 +575,7 @@ static void fkScanChildren( Expr *pLeft; /* Value from parent table row */ Expr *pRight; /* Column ref to child table */ Expr *pEq; /* Expression (pLeft = pRight) */ - i16 iCol; /* Index of column in child table */ + i16 iCol; /* Index of column in child table */ const char *zCol; /* Name of column in child table */ iCol = pIdx ? pIdx->aiColumn[i] : -1; @@ -665,7 +665,7 @@ FKey *sqlite3FkReferences(Table *pTab){ } /* -** The second argument is a Trigger structure allocated by the +** The second argument is a Trigger structure allocated by the ** fkActionTrigger() routine. This function deletes the Trigger structure ** and all of its sub-components. ** @@ -693,7 +693,7 @@ static void fkTriggerDelete(sqlite3 *dbMem, Trigger *p){ ** ** (a) The table is the parent table of a FK constraint, or ** (b) The table is the child table of a deferred FK constraint and it is -** determined at runtime that there are outstanding deferred FK +** determined at runtime that there are outstanding deferred FK ** constraint violations in the database, ** ** then the equivalent of "DELETE FROM " is executed before dropping @@ -709,7 +709,7 @@ void sqlite3FkDropTable(Parse *pParse, SrcList *pName, Table *pTab){ assert( v ); /* VDBE has already been allocated */ if( sqlite3FkReferences(pTab)==0 ){ /* Search for a deferred foreign key constraint for which this table - ** is the child table. If one cannot be found, return without + ** is the child table. If one cannot be found, return without ** generating any VDBE code. If one can be found, then jump over ** the entire DELETE if there are no outstanding deferred constraints ** when this statement is run. */ @@ -726,10 +726,10 @@ void sqlite3FkDropTable(Parse *pParse, SrcList *pName, Table *pTab){ sqlite3DeleteFrom(pParse, sqlite3SrcListDup(db, pName, 0), 0); pParse->disableTriggers = 0; - /* If the DELETE has generated immediate foreign key constraint + /* If the DELETE has generated immediate foreign key constraint ** violations, halt the VDBE and return an error at this point, before ** any modifications to the schema are made. This is because statement - ** transactions are not able to rollback schema changes. + ** transactions are not able to rollback schema changes. ** ** If the SQLITE_DeferFKs flag is set, then this is not required, as ** the statement transaction will not be rolled back even if FK @@ -752,7 +752,7 @@ void sqlite3FkDropTable(Parse *pParse, SrcList *pName, Table *pTab){ /* ** The second argument points to an FKey object representing a foreign key ** for which pTab is the child table. An UPDATE statement against pTab -** is currently being processed. For each column of the table that is +** is currently being processed. For each column of the table that is ** actually updated, the corresponding element in the aChange[] array ** is zero or greater (if a column is unmodified the corresponding element ** is set to -1). If the rowid column is modified by the UPDATE statement @@ -779,7 +779,7 @@ static int fkChildIsModified( /* ** The second argument points to an FKey object representing a foreign key ** for which pTab is the parent table. An UPDATE statement against pTab -** is currently being processed. For each column of the table that is +** is currently being processed. For each column of the table that is ** actually updated, the corresponding element in the aChange[] array ** is zero or greater (if a column is unmodified the corresponding element ** is set to -1). If the rowid column is modified by the UPDATE statement @@ -789,9 +789,9 @@ static int fkChildIsModified( ** parent key for FK constraint *p are modified. */ static int fkParentIsModified( - Table *pTab, - FKey *p, - int *aChange, + Table *pTab, + FKey *p, + int *aChange, int bChngRowid ){ int i; @@ -832,7 +832,7 @@ static int isSetNullAction(Parse *pParse, FKey *pFKey){ /* ** This function is called when inserting, deleting or updating a row of -** table pTab to generate VDBE code to perform foreign key constraint +** table pTab to generate VDBE code to perform foreign key constraint ** processing for the operation. ** ** For a DELETE operation, parameter regOld is passed the index of the @@ -848,11 +848,11 @@ static int isSetNullAction(Parse *pParse, FKey *pFKey){ ** For an UPDATE operation, this function is called twice. Once before ** the original record is deleted from the table using the calling convention ** described for DELETE. Then again after the original record is deleted -** but before the new record is inserted using the INSERT convention. +** but before the new record is inserted using the INSERT convention. */ void sqlite3FkCheck( Parse *pParse, /* Parse context */ - Table *pTab, /* Row is being deleted from this table */ + Table *pTab, /* Row is being deleted from this table */ int regOld, /* Previous row data is stored here */ int regNew, /* New row data is stored here */ int *aChange, /* Array indicating UPDATEd columns (or 0) */ @@ -884,16 +884,16 @@ void sqlite3FkCheck( int i; int bIgnore = 0; - if( aChange + if( aChange && sqlite3_stricmp(pTab->zName, pFKey->zTo)!=0 - && fkChildIsModified(pTab, pFKey, aChange, bChngRowid)==0 + && fkChildIsModified(pTab, pFKey, aChange, bChngRowid)==0 ){ continue; } - /* Find the parent table of this foreign key. Also find a unique index - ** on the parent key columns in the parent table. If either of these - ** schema items cannot be located, set an error in pParse and return + /* Find the parent table of this foreign key. Also find a unique index + ** on the parent key columns in the parent table. If either of these + ** schema items cannot be located, set an error in pParse and return ** early. */ if( pParse->disableTriggers ){ pTo = sqlite3FindTable(db, pFKey->zTo, zDb); @@ -935,7 +935,7 @@ void sqlite3FkCheck( } assert( pIdx==0 || pIdx->aiColumn[i]>=0 ); #ifndef SQLITE_OMIT_AUTHORIZATION - /* Request permission to read the parent key columns. If the + /* Request permission to read the parent key columns. If the ** authorization callback returns SQLITE_IGNORE, behave as if any ** values read from the parent table are NULL. */ if( db->xAuth ){ @@ -947,24 +947,24 @@ void sqlite3FkCheck( #endif } - /* Take a shared-cache advisory read-lock on the parent table. Allocate - ** a cursor to use to search the unique index on the parent key columns + /* Take a shared-cache advisory read-lock on the parent table. Allocate + ** a cursor to use to search the unique index on the parent key columns ** in the parent table. */ sqlite3TableLock(pParse, iDb, pTo->tnum, 0, pTo->zName); pParse->nTab++; if( regOld!=0 ){ /* A row is being removed from the child table. Search for the parent. - ** If the parent does not exist, removing the child row resolves an + ** If the parent does not exist, removing the child row resolves an ** outstanding foreign key constraint violation. */ fkLookupParent(pParse, iDb, pTo, pIdx, pFKey, aiCol, regOld, -1, bIgnore); } if( regNew!=0 && !isSetNullAction(pParse, pFKey) ){ /* A row is being added to the child table. If a parent row cannot - ** be found, adding the child row has violated the FK constraint. + ** be found, adding the child row has violated the FK constraint. ** ** If this operation is being performed as part of a trigger program - ** that is actually a "SET NULL" action belonging to this very + ** that is actually a "SET NULL" action belonging to this very ** foreign key, then omit this scan altogether. As all child key ** values are guaranteed to be NULL, it is not possible for adding ** this row to cause an FK violation. */ @@ -985,8 +985,8 @@ void sqlite3FkCheck( continue; } - if( !pFKey->isDeferred && !(db->flags & SQLITE_DeferFKs) - && !pParse->pToplevel && !pParse->isMultiWrite + if( !pFKey->isDeferred && !(db->flags & SQLITE_DeferFKs) + && !pParse->pToplevel && !pParse->isMultiWrite ){ assert( regOld==0 && regNew!=0 ); /* Inserting a single row into a parent table cannot cause (or fix) @@ -1009,7 +1009,7 @@ void sqlite3FkCheck( pItem->zName = pFKey->pFrom->zName; pItem->pTab->nTabRef++; pItem->iCursor = pParse->nTab++; - + if( regNew!=0 ){ fkScanChildren(pParse, pSrc, pTab, pIdx, pFKey, aiCol, regNew, -1); } @@ -1028,10 +1028,10 @@ void sqlite3FkCheck( ** ** Note 2: At first glance it may seem like SQLite could simply omit ** all OP_FkCounter related scans when either CASCADE or SET NULL - ** applies. The trouble starts if the CASCADE or SET NULL action - ** trigger causes other triggers or action rules attached to the + ** applies. The trouble starts if the CASCADE or SET NULL action + ** trigger causes other triggers or action rules attached to the ** child table to fire. In these cases the fk constraint counters - ** might be set incorrectly if any OP_FkCounter related scans are + ** might be set incorrectly if any OP_FkCounter related scans are ** omitted. */ if( !pFKey->isDeferred && eAction!=OE_Cascade && eAction!=OE_SetNull ){ sqlite3MayAbort(pParse); @@ -1047,7 +1047,7 @@ void sqlite3FkCheck( #define COLUMN_MASK(x) (((x)>31) ? 0xffffffff : ((u32)1<<(x))) /* -** This function is called before generating code to update or delete a +** This function is called before generating code to update or delete a ** row contained in table pTab. */ u32 sqlite3FkOldmask( @@ -1077,17 +1077,17 @@ u32 sqlite3FkOldmask( /* -** This function is called before generating code to update or delete a +** This function is called before generating code to update or delete a ** row contained in table pTab. If the operation is a DELETE, then ** parameter aChange is passed a NULL value. For an UPDATE, aChange points ** to an array of size N, where N is the number of columns in table pTab. -** If the i'th column is not modified by the UPDATE, then the corresponding +** If the i'th column is not modified by the UPDATE, then the corresponding ** entry in the aChange[] array is set to -1. If the column is modified, ** the value is 0 or greater. Parameter chngRowid is set to true if the ** UPDATE statement modifies the rowid fields of the table. ** ** If any foreign key processing will be required, this function returns -** true. If there is no foreign key related processing, this function +** true. If there is no foreign key related processing, this function ** returns false. */ int sqlite3FkRequired( @@ -1098,8 +1098,8 @@ int sqlite3FkRequired( ){ if( pParse->db->flags&SQLITE_ForeignKeys ){ if( !aChange ){ - /* A DELETE operation. Foreign key processing is required if the - ** table in question is either the child or parent table for any + /* A DELETE operation. Foreign key processing is required if the + ** table in question is either the child or parent table for any ** foreign key constraint. */ return (sqlite3FkReferences(pTab) || pTab->pFKey); }else{ @@ -1122,7 +1122,7 @@ int sqlite3FkRequired( } /* -** This function is called when an UPDATE or DELETE operation is being +** This function is called when an UPDATE or DELETE operation is being ** compiled on table pTab, which is the parent table of foreign-key pFKey. ** If the current operation is an UPDATE, then the pChanges parameter is ** passed a pointer to the list of columns being modified. If it is a @@ -1134,7 +1134,7 @@ int sqlite3FkRequired( ** returned (these actions require no special handling by the triggers ** sub-system, code for them is created by fkScanChildren()). ** -** For example, if pFKey is the foreign key and pTab is table "p" in +** For example, if pFKey is the foreign key and pTab is table "p" in ** the following schema: ** ** CREATE TABLE p(pk PRIMARY KEY); @@ -1147,7 +1147,7 @@ int sqlite3FkRequired( ** END; ** ** The returned pointer is cached as part of the foreign key object. It -** is eventually freed along with the rest of the foreign key object by +** is eventually freed along with the rest of the foreign key object by ** sqlite3FkDelete(). */ static Trigger *fkActionTrigger( @@ -1203,7 +1203,7 @@ static Trigger *fkActionTrigger( ** that the affinity and collation sequence associated with the ** parent table are used for the comparison. */ pEq = sqlite3PExpr(pParse, TK_EQ, - sqlite3PExpr(pParse, TK_DOT, + sqlite3PExpr(pParse, TK_DOT, sqlite3ExprAlloc(db, TK_ID, &tOld, 0), sqlite3ExprAlloc(db, TK_ID, &tToCol, 0)), sqlite3ExprAlloc(db, TK_ID, &tFromCol, 0) @@ -1217,20 +1217,20 @@ static Trigger *fkActionTrigger( */ if( pChanges ){ pEq = sqlite3PExpr(pParse, TK_IS, - sqlite3PExpr(pParse, TK_DOT, + sqlite3PExpr(pParse, TK_DOT, sqlite3ExprAlloc(db, TK_ID, &tOld, 0), sqlite3ExprAlloc(db, TK_ID, &tToCol, 0)), - sqlite3PExpr(pParse, TK_DOT, + sqlite3PExpr(pParse, TK_DOT, sqlite3ExprAlloc(db, TK_ID, &tNew, 0), sqlite3ExprAlloc(db, TK_ID, &tToCol, 0)) ); pWhen = sqlite3ExprAnd(db, pWhen, pEq); } - + if( action!=OE_Restrict && (action!=OE_Cascade || pChanges) ){ Expr *pNew; if( action==OE_Cascade ){ - pNew = sqlite3PExpr(pParse, TK_DOT, + pNew = sqlite3PExpr(pParse, TK_DOT, sqlite3ExprAlloc(db, TK_ID, &tNew, 0), sqlite3ExprAlloc(db, TK_ID, &tToCol, 0)); }else if( action==OE_SetDflt ){ @@ -1254,7 +1254,7 @@ static Trigger *fkActionTrigger( if( action==OE_Restrict ){ Token tFrom; - Expr *pRaise; + Expr *pRaise; tFrom.z = zFrom; tFrom.n = nFrom; @@ -1262,7 +1262,7 @@ static Trigger *fkActionTrigger( if( pRaise ){ pRaise->affinity = OE_Abort; } - pSelect = sqlite3SelectNew(pParse, + pSelect = sqlite3SelectNew(pParse, sqlite3ExprListAppend(pParse, 0, pRaise), sqlite3SrcListAppend(db, 0, &tFrom, 0), pWhere, @@ -1274,7 +1274,7 @@ static Trigger *fkActionTrigger( /* Disable lookaside memory allocation */ db->lookaside.bDisable++; - pTrigger = (Trigger *)sqlite3DbMallocZero(db, + pTrigger = (Trigger *)sqlite3DbMallocZero(db, sizeof(Trigger) + /* struct Trigger */ sizeof(TriggerStep) + /* Single step in trigger program */ nFrom + 1 /* Space for pStep->zTarget */ @@ -1283,7 +1283,7 @@ static Trigger *fkActionTrigger( pStep = pTrigger->step_list = (TriggerStep *)&pTrigger[1]; pStep->zTarget = (char *)&pStep[1]; memcpy((char *)pStep->zTarget, zFrom, nFrom); - + pStep->pWhere = sqlite3ExprDup(db, pWhere, EXPRDUP_REDUCE); pStep->pExprList = sqlite3ExprListDup(db, pList, EXPRDUP_REDUCE); pStep->pSelect = sqlite3SelectDup(db, pSelect, EXPRDUP_REDUCE); @@ -1308,12 +1308,12 @@ static Trigger *fkActionTrigger( switch( action ){ case OE_Restrict: - pStep->op = TK_SELECT; + pStep->op = TK_SELECT; break; - case OE_Cascade: - if( !pChanges ){ - pStep->op = TK_DELETE; - break; + case OE_Cascade: + if( !pChanges ){ + pStep->op = TK_DELETE; + break; } default: pStep->op = TK_UPDATE; @@ -1340,9 +1340,9 @@ void sqlite3FkActions( int *aChange, /* Array indicating UPDATEd columns (or 0) */ int bChngRowid /* True if rowid is UPDATEd */ ){ - /* If foreign-key support is enabled, iterate through all FKs that - ** refer to table pTab. If there is an action associated with the FK - ** for this operation (either update or delete), invoke the associated + /* If foreign-key support is enabled, iterate through all FKs that + ** refer to table pTab. If there is an action associated with the FK + ** for this operation (either update or delete), invoke the associated ** trigger sub-program. */ if( pParse->db->flags&SQLITE_ForeignKeys ){ FKey *pFKey; /* Iterator variable */ diff --git a/third_party/sqlite/src/src/func.c b/third_party/sqlite/src/src/func.c index 885725bc6b475..8865c6b314389 100644 --- a/third_party/sqlite/src/src/func.c +++ b/third_party/sqlite/src/src/func.c @@ -130,7 +130,7 @@ static void lengthFunc( ** Implementation of the abs() function. ** ** IMP: R-23979-26855 The abs(X) function returns the absolute value of -** the numeric argument X. +** the numeric argument X. */ static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ assert( argc==1 ); @@ -147,7 +147,7 @@ static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ return; } iVal = -iVal; - } + } sqlite3_result_int64(context, iVal); break; } @@ -471,7 +471,7 @@ static void lowerFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ #define noopFunc versionFunc /* Substitute function - never called */ /* -** Implementation of random(). Return a random integer. +** Implementation of random(). Return a random integer. */ static void randomFunc( sqlite3_context *context, @@ -482,11 +482,11 @@ static void randomFunc( UNUSED_PARAMETER2(NotUsed, NotUsed2); sqlite3_randomness(sizeof(r), &r); if( r<0 ){ - /* We need to prevent a random number of 0x8000000000000000 + /* We need to prevent a random number of 0x8000000000000000 ** (or -9223372036854775808) since when you do abs() of that ** number of you get the same value back again. To do this ** in a way that is testable, mask the sign bit off of negative - ** values, resulting in a positive value. Then take the + ** values, resulting in a positive value. Then take the ** 2s complement of that positive value. The end result can ** therefore be no less than -9223372036854775807. */ @@ -524,8 +524,8 @@ static void randomBlob( ** value is the same as the sqlite3_last_insert_rowid() API function. */ static void last_insert_rowid( - sqlite3_context *context, - int NotUsed, + sqlite3_context *context, + int NotUsed, sqlite3_value **NotUsed2 ){ sqlite3 *db = sqlite3_context_db_handle(context); @@ -633,7 +633,7 @@ static const struct compareInfo likeInfoAlt = { '%', '_', 0, 0 }; ** it the last character in the list. ** ** Like matching rules: -** +** ** '%' Matches any sequence of zero or more characters ** *** '_' Matches any one character @@ -656,7 +656,7 @@ static int patternCompare( u32 matchAll = pInfo->matchAll; /* "*" or "%" */ u8 noCase = pInfo->noCase; /* True if uppercase==lowercase */ const u8 *zEscaped = 0; /* One past the last escaped input char */ - + while( (c = Utf8Read(zPattern))!=0 ){ if( c==matchAll ){ /* Match "*" */ /* Skip over multiple "*" characters in the pattern. If there @@ -808,8 +808,8 @@ int sqlite3_like_count = 0; ** the GLOB operator. */ static void likeFunc( - sqlite3_context *context, - int argc, + sqlite3_context *context, + int argc, sqlite3_value **argv ){ const unsigned char *zA, *zB; @@ -851,7 +851,7 @@ static void likeFunc( const unsigned char *zEsc = sqlite3_value_text(argv[2]); if( zEsc==0 ) return; if( sqlite3Utf8CharLen((char*)zEsc, -1)!=1 ){ - sqlite3_result_error(context, + sqlite3_result_error(context, "ESCAPE expression must be a single character", -1); return; } @@ -955,8 +955,8 @@ static void compileoptionusedFunc( #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ /* -** Implementation of the sqlite_compileoption_get() function. -** The result is a string that identifies the compiler options +** Implementation of the sqlite_compileoption_get() function. +** The result is a string that identifies the compiler options ** used to build SQLite. */ #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS @@ -980,7 +980,7 @@ static void compileoptiongetFunc( ** digits. */ static const char hexdigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' + '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; /* @@ -1015,7 +1015,7 @@ static void quoteFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ char const *zBlob = sqlite3_value_blob(argv[0]); int nBlob = sqlite3_value_bytes(argv[0]); assert( zBlob==sqlite3_value_blob(argv[0]) ); /* No encoding change */ - zText = (char *)contextMalloc(context, (2*(i64)nBlob)+4); + zText = (char *)contextMalloc(context, (2*(i64)nBlob)+4); if( zText ){ int i; for(i=0; in>0x7fffffff || p->n==sqlite3_aggregate_count(context) ); #endif -} +} static void countFinalize(sqlite3_context *context){ CountCtx *p; p = sqlite3_aggregate_context(context, 0); @@ -1558,8 +1558,8 @@ static void countFinalize(sqlite3_context *context){ ** Routines to implement min() and max() aggregate functions. */ static void minmaxStep( - sqlite3_context *context, - int NotUsed, + sqlite3_context *context, + int NotUsed, sqlite3_value **argv ){ Mem *pArg = (Mem *)argv[0]; @@ -1649,8 +1649,8 @@ static void groupConcatFinalize(sqlite3_context *context){ sqlite3_result_error_toobig(context); }else if( pAccum->accError==STRACCUM_NOMEM ){ sqlite3_result_error_nomem(context); - }else{ - sqlite3_result_text(context, sqlite3StrAccumFinish(pAccum), -1, + }else{ + sqlite3_result_text(context, sqlite3StrAccumFinish(pAccum), -1, sqlite3_free); } } @@ -1694,10 +1694,10 @@ void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive){ } sqlite3CreateFunc(db, "like", 2, SQLITE_UTF8, pInfo, likeFunc, 0, 0, 0); sqlite3CreateFunc(db, "like", 3, SQLITE_UTF8, pInfo, likeFunc, 0, 0, 0); - sqlite3CreateFunc(db, "glob", 2, SQLITE_UTF8, + sqlite3CreateFunc(db, "glob", 2, SQLITE_UTF8, (struct compareInfo*)&globInfo, likeFunc, 0, 0, 0); setLikeOptFlag(db, "glob", SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE); - setLikeOptFlag(db, "like", + setLikeOptFlag(db, "like", caseSensitive ? (SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE) : SQLITE_FUNC_LIKE); } @@ -1715,8 +1715,8 @@ void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive){ */ int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){ FuncDef *pDef; - if( pExpr->op!=TK_FUNCTION - || !pExpr->x.pList + if( pExpr->op!=TK_FUNCTION + || !pExpr->x.pList || pExpr->x.pList->nExpr!=2 ){ return 0; @@ -1829,7 +1829,7 @@ void sqlite3RegisterBuiltinFunctions(void){ AGGREGATE(count, 1, 0, 0, countStep, countFinalize ), AGGREGATE(group_concat, 1, 0, 0, groupConcatStep, groupConcatFinalize), AGGREGATE(group_concat, 2, 0, 0, groupConcatStep, groupConcatFinalize), - + LIKEFUNC(glob, 2, &globInfo, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE), #ifdef SQLITE_CASE_SENSITIVE_LIKE LIKEFUNC(like, 2, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE), diff --git a/third_party/sqlite/src/src/global.c b/third_party/sqlite/src/src/global.c index a105135561b61..60b225f83b1b3 100644 --- a/third_party/sqlite/src/src/global.c +++ b/third_party/sqlite/src/src/global.c @@ -15,7 +15,7 @@ #include "sqliteInt.h" /* An array to map all upper-case characters into their corresponding -** lower-case character. +** lower-case character. ** ** SQLite only considers US-ASCII (or EBCDIC) characters. We do not ** handle case conversions for the UTF character set since the tables @@ -82,7 +82,7 @@ const unsigned char sqlite3UpperToLower[] = { ** The equivalent of tolower() is implemented using the sqlite3UpperToLower[] ** array. tolower() is used more often than toupper() by SQLite. ** -** Bit 0x40 is set if the character is non-alphanumeric and can be used in an +** Bit 0x40 is set if the character is non-alphanumeric and can be used in an ** SQLite identifier. Identifiers are alphanumerics, "_", "$", and any ** non-ASCII UTF character. Hence the test for whether or not a character is ** part of an identifier is 0x46. @@ -165,7 +165,7 @@ const unsigned char sqlite3CtypeMap[256] = { ** if journal_mode=MEMORY or if temp_store=MEMORY, regardless of this ** setting.) */ -#ifndef SQLITE_STMTJRNL_SPILL +#ifndef SQLITE_STMTJRNL_SPILL # define SQLITE_STMTJRNL_SPILL (64*1024) #endif @@ -281,7 +281,7 @@ int sqlite3PendingByte = 0x40000000; ** Properties of opcodes. The OPFLG_INITIALIZER macro is ** created by mkopcodeh.awk during compilation. Data is obtained ** from the comments following the "case OP_xxxx:" statements in -** the vdbe.c file. +** the vdbe.c file. */ const unsigned char sqlite3OpcodeProperty[] = OPFLG_INITIALIZER; diff --git a/third_party/sqlite/src/src/hash.c b/third_party/sqlite/src/src/hash.c index 62b695a1bb344..2020a8fc903be 100644 --- a/third_party/sqlite/src/src/hash.c +++ b/third_party/sqlite/src/src/hash.c @@ -116,7 +116,7 @@ static int rehash(Hash *pH, unsigned int new_size){ /* The inability to allocates space for a larger hash table is ** a performance hit but it is not a fatal error. So mark the - ** allocation as a benign. Use sqlite3Malloc()/memset(0) instead of + ** allocation as a benign. Use sqlite3Malloc()/memset(0) instead of ** sqlite3MallocZero() to make the allocation, as sqlite3MallocZero() ** only zeroes the requested number of bytes whereas this module will ** use the actual amount of space allocated for the hash table (which @@ -166,7 +166,7 @@ static HashElem *findElementWithHash( *pHash = h; while( count-- ){ assert( elem!=0 ); - if( sqlite3StrICmp(elem->pKey,pKey)==0 ){ + if( sqlite3StrICmp(elem->pKey,pKey)==0 ){ return elem; } elem = elem->next; @@ -184,7 +184,7 @@ static void removeElementGivenHash( ){ struct _ht *pEntry; if( elem->prev ){ - elem->prev->next = elem->next; + elem->prev->next = elem->next; }else{ pH->first = elem->next; } diff --git a/third_party/sqlite/src/src/hash.h b/third_party/sqlite/src/src/hash.h index 90540eda50ebc..eaad0ba8487a3 100644 --- a/third_party/sqlite/src/src/hash.h +++ b/third_party/sqlite/src/src/hash.h @@ -35,7 +35,7 @@ typedef struct HashElem HashElem; ** element pointed to plus the next _ht.count-1 elements in the list. ** ** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the +** by a linear search of the global list. For small tables, the ** Hash.ht table is never allocated because if there are few elements ** in the table, it is faster to do a linear search than to manage ** the hash table. @@ -50,7 +50,7 @@ struct Hash { } *ht; }; -/* Each element in the hash table is an instance of the following +/* Each element in the hash table is an instance of the following ** structure. All elements are stored on a single doubly-linked list. ** ** Again, this structure is intended to be opaque, but it can't really diff --git a/third_party/sqlite/src/src/hwtime.h b/third_party/sqlite/src/src/hwtime.h index 5b209db8afc69..3013bdd852885 100644 --- a/third_party/sqlite/src/src/hwtime.h +++ b/third_party/sqlite/src/src/hwtime.h @@ -51,7 +51,7 @@ __asm__ __volatile__ ("rdtsc" : "=A" (val)); return val; } - + #elif (defined(__GNUC__) && defined(__ppc__)) __inline__ sqlite_uint64 sqlite3Hwtime(void){ diff --git a/third_party/sqlite/src/src/in-operator.md b/third_party/sqlite/src/src/in-operator.md index e9ad2101aa94f..92cb3d48a3996 100644 --- a/third_party/sqlite/src/src/in-operator.md +++ b/third_party/sqlite/src/src/in-operator.md @@ -25,7 +25,7 @@ that returns two or more columns, or a list of scalars. It is not currently support for the RHS to be a list of vectors. The number of columns for LHS must match the number of columns for -the RHS. If the RHS is a list of values, then the LHS must be a +the RHS. If the RHS is a list of values, then the LHS must be a scalar. If the RHS is a subquery returning N columns, then the LHS must be a vector of size N. @@ -47,7 +47,7 @@ the system only needs a binary result: TRUE or NOT-TRUE. One can also to define a binary result of FALSE and NOT-FALSE, but it turns out that no extra optimizations are possible in that case, so if the FALSE/NOT-FALSE binary is needed, we have to compute the three-state -TRUE/FALSE/NULL result and then combine the TRUE and NULL values into +TRUE/FALSE/NULL result and then combine the TRUE and NULL values into NOT-FALSE. A "NOT IN" operator is computed by first computing the equivalent IN @@ -97,11 +97,11 @@ is the algorithm that is implemented in SQLite. 5. If we do not need to distinguish between FALSE and NULL, then return FALSE. - + 6. For each row in the RHS, compare that row against the LHS and if the result is NULL, immediately return NULL. In the case of a scalar IN operator, we only need to look at the very first - row the RHS because for a scalar RHS, all NULLs will always come + row the RHS because for a scalar RHS, all NULLs will always come first. If the RHS is empty, this step is a no-op. 7. Return FALSE. diff --git a/third_party/sqlite/src/src/insert.c b/third_party/sqlite/src/src/insert.c index 894bfc2cc17b3..c6cef5eedd8ce 100644 --- a/third_party/sqlite/src/src/insert.c +++ b/third_party/sqlite/src/src/insert.c @@ -15,7 +15,7 @@ #include "sqliteInt.h" /* -** Generate code that will +** Generate code that will ** ** (1) acquire a lock for table pTab then ** (2) open pTab as cursor iCur. @@ -34,7 +34,7 @@ void sqlite3OpenTable( assert( !IsVirtual(pTab) ); v = sqlite3GetVdbe(pParse); assert( opcode==OP_OpenWrite || opcode==OP_OpenRead ); - sqlite3TableLock(pParse, iDb, pTab->tnum, + sqlite3TableLock(pParse, iDb, pTab->tnum, (opcode==OP_OpenWrite)?1:0, pTab->zName); if( HasRowid(pTab) ){ sqlite3VdbeAddOp4Int(v, opcode, iCur, pTab->tnum, iDb, pTab->nCol); @@ -51,7 +51,7 @@ void sqlite3OpenTable( /* ** Return a pointer to the column affinity string associated with index -** pIdx. A column affinity string has one character for each column in +** pIdx. A column affinity string has one character for each column in ** the table, according to the affinity of the column: ** ** Character Column affinity @@ -103,7 +103,7 @@ const char *sqlite3IndexAffinityStr(sqlite3 *db, Index *pIdx){ } pIdx->zColAff[n] = 0; } - + return pIdx->zColAff; } @@ -158,9 +158,9 @@ void sqlite3TableAffinity(Vdbe *v, Table *pTab, int iReg){ /* ** Return non-zero if the table pTab in database iDb or any of its indices -** have been opened at any point in the VDBE program. This is used to see if -** a statement of the form "INSERT INTO SELECT ..." can -** run without using a temporary table for the results of the SELECT. +** have been opened at any point in the VDBE program. This is used to see if +** a statement of the form "INSERT INTO SELECT ..." can +** run without using a temporary table for the results of the SELECT. */ static int readsTable(Parse *p, int iDb, Table *pTab){ Vdbe *v = sqlite3GetVdbe(p); @@ -251,7 +251,7 @@ static int autoIncBegin( /* ** This routine generates code that will initialize all of the -** register used by the autoincrement tracker. +** register used by the autoincrement tracker. */ void sqlite3AutoincrementBegin(Parse *pParse){ AutoincInfo *p; /* Information about an AUTOINCREMENT */ @@ -278,7 +278,7 @@ void sqlite3AutoincrementBegin(Parse *pParse){ /* 6 */ {OP_Goto, 0, 9, 0}, /* 7 */ {OP_Next, 0, 2, 0}, /* 8 */ {OP_Integer, 0, 0, 0}, - /* 9 */ {OP_Close, 0, 0, 0} + /* 9 */ {OP_Close, 0, 0, 0} }; VdbeOp *aOp; pDb = &db->aDb[p->iDb]; @@ -625,7 +625,7 @@ void sqlite3Insert( regData = regRowid+1; /* If the INSERT statement included an IDLIST term, then make sure - ** all elements of the IDLIST really are columns of the table and + ** all elements of the IDLIST really are columns of the table and ** remember the column indices. ** ** If the table has an INTEGER PRIMARY KEY column and that column @@ -697,7 +697,7 @@ void sqlite3Insert( ** the destination table (template 3). ** ** A temp table must be used if the table being updated is also one - ** of the tables being read by the SELECT statement. Also use a + ** of the tables being read by the SELECT statement. Also use a ** temp table in the case of row triggers. */ if( pTrigger || readsTable(pParse, iDb, pTab) ){ @@ -733,7 +733,7 @@ void sqlite3Insert( sqlite3ReleaseTempReg(pParse, regTempRowid); } }else{ - /* This is the case if the data for the INSERT is coming from a + /* This is the case if the data for the INSERT is coming from a ** single-row VALUES clause */ NameContext sNC; @@ -752,7 +752,7 @@ void sqlite3Insert( } /* If there is no IDLIST term but the table has an integer primary - ** key, the set the ipkColumn variable to the integer primary key + ** key, the set the ipkColumn variable to the integer primary key ** column index in the original table definition. */ if( pColumn==0 && nColumn>0 ){ @@ -766,7 +766,7 @@ void sqlite3Insert( nHidden += (IsHiddenColumn(&pTab->aCol[i]) ? 1 : 0); } if( pColumn==0 && nColumn && nColumn!=(pTab->nCol-nHidden) ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "table %S has %d columns but %d values were supplied", pTabList, 0, pTab->nCol-nHidden, nColumn); goto insert_cleanup; @@ -775,7 +775,7 @@ void sqlite3Insert( sqlite3ErrorMsg(pParse, "%d values for %d columns", nColumn, pColumn->nId); goto insert_cleanup; } - + /* Initialize the count of rows to be inserted */ if( db->flags & SQLITE_CountRows ){ @@ -871,7 +871,7 @@ void sqlite3Insert( || (pColumn==0 && IsOrdinaryHiddenColumn(&pTab->aCol[i])) ){ sqlite3ExprCode(pParse, pTab->aCol[i].pDflt, regCols+i+1); }else if( useTempTable ){ - sqlite3VdbeAddOp3(v, OP_Column, srcTab, j, regCols+i+1); + sqlite3VdbeAddOp3(v, OP_Column, srcTab, j, regCols+i+1); }else{ assert( pSelect==0 ); /* Otherwise useTempTable is true */ sqlite3ExprCodeAndCache(pParse, pList->a[j].pExpr, regCols+i+1); @@ -889,7 +889,7 @@ void sqlite3Insert( } /* Fire BEFORE or INSTEAD OF triggers */ - sqlite3CodeRowTrigger(pParse, pTrigger, TK_INSERT, 0, TRIGGER_BEFORE, + sqlite3CodeRowTrigger(pParse, pTrigger, TK_INSERT, 0, TRIGGER_BEFORE, pTab, regCols-pTab->nCol-1, onError, endOfLoop); sqlite3ReleaseTempRange(pParse, regCols, pTab->nCol+1); @@ -973,7 +973,7 @@ void sqlite3Insert( if( j<0 || nColumn==0 || (pColumn && j>=pColumn->nId) ){ sqlite3ExprCodeFactorable(pParse, pTab->aCol[i].pDflt, iRegStore); }else if( useTempTable ){ - sqlite3VdbeAddOp3(v, OP_Column, srcTab, j, iRegStore); + sqlite3VdbeAddOp3(v, OP_Column, srcTab, j, iRegStore); }else if( pSelect ){ if( regFromSelect!=regData ){ sqlite3VdbeAddOp2(v, OP_SCopy, regFromSelect+j, iRegStore); @@ -1007,7 +1007,7 @@ void sqlite3Insert( ** constraints or (b) there are no triggers and this table is not a ** parent table in a foreign key constraint. It is safe to set the ** flag in the second case as if any REPLACE constraint is hit, an - ** OP_Delete or OP_IdxDelete instruction will be executed on each + ** OP_Delete or OP_IdxDelete instruction will be executed on each ** cursor that is disturbed. And these instructions both clear the ** VdbeCursor.seekResult variable, disabling the OPFLAG_USESEEKRESULT ** functionality. */ @@ -1028,7 +1028,7 @@ void sqlite3Insert( if( pTrigger ){ /* Code AFTER triggers */ - sqlite3CodeRowTrigger(pParse, pTrigger, TK_INSERT, 0, TRIGGER_AFTER, + sqlite3CodeRowTrigger(pParse, pTrigger, TK_INSERT, 0, TRIGGER_AFTER, pTab, regData-2-pTab->nCol, onError, endOfLoop); } @@ -1055,7 +1055,7 @@ insert_end: } /* - ** Return the number of rows inserted. If this routine is + ** Return the number of rows inserted. If this routine is ** generating code because of a call to sqlite3NestedParse(), do not ** invoke the callback function. */ @@ -1258,9 +1258,9 @@ void sqlite3GenerateConstraintChecks( assert( v!=0 ); assert( pTab->pSelect==0 ); /* This table is not a VIEW */ nCol = pTab->nCol; - + /* pPk is the PRIMARY KEY index for WITHOUT ROWID tables and NULL for - ** normal rowid tables. nPkField is the number of key fields in the + ** normal rowid tables. nPkField is the number of key fields in the ** pPk index or 1 for a rowid table. In other words, nPkField is the ** number of fields in the true primary key of the table. */ if( HasRowid(pTab) ){ @@ -1417,10 +1417,10 @@ void sqlite3GenerateConstraintChecks( ** the triggers and remove both the table and index b-tree entries. ** ** Otherwise, if there are no triggers or the recursive-triggers - ** flag is not set, but the table has one or more indexes, call - ** GenerateRowIndexDelete(). This removes the index b-tree entries - ** only. The table b-tree entry will be replaced by the new entry - ** when it is inserted. + ** flag is not set, but the table has one or more indexes, call + ** GenerateRowIndexDelete(). This removes the index b-tree entries + ** only. The table b-tree entry will be replaced by the new entry + ** when it is inserted. ** ** If either GenerateRowDelete() or GenerateRowIndexDelete() is called, ** also invoke MultiWrite() to indicate that this VDBE may require @@ -1528,7 +1528,7 @@ void sqlite3GenerateConstraintChecks( sqlite3VdbeAddOp3(v, OP_MakeRecord, regIdx, pIdx->nColumn, aRegIdx[ix]); VdbeComment((v, "for %s", pIdx->zName)); - /* In an UPDATE operation, if this index is the PRIMARY KEY index + /* In an UPDATE operation, if this index is the PRIMARY KEY index ** of a WITHOUT ROWID table and there has been no change the ** primary key, then no collision is possible. The collision detection ** logic below can all be skipped. */ @@ -1539,7 +1539,7 @@ void sqlite3GenerateConstraintChecks( /* Find out what action to take in case there is a uniqueness conflict */ onError = pIdx->onError; - if( onError==OE_None ){ + if( onError==OE_None ){ sqlite3VdbeResolveLabel(v, addrUniqueOk); continue; /* pIdx is not a UNIQUE index */ } @@ -1555,7 +1555,7 @@ void sqlite3GenerateConstraintChecks( ** (3) There are no secondary indexes on the table ** (4) No delete triggers need to be fired if there is a conflict ** (5) No FK constraint counters need to be updated if a conflict occurs. - */ + */ if( (ix==0 && pIdx->pNext==0) /* Condition 3 */ && pPk==pIdx /* Condition 2 */ && onError==OE_Replace /* Condition 1 */ @@ -1598,7 +1598,7 @@ void sqlite3GenerateConstraintChecks( } } if( isUpdate ){ - /* If currently processing the PRIMARY KEY of a WITHOUT ROWID + /* If currently processing the PRIMARY KEY of a WITHOUT ROWID ** table, only conflict if the new PRIMARY KEY values are actually ** different from the old. ** @@ -1608,7 +1608,7 @@ void sqlite3GenerateConstraintChecks( int addrJump = sqlite3VdbeCurrentAddr(v)+pPk->nKeyCol; int op = OP_Ne; int regCmp = (IsPrimaryKeyIndex(pIdx) ? regIdx : regR); - + for(i=0; inKeyCol; i++){ char *p4 = (char*)sqlite3LocateCollSeq(pParse, pPk->azColl[i]); x = pPk->aiColumn[i]; @@ -1617,7 +1617,7 @@ void sqlite3GenerateConstraintChecks( addrJump = addrUniqueOk; op = OP_Eq; } - sqlite3VdbeAddOp4(v, op, + sqlite3VdbeAddOp4(v, op, regOldData+1+x, addrJump, regCmp+i, p4, P4_COLLSEQ ); sqlite3VdbeChangeP5(v, SQLITE_NOTNULL); @@ -1663,7 +1663,7 @@ void sqlite3GenerateConstraintChecks( sqlite3VdbeGoto(v, ipkTop+1); sqlite3VdbeJumpHere(v, ipkBottom); } - + *pbMayReplace = seenReplace; VdbeModuleComment((v, "END: GenCnstCks(%d)", seenReplace)); } @@ -1737,7 +1737,7 @@ void sqlite3CompleteInsertion( pik_flags |= (update_flags & OPFLAG_SAVEPOSITION); #ifdef SQLITE_ENABLE_PREUPDATE_HOOK if( update_flags==0 ){ - sqlite3VdbeAddOp4(v, OP_InsertInt, + sqlite3VdbeAddOp4(v, OP_InsertInt, iIdxCur+i, aRegIdx[i], 0, (char*)pTab, P4_TABLE ); sqlite3VdbeChangeP5(v, OPFLAG_ISNOOP); @@ -1917,7 +1917,7 @@ static int xferCompatibleIndex(Index *pDest, Index *pSrc){ ** ** INSERT INTO tab1 SELECT * FROM tab2; ** -** The xfer optimization transfers raw records from tab2 over to tab1. +** The xfer optimization transfers raw records from tab2 over to tab1. ** Columns are not decoded and reassembled, which greatly improves ** performance. Raw index records are transferred in the same way. ** @@ -2052,8 +2052,8 @@ static int xferOptimization( Column *pDestCol = &pDest->aCol[i]; Column *pSrcCol = &pSrc->aCol[i]; #ifdef SQLITE_ENABLE_HIDDEN_COLUMNS - if( (db->flags & SQLITE_Vacuum)==0 - && (pDestCol->colFlags | pSrcCol->colFlags) & COLFLAG_HIDDEN + if( (db->flags & SQLITE_Vacuum)==0 + && (pDestCol->colFlags | pSrcCol->colFlags) & COLFLAG_HIDDEN ){ return 0; /* Neither table may have __hidden__ columns */ } @@ -2071,7 +2071,7 @@ static int xferOptimization( if( i>0 ){ assert( pDestCol->pDflt==0 || pDestCol->pDflt->op==TK_SPAN ); assert( pSrcCol->pDflt==0 || pSrcCol->pDflt->op==TK_SPAN ); - if( (pDestCol->pDflt==0)!=(pSrcCol->pDflt==0) + if( (pDestCol->pDflt==0)!=(pSrcCol->pDflt==0) || (pDestCol->pDflt && strcmp(pDestCol->pDflt->u.zToken, pSrcCol->pDflt->u.zToken)!=0) ){ @@ -2098,7 +2098,7 @@ static int xferOptimization( #ifndef SQLITE_OMIT_FOREIGN_KEY /* Disallow the transfer optimization if the destination table constains ** any foreign key constraints. This is more restrictive than necessary. - ** But the main beneficiary of the transfer optimization is the VACUUM + ** But the main beneficiary of the transfer optimization is the VACUUM ** command, and the VACUUM command disables foreign key constraints. So ** the extra complication to make this rule less restrictive is probably ** not worth the effort. Ticket [6284df89debdfa61db8073e062908af0c9b6118e] @@ -2145,7 +2145,7 @@ static int xferOptimization( ** (If the destination is not initially empty, the rowid fields ** of index entries might need to change.) ** - ** (2) The destination has a unique index. (The xfer optimization + ** (2) The destination has a unique index. (The xfer optimization ** is unable to test uniqueness.) ** ** (3) onError is something other than OE_Abort and OE_Rollback. @@ -2208,14 +2208,14 @@ static int xferOptimization( /* This INSERT command is part of a VACUUM operation, which guarantees ** that the destination table is empty. If all indexed columns use ** collation sequence BINARY, then it can also be assumed that the - ** index will be populated by inserting keys in strictly sorted + ** index will be populated by inserting keys in strictly sorted ** order. In this case, instead of seeking within the b-tree as part ** of every OP_IdxInsert opcode, an OP_Last is added before the - ** OP_IdxInsert to seek to the point within the b-tree where each key + ** OP_IdxInsert to seek to the point within the b-tree where each key ** should be inserted. This is faster. ** ** If any of the indexed columns use a collation sequence other than - ** BINARY, this optimization is disabled. This is because the user + ** BINARY, this optimization is disabled. This is because the user ** might change the definition of a collation sequence and then run ** a VACUUM command. In that case keys may not be written in strictly ** sorted order. */ diff --git a/third_party/sqlite/src/src/legacy.c b/third_party/sqlite/src/src/legacy.c index bd34512d311f2..6bc4d4ef4b2e6 100644 --- a/third_party/sqlite/src/src/legacy.c +++ b/third_party/sqlite/src/src/legacy.c @@ -69,7 +69,7 @@ int sqlite3_exec( rc = sqlite3_step(pStmt); /* Invoke the callback function if required */ - if( xCallback && (SQLITE_ROW==rc || + if( xCallback && (SQLITE_ROW==rc || (SQLITE_DONE==rc && !callbackIsInit && db->flags&SQLITE_NullCallback)) ){ if( !callbackIsInit ){ diff --git a/third_party/sqlite/src/src/loadext.c b/third_party/sqlite/src/src/loadext.c index 3296be60dd693..1de1bd2b767a9 100644 --- a/third_party/sqlite/src/src/loadext.c +++ b/third_party/sqlite/src/src/loadext.c @@ -296,8 +296,8 @@ static const sqlite3_api_routines sqlite3Apis = { sqlite3_memory_highwater, sqlite3_memory_used, #ifdef SQLITE_MUTEX_OMIT - 0, - 0, + 0, + 0, 0, 0, 0, @@ -432,7 +432,7 @@ static const sqlite3_api_routines sqlite3Apis = { ** ** Return SQLITE_OK on success and SQLITE_ERROR if something goes wrong. ** -** If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with +** If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with ** error message text. The calling function should free this memory ** by calling sqlite3DbFree(db, ). */ @@ -456,7 +456,7 @@ static int sqlite3LoadExtension( /* Shared library endings to try if zFile cannot be loaded as written */ static const char *azEndings[] = { #if SQLITE_OS_WIN - "dll" + "dll" #elif defined(__APPLE__) "dylib" #else @@ -496,7 +496,7 @@ static int sqlite3LoadExtension( if( pzErrMsg ){ *pzErrMsg = zErrmsg = sqlite3_malloc64(nMsg); if( zErrmsg ){ - sqlite3_snprintf(nMsg, zErrmsg, + sqlite3_snprintf(nMsg, zErrmsg, "unable to open shared library [%s]", zFile); sqlite3OsDlError(pVfs, nMsg-1, zErrmsg); } @@ -508,9 +508,9 @@ static int sqlite3LoadExtension( /* If no entry point was specified and the default legacy ** entry point name "sqlite3_extension_init" was not found, then ** construct an entry point name "sqlite3_X_init" where the X is - ** replaced by the lowercase value of every ASCII alphabetic + ** replaced by the lowercase value of every ASCII alphabetic ** character in the filename after the last "/" upto the first ".", - ** and eliding the first three characters if they are "lib". + ** and eliding the first three characters if they are "lib". ** Examples: ** ** /usr/local/lib/libExample5.4.3.so ==> sqlite3_example_init @@ -630,7 +630,7 @@ int sqlite3_enable_load_extension(sqlite3 *db, int onoff){ */ typedef struct sqlite3AutoExtList sqlite3AutoExtList; static SQLITE_WSD struct sqlite3AutoExtList { - u32 nExt; /* Number of entries in aExt[] */ + u32 nExt; /* Number of entries in aExt[] */ void (**aExt)(void); /* Pointers to the extension init functions */ } sqlite3Autoext = { 0, 0 }; diff --git a/third_party/sqlite/src/src/main.c b/third_party/sqlite/src/src/main.c index 03e4f1b928457..fdea6d233c7c0 100644 --- a/third_party/sqlite/src/src/main.c +++ b/third_party/sqlite/src/src/main.c @@ -34,19 +34,19 @@ int sqlite3Fts5Init(sqlite3*); #ifndef SQLITE_AMALGAMATION /* IMPLEMENTATION-OF: R-46656-45156 The sqlite3_version[] string constant -** contains the text of SQLITE_VERSION macro. +** contains the text of SQLITE_VERSION macro. */ const char sqlite3_version[] = SQLITE_VERSION; #endif /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns -** a pointer to the to the sqlite3_version[] string constant. +** a pointer to the to the sqlite3_version[] string constant. */ const char *sqlite3_libversion(void){ return sqlite3_version; } /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a ** pointer to a string constant whose value is the same as the -** SQLITE_SOURCE_ID C preprocessor macro. +** SQLITE_SOURCE_ID C preprocessor macro. */ const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } @@ -102,13 +102,13 @@ char *sqlite3_temp_directory = 0; char *sqlite3_data_directory = 0; /* -** Initialize SQLite. +** Initialize SQLite. ** ** This routine must be called to initialize the memory allocation, ** VFS, and mutex subsystems prior to doing any serious work with ** SQLite. But as long as you do not compile with SQLITE_OMIT_AUTOINIT ** this routine will be called automatically by key routines such as -** sqlite3_open(). +** sqlite3_open(). ** ** This routine is a no-op except on its very first call for the process, ** or for the first call after a call to sqlite3_shutdown. @@ -158,7 +158,7 @@ int sqlite3_initialize(void){ */ if( sqlite3GlobalConfig.isInit ) return SQLITE_OK; - /* Make sure the mutex subsystem is initialized. If unable to + /* Make sure the mutex subsystem is initialized. If unable to ** initialize the mutex subsystem, return early with the error. ** If the system is so sick that we are unable to allocate a mutex, ** there is not much SQLite is going to be able to do. @@ -235,7 +235,7 @@ int sqlite3_initialize(void){ rc = sqlite3OsInit(); } if( rc==SQLITE_OK ){ - sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage, + sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage, sqlite3GlobalConfig.szPage, sqlite3GlobalConfig.nPage); sqlite3GlobalConfig.isInit = 1; #ifdef SQLITE_EXTRA_INIT @@ -458,7 +458,7 @@ int sqlite3_config(int op, ...){ ** a single parameter which is a pointer to an integer and writes into ** that integer the number of extra bytes per page required for each page ** in SQLITE_CONFIG_PAGECACHE. */ - *va_arg(ap, int*) = + *va_arg(ap, int*) = sqlite3HeaderSizeBtree() + sqlite3HeaderSizePcache() + sqlite3HeaderSizePcache1(); @@ -545,7 +545,7 @@ int sqlite3_config(int op, ...){ sqlite3GlobalConfig.nLookaside = va_arg(ap, int); break; } - + /* Record a pointer to the logger function and its first argument. ** The default is NULL. Logging is disabled if the function pointer is ** NULL. @@ -649,7 +649,7 @@ int sqlite3_config(int op, ...){ /* ** Set up the lookaside buffers for a database connection. -** Return SQLITE_OK on success. +** Return SQLITE_OK on success. ** If lookaside is already active, return SQLITE_BUSY. ** ** The sz parameter is the number of bytes in each lookaside slot. @@ -665,7 +665,7 @@ static int setupLookaside(sqlite3 *db, void *pBuf, int sz, int cnt){ return SQLITE_BUSY; } /* Free any existing lookaside buffer for this handle before - ** allocating a new one so we don't have to have space for + ** allocating a new one so we don't have to have space for ** both at the same time. */ if( db->lookaside.bMalloced ){ @@ -886,7 +886,7 @@ static int binCollFunc( } /* -** Another built-in collating sequence: NOCASE. +** Another built-in collating sequence: NOCASE. ** ** This collating sequence is intended to be used for "case independent ** comparison". SQLite's knowledge of upper and lower case equivalents @@ -1013,7 +1013,7 @@ static void disconnectAllVtab(sqlite3 *db){ /* ** Return TRUE if database connection db has unfinalized prepared -** statements or unfinished sqlite3_backup objects. +** statements or unfinished sqlite3_backup objects. */ static int connectionIsBusy(sqlite3 *db){ int j; @@ -1202,7 +1202,7 @@ void sqlite3LeaveMutexAndCloseZombie(sqlite3 *db){ /* The temp-database schema is allocated differently from the other schema ** objects (using sqliteMalloc() directly, instead of sqlite3BtreeSchema()). ** So it needs to be freed here. Todo: Why not roll the temp schema into - ** the same sqliteMalloc() as the one that allocates the database + ** the same sqliteMalloc() as the one that allocates the database ** structure? */ sqlite3DbFree(db, db->aDb[1].pSchema); @@ -1230,7 +1230,7 @@ void sqlite3RollbackAll(sqlite3 *db, int tripCode){ assert( sqlite3_mutex_held(db->mutex) ); sqlite3BeginBenignMalloc(); - /* Obtain all b-tree mutexes before making any calls to BtreeRollback(). + /* Obtain all b-tree mutexes before making any calls to BtreeRollback(). ** This is important in case the transaction being rolled back has ** modified the database schema. If the b-tree mutexes are not taken ** here, then another shared-cache connection might sneak in between @@ -1489,7 +1489,7 @@ int sqlite3InvokeBusyHandler(BusyHandler *p){ }else{ p->nBusy++; } - return rc; + return rc; } /* @@ -1520,9 +1520,9 @@ int sqlite3_busy_handler( ** be invoked every nOps opcodes. */ void sqlite3_progress_handler( - sqlite3 *db, + sqlite3 *db, int nOps, - int (*xProgress)(void*), + int (*xProgress)(void*), void *pArg ){ #ifdef SQLITE_ENABLE_API_ARMOR @@ -1581,7 +1581,7 @@ void sqlite3_interrupt(sqlite3 *db){ ** This function is exactly the same as sqlite3_create_function(), except ** that it is designed to be called by internal code. The difference is ** that if a malloc() fails in sqlite3_create_function(), an error code -** is returned and the mallocFailed flag cleared. +** is returned and the mallocFailed flag cleared. */ int sqlite3CreateFunc( sqlite3 *db, @@ -1600,7 +1600,7 @@ int sqlite3CreateFunc( assert( sqlite3_mutex_held(db->mutex) ); if( zFunctionName==0 || - (xSFunc && (xFinal || xStep)) || + (xSFunc && (xFinal || xStep)) || (!xSFunc && (xFinal && !xStep)) || (!xSFunc && (!xFinal && xStep)) || (nArg<-1 || nArg>SQLITE_MAX_FUNCTION_ARG) || @@ -1611,7 +1611,7 @@ int sqlite3CreateFunc( assert( SQLITE_FUNC_CONSTANT==SQLITE_DETERMINISTIC ); extraFlags = enc & SQLITE_DETERMINISTIC; enc &= (SQLITE_FUNC_ENCMASK|SQLITE_ANY); - + #ifndef SQLITE_OMIT_UTF16 /* If SQLITE_UTF16 is specified as the encoding type, transform this ** to one of SQLITE_UTF16LE or SQLITE_UTF16BE using the @@ -1638,7 +1638,7 @@ int sqlite3CreateFunc( #else enc = SQLITE_UTF8; #endif - + /* Check if an existing function is being overridden or deleted. If so, ** and there are active VMs, then return SQLITE_BUSY. If a function ** is being overridden/deleted but there are no active VMs, allow the @@ -1647,7 +1647,7 @@ int sqlite3CreateFunc( p = sqlite3FindFunction(db, zFunctionName, nArg, (u8)enc, 0); if( p && (p->funcFlags & SQLITE_FUNC_ENCMASK)==enc && p->nArg==nArg ){ if( db->nVdbeActive ){ - sqlite3ErrorWithMsg(db, SQLITE_BUSY, + sqlite3ErrorWithMsg(db, SQLITE_BUSY, "unable to delete/modify user-function due to active statements"); assert( !db->mallocFailed ); return SQLITE_BUSY; @@ -1772,7 +1772,7 @@ int sqlite3_create_function16( ** ** If the function already exists as a regular global function, then ** this routine is a no-op. If the function does not exist, then create -** a new one that always throws a run-time error. +** a new one that always throws a run-time error. ** ** When virtual tables intend to provide an overloaded function, they ** should call this routine to make sure the global function exists. @@ -1804,7 +1804,7 @@ int sqlite3_overload_function( #ifndef SQLITE_OMIT_TRACE /* ** Register a trace function. The pArg from the previously registered trace -** is returned. +** is returned. ** ** A NULL trace function means that no tracing is executes. A non-NULL ** trace is a pointer to a function that is invoked at the start of each @@ -1855,8 +1855,8 @@ int sqlite3_trace_v2( #ifndef SQLITE_OMIT_DEPRECATED /* -** Register a profile function. The pArg from the previously registered -** profile function is returned. +** Register a profile function. The pArg from the previously registered +** profile function is returned. ** ** A NULL profile function means that no profiling is executes. A non-NULL ** profile is a pointer to a function that is invoked at the conclusion of @@ -1988,7 +1988,7 @@ void *sqlite3_preupdate_hook( ** Invoke sqlite3_wal_checkpoint if the number of frames in the log file ** is greater than sqlite3.pWalArg cast to an integer (the value configured by ** wal_autocheckpoint()). -*/ +*/ int sqlite3WalDefaultHook( void *pClientData, /* Argument */ sqlite3 *db, /* Connection */ @@ -2122,7 +2122,7 @@ int sqlite3_wal_checkpoint_v2( /* ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points -** to contains a zero-length string, all attached databases are +** to contains a zero-length string, all attached databases are ** checkpointed. */ int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){ @@ -2136,9 +2136,9 @@ int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){ ** Run a checkpoint on database iDb. This is a no-op if database iDb is ** not currently open in WAL mode. ** -** If a transaction is open on the database being checkpointed, this -** function returns SQLITE_LOCKED and a checkpoint is not attempted. If -** an error occurs while running the checkpoint, an SQLite error code is +** If a transaction is open on the database being checkpointed, this +** function returns SQLITE_LOCKED and a checkpoint is not attempted. If +** an error occurs while running the checkpoint, an SQLite error code is ** returned (i.e. SQLITE_IOERR). Otherwise, SQLITE_OK. ** ** The mutex on database handle db should be held by the caller. The mutex @@ -2249,11 +2249,11 @@ const void *sqlite3_errmsg16(sqlite3 *db){ 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0 }; static const u16 misuse[] = { - 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ', - 'r', 'o', 'u', 't', 'i', 'n', 'e', ' ', - 'c', 'a', 'l', 'l', 'e', 'd', ' ', - 'o', 'u', 't', ' ', - 'o', 'f', ' ', + 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ', + 'r', 'o', 'u', 't', 'i', 'n', 'e', ' ', + 'c', 'a', 'l', 'l', 'e', 'd', ' ', + 'o', 'u', 't', ' ', + 'o', 'f', ' ', 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', 0 }; @@ -2309,7 +2309,7 @@ int sqlite3_extended_errcode(sqlite3 *db){ } int sqlite3_system_errno(sqlite3 *db){ return db ? db->iSysErrno : 0; -} +} /* ** Return a string that describes the kind of error specified in the @@ -2326,7 +2326,7 @@ const char *sqlite3_errstr(int rc){ */ static int createCollation( sqlite3* db, - const char *zName, + const char *zName, u8 enc, void* pCtx, int(*xCompare)(void*,int,const void*,int,const void*), @@ -2334,7 +2334,7 @@ static int createCollation( ){ CollSeq *pColl; int enc2; - + assert( sqlite3_mutex_held(db->mutex) ); /* If SQLITE_UTF16 is specified as the encoding type, transform this @@ -2351,14 +2351,14 @@ static int createCollation( return SQLITE_MISUSE_BKPT; } - /* Check if this call is removing or replacing an existing collation + /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there ** are no active VMs, invalidate any pre-compiled statements. */ pColl = sqlite3FindCollSeq(db, (u8)enc2, zName, 0); if( pColl && pColl->xCmp ){ if( db->nVdbeActive ){ - sqlite3ErrorWithMsg(db, SQLITE_BUSY, + sqlite3ErrorWithMsg(db, SQLITE_BUSY, "unable to delete/modify collation sequence due to active statements"); return SQLITE_BUSY; } @@ -2369,7 +2369,7 @@ static int createCollation( ** then any copies made by synthCollSeq() need to be invalidated. ** Also, collation destructor - CollSeq.xDel() - function may need ** to be called. - */ + */ if( (pColl->enc & ~SQLITE_UTF16_ALIGNED)==enc2 ){ CollSeq *aColl = sqlite3HashFind(&db->aCollSeq, zName); int j; @@ -2518,17 +2518,17 @@ int sqlite3_limit(sqlite3 *db, int limitId, int newLimit){ ** query parameter. The second argument contains the URI (or non-URI filename) ** itself. When this function is called the *pFlags variable should contain ** the default flags to open the database handle with. The value stored in -** *pFlags may be updated before returning if the URI filename contains +** *pFlags may be updated before returning if the URI filename contains ** "cache=xxx" or "mode=xxx" query parameters. ** ** If successful, SQLITE_OK is returned. In this case *ppVfs is set to point to ** the VFS that should be used to open the database file. *pzFile is set to -** point to a buffer containing the name of the file to open. It is the +** point to a buffer containing the name of the file to open. It is the ** responsibility of the caller to eventually call sqlite3_free() to release ** this buffer. ** ** If an error occurs, then an SQLite error code is returned and *pzErrMsg -** may be set to point to a buffer containing an English language error +** may be set to point to a buffer containing an English language error ** message. It is the responsibility of the caller to eventually release ** this buffer by calling sqlite3_free(). */ @@ -2536,7 +2536,7 @@ int sqlite3ParseUri( const char *zDefaultVfs, /* VFS to use if no "vfs=xxx" query option */ const char *zUri, /* Nul-terminated URI to parse */ unsigned int *pFlags, /* IN/OUT: SQLITE_OPEN_XXX flags */ - sqlite3_vfs **ppVfs, /* OUT: VFS to use */ + sqlite3_vfs **ppVfs, /* OUT: VFS to use */ char **pzFile, /* OUT: Filename component of URI */ char **pzErrMsg /* OUT: Error message (if rc!=SQLITE_OK) */ ){ @@ -2559,7 +2559,7 @@ int sqlite3ParseUri( int iOut = 0; /* Output character index */ u64 nByte = nUri+2; /* Bytes of space to allocate */ - /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen + /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen ** method that there may be extra parameters following the file-name. */ flags |= SQLITE_OPEN_URI; @@ -2574,7 +2574,7 @@ int sqlite3ParseUri( /* The following condition causes URIs with five leading / characters ** like file://///host/path to be converted into UNCs like //host/path. ** The correct URI for that UNC has only two or four leading / characters - ** file://host/path or file:////host/path. But 5 leading slashes is a + ** file://host/path or file:////host/path. But 5 leading slashes is a ** common error, we are told, so we handle it as a special case. */ if( strncmp(zUri+7, "///", 3)==0 ){ iIn++; } }else if( strncmp(zUri+5, "//localhost/", 12)==0 ){ @@ -2586,7 +2586,7 @@ int sqlite3ParseUri( iIn = 7; while( zUri[iIn] && zUri[iIn]!='/' ) iIn++; if( iIn!=7 && (iIn!=16 || memcmp("localhost", &zUri[7], 9)) ){ - *pzErrMsg = sqlite3_mprintf("invalid uri authority: %.*s", + *pzErrMsg = sqlite3_mprintf("invalid uri authority: %.*s", iIn-7, &zUri[7]); rc = SQLITE_ERROR; goto parse_uri_out; @@ -2594,8 +2594,8 @@ int sqlite3ParseUri( } #endif - /* Copy the filename and any query parameters into the zFile buffer. - ** Decode %HH escape codes along the way. + /* Copy the filename and any query parameters into the zFile buffer. + ** Decode %HH escape codes along the way. ** ** Within this loop, variable eState may be set to 0, 1 or 2, depending ** on the parsing context. As follows: @@ -2607,9 +2607,9 @@ int sqlite3ParseUri( eState = 0; while( (c = zUri[iIn])!=0 && c!='#' ){ iIn++; - if( c=='%' - && sqlite3Isxdigit(zUri[iIn]) - && sqlite3Isxdigit(zUri[iIn+1]) + if( c=='%' + && sqlite3Isxdigit(zUri[iIn]) + && sqlite3Isxdigit(zUri[iIn+1]) ){ int octet = (sqlite3HexToInt(zUri[iIn++]) << 4); octet += sqlite3HexToInt(zUri[iIn++]); @@ -2621,7 +2621,7 @@ int sqlite3ParseUri( ** case we ignore all text in the remainder of the path, name or ** value currently being parsed. So ignore the current character ** and skip to the next "?", "=" or "&", as appropriate. */ - while( (c = zUri[iIn])!=0 && c!='#' + while( (c = zUri[iIn])!=0 && c!='#' && (eState!=0 || c!='?') && (eState!=1 || (c!='=' && c!='&')) && (eState!=2 || c!='&') @@ -2659,7 +2659,7 @@ int sqlite3ParseUri( zFile[iOut++] = '\0'; zFile[iOut++] = '\0'; - /* Check if there were any options specified that should be interpreted + /* Check if there were any options specified that should be interpreted ** here. Options that are interpreted here include "vfs" and those that ** correspond to flags that may be passed to the sqlite3_open_v2() ** method. */ @@ -2695,7 +2695,7 @@ int sqlite3ParseUri( if( nOpt==4 && memcmp("mode", zOpt, 4)==0 ){ static struct OpenMode aOpenMode[] = { { "ro", SQLITE_OPEN_READONLY }, - { "rw", SQLITE_OPEN_READWRITE }, + { "rw", SQLITE_OPEN_READWRITE }, { "rwc", SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE }, { "memory", SQLITE_OPEN_MEMORY }, { 0, 0 } @@ -2765,7 +2765,7 @@ int sqlite3ParseUri( /* ** This routine does the work of opening a database on behalf of -** sqlite3_open() and sqlite3_open16(). The database filename "zFilename" +** sqlite3_open() and sqlite3_open16(). The database filename "zFilename" ** is UTF-8 encoded. */ static int openDatabase( @@ -2789,7 +2789,7 @@ static int openDatabase( if( rc ) return rc; #endif - /* Only allow sensible combinations of bits in the flags argument. + /* Only allow sensible combinations of bits in the flags argument. ** Throw an error if any non-sense combination is used. If we ** do not block illegal combinations here, it could trigger ** assert() statements in deeper layers. Sensible combinations @@ -2836,11 +2836,11 @@ static int openDatabase( flags &= ~( SQLITE_OPEN_DELETEONCLOSE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_MAIN_DB | - SQLITE_OPEN_TEMP_DB | - SQLITE_OPEN_TRANSIENT_DB | - SQLITE_OPEN_MAIN_JOURNAL | - SQLITE_OPEN_TEMP_JOURNAL | - SQLITE_OPEN_SUBJOURNAL | + SQLITE_OPEN_TEMP_DB | + SQLITE_OPEN_TRANSIENT_DB | + SQLITE_OPEN_MAIN_JOURNAL | + SQLITE_OPEN_TEMP_JOURNAL | + SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_MASTER_JOURNAL | SQLITE_OPEN_NOMUTEX | SQLITE_OPEN_FULLMUTEX | @@ -2922,7 +2922,7 @@ static int openDatabase( goto opendb_out; } /* EVIDENCE-OF: R-08308-17224 The default collating function for all - ** strings is BINARY. + ** strings is BINARY. */ db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, sqlite3StrBINARY, 0); assert( db->pDfltColl!=0 ); @@ -2954,7 +2954,7 @@ static int openDatabase( db->aDb[1].pSchema = sqlite3SchemaGet(db, 0); /* The default safety_level for the main database is FULL; for the temp - ** database it is OFF. This matches the pager layer defaults. + ** database it is OFF. This matches the pager layer defaults. */ db->aDb[0].zDbSName = "main"; db->aDb[0].safety_level = SQLITE_DEFAULT_SYNCHRONOUS+1; @@ -2976,7 +2976,7 @@ static int openDatabase( #ifdef SQLITE_ENABLE_FTS5 /* Register any built-in FTS5 module before loading the automatic - ** extensions. This allows automatic extensions to register FTS5 + ** extensions. This allows automatic extensions to register FTS5 ** tokenizers and auxiliary functions. */ if( !db->mallocFailed && rc==SQLITE_OK ){ rc = sqlite3Fts5Init(db); @@ -3109,8 +3109,8 @@ opendb_out: ** Open a new database handle. */ int sqlite3_open( - const char *zFilename, - sqlite3 **ppDb + const char *zFilename, + sqlite3 **ppDb ){ return openDatabase(zFilename, ppDb, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0); @@ -3129,7 +3129,7 @@ int sqlite3_open_v2( ** Open a new database handle. */ int sqlite3_open16( - const void *zFilename, + const void *zFilename, sqlite3 **ppDb ){ char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */ @@ -3168,9 +3168,9 @@ int sqlite3_open16( ** Register a new collation sequence with the database handle db. */ int sqlite3_create_collation( - sqlite3* db, - const char *zName, - int enc, + sqlite3* db, + const char *zName, + int enc, void* pCtx, int(*xCompare)(void*,int,const void*,int,const void*) ){ @@ -3181,9 +3181,9 @@ int sqlite3_create_collation( ** Register a new collation sequence with the database handle db. */ int sqlite3_create_collation_v2( - sqlite3* db, - const char *zName, - int enc, + sqlite3* db, + const char *zName, + int enc, void* pCtx, int(*xCompare)(void*,int,const void*,int,const void*), void(*xDel)(void*) @@ -3206,9 +3206,9 @@ int sqlite3_create_collation_v2( ** Register a new collation sequence with the database handle db. */ int sqlite3_create_collation16( - sqlite3* db, + sqlite3* db, const void *zName, - int enc, + int enc, void* pCtx, int(*xCompare)(void*,int,const void*,int,const void*) ){ @@ -3236,8 +3236,8 @@ int sqlite3_create_collation16( ** db. Replace any previously installed collation sequence factory. */ int sqlite3_collation_needed( - sqlite3 *db, - void *pCollNeededArg, + sqlite3 *db, + void *pCollNeededArg, void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*) ){ #ifdef SQLITE_ENABLE_API_ARMOR @@ -3257,8 +3257,8 @@ int sqlite3_collation_needed( ** db. Replace any previously installed collation sequence factory. */ int sqlite3_collation_needed16( - sqlite3 *db, - void *pCollNeededArg, + sqlite3 *db, + void *pCollNeededArg, void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*) ){ #ifdef SQLITE_ENABLE_API_ARMOR @@ -3422,13 +3422,13 @@ int sqlite3_table_column_metadata( /* The following block stores the meta information that will be returned ** to the caller in local variables zDataType, zCollSeq, notnull, primarykey ** and autoinc. At this point there are two possibilities: - ** - ** 1. The specified column name was rowid", "oid" or "_rowid_" - ** and there is no explicitly declared IPK column. ** - ** 2. The table is not a view and the column name identified an + ** 1. The specified column name was rowid", "oid" or "_rowid_" + ** and there is no explicitly declared IPK column. + ** + ** 2. The table is not a view and the column name identified an ** explicitly declared column. Copy meta information from *pCol. - */ + */ if( pCol ){ zDataType = sqlite3ColumnType(pCol,0); zCollSeq = pCol->zColl; @@ -3478,7 +3478,7 @@ int sqlite3_sleep(int ms){ pVfs = sqlite3_vfs_find(0); if( pVfs==0 ) return 0; - /* This function works in milliseconds, but the underlying OsSleep() + /* This function works in milliseconds, but the underlying OsSleep() ** API uses microseconds. Hence the 1000's. */ rc = (sqlite3OsSleep(pVfs, 1000*ms)/1000); @@ -3618,7 +3618,7 @@ int sqlite3_test_control(int op, ...){ /* ** sqlite3_test_control(BENIGN_MALLOC_HOOKS, xBegin, xEnd) ** - ** Register hooks to call to indicate which malloc() failures + ** Register hooks to call to indicate which malloc() failures ** are benign. */ case SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS: { @@ -3679,7 +3679,7 @@ int sqlite3_test_control(int op, ...){ ** This action provides a run-time test to see how the ALWAYS and ** NEVER macros were defined at compile-time. ** - ** The return value is ALWAYS(X). + ** The return value is ALWAYS(X). ** ** The recommended test is X==2. If the return value is 2, that means ** ALWAYS() and NEVER() are both no-op pass-through macros, which is the @@ -3716,7 +3716,7 @@ int sqlite3_test_control(int op, ...){ ** 10 little-endian, determined at run-time ** 432101 big-endian, determined at compile-time ** 123410 little-endian, determined at compile-time - */ + */ case SQLITE_TESTCTRL_BYTEORDER: { rc = SQLITE_BYTEORDER*100 + SQLITE_LITTLEENDIAN*10 + SQLITE_BIGENDIAN; break; @@ -3738,7 +3738,7 @@ int sqlite3_test_control(int op, ...){ /* sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS, sqlite3 *db, int N) ** - ** Enable or disable various optimizations for testing purposes. The + ** Enable or disable various optimizations for testing purposes. The ** argument N is a bitmask of optimizations to be disabled. For normal ** operation N should be 0. The idea is that a test program (like the ** SQL Logic Test or SLT test module) can run the same SQL multiple times @@ -3756,7 +3756,7 @@ int sqlite3_test_control(int op, ...){ ** ** If zWord is a keyword recognized by the parser, then return the ** number of keywords. Or if zWord is not a keyword, return 0. - ** + ** ** This test feature is only available in the amalgamation since ** the SQLITE_N_KEYWORD macro is not defined in this file if SQLite ** is built using separate source files. @@ -3767,12 +3767,12 @@ int sqlite3_test_control(int op, ...){ rc = (sqlite3KeywordCode((u8*)zWord, n)!=TK_ID) ? SQLITE_N_KEYWORD : 0; break; } -#endif +#endif /* sqlite3_test_control(SQLITE_TESTCTRL_SCRATCHMALLOC, sz, &pNew, pFree); ** - ** Pass pFree into sqlite3ScratchFree(). - ** If sz>0 then allocate a scratch buffer into pNew. + ** Pass pFree into sqlite3ScratchFree(). + ** If sz>0 then allocate a scratch buffer into pNew. */ case SQLITE_TESTCTRL_SCRATCHMALLOC: { void *pFree, **ppNew; @@ -3821,7 +3821,7 @@ int sqlite3_test_control(int op, ...){ /* sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE, xCallback, ptr); ** - ** Set the VDBE coverage callback function to xCallback with context + ** Set the VDBE coverage callback function to xCallback with context ** pointer ptr. */ case SQLITE_TESTCTRL_VDBE_COVERAGE: { @@ -3886,7 +3886,7 @@ int sqlite3_test_control(int op, ...){ /* ** This is a utility routine, useful to VFS implementations, that checks -** to see if a database file was a URI that contained a specific query +** to see if a database file was a URI that contained a specific query ** parameter, and if so obtains the value of the query parameter. ** ** The zFilename argument is the filename pointer passed into the xOpen() @@ -3974,11 +3974,11 @@ int sqlite3_db_readonly(sqlite3 *db, const char *zDbName){ #ifdef SQLITE_ENABLE_SNAPSHOT /* -** Obtain a snapshot handle for the snapshot of database zDb currently +** Obtain a snapshot handle for the snapshot of database zDb currently ** being read by handle db. */ int sqlite3_snapshot_get( - sqlite3 *db, + sqlite3 *db, const char *zDb, sqlite3_snapshot **ppSnapshot ){ @@ -4014,8 +4014,8 @@ int sqlite3_snapshot_get( ** Open a read-transaction on the snapshot idendified by pSnapshot. */ int sqlite3_snapshot_open( - sqlite3 *db, - const char *zDb, + sqlite3 *db, + const char *zDb, sqlite3_snapshot *pSnapshot ){ int rc = SQLITE_ERROR; diff --git a/third_party/sqlite/src/src/malloc.c b/third_party/sqlite/src/src/malloc.c index e7714aa103a46..6534a69e67699 100644 --- a/third_party/sqlite/src/src/malloc.c +++ b/third_party/sqlite/src/src/malloc.c @@ -92,7 +92,7 @@ int sqlite3_memory_alarm( #endif /* -** Set the soft heap-size limit for the library. Passing a zero or +** Set the soft heap-size limit for the library. Passing a zero or ** negative value indicates no limit. */ sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 n){ @@ -204,7 +204,7 @@ sqlite3_int64 sqlite3_memory_highwater(int resetFlag){ } /* -** Trigger the alarm +** Trigger the alarm */ static void sqlite3MallocAlarm(int nByte){ if( mem0.alarmThreshold<=0 ) return; @@ -526,7 +526,7 @@ void *sqlite3Realloc(void *pOld, u64 nBytes){ sqlite3_mutex_enter(mem0.mutex); sqlite3StatusHighwater(SQLITE_STATUS_MALLOC_SIZE, (int)nBytes); nDiff = nNew - nOld; - if( nDiff>0 && sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >= + if( nDiff>0 && sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >= mem0.alarmThreshold-nDiff ){ sqlite3MallocAlarm(nDiff); } @@ -568,7 +568,7 @@ void *sqlite3_realloc64(void *pOld, sqlite3_uint64 n){ /* ** Allocate and zero memory. -*/ +*/ void *sqlite3MallocZero(u64 n){ void *p = sqlite3Malloc(n); if( p ){ @@ -598,13 +598,13 @@ static SQLITE_NOINLINE void *dbMallocRawFinish(sqlite3 *db, u64 n){ assert( db!=0 ); p = sqlite3Malloc(n); if( !p ) sqlite3OomFault(db); - sqlite3MemdebugSetType(p, + sqlite3MemdebugSetType(p, (db->lookaside.bDisable==0) ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP); return p; } /* -** Allocate memory, either lookaside (if possible) or heap. +** Allocate memory, either lookaside (if possible) or heap. ** If the allocation fails, set the mallocFailed flag in ** the connection pointer. ** @@ -721,9 +721,9 @@ void *sqlite3DbReallocOrFree(sqlite3 *db, void *p, u64 n){ } /* -** Make a copy of a string in memory obtained from sqliteMalloc(). These +** Make a copy of a string in memory obtained from sqliteMalloc(). These ** functions call sqlite3MallocRaw() directly instead of sqliteMalloc(). This -** is because when memory debugging is turned on, these two functions are +** is because when memory debugging is turned on, these two functions are ** called via macros that record the current file and line number in the ** ThreadData structure. */ @@ -805,20 +805,20 @@ static SQLITE_NOINLINE int apiOomError(sqlite3 *db){ } /* -** This function must be called before exiting any API function (i.e. +** This function must be called before exiting any API function (i.e. ** returning control to the user) that has called sqlite3_malloc or ** sqlite3_realloc. ** ** The returned value is normally a copy of the second argument to this ** function. However, if a malloc() failure has occurred since the previous -** invocation SQLITE_NOMEM is returned instead. +** invocation SQLITE_NOMEM is returned instead. ** ** If an OOM as occurred, then the connection error-code (the value ** returned by sqlite3_errcode()) is set to SQLITE_NOMEM. */ int sqlite3ApiExit(sqlite3* db, int rc){ /* If the db handle must hold the connection handle mutex here. - ** Otherwise the read (and possible write) of db->mallocFailed + ** Otherwise the read (and possible write) of db->mallocFailed ** is unsafe, as is the call to sqlite3Error(). */ assert( db!=0 ); diff --git a/third_party/sqlite/src/src/mem1.c b/third_party/sqlite/src/src/mem1.c index efc84c41d7658..509d7c2aba911 100644 --- a/third_party/sqlite/src/src/mem1.c +++ b/third_party/sqlite/src/src/mem1.c @@ -68,7 +68,7 @@ static malloc_zone_t* _sqliteZone_; #else /* if not __APPLE__ */ /* -** Use standard C library malloc and free on non-Apple systems. +** Use standard C library malloc and free on non-Apple systems. ** Also used by Apple systems if SQLITE_WITHOUT_ZONEMALLOC is defined. */ #define SQLITE_MALLOC(x) malloc(x) @@ -248,13 +248,13 @@ static int sqlite3MemInit(void *NotUsed){ /* defer MT decisions to system malloc */ _sqliteZone_ = malloc_default_zone(); }else{ - /* only 1 core, use our own zone to contention over global locks, + /* only 1 core, use our own zone to contention over global locks, ** e.g. we have our own dedicated locks */ bool success; malloc_zone_t* newzone = malloc_create_zone(4096, 0); malloc_set_zone_name(newzone, "Sqlite_Heap"); do{ - success = OSAtomicCompareAndSwapPtrBarrier(NULL, newzone, + success = OSAtomicCompareAndSwapPtrBarrier(NULL, newzone, (void * volatile *)&_sqliteZone_); }while(!_sqliteZone_); if( !success ){ diff --git a/third_party/sqlite/src/src/mem2.c b/third_party/sqlite/src/src/mem2.c index 51ea297c6a1af..8e375b2483ded 100644 --- a/third_party/sqlite/src/src/mem2.c +++ b/third_party/sqlite/src/src/mem2.c @@ -80,7 +80,7 @@ struct MemBlockHdr { ** when this module is combined with other in the amalgamation. */ static struct { - + /* ** Mutex to control access to the memory allocation subsystem. */ @@ -91,7 +91,7 @@ static struct { */ struct MemBlockHdr *pFirst; struct MemBlockHdr *pLast; - + /* ** The number of levels of backtrace to save in new allocations. */ @@ -104,7 +104,7 @@ static struct { int nTitle; /* Bytes of zTitle to save. Includes '\0' and padding */ char zTitle[100]; /* The title text */ - /* + /* ** sqlite3MallocDisallow() increments the following counter. ** sqlite3MallocAllow() decrements it. */ @@ -163,7 +163,7 @@ static struct MemBlockHdr *sqlite3MemsysGetHeader(void *pAllocation){ pU8 = (u8*)pAllocation; assert( pInt[nReserve/sizeof(int)]==(int)REARGUARD ); /* This checks any of the "extra" bytes allocated due - ** to rounding up to an 8 byte boundary to ensure + ** to rounding up to an 8 byte boundary to ensure ** they haven't been overwritten. */ while( nReserve-- > p->iSize ) assert( pU8[nReserve]==0x65 ); @@ -292,7 +292,7 @@ static void *sqlite3MemMalloc(int nByte){ p = (void*)pInt; } sqlite3_mutex_leave(mem.mutex); - return p; + return p; } /* @@ -302,7 +302,7 @@ static void sqlite3MemFree(void *pPrior){ struct MemBlockHdr *pHdr; void **pBt; char *z; - assert( sqlite3GlobalConfig.bMemstat || sqlite3GlobalConfig.bCoreMutex==0 + assert( sqlite3GlobalConfig.bMemstat || sqlite3GlobalConfig.bCoreMutex==0 || mem.mutex!=0 ); pHdr = sqlite3MemsysGetHeader(pPrior); pBt = (void**)pHdr; @@ -328,15 +328,15 @@ static void sqlite3MemFree(void *pPrior){ randomFill(z, sizeof(void*)*pHdr->nBacktraceSlots + sizeof(*pHdr) + (int)pHdr->iSize + sizeof(int) + pHdr->nTitle); free(z); - sqlite3_mutex_leave(mem.mutex); + sqlite3_mutex_leave(mem.mutex); } /* ** Change the size of an existing memory allocation. ** ** For this debugging implementation, we *always* make a copy of the -** allocation into a new place in memory. In this way, if the -** higher level code is using pointer to the old allocation, it is +** allocation into a new place in memory. In this way, if the +** higher level code is using pointer to the old allocation, it is ** much more likely to break and we are much more liking to find ** the error. */ @@ -470,7 +470,7 @@ void sqlite3MemdebugSync(){ } /* -** Open the file indicated and write a log of all unfreed memory +** Open the file indicated and write a log of all unfreed memory ** allocations into that log. */ void sqlite3MemdebugDump(const char *zFilename){ @@ -487,7 +487,7 @@ void sqlite3MemdebugDump(const char *zFilename){ for(pHdr=mem.pFirst; pHdr; pHdr=pHdr->pNext){ char *z = (char*)pHdr; z -= pHdr->nBacktraceSlots*sizeof(void*) + pHdr->nTitle; - fprintf(out, "**** %lld bytes at %p from %s ****\n", + fprintf(out, "**** %lld bytes at %p from %s ****\n", pHdr->iSize, &pHdr[1], pHdr->nTitle ? z : "???"); if( pHdr->nBacktrace ){ fflush(out); @@ -500,7 +500,7 @@ void sqlite3MemdebugDump(const char *zFilename){ fprintf(out, "COUNTS:\n"); for(i=0; i= M*(1 + log2(n)/2) - n + 1 @@ -51,7 +51,7 @@ #include "sqliteInt.h" /* -** This version of the memory allocator is used only when +** This version of the memory allocator is used only when ** SQLITE_ENABLE_MEMSYS5 is defined. */ #ifdef SQLITE_ENABLE_MEMSYS5 @@ -96,7 +96,7 @@ static SQLITE_WSD struct Mem5Global { int szAtom; /* Smallest possible allocation in bytes */ int nBlock; /* Number of szAtom sized blocks in zPool */ u8 *zPool; /* Memory available to be allocated */ - + /* ** Mutex to control access to the memory allocation subsystem. */ @@ -115,7 +115,7 @@ static SQLITE_WSD struct Mem5Global { u32 maxCount; /* Maximum instantaneous currentCount */ u32 maxRequest; /* Largest allocation (exclusive of internal frag) */ #endif - + /* ** Lists of free blocks. aiFreelist[0] is a list of free blocks of ** size mem5.szAtom. aiFreelist[1] holds blocks of size szAtom*2. @@ -291,7 +291,7 @@ static void memsys5FreeUnsafe(void *pOld){ u32 size, iLogsize; int iBlock; - /* Set iBlock to the index of the block pointed to by pOld in + /* Set iBlock to the index of the block pointed to by pOld in ** the array of mem5.szAtom byte blocks pointed to by mem5.zPool. */ iBlock = (int)(((u8 *)pOld-mem5.zPool)/mem5.szAtom); @@ -360,7 +360,7 @@ static void *memsys5Malloc(int nBytes){ p = memsys5MallocUnsafe(nBytes); memsys5Leave(); } - return (void*)p; + return (void*)p; } /* @@ -373,14 +373,14 @@ static void memsys5Free(void *pPrior){ assert( pPrior!=0 ); memsys5Enter(); memsys5FreeUnsafe(pPrior); - memsys5Leave(); + memsys5Leave(); } /* ** Change the size of an existing memory allocation. ** ** The outer layer memory allocator prevents this routine from -** being called with pPrior==0. +** being called with pPrior==0. ** ** nBytes is always a value obtained from a prior call to ** memsys5Round(). Hence nBytes is always a non-negative power @@ -513,7 +513,7 @@ static void memsys5Shutdown(void *NotUsed){ #ifdef SQLITE_TEST /* -** Open the file indicated and write a log of all unfreed memory +** Open the file indicated and write a log of all unfreed memory ** allocations into that log. */ void sqlite3Memsys5Dump(const char *zFilename){ @@ -555,7 +555,7 @@ void sqlite3Memsys5Dump(const char *zFilename){ #endif /* -** This routine is the only routine in this file with external +** This routine is the only routine in this file with external ** linkage. It returns a pointer to a static sqlite3_mem_methods ** struct populated with the memsys5 methods. */ diff --git a/third_party/sqlite/src/src/memjournal.c b/third_party/sqlite/src/src/memjournal.c index cd8b87d8aaeca..9753199b9b3df 100644 --- a/third_party/sqlite/src/src/memjournal.c +++ b/third_party/sqlite/src/src/memjournal.c @@ -106,7 +106,7 @@ static int memjrnlRead( assert( p->readpoint.iOffset==0 || p->readpoint.pChunk!=0 ); if( p->readpoint.iOffset!=iOfst || iOfst==0 ){ sqlite3_int64 iOff = 0; - for(pChunk=p->pFirst; + for(pChunk=p->pFirst; ALWAYS(pChunk) && (iOff+p->nChunkSize)<=iOfst; pChunk=pChunk->pNext ){ @@ -141,7 +141,7 @@ static void memjrnlFreeChunks(MemJournal *p){ for(pIter=p->pFirst; pIter; pIter=pNext){ pNext = pIter->pNext; sqlite3_free(pIter); - } + } p->pFirst = 0; } @@ -213,7 +213,7 @@ static int memjrnlWrite( ** access writes are not required. The only exception to this is when ** the in-memory journal is being used by a connection using the ** atomic-write optimization. In this case the first 28 bytes of the - ** journal file may be written as part of committing the transaction. */ + ** journal file may be written as part of committing the transaction. */ assert( iOfst==p->endpoint.iOffset || iOfst==0 ); #ifdef SQLITE_ENABLE_ATOMIC_WRITE if( iOfst==0 && p->pFirst ){ @@ -263,7 +263,7 @@ static int memjrnlWrite( ** ** If the journal file is already on disk, truncate it there. Or, if it ** is still in main memory but is being truncated to zero bytes in size, -** ignore +** ignore */ static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){ MemJournal *p = (MemJournal *)pJfd; @@ -290,8 +290,8 @@ static int memjrnlClose(sqlite3_file *pJfd){ /* ** Sync the file. ** -** If the real file has been created, call its xSync method. Otherwise, -** syncing an in-memory journal is a no-op. +** If the real file has been created, call its xSync method. Otherwise, +** syncing an in-memory journal is a no-op. */ static int memjrnlSync(sqlite3_file *pJfd, int flags){ UNUSED_PARAMETER2(pJfd, flags); @@ -332,11 +332,11 @@ static const struct sqlite3_io_methods MemJournalMethods = { 0 /* xUnfetch */ }; -/* -** Open a journal file. +/* +** Open a journal file. ** -** The behaviour of the journal file depends on the value of parameter -** nSpill. If nSpill is 0, then the journal file is always create and +** The behaviour of the journal file depends on the value of parameter +** nSpill. If nSpill is 0, then the journal file is always create and ** accessed using the underlying VFS. If nSpill is less than zero, then ** all content is always stored in main-memory. Finally, if nSpill is a ** positive value, then the journal file is initially created in-memory @@ -386,9 +386,9 @@ void sqlite3MemJournalOpen(sqlite3_file *pJfd){ #ifdef SQLITE_ENABLE_ATOMIC_WRITE /* -** If the argument p points to a MemJournal structure that is not an +** If the argument p points to a MemJournal structure that is not an ** in-memory-only journal file (i.e. is one that was opened with a +ve -** nSpill parameter), and the underlying file has not yet been created, +** nSpill parameter), and the underlying file has not yet been created, ** create it now. */ int sqlite3JournalCreate(sqlite3_file *p){ @@ -409,7 +409,7 @@ int sqlite3JournalIsInMemory(sqlite3_file *p){ return p->pMethods==&MemJournalMethods; } -/* +/* ** Return the number of bytes required to store a JournalFile that uses vfs ** pVfs to create the underlying on-disk files. */ diff --git a/third_party/sqlite/src/src/mutex.c b/third_party/sqlite/src/src/mutex.c index 6f1bc9767db8e..0a3d3d4e0462b 100644 --- a/third_party/sqlite/src/src/mutex.c +++ b/third_party/sqlite/src/src/mutex.c @@ -29,11 +29,11 @@ static SQLITE_WSD int mutexIsInit = 0; /* ** Initialize the mutex system. */ -int sqlite3MutexInit(void){ +int sqlite3MutexInit(void){ int rc = SQLITE_OK; if( !sqlite3GlobalConfig.mutex.xMutexAlloc ){ /* If the xMutexAlloc method has not been set, then the user did not - ** install a mutex implementation via sqlite3_config() prior to + ** install a mutex implementation via sqlite3_config() prior to ** sqlite3_initialize() being called. This block copies pointers to ** the default implementation into the sqlite3GlobalConfig structure. */ @@ -140,7 +140,7 @@ int sqlite3_mutex_try(sqlite3_mutex *p){ /* ** The sqlite3_mutex_leave() routine exits a mutex that was previously -** entered by the same thread. The behavior is undefined if the mutex +** entered by the same thread. The behavior is undefined if the mutex ** is not currently entered. If a NULL pointer is passed as an argument ** this function is a no-op. */ diff --git a/third_party/sqlite/src/src/mutex.h b/third_party/sqlite/src/src/mutex.h index 03eb1faadb67a..cb9589dcca2ef 100644 --- a/third_party/sqlite/src/src/mutex.h +++ b/third_party/sqlite/src/src/mutex.h @@ -56,9 +56,9 @@ */ #define sqlite3_mutex_alloc(X) ((sqlite3_mutex*)8) #define sqlite3_mutex_free(X) -#define sqlite3_mutex_enter(X) +#define sqlite3_mutex_enter(X) #define sqlite3_mutex_try(X) SQLITE_OK -#define sqlite3_mutex_leave(X) +#define sqlite3_mutex_leave(X) #define sqlite3_mutex_held(X) ((void)(X),1) #define sqlite3_mutex_notheld(X) ((void)(X),1) #define sqlite3MutexAlloc(X) ((sqlite3_mutex*)8) diff --git a/third_party/sqlite/src/src/mutex_noop.c b/third_party/sqlite/src/src/mutex_noop.c index ecc84b4a94aef..0766f683d08f0 100644 --- a/third_party/sqlite/src/src/mutex_noop.c +++ b/third_party/sqlite/src/src/mutex_noop.c @@ -37,9 +37,9 @@ */ static int noopMutexInit(void){ return SQLITE_OK; } static int noopMutexEnd(void){ return SQLITE_OK; } -static sqlite3_mutex *noopMutexAlloc(int id){ +static sqlite3_mutex *noopMutexAlloc(int id){ UNUSED_PARAMETER(id); - return (sqlite3_mutex*)8; + return (sqlite3_mutex*)8; } static void noopMutexFree(sqlite3_mutex *p){ UNUSED_PARAMETER(p); return; } static void noopMutexEnter(sqlite3_mutex *p){ UNUSED_PARAMETER(p); return; } @@ -104,7 +104,7 @@ static int debugMutexEnd(void){ return SQLITE_OK; } /* ** The sqlite3_mutex_alloc() routine allocates a new ** mutex and returns a pointer to it. If it returns NULL -** that means that a mutex could not be allocated. +** that means that a mutex could not be allocated. */ static sqlite3_mutex *debugMutexAlloc(int id){ static sqlite3_debug_mutex aStatic[SQLITE_MUTEX_STATIC_VFS3 - 1]; diff --git a/third_party/sqlite/src/src/mutex_unix.c b/third_party/sqlite/src/src/mutex_unix.c index 55d08c80522de..87258114ebdd6 100644 --- a/third_party/sqlite/src/src/mutex_unix.c +++ b/third_party/sqlite/src/src/mutex_unix.c @@ -63,7 +63,7 @@ struct sqlite3_mutex { ** there might be race conditions that can cause these routines to ** deliver incorrect results. In particular, if pthread_equal() is ** not an atomic operation, then these routines might delivery -** incorrect results. On most platforms, pthread_equal() is a +** incorrect results. On most platforms, pthread_equal() is a ** comparison of two integers and is therefore atomic. But we are ** told that HPUX is not such a platform. If so, then these routines ** will not always work correctly on HPUX. @@ -145,7 +145,7 @@ static int pthreadMutexEnd(void){ return SQLITE_OK; } ** ** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() -** returns a different mutex on every call. But for the static +** returns a different mutex on every call. But for the static ** mutex types, the same mutex is returned on every call that has ** the same type number. */ @@ -250,7 +250,7 @@ static void pthreadMutexEnter(sqlite3_mutex *p){ ** is atomic - that it cannot be deceived into thinking self ** and p->owner are equal if p->owner changes between two values ** that are not equal to self while the comparison is taking place. - ** This implementation also assumes a coherent cache - that + ** This implementation also assumes a coherent cache - that ** separate processes cannot read different values from the same ** address at the same time. If either of these two conditions ** are not met, then the mutexes will fail and problems will result. @@ -293,7 +293,7 @@ static int pthreadMutexTry(sqlite3_mutex *p){ ** is atomic - that it cannot be deceived into thinking self ** and p->owner are equal if p->owner changes between two values ** that are not equal to self while the comparison is taking place. - ** This implementation also assumes a coherent cache - that + ** This implementation also assumes a coherent cache - that ** separate processes cannot read different values from the same ** address at the same time. If either of these two conditions ** are not met, then the mutexes will fail and problems will result. diff --git a/third_party/sqlite/src/src/notify.c b/third_party/sqlite/src/src/notify.c index 8137226f35d7f..407d53d720fcd 100644 --- a/third_party/sqlite/src/src/notify.c +++ b/third_party/sqlite/src/src/notify.c @@ -41,13 +41,13 @@ static sqlite3 *SQLITE_WSD sqlite3BlockedList = 0; #ifndef NDEBUG /* -** This function is a complex assert() that verifies the following +** This function is a complex assert() that verifies the following ** properties of the blocked connections list: ** -** 1) Each entry in the list has a non-NULL value for either +** 1) Each entry in the list has a non-NULL value for either ** pUnlockConnection or pBlockingConnection, or both. ** -** 2) All entries in the list that share a common value for +** 2) All entries in the list that share a common value for ** xUnlockNotify are grouped together. ** ** 3) If the argument db is not NULL, then none of the entries in the @@ -99,8 +99,8 @@ static void addToBlockedList(sqlite3 *db){ sqlite3 **pp; assertMutexHeld(); for( - pp=&sqlite3BlockedList; - *pp && (*pp)->xUnlockNotify!=db->xUnlockNotify; + pp=&sqlite3BlockedList; + *pp && (*pp)->xUnlockNotify!=db->xUnlockNotify; pp=&(*pp)->pNextBlocked ); db->pNextBlocked = *pp; @@ -162,9 +162,9 @@ int sqlite3_unlock_notify( db->xUnlockNotify = 0; db->pUnlockArg = 0; }else if( 0==db->pBlockingConnection ){ - /* The blocking transaction has been concluded. Or there never was a + /* The blocking transaction has been concluded. Or there never was a ** blocking transaction. In either case, invoke the notify callback - ** immediately. + ** immediately. */ xNotify(&pArg, 1); }else{ @@ -190,7 +190,7 @@ int sqlite3_unlock_notify( } /* -** This function is called while stepping or preparing a statement +** This function is called while stepping or preparing a statement ** associated with connection db. The operation will return SQLITE_LOCKED ** to the user because it requires a lock that will not be available ** until connection pBlocker concludes its current transaction. @@ -206,7 +206,7 @@ void sqlite3ConnectionBlocked(sqlite3 *db, sqlite3 *pBlocker){ /* ** This function is called when -** the transaction opened by database db has just finished. Locks held +** the transaction opened by database db has just finished. Locks held ** by database connection db have been released. ** ** This function loops through each entry in the blocked connections @@ -266,7 +266,7 @@ void sqlite3ConnectionUnlocked(sqlite3 *db){ }else{ /* This occurs when the array of context pointers that need to ** be passed to the unlock-notify callback is larger than the - ** aStatic[] array allocated on the stack and the attempt to + ** aStatic[] array allocated on the stack and the attempt to ** allocate a larger array from the heap has failed. ** ** This is a difficult situation to handle. Returning an error @@ -274,17 +274,17 @@ void sqlite3ConnectionUnlocked(sqlite3 *db){ ** is returned the transaction on connection db will still be ** closed and the unlock-notify callbacks on blocked connections ** will go unissued. This might cause the application to wait - ** indefinitely for an unlock-notify callback that will never + ** indefinitely for an unlock-notify callback that will never ** arrive. ** ** Instead, invoke the unlock-notify callback with the context ** array already accumulated. We can then clear the array and - ** begin accumulating any further context pointers without + ** begin accumulating any further context pointers without ** requiring any dynamic allocation. This is sub-optimal because ** it means that instead of one callback with a large array of ** context pointers the application will receive two or more ** callbacks with smaller arrays of context pointers, which will - ** reduce the applications ability to prioritize multiple + ** reduce the applications ability to prioritize multiple ** connections. But it is the best that can be done under the ** circumstances. */ @@ -319,7 +319,7 @@ void sqlite3ConnectionUnlocked(sqlite3 *db){ } /* -** This is called when the database connection passed as an argument is +** This is called when the database connection passed as an argument is ** being closed. The connection is removed from the blocked list. */ void sqlite3ConnectionClosed(sqlite3 *db){ diff --git a/third_party/sqlite/src/src/os.h b/third_party/sqlite/src/src/os.h index 947f88b36e4d2..52d3a4904751b 100644 --- a/third_party/sqlite/src/src/os.h +++ b/third_party/sqlite/src/src/os.h @@ -52,10 +52,10 @@ ** 2006-10-31: The default prefix used to be "sqlite_". But then ** Mcafee started using SQLite in their anti-virus product and it ** started putting files with the "sqlite" name in the c:/temp folder. -** This annoyed many windows users. Those users would then do a +** This annoyed many windows users. Those users would then do a ** Google search for "sqlite", find the telephone numbers of the ** developers and call to wake them up at night and complain. -** For this reason, the default name prefix is changed to be "sqlite" +** For this reason, the default name prefix is changed to be "sqlite" ** spelled backwards. So the temp files are still identified, but ** anybody smart enough to figure out the code is also likely smart ** enough to know that calling the developer will not help get rid @@ -96,9 +96,9 @@ ** UnlockFile(). ** ** LockFile() prevents not just writing but also reading by other processes. -** A SHARED_LOCK is obtained by locking a single randomly-chosen -** byte out of a specific range of bytes. The lock byte is obtained at -** random so two separate readers can probably access the file at the +** A SHARED_LOCK is obtained by locking a single randomly-chosen +** byte out of a specific range of bytes. The lock byte is obtained at +** random so two separate readers can probably access the file at the ** same time, unless they are unlucky and choose the same lock byte. ** An EXCLUSIVE_LOCK is obtained by locking all bytes in the range. ** There can only be one writer. A RESERVED_LOCK is obtained by locking @@ -117,7 +117,7 @@ ** The following #defines specify the range of bytes used for locking. ** SHARED_SIZE is the number of bytes available in the pool from which ** a random byte is selected for a shared lock. The pool of bytes for -** shared locks begins at SHARED_FIRST. +** shared locks begins at SHARED_FIRST. ** ** The same locking strategy and ** byte ranges are used for Unix. This leaves open the possibility of having @@ -133,7 +133,7 @@ ** that all locks will fit on a single page even at the minimum page size. ** PENDING_BYTE defines the beginning of the locks. By default PENDING_BYTE ** is set high so that we don't have to allocate an unused page except -** for very large databases. But one should test the page skipping logic +** for very large databases. But one should test the page skipping logic ** by setting PENDING_BYTE low and running the entire regression suite. ** ** Changing the value of PENDING_BYTE results in a subtly incompatible @@ -157,8 +157,8 @@ */ int sqlite3OsInit(void); -/* -** Functions for accessing sqlite3_file methods +/* +** Functions for accessing sqlite3_file methods */ void sqlite3OsClose(sqlite3_file*); int sqlite3OsRead(sqlite3_file*, void*, int amt, i64 offset); @@ -182,8 +182,8 @@ int sqlite3OsFetch(sqlite3_file *id, i64, int, void **); int sqlite3OsUnfetch(sqlite3_file *, i64, void *); -/* -** Functions for accessing sqlite3_vfs methods +/* +** Functions for accessing sqlite3_vfs methods */ int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *); int sqlite3OsDelete(sqlite3_vfs *, const char *, int); @@ -201,7 +201,7 @@ int sqlite3OsGetLastError(sqlite3_vfs*); int sqlite3OsCurrentTimeInt64(sqlite3_vfs *, sqlite3_int64*); /* -** Convenience functions for opening and closing files using +** Convenience functions for opening and closing files using ** sqlite3_malloc() to obtain space for the file-handle structure. */ int sqlite3OsOpenMalloc(sqlite3_vfs *, const char *, sqlite3_file **, int,int*); diff --git a/third_party/sqlite/src/src/os_unix.c b/third_party/sqlite/src/src/os_unix.c index 60981af7e738e..44f6d67ee07f3 100644 --- a/third_party/sqlite/src/src/os_unix.c +++ b/third_party/sqlite/src/src/os_unix.c @@ -61,7 +61,7 @@ ** Styles 4, 5, and 7 are only available of SQLITE_ENABLE_LOCKING_STYLE ** is defined to 1. The SQLITE_ENABLE_LOCKING_STYLE also enables automatic ** selection of the appropriate locking style based on the filesystem -** where the database is located. +** where the database is located. */ #if !defined(SQLITE_ENABLE_LOCKING_STYLE) # if defined(__APPLE__) @@ -172,7 +172,7 @@ #define osGetpid(X) (pid_t)getpid() /* -** Only set the lastErrno if the error code is a real error and not +** Only set the lastErrno if the error code is a real error and not ** a normal expected return code of SQLITE_BUSY or SQLITE_OK */ #define IS_LOCK_ERROR(x) ((x != SQLITE_OK) && (x != SQLITE_BUSY)) @@ -239,7 +239,7 @@ struct unixFile { ** whenever any part of the database changes. An assertion fault will ** occur if a file is updated without also updating the transaction ** counter. This test is made to avoid new problems similar to the - ** one described by ticket #3584. + ** one described by ticket #3584. */ unsigned char transCntrChng; /* True if the transaction counter changed */ unsigned char dbUpdate; /* True if any part of database file changed */ @@ -248,7 +248,7 @@ struct unixFile { #endif #ifdef SQLITE_TEST - /* In test mode, increase the size of this structure a bit so that + /* In test mode, increase the size of this structure a bit so that ** it is larger than the struct CrashFile defined in test6.c. */ char aPadding[32]; @@ -379,7 +379,7 @@ static struct unix_syscall { #ifdef __DJGPP__ { "fstat", 0, 0 }, #define osFstat(a,b,c) 0 -#else +#else { "fstat", (sqlite3_syscall_ptr)fstat, 0 }, #define osFstat ((int(*)(int,struct stat*))aSyscall[5].pCurrent) #endif @@ -601,7 +601,7 @@ static const char *unixNextSystemCall(sqlite3_vfs *p, const char *zName){ /* ** Do not accept any file descriptor less than this value, in order to avoid -** opening database file using file descriptors that are commonly used for +** opening database file using file descriptors that are commonly used for ** standard input, output, and error. */ #ifndef SQLITE_MINIMUM_FILE_DESCRIPTOR @@ -640,7 +640,7 @@ static int robust_open(const char *z, int f, mode_t m){ } if( fd>=SQLITE_MINIMUM_FILE_DESCRIPTOR ) break; osClose(fd); - sqlite3_log(SQLITE_WARNING, + sqlite3_log(SQLITE_WARNING, "attempt to open \"%s\" as file descriptor %d", z, fd); fd = -1; if( osOpen("/dev/null", f, m)<0 ) break; @@ -648,9 +648,9 @@ static int robust_open(const char *z, int f, mode_t m){ if( fd>=0 ){ if( m!=0 ){ struct stat statbuf; - if( osFstat(fd, &statbuf)==0 + if( osFstat(fd, &statbuf)==0 && statbuf.st_size==0 - && (statbuf.st_mode&0777)!=m + && (statbuf.st_mode&0777)!=m ){ osFchmod(fd, m); } @@ -665,11 +665,11 @@ static int robust_open(const char *z, int f, mode_t m){ /* ** Helper functions to obtain and relinquish the global mutex. The ** global mutex is used to protect the unixInodeInfo and -** vxworksFileId objects used by this file, all of which may be +** vxworksFileId objects used by this file, all of which may be ** shared by multiple threads. ** -** Function unixMutexHeld() is used to assert() that the global mutex -** is held when required. This function is only used as part of assert() +** Function unixMutexHeld() is used to assert() that the global mutex +** is held when required. This function is only used as part of assert() ** statements. e.g. ** ** unixEnterMutex() @@ -777,7 +777,7 @@ static int lockTrace(int fd, int op, struct flock *p){ static int robust_ftruncate(int h, sqlite3_int64 sz){ int rc; #ifdef __ANDROID__ - /* On Android, ftruncate() always uses 32-bit offsets, even if + /* On Android, ftruncate() always uses 32-bit offsets, even if ** _FILE_OFFSET_BITS=64 is defined. This means it is unsafe to attempt to ** truncate a file to any size larger than 2GiB. Silently ignore any ** such attempts. */ @@ -793,32 +793,32 @@ static int robust_ftruncate(int h, sqlite3_int64 sz){ ** This routine translates a standard POSIX errno code into something ** useful to the clients of the sqlite3 functions. Specifically, it is ** intended to translate a variety of "try again" errors into SQLITE_BUSY -** and a variety of "please close the file descriptor NOW" errors into +** and a variety of "please close the file descriptor NOW" errors into ** SQLITE_IOERR -** +** ** Errors during initialization of locks, or file system support for locks, ** should handle ENOLCK, ENOTSUP, EOPNOTSUPP separately. */ static int sqliteErrorFromPosixError(int posixError, int sqliteIOErr) { - assert( (sqliteIOErr == SQLITE_IOERR_LOCK) || - (sqliteIOErr == SQLITE_IOERR_UNLOCK) || + assert( (sqliteIOErr == SQLITE_IOERR_LOCK) || + (sqliteIOErr == SQLITE_IOERR_UNLOCK) || (sqliteIOErr == SQLITE_IOERR_RDLOCK) || (sqliteIOErr == SQLITE_IOERR_CHECKRESERVEDLOCK) ); switch (posixError) { - case EACCES: + case EACCES: case EAGAIN: case ETIMEDOUT: case EBUSY: case EINTR: - case ENOLCK: - /* random NFS retry error, unless during file system support + case ENOLCK: + /* random NFS retry error, unless during file system support * introspection, in which it actually means what it says */ return SQLITE_BUSY; - - case EPERM: + + case EPERM: return SQLITE_PERM; - - default: + + default: return sqliteIOErr; } } @@ -833,7 +833,7 @@ static int sqliteErrorFromPosixError(int posixError, int sqliteIOErr) { ** ** A pointer to an instance of the following structure can be used as a ** unique file ID in VxWorks. Each instance of this structure contains -** a copy of the canonical filename. There is also a reference count. +** a copy of the canonical filename. There is also a reference count. ** The structure is reclaimed when the number of pointers to it drops to ** zero. ** @@ -849,7 +849,7 @@ struct vxworksFileId { }; #if OS_VXWORKS -/* +/* ** All unique filenames are held on a linked list headed by this ** variable: */ @@ -921,7 +921,7 @@ static struct vxworksFileId *vxworksFindFileId(const char *zAbsoluteName){ */ unixEnterMutex(); for(pCandidate=vxworksFileList; pCandidate; pCandidate=pCandidate->pNext){ - if( pCandidate->nName==n + if( pCandidate->nName==n && memcmp(pCandidate->zCanonicalName, pNew->zCanonicalName, n)==0 ){ sqlite3_free(pNew); @@ -1014,7 +1014,7 @@ static void vxworksReleaseFileId(struct vxworksFileId *pId){ ** cnt>0 means there are cnt shared locks on the file. ** ** Any attempt to lock or unlock a file first checks the locking -** structure. The fcntl() system call is only invoked to set a +** structure. The fcntl() system call is only invoked to set a ** POSIX lock if the internal lock structure transitions between ** a locked and an unlocked state. ** @@ -1047,7 +1047,7 @@ static void vxworksReleaseFileId(struct vxworksFileId *pId){ ** ** SQLite used to support LinuxThreads. But support for LinuxThreads ** was dropped beginning with version 3.7.0. SQLite will still work with -** LinuxThreads provided that (1) there is no more than one connection +** LinuxThreads provided that (1) there is no more than one connection ** per database file in the same process and (2) database connections ** do not move across threads. */ @@ -1064,7 +1064,7 @@ struct unixFileId { /* We are told that some versions of Android contain a bug that ** sizes ino_t at only 32-bits instead of 64-bits. (See ** https://android-review.googlesource.com/#/c/115351/3/dist/sqlite3.c) - ** To work around this, always allocate 64-bits for the inode number. + ** To work around this, always allocate 64-bits for the inode number. ** On small machines that only have 32-bit inodes, this wastes 4 bytes, ** but that should not be a big deal. */ /* WAS: ino_t ino; */ @@ -1117,7 +1117,7 @@ static unixInodeInfo *inodeList = 0; ** strerror_r(). ** ** The first argument passed to the macro should be the error code that -** will be returned to SQLite (e.g. SQLITE_IOERR_DELETE, SQLITE_CANTOPEN). +** will be returned to SQLite (e.g. SQLITE_IOERR_DELETE, SQLITE_CANTOPEN). ** The two subsequent arguments should be the name of the OS function that ** failed (e.g. "unlink", "open") and the associated file-system path, ** if any. @@ -1135,7 +1135,7 @@ static int unixLogErrorAtLine( /* If this is not a threadsafe build (SQLITE_THREADSAFE==0), then use ** the strerror() function to obtain the human-readable error message ** equivalent to errno. Otherwise, use strerror_r(). - */ + */ #if SQLITE_THREADSAFE && defined(HAVE_STRERROR_R) char aErr[80]; memset(aErr, 0, sizeof(aErr)); @@ -1143,18 +1143,18 @@ static int unixLogErrorAtLine( /* If STRERROR_R_CHAR_P (set by autoconf scripts) or __USE_GNU is defined, ** assume that the system provides the GNU version of strerror_r() that - ** returns a pointer to a buffer containing the error message. That pointer - ** may point to aErr[], or it may point to some static storage somewhere. - ** Otherwise, assume that the system provides the POSIX version of + ** returns a pointer to a buffer containing the error message. That pointer + ** may point to aErr[], or it may point to some static storage somewhere. + ** Otherwise, assume that the system provides the POSIX version of ** strerror_r(), which always writes an error message into aErr[]. ** ** If the code incorrectly assumes that it is the POSIX version that is ** available, the error message will often be an empty string. Not a - ** huge problem. Incorrectly concluding that the GNU version is available + ** huge problem. Incorrectly concluding that the GNU version is available ** could lead to a segfault though. */ #if defined(STRERROR_R_CHAR_P) || defined(__USE_GNU) - zErr = + zErr = # endif strerror_r(iErrno, aErr, sizeof(aErr)-1); @@ -1205,7 +1205,7 @@ static void storeLastErrno(unixFile *pFile, int error){ /* ** Close all file descriptors accumuated in the unixInodeInfo->pUnused list. -*/ +*/ static void closePendingFds(unixFile *pFile){ unixInodeInfo *pInode = pFile->pInode; UnixUnusedFd *p; @@ -1353,7 +1353,7 @@ static int fileHasMoved(unixFile *pFile){ return 0; return pFile->pInode!=0 && - (osStat(pFile->zPath, &buf)!=0 + (osStat(pFile->zPath, &buf)!=0 || (u64)buf.st_ino!=pFile->pInode->fileId.ino); #endif } @@ -1434,7 +1434,7 @@ static int unixCheckReservedLock(sqlite3_file *id, int *pResOut){ } } #endif - + unixLeaveMutex(); OSTRACE(("TEST WR-LOCK %d %d %d (unix)\n", pFile->h, rc, reserved)); @@ -1443,7 +1443,7 @@ static int unixCheckReservedLock(sqlite3_file *id, int *pResOut){ } /* -** Attempt to set a system-lock on the file pFile. The lock is +** Attempt to set a system-lock on the file pFile. The lock is ** described by pLock. ** ** If the pFile was opened read/write from unix-excl, then the only lock @@ -1535,7 +1535,7 @@ static int unixLock(sqlite3_file *id, int eFileLock){ ** ** A process may only obtain a RESERVED lock after it has a SHARED lock. ** A RESERVED lock is implemented by grabbing a write-lock on the - ** 'reserved byte'. + ** 'reserved byte'. ** ** A process may only obtain a PENDING lock after it has obtained a ** SHARED lock. A PENDING lock is implemented by obtaining a write-lock @@ -1549,7 +1549,7 @@ static int unixLock(sqlite3_file *id, int eFileLock){ ** implemented by obtaining a write-lock on the entire 'shared byte ** range'. Since all other locks require a read-lock on one of the bytes ** within this range, this ensures that no other locks are held on the - ** database. + ** database. */ int rc = SQLITE_OK; unixFile *pFile = (unixFile*)id; @@ -1590,7 +1590,7 @@ static int unixLock(sqlite3_file *id, int eFileLock){ /* If some thread using this PID has a lock via a different unixFile* ** handle that precludes the requested lock, return BUSY. */ - if( (pFile->eFileLock!=pInode->eFileLock && + if( (pFile->eFileLock!=pInode->eFileLock && (pInode->eFileLock>=PENDING_LOCK || eFileLock>SHARED_LOCK)) ){ rc = SQLITE_BUSY; @@ -1601,7 +1601,7 @@ static int unixLock(sqlite3_file *id, int eFileLock){ ** has a SHARED or RESERVED lock, then increment reference counts and ** return SQLITE_OK. */ - if( eFileLock==SHARED_LOCK && + if( eFileLock==SHARED_LOCK && (pInode->eFileLock==SHARED_LOCK || pInode->eFileLock==RESERVED_LOCK) ){ assert( eFileLock==SHARED_LOCK ); assert( pFile->eFileLock==0 ); @@ -1619,7 +1619,7 @@ static int unixLock(sqlite3_file *id, int eFileLock){ */ lock.l_len = 1L; lock.l_whence = SEEK_SET; - if( eFileLock==SHARED_LOCK + if( eFileLock==SHARED_LOCK || (eFileLock==EXCLUSIVE_LOCK && pFile->eFileLockh, azFileLock(eFileLock), + OSTRACE(("LOCK %d %s %s (unix)\n", pFile->h, azFileLock(eFileLock), rc==SQLITE_OK ? "ok" : "failed")); return rc; } @@ -1753,11 +1753,11 @@ static void setPendingFd(unixFile *pFile){ ** ** If the locking level of the file descriptor is already at or below ** the requested locking level, this routine is a no-op. -** +** ** If handleNFSUnlock is true, then on downgrading an EXCLUSIVE_LOCK to SHARED ** the byte range is divided into 2 parts and the first part is unlocked then -** set to a read lock, then the other part is simply unlocked. This works -** around a bug in BSD NFS lockd (also seen on MacOSX 10.3+) that fails to +** set to a read lock, then the other part is simply unlocked. This works +** around a bug in BSD NFS lockd (also seen on MacOSX 10.3+) that fails to ** remove the write lock on a region when a read lock is set. */ static int posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnlock){ @@ -1795,7 +1795,7 @@ static int posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnlock){ /* downgrading to a shared lock on NFS involves clearing the write lock ** before establishing the readlock - to avoid a race condition we downgrade - ** the lock in 2 blocks, so that part of the range will be covered by a + ** the lock in 2 blocks, so that part of the range will be covered by a ** write lock until the rest is covered by a read lock: ** 1: [WWWWW] ** 2: [....W] @@ -1811,7 +1811,7 @@ static int posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnlock){ if( handleNFSUnlock ){ int tErrno; /* Error code from system call errors */ off_t divSize = SHARED_SIZE - 1; - + lock.l_type = F_UNLCK; lock.l_whence = SEEK_SET; lock.l_start = SHARED_FIRST; @@ -1853,11 +1853,11 @@ static int posixUnlock(sqlite3_file *id, int eFileLock, int handleNFSUnlock){ lock.l_len = SHARED_SIZE; if( unixFileLock(pFile, &lock) ){ /* In theory, the call to unixFileLock() cannot fail because another - ** process is holding an incompatible lock. If it does, this + ** process is holding an incompatible lock. If it does, this ** indicates that the other process is not following the locking ** protocol. If this happens, return SQLITE_IOERR_RDLOCK. Returning - ** SQLITE_BUSY would confuse the upper layer (in practice it causes - ** an assert to fail). */ + ** SQLITE_BUSY would confuse the upper layer (in practice it causes + ** an assert to fail). */ rc = SQLITE_IOERR_RDLOCK; storeLastErrno(pFile, errno); goto end_unlock; @@ -1933,7 +1933,7 @@ static void unixUnmapfile(unixFile *pFd); #endif /* -** This function performs the parts of the "close file" operation +** This function performs the parts of the "close file" operation ** common to all locking schemes. It closes the directory and file ** handles, if they are valid, and sets all fields of the unixFile ** structure to 0. @@ -1991,7 +1991,7 @@ static int unixClose(sqlite3_file *id){ if( ALWAYS(pFile->pInode) && pFile->pInode->nLock ){ /* If there are outstanding locks, do not actually close the file just ** yet because that would clear those locks. Instead, add the file - ** descriptor to pInode->pUnused list. It will be automatically closed + ** descriptor to pInode->pUnused list. It will be automatically closed ** when the last lock is cleared. */ setPendingFd(pFile); @@ -2090,7 +2090,7 @@ static int dotlockCheckReservedLock(sqlite3_file *id, int *pResOut) { unixFile *pFile = (unixFile*)id; SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); - + assert( pFile ); reserved = osAccess((const char*)pFile->lockingContext, 0)==0; OSTRACE(("TEST WR-LOCK %d %d %d (dotlock)\n", pFile->h, rc, reserved)); @@ -2144,7 +2144,7 @@ static int dotlockLock(sqlite3_file *id, int eFileLock) { #endif return SQLITE_OK; } - + /* grab an exclusive lock */ rc = osMkdir(zLockFile, 0777); if( rc<0 ){ @@ -2159,8 +2159,8 @@ static int dotlockLock(sqlite3_file *id, int eFileLock) { } } return rc; - } - + } + /* got it, set the type and return ok */ pFile->eFileLock = eFileLock; return rc; @@ -2184,7 +2184,7 @@ static int dotlockUnlock(sqlite3_file *id, int eFileLock) { OSTRACE(("UNLOCK %d %d was %d pid=%d (dotlock)\n", pFile->h, eFileLock, pFile->eFileLock, osGetpid(0))); assert( eFileLock<=SHARED_LOCK ); - + /* no-op if possible */ if( pFile->eFileLock==eFileLock ){ return SQLITE_OK; @@ -2197,7 +2197,7 @@ static int dotlockUnlock(sqlite3_file *id, int eFileLock) { pFile->eFileLock = SHARED_LOCK; return SQLITE_OK; } - + /* To fully unlock the database, delete the lock file */ assert( eFileLock==NO_LOCK ); rc = osRmdir(zLockFile); @@ -2209,7 +2209,7 @@ static int dotlockUnlock(sqlite3_file *id, int eFileLock) { rc = SQLITE_IOERR_UNLOCK; storeLastErrno(pFile, tErrno); } - return rc; + return rc; } pFile->eFileLock = NO_LOCK; return SQLITE_OK; @@ -2256,7 +2256,7 @@ static int robust_flock(int fd, int op){ #else # define robust_flock(a,b) flock(a,b) #endif - + /* ** This routine checks if there is a RESERVED lock held on the specified @@ -2268,16 +2268,16 @@ static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){ int rc = SQLITE_OK; int reserved = 0; unixFile *pFile = (unixFile*)id; - + SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); - + assert( pFile ); - + /* Check if a thread in this process holds such a lock */ if( pFile->eFileLock>SHARED_LOCK ){ reserved = 1; } - + /* Otherwise see if some other process holds it. */ if( !reserved ){ /* attempt to get the lock */ @@ -2288,7 +2288,7 @@ static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){ if ( lrc ) { int tErrno = errno; /* unlock failed with an error */ - lrc = SQLITE_IOERR_UNLOCK; + lrc = SQLITE_IOERR_UNLOCK; storeLastErrno(pFile, tErrno); rc = lrc; } @@ -2296,7 +2296,7 @@ static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){ int tErrno = errno; reserved = 1; /* someone else might have it reserved */ - lrc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_LOCK); + lrc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_LOCK); if( IS_LOCK_ERROR(lrc) ){ storeLastErrno(pFile, tErrno); rc = lrc; @@ -2350,15 +2350,15 @@ static int flockLock(sqlite3_file *id, int eFileLock) { assert( pFile ); - /* if we already have a lock, it is exclusive. + /* if we already have a lock, it is exclusive. ** Just adjust level and punt on outta here. */ if (pFile->eFileLock > NO_LOCK) { pFile->eFileLock = eFileLock; return SQLITE_OK; } - + /* grab an exclusive lock */ - + if (robust_flock(pFile->h, LOCK_EX | LOCK_NB)) { int tErrno = errno; /* didn't get, must be busy */ @@ -2370,7 +2370,7 @@ static int flockLock(sqlite3_file *id, int eFileLock) { /* got it, set the type and return ok */ pFile->eFileLock = eFileLock; } - OSTRACE(("LOCK %d %s %s (flock)\n", pFile->h, azFileLock(eFileLock), + OSTRACE(("LOCK %d %s %s (flock)\n", pFile->h, azFileLock(eFileLock), rc==SQLITE_OK ? "ok" : "failed")); #ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS if( (rc & SQLITE_IOERR) == SQLITE_IOERR ){ @@ -2390,23 +2390,23 @@ static int flockLock(sqlite3_file *id, int eFileLock) { */ static int flockUnlock(sqlite3_file *id, int eFileLock) { unixFile *pFile = (unixFile*)id; - + assert( pFile ); OSTRACE(("UNLOCK %d %d was %d pid=%d (flock)\n", pFile->h, eFileLock, pFile->eFileLock, osGetpid(0))); assert( eFileLock<=SHARED_LOCK ); - + /* no-op if possible */ if( pFile->eFileLock==eFileLock ){ return SQLITE_OK; } - + /* shared can just be set because we always have an exclusive */ if (eFileLock==SHARED_LOCK) { pFile->eFileLock = eFileLock; return SQLITE_OK; } - + /* no, really, unlock. */ if( robust_flock(pFile->h, LOCK_UN) ){ #ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS @@ -2457,14 +2457,14 @@ static int semXCheckReservedLock(sqlite3_file *id, int *pResOut) { unixFile *pFile = (unixFile*)id; SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); - + assert( pFile ); /* Check if a thread in this process holds such a lock */ if( pFile->eFileLock>SHARED_LOCK ){ reserved = 1; } - + /* Otherwise see if some other process holds it. */ if( !reserved ){ sem_t *pSem = pFile->pInode->pSem; @@ -2523,14 +2523,14 @@ static int semXLock(sqlite3_file *id, int eFileLock) { sem_t *pSem = pFile->pInode->pSem; int rc = SQLITE_OK; - /* if we already have a lock, it is exclusive. + /* if we already have a lock, it is exclusive. ** Just adjust level and punt on outta here. */ if (pFile->eFileLock > NO_LOCK) { pFile->eFileLock = eFileLock; rc = SQLITE_OK; goto sem_end_lock; } - + /* lock semaphore now but bail out when already locked. */ if( sem_trywait(pSem)==-1 ){ rc = SQLITE_BUSY; @@ -2560,18 +2560,18 @@ static int semXUnlock(sqlite3_file *id, int eFileLock) { OSTRACE(("UNLOCK %d %d was %d pid=%d (sem)\n", pFile->h, eFileLock, pFile->eFileLock, osGetpid(0))); assert( eFileLock<=SHARED_LOCK ); - + /* no-op if possible */ if( pFile->eFileLock==eFileLock ){ return SQLITE_OK; } - + /* shared can just be set because we always have an exclusive */ if (eFileLock==SHARED_LOCK) { pFile->eFileLock = eFileLock; return SQLITE_OK; } - + /* no, really unlock. */ if ( sem_post(pSem)==-1 ) { int rc, tErrno = errno; @@ -2579,7 +2579,7 @@ static int semXUnlock(sqlite3_file *id, int eFileLock) { if( IS_LOCK_ERROR(rc) ){ storeLastErrno(pFile, tErrno); } - return rc; + return rc; } pFile->eFileLock = NO_LOCK; return SQLITE_OK; @@ -2644,7 +2644,7 @@ struct ByteRangeLockPB2 /* ** This is a utility for setting or clearing a bit-range lock on an ** AFP filesystem. -** +** ** Return SQLITE_OK on success, SQLITE_BUSY on failure. */ static int afpSetLock( @@ -2656,14 +2656,14 @@ static int afpSetLock( ){ struct ByteRangeLockPB2 pb; int err; - + pb.unLockFlag = setLockFlag ? 0 : 1; pb.startEndFlag = 0; pb.offset = offset; - pb.length = length; + pb.length = length; pb.fd = pFile->h; - - OSTRACE(("AFPSETLOCK [%s] for %d%s in range %llx:%llx\n", + + OSTRACE(("AFPSETLOCK [%s] for %d%s in range %llx:%llx\n", (setLockFlag?"ON":"OFF"), pFile->h, (pb.fd==-1?"[testval-1]":""), offset, length)); err = fsctl(path, afpfsByteRangeLock2FSCTL, &pb, 0); @@ -2698,9 +2698,9 @@ static int afpCheckReservedLock(sqlite3_file *id, int *pResOut){ int reserved = 0; unixFile *pFile = (unixFile*)id; afpLockingContext *context; - + SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); - + assert( pFile ); context = (afpLockingContext *) pFile->lockingContext; if( context->reserved ){ @@ -2708,17 +2708,17 @@ static int afpCheckReservedLock(sqlite3_file *id, int *pResOut){ return SQLITE_OK; } unixEnterMutex(); /* Because pFile->pInode is shared across threads */ - + /* Check if a thread in this process holds such a lock */ if( pFile->pInode->eFileLock>SHARED_LOCK ){ reserved = 1; } - + /* Otherwise see if some other process holds it. */ if( !reserved ){ /* lock the RESERVED byte */ - int lrc = afpSetLock(context->dbPath, pFile, RESERVED_BYTE, 1,1); + int lrc = afpSetLock(context->dbPath, pFile, RESERVED_BYTE, 1,1); if( SQLITE_OK==lrc ){ /* if we succeeded in taking the reserved lock, unlock it to restore ** the original state */ @@ -2731,10 +2731,10 @@ static int afpCheckReservedLock(sqlite3_file *id, int *pResOut){ rc=lrc; } } - + unixLeaveMutex(); OSTRACE(("TEST WR-LOCK %d %d %d (afp)\n", pFile->h, rc, reserved)); - + *pResOut = reserved; return rc; } @@ -2768,7 +2768,7 @@ static int afpLock(sqlite3_file *id, int eFileLock){ unixFile *pFile = (unixFile*)id; unixInodeInfo *pInode = pFile->pInode; afpLockingContext *context = (afpLockingContext *) pFile->lockingContext; - + assert( pFile ); OSTRACE(("LOCK %d %s was %s(%s,%d) pid=%d (afp)\n", pFile->h, azFileLock(eFileLock), azFileLock(pFile->eFileLock), @@ -2792,7 +2792,7 @@ static int afpLock(sqlite3_file *id, int eFileLock){ assert( pFile->eFileLock!=NO_LOCK || eFileLock==SHARED_LOCK ); assert( eFileLock!=PENDING_LOCK ); assert( eFileLock!=RESERVED_LOCK || pFile->eFileLock==SHARED_LOCK ); - + /* This mutex is needed because pFile->pInode is shared across threads */ unixEnterMutex(); @@ -2801,18 +2801,18 @@ static int afpLock(sqlite3_file *id, int eFileLock){ /* If some thread using this PID has a lock via a different unixFile* ** handle that precludes the requested lock, return BUSY. */ - if( (pFile->eFileLock!=pInode->eFileLock && + if( (pFile->eFileLock!=pInode->eFileLock && (pInode->eFileLock>=PENDING_LOCK || eFileLock>SHARED_LOCK)) ){ rc = SQLITE_BUSY; goto afp_end_lock; } - + /* If a SHARED lock is requested, and some thread using this PID already ** has a SHARED or RESERVED lock, then increment reference counts and ** return SQLITE_OK. */ - if( eFileLock==SHARED_LOCK && + if( eFileLock==SHARED_LOCK && (pInode->eFileLock==SHARED_LOCK || pInode->eFileLock==RESERVED_LOCK) ){ assert( eFileLock==SHARED_LOCK ); assert( pFile->eFileLock==0 ); @@ -2822,12 +2822,12 @@ static int afpLock(sqlite3_file *id, int eFileLock){ pInode->nLock++; goto afp_end_lock; } - + /* A PENDING lock is needed before acquiring a SHARED lock and before ** acquiring an EXCLUSIVE lock. For the SHARED lock, the PENDING will ** be released. */ - if( eFileLock==SHARED_LOCK + if( eFileLock==SHARED_LOCK || (eFileLock==EXCLUSIVE_LOCK && pFile->eFileLocknShared==0 ); assert( pInode->eFileLock==0 ); - + mask = (sizeof(long)==8) ? LARGEST_INT64 : 0x7fffffff; /* Now get the read-lock SHARED_LOCK */ /* note that the quality of the randomness doesn't matter that much */ - lk = random(); + lk = random(); pInode->sharedByte = (lk & mask)%(SHARED_SIZE - 1); - lrc1 = afpSetLock(context->dbPath, pFile, + lrc1 = afpSetLock(context->dbPath, pFile, SHARED_FIRST+pInode->sharedByte, 1, 1); if( IS_LOCK_ERROR(lrc1) ){ lrc1Errno = pFile->lastErrno; } /* Drop the temporary PENDING lock */ lrc2 = afpSetLock(context->dbPath, pFile, PENDING_BYTE, 1, 0); - + if( IS_LOCK_ERROR(lrc1) ) { storeLastErrno(pFile, lrc1Errno); rc = lrc1; @@ -2895,34 +2895,34 @@ static int afpLock(sqlite3_file *id, int eFileLock){ } if (!failed && eFileLock == EXCLUSIVE_LOCK) { /* Acquire an EXCLUSIVE lock */ - - /* Remove the shared lock before trying the range. we'll need to + + /* Remove the shared lock before trying the range. we'll need to ** reestablish the shared lock if we can't get the afpUnlock */ if( !(failed = afpSetLock(context->dbPath, pFile, SHARED_FIRST + pInode->sharedByte, 1, 0)) ){ int failed2 = SQLITE_OK; /* now attemmpt to get the exclusive lock range */ - failed = afpSetLock(context->dbPath, pFile, SHARED_FIRST, + failed = afpSetLock(context->dbPath, pFile, SHARED_FIRST, SHARED_SIZE, 1); - if( failed && (failed2 = afpSetLock(context->dbPath, pFile, + if( failed && (failed2 = afpSetLock(context->dbPath, pFile, SHARED_FIRST + pInode->sharedByte, 1, 1)) ){ /* Can't reestablish the shared lock. Sqlite can't deal, this is ** a critical I/O error */ - rc = ((failed & SQLITE_IOERR) == SQLITE_IOERR) ? failed2 : + rc = ((failed & SQLITE_IOERR) == SQLITE_IOERR) ? failed2 : SQLITE_IOERR_LOCK; goto afp_end_lock; - } + } }else{ - rc = failed; + rc = failed; } } if( failed ){ rc = failed; } } - + if( rc==SQLITE_OK ){ pFile->eFileLock = eFileLock; pInode->eFileLock = eFileLock; @@ -2930,10 +2930,10 @@ static int afpLock(sqlite3_file *id, int eFileLock){ pFile->eFileLock = PENDING_LOCK; pInode->eFileLock = PENDING_LOCK; } - + afp_end_lock: unixLeaveMutex(); - OSTRACE(("LOCK %d %s %s (afp)\n", pFile->h, azFileLock(eFileLock), + OSTRACE(("LOCK %d %s %s (afp)\n", pFile->h, azFileLock(eFileLock), rc==SQLITE_OK ? "ok" : "failed")); return rc; } @@ -2972,7 +2972,7 @@ static int afpUnlock(sqlite3_file *id, int eFileLock) { SimulateIOErrorBenign(1); SimulateIOError( h=(-1) ) SimulateIOErrorBenign(0); - + #ifdef SQLITE_DEBUG /* When reducing a lock such that other processes can start ** reading the database file again, make sure that the @@ -2987,7 +2987,7 @@ static int afpUnlock(sqlite3_file *id, int eFileLock) { || pFile->transCntrChng==1 ); pFile->inNormalWrite = 0; #endif - + if( pFile->eFileLock==EXCLUSIVE_LOCK ){ rc = afpSetLock(context->dbPath, pFile, SHARED_FIRST, SHARED_SIZE, 0); if( rc==SQLITE_OK && (eFileLock==SHARED_LOCK || pInode->nShared>1) ){ @@ -3000,11 +3000,11 @@ static int afpUnlock(sqlite3_file *id, int eFileLock) { } if( rc==SQLITE_OK && pFile->eFileLock>=PENDING_LOCK ){ rc = afpSetLock(context->dbPath, pFile, PENDING_BYTE, 1, 0); - } + } if( rc==SQLITE_OK && pFile->eFileLock>=RESERVED_LOCK && context->reserved ){ rc = afpSetLock(context->dbPath, pFile, RESERVED_BYTE, 1, 0); - if( !rc ){ - context->reserved = 0; + if( !rc ){ + context->reserved = 0; } } if( rc==SQLITE_OK && (eFileLock==SHARED_LOCK || pInode->nShared>1)){ @@ -3039,14 +3039,14 @@ static int afpUnlock(sqlite3_file *id, int eFileLock) { } } } - + unixLeaveMutex(); if( rc==SQLITE_OK ) pFile->eFileLock = eFileLock; return rc; } /* -** Close a file & cleanup AFP specific locking context +** Close a file & cleanup AFP specific locking context */ static int afpClose(sqlite3_file *id) { int rc = SQLITE_OK; @@ -3098,7 +3098,7 @@ static int nfsUnlock(sqlite3_file *id, int eFileLock){ /* ** The code above is the NFS lock implementation. The code is specific ** to MacOSX and does not work on other unix platforms. No alternative -** is available. +** is available. ** ********************* End of the NFS lock implementation ********************** ******************************************************************************/ @@ -3106,7 +3106,7 @@ static int nfsUnlock(sqlite3_file *id, int eFileLock){ /****************************************************************************** **************** Non-locking sqlite3_file methods ***************************** ** -** The next division contains implementations for all methods of the +** The next division contains implementations for all methods of the ** sqlite3_file object other than the locking methods. The locking ** methods were defined in divisions above (one locking method per ** division). Those methods that are common to all locking modes @@ -3114,7 +3114,7 @@ static int nfsUnlock(sqlite3_file *id, int eFileLock){ */ /* -** Seek to the offset passed as the second argument, then read cnt +** Seek to the offset passed as the second argument, then read cnt ** bytes into pBuf. Return the number of bytes actually read. ** ** NB: If you define USE_PREAD or USE_PREAD64, then it might also @@ -3176,8 +3176,8 @@ static int seekAndRead(unixFile *id, sqlite3_int64 offset, void *pBuf, int cnt){ ** wrong. */ static int unixRead( - sqlite3_file *id, - void *pBuf, + sqlite3_file *id, + void *pBuf, int amt, sqlite3_int64 offset ){ @@ -3192,7 +3192,7 @@ static int unixRead( #if 0 assert( pFile->pUnused==0 || offset>=PENDING_BYTE+512 - || offset+amt<=PENDING_BYTE + || offset+amt<=PENDING_BYTE ); #endif @@ -3230,7 +3230,7 @@ static int unixRead( /* ** Attempt to seek the file-descriptor passed as the first argument to ** absolute offset iOff, then attempt to write nBuf bytes of data from -** pBuf to it. If an error occurs, return -1 and set *piErrno. Otherwise, +** pBuf to it. If an error occurs, return -1 and set *piErrno. Otherwise, ** return the actual number of bytes written (which may be less than ** nBuf). */ @@ -3290,10 +3290,10 @@ static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){ ** or some other error code on failure. */ static int unixWrite( - sqlite3_file *id, - const void *pBuf, + sqlite3_file *id, + const void *pBuf, int amt, - sqlite3_int64 offset + sqlite3_int64 offset ){ unixFile *pFile = (unixFile*)id; int wrote = 0; @@ -3305,7 +3305,7 @@ static int unixWrite( #if 0 assert( pFile->pUnused==0 || offset>=PENDING_BYTE+512 - || offset+amt<=PENDING_BYTE + || offset+amt<=PENDING_BYTE ); #endif @@ -3347,7 +3347,7 @@ static int unixWrite( } } #endif - + while( (wrote = seekAndWrite(pFile, offset, pBuf, amt))0 ){ amt -= wrote; offset += wrote; @@ -3413,8 +3413,8 @@ int sqlite3_fullsync_count = 0; ** ** SQLite sets the dataOnly flag if the size of the file is unchanged. ** The idea behind dataOnly is that it should only write the file content -** to disk, not the inode. We only set dataOnly if the file size is -** unchanged since the file size is part of the inode. However, +** to disk, not the inode. We only set dataOnly if the file size is +** unchanged since the file size is part of the inode. However, ** Ted Ts'o tells us that fdatasync() will also write the inode if the ** file size has changed. The only real difference between fdatasync() ** and fsync(), Ted tells us, is that fdatasync() will not flush the @@ -3428,7 +3428,7 @@ static int full_fsync(int fd, int fullSync, int dataOnly){ int rc; /* The following "ifdef/elif/else/" block has the same structure as - ** the one below. It is replicated here solely to avoid cluttering + ** the one below. It is replicated here solely to avoid cluttering ** up the real code with the UNUSED_PARAMETER() macros. */ #ifdef SQLITE_NO_SYNC @@ -3442,7 +3442,7 @@ static int full_fsync(int fd, int fullSync, int dataOnly){ UNUSED_PARAMETER(dataOnly); #endif - /* Record the number of times that we do a normal fsync() and + /* Record the number of times that we do a normal fsync() and ** FULLSYNC. This is used during testing to verify that this procedure ** gets called with the correct arguments. */ @@ -3468,11 +3468,11 @@ static int full_fsync(int fd, int fullSync, int dataOnly){ rc = 1; } /* If the FULLFSYNC failed, fall back to attempting an fsync(). - ** It shouldn't be possible for fullfsync to fail on the local + ** It shouldn't be possible for fullfsync to fail on the local ** file system (on OSX), so failure indicates that FULLFSYNC - ** isn't supported for this file system. So, attempt an fsync - ** and (for now) ignore the overhead of a superfluous fcntl call. - ** It'd be better to detect fullfsync support once and avoid + ** isn't supported for this file system. So, attempt an fsync + ** and (for now) ignore the overhead of a superfluous fcntl call. + ** It'd be better to detect fullfsync support once and avoid ** the fcntl call every time sync is called. */ if( rc ) rc = fsync(fd); @@ -3482,7 +3482,7 @@ static int full_fsync(int fd, int fullSync, int dataOnly){ ** so currently we default to the macro that redefines fdatasync to fsync */ rc = fsync(fd); -#else +#else rc = fdatasync(fd); #if OS_VXWORKS if( rc==-1 && errno==ENOTSUP ){ @@ -3643,7 +3643,7 @@ static int unixTruncate(sqlite3_file *id, i64 nByte){ #if SQLITE_MAX_MMAP_SIZE>0 /* If the file was just truncated to a size smaller than the currently ** mapped region, reduce the effective mapping size as well. SQLite will - ** use read() and write() to access data beyond this point from now on. + ** use read() and write() to access data beyond this point from now on. */ if( nBytemmapSize ){ pFile->mmapSize = nByte; @@ -3689,8 +3689,8 @@ static int unixFileSize(sqlite3_file *id, i64 *pSize){ static int proxyFileControl(sqlite3_file*,int,void*); #endif -/* -** This function is called to handle the SQLITE_FCNTL_SIZE_HINT +/* +** This function is called to handle the SQLITE_FCNTL_SIZE_HINT ** file-control operation. Enlarge the database to nBytes in size ** (rounded up to the next chunk-size). If the database is already ** nBytes or larger, this routine is a no-op. @@ -3699,7 +3699,7 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){ if( pFile->szChunk>0 ){ i64 nSize; /* Required file size */ struct stat buf; /* Used to hold return values of fstat() */ - + if( osFstat(pFile->h, &buf) ){ return SQLITE_IOERR_FSTAT; } @@ -3708,8 +3708,8 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){ if( nSize>(i64)buf.st_size ){ #if defined(HAVE_POSIX_FALLOCATE) && HAVE_POSIX_FALLOCATE - /* The code below is handling the return value of osFallocate() - ** correctly. posix_fallocate() is defined to "returns zero on success, + /* The code below is handling the return value of osFallocate() + ** correctly. posix_fallocate() is defined to "returns zero on success, ** or an error number on failure". See the manpage for details. */ int err; do{ @@ -3717,7 +3717,7 @@ static int fcntlSizeHint(unixFile *pFile, i64 nByte){ }while( err==EINTR ); if( err ) return SQLITE_IOERR_WRITE; #else - /* If the OS does not have posix_fallocate(), fake it. Write a + /* If the OS does not have posix_fallocate(), fake it. Write a ** single byte to the last byte in each block that falls entirely ** within the extended region. Then, if required, a single byte ** at offset (nSize-1), to set the size of the file correctly. @@ -3875,7 +3875,7 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){ ** a database and its journal file) that the sector size will be the ** same for both. */ -#ifndef __QNXNTO__ +#ifndef __QNXNTO__ static int unixSectorSize(sqlite3_file *NotUsed){ UNUSED_PARAMETER(NotUsed); return SQLITE_DEFAULT_SECTOR_SIZE; @@ -3892,7 +3892,7 @@ static int unixSectorSize(sqlite3_file *id){ unixFile *pFile = (unixFile*)id; if( pFile->sectorSize == 0 ){ struct statvfs fsInfo; - + /* Set defaults for non-supported filesystems */ pFile->sectorSize = SQLITE_DEFAULT_SECTOR_SIZE; pFile->deviceCharacteristics = 0; @@ -3993,7 +3993,7 @@ static int unixDeviceCharacteristics(sqlite3_file *id){ /* ** Return the system page size. ** -** This function should not be called directly by other code in this file. +** This function should not be called directly by other code in this file. ** Instead, it should be called via macro osGetpagesize(). */ static int unixGetpagesize(void){ @@ -4011,7 +4011,7 @@ static int unixGetpagesize(void){ #ifndef SQLITE_OMIT_WAL /* -** Object used to represent an shared memory buffer. +** Object used to represent an shared memory buffer. ** ** When multiple threads all reference the same wal-index, each thread ** has its own unixShm object, but they all point to a single instance @@ -4031,7 +4031,7 @@ static int unixGetpagesize(void){ ** nRef ** ** The following fields are read-only after the object is created: -** +** ** fid ** zFilename ** @@ -4158,7 +4158,7 @@ static int unixShmSystemLock( } #endif - return rc; + return rc; } /* @@ -4210,20 +4210,20 @@ static void unixShmPurge(unixFile *pFd){ } /* -** Open a shared-memory area associated with open database file pDbFd. +** Open a shared-memory area associated with open database file pDbFd. ** This particular implementation uses mmapped files. ** ** The file used to implement shared-memory is in the same directory ** as the open database file and has the same name as the open database ** file with the "-shm" suffix added. For example, if the database file ** is "/home/user1/config.db" then the file that is created and mmapped -** for shared memory will be called "/home/user1/config.db-shm". +** for shared memory will be called "/home/user1/config.db-shm". ** ** Another approach to is to use files in /dev/shm or /dev/tmp or an ** some other tmpfs mount. But if a file in a different directory ** from the database file is used, then differing access permissions ** or a chroot() might cause two different processes on the same -** database to end up using different files for shared memory - +** database to end up using different files for shared memory - ** meaning that their memory would not really be shared - resulting ** in database corruption. Nevertheless, this tmpfs file usage ** can be enabled at compile-time using -DSQLITE_SHM_DIRECTORY="/dev/shm" @@ -4292,7 +4292,7 @@ static int unixOpenSharedMemory(unixFile *pDbFd){ memset(pShmNode, 0, sizeof(*pShmNode)+nShmFilename); zShmFilename = pShmNode->zFilename = (char*)&pShmNode[1]; #ifdef SQLITE_SHM_DIRECTORY - sqlite3_snprintf(nShmFilename, zShmFilename, + sqlite3_snprintf(nShmFilename, zShmFilename, SQLITE_SHM_DIRECTORY "/sqlite-shm-%x-%x", (u32)sStat.st_ino, (u32)sStat.st_dev); #else @@ -4327,9 +4327,9 @@ static int unixOpenSharedMemory(unixFile *pDbFd){ ** the original owner will not be able to connect. */ robustFchown(pShmNode->h, sStat.st_uid, sStat.st_gid); - + /* Check to see if another process is holding the dead-man switch. - ** If not, truncate the file to zero length. + ** If not, truncate the file to zero length. */ rc = SQLITE_OK; if( unixShmSystemLock(pDbFd, F_WRLCK, UNIX_SHM_DMS, 1)==SQLITE_OK ){ @@ -4357,7 +4357,7 @@ static int unixOpenSharedMemory(unixFile *pDbFd){ ** the cover of the unixEnterMutex() mutex and the pointer from the ** new (struct unixShm) object to the pShmNode has been set. All that is ** left to do is to link the new object into the linked list starting - ** at pShmNode->pFirst. This must be done while holding the pShmNode->mutex + ** at pShmNode->pFirst. This must be done while holding the pShmNode->mutex ** mutex. */ sqlite3_mutex_enter(pShmNode->mutex); @@ -4375,22 +4375,22 @@ shm_open_err: } /* -** This function is called to obtain a pointer to region iRegion of the -** shared-memory associated with the database file fd. Shared-memory regions -** are numbered starting from zero. Each shared-memory region is szRegion +** This function is called to obtain a pointer to region iRegion of the +** shared-memory associated with the database file fd. Shared-memory regions +** are numbered starting from zero. Each shared-memory region is szRegion ** bytes in size. ** ** If an error occurs, an error code is returned and *pp is set to NULL. ** ** Otherwise, if the bExtend parameter is 0 and the requested shared-memory ** region has not been allocated (by any client, including one running in a -** separate process), then *pp is set to NULL and SQLITE_OK returned. If -** bExtend is non-zero and the requested shared-memory region has not yet +** separate process), then *pp is set to NULL and SQLITE_OK returned. If +** bExtend is non-zero and the requested shared-memory region has not yet ** been allocated, it is allocated by this function. ** ** If the shared-memory region has already been allocated or is allocated by -** this call as described above, then it is mapped into this processes -** address space (if it is not already), *pp is set to point to the mapped +** this call as described above, then it is mapped into this processes +** address space (if it is not already), *pp is set to point to the mapped ** memory and SQLITE_OK returned. */ static int unixShmMap( @@ -4440,7 +4440,7 @@ static int unixShmMap( rc = SQLITE_IOERR_SHMSIZE; goto shmpage_out; } - + if( sStat.st_sizeh>=0 ){ pMem = osMmap(0, nMap, - pShmNode->isReadonly ? PROT_READ : PROT_READ|PROT_WRITE, + pShmNode->isReadonly ? PROT_READ : PROT_READ|PROT_WRITE, MAP_SHARED, pShmNode->h, szRegion*(i64)pShmNode->nRegion ); if( pMem==MAP_FAILED ){ @@ -4580,7 +4580,7 @@ static int unixShmLock( if( rc==SQLITE_OK ){ p->exclMask &= ~mask; p->sharedMask &= ~mask; - } + } }else if( flags & SQLITE_SHM_SHARED ){ u16 allShared = 0; /* Union of locks held by connections other than "p" */ @@ -4619,7 +4619,7 @@ static int unixShmLock( break; } } - + /* Get the exclusive locks at the system level. Then if successful ** also mark the local connection as being locked. */ @@ -4638,7 +4638,7 @@ static int unixShmLock( } /* -** Implement a memory barrier or memory fence on shared memory. +** Implement a memory barrier or memory fence on shared memory. ** ** All loads and stores begun before the barrier must complete before ** any load or store begun after the barrier. @@ -4653,7 +4653,7 @@ static void unixShmBarrier( } /* -** Close a connection to shared-memory. Delete the underlying +** Close a connection to shared-memory. Delete the underlying ** storage if deleteFlag is true. ** ** If there is no shared memory associated with the connection then this @@ -4726,7 +4726,7 @@ static void unixUnmapfile(unixFile *pFd){ } /* -** Attempt to set the size of the memory mapping maintained by file +** Attempt to set the size of the memory mapping maintained by file ** descriptor pFd to nNew bytes. Any existing mapping is discarded. ** ** If successful, this function sets the following variables: @@ -4818,14 +4818,14 @@ static void unixRemapfile( /* ** Memory map or remap the file opened by file-descriptor pFd (if the file -** is already mapped, the existing mapping is replaced by the new). Or, if -** there already exists a mapping for this file, and there are still +** is already mapped, the existing mapping is replaced by the new). Or, if +** there already exists a mapping for this file, and there are still ** outstanding xFetch() references to it, this function is a no-op. ** -** If parameter nByte is non-negative, then it is the requested size of -** the mapping to create. Otherwise, if nByte is less than zero, then the +** If parameter nByte is non-negative, then it is the requested size of +** the mapping to create. Otherwise, if nByte is less than zero, then the ** requested size is the size of the file on disk. The actual size of the -** created mapping is either the requested size or the value configured +** created mapping is either the requested size or the value configured ** using SQLITE_FCNTL_MMAP_LIMIT, whichever is smaller. ** ** SQLITE_OK is returned if no error occurs (even if the mapping is not @@ -4866,7 +4866,7 @@ static int unixMapfile(unixFile *pFd, i64 nMap){ ** Finally, if an error does occur, return an SQLite error code. The final ** value of *pp is undefined in this case. ** -** If this function does return a pointer, the caller must eventually +** If this function does return a pointer, the caller must eventually ** release the reference by calling unixUnfetch(). */ static int unixFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){ @@ -4891,13 +4891,13 @@ static int unixFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){ } /* -** If the third argument is non-NULL, then this function releases a +** If the third argument is non-NULL, then this function releases a ** reference obtained by an earlier call to unixFetch(). The second ** argument passed to this function must be the same as the corresponding -** argument that was passed to the unixFetch() invocation. +** argument that was passed to the unixFetch() invocation. ** -** Or, if the third argument is NULL, then this function is being called -** to inform the VFS layer that, according to POSIX, any existing mapping +** Or, if the third argument is NULL, then this function is being called +** to inform the VFS layer that, according to POSIX, any existing mapping ** may now be invalid and should be unmapped. */ static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){ @@ -4905,7 +4905,7 @@ static int unixUnfetch(sqlite3_file *fd, i64 iOff, void *p){ unixFile *pFd = (unixFile *)fd; /* The underlying database file */ UNUSED_PARAMETER(iOff); - /* If p==0 (unmap the entire file) then there must be no outstanding + /* If p==0 (unmap the entire file) then there must be no outstanding ** xFetch references. Or, if p!=0 (meaning it is an xFetch reference), ** then there must be at least one outstanding. */ assert( (p==0)==(pFd->nFetchOut==0) ); @@ -5113,8 +5113,8 @@ IOMETHODS( #endif #if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE -/* -** This "finder" function attempts to determine the best locking strategy +/* +** This "finder" function attempts to determine the best locking strategy ** for the database file "filePath". It then returns the sqlite3_io_methods ** object that implements that strategy. ** @@ -5156,8 +5156,8 @@ static const sqlite3_io_methods *autolockIoFinderImpl( } /* Default case. Handles, amongst others, "nfs". - ** Test byte-range lock using fcntl(). If the call succeeds, - ** assume that the file-system supports POSIX style locks. + ** Test byte-range lock using fcntl(). If the call succeeds, + ** assume that the file-system supports POSIX style locks. */ lockInfo.l_len = 1; lockInfo.l_start = 0; @@ -5173,7 +5173,7 @@ static const sqlite3_io_methods *autolockIoFinderImpl( return &dotlockIoMethods; } } -static const sqlite3_io_methods +static const sqlite3_io_methods *(*const autolockIoFinder)(const char*,unixFile*) = autolockIoFinderImpl; #endif /* defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE */ @@ -5209,7 +5209,7 @@ static const sqlite3_io_methods *vxworksIoFinderImpl( return &semIoMethods; } } -static const sqlite3_io_methods +static const sqlite3_io_methods *(*const vxworksIoFinder)(const char*,unixFile*) = vxworksIoFinderImpl; #endif /* OS_VXWORKS */ @@ -5248,7 +5248,7 @@ static int fillInUnixFile( ** include the special Apple locking styles. */ #if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE - assert( zFilename==0 || zFilename[0]=='/' + assert( zFilename==0 || zFilename[0]=='/' || pVfs->pAppData==(void*)&autolockIoFinder ); #else assert( zFilename==0 || zFilename[0]=='/' ); @@ -5348,14 +5348,14 @@ static int fillInUnixFile( robust_close(pNew, h, __LINE__); h = -1; } - unixLeaveMutex(); + unixLeaveMutex(); } } #endif else if( pLockingStyle == &dotlockIoMethods ){ /* Dotfile locking uses the file path so it needs to be included in - ** the dotlockLockingContext + ** the dotlockLockingContext */ char *zLockFile; int nFilename; @@ -5393,7 +5393,7 @@ static int fillInUnixFile( unixLeaveMutex(); } #endif - + storeLastErrno(pNew, 0); #if OS_VXWORKS if( rc!=SQLITE_OK ){ @@ -5457,7 +5457,7 @@ static int unixGetTempname(int nBuf, char *zBuf){ /* It's odd to simulate an io-error here, but really this is just ** using the io-error infrastructure to test that SQLite handles this - ** function failing. + ** function failing. */ zBuf[0] = 0; SimulateIOError( return SQLITE_IOERR ); @@ -5486,7 +5486,7 @@ static int proxyTransformUnixFile(unixFile*, const char*); #endif /* -** Search for an unused file descriptor that was opened on the database +** Search for an unused file descriptor that was opened on the database ** file (not a journal or master-journal file) identified by pathname ** zPath with SQLITE_OPEN_XXX flags matching those passed as the second ** argument to this function. @@ -5495,7 +5495,7 @@ static int proxyTransformUnixFile(unixFile*, const char*); ** but the associated file descriptor could not be closed because some ** other file descriptor open on the same file is holding a file-lock. ** Refer to comments in the unixClose() function and the lengthy comment -** describing "Posix Advisory Locking" at the start of this file for +** describing "Posix Advisory Locking" at the start of this file for ** further details. Also, ticket #4018. ** ** If a suitable file descriptor is found, then it is returned. If no @@ -5506,8 +5506,8 @@ static UnixUnusedFd *findReusableFd(const char *zPath, int flags){ /* Do not search for an unused file descriptor on vxworks. Not because ** vxworks would not benefit from the change (it might, we're not sure), - ** but because no way to test it is currently available. It is better - ** not to risk breaking vxworks support for the sake of such an obscure + ** but because no way to test it is currently available. It is better + ** not to risk breaking vxworks support for the sake of such an obscure ** feature. */ #if !OS_VXWORKS struct stat sStat; /* Results of stat() call */ @@ -5544,7 +5544,7 @@ static UnixUnusedFd *findReusableFd(const char *zPath, int flags){ } /* -** Find the mode, uid and gid of file zFile. +** Find the mode, uid and gid of file zFile. */ static int getFileMode( const char *zFile, /* File name */ @@ -5568,16 +5568,16 @@ static int getFileMode( ** This function is called by unixOpen() to determine the unix permissions ** to create new files with. If no error occurs, then SQLITE_OK is returned ** and a value suitable for passing as the third argument to open(2) is -** written to *pMode. If an IO error occurs, an SQLite error code is +** written to *pMode. If an IO error occurs, an SQLite error code is ** returned and the value of *pMode is not modified. ** ** In most cases, this routine sets *pMode to 0, which will become ** an indication to robust_open() to create the file using ** SQLITE_DEFAULT_FILE_PERMISSIONS adjusted by the umask. -** But if the file being opened is a WAL or regular journal file, then -** this function queries the file-system for the permissions on the -** corresponding database file and sets *pMode to this value. Whenever -** possible, WAL and journal files are created using the same permissions +** But if the file being opened is a WAL or regular journal file, then +** this function queries the file-system for the permissions on the +** corresponding database file and sets *pMode to this value. Whenever +** possible, WAL and journal files are created using the same permissions ** as the associated database file. ** ** If the SQLITE_ENABLE_8_3_NAMES option is enabled, then the @@ -5609,10 +5609,10 @@ static int findCreateFileMode( ** "-journalNN" ** "-walNN" ** - ** where NN is a decimal number. The NN naming schemes are + ** where NN is a decimal number. The NN naming schemes are ** used by the test_multiplex.c module. */ - nDb = sqlite3Strlen30(zPath) - 1; + nDb = sqlite3Strlen30(zPath) - 1; while( zPath[nDb]!='-' ){ #ifndef SQLITE_ENABLE_8_3_NAMES /* In the normal case (8+3 filenames disabled) the journal filename @@ -5685,7 +5685,7 @@ int chromium_sqlite3_fill_in_unix_sqlite3_file(sqlite3_vfs* pVfs, /* ** Open the file zPath. -** +** ** Previously, the SQLite OS layer used three functions in place of this ** one: ** @@ -5696,13 +5696,13 @@ int chromium_sqlite3_fill_in_unix_sqlite3_file(sqlite3_vfs* pVfs, ** These calls correspond to the following combinations of flags: ** ** ReadWrite() -> (READWRITE | CREATE) -** ReadOnly() -> (READONLY) +** ReadOnly() -> (READONLY) ** OpenExclusive() -> (READWRITE | CREATE | EXCLUSIVE) ** ** The old OpenExclusive() accepted a boolean argument - "delFlag". If ** true, the file was configured to be automatically deleted when the -** file handle closed. To achieve the same effect using this new -** interface, add the DELETEONCLOSE flag to those specified above for +** file handle closed. To achieve the same effect using this new +** interface, add the DELETEONCLOSE flag to those specified above for ** OpenExclusive(). */ static int unixOpen( @@ -5737,8 +5737,8 @@ static int unixOpen( ** is called the directory file descriptor will be fsync()ed and close()d. */ int syncDir = (isCreate && ( - eType==SQLITE_OPEN_MASTER_JOURNAL - || eType==SQLITE_OPEN_MAIN_JOURNAL + eType==SQLITE_OPEN_MASTER_JOURNAL + || eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_WAL )); @@ -5748,9 +5748,9 @@ static int unixOpen( char zTmpname[MAX_PATHNAME+2]; const char *zName = zPath; - /* Check the following statements are true: + /* Check the following statements are true: ** - ** (a) Exactly one of the READWRITE and READONLY flags must be set, and + ** (a) Exactly one of the READWRITE and READONLY flags must be set, and ** (b) if CREATE is set, then READWRITE must also be set, and ** (c) if EXCLUSIVE is set, then CREATE must also be set. ** (d) if DELETEONCLOSE is set, then CREATE must also be set. @@ -5760,7 +5760,7 @@ static int unixOpen( assert(isExclusive==0 || isCreate); assert(isDelete==0 || isCreate); - /* The main DB, main journal, WAL file and master journal are never + /* The main DB, main journal, WAL file and master journal are never ** automatically deleted. Nor are they ever temporary files. */ assert( (!isDelete && zName) || eType!=SQLITE_OPEN_MAIN_DB ); assert( (!isDelete && zName) || eType!=SQLITE_OPEN_MAIN_JOURNAL ); @@ -5768,9 +5768,9 @@ static int unixOpen( assert( (!isDelete && zName) || eType!=SQLITE_OPEN_WAL ); /* Assert that the upper layer has set one of the "file-type" flags. */ - assert( eType==SQLITE_OPEN_MAIN_DB || eType==SQLITE_OPEN_TEMP_DB - || eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_TEMP_JOURNAL - || eType==SQLITE_OPEN_SUBJOURNAL || eType==SQLITE_OPEN_MASTER_JOURNAL + assert( eType==SQLITE_OPEN_MAIN_DB || eType==SQLITE_OPEN_TEMP_DB + || eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_TEMP_JOURNAL + || eType==SQLITE_OPEN_SUBJOURNAL || eType==SQLITE_OPEN_MASTER_JOURNAL || eType==SQLITE_OPEN_TRANSIENT_DB || eType==SQLITE_OPEN_WAL ); @@ -5822,7 +5822,7 @@ static int unixOpen( /* Determine the value of the flags parameter passed to POSIX function ** open(). These must be calculated even if open() is not called, as - ** they may be stored as part of the file handle and used by the + ** they may be stored as part of the file handle and used by the ** 'conch file' locking functions later on. */ if( isReadonly ) openFlags |= O_RDONLY; if( isReadWrite ) openFlags |= O_RDWR; @@ -5894,7 +5894,7 @@ static int unixOpen( p->openFlags = openFlags; } #endif - + #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE if( fstatfs(fd, &fsInfo) == -1 ){ storeLastErrno(p, errno); @@ -5925,7 +5925,7 @@ static int unixOpen( char *envforce = getenv("SQLITE_FORCE_PROXY_LOCKING"); int useProxy = 0; - /* SQLITE_FORCE_PROXY_LOCKING==1 means force always use proxy, 0 means + /* SQLITE_FORCE_PROXY_LOCKING==1 means force always use proxy, 0 means ** never use proxy, NULL means use proxy for non-local files only. */ if( envforce!=NULL ){ useProxy = atoi(envforce)>0; @@ -5937,9 +5937,9 @@ static int unixOpen( if( rc==SQLITE_OK ){ rc = proxyTransformUnixFile((unixFile*)pFile, ":auto:"); if( rc!=SQLITE_OK ){ - /* Use unixClose to clean up the resources added in fillInUnixFile - ** and clear all the structure's references. Specifically, - ** pFile->pMethods will be NULL so sqlite3OsClose will be a no-op + /* Use unixClose to clean up the resources added in fillInUnixFile + ** and clear all the structure's references. Specifically, + ** pFile->pMethods will be NULL so sqlite3OsClose will be a no-op */ unixClose(pFile); return rc; @@ -5949,7 +5949,7 @@ static int unixOpen( } } #endif - + /* Duplicated in chromium_sqlite3_fill_in_unix_sqlite3_file(). */ rc = fillInUnixFile(pVfs, fd, pFile, zPath, ctrlFlags); @@ -6067,9 +6067,9 @@ static int mkFullPathname( /* ** Turn a relative pathname into a full pathname. The relative path ** is stored as a nul-terminated string in the buffer pointed to by -** zPath. +** zPath. ** -** zOut points to a buffer of at least sqlite3_vfs.mxPathname bytes +** zOut points to a buffer of at least sqlite3_vfs.mxPathname bytes ** (in this case, MAX_PATHNAME bytes). The full-path is written to ** this buffer before returning. */ @@ -6186,7 +6186,7 @@ static void unixDlError(sqlite3_vfs *NotUsed, int nBuf, char *zBufOut){ unixLeaveMutex(); } static void (*unixDlSym(sqlite3_vfs *NotUsed, void *p, const char*zSym))(void){ - /* + /* ** GCC with -pedantic-errors says that C90 does not allow a void* to be ** cast into a pointer to a function. And yet the library dlsym() routine ** returns a void* which is really a pointer to a function. So how do we @@ -6196,7 +6196,7 @@ static void (*unixDlSym(sqlite3_vfs *NotUsed, void *p, const char*zSym))(void){ ** parameters void* and const char* and returning a pointer to a function. ** We initialize x by assigning it a pointer to the dlsym() function. ** (That assignment requires a cast.) Then we call the function that - ** x points to. + ** x points to. ** ** This work-around is unlikely to work correctly on any system where ** you really cannot cast a function pointer into void*. But then, on the @@ -6239,7 +6239,7 @@ static int unixRandomness(sqlite3_vfs *NotUsed, int nBuf, char *zBuf){ ** tests repeatable. */ memset(zBuf, 0, nBuf); - randomnessPid = osGetpid(0); + randomnessPid = osGetpid(0); #if !defined(SQLITE_TEST) && !defined(SQLITE_OMIT_RANDOMNESS) { int fd, got; @@ -6306,7 +6306,7 @@ int sqlite3_current_time = 0; /* Fake system time in seconds since 1970. */ ** epoch of noon in Greenwich on November 24, 4714 B.C according to the ** proleptic Gregorian calendar. ** -** On success, return SQLITE_OK. Return SQLITE_ERROR if the time and date +** On success, return SQLITE_OK. Return SQLITE_ERROR if the time and date ** cannot be found. */ static int unixCurrentTimeInt64(sqlite3_vfs *NotUsed, sqlite3_int64 *piNow){ @@ -6413,7 +6413,7 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ ** To address the performance and cache coherency issues, proxy file locking ** changes the way database access is controlled by limiting access to a ** single host at a time and moving file locks off of the database file -** and onto a proxy file on the local file system. +** and onto a proxy file on the local file system. ** ** ** Using proxy locks @@ -6439,19 +6439,19 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ ** actual proxy file name is generated from the name and path of the ** database file. For example: ** -** For database path "/Users/me/foo.db" +** For database path "/Users/me/foo.db" ** The lock path will be "/sqliteplocks/_Users_me_foo.db:auto:") ** ** Once a lock proxy is configured for a database connection, it can not ** be removed, however it may be switched to a different proxy path via ** the above APIs (assuming the conch file is not being held by another -** connection or process). +** connection or process). ** ** ** How proxy locking works ** ----------------------- ** -** Proxy file locking relies primarily on two new supporting files: +** Proxy file locking relies primarily on two new supporting files: ** ** * conch file to limit access to the database file to a single host ** at a time @@ -6478,11 +6478,11 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ ** host (the conch ensures that they all use the same local lock file). ** ** Requesting the lock proxy does not immediately take the conch, it is -** only taken when the first request to lock database file is made. +** only taken when the first request to lock database file is made. ** This matches the semantics of the traditional locking behavior, where ** opening a connection to a database file does not take a lock on it. -** The shared lock and an open file descriptor are maintained until -** the connection to the database is closed. +** The shared lock and an open file descriptor are maintained until +** the connection to the database is closed. ** ** The proxy file and the lock file are never deleted so they only need ** to be created the first time they are used. @@ -6496,7 +6496,7 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ ** automatically configured for proxy locking, lock files are ** named automatically using the same logic as ** PRAGMA lock_proxy_file=":auto:" -** +** ** SQLITE_PROXY_DEBUG ** ** Enables the logging of error messages during host id file @@ -6511,8 +6511,8 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ ** ** Permissions to use when creating a directory for storing the ** lock proxy files, only used when LOCKPROXYDIR is not set. -** -** +** +** ** As mentioned above, when compiled with SQLITE_PREFER_PROXY_LOCKING, ** setting the environment variable SQLITE_FORCE_PROXY_LOCKING to 1 will ** force proxy locking to be used for every database file opened, and 0 @@ -6522,12 +6522,12 @@ static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ */ /* -** Proxy locking is only available on MacOSX +** Proxy locking is only available on MacOSX */ #if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE /* -** The proxyLockingContext has the path and file structures for the remote +** The proxyLockingContext has the path and file structures for the remote ** and local proxy files in it */ typedef struct proxyLockingContext proxyLockingContext; @@ -6543,10 +6543,10 @@ struct proxyLockingContext { sqlite3_io_methods const *pOldMethod; /* Original I/O methods for close */ }; -/* -** The proxy lock file path for the database at dbPath is written into lPath, +/* +** The proxy lock file path for the database at dbPath is written into lPath, ** which must point to valid, writable memory large enough for a maxLen length -** file path. +** file path. */ static int proxyGetLockPath(const char *dbPath, char *lPath, size_t maxLen){ int len; @@ -6563,7 +6563,7 @@ static int proxyGetLockPath(const char *dbPath, char *lPath, size_t maxLen){ lPath, errno, osGetpid(0))); return SQLITE_IOERR_LOCK; } - len = strlcat(lPath, "sqliteplocks", maxLen); + len = strlcat(lPath, "sqliteplocks", maxLen); } # else len = strlcpy(lPath, "/tmp/", maxLen); @@ -6573,7 +6573,7 @@ static int proxyGetLockPath(const char *dbPath, char *lPath, size_t maxLen){ if( lPath[len-1]!='/' ){ len = strlcat(lPath, "/", maxLen); } - + /* transform the db path to a unique cache name */ dbLen = (int)strlen(dbPath); for( i=0; i 0) ){ /* only mkdir if leaf dir != "." or "/" or ".." */ - if( i-start>2 || (i-start==1 && buf[start] != '.' && buf[start] != '/') + if( i-start>2 || (i-start==1 && buf[start] != '.' && buf[start] != '/') || (i-start==2 && buf[start] != '.' && buf[start+1] != '.') ){ buf[i]='\0'; if( osMkdir(buf, SQLITE_DEFAULT_PROXYDIR_PERMISSIONS) ){ @@ -6678,13 +6678,13 @@ static int proxyCreateUnixFile( switch (terrno) { case EACCES: return SQLITE_PERM; - case EIO: + case EIO: return SQLITE_IOERR_LOCK; /* even though it is the conch */ default: return SQLITE_CANTOPEN_BKPT; } } - + pNew = (unixFile *)sqlite3_malloc64(sizeof(*pNew)); if( pNew==NULL ){ rc = SQLITE_NOMEM_BKPT; @@ -6698,13 +6698,13 @@ static int proxyCreateUnixFile( pUnused->fd = fd; pUnused->flags = openFlags; pNew->pUnused = pUnused; - + rc = fillInUnixFile(&dummyVfs, fd, (sqlite3_file*)pNew, path, 0); if( rc==SQLITE_OK ){ *ppFile = pNew; return SQLITE_OK; } -end_create_proxy: +end_create_proxy: robust_close(pNew, fd, __LINE__); sqlite3_free(pNew); sqlite3_free(pUnused); @@ -6723,7 +6723,7 @@ int sqlite3_hostid_num = 0; extern int gethostuuid(uuid_t id, const struct timespec *wait); #endif -/* get the host ID via gethostuuid(), pHostID must point to PROXY_HOSTIDLEN +/* get the host ID via gethostuuid(), pHostID must point to PROXY_HOSTIDLEN ** bytes of writable memory. */ static int proxyGetHostID(unsigned char *pHostID, int *pError){ @@ -6749,7 +6749,7 @@ static int proxyGetHostID(unsigned char *pHostID, int *pError){ pHostID[0] = (char)(pHostID[0] + (char)(sqlite3_hostid_num & 0xFF)); } #endif - + return SQLITE_OK; } @@ -6760,14 +6760,14 @@ static int proxyGetHostID(unsigned char *pHostID, int *pError){ #define PROXY_PATHINDEX (PROXY_HEADERLEN+PROXY_HOSTIDLEN) #define PROXY_MAXCONCHLEN (PROXY_HEADERLEN+PROXY_HOSTIDLEN+MAXPATHLEN) -/* -** Takes an open conch file, copies the contents to a new path and then moves +/* +** Takes an open conch file, copies the contents to a new path and then moves ** it back. The newly created file's file descriptor is assigned to the -** conch file structure and finally the original conch file descriptor is +** conch file structure and finally the original conch file descriptor is ** closed. Returns zero if successful. */ static int proxyBreakConchLock(unixFile *pFile, uuid_t myHostID){ - proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; + proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; unixFile *conchFile = pCtx->conchFile; char tPath[MAXPATHLEN]; char buf[PROXY_MAXCONCHLEN]; @@ -6781,7 +6781,7 @@ static int proxyBreakConchLock(unixFile *pFile, uuid_t myHostID){ /* create a new path by replace the trailing '-conch' with '-break' */ pathLen = strlcpy(tPath, cPath, MAXPATHLEN); - if( pathLen>MAXPATHLEN || pathLen<6 || + if( pathLen>MAXPATHLEN || pathLen<6 || (strlcpy(&tPath[pathLen-5], "break", 6) != 5) ){ sqlite3_snprintf(sizeof(errmsg),errmsg,"path error (len %d)",(int)pathLen); goto end_breaklock; @@ -6823,24 +6823,24 @@ end_breaklock: return rc; } -/* Take the requested lock on the conch file and break a stale lock if the +/* Take the requested lock on the conch file and break a stale lock if the ** host id matches. */ static int proxyConchLock(unixFile *pFile, uuid_t myHostID, int lockType){ - proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; + proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; unixFile *conchFile = pCtx->conchFile; int rc = SQLITE_OK; int nTries = 0; struct timespec conchModTime; - + memset(&conchModTime, 0, sizeof(conchModTime)); do { rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, lockType); nTries ++; if( rc==SQLITE_BUSY ){ /* If the lock failed (busy): - * 1st try: get the mod time of the conch, wait 0.5s and try again. - * 2nd try: fail if the mod time changed or host id is different, wait + * 1st try: get the mod time of the conch, wait 0.5s and try again. + * 2nd try: fail if the mod time changed or host id is different, wait * 10 sec and try again * 3rd try: break the lock unless the mod time has changed. */ @@ -6849,20 +6849,20 @@ static int proxyConchLock(unixFile *pFile, uuid_t myHostID, int lockType){ storeLastErrno(pFile, errno); return SQLITE_IOERR_LOCK; } - + if( nTries==1 ){ conchModTime = buf.st_mtimespec; usleep(500000); /* wait 0.5 sec and try the lock again*/ - continue; + continue; } assert( nTries>1 ); - if( conchModTime.tv_sec != buf.st_mtimespec.tv_sec || + if( conchModTime.tv_sec != buf.st_mtimespec.tv_sec || conchModTime.tv_nsec != buf.st_mtimespec.tv_nsec ){ return SQLITE_BUSY; } - - if( nTries==2 ){ + + if( nTries==2 ){ char tBuf[PROXY_MAXCONCHLEN]; int len = osPread(conchFile->h, tBuf, PROXY_MAXCONCHLEN, 0); if( len<0 ){ @@ -6879,9 +6879,9 @@ static int proxyConchLock(unixFile *pFile, uuid_t myHostID, int lockType){ return SQLITE_BUSY; } usleep(10000000); /* wait 10 sec and try the lock again */ - continue; + continue; } - + assert( nTries==3 ); if( 0==proxyBreakConchLock(pFile, myHostID) ){ rc = SQLITE_OK; @@ -6894,19 +6894,19 @@ static int proxyConchLock(unixFile *pFile, uuid_t myHostID, int lockType){ } } } while( rc==SQLITE_BUSY && nTries<3 ); - + return rc; } -/* Takes the conch by taking a shared lock and read the contents conch, if -** lockPath is non-NULL, the host ID and lock file path must match. A NULL -** lockPath means that the lockPath in the conch file will be used if the -** host IDs match, or a new lock path will be generated automatically +/* Takes the conch by taking a shared lock and read the contents conch, if +** lockPath is non-NULL, the host ID and lock file path must match. A NULL +** lockPath means that the lockPath in the conch file will be used if the +** host IDs match, or a new lock path will be generated automatically ** and written to the conch file. */ static int proxyTakeConch(unixFile *pFile){ - proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; - + proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; + if( pCtx->conchHeld!=0 ){ return SQLITE_OK; }else{ @@ -6922,7 +6922,7 @@ static int proxyTakeConch(unixFile *pFile){ int readLen = 0; int tryOldLockPath = 0; int forceNewLockPath = 0; - + OSTRACE(("TAKECONCH %d for %s pid=%d\n", conchFile->h, (pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"), osGetpid(0))); @@ -6943,21 +6943,21 @@ static int proxyTakeConch(unixFile *pFile){ storeLastErrno(pFile, conchFile->lastErrno); rc = SQLITE_IOERR_READ; goto end_takeconch; - }else if( readLen<=(PROXY_HEADERLEN+PROXY_HOSTIDLEN) || + }else if( readLen<=(PROXY_HEADERLEN+PROXY_HOSTIDLEN) || readBuf[0]!=(char)PROXY_CONCHVERSION ){ - /* a short read or version format mismatch means we need to create a new - ** conch file. + /* a short read or version format mismatch means we need to create a new + ** conch file. */ createConch = 1; } /* if the host id matches and the lock path already exists in the conch - ** we'll try to use the path there, if we can't open that path, we'll - ** retry with a new auto-generated path + ** we'll try to use the path there, if we can't open that path, we'll + ** retry with a new auto-generated path */ do { /* in case we need to try again for an :auto: named lock file */ if( !createConch && !forceNewLockPath ){ - hostIdMatch = !memcmp(&readBuf[PROXY_HEADERLEN], myHostID, + hostIdMatch = !memcmp(&readBuf[PROXY_HEADERLEN], myHostID, PROXY_HOSTIDLEN); /* if the conch has data compare the contents */ if( !pCtx->lockProxyPath ){ @@ -6966,7 +6966,7 @@ static int proxyTakeConch(unixFile *pFile){ */ if( hostIdMatch ){ size_t pathLen = (readLen - PROXY_PATHINDEX); - + if( pathLen>=MAXPATHLEN ){ pathLen=MAXPATHLEN-1; } @@ -6982,23 +6982,23 @@ static int proxyTakeConch(unixFile *pFile){ readLen-PROXY_PATHINDEX) ){ /* conch host and lock path match */ - goto end_takeconch; + goto end_takeconch; } } - + /* if the conch isn't writable and doesn't match, we can't take it */ if( (conchFile->openFlags&O_RDWR) == 0 ){ rc = SQLITE_BUSY; goto end_takeconch; } - + /* either the conch didn't match or we need to create a new one */ if( !pCtx->lockProxyPath ){ proxyGetLockPath(pCtx->dbPath, lockPath, MAXPATHLEN); tempLockPath = lockPath; /* create a copy of the lock path _only_ if the conch is taken */ } - + /* update conch with host and path (this will fail if other process ** has a shared lock already), if the host id matches, use the big ** stick. @@ -7009,7 +7009,7 @@ static int proxyTakeConch(unixFile *pFile){ /* We are trying for an exclusive lock but another thread in this ** same process is still holding a shared lock. */ rc = SQLITE_BUSY; - } else { + } else { rc = proxyConchLock(pFile, myHostID, EXCLUSIVE_LOCK); } }else{ @@ -7018,7 +7018,7 @@ static int proxyTakeConch(unixFile *pFile){ if( rc==SQLITE_OK ){ char writeBuffer[PROXY_MAXCONCHLEN]; int writeSize = 0; - + writeBuffer[0] = (char)PROXY_CONCHVERSION; memcpy(&writeBuffer[PROXY_HEADERLEN], myHostID, PROXY_HOSTIDLEN); if( pCtx->lockProxyPath!=NULL ){ @@ -7031,8 +7031,8 @@ static int proxyTakeConch(unixFile *pFile){ robust_ftruncate(conchFile->h, writeSize); rc = unixWrite((sqlite3_file *)conchFile, writeBuffer, writeSize, 0); full_fsync(conchFile->h,0,0); - /* If we created a new conch file (not just updated the contents of a - ** valid conch file), try to match the permissions of the database + /* If we created a new conch file (not just updated the contents of a + ** valid conch file), try to match the permissions of the database */ if( rc==SQLITE_OK && createConch ){ struct stat buf; @@ -7056,14 +7056,14 @@ static int proxyTakeConch(unixFile *pFile){ } }else{ int code = errno; - fprintf(stderr, "STAT FAILED[%d] with %d %s\n", + fprintf(stderr, "STAT FAILED[%d] with %d %s\n", err, code, strerror(code)); #endif } } } conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, SHARED_LOCK); - + end_takeconch: OSTRACE(("TRANSPROXY: CLOSE %d\n", pFile->h)); if( rc==SQLITE_OK && pFile->openFlags ){ @@ -7086,7 +7086,7 @@ static int proxyTakeConch(unixFile *pFile){ rc = proxyCreateUnixFile(path, &pCtx->lockProxy, 1); if( rc!=SQLITE_OK && rc!=SQLITE_NOMEM && tryOldLockPath ){ /* we couldn't create the proxy lock file with the old lock file path - ** so try again via auto-naming + ** so try again via auto-naming */ forceNewLockPath = 1; tryOldLockPath = 0; @@ -7106,7 +7106,7 @@ static int proxyTakeConch(unixFile *pFile){ } if( rc==SQLITE_OK ){ pCtx->conchHeld = 1; - + if( pCtx->lockProxy->pMethod == &afpIoMethods ){ afpLockingContext *afpCtx; afpCtx = (afpLockingContext *)pCtx->lockProxy->lockingContext; @@ -7118,7 +7118,7 @@ static int proxyTakeConch(unixFile *pFile){ OSTRACE(("TAKECONCH %d %s\n", conchFile->h, rc==SQLITE_OK?"ok":"failed")); return rc; - } while (1); /* in case we need to retry the :auto: lock file - + } while (1); /* in case we need to retry the :auto: lock file - ** we should never get here except via the 'continue' call. */ } } @@ -7134,7 +7134,7 @@ static int proxyReleaseConch(unixFile *pFile){ pCtx = (proxyLockingContext *)pFile->lockingContext; conchFile = pCtx->conchFile; OSTRACE(("RELEASECONCH %d for %s pid=%d\n", conchFile->h, - (pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"), + (pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"), osGetpid(0))); if( pCtx->conchHeld>0 ){ rc = conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, NO_LOCK); @@ -7162,13 +7162,13 @@ static int proxyCreateConchPathname(char *dbPath, char **pConchPath){ char *conchPath; /* buffer in which to construct conch name */ /* Allocate space for the conch filename and initialize the name to - ** the name of the original database file. */ + ** the name of the original database file. */ *pConchPath = conchPath = (char *)sqlite3_malloc64(len + 8); if( conchPath==0 ){ return SQLITE_NOMEM_BKPT; } memcpy(conchPath, dbPath, len+1); - + /* now insert a "." before the last / character */ for( i=(len-1); i>=0; i-- ){ if( conchPath[i]=='/' ){ @@ -7191,7 +7191,7 @@ static int proxyCreateConchPathname(char *dbPath, char **pConchPath){ /* Takes a fully configured proxy locking-style unix file and switches -** the local lock file path +** the local lock file path */ static int switchLockProxyPath(unixFile *pFile, const char *path) { proxyLockingContext *pCtx = (proxyLockingContext*)pFile->lockingContext; @@ -7200,7 +7200,7 @@ static int switchLockProxyPath(unixFile *pFile, const char *path) { if( pFile->eFileLock!=NO_LOCK ){ return SQLITE_BUSY; - } + } /* nothing to do if the path is NULL, :auto: or matches the existing path */ if( !path || path[0]=='\0' || !strcmp(path, ":auto:") || @@ -7218,7 +7218,7 @@ static int switchLockProxyPath(unixFile *pFile, const char *path) { sqlite3_free(oldPath); pCtx->lockProxyPath = sqlite3DbStrDup(0, path); } - + return rc; } @@ -7232,7 +7232,7 @@ static int switchLockProxyPath(unixFile *pFile, const char *path) { static int proxyGetDbPathForUnixFile(unixFile *pFile, char *dbPath){ #if defined(__APPLE__) if( pFile->pMethod == &afpIoMethods ){ - /* afp style keeps a reference to the db path in the filePath field + /* afp style keeps a reference to the db path in the filePath field ** of the struct */ assert( (int)strlen((char*)pFile->lockingContext)<=MAXPATHLEN ); strlcpy(dbPath, ((afpLockingContext *)pFile->lockingContext)->dbPath, @@ -7253,9 +7253,9 @@ static int proxyGetDbPathForUnixFile(unixFile *pFile, char *dbPath){ } /* -** Takes an already filled in unix file and alters it so all file locking +** Takes an already filled in unix file and alters it so all file locking ** will be performed on the local proxy lock file. The following fields -** are preserved in the locking context so that they can be restored and +** are preserved in the locking context so that they can be restored and ** the unix structure properly cleaned up at close time: ** ->lockingContext ** ->pMethod @@ -7265,7 +7265,7 @@ static int proxyTransformUnixFile(unixFile *pFile, const char *path) { char dbPath[MAXPATHLEN+1]; /* Name of the database file */ char *lockPath=NULL; int rc = SQLITE_OK; - + if( pFile->eFileLock!=NO_LOCK ){ return SQLITE_BUSY; } @@ -7275,7 +7275,7 @@ static int proxyTransformUnixFile(unixFile *pFile, const char *path) { }else{ lockPath=(char *)path; } - + OSTRACE(("TRANSPROXY %d for %s pid=%d\n", pFile->h, (lockPath ? lockPath : ":auto:"), osGetpid(0))); @@ -7309,7 +7309,7 @@ static int proxyTransformUnixFile(unixFile *pFile, const char *path) { rc = SQLITE_OK; } } - } + } if( rc==SQLITE_OK && lockPath ){ pCtx->lockProxyPath = sqlite3DbStrDup(0, lockPath); } @@ -7321,7 +7321,7 @@ static int proxyTransformUnixFile(unixFile *pFile, const char *path) { } } if( rc==SQLITE_OK ){ - /* all memory is allocated, proxys are created and assigned, + /* all memory is allocated, proxys are created and assigned, ** switch the locking context and pMethod then return. */ pCtx->oldLockingContext = pFile->lockingContext; @@ -7329,12 +7329,12 @@ static int proxyTransformUnixFile(unixFile *pFile, const char *path) { pCtx->pOldMethod = pFile->pMethod; pFile->pMethod = &proxyIoMethods; }else{ - if( pCtx->conchFile ){ + if( pCtx->conchFile ){ pCtx->conchFile->pMethod->xClose((sqlite3_file *)pCtx->conchFile); sqlite3_free(pCtx->conchFile); } sqlite3DbFree(0, pCtx->lockProxyPath); - sqlite3_free(pCtx->conchFilePath); + sqlite3_free(pCtx->conchFilePath); sqlite3_free(pCtx); } OSTRACE(("TRANSPROXY %d %s\n", pFile->h, @@ -7372,7 +7372,7 @@ static int proxyFileControl(sqlite3_file *id, int op, void *pArg){ if( isProxyStyle ){ /* turn off proxy locking - not supported. If support is added for ** switching proxy locking mode off then it will need to fail if - ** the journal mode is WAL mode. + ** the journal mode is WAL mode. */ rc = SQLITE_ERROR /*SQLITE_PROTOCOL? SQLITE_MISUSE?*/; }else{ @@ -7382,9 +7382,9 @@ static int proxyFileControl(sqlite3_file *id, int op, void *pArg){ }else{ const char *proxyPath = (const char *)pArg; if( isProxyStyle ){ - proxyLockingContext *pCtx = + proxyLockingContext *pCtx = (proxyLockingContext*)pFile->lockingContext; - if( !strcmp(pArg, ":auto:") + if( !strcmp(pArg, ":auto:") || (pCtx->lockProxyPath && !strncmp(pCtx->lockProxyPath, proxyPath, MAXPATHLEN)) ){ @@ -7509,7 +7509,7 @@ static int proxyClose(sqlite3_file *id) { unixFile *lockProxy = pCtx->lockProxy; unixFile *conchFile = pCtx->conchFile; int rc = SQLITE_OK; - + if( lockProxy ){ rc = lockProxy->pMethod->xUnlock((sqlite3_file*)lockProxy, NO_LOCK); if( rc ) return rc; @@ -7546,7 +7546,7 @@ static int proxyClose(sqlite3_file *id) { ** The proxy locking style is intended for use with AFP filesystems. ** And since AFP is only supported on MacOSX, the proxy locking is also ** restricted to MacOSX. -** +** ** ******************* End of the proxy lock implementation ********************** ******************************************************************************/ @@ -7564,8 +7564,8 @@ static int proxyClose(sqlite3_file *id) { ** necessarily been initialized when this routine is called, and so they ** should not be used. */ -int sqlite3_os_init(void){ - /* +int sqlite3_os_init(void){ + /* ** The following macro defines an initializer for an sqlite3_vfs object. ** The name of the VFS is NAME. The pAppData is a pointer to a pointer ** to the "finder" function. (pAppData is a pointer to a pointer because @@ -7581,7 +7581,7 @@ int sqlite3_os_init(void){ ** ** Most finders simply return a pointer to a fixed sqlite3_io_methods ** object. But the "autolockIoFinder" available on MacOSX does a little - ** more than that; it looks at the filesystem type that hosts the + ** more than that; it looks at the filesystem type that hosts the ** database file and tries to choose an locking method appropriate for ** that filesystem time. */ @@ -7653,7 +7653,7 @@ int sqlite3_os_init(void){ for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){ sqlite3_vfs_register(&aVfs[i], i==0); } - return SQLITE_OK; + return SQLITE_OK; } /* @@ -7663,8 +7663,8 @@ int sqlite3_os_init(void){ ** to release dynamically allocated objects. But not on unix. ** This routine is a no-op for unix. */ -int sqlite3_os_end(void){ - return SQLITE_OK; +int sqlite3_os_end(void){ + return SQLITE_OK; } - + #endif /* SQLITE_OS_UNIX */ diff --git a/third_party/sqlite/src/src/pager.c b/third_party/sqlite/src/src/pager.c index 40c4dd9d88fa9..44fbe9582a726 100644 --- a/third_party/sqlite/src/src/pager.c +++ b/third_party/sqlite/src/src/pager.c @@ -10,7 +10,7 @@ ** ************************************************************************* ** This is the implementation of the page cache subsystem or "pager". -** +** ** The pager is used to access a database disk file. It implements ** atomic commit and rollback through the use of a journal file that ** is separate from the database file. The pager also implements file @@ -36,60 +36,60 @@ ** ** Definition: A page of the database file is said to be "overwriteable" if ** one or more of the following are true about the page: -** +** ** (a) The original content of the page as it was at the beginning of ** the transaction has been written into the rollback journal and ** synced. -** +** ** (b) The page was a freelist leaf page at the start of the transaction. -** +** ** (c) The page number is greater than the largest page that existed in ** the database file at the start of the transaction. -** +** ** (1) A page of the database file is never overwritten unless one of the ** following are true: -** +** ** (a) The page and all other pages on the same sector are overwriteable. -** +** ** (b) The atomic page write optimization is enabled, and the entire ** transaction other than the update of the transaction sequence ** number consists of a single page change. -** +** ** (2) The content of a page written into the rollback journal exactly matches ** both the content in the database when the rollback journal was written ** and the content in the database at the beginning of the current ** transaction. -** +** ** (3) Writes to the database file are an integer multiple of the page size ** in length and are aligned on a page boundary. -** +** ** (4) Reads from the database file are either aligned on a page boundary and ** an integer multiple of the page size in length or are taken from the ** first 100 bytes of the database file. -** +** ** (5) All writes to the database file are synced prior to the rollback journal ** being deleted, truncated, or zeroed. -** +** ** (6) If a master journal file is used, then all writes to the database file ** are synced prior to the master journal being deleted. -** +** ** Definition: Two databases (or the same database at two points it time) ** are said to be "logically equivalent" if they give the same answer to ** all queries. Note in particular the content of freelist leaf ** pages can be changed arbitrarily without affecting the logical equivalence ** of the database. -** +** ** (7) At any time, if any subset, including the empty set and the total set, -** of the unsynced changes to a rollback journal are removed and the +** of the unsynced changes to a rollback journal are removed and the ** journal is rolled back, the resulting database file will be logically ** equivalent to the database file at the beginning of the transaction. -** +** ** (8) When a transaction is rolled back, the xTruncate method of the VFS ** is called to restore the database file to the same size it was at ** the beginning of the transaction. (In some VFSes, the xTruncate ** method is a no-op, but that does not change the fact the SQLite will ** invoke it.) -** +** ** (9) Whenever the database file is modified, at least one bit in the range ** of bytes from 24 through 39 inclusive will be changed prior to releasing ** the EXCLUSIVE lock, thus signaling other connections on the same @@ -122,7 +122,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ /* ** The following two macros are used within the PAGERTRACE() macros above -** to print out file-descriptors. +** to print out file-descriptors. ** ** PAGERID() takes a pointer to a Pager struct as its argument. The ** associated file-descriptor is returned. FILEHANDLEID() takes an sqlite3_file @@ -143,7 +143,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** | | | ** | V | ** |<-------WRITER_LOCKED------> ERROR -** | | ^ +** | | ^ ** | V | ** |<------WRITER_CACHEMOD-------->| ** | | | @@ -155,7 +155,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** ** ** List of state transitions and the C [function] that performs each: -** +** ** OPEN -> READER [sqlite3PagerSharedLock] ** READER -> OPEN [pager_unlock] ** @@ -167,7 +167,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** ** WRITER_*** -> ERROR [pager_error] ** ERROR -> OPEN [pager_unlock] -** +** ** ** OPEN: ** @@ -181,9 +181,9 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** ** READER: ** -** In this state all the requirements for reading the database in +** In this state all the requirements for reading the database in ** rollback (non-WAL) mode are met. Unless the pager is (or recently -** was) in exclusive-locking mode, a user-level read transaction is +** was) in exclusive-locking mode, a user-level read transaction is ** open. The database size is known in this state. ** ** A connection running with locking_mode=normal enters this state when @@ -193,28 +193,28 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** this state even after the read-transaction is closed. The only way ** a locking_mode=exclusive connection can transition from READER to OPEN ** is via the ERROR state (see below). -** +** ** * A read transaction may be active (but a write-transaction cannot). ** * A SHARED or greater lock is held on the database file. -** * The dbSize variable may be trusted (even if a user-level read +** * The dbSize variable may be trusted (even if a user-level read ** transaction is not active). The dbOrigSize and dbFileSize variables ** may not be trusted at this point. ** * If the database is a WAL database, then the WAL connection is open. -** * Even if a read-transaction is not open, it is guaranteed that +** * Even if a read-transaction is not open, it is guaranteed that ** there is no hot-journal in the file-system. ** ** WRITER_LOCKED: ** ** The pager moves to this state from READER when a write-transaction -** is first opened on the database. In WRITER_LOCKED state, all locks -** required to start a write-transaction are held, but no actual +** is first opened on the database. In WRITER_LOCKED state, all locks +** required to start a write-transaction are held, but no actual ** modifications to the cache or database have taken place. ** -** In rollback mode, a RESERVED or (if the transaction was opened with +** In rollback mode, a RESERVED or (if the transaction was opened with ** BEGIN EXCLUSIVE) EXCLUSIVE lock is obtained on the database file when -** moving to this state, but the journal file is not written to or opened -** to in this state. If the transaction is committed or rolled back while -** in WRITER_LOCKED state, all that is required is to unlock the database +** moving to this state, but the journal file is not written to or opened +** to in this state. If the transaction is committed or rolled back while +** in WRITER_LOCKED state, all that is required is to unlock the database ** file. ** ** IN WAL mode, WalBeginWriteTransaction() is called to lock the log file. @@ -222,7 +222,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** is made to obtain an EXCLUSIVE lock on the database file. ** ** * A write transaction is active. -** * If the connection is open in rollback-mode, a RESERVED or greater +** * If the connection is open in rollback-mode, a RESERVED or greater ** lock is held on the database file. ** * If the connection is open in WAL-mode, a WAL write transaction ** is open (i.e. sqlite3WalBeginWriteTransaction() has been successfully @@ -241,7 +241,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** ** * A write transaction is active. ** * A RESERVED or greater lock is held on the database file. -** * The journal file is open and the first header has been written +** * The journal file is open and the first header has been written ** to it, but the header has not been synced to disk. ** * The contents of the page cache have been modified. ** @@ -254,7 +254,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** ** * A write transaction is active. ** * An EXCLUSIVE or greater lock is held on the database file. -** * The journal file is open and the first header has been written +** * The journal file is open and the first header has been written ** and synced to disk. ** * The contents of the page cache have been modified (and possibly ** written to disk). @@ -266,8 +266,8 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** A rollback-mode pager changes to WRITER_FINISHED state from WRITER_DBMOD ** state after the entire transaction has been successfully written into the ** database file. In this state the transaction may be committed simply -** by finalizing the journal file. Once in WRITER_FINISHED state, it is -** not possible to modify the database further. At this point, the upper +** by finalizing the journal file. Once in WRITER_FINISHED state, it is +** not possible to modify the database further. At this point, the upper ** layer must either commit or rollback the transaction. ** ** * A write transaction is active. @@ -275,19 +275,19 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** * All writing and syncing of journal and database data has finished. ** If no error occurred, all that remains is to finalize the journal to ** commit the transaction. If an error did occur, the caller will need -** to rollback the transaction. +** to rollback the transaction. ** ** ERROR: ** ** The ERROR state is entered when an IO or disk-full error (including -** SQLITE_IOERR_NOMEM) occurs at a point in the code that makes it -** difficult to be sure that the in-memory pager state (cache contents, +** SQLITE_IOERR_NOMEM) occurs at a point in the code that makes it +** difficult to be sure that the in-memory pager state (cache contents, ** db size etc.) are consistent with the contents of the file-system. ** ** Temporary pager files may enter the ERROR state, but in-memory pagers ** cannot. ** -** For example, if an IO error occurs while performing a rollback, +** For example, if an IO error occurs while performing a rollback, ** the contents of the page-cache may be left in an inconsistent state. ** At this point it would be dangerous to change back to READER state ** (as usually happens after a rollback). Any subsequent readers might @@ -297,13 +297,13 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** instead of READER following such an error. ** ** Once it has entered the ERROR state, any attempt to use the pager -** to read or write data returns an error. Eventually, once all +** to read or write data returns an error. Eventually, once all ** outstanding transactions have been abandoned, the pager is able to -** transition back to OPEN state, discarding the contents of the +** transition back to OPEN state, discarding the contents of the ** page-cache and any other in-memory state at the same time. Everything ** is reloaded from disk (and, if necessary, hot-journal rollback peformed) ** when a read-transaction is next opened on the pager (transitioning -** the pager into READER state). At that point the system has recovered +** the pager into READER state). At that point the system has recovered ** from the error. ** ** Specifically, the pager jumps into the ERROR state if: @@ -319,21 +319,21 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** memory. ** ** In other cases, the error is returned to the b-tree layer. The b-tree -** layer then attempts a rollback operation. If the error condition +** layer then attempts a rollback operation. If the error condition ** persists, the pager enters the ERROR state via condition (1) above. ** ** Condition (3) is necessary because it can be triggered by a read-only ** statement executed within a transaction. In this case, if the error ** code were simply returned to the user, the b-tree layer would not ** automatically attempt a rollback, as it assumes that an error in a -** read-only statement cannot leave the pager in an internally inconsistent +** read-only statement cannot leave the pager in an internally inconsistent ** state. ** ** * The Pager.errCode variable is set to something other than SQLITE_OK. ** * There are one or more outstanding references to pages (after the ** last reference is dropped the pager should move back to OPEN state). ** * The pager is not an in-memory pager. -** +** ** ** Notes: ** @@ -343,7 +343,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** ** * Normally, a connection open in exclusive mode is never in PAGER_OPEN ** state. There are two exceptions: immediately after exclusive-mode has -** been turned on (and before any read or write transactions are +** been turned on (and before any read or write transactions are ** executed), and when the pager is leaving the "error state". ** ** * See also: assert_pager_state(). @@ -357,7 +357,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ #define PAGER_ERROR 6 /* -** The Pager.eLock variable is almost always set to one of the +** The Pager.eLock variable is almost always set to one of the ** following locking-states, according to the lock currently held on ** the database file: NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. ** This variable is kept up to date as locks are taken and released by @@ -372,20 +372,20 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** to a less exclusive (lower) value than the lock that is actually held ** at the system level, but it is never set to a more exclusive value. ** -** This is usually safe. If an xUnlock fails or appears to fail, there may +** This is usually safe. If an xUnlock fails or appears to fail, there may ** be a few redundant xLock() calls or a lock may be held for longer than ** required, but nothing really goes wrong. ** ** The exception is when the database file is unlocked as the pager moves -** from ERROR to OPEN state. At this point there may be a hot-journal file +** from ERROR to OPEN state. At this point there may be a hot-journal file ** in the file-system that needs to be rolled back (as part of an OPEN->SHARED ** transition, by the same pager or any other). If the call to xUnlock() ** fails at this point and the pager is left holding an EXCLUSIVE lock, this ** can confuse the call to xCheckReservedLock() call made later as part ** of hot-journal detection. ** -** xCheckReservedLock() is defined as returning true "if there is a RESERVED -** lock held by this process or any others". So xCheckReservedLock may +** xCheckReservedLock() is defined as returning true "if there is a RESERVED +** lock held by this process or any others". So xCheckReservedLock may ** return true because the caller itself is holding an EXCLUSIVE lock (but ** doesn't know it because of a previous error in xUnlock). If this happens ** a hot-journal may be mistaken for a journal being created by an active @@ -396,12 +396,12 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** database in the ERROR state, Pager.eLock is set to UNKNOWN_LOCK. It ** is only changed back to a real locking state after a successful call ** to xLock(EXCLUSIVE). Also, the code to do the OPEN->SHARED state transition -** omits the check for a hot-journal if Pager.eLock is set to UNKNOWN_LOCK +** omits the check for a hot-journal if Pager.eLock is set to UNKNOWN_LOCK ** lock. Instead, it assumes a hot-journal exists and obtains an EXCLUSIVE ** lock on the database file before attempting to roll it back. See function ** PagerSharedLock() for more detail. ** -** Pager.eLock may only be set to UNKNOWN_LOCK when the pager is in +** Pager.eLock may only be set to UNKNOWN_LOCK when the pager is in ** PAGER_OPEN state. */ #define UNKNOWN_LOCK (EXCLUSIVE_LOCK+1) @@ -421,7 +421,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ #endif /* -** The maximum allowed sector size. 64KiB. If the xSectorsize() method +** The maximum allowed sector size. 64KiB. If the xSectorsize() method ** returns a value larger than this, then MAX_SECTOR_SIZE is used instead. ** This could conceivably cause corruption following a power failure on ** such a system. This is currently an undocumented limit. @@ -437,7 +437,7 @@ int sqlite3PagerTrace=1; /* True to enable tracing */ ** ** When a savepoint is created, the PagerSavepoint.iHdrOffset field is ** set to 0. If a journal-header is written into the main journal while -** the savepoint is active, then iHdrOffset is set to the byte offset +** the savepoint is active, then iHdrOffset is set to the byte offset ** immediately following the last journal record written into the main ** journal before the journal-header. This is required during savepoint ** rollback (see pagerPlaybackSavepoint()). @@ -487,34 +487,34 @@ struct PagerSavepoint { ** ** changeCountDone ** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. +** This boolean variable is used to make sure that the change-counter +** (the 4-byte header field at byte offset 24 of the database file) is +** not updated more often than necessary. ** -** It is set to true when the change-counter field is updated, which +** It is set to true when the change-counter field is updated, which ** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is +** It is cleared (set to false) whenever an exclusive lock is ** relinquished on the database file. Each time a transaction is committed, ** The changeCountDone flag is inspected. If it is true, the work of ** updating the change-counter is omitted for the current transaction. ** -** This mechanism means that when running in exclusive mode, a connection +** This mechanism means that when running in exclusive mode, a connection ** need only update the change-counter once, for the first transaction ** committed. ** ** setMaster ** ** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a master-journal name to be written into the +** (or may not) specify a master-journal name to be written into the ** journal file before it is synced to disk. ** -** Whether or not a journal file contains a master-journal pointer affects -** the way in which the journal file is finalized after the transaction is +** Whether or not a journal file contains a master-journal pointer affects +** the way in which the journal file is finalized after the transaction is ** committed or rolled back when running in "journal_mode=PERSIST" mode. ** If a journal file does not contain a master-journal pointer, it is ** finalized by overwriting the first journal header with zeroes. If -** it does contain a master-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were +** it does contain a master-journal pointer the journal file is finalized +** by truncating it to zero bytes, just as if the connection were ** running in "journal_mode=truncate" mode. ** ** Journal files that contain master journal pointers cannot be finalized @@ -540,12 +540,12 @@ struct PagerSavepoint { ** to allocate a new page to prevent the journal file from being written ** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF ** case is a user preference. -** +** ** If the SPILLFLAG_NOSYNC bit is set, writing to the database from ** pagerStress() is permitted, but syncing the journal file is not. ** This flag is set by sqlite3PagerWrite() when the file-system sector-size ** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. +** from happening in between the journalling of two pages on the same sector. ** ** subjInMemory ** @@ -553,16 +553,16 @@ struct PagerSavepoint { ** is opened as an in-memory journal file. If false, then in-memory ** sub-journals are only used for in-memory pager files. ** -** This variable is updated by the upper layer each time a new +** This variable is updated by the upper layer each time a new ** write-transaction is opened. ** ** dbSize, dbOrigSize, dbFileSize ** ** Variable dbSize is set to the number of pages in the database file. ** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). +** OPEN and ERROR). ** -** dbSize is set based on the size of the database file, which may be +** dbSize is set based on the size of the database file, which may be ** larger than the size of the database (the value stored at offset ** 28 of the database header by the btree). If the size of the file ** is not an integer multiple of the page-size, the value stored in @@ -573,10 +573,10 @@ struct PagerSavepoint { ** ** During a write-transaction, if pages with page-numbers greater than ** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), +** Similarly, if the database is truncated using PagerTruncateImage(), ** dbSize is updated. ** -** Variables dbOrigSize and dbFileSize are valid in states +** Variables dbOrigSize and dbFileSize are valid in states ** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize ** variable at the start of the transaction. It is used during rollback, ** and to determine whether or not pages need to be journalled before @@ -585,12 +585,12 @@ struct PagerSavepoint { ** Throughout a write-transaction, dbFileSize contains the size of ** the file on disk in pages. It is set to a copy of dbSize when the ** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. +** to write or truncate the database file on disk. ** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), +** The only reason the dbFileSize variable is required is to suppress +** unnecessary calls to xTruncate() after committing a transaction. If, +** when a transaction is committed, the dbFileSize variable indicates +** that the database file is larger than the database image (Pager.dbSize), ** pager_truncate() is called. The pager_truncate() call uses xFilesize() ** to measure the database file on disk, and then truncates it if required. ** dbFileSize is not used when rolling back a transaction. In this case @@ -601,20 +601,20 @@ struct PagerSavepoint { ** dbHintSize ** ** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. +** the VFS xFileControl(FCNTL_SIZE_HINT) method. ** ** dbHintSize is set to a copy of the dbSize variable when a ** write-transaction is opened (at the same time as dbFileSize and ** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, ** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for +** size-hint passed to the method call. See pager_write_pagelist() for ** details. ** ** errCode ** ** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX +** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode +** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX ** sub-codes. */ struct Pager { @@ -710,7 +710,7 @@ struct Pager { /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains -** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS +** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS ** or CACHE_WRITE to sqlite3_db_status(). */ #define PAGER_STAT_HIT 0 @@ -767,7 +767,7 @@ static const unsigned char aJournalMagic[] = { #define JOURNAL_PG_SZ(pPager) ((pPager->pageSize) + 8) /* -** The journal header size for this pager. This is usually the same +** The journal header size for this pager. This is usually the same ** size as a single disk sector. See also setSectorSize(). */ #define JOURNAL_HDR_SZ(pPager) (pPager->sectorSize) @@ -836,7 +836,7 @@ int sqlite3PagerUseWal(Pager *pPager, Pgno pgno){ # define pagerBeginReadTransaction(z) SQLITE_OK #endif -#ifndef NDEBUG +#ifndef NDEBUG /* ** Usage: ** @@ -865,25 +865,25 @@ static int assert_pager_state(Pager *p){ assert( p->tempFile==0 || p->eLock==EXCLUSIVE_LOCK ); assert( p->tempFile==0 || pPager->changeCountDone ); - /* If the useJournal flag is clear, the journal-mode must be "OFF". + /* If the useJournal flag is clear, the journal-mode must be "OFF". ** And if the journal-mode is "OFF", the journal file must not be open. */ assert( p->journalMode==PAGER_JOURNALMODE_OFF || p->useJournal ); assert( p->journalMode!=PAGER_JOURNALMODE_OFF || !isOpen(p->jfd) ); - /* Check that MEMDB implies noSync. And an in-memory journal. Since - ** this means an in-memory pager performs no IO at all, it cannot encounter - ** either SQLITE_IOERR or SQLITE_FULL during rollback or while finalizing - ** a journal file. (although the in-memory journal implementation may - ** return SQLITE_IOERR_NOMEM while the journal file is being written). It - ** is therefore not possible for an in-memory pager to enter the ERROR + /* Check that MEMDB implies noSync. And an in-memory journal. Since + ** this means an in-memory pager performs no IO at all, it cannot encounter + ** either SQLITE_IOERR or SQLITE_FULL during rollback or while finalizing + ** a journal file. (although the in-memory journal implementation may + ** return SQLITE_IOERR_NOMEM while the journal file is being written). It + ** is therefore not possible for an in-memory pager to enter the ERROR ** state. */ if( MEMDB ){ assert( !isOpen(p->fd) ); assert( p->noSync ); - assert( p->journalMode==PAGER_JOURNALMODE_OFF - || p->journalMode==PAGER_JOURNALMODE_MEMORY + assert( p->journalMode==PAGER_JOURNALMODE_OFF + || p->journalMode==PAGER_JOURNALMODE_MEMORY ); assert( p->eState!=PAGER_ERROR && p->eState!=PAGER_OPEN ); assert( pagerUseWal(p)==0 ); @@ -930,9 +930,9 @@ static int assert_pager_state(Pager *p){ ** to journal_mode=wal. */ assert( p->eLock>=RESERVED_LOCK ); - assert( isOpen(p->jfd) - || p->journalMode==PAGER_JOURNALMODE_OFF - || p->journalMode==PAGER_JOURNALMODE_WAL + assert( isOpen(p->jfd) + || p->journalMode==PAGER_JOURNALMODE_OFF + || p->journalMode==PAGER_JOURNALMODE_WAL ); } assert( pPager->dbOrigSize==pPager->dbFileSize ); @@ -944,9 +944,9 @@ static int assert_pager_state(Pager *p){ assert( pPager->errCode==SQLITE_OK ); assert( !pagerUseWal(pPager) ); assert( p->eLock>=EXCLUSIVE_LOCK ); - assert( isOpen(p->jfd) - || p->journalMode==PAGER_JOURNALMODE_OFF - || p->journalMode==PAGER_JOURNALMODE_WAL + assert( isOpen(p->jfd) + || p->journalMode==PAGER_JOURNALMODE_OFF + || p->journalMode==PAGER_JOURNALMODE_WAL ); assert( pPager->dbOrigSize<=pPager->dbHintSize ); break; @@ -955,9 +955,9 @@ static int assert_pager_state(Pager *p){ assert( p->eLock==EXCLUSIVE_LOCK ); assert( pPager->errCode==SQLITE_OK ); assert( !pagerUseWal(pPager) ); - assert( isOpen(p->jfd) - || p->journalMode==PAGER_JOURNALMODE_OFF - || p->journalMode==PAGER_JOURNALMODE_WAL + assert( isOpen(p->jfd) + || p->journalMode==PAGER_JOURNALMODE_OFF + || p->journalMode==PAGER_JOURNALMODE_WAL ); break; @@ -975,7 +975,7 @@ static int assert_pager_state(Pager *p){ } #endif /* ifndef NDEBUG */ -#ifdef SQLITE_DEBUG +#ifdef SQLITE_DEBUG /* ** Return a pointer to a human readable string in a static buffer ** containing the state of the Pager object passed as an argument. This @@ -1123,7 +1123,7 @@ static int write32bits(sqlite3_file *fd, i64 offset, u32 val){ ** succeeds, set the Pager.eLock variable to match the (attempted) new lock. ** ** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is -** called, do not modify it. See the comment above the #define of +** called, do not modify it. See the comment above the #define of ** UNKNOWN_LOCK for an explanation of this. */ static int pagerUnlockDb(Pager *pPager, int eLock){ @@ -1146,11 +1146,11 @@ static int pagerUnlockDb(Pager *pPager, int eLock){ /* ** Lock the database file to level eLock, which must be either SHARED_LOCK, ** RESERVED_LOCK or EXCLUSIVE_LOCK. If the caller is successful, set the -** Pager.eLock variable to the new locking state. +** Pager.eLock variable to the new locking state. ** -** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is -** called, do not modify it unless the new locking state is EXCLUSIVE_LOCK. -** See the comment above the #define of UNKNOWN_LOCK for an explanation +** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is +** called, do not modify it unless the new locking state is EXCLUSIVE_LOCK. +** See the comment above the #define of UNKNOWN_LOCK for an explanation ** of this. */ static int pagerLockDb(Pager *pPager, int eLock){ @@ -1255,8 +1255,8 @@ static void checkPage(PgHdr *pPg){ /* ** When this is called the journal file for pager pPager must be open. -** This function attempts to read a master journal file name from the -** end of the file and, if successful, copies it into memory supplied +** This function attempts to read a master journal file name from the +** end of the file and, if successful, copies it into memory supplied ** by the caller. See comments above writeMasterJournal() for the format ** used to store a master journal file name at the end of a journal file. ** @@ -1272,7 +1272,7 @@ static void checkPage(PgHdr *pPg){ ** nul-terminator byte is appended to the buffer following the master ** journal file name. ** -** If it is determined that no master journal file name is present +** If it is determined that no master journal file name is present ** zMaster[0] is set to 0 and SQLITE_OK returned. ** ** If an error occurs while reading from the journal file, an SQLite @@ -1290,8 +1290,8 @@ static int readMasterJournal(sqlite3_file *pJrnl, char *zMaster, u32 nMaster){ if( SQLITE_OK!=(rc = sqlite3OsFileSize(pJrnl, &szJ)) || szJ<16 || SQLITE_OK!=(rc = read32bits(pJrnl, szJ-16, &len)) - || len>=nMaster - || len==0 + || len>=nMaster + || len==0 || SQLITE_OK!=(rc = read32bits(pJrnl, szJ-12, &cksum)) || SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, aMagic, 8, szJ-8)) || memcmp(aMagic, aJournalMagic, 8) @@ -1313,13 +1313,13 @@ static int readMasterJournal(sqlite3_file *pJrnl, char *zMaster, u32 nMaster){ len = 0; } zMaster[len] = '\0'; - + return SQLITE_OK; } /* -** Return the offset of the sector boundary at or immediately -** following the value in pPager->journalOff, assuming a sector +** Return the offset of the sector boundary at or immediately +** following the value in pPager->journalOff, assuming a sector ** size of pPager->sectorSize bytes. ** ** i.e for a sector size of 512: @@ -1330,7 +1330,7 @@ static int readMasterJournal(sqlite3_file *pJrnl, char *zMaster, u32 nMaster){ ** 512 512 ** 100 512 ** 2000 2048 -** +** */ static i64 journalHdrOffset(Pager *pPager){ i64 offset = 0; @@ -1352,12 +1352,12 @@ static i64 journalHdrOffset(Pager *pPager){ ** ** If doTruncate is non-zero or the Pager.journalSizeLimit variable is ** set to 0, then truncate the journal file to zero bytes in size. Otherwise, -** zero the 28-byte header at the start of the journal file. In either case, -** if the pager is not in no-sync mode, sync the journal file immediately +** zero the 28-byte header at the start of the journal file. In either case, +** if the pager is not in no-sync mode, sync the journal file immediately ** after writing or truncating it. ** ** If Pager.journalSizeLimit is set to a positive, non-zero value, and -** following the truncation or zeroing described above the size of the +** following the truncation or zeroing described above the size of the ** journal file in bytes is larger than this value, then truncate the ** journal file to Pager.journalSizeLimit bytes. The journal file does ** not need to be synced following this operation. @@ -1383,8 +1383,8 @@ static int zeroJournalHdr(Pager *pPager, int doTruncate){ rc = sqlite3OsSync(pPager->jfd, SQLITE_SYNC_DATAONLY|pPager->syncFlags); } - /* At this point the transaction is committed but the write lock - ** is still held on the file. If there is a size limit configured for + /* At this point the transaction is committed but the write lock + ** is still held on the file. If there is a size limit configured for ** the persistent journal and the journal file currently consumes more ** space than that limit allows for, truncate it now. There is no need ** to sync the file following this operation. @@ -1412,7 +1412,7 @@ static int zeroJournalHdr(Pager *pPager, int doTruncate){ ** - 4 bytes: Initial database page count. ** - 4 bytes: Sector size used by the process that wrote this journal. ** - 4 bytes: Database page size. -** +** ** Followed by (JOURNAL_HDR_SZ - 28) bytes of unused space. */ static int writeJournalHdr(Pager *pPager){ @@ -1428,8 +1428,8 @@ static int writeJournalHdr(Pager *pPager){ nHeader = JOURNAL_HDR_SZ(pPager); } - /* If there are active savepoints and any of them were created - ** since the most recent journal header was written, update the + /* If there are active savepoints and any of them were created + ** since the most recent journal header was written, update the ** PagerSavepoint.iHdrOffset fields now. */ for(ii=0; iinSavepoint; ii++){ @@ -1440,10 +1440,10 @@ static int writeJournalHdr(Pager *pPager){ pPager->journalHdr = pPager->journalOff = journalHdrOffset(pPager); - /* + /* ** Write the nRec Field - the number of page records that follow this ** journal header. Normally, zero is written to this value at this time. - ** After the records are added to the journal (and the journal synced, + ** After the records are added to the journal (and the journal synced, ** if in full-sync mode), the zero is overwritten with the true number ** of records (see syncJournal()). ** @@ -1462,7 +1462,7 @@ static int writeJournalHdr(Pager *pPager){ */ assert( isOpen(pPager->fd) || pPager->noSync ); if( pPager->noSync || (pPager->journalMode==PAGER_JOURNALMODE_MEMORY) - || (sqlite3OsDeviceCharacteristics(pPager->fd)&SQLITE_IOCAP_SAFE_APPEND) + || (sqlite3OsDeviceCharacteristics(pPager->fd)&SQLITE_IOCAP_SAFE_APPEND) ){ memcpy(zHeader, aJournalMagic, sizeof(aJournalMagic)); put32bits(&zHeader[sizeof(aJournalMagic)], 0xffffffff); @@ -1470,7 +1470,7 @@ static int writeJournalHdr(Pager *pPager){ memset(zHeader, 0, sizeof(aJournalMagic)+4); } - /* The random check-hash initializer */ + /* The random check-hash initializer */ sqlite3_randomness(sizeof(pPager->cksumInit), &pPager->cksumInit); put32bits(&zHeader[sizeof(aJournalMagic)+4], pPager->cksumInit); /* The initial database size */ @@ -1489,23 +1489,23 @@ static int writeJournalHdr(Pager *pPager){ memset(&zHeader[sizeof(aJournalMagic)+20], 0, nHeader-(sizeof(aJournalMagic)+20)); - /* In theory, it is only necessary to write the 28 bytes that the - ** journal header consumes to the journal file here. Then increment the - ** Pager.journalOff variable by JOURNAL_HDR_SZ so that the next + /* In theory, it is only necessary to write the 28 bytes that the + ** journal header consumes to the journal file here. Then increment the + ** Pager.journalOff variable by JOURNAL_HDR_SZ so that the next ** record is written to the following sector (leaving a gap in the file ** that will be implicitly filled in by the OS). ** - ** However it has been discovered that on some systems this pattern can + ** However it has been discovered that on some systems this pattern can ** be significantly slower than contiguously writing data to the file, - ** even if that means explicitly writing data to the block of + ** even if that means explicitly writing data to the block of ** (JOURNAL_HDR_SZ - 28) bytes that will not be used. So that is what - ** is done. + ** is done. ** - ** The loop is required here in case the sector-size is larger than the + ** The loop is required here in case the sector-size is larger than the ** database page size. Since the zHeader buffer is only Pager.pageSize ** bytes in size, more than one call to sqlite3OsWrite() may be required ** to populate the entire journal header sector. - */ + */ for(nWrite=0; rc==SQLITE_OK&&nWritejournalHdr, nHeader)) rc = sqlite3OsWrite(pPager->jfd, zHeader, nHeader, pPager->journalOff); @@ -1603,29 +1603,29 @@ static int readJournalHdr( /* Check that the values read from the page-size and sector-size fields ** are within range. To be 'in range', both values need to be a power - ** of two greater than or equal to 512 or 32, and not greater than their + ** of two greater than or equal to 512 or 32, and not greater than their ** respective compile time maximum limits. */ if( iPageSize<512 || iSectorSize<32 || iPageSize>SQLITE_MAX_PAGE_SIZE || iSectorSize>MAX_SECTOR_SIZE - || ((iPageSize-1)&iPageSize)!=0 || ((iSectorSize-1)&iSectorSize)!=0 + || ((iPageSize-1)&iPageSize)!=0 || ((iSectorSize-1)&iSectorSize)!=0 ){ - /* If the either the page-size or sector-size in the journal-header is - ** invalid, then the process that wrote the journal-header must have - ** crashed before the header was synced. In this case stop reading + /* If the either the page-size or sector-size in the journal-header is + ** invalid, then the process that wrote the journal-header must have + ** crashed before the header was synced. In this case stop reading ** the journal file here. */ return SQLITE_DONE; } - /* Update the page-size to match the value read from the journal. - ** Use a testcase() macro to make sure that malloc failure within + /* Update the page-size to match the value read from the journal. + ** Use a testcase() macro to make sure that malloc failure within ** PagerSetPagesize() is tested. */ rc = sqlite3PagerSetPagesize(pPager, &iPageSize, -1); testcase( rc!=SQLITE_OK ); - /* Update the assumed sector-size to match the value used by + /* Update the assumed sector-size to match the value used by ** the process that created this journal. If this journal was ** created by a process other than this one, then this routine ** is being called from within pager_playback(). The local value @@ -1655,7 +1655,7 @@ static int readJournalHdr( ** The master journal page checksum is the sum of the bytes in the master ** journal name, where each byte is interpreted as a signed 8-bit integer. ** -** If zMaster is a NULL pointer (occurs for a single database transaction), +** If zMaster is a NULL pointer (occurs for a single database transaction), ** this call is a no-op. */ static int writeMasterJournal(Pager *pPager, const char *zMaster){ @@ -1668,8 +1668,8 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){ assert( pPager->setMaster==0 ); assert( !pagerUseWal(pPager) ); - if( !zMaster - || pPager->journalMode==PAGER_JOURNALMODE_MEMORY + if( !zMaster + || pPager->journalMode==PAGER_JOURNALMODE_MEMORY || !isOpen(pPager->jfd) ){ return SQLITE_OK; @@ -1705,16 +1705,16 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){ } pPager->journalOff += (nMaster+20); - /* If the pager is in peristent-journal mode, then the physical + /* If the pager is in peristent-journal mode, then the physical ** journal-file may extend past the end of the master-journal name - ** and 8 bytes of magic data just written to the file. This is + ** and 8 bytes of magic data just written to the file. This is ** dangerous because the code to rollback a hot-journal file - ** will not be able to find the master-journal name to determine - ** whether or not the journal is hot. + ** will not be able to find the master-journal name to determine + ** whether or not the journal is hot. ** - ** Easiest thing to do in this scenario is to truncate the journal + ** Easiest thing to do in this scenario is to truncate the journal ** file to the required size. - */ + */ if( SQLITE_OK==(rc = sqlite3OsFileSize(pPager->jfd, &jrnlSize)) && jrnlSize>pPager->journalOff ){ @@ -1760,7 +1760,7 @@ static void releaseAllSavepoints(Pager *pPager){ } /* -** Set the bit number pgno in the PagerSavepoint.pInSavepoint +** Set the bit number pgno in the PagerSavepoint.pInSavepoint ** bitvecs of all open savepoints. Return SQLITE_OK if successful ** or SQLITE_NOMEM if a malloc failure occurs. */ @@ -1789,8 +1789,8 @@ static int addToSavepointBitvecs(Pager *pPager, Pgno pgno){ ** not exhibit the UNDELETABLE_WHEN_OPEN property, the journal file is ** closed (if it is open). ** -** If the pager is in ERROR state when this function is called, the -** contents of the pager cache are discarded before switching back to +** If the pager is in ERROR state when this function is called, the +** contents of the pager cache are discarded before switching back to ** the OPEN state. Regardless of whether the pager is in exclusive-mode ** or not, any journal file left in the file-system will be treated ** as a hot-journal and rolled back the next time a read-transaction @@ -1798,9 +1798,9 @@ static int addToSavepointBitvecs(Pager *pPager, Pgno pgno){ */ static void pager_unlock(Pager *pPager){ - assert( pPager->eState==PAGER_READER - || pPager->eState==PAGER_OPEN - || pPager->eState==PAGER_ERROR + assert( pPager->eState==PAGER_READER + || pPager->eState==PAGER_OPEN + || pPager->eState==PAGER_ERROR ); sqlite3BitvecDestroy(pPager->pInJournal); @@ -1878,17 +1878,17 @@ static void pager_unlock(Pager *pPager){ /* ** This function is called whenever an IOERR or FULL error that requires ** the pager to transition into the ERROR state may ahve occurred. -** The first argument is a pointer to the pager structure, the second -** the error-code about to be returned by a pager API function. The -** value returned is a copy of the second argument to this function. +** The first argument is a pointer to the pager structure, the second +** the error-code about to be returned by a pager API function. The +** value returned is a copy of the second argument to this function. ** ** If the second argument is SQLITE_FULL, SQLITE_IOERR or one of the ** IOERR sub-codes, the pager enters the ERROR state and the error code ** is stored in Pager.errCode. While the pager remains in the ERROR state, ** all major API calls on the Pager will immediately return Pager.errCode. ** -** The ERROR state indicates that the contents of the pager-cache -** cannot be trusted. This state can be cleared by completely discarding +** The ERROR state indicates that the contents of the pager-cache +** cannot be trusted. This state can be cleared by completely discarding ** the contents of the pager-cache. If a transaction was active when ** the persistent error occurred, then the rollback journal may need ** to be replayed to restore the contents of the database file (as if @@ -1936,27 +1936,27 @@ static int pagerFlushOnCommit(Pager *pPager, int bCommit){ } /* -** This routine ends a transaction. A transaction is usually ended by -** either a COMMIT or a ROLLBACK operation. This routine may be called +** This routine ends a transaction. A transaction is usually ended by +** either a COMMIT or a ROLLBACK operation. This routine may be called ** after rollback of a hot-journal, or if an error occurs while opening ** the journal file or writing the very first journal-header of a ** database transaction. -** +** ** This routine is never called in PAGER_ERROR state. If it is called ** in PAGER_NONE or PAGER_SHARED state and the lock held is less ** exclusive than a RESERVED lock, it is a no-op. ** ** Otherwise, any active savepoints are released. ** -** If the journal file is open, then it is "finalized". Once a journal -** file has been finalized it is not possible to use it to roll back a +** If the journal file is open, then it is "finalized". Once a journal +** file has been finalized it is not possible to use it to roll back a ** transaction. Nor will it be considered to be a hot-journal by this ** or any other database connection. Exactly how a journal is finalized ** depends on whether or not the pager is running in exclusive mode and ** the current journal-mode (Pager.journalMode value), as follows: ** ** journalMode==MEMORY -** Journal file descriptor is simply closed. This destroys an +** Journal file descriptor is simply closed. This destroys an ** in-memory journal. ** ** journalMode==TRUNCATE @@ -1976,12 +1976,12 @@ static int pagerFlushOnCommit(Pager *pPager, int bCommit){ ** journalMode==PERSIST is used instead. ** ** After the journal is finalized, the pager moves to PAGER_READER state. -** If running in non-exclusive rollback mode, the lock on the file is +** If running in non-exclusive rollback mode, the lock on the file is ** downgraded to a SHARED_LOCK. ** ** SQLITE_OK is returned if no error occurs. If an error occurs during ** any of the IO operations to finalize the journal file or unlock the -** database then the IO error code is returned to the user. If the +** database then the IO error code is returned to the user. If the ** operation to finalize the journal file fails, then the code still ** tries to unlock the database file if not in exclusive mode. If the ** unlock operation fails as well, then the first error code related @@ -2000,9 +2000,9 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){ ** 1. After a successful hot-journal rollback, it is called with ** eState==PAGER_NONE and eLock==EXCLUSIVE_LOCK. ** - ** 2. If a connection with locking_mode=exclusive holding an EXCLUSIVE + ** 2. If a connection with locking_mode=exclusive holding an EXCLUSIVE ** lock switches back to locking_mode=normal and then executes a - ** read-transaction, this function is called with eState==PAGER_READER + ** read-transaction, this function is called with eState==PAGER_READER ** and eLock==EXCLUSIVE_LOCK when the read-transaction is closed. */ assert( assert_pager_state(pPager) ); @@ -2048,9 +2048,9 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){ */ int bDelete = !pPager->tempFile; assert( sqlite3JournalIsInMemory(pPager->jfd)==0 ); - assert( pPager->journalMode==PAGER_JOURNALMODE_DELETE - || pPager->journalMode==PAGER_JOURNALMODE_MEMORY - || pPager->journalMode==PAGER_JOURNALMODE_WAL + assert( pPager->journalMode==PAGER_JOURNALMODE_DELETE + || pPager->journalMode==PAGER_JOURNALMODE_MEMORY + || pPager->journalMode==PAGER_JOURNALMODE_WAL ); sqlite3OsClose(pPager->jfd); if( bDelete ){ @@ -2083,8 +2083,8 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){ } if( pagerUseWal(pPager) ){ - /* Drop the WAL write-lock, if any. Also, if the connection was in - ** locking_mode=exclusive mode but is no longer, drop the EXCLUSIVE + /* Drop the WAL write-lock, if any. Also, if the connection was in + ** locking_mode=exclusive mode but is no longer, drop the EXCLUSIVE ** lock held on the database file. */ rc2 = sqlite3WalEndWriteTransaction(pPager->pWal); @@ -2092,7 +2092,7 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){ }else if( rc==SQLITE_OK && bCommit && pPager->dbFileSize>pPager->dbSize ){ /* This branch is taken when committing a transaction in rollback-journal ** mode if the database file on disk is larger than the database image. - ** At this point the journal has been finalized and the transaction + ** At this point the journal has been finalized and the transaction ** successfully committed, but the EXCLUSIVE lock is still held on the ** file. So it is safe to truncate the database file to its minimum ** required size. */ @@ -2105,7 +2105,7 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){ if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK; } - if( !pPager->exclusiveMode + if( !pPager->exclusiveMode && (!pagerUseWal(pPager) || sqlite3WalExclusiveMode(pPager->pWal, 0)) ){ rc2 = pagerUnlockDb(pPager, SHARED_LOCK); @@ -2118,19 +2118,19 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){ } /* -** Execute a rollback if a transaction is active and unlock the -** database file. +** Execute a rollback if a transaction is active and unlock the +** database file. ** -** If the pager has already entered the ERROR state, do not attempt +** If the pager has already entered the ERROR state, do not attempt ** the rollback at this time. Instead, pager_unlock() is called. The ** call to pager_unlock() will discard all in-memory pages, unlock -** the database file and move the pager back to OPEN state. If this -** means that there is a hot-journal left in the file-system, the next -** connection to obtain a shared lock on the pager (which may be this one) +** the database file and move the pager back to OPEN state. If this +** means that there is a hot-journal left in the file-system, the next +** connection to obtain a shared lock on the pager (which may be this one) ** will roll it back. ** ** If the pager has not already entered the ERROR state, but an IO or -** malloc error occurs during a rollback, then this will itself cause +** malloc error occurs during a rollback, then this will itself cause ** the pager to enter the ERROR state. Which will be cleared by the ** call to pager_unlock(), as described above. */ @@ -2151,10 +2151,10 @@ static void pagerUnlockAndRollback(Pager *pPager){ /* ** Parameter aData must point to a buffer of pPager->pageSize bytes -** of data. Compute and return a checksum based ont the contents of the +** of data. Compute and return a checksum based ont the contents of the ** page of data and the current value of pPager->cksumInit. ** -** This is not a real checksum. It is really just the sum of the +** This is not a real checksum. It is really just the sum of the ** random initial value (pPager->cksumInit) and every 200th byte ** of the page data, starting with byte offset (pPager->pageSize%200). ** Each byte is interpreted as an 8-bit unsigned integer. @@ -2162,8 +2162,8 @@ static void pagerUnlockAndRollback(Pager *pPager){ ** Changing the formula used to compute this checksum results in an ** incompatible journal file format. ** -** If journal corruption occurs due to a power failure, the most likely -** scenario is that one end or the other of the record will be changed. +** If journal corruption occurs due to a power failure, the most likely +** scenario is that one end or the other of the record will be changed. ** It is much less likely that the two ends of the journal record will be ** correct and the middle be corrupt. Thus, this "checksum" scheme, ** though fast and simple, catches the mostly likely kind of corruption. @@ -2213,7 +2213,7 @@ void sqlite3PagerAlignReserve(Pager *pDest, Pager *pSrc){ ** The page begins at offset *pOffset into the file. The *pOffset ** value is increased to the start of the next page in the journal. ** -** The main rollback journal uses checksums - the statement journal does +** The main rollback journal uses checksums - the statement journal does ** not. ** ** If the page number of the page record read from the (sub-)journal file @@ -2233,7 +2233,7 @@ void sqlite3PagerAlignReserve(Pager *pDest, Pager *pSrc){ ** is successfully read from the (sub-)journal file but appears to be ** corrupted, SQLITE_DONE is returned. Data is considered corrupted in ** two circumstances: -** +** ** * If the record page-number is illegal (0 or PAGER_MJ_PGNO), or ** * If the record is being rolled back from the main journal file ** and the checksum field does not match the record content. @@ -2268,7 +2268,7 @@ static int pager_playback_one_page( assert( aData ); /* Temp storage must have already been allocated */ assert( pagerUseWal(pPager)==0 || (!isMainJrnl && isSavepnt) ); - /* Either the state is greater than PAGER_WRITER_CACHEMOD (a transaction + /* Either the state is greater than PAGER_WRITER_CACHEMOD (a transaction ** or savepoint rollback done at the request of the caller) or this is ** a hot-journal rollback. If it is a hot-journal rollback, the pager ** is in state OPEN and holds an EXCLUSIVE lock. Hot-journal rollback @@ -2335,7 +2335,7 @@ static int pager_playback_one_page( ** assert()able. ** ** If in WRITER_DBMOD, WRITER_FINISHED or OPEN state, then we update the - ** pager cache if it exists and the main file. The page is then marked + ** pager cache if it exists and the main file. The page is then marked ** not dirty. Since this code is only executed in PAGER_OPEN state for ** a hot-journal rollback, it is guaranteed that the page-cache is empty ** if the pager is in OPEN state. @@ -2393,18 +2393,18 @@ static int pager_playback_one_page( }else if( !isMainJrnl && pPg==0 ){ /* If this is a rollback of a savepoint and data was not written to ** the database and the page is not in-memory, there is a potential - ** problem. When the page is next fetched by the b-tree layer, it - ** will be read from the database file, which may or may not be - ** current. + ** problem. When the page is next fetched by the b-tree layer, it + ** will be read from the database file, which may or may not be + ** current. ** ** There are a couple of different ways this can happen. All are quite - ** obscure. When running in synchronous mode, this can only happen + ** obscure. When running in synchronous mode, this can only happen ** if the page is on the free-list at the start of the transaction, then ** populated, then moved using sqlite3PagerMovepage(). ** ** The solution is to add an in-memory page to the cache containing - ** the data just read from the sub-journal. Mark the page as dirty - ** and if the pager requires a journal-sync, then mark the page as + ** the data just read from the sub-journal. Mark the page as dirty + ** and if the pager requires a journal-sync, then mark the page as ** requiring a journal-sync before it is written. */ assert( isSavepnt ); @@ -2452,26 +2452,26 @@ static int pager_playback_one_page( ** This routine checks if it is possible to delete the master journal file, ** and does so if it is. ** -** Argument zMaster may point to Pager.pTmpSpace. So that buffer is not +** Argument zMaster may point to Pager.pTmpSpace. So that buffer is not ** available for use within this function. ** -** When a master journal file is created, it is populated with the names -** of all of its child journals, one after another, formatted as utf-8 -** encoded text. The end of each child journal file is marked with a +** When a master journal file is created, it is populated with the names +** of all of its child journals, one after another, formatted as utf-8 +** encoded text. The end of each child journal file is marked with a ** nul-terminator byte (0x00). i.e. the entire contents of a master journal ** file for a transaction involving two databases might be: ** ** "/home/bill/a.db-journal\x00/home/bill/b.db-journal\x00" ** -** A master journal file may only be deleted once all of its child +** A master journal file may only be deleted once all of its child ** journals have been rolled back. ** -** This function reads the contents of the master-journal file into +** This function reads the contents of the master-journal file into ** memory and loops through each of the child journal names. For ** each child journal, it checks if: ** ** * if the child journal exists, and if so -** * if the child journal contains a reference to master journal +** * if the child journal contains a reference to master journal ** file zMaster ** ** If a child journal can be found that matches both of the criteria @@ -2481,12 +2481,12 @@ static int pager_playback_one_page( ** ** If an IO error within this function, an error code is returned. This ** function allocates memory by calling sqlite3Malloc(). If an allocation -** fails, SQLITE_NOMEM is returned. Otherwise, if no IO or malloc errors +** fails, SQLITE_NOMEM is returned. Otherwise, if no IO or malloc errors ** occur, SQLITE_OK is returned. ** ** TODO: This function allocates a single block of memory to load ** the entire contents of the master journal file. This could be -** a couple of kilobytes or so - potentially larger than the page +** a couple of kilobytes or so - potentially larger than the page ** size. */ static int pager_delmaster(Pager *pPager, const char *zMaster){ @@ -2564,7 +2564,7 @@ static int pager_delmaster(Pager *pPager, const char *zMaster){ } zJournal += (sqlite3Strlen30(zJournal)+1); } - + sqlite3OsClose(pMaster); rc = sqlite3OsDelete(pVfs, zMaster, 0); @@ -2580,20 +2580,20 @@ delmaster_out: /* -** This function is used to change the actual size of the database +** This function is used to change the actual size of the database ** file in the file-system. This only happens when committing a transaction, ** or rolling back a transaction (including rolling back a hot-journal). ** ** If the main database file is not open, or the pager is not in either -** DBMOD or OPEN state, this function is a no-op. Otherwise, the size -** of the file is changed to nPage pages (nPage*pPager->pageSize bytes). +** DBMOD or OPEN state, this function is a no-op. Otherwise, the size +** of the file is changed to nPage pages (nPage*pPager->pageSize bytes). ** If the file on disk is currently larger than nPage pages, then use the VFS ** xTruncate() method to truncate it. ** -** Or, it might be the case that the file on disk is smaller than -** nPage pages. Some operating system implementations can get confused if -** you try to truncate a file to some size that is larger than it -** currently is, so detect this case and write a single zero byte to +** Or, it might be the case that the file on disk is smaller than +** nPage pages. Some operating system implementations can get confused if +** you try to truncate a file to some size that is larger than it +** currently is, so detect this case and write a single zero byte to ** the end of the new file instead. ** ** If successful, return SQLITE_OK. If an IO error occurs while modifying @@ -2603,9 +2603,9 @@ static int pager_truncate(Pager *pPager, Pgno nPage){ int rc = SQLITE_OK; assert( pPager->eState!=PAGER_ERROR ); assert( pPager->eState!=PAGER_READER ); - - if( isOpen(pPager->fd) - && (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) + + if( isOpen(pPager->fd) + && (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) ){ i64 currentSize, newSize; int szPage = pPager->pageSize; @@ -2649,8 +2649,8 @@ int sqlite3SectorSize(sqlite3_file *pFile){ /* ** Set the value of the Pager.sectorSize variable for the given ** pager based on the value returned by the xSectorSize method -** of the open database file. The sector size will be used -** to determine the size and alignment of journal header and +** of the open database file. The sector size will be used +** to determine the size and alignment of journal header and ** master journal pointers within created journal files. ** ** For temporary files the effective sector size is always 512 bytes. @@ -2673,7 +2673,7 @@ static void setSectorSize(Pager *pPager){ assert( isOpen(pPager->fd) || pPager->tempFile ); if( pPager->tempFile - || (sqlite3OsDeviceCharacteristics(pPager->fd) & + || (sqlite3OsDeviceCharacteristics(pPager->fd) & SQLITE_IOCAP_POWERSAFE_OVERWRITE)!=0 ){ /* Sector size doesn't matter for temporary files. Also, the file @@ -2687,15 +2687,15 @@ static void setSectorSize(Pager *pPager){ /* ** Playback the journal and thus restore the database file to -** the state it was in before we started making changes. +** the state it was in before we started making changes. ** -** The journal file format is as follows: +** The journal file format is as follows: ** ** (1) 8 byte prefix. A copy of aJournalMagic[]. ** (2) 4 byte big-endian integer which is the number of valid page records ** in the journal. If this value is 0xffffffff, then compute the ** number of page records from the journal size. -** (3) 4 byte big-endian integer which is the initial value for the +** (3) 4 byte big-endian integer which is the initial value for the ** sanity checksum. ** (4) 4 byte integer which is the number of pages to truncate the ** database to during a rollback. @@ -2724,7 +2724,7 @@ static void setSectorSize(Pager *pPager){ ** from the file size. This value is used when the user selects the ** no-sync option for the journal. A power failure could lead to corruption ** in this case. But for things like temporary table (which will be -** deleted when the power is restored) we don't care. +** deleted when the power is restored) we don't care. ** ** If the file opened as the journal file is not a well-formed ** journal file then all pages up to the first corrupted page are rolled @@ -2736,7 +2736,7 @@ static void setSectorSize(Pager *pPager){ ** and an error code is returned. ** ** The isHot parameter indicates that we are trying to rollback a journal -** that might be a hot journal. Or, it could be that the journal is +** that might be a hot journal. Or, it could be that the journal is ** preserved because of JOURNALMODE_PERSIST or JOURNALMODE_TRUNCATE. ** If the journal really is hot, reset the pager cache prior rolling ** back any content. If the journal is merely persistent, no reset is @@ -2786,9 +2786,9 @@ static int pager_playback(Pager *pPager, int isHot){ pPager->journalOff = 0; needPagerReset = isHot; - /* This loop terminates either when a readJournalHdr() or - ** pager_playback_one_page() call returns SQLITE_DONE or an IO error - ** occurs. + /* This loop terminates either when a readJournalHdr() or + ** pager_playback_one_page() call returns SQLITE_DONE or an IO error + ** occurs. */ while( 1 ){ /* Read the next journal header from the journal file. If there are @@ -2797,7 +2797,7 @@ static int pager_playback(Pager *pPager, int isHot){ ** This indicates nothing more needs to be rolled back. */ rc = readJournalHdr(pPager, isHot, szJ, &nRec, &mxPg); - if( rc!=SQLITE_OK ){ + if( rc!=SQLITE_OK ){ if( rc==SQLITE_DONE ){ rc = SQLITE_OK; } @@ -2825,7 +2825,7 @@ static int pager_playback(Pager *pPager, int isHot){ ** chunk of the journal contains zero pages to be rolled back. But ** when doing a ROLLBACK and the nRec==0 chunk is the last chunk in ** the journal, it means that the journal might contain additional - ** pages that need to be rolled back and that the number of pages + ** pages that need to be rolled back and that the number of pages ** should be computed based on the journal file size. */ if( nRec==0 && !isHot && @@ -2844,7 +2844,7 @@ static int pager_playback(Pager *pPager, int isHot){ pPager->dbSize = mxPg; } - /* Copy original pages out of the journal and back into the + /* Copy original pages out of the journal and back into the ** database file and/or page cache. */ for(u=0; upData. A shared lock or greater must be held on the database ** file before this function is called. ** @@ -3028,15 +3028,15 @@ static void pager_write_changecounter(PgHdr *pPg){ #ifndef SQLITE_OMIT_WAL /* -** This function is invoked once for each page that has already been +** This function is invoked once for each page that has already been ** written into the log file when a WAL transaction is rolled back. -** Parameter iPg is the page number of said page. The pCtx argument +** Parameter iPg is the page number of said page. The pCtx argument ** is actually a pointer to the Pager structure. ** ** If page iPg is present in the cache, and has no outstanding references, ** it is discarded. Otherwise, if there are one or more outstanding ** references, the page content is reloaded from the database. If the -** attempt to reload content from the database is required and fails, +** attempt to reload content from the database is required and fails, ** return an SQLite error code. Otherwise, SQLITE_OK. */ static int pagerUndoCallback(void *pCtx, Pgno iPg){ @@ -3066,7 +3066,7 @@ static int pagerUndoCallback(void *pCtx, Pgno iPg){ ** updated as data is copied out of the rollback journal and into the ** database. This is not generally possible with a WAL database, as ** rollback involves simply truncating the log file. Therefore, if one - ** or more frames have already been written to the log (and therefore + ** or more frames have already been written to the log (and therefore ** also copied into the backup databases) as part of this transaction, ** the backups must be restarted. */ @@ -3083,7 +3083,7 @@ static int pagerRollbackWal(Pager *pPager){ PgHdr *pList; /* List of dirty pages to revert */ /* For all pages in the cache that are currently dirty or have already - ** been written (but not committed) to the log file, do one of the + ** been written (but not committed) to the log file, do one of the ** following: ** ** + Discard the cached page (if refcount==0), or @@ -3105,11 +3105,11 @@ static int pagerRollbackWal(Pager *pPager){ ** This function is a wrapper around sqlite3WalFrames(). As well as logging ** the contents of the list of pages headed by pList (connected by pDirty), ** this function notifies any active backup processes that the pages have -** changed. +** changed. ** ** The list of pages passed into this routine is always sorted by page number. ** Hence, if page 1 appears anywhere on the list, it will be the first page. -*/ +*/ static int pagerWalFrames( Pager *pPager, /* Pager object */ PgHdr *pList, /* List of frames to log */ @@ -3150,7 +3150,7 @@ static int pagerWalFrames( pPager->aStat[PAGER_STAT_WRITE] += nList; if( pList->pgno==1 ) pager_write_changecounter(pList); - rc = sqlite3WalFrames(pPager->pWal, + rc = sqlite3WalFrames(pPager->pWal, pPager->pageSize, pList, nTruncate, isCommit, pPager->walSyncFlags ); if( rc==SQLITE_OK && pPager->pBackup ){ @@ -3265,9 +3265,9 @@ static int pagerPagecount(Pager *pPager, Pgno *pnPage){ ** Return SQLITE_OK or an error code. ** ** The caller must hold a SHARED lock on the database file to call this -** function. Because an EXCLUSIVE lock on the db file is required to delete -** a WAL on a none-empty database, this ensures there is no race condition -** between the xAccess() below and an xDelete() being executed by some +** function. Because an EXCLUSIVE lock on the db file is required to delete +** a WAL on a none-empty database, this ensures there is no race condition +** between the xAccess() below and an xDelete() being executed by some ** other connection. */ static int pagerOpenWalIfPresent(Pager *pPager){ @@ -3305,21 +3305,21 @@ static int pagerOpenWalIfPresent(Pager *pPager){ /* ** Playback savepoint pSavepoint. Or, if pSavepoint==NULL, then playback -** the entire master journal file. The case pSavepoint==NULL occurs when -** a ROLLBACK TO command is invoked on a SAVEPOINT that is a transaction +** the entire master journal file. The case pSavepoint==NULL occurs when +** a ROLLBACK TO command is invoked on a SAVEPOINT that is a transaction ** savepoint. ** -** When pSavepoint is not NULL (meaning a non-transaction savepoint is +** When pSavepoint is not NULL (meaning a non-transaction savepoint is ** being rolled back), then the rollback consists of up to three stages, ** performed in the order specified: ** ** * Pages are played back from the main journal starting at byte -** offset PagerSavepoint.iOffset and continuing to +** offset PagerSavepoint.iOffset and continuing to ** PagerSavepoint.iHdrOffset, or to the end of the main journal ** file if PagerSavepoint.iHdrOffset is zero. ** ** * If PagerSavepoint.iHdrOffset is not zero, then pages are played -** back starting from the journal header immediately following +** back starting from the journal header immediately following ** PagerSavepoint.iHdrOffset to the end of the main journal file. ** ** * Pages are then played back from the sub-journal file, starting @@ -3335,7 +3335,7 @@ static int pagerOpenWalIfPresent(Pager *pPager){ ** journal file. There is no need for a bitvec in this case. ** ** In either case, before playback commences the Pager.dbSize variable -** is reset to the value that it held at the start of the savepoint +** is reset to the value that it held at the start of the savepoint ** (or transaction). No page with a page-number greater than this value ** is played back. If one is encountered it is simply skipped. */ @@ -3356,7 +3356,7 @@ static int pagerPlaybackSavepoint(Pager *pPager, PagerSavepoint *pSavepoint){ } } - /* Set the database size back to the value it was before the savepoint + /* Set the database size back to the value it was before the savepoint ** being reverted was opened. */ pPager->dbSize = pSavepoint ? pSavepoint->nOrig : pPager->dbOrigSize; @@ -3409,7 +3409,7 @@ static int pagerPlaybackSavepoint(Pager *pPager, PagerSavepoint *pSavepoint){ ** test is related to ticket #2565. See the discussion in the ** pager_playback() function for additional information. */ - if( nJRec==0 + if( nJRec==0 && pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff ){ nJRec = (u32)((szJ - pPager->journalOff)/JOURNAL_PG_SZ(pPager)); @@ -3588,7 +3588,7 @@ void sqlite3PagerSetFlags( /* ** The following global variable is incremented whenever the library ** attempts to open a temporary file. This information is used for -** testing and analysis only. +** testing and analysis only. */ #ifdef SQLITE_TEST int sqlite3_opentemp_count = 0; @@ -3597,8 +3597,8 @@ int sqlite3_opentemp_count = 0; /* ** Open a temporary file. ** -** Write the file descriptor into *pFile. Return SQLITE_OK on success -** or some other error code if we fail. The OS will automatically +** Write the file descriptor into *pFile. Return SQLITE_OK on success +** or some other error code if we fail. The OS will automatically ** delete the temporary file when it is closed. ** ** The flags passed to the VFS layer xOpen() call are those specified @@ -3630,9 +3630,9 @@ static int pagerOpentemp( /* ** Set the busy handler function. ** -** The pager invokes the busy-handler if sqlite3OsLock() returns +** The pager invokes the busy-handler if sqlite3OsLock() returns ** SQLITE_BUSY when trying to upgrade from no-lock to a SHARED lock, -** or when trying to upgrade from a RESERVED lock to an EXCLUSIVE +** or when trying to upgrade from a RESERVED lock to an EXCLUSIVE ** lock. It does *not* invoke the busy handler when upgrading from ** SHARED to RESERVED, or when upgrading from SHARED to EXCLUSIVE ** (which occurs during hot-journal rollback). Summary: @@ -3644,7 +3644,7 @@ static int pagerOpentemp( ** SHARED_LOCK -> EXCLUSIVE_LOCK | No ** RESERVED_LOCK -> EXCLUSIVE_LOCK | Yes ** -** If the busy-handler callback returns non-zero, the lock is +** If the busy-handler callback returns non-zero, the lock is ** retried. If it returns zero, then the SQLITE_BUSY error is ** returned to the caller of the pager API function. */ @@ -3665,16 +3665,16 @@ void sqlite3PagerSetBusyhandler( } /* -** Change the page size used by the Pager object. The new page size +** Change the page size used by the Pager object. The new page size ** is passed in *pPageSize. ** ** If the pager is in the error state when this function is called, it -** is a no-op. The value returned is the error state error code (i.e. +** is a no-op. The value returned is the error state error code (i.e. ** one of SQLITE_IOERR, an SQLITE_IOERR_xxx sub-code or SQLITE_FULL). ** ** Otherwise, if all of the following are true: ** -** * the new page size (value of *pPageSize) is valid (a power +** * the new page size (value of *pPageSize) is valid (a power ** of two between 512 and SQLITE_MAX_PAGE_SIZE, inclusive), and ** ** * there are no outstanding page references, and @@ -3684,14 +3684,14 @@ void sqlite3PagerSetBusyhandler( ** ** then the pager object page size is set to *pPageSize. ** -** If the page size is changed, then this function uses sqlite3PagerMalloc() -** to obtain a new Pager.pTmpSpace buffer. If this allocation attempt -** fails, SQLITE_NOMEM is returned and the page size remains unchanged. +** If the page size is changed, then this function uses sqlite3PagerMalloc() +** to obtain a new Pager.pTmpSpace buffer. If this allocation attempt +** fails, SQLITE_NOMEM is returned and the page size remains unchanged. ** In all other cases, SQLITE_OK is returned. ** ** If the page size is not changed, either because one of the enumerated ** conditions above is not true, the pager was in error state when this -** function was called, or because the memory allocation attempt failed, +** function was called, or because the memory allocation attempt failed, ** then *pPageSize is set to the old, retained page size before returning. */ int sqlite3PagerSetPagesize(Pager *pPager, u32 *pPageSize, int nReserve){ @@ -3701,7 +3701,7 @@ int sqlite3PagerSetPagesize(Pager *pPager, u32 *pPageSize, int nReserve){ ** function may be called from within PagerOpen(), before the state ** of the Pager object is internally consistent. ** - ** At one point this function returned an error if the pager was in + ** At one point this function returned an error if the pager was in ** PAGER_ERROR state. But since PAGER_ERROR state guarantees that ** there is at least one outstanding page reference, this function ** is a no-op for that case anyhow. @@ -3710,8 +3710,8 @@ int sqlite3PagerSetPagesize(Pager *pPager, u32 *pPageSize, int nReserve){ u32 pageSize = *pPageSize; assert( pageSize==0 || (pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE) ); if( (pPager->memDb==0 || pPager->dbSize==0) - && sqlite3PcacheRefCount(pPager->pPCache)==0 - && pageSize && pageSize!=(u32)pPager->pageSize + && sqlite3PcacheRefCount(pPager->pPCache)==0 + && pageSize && pageSize!=(u32)pPager->pageSize ){ char *pNew = NULL; /* New temp space */ i64 nByte = 0; @@ -3762,7 +3762,7 @@ void *sqlite3PagerTempSpace(Pager *pPager){ } /* -** Attempt to set the maximum database page count if mxPage is positive. +** Attempt to set the maximum database page count if mxPage is positive. ** Make no changes if mxPage is zero or negative. And never reduce the ** maximum page count below the current size of the database. ** @@ -3803,11 +3803,11 @@ void enable_simulated_io_errors(void){ /* ** Read the first N bytes from the beginning of the file into memory -** that pDest points to. +** that pDest points to. ** ** If the pager was opened on a transient file (zFilename==""), or ** opened on a file less than N bytes in size, the output buffer is -** zeroed and SQLITE_OK returned. The rationale for this is that this +** zeroed and SQLITE_OK returned. The rationale for this is that this ** function is used to read database headers, and a new transient or ** zero sized database has a header than consists entirely of zeroes. ** @@ -3840,7 +3840,7 @@ int sqlite3PagerReadFileheader(Pager *pPager, int N, unsigned char *pDest){ ** This function may only be called when a read-transaction is open on ** the pager. It returns the total number of pages in the database. ** -** However, if the file is between 1 and bytes in size, then +** However, if the file is between 1 and bytes in size, then ** this is considered a 1 page file. */ void sqlite3PagerPagecount(Pager *pPager, int *pnPage){ @@ -3855,19 +3855,19 @@ void sqlite3PagerPagecount(Pager *pPager, int *pnPage){ ** a similar or greater lock is already held, this function is a no-op ** (returning SQLITE_OK immediately). ** -** Otherwise, attempt to obtain the lock using sqlite3OsLock(). Invoke -** the busy callback if the lock is currently not available. Repeat -** until the busy callback returns false or until the attempt to +** Otherwise, attempt to obtain the lock using sqlite3OsLock(). Invoke +** the busy callback if the lock is currently not available. Repeat +** until the busy callback returns false or until the attempt to ** obtain the lock succeeds. ** ** Return SQLITE_OK on success and an error code if we cannot obtain -** the lock. If the lock is obtained successfully, set the Pager.state +** the lock. If the lock is obtained successfully, set the Pager.state ** variable to locktype before returning. */ static int pager_wait_on_lock(Pager *pPager, int locktype){ int rc; /* Return code */ - /* Check that this is either a no-op (because the requested lock is + /* Check that this is either a no-op (because the requested lock is ** already held), or one of the transitions that the busy-handler ** may be invoked during, according to the comment above ** sqlite3PagerSetBusyhandler(). @@ -3884,10 +3884,10 @@ static int pager_wait_on_lock(Pager *pPager, int locktype){ } /* -** Function assertTruncateConstraint(pPager) checks that one of the +** Function assertTruncateConstraint(pPager) checks that one of the ** following is true for all dirty pages currently in the page-cache: ** -** a) The page number is less than or equal to the size of the +** a) The page number is less than or equal to the size of the ** current database image, in pages, OR ** ** b) if the page content were written at this time, it would not @@ -3900,9 +3900,9 @@ static int pager_wait_on_lock(Pager *pPager, int locktype){ ** the database file. If a savepoint transaction were rolled back after ** this happened, the correct behavior would be to restore the current ** content of the page. However, since this content is not present in either -** the database file or the portion of the rollback journal and +** the database file or the portion of the rollback journal and ** sub-journal rolled back the content could not be restored and the -** database image would become corrupt. It is therefore fortunate that +** database image would become corrupt. It is therefore fortunate that ** this circumstance cannot arise. */ #if defined(SQLITE_DEBUG) @@ -3918,9 +3918,9 @@ static void assertTruncateConstraint(Pager *pPager){ #endif /* -** Truncate the in-memory database file image to nPage pages. This -** function does not actually modify the database file on disk. It -** just sets the internal state of the pager object so that the +** Truncate the in-memory database file image to nPage pages. This +** function does not actually modify the database file on disk. It +** just sets the internal state of the pager object so that the ** truncation will be done when the current transaction is committed. ** ** This function is only called right before committing a transaction. @@ -3935,11 +3935,11 @@ void sqlite3PagerTruncateImage(Pager *pPager, Pgno nPage){ /* At one point the code here called assertTruncateConstraint() to ** ensure that all pages being truncated away by this operation are, - ** if one or more savepoints are open, present in the savepoint + ** if one or more savepoints are open, present in the savepoint ** journal so that they can be restored if the savepoint is rolled ** back. This is no longer necessary as this function is now only - ** called right before committing a transaction. So although the - ** Pager object may still have open savepoints (Pager.nSavepoint!=0), + ** called right before committing a transaction. So although the + ** Pager object may still have open savepoints (Pager.nSavepoint!=0), ** they cannot be rolled back. So the assertTruncateConstraint() call ** is no longer correct. */ } @@ -3951,12 +3951,12 @@ void sqlite3PagerTruncateImage(Pager *pPager, Pgno nPage){ ** size of the journal file so that the pager_playback() routine knows ** that the entire journal file has been synced. ** -** Syncing a hot-journal to disk before attempting to roll it back ensures +** Syncing a hot-journal to disk before attempting to roll it back ensures ** that if a power-failure occurs during the rollback, the process that ** attempts rollback following system recovery sees the same journal ** content as this process. ** -** If everything goes as planned, SQLITE_OK is returned. Otherwise, +** If everything goes as planned, SQLITE_OK is returned. Otherwise, ** an SQLite error code. */ static int pagerSyncHotJournal(Pager *pPager){ @@ -3972,7 +3972,7 @@ static int pagerSyncHotJournal(Pager *pPager){ #if SQLITE_MAX_MMAP_SIZE>0 /* -** Obtain a reference to a memory mapped page object for page number pgno. +** Obtain a reference to a memory mapped page object for page number pgno. ** The new object will use the pointer pData, obtained from xFetch(). ** If successful, set *ppPage to point to the new page reference ** and return SQLITE_OK. Otherwise, return an SQLite error code and set @@ -3988,7 +3988,7 @@ static int pagerAcquireMapPage( PgHdr **ppPage /* OUT: Acquired page object */ ){ PgHdr *p; /* Memory mapped page to return */ - + if( pPager->pMmapFreelist ){ *ppPage = p = pPager->pMmapFreelist; pPager->pMmapFreelist = p->pDirty; @@ -4022,7 +4022,7 @@ static int pagerAcquireMapPage( #endif /* -** Release a reference to page pPg. pPg must have been returned by an +** Release a reference to page pPg. pPg must have been returned by an ** earlier call to pagerAcquireMapPage(). */ static void pagerReleaseMapPage(PgHdr *pPg){ @@ -4058,7 +4058,7 @@ static void pagerFreeMapHdrs(Pager *pPager){ ** result in a coredump. ** ** This function always succeeds. If a transaction is active an attempt -** is made to roll it back. If an error occurs during the rollback +** is made to roll it back. If an error occurs during the rollback ** a hot journal may be left in the filesystem but no error is returned ** to the caller. */ @@ -4084,8 +4084,8 @@ int sqlite3PagerClose(Pager *pPager, sqlite3 *db){ pager_unlock(pPager); }else{ /* If it is open, sync the journal file before calling UnlockAndRollback. - ** If this is not done, then an unsynced portion of the open journal - ** file may be played back into the database. If a power failure occurs + ** If this is not done, then an unsynced portion of the open journal + ** file may be played back into the database. If a power failure occurs ** while this is happening, the database could become corrupt. ** ** If an error occurs while trying to sync the journal, shift the pager @@ -4141,7 +4141,7 @@ void sqlite3PagerRef(DbPage *pPg){ ** disk and can be restored in the event of a hot-journal rollback. ** ** If the Pager.noSync flag is set, then this function is a no-op. -** Otherwise, the actions required depend on the journal-mode and the +** Otherwise, the actions required depend on the journal-mode and the ** device characteristics of the file-system, as follows: ** ** * If the journal file is an in-memory journal file, no action need @@ -4153,7 +4153,7 @@ void sqlite3PagerRef(DbPage *pPg){ ** been written following it. If the pager is operating in full-sync ** mode, then the journal file is synced before this field is updated. ** -** * If the device does not support the SEQUENTIAL property, then +** * If the device does not support the SEQUENTIAL property, then ** journal file is synced. ** ** Or, in pseudo-code: @@ -4162,11 +4162,11 @@ void sqlite3PagerRef(DbPage *pPg){ ** if( NOT SAFE_APPEND ){ ** if( ) xSync(); ** -** } +** } ** if( NOT SEQUENTIAL ) xSync(); ** } ** -** If successful, this routine clears the PGHDR_NEED_SYNC flag of every +** If successful, this routine clears the PGHDR_NEED_SYNC flag of every ** page currently held in memory before returning SQLITE_OK. If an IO ** error is encountered, then the IO error code is returned to the caller. */ @@ -4194,10 +4194,10 @@ static int syncJournal(Pager *pPager, int newHdr){ ** mode, then the journal file may at this point actually be larger ** than Pager.journalOff bytes. If the next thing in the journal ** file happens to be a journal-header (written as part of the - ** previous connection's transaction), and a crash or power-failure - ** occurs after nRec is updated but before this connection writes - ** anything else to the journal file (or commits/rolls back its - ** transaction), then SQLite may become confused when doing the + ** previous connection's transaction), and a crash or power-failure + ** occurs after nRec is updated but before this connection writes + ** anything else to the journal file (or commits/rolls back its + ** transaction), then SQLite may become confused when doing the ** hot-journal rollback following recovery. It may roll back all ** of this connections data, then proceed to rolling back the old, ** out-of-date data that follows it. Database corruption. @@ -4207,7 +4207,7 @@ static int syncJournal(Pager *pPager, int newHdr){ ** byte to the start of it to prevent it from being recognized. ** ** Variable iNextHdrOffset is set to the offset at which this - ** problematic header will occur, if it exists. aMagic is used + ** problematic header will occur, if it exists. aMagic is used ** as a temporary buffer to inspect the first couple of bytes of ** the potential journal header. */ @@ -4234,7 +4234,7 @@ static int syncJournal(Pager *pPager, int newHdr){ ** it as a candidate for rollback. ** ** This is not required if the persistent media supports the - ** SAFE_APPEND property. Because in this case it is not possible + ** SAFE_APPEND property. Because in this case it is not possible ** for garbage data to be appended to the file, the nRec field ** is populated with 0xFFFFFFFF when the journal header is written ** and never needs to be updated. @@ -4254,7 +4254,7 @@ static int syncJournal(Pager *pPager, int newHdr){ if( 0==(iDc&SQLITE_IOCAP_SEQUENTIAL) ){ PAGERTRACE(("SYNC journal of %d\n", PAGERID(pPager))); IOTRACE(("JSYNC %p\n", pPager)) - rc = sqlite3OsSync(pPager->jfd, pPager->syncFlags| + rc = sqlite3OsSync(pPager->jfd, pPager->syncFlags| (pPager->syncFlags==SQLITE_SYNC_FULL?SQLITE_SYNC_DATAONLY:0) ); if( rc!=SQLITE_OK ) return rc; @@ -4271,8 +4271,8 @@ static int syncJournal(Pager *pPager, int newHdr){ } } - /* Unless the pager is in noSync mode, the journal file was just - ** successfully synced. Either way, clear the PGHDR_NEED_SYNC flag on + /* Unless the pager is in noSync mode, the journal file was just + ** successfully synced. Either way, clear the PGHDR_NEED_SYNC flag on ** all pages. */ sqlite3PcacheClearSyncFlags(pPager->pPCache); @@ -4292,9 +4292,9 @@ static int syncJournal(Pager *pPager, int newHdr){ ** is called. Before writing anything to the database file, this lock ** is upgraded to an EXCLUSIVE lock. If the lock cannot be obtained, ** SQLITE_BUSY is returned and no data is written to the database file. -** +** ** If the pager is a temp-file pager and the actual file-system file -** is not yet open, it is created and opened before any data is +** is not yet open, it is created and opened before any data is ** written out. ** ** Once the lock has been upgraded and, if necessary, the file opened, @@ -4309,7 +4309,7 @@ static int syncJournal(Pager *pPager, int newHdr){ ** in Pager.dbFileVers[] is updated to match the new value stored in ** the database file. ** -** If everything is successful, SQLITE_OK is returned. If an IO error +** If everything is successful, SQLITE_OK is returned. If an IO error ** occurs, an IO error code is returned. Or, if the EXCLUSIVE lock cannot ** be obtained, SQLITE_BUSY is returned. */ @@ -4335,7 +4335,7 @@ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){ ** file size will be. */ assert( rc!=SQLITE_OK || isOpen(pPager->fd) ); - if( rc==SQLITE_OK + if( rc==SQLITE_OK && pPager->dbHintSizedbSize && (pList->pDirty || pList->pgno>pPager->dbHintSize) ){ @@ -4357,7 +4357,7 @@ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){ */ if( pgno<=pPager->dbSize && 0==(pList->flags&PGHDR_DONT_WRITE) ){ i64 offset = (pgno-1)*(i64)pPager->pageSize; /* Offset to write */ - char *pData; /* Data to write */ + char *pData; /* Data to write */ assert( (pList->flags&PGHDR_NEED_SYNC)==0 ); if( pList->pgno==1 ) pager_write_changecounter(pList); @@ -4369,8 +4369,8 @@ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){ rc = sqlite3OsWrite(pPager->fd, pData, pPager->pageSize, offset); /* If page 1 was just written, update Pager.dbFileVers to match - ** the value now stored in the database file. If writing this - ** page caused the database file to grow, update dbFileSize. + ** the value now stored in the database file. If writing this + ** page caused the database file to grow, update dbFileSize. */ if( pgno==1 ){ memcpy(&pPager->dbFileVers, &pData[24], sizeof(pPager->dbFileVers)); @@ -4398,18 +4398,18 @@ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){ } /* -** Ensure that the sub-journal file is open. If it is already open, this +** Ensure that the sub-journal file is open. If it is already open, this ** function is a no-op. ** -** SQLITE_OK is returned if everything goes according to plan. An -** SQLITE_IOERR_XXX error code is returned if a call to sqlite3OsOpen() +** SQLITE_OK is returned if everything goes according to plan. An +** SQLITE_IOERR_XXX error code is returned if a call to sqlite3OsOpen() ** fails. */ static int openSubJournal(Pager *pPager){ int rc = SQLITE_OK; if( !isOpen(pPager->sjfd) ){ - const int flags = SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_READWRITE - | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE + const int flags = SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_READWRITE + | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE; int nStmtSpill = sqlite3Config.nStmtSpill; if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->subjInMemory ){ @@ -4421,13 +4421,13 @@ static int openSubJournal(Pager *pPager){ } /* -** Append a record of the current state of page pPg to the sub-journal. +** Append a record of the current state of page pPg to the sub-journal. ** ** If successful, set the bit corresponding to pPg->pgno in the bitvecs ** for all open savepoints before returning. ** ** This function returns SQLITE_OK if everything is successful, an IO -** error code if the attempt to write to the sub-journal fails, or +** error code if the attempt to write to the sub-journal fails, or ** SQLITE_NOMEM if a malloc fails while setting a bit in a savepoint ** bitvec. */ @@ -4440,9 +4440,9 @@ static int subjournalPage(PgHdr *pPg){ assert( pPager->useJournal ); assert( isOpen(pPager->jfd) || pagerUseWal(pPager) ); assert( isOpen(pPager->sjfd) || pPager->nSubRec==0 ); - assert( pagerUseWal(pPager) - || pageInJournal(pPager, pPg) - || pPg->pgno>pPager->dbOrigSize + assert( pagerUseWal(pPager) + || pageInJournal(pPager, pPg) + || pPg->pgno>pPager->dbOrigSize ); rc = openSubJournal(pPager); @@ -4452,7 +4452,7 @@ static int subjournalPage(PgHdr *pPg){ void *pData = pPg->pData; i64 offset = (i64)pPager->nSubRec*(4+pPager->pageSize); char *pData2; - + CODEC2(pPager, pData, pPg->pgno, 7, return SQLITE_NOMEM_BKPT, pData2); PAGERTRACE(("STMT-JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno)); rc = write32bits(pPager->sjfd, offset, pPg->pgno); @@ -4480,14 +4480,14 @@ static int subjournalPageIfRequired(PgHdr *pPg){ ** This function is called by the pcache layer when it has reached some ** soft memory limit. The first argument is a pointer to a Pager object ** (cast as a void*). The pager is always 'purgeable' (not an in-memory -** database). The second argument is a reference to a page that is +** database). The second argument is a reference to a page that is ** currently dirty but has no outstanding references. The page -** is always associated with the Pager object passed as the first +** is always associated with the Pager object passed as the first ** argument. ** ** The job of this function is to make pPg clean by writing its contents ** out to the database file, if possible. This may involve syncing the -** journal file. +** journal file. ** ** If successful, sqlite3PcacheMakeClean() is called on the page and ** SQLITE_OK returned. If an IO error occurs while trying to make the @@ -4512,7 +4512,7 @@ static int pagerStress(void *p, PgHdr *pPg){ ** a rollback or by user request, respectively. ** ** Spilling is also prohibited when in an error state since that could - ** lead to database corruption. In the current implementation it + ** lead to database corruption. In the current implementation it ** is impossible for sqlite3PcacheFetch() to be called with createFlag==3 ** while in the error state, hence it is impossible for this routine to ** be called in the error state. Nevertheless, we include a NEVER() @@ -4532,19 +4532,19 @@ static int pagerStress(void *p, PgHdr *pPg){ pPg->pDirty = 0; if( pagerUseWal(pPager) ){ /* Write a single frame for this page to the log. */ - rc = subjournalPageIfRequired(pPg); + rc = subjournalPageIfRequired(pPg); if( rc==SQLITE_OK ){ rc = pagerWalFrames(pPager, pPg, 0, 0); } }else{ - + /* Sync the journal file if required. */ - if( pPg->flags&PGHDR_NEED_SYNC + if( pPg->flags&PGHDR_NEED_SYNC || pPager->eState==PAGER_WRITER_CACHEMOD ){ rc = syncJournal(pPager, 1); } - + /* Write the contents of the page out to the database file. */ if( rc==SQLITE_OK ){ assert( (pPg->flags&PGHDR_NEED_SYNC)==0 ); @@ -4558,7 +4558,7 @@ static int pagerStress(void *p, PgHdr *pPg){ sqlite3PcacheMakeClean(pPg); } - return pager_error(pPager, rc); + return pager_error(pPager, rc); } /* @@ -4589,8 +4589,8 @@ int sqlite3PagerFlush(Pager *pPager){ ** The zFilename argument is the path to the database file to open. ** If zFilename is NULL then a randomly-named temporary file is created ** and used as the file to be cached. Temporary files are be deleted -** automatically when they are closed. If zFilename is ":memory:" then -** all information is held in cache. It is never written to disk. +** automatically when they are closed. If zFilename is ":memory:" then +** all information is held in cache. It is never written to disk. ** This can be used to implement an in-memory database. ** ** The nExtra parameter specifies the number of bytes of space allocated @@ -4604,13 +4604,13 @@ int sqlite3PagerFlush(Pager *pPager){ ** of the PAGER_* flags. ** ** The vfsFlags parameter is a bitmask to pass to the flags parameter -** of the xOpen() method of the supplied VFS when opening files. +** of the xOpen() method of the supplied VFS when opening files. ** -** If the pager object is allocated and the specified file opened +** If the pager object is allocated and the specified file opened ** successfully, SQLITE_OK is returned and *ppPager set to point to ** the new pager object. If an error occurs, *ppPager is set to NULL ** and error code returned. This function may return SQLITE_NOMEM -** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or +** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or ** various SQLITE_IO_XXX errors. */ int sqlite3PagerOpen( @@ -4693,7 +4693,7 @@ int sqlite3PagerOpen( } /* Allocate memory for the Pager structure, PCache object, the - ** three file descriptors, the database file name and the journal + ** three file descriptors, the database file name and the journal ** file name. The layout in memory is as follows: ** ** Pager object (sizeof(Pager) bytes) @@ -4708,7 +4708,7 @@ int sqlite3PagerOpen( ROUND8(sizeof(*pPager)) + /* Pager structure */ ROUND8(pcacheSize) + /* PCache object */ ROUND8(pVfs->szOsFile) + /* The main db file */ - journalFileSize * 2 + /* The two journal files */ + journalFileSize * 2 + /* The two journal files */ nPathname + 1 + nUri + /* zFilename */ nPathname + 8 + 2 /* zJournal */ #ifndef SQLITE_OMIT_WAL @@ -4807,7 +4807,7 @@ int sqlite3PagerOpen( ** disk and uses an in-memory rollback journal. ** ** This branch also runs for files marked as immutable. - */ + */ act_like_temp_file: tempFile = 1; pPager->eState = PAGER_READER; /* Pretend we already have a lock */ @@ -4816,7 +4816,7 @@ act_like_temp_file: readOnly = (vfsFlags&SQLITE_OPEN_READONLY); } - /* The following call to PagerSetPagesize() serves to set the value of + /* The following call to PagerSetPagesize() serves to set the value of ** Pager.pageSize and to allocate the Pager.pTmpSpace buffer. */ if( rc==SQLITE_OK ){ @@ -4856,10 +4856,10 @@ act_like_temp_file: /* pPager->state = PAGER_UNLOCK; */ /* pPager->errMask = 0; */ pPager->tempFile = (u8)tempFile; - assert( tempFile==PAGER_LOCKINGMODE_NORMAL + assert( tempFile==PAGER_LOCKINGMODE_NORMAL || tempFile==PAGER_LOCKINGMODE_EXCLUSIVE ); assert( PAGER_LOCKINGMODE_EXCLUSIVE==1 ); - pPager->exclusiveMode = (u8)tempFile; + pPager->exclusiveMode = (u8)tempFile; pPager->changeCountDone = pPager->tempFile; pPager->memDb = (u8)memDb; pPager->readOnly = (u8)readOnly; @@ -4930,7 +4930,7 @@ static int databaseIsUnmoved(Pager *pPager){ /* ** This function is called after transitioning from PAGER_UNLOCK to ** PAGER_SHARED state. It tests if there is a hot journal present in -** the file-system for the given pager. A hot journal is one that +** the file-system for the given pager. A hot journal is one that ** needs to be played back. According to this function, a hot-journal ** file exists if the following criteria are met: ** @@ -4949,10 +4949,10 @@ static int databaseIsUnmoved(Pager *pPager){ ** at the end of the file. If there is, and that master journal file ** does not exist, then the journal file is not really hot. In this ** case this routine will return a false-positive. The pager_playback() -** routine will discover that the journal file is not really hot and -** will not roll it back. +** routine will discover that the journal file is not really hot and +** will not roll it back. ** -** If a hot-journal file is found to exist, *pExists is set to 1 and +** If a hot-journal file is found to exist, *pExists is set to 1 and ** SQLITE_OK returned. If no hot-journal file is present, *pExists is ** set to 0 and SQLITE_OK returned. If an IO error occurs while trying ** to determine whether or not a hot-journal file exists, the IO error @@ -4980,7 +4980,7 @@ static int hasHotJournal(Pager *pPager, int *pExists){ int locked = 0; /* True if some process holds a RESERVED lock */ /* Race condition here: Another process might have been holding the - ** the RESERVED lock and have a journal open at the sqlite3OsAccess() + ** the RESERVED lock and have a journal open at the sqlite3OsAccess() ** call above, but then delete the journal and drop the lock before ** we get to the following sqlite3OsCheckReservedLock() call. If that ** is the case, this routine might think there is a hot journal when @@ -5013,7 +5013,7 @@ static int hasHotJournal(Pager *pPager, int *pExists){ /* The journal file exists and no other connection has a reserved ** or greater lock on the database file. Now check that there is ** at least one non-zero bytes at the start of the journal file. - ** If there is, then we consider this journal to be hot. If not, + ** If there is, then we consider this journal to be hot. If not, ** it can be ignored. */ if( !jrnlOpen ){ @@ -5063,7 +5063,7 @@ static int hasHotJournal(Pager *pPager, int *pExists){ ** on the database file), then an attempt is made to obtain a ** SHARED lock on the database file. Immediately after obtaining ** the SHARED lock, the file-system is checked for a hot-journal, -** which is played back if present. Following any hot-journal +** which is played back if present. Following any hot-journal ** rollback, the contents of the cache are validated by checking ** the 'change-counter' field of the database file header and ** discarded if they are found to be invalid. @@ -5074,8 +5074,8 @@ static int hasHotJournal(Pager *pPager, int *pExists){ ** the contents of the page cache and rolling back any open journal ** file. ** -** If everything is successful, SQLITE_OK is returned. If an IO error -** occurs while locking the database, checking for a hot-journal file or +** If everything is successful, SQLITE_OK is returned. If an IO error +** occurs while locking the database, checking for a hot-journal file or ** rolling back a journal file, the IO error code is returned. */ int sqlite3PagerSharedLock(Pager *pPager){ @@ -5083,7 +5083,7 @@ int sqlite3PagerSharedLock(Pager *pPager){ /* This routine is only called from b-tree and only when there are no ** outstanding pages. This implies that the pager state should either - ** be OPEN or READER. READER is only possible if the pager is or was in + ** be OPEN or READER. READER is only possible if the pager is or was in ** exclusive access mode. */ assert( sqlite3PcacheRefCount(pPager->pPCache)==0 ); assert( assert_pager_state(pPager) ); @@ -5121,12 +5121,12 @@ int sqlite3PagerSharedLock(Pager *pPager){ ** important that a RESERVED lock is not obtained on the way to the ** EXCLUSIVE lock. If it were, another process might open the ** database file, detect the RESERVED lock, and conclude that the - ** database is safe to read while this process is still rolling the + ** database is safe to read while this process is still rolling the ** hot-journal back. - ** + ** ** Because the intermediate RESERVED lock is not requested, any - ** other process attempting to access the database file will get to - ** this point in the code and fail to obtain its own EXCLUSIVE lock + ** other process attempting to access the database file will get to + ** this point in the code and fail to obtain its own EXCLUSIVE lock ** on the database file. ** ** Unless the pager is in locking_mode=exclusive mode, the lock is @@ -5136,17 +5136,17 @@ int sqlite3PagerSharedLock(Pager *pPager){ if( rc!=SQLITE_OK ){ goto failed; } - - /* If it is not already open and the file exists on disk, open the - ** journal for read/write access. Write access is required because - ** in exclusive-access mode the file descriptor will be kept open - ** and possibly used for a transaction later on. Also, write-access - ** is usually required to finalize the journal in journal_mode=persist + + /* If it is not already open and the file exists on disk, open the + ** journal for read/write access. Write access is required because + ** in exclusive-access mode the file descriptor will be kept open + ** and possibly used for a transaction later on. Also, write-access + ** is usually required to finalize the journal in journal_mode=persist ** mode (and also for journal_mode=truncate on some systems). ** - ** If the journal does not exist, it usually means that some - ** other connection managed to get in and roll it back before - ** this connection obtained the exclusive lock above. Or, it + ** If the journal does not exist, it usually means that some + ** other connection managed to get in and roll it back before + ** this connection obtained the exclusive lock above. Or, it ** may mean that the pager was in the error-state when this ** function was called and the journal file does not exist. */ @@ -5167,7 +5167,7 @@ int sqlite3PagerSharedLock(Pager *pPager){ } } } - + /* Playback and delete the journal. Drop the database write ** lock and reacquire the read lock. Purge the cache before ** playing back the hot-journal so that we don't end up with @@ -5192,8 +5192,8 @@ int sqlite3PagerSharedLock(Pager *pPager){ ** or roll back a hot-journal while holding an EXCLUSIVE lock. The ** pager_unlock() routine will be called before returning to unlock ** the file. If the unlock attempt fails, then Pager.eLock must be - ** set to UNKNOWN_LOCK (see the comment above the #define for - ** UNKNOWN_LOCK above for an explanation). + ** set to UNKNOWN_LOCK (see the comment above the #define for + ** UNKNOWN_LOCK above for an explanation). ** ** In order to get pager_unlock() to do this, set Pager.eState to ** PAGER_ERROR now. This is not actually counted as a transition @@ -5201,7 +5201,7 @@ int sqlite3PagerSharedLock(Pager *pPager){ ** since we know that the same call to pager_unlock() will very ** shortly transition the pager object to the OPEN state. Calling ** assert_pager_state() would fail now, as it should not be possible - ** to be in ERROR state when there are zero outstanding page + ** to be in ERROR state when there are zero outstanding page ** references. */ pager_error(pPager, rc); @@ -5226,8 +5226,8 @@ int sqlite3PagerSharedLock(Pager *pPager){ ** a 32-bit counter that is incremented with each change. The ** other bytes change randomly with each file change when ** a codec is in use. - ** - ** There is a vanishingly small chance that a change will not be + ** + ** There is a vanishingly small chance that a change will not be ** detected. The chance of an undetected change is so small that ** it can be neglected. */ @@ -5299,7 +5299,7 @@ int sqlite3PagerSharedLock(Pager *pPager){ ** Except, in locking_mode=EXCLUSIVE when there is nothing to in ** the rollback journal, the unlock is not performed and there is ** nothing to rollback, so this routine is a no-op. -*/ +*/ static void pagerUnlockIfUnused(Pager *pPager){ if( pPager->nMmapOut==0 && (sqlite3PcacheRefCount(pPager->pPCache)==0) ){ pagerUnlockAndRollback(pPager); @@ -5308,7 +5308,7 @@ static void pagerUnlockIfUnused(Pager *pPager){ /* ** The page getter methods each try to acquire a reference to a -** page with page number pgno. If the requested reference is +** page with page number pgno. If the requested reference is ** successfully obtained, it is copied to *ppPage and SQLITE_OK returned. ** ** There are different implementations of the getter method depending @@ -5318,22 +5318,22 @@ static void pagerUnlockIfUnused(Pager *pPager){ ** getPageError() -- Used if the pager is in an error state ** getPageMmap() -- Used if memory-mapped I/O is enabled ** -** If the requested page is already in the cache, it is returned. +** If the requested page is already in the cache, it is returned. ** Otherwise, a new page object is allocated and populated with data ** read from the database file. In some cases, the pcache module may ** choose not to allocate a new page object and may reuse an existing ** object with no outstanding references. ** -** The extra data appended to a page is always initialized to zeros the -** first time a page is loaded into memory. If the page requested is +** The extra data appended to a page is always initialized to zeros the +** first time a page is loaded into memory. If the page requested is ** already in the cache when this function is called, then the extra ** data is left as it was when the page object was last used. ** -** If the database image is smaller than the requested page or if -** the flags parameter contains the PAGER_GET_NOCONTENT bit and the -** requested page is not already stored in the cache, then no -** actual disk read occurs. In this case the memory image of the -** page is initialized to all zeros. +** If the database image is smaller than the requested page or if +** the flags parameter contains the PAGER_GET_NOCONTENT bit and the +** requested page is not already stored in the cache, then no +** actual disk read occurs. In this case the memory image of the +** page is initialized to all zeros. ** ** If PAGER_GET_NOCONTENT is true, it means that we do not care about ** the contents of the page. This occurs in two scenarios: @@ -5404,7 +5404,7 @@ static int getPageNormal( return SQLITE_OK; }else{ - /* The pager cache has created a new page. Its content needs to + /* The pager cache has created a new page. Its content needs to ** be initialized. But first some error checks: ** ** (1) The maximum page number is 2^31 @@ -5425,9 +5425,9 @@ static int getPageNormal( } if( noContent ){ /* Failure to set the bits in the InJournal bit-vectors is benign. - ** It merely means that we might do some extra work to journal a - ** page that does not need to be journaled. Nevertheless, be sure - ** to test the case where a malloc error occurs while trying to set + ** It merely means that we might do some extra work to journal a + ** page that does not need to be journaled. Nevertheless, be sure + ** to test the case where a malloc error occurs while trying to set ** a bit in a bit vector. */ sqlite3BeginBenignMalloc(); @@ -5482,7 +5482,7 @@ static int getPageMMap( /* It is acceptable to use a read-only (mmap) page for any page except ** page 1 if there is no write-transaction open or the ACQUIRE_READONLY - ** flag was specified by the caller. And so long as the db is not a + ** flag was specified by the caller. And so long as the db is not a ** temporary or in-memory database. */ const int bMmapOk = (pgno>1 && (pPager->eState==PAGER_READER || (flags & PAGER_GET_READONLY)) @@ -5514,7 +5514,7 @@ static int getPageMMap( } if( bMmapOk && iFrame==0 ){ void *pData = 0; - rc = sqlite3OsFetch(pPager->fd, + rc = sqlite3OsFetch(pPager->fd, (i64)(pgno-1) * pPager->pageSize, pPager->pageSize, &pData ); if( rc==SQLITE_OK && pData ){ @@ -5570,12 +5570,12 @@ int sqlite3PagerGet( /* ** Acquire a page if it is already in the in-memory cache. Do ** not read the page from disk. Return a pointer to the page, -** or 0 if the page is not in cache. +** or 0 if the page is not in cache. ** ** See also sqlite3PagerGet(). The difference between this routine ** and sqlite3PagerGet() is that _get() will go to the disk and read ** in the page if the page is not already in cache. This routine -** returns NULL if the page is not in cache or if a disk I/O error +** returns NULL if the page is not in cache or if a disk I/O error ** has ever happened. */ DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno){ @@ -5614,24 +5614,24 @@ void sqlite3PagerUnref(DbPage *pPg){ /* ** This function is called at the start of every write transaction. -** There must already be a RESERVED or EXCLUSIVE lock on the database +** There must already be a RESERVED or EXCLUSIVE lock on the database ** file when this routine is called. ** ** Open the journal file for pager pPager and write a journal header ** to the start of it. If there are active savepoints, open the sub-journal -** as well. This function is only used when the journal file is being -** opened to write a rollback log for a transaction. It is not used +** as well. This function is only used when the journal file is being +** opened to write a rollback log for a transaction. It is not used ** when opening a hot journal file to roll it back. ** ** If the journal file is already open (as it may be in exclusive mode), ** then this function just writes a journal header to the start of the -** already open file. +** already open file. ** ** Whether or not the journal file is opened by this function, the ** Pager.pInJournal bitvec structure is allocated. ** -** Return SQLITE_OK if everything is successful. Otherwise, return -** SQLITE_NOMEM if the attempt to allocate Pager.pInJournal fails, or +** Return SQLITE_OK if everything is successful. Otherwise, return +** SQLITE_NOMEM if the attempt to allocate Pager.pInJournal fails, or ** an IO error code if opening or writing the journal file fails. */ static int pager_open_journal(Pager *pPager){ @@ -5641,7 +5641,7 @@ static int pager_open_journal(Pager *pPager){ assert( pPager->eState==PAGER_WRITER_LOCKED ); assert( assert_pager_state(pPager) ); assert( pPager->pInJournal==0 ); - + /* If already in the error state, this function is a no-op. But on ** the other hand, this routine is never called if we are already in ** an error state. */ @@ -5652,7 +5652,7 @@ static int pager_open_journal(Pager *pPager){ if( pPager->pInJournal==0 ){ return SQLITE_NOMEM_BKPT; } - + /* Open the journal file if it is not already open. */ if( !isOpen(pPager->jfd) ){ if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY ){ @@ -5668,7 +5668,7 @@ static int pager_open_journal(Pager *pPager){ flags |= SQLITE_OPEN_MAIN_JOURNAL; nSpill = jrnlBufferSize(pPager); } - + /* Verify that the database still has the same name as it did when ** it was originally opened. */ rc = databaseIsUnmoved(pPager); @@ -5680,9 +5680,9 @@ static int pager_open_journal(Pager *pPager){ } assert( rc!=SQLITE_OK || isOpen(pPager->jfd) ); } - - - /* Write the first journal header to the journal file and open + + + /* Write the first journal header to the journal file and open ** the sub-journal if necessary. */ if( rc==SQLITE_OK ){ @@ -5707,12 +5707,12 @@ static int pager_open_journal(Pager *pPager){ } /* -** Begin a write-transaction on the specified pager object. If a +** Begin a write-transaction on the specified pager object. If a ** write-transaction has already been opened, this function is a no-op. ** ** If the exFlag argument is false, then acquire at least a RESERVED ** lock on the database file. If exFlag is true, then acquire at least -** an EXCLUSIVE lock. If such a lock is already held, no locking +** an EXCLUSIVE lock. If such a lock is already held, no locking ** functions need be called. ** ** If the subjInMemory argument is non-zero, then any sub-journal opened @@ -5720,7 +5720,7 @@ static int pager_open_journal(Pager *pPager){ ** has no effect if the sub-journal is already opened (as it may be when ** running in exclusive mode) or if the transaction does not require a ** sub-journal. If the subjInMemory argument is zero, then any required -** sub-journal is implemented in-memory if pPager is an in-memory database, +** sub-journal is implemented in-memory if pPager is an in-memory database, ** or using a temporary file otherwise. */ int sqlite3PagerBegin(Pager *pPager, int exFlag, int subjInMemory){ @@ -5768,9 +5768,9 @@ int sqlite3PagerBegin(Pager *pPager, int exFlag, int subjInMemory){ ** ** WAL mode sets Pager.eState to PAGER_WRITER_LOCKED or CACHEMOD ** when it has an open transaction, but never to DBMOD or FINISHED. - ** This is because in those states the code to roll back savepoint - ** transactions may copy data from the sub-journal into the database - ** file as well as into the page cache. Which would be incorrect in + ** This is because in those states the code to roll back savepoint + ** transactions may copy data from the sub-journal into the database + ** file as well as into the page cache. Which would be incorrect in ** WAL mode. */ pPager->eState = PAGER_WRITER_LOCKED; @@ -5824,11 +5824,11 @@ static SQLITE_NOINLINE int pagerAddPageToRollbackJournal(PgHdr *pPg){ rc = write32bits(pPager->jfd, iOff+pPager->pageSize+4, cksum); if( rc!=SQLITE_OK ) return rc; - IOTRACE(("JOUT %p %d %lld %d\n", pPager, pPg->pgno, + IOTRACE(("JOUT %p %d %lld %d\n", pPager, pPg->pgno, pPager->journalOff, pPager->pageSize)); PAGER_INCR(sqlite3_pager_writej_count); PAGERTRACE(("JOURNAL %d page %d needSync=%d hash(%08x)\n", - PAGERID(pPager), pPg->pgno, + PAGERID(pPager), pPg->pgno, ((pPg->flags&PGHDR_NEED_SYNC)?1:0), pager_pagehash(pPg))); pPager->journalOff += 8 + pPager->pageSize; @@ -5843,9 +5843,9 @@ static SQLITE_NOINLINE int pagerAddPageToRollbackJournal(PgHdr *pPg){ } /* -** Mark a single data page as writeable. The page is written into the +** Mark a single data page as writeable. The page is written into the ** main journal or sub-journal as required. If the page is written into -** one of the journals, the corresponding bit is set in the +** one of the journals, the corresponding bit is set in the ** Pager.pInJournal bitvec and the PagerSavepoint.pInSavepoint bitvecs ** of any open savepoints as appropriate. */ @@ -5853,7 +5853,7 @@ static int pager_write(PgHdr *pPg){ Pager *pPager = pPg->pPager; int rc = SQLITE_OK; - /* This routine is not called unless a write-transaction has already + /* This routine is not called unless a write-transaction has already ** been started. The journal file may or may not be open at this point. ** It is never called in the ERROR state. */ @@ -5870,7 +5870,7 @@ static int pager_write(PgHdr *pPg){ ** obtained the necessary locks to begin the write-transaction, but the ** rollback journal might not yet be open. Open it now if this is the case. ** - ** This is done before calling sqlite3PcacheMakeDirty() on the page. + ** This is done before calling sqlite3PcacheMakeDirty() on the page. ** Otherwise, if it were done after calling sqlite3PcacheMakeDirty(), then ** an error might occur and the pager would end up in WRITER_LOCKED state ** with pages marked as dirty in the cache. @@ -5915,7 +5915,7 @@ static int pager_write(PgHdr *pPg){ ** PGHDR_WRITEABLE bit that indicates that the page can be safely modified. */ pPg->flags |= PGHDR_WRITEABLE; - + /* If the statement journal is open and the page is not in it, ** then write the page into the statement journal. */ @@ -5999,7 +5999,7 @@ static SQLITE_NOINLINE int pagerWriteLargeSector(PgHdr *pPg){ } } - /* If the PGHDR_NEED_SYNC flag is set for any of the nPage pages + /* If the PGHDR_NEED_SYNC flag is set for any of the nPage pages ** starting at pg1, then it needs to be set for all of them. Because ** writing to any of these nPage pages may damage the others, the ** journal file must contain sync()ed copies of all of them @@ -6022,9 +6022,9 @@ static SQLITE_NOINLINE int pagerWriteLargeSector(PgHdr *pPg){ } /* -** Mark a data page as writeable. This routine must be called before -** making changes to a page. The caller must check the return value -** of this function and be careful not to change any page data unless +** Mark a data page as writeable. This routine must be called before +** making changes to a page. The caller must check the return value +** of this function and be careful not to change any page data unless ** this routine returns SQLITE_OK. ** ** The difference between this function and pager_write() is that this @@ -6075,13 +6075,13 @@ int sqlite3PagerIswriteable(DbPage *pPg){ ** on the given page is unused. The pager marks the page as clean so ** that it does not get written to disk. ** -** Tests show that this optimization can quadruple the speed of large +** Tests show that this optimization can quadruple the speed of large ** DELETE operations. ** ** This optimization cannot be used with a temp-file, as the page may ** have been dirty at the start of the transaction. In that case, if -** memory pressure forces page pPg out of the cache, the data does need -** to be written out to disk so that it may be read back in if the +** memory pressure forces page pPg out of the cache, the data does need +** to be written out to disk so that it may be read back in if the ** current transaction is rolled back. */ void sqlite3PagerDontWrite(PgHdr *pPg){ @@ -6097,17 +6097,17 @@ void sqlite3PagerDontWrite(PgHdr *pPg){ } /* -** This routine is called to increment the value of the database file -** change-counter, stored as a 4-byte big-endian integer starting at +** This routine is called to increment the value of the database file +** change-counter, stored as a 4-byte big-endian integer starting at ** byte offset 24 of the pager file. The secondary change counter at ** 92 is also updated, as is the SQLite version number at offset 96. ** ** But this only happens if the pPager->changeCountDone flag is false. ** To avoid excess churning of page 1, the update only happens once. -** See also the pager_write_changecounter() routine that does an +** See also the pager_write_changecounter() routine that does an ** unconditional update of the change counters. ** -** If the isDirectMode flag is zero, then this is done by calling +** If the isDirectMode flag is zero, then this is done by calling ** sqlite3PagerWrite() on page 1, then modifying the contents of the ** page data. In this case the file will be updated when the current ** transaction is committed. @@ -6115,7 +6115,7 @@ void sqlite3PagerDontWrite(PgHdr *pPg){ ** The isDirectMode flag may only be non-zero if the library was compiled ** with the SQLITE_ENABLE_ATOMIC_WRITE macro defined. In this case, ** if isDirect is non-zero, then the database file is updated directly -** by writing an updated version of page 1 using a call to the +** by writing an updated version of page 1 using a call to the ** sqlite3OsWrite() function. */ static int pager_incr_changecounter(Pager *pPager, int isDirectMode){ @@ -6154,7 +6154,7 @@ static int pager_incr_changecounter(Pager *pPager, int isDirectMode){ assert( pPgHdr==0 || rc==SQLITE_OK ); /* If page one was fetched successfully, and this function is not - ** operating in direct-mode, make page 1 writable. When not in + ** operating in direct-mode, make page 1 writable. When not in ** direct mode, page 1 is always held in cache and hence the PagerGet() ** above is always successful - hence the ALWAYS on rc==SQLITE_OK. */ @@ -6218,22 +6218,22 @@ int sqlite3PagerSync(Pager *pPager, const char *zMaster){ /* ** This function may only be called while a write-transaction is active in -** rollback. If the connection is in WAL mode, this call is a no-op. -** Otherwise, if the connection does not already have an EXCLUSIVE lock on +** rollback. If the connection is in WAL mode, this call is a no-op. +** Otherwise, if the connection does not already have an EXCLUSIVE lock on ** the database file, an attempt is made to obtain one. ** ** If the EXCLUSIVE lock is already held or the attempt to obtain it is ** successful, or the connection is in WAL mode, SQLITE_OK is returned. -** Otherwise, either SQLITE_BUSY or an SQLITE_IOERR_XXX error code is +** Otherwise, either SQLITE_BUSY or an SQLITE_IOERR_XXX error code is ** returned. */ int sqlite3PagerExclusiveLock(Pager *pPager){ int rc = pPager->errCode; assert( assert_pager_state(pPager) ); if( rc==SQLITE_OK ){ - assert( pPager->eState==PAGER_WRITER_CACHEMOD - || pPager->eState==PAGER_WRITER_DBMOD - || pPager->eState==PAGER_WRITER_LOCKED + assert( pPager->eState==PAGER_WRITER_CACHEMOD + || pPager->eState==PAGER_WRITER_DBMOD + || pPager->eState==PAGER_WRITER_LOCKED ); assert( assert_pager_state(pPager) ); if( 0==pagerUseWal(pPager) ){ @@ -6253,12 +6253,12 @@ int sqlite3PagerExclusiveLock(Pager *pPager){ ** ** * The database file change-counter is updated, ** * the journal is synced (unless the atomic-write optimization is used), -** * all dirty pages are written to the database file, +** * all dirty pages are written to the database file, ** * the database file is truncated (if required), and -** * the database file synced. +** * the database file synced. ** -** The only thing that remains to commit the transaction is to finalize -** (delete, truncate or zero the first part of) the journal file (or +** The only thing that remains to commit the transaction is to finalize +** (delete, truncate or zero the first part of) the journal file (or ** delete the master journal file if specified). ** ** Note that if zMaster==NULL, this does not overwrite a previous value @@ -6289,7 +6289,7 @@ int sqlite3PagerCommitPhaseOne( /* Provide the ability to easily simulate an I/O error during testing */ if( sqlite3FaultSim(400) ) return SQLITE_IOERR; - PAGERTRACE(("DATABASE SYNC: File=%s zMaster=%s nSize=%d\n", + PAGERTRACE(("DATABASE SYNC: File=%s zMaster=%s nSize=%d\n", pPager->zFilename, zMaster, pPager->dbSize)); /* If no database changes have been made, return early. */ @@ -6324,11 +6324,11 @@ int sqlite3PagerCommitPhaseOne( }else{ /* The following block updates the change-counter. Exactly how it ** does this depends on whether or not the atomic-update optimization - ** was enabled at compile time, and if this transaction meets the - ** runtime criteria to use the operation: + ** was enabled at compile time, and if this transaction meets the + ** runtime criteria to use the operation: ** ** * The file-system supports the atomic-write property for - ** blocks of size page-size, and + ** blocks of size page-size, and ** * This commit is not part of a multi-file transaction, and ** * Exactly one page has been modified and store in the journal file. ** @@ -6338,7 +6338,7 @@ int sqlite3PagerCommitPhaseOne( ** is not applicable to this transaction, call sqlite3JournalCreate() ** to make sure the journal file has actually been created, then call ** pager_incr_changecounter() to update the change-counter in indirect - ** mode. + ** mode. ** ** Otherwise, if the optimization is both enabled and applicable, ** then call pager_incr_changecounter() to update the change-counter @@ -6347,19 +6347,19 @@ int sqlite3PagerCommitPhaseOne( */ #ifdef SQLITE_ENABLE_ATOMIC_WRITE PgHdr *pPg; - assert( isOpen(pPager->jfd) - || pPager->journalMode==PAGER_JOURNALMODE_OFF - || pPager->journalMode==PAGER_JOURNALMODE_WAL + assert( isOpen(pPager->jfd) + || pPager->journalMode==PAGER_JOURNALMODE_OFF + || pPager->journalMode==PAGER_JOURNALMODE_WAL ); - if( !zMaster && isOpen(pPager->jfd) - && pPager->journalOff==jrnlBufferSize(pPager) + if( !zMaster && isOpen(pPager->jfd) + && pPager->journalOff==jrnlBufferSize(pPager) && pPager->dbSize>=pPager->dbOrigSize && (0==(pPg = sqlite3PcacheDirtyList(pPager->pPCache)) || 0==pPg->pDirty) ){ - /* Update the db file change counter via the direct-write method. The - ** following call will modify the in-memory representation of page 1 - ** to include the updated change counter and then write page 1 - ** directly to the database file. Because of the atomic-write + /* Update the db file change counter via the direct-write method. The + ** following call will modify the in-memory representation of page 1 + ** to include the updated change counter and then write page 1 + ** directly to the database file. Because of the atomic-write ** property of the host file-system, this is safe. */ rc = pager_incr_changecounter(pPager, 1); @@ -6373,28 +6373,28 @@ int sqlite3PagerCommitPhaseOne( rc = pager_incr_changecounter(pPager, 0); #endif if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - - /* Write the master journal name into the journal file. If a master - ** journal file name has already been written to the journal file, + + /* Write the master journal name into the journal file. If a master + ** journal file name has already been written to the journal file, ** or if zMaster is NULL (no master journal), then this call is a no-op. */ rc = writeMasterJournal(pPager, zMaster); if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - + /* Sync the journal file and write all dirty pages to the database. - ** If the atomic-update optimization is being used, this sync will not + ** If the atomic-update optimization is being used, this sync will not ** create the journal file or perform any real IO. ** ** Because the change-counter page was just modified, unless the ** atomic-update optimization is used it is almost certain that the ** journal requires a sync here. However, in locking_mode=exclusive - ** on a system under memory pressure it is just possible that this is + ** on a system under memory pressure it is just possible that this is ** not the case. In this case it is likely enough that the redundant - ** xSync() call will be changed to a no-op by the OS anyhow. + ** xSync() call will be changed to a no-op by the OS anyhow. */ rc = syncJournal(pPager, 0); if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - + rc = pager_write_pagelist(pPager,sqlite3PcacheDirtyList(pPager->pPCache)); if( rc!=SQLITE_OK ){ assert( rc!=SQLITE_IOERR_BLOCKED ); @@ -6402,7 +6402,7 @@ int sqlite3PagerCommitPhaseOne( } sqlite3PcacheCleanAll(pPager->pPCache); - /* If the file on disk is smaller than the database image, use + /* If the file on disk is smaller than the database image, use ** pager_truncate to grow the file here. This can happen if the database ** image was extended as part of the current transaction and then the ** last page in the db image moved to the free-list. In this case the @@ -6414,7 +6414,7 @@ int sqlite3PagerCommitPhaseOne( rc = pager_truncate(pPager, nNew); if( rc!=SQLITE_OK ) goto commit_phase_one_exit; } - + /* Finally, sync the database file. */ if( !noSync ){ rc = sqlite3PagerSync(pPager, zMaster); @@ -6434,12 +6434,12 @@ commit_phase_one_exit: /* ** When this function is called, the database file has been completely ** updated to reflect the changes made by the current transaction and -** synced to disk. The journal file still exists in the file-system +** synced to disk. The journal file still exists in the file-system ** though, and if a failure occurs at this point it will eventually ** be used as a hot-journal and the current transaction rolled back. ** -** This function finalizes the journal file, either by deleting, -** truncating or partially zeroing it, so that it cannot be used +** This function finalizes the journal file, either by deleting, +** truncating or partially zeroing it, so that it cannot be used ** for hot-journal rollback. Once this is done the transaction is ** irrevocably committed. ** @@ -6464,15 +6464,15 @@ int sqlite3PagerCommitPhaseTwo(Pager *pPager){ ** this transaction, the pager is running in exclusive-mode and is ** using persistent journals, then this function is a no-op. ** - ** The start of the journal file currently contains a single journal + ** The start of the journal file currently contains a single journal ** header with the nRec field set to 0. If such a journal is used as ** a hot-journal during hot-journal rollback, 0 changes will be made - ** to the database file. So there is no need to zero the journal + ** to the database file. So there is no need to zero the journal ** header. Since the pager is in exclusive mode, there is no need ** to drop any locks either. */ - if( pPager->eState==PAGER_WRITER_LOCKED - && pPager->exclusiveMode + if( pPager->eState==PAGER_WRITER_LOCKED + && pPager->exclusiveMode && pPager->journalMode==PAGER_JOURNALMODE_PERSIST ){ assert( pPager->journalOff==JOURNAL_HDR_SZ(pPager) || !pPager->journalOff ); @@ -6487,7 +6487,7 @@ int sqlite3PagerCommitPhaseTwo(Pager *pPager){ } /* -** If a write transaction is open, then all changes made within the +** If a write transaction is open, then all changes made within the ** transaction are reverted and the current write-transaction is closed. ** The pager falls back to PAGER_READER state if successful, or PAGER_ERROR ** state if an error occurs. @@ -6497,14 +6497,14 @@ int sqlite3PagerCommitPhaseTwo(Pager *pPager){ ** ** Otherwise, in rollback mode, this function performs two functions: ** -** 1) It rolls back the journal file, restoring all database file and +** 1) It rolls back the journal file, restoring all database file and ** in-memory cache pages to the state they were in when the transaction ** was opened, and ** ** 2) It finalizes the journal file, so that it is not used for hot ** rollback at any point in the future. ** -** Finalization of the journal file (task 2) is only performed if the +** Finalization of the journal file (task 2) is only performed if the ** rollback is successful. ** ** In WAL mode, all cache-entries containing data modified within the @@ -6517,7 +6517,7 @@ int sqlite3PagerRollback(Pager *pPager){ PAGERTRACE(("ROLLBACK %d\n", PAGERID(pPager))); /* PagerRollback() is a no-op if called in READER or OPEN state. If - ** the pager is already in the ERROR state, the rollback is not + ** the pager is already in the ERROR state, the rollback is not ** attempted here. Instead, the error code is returned to the caller. */ assert( assert_pager_state(pPager) ); @@ -6533,7 +6533,7 @@ int sqlite3PagerRollback(Pager *pPager){ int eState = pPager->eState; rc = pager_end_transaction(pPager, 0, 0); if( !MEMDB && eState>PAGER_WRITER_LOCKED ){ - /* This can happen using journal_mode=off. Move the pager to the error + /* This can happen using journal_mode=off. Move the pager to the error ** state to indicate that the contents of the cache may not be trusted. ** Any active readers will get SQLITE_ABORT. */ @@ -6548,7 +6548,7 @@ int sqlite3PagerRollback(Pager *pPager){ assert( pPager->eState==PAGER_READER || rc!=SQLITE_OK ); assert( rc==SQLITE_OK || rc==SQLITE_FULL || rc==SQLITE_CORRUPT - || rc==SQLITE_NOMEM || (rc&0xFF)==SQLITE_IOERR + || rc==SQLITE_NOMEM || (rc&0xFF)==SQLITE_IOERR || rc==SQLITE_CANTOPEN ); @@ -6618,8 +6618,8 @@ int *sqlite3PagerStats(Pager *pPager){ /* ** Parameter eStat must be either SQLITE_DBSTATUS_CACHE_HIT or ** SQLITE_DBSTATUS_CACHE_MISS. Before returning, *pnVal is incremented by the -** current cache hit or miss count, according to the value of eStat. If the -** reset parameter is non-zero, the cache hit or miss count is zeroed before +** current cache hit or miss count, according to the value of eStat. If the +** reset parameter is non-zero, the cache hit or miss count is zeroed before ** returning. */ void sqlite3PagerCacheStat(Pager *pPager, int eStat, int reset, int *pnVal){ @@ -6652,7 +6652,7 @@ int sqlite3PagerIsMemdb(Pager *pPager){ ** to make up the difference. If the number of savepoints is already ** equal to nSavepoint, then this function is a no-op. ** -** If a memory allocation fails, SQLITE_NOMEM is returned. If an error +** If a memory allocation fails, SQLITE_NOMEM is returned. If an error ** occurs while opening the sub-journal file, then an IO error code is ** returned. Otherwise, SQLITE_OK. */ @@ -6667,7 +6667,7 @@ static SQLITE_NOINLINE int pagerOpenSavepoint(Pager *pPager, int nSavepoint){ assert( nSavepoint>nCurrent && pPager->useJournal ); /* Grow the Pager.aSavepoint array using realloc(). Return SQLITE_NOMEM - ** if the allocation fails. Otherwise, zero the new portion in case a + ** if the allocation fails. Otherwise, zero the new portion in case a ** malloc failure occurs while populating it in the for(...) loop below. */ aNew = (PagerSavepoint *)sqlite3Realloc( @@ -6715,7 +6715,7 @@ int sqlite3PagerOpenSavepoint(Pager *pPager, int nSavepoint){ /* ** This function is called to rollback or release (commit) a savepoint. -** The savepoint to release or rollback need not be the most recently +** The savepoint to release or rollback need not be the most recently ** created savepoint. ** ** Parameter op is always either SAVEPOINT_ROLLBACK or SAVEPOINT_RELEASE. @@ -6723,29 +6723,29 @@ int sqlite3PagerOpenSavepoint(Pager *pPager, int nSavepoint){ ** index iSavepoint. If it is SAVEPOINT_ROLLBACK, then rollback all changes ** that have occurred since the specified savepoint was created. ** -** The savepoint to rollback or release is identified by parameter +** The savepoint to rollback or release is identified by parameter ** iSavepoint. A value of 0 means to operate on the outermost savepoint ** (the first created). A value of (Pager.nSavepoint-1) means operate ** on the most recently created savepoint. If iSavepoint is greater than ** (Pager.nSavepoint-1), then this function is a no-op. ** ** If a negative value is passed to this function, then the current -** transaction is rolled back. This is different to calling +** transaction is rolled back. This is different to calling ** sqlite3PagerRollback() because this function does not terminate -** the transaction or unlock the database, it just restores the -** contents of the database to its original state. +** the transaction or unlock the database, it just restores the +** contents of the database to its original state. ** -** In any case, all savepoints with an index greater than iSavepoint +** In any case, all savepoints with an index greater than iSavepoint ** are destroyed. If this is a release operation (op==SAVEPOINT_RELEASE), ** then savepoint iSavepoint is also destroyed. ** ** This function may return SQLITE_NOMEM if a memory allocation fails, -** or an IO error code if an IO error occurs while rolling back a +** or an IO error code if an IO error occurs while rolling back a ** savepoint. If no errors occur, SQLITE_OK is returned. -*/ +*/ int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){ int rc = pPager->errCode; - + #ifdef SQLITE_ENABLE_ZIPVFS if( op==SAVEPOINT_RELEASE ) rc = SQLITE_OK; #endif @@ -6758,7 +6758,7 @@ int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){ int nNew; /* Number of remaining savepoints after this op. */ /* Figure out how many savepoints will still be active after this - ** operation. Store this value in nNew. Then free resources associated + ** operation. Store this value in nNew. Then free resources associated ** with any savepoints that are destroyed by this operation. */ nNew = iSavepoint + (( op==SAVEPOINT_RELEASE ) ? 0 : 1); @@ -6767,7 +6767,7 @@ int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){ } pPager->nSavepoint = nNew; - /* If this is a release of the outermost savepoint, truncate + /* If this is a release of the outermost savepoint, truncate ** the sub-journal to zero bytes in size. */ if( op==SAVEPOINT_RELEASE ){ if( nNew==0 && isOpen(pPager->sjfd) ){ @@ -6789,14 +6789,14 @@ int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){ rc = pagerPlaybackSavepoint(pPager, pSavepoint); assert(rc!=SQLITE_DONE); } - + #ifdef SQLITE_ENABLE_ZIPVFS - /* If the cache has been modified but the savepoint cannot be rolled + /* If the cache has been modified but the savepoint cannot be rolled ** back journal_mode=off, put the pager in the error state. This way, ** if the VFS used by this pager includes ZipVFS, the entire transaction ** can be rolled back at the ZipVFS level. */ - else if( - pPager->journalMode==PAGER_JOURNALMODE_OFF + else if( + pPager->journalMode==PAGER_JOURNALMODE_OFF && pPager->eState>=PAGER_WRITER_CACHEMOD ){ pPager->errCode = SQLITE_ABORT; @@ -6921,8 +6921,8 @@ int sqlite3PagerState(Pager *pPager){ ** transaction is active). ** ** If the fourth argument, isCommit, is non-zero, then this page is being -** moved as part of a database reorganization just before the transaction -** is being committed. In this case, it is guaranteed that the database page +** moved as part of a database reorganization just before the transaction +** is being committed. In this case, it is guaranteed that the database page ** pPg refers to will not be written to again within this transaction. ** ** This function may return SQLITE_NOMEM or an IO error code if an error @@ -6950,7 +6950,7 @@ int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit){ } /* If the page being moved is dirty and has not been saved by the latest - ** savepoint, then save the current contents of the page into the + ** savepoint, then save the current contents of the page into the ** sub-journal now. This is required to handle the following scenario: ** ** BEGIN; @@ -6973,7 +6973,7 @@ int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit){ return rc; } - PAGERTRACE(("MOVE %d page %d (needSync=%d) moves to %d\n", + PAGERTRACE(("MOVE %d page %d (needSync=%d) moves to %d\n", PAGERID(pPager), pPg->pgno, (pPg->flags&PGHDR_NEED_SYNC)?1:0, pgno)); IOTRACE(("MOVE %p %d %d\n", pPager, pPg->pgno, pgno)) @@ -6981,7 +6981,7 @@ int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit){ ** be written to, store pPg->pgno in local variable needSyncPgno. ** ** If the isCommit flag is set, there is no need to remember that - ** the journal needs to be sync()ed before database page pPg->pgno + ** the journal needs to be sync()ed before database page pPg->pgno ** can be written to. The caller has already promised not to write to it. */ if( (pPg->flags&PGHDR_NEED_SYNC) && !isCommit ){ @@ -6992,8 +6992,8 @@ int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit){ } /* If the cache contains a page with page-number pgno, remove it - ** from its hash chain. Also, if the PGHDR_NEED_SYNC flag was set for - ** page pgno before the 'move' operation, it needs to be retained + ** from its hash chain. Also, if the PGHDR_NEED_SYNC flag was set for + ** page pgno before the 'move' operation, it needs to be retained ** for the page moved there. */ pPg->flags &= ~PGHDR_NEED_SYNC; @@ -7024,9 +7024,9 @@ int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit){ } if( needSyncPgno ){ - /* If needSyncPgno is non-zero, then the journal file needs to be + /* If needSyncPgno is non-zero, then the journal file needs to be ** sync()ed before any data is written to database file page needSyncPgno. - ** Currently, no such page exists in the page-cache and the + ** Currently, no such page exists in the page-cache and the ** "is journaled" bitvec flag has been set. This needs to be remedied by ** loading the page into the pager-cache and setting the PGHDR_NEED_SYNC ** flag. @@ -7057,9 +7057,9 @@ int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit){ #endif /* -** The page handle passed as the first argument refers to a dirty page -** with a page number other than iNew. This function changes the page's -** page number to iNew and sets the value of the PgHdr.flags field to +** The page handle passed as the first argument refers to a dirty page +** with a page number other than iNew. This function changes the page's +** page number to iNew and sets the value of the PgHdr.flags field to ** the value passed as the third parameter. */ void sqlite3PagerRekey(DbPage *pPg, Pgno iNew, u16 flags){ @@ -7077,7 +7077,7 @@ void *sqlite3PagerGetData(DbPage *pPg){ } /* -** Return a pointer to the Pager.nExtra bytes of "extra" space +** Return a pointer to the Pager.nExtra bytes of "extra" space ** allocated along with the specified page. */ void *sqlite3PagerGetExtra(DbPage *pPg){ @@ -7086,7 +7086,7 @@ void *sqlite3PagerGetExtra(DbPage *pPg){ /* ** Get/set the locking-mode for this pager. Parameter eMode must be one -** of PAGER_LOCKINGMODE_QUERY, PAGER_LOCKINGMODE_NORMAL or +** of PAGER_LOCKINGMODE_QUERY, PAGER_LOCKINGMODE_NORMAL or ** PAGER_LOCKINGMODE_EXCLUSIVE. If the parameter is not _QUERY, then ** the locking-mode is set to the value specified. ** @@ -7141,8 +7141,8 @@ int sqlite3PagerSetJournalMode(Pager *pPager, int eMode){ assert( eMode==PAGER_JOURNALMODE_DELETE || eMode==PAGER_JOURNALMODE_TRUNCATE || eMode==PAGER_JOURNALMODE_PERSIST - || eMode==PAGER_JOURNALMODE_OFF - || eMode==PAGER_JOURNALMODE_WAL + || eMode==PAGER_JOURNALMODE_OFF + || eMode==PAGER_JOURNALMODE_WAL || eMode==PAGER_JOURNALMODE_MEMORY ); /* This routine is only called from the OP_JournalMode opcode, and @@ -7327,7 +7327,7 @@ static int pagerExclusiveLock(Pager *pPager){ assert( pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK ); rc = pagerLockDb(pPager, EXCLUSIVE_LOCK); if( rc!=SQLITE_OK ){ - /* If the attempt to grab the exclusive lock failed, release the + /* If the attempt to grab the exclusive lock failed, release the ** pending lock that may have been obtained instead. */ pagerUnlockDb(pPager, SHARED_LOCK); } @@ -7336,7 +7336,7 @@ static int pagerExclusiveLock(Pager *pPager){ } /* -** Call sqlite3WalOpen() to open the WAL handle. If the pager is in +** Call sqlite3WalOpen() to open the WAL handle. If the pager is in ** exclusive-locking mode when this function is called, take an EXCLUSIVE ** lock on the database file and use heap-memory to store the wal-index ** in. Otherwise, use the normal shared-memory. @@ -7347,8 +7347,8 @@ static int pagerOpenWal(Pager *pPager){ assert( pPager->pWal==0 && pPager->tempFile==0 ); assert( pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK ); - /* If the pager is already in exclusive-mode, the WAL module will use - ** heap-memory for the wal-index instead of the VFS shared-memory + /* If the pager is already in exclusive-mode, the WAL module will use + ** heap-memory for the wal-index instead of the VFS shared-memory ** implementation. Take the exclusive lock now, before opening the WAL ** file, to make sure this is safe. */ @@ -7356,7 +7356,7 @@ static int pagerOpenWal(Pager *pPager){ rc = pagerExclusiveLock(pPager); } - /* Open the connection to the log file. If this operation fails, + /* Open the connection to the log file. If this operation fails, ** (e.g. due to malloc() failure), return an error code. */ if( rc==SQLITE_OK ){ @@ -7378,7 +7378,7 @@ static int pagerOpenWal(Pager *pPager){ ** If the pager passed as the first argument is open on a real database ** file (not a temp file or an in-memory database), and the WAL file ** is not already open, make an attempt to open it now. If successful, -** return SQLITE_OK. If an error occurs or the VFS used by the pager does +** return SQLITE_OK. If an error occurs or the VFS used by the pager does ** not support the xShmXXX() methods, return an error code. *pbOpen is ** not modified in either case. ** @@ -7420,7 +7420,7 @@ int sqlite3PagerOpenWal( ** This function is called to close the connection to the log file prior ** to switching from WAL to rollback mode. ** -** Before closing the log file, this function attempts to take an +** Before closing the log file, this function attempts to take an ** EXCLUSIVE lock on the database file. If this cannot be obtained, an ** error (SQLITE_BUSY) is returned and the log connection is not closed. ** If successful, the EXCLUSIVE lock is not released before returning. @@ -7446,7 +7446,7 @@ int sqlite3PagerCloseWal(Pager *pPager, sqlite3 *db){ rc = pagerOpenWal(pPager); } } - + /* Checkpoint and close the log. Because an EXCLUSIVE lock is held on ** the database file, the log and log-summary files will be deleted. */ @@ -7478,7 +7478,7 @@ int sqlite3PagerSnapshotGet(Pager *pPager, sqlite3_snapshot **ppSnapshot){ /* ** If this is a WAL database, store a pointer to pSnapshot. Next time a -** read transaction is opened, attempt to read from the snapshot it +** read transaction is opened, attempt to read from the snapshot it ** identifies. If this is not a WAL database, return an error. */ int sqlite3PagerSnapshotOpen(Pager *pPager, sqlite3_snapshot *pSnapshot){ @@ -7492,7 +7492,7 @@ int sqlite3PagerSnapshotOpen(Pager *pPager, sqlite3_snapshot *pSnapshot){ } /* -** If this is a WAL database, call sqlite3WalSnapshotRecover(). If this +** If this is a WAL database, call sqlite3WalSnapshotRecover(). If this ** is not a WAL database, return an error. */ int sqlite3PagerSnapshotRecover(Pager *pPager){ diff --git a/third_party/sqlite/src/src/pager.h b/third_party/sqlite/src/src/pager.h index 585ef2949794f..3522a4e3dcad4 100644 --- a/third_party/sqlite/src/src/pager.h +++ b/third_party/sqlite/src/src/pager.h @@ -18,8 +18,8 @@ #define SQLITE_PAGER_H /* -** Default maximum size for persistent journal files. A negative -** value means no limit. This value may be overridden using the +** Default maximum size for persistent journal files. A negative +** value means no limit. This value may be overridden using the ** sqlite3PagerJournalSizeLimit() API. See also "PRAGMA journal_size_limit". */ #ifndef SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT @@ -45,9 +45,9 @@ typedef struct PgHdr DbPage; /* ** Page number PAGER_MJ_PGNO is never used in an SQLite database (it is ** reserved for working around a windows/posix incompatibility). It is -** used in the journal to signify that the remainder of the journal file +** used in the journal to signify that the remainder of the journal file ** is devoted to storing a master journal name - there are no more pages to -** roll back. See comments for function writeMasterJournal() in pager.c +** roll back. See comments for function writeMasterJournal() in pager.c ** for details. */ #define PAGER_MJ_PGNO(x) ((Pgno)((PENDING_BYTE/((x)->pageSize))+1)) @@ -108,11 +108,11 @@ typedef struct PgHdr DbPage; /* ** The remainder of this file contains the declarations of the functions -** that make up the Pager sub-system API. See source code comments for +** that make up the Pager sub-system API. See source code comments for ** a detailed description of each routine. */ -/* Open and close a Pager connection. */ +/* Open and close a Pager connection. */ int sqlite3PagerOpen( sqlite3_vfs*, Pager **ppPager, @@ -145,7 +145,7 @@ i64 sqlite3PagerJournalSizeLimit(Pager *, i64); sqlite3_backup **sqlite3PagerBackupPtr(Pager*); int sqlite3PagerFlush(Pager*); -/* Functions used to obtain and release page references. */ +/* Functions used to obtain and release page references. */ int sqlite3PagerGet(Pager *pPager, Pgno pgno, DbPage **ppPage, int clrFlag); DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno); void sqlite3PagerRef(DbPage*); @@ -157,8 +157,8 @@ int sqlite3PagerWrite(DbPage*); void sqlite3PagerDontWrite(DbPage*); int sqlite3PagerMovepage(Pager*,DbPage*,Pgno,int); int sqlite3PagerPageRefcount(DbPage*); -void *sqlite3PagerGetData(DbPage *); -void *sqlite3PagerGetExtra(DbPage *); +void *sqlite3PagerGetData(DbPage *); +void *sqlite3PagerGetExtra(DbPage *); /* Functions used to manage pager transactions and savepoints. */ void sqlite3PagerPagecount(Pager*, int*); diff --git a/third_party/sqlite/src/src/parse.y b/third_party/sqlite/src/src/parse.y index 9cada2a1be467..89b9c67e6a75b 100644 --- a/third_party/sqlite/src/src/parse.y +++ b/third_party/sqlite/src/src/parse.y @@ -426,7 +426,7 @@ cmd ::= select(X). { pLoop->pNext = pNext; pLoop->selFlags |= SF_Compound; } - if( (p->selFlags & SF_MultiValue)==0 && + if( (p->selFlags & SF_MultiValue)==0 && (mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0 && cnt>mxSelect ){ @@ -639,7 +639,7 @@ dbnm(A) ::= DOT nm(X). {A = X;} %type fullname {SrcList*} %destructor fullname {sqlite3SrcListDelete(pParse->db, $$);} -fullname(A) ::= nm(X) dbnm(Y). +fullname(A) ::= nm(X) dbnm(Y). {A = sqlite3SrcListAppend(pParse->db,0,&X,&Y); /*A-overwrites-X*/} %type joinop {int} @@ -662,8 +662,8 @@ on_opt(N) ::= . {N = 0;} // with z pointing to the token data and n containing the number of bytes // in the token. // -// If there is a "NOT INDEXED" clause, then (z==0 && n==1), which is -// normally illegal. The sqlite3SrcListIndexedBy() function +// If there is a "NOT INDEXED" clause, then (z==0 && n==1), which is +// normally illegal. The sqlite3SrcListIndexedBy() function // recognizes and interprets this as a special case. // %type indexed_opt {Token} @@ -718,9 +718,9 @@ having_opt(A) ::= HAVING expr(X). {A = X.pExpr;} // The destructor for limit_opt will never fire in the current grammar. // The limit_opt non-terminal only occurs at the end of a single production -// rule for SELECT statements. As soon as the rule that create the +// rule for SELECT statements. As soon as the rule that create the // limit_opt non-terminal reduces, the SELECT statement rule will also -// reduce. So there is never a limit_opt non-terminal on the stack +// reduce. So there is never a limit_opt non-terminal on the stack // except as a transient. So there is never anything to destroy. // //%destructor limit_opt { @@ -729,15 +729,15 @@ having_opt(A) ::= HAVING expr(X). {A = X.pExpr;} //} limit_opt(A) ::= . {A.pLimit = 0; A.pOffset = 0;} limit_opt(A) ::= LIMIT expr(X). {A.pLimit = X.pExpr; A.pOffset = 0;} -limit_opt(A) ::= LIMIT expr(X) OFFSET expr(Y). +limit_opt(A) ::= LIMIT expr(X) OFFSET expr(Y). {A.pLimit = X.pExpr; A.pOffset = Y.pExpr;} -limit_opt(A) ::= LIMIT expr(X) COMMA expr(Y). +limit_opt(A) ::= LIMIT expr(X) COMMA expr(Y). {A.pOffset = X.pExpr; A.pLimit = Y.pExpr;} /////////////////////////// The DELETE statement ///////////////////////////// // %ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT -cmd ::= with(C) DELETE FROM fullname(X) indexed_opt(I) where_opt(W) +cmd ::= with(C) DELETE FROM fullname(X) indexed_opt(I) where_opt(W) orderby_opt(O) limit_opt(L). { sqlite3WithPush(pParse, C, 1); sqlite3SrcListIndexedBy(pParse, X, &I); @@ -766,7 +766,7 @@ cmd ::= with(C) UPDATE orconf(R) fullname(X) indexed_opt(I) SET setlist(Y) where_opt(W) orderby_opt(O) limit_opt(L). { sqlite3WithPush(pParse, C, 1); sqlite3SrcListIndexedBy(pParse, X, &I); - sqlite3ExprListCheckLength(pParse,Y,"set list"); + sqlite3ExprListCheckLength(pParse,Y,"set list"); W = sqlite3LimitWhere(pParse, X, W, O, L.pLimit, L.pOffset, "UPDATE"); sqlite3Update(pParse,X,Y,W,R); } @@ -776,7 +776,7 @@ cmd ::= with(C) UPDATE orconf(R) fullname(X) indexed_opt(I) SET setlist(Y) where_opt(W). { sqlite3WithPush(pParse, C, 1); sqlite3SrcListIndexedBy(pParse, X, &I); - sqlite3ExprListCheckLength(pParse,Y,"set list"); + sqlite3ExprListCheckLength(pParse,Y,"set list"); sqlite3Update(pParse,X,Y,W,R); } %endif @@ -865,7 +865,7 @@ idlist(A) ::= nm(Y). } #if SQLITE_MAX_EXPR_DEPTH>0 p->nHeight = 1; -#endif +#endif } pOut->pExpr = p; pOut->zStart = t.z; @@ -1037,7 +1037,7 @@ expr(A) ::= expr(A) likeop(OP) expr(Y) ESCAPE expr(E). [LIKE_KW] { ){ pOperand->pExpr = sqlite3PExpr(pParse, op, pOperand->pExpr, 0); pOperand->zEnd = &pPostOp->z[pPostOp->n]; - } + } } expr(A) ::= expr(A) ISNULL|NOTNULL(E). {spanUnaryPostfix(pParse,@E,&A,&E);} @@ -1061,7 +1061,7 @@ expr(A) ::= expr(A) NOT NULL(E). {spanUnaryPostfix(pParse,TK_NOTNULL,&A,&E);} // // If expr2 is NULL then code as TK_ISNULL or TK_NOTNULL. If expr2 // is any other expression, code as TK_IS or TK_ISNOT. -// +// expr(A) ::= expr(A) IS expr(Y). { spanBinaryExpr(pParse,TK_IS,&A,&Y); binaryToUnaryIfNull(pParse, Y.pExpr, A.pExpr, TK_ISNULL); @@ -1089,7 +1089,7 @@ expr(A) ::= expr(A) IS NOT expr(Y). { -expr(A) ::= NOT(B) expr(X). +expr(A) ::= NOT(B) expr(X). {spanUnaryPrefix(&A,pParse,@B,&X,&B);/*A-overwrites-B*/} expr(A) ::= BITNOT(B) expr(X). {spanUnaryPrefix(&A,pParse,@B,&X,&B);/*A-overwrites-B*/} @@ -1109,7 +1109,7 @@ expr(A) ::= expr(A) between_op(N) expr(X) AND expr(Y). [BETWEEN] { A.pExpr->x.pList = pList; }else{ sqlite3ExprListDelete(pParse->db, pList); - } + } exprNot(pParse, N, &A); A.zEnd = Y.zEnd; } @@ -1221,11 +1221,11 @@ case_exprlist(A) ::= WHEN expr(Y) THEN expr(Z). { %type case_else {Expr*} %destructor case_else {sqlite3ExprDelete(pParse->db, $$);} case_else(A) ::= ELSE expr(X). {A = X.pExpr;} -case_else(A) ::= . {A = 0;} +case_else(A) ::= . {A = 0;} %type case_operand {Expr*} %destructor case_operand {sqlite3ExprDelete(pParse->db, $$);} -case_operand(A) ::= expr(X). {A = X.pExpr; /*A-overwrites-X*/} -case_operand(A) ::= . {A = 0;} +case_operand(A) ::= expr(X). {A = X.pExpr; /*A-overwrites-X*/} +case_operand(A) ::= . {A = 0;} %type exprlist {ExprList*} %destructor exprlist {sqlite3ExprListDelete(pParse->db, $$);} @@ -1253,7 +1253,7 @@ paren_exprlist(A) ::= LP exprlist(X) RP. {A = X;} // cmd ::= createkw(S) uniqueflag(U) INDEX ifnotexists(NE) nm(X) dbnm(D) ON nm(Y) LP sortlist(Z) RP where_opt(W). { - sqlite3CreateIndex(pParse, &X, &D, + sqlite3CreateIndex(pParse, &X, &D, sqlite3SrcListAppend(pParse->db,0,&Y,0), Z, U, &S, W, SQLITE_SO_ASC, NE, SQLITE_IDXTYPE_APPDEF); } @@ -1341,7 +1341,7 @@ cmd ::= VACUUM nm(X). {sqlite3Vacuum(pParse,&X);} cmd ::= PRAGMA nm(X) dbnm(Z). {sqlite3Pragma(pParse,&X,&Z,0,0);} cmd ::= PRAGMA nm(X) dbnm(Z) EQ nmnum(Y). {sqlite3Pragma(pParse,&X,&Z,&Y,0);} cmd ::= PRAGMA nm(X) dbnm(Z) LP nmnum(Y) RP. {sqlite3Pragma(pParse,&X,&Z,&Y,0);} -cmd ::= PRAGMA nm(X) dbnm(Z) EQ minus_num(Y). +cmd ::= PRAGMA nm(X) dbnm(Z) EQ minus_num(Y). {sqlite3Pragma(pParse,&X,&Z,&Y,1);} cmd ::= PRAGMA nm(X) dbnm(Z) LP minus_num(Y) RP. {sqlite3Pragma(pParse,&X,&Z,&Y,1);} @@ -1367,7 +1367,7 @@ cmd ::= createkw trigger_decl(A) BEGIN trigger_cmd_list(S) END(Z). { sqlite3FinishTrigger(pParse, S, &all); } -trigger_decl(A) ::= temp(T) TRIGGER ifnotexists(NOERR) nm(B) dbnm(Z) +trigger_decl(A) ::= temp(T) TRIGGER ifnotexists(NOERR) nm(B) dbnm(Z) trigger_time(C) trigger_event(D) ON fullname(E) foreach_clause when_clause(G). { sqlite3BeginTrigger(pParse, &B, &Z, C, D.a, D.b, E, G, T, NOERR); @@ -1401,20 +1401,20 @@ trigger_cmd_list(A) ::= trigger_cmd_list(A) trigger_cmd(X) SEMI. { A->pLast->pNext = X; A->pLast = X; } -trigger_cmd_list(A) ::= trigger_cmd(A) SEMI. { +trigger_cmd_list(A) ::= trigger_cmd(A) SEMI. { assert( A!=0 ); A->pLast = A; } // Disallow qualified table names on INSERT, UPDATE, and DELETE statements -// within a trigger. The table to INSERT, UPDATE, or DELETE is always in +// within a trigger. The table to INSERT, UPDATE, or DELETE is always in // the same database as the table that the trigger fires on. // %type trnm {Token} trnm(A) ::= nm(A). trnm(A) ::= nm DOT nm(X). { A = X; - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "qualified table names are not allowed on INSERT, UPDATE, and DELETE " "statements within triggers"); } @@ -1439,9 +1439,9 @@ tridxby ::= NOT INDEXED. { %type trigger_cmd {TriggerStep*} %destructor trigger_cmd {sqlite3DeleteTriggerStep(pParse->db, $$);} -// UPDATE +// UPDATE trigger_cmd(A) ::= - UPDATE orconf(R) trnm(X) tridxby SET setlist(Y) where_opt(Z). + UPDATE orconf(R) trnm(X) tridxby SET setlist(Y) where_opt(Z). {A = sqlite3TriggerUpdateStep(pParse->db, &X, Y, Z, R);} // INSERT @@ -1459,14 +1459,14 @@ trigger_cmd(A) ::= select(X). // The special RAISE expression that may occur in trigger programs expr(A) ::= RAISE(X) LP IGNORE RP(Y). { spanSet(&A,&X,&Y); /*A-overwrites-X*/ - A.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0); + A.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0); if( A.pExpr ){ A.pExpr->affinity = OE_Ignore; } } expr(A) ::= RAISE(X) LP raisetype(T) COMMA nm(Z) RP(Y). { spanSet(&A,&X,&Y); /*A-overwrites-X*/ - A.pExpr = sqlite3ExprAlloc(pParse->db, TK_RAISE, &Z, 1); + A.pExpr = sqlite3ExprAlloc(pParse->db, TK_RAISE, &Z, 1); if( A.pExpr ) { A.pExpr->affinity = (char)T; } diff --git a/third_party/sqlite/src/src/pcache.c b/third_party/sqlite/src/src/pcache.c index 0fc44c54992be..9c7b88ed1e431 100644 --- a/third_party/sqlite/src/src/pcache.c +++ b/third_party/sqlite/src/src/pcache.c @@ -31,7 +31,7 @@ ** ** The PCache.pSynced variable is used to optimize searching for a dirty ** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. +** a page that does not require a journal sync than one that does. ** Therefore, pSynced is maintained to that it *almost* always points ** to either the oldest page in the pDirty/pDirtyTail list that has a ** clear PGHDR_NEED_SYNC flag or to a page that is older than this one @@ -72,7 +72,7 @@ struct PCache { sqlite3_pcache_page *pLower; PgHdr *pPg; unsigned char *a; - + if( sqlite3PcacheTrace<2 ) return; if( pCache->pCache==0 ) return; N = sqlite3PcachePagecount(pCache); @@ -164,12 +164,12 @@ static void pcacheManageDirtyList(PgHdr *pPage, u8 addRemove){ if( addRemove & PCACHE_DIRTYLIST_REMOVE ){ assert( pPage->pDirtyNext || pPage==p->pDirtyTail ); assert( pPage->pDirtyPrev || pPage==p->pDirty ); - + /* Update the PCache1.pSynced variable if necessary. */ if( p->pSynced==pPage ){ p->pSynced = pPage->pDirtyPrev; } - + if( pPage->pDirtyNext ){ pPage->pDirtyNext->pDirtyPrev = pPage->pDirtyPrev; }else{ @@ -179,7 +179,7 @@ static void pcacheManageDirtyList(PgHdr *pPage, u8 addRemove){ if( pPage->pDirtyPrev ){ pPage->pDirtyPrev->pDirtyNext = pPage->pDirtyNext; }else{ - /* If there are now no dirty pages in the cache, set eCreate to 2. + /* If there are now no dirty pages in the cache, set eCreate to 2. ** This is an optimization that allows sqlite3PcacheFetch() to skip ** searching for a dirty page to eject from the cache when it might ** otherwise have to. */ @@ -196,7 +196,7 @@ static void pcacheManageDirtyList(PgHdr *pPage, u8 addRemove){ } if( addRemove & PCACHE_DIRTYLIST_ADD ){ assert( pPage->pDirtyNext==0 && pPage->pDirtyPrev==0 && p->pDirty!=pPage ); - + pPage->pDirtyNext = p->pDirty; if( pPage->pDirtyNext ){ assert( pPage->pDirtyNext->pDirtyPrev==0 ); @@ -211,11 +211,11 @@ static void pcacheManageDirtyList(PgHdr *pPage, u8 addRemove){ p->pDirty = pPage; /* If pSynced is NULL and this page has a clear NEED_SYNC flag, set - ** pSynced to point to it. Checking the NEED_SYNC flag is an + ** pSynced to point to it. Checking the NEED_SYNC flag is an ** optimization, as if pSynced points to a page with the NEED_SYNC - ** flag set sqlite3PcacheFetchStress() searches through all newer + ** flag set sqlite3PcacheFetchStress() searches through all newer ** entries of the dirty-list for a page with NEED_SYNC clear anyway. */ - if( !p->pSynced + if( !p->pSynced && 0==(pPage->flags&PGHDR_NEED_SYNC) /*OPTIMIZATION-IF-FALSE*/ ){ p->pSynced = pPage; @@ -255,7 +255,7 @@ static int numberOfCachePages(PCache *p){ /*************************************************** General Interfaces ****** ** -** Initialize and shutdown the page cache subsystem. Neither of these +** Initialize and shutdown the page cache subsystem. Neither of these ** functions are threadsafe. */ int sqlite3PcacheInitialize(void){ @@ -281,8 +281,8 @@ int sqlite3PcacheSize(void){ return sizeof(PCache); } /* ** Create a new PCache object. Storage space to hold the object -** has already been allocated and is passed in as the p pointer. -** The caller discovers how much space needs to be allocated by +** has already been allocated and is passed in as the p pointer. +** The caller discovers how much space needs to be allocated by ** calling sqlite3PcacheSize(). ** ** szExtra is some extra space allocated for each page. The first @@ -394,7 +394,7 @@ sqlite3_pcache_page *sqlite3PcacheFetch( /* ** If the sqlite3PcacheFetch() routine is unable to allocate a new ** page because no clean pages are available for reuse and the cache -** size limit has been reached, then this routine can be invoked to +** size limit has been reached, then this routine can be invoked to ** try harder to allocate a page. This routine might invoke the stress ** callback to spill dirty pages to the journal. It will then try to ** allocate the new page and will only fail to allocate a new page on @@ -411,17 +411,17 @@ int sqlite3PcacheFetchStress( if( pCache->eCreate==2 ) return 0; if( sqlite3PcachePagecount(pCache)>pCache->szSpill ){ - /* Find a dirty page to write-out and recycle. First try to find a + /* Find a dirty page to write-out and recycle. First try to find a ** page that does not require a journal-sync (one with PGHDR_NEED_SYNC - ** cleared), but if that is not possible settle for any other + ** cleared), but if that is not possible settle for any other ** unreferenced dirty page. ** ** If the LRU page in the dirty list that has a clear PGHDR_NEED_SYNC ** flag is currently referenced, then the following may leave pSynced ** set incorrectly (pointing to other than the LRU page with NEED_SYNC ** cleared). This is Ok, as pSynced is just an optimization. */ - for(pPg=pCache->pSynced; - pPg && (pPg->nRef || (pPg->flags&PGHDR_NEED_SYNC)); + for(pPg=pCache->pSynced; + pPg && (pPg->nRef || (pPg->flags&PGHDR_NEED_SYNC)); pPg=pPg->pDirtyPrev ); pCache->pSynced = pPg; @@ -431,7 +431,7 @@ int sqlite3PcacheFetchStress( if( pPg ){ int rc; #ifdef SQLITE_LOG_CACHE_SPILL - sqlite3_log(SQLITE_FULL, + sqlite3_log(SQLITE_FULL, "spill page %d making room for %d - cache used: %d/%d", pPg->pgno, pgno, sqlite3GlobalConfig.pcache.xPagecount(pCache->pCache), @@ -621,7 +621,7 @@ void sqlite3PcacheClearSyncFlags(PCache *pCache){ } /* -** Change the page number of page p to newPgno. +** Change the page number of page p to newPgno. */ void sqlite3PcacheMove(PgHdr *p, Pgno newPgno){ PCache *pCache = p->pCache; @@ -684,7 +684,7 @@ void sqlite3PcacheClose(PCache *pCache){ sqlite3GlobalConfig.pcache2.xDestroy(pCache->pCache); } -/* +/* ** Discard the contents of the cache. */ void sqlite3PcacheClear(PCache *pCache){ @@ -775,7 +775,7 @@ PgHdr *sqlite3PcacheDirtyList(PCache *pCache){ return pcacheSortDirtyList(pCache->pDirty); } -/* +/* ** Return the total number of references to all pages held by the cache. ** ** This is not the total number of pages referenced, but the sum of the @@ -792,7 +792,7 @@ int sqlite3PcachePageRefcount(PgHdr *p){ return p->nRef; } -/* +/* ** Return the total number of pages in the cache. */ int sqlite3PcachePagecount(PCache *pCache){ @@ -834,7 +834,7 @@ int sqlite3PcacheSetSpillsize(PCache *p, int mxPage){ p->szSpill = mxPage; } res = numberOfCachePages(p); - if( resszSpill ) res = p->szSpill; + if( resszSpill ) res = p->szSpill; return res; } diff --git a/third_party/sqlite/src/src/pcache.h b/third_party/sqlite/src/src/pcache.h index 9012edf22e8c8..7c40113ecd0d5 100644 --- a/third_party/sqlite/src/src/pcache.h +++ b/third_party/sqlite/src/src/pcache.h @@ -10,7 +10,7 @@ ** ************************************************************************* ** This header file defines the interface that the sqlite page cache -** subsystem. +** subsystem. */ #ifndef _PCACHE_H_ @@ -87,7 +87,7 @@ int sqlite3PcacheSetPageSize(PCache *, int); int sqlite3PcacheSize(void); /* One release per successful fetch. Page is pinned until released. -** Reference counted. +** Reference counted. */ sqlite3_pcache_page *sqlite3PcacheFetch(PCache*, Pgno, int createFlag); int sqlite3PcacheFetchStress(PCache*, Pgno, sqlite3_pcache_page**); @@ -131,7 +131,7 @@ int sqlite3PcachePagecount(PCache*); #if defined(SQLITE_CHECK_PAGES) || defined(SQLITE_DEBUG) /* Iterate through all dirty pages currently stored in the cache. This -** interface is only available if SQLITE_CHECK_PAGES is defined when the +** interface is only available if SQLITE_CHECK_PAGES is defined when the ** library is built. */ void sqlite3PcacheIterateDirty(PCache *pCache, void (*xIter)(PgHdr *)); diff --git a/third_party/sqlite/src/src/pcache1.c b/third_party/sqlite/src/src/pcache1.c index 3b938ce7b2f8a..1bce2fa450b90 100644 --- a/third_party/sqlite/src/src/pcache1.c +++ b/third_party/sqlite/src/src/pcache1.c @@ -63,7 +63,7 @@ ** ** The third case is a chunk of heap memory (defaulting to 100 pages worth) ** that is allocated when the page cache is created. The size of the local -** bulk allocation can be adjusted using +** bulk allocation can be adjusted using ** ** sqlite3_config(SQLITE_CONFIG_PAGECACHE, (void*)0, 0, N). ** @@ -88,9 +88,9 @@ typedef struct PgFreeslot PgFreeslot; typedef struct PGroup PGroup; /* -** Each cache entry is represented by an instance of the following +** Each cache entry is represented by an instance of the following ** structure. Unless SQLITE_PCACHE_SEPARATE_HEADER is defined, a buffer of -** PgHdr1.pCache->szPage bytes is allocated directly before this structure +** PgHdr1.pCache->szPage bytes is allocated directly before this structure ** in memory. */ struct PgHdr1 { @@ -105,7 +105,7 @@ struct PgHdr1 { PgHdr1 *pLruPrev; /* Previous in LRU list of unpinned pages */ }; -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set +/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set ** of one or more PCaches that are able to recycle each other's unpinned ** pages when they are under memory pressure. A PGroup is an instance of ** the following object. @@ -141,12 +141,12 @@ struct PGroup { ** temporary or transient database) has a single page cache which ** is an instance of this object. ** -** Pointers to structures of this type are cast and returned as +** Pointers to structures of this type are cast and returned as ** opaque sqlite3_pcache* handles. */ struct PCache1 { /* Cache configuration parameters. Page size (szPage) and the purgeable - ** flag (bPurgeable) are set when the cache is created. nMax may be + ** flag (bPurgeable) are set when the cache is created. nMax may be ** modified at any time by a call to the pcache1Cachesize() method. ** The PGroup mutex must be held when accessing nMax. */ @@ -192,7 +192,7 @@ static SQLITE_WSD struct PCacheGlobal { */ int isInit; /* True if initialized */ int separateCache; /* Use a new PGroup for each PCache */ - int nInitPage; /* Initial bulk allocation size */ + int nInitPage; /* Initial bulk allocation size */ int szSlot; /* Size of each free slot */ int nSlot; /* The number of pcache slots */ int nReserve; /* Try to keep nFreeSlot above this */ @@ -233,7 +233,7 @@ static SQLITE_WSD struct PCacheGlobal { /* -** This function is called during initialization if a static buffer is +** This function is called during initialization if a static buffer is ** supplied to use for the page-cache by passing the SQLITE_CONFIG_PAGECACHE ** verb to sqlite3_config(). Parameter pBuf points to an allocation large ** enough to contain 'n' buffers of 'sz' bytes each. @@ -302,8 +302,8 @@ static int pcache1InitBulk(PCache1 *pCache){ /* ** Malloc function used within this file to allocate space from the buffer -** configured using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no -** such buffer exists or there is no space left in it, this function falls +** configured using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no +** such buffer exists or there is no space left in it, this function falls ** back to sqlite3Malloc(). ** ** Multiple threads can run this routine at the same time. Global variables @@ -409,7 +409,7 @@ static PgHdr1 *pcache1AllocPage(PCache1 *pCache, int benignMalloc){ }else{ #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT /* The group mutex must be released before pcache1Alloc() is called. This - ** is because it might call sqlite3_release_memory(), which assumes that + ** is because it might call sqlite3_release_memory(), which assumes that ** this mutex is not held. */ assert( pcache1.separateCache==0 ); assert( pCache->pGroup==&pcache1.grp ); @@ -551,7 +551,7 @@ static void pcache1ResizeHash(PCache1 *p){ } /* -** This function is used internally to remove the page pPage from the +** This function is used internally to remove the page pPage from the ** PGroup LRU list, if is part of it. If pPage is not part of the PGroup ** LRU list, then this function is a no-op. ** @@ -579,7 +579,7 @@ static PgHdr1 *pcache1PinPage(PgHdr1 *pPage){ /* -** Remove the page supplied as an argument from the hash table +** Remove the page supplied as an argument from the hash table ** (PCache1.apHash structure) that it is currently stored in. ** Also free the page if freePage is true. ** @@ -622,8 +622,8 @@ static void pcache1EnforceMaxPage(PCache1 *pCache){ } /* -** Discard all pages from cache pCache with a page number (key value) -** greater than or equal to iLimit. Any pinned pages that meet this +** Discard all pages from cache pCache with a page number (key value) +** greater than or equal to iLimit. Any pinned pages that meet this ** criteria are unpinned before they are discarded. ** ** The PCache mutex must be held when this function is called. @@ -655,7 +655,7 @@ static void pcache1TruncateUnsafe( PgHdr1 **pp; PgHdr1 *pPage; assert( hnHash ); - pp = &pCache->apHash[h]; + pp = &pCache->apHash[h]; while( (pPage = *pp)!=0 ){ if( pPage->iKey>=iLimit ){ pCache->nPage--; @@ -696,7 +696,7 @@ static int pcache1Init(void *NotUsed){ ** ** * Use a unified cache in single-threaded applications that have ** configured a start-time buffer for use as page-cache memory using - ** sqlite3_config(SQLITE_CONFIG_PAGECACHE, pBuf, sz, N) with non-NULL + ** sqlite3_config(SQLITE_CONFIG_PAGECACHE, pBuf, sz, N) with non-NULL ** pBuf argument. ** ** * Otherwise use separate caches (mode-1) @@ -733,7 +733,7 @@ static int pcache1Init(void *NotUsed){ /* ** Implementation of the sqlite3_pcache.xShutdown method. -** Note that the static mutex allocated in xInit does +** Note that the static mutex allocated in xInit does ** not need to be freed. */ static void pcache1Shutdown(void *NotUsed){ @@ -793,7 +793,7 @@ static sqlite3_pcache *pcache1Create(int szPage, int szExtra, int bPurgeable){ } /* -** Implementation of the sqlite3_pcache.xCachesize method. +** Implementation of the sqlite3_pcache.xCachesize method. ** ** Configure the cache_size limit for a cache. */ @@ -812,7 +812,7 @@ static void pcache1Cachesize(sqlite3_pcache *p, int nMax){ } /* -** Implementation of the sqlite3_pcache.xShrink method. +** Implementation of the sqlite3_pcache.xShrink method. ** ** Free up as much memory as possible. */ @@ -831,7 +831,7 @@ static void pcache1Shrink(sqlite3_pcache *p){ } /* -** Implementation of the sqlite3_pcache.xPagecount method. +** Implementation of the sqlite3_pcache.xPagecount method. */ static int pcache1Pagecount(sqlite3_pcache *p){ int n; @@ -852,8 +852,8 @@ static int pcache1Pagecount(sqlite3_pcache *p){ ** for these steps, the main pcache1Fetch() procedure can run faster. */ static SQLITE_NOINLINE PgHdr1 *pcache1FetchStage2( - PCache1 *pCache, - unsigned int iKey, + PCache1 *pCache, + unsigned int iKey, int createFlag ){ unsigned int nPinned; @@ -895,8 +895,8 @@ static SQLITE_NOINLINE PgHdr1 *pcache1FetchStage2( } } - /* Step 5. If a usable page buffer has still not been found, - ** attempt to allocate a new one. + /* Step 5. If a usable page buffer has still not been found, + ** attempt to allocate a new one. */ if( !pPage ){ pPage = pcache1AllocPage(pCache, createFlag==1); @@ -921,13 +921,13 @@ static SQLITE_NOINLINE PgHdr1 *pcache1FetchStage2( } /* -** Implementation of the sqlite3_pcache.xFetch method. +** Implementation of the sqlite3_pcache.xFetch method. ** ** Fetch a page by key value. ** ** Whether or not a new page may be allocated by this function depends on ** the value of the createFlag argument. 0 means do not allocate a new -** page. 1 means allocate a new page if space is easily available. 2 +** page. 1 means allocate a new page if space is easily available. 2 ** means to try really hard to allocate a new page. ** ** For a non-purgeable cache (a cache used as the storage for an in-memory @@ -938,7 +938,7 @@ static SQLITE_NOINLINE PgHdr1 *pcache1FetchStage2( ** There are three different approaches to obtaining space for a page, ** depending on the value of parameter createFlag (which may be 0, 1 or 2). ** -** 1. Regardless of the value of createFlag, the cache is searched for a +** 1. Regardless of the value of createFlag, the cache is searched for a ** copy of the requested page. If one is found, it is returned. ** ** 2. If createFlag==0 and the page is not already in the cache, NULL is @@ -952,13 +952,13 @@ static SQLITE_NOINLINE PgHdr1 *pcache1FetchStage2( ** PCache1.nMax, or ** ** (b) the number of pages pinned by the cache is greater than -** the sum of nMax for all purgeable caches, less the sum of +** the sum of nMax for all purgeable caches, less the sum of ** nMin for all other purgeable caches, or ** ** 4. If none of the first three conditions apply and the cache is marked ** as purgeable, and if one of the following is true: ** -** (a) The number of pages allocated for the cache is already +** (a) The number of pages allocated for the cache is already ** PCache1.nMax, or ** ** (b) The number of pages allocated for all purgeable caches is @@ -970,7 +970,7 @@ static SQLITE_NOINLINE PgHdr1 *pcache1FetchStage2( ** ** then attempt to recycle a page from the LRU list. If it is the right ** size, return the recycled buffer. Otherwise, free the buffer and -** proceed to step 5. +** proceed to step 5. ** ** 5. Otherwise, allocate and return a new page buffer. ** @@ -980,8 +980,8 @@ static SQLITE_NOINLINE PgHdr1 *pcache1FetchStage2( ** invokes the appropriate routine. */ static PgHdr1 *pcache1FetchNoMutex( - sqlite3_pcache *p, - unsigned int iKey, + sqlite3_pcache *p, + unsigned int iKey, int createFlag ){ PCache1 *pCache = (PCache1 *)p; @@ -1010,8 +1010,8 @@ static PgHdr1 *pcache1FetchNoMutex( } #if PCACHE1_MIGHT_USE_GROUP_MUTEX static PgHdr1 *pcache1FetchWithMutex( - sqlite3_pcache *p, - unsigned int iKey, + sqlite3_pcache *p, + unsigned int iKey, int createFlag ){ PCache1 *pCache = (PCache1 *)p; @@ -1025,8 +1025,8 @@ static PgHdr1 *pcache1FetchWithMutex( } #endif static sqlite3_pcache_page *pcache1Fetch( - sqlite3_pcache *p, - unsigned int iKey, + sqlite3_pcache *p, + unsigned int iKey, int createFlag ){ #if PCACHE1_MIGHT_USE_GROUP_MUTEX || defined(SQLITE_DEBUG) @@ -1056,18 +1056,18 @@ static sqlite3_pcache_page *pcache1Fetch( ** Mark a page as unpinned (eligible for asynchronous recycling). */ static void pcache1Unpin( - sqlite3_pcache *p, - sqlite3_pcache_page *pPg, + sqlite3_pcache *p, + sqlite3_pcache_page *pPg, int reuseUnlikely ){ PCache1 *pCache = (PCache1 *)p; PgHdr1 *pPage = (PgHdr1 *)pPg; PGroup *pGroup = pCache->pGroup; - + assert( pPage->pCache==pCache ); pcache1EnterMutex(pGroup); - /* It is an error to call this function if the page is already + /* It is an error to call this function if the page is already ** part of the PGroup LRU list. */ assert( pPage->pLruPrev==0 && pPage->pLruNext==0 ); @@ -1089,7 +1089,7 @@ static void pcache1Unpin( } /* -** Implementation of the sqlite3_pcache.xRekey method. +** Implementation of the sqlite3_pcache.xRekey method. */ static void pcache1Rekey( sqlite3_pcache *p, @@ -1100,7 +1100,7 @@ static void pcache1Rekey( PCache1 *pCache = (PCache1 *)p; PgHdr1 *pPage = (PgHdr1 *)pPg; PgHdr1 **pp; - unsigned int h; + unsigned int h; assert( pPage->iKey==iOld ); assert( pPage->pCache==pCache ); @@ -1125,7 +1125,7 @@ static void pcache1Rekey( } /* -** Implementation of the sqlite3_pcache.xTruncate method. +** Implementation of the sqlite3_pcache.xTruncate method. ** ** Discard all unpinned pages in the cache with a page number equal to ** or greater than parameter iLimit. Any pinned pages with a page number @@ -1142,7 +1142,7 @@ static void pcache1Truncate(sqlite3_pcache *p, unsigned int iLimit){ } /* -** Implementation of the sqlite3_pcache.xDestroy method. +** Implementation of the sqlite3_pcache.xDestroy method. ** ** Destroy a cache allocated using pcache1Create(). */ @@ -1208,7 +1208,7 @@ sqlite3_mutex *sqlite3Pcache1Mutex(void){ ** by the current thread may be sqlite3_free()ed. ** ** nReq is the number of bytes of memory required. Once this much has -** been released, the function returns. The return value is the total number +** been released, the function returns. The return value is the total number ** of bytes of memory released. */ int sqlite3PcacheReleaseMemory(int nReq){ diff --git a/third_party/sqlite/src/src/pragma.c b/third_party/sqlite/src/src/pragma.c index 1d5ebfca098d3..c701dcd2df4b3 100644 --- a/third_party/sqlite/src/src/pragma.c +++ b/third_party/sqlite/src/src/pragma.c @@ -26,13 +26,13 @@ ** that includes the PragType_XXXX macro definitions and the aPragmaName[] ** object. This ensures that the aPragmaName[] table is arranged in ** lexicographical order to facility a binary search of the pragma name. -** Do not edit pragma.h directly. Edit and rerun the script in at +** Do not edit pragma.h directly. Edit and rerun the script in at ** ../tool/mkpragmatab.tcl. */ #include "pragma.h" /* ** Interpret the given string as a safety level. Return 0 for OFF, -** 1 for ON or NORMAL, 2 for FULL, and 3 for EXTRA. Return 1 for an empty or +** 1 for ON or NORMAL, 2 for FULL, and 3 for EXTRA. Return 1 for an empty or ** unrecognized string argument. The FULL and EXTRA option is disallowed ** if the omitFull parameter it 1. ** @@ -91,7 +91,7 @@ static int getLockingMode(const char *z){ /* ** Interpret the given string as an auto-vacuum mode value. ** -** The following strings, "none", "full" and "incremental" are +** The following strings, "none", "full" and "incremental" are ** acceptable, as are their numeric equivalents: 0, 1 and 2 respectively. */ static int getAutoVacuum(const char *z){ @@ -243,7 +243,7 @@ static const char *actionName(u8 action){ case OE_SetDflt: zName = "SET DEFAULT"; break; case OE_Cascade: zName = "CASCADE"; break; case OE_Restrict: zName = "RESTRICT"; break; - default: zName = "NO ACTION"; + default: zName = "NO ACTION"; assert( action==OE_None ); break; } return zName; @@ -296,7 +296,7 @@ static const PragmaName *pragmaLocate(const char *zName){ } /* -** Process a pragma statement. +** Process a pragma statement. ** ** Pragmas are of this form: ** @@ -311,7 +311,7 @@ static const PragmaName *pragmaLocate(const char *zName){ ** id and pId2 is any empty string. */ void sqlite3Pragma( - Parse *pParse, + Parse *pParse, Token *pId1, /* First part of [schema.]id field */ Token *pId2, /* Second part of [schema.]id field, or NULL */ Token *pValue, /* Token for , or NULL */ @@ -339,8 +339,8 @@ void sqlite3Pragma( if( iDb<0 ) return; pDb = &db->aDb[iDb]; - /* If the temp database has been explicitly named as part of the - ** pragma, make sure it is open. + /* If the temp database has been explicitly named as part of the + ** pragma, make sure it is open. */ if( iDb==1 && sqlite3OpenTempDatabase(pParse) ){ return; @@ -408,7 +408,7 @@ void sqlite3Pragma( } /* Register the result column names for pragmas that return results */ - if( (pPragma->mPragFlg & PragFlg_NoColumns)==0 + if( (pPragma->mPragFlg & PragFlg_NoColumns)==0 && ((pPragma->mPragFlg & PragFlg_NoColumns1)==0 || zRight==0) ){ setPragmaResultColumnNames(v, pPragma); @@ -416,7 +416,7 @@ void sqlite3Pragma( /* Jump to the appropriate pragma handler */ switch( pPragma->ePragTyp ){ - + #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED) /* ** PRAGMA [schema.]default_cache_size @@ -528,7 +528,7 @@ void sqlite3Pragma( ** PRAGMA [schema.]max_page_count=N ** ** The first form reports the current setting for the - ** maximum number of pages in the database file. The + ** maximum number of pages in the database file. The ** second form attempts to change this setting. Both ** forms return the current setting. ** @@ -547,7 +547,7 @@ void sqlite3Pragma( if( sqlite3Tolower(zLeft[0])=='p' ){ sqlite3VdbeAddOp2(v, OP_Pagecount, iDb, iReg); }else{ - sqlite3VdbeAddOp3(v, OP_MaxPgcnt, iDb, iReg, + sqlite3VdbeAddOp3(v, OP_MaxPgcnt, iDb, iReg, sqlite3AbsInt32(sqlite3Atoi(zRight))); } sqlite3VdbeAddOp2(v, OP_ResultRow, iReg, 1); @@ -684,7 +684,7 @@ void sqlite3Pragma( */ rc = sqlite3BtreeSetAutoVacuum(pBt, eAuto); if( rc==SQLITE_OK && (eAuto==1 || eAuto==2) ){ - /* When setting the auto_vacuum mode to either "full" or + /* When setting the auto_vacuum mode to either "full" or ** "incremental", write the value of meta[6] in the database ** file. Before writing to meta[6], check that meta[3] indicates ** that this really is an auto-vacuum capable database. @@ -807,7 +807,7 @@ void sqlite3Pragma( assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); if( !zRight ){ returnSingleInt(v, - (db->flags & SQLITE_CacheSpill)==0 ? 0 : + (db->flags & SQLITE_CacheSpill)==0 ? 0 : sqlite3BtreeSetSpillSize(pDb->pBt,0)); }else{ int size = 1; @@ -981,7 +981,7 @@ void sqlite3Pragma( Pager *pPager = sqlite3BtreePager(pDb->pBt); char *proxy_file_path = NULL; sqlite3_file *pFile = sqlite3PagerFile(pPager); - sqlite3OsFileControlHint(pFile, SQLITE_GET_LOCKPROXYFILE, + sqlite3OsFileControlHint(pFile, SQLITE_GET_LOCKPROXYFILE, &proxy_file_path); returnSingleText(v, proxy_file_path); }else{ @@ -989,10 +989,10 @@ void sqlite3Pragma( sqlite3_file *pFile = sqlite3PagerFile(pPager); int res; if( zRight[0] ){ - res=sqlite3OsFileControl(pFile, SQLITE_SET_LOCKPROXYFILE, + res=sqlite3OsFileControl(pFile, SQLITE_SET_LOCKPROXYFILE, zRight); } else { - res=sqlite3OsFileControl(pFile, SQLITE_SET_LOCKPROXYFILE, + res=sqlite3OsFileControl(pFile, SQLITE_SET_LOCKPROXYFILE, NULL); } if( res!=SQLITE_OK ){ @@ -1002,8 +1002,8 @@ void sqlite3Pragma( } break; } -#endif /* SQLITE_ENABLE_LOCKING_STYLE */ - +#endif /* SQLITE_ENABLE_LOCKING_STYLE */ + /* ** PRAGMA [schema.]synchronous ** PRAGMA [schema.]synchronous=OFF|ON|NORMAL|FULL|EXTRA @@ -1018,7 +1018,7 @@ void sqlite3Pragma( returnSingleInt(v, pDb->safety_level-1); }else{ if( !db->autoCommit ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "Safety level may not be changed inside a transaction"); }else{ int iLevel = (getSafetyLevel(zRight,0,1)+1) & PAGER_SYNCHRONOUS_MASK; @@ -1058,7 +1058,7 @@ void sqlite3Pragma( if( mask==SQLITE_DeferFKs ) db->nDeferredImmCons = 0; } - /* Many of the flag-pragmas modify the code generated by the SQL + /* Many of the flag-pragmas modify the code generated by the SQL ** compiler (eg. count_changes). So add an opcode to expire all ** compiled SQL statements after modifying a pragma value. */ @@ -1236,7 +1236,7 @@ void sqlite3Pragma( if( pTab ){ pFK = pTab->pFKey; if( pFK ){ - int i = 0; + int i = 0; pParse->nMem = 8; sqlite3CodeVerifySchema(pParse, iDb); while(pFK){ @@ -1398,7 +1398,7 @@ void sqlite3Pragma( #endif #ifndef SQLITE_OMIT_INTEGRITY_CHECK - /* Pragma "quick_check" is reduced version of + /* Pragma "quick_check" is reduced version of ** integrity_check designed to detect most database corruption ** without most of the overhead of a full integrity-check. */ @@ -1606,7 +1606,7 @@ void sqlite3Pragma( sqlite3VdbeAddOp2(v, OP_ResultRow, 7, 1); } #endif /* SQLITE_OMIT_BTREECOUNT */ - } + } } { static const int iLn = VDBE_OFFSET_LINENO(2); @@ -1642,7 +1642,7 @@ void sqlite3Pragma( ** encoding that will be used for the main database file if a new file ** is created. If an existing main database file is opened, then the ** default text encoding for the existing database is used. - ** + ** ** In all cases new databases created using the ATTACH command are ** created to use the same default text encoding as the main database. If ** the main database has not been initialized and/or created when ATTACH @@ -1680,9 +1680,9 @@ void sqlite3Pragma( ** will be overwritten when the schema is next loaded. If it does not ** already exists, it will be created to use the new encoding value. */ - if( - !(DbHasProperty(db, 0, DB_SchemaLoaded)) || - DbHasProperty(db, 0, DB_Empty) + if( + !(DbHasProperty(db, 0, DB_SchemaLoaded)) || + DbHasProperty(db, 0, DB_Empty) ){ for(pEnc=&encnames[0]; pEnc->zName; pEnc++){ if( 0==sqlite3StrICmp(zRight, pEnc->zName) ){ @@ -1826,8 +1826,8 @@ void sqlite3Pragma( if( zRight ){ sqlite3_wal_autocheckpoint(db, sqlite3Atoi(zRight)); } - returnSingleInt(v, - db->xWalCallback==sqlite3WalDefaultHook ? + returnSingleInt(v, + db->xWalCallback==sqlite3WalDefaultHook ? SQLITE_PTR_TO_INT(db->pWalArg) : 0); } break; @@ -1920,7 +1920,7 @@ void sqlite3Pragma( pBt = db->aDb[i].pBt; if( pBt==0 || sqlite3BtreePager(pBt)==0 ){ zState = "closed"; - }else if( sqlite3_file_control(db, i ? db->aDb[i].zDbSName : 0, + }else if( sqlite3_file_control(db, i ? db->aDb[i].zDbSName : 0, SQLITE_FCNTL_LOCKSTATE, &j)==SQLITE_OK ){ zState = azLockName[j]; } @@ -1979,7 +1979,7 @@ void sqlite3Pragma( /* The following block is a no-op unless SQLITE_DEBUG is defined. Its only ** purpose is to execute assert() statements to verify that if the ** PragFlg_NoColumns1 flag is set and the caller specified an argument - ** to the PRAGMA, the implementation has not added any OP_ResultRow + ** to the PRAGMA, the implementation has not added any OP_ResultRow ** instructions to the VM. */ if( (pPragma->mPragFlg & PragFlg_NoColumns1) && zRight ){ sqlite3VdbeVerifyNoResultRow(v); @@ -2010,7 +2010,7 @@ struct PragmaVtabCursor { char *azArg[2]; /* Value of the argument and schema */ }; -/* +/* ** Pragma virtual table module xConnect method. */ static int pragmaVtabConnect( @@ -2073,7 +2073,7 @@ static int pragmaVtabConnect( return rc; } -/* +/* ** Pragma virtual table module xDisconnect method. */ static int pragmaVtabDisconnect(sqlite3_vtab *pVtab){ @@ -2171,11 +2171,11 @@ static int pragmaVtabNext(sqlite3_vtab_cursor *pVtabCursor){ return rc; } -/* +/* ** Pragma virtual table module xFilter method. */ static int pragmaVtabFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -2226,11 +2226,11 @@ static int pragmaVtabEof(sqlite3_vtab_cursor *pVtabCursor){ } /* The xColumn method simply returns the corresponding column from -** the PRAGMA. +** the PRAGMA. */ static int pragmaVtabColumn( - sqlite3_vtab_cursor *pVtabCursor, - sqlite3_context *ctx, + sqlite3_vtab_cursor *pVtabCursor, + sqlite3_context *ctx, int i ){ PragmaVtabCursor *pCsr = (PragmaVtabCursor*)pVtabCursor; @@ -2243,7 +2243,7 @@ static int pragmaVtabColumn( return SQLITE_OK; } -/* +/* ** Pragma virtual table module xRowid method. */ static int pragmaVtabRowid(sqlite3_vtab_cursor *pVtabCursor, sqlite_int64 *p){ diff --git a/third_party/sqlite/src/src/pragma.h b/third_party/sqlite/src/src/pragma.h index e47f80fefac44..46d952881a166 100644 --- a/third_party/sqlite/src/src/pragma.h +++ b/third_party/sqlite/src/src/pragma.h @@ -67,52 +67,52 @@ static const char *const pragCName[] = { /* 0 */ "cache_size", /* Used by: default_cache_size */ /* 1 */ "cid", /* Used by: table_info */ - /* 2 */ "name", - /* 3 */ "type", - /* 4 */ "notnull", - /* 5 */ "dflt_value", - /* 6 */ "pk", + /* 2 */ "name", + /* 3 */ "type", + /* 4 */ "notnull", + /* 5 */ "dflt_value", + /* 6 */ "pk", /* 7 */ "table", /* Used by: stats */ - /* 8 */ "index", - /* 9 */ "width", - /* 10 */ "height", + /* 8 */ "index", + /* 9 */ "width", + /* 10 */ "height", /* 11 */ "seqno", /* Used by: index_info */ - /* 12 */ "cid", - /* 13 */ "name", + /* 12 */ "cid", + /* 13 */ "name", /* 14 */ "seqno", /* Used by: index_xinfo */ - /* 15 */ "cid", - /* 16 */ "name", - /* 17 */ "desc", - /* 18 */ "coll", - /* 19 */ "key", + /* 15 */ "cid", + /* 16 */ "name", + /* 17 */ "desc", + /* 18 */ "coll", + /* 19 */ "key", /* 20 */ "seq", /* Used by: index_list */ - /* 21 */ "name", - /* 22 */ "unique", - /* 23 */ "origin", - /* 24 */ "partial", + /* 21 */ "name", + /* 22 */ "unique", + /* 23 */ "origin", + /* 24 */ "partial", /* 25 */ "seq", /* Used by: database_list */ - /* 26 */ "name", - /* 27 */ "file", + /* 26 */ "name", + /* 27 */ "file", /* 28 */ "seq", /* Used by: collation_list */ - /* 29 */ "name", + /* 29 */ "name", /* 30 */ "id", /* Used by: foreign_key_list */ - /* 31 */ "seq", - /* 32 */ "table", - /* 33 */ "from", - /* 34 */ "to", - /* 35 */ "on_update", - /* 36 */ "on_delete", - /* 37 */ "match", + /* 31 */ "seq", + /* 32 */ "table", + /* 33 */ "from", + /* 34 */ "to", + /* 35 */ "on_update", + /* 36 */ "on_delete", + /* 37 */ "match", /* 38 */ "table", /* Used by: foreign_key_check */ - /* 39 */ "rowid", - /* 40 */ "parent", - /* 41 */ "fkid", + /* 39 */ "rowid", + /* 40 */ "parent", + /* 41 */ "fkid", /* 42 */ "busy", /* Used by: wal_checkpoint */ - /* 43 */ "log", + /* 43 */ "log", /* 44 */ "checkpointed", /* 45 */ "timeout", /* Used by: busy_timeout */ /* 46 */ "database", /* Used by: lock_status */ - /* 47 */ "status", + /* 47 */ "status", }; /* Definitions of all built-in pragmas */ diff --git a/third_party/sqlite/src/src/prepare.c b/third_party/sqlite/src/src/prepare.c index 74127bc76b424..0af3a93fae92c 100644 --- a/third_party/sqlite/src/src/prepare.c +++ b/third_party/sqlite/src/src/prepare.c @@ -181,7 +181,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){ } /* If there is not already a read-only (or read-write) transaction opened - ** on the b-tree database, open one now. If a transaction is opened, it + ** on the b-tree database, open one now. If a transaction is opened, it ** will be closed before this function returns. */ sqlite3BtreeEnter(pDb->pBt); if( !sqlite3BtreeIsInReadTrans(pDb->pBt) ){ @@ -286,7 +286,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){ assert( db->init.busy ); { char *zSql; - zSql = sqlite3MPrintf(db, + zSql = sqlite3MPrintf(db, "SELECT name, rootpage, sql FROM \"%w\".%s ORDER BY rowid", db->aDb[iDb].zDbSName, zMasterName); #ifndef SQLITE_OMIT_AUTHORIZATION @@ -314,7 +314,7 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){ } if( rc==SQLITE_OK || (db->flags&SQLITE_RecoveryMode)){ /* Black magic: If the SQLITE_RecoveryMode flag is set, then consider - ** the schema loaded, even if errors occurred. In this situation the + ** the schema loaded, even if errors occurred. In this situation the ** current sqlite3_prepare() operation will fail, but the following one ** will attempt to compile the supplied statement against whatever subset ** of the schema was loaded before the error occurred. The primary @@ -355,7 +355,7 @@ error_out: int sqlite3Init(sqlite3 *db, char **pzErrMsg){ int i, rc; int commit_internal = !(db->flags&SQLITE_InternChanges); - + assert( sqlite3_mutex_held(db->mutex) ); assert( sqlite3BtreeHoldsMutex(db->aDb[0].pBt) ); assert( db->init.busy==0 ); @@ -389,7 +389,7 @@ int sqlite3Init(sqlite3 *db, char **pzErrMsg){ sqlite3CommitInternalChanges(db); } - return rc; + return rc; } /* @@ -430,7 +430,7 @@ static void schemaIsValid(Parse *pParse){ if( pBt==0 ) continue; /* If there is not already a read-only (or read-write) transaction opened - ** on the b-tree database, open one now. If a transaction is opened, it + ** on the b-tree database, open one now. If a transaction is opened, it ** will be closed immediately after reading the meta-value. */ if( !sqlite3BtreeIsInReadTrans(pBt) ){ rc = sqlite3BtreeBeginTrans(pBt, 0); @@ -441,7 +441,7 @@ static void schemaIsValid(Parse *pParse){ openedTransaction = 1; } - /* Read the schema cookie from the database. If it does not match the + /* Read the schema cookie from the database. If it does not match the ** value stored as part of the in-memory schema representation, ** set Parse.rc to SQLITE_SCHEMA. */ sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&cookie); @@ -468,13 +468,13 @@ static void schemaIsValid(Parse *pParse){ int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){ int i = -1000000; - /* If pSchema is NULL, then return -1000000. This happens when code in + /* If pSchema is NULL, then return -1000000. This happens when code in ** expr.c is trying to resolve a reference to a transient table (i.e. one - ** created by a sub-select). In this case the return value of this + ** created by a sub-select). In this case the return value of this ** function should never be used. ** ** We return -1000000 instead of the more usual -1 simply because using - ** -1000000 as the incorrect index into db->aDb[] is much + ** -1000000 as the incorrect index into db->aDb[] is much ** more likely to cause a segfault than -1 (of course there are assert() ** statements too, but it never hurts to play the odds). */ @@ -545,8 +545,8 @@ static int sqlite3Prepare( ** This thread is currently holding mutexes on all Btrees (because ** of the sqlite3BtreeEnterAll() in sqlite3LockAndPrepare()) so it ** is not possible for another thread to start a new schema change - ** while this routine is running. Hence, we do not need to hold - ** locks on the schema, we just need to make sure nobody else is + ** while this routine is running. Hence, we do not need to hold + ** locks on the schema, we just need to make sure nobody else is ** holding them. ** ** Note that setting READ_UNCOMMITTED overrides most lock detection, @@ -767,7 +767,7 @@ int sqlite3_prepare_v2( ** Compile the UTF-16 encoded SQL statement zSql into a statement handle. */ static int sqlite3Prepare16( - sqlite3 *db, /* Database handle. */ + sqlite3 *db, /* Database handle. */ const void *zSql, /* UTF-16 encoded SQL statement. */ int nBytes, /* Length of zSql in bytes. */ int saveSqlFlag, /* True to save SQL text into the sqlite3_stmt */ @@ -810,7 +810,7 @@ static int sqlite3Prepare16( int chars_parsed = sqlite3Utf8CharLen(zSql8, (int)(zTail8-zSql8)); *pzTail = (u8 *)zSql + sqlite3Utf16ByteLen(zSql, chars_parsed); } - sqlite3DbFree(db, zSql8); + sqlite3DbFree(db, zSql8); rc = sqlite3ApiExit(db, rc); sqlite3_mutex_leave(db->mutex); return rc; @@ -825,7 +825,7 @@ static int sqlite3Prepare16( ** occurs. */ int sqlite3_prepare16( - sqlite3 *db, /* Database handle. */ + sqlite3 *db, /* Database handle. */ const void *zSql, /* UTF-16 encoded SQL statement. */ int nBytes, /* Length of zSql in bytes. */ sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ @@ -837,7 +837,7 @@ int sqlite3_prepare16( return rc; } int sqlite3_prepare16_v2( - sqlite3 *db, /* Database handle. */ + sqlite3 *db, /* Database handle. */ const void *zSql, /* UTF-16 encoded SQL statement. */ int nBytes, /* Length of zSql in bytes. */ sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ diff --git a/third_party/sqlite/src/src/printf.c b/third_party/sqlite/src/src/printf.c index ede86f12088f4..0a9d0c4c2e2c2 100644 --- a/third_party/sqlite/src/src/printf.c +++ b/third_party/sqlite/src/src/printf.c @@ -1,6 +1,6 @@ /* ** The "printf" code that follows dates from the 1980's. It is in -** the public domain. +** the public domain. ** ************************************************************************** ** @@ -229,7 +229,7 @@ void sqlite3VXPrintf( break; } /* Find out what flags are present */ - flag_leftjustify = flag_plussign = flag_blanksign = + flag_leftjustify = flag_plussign = flag_blanksign = flag_alternateform = flag_altform2 = flag_zeropad = 0; done = 0; do{ @@ -511,7 +511,7 @@ void sqlite3VXPrintf( e2 = exp; } if( MAX(e2,0)+(i64)precision+(i64)width > etBUFSIZE - 15 ){ - bufpt = zExtra + bufpt = zExtra = sqlite3Malloc( MAX(e2,0)+(i64)precision+(i64)width+15 ); if( bufpt==0 ){ setStrAccumError(pAccum, STRACCUM_NOMEM); @@ -962,7 +962,7 @@ char *sqlite3_vmprintf(const char *zFormat, va_list ap){ char zBase[SQLITE_PRINT_BUF_SIZE]; StrAccum acc; -#ifdef SQLITE_ENABLE_API_ARMOR +#ifdef SQLITE_ENABLE_API_ARMOR if( zFormat==0 ){ (void)SQLITE_MISUSE_BKPT; return 0; diff --git a/third_party/sqlite/src/src/resolve.c b/third_party/sqlite/src/src/resolve.c index 7d89b6fec5729..a8a24b5b899fc 100644 --- a/third_party/sqlite/src/src/resolve.c +++ b/third_party/sqlite/src/src/resolve.c @@ -82,7 +82,7 @@ static void resolveAlias( } ExprSetProperty(pDup, EP_Alias); - /* Before calling sqlite3ExprDelete(), set the EP_Static flag. This + /* Before calling sqlite3ExprDelete(), set the EP_Static flag. This ** prevents ExprDelete() from deleting the Expr structure itself, ** allowing it to be repopulated by the memcpy() on the following line. ** The pExpr->u.zToken might point into memory that will be freed by the @@ -149,7 +149,7 @@ int sqlite3MatchSpanName( /* ** Given the name of a column of the form X.Y.Z or Y.Z or just Z, look up -** that name in the set of source tables in pSrcList and make the pExpr +** that name in the set of source tables in pSrcList and make the pExpr ** expression node refer back to that source column. The following changes ** are made to pExpr: ** @@ -268,7 +268,7 @@ static int lookupName( for(j=0, pCol=pTab->aCol; jnCol; j++, pCol++){ if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ /* If there has been exactly one prior match and this match - ** is for the right-hand table of a NATURAL JOIN or is in a + ** is for the right-hand table of a NATURAL JOIN or is in a ** USING clause, then skip this match. */ if( cnt==1 ){ @@ -296,7 +296,7 @@ static int lookupName( } /* if( pSrcList ) */ #ifndef SQLITE_OMIT_TRIGGER - /* If we have not already resolved the name, then maybe + /* If we have not already resolved the name, then maybe ** it is a new.* or old.* trigger argument reference */ if( zDb==0 && zTab!=0 && cntTab==0 && pParse->pTriggerTab!=0 ){ @@ -312,7 +312,7 @@ static int lookupName( pTab = 0; } - if( pTab ){ + if( pTab ){ int iCol; pSchema = pTab->pSchema; cntTab++; @@ -408,7 +408,7 @@ static int lookupName( assert( zTab==0 && zDb==0 ); goto lookupname_end; } - } + } } /* Advance to the next name context. The loop will exit when either @@ -597,7 +597,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ SrcList *pSrcList = pNC->pSrcList; struct SrcList_item *pItem; assert( pSrcList && pSrcList->nSrc==1 ); - pItem = pSrcList->a; + pItem = pSrcList->a; pExpr->op = TK_COLUMN; pExpr->pTab = pItem->pTab; pExpr->iTable = pItem->iCursor; @@ -613,7 +613,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ case TK_ID: { return lookupName(pParse, 0, 0, pExpr->u.zToken, pNC, pExpr); } - + /* A table name and column name: ID.ID ** Or a database, table and column: ID.ID.ID */ @@ -686,7 +686,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ ** to likelihood(X,0.9375). */ /* TUNING: unlikely() probability is 0.0625. likely() is 0.9375 */ pExpr->iTable = pDef->zName[0]=='u' ? 8388608 : 125829120; - } + } } #ifndef SQLITE_OMIT_AUTHORIZATION { @@ -752,7 +752,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ pNC->ncFlags |= NC_AllowAgg; } /* FIX ME: Compute pExpr->affinity based on the expected return - ** type of the function + ** type of the function */ return WRC_Prune; } @@ -812,7 +812,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ testcase( pExpr->op==TK_BETWEEN ); sqlite3ErrorMsg(pParse, "row value misused"); } - break; + break; } } return (pParse->nErr || pParse->db->mallocFailed) ? WRC_Abort : WRC_Continue; @@ -922,7 +922,7 @@ static void resolveOutOfRangeError( int i, /* The index (1-based) of the term out of range */ int mx /* Largest permissible value of i */ ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "%r %s BY term out of range - should be " "between 1 and %d", i, zType, mx); } @@ -1159,7 +1159,7 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ ExprList *pGroupBy; /* The GROUP BY clause */ Select *pLeftmost; /* Left-most of SELECT of a compound */ sqlite3 *db; /* Database connection */ - + assert( p!=0 ); if( p->selFlags & SF_Resolved ){ @@ -1213,7 +1213,7 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ pSub->pOrderBy = p->pOrderBy; p->pOrderBy = 0; } - + /* Recursively resolve names in all subqueries */ for(i=0; ipSrc->nSrc; i++){ @@ -1240,18 +1240,18 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ pItem->fg.isCorrelated = (nRef!=0); } } - + /* Set up the local name-context to pass to sqlite3ResolveExprNames() to ** resolve the result-set expression list. */ sNC.ncFlags = NC_AllowAgg; sNC.pSrcList = p->pSrc; sNC.pNext = pOuterNC; - + /* Resolve names in the result set. */ if( sqlite3ResolveExprListNames(&sNC, p->pEList) ) return WRC_Abort; - - /* If there are no aggregate functions in the result-set, and no GROUP BY + + /* If there are no aggregate functions in the result-set, and no GROUP BY ** expression, do not allow aggregates in any of the other expressions. */ assert( (p->selFlags & SF_Aggregate)==0 ); @@ -1262,14 +1262,14 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ }else{ sNC.ncFlags &= ~NC_AllowAgg; } - + /* If a HAVING clause is present, then there must be a GROUP BY clause. */ if( p->pHaving && !pGroupBy ){ sqlite3ErrorMsg(pParse, "a GROUP BY clause is required before HAVING"); return WRC_Abort; } - + /* Add the output column list to the name-context before parsing the ** other expressions in the SELECT statement. This is so that ** expressions in the WHERE clause (etc.) can refer to expressions by @@ -1286,19 +1286,19 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ for(i=0; ipSrc->nSrc; i++){ struct SrcList_item *pItem = &p->pSrc->a[i]; if( pItem->fg.isTabFunc - && sqlite3ResolveExprListNames(&sNC, pItem->u1.pFuncArg) + && sqlite3ResolveExprListNames(&sNC, pItem->u1.pFuncArg) ){ return WRC_Abort; } } /* The ORDER BY and GROUP BY clauses may not refer to terms in - ** outer queries + ** outer queries */ sNC.pNext = 0; sNC.ncFlags |= NC_AllowAgg; - /* If this is a converted compound query, move the ORDER BY clause from + /* If this is a converted compound query, move the ORDER BY clause from ** the sub-query back to the parent query. At this point each term ** within the ORDER BY clause has been transformed to an integer value. ** These integers will be replaced by copies of the corresponding result @@ -1327,13 +1327,13 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ if( db->mallocFailed ){ return WRC_Abort; } - - /* Resolve the GROUP BY clause. At the same time, make sure + + /* Resolve the GROUP BY clause. At the same time, make sure ** the GROUP BY clause does not contain aggregate functions. */ if( pGroupBy ){ struct ExprList_item *pItem; - + if( resolveOrderGroupBy(&sNC, p, pGroupBy, "GROUP") || db->mallocFailed ){ return WRC_Abort; } @@ -1375,7 +1375,7 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ ** checking on function usage and set a flag if any aggregate functions ** are seen. ** -** To resolve table columns references we look for nodes (or subtrees) of the +** To resolve table columns references we look for nodes (or subtrees) of the ** form X.Y.Z or Y.Z or just Z where ** ** X: The name of a database. Ex: "main" or "temp" or @@ -1407,7 +1407,7 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ ** ** SELECT a+b AS x, c+d AS y FROM t1 ORDER BY a+b; ** -** Function calls are checked to make sure that the function is +** Function calls are checked to make sure that the function is ** defined and that the correct number of arguments are specified. ** If the function is an aggregate function, then the NC_HasAgg flag is ** set and the opcode is changed from TK_FUNCTION to TK_AGG_FUNCTION. @@ -1417,7 +1417,7 @@ static int resolveSelectStep(Walker *pWalker, Select *p){ ** An error message is left in pParse if anything is amiss. The number ** if errors is returned. */ -int sqlite3ResolveExprNames( +int sqlite3ResolveExprNames( NameContext *pNC, /* Namespace to resolve expressions in. */ Expr *pExpr /* The expression to be analyzed. */ ){ @@ -1462,7 +1462,7 @@ int sqlite3ResolveExprNames( ** just like sqlite3ResolveExprNames() except that it works for an expression ** list rather than a single expression. */ -int sqlite3ResolveExprListNames( +int sqlite3ResolveExprListNames( NameContext *pNC, /* Namespace to resolve expressions in. */ ExprList *pList /* The expression list to be analyzed. */ ){ diff --git a/third_party/sqlite/src/src/rowset.c b/third_party/sqlite/src/src/rowset.c index aa81607b9fdc1..a94f3d157f91e 100644 --- a/third_party/sqlite/src/src/rowset.c +++ b/third_party/sqlite/src/src/rowset.c @@ -35,7 +35,7 @@ ** extracts the least value from the RowSet. ** ** The INSERT primitive might allocate additional memory. Memory is -** allocated in chunks so most INSERTs do no allocation. There is an +** allocated in chunks so most INSERTs do no allocation. There is an ** upper bound on the size of allocated memory. No memory is freed ** until DESTROY. ** @@ -83,7 +83,7 @@ ** 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 { +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) */ @@ -131,7 +131,7 @@ struct RowSet { ** ** It must be the case that N is sufficient to make a Rowset. If not ** an assertion fault occurs. -** +** ** If N is larger than the minimum, use the surplus as an initial ** allocation of entries available to be filled. */ @@ -231,7 +231,7 @@ void sqlite3RowSetInsert(RowSet *p, i64 rowid){ /* ** Merge two lists of RowSetEntry objects. Remove duplicates. ** -** The input lists are connected via pRight pointers and are +** The input lists are connected via pRight pointers and are ** assumed to each already be in sorted order. */ static struct RowSetEntry *rowSetEntryMerge( @@ -268,7 +268,7 @@ static struct RowSetEntry *rowSetEntryMerge( /* ** Sort all elements on the list of RowSetEntry objects into order of ** increasing v. -*/ +*/ static struct RowSetEntry *rowSetEntrySort(struct RowSetEntry *pIn){ unsigned int i; struct RowSetEntry *pNext, *aBucket[40]; @@ -341,7 +341,7 @@ static struct RowSetEntry *rowSetNDeepTree( struct RowSetEntry *pLeft; /* Left subtree */ if( *ppList==0 ){ /*OPTIMIZATION-IF-TRUE*/ /* Prevent unnecessary deep recursion when we run out of entries */ - return 0; + return 0; } if( iDepth>1 ){ /*OPTIMIZATION-IF-TRUE*/ /* This branch causes a *balanced* tree to be generated. A valid tree diff --git a/third_party/sqlite/src/src/select.c b/third_party/sqlite/src/src/select.c index d817ebd074f39..851be6858970b 100644 --- a/third_party/sqlite/src/src/select.c +++ b/third_party/sqlite/src/src/select.c @@ -224,7 +224,7 @@ int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){ for(i=0; i<3 && apAll[i]; i++){ p = apAll[i]; for(j=0; jn==aKeyword[j].nChar + if( p->n==aKeyword[j].nChar && sqlite3StrNICmp((char*)p->z, &zKeyText[aKeyword[j].i], p->n)==0 ){ jointype |= aKeyword[j].code; break; @@ -246,9 +246,9 @@ int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){ sqlite3ErrorMsg(pParse, "unknown or unsupported join type: " "%T %T%s%T", pA, pB, zSp, pC); jointype = JT_INNER; - }else if( (jointype & JT_OUTER)!=0 + }else if( (jointype & JT_OUTER)!=0 && (jointype & (JT_LEFT|JT_RIGHT))!=JT_LEFT ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "RIGHT and FULL OUTER JOINs are not currently supported"); jointype = JT_INNER; } @@ -269,7 +269,7 @@ static int columnIndex(Table *pTab, const char *zCol){ /* ** Search the first N tables in pSrc, from left to right, looking for a -** table that has a column named zCol. +** table that has a column named zCol. ** ** When found, set *piTab and *piCol to the table index and column index ** of the matching column and return TRUE. @@ -307,7 +307,7 @@ static int tableAndColumnIndex( ** ** (tab1.col1 = tab2.col2) ** -** where tab1 is the iSrc'th table in SrcList pSrc and tab2 is the +** where tab1 is the iSrc'th table in SrcList pSrc and tab2 is the ** (iSrc+1)'th. Column col1 is column iColLeft of tab1, and col2 is ** column iColRight of tab2. */ @@ -384,7 +384,7 @@ static void setJoinExpr(Expr *p, int iTable){ } setJoinExpr(p->pLeft, iTable); p = p->pRight; - } + } } /* @@ -458,7 +458,7 @@ static int sqliteProcessJoin(Parse *pParse, Select *p){ } /* Create extra terms on the WHERE clause for each column named - ** in the USING clause. Example: If the two tables to be joined are + ** in the USING clause. Example: If the two tables to be joined are ** A and B and the USING clause names X, Y, and Z, then add this ** to the WHERE clause: A.X=B.X AND A.Y=B.Y AND A.Z=B.Z ** Report an error if any column mentioned in the USING clause is @@ -553,7 +553,7 @@ static void pushOntoSorter( pParse->nMem += pSort->nOBSat; nKey = nExpr - pSort->nOBSat + bSeq; if( bSeq ){ - addrFirst = sqlite3VdbeAddOp1(v, OP_IfNot, regBase+nExpr); + addrFirst = sqlite3VdbeAddOp1(v, OP_IfNot, regBase+nExpr); }else{ addrFirst = sqlite3VdbeAddOp1(v, OP_SequenceTest, pSort->iECursor); } @@ -667,7 +667,7 @@ static void codeDistinct( ** ** If srcTab is negative, then the pEList expressions ** are evaluated in order to get the data for this row. If srcTab is -** zero or more, then data is pulled from srcTab and pEList is used only +** zero or more, then data is pulled from srcTab and pEList is used only ** to get the number of columns and the collation sequence for each column. */ static void selectInnerLoop( @@ -745,8 +745,8 @@ static void selectInnerLoop( } if( pSort && hasDistinct==0 && eDest!=SRT_EphemTab && eDest!=SRT_Table ){ /* For each expression in pEList that is a copy of an expression in - ** the ORDER BY clause (pSort->pOrderBy), set the associated - ** iOrderByCol value to one more than the index of the ORDER BY + ** the ORDER BY clause (pSort->pOrderBy), set the associated + ** iOrderByCol value to one more than the index of the ORDER BY ** expression within the sort-key that pushOntoSorter() will generate. ** This allows the pEList field to be omitted from the sorted record, ** saving space and CPU cycles. */ @@ -758,7 +758,7 @@ static void selectInnerLoop( } } regOrig = 0; - assert( eDest==SRT_Set || eDest==SRT_Mem + assert( eDest==SRT_Set || eDest==SRT_Mem || eDest==SRT_Coroutine || eDest==SRT_Output ); } nResultCol = sqlite3ExprCodeExprList(pParse,pEList,regResult,0,ecelFlags); @@ -905,7 +905,7 @@ static void selectInnerLoop( }else{ int r1 = sqlite3GetTempReg(pParse); assert( sqlite3Strlen30(pDest->zAffSdst)==nResultCol ); - sqlite3VdbeAddOp4(v, OP_MakeRecord, regResult, nResultCol, + sqlite3VdbeAddOp4(v, OP_MakeRecord, regResult, nResultCol, r1, pDest->zAffSdst, nResultCol); sqlite3ExprCacheAffinityChange(pParse, regResult, nResultCol); sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iParm, r1, regResult, nResultCol); @@ -923,7 +923,7 @@ static void selectInnerLoop( } /* If this is a scalar select that is part of an expression, then - ** store the results in the appropriate memory cell or array of + ** store the results in the appropriate memory cell or array of ** memory cells and break out of the scan loop. */ case SRT_Mem: { @@ -979,7 +979,7 @@ static void selectInnerLoop( /* If the destination is DistQueue, then cursor (iParm+1) is open ** on a second ephemeral index that holds all values every previously ** added to the queue. */ - addrTest = sqlite3VdbeAddOp4Int(v, OP_Found, iParm+1, 0, + addrTest = sqlite3VdbeAddOp4Int(v, OP_Found, iParm+1, 0, regResult, nResultCol); VdbeCoverage(v); } @@ -1181,7 +1181,7 @@ static void explainTempTable(Parse *pParse, const char *zUsage){ ** where iSub1 and iSub2 are the integers passed as the corresponding ** function parameters, and op is the text representation of the parameter ** of the same name. The parameter "op" must be one of TK_UNION, TK_EXCEPT, -** TK_INTERSECT or TK_ALL. The first form is used if argument bUseTmp is +** TK_INTERSECT or TK_ALL. The first form is used if argument bUseTmp is ** false, or the second form if it is true. */ static void explainComposite( @@ -1307,7 +1307,7 @@ static void generateSortTail( } #endif default: { - assert( eDest==SRT_Output || eDest==SRT_Coroutine ); + assert( eDest==SRT_Output || eDest==SRT_Coroutine ); testcase( eDest==SRT_Output ); testcase( eDest==SRT_Coroutine ); if( eDest==SRT_Output ){ @@ -1350,14 +1350,14 @@ static void generateSortTail( ** original CREATE TABLE statement if the expression is a column. The ** declaration type for a ROWID field is INTEGER. Exactly when an expression ** is considered a column can be complex in the presence of subqueries. The -** result-set expression in all of the following SELECT statements is +** result-set expression in all of the following SELECT statements is ** considered a column by this function. ** ** SELECT col FROM tbl; ** SELECT (SELECT col FROM tbl; ** SELECT (SELECT col FROM tbl); ** SELECT abc FROM (SELECT col AS abc FROM tbl); -** +** ** The declaration type for any expression other than a column is NULL. ** ** This routine has either 3 or 6 parameters depending on whether or not @@ -1369,7 +1369,7 @@ static void generateSortTail( # define columnType(A,B,C,D,E,F) columnTypeImpl(A,B,F) #endif static const char *columnTypeImpl( - NameContext *pNC, + NameContext *pNC, Expr *pExpr, #ifdef SQLITE_ENABLE_COLUMN_METADATA const char **pzOrigDb, @@ -1415,19 +1415,19 @@ static const char *columnTypeImpl( if( pTab==0 ){ /* At one time, code such as "SELECT new.x" within a trigger would ** cause this condition to run. Since then, we have restructured how - ** trigger code is generated and so this condition is no longer + ** trigger code is generated and so this condition is no longer ** possible. However, it can still be true for statements like ** the following: ** ** CREATE TABLE t1(col INTEGER); ** SELECT (SELECT t1.col) FROM FROM t1; ** - ** when columnType() is called on the expression "t1.col" in the + ** when columnType() is called on the expression "t1.col" in the ** sub-select. In this case, set the column type to NULL, even ** though it should really be "INTEGER". ** ** This is not a problem, as the column type of "t1.col" is never - ** used. When columnType() is called on the expression + ** used. When columnType() is called on the expression ** "(SELECT t1.col)", the correct type is returned (see the TK_SELECT ** branch below. */ break; @@ -1441,7 +1441,7 @@ static const char *columnTypeImpl( */ if( iCol>=0 && ALWAYS(iColpEList->nExpr) ){ /* If iCol is less than zero, then the expression requests the - ** rowid of the sub-select or view. This expression is legal (see + ** rowid of the sub-select or view. This expression is legal (see ** test case misc2.2.2) - it always evaluates to NULL. ** ** The ALWAYS() is because iCol>=pS->pEList->nExpr will have been @@ -1452,7 +1452,7 @@ static const char *columnTypeImpl( sNC.pSrcList = pS->pSrc; sNC.pNext = pNC; sNC.pParse = pNC->pParse; - zType = columnType(&sNC, p,&zOrigDb,&zOrigTab,&zOrigCol, &estWidth); + zType = columnType(&sNC, p,&zOrigDb,&zOrigTab,&zOrigCol, &estWidth); } }else if( pTab->pSchema ){ /* A real table */ @@ -1497,13 +1497,13 @@ static const char *columnTypeImpl( sNC.pSrcList = pS->pSrc; sNC.pNext = pNC; sNC.pParse = pNC->pParse; - zType = columnType(&sNC, p, &zOrigDb, &zOrigTab, &zOrigCol, &estWidth); + zType = columnType(&sNC, p, &zOrigDb, &zOrigTab, &zOrigCol, &estWidth); break; } #endif } -#ifdef SQLITE_ENABLE_COLUMN_METADATA +#ifdef SQLITE_ENABLE_COLUMN_METADATA if( pzOrigDb ){ assert( pzOrigTab && pzOrigCol ); *pzOrigDb = zOrigDb; @@ -1539,7 +1539,7 @@ static void generateColumnTypes( const char *zOrigCol = 0; zType = columnType(&sNC, p, &zOrigDb, &zOrigTab, &zOrigCol, 0); - /* The vdbe must make its own copy of the column-type and other + /* The vdbe must make its own copy of the column-type and other ** column specific strings, in case the schema is reset before this ** virtual machine is deleted. */ @@ -1607,7 +1607,7 @@ static void generateColumnNames( zCol = pTab->aCol[iCol].zName; } if( !shortNames && !fullNames ){ - sqlite3VdbeSetColName(v, i, COLNAME_NAME, + sqlite3VdbeSetColName(v, i, COLNAME_NAME, sqlite3DbStrDup(db, pEList->a[i].zSpan), SQLITE_DYNAMIC); }else if( fullNames ){ char *zName = 0; @@ -1731,7 +1731,7 @@ int sqlite3ColumnsFromExprList( /* ** Add type and collation information to a column list based on ** a SELECT statement. -** +** ** The column list presumably came from selectColumnNamesFromExprList(). ** The column list has only names, not types or collations. This ** routine goes through and adds the types and collations. @@ -1844,9 +1844,9 @@ Vdbe *sqlite3GetVdbe(Parse *pParse){ ** Compute the iLimit and iOffset fields of the SELECT based on the ** pLimit and pOffset expressions. pLimit and pOffset hold the expressions ** that appear in the original SQL statement after the LIMIT and OFFSET -** keywords. Or NULL if those keywords are omitted. iLimit and iOffset -** are the integer memory register numbers for counters used to compute -** the limit and offset. If there is no limit and/or offset, then +** keywords. Or NULL if those keywords are omitted. iLimit and iOffset +** are the integer memory register numbers for counters used to compute +** the limit and offset. If there is no limit and/or offset, then ** iLimit and iOffset are negative. ** ** This routine changes the values of iLimit and iOffset only if @@ -1870,7 +1870,7 @@ static void computeLimitRegisters(Parse *pParse, Select *p, int iBreak){ int n; if( p->iLimit ) return; - /* + /* ** "LIMIT -1" always shows all rows. There is some ** controversy about what the correct behavior should be. ** The current implementation interprets "LIMIT 0" to mean @@ -1998,7 +1998,7 @@ static KeyInfo *multiSelectOrderByKeyInfo(Parse *pParse, Select *p, int nExtra){ ** inserted into the Queue table. The iDistinct table keeps a copy of all rows ** that have ever been inserted into Queue and causes duplicates to be ** discarded. If the operator is UNION ALL, then duplicates are allowed. -** +** ** If the query has an ORDER BY, then entries in the Queue table are kept in ** ORDER BY order and the first entry is extracted for each cycle. Without ** an ORDER BY, the Queue table is just a FIFO. @@ -2199,7 +2199,7 @@ static int multiSelectValues( ** ** "p" points to the right-most of the two queries. the query on the ** left is p->pPrior. The left query could also be a compound query -** in which case this routine will be called recursively. +** in which case this routine will be called recursively. ** ** The results of the total query are to be written into a destination ** of type eDest with parameter iParm. @@ -2333,7 +2333,7 @@ static int multiSelect( p->nSelectRow = sqlite3LogEstAdd(p->nSelectRow, pPrior->nSelectRow); if( pPrior->pLimit && sqlite3ExprIsInteger(pPrior->pLimit, &nLimit) - && nLimit>0 && p->nSelectRow > sqlite3LogEst((u64)nLimit) + && nLimit>0 && p->nSelectRow > sqlite3LogEst((u64)nLimit) ){ p->nSelectRow = sqlite3LogEst((u64)nLimit); } @@ -2524,7 +2524,7 @@ static int multiSelect( explainComposite(pParse, p->op, iSub1, iSub2, p->op!=TK_ALL); - /* Compute collating sequences used by + /* Compute collating sequences used by ** temporary tables needed to implement the compound select. ** Attach the KeyInfo structure to all temporary tables. ** @@ -2630,7 +2630,7 @@ static int generateOutputSubroutine( addr = sqlite3VdbeCurrentAddr(v); iContinue = sqlite3VdbeMakeLabel(v); - /* Suppress duplicates for UNION, EXCEPT, and INTERSECT + /* Suppress duplicates for UNION, EXCEPT, and INTERSECT */ if( regPrev ){ int addr1, addr2; @@ -2672,7 +2672,7 @@ static int generateOutputSubroutine( int r1; testcase( pIn->nSdst>1 ); r1 = sqlite3GetTempReg(pParse); - sqlite3VdbeAddOp4(v, OP_MakeRecord, pIn->iSdst, pIn->nSdst, + sqlite3VdbeAddOp4(v, OP_MakeRecord, pIn->iSdst, pIn->nSdst, r1, pDest->zAffSdst, pIn->nSdst); sqlite3ExprCacheAffinityChange(pParse, pIn->iSdst, pIn->nSdst); sqlite3VdbeAddOp4Int(v, OP_IdxInsert, pDest->iSDParm, r1, @@ -2710,7 +2710,7 @@ static int generateOutputSubroutine( ** SRT_Output. This routine is never called with any other ** destination other than the ones handled above or SRT_Output. ** - ** For SRT_Output, results are stored in a sequence of registers. + ** For SRT_Output, results are stored in a sequence of registers. ** Then the OP_ResultRow opcode is used to cause sqlite3_step() to ** return the next row of result. */ @@ -2768,7 +2768,7 @@ static int generateOutputSubroutine( ** ** EofB: Called when data is exhausted from selectB. ** -** The implementation of the latter five subroutines depend on which +** The implementation of the latter five subroutines depend on which ** is used: ** ** @@ -2877,7 +2877,7 @@ static int multiSelectOrderBy( /* Patch up the ORDER BY clause */ - op = p->op; + op = p->op; pPrior = p->pPrior; assert( pPrior->pOrderBy==0 ); pOrderBy = p->pOrderBy; @@ -2953,7 +2953,7 @@ static int multiSelectOrderBy( } } } - + /* Separate the left and the right query from one another */ p->pPrior = 0; @@ -2998,7 +2998,7 @@ static int multiSelectOrderBy( sqlite3VdbeEndCoroutine(v, regAddrA); sqlite3VdbeJumpHere(v, addr1); - /* Generate a coroutine to evaluate the SELECT statement on + /* Generate a coroutine to evaluate the SELECT statement on ** the right - the "B" select */ addrSelectB = sqlite3VdbeCurrentAddr(v) + 1; @@ -3007,7 +3007,7 @@ static int multiSelectOrderBy( savedLimit = p->iLimit; savedOffset = p->iOffset; p->iLimit = regLimitB; - p->iOffset = 0; + p->iOffset = 0; explainSetInteger(iSub2, pParse->iNextSelectId); sqlite3Select(pParse, p, &destB); p->iLimit = savedLimit; @@ -3021,7 +3021,7 @@ static int multiSelectOrderBy( addrOutA = generateOutputSubroutine(pParse, p, &destA, pDest, regOutA, regPrev, pKeyDup, labelEnd); - + /* Generate a subroutine that outputs the current row of the B ** select as the next output row of the compound select. */ @@ -3038,7 +3038,7 @@ static int multiSelectOrderBy( */ if( op==TK_EXCEPT || op==TK_INTERSECT ){ addrEofA_noB = addrEofA = labelEnd; - }else{ + }else{ VdbeNoopComment((v, "eof-A subroutine")); addrEofA = sqlite3VdbeAddOp2(v, OP_Gosub, regOutB, addrOutB); addrEofA_noB = sqlite3VdbeAddOp2(v, OP_Yield, regAddrB, labelEnd); @@ -3053,7 +3053,7 @@ static int multiSelectOrderBy( if( op==TK_INTERSECT ){ addrEofB = addrEofA; if( p->nSelectRow > pPrior->nSelectRow ) p->nSelectRow = pPrior->nSelectRow; - }else{ + }else{ VdbeNoopComment((v, "eof-B subroutine")); addrEofB = sqlite3VdbeAddOp2(v, OP_Gosub, regOutA, addrOutA); sqlite3VdbeAddOp2(v, OP_Yield, regAddrA, labelEnd); VdbeCoverage(v); @@ -3141,13 +3141,13 @@ static void substSelect(Parse*, Select *, int, ExprList*, int); /* ** Scan through the expression pExpr. Replace every reference to ** a column in table number iTable with a copy of the iColumn-th -** entry in pEList. (But leave references to the ROWID column +** entry in pEList. (But leave references to the ROWID column ** unchanged.) ** ** This routine is part of the flattening procedure. A subquery ** whose result set is defined by pEList appears as entry in the ** FROM clause of a SELECT such that the VDBE cursor assigned to that -** FORM clause entry is iTable. This routine make the necessary +** FORM clause entry is iTable. This routine make the necessary ** changes to pExpr so that it refers directly to the source table ** of the subquery rather the result set of the subquery. */ @@ -3254,7 +3254,7 @@ static void substSelect( ** SELECT x+y AS a FROM t1 WHERE z<100 AND a>5 ** ** The code generated for this simplification gives the same result -** but only has to scan the data once. And because indices might +** but only has to scan the data once. And because indices might ** exist on the table t1, a complete scan of the data might be ** avoided. ** @@ -3273,7 +3273,7 @@ static void substSelect( ** (4) The subquery is not DISTINCT. ** ** (**) At one point restrictions (4) and (5) defined a subset of DISTINCT -** sub-queries that were excluded from this optimization. Restriction +** sub-queries that were excluded from this optimization. Restriction ** (4) has since been expanded to exclude all DISTINCT subqueries. ** ** (6) The subquery does not use aggregates or the outer query is not @@ -3291,7 +3291,7 @@ static void substSelect( ** ** (**) Restriction (10) was removed from the code on 2005-02-05 but we ** accidently carried the comment forward until 2014-09-15. Original -** text: "The subquery does not use aggregates or the outer query +** text: "The subquery does not use aggregates or the outer query ** does not use LIMIT." ** ** (11) The subquery and the outer query do not both have ORDER BY clauses. @@ -3309,10 +3309,10 @@ static void substSelect( ** ** (16) The outer query is not an aggregate or the subquery does ** not contain ORDER BY. (Ticket #2942) This used to not matter -** until we introduced the group_concat() function. +** until we introduced the group_concat() function. ** -** (17) The sub-query is not a compound select, or it is a UNION ALL -** compound clause made up entirely of non-aggregate queries, and +** (17) The sub-query is not a compound select, or it is a UNION ALL +** compound clause made up entirely of non-aggregate queries, and ** the parent query: ** ** * is not itself part of a compound select, @@ -3333,7 +3333,7 @@ static void substSelect( ** syntax error and return a detailed message. ** ** (18) If the sub-query is a compound select, then all terms of the -** ORDER by clause of the parent must be simple references to +** ORDER by clause of the parent must be simple references to ** columns of the sub-query. ** ** (19) The subquery does not use LIMIT or the outer query does not @@ -3355,7 +3355,7 @@ static void substSelect( ** parent to a compound query confuses the code that handles ** recursive queries in multiSelect(). ** -** (24) The subquery is not an aggregate that uses the built-in min() or +** (24) The subquery is not an aggregate that uses the built-in min() or ** or max() functions. (Without this restriction, a query like: ** "SELECT x FROM (SELECT max(y), x FROM t1)" would not necessarily ** return the value X for which Y was maximal.) @@ -3412,7 +3412,7 @@ static int flattenSubquery( return 0; /* Restriction (2b) */ } } - + pSubSrc = pSub->pSrc; assert( pSubSrc ); /* Prior to version 3.1.2, when LIMIT and OFFSET had to be simple constants, @@ -3451,7 +3451,7 @@ static int flattenSubquery( } /* OBSOLETE COMMENT 1: - ** Restriction 3: If the subquery is a join, make sure the subquery is + ** Restriction 3: If the subquery is a join, make sure the subquery is ** not used as the right operand of an outer join. Examples of why this ** is not allowed: ** @@ -3504,7 +3504,7 @@ static int flattenSubquery( assert( pSub->pSrc!=0 ); assert( pSub->pEList->nExpr==pSub1->pEList->nExpr ); if( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))!=0 - || (pSub1->pPrior && pSub1->op!=TK_ALL) + || (pSub1->pPrior && pSub1->op!=TK_ALL) || pSub1->pSrc->nSrc<1 ){ return 0; @@ -3532,13 +3532,13 @@ static int flattenSubquery( pParse->zAuthContext = zSavedAuthContext; /* If the sub-query is a compound SELECT statement, then (by restrictions - ** 17 and 18 above) it must be a UNION ALL and the parent query must + ** 17 and 18 above) it must be a UNION ALL and the parent query must ** be of the form: ** - ** SELECT FROM () + ** SELECT FROM () ** ** followed by any ORDER BY, LIMIT and/or OFFSET clauses. This block - ** creates N-1 copies of the parent query without any ORDER BY, LIMIT or + ** creates N-1 copies of the parent query without any ORDER BY, LIMIT or ** OFFSET clauses and joins them to the left-hand-side of the original ** using UNION ALL operators. In this case N is the number of simple ** select statements in the compound sub-query. @@ -3596,7 +3596,7 @@ static int flattenSubquery( if( db->mallocFailed ) return 1; } - /* Begin flattening the iFrom-th entry of the FROM clause + /* Begin flattening the iFrom-th entry of the FROM clause ** in the outer query. */ pSub = pSub1 = pSubitem->pSelect; @@ -3695,10 +3695,10 @@ static int flattenSubquery( memset(&pSubSrc->a[i], 0, sizeof(pSubSrc->a[i])); } pSrc->a[iFrom].fg.jointype = jointype; - - /* Now begin substituting subquery result set expressions for + + /* Now begin substituting subquery result set expressions for ** references to the iParent in the outer query. - ** + ** ** Example: ** ** SELECT a+5, b*10 FROM (SELECT x*3 AS a, y+10 AS b FROM t1) WHERE a>b; @@ -3741,7 +3741,7 @@ static int flattenSubquery( assert( pParent->pHaving==0 ); pParent->pHaving = pParent->pWhere; pParent->pWhere = pWhere; - pParent->pHaving = sqlite3ExprAnd(db, + pParent->pHaving = sqlite3ExprAnd(db, sqlite3ExprDup(db, pSub->pHaving, 0), pParent->pHaving ); assert( pParent->pGroupBy==0 ); @@ -3750,12 +3750,12 @@ static int flattenSubquery( pParent->pWhere = sqlite3ExprAnd(db, pWhere, pParent->pWhere); } substSelect(pParse, pParent, iParent, pSub->pEList, 0); - + /* The flattened query is distinct if either the inner or the - ** outer query is distinct. + ** outer query is distinct. */ pParent->selFlags |= pSub->selFlags & SF_Distinct; - + /* ** SELECT ... FROM (SELECT ... LIMIT a OFFSET b) LIMIT x OFFSET y; ** @@ -3870,7 +3870,7 @@ static int pushDownWhereTerms( ** * the argument to the aggregate function is a column value. ** ** If all of the above are true, then WHERE_ORDERBY_MIN or WHERE_ORDERBY_MAX -** is returned as appropriate. Also, *ppMinMax is set to point to the +** is returned as appropriate. Also, *ppMinMax is set to point to the ** list of arguments passed to the aggregate before returning. ** ** Or, if the conditions above are not met, *ppMinMax is set to 0 and @@ -3903,7 +3903,7 @@ static u8 minMaxQuery(AggInfo *pAggInfo, ExprList **ppMinMax){ /* ** The select statement passed as the first argument is an aggregate query. -** The second argument is the associated aggregate-info object. This +** The second argument is the associated aggregate-info object. This ** function tests if the SELECT is of the form: ** ** SELECT count(*) FROM @@ -3918,7 +3918,7 @@ static Table *isSimpleCount(Select *p, AggInfo *pAggInfo){ assert( !p->pGroupBy ); - if( p->pWhere || p->pEList->nExpr!=1 + if( p->pWhere || p->pEList->nExpr!=1 || p->pSrc->nSrc!=1 || p->pSrc->a[0].pSelect ){ return 0; @@ -3939,8 +3939,8 @@ static Table *isSimpleCount(Select *p, AggInfo *pAggInfo){ /* ** If the source-list item passed as an argument was augmented with an ** INDEXED BY clause, then try to locate the specified index. If there -** was such a clause and the named index cannot be found, return -** SQLITE_ERROR and leave an error in pParse. Otherwise, populate +** was such a clause and the named index cannot be found, return +** SQLITE_ERROR and leave an error in pParse. Otherwise, populate ** pFrom->pIndex and return SQLITE_OK. */ int sqlite3IndexedByLookup(Parse *pParse, struct SrcList_item *pFrom){ @@ -3948,8 +3948,8 @@ int sqlite3IndexedByLookup(Parse *pParse, struct SrcList_item *pFrom){ Table *pTab = pFrom->pTab; char *zIndexedBy = pFrom->u1.zIndexedBy; Index *pIdx; - for(pIdx=pTab->pIndex; - pIdx && sqlite3StrICmp(pIdx->zName, zIndexedBy); + for(pIdx=pTab->pIndex; + pIdx && sqlite3StrICmp(pIdx->zName, zIndexedBy); pIdx=pIdx->pNext ); if( !pIdx ){ @@ -3962,7 +3962,7 @@ int sqlite3IndexedByLookup(Parse *pParse, struct SrcList_item *pFrom){ return SQLITE_OK; } /* -** Detect compound SELECT statements that use an ORDER BY clause with +** Detect compound SELECT statements that use an ORDER BY clause with ** an alternative collating sequence. ** ** SELECT ... FROM t1 EXCEPT SELECT ... FROM t2 ORDER BY .. COLLATE ... @@ -4047,9 +4047,9 @@ static int cannotBeFunction(Parse *pParse, struct SrcList_item *pFrom){ #ifndef SQLITE_OMIT_CTE /* -** Argument pWith (which may be NULL) points to a linked list of nested -** WITH contexts, from inner to outermost. If the table identified by -** FROM clause element pItem is really a common-table-expression (CTE) +** Argument pWith (which may be NULL) points to a linked list of nested +** WITH contexts, from inner to outermost. If the table identified by +** FROM clause element pItem is really a common-table-expression (CTE) ** then return a pointer to the CTE definition for that table. Otherwise ** return NULL. ** @@ -4084,7 +4084,7 @@ static struct Cte *searchWith( ** onto the top of the stack. If argument bFree is true, then this ** WITH clause will never be popped from the stack. In this case it ** should be freed along with the Parse object. In other cases, when -** bFree==0, the With object will be freed along with the SELECT +** bFree==0, the With object will be freed along with the SELECT ** statement with which it is associated. */ void sqlite3WithPush(Parse *pParse, With *pWith, u8 bFree){ @@ -4098,7 +4098,7 @@ void sqlite3WithPush(Parse *pParse, With *pWith, u8 bFree){ } /* -** This function checks if argument pFrom refers to a CTE declared by +** This function checks if argument pFrom refers to a CTE declared by ** a WITH clause on the stack currently maintained by the parser. And, ** if currently processing a CTE expression, if it is a recursive ** reference to the current CTE. @@ -4113,7 +4113,7 @@ void sqlite3WithPush(Parse *pParse, With *pWith, u8 bFree){ ** parser and some error code other than SQLITE_OK returned. */ static int withExpand( - Walker *pWalker, + Walker *pWalker, struct SrcList_item *pFrom ){ Parse *pParse = pWalker->pParse; @@ -4162,8 +4162,8 @@ static int withExpand( SrcList *pSrc = pFrom->pSelect->pSrc; for(i=0; inSrc; i++){ struct SrcList_item *pItem = &pSrc->a[i]; - if( pItem->zDatabase==0 - && pItem->zName!=0 + if( pItem->zDatabase==0 + && pItem->zName!=0 && 0==sqlite3StrICmp(pItem->zName, pCte->zName) ){ pItem->pTab = pTab; @@ -4174,7 +4174,7 @@ static int withExpand( } } - /* Only one recursive reference is permitted. */ + /* Only one recursive reference is permitted. */ if( pTab->nTabRef>2 ){ sqlite3ErrorMsg( pParse, "multiple references to recursive table: %s", pCte->zName @@ -4229,12 +4229,12 @@ static int withExpand( #ifndef SQLITE_OMIT_CTE /* -** If the SELECT passed as the second argument has an associated WITH +** If the SELECT passed as the second argument has an associated WITH ** clause, pop it from the stack stored as part of the Parse object. ** ** This function is used as the xSelectCallback2() callback by ** sqlite3SelectExpand() when walking a SELECT tree to resolve table -** names and other FROM clause elements. +** names and other FROM clause elements. */ static void selectPopWith(Walker *pWalker, Select *p){ Parse *pParse = pWalker->pParse; @@ -4257,7 +4257,7 @@ static void selectPopWith(Walker *pWalker, Select *p){ ** (1) Make sure VDBE cursor numbers have been assigned to every ** element of the FROM clause. ** -** (2) Fill in the pTabList->a[].pTab fields in the SrcList that +** (2) Fill in the pTabList->a[].pTab fields in the SrcList that ** defines FROM clause. When views appear in the FROM clause, ** fill pTabList->a[].pSelect with a copy of the SELECT statement ** that implements the view. A copy is made of the view's SELECT @@ -4467,7 +4467,7 @@ static int selectExpander(Walker *pWalker, Select *p){ ** bit set. */ if( (p->selFlags & SF_IncludeHidden)==0 - && IsHiddenColumn(&pTab->aCol[j]) + && IsHiddenColumn(&pTab->aCol[j]) ){ continue; } @@ -4477,7 +4477,7 @@ static int selectExpander(Walker *pWalker, Select *p){ if( (pFrom->fg.jointype & JT_NATURAL)!=0 && tableAndColumnIndex(pTabList, i, zName, 0, 0) ){ - /* In a NATURAL join, omit the join columns from the + /* In a NATURAL join, omit the join columns from the ** table to the right of the join */ continue; } @@ -4549,8 +4549,8 @@ static int selectExpander(Walker *pWalker, Select *p){ ** ** When this routine is the Walker.xExprCallback then expression trees ** are walked without any actions being taken at each node. Presumably, -** when this routine is used for Walker.xExprCallback then -** Walker.xSelectCallback is set to do something useful for every +** when this routine is used for Walker.xExprCallback then +** Walker.xSelectCallback is set to do something useful for every ** subquery in the parser tree. */ int sqlite3ExprWalkNoop(Walker *NotUsed, Expr *NotUsed2){ @@ -4795,7 +4795,7 @@ static void updateAccumulator(Parse *pParse, AggInfo *pAggInfo){ } /* Before populating the accumulator registers, clear the column cache. - ** Otherwise, if any of the required column values are already present + ** Otherwise, if any of the required column values are already present ** in registers, sqlite3ExprCode() may use OP_SCopy to copy the value ** to pC->iMem. But by the time the value is used, the original register ** may have been used, invalidating the underlying buffer holding the @@ -4845,7 +4845,7 @@ static void explainSimpleCount( #endif /* -** Generate code for the SELECT statement given in the p argument. +** Generate code for the SELECT statement given in the p argument. ** ** The results are returned according to the SelectDest structure. ** See comments in sqliteInt.h for further information. @@ -4902,7 +4902,7 @@ int sqlite3Select( assert( p->pOrderBy==0 || pDest->eDest!=SRT_DistQueue ); assert( p->pOrderBy==0 || pDest->eDest!=SRT_Queue ); if( IgnorableOrderby(pDest) ){ - assert(pDest->eDest==SRT_Exists || pDest->eDest==SRT_Union || + assert(pDest->eDest==SRT_Exists || pDest->eDest==SRT_Union || pDest->eDest==SRT_Except || pDest->eDest==SRT_Discard || pDest->eDest==SRT_Queue || pDest->eDest==SRT_DistFifo || pDest->eDest==SRT_DistQueue || pDest->eDest==SRT_Fifo); @@ -5117,7 +5117,7 @@ int sqlite3Select( } #endif - /* If the query is DISTINCT with an ORDER BY but is not an aggregate, and + /* If the query is DISTINCT with an ORDER BY but is not an aggregate, and ** if the select-list is the same as the ORDER BY list, then this query ** can be rewritten as a GROUP BY. In other words, this: ** @@ -5127,12 +5127,12 @@ int sqlite3Select( ** ** SELECT xyz FROM ... GROUP BY xyz ORDER BY xyz ** - ** The second form is preferred as a single index (or temp-table) may be - ** used for both the ORDER BY and DISTINCT processing. As originally - ** written the query must use a temp-table for at least one of the ORDER + ** The second form is preferred as a single index (or temp-table) may be + ** used for both the ORDER BY and DISTINCT processing. As originally + ** written the query must use a temp-table for at least one of the ORDER ** BY and DISTINCT, and an index or separate temp-table for the other. */ - if( (p->selFlags & (SF_Distinct|SF_Aggregate))==SF_Distinct + if( (p->selFlags & (SF_Distinct|SF_Aggregate))==SF_Distinct && sqlite3ExprListCompare(sSort.pOrderBy, pEList, -1)==0 ){ p->selFlags &= ~SF_Distinct; @@ -5227,7 +5227,7 @@ int sqlite3Select( } } - /* If sorting index that was created by a prior OP_OpenEphemeral + /* If sorting index that was created by a prior OP_OpenEphemeral ** instruction ended up not being needed, then change the OP_OpenEphemeral ** into an OP_Noop. */ @@ -5280,8 +5280,8 @@ int sqlite3Select( } /* If there is both a GROUP BY and an ORDER BY clause and they are - ** identical, then it may be possible to disable the ORDER BY clause - ** on the grounds that the GROUP BY will cause elements to come out + ** identical, then it may be possible to disable the ORDER BY clause + ** on the grounds that the GROUP BY will cause elements to come out ** in the correct order. It also may not - the GROUP BY might use a ** database index that causes rows to be grouped together as required ** but not actually sorted. Either way, record the fact that the @@ -5290,7 +5290,7 @@ int sqlite3Select( if( sqlite3ExprListCompare(pGroupBy, sSort.pOrderBy, -1)==0 ){ orderByGrp = 1; } - + /* Create a label to jump to when we want to abort the query */ addrEnd = sqlite3VdbeMakeLabel(v); @@ -5337,12 +5337,12 @@ int sqlite3Select( /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction - ** will be converted into a Noop. + ** will be converted into a Noop. */ sAggInfo.sortingIdx = pParse->nTab++; pKeyInfo = keyInfoFromExprList(pParse, pGroupBy, 0, sAggInfo.nColumn); - addrSortingIdx = sqlite3VdbeAddOp4(v, OP_SorterOpen, - sAggInfo.sortingIdx, sAggInfo.nSortingColumn, + addrSortingIdx = sqlite3VdbeAddOp4(v, OP_SorterOpen, + sAggInfo.sortingIdx, sAggInfo.nSortingColumn, 0, (char*)pKeyInfo, P4_KEYINFO); /* Initialize memory locations used by GROUP BY aggregate processing @@ -5390,7 +5390,7 @@ int sqlite3Select( int nCol; int nGroupBy; - explainTempTable(pParse, + explainTempTable(pParse, (sDistinct.isTnct && (p->selFlags&SF_Distinct)==0) ? "DISTINCT" : "GROUP BY"); @@ -5412,7 +5412,7 @@ int sqlite3Select( struct AggInfo_col *pCol = &sAggInfo.aCol[i]; if( pCol->iSorterColumn>=j ){ int r1 = j + regBase; - sqlite3ExprCodeGetColumnToReg(pParse, + sqlite3ExprCodeGetColumnToReg(pParse, pCol->pTab, pCol->iColumn, pCol->iTable, r1); j++; } @@ -5438,9 +5438,9 @@ int sqlite3Select( ** clause, cancel the ephemeral table open coded earlier. ** ** This is an optimization - the correct answer should result regardless. - ** Use the SQLITE_GroupByOrder flag with SQLITE_TESTCTRL_OPTIMIZER to + ** Use the SQLITE_GroupByOrder flag with SQLITE_TESTCTRL_OPTIMIZER to ** disable this optimization for testing purposes. */ - if( orderByGrp && OptimizationEnabled(db, SQLITE_GroupByOrder) + if( orderByGrp && OptimizationEnabled(db, SQLITE_GroupByOrder) && (groupBySort || sqlite3WhereIsSorted(pWInfo)) ){ sSort.pOrderBy = 0; @@ -5545,7 +5545,7 @@ int sqlite3Select( sqlite3VdbeResolveLabel(v, addrReset); resetAccumulator(pParse, &sAggInfo); sqlite3VdbeAddOp1(v, OP_Return, regReset); - + } /* endif pGroupBy. Begin aggregate queries without GROUP BY: */ else { ExprList *pDel = 0; @@ -5581,7 +5581,7 @@ int sqlite3Select( ** ** (2013-10-03) Do not count the entries in a partial index. ** - ** In practice the KeyInfo structure will not be used. It is only + ** In practice the KeyInfo structure will not be used. It is only ** passed to keep OP_OpenRead happy. */ if( !HasRowid(pTab) ) pBest = sqlite3PrimaryKeyIndex(pTab); @@ -5616,11 +5616,11 @@ int sqlite3Select( ** SELECT max(x) FROM ... ** ** If it is, then ask the code in where.c to attempt to sort results - ** as if there was an "ORDER ON x" or "ORDER ON x DESC" clause. + ** as if there was an "ORDER ON x" or "ORDER ON x DESC" clause. ** If where.c is able to produce results sorted in this order, then - ** add vdbe code to break out of the processing loop after the - ** first iteration (since the first iteration of the loop is - ** guaranteed to operate on the row with the minimum or maximum + ** add vdbe code to break out of the processing loop after the + ** first iteration (since the first iteration of the loop is + ** guaranteed to operate on the row with the minimum or maximum ** value of x, the only row required). ** ** A special flag must be passed to sqlite3WhereBegin() to slightly @@ -5631,13 +5631,13 @@ int sqlite3Select( ** for x. ** ** + The optimizer code in where.c (the thing that decides which - ** index or indices to use) should place a different priority on + ** index or indices to use) should place a different priority on ** satisfying the 'ORDER BY' clause than it does in other cases. ** Refer to code and comments in where.c for details. */ ExprList *pMinMax = 0; u8 flag = WHERE_ORDERBY_NORMAL; - + assert( p->pGroupBy==0 ); assert( flag==0 ); if( p->pHaving==0 ){ @@ -5654,7 +5654,7 @@ int sqlite3Select( pMinMax->a[0].pExpr->op = TK_COLUMN; } } - + /* This case runs if the aggregate has no GROUP BY clause. The ** processing is much simpler since there is only a single row ** of output. @@ -5678,12 +5678,12 @@ int sqlite3Select( sSort.pOrderBy = 0; sqlite3ExprIfFalse(pParse, pHaving, addrEnd, SQLITE_JUMPIFNULL); - selectInnerLoop(pParse, p, p->pEList, -1, 0, 0, + selectInnerLoop(pParse, p, p->pEList, -1, 0, 0, pDest, addrEnd, addrEnd); sqlite3ExprListDelete(db, pDel); } sqlite3VdbeResolveLabel(v, addrEnd); - + } /* endif aggregate query */ if( sDistinct.eTnctType==WHERE_DISTINCT_UNORDERED ){ diff --git a/third_party/sqlite/src/src/shell.c b/third_party/sqlite/src/src/shell.c index 33377da521d3c..4e1b28b9a2eb4 100644 --- a/third_party/sqlite/src/src/shell.c +++ b/third_party/sqlite/src/src/shell.c @@ -2282,8 +2282,8 @@ static int process_input(ShellState *p, FILE *in); /* ** Read the content of file zName into memory obtained from sqlite3_malloc64() -** and return a pointer to the buffer. The caller is responsible for freeing -** the memory. +** and return a pointer to the buffer. The caller is responsible for freeing +** the memory. ** ** If parameter pnByte is not NULL, (*pnByte) is set to the number of bytes ** read. @@ -3275,15 +3275,15 @@ int shellDeleteFile(const char *zFilename){ ** fkey_collate_clause('parent-tab', 'parent-col', 'child-tab', 'child-col') ** ** If either of the named tables or columns do not exist, this function -** returns an empty string. An empty string is also returned if both tables +** returns an empty string. An empty string is also returned if both tables ** and columns exist but have the same default collation sequence. Or, ** if both exist but the default collation sequences are different, this ** function returns the string " COLLATE ", where ** is the default collation sequence of the parent column. */ static void shellFkeyCollateClause( - sqlite3_context *pCtx, - int nVal, + sqlite3_context *pCtx, + int nVal, sqlite3_value **apVal ){ sqlite3 *db = sqlite3_context_db_handle(pCtx); @@ -3294,7 +3294,7 @@ static void shellFkeyCollateClause( const char *zChildCol; const char *zChildSeq = 0; /* Initialize to avoid false-positive warning */ int rc; - + assert( nVal==4 ); zParent = (const char*)sqlite3_value_text(apVal[0]); zParentCol = (const char*)sqlite3_value_text(apVal[1]); @@ -3415,7 +3415,7 @@ static int lintFkeyIndexes( return SQLITE_ERROR; } } - + /* Register the fkey_collate_clause() SQL function */ rc = sqlite3_create_function(db, "fkey_collate_clause", 4, SQLITE_UTF8, 0, shellFkeyCollateClause, 0, 0 @@ -3455,9 +3455,9 @@ static int lintFkeyIndexes( raw_printf(stderr, "Error: internal error"); break; }else{ - if( bGroupByParent + if( bGroupByParent && (bVerbose || res==0) - && (zPrev==0 || sqlite3_stricmp(zParent, zPrev)) + && (zPrev==0 || sqlite3_stricmp(zParent, zPrev)) ){ raw_printf(out, "-- Parent table %s\n", zParent); sqlite3_free(zPrev); @@ -3467,7 +3467,7 @@ static int lintFkeyIndexes( if( res==0 ){ raw_printf(out, "%s%s --> %s\n", zIndent, zCI, zTarget); }else if( bVerbose ){ - raw_printf(out, "%s/* no extra indexes required for %s -> %s */\n", + raw_printf(out, "%s/* no extra indexes required for %s -> %s */\n", zIndent, zFrom, zTarget ); } diff --git a/third_party/sqlite/src/src/sqlite.h.in b/third_party/sqlite/src/src/sqlite.h.in index 371ae5848bbc5..133054c2d4d45 100644 --- a/third_party/sqlite/src/src/sqlite.h.in +++ b/third_party/sqlite/src/src/sqlite.h.in @@ -108,7 +108,7 @@ extern "C" { ** be held constant and Z will be incremented or else Y will be incremented ** and Z will be reset to zero. ** -** Since [version 3.6.18] ([dateof:3.6.18]), +** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the ** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to @@ -149,8 +149,8 @@ extern "C" { ** function is provided for use in DLLs since DLL users usually do not have ** direct access to string constants within the DLL. ^The ** sqlite3_libversion_number() function returns an integer equal to -** [SQLITE_VERSION_NUMBER]. ^The sqlite3_sourceid() function returns -** a pointer to a string constant whose value is the same as the +** [SQLITE_VERSION_NUMBER]. ^The sqlite3_sourceid() function returns +** a pointer to a string constant whose value is the same as the ** [SQLITE_SOURCE_ID] C preprocessor macro. ** ** See also: [sqlite_version()] and [sqlite_source_id()]. @@ -163,20 +163,20 @@ int sqlite3_libversion_number(void); /* ** CAPI3REF: Run-Time Library Compilation Options Diagnostics ** -** ^The sqlite3_compileoption_used() function returns 0 or 1 -** indicating whether the specified option was defined at -** compile time. ^The SQLITE_ prefix may be omitted from the -** option name passed to sqlite3_compileoption_used(). +** ^The sqlite3_compileoption_used() function returns 0 or 1 +** indicating whether the specified option was defined at +** compile time. ^The SQLITE_ prefix may be omitted from the +** option name passed to sqlite3_compileoption_used(). ** ** ^The sqlite3_compileoption_get() function allows iterating ** over the list of options that were defined at compile time by ** returning the N-th compile time option string. ^If N is out of range, -** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_ -** prefix is omitted from any strings returned by +** sqlite3_compileoption_get() returns a NULL pointer. ^The SQLITE_ +** prefix is omitted from any strings returned by ** sqlite3_compileoption_get(). ** ** ^Support for the diagnostic functions sqlite3_compileoption_used() -** and sqlite3_compileoption_get() may be omitted by specifying the +** and sqlite3_compileoption_get() may be omitted by specifying the ** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time. ** ** See also: SQL functions [sqlite_compileoption_used()] and @@ -197,7 +197,7 @@ const char *sqlite3_compileoption_get(int N); ** SQLite can be compiled with or without mutexes. When ** the [SQLITE_THREADSAFE] C preprocessor macro is 1 or 2, mutexes ** are enabled and SQLite is threadsafe. When the -** [SQLITE_THREADSAFE] macro is 0, +** [SQLITE_THREADSAFE] macro is 0, ** the mutexes are omitted. Without the mutexes, it is not safe ** to use SQLite concurrently from more than one thread. ** @@ -254,14 +254,14 @@ typedef struct sqlite3 sqlite3; ** ** ^The sqlite3_int64 and sqlite_int64 types can store integer values ** between -9223372036854775808 and +9223372036854775807 inclusive. ^The -** sqlite3_uint64 and sqlite_uint64 types can store integer values +** sqlite3_uint64 and sqlite_uint64 types can store integer values ** between 0 and +18446744073709551615 inclusive. */ #ifdef SQLITE_INT64_TYPE typedef SQLITE_INT64_TYPE sqlite_int64; # ifdef SQLITE_UINT64_TYPE typedef SQLITE_UINT64_TYPE sqlite_uint64; -# else +# else typedef unsigned SQLITE_INT64_TYPE sqlite_uint64; # endif #elif defined(_MSC_VER) || defined(__BORLANDC__) @@ -304,7 +304,7 @@ typedef sqlite_uint64 sqlite3_uint64; ** destructors are called is arbitrary. ** ** Applications should [sqlite3_finalize | finalize] all [prepared statements], -** [sqlite3_blob_close | close] all [BLOB handles], and +** [sqlite3_blob_close | close] all [BLOB handles], and ** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated ** with the [sqlite3] object prior to attempting to close the object. ^If ** sqlite3_close_v2() is called on a [database connection] that still has @@ -341,7 +341,7 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**); ** The sqlite3_exec() interface is a convenience wrapper around ** [sqlite3_prepare_v2()], [sqlite3_step()], and [sqlite3_finalize()], ** that allows an application to run multiple statements of SQL -** without having to use a lot of C code. +** without having to use a lot of C code. ** ** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded, ** semicolon-separate SQL statements passed into its 2nd argument, @@ -381,7 +381,7 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**); ** from [sqlite3_column_name()]. ** ** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer -** to an empty string, or a pointer that contains only whitespace and/or +** to an empty string, or a pointer that contains only whitespace and/or ** SQL comments, then no SQL statements are evaluated and the database ** is not changed. ** @@ -642,7 +642,7 @@ int sqlite3_exec( /* ** CAPI3REF: OS Interface Open File Handle ** -** An [sqlite3_file] object represents an open file in the +** An [sqlite3_file] object represents an open file in the ** [sqlite3_vfs | OS interface layer]. Individual OS interface ** implementations will ** want to subclass this object by appending additional fields @@ -664,7 +664,7 @@ struct sqlite3_file { ** This object defines the methods used to perform various operations ** against the open file represented by the [sqlite3_file] object. ** -** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element +** If the [sqlite3_vfs.xOpen] method sets the sqlite3_file.pMethods element ** to a non-NULL pointer, then the sqlite3_io_methods.xClose method ** may be invoked even if the [sqlite3_vfs.xOpen] reported that it failed. The ** only way to prevent a call to xClose following a failed [sqlite3_vfs.xOpen] @@ -804,7 +804,7 @@ struct sqlite3_io_methods { **
    • [[SQLITE_FCNTL_CHUNK_SIZE]] ** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS ** extends and truncates the database file in chunks of a size specified -** by the user. The fourth argument to [sqlite3_file_control()] should +** by the user. The fourth argument to [sqlite3_file_control()] should ** point to an integer (type int) containing the new chunk-size to use ** for the nominated database. Allocating database file space in large ** chunks (say 1MB at a time), may reduce file-system fragmentation and @@ -827,24 +827,24 @@ struct sqlite3_io_methods { **
    • [[SQLITE_FCNTL_SYNC]] ** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and ** sent to the VFS immediately before the xSync method is invoked on a -** database file descriptor. Or, if the xSync method is not invoked -** because the user has configured SQLite with -** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place +** database file descriptor. Or, if the xSync method is not invoked +** because the user has configured SQLite with +** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place ** of the xSync method. In most cases, the pointer argument passed with ** this file-control is NULL. However, if the database file is being synced ** as part of a multi-database commit, the argument points to a nul-terminated -** string containing the transactions master-journal file name. VFSes that -** do not need this signal should silently ignore this opcode. Applications -** should not call [sqlite3_file_control()] with this opcode as doing so may -** disrupt the operation of the specialized VFSes that do require it. +** string containing the transactions master-journal file name. VFSes that +** do not need this signal should silently ignore this opcode. Applications +** should not call [sqlite3_file_control()] with this opcode as doing so may +** disrupt the operation of the specialized VFSes that do require it. ** **
    • [[SQLITE_FCNTL_COMMIT_PHASETWO]] ** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite ** and sent to the VFS after a transaction has been committed immediately ** but before the database is unlocked. VFSes that do not need this signal ** should silently ignore this opcode. Applications should not call -** [sqlite3_file_control()] with this opcode as doing so may disrupt the -** operation of the specialized VFSes that do require it. +** [sqlite3_file_control()] with this opcode as doing so may disrupt the +** operation of the specialized VFSes that do require it. ** **
    • [[SQLITE_FCNTL_WIN32_AV_RETRY]] ** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic @@ -891,13 +891,13 @@ struct sqlite3_io_methods { **
    • [[SQLITE_FCNTL_OVERWRITE]] ** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening ** a write transaction to indicate that, unless it is rolled back for some -** reason, the entire database file will be overwritten by the current +** reason, the entire database file will be overwritten by the current ** transaction. This is used by VACUUM operations. ** **
    • [[SQLITE_FCNTL_VFSNAME]] ** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of ** all [VFSes] in the VFS stack. The names are of all VFS shims and the -** final bottom-level VFS are written into memory obtained from +** final bottom-level VFS are written into memory obtained from ** [sqlite3_malloc()] and the result is stored in the char* variable ** that the fourth parameter of [sqlite3_file_control()] points to. ** The caller is responsible for freeing the memory when done. As with @@ -916,7 +916,7 @@ struct sqlite3_io_methods { ** upper-most shim only. ** **
    • [[SQLITE_FCNTL_PRAGMA]] -** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] +** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] ** file control is sent to the open [sqlite3_file] object corresponding ** to the database file to which the pragma statement refers. ^The argument ** to the [SQLITE_FCNTL_PRAGMA] file control is an array of @@ -927,7 +927,7 @@ struct sqlite3_io_methods { ** of the char** argument point to a string obtained from [sqlite3_mprintf()] ** or the equivalent and that string will become the result of the pragma or ** the error message if the pragma fails. ^If the -** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal +** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal ** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] ** file control returns [SQLITE_OK], then the parser assumes that the ** VFS has handled the PRAGMA itself and the parser generates a no-op @@ -967,7 +967,7 @@ struct sqlite3_io_methods { ** The argument is a pointer to a value of type sqlite3_int64 that ** is an advisory maximum number of bytes in the file to memory map. The ** pointer is overwritten with the old value. The limit is not changed if -** the value originally pointed to is negative, and so the current limit +** the value originally pointed to is negative, and so the current limit ** can be queried by passing in a pointer to a negative number. This ** file-control is used internally to implement [PRAGMA mmap_size]. ** @@ -1011,7 +1011,7 @@ struct sqlite3_io_methods { **
    • [[SQLITE_FCNTL_RBU]] ** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by ** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for -** this opcode. +** this opcode. ** */ #define SQLITE_FCNTL_LOCKSTATE 1 @@ -1120,14 +1120,14 @@ typedef struct sqlite3_api_routines sqlite3_api_routines; ** the [sqlite3_file] can safely store a pointer to the ** filename if it needs to remember the filename for some reason. ** If the zFilename parameter to xOpen is a NULL pointer then xOpen -** must invent its own temporary name for the file. ^Whenever the +** must invent its own temporary name for the file. ^Whenever the ** xFilename parameter is NULL it will also be the case that the ** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE]. ** ** The flags argument to xOpen() includes all bits set in ** the flags argument to [sqlite3_open_v2()]. Or if [sqlite3_open()] ** or [sqlite3_open16()] is used, then flags includes at least -** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. +** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. ** If xOpen() opens a file read-only then it sets *pOutFlags to ** include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be set. ** @@ -1169,10 +1169,10 @@ typedef struct sqlite3_api_routines sqlite3_api_routines; ** ^The [SQLITE_OPEN_EXCLUSIVE] flag is always used in conjunction ** with the [SQLITE_OPEN_CREATE] flag, which are both directly ** analogous to the O_EXCL and O_CREAT flags of the POSIX open() -** API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the +** API. The SQLITE_OPEN_EXCLUSIVE flag, when paired with the ** SQLITE_OPEN_CREATE, is used to indicate that file should always ** be created, and that it is an error if it already exists. -** It is not used to indicate the file should be opened +** It is not used to indicate the file should be opened ** for exclusive access. ** ** ^At least szOsFile bytes of memory are allocated by SQLite @@ -1210,16 +1210,16 @@ typedef struct sqlite3_api_routines sqlite3_api_routines; ** method returns a Julian Day Number for the current date and time as ** a floating point value. ** ^The xCurrentTimeInt64() method returns, as an integer, the Julian -** Day Number multiplied by 86400000 (the number of milliseconds in -** a 24-hour day). +** Day Number multiplied by 86400000 (the number of milliseconds in +** a 24-hour day). ** ^SQLite will use the xCurrentTimeInt64() method to get the current -** date and time if that method is available (if iVersion is 2 or +** date and time if that method is available (if iVersion is 2 or ** greater and the function pointer is not NULL) and will fall back ** to xCurrentTime() if xCurrentTimeInt64() is unavailable. ** ** ^The xSetSystemCall(), xGetSystemCall(), and xNestSystemCall() interfaces ** are not used by the SQLite core. These optional interfaces are provided -** by some VFSes to facilitate testing of the VFS code. By overriding +** by some VFSes to facilitate testing of the VFS code. By overriding ** system calls with functions under its control, a test program can ** simulate faults and error conditions that would otherwise be difficult ** or impossible to induce. The set of system calls that can be overridden @@ -1266,7 +1266,7 @@ struct sqlite3_vfs { /* ** The methods above are in versions 1 through 3 of the sqlite_vfs object. ** New fields may be appended in future versions. The iVersion - ** value will increment whenever this happens. + ** value will increment whenever this happens. */ }; @@ -1310,7 +1310,7 @@ struct sqlite3_vfs { ** ** ** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as -** was given on the corresponding lock. +** was given on the corresponding lock. ** ** The xShmLock method can transition between unlocked and SHARED or ** between unlocked and EXCLUSIVE. It cannot transition between SHARED @@ -1455,7 +1455,7 @@ int sqlite3_config(int, ...); ** [database connection] (specified in the first argument). ** ** The second argument to sqlite3_db_config(D,V,...) is the -** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code +** [SQLITE_DBCONFIG_LOOKASIDE | configuration verb] - an integer code ** that indicates what aspect of the [database connection] is being configured. ** Subsequent arguments vary depending on the configuration verb. ** @@ -1473,7 +1473,7 @@ int sqlite3_db_config(sqlite3*, int op, ...); ** This object is used in only one place in the SQLite interface. ** A pointer to an instance of this object is the argument to ** [sqlite3_config()] when the configuration option is -** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC]. +** [SQLITE_CONFIG_MALLOC] or [SQLITE_CONFIG_GETMALLOC]. ** By creating an instance of this object ** and passing it to [sqlite3_config]([SQLITE_CONFIG_MALLOC]) ** during configuration, an application can specify an alternative @@ -1503,7 +1503,7 @@ int sqlite3_db_config(sqlite3*, int op, ...); ** allocators round up memory allocations at least to the next multiple ** of 8. Some allocators round up to a larger multiple or to a power of 2. ** Every memory allocation request coming in through [sqlite3_malloc()] -** or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0, +** or [sqlite3_realloc()] first calls xRoundup. If xRoundup returns 0, ** that causes the corresponding memory allocation to fail. ** ** The xInit method initializes the memory allocator. For example, @@ -1561,7 +1561,7 @@ struct sqlite3_mem_methods { ** by a single thread. ^If SQLite is compiled with ** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then ** it is not possible to change the [threading mode] from its default -** value of Single-thread and so [sqlite3_config()] will return +** value of Single-thread and so [sqlite3_config()] will return ** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD ** configuration option.
    • ** @@ -1596,7 +1596,7 @@ struct sqlite3_mem_methods { ** SQLITE_CONFIG_SERIALIZED configuration option. ** ** [[SQLITE_CONFIG_MALLOC]]
      SQLITE_CONFIG_MALLOC
      -**
      ^(The SQLITE_CONFIG_MALLOC option takes a single argument which is +**
      ^(The SQLITE_CONFIG_MALLOC option takes a single argument which is ** a pointer to an instance of the [sqlite3_mem_methods] structure. ** The argument specifies ** alternative low-level memory allocation routines to be used in place of @@ -1642,7 +1642,7 @@ struct sqlite3_mem_methods { ** ^SQLite will never request a scratch buffer that is more than 6 ** times the database page size. ** ^If SQLite needs needs additional -** scratch memory beyond what is provided by this configuration option, then +** scratch memory beyond what is provided by this configuration option, then ** [sqlite3_malloc()] will be used to obtain the memory needed.

      ** ^When the application provides any amount of scratch memory using ** SQLITE_CONFIG_SCRATCH, SQLite avoids unnecessary large @@ -1654,7 +1654,7 @@ struct sqlite3_mem_methods { ** [[SQLITE_CONFIG_PAGECACHE]]

      SQLITE_CONFIG_PAGECACHE
      **
      ^The SQLITE_CONFIG_PAGECACHE option specifies a memory pool ** that SQLite can use for the database page cache with the default page -** cache implementation. +** cache implementation. ** This configuration option is a no-op if an application-define page ** cache implementation is loaded using the [SQLITE_CONFIG_PCACHE2]. ** ^There are three arguments to SQLITE_CONFIG_PAGECACHE: A pointer to @@ -1682,7 +1682,7 @@ struct sqlite3_mem_methods { ** additional cache line.
      ** ** [[SQLITE_CONFIG_HEAP]]
      SQLITE_CONFIG_HEAP
      -**
      ^The SQLITE_CONFIG_HEAP option specifies a static memory buffer +**
      ^The SQLITE_CONFIG_HEAP option specifies a static memory buffer ** that SQLite will use for all of its dynamic memory allocation needs ** beyond those provided for by [SQLITE_CONFIG_SCRATCH] and ** [SQLITE_CONFIG_PAGECACHE]. @@ -1738,7 +1738,7 @@ struct sqlite3_mem_methods { ** configuration on individual connections.)^
      ** ** [[SQLITE_CONFIG_PCACHE2]]
      SQLITE_CONFIG_PCACHE2
      -**
      ^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is +**
      ^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is ** a pointer to an [sqlite3_pcache_methods2] object. This object specifies ** the interface to a custom page cache implementation.)^ ** ^SQLite makes a copy of the [sqlite3_pcache_methods2] object.
      @@ -1752,7 +1752,7 @@ struct sqlite3_mem_methods { **
      The SQLITE_CONFIG_LOG option is used to configure the SQLite ** global [error log]. ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a -** function with a call signature of void(*)(void*,int,const char*), +** function with a call signature of void(*)(void*,int,const char*), ** and a pointer to void. ^If the function pointer is not NULL, it is ** invoked by [sqlite3_log()] to process each logging event. ^If the ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op. @@ -1861,7 +1861,7 @@ struct sqlite3_mem_methods { ** [[SQLITE_CONFIG_STMTJRNL_SPILL]] **
      SQLITE_CONFIG_STMTJRNL_SPILL **
      ^The SQLITE_CONFIG_STMTJRNL_SPILL option takes a single parameter which -** becomes the [statement journal] spill-to-disk threshold. +** becomes the [statement journal] spill-to-disk threshold. ** [Statement journals] are held in memory until their size (in bytes) ** exceeds this threshold, at which point they are written to disk. ** Or if the threshold is -1, statement journals are always held @@ -1884,7 +1884,7 @@ struct sqlite3_mem_methods { #define SQLITE_CONFIG_MEMSTATUS 9 /* boolean */ #define SQLITE_CONFIG_MUTEX 10 /* sqlite3_mutex_methods* */ #define SQLITE_CONFIG_GETMUTEX 11 /* sqlite3_mutex_methods* */ -/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ +/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ #define SQLITE_CONFIG_LOOKASIDE 13 /* int int */ #define SQLITE_CONFIG_PCACHE 14 /* no-op */ #define SQLITE_CONFIG_GETPCACHE 15 /* no-op */ @@ -1915,7 +1915,7 @@ struct sqlite3_mem_methods { ** **
      **
      SQLITE_DBCONFIG_LOOKASIDE
      -**
      ^This option takes three additional arguments that determine the +**
      ^This option takes three additional arguments that determine the ** [lookaside memory allocator] configuration for the [database connection]. ** ^The first argument (the third parameter to [sqlite3_db_config()] is a ** pointer to a memory buffer to use for lookaside memory. @@ -1933,7 +1933,7 @@ struct sqlite3_mem_methods { ** when the "current value" returned by ** [sqlite3_db_status](D,[SQLITE_CONFIG_LOOKASIDE],...) is zero. ** Any attempt to change the lookaside memory configuration when lookaside -** memory is in use leaves the configuration unchanged and returns +** memory is in use leaves the configuration unchanged and returns ** [SQLITE_BUSY].)^
      ** **
      SQLITE_DBCONFIG_ENABLE_FKEY
      @@ -1996,9 +1996,9 @@ struct sqlite3_mem_methods { **
      ** **
      SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
      -**
      Usually, when a database in wal mode is closed or detached from a -** database handle, SQLite checks if this will mean that there are now no -** connections at all to the database. If so, it performs a checkpoint +**
      Usually, when a database in wal mode is closed or detached from a +** database handle, SQLite checks if this will mean that there are now no +** connections at all to the database. If so, it performs a checkpoint ** operation before closing the connection. This option may be used to ** override this behaviour. The first parameter passed to this operation ** is an integer - non-zero to disable checkpoints-on-close, or zero (the @@ -2040,18 +2040,18 @@ int sqlite3_extended_result_codes(sqlite3*, int onoff); ** the table has a column of type [INTEGER PRIMARY KEY] then that column ** is another alias for the rowid. ** -** ^The sqlite3_last_insert_rowid(D) interface returns the [rowid] of the +** ^The sqlite3_last_insert_rowid(D) interface returns the [rowid] of the ** most recent successful [INSERT] into a rowid table or [virtual table] ** on database connection D. ** ^Inserts into [WITHOUT ROWID] tables are not recorded. ** ^If no successful [INSERT]s into rowid tables -** have ever occurred on the database connection D, +** have ever occurred on the database connection D, ** then sqlite3_last_insert_rowid(D) returns zero. ** ** ^(If an [INSERT] occurs within a trigger or within a [virtual table] ** method, then this routine will return the [rowid] of the inserted ** row as long as the trigger or virtual table method is running. -** But once the trigger or virtual table method ends, the value returned +** But once the trigger or virtual table method ends, the value returned ** by this routine reverts to what it was before the trigger or virtual ** table method began.)^ ** @@ -2091,37 +2091,37 @@ sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); ** returned by this function. ** ** ^Only changes made directly by the INSERT, UPDATE or DELETE statement are -** considered - auxiliary changes caused by [CREATE TRIGGER | triggers], +** considered - auxiliary changes caused by [CREATE TRIGGER | triggers], ** [foreign key actions] or [REPLACE] constraint resolution are not counted. -** -** Changes to a view that are intercepted by -** [INSTEAD OF trigger | INSTEAD OF triggers] are not counted. ^The value -** returned by sqlite3_changes() immediately after an INSERT, UPDATE or -** DELETE statement run on a view is always zero. Only changes made to real +** +** Changes to a view that are intercepted by +** [INSTEAD OF trigger | INSTEAD OF triggers] are not counted. ^The value +** returned by sqlite3_changes() immediately after an INSERT, UPDATE or +** DELETE statement run on a view is always zero. Only changes made to real ** tables are counted. ** ** Things are more complicated if the sqlite3_changes() function is ** executed while a trigger program is running. This may happen if the ** program uses the [changes() SQL function], or if some other callback ** function invokes sqlite3_changes() directly. Essentially: -** +** **
        **
      • ^(Before entering a trigger program the value returned by -** sqlite3_changes() function is saved. After the trigger program +** sqlite3_changes() function is saved. After the trigger program ** has finished, the original value is restored.)^ -** -**
      • ^(Within a trigger program each INSERT, UPDATE and DELETE -** statement sets the value returned by sqlite3_changes() -** upon completion as normal. Of course, this value will not include -** any changes performed by sub-triggers, as the sqlite3_changes() +** +**
      • ^(Within a trigger program each INSERT, UPDATE and DELETE +** statement sets the value returned by sqlite3_changes() +** upon completion as normal. Of course, this value will not include +** any changes performed by sub-triggers, as the sqlite3_changes() ** value will be saved and restored after each sub-trigger has run.)^ **
      -** +** ** ^This means that if the changes() SQL function (or similar) is used -** by the first INSERT, UPDATE or DELETE statement within a trigger, it +** by the first INSERT, UPDATE or DELETE statement within a trigger, it ** returns the value as set when the calling statement began executing. -** ^If it is used by the second or subsequent such statement within a trigger -** program, the value returned reflects the number of rows modified by the +** ^If it is used by the second or subsequent such statement within a trigger +** program, the value returned reflects the number of rows modified by the ** previous INSERT, UPDATE or DELETE statement within the same trigger. ** ** See also the [sqlite3_total_changes()] interface, the @@ -2142,12 +2142,12 @@ int sqlite3_changes(sqlite3*); ** since the database connection was opened, including those executed as ** part of trigger programs. ^Executing any other type of SQL statement ** does not affect the value returned by sqlite3_total_changes(). -** +** ** ^Changes made as part of [foreign key actions] are included in the ** count, but those made as part of REPLACE constraint resolution are -** not. ^Changes to a view that are intercepted by INSTEAD OF triggers +** not. ^Changes to a view that are intercepted by INSTEAD OF triggers ** are not counted. -** +** ** See also the [sqlite3_changes()] interface, the ** [count_changes pragma], and the [total_changes() SQL function]. ** @@ -2183,7 +2183,7 @@ int sqlite3_total_changes(sqlite3*); ** ** ^The sqlite3_interrupt(D) call is in effect until all currently running ** SQL statements on [database connection] D complete. ^Any new SQL statements -** that are started after the sqlite3_interrupt() call and before the +** that are started after the sqlite3_interrupt() call and before the ** running statements reaches zero are interrupted as if they had been ** running prior to the sqlite3_interrupt() call. ^New SQL statements ** that are started after the running statement count reaches zero are @@ -2218,7 +2218,7 @@ void sqlite3_interrupt(sqlite3*); ** ^These routines do not parse the SQL statements thus ** will not detect syntactically incorrect SQL. ** -** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior +** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior ** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked ** automatically by sqlite3_complete16(). If that initialization fails, ** then the return value from sqlite3_complete16() will be non-zero @@ -2263,7 +2263,7 @@ int sqlite3_complete16(const void *sql); ** The presence of a busy handler does not guarantee that it will be invoked ** when there is lock contention. ^If SQLite determines that invoking the busy ** handler could result in a deadlock, it will go ahead and return [SQLITE_BUSY] -** to the application instead of invoking the +** to the application instead of invoking the ** busy handler. ** Consider a scenario where one process is holding a read lock that ** it is trying to promote to a reserved lock and @@ -2288,7 +2288,7 @@ int sqlite3_complete16(const void *sql); ** database connection that invoked the busy handler. In other words, ** the busy handler is not reentrant. Any such actions ** result in undefined behavior. -** +** ** A busy handler must not close the database connection ** or [prepared statement] that invoked the busy handler. */ @@ -2677,7 +2677,7 @@ void sqlite3_randomness(int N, void *P); ** requested is ok. ^When the callback returns [SQLITE_DENY], the ** [sqlite3_prepare_v2()] or equivalent call that triggered the ** authorizer will fail with an error message explaining that -** access is denied. +** access is denied. ** ** ^The first parameter to the authorizer callback is a copy of the third ** parameter to the sqlite3_set_authorizer() interface. ^The second parameter @@ -2724,7 +2724,7 @@ void sqlite3_randomness(int N, void *P); ** database connections for the meaning of "modify" in this paragraph. ** ** ^When [sqlite3_prepare_v2()] is used to prepare a statement, the -** statement might be re-prepared during [sqlite3_step()] due to a +** statement might be re-prepared during [sqlite3_step()] due to a ** schema change. Hence, the application should ensure that the ** correct authorizer callback remains in place during the [sqlite3_step()]. ** @@ -2872,7 +2872,7 @@ SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, ** execution of the prepared statement, such as at the start of each ** trigger subprogram. ^The P argument is a pointer to the ** [prepared statement]. ^The X argument is a pointer to a string which -** is the unexpanded SQL text of the prepared statement or an SQL comment +** is the unexpanded SQL text of the prepared statement or an SQL comment ** that indicates the invocation of a trigger. ^The callback can compute ** the same text that would have been returned by the legacy [sqlite3_trace()] ** interface by using the X argument when X begins with "--" and invoking @@ -2888,7 +2888,7 @@ SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, ** ** [[SQLITE_TRACE_ROW]]
      SQLITE_TRACE_ROW
      **
      ^An SQLITE_TRACE_ROW callback is invoked whenever a prepared -** statement generates a single row of result. +** statement generates a single row of result. ** ^The P argument is a pointer to the [prepared statement] and the ** X argument is unused. ** @@ -2915,10 +2915,10 @@ SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, ** M argument should be the bitwise OR-ed combination of ** zero or more [SQLITE_TRACE] constants. ** -** ^Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides +** ^Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides ** (cancels) any prior calls to sqlite3_trace() or sqlite3_trace_v2(). ** -** ^The X callback is invoked whenever any of the events identified by +** ^The X callback is invoked whenever any of the events identified by ** mask M occur. ^The integer return value from the callback is currently ** ignored, though this may change in future releases. Callback ** implementations should return zero to ensure future compatibility. @@ -2950,8 +2950,8 @@ int sqlite3_trace_v2( ** database connection D. An example use for this ** interface is to keep a GUI updated during a large query. ** -** ^The parameter P is passed through as the only parameter to the -** callback function X. ^The parameter N is the approximate number of +** ^The parameter P is passed through as the only parameter to the +** callback function X. ^The parameter N is the approximate number of ** [virtual machine instructions] that are evaluated between successive ** invocations of the callback X. ^If N is less than one then the progress ** handler is disabled. @@ -2978,7 +2978,7 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** CAPI3REF: Opening A New Database Connection ** CONSTRUCTOR: sqlite3 ** -** ^These routines open an SQLite database file as specified by the +** ^These routines open an SQLite database file as specified by the ** filename argument. ^The filename argument is interpreted as UTF-8 for ** sqlite3_open() and sqlite3_open_v2() and as UTF-16 in the native byte ** order for sqlite3_open16(). ^(A [database connection] handle is usually @@ -3003,7 +3003,7 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** except that it accepts two additional parameters for additional control ** over the new database connection. ^(The flags parameter to ** sqlite3_open_v2() can take one of -** the following three values, optionally combined with the +** the following three values, optionally combined with the ** [SQLITE_OPEN_NOMUTEX], [SQLITE_OPEN_FULLMUTEX], [SQLITE_OPEN_SHAREDCACHE], ** [SQLITE_OPEN_PRIVATECACHE], and/or [SQLITE_OPEN_URI] flags:)^ ** @@ -3071,17 +3071,17 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** information. ** ** URI filenames are parsed according to RFC 3986. ^If the URI contains an -** authority, then it must be either an empty string or the string -** "localhost". ^If the authority is not an empty string or "localhost", an -** error is returned to the caller. ^The fragment component of a URI, if +** authority, then it must be either an empty string or the string +** "localhost". ^If the authority is not an empty string or "localhost", an +** error is returned to the caller. ^The fragment component of a URI, if ** present, is ignored. ** ** ^SQLite uses the path component of the URI as the name of the disk file -** which contains the database. ^If the path begins with a '/' character, -** then it is interpreted as an absolute path. ^If the path does not begin +** which contains the database. ^If the path begins with a '/' character, +** then it is interpreted as an absolute path. ^If the path does not begin ** with a '/' (meaning that the authority section is omitted from the URI) -** then the path is interpreted as a relative path. -** ^(On windows, the first component of an absolute path +** then the path is interpreted as a relative path. +** ^(On windows, the first component of an absolute path ** is a drive specification (e.g. "C:").)^ ** ** [[core URI query parameters]] @@ -3101,13 +3101,13 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** **
    • mode: ^(The mode parameter may be set to either "ro", "rw", ** "rwc", or "memory". Attempting to set it to any other value is -** an error)^. -** ^If "ro" is specified, then the database is opened for read-only -** access, just as if the [SQLITE_OPEN_READONLY] flag had been set in the -** third argument to sqlite3_open_v2(). ^If the mode option is set to -** "rw", then the database is opened for read-write (but not create) -** access, as if SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had -** been set. ^Value "rwc" is equivalent to setting both +** an error)^. +** ^If "ro" is specified, then the database is opened for read-only +** access, just as if the [SQLITE_OPEN_READONLY] flag had been set in the +** third argument to sqlite3_open_v2(). ^If the mode option is set to +** "rw", then the database is opened for read-write (but not create) +** access, as if SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had +** been set. ^Value "rwc" is equivalent to setting both ** SQLITE_OPEN_READWRITE and SQLITE_OPEN_CREATE. ^If the mode option is ** set to "memory" then a pure [in-memory database] that never reads ** or writes from disk is used. ^It is an error to specify a value for @@ -3117,7 +3117,7 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); **
    • cache: ^The cache parameter may be set to either "shared" or ** "private". ^Setting it to "shared" is equivalent to setting the ** SQLITE_OPEN_SHAREDCACHE bit in the flags argument passed to -** sqlite3_open_v2(). ^Setting the cache parameter to "private" is +** sqlite3_open_v2(). ^Setting the cache parameter to "private" is ** equivalent to setting the SQLITE_OPEN_PRIVATECACHE bit. ** ^If sqlite3_open_v2() is used and the "cache" parameter is present in ** a URI filename, its value overrides any behavior requested by setting @@ -3143,7 +3143,7 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** property on a database file that does in fact change can result ** in incorrect query results and/or [SQLITE_CORRUPT] errors. ** See also: [SQLITE_IOCAP_IMMUTABLE]. -** +** ** ** ** ^Specifying an unknown parameter in the query component of a URI is not an @@ -3155,36 +3155,36 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); ** ** **
      URI filenames Results -**
      file:data.db +**
      file:data.db ** Open the file "data.db" in the current directory. **
      file:/home/fred/data.db
      -** file:///home/fred/data.db
      -** file://localhost/home/fred/data.db
      +** file:///home/fred/data.db
      +** file://localhost/home/fred/data.db
      ** Open the database file "/home/fred/data.db". -**
      file://darkstar/home/fred/data.db +**
      file://darkstar/home/fred/data.db ** An error. "darkstar" is not a recognized authority. -**
      +**
      ** file:///C:/Documents%20and%20Settings/fred/Desktop/data.db ** Windows only: Open the file "data.db" on fred's desktop on drive -** C:. Note that the %20 escaping in this example is not strictly +** C:. Note that the %20 escaping in this example is not strictly ** necessary - space characters can be used literally ** in URI filenames. -**
      file:data.db?mode=ro&cache=private +**
      file:data.db?mode=ro&cache=private ** Open file "data.db" in the current directory for read-only access. ** Regardless of whether or not shared-cache mode is enabled by ** default, use a private cache. **
      file:/home/fred/data.db?vfs=unix-dotfile ** Open file "/home/fred/data.db". Use the special VFS "unix-dotfile" ** that uses dot-files in place of posix advisory locking. -**
      file:data.db?mode=readonly +**
      file:data.db?mode=readonly ** An error. "readonly" is not a valid option for the "mode" parameter. **
      ** ** ^URI hexadecimal escape sequences (%HH) are supported within the path and ** query components of a URI. A hexadecimal escape sequence consists of a -** percent sign - "%" - followed by exactly two hexadecimal digits +** percent sign - "%" - followed by exactly two hexadecimal digits ** specifying an octet value. ^Before the path or query components of a -** URI filename are interpreted, they are encoded using UTF-8 and all +** URI filename are interpreted, they are encoded using UTF-8 and all ** hexadecimal escape sequences replaced by a single byte containing the ** corresponding octet. If this process generates an invalid UTF-8 encoding, ** the results are undefined. @@ -3220,15 +3220,15 @@ int sqlite3_open_v2( ** CAPI3REF: Obtain Values For URI Parameters ** ** These are utility routines, useful to VFS implementations, that check -** to see if a database file was a URI that contained a specific query +** to see if a database file was a URI that contained a specific query ** parameter, and if so obtains the value of that query parameter. ** -** If F is the database filename pointer passed into the xOpen() method of -** a VFS implementation when the flags parameter to xOpen() has one or +** If F is the database filename pointer passed into the xOpen() method of +** a VFS implementation when the flags parameter to xOpen() has one or ** more of the [SQLITE_OPEN_URI] or [SQLITE_OPEN_MAIN_DB] bits set and ** P is the name of the query parameter, then ** sqlite3_uri_parameter(F,P) returns the value of the P -** parameter if it exists or a NULL pointer if P does not appear as a +** parameter if it exists or a NULL pointer if P does not appear as a ** query parameter on F. If P is a query parameter of F ** has no explicit value, then sqlite3_uri_parameter(F,P) returns ** a pointer to an empty string. @@ -3237,7 +3237,7 @@ int sqlite3_open_v2( ** parameter and returns true (1) or false (0) according to the value ** of P. The sqlite3_uri_boolean(F,P,B) routine returns true (1) if the ** value of query parameter P is one of "yes", "true", or "on" in any -** case or if the value begins with a non-zero number. The +** case or if the value begins with a non-zero number. The ** sqlite3_uri_boolean(F,P,B) routines returns false (0) if the value of ** query parameter P is one of "no", "false", or "off" in any case or ** if the value begins with a numeric zero. If P is not a query @@ -3248,7 +3248,7 @@ int sqlite3_open_v2( ** 64-bit signed integer and returns that integer, or D if P does not ** exist. If the value of P is something other than an integer, then ** zero is returned. -** +** ** If F is a NULL pointer, then sqlite3_uri_parameter(F,P) returns NULL and ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and ** is not a database file pathname pointer that SQLite passed into the xOpen @@ -3264,14 +3264,14 @@ sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64); ** CAPI3REF: Error Codes And Messages ** METHOD: sqlite3 ** -** ^If the most recent sqlite3_* API call associated with +** ^If the most recent sqlite3_* API call associated with ** [database connection] D failed, then the sqlite3_errcode(D) interface ** returns the numeric [result code] or [extended result code] for that ** API call. ** If the most recent API call was successful, ** then the return value from sqlite3_errcode() is undefined. ** ^The sqlite3_extended_errcode() -** interface is the same except that it always returns the +** interface is the same except that it always returns the ** [extended result code] even when extended result codes are ** disabled. ** @@ -3315,7 +3315,7 @@ const char *sqlite3_errstr(int); ** has been compiled into binary form and is ready to be evaluated. ** ** Think of each SQL statement as a separate computer program. The -** original SQL text is source code. A prepared statement object +** original SQL text is source code. A prepared statement object ** is the compiled object code. All SQL must be converted into a ** prepared statement before it can be run. ** @@ -3345,7 +3345,7 @@ typedef struct sqlite3_stmt sqlite3_stmt; ** new limit for that construct.)^ ** ** ^If the new limit is a negative number, the limit is unchanged. -** ^(For each limit category SQLITE_LIMIT_NAME there is a +** ^(For each limit category SQLITE_LIMIT_NAME there is a ** [limits | hard upper bound] ** set at compile-time by a C preprocessor macro called ** [limits | SQLITE_MAX_NAME]. @@ -3353,7 +3353,7 @@ typedef struct sqlite3_stmt sqlite3_stmt; ** ^Attempts to increase a limit above its hard upper bound are ** silently truncated to the hard upper bound. ** -** ^Regardless of whether or not the limit was changed, the +** ^Regardless of whether or not the limit was changed, the ** [sqlite3_limit()] interface returns the prior value of the limit. ** ^Hence, to find the current value of a limit without changing it, ** simply invoke this interface with the third parameter set to -1. @@ -3513,12 +3513,12 @@ int sqlite3_limit(sqlite3*, int id, int newVal); **
    • ** **
    • -** ^If the specific value bound to [parameter | host parameter] in the +** ^If the specific value bound to [parameter | host parameter] in the ** WHERE clause might influence the choice of query plan for a statement, -** then the statement will be automatically recompiled, as if there had been +** then the statement will be automatically recompiled, as if there had been ** a schema change, on the first [sqlite3_step()] call following any change -** to the [sqlite3_bind_text | bindings] of that [parameter]. -** ^The specific value of WHERE-clause [parameter] might influence the +** to the [sqlite3_bind_text | bindings] of that [parameter]. +** ^The specific value of WHERE-clause [parameter] might influence the ** choice of query plan if the parameter is the left-hand side of a [LIKE] ** or [GLOB] operator or if the parameter is compared to an indexed column ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled. @@ -3597,8 +3597,8 @@ char *sqlite3_expanded_sql(sqlite3_stmt *pStmt); ** the content of the database file. ** ** Note that [application-defined SQL functions] or -** [virtual tables] might change the database indirectly as a side effect. -** ^(For example, if an application defines a function "eval()" that +** [virtual tables] might change the database indirectly as a side effect. +** ^(For example, if an application defines a function "eval()" that ** calls [sqlite3_exec()], then the following SQL statement would ** change the database file through side-effects: ** @@ -3612,10 +3612,10 @@ char *sqlite3_expanded_sql(sqlite3_stmt *pStmt); ** ^Transaction control statements such as [BEGIN], [COMMIT], [ROLLBACK], ** [SAVEPOINT], and [RELEASE] cause sqlite3_stmt_readonly() to return true, ** since the statements themselves do not actually modify the database but -** rather they control the timing of when other statements modify the +** rather they control the timing of when other statements modify the ** database. ^The [ATTACH] and [DETACH] statements also cause ** sqlite3_stmt_readonly() to return true since, while those statements -** change the configuration of a database connection, they do not make +** change the configuration of a database connection, they do not make ** changes to the content of the database files on disk. ** ^The sqlite3_stmt_readonly() interface returns true for [BEGIN] since ** [BEGIN] merely sets internal flags, but the [BEGIN|BEGIN IMMEDIATE] and @@ -3629,18 +3629,18 @@ int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); ** METHOD: sqlite3_stmt ** ** ^The sqlite3_stmt_busy(S) interface returns true (non-zero) if the -** [prepared statement] S has been stepped at least once using +** [prepared statement] S has been stepped at least once using ** [sqlite3_step(S)] but has neither run to completion (returned ** [SQLITE_DONE] from [sqlite3_step(S)]) nor ** been reset using [sqlite3_reset(S)]. ^The sqlite3_stmt_busy(S) -** interface returns false if S is a NULL pointer. If S is not a +** interface returns false if S is a NULL pointer. If S is not a ** NULL pointer and is not a pointer to a valid [prepared statement] ** object, then the behavior is undefined and probably undesirable. ** ** This interface can be used in combination [sqlite3_next_stmt()] -** to locate all prepared statements associated with a database +** to locate all prepared statements associated with a database ** connection that are in need of being reset. This can be used, -** for example, in diagnostic routines to search for prepared +** for example, in diagnostic routines to search for prepared ** statements that are holding a transaction open. */ int sqlite3_stmt_busy(sqlite3_stmt*); @@ -3659,7 +3659,7 @@ int sqlite3_stmt_busy(sqlite3_stmt*); ** will accept either a protected or an unprotected sqlite3_value. ** Every interface that accepts sqlite3_value arguments specifies ** whether or not it requires a protected sqlite3_value. The -** [sqlite3_value_dup()] interface can be used to construct a new +** [sqlite3_value_dup()] interface can be used to construct a new ** protected sqlite3_value from an unprotected sqlite3_value. ** ** The terms "protected" and "unprotected" refer to whether or not @@ -3667,7 +3667,7 @@ int sqlite3_stmt_busy(sqlite3_stmt*); ** sqlite3_value object but no mutex is held for an unprotected ** sqlite3_value object. If SQLite is compiled to be single-threaded ** (with [SQLITE_THREADSAFE=0] and with [sqlite3_threadsafe()] returning 0) -** or if SQLite is run in one of reduced mutex modes +** or if SQLite is run in one of reduced mutex modes ** [SQLITE_CONFIG_SINGLETHREAD] or [SQLITE_CONFIG_MULTITHREAD] ** then there is no distinction between protected and unprotected ** sqlite3_value objects and they can be used interchangeably. However, @@ -3754,7 +3754,7 @@ typedef struct sqlite3_context sqlite3_context; ** or sqlite3_bind_text16() or sqlite3_bind_text64() then ** that parameter must be the byte offset ** where the NUL terminator would occur assuming the string were NUL -** terminated. If any NUL characters occur at byte offsets less than +** terminated. If any NUL characters occur at byte offsets less than ** the value of the fourth parameter then the resulting string value will ** contain embedded NULs. The result of expressions involving strings ** with embedded NULs is undefined. @@ -3913,7 +3913,7 @@ int sqlite3_clear_bindings(sqlite3_stmt*); ** METHOD: sqlite3_stmt ** ** ^Return the number of columns in the result set returned by the -** [prepared statement]. ^If this routine returns 0, that means the +** [prepared statement]. ^If this routine returns 0, that means the ** [prepared statement] returns no data (for example an [UPDATE]). ** ^However, just because this routine returns a positive number does not ** mean that one or more rows of data will be returned. ^A SELECT statement @@ -4097,7 +4097,7 @@ const void *sqlite3_column_decltype16(sqlite3_stmt*,int); ** For all versions of SQLite up to and including 3.6.23.1, a call to ** [sqlite3_reset()] was required after sqlite3_step() returned anything ** other than [SQLITE_ROW] before any subsequent invocation of -** sqlite3_step(). Failure to reset the prepared statement using +** sqlite3_step(). Failure to reset the prepared statement using ** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from ** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1], ** sqlite3_step() began @@ -4228,7 +4228,7 @@ int sqlite3_data_count(sqlite3_stmt *pStmt); ** the number of bytes in that string. ** ^If the result is NULL, then sqlite3_column_bytes16() returns zero. ** -** ^The values returned by [sqlite3_column_bytes()] and +** ^The values returned by [sqlite3_column_bytes()] and ** [sqlite3_column_bytes16()] do not include the zero terminators at the end ** of the string. ^For clarity: the values returned by ** [sqlite3_column_bytes()] and [sqlite3_column_bytes16()] are the number of @@ -4419,7 +4419,7 @@ int sqlite3_reset(sqlite3_stmt *pStmt); ** ^The second parameter is the name of the SQL function to be created or ** redefined. ^The length of the name is limited to 255 bytes in a UTF-8 ** representation, exclusive of the zero-terminator. ^Note that the name -** length limit is in UTF-8 bytes, not characters nor UTF-16 bytes. +** length limit is in UTF-8 bytes, not characters nor UTF-16 bytes. ** ^Any attempt to create a function with a longer name ** will result in [SQLITE_MISUSE] being returned. ** @@ -4434,7 +4434,7 @@ int sqlite3_reset(sqlite3_stmt *pStmt); ** ^The fourth parameter, eTextRep, specifies what ** [SQLITE_UTF8 | text encoding] this SQL function prefers for ** its parameters. The application should set this parameter to -** [SQLITE_UTF16LE] if the function implementation invokes +** [SQLITE_UTF16LE] if the function implementation invokes ** [sqlite3_value_text16le()] on an input, or [SQLITE_UTF16BE] if the ** implementation invokes [sqlite3_value_text16be()] on an input, or ** [SQLITE_UTF16] if [sqlite3_value_text16()] is used, or [SQLITE_UTF8] @@ -4465,13 +4465,13 @@ int sqlite3_reset(sqlite3_stmt *pStmt); ** callbacks. ** ** ^(If the ninth parameter to sqlite3_create_function_v2() is not NULL, -** then it is destructor for the application data pointer. +** then it is destructor for the application data pointer. ** The destructor is invoked when the function is deleted, either by being ** overloaded or when the database connection closes.)^ ** ^The destructor is also invoked if the call to ** sqlite3_create_function_v2() fails. ** ^When the destructor callback of the tenth parameter is invoked, it -** is passed a single argument which is a copy of the application data +** is passed a single argument which is a copy of the application data ** pointer which was the fifth parameter to sqlite3_create_function_v2(). ** ** ^It is permitted to register multiple implementations of the same @@ -4482,7 +4482,7 @@ int sqlite3_reset(sqlite3_stmt *pStmt); ** nArg parameter is a better match than a function implementation with ** a negative nArg. ^A function where the preferred text encoding ** matches the database encoding is a better -** match than a function where the encoding is different. +** match than a function where the encoding is different. ** ^A function where the encoding difference is between UTF16le and UTF16be ** is a closer match than a function where the encoding difference is ** between UTF8 and UTF16. @@ -4542,7 +4542,7 @@ int sqlite3_create_function_v2( /* ** CAPI3REF: Function Flags ** -** These constants may be ORed together with the +** These constants may be ORed together with the ** [SQLITE_UTF8 | preferred text encoding] as the fourth argument ** to [sqlite3_create_function()], [sqlite3_create_function16()], or ** [sqlite3_create_function_v2()]. @@ -4554,7 +4554,7 @@ int sqlite3_create_function_v2( ** DEPRECATED ** ** These functions are [deprecated]. In order to maintain -** backwards compatibility with older code, these functions continue +** backwards compatibility with older code, these functions continue ** to be supported. However, new applications should avoid ** the use of these functions. To encourage programmers to avoid ** these functions, we will not explain what they do. @@ -4575,7 +4575,7 @@ SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int), ** ** The C-language implementation of SQL functions and aggregates uses ** this set of interface routines to access the parameter values on -** the function or aggregate. +** the function or aggregate. ** ** The xFunc (for scalar functions) or xStep (for aggregates) parameters ** to [sqlite3_create_function()] and [sqlite3_create_function16()] @@ -4670,7 +4670,7 @@ void sqlite3_value_free(sqlite3_value*); ** Implementations of aggregate SQL functions use this ** routine to allocate memory for storing their state. ** -** ^The first time the sqlite3_aggregate_context(C,N) routine is called +** ^The first time the sqlite3_aggregate_context(C,N) routine is called ** for a particular aggregate function, SQLite ** allocates N of memory, zeroes out that memory, and returns a pointer ** to the new memory. ^On second and subsequent calls to @@ -4683,7 +4683,7 @@ void sqlite3_value_free(sqlite3_value*); ** In those cases, sqlite3_aggregate_context() might be called for the ** first time from within xFinal().)^ ** -** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer +** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer ** when first called if N is less than or equal to zero or if a memory ** allocate error occurs. ** @@ -4692,10 +4692,10 @@ void sqlite3_value_free(sqlite3_value*); ** value of N in subsequent call to sqlite3_aggregate_context() within ** the same aggregate function instance will not resize the memory ** allocation.)^ Within the xFinal callback, it is customary to set -** N=0 in calls to sqlite3_aggregate_context(C,N) so that no +** N=0 in calls to sqlite3_aggregate_context(C,N) so that no ** pointless memory allocations occur. ** -** ^SQLite automatically frees the memory allocated by +** ^SQLite automatically frees the memory allocated by ** sqlite3_aggregate_context() when the aggregate query concludes. ** ** The first parameter must be a copy of the @@ -4745,7 +4745,7 @@ sqlite3 *sqlite3_context_db_handle(sqlite3_context*); ** some circumstances the associated metadata may be preserved. An example ** of where this might be useful is in a regular-expression matching ** function. The compiled version of the regular expression can be stored as -** metadata associated with the pattern string. +** metadata associated with the pattern string. ** Then as long as the pattern string remains the same, ** the compiled regular expression can be reused on multiple ** invocations of the same function. @@ -4770,10 +4770,10 @@ sqlite3 *sqlite3_context_db_handle(sqlite3_context*); ** SQL statement)^, or **
    • ^(when sqlite3_set_auxdata() is invoked again on the same ** parameter)^, or -**
    • ^(during the original sqlite3_set_auxdata() call when a memory +**
    • ^(during the original sqlite3_set_auxdata() call when a memory ** allocation error occurs.)^ ** -** Note the last bullet in particular. The destructor X in +** Note the last bullet in particular. The destructor X in ** sqlite3_set_auxdata(C,N,P,X) might be called immediately, before the ** sqlite3_set_auxdata() interface even returns. Hence sqlite3_set_auxdata() ** should be called near the end of the function implementation and the @@ -4961,8 +4961,8 @@ int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); ** METHOD: sqlite3_context ** ** The sqlite3_result_subtype(C,T) function causes the subtype of -** the result from the [application-defined SQL function] with -** [sqlite3_context] C to be the value T. Only the lower 8 bits +** the result from the [application-defined SQL function] with +** [sqlite3_context] C to be the value T. Only the lower 8 bits ** of the subtype T are preserved in current versions of SQLite; ** higher order bits are discarded. ** The number of subtype bytes preserved by SQLite might increase @@ -5009,7 +5009,7 @@ void sqlite3_result_subtype(sqlite3_context*,unsigned int); ** deleted. ^When all collating functions having the same name are deleted, ** that collation is no longer usable. ** -** ^The collating function callback is invoked with a copy of the pArg +** ^The collating function callback is invoked with a copy of the pArg ** application data pointer and with two strings in the encoding specified ** by the eTextRep argument. The collating function must return an ** integer that is negative, zero, or positive @@ -5039,36 +5039,36 @@ void sqlite3_result_subtype(sqlite3_context*,unsigned int); ** calls to the collation creation functions or when the ** [database connection] is closed using [sqlite3_close()]. ** -** ^The xDestroy callback is not called if the +** ^The xDestroy callback is not called if the ** sqlite3_create_collation_v2() function fails. Applications that invoke -** sqlite3_create_collation_v2() with a non-NULL xDestroy argument should +** sqlite3_create_collation_v2() with a non-NULL xDestroy argument should ** check the return code and dispose of the application data pointer ** themselves rather than expecting SQLite to deal with it for them. -** This is different from every other SQLite interface. The inconsistency -** is unfortunate but cannot be changed without breaking backwards +** This is different from every other SQLite interface. The inconsistency +** is unfortunate but cannot be changed without breaking backwards ** compatibility. ** ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. */ int sqlite3_create_collation( - sqlite3*, - const char *zName, - int eTextRep, + sqlite3*, + const char *zName, + int eTextRep, void *pArg, int(*xCompare)(void*,int,const void*,int,const void*) ); int sqlite3_create_collation_v2( - sqlite3*, - const char *zName, - int eTextRep, + sqlite3*, + const char *zName, + int eTextRep, void *pArg, int(*xCompare)(void*,int,const void*,int,const void*), void(*xDestroy)(void*) ); int sqlite3_create_collation16( - sqlite3*, + sqlite3*, const void *zName, - int eTextRep, + int eTextRep, void *pArg, int(*xCompare)(void*,int,const void*,int,const void*) ); @@ -5101,12 +5101,12 @@ int sqlite3_create_collation16( ** [sqlite3_create_collation_v2()]. */ int sqlite3_collation_needed( - sqlite3*, - void*, + sqlite3*, + void*, void(*)(void*,sqlite3*,int eTextRep,const char*) ); int sqlite3_collation_needed16( - sqlite3*, + sqlite3*, void*, void(*)(void*,sqlite3*,int eTextRep,const void*) ); @@ -5148,7 +5148,7 @@ int sqlite3_rekey_v2( ); /* -** Specify the activation key for a SEE database. Unless +** Specify the activation key for a SEE database. Unless ** activated, none of the SEE routines will work. */ void sqlite3_activate_see( @@ -5158,7 +5158,7 @@ void sqlite3_activate_see( #ifdef SQLITE_ENABLE_CEROD /* -** Specify the activation key for a CEROD database. Unless +** Specify the activation key for a CEROD database. Unless ** activated, none of the CEROD routines will work. */ void sqlite3_activate_cerod( @@ -5214,7 +5214,7 @@ int sqlite3_sleep(int); ** ^The [temp_store_directory pragma] may modify this variable and cause ** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, ** the [temp_store_directory pragma] always assumes that any string -** that this variable points to is held in memory obtained from +** that this variable points to is held in memory obtained from ** [sqlite3_malloc] and the pragma may attempt to free that memory ** using [sqlite3_free]. ** Hence, if this variable is modified directly, either it should be @@ -5271,7 +5271,7 @@ SQLITE_EXTERN char *sqlite3_temp_directory; ** ^The [data_store_directory pragma] may modify this variable and cause ** it to point to memory obtained from [sqlite3_malloc]. ^Furthermore, ** the [data_store_directory pragma] always assumes that any string -** that this variable points to is held in memory obtained from +** that this variable points to is held in memory obtained from ** [sqlite3_malloc] and the pragma may attempt to free that memory ** using [sqlite3_free]. ** Hence, if this variable is modified directly, either it should be @@ -5460,7 +5460,7 @@ void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); ** and [sqlite3_preupdate_hook()] interfaces. */ void *sqlite3_update_hook( - sqlite3*, + sqlite3*, void(*)(void *,int ,char const *,char const *,sqlite3_int64), void* ); @@ -5474,7 +5474,7 @@ void *sqlite3_update_hook( ** and disabled if the argument is false.)^ ** ** ^Cache sharing is enabled and disabled for an entire process. -** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]). +** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]). ** In prior versions of SQLite, ** sharing was enabled or disabled for each thread separately. ** @@ -5491,8 +5491,8 @@ void *sqlite3_update_hook( ** cache setting should set it explicitly. ** ** Note: This method is disabled on MacOS X 10.7 and iOS version 5.0 -** and will always return SQLITE_MISUSE. On those systems, -** shared cache mode should be enabled per-database connection via +** and will always return SQLITE_MISUSE. On those systems, +** shared cache mode should be enabled per-database connection via ** [sqlite3_open_v2()] with [SQLITE_OPEN_SHAREDCACHE]. ** ** This interface is threadsafe on processors where writing a @@ -5542,7 +5542,7 @@ int sqlite3_db_release_memory(sqlite3*); ** as heap memory usages approaches the limit. ** ^The soft heap limit is "soft" because even though SQLite strives to stay ** below the limit, it will exceed the limit rather than generate -** an [SQLITE_NOMEM] error. In other words, the soft heap limit +** an [SQLITE_NOMEM] error. In other words, the soft heap limit ** is advisory only. ** ** ^The return value from sqlite3_soft_heap_limit64() is the size of @@ -5569,7 +5569,7 @@ int sqlite3_db_release_memory(sqlite3*); ** from the heap. ** )^ ** -** Beginning with SQLite [version 3.7.3] ([dateof:3.7.3]), +** Beginning with SQLite [version 3.7.3] ([dateof:3.7.3]), ** the soft heap limit is enforced ** regardless of whether or not the [SQLITE_ENABLE_MEMORY_MANAGEMENT] ** compile-time option is invoked. With [SQLITE_ENABLE_MEMORY_MANAGEMENT], @@ -5645,7 +5645,7 @@ SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N); ** ** ^If the specified table is actually a view, an [error code] is returned. ** -** ^If the specified column is "rowid", "oid" or "_rowid_" and the table +** ^If the specified column is "rowid", "oid" or "_rowid_" and the table ** is not a [WITHOUT ROWID] table and an ** [INTEGER PRIMARY KEY] column has been explicitly declared, then the output ** parameters are set for the explicitly declared column. ^(If there is no @@ -5711,7 +5711,7 @@ int sqlite3_table_column_metadata( ** prior to calling this API, ** otherwise an error will be returned. ** -** Security warning: It is recommended that the +** Security warning: It is recommended that the ** [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method be used to enable only this ** interface. The use of the [sqlite3_enable_load_extension()] interface ** should be avoided. This will keep the SQL function [load_extension()] @@ -5798,7 +5798,7 @@ int sqlite3_auto_extension(void(*xEntryPoint)(void)); ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the ** initialization routine X that was registered using a prior call to ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)] -** routine returns 1 if initialization routine X was successfully +** routine returns 1 if initialization routine X was successfully ** unregistered and it returns 0 if X was not on the list of initialization ** routines. */ @@ -5833,8 +5833,8 @@ typedef struct sqlite3_module sqlite3_module; ** CAPI3REF: Virtual Table Object ** KEYWORDS: sqlite3_module {virtual table module} ** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual tables]. +** This structure, sometimes called a "virtual table module", +** defines the implementation of a [virtual tables]. ** This structure consists mostly of methods for the module. ** ** ^A virtual table module is created by filling in a persistent @@ -5873,7 +5873,7 @@ struct sqlite3_module { void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), void **ppArg); int (*xRename)(sqlite3_vtab *pVtab, const char *zNew); - /* The methods above are in version 1 of the sqlite_module object. Those + /* The methods above are in version 1 of the sqlite_module object. Those ** below are for version 2 and greater. */ int (*xSavepoint)(sqlite3_vtab *pVTab, int); int (*xRelease)(sqlite3_vtab *pVTab, int); @@ -5920,7 +5920,7 @@ struct sqlite3_module { ** required by SQLite. If the table has at least 64 columns and any column ** to the right of the first 63 is required, then bit 63 of colUsed is also ** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to +** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to ** non-zero. ** ** The [xBestIndex] method must fill aConstraintUsage[] with information @@ -5941,17 +5941,17 @@ struct sqlite3_module { ** ** ^The estimatedCost value is an estimate of the cost of a particular ** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) +** to a linear scan of an SQLite table with N rows. A cost of log(N) ** indicates that the expense of the operation is similar to that of a ** binary search on a unique indexed field of an SQLite table with N rows. ** ** ^The estimatedRows value is an estimate of the number of rows that ** will be returned by the strategy. ** -** The xBestIndex method may optionally populate the idxFlags field with a +** The xBestIndex method may optionally populate the idxFlags field with a ** mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag - ** SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite -** assumes that the strategy may visit at most one row. +** assumes that the strategy may visit at most one row. ** ** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then ** SQLite also assumes that if a call to the xUpdate() method is made as @@ -5964,14 +5964,14 @@ struct sqlite3_module { ** the xUpdate method are automatically rolled back by SQLite. ** ** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). +** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). ** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely +** used with an SQLite version earlier than 3.8.2, the results of attempting +** to read or write the estimatedRows field are undefined (but are likely ** to included crashing the application). The estimatedRows field should ** therefore only be used if [sqlite3_libversion_number()] returns a ** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). +** was added for [version 3.9.0] ([dateof:3.9.0]). ** It may therefore only be used if ** sqlite3_libversion_number() returns a value greater than or equal to ** 3009000. @@ -6041,7 +6041,7 @@ struct sqlite3_index_info { ** preexisting [virtual table] for the module. ** ** ^The module name is registered on the [database connection] specified -** by the first parameter. ^The name of the module is given by the +** by the first parameter. ^The name of the module is given by the ** second parameter. ^The third parameter is a pointer to ** the implementation of the [virtual table module]. ^The fourth ** parameter is an arbitrary client data pointer that is passed through @@ -6133,7 +6133,7 @@ int sqlite3_declare_vtab(sqlite3*, const char *zSQL); ** METHOD: sqlite3 ** ** ^(Virtual tables can provide alternative implementations of functions -** using the [xFindFunction] method of the [virtual table module]. +** using the [xFindFunction] method of the [virtual table module]. ** But global versions of those functions ** must exist in order to be overloaded.)^ ** @@ -6184,7 +6184,7 @@ typedef struct sqlite3_blob sqlite3_blob; ** SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow; ** )^ ** -** ^(Parameter zDb is not the filename that contains the database, but +** ^(Parameter zDb is not the filename that contains the database, but ** rather the symbolic name of the database. For attached databases, this is ** the name that appears after the AS keyword in the [ATTACH] statement. ** For the main database file, the database name is "main". For TEMP @@ -6197,28 +6197,28 @@ typedef struct sqlite3_blob sqlite3_blob; ** ^(On success, [SQLITE_OK] is returned and the new [BLOB handle] is stored ** in *ppBlob. Otherwise an [error code] is returned and, unless the error ** code is SQLITE_MISUSE, *ppBlob is set to NULL.)^ ^This means that, provided -** the API is not misused, it is always safe to call [sqlite3_blob_close()] +** the API is not misused, it is always safe to call [sqlite3_blob_close()] ** on *ppBlob after this function it returns. ** ** This function fails with SQLITE_ERROR if any of the following are true: **
        -**
      • ^(Database zDb does not exist)^, -**
      • ^(Table zTable does not exist within database zDb)^, -**
      • ^(Table zTable is a WITHOUT ROWID table)^, +**
      • ^(Database zDb does not exist)^, +**
      • ^(Table zTable does not exist within database zDb)^, +**
      • ^(Table zTable is a WITHOUT ROWID table)^, **
      • ^(Column zColumn does not exist)^, **
      • ^(Row iRow is not present in the table)^, **
      • ^(The specified column of row iRow contains a value that is not ** a TEXT or BLOB value)^, -**
      • ^(Column zColumn is part of an index, PRIMARY KEY or UNIQUE +**
      • ^(Column zColumn is part of an index, PRIMARY KEY or UNIQUE ** constraint and the blob is being opened for read/write access)^, -**
      • ^([foreign key constraints | Foreign key constraints] are enabled, +**
      • ^([foreign key constraints | Foreign key constraints] are enabled, ** column zColumn is part of a [child key] definition and the blob is ** being opened for read/write access)^. **
      ** -** ^Unless it returns SQLITE_MISUSE, this function sets the -** [database connection] error code and message accessible via -** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. +** ^Unless it returns SQLITE_MISUSE, this function sets the +** [database connection] error code and message accessible via +** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. ** ** A BLOB referenced by sqlite3_blob_open() may be read using the ** [sqlite3_blob_read()] interface and modified by using @@ -6244,7 +6244,7 @@ typedef struct sqlite3_blob sqlite3_blob; ** blob. ** ** ^The [sqlite3_bind_zeroblob()] and [sqlite3_result_zeroblob()] interfaces -** and the built-in [zeroblob] SQL function may be used to create a +** and the built-in [zeroblob] SQL function may be used to create a ** zero-filled blob to read or write using the incremental-blob interface. ** ** To avoid a resource leak, every open [BLOB handle] should eventually @@ -6294,7 +6294,7 @@ int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); ** DESTRUCTOR: sqlite3_blob ** ** ^This function closes an open [BLOB handle]. ^(The BLOB handle is closed -** unconditionally. Even if this routine returns an error code, the +** unconditionally. Even if this routine returns an error code, the ** handle is still closed.)^ ** ** ^If the blob handle being closed was opened for read-write access, and if @@ -6304,10 +6304,10 @@ int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); ** code is returned and the transaction rolled back. ** ** Calling this function with an argument that is not a NULL pointer or an -** open blob handle results in undefined behaviour. ^Calling this routine -** with a null pointer (such as would be returned by a failed call to +** open blob handle results in undefined behaviour. ^Calling this routine +** with a null pointer (such as would be returned by a failed call to ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function -** is passed a valid open blob handle, the values returned by the +** is passed a valid open blob handle, the values returned by the ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning. */ int sqlite3_blob_close(sqlite3_blob *); @@ -6316,7 +6316,7 @@ int sqlite3_blob_close(sqlite3_blob *); ** CAPI3REF: Return The Size Of An Open BLOB ** METHOD: sqlite3_blob ** -** ^Returns the size in bytes of the BLOB accessible via the +** ^Returns the size in bytes of the BLOB accessible via the ** successfully opened [BLOB handle] in its only argument. ^The ** incremental blob I/O routines can only read or overwriting existing ** blob content; they cannot change the size of a blob. @@ -6367,9 +6367,9 @@ int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); ** ** ^(On success, sqlite3_blob_write() returns SQLITE_OK. ** Otherwise, an [error code] or an [extended error code] is returned.)^ -** ^Unless SQLITE_MISUSE is returned, this function sets the -** [database connection] error code and message accessible via -** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. +** ^Unless SQLITE_MISUSE is returned, this function sets the +** [database connection] error code and message accessible via +** [sqlite3_errcode()] and [sqlite3_errmsg()] and related functions. ** ** ^If the [BLOB handle] passed as the first argument was not opened for ** writing (the flags parameter to [sqlite3_blob_open()] was zero), @@ -6378,9 +6378,9 @@ int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); ** This function may only modify the contents of the BLOB; it is ** not possible to increase the size of a BLOB using this API. ** ^If offset iOffset is less than N bytes from the end of the BLOB, -** [SQLITE_ERROR] is returned and no data is written. The size of the -** BLOB (and hence the maximum value of N+iOffset) can be determined -** using the [sqlite3_blob_bytes()] interface. ^If N or iOffset are less +** [SQLITE_ERROR] is returned and no data is written. The size of the +** BLOB (and hence the maximum value of N+iOffset) can be determined +** using the [sqlite3_blob_bytes()] interface. ^If N or iOffset are less ** than zero [SQLITE_ERROR] is returned and no data is written. ** ** ^An attempt to write to an expired [BLOB handle] fails with an @@ -6532,7 +6532,7 @@ int sqlite3_vfs_unregister(sqlite3_vfs*); ** ^(Some systems (for example, Windows 95) do not support the operation ** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try() ** will always return SQLITE_BUSY. The SQLite core only ever uses -** sqlite3_mutex_try() as an optimization so this is acceptable +** sqlite3_mutex_try() as an optimization so this is acceptable ** behavior.)^ ** ** ^The sqlite3_mutex_leave() routine exits a mutex that was @@ -6695,7 +6695,7 @@ int sqlite3_mutex_notheld(sqlite3_mutex*); ** CAPI3REF: Retrieve the mutex for a database connection ** METHOD: sqlite3 ** -** ^This interface returns a pointer the [sqlite3_mutex] object that +** ^This interface returns a pointer the [sqlite3_mutex] object that ** serializes access to the [database connection] given in the argument ** when the [threading mode] is Serialized. ** ^If the [threading mode] is Single-thread or Multi-thread then this @@ -6850,7 +6850,7 @@ int sqlite3_status64( **
      This parameter records the largest memory allocation request ** handed to [sqlite3_malloc()] or [sqlite3_realloc()] (or their ** internal equivalents). Only the value returned in the -** *pHighwater parameter to [sqlite3_status()] is of interest. +** *pHighwater parameter to [sqlite3_status()] is of interest. ** The value written into the *pCurrent parameter is undefined.
      )^ ** ** [[SQLITE_STATUS_MALLOC_COUNT]] ^(
      SQLITE_STATUS_MALLOC_COUNT
      @@ -6859,11 +6859,11 @@ int sqlite3_status64( ** ** [[SQLITE_STATUS_PAGECACHE_USED]] ^(
      SQLITE_STATUS_PAGECACHE_USED
      **
      This parameter returns the number of pages used out of the -** [pagecache memory allocator] that was configured using +** [pagecache memory allocator] that was configured using ** [SQLITE_CONFIG_PAGECACHE]. The ** value returned is in pages, not in bytes.
      )^ ** -** [[SQLITE_STATUS_PAGECACHE_OVERFLOW]] +** [[SQLITE_STATUS_PAGECACHE_OVERFLOW]] ** ^(
      SQLITE_STATUS_PAGECACHE_OVERFLOW
      **
      This parameter returns the number of bytes of page cache ** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] @@ -6876,7 +6876,7 @@ int sqlite3_status64( ** [[SQLITE_STATUS_PAGECACHE_SIZE]] ^(
      SQLITE_STATUS_PAGECACHE_SIZE
      **
      This parameter records the largest memory allocation request ** handed to [pagecache memory allocator]. Only the value returned in the -** *pHighwater parameter to [sqlite3_status()] is of interest. +** *pHighwater parameter to [sqlite3_status()] is of interest. ** The value written into the *pCurrent parameter is undefined.
      )^ ** ** [[SQLITE_STATUS_SCRATCH_USED]] ^(
      SQLITE_STATUS_SCRATCH_USED
      @@ -6900,11 +6900,11 @@ int sqlite3_status64( ** [[SQLITE_STATUS_SCRATCH_SIZE]] ^(
      SQLITE_STATUS_SCRATCH_SIZE
      **
      This parameter records the largest memory allocation request ** handed to [scratch memory allocator]. Only the value returned in the -** *pHighwater parameter to [sqlite3_status()] is of interest. +** *pHighwater parameter to [sqlite3_status()] is of interest. ** The value written into the *pCurrent parameter is undefined.
      )^ ** ** [[SQLITE_STATUS_PARSER_STACK]] ^(
      SQLITE_STATUS_PARSER_STACK
      -**
      The *pHighwater parameter records the deepest parser stack. +**
      The *pHighwater parameter records the deepest parser stack. ** The *pCurrent value is undefined. The *pHighwater value is only ** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].
      )^ ** @@ -6926,12 +6926,12 @@ int sqlite3_status64( ** CAPI3REF: Database Connection Status ** METHOD: sqlite3 ** -** ^This interface is used to retrieve runtime status information +** ^This interface is used to retrieve runtime status information ** about a single [database connection]. ^The first argument is the ** database connection object to be interrogated. ^The second argument ** is an integer constant, taken from the set of ** [SQLITE_DBSTATUS options], that -** determines the parameter to interrogate. The set of +** determines the parameter to interrogate. The set of ** [SQLITE_DBSTATUS options] is likely ** to grow in future releases of SQLite. ** @@ -6966,7 +6966,7 @@ int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); ** checked out.
    • )^ ** ** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(
      SQLITE_DBSTATUS_LOOKASIDE_HIT
      -**
      This parameter returns the number malloc attempts that were +**
      This parameter returns the number malloc attempts that were ** satisfied using lookaside memory. Only the high-water value is meaningful; ** the current value is always zero.)^ ** @@ -6991,7 +6991,7 @@ int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); ** memory used by all pager caches associated with the database connection.)^ ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. ** -** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] +** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] ** ^(
      SQLITE_DBSTATUS_CACHE_USED_SHARED
      **
      This parameter is similar to DBSTATUS_CACHE_USED, except that if a ** pager cache is shared between two or more connections the bytes of heap @@ -7006,7 +7006,7 @@ int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); ** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(
      SQLITE_DBSTATUS_SCHEMA_USED
      **
      This parameter returns the approximate number of bytes of heap ** memory used to store the schema for all databases associated -** with the connection - main, temp, and any [ATTACH]-ed databases.)^ +** with the connection - main, temp, and any [ATTACH]-ed databases.)^ ** ^The full amount of memory used by the schemas is reported, even if the ** schema memory is shared with other database connections due to ** [shared cache mode] being enabled. @@ -7021,13 +7021,13 @@ int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); ** ** [[SQLITE_DBSTATUS_CACHE_HIT]] ^(
      SQLITE_DBSTATUS_CACHE_HIT
      **
      This parameter returns the number of pager cache hits that have -** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT +** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT ** is always 0. **
      ** ** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(
      SQLITE_DBSTATUS_CACHE_MISS
      **
      This parameter returns the number of pager cache misses that have -** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS +** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS ** is always 0. **
      ** @@ -7075,7 +7075,7 @@ int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); ** statements. For example, if the number of table steps greatly exceeds ** the number of table searches or result rows, that would tend to indicate ** that the prepared statement is using a full table scan rather than -** an index. +** an index. ** ** ^(This interface is used to retrieve and reset counter values from ** a [prepared statement]. The first argument is the prepared statement @@ -7102,7 +7102,7 @@ int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** [[SQLITE_STMTSTATUS_FULLSCAN_STEP]]
      SQLITE_STMTSTATUS_FULLSCAN_STEP
      **
      ^This is the number of times that SQLite has stepped forward in ** a table as part of a full table scan. Large numbers for this counter -** may indicate opportunities for performance improvement through +** may indicate opportunities for performance improvement through ** careful use of indices.
      ** ** [[SQLITE_STMTSTATUS_SORT]]
      SQLITE_STMTSTATUS_SORT
      @@ -7120,7 +7120,7 @@ int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** [[SQLITE_STMTSTATUS_VM_STEP]]
      SQLITE_STMTSTATUS_VM_STEP
      **
      ^This is the number of virtual machine operations executed ** by the prepared statement if that number is less than or equal -** to 2147483647. The number of virtual machine operations can be +** to 2147483647. The number of virtual machine operations can be ** used as a proxy for the total work done by the prepared statement. ** If the number of virtual machine operations exceeds 2147483647 ** then the value returned by this statement status code is undefined. @@ -7166,15 +7166,15 @@ struct sqlite3_pcache_page { ** KEYWORDS: {page cache} ** ** ^(The [sqlite3_config]([SQLITE_CONFIG_PCACHE2], ...) interface can -** register an alternative page cache implementation by passing in an +** register an alternative page cache implementation by passing in an ** instance of the sqlite3_pcache_methods2 structure.)^ -** In many applications, most of the heap memory allocated by +** In many applications, most of the heap memory allocated by ** SQLite is used for the page cache. -** By implementing a +** By implementing a ** custom page cache using this API, an application can better control -** the amount of memory consumed by SQLite, the way in which -** that memory is allocated and released, and the policies used to -** determine exactly which parts of a database file are cached and for +** the amount of memory consumed by SQLite, the way in which +** that memory is allocated and released, and the policies used to +** determine exactly which parts of a database file are cached and for ** how long. ** ** The alternative page cache mechanism is an @@ -7187,19 +7187,19 @@ struct sqlite3_pcache_page { ** [sqlite3_config()] returns.)^ ** ** [[the xInit() page cache method]] -** ^(The xInit() method is called once for each effective +** ^(The xInit() method is called once for each effective ** call to [sqlite3_initialize()])^ ** (usually only once during the lifetime of the process). ^(The xInit() ** method is passed a copy of the sqlite3_pcache_methods2.pArg value.)^ -** The intent of the xInit() method is to set up global data structures -** required by the custom page cache implementation. -** ^(If the xInit() method is NULL, then the +** The intent of the xInit() method is to set up global data structures +** required by the custom page cache implementation. +** ^(If the xInit() method is NULL, then the ** built-in default page cache is used instead of the application defined ** page cache.)^ ** ** [[the xShutdown() page cache method]] ** ^The xShutdown() method is called by [sqlite3_shutdown()]. -** It can be used to clean up +** It can be used to clean up ** any outstanding resources before process shutdown, if required. ** ^The xShutdown() method may be NULL. ** @@ -7218,7 +7218,7 @@ struct sqlite3_pcache_page { ** though this is not guaranteed. ^The ** first parameter, szPage, is the size in bytes of the pages that must ** be allocated by the cache. ^szPage will always a power of two. ^The -** second parameter szExtra is a number of bytes of extra storage +** second parameter szExtra is a number of bytes of extra storage ** associated with each page cache entry. ^The szExtra parameter will ** a number less than 250. SQLite will use the ** extra szExtra bytes on each page to store metadata about the underlying @@ -7231,7 +7231,7 @@ struct sqlite3_pcache_page { ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will ** never invoke xUnpin() except to deliberately delete a page. ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to -** false will always have the "discard" flag set to true. +** false will always have the "discard" flag set to true. ** ^Hence, a cache created with bPurgeable false will ** never contain any unpinned pages. ** @@ -7246,12 +7246,12 @@ struct sqlite3_pcache_page { ** [[the xPagecount() page cache methods]] ** The xPagecount() method must return the number of pages currently ** stored in the cache, both pinned and unpinned. -** +** ** [[the xFetch() page cache methods]] -** The xFetch() method locates a page in the cache and returns a pointer to +** The xFetch() method locates a page in the cache and returns a pointer to ** an sqlite3_pcache_page object associated with that page, or a NULL pointer. ** The pBuf element of the returned sqlite3_pcache_page object will be a -** pointer to a buffer of szPage bytes used to store the content of a +** pointer to a buffer of szPage bytes used to store the content of a ** single database page. The pExtra element of sqlite3_pcache_page will be ** a pointer to the szExtra bytes of extra storage that SQLite has requested ** for each entry in the page cache. @@ -7290,8 +7290,8 @@ struct sqlite3_pcache_page { ** page cache implementation. ^The page cache implementation ** may choose to evict unpinned pages at any time. ** -** The cache must not perform any reference counting. A single -** call to xUnpin() unpins the page regardless of the number of prior calls +** The cache must not perform any reference counting. A single +** call to xUnpin() unpins the page regardless of the number of prior calls ** to xFetch(). ** ** [[the xRekey() page cache methods]] @@ -7331,7 +7331,7 @@ struct sqlite3_pcache_methods2 { int (*xPagecount)(sqlite3_pcache*); sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); - void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, + void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, unsigned oldKey, unsigned newKey); void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); void (*xDestroy)(sqlite3_pcache*); @@ -7376,7 +7376,7 @@ typedef struct sqlite3_backup sqlite3_backup; ** ** The backup API copies the content of one database into another. ** It is useful either for creating backups of databases or -** for copying in-memory databases to or from persistent files. +** for copying in-memory databases to or from persistent files. ** ** See Also: [Using the SQLite Online Backup API] ** @@ -7387,36 +7387,36 @@ typedef struct sqlite3_backup sqlite3_backup; ** ^Thus, the backup may be performed on a live source database without ** preventing other database connections from ** reading or writing to the source database while the backup is underway. -** -** ^(To perform a backup operation: +** +** ^(To perform a backup operation: **
        **
      1. sqlite3_backup_init() is called once to initialize the -** backup, -**
      2. sqlite3_backup_step() is called one or more times to transfer +** backup, +**
      3. sqlite3_backup_step() is called one or more times to transfer ** the data between the two databases, and finally -**
      4. sqlite3_backup_finish() is called to release all resources -** associated with the backup operation. +**
      5. sqlite3_backup_finish() is called to release all resources +** associated with the backup operation. **
      )^ ** There should be exactly one call to sqlite3_backup_finish() for each ** successful call to sqlite3_backup_init(). ** ** [[sqlite3_backup_init()]] sqlite3_backup_init() ** -** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the -** [database connection] associated with the destination database +** ^The D and N arguments to sqlite3_backup_init(D,N,S,M) are the +** [database connection] associated with the destination database ** and the database name, respectively. ** ^The database name is "main" for the main database, "temp" for the ** temporary database, or the name specified after the AS keyword in ** an [ATTACH] statement for an attached database. -** ^The S and M arguments passed to +** ^The S and M arguments passed to ** sqlite3_backup_init(D,N,S,M) identify the [database connection] ** and database name of the source database, respectively. ** ^The source and destination [database connections] (parameters S and D) ** must be different or else sqlite3_backup_init(D,N,S,M) will fail with ** an error. ** -** ^A call to sqlite3_backup_init() will fail, returning NULL, if -** there is already a read or read-write transaction open on the +** ^A call to sqlite3_backup_init() will fail, returning NULL, if +** there is already a read or read-write transaction open on the ** destination database. ** ** ^If an error occurs within sqlite3_backup_init(D,N,S,M), then NULL is @@ -7428,14 +7428,14 @@ typedef struct sqlite3_backup sqlite3_backup; ** ^A successful call to sqlite3_backup_init() returns a pointer to an ** [sqlite3_backup] object. ** ^The [sqlite3_backup] object may be used with the sqlite3_backup_step() and -** sqlite3_backup_finish() functions to perform the specified backup +** sqlite3_backup_finish() functions to perform the specified backup ** operation. ** ** [[sqlite3_backup_step()]] sqlite3_backup_step() ** -** ^Function sqlite3_backup_step(B,N) will copy up to N pages between +** ^Function sqlite3_backup_step(B,N) will copy up to N pages between ** the source and destination databases specified by [sqlite3_backup] object B. -** ^If N is negative, all remaining source pages are copied. +** ^If N is negative, all remaining source pages are copied. ** ^If sqlite3_backup_step(B,N) successfully copies N pages and there ** are still more pages to be copied, then the function returns [SQLITE_OK]. ** ^If sqlite3_backup_step(B,N) successfully finishes copying all pages @@ -7457,8 +7457,8 @@ typedef struct sqlite3_backup sqlite3_backup; ** ** ^If sqlite3_backup_step() cannot obtain a required file-system lock, then ** the [sqlite3_busy_handler | busy-handler function] -** is invoked (if one is specified). ^If the -** busy-handler returns non-zero before the lock is available, then +** is invoked (if one is specified). ^If the +** busy-handler returns non-zero before the lock is available, then ** [SQLITE_BUSY] is returned to the caller. ^In this case the call to ** sqlite3_backup_step() can be retried later. ^If the source ** [database connection] @@ -7466,15 +7466,15 @@ typedef struct sqlite3_backup sqlite3_backup; ** is called, then [SQLITE_LOCKED] is returned immediately. ^Again, in this ** case the call to sqlite3_backup_step() can be retried later on. ^(If ** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX], [SQLITE_NOMEM], or -** [SQLITE_READONLY] is returned, then -** there is no point in retrying the call to sqlite3_backup_step(). These -** errors are considered fatal.)^ The application must accept -** that the backup operation has failed and pass the backup operation handle +** [SQLITE_READONLY] is returned, then +** there is no point in retrying the call to sqlite3_backup_step(). These +** errors are considered fatal.)^ The application must accept +** that the backup operation has failed and pass the backup operation handle ** to the sqlite3_backup_finish() to release associated resources. ** ** ^The first call to sqlite3_backup_step() obtains an exclusive lock -** on the destination file. ^The exclusive lock is not released until either -** sqlite3_backup_finish() is called or the backup operation is complete +** on the destination file. ^The exclusive lock is not released until either +** sqlite3_backup_finish() is called or the backup operation is complete ** and sqlite3_backup_step() returns [SQLITE_DONE]. ^Every call to ** sqlite3_backup_step() obtains a [shared lock] on the source database that ** lasts for the duration of the sqlite3_backup_step() call. @@ -7483,18 +7483,18 @@ typedef struct sqlite3_backup sqlite3_backup; ** through the backup process. ^If the source database is modified by an ** external process or via a database connection other than the one being ** used by the backup operation, then the backup will be automatically -** restarted by the next call to sqlite3_backup_step(). ^If the source +** restarted by the next call to sqlite3_backup_step(). ^If the source ** database is modified by the using the same database connection as is used ** by the backup operation, then the backup database is automatically ** updated at the same time. ** ** [[sqlite3_backup_finish()]] sqlite3_backup_finish() ** -** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the +** When sqlite3_backup_step() has returned [SQLITE_DONE], or when the ** application wishes to abandon the backup operation, the application ** should destroy the [sqlite3_backup] by passing it to sqlite3_backup_finish(). ** ^The sqlite3_backup_finish() interfaces releases all -** resources associated with the [sqlite3_backup] object. +** resources associated with the [sqlite3_backup] object. ** ^If sqlite3_backup_step() has not yet returned [SQLITE_DONE], then any ** active write-transaction on the destination database is rolled back. ** The [sqlite3_backup] object is invalid @@ -7534,8 +7534,8 @@ typedef struct sqlite3_backup sqlite3_backup; ** connections, then the source database connection may be used concurrently ** from within other threads. ** -** However, the application must guarantee that the destination -** [database connection] is not passed to any other API (by any thread) after +** However, the application must guarantee that the destination +** [database connection] is not passed to any other API (by any thread) after ** sqlite3_backup_init() is called and before the corresponding call to ** sqlite3_backup_finish(). SQLite does not currently check to see ** if the application incorrectly accesses the destination [database connection] @@ -7546,11 +7546,11 @@ typedef struct sqlite3_backup sqlite3_backup; ** If running in [shared cache mode], the application must ** guarantee that the shared cache used by the destination database ** is not accessed while the backup is running. In practice this means -** that the application must guarantee that the disk file being +** that the application must guarantee that the disk file being ** backed up to is not accessed by any connection within the process, ** not just the specific connection that was passed to sqlite3_backup_init(). ** -** The [sqlite3_backup] object itself is partially threadsafe. Multiple +** The [sqlite3_backup] object itself is partially threadsafe. Multiple ** threads may safely make multiple concurrent calls to sqlite3_backup_step(). ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() ** APIs are not strictly speaking threadsafe. If they are invoked at the @@ -7575,8 +7575,8 @@ int sqlite3_backup_pagecount(sqlite3_backup *p); ** ^When running in shared-cache mode, a database operation may fail with ** an [SQLITE_LOCKED] error if the required locks on the shared-cache or ** individual tables within the shared-cache cannot be obtained. See -** [SQLite Shared-Cache Mode] for a description of shared-cache locking. -** ^This API may be used to register a callback that SQLite will invoke +** [SQLite Shared-Cache Mode] for a description of shared-cache locking. +** ^This API may be used to register a callback that SQLite will invoke ** when the connection currently holding the required lock relinquishes it. ** ^This API is only available if the library was compiled with the ** [SQLITE_ENABLE_UNLOCK_NOTIFY] C-preprocessor symbol defined. @@ -7584,14 +7584,14 @@ int sqlite3_backup_pagecount(sqlite3_backup *p); ** See Also: [Using the SQLite Unlock Notification Feature]. ** ** ^Shared-cache locks are released when a database connection concludes -** its current transaction, either by committing it or rolling it back. +** its current transaction, either by committing it or rolling it back. ** ** ^When a connection (known as the blocked connection) fails to obtain a ** shared-cache lock and SQLITE_LOCKED is returned to the caller, the ** identity of the database connection (the blocking connection) that -** has locked the required resource is stored internally. ^After an +** has locked the required resource is stored internally. ^After an ** application receives an SQLITE_LOCKED error, it may call the -** sqlite3_unlock_notify() method with the blocked connection handle as +** sqlite3_unlock_notify() method with the blocked connection handle as ** the first argument to register for a callback that will be invoked ** when the blocking connections current transaction is concluded. ^The ** callback is invoked from within the [sqlite3_step] or [sqlite3_close] @@ -7605,15 +7605,15 @@ int sqlite3_backup_pagecount(sqlite3_backup *p); ** ** ^If the blocked connection is attempting to obtain a write-lock on a ** shared-cache table, and more than one other connection currently holds -** a read-lock on the same table, then SQLite arbitrarily selects one of +** a read-lock on the same table, then SQLite arbitrarily selects one of ** the other connections to use as the blocking connection. ** -** ^(There may be at most one unlock-notify callback registered by a +** ^(There may be at most one unlock-notify callback registered by a ** blocked connection. If sqlite3_unlock_notify() is called when the ** blocked connection already has a registered unlock-notify callback, ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is ** called with a NULL pointer as its second argument, then any existing -** unlock-notify callback is canceled. ^The blocked connections +** unlock-notify callback is canceled. ^The blocked connections ** unlock-notify callback may also be canceled by closing the blocked ** connection using [sqlite3_close()]. ** @@ -7626,7 +7626,7 @@ int sqlite3_backup_pagecount(sqlite3_backup *p); ** ** Callback Invocation Details ** -** When an unlock-notify callback is registered, the application provides a +** When an unlock-notify callback is registered, the application provides a ** single void* pointer that is passed to the callback when it is invoked. ** However, the signature of the callback function allows SQLite to pass ** it an array of void* context pointers. The first argument passed to @@ -7639,12 +7639,12 @@ int sqlite3_backup_pagecount(sqlite3_backup *p); ** same callback function, then instead of invoking the callback function ** multiple times, it is invoked once with the set of void* context pointers ** specified by the blocked connections bundled together into an array. -** This gives the application an opportunity to prioritize any actions +** This gives the application an opportunity to prioritize any actions ** related to the set of unblocked database connections. ** ** Deadlock Detection ** -** Assuming that after registering for an unlock-notify callback a +** Assuming that after registering for an unlock-notify callback a ** database waits for the callback to be issued before taking any further ** action (a reasonable assumption), then using this API may cause the ** application to deadlock. For example, if connection X is waiting for @@ -7667,7 +7667,7 @@ int sqlite3_backup_pagecount(sqlite3_backup *p); ** ** The "DROP TABLE" Exception ** -** When a call to [sqlite3_step()] returns SQLITE_LOCKED, it is almost +** When a call to [sqlite3_step()] returns SQLITE_LOCKED, it is almost ** always appropriate to call sqlite3_unlock_notify(). There is however, ** one exception. When executing a "DROP TABLE" or "DROP INDEX" statement, ** SQLite checks if there are any currently executing SELECT statements @@ -7680,7 +7680,7 @@ int sqlite3_backup_pagecount(sqlite3_backup *p); ** One way around this problem is to check the extended error code returned ** by an sqlite3_step() call. ^(If there is a blocking connection, then the ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in -** the special "DROP TABLE/INDEX" case, the extended error code is just +** the special "DROP TABLE/INDEX" case, the extended error code is just ** SQLITE_LOCKED.)^ */ int sqlite3_unlock_notify( @@ -7794,8 +7794,8 @@ void sqlite3_log(int iErrCode, const char *zFormat, ...); ** ^The [sqlite3_wal_hook()] function is used to register a callback that ** is invoked each time data is committed to a database in wal mode. ** -** ^(The callback is invoked by SQLite after the commit has taken place and -** the associated write-lock on the database released)^, so the implementation +** ^(The callback is invoked by SQLite after the commit has taken place and +** the associated write-lock on the database released)^, so the implementation ** may read, write or [checkpoint] the database as required. ** ** ^The first parameter passed to the callback function when it is invoked @@ -7814,7 +7814,7 @@ void sqlite3_log(int iErrCode, const char *zFormat, ...); ** that does not correspond to any valid SQLite error code, the results ** are undefined. ** -** A single database handle may have at most a single write-ahead log callback +** A single database handle may have at most a single write-ahead log callback ** registered at one time. ^Calling [sqlite3_wal_hook()] replaces any ** previously registered write-ahead log callback. ^Note that the ** [sqlite3_wal_autocheckpoint()] interface and the @@ -7822,7 +7822,7 @@ void sqlite3_log(int iErrCode, const char *zFormat, ...); ** overwrite any prior [sqlite3_wal_hook()] settings. */ void *sqlite3_wal_hook( - sqlite3*, + sqlite3*, int(*)(void *,sqlite3*,const char*,int), void* ); @@ -7835,7 +7835,7 @@ void *sqlite3_wal_hook( ** [sqlite3_wal_hook()] that causes any database on [database connection] D ** to automatically [checkpoint] ** after committing a transaction if there are N or -** more frames in the [write-ahead log] file. ^Passing zero or +** more frames in the [write-ahead log] file. ^Passing zero or ** a negative value as the nFrame parameter disables automatic ** checkpoints entirely. ** @@ -7865,7 +7865,7 @@ int sqlite3_wal_autocheckpoint(sqlite3 *db, int N); ** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to ** [sqlite3_wal_checkpoint_v2](D,X,[SQLITE_CHECKPOINT_PASSIVE],0,0).)^ ** -** In brief, sqlite3_wal_checkpoint(D,X) causes the content in the +** In brief, sqlite3_wal_checkpoint(D,X) causes the content in the ** [write-ahead log] for database X on [database connection] D to be ** transferred into the database file and for the write-ahead log to ** be reset. See the [checkpointing] documentation for addition @@ -7891,10 +7891,10 @@ int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); ** **
      **
      SQLITE_CHECKPOINT_PASSIVE
      -** ^Checkpoint as many frames as possible without waiting for any database -** readers or writers to finish, then sync the database file if all frames +** ^Checkpoint as many frames as possible without waiting for any database +** readers or writers to finish, then sync the database file if all frames ** in the log were checkpointed. ^The [busy-handler callback] -** is never invoked in the SQLITE_CHECKPOINT_PASSIVE mode. +** is never invoked in the SQLITE_CHECKPOINT_PASSIVE mode. ** ^On the other hand, passive mode might leave the checkpoint unfinished ** if there are concurrent readers or writers. ** @@ -7908,9 +7908,9 @@ int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); ** **
      SQLITE_CHECKPOINT_RESTART
      ** ^This mode works the same way as SQLITE_CHECKPOINT_FULL with the addition -** that after checkpointing the log file it blocks (calls the +** that after checkpointing the log file it blocks (calls the ** [busy-handler callback]) -** until all readers are reading from the database file only. ^This ensures +** until all readers are reading from the database file only. ^This ensures ** that the next writer will restart the log file from the beginning. ** ^Like SQLITE_CHECKPOINT_FULL, this mode blocks new ** database writer attempts while it is pending, but does not impede readers. @@ -7932,31 +7932,31 @@ int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); ** truncated to zero bytes and so both *pnLog and *pnCkpt will be set to zero. ** ** ^All calls obtain an exclusive "checkpoint" lock on the database file. ^If -** any other process is running a checkpoint operation at the same time, the -** lock cannot be obtained and SQLITE_BUSY is returned. ^Even if there is a +** any other process is running a checkpoint operation at the same time, the +** lock cannot be obtained and SQLITE_BUSY is returned. ^Even if there is a ** busy-handler configured, it will not be invoked in this case. ** -** ^The SQLITE_CHECKPOINT_FULL, RESTART and TRUNCATE modes also obtain the +** ^The SQLITE_CHECKPOINT_FULL, RESTART and TRUNCATE modes also obtain the ** exclusive "writer" lock on the database file. ^If the writer lock cannot be ** obtained immediately, and a busy-handler is configured, it is invoked and ** the writer lock retried until either the busy-handler returns 0 or the lock ** is successfully obtained. ^The busy-handler is also invoked while waiting for ** database readers as described above. ^If the busy-handler returns 0 before ** the writer lock is obtained or while waiting for database readers, the -** checkpoint operation proceeds from that point in the same way as -** SQLITE_CHECKPOINT_PASSIVE - checkpointing as many frames as possible +** checkpoint operation proceeds from that point in the same way as +** SQLITE_CHECKPOINT_PASSIVE - checkpointing as many frames as possible ** without blocking any further. ^SQLITE_BUSY is returned in this case. ** ** ^If parameter zDb is NULL or points to a zero length string, then the -** specified operation is attempted on all WAL databases [attached] to +** specified operation is attempted on all WAL databases [attached] to ** [database connection] db. In this case the -** values written to output parameters *pnLog and *pnCkpt are undefined. ^If -** an SQLITE_BUSY error is encountered when processing one or more of the -** attached WAL databases, the operation is still attempted on any remaining -** attached databases and SQLITE_BUSY is returned at the end. ^If any other -** error occurs while processing an attached database, processing is abandoned -** and the error code is returned to the caller immediately. ^If no error -** (SQLITE_BUSY or otherwise) is encountered while processing the attached +** values written to output parameters *pnLog and *pnCkpt are undefined. ^If +** an SQLITE_BUSY error is encountered when processing one or more of the +** attached WAL databases, the operation is still attempted on any remaining +** attached databases and SQLITE_BUSY is returned at the end. ^If any other +** error occurs while processing an attached database, processing is abandoned +** and the error code is returned to the caller immediately. ^If no error +** (SQLITE_BUSY or otherwise) is encountered while processing the attached ** databases, SQLITE_OK is returned. ** ** ^If database zDb is the name of an attached database that is not in WAL @@ -8032,20 +8032,20 @@ int sqlite3_vtab_config(sqlite3*, int op, ...); ** If X is non-zero, then the virtual table implementation guarantees ** that if [xUpdate] returns [SQLITE_CONSTRAINT], it will do so before ** any modifications to internal or persistent data structures have been made. -** If the [ON CONFLICT] mode is ABORT, FAIL, IGNORE or ROLLBACK, SQLite +** If the [ON CONFLICT] mode is ABORT, FAIL, IGNORE or ROLLBACK, SQLite ** is able to roll back a statement or database transaction, and abandon -** or continue processing the current SQL statement as appropriate. +** or continue processing the current SQL statement as appropriate. ** If the ON CONFLICT mode is REPLACE and the [xUpdate] method returns ** [SQLITE_CONSTRAINT], SQLite handles this as if the ON CONFLICT mode ** had been ABORT. ** ** Virtual table implementations that are required to handle OR REPLACE -** must do so within the [xUpdate] method. If a call to the -** [sqlite3_vtab_on_conflict()] function indicates that the current ON -** CONFLICT policy is REPLACE, the virtual table implementation should +** must do so within the [xUpdate] method. If a call to the +** [sqlite3_vtab_on_conflict()] function indicates that the current ON +** CONFLICT policy is REPLACE, the virtual table implementation should ** silently replace the appropriate rows within the xUpdate callback and ** return SQLITE_OK. Or, if this is not possible, it may return -** SQLITE_CONSTRAINT, in which case SQLite falls back to OR ABORT +** SQLITE_CONSTRAINT, in which case SQLite falls back to OR ABORT ** constraint handling. **
      */ @@ -8171,7 +8171,7 @@ int sqlite3_stmt_scanstatus( int idx, /* Index of loop to report on */ int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ void *pOut /* Result written here */ -); +); /* ** CAPI3REF: Zero Scan-Status Counters @@ -8189,15 +8189,15 @@ void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); ** ** ^If a write-transaction is open on [database connection] D when the ** [sqlite3_db_cacheflush(D)] interface invoked, any dirty -** pages in the pager-cache that are not currently in use are written out +** pages in the pager-cache that are not currently in use are written out ** to disk. A dirty page may be in use if a database cursor created by an ** active SQL statement is reading from it, or if it is page 1 of a database ** file (page 1 is always "in use"). ^The [sqlite3_db_cacheflush(D)] ** interface flushes caches for all schemas - "main", "temp", and ** any [attached] databases. ** -** ^If this function needs to obtain extra database locks before dirty pages -** can be flushed to disk, it does so. ^If those locks cannot be obtained +** ^If this function needs to obtain extra database locks before dirty pages +** can be flushed to disk, it does so. ^If those locks cannot be obtained ** immediately and there is a busy-handler callback configured, it is invoked ** in the usual manner. ^If the required lock still cannot be obtained, then ** the database is skipped and an attempt made to flush any dirty pages @@ -8244,16 +8244,16 @@ int sqlite3_db_cacheflush(sqlite3*); ** kind of update operation that is about to occur. ** ^(The fourth parameter to the preupdate callback is the name of the ** database within the database connection that is being modified. This -** will be "main" for the main database or "temp" for TEMP tables or +** will be "main" for the main database or "temp" for TEMP tables or ** the name given after the AS keyword in the [ATTACH] statement for attached ** databases.)^ ** ^The fifth parameter to the preupdate callback is the name of the ** table that is being modified. ** ** For an UPDATE or DELETE operation on a [rowid table], the sixth -** parameter passed to the preupdate callback is the initial [rowid] of the +** parameter passed to the preupdate callback is the initial [rowid] of the ** row being modified or deleted. For an INSERT operation on a rowid table, -** or any operation on a WITHOUT ROWID table, the value of the sixth +** or any operation on a WITHOUT ROWID table, the value of the sixth ** parameter is undefined. For an INSERT or UPDATE on a rowid table the ** seventh parameter is the final rowid value of the row being inserted ** or updated. The value of the seventh parameter passed to the callback @@ -8292,7 +8292,7 @@ int sqlite3_db_cacheflush(sqlite3*); ** ** ^The [sqlite3_preupdate_depth(D)] interface returns 0 if the preupdate ** callback was invoked as a result of a direct insert, update, or delete -** operation; or 1 for inserts, updates, or deletes invoked by top-level +** operation; or 1 for inserts, updates, or deletes invoked by top-level ** triggers; or 2 for changes resulting from triggers called by top-level ** triggers; and so forth. ** @@ -8326,7 +8326,7 @@ int sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); ** The return value is OS-dependent. For example, on unix systems, after ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be ** called to get back the underlying "errno" that caused the problem, such -** as ENOSPC, EAUTH, EISDIR, and so forth. +** as ENOSPC, EAUTH, EISDIR, and so forth. */ int sqlite3_system_errno(sqlite3*); @@ -8353,7 +8353,7 @@ int sqlite3_system_errno(sqlite3*); ** ** The constructor for this object is [sqlite3_snapshot_get()]. The ** [sqlite3_snapshot_open()] method causes a fresh read transaction to refer -** to an historical snapshot (if possible). The destructor for +** to an historical snapshot (if possible). The destructor for ** sqlite3_snapshot objects is [sqlite3_snapshot_free()]. */ typedef struct sqlite3_snapshot { @@ -8370,12 +8370,12 @@ typedef struct sqlite3_snapshot { ** [sqlite3_snapshot_get(D,S,P)] interface writes a pointer to the newly ** created [sqlite3_snapshot] object into *P and returns SQLITE_OK. ** If there is not already a read-transaction open on schema S when -** this function is called, one is opened automatically. +** this function is called, one is opened automatically. ** ** The following must be true for this function to succeed. If any of ** the following statements are false when sqlite3_snapshot_get() is ** called, SQLITE_ERROR is returned. The final value of *P is undefined -** in this case. +** in this case. ** **
        **
      • The database handle must be in [autocommit mode]. @@ -8387,13 +8387,13 @@ typedef struct sqlite3_snapshot { ** **
      • One or more transactions must have been written to the current wal ** file since it was created on disk (by any connection). This means -** that a snapshot cannot be taken on a wal mode database with no wal +** that a snapshot cannot be taken on a wal mode database with no wal ** file immediately after it is first opened. At least one transaction ** must be written to it first. **
      ** ** This function may also return SQLITE_NOMEM. If it is called with the -** database handle in autocommit mode but fails for some other reason, +** database handle in autocommit mode but fails for some other reason, ** whether or not a read transaction is opened on schema S is undefined. ** ** The [sqlite3_snapshot] object returned from a successful call to @@ -8433,7 +8433,7 @@ SQLITE_EXPERIMENTAL int sqlite3_snapshot_get( ** database connection D does not know that the database file for ** schema S is in [WAL mode]. A database connection might not know ** that the database file is in [WAL mode] if there has been no prior -** I/O on that database connection, or if the database entered [WAL mode] +** I/O on that database connection, or if the database entered [WAL mode] ** after the most recent I/O on the database connection.)^ ** (Hint: Run "[PRAGMA application_id]" against a newly opened ** database connection in order to make it ready to use snapshots.) @@ -8465,17 +8465,17 @@ SQLITE_EXPERIMENTAL void sqlite3_snapshot_free(sqlite3_snapshot*); ** EXPERIMENTAL ** ** The sqlite3_snapshot_cmp(P1, P2) interface is used to compare the ages -** of two valid snapshot handles. +** of two valid snapshot handles. ** -** If the two snapshot handles are not associated with the same database -** file, the result of the comparison is undefined. +** If the two snapshot handles are not associated with the same database +** file, the result of the comparison is undefined. ** ** Additionally, the result of the comparison is only valid if both of the ** snapshot handles were obtained by calling sqlite3_snapshot_get() since the ** last time the wal file was deleted. The wal file is deleted when the ** database is changed back to rollback mode or when the number of database -** clients drops to zero. If either snapshot handle was obtained before the -** wal file was last deleted, the value returned by this function +** clients drops to zero. If either snapshot handle was obtained before the +** wal file was last deleted, the value returned by this function ** is undefined. ** ** Otherwise, this API returns a negative value if P1 refers to an older diff --git a/third_party/sqlite/src/src/sqlite3ext.h b/third_party/sqlite/src/src/sqlite3ext.h index ce87e74690b2f..b31755c9d8ef8 100644 --- a/third_party/sqlite/src/src/sqlite3ext.h +++ b/third_party/sqlite/src/src/sqlite3ext.h @@ -12,7 +12,7 @@ ** This header file defines the SQLite interface for use by ** shared libraries that want to be imported as extensions into ** an SQLite instance. Shared libraries that intend to be loaded -** as extensions by SQLite should #include this file instead of +** as extensions by SQLite should #include this file instead of ** sqlite3.h. */ #ifndef SQLITE3EXT_H @@ -543,14 +543,14 @@ typedef int (*sqlite3_loadext_entry)( #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */ #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) - /* This case when the file really is being compiled as a loadable + /* This case when the file really is being compiled as a loadable ** extension */ # define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0; # define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v; # define SQLITE_EXTENSION_INIT3 \ extern const sqlite3_api_routines *sqlite3_api; #else - /* This case when the file is being statically linked into the + /* This case when the file is being statically linked into the ** application */ # define SQLITE_EXTENSION_INIT1 /*no-op*/ # define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */ diff --git a/third_party/sqlite/src/src/sqliteInt.h b/third_party/sqlite/src/src/sqliteInt.h index ee58edad775c0..78b8dddb9ec90 100644 --- a/third_party/sqlite/src/src/sqliteInt.h +++ b/third_party/sqlite/src/src/sqliteInt.h @@ -35,10 +35,10 @@ ** ** PREVENTS-HARMLESS-OVERREAD - This branch prevents a buffer overread ** that would be harmless and undetectable -** if it did occur. +** if it did occur. ** ** In all cases, the special comment must be enclosed in the usual -** slash-asterisk...asterisk-slash comment marks, with no spaces between the +** slash-asterisk...asterisk-slash comment marks, with no spaces between the ** asterisks and the comment text. */ diff --git a/third_party/sqlite/src/src/sqliteLimit.h b/third_party/sqlite/src/src/sqliteLimit.h index 0554e61581889..7d762e13fb4f9 100644 --- a/third_party/sqlite/src/src/sqliteLimit.h +++ b/third_party/sqlite/src/src/sqliteLimit.h @@ -9,7 +9,7 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** +** ** This file defines various limits of what SQLite can process. */ @@ -57,9 +57,9 @@ #endif /* -** The maximum depth of an expression tree. This is limited to -** some extent by SQLITE_MAX_SQL_LENGTH. But sometime you might -** want to place more severe limits on the complexity of an +** The maximum depth of an expression tree. This is limited to +** some extent by SQLITE_MAX_SQL_LENGTH. But sometime you might +** want to place more severe limits on the complexity of an ** expression. ** ** A value of 0 used to mean that the limit was not enforced. @@ -141,10 +141,10 @@ ** ** Earlier versions of SQLite allowed the user to change this value at ** compile time. This is no longer permitted, on the grounds that it creates -** a library that is technically incompatible with an SQLite library -** compiled with a different limit. If a process operating on a database -** with a page-size of 65536 bytes crashes, then an instance of SQLite -** compiled with the default page-size limit will not be able to rollback +** a library that is technically incompatible with an SQLite library +** compiled with a different limit. If a process operating on a database +** with a page-size of 65536 bytes crashes, then an instance of SQLite +** compiled with the default page-size limit will not be able to rollback ** the aborted transaction. This could lead to database corruption. */ #ifdef SQLITE_MAX_PAGE_SIZE @@ -203,7 +203,7 @@ ** Maximum depth of recursion for triggers. ** ** A value of 1 means that a trigger program will not be able to itself -** fire any triggers. A value of 0 means that no trigger programs at all +** fire any triggers. A value of 0 means that no trigger programs at all ** may be executed. */ #ifndef SQLITE_MAX_TRIGGER_DEPTH diff --git a/third_party/sqlite/src/src/status.c b/third_party/sqlite/src/src/status.c index 24dcad45724c3..74548b73b6f39 100644 --- a/third_party/sqlite/src/src/status.c +++ b/third_party/sqlite/src/src/status.c @@ -214,7 +214,7 @@ int sqlite3_db_status( break; } - /* + /* ** Return an approximation for the amount of memory currently used ** by all pagers associated with the given database connection. The ** highwater mark is meaningless and is returned as zero. @@ -258,7 +258,7 @@ int sqlite3_db_status( HashElem *p; nByte += sqlite3GlobalConfig.m.xRoundup(sizeof(HashElem)) * ( - pSchema->tblHash.count + pSchema->tblHash.count + pSchema->trigHash.count + pSchema->idxHash.count + pSchema->fkeyHash.count @@ -308,7 +308,7 @@ int sqlite3_db_status( /* ** Set *pCurrent to the total cache hits or misses encountered by all - ** pagers the database handle is connected to. *pHighwater is always set + ** pagers the database handle is connected to. *pHighwater is always set ** to zero. */ case SQLITE_DBSTATUS_CACHE_HIT: diff --git a/third_party/sqlite/src/src/table.c b/third_party/sqlite/src/src/table.c index c79255f990cf8..3dd9a01dc62be 100644 --- a/third_party/sqlite/src/src/table.c +++ b/third_party/sqlite/src/src/table.c @@ -109,7 +109,7 @@ malloc_failed: ** at the conclusion of the call. ** ** The result that is written to ***pazResult is held in memory obtained -** from malloc(). But the caller cannot free this memory directly. +** from malloc(). But the caller cannot free this memory directly. ** Instead, the entire table should be passed to sqlite3_free_table() when ** the calling procedure is finished using it. */ diff --git a/third_party/sqlite/src/src/tclsqlite.c b/third_party/sqlite/src/src/tclsqlite.c index 5b52bf0c91ca1..6cb51aa394796 100644 --- a/third_party/sqlite/src/src/tclsqlite.c +++ b/third_party/sqlite/src/src/tclsqlite.c @@ -3140,7 +3140,7 @@ static int SQLITE_TCLAPI DbObjCmd( */ case DB_PREUPDATE: { #ifndef SQLITE_ENABLE_PREUPDATE_HOOK - Tcl_AppendResult(interp, "preupdate_hook was omitted at compile-time", + Tcl_AppendResult(interp, "preupdate_hook was omitted at compile-time", (char*)0); rc = TCL_ERROR; #else diff --git a/third_party/sqlite/src/src/test1.c b/third_party/sqlite/src/src/test1.c index d17fc1022ad42..2059e5a284c6e 100644 --- a/third_party/sqlite/src/src/test1.c +++ b/third_party/sqlite/src/src/test1.c @@ -28,7 +28,7 @@ #include /* -** This is a copy of the first part of the SqliteDb structure in +** This is a copy of the first part of the SqliteDb structure in ** tclsqlite.c. We need it here so that the get_sqlite_pointer routine ** can extract the sqlite3* pointer from an existing Tcl SQLite ** connection. @@ -160,8 +160,8 @@ int sqlite3TestErrCode(Tcl_Interp *interp, sqlite3 *db, int rc){ ** Decode a pointer to an sqlite3_stmt object. */ static int getStmtPointer( - Tcl_Interp *interp, - const char *zArg, + Tcl_Interp *interp, + const char *zArg, sqlite3_stmt **ppStmt ){ *ppStmt = (sqlite3_stmt*)sqlite3TestTextToPtr(zArg); @@ -259,9 +259,9 @@ static int SQLITE_TCLAPI test_io_trace( } /* -** Usage: clang_sanitize_address +** Usage: clang_sanitize_address ** -** Returns true if the program was compiled using clang with the +** Returns true if the program was compiled using clang with the ** -fsanitize=address switch on the command line. False otherwise. ** ** Also return true if the OMIT_MISUSE environment variable exists. @@ -285,7 +285,7 @@ static int SQLITE_TCLAPI clang_sanitize_address( Tcl_SetObjResult(interp, Tcl_NewIntObj(res)); return TCL_OK; } - + /* ** Usage: sqlite3_exec_printf DB FORMAT STRING ** @@ -306,7 +306,7 @@ static int SQLITE_TCLAPI test_exec_printf( char *zSql; char zBuf[30]; if( argc!=4 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB FORMAT STRING", 0); return TCL_ERROR; } @@ -345,7 +345,7 @@ static int SQLITE_TCLAPI test_exec_hex( char zSql[501]; char zBuf[30]; if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB HEX", 0); return TCL_ERROR; } @@ -385,7 +385,7 @@ static int SQLITE_TCLAPI db_enter( ){ sqlite3 *db; if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB", 0); return TCL_ERROR; } @@ -401,7 +401,7 @@ static int SQLITE_TCLAPI db_leave( ){ sqlite3 *db; if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB", 0); return TCL_ERROR; } @@ -429,7 +429,7 @@ static int SQLITE_TCLAPI test_exec( int i, j; char zBuf[30]; if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB SQL", 0); return TCL_ERROR; } @@ -472,7 +472,7 @@ static int SQLITE_TCLAPI test_exec_nr( int rc; char *zErr = 0; if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB SQL", 0); return TCL_ERROR; } @@ -485,7 +485,7 @@ static int SQLITE_TCLAPI test_exec_nr( /* ** Usage: sqlite3_mprintf_z_test SEPARATOR ARG0 ARG1 ... ** -** Test the %z format of sqlite_mprintf(). Use multiple mprintf() calls to +** Test the %z format of sqlite_mprintf(). Use multiple mprintf() calls to ** concatenate arg0 through argn using separator as the separator. ** Return the result. */ @@ -582,7 +582,7 @@ static int SQLITE_TCLAPI test_get_table_printf( if( Tcl_GetInt(interp, argv[4], &resCount) ) return TCL_ERROR; } if( argc!=4 && argc!=5 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB FORMAT STRING ?COUNT?", 0); return TCL_ERROR; } @@ -852,14 +852,14 @@ static int execFuncCallback(void *pData, int argc, char **argv, char **NotUsed){ ** This is illegal and should set the SQLITE_MISUSE flag on the database. ** ** 2004-Jan-07: We have changed this to make it legal to call sqlite3_exec() -** from within a function call. -** +** from within a function call. +** ** This routine simulates the effect of having two threads attempt to ** use the same database at the same time. */ static void sqlite3ExecFunc( - sqlite3_context *context, - int argc, + sqlite3_context *context, + int argc, sqlite3_value **argv ){ struct dstr x; @@ -878,9 +878,9 @@ static void sqlite3ExecFunc( ** * It calls sqlite3_value_text() 3 times on the argument sqlite3_value*. ** If the three pointers returned are not the same an SQL error is raised. ** -** * Otherwise it returns a copy of the text representation of its -** argument in such a way as the VDBE representation is a Mem* cell -** with the MEM_Term flag clear. +** * Otherwise it returns a copy of the text representation of its +** argument in such a way as the VDBE representation is a Mem* cell +** with the MEM_Term flag clear. ** ** Ticket #2213 can therefore be tested by evaluating the following ** SQL expression: @@ -888,8 +888,8 @@ static void sqlite3ExecFunc( ** tkt2213func(tkt2213func('a string')); */ static void tkt2213Function( - sqlite3_context *context, - int argc, + sqlite3_context *context, + int argc, sqlite3_value **argv ){ int nText; @@ -936,8 +936,8 @@ static void tkt2213Function( ** the _text(), _text16() and _blob() APIs become invalidated. */ static void ptrChngFunction( - sqlite3_context *context, - int argc, + sqlite3_context *context, + int argc, sqlite3_value **argv ){ const void *p1, *p2; @@ -990,8 +990,8 @@ static void ptrChngFunction( ** the arguments are the same. */ static void nondeterministicFunction( - sqlite3_context *context, - int argc, + sqlite3_context *context, + int argc, sqlite3_value **argv ){ static int cnt = 0; @@ -1028,7 +1028,7 @@ static int SQLITE_TCLAPI test_create_function( return TCL_ERROR; } if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - rc = sqlite3_create_function(db, "x_coalesce", -1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "x_coalesce", -1, SQLITE_UTF8, 0, t1_ifnullFunc, 0, 0); if( rc==SQLITE_OK ){ rc = sqlite3_create_function(db, "hex8", 1, SQLITE_UTF8 | SQLITE_DETERMINISTIC, @@ -1041,11 +1041,11 @@ static int SQLITE_TCLAPI test_create_function( } #endif if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "tkt2213func", 1, SQLITE_ANY, 0, + rc = sqlite3_create_function(db, "tkt2213func", 1, SQLITE_ANY, 0, tkt2213Function, 0, 0); } if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "pointer_change", 4, SQLITE_ANY, 0, + rc = sqlite3_create_function(db, "pointer_change", 4, SQLITE_ANY, 0, ptrChngFunction, 0, 0); } @@ -1063,7 +1063,7 @@ static int SQLITE_TCLAPI test_create_function( } #ifndef SQLITE_OMIT_UTF16 - /* Use the sqlite3_create_function16() API here. Mainly for fun, but also + /* Use the sqlite3_create_function16() API here. Mainly for fun, but also ** because it is not tested anywhere else. */ if( rc==SQLITE_OK ){ const void *zUtf16; @@ -1075,7 +1075,7 @@ static int SQLITE_TCLAPI test_create_function( if( db->mallocFailed ){ rc = SQLITE_NOMEM; }else{ - rc = sqlite3_create_function16(db, zUtf16, + rc = sqlite3_create_function16(db, zUtf16, 1, SQLITE_UTF16, db, sqlite3ExecFunc, 0, 0); } sqlite3ValueFree(pVal); @@ -1124,7 +1124,7 @@ static void t1CountStep( #endif } } -} +} static void t1CountFinalize(sqlite3_context *context){ t1CountCtx *p; p = sqlite3_aggregate_context(context, sizeof(*p)); @@ -1607,7 +1607,7 @@ static int SQLITE_TCLAPI test_table_column_metadata( if( strlen(zDb)==0 ) zDb = 0; - rc = sqlite3_table_column_metadata(db, zDb, zTbl, zCol, + rc = sqlite3_table_column_metadata(db, zDb, zTbl, zCol, &zDatatype, &zCollseq, ¬null, &primarykey, &autoincrement); if( rc!=SQLITE_OK ){ @@ -1629,7 +1629,7 @@ static int SQLITE_TCLAPI test_table_column_metadata( #ifndef SQLITE_OMIT_INCRBLOB static int SQLITE_TCLAPI blobHandleFromObj( - Tcl_Interp *interp, + Tcl_Interp *interp, Tcl_Obj *pObj, sqlite3_blob **ppBlob ){ @@ -1643,7 +1643,7 @@ static int SQLITE_TCLAPI blobHandleFromObj( int notUsed; Tcl_Channel channel; ClientData instanceData; - + channel = Tcl_GetChannel(interp, z, ¬Used); if( !channel ) return TCL_ERROR; @@ -1756,7 +1756,7 @@ static int SQLITE_TCLAPI test_create_collation_v2( Tcl_IncrRefCount(p->pCmp); Tcl_IncrRefCount(p->pDel); - rc = sqlite3_create_collation_v2(db, Tcl_GetString(objv[2]), 16, + rc = sqlite3_create_collation_v2(db, Tcl_GetString(objv[2]), 16, (void *)p, testCreateCollationCmp, testCreateCollationDel ); if( rc!=SQLITE_MISUSE ){ @@ -1764,7 +1764,7 @@ static int SQLITE_TCLAPI test_create_collation_v2( "an invalid encoding", (char*)0); return TCL_ERROR; } - rc = sqlite3_create_collation_v2(db, Tcl_GetString(objv[2]), SQLITE_UTF8, + rc = sqlite3_create_collation_v2(db, Tcl_GetString(objv[2]), SQLITE_UTF8, (void *)p, testCreateCollationCmp, testCreateCollationDel ); return TCL_OK; @@ -1802,10 +1802,10 @@ static void cf2Destroy(void *pUser){ if( rc!=TCL_OK ) Tcl_BackgroundError(p->interp); } - if( p->pFunc ) Tcl_DecrRefCount(p->pFunc); - if( p->pStep ) Tcl_DecrRefCount(p->pStep); - if( p->pFinal ) Tcl_DecrRefCount(p->pFinal); - if( p->pDestroy ) Tcl_DecrRefCount(p->pDestroy); + if( p->pFunc ) Tcl_DecrRefCount(p->pFunc); + if( p->pStep ) Tcl_DecrRefCount(p->pStep); + if( p->pFinal ) Tcl_DecrRefCount(p->pFinal); + if( p->pDestroy ) Tcl_DecrRefCount(p->pDestroy); sqlite3_free(p); } static int SQLITE_TCLAPI test_create_function_v2( @@ -1842,7 +1842,7 @@ static int SQLITE_TCLAPI test_create_function_v2( if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; zFunc = Tcl_GetString(objv[2]); if( Tcl_GetIntFromObj(interp, objv[3], &nArg) ) return TCL_ERROR; - if( Tcl_GetIndexFromObjStruct(interp, objv[4], aEnc, sizeof(aEnc[0]), + if( Tcl_GetIndexFromObjStruct(interp, objv[4], aEnc, sizeof(aEnc[0]), "encoding", 0, &enc) ){ return TCL_ERROR; @@ -1869,17 +1869,17 @@ static int SQLITE_TCLAPI test_create_function_v2( case 3: p->pDestroy = objv[i+1]; break; } } - if( p->pFunc ) p->pFunc = Tcl_DuplicateObj(p->pFunc); - if( p->pStep ) p->pStep = Tcl_DuplicateObj(p->pStep); - if( p->pFinal ) p->pFinal = Tcl_DuplicateObj(p->pFinal); - if( p->pDestroy ) p->pDestroy = Tcl_DuplicateObj(p->pDestroy); + if( p->pFunc ) p->pFunc = Tcl_DuplicateObj(p->pFunc); + if( p->pStep ) p->pStep = Tcl_DuplicateObj(p->pStep); + if( p->pFinal ) p->pFinal = Tcl_DuplicateObj(p->pFinal); + if( p->pDestroy ) p->pDestroy = Tcl_DuplicateObj(p->pDestroy); - if( p->pFunc ) Tcl_IncrRefCount(p->pFunc); - if( p->pStep ) Tcl_IncrRefCount(p->pStep); - if( p->pFinal ) Tcl_IncrRefCount(p->pFinal); - if( p->pDestroy ) Tcl_IncrRefCount(p->pDestroy); + if( p->pFunc ) Tcl_IncrRefCount(p->pFunc); + if( p->pStep ) Tcl_IncrRefCount(p->pStep); + if( p->pFinal ) Tcl_IncrRefCount(p->pFinal); + if( p->pDestroy ) Tcl_IncrRefCount(p->pDestroy); - rc = sqlite3_create_function_v2(db, zFunc, nArg, enc, (void *)p, + rc = sqlite3_create_function_v2(db, zFunc, nArg, enc, (void *)p, (p->pFunc ? cf2Func : 0), (p->pStep ? cf2Step : 0), (p->pFinal ? cf2Final : 0), @@ -1928,8 +1928,8 @@ static int SQLITE_TCLAPI test_load_extension( db = ((struct SqliteDb*)cmdInfo.objClientData)->db; assert(db); - /* Call the underlying C function. If an error occurs, set rc to - ** TCL_ERROR and load any error string into the interpreter. If no + /* Call the underlying C function. If an error occurs, set rc to + ** TCL_ERROR and load any error string into the interpreter. If no ** error occurs, set rc to TCL_OK. */ #ifdef SQLITE_OMIT_LOAD_EXTENSION @@ -2068,12 +2068,12 @@ static int SQLITE_TCLAPI test_register_func( sqlite3 *db; int rc; if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB FUNCTION-NAME", 0); return TCL_ERROR; } if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - rc = sqlite3_create_function(db, argv[2], -1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, argv[2], -1, SQLITE_UTF8, 0, testFunc, 0, 0); if( rc!=0 ){ Tcl_AppendResult(interp, sqlite3ErrStr(rc), 0); @@ -2084,7 +2084,7 @@ static int SQLITE_TCLAPI test_register_func( } /* -** Usage: sqlite3_finalize STMT +** Usage: sqlite3_finalize STMT ** ** Finalize a statement handle. */ @@ -2447,7 +2447,7 @@ static int SQLITE_TCLAPI test_snapshot_get_blob( Tcl_SetObjResult(interp, Tcl_NewStringObj(sqlite3ErrName(rc), -1)); return TCL_ERROR; }else{ - Tcl_SetObjResult(interp, + Tcl_SetObjResult(interp, Tcl_NewByteArrayObj((unsigned char*)pSnapshot, sizeof(sqlite3_snapshot)) ); sqlite3_snapshot_free(pSnapshot); @@ -2662,7 +2662,7 @@ static int SQLITE_TCLAPI uses_stmt_journal( /* -** Usage: sqlite3_reset STMT +** Usage: sqlite3_reset STMT ** ** Reset a statement handle. */ @@ -2697,7 +2697,7 @@ static int SQLITE_TCLAPI test_reset( } /* -** Usage: sqlite3_expired STMT +** Usage: sqlite3_expired STMT ** ** Return TRUE if a recompilation of the statement is recommended. */ @@ -2740,7 +2740,7 @@ static int SQLITE_TCLAPI test_transfer_bind( } if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt1)) return TCL_ERROR; if( getStmtPointer(interp, Tcl_GetString(objv[2]), &pStmt2)) return TCL_ERROR; - Tcl_SetObjResult(interp, + Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_transfer_bindings(pStmt1,pStmt2))); #endif return TCL_OK; @@ -2797,7 +2797,7 @@ static int SQLITE_TCLAPI test_bind( int rc; int idx; if( argc!=5 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " VM IDX VALUE (null|static|normal)\"", 0); return TCL_ERROR; } @@ -2860,7 +2860,7 @@ static int SQLITE_TCLAPI test_bind( */ static Tcl_Interp* pTestCollateInterp; static int test_collate_func( - void *pCtx, + void *pCtx, int nA, const void *zA, int nB, const void *zB ){ @@ -2925,12 +2925,12 @@ static int SQLITE_TCLAPI test_collate( if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[2], &val) ) return TCL_ERROR; - rc = sqlite3_create_collation(db, "test_collate", SQLITE_UTF8, + rc = sqlite3_create_collation(db, "test_collate", SQLITE_UTF8, (void *)SQLITE_UTF8, val?test_collate_func:0); if( rc==SQLITE_OK ){ const void *zUtf16; if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[3], &val) ) return TCL_ERROR; - rc = sqlite3_create_collation(db, "test_collate", SQLITE_UTF16LE, + rc = sqlite3_create_collation(db, "test_collate", SQLITE_UTF16LE, (void *)SQLITE_UTF16LE, val?test_collate_func:0); if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[4], &val) ) return TCL_ERROR; @@ -2946,14 +2946,14 @@ static int SQLITE_TCLAPI test_collate( if( db->mallocFailed ){ rc = SQLITE_NOMEM; }else{ - rc = sqlite3_create_collation16(db, zUtf16, SQLITE_UTF16BE, + rc = sqlite3_create_collation16(db, zUtf16, SQLITE_UTF16BE, (void *)SQLITE_UTF16BE, val?test_collate_func:0); } sqlite3ValueFree(pVal); sqlite3_mutex_leave(db->mutex); } if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - + if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, sqlite3ErrName(rc), 0); return TCL_ERROR; @@ -2974,7 +2974,7 @@ bad_args: ** built-in collation "binary". */ static int test_utf16bin_collate_func( - void *pCtx, + void *pCtx, int nA, const void *zA, int nB, const void *zB ){ @@ -2995,7 +2995,7 @@ static int SQLITE_TCLAPI test_utf16bin_collate( if( objc!=2 ) goto bad_args; if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; - rc = sqlite3_create_collation(db, "utf16bin", SQLITE_UTF16, 0, + rc = sqlite3_create_collation(db, "utf16bin", SQLITE_UTF16, 0, test_utf16bin_collate_func ); if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; @@ -3007,7 +3007,7 @@ bad_args: } /* -** When the collation needed callback is invoked, record the name of +** When the collation needed callback is invoked, record the name of ** the requested collating function here. The recorded name is linked ** to a TCL variable and used to make sure that the requested collation ** name is correct. @@ -3021,7 +3021,7 @@ static char *pzNeededCollation = zNeededCollation; ** sqlite3_collation_needed16(). */ static void test_collate_needed_cb( - void *pCtx, + void *pCtx, sqlite3 *db, int eTextRep, const void *pName @@ -3100,9 +3100,9 @@ static int SQLITE_TCLAPI add_alignment_test_collations( sqlite3 *db; if( objc>=2 ){ if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; - sqlite3_create_collation(db, "utf16_unaligned", SQLITE_UTF16, + sqlite3_create_collation(db, "utf16_unaligned", SQLITE_UTF16, 0, alignmentCollFunc); - sqlite3_create_collation(db, "utf16_aligned", SQLITE_UTF16_ALIGNED, + sqlite3_create_collation(db, "utf16_aligned", SQLITE_UTF16_ALIGNED, 0, alignmentCollFunc); } return SQLITE_OK; @@ -3136,7 +3136,7 @@ static int SQLITE_TCLAPI add_alignment_test_collations( */ #ifndef SQLITE_OMIT_UTF16 static void test_function_utf8( - sqlite3_context *pCtx, + sqlite3_context *pCtx, int nArg, sqlite3_value **argv ){ @@ -3147,20 +3147,20 @@ static void test_function_utf8( pX = Tcl_NewStringObj("test_function", -1); Tcl_IncrRefCount(pX); Tcl_ListObjAppendElement(interp, pX, Tcl_NewStringObj("UTF-8", -1)); - Tcl_ListObjAppendElement(interp, pX, + Tcl_ListObjAppendElement(interp, pX, Tcl_NewStringObj((char*)sqlite3_value_text(argv[0]), -1)); Tcl_EvalObjEx(interp, pX, 0); Tcl_DecrRefCount(pX); sqlite3_result_text(pCtx, Tcl_GetStringResult(interp), -1, SQLITE_TRANSIENT); pVal = sqlite3ValueNew(0); - sqlite3ValueSetStr(pVal, -1, Tcl_GetStringResult(interp), + sqlite3ValueSetStr(pVal, -1, Tcl_GetStringResult(interp), SQLITE_UTF8, SQLITE_STATIC); sqlite3_result_text16be(pCtx, sqlite3_value_text16be(pVal), -1, SQLITE_TRANSIENT); sqlite3ValueFree(pVal); } static void test_function_utf16le( - sqlite3_context *pCtx, + sqlite3_context *pCtx, int nArg, sqlite3_value **argv ){ @@ -3171,18 +3171,18 @@ static void test_function_utf16le( pX = Tcl_NewStringObj("test_function", -1); Tcl_IncrRefCount(pX); Tcl_ListObjAppendElement(interp, pX, Tcl_NewStringObj("UTF-16LE", -1)); - Tcl_ListObjAppendElement(interp, pX, + Tcl_ListObjAppendElement(interp, pX, Tcl_NewStringObj((char*)sqlite3_value_text(argv[0]), -1)); Tcl_EvalObjEx(interp, pX, 0); Tcl_DecrRefCount(pX); pVal = sqlite3ValueNew(0); - sqlite3ValueSetStr(pVal, -1, Tcl_GetStringResult(interp), + sqlite3ValueSetStr(pVal, -1, Tcl_GetStringResult(interp), SQLITE_UTF8, SQLITE_STATIC); sqlite3_result_text(pCtx,(char*)sqlite3_value_text(pVal),-1,SQLITE_TRANSIENT); sqlite3ValueFree(pVal); } static void test_function_utf16be( - sqlite3_context *pCtx, + sqlite3_context *pCtx, int nArg, sqlite3_value **argv ){ @@ -3193,12 +3193,12 @@ static void test_function_utf16be( pX = Tcl_NewStringObj("test_function", -1); Tcl_IncrRefCount(pX); Tcl_ListObjAppendElement(interp, pX, Tcl_NewStringObj("UTF-16BE", -1)); - Tcl_ListObjAppendElement(interp, pX, + Tcl_ListObjAppendElement(interp, pX, Tcl_NewStringObj((char*)sqlite3_value_text(argv[0]), -1)); Tcl_EvalObjEx(interp, pX, 0); Tcl_DecrRefCount(pX); pVal = sqlite3ValueNew(0); - sqlite3ValueSetStr(pVal, -1, Tcl_GetStringResult(interp), + sqlite3ValueSetStr(pVal, -1, Tcl_GetStringResult(interp), SQLITE_UTF8, SQLITE_STATIC); sqlite3_result_text16(pCtx, sqlite3_value_text16le(pVal), -1, SQLITE_TRANSIENT); @@ -3224,17 +3224,17 @@ static int SQLITE_TCLAPI test_function( if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[2], &val) ) return TCL_ERROR; if( val ){ - sqlite3_create_function(db, "test_function", 1, SQLITE_UTF8, + sqlite3_create_function(db, "test_function", 1, SQLITE_UTF8, interp, test_function_utf8, 0, 0); } if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[3], &val) ) return TCL_ERROR; if( val ){ - sqlite3_create_function(db, "test_function", 1, SQLITE_UTF16LE, + sqlite3_create_function(db, "test_function", 1, SQLITE_UTF16LE, interp, test_function_utf16le, 0, 0); } if( TCL_OK!=Tcl_GetBooleanFromObj(interp, objv[4], &val) ) return TCL_ERROR; if( val ){ - sqlite3_create_function(db, "test_function", 1, SQLITE_UTF16BE, + sqlite3_create_function(db, "test_function", 1, SQLITE_UTF16BE, interp, test_function_utf16be, 0, 0); } @@ -3437,7 +3437,7 @@ static int SQLITE_TCLAPI test_intarray_addr( return TCL_ERROR; } } - } + } Tcl_SetObjResult(interp, Tcl_NewWideIntObj((sqlite3_int64)p)); return TCL_OK; } @@ -3473,7 +3473,7 @@ static int SQLITE_TCLAPI test_int64array_addr( } p[i] = v; } - } + } Tcl_SetObjResult(interp, Tcl_NewWideIntObj((sqlite3_int64)p)); return TCL_OK; } @@ -3507,7 +3507,7 @@ static int SQLITE_TCLAPI test_doublearray_addr( return TCL_ERROR; } } - } + } Tcl_SetObjResult(interp, Tcl_NewWideIntObj((sqlite3_int64)p)); return TCL_OK; } @@ -3883,7 +3883,7 @@ static int SQLITE_TCLAPI test_bind_parameter_name( } if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; if( Tcl_GetIntFromObj(interp, objv[2], &i) ) return TCL_ERROR; - Tcl_SetObjResult(interp, + Tcl_SetObjResult(interp, Tcl_NewStringObj(sqlite3_bind_parameter_name(pStmt,i),-1) ); return TCL_OK; @@ -3908,7 +3908,7 @@ static int SQLITE_TCLAPI test_bind_parameter_index( return TCL_ERROR; } if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; - Tcl_SetObjResult(interp, + Tcl_SetObjResult(interp, Tcl_NewIntObj( sqlite3_bind_parameter_index(pStmt,Tcl_GetString(objv[2])) ) @@ -3975,7 +3975,7 @@ static int SQLITE_TCLAPI test_ex_errcode( int rc; if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " DB", 0); return TCL_ERROR; } @@ -4002,7 +4002,7 @@ static int SQLITE_TCLAPI test_errcode( int rc; if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " DB", 0); return TCL_ERROR; } @@ -4028,7 +4028,7 @@ static int SQLITE_TCLAPI test_errmsg( const char *zErr; if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " DB", 0); return TCL_ERROR; } @@ -4043,7 +4043,7 @@ static int SQLITE_TCLAPI test_errmsg( ** Usage: test_errmsg16 DB ** ** Returns the UTF-16 representation of the error message string for the -** most recent sqlite3_* API call. This is a byte array object at the TCL +** most recent sqlite3_* API call. This is a byte array object at the TCL ** level, and it includes the 0x00 0x00 terminator bytes at the end of the ** UTF-16 string. */ @@ -4060,7 +4060,7 @@ static int SQLITE_TCLAPI test_errmsg16( int bytes = 0; if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " DB", 0); return TCL_ERROR; } @@ -4099,7 +4099,7 @@ static int SQLITE_TCLAPI test_prepare( int rc; if( objc!=5 && objc!=4 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " DB sql bytes ?tailvar?", 0); return TCL_ERROR; } @@ -4157,7 +4157,7 @@ static int SQLITE_TCLAPI test_prepare_v2( int rc; if( objc!=5 && objc!=4 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " DB sql bytes tailvar", 0); return TCL_ERROR; } @@ -4222,7 +4222,7 @@ static int SQLITE_TCLAPI test_prepare_tkt3134( int rc; if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " DB sql bytes tailvar", 0); return TCL_ERROR; } @@ -4264,13 +4264,13 @@ static int SQLITE_TCLAPI test_prepare16( const void *zTail = 0; Tcl_Obj *pTail = 0; sqlite3_stmt *pStmt = 0; - char zBuf[50]; + char zBuf[50]; int rc; int bytes; /* The integer specified as arg 3 */ int objlen; /* The byte-array length of arg 2 */ if( objc!=5 && objc!=4 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " DB sql bytes ?tailvar?", 0); return TCL_ERROR; } @@ -4324,13 +4324,13 @@ static int SQLITE_TCLAPI test_prepare16_v2( const void *zTail = 0; Tcl_Obj *pTail = 0; sqlite3_stmt *pStmt = 0; - char zBuf[50]; + char zBuf[50]; int rc; int bytes; /* The integer specified as arg 3 */ int objlen; /* The byte-array length of arg 2 */ if( objc!=5 && objc!=4 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " DB sql bytes ?tailvar?", 0); return TCL_ERROR; } @@ -4378,14 +4378,14 @@ static int SQLITE_TCLAPI test_open( char zBuf[100]; if( objc!=3 && objc!=2 && objc!=1 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " filename options-list", 0); return TCL_ERROR; } zFilename = objc>1 ? Tcl_GetString(objv[1]) : 0; sqlite3_open(zFilename, &db); - + if( sqlite3TestMakePointerStr(interp, zBuf, db) ) return TCL_ERROR; Tcl_AppendResult(interp, zBuf, 0); return TCL_OK; @@ -4448,7 +4448,7 @@ static int SQLITE_TCLAPI test_open_v2( { "SQLITE_OPEN_URI", SQLITE_OPEN_URI }, { 0, 0 } }; - rc = Tcl_GetIndexFromObjStruct(interp, apFlag[i], aFlag, sizeof(aFlag[0]), + rc = Tcl_GetIndexFromObjStruct(interp, apFlag[i], aFlag, sizeof(aFlag[0]), "flag", 0, &iFlag ); if( rc!=TCL_OK ) return rc; @@ -4476,14 +4476,14 @@ static int SQLITE_TCLAPI test_open16( char zBuf[100]; if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " filename options-list", 0); return TCL_ERROR; } zFilename = Tcl_GetByteArrayFromObj(objv[1], 0); sqlite3_open16(zFilename, &db); - + if( sqlite3TestMakePointerStr(interp, zBuf, db) ) return TCL_ERROR; Tcl_AppendResult(interp, zBuf, 0); #endif /* SQLITE_OMIT_UTF16 */ @@ -4531,7 +4531,7 @@ static int SQLITE_TCLAPI test_step( int rc; if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " STMT", 0); return TCL_ERROR; } @@ -4583,7 +4583,7 @@ static int SQLITE_TCLAPI test_ex_sql( } /* -** Usage: sqlite3_column_count STMT +** Usage: sqlite3_column_count STMT ** ** Return the number of columns returned by the sql statement STMT. */ @@ -4596,7 +4596,7 @@ static int SQLITE_TCLAPI test_column_count( sqlite3_stmt *pStmt; if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " STMT column", 0); return TCL_ERROR; } @@ -4623,7 +4623,7 @@ static int SQLITE_TCLAPI test_column_type( int tp; if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " STMT column", 0); return TCL_ERROR; } @@ -4633,20 +4633,20 @@ static int SQLITE_TCLAPI test_column_type( tp = sqlite3_column_type(pStmt, col); switch( tp ){ - case SQLITE_INTEGER: - Tcl_SetResult(interp, "INTEGER", TCL_STATIC); + case SQLITE_INTEGER: + Tcl_SetResult(interp, "INTEGER", TCL_STATIC); break; case SQLITE_NULL: - Tcl_SetResult(interp, "NULL", TCL_STATIC); + Tcl_SetResult(interp, "NULL", TCL_STATIC); break; case SQLITE_FLOAT: - Tcl_SetResult(interp, "FLOAT", TCL_STATIC); + Tcl_SetResult(interp, "FLOAT", TCL_STATIC); break; case SQLITE_TEXT: - Tcl_SetResult(interp, "TEXT", TCL_STATIC); + Tcl_SetResult(interp, "TEXT", TCL_STATIC); break; case SQLITE_BLOB: - Tcl_SetResult(interp, "BLOB", TCL_STATIC); + Tcl_SetResult(interp, "BLOB", TCL_STATIC); break; default: assert(0); @@ -4672,7 +4672,7 @@ static int SQLITE_TCLAPI test_column_int64( i64 iVal; if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " STMT column", 0); return TCL_ERROR; } @@ -4701,7 +4701,7 @@ static int SQLITE_TCLAPI test_column_blob( const void *pBlob; if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " STMT column", 0); return TCL_ERROR; } @@ -4731,7 +4731,7 @@ static int SQLITE_TCLAPI test_column_double( double rVal; if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " STMT column", 0); return TCL_ERROR; } @@ -4745,7 +4745,7 @@ static int SQLITE_TCLAPI test_column_double( } /* -** Usage: sqlite3_data_count STMT +** Usage: sqlite3_data_count STMT ** ** Return the number of columns returned by the sql statement STMT. */ @@ -4758,7 +4758,7 @@ static int SQLITE_TCLAPI test_data_count( sqlite3_stmt *pStmt; if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " STMT column", 0); return TCL_ERROR; } @@ -4789,7 +4789,7 @@ static int SQLITE_TCLAPI test_stmt_utf8( xFunc = (const char *(*)(sqlite3_stmt*, int))clientData; if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " STMT column", 0); return TCL_ERROR; } @@ -4843,7 +4843,7 @@ static int SQLITE_TCLAPI test_stmt_utf16( xFunc = (const void *(*)(sqlite3_stmt*, int))clientData; if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " STMT column", 0); return TCL_ERROR; } @@ -4884,7 +4884,7 @@ static int SQLITE_TCLAPI test_stmt_int( xFunc = (int (*)(sqlite3_stmt*, int))clientData; if( objc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " STMT column", 0); return TCL_ERROR; } @@ -4929,7 +4929,7 @@ static int SQLITE_TCLAPI sqlite_set_magic( } /* -** Usage: sqlite3_interrupt DB +** Usage: sqlite3_interrupt DB ** ** Trigger an interrupt on DB */ @@ -4983,7 +4983,7 @@ static int SQLITE_TCLAPI test_stack_used( sqlite3 *db; int i; if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB SQL", 0); return TCL_ERROR; } @@ -5011,7 +5011,7 @@ static int SQLITE_TCLAPI delete_function( int rc; sqlite3 *db; if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB function-name", 0); return TCL_ERROR; } @@ -5024,8 +5024,8 @@ static int SQLITE_TCLAPI delete_function( /* ** Usage: sqlite_delete_collation DB collation-name ** -** Delete the collation sequence 'collation-name' from database handle -** DB. It is assumed that the collation sequence was created as UTF8 (the +** Delete the collation sequence 'collation-name' from database handle +** DB. It is assumed that the collation sequence was created as UTF8 (the ** way the TCL interface does it). */ static int SQLITE_TCLAPI delete_collation( @@ -5037,7 +5037,7 @@ static int SQLITE_TCLAPI delete_collation( int rc; sqlite3 *db; if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB function-name", 0); return TCL_ERROR; } @@ -5062,7 +5062,7 @@ static int SQLITE_TCLAPI get_autocommit( char zBuf[30]; sqlite3 *db; if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB", 0); return TCL_ERROR; } @@ -5088,7 +5088,7 @@ static int SQLITE_TCLAPI test_busy_timeout( int rc, ms; sqlite3 *db; if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " DB", 0); return TCL_ERROR; } @@ -5128,7 +5128,7 @@ static int SQLITE_TCLAPI tcl_variable_type( ** Usage: sqlite3_release_memory ?N? ** ** Attempt to release memory currently held but not actually required. -** The integer N is the number of bytes we are trying to release. The +** The integer N is the number of bytes we are trying to release. The ** return value is the amount of memory actually released. */ static int SQLITE_TCLAPI test_release_memory( @@ -5396,7 +5396,7 @@ static int SQLITE_TCLAPI working_64bit_int( ** ** This TCL command unregisters the primary VFS and then registers ** it back again. This is used to test the ability to register a -** VFS when none are previously registered, and the ability to +** VFS when none are previously registered, and the ability to ** unregister the only available VFS. Ticket #2738 */ static int SQLITE_TCLAPI vfs_unlink_test( @@ -5445,7 +5445,7 @@ static int SQLITE_TCLAPI vfs_unlink_test( assert( sqlite3_vfs_find("__two")==&two ); assert( sqlite3_vfs_find(0)==pMain ); } - + /* Unlink the default VFS. Repeat until there are no more VFSes ** registered. */ @@ -5458,18 +5458,18 @@ static int SQLITE_TCLAPI vfs_unlink_test( } } assert( 0==sqlite3_vfs_find(0) ); - + /* Register the main VFS as non-default (will be made default, since ** it'll be the only one in existence). */ sqlite3_vfs_register(pMain, 0); assert( sqlite3_vfs_find(0)==pMain ); - + /* Un-register the main VFS again to restore an empty VFS list */ sqlite3_vfs_unregister(pMain); assert( 0==sqlite3_vfs_find(0) ); - /* Relink all VFSes in reverse order. */ + /* Relink all VFSes in reverse order. */ for(i=sizeof(apVfs)/sizeof(apVfs[0])-1; i>=0; i--){ if( apVfs[i] ){ sqlite3_vfs_register(apVfs[i], 1); @@ -5625,16 +5625,16 @@ static int SQLITE_TCLAPI file_control_lasterrno_test( return TCL_ERROR; } rc = sqlite3_file_control(db, NULL, SQLITE_LAST_ERRNO, &iArg); - if( rc ){ - Tcl_SetObjResult(interp, Tcl_NewIntObj(rc)); - return TCL_ERROR; + if( rc ){ + Tcl_SetObjResult(interp, Tcl_NewIntObj(rc)); + return TCL_ERROR; } if( iArg!=0 ) { Tcl_AppendResult(interp, "Unexpected non-zero errno: ", Tcl_GetStringFromObj(Tcl_NewIntObj(iArg), 0), " ", 0); return TCL_ERROR; } - return TCL_OK; + return TCL_OK; } /* @@ -5659,7 +5659,7 @@ static int SQLITE_TCLAPI file_control_chunksize_test( Tcl_WrongNumArgs(interp, 1, objv, "DB DBNAME SIZE"); return TCL_ERROR; } - if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) + if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) || Tcl_GetIntFromObj(interp, objv[3], &nSize) ){ return TCL_ERROR; @@ -5678,7 +5678,7 @@ static int SQLITE_TCLAPI file_control_chunksize_test( /* ** tclcmd: file_control_sizehint_test DB DBNAME SIZE ** -** This TCL command runs the sqlite3_file_control interface +** This TCL command runs the sqlite3_file_control interface ** with SQLITE_FCNTL_SIZE_HINT */ static int SQLITE_TCLAPI file_control_sizehint_test( @@ -5696,7 +5696,7 @@ static int SQLITE_TCLAPI file_control_sizehint_test( Tcl_WrongNumArgs(interp, 1, objv, "DB DBNAME SIZE"); return TCL_ERROR; } - if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) + if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) || Tcl_GetWideIntFromObj(interp, objv[3], &nSize) ){ return TCL_ERROR; @@ -5726,7 +5726,7 @@ static int SQLITE_TCLAPI file_control_lockproxy_test( Tcl_Obj *CONST objv[] /* Command arguments */ ){ sqlite3 *db; - + if( objc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetStringFromObj(objv[0], 0), " DB PWD", 0); @@ -5735,7 +5735,7 @@ static int SQLITE_TCLAPI file_control_lockproxy_test( if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ return TCL_ERROR; } - + #if !defined(SQLITE_ENABLE_LOCKING_STYLE) # if defined(__APPLE__) # define SQLITE_ENABLE_LOCKING_STYLE 1 @@ -5750,7 +5750,7 @@ static int SQLITE_TCLAPI file_control_lockproxy_test( int nPwd; const char *zPwd; char proxyPath[400]; - + zPwd = Tcl_GetStringFromObj(objv[2], &nPwd); if( sizeof(proxyPath)zName, -1)); } Tcl_SetObjResult(interp, pRet); - return TCL_OK; + return TCL_OK; } /* @@ -6068,7 +6068,7 @@ static int SQLITE_TCLAPI test_limit( { "SQLITE_LIMIT_VARIABLE_NUMBER", SQLITE_LIMIT_VARIABLE_NUMBER }, { "SQLITE_LIMIT_TRIGGER_DEPTH", SQLITE_LIMIT_TRIGGER_DEPTH }, { "SQLITE_LIMIT_WORKER_THREADS", SQLITE_LIMIT_WORKER_THREADS }, - + /* Out of range test cases */ { "SQLITE_LIMIT_TOOSMALL", -1, }, { "SQLITE_LIMIT_TOOBIG", SQLITE_LIMIT_WORKER_THREADS+1 }, @@ -6097,7 +6097,7 @@ static int SQLITE_TCLAPI test_limit( if( Tcl_GetIntFromObj(interp, objv[3], &val) ) return TCL_ERROR; rc = sqlite3_limit(db, id, val); Tcl_SetObjResult(interp, Tcl_NewIntObj(rc)); - return TCL_OK; + return TCL_OK; } /* @@ -6322,7 +6322,7 @@ static int SQLITE_TCLAPI test_wal_checkpoint_v2( } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) || ( TCL_OK!=Tcl_GetIntFromObj(0, objv[2], &eMode) - && TCL_OK!=Tcl_GetIndexFromObj(interp, objv[2], aMode, "mode", 0, &eMode) + && TCL_OK!=Tcl_GetIndexFromObj(interp, objv[2], aMode, "mode", 0, &eMode) )){ return TCL_ERROR; } @@ -6363,7 +6363,7 @@ static int SQLITE_TCLAPI test_wal_autocheckpoint( return TCL_ERROR; } - if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) + if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) || Tcl_GetIntFromObj(0, objv[2], &iVal) ){ return TCL_ERROR; @@ -6507,7 +6507,7 @@ static int SQLITE_TCLAPI test_print_eqp( } if( getStmtPointer(interp, Tcl_GetString(objv[1]), &pStmt) ) return TCL_ERROR; rc = printExplainQueryPlan(pStmt); - /* This is needed on Windows so that a test case using this + /* This is needed on Windows so that a test case using this ** function can open a read pipe and get the output of ** printExplainQueryPlan() immediately. */ @@ -6530,8 +6530,8 @@ static int SQLITE_TCLAPI test_test_control( const char *zName; int i; } aVerb[] = { - { "SQLITE_TESTCTRL_LOCALTIME_FAULT", SQLITE_TESTCTRL_LOCALTIME_FAULT }, - { "SQLITE_TESTCTRL_SORTER_MMAP", SQLITE_TESTCTRL_SORTER_MMAP }, + { "SQLITE_TESTCTRL_LOCALTIME_FAULT", SQLITE_TESTCTRL_LOCALTIME_FAULT }, + { "SQLITE_TESTCTRL_SORTER_MMAP", SQLITE_TESTCTRL_SORTER_MMAP }, { "SQLITE_TESTCTRL_IMPOSTER", SQLITE_TESTCTRL_IMPOSTER }, }; int iVerb; @@ -6611,9 +6611,9 @@ static int SQLITE_TCLAPI test_getrusage( getrusage(RUSAGE_SELF, &r); sqlite3_snprintf(sizeof(buf), buf, - "ru_utime=%d.%06d ru_stime=%d.%06d ru_minflt=%d ru_majflt=%d", - (int)r.ru_utime.tv_sec, (int)r.ru_utime.tv_usec, - (int)r.ru_stime.tv_sec, (int)r.ru_stime.tv_usec, + "ru_utime=%d.%06d ru_stime=%d.%06d ru_minflt=%d ru_majflt=%d", + (int)r.ru_utime.tv_sec, (int)r.ru_utime.tv_usec, + (int)r.ru_stime.tv_sec, (int)r.ru_stime.tv_usec, (int)r.ru_minflt, (int)r.ru_majflt ); Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1)); @@ -6685,7 +6685,7 @@ static int SQLITE_TCLAPI win32_file_lock( int retry = 0; HANDLE ev; DWORD wResult; - + if( objc!=4 && objc!=1 ){ Tcl_WrongNumArgs(interp, 1, objv, "FILENAME DELAY1 DELAY2"); return TCL_ERROR; @@ -7054,7 +7054,7 @@ static int SQLITE_TCLAPI sorter_test_fakeheap( /* ** sorter_test_sort4_helper DB SQL1 NSTEP SQL2 ** -** Compile SQL statement $SQL1 and step it $NSTEP times. For each row, +** Compile SQL statement $SQL1 and step it $NSTEP times. For each row, ** check that the leftmost and rightmost columns returned are both integers, ** and that both contain the same value. ** @@ -7069,15 +7069,15 @@ static int SQLITE_TCLAPI sorter_test_sort4_helper( ){ const char *zSql1; const char *zSql2; - int nStep; - int iStep; - unsigned int iCksum1 = 0; - unsigned int iCksum2 = 0; + int nStep; + int iStep; + unsigned int iCksum1 = 0; + unsigned int iCksum2 = 0; int rc; int iB; sqlite3 *db; sqlite3_stmt *pStmt; - + if( objc!=5 ){ Tcl_WrongNumArgs(interp, 1, objv, "DB SQL1 NSTEP SQL2"); return TCL_ERROR; @@ -7307,7 +7307,7 @@ static int SQLITE_TCLAPI test_bad_behavior( } } return TCL_OK; -} +} /* ** tclcmd: register_dbstat_vtab DB @@ -7715,27 +7715,27 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0); } for(i=0; idb->mutex); return TCL_OK; -} +} /* ** usage: btree_insert CSR ?KEY? VALUE diff --git a/third_party/sqlite/src/src/test4.c b/third_party/sqlite/src/src/test4.c index c5b5ec12cc43d..766648f360043 100644 --- a/third_party/sqlite/src/src/test4.c +++ b/third_party/sqlite/src/src/test4.c @@ -62,7 +62,7 @@ static Thread threadset[N_THREAD]; /* -** The main loop for a thread. Threads use busy waiting. +** The main loop for a thread. Threads use busy waiting. */ static void *thread_main(void *pArg){ Thread *p = (Thread*)pArg; @@ -661,7 +661,7 @@ static int SQLITE_TCLAPI tcl_thread_db_put( ** Usage: thread_stmt_get ID ** ** Return the database stmt pointer for the given thread. Then -** remove the pointer from the thread itself. +** remove the pointer from the thread itself. */ static int SQLITE_TCLAPI tcl_thread_stmt_get( void *NotUsed, diff --git a/third_party/sqlite/src/src/test5.c b/third_party/sqlite/src/src/test5.c index 0d9242862bc69..e916eb9882c5d 100644 --- a/third_party/sqlite/src/src/test5.c +++ b/third_party/sqlite/src/src/test5.c @@ -138,7 +138,7 @@ static int SQLITE_TCLAPI test_translate( if( objc!=4 && objc!=5 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), + Tcl_GetStringFromObj(objv[0], 0), " ", 0 ); return TCL_ERROR; diff --git a/third_party/sqlite/src/src/test6.c b/third_party/sqlite/src/src/test6.c index 5304bcc31f20b..ecbb233da88b8 100644 --- a/third_party/sqlite/src/src/test6.c +++ b/third_party/sqlite/src/src/test6.c @@ -33,25 +33,25 @@ typedef struct WriteBuffer WriteBuffer; /* ** Method: ** -** This layer is implemented as a wrapper around the "real" -** sqlite3_file object for the host system. Each time data is +** This layer is implemented as a wrapper around the "real" +** sqlite3_file object for the host system. Each time data is ** written to the file object, instead of being written to the -** underlying file, the write operation is stored in an in-memory +** underlying file, the write operation is stored in an in-memory ** structure (type WriteBuffer). This structure is placed at the ** end of a global ordered list (the write-list). ** ** When data is read from a file object, the requested region is -** first retrieved from the real file. The write-list is then -** traversed and data copied from any overlapping WriteBuffer +** first retrieved from the real file. The write-list is then +** traversed and data copied from any overlapping WriteBuffer ** structures to the output buffer. i.e. a read() operation following ** one or more write() operations works as expected, even if no ** data has actually been written out to the real file. ** -** When a fsync() operation is performed, an operating system crash -** may be simulated, in which case exit(-1) is called (the call to +** When a fsync() operation is performed, an operating system crash +** may be simulated, in which case exit(-1) is called (the call to ** xSync() never returns). Whether or not a crash is simulated, -** the data associated with a subset of the WriteBuffer structures -** stored in the write-list is written to the real underlying files +** the data associated with a subset of the WriteBuffer structures +** stored in the write-list is written to the real underlying files ** and the entries removed from the write-list. If a crash is simulated, ** a subset of the buffers may be corrupted before the data is written. ** @@ -63,13 +63,13 @@ typedef struct WriteBuffer WriteBuffer; ** Normal mode is used when the simulated device has none of the ** SQLITE_IOCAP_XXX flags set. ** -** In normal mode, if the fsync() is not a simulated crash, the +** In normal mode, if the fsync() is not a simulated crash, the ** write-list is traversed from beginning to end. Each WriteBuffer ** structure associated with the file handle used to call xSync() ** is written to the real file and removed from the write-list. ** -** If a crash is simulated, one of the following takes place for -** each WriteBuffer in the write-list, regardless of which +** If a crash is simulated, one of the following takes place for +** each WriteBuffer in the write-list, regardless of which ** file-handle it is associated with: ** ** 1. The buffer is correctly written to the file, just as if @@ -77,14 +77,14 @@ typedef struct WriteBuffer WriteBuffer; ** ** 2. Nothing is done. ** -** 3. Garbage data is written to all sectors of the file that +** 3. Garbage data is written to all sectors of the file that ** overlap the region specified by the WriteBuffer. Or garbage -** data is written to some contiguous section within the +** data is written to some contiguous section within the ** overlapped sectors. ** ** Device Characteristic flag handling: ** -** If the IOCAP_ATOMIC flag is set, then option (3) above is +** If the IOCAP_ATOMIC flag is set, then option (3) above is ** never selected. ** ** If the IOCAP_ATOMIC512 flag is set, and the WriteBuffer represents @@ -96,11 +96,11 @@ typedef struct WriteBuffer WriteBuffer; ** ** If either the IOCAP_SAFEAPPEND or IOCAP_SEQUENTIAL flags are set ** and a crash is being simulated, then an entry of the write-list is -** selected at random. Everything in the list after the selected entry +** selected at random. Everything in the list after the selected entry ** is discarded before processing begins. ** -** If IOCAP_SEQUENTIAL is set and a crash is being simulated, option -** (1) is selected for all write-list entries except the last. If a +** If IOCAP_SEQUENTIAL is set and a crash is being simulated, option +** (1) is selected for all write-list entries except the last. If a ** crash is not being simulated, then all entries in the write-list ** that occur before at least one write() on the file-handle specified ** as part of the xSync() are written to their associated real files. @@ -114,7 +114,7 @@ typedef struct WriteBuffer WriteBuffer; ** Each write operation in the write-list is represented by an instance ** of the following structure. ** -** If zBuf is 0, then this structure represents a call to xTruncate(), +** If zBuf is 0, then this structure represents a call to xTruncate(), ** not xWrite(). In that case, iOffset is the size that the file is ** truncated to. */ @@ -133,7 +133,7 @@ struct CrashFile { char *zName; int flags; /* Flags the file was opened with */ - /* Cache of the entire file. This is used to speed up OsRead() and + /* Cache of the entire file. This is used to speed up OsRead() and ** OsFileSize() calls. Although both could be done by traversing the ** write-list, in practice this is impractically slow. */ @@ -150,7 +150,7 @@ struct CrashGlobal { int iDeviceCharacteristics; /* Value of simulated device characteristics */ int iCrash; /* Crash on the iCrash'th call to xSync() */ - char zCrashFile[500]; /* Crash during an xSync() on this file */ + char zCrashFile[500]; /* Crash during an xSync() on this file */ }; static CrashGlobal g = {0, 0, SQLITE_DEFAULT_SECTOR_SIZE, 0, 0}; @@ -194,7 +194,7 @@ static int writeListSync(CrashFile *pFile, int isCrash){ WriteBuffer *pWrite; WriteBuffer **ppPtr; - /* If this is not a crash simulation, set pFinal to point to the + /* If this is not a crash simulation, set pFinal to point to the ** last element of the write-list that is associated with file handle ** pFile. ** @@ -242,7 +242,7 @@ static int writeListSync(CrashFile *pFile, int isCrash){ char random; sqlite3_randomness(1, &random); - /* Do not select option 3 (sector trashing) if the IOCAP_ATOMIC flag + /* Do not select option 3 (sector trashing) if the IOCAP_ATOMIC flag ** is set or this is an OsTruncate(), not an Oswrite(). */ if( (iDc&SQLITE_IOCAP_ATOMIC) || (pWrite->zBuf==0) ){ @@ -288,7 +288,7 @@ static int writeListSync(CrashFile *pFile, int isCrash){ *ppPtr = pWrite->pNext; #ifdef TRACE_CRASHTEST if( isCrash ){ - printf("Writing %d bytes @ %d (%s)\n", + printf("Writing %d bytes @ %d (%s)\n", pWrite->nBuf, (int)pWrite->iOffset, pWrite->pFile->zName ); } @@ -300,7 +300,7 @@ static int writeListSync(CrashFile *pFile, int isCrash){ ppPtr = &pWrite->pNext; #ifdef TRACE_CRASHTEST if( isCrash ){ - printf("Omiting %d bytes @ %d (%s)\n", + printf("Omiting %d bytes @ %d (%s)\n", pWrite->nBuf, (int)pWrite->iOffset, pWrite->pFile->zName ); } @@ -315,7 +315,7 @@ static int writeListSync(CrashFile *pFile, int isCrash){ assert(pWrite->zBuf); #ifdef TRACE_CRASHTEST - printf("Trashing %d sectors @ %lld (sector %d) (%s)\n", + printf("Trashing %d sectors @ %lld (sector %d) (%s)\n", 1+iLast-iFirst, pWrite->iOffset, iFirst, pWrite->pFile->zName ); #endif @@ -324,7 +324,7 @@ static int writeListSync(CrashFile *pFile, int isCrash){ if( zGarbage ){ sqlite3_int64 i; for(i=iFirst; rc==SQLITE_OK && i<=iLast; i++){ - sqlite3_randomness(g.iSectorSize, zGarbage); + sqlite3_randomness(g.iSectorSize, zGarbage); rc = writeDbFile( pWrite->pFile, zGarbage, g.iSectorSize, i*g.iSectorSize ); @@ -388,7 +388,7 @@ static int writeListAppend( g.pWriteList = pNew; } g.pWriteListEnd = pNew; - + return SQLITE_OK; } @@ -406,9 +406,9 @@ static int cfClose(sqlite3_file *pFile){ ** Read data from a crash-file. */ static int cfRead( - sqlite3_file *pFile, - void *zBuf, - int iAmt, + sqlite3_file *pFile, + void *zBuf, + int iAmt, sqlite_int64 iOfst ){ CrashFile *pCrash = (CrashFile *)pFile; @@ -430,9 +430,9 @@ static int cfRead( ** Write data to a crash-file. */ static int cfWrite( - sqlite3_file *pFile, - const void *zBuf, - int iAmt, + sqlite3_file *pFile, + const void *zBuf, + int iAmt, sqlite_int64 iOfst ){ CrashFile *pCrash = (CrashFile *)pFile; @@ -599,7 +599,7 @@ struct crashAppData { ** ** The caller will have allocated pVfs->szOsFile bytes of space ** at pFile. This file uses this space for the CrashFile structure -** and allocates space for the "real" file structure using +** and allocates space for the "real" file structure using ** sqlite3_malloc(). The assumption here is (pVfs->szOsFile) is ** equal or greater than sizeof(CrashFile). */ @@ -662,17 +662,17 @@ static int cfDelete(sqlite3_vfs *pCfVfs, const char *zPath, int dirSync){ return pVfs->xDelete(pVfs, zPath, dirSync); } static int cfAccess( - sqlite3_vfs *pCfVfs, - const char *zPath, - int flags, + sqlite3_vfs *pCfVfs, + const char *zPath, + int flags, int *pResOut ){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; return pVfs->xAccess(pVfs, zPath, flags, pResOut); } static int cfFullPathname( - sqlite3_vfs *pCfVfs, - const char *zPath, + sqlite3_vfs *pCfVfs, + const char *zPath, int nPathOut, char *zPathOut ){ @@ -748,11 +748,11 @@ static int processDevSymArgs( int nOpt; char *zOpt = Tcl_GetStringFromObj(objv[i], &nOpt); - if( (nOpt>11 || nOpt<2 || strncmp("-sectorsize", zOpt, nOpt)) + if( (nOpt>11 || nOpt<2 || strncmp("-sectorsize", zOpt, nOpt)) && (nOpt>16 || nOpt<2 || strncmp("-characteristics", zOpt, nOpt)) ){ - Tcl_AppendResult(interp, - "Bad option: \"", zOpt, + Tcl_AppendResult(interp, + "Bad option: \"", zOpt, "\" - must be \"-characteristics\" or \"-sectorsize\"", 0 ); return TCL_ERROR; @@ -780,7 +780,7 @@ static int processDevSymArgs( Tcl_Obj *pFlag = Tcl_DuplicateObj(apObj[j]); Tcl_IncrRefCount(pFlag); Tcl_UtfToLower(Tcl_GetString(pFlag)); - + rc = Tcl_GetIndexFromObjStruct( interp, pFlag, aFlag, sizeof(aFlag[0]), "no such flag", 0, &iChoice ); @@ -808,7 +808,7 @@ static int processDevSymArgs( /* ** tclcmd: sqlite3_crash_now ** -** Simulate a crash immediately. This function does not return +** Simulate a crash immediately. This function does not return ** (writeListSync() calls exit(-1)). */ static int SQLITE_TCLAPI crashNowCmd( @@ -846,7 +846,7 @@ static int SQLITE_TCLAPI crashEnableCmd( 0, /* pNext */ "crash", /* zName */ 0, /* pAppData */ - + cfOpen, /* xOpen */ cfDelete, /* xDelete */ cfAccess, /* xAccess */ @@ -899,7 +899,7 @@ static int SQLITE_TCLAPI crashEnableCmd( ** an argument. For -sectorsize, this is the simulated sector size in ** bytes. For -characteristics, the argument must be a list of io-capability ** flags to simulate. Valid flags are "atomic", "atomic512", "atomic1K", -** "atomic2K", "atomic4K", "atomic8K", "atomic16K", "atomic32K", +** "atomic2K", "atomic4K", "atomic8K", "atomic16K", "atomic32K", ** "atomic64K", "sequential" and "safe_append". ** ** Example: @@ -1013,7 +1013,7 @@ static int SQLITE_TCLAPI jtObjCmd( zParent = Tcl_GetString(objv[1]); if( objc==3 ){ if( strcmp(zParent, "-default") ){ - Tcl_AppendResult(interp, + Tcl_AppendResult(interp, "bad option \"", zParent, "\": must be -default", 0 ); return TCL_ERROR; diff --git a/third_party/sqlite/src/src/test7.c b/third_party/sqlite/src/src/test7.c index d57e4b826b843..8a772d7891614 100644 --- a/third_party/sqlite/src/src/test7.c +++ b/third_party/sqlite/src/src/test7.c @@ -61,7 +61,7 @@ struct Thread { volatile int opnum; /* Operation number */ volatile int busy; /* True if this thread is in use */ - /* The next group of fields are writable by the client threads + /* The next group of fields are writable by the client threads ** but read-only to the superviser thread. */ volatile int completed; /* Number of operations completed */ @@ -74,10 +74,10 @@ struct Thread { const char *argv[100]; /* result columns */ const char *colv[100]; /* result column names */ - /* Initialized to 1 by the supervisor thread when the client is - ** created, and then deemed read-only to the supervisor thread. - ** Is set to 0 by the server thread belonging to this client - ** just before it exits. + /* Initialized to 1 by the supervisor thread when the client is + ** created, and then deemed read-only to the supervisor thread. + ** Is set to 0 by the server thread belonging to this client + ** just before it exits. */ int nServer; /* Number of server threads running */ }; @@ -90,7 +90,7 @@ struct Thread { static Thread threadset[N_THREAD]; /* -** The main loop for a thread. Threads use busy waiting. +** The main loop for a thread. Threads use busy waiting. */ static void *client_main(void *pArg){ Thread *p = (Thread*)pArg; diff --git a/third_party/sqlite/src/src/test8.c b/third_party/sqlite/src/src/test8.c index daab504e4ea68..1a89e475b08e3 100644 --- a/third_party/sqlite/src/src/test8.c +++ b/third_party/sqlite/src/src/test8.c @@ -49,8 +49,8 @@ typedef struct echo_cursor echo_cursor; /* ** Errors can be provoked within the following echo virtual table methods: ** -** xBestIndex xOpen xFilter xNext -** xColumn xRowid xUpdate xSync +** xBestIndex xOpen xFilter xNext +** xColumn xRowid xUpdate xSync ** xBegin xRename ** ** This is done by setting the global tcl variable: @@ -62,10 +62,10 @@ typedef struct echo_cursor echo_cursor; ** the name of the virtual table, the name of the underlying real table). */ -/* +/* ** An echo virtual-table object. ** -** echo.vtab.aIndex is an array of booleans. The nth entry is true if +** echo.vtab.aIndex is an array of booleans. The nth entry is true if ** the nth column of the real table is the left-most column of an index ** (implicit or otherwise). In other words, if SQLite can optimize ** a query like "SELECT * FROM real_table WHERE col = ?". @@ -157,9 +157,9 @@ static void dequoteString(char *z){ ** on *paCol. */ static int getColumnNames( - sqlite3 *db, + sqlite3 *db, const char *zTab, - char ***paCol, + char ***paCol, int *pnCol ){ char **aCol = 0; @@ -186,7 +186,7 @@ static int getColumnNames( char *zSpace; nCol = sqlite3_column_count(pStmt); - /* Figure out how much space to allocate for the array of column names + /* Figure out how much space to allocate for the array of column names ** (including space for the strings themselves). Then allocate it. */ nBytes = sizeof(char *) * nCol; @@ -225,15 +225,15 @@ out: } /* -** Parameter zTab is the name of a table in database db with nCol -** columns. This function allocates an array of integers nCol in -** size and populates it according to any implicit or explicit +** Parameter zTab is the name of a table in database db with nCol +** columns. This function allocates an array of integers nCol in +** size and populates it according to any implicit or explicit ** indices on table zTab. ** -** If successful, SQLITE_OK is returned and *paIndex set to point +** If successful, SQLITE_OK is returned and *paIndex set to point ** at the allocated array. Otherwise, an error code is returned. ** -** See comments associated with the member variable aIndex above +** See comments associated with the member variable aIndex above ** "struct echo_vtab" for details of the contents of the array. */ static int getIndexArray( @@ -263,7 +263,7 @@ static int getIndexArray( rc = sqlite3_prepare(db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); - /* For each index, figure out the left-most column and set the + /* For each index, figure out the left-most column and set the ** corresponding entry in aIndex[] to 1. */ while( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){ @@ -317,7 +317,7 @@ static void appendToEchoModule(Tcl_Interp *interp, const char *zArg){ /* ** This function is called from within the echo-modules xCreate and -** xConnect methods. The argc and argv arguments are copies of those +** xConnect methods. The argc and argv arguments are copies of those ** passed to the calling method. This function is responsible for ** calling sqlite3_declare_vtab() to declare the schema of the virtual ** table being created or connected. @@ -327,20 +327,20 @@ static void appendToEchoModule(Tcl_Interp *interp, const char *zArg){ ** CREATE TABLE t1 AS echo(t2); ** ** Then t2 is assumed to be the name of a *real* database table. The -** schema of the virtual table is declared by passing a copy of the +** schema of the virtual table is declared by passing a copy of the ** CREATE TABLE statement for the real table to sqlite3_declare_vtab(). -** Hence, the virtual table should have exactly the same column names and +** Hence, the virtual table should have exactly the same column names and ** types as the real table. */ static int echoDeclareVtab( - echo_vtab *pVtab, - sqlite3 *db + echo_vtab *pVtab, + sqlite3 *db ){ int rc = SQLITE_OK; if( pVtab->zTableName ){ sqlite3_stmt *pStmt = 0; - rc = sqlite3_prepare(db, + rc = sqlite3_prepare(db, "SELECT sql FROM sqlite_master WHERE type = 'table' AND name = ?", -1, &pStmt, 0); if( rc==SQLITE_OK ){ @@ -355,7 +355,7 @@ static int echoDeclareVtab( } } else { rc = sqlite3_finalize(pStmt); - if( rc==SQLITE_OK ){ + if( rc==SQLITE_OK ){ rc = SQLITE_ERROR; } } @@ -458,7 +458,7 @@ static int echoConstructor( return SQLITE_OK; } -/* +/* ** Echo virtual table module xCreate method. */ static int echoCreate( @@ -472,8 +472,8 @@ static int echoCreate( appendToEchoModule(((EchoModule *)pAux)->interp, "xCreate"); rc = echoConstructor(db, pAux, argc, argv, ppVtab, pzErr); - /* If there were two arguments passed to the module at the SQL level - ** (i.e. "CREATE VIRTUAL TABLE tbl USING echo(arg1, arg2)"), then + /* If there were two arguments passed to the module at the SQL level + ** (i.e. "CREATE VIRTUAL TABLE tbl USING echo(arg1, arg2)"), then ** the second argument is used as a table name. Attempt to create ** such a table with a single column, "logmsg". This table will ** be used to log calls to the xUpdate method. It will be deleted @@ -506,7 +506,7 @@ static int echoCreate( return rc; } -/* +/* ** Echo virtual table module xConnect method. */ static int echoConnect( @@ -520,7 +520,7 @@ static int echoConnect( return echoConstructor(db, pAux, argc, argv, ppVtab, pzErr); } -/* +/* ** Echo virtual table module xDisconnect method. */ static int echoDisconnect(sqlite3_vtab *pVtab){ @@ -528,7 +528,7 @@ static int echoDisconnect(sqlite3_vtab *pVtab){ return echoDestructor(pVtab); } -/* +/* ** Echo virtual table module xDestroy method. */ static int echoDestroy(sqlite3_vtab *pVtab){ @@ -550,7 +550,7 @@ static int echoDestroy(sqlite3_vtab *pVtab){ return rc; } -/* +/* ** Echo virtual table module xOpen method. */ static int echoOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){ @@ -563,7 +563,7 @@ static int echoOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){ return (pCur ? SQLITE_OK : SQLITE_NOMEM); } -/* +/* ** Echo virtual table module xClose method. */ static int echoClose(sqlite3_vtab_cursor *cur){ @@ -584,7 +584,7 @@ static int echoEof(sqlite3_vtab_cursor *cur){ return (((echo_cursor *)cur)->pStmt ? 0 : 1); } -/* +/* ** Echo virtual table module xNext method. */ static int echoNext(sqlite3_vtab_cursor *cur){ @@ -608,7 +608,7 @@ static int echoNext(sqlite3_vtab_cursor *cur){ return rc; } -/* +/* ** Echo virtual table module xColumn method. */ static int echoColumn(sqlite3_vtab_cursor *cur, sqlite3_context *ctx, int i){ @@ -628,7 +628,7 @@ static int echoColumn(sqlite3_vtab_cursor *cur, sqlite3_context *ctx, int i){ return SQLITE_OK; } -/* +/* ** Echo virtual table module xRowid method. */ static int echoRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ @@ -645,7 +645,7 @@ static int echoRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ /* ** Compute a simple hash of the null terminated string zString. ** -** This module uses only sqlite3_index_info.idxStr, not +** This module uses only sqlite3_index_info.idxStr, not ** sqlite3_index_info.idxNum. So to test idxNum, when idxStr is set ** in echoBestIndex(), idxNum is set to the corresponding hash value. ** In echoFilter(), code assert()s that the supplied idxNum value is @@ -660,11 +660,11 @@ static int hashString(const char *zString){ return (int)(val&0x7fffffff); } -/* +/* ** Echo virtual table module xFilter method. */ static int echoFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -750,7 +750,7 @@ static void string_concat(char **pzStr, char *zAppend, int doFree, int *pRc){ } /* -** This function returns a pointer to an sqlite3_malloc()ed buffer +** This function returns a pointer to an sqlite3_malloc()ed buffer ** containing the select-list (the thing between keywords SELECT and FROM) ** to query the underlying real table with for the scan described by ** argument pIdxInfo. @@ -787,10 +787,10 @@ static char *echoSelectList(echo_vtab *pTab, sqlite3_index_info *pIdxInfo){ ** ** then the echo module handles WHERE or ORDER BY clauses that refer ** to the column "b", but not "a" or "c". If a multi-column index is -** present, only its left most column is considered. +** present, only its left most column is considered. ** ** This xBestIndex method encodes the proposed search strategy as -** an SQL query on the real table underlying the virtual echo module +** an SQL query on the real table underlying the virtual echo module ** table and stores the query in sqlite3_index_info.idxStr. The SQL ** statement is of the form: ** @@ -826,8 +826,8 @@ static int echoBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ /* Determine the number of rows in the table and store this value in local ** variable nRow. The 'estimated-cost' of the scan will be the number of - ** rows in the table for a linear scan, or the log (base 2) of the - ** number of rows if the proposed scan uses an index. + ** rows in the table for a linear scan, or the log (base 2) of the + ** number of rows if the proposed scan uses an index. */ if( Tcl_GetVar(interp, "echo_module_cost", TCL_GLOBAL_ONLY) ){ cost = atof(Tcl_GetVar(interp, "echo_module_cost", TCL_GLOBAL_ONLY)); @@ -898,7 +898,7 @@ static int echoBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ zOp = "regexp"; break; } if( zOp[0]=='L' ){ - zNew = sqlite3_mprintf(" %s %s LIKE (SELECT '%%'||?||'%%')", + zNew = sqlite3_mprintf(" %s %s LIKE (SELECT '%%'||?||'%%')", zSep, zNewCol); } else { zNew = sqlite3_mprintf(" %s %s %s ?", zSep, zNewCol, zOp); @@ -912,7 +912,7 @@ static int echoBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ } /* If there is only one term in the ORDER BY clause, and it is - ** on a column that this virtual table has an index for, then consume + ** on a column that this virtual table has an index for, then consume ** the ORDER BY clause. */ if( pIdxInfo->nOrderBy==1 && ( @@ -952,10 +952,10 @@ static int echoBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ /* ** The xUpdate method for echo module virtual tables. -** +** ** apData[0] apData[1] apData[2..] ** -** INTEGER DELETE +** INTEGER DELETE ** ** INTEGER NULL (nCol args) UPDATE (do not set rowid) ** INTEGER INTEGER (nCol args) UPDATE (with SET rowid = ) @@ -965,9 +965,9 @@ static int echoBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ ** */ int echoUpdate( - sqlite3_vtab *tab, - int nData, - sqlite3_value **apData, + sqlite3_vtab *tab, + int nData, + sqlite3_value **apData, sqlite_int64 *pRowid ){ echo_vtab *pVtab = (echo_vtab *)tab; @@ -1028,7 +1028,7 @@ int echoUpdate( int ii; char *zInsert = 0; char *zValues = 0; - + zInsert = sqlite3_mprintf("INSERT INTO %Q (", pVtab->zTableName); if( !zInsert ){ rc = SQLITE_NOMEM; @@ -1041,9 +1041,9 @@ int echoUpdate( assert((pVtab->nCol+2)==nData); for(ii=2; iiaCol[ii-2]), 1, &rc); - string_concat(&zValues, + string_concat(&zValues, sqlite3_mprintf("%s?%d", zValues?", ":"", ii), 1, &rc); } @@ -1111,7 +1111,7 @@ static int echoBegin(sqlite3_vtab *tab){ int rc; echo_vtab *pVtab = (echo_vtab *)tab; Tcl_Interp *interp = pVtab->interp; - const char *zVal; + const char *zVal; /* Ticket #3083 - do not start a transaction if we are already in ** a transaction */ @@ -1142,7 +1142,7 @@ static int echoSync(sqlite3_vtab *tab){ int rc; echo_vtab *pVtab = (echo_vtab *)tab; Tcl_Interp *interp = pVtab->interp; - const char *zVal; + const char *zVal; /* Ticket #3083 - Only call xSync if we have previously started a ** transaction */ @@ -1266,7 +1266,7 @@ static int echoRename(sqlite3_vtab *vtab, const char *zNewName){ if( p->isPattern ){ int nThis = (int)strlen(p->zThis); - char *zSql = sqlite3_mprintf("ALTER TABLE %s RENAME TO %s%s", + char *zSql = sqlite3_mprintf("ALTER TABLE %s RENAME TO %s%s", p->zTableName, zNewName, &p->zTableName[nThis] ); rc = sqlite3_exec(p->db, zSql, 0, 0, 0); @@ -1300,7 +1300,7 @@ static sqlite3_module echoModule = { echoCreate, echoConnect, echoBestIndex, - echoDisconnect, + echoDisconnect, echoDestroy, echoOpen, /* xOpen - open a cursor */ echoClose, /* xClose - close a cursor */ @@ -1323,7 +1323,7 @@ static sqlite3_module echoModuleV2 = { echoCreate, echoConnect, echoBestIndex, - echoDisconnect, + echoDisconnect, echoDestroy, echoOpen, /* xOpen - open a cursor */ echoClose, /* xClose - close a cursor */ @@ -1383,7 +1383,7 @@ static int SQLITE_TCLAPI register_echo_module( if( rc==SQLITE_OK ){ pMod = sqlite3_malloc(sizeof(EchoModule)); pMod->interp = interp; - rc = sqlite3_create_module_v2(db, "echo_v2", + rc = sqlite3_create_module_v2(db, "echo_v2", &echoModuleV2, (void*)pMod, moduleDestroy ); } @@ -1435,7 +1435,7 @@ int Sqlitetest8_Init(Tcl_Interp *interp){ }; int i; for(i=0; ibase.zErrMsg = sqlite3_mprintf("%s", zErr); }else{ - /* Analyze the scripts return value. The return value should be a tcl + /* Analyze the scripts return value. The return value should be a tcl ** list object with an even number of elements. The first element of each ** pair must be one of: - ** + ** ** "sql" (SQL statement to return data) */ Tcl_Obj *pRes = Tcl_GetObjResult(interp); @@ -354,8 +354,8 @@ static int tclFilter( } static int tclColumn( - sqlite3_vtab_cursor *pVtabCursor, - sqlite3_context *ctx, + sqlite3_vtab_cursor *pVtabCursor, + sqlite3_context *ctx, int i ){ tcl_cursor *pCsr = (tcl_cursor*)pVtabCursor; @@ -458,10 +458,10 @@ static int tclBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ rc = SQLITE_ERROR; pTab->base.zErrMsg = sqlite3_mprintf("%s", zErr); }else{ - /* Analyze the scripts return value. The return value should be a tcl + /* Analyze the scripts return value. The return value should be a tcl ** list object with an even number of elements. The first element of each ** pair must be one of: - ** + ** ** "orderby" (value of orderByConsumed flag) ** "cost" (value of estimatedCost field) ** "rows" (value of estimatedRows field) @@ -502,8 +502,8 @@ static int tclBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ rc = Tcl_GetWideIntFromObj(interp, p, &x); pIdxInfo->estimatedRows = (tRowcnt)x; }else - if( sqlite3_stricmp("use", zCmd)==0 - || sqlite3_stricmp("omit", zCmd)==0 + if( sqlite3_stricmp("use", zCmd)==0 + || sqlite3_stricmp("omit", zCmd)==0 ){ int iCons; rc = Tcl_GetIntFromObj(interp, p, &iCons); @@ -541,7 +541,7 @@ static sqlite3_module tclModule = { tclConnect, tclConnect, tclBestIndex, - tclDisconnect, + tclDisconnect, tclDisconnect, tclOpen, /* xOpen - open a cursor */ tclClose, /* xClose - close a cursor */ @@ -602,7 +602,7 @@ int Sqlitetesttcl_Init(Tcl_Interp *interp){ }; int i; for(i=0; iaBuffer ){ char *z = (char *)zBuf; /* Pointer to remaining data to write */ int n = iAmt; /* Number of bytes at z */ @@ -267,7 +267,7 @@ static int demoWrite( /* If the buffer is full, or if this data is not being written directly ** following the data already buffered, flush the buffer. Flushing - ** the buffer is a no-op if it is empty. + ** the buffer is a no-op if it is empty. */ if( p->nBuffer==SQLITE_DEMOVFS_BUFFERSZ || p->iBufferOfst+p->nBuffer!=i ){ int rc = demoFlushBuffer(p); @@ -374,7 +374,7 @@ static int demoFileControl(sqlite3_file *pFile, int op, void *pArg){ /* ** The xSectorSize() and xDeviceCharacteristics() methods. These two -** may return special values allowing SQLite to optimize file-system +** may return special values allowing SQLite to optimize file-system ** access to some extent. But it is also safe to simply return 0. */ static int demoSectorSize(sqlite3_file *pFile){ @@ -494,9 +494,9 @@ static int demoDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ ** is both readable and writable. */ static int demoAccess( - sqlite3_vfs *pVfs, - const char *zPath, - int flags, + sqlite3_vfs *pVfs, + const char *zPath, + int flags, int *pResOut ){ int rc; /* access() return code */ @@ -517,13 +517,13 @@ static int demoAccess( /* ** Argument zPath points to a nul-terminated string containing a file path. -** If zPath is an absolute path, then it is copied as is into the output +** If zPath is an absolute path, then it is copied as is into the output ** buffer. Otherwise, if it is a relative path, then the equivalent full ** path is written to the output buffer. ** ** This function assumes that paths are UNIX style. Specifically, that: ** -** 1. Path components are separated by a '/'. and +** 1. Path components are separated by a '/'. and ** 2. Full paths begin with a '/' character. */ static int demoFullPathname( @@ -581,7 +581,7 @@ static int demoRandomness(sqlite3_vfs *pVfs, int nByte, char *zByte){ } /* -** Sleep for at least nMicro microseconds. Return the (approximate) number +** Sleep for at least nMicro microseconds. Return the (approximate) number ** of microseconds slept for. */ static int demoSleep(sqlite3_vfs *pVfs, int nMicro){ @@ -597,13 +597,13 @@ static int demoSleep(sqlite3_vfs *pVfs, int nMicro){ ** http://en.wikipedia.org/wiki/Julian_day ** ** This implementation is not very good. The current time is rounded to -** an integer number of seconds. Also, assuming time_t is a signed 32-bit +** an integer number of seconds. Also, assuming time_t is a signed 32-bit ** value, it will stop working some time in the year 2038 AD (the so-called -** "year 2038" problem that afflicts systems that store time this way). +** "year 2038" problem that afflicts systems that store time this way). */ static int demoCurrentTime(sqlite3_vfs *pVfs, double *pTime){ time_t t = time(0); - *pTime = t/86400.0 + 2440587.5; + *pTime = t/86400.0 + 2440587.5; return SQLITE_OK; } diff --git a/third_party/sqlite/src/src/test_devsym.c b/third_party/sqlite/src/src/test_devsym.c index 9a1ba09d69bc0..a436bb5ac395b 100644 --- a/third_party/sqlite/src/src/test_devsym.c +++ b/third_party/sqlite/src/src/test_devsym.c @@ -11,7 +11,7 @@ ****************************************************************************** ** ** This file contains code that modified the OS layer in order to simulate -** different device types (by overriding the return values of the +** different device types (by overriding the return values of the ** xDeviceCharacteristics() and xSectorSize() methods). */ #if SQLITE_TEST /* This file is used for testing only */ @@ -141,9 +141,9 @@ static int devsymClose(sqlite3_file *pFile){ ** Read data from an devsym-file. */ static int devsymRead( - sqlite3_file *pFile, - void *zBuf, - int iAmt, + sqlite3_file *pFile, + void *zBuf, + int iAmt, sqlite_int64 iOfst ){ devsym_file *p = (devsym_file *)pFile; @@ -154,9 +154,9 @@ static int devsymRead( ** Write data to an devsym-file. */ static int devsymWrite( - sqlite3_file *pFile, - const void *zBuf, - int iAmt, + sqlite3_file *pFile, + const void *zBuf, + int iAmt, sqlite_int64 iOfst ){ devsym_file *p = (devsym_file *)pFile; @@ -241,10 +241,10 @@ static int devsymShmLock(sqlite3_file *pFile, int ofst, int n, int flags){ return sqlite3OsShmLock(p->pReal, ofst, n, flags); } static int devsymShmMap( - sqlite3_file *pFile, - int iRegion, - int szRegion, - int isWrite, + sqlite3_file *pFile, + int iRegion, + int szRegion, + int isWrite, void volatile **pp ){ devsym_file *p = (devsym_file *)pFile; @@ -295,9 +295,9 @@ static int devsymDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ ** is available, or false otherwise. */ static int devsymAccess( - sqlite3_vfs *pVfs, - const char *zPath, - int flags, + sqlite3_vfs *pVfs, + const char *zPath, + int flags, int *pResOut ){ return sqlite3OsAccess(g.pVfs, zPath, flags, pResOut); @@ -309,9 +309,9 @@ static int devsymAccess( ** of at least (DEVSYM_MAX_PATHNAME+1) bytes. */ static int devsymFullPathname( - sqlite3_vfs *pVfs, - const char *zPath, - int nOut, + sqlite3_vfs *pVfs, + const char *zPath, + int nOut, char *zOut ){ return sqlite3OsFullPathname(g.pVfs, zPath, nOut, zOut); @@ -327,7 +327,7 @@ static void *devsymDlOpen(sqlite3_vfs *pVfs, const char *zPath){ /* ** Populate the buffer zErrMsg (size nByte bytes) with a human readable -** utf-8 string describing the most recent error encountered associated +** utf-8 string describing the most recent error encountered associated ** with dynamic libraries. */ static void devsymDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){ @@ -350,7 +350,7 @@ static void devsymDlClose(sqlite3_vfs *pVfs, void *pHandle){ #endif /* SQLITE_OMIT_LOAD_EXTENSION */ /* -** Populate the buffer pointed to by zBufOut with nByte bytes of +** Populate the buffer pointed to by zBufOut with nByte bytes of ** random data. */ static int devsymRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ @@ -358,7 +358,7 @@ static int devsymRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ } /* -** Sleep for nMicro microseconds. Return the number of microseconds +** Sleep for nMicro microseconds. Return the number of microseconds ** actually slept. */ static int devsymSleep(sqlite3_vfs *pVfs, int nMicro){ diff --git a/third_party/sqlite/src/src/test_fs.c b/third_party/sqlite/src/src/test_fs.c index dd590a66232fb..176169efaf31b 100644 --- a/third_party/sqlite/src/src/test_fs.c +++ b/third_party/sqlite/src/src/test_fs.c @@ -26,8 +26,8 @@ ** CREATE TABLE idx(id INTEGER PRIMARY KEY, path TEXT); ** INSERT INTO idx VALUES(4, '/etc/passwd'); ** -** Adding the row to the idx table automatically creates a row in the -** virtual table with rowid=4, path=/etc/passwd and a text field that +** Adding the row to the idx table automatically creates a row in the +** virtual table with rowid=4, path=/etc/passwd and a text field that ** contains data read from file /etc/passwd on disk. ** ************************************************************************* @@ -49,7 +49,7 @@ ************************************************************************* ** Virtual table module "fstree" ** -** This module is also a read-only eponymous virtual table with the +** This module is also a read-only eponymous virtual table with the ** following schema: ** ** CREATE TABLE fstree(path TEXT, size INT, data BLOB); @@ -96,8 +96,8 @@ typedef struct fs_vtab fs_vtab; typedef struct fs_cursor fs_cursor; -/* -** A fs virtual-table object +/* +** A fs virtual-table object */ struct fs_vtab { sqlite3_vtab base; @@ -259,7 +259,7 @@ static int fsdirNext(sqlite3_vtab_cursor *cur){ ** xFilter method implementation. */ static int fsdirFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -286,7 +286,7 @@ static int fsdirFilter( memcpy(pCsr->zDir, zDir, nDir+1); pCsr->pDir = opendir(pCsr->zDir); - return fsdirNext(pVtabCursor); + return fsdirNext(pVtabCursor); } /* @@ -475,14 +475,14 @@ static int fstreeNext(sqlite3_vtab_cursor *cur){ ** xFilter method implementation. */ static int fstreeFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ FstreeCsr *pCsr = (FstreeCsr*)pVtabCursor; FstreeVtab *pTab = (FstreeVtab*)(pCsr->base.pVtab); int rc; - const char *zSql = + const char *zSql = "WITH r(d) AS (" " SELECT CASE WHEN dir=?2 THEN ?3 ELSE dir END || '/' || name " " FROM fsdir WHERE dir=?1 AND name NOT LIKE '.%'" @@ -555,7 +555,7 @@ static int fstreeFilter( sqlite3_free(zRoot); #endif - return fstreeNext(pVtabCursor); + return fstreeNext(pVtabCursor); } /* @@ -695,7 +695,7 @@ static int fsNext(sqlite3_vtab_cursor *cur){ } static int fsFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -721,7 +721,7 @@ static int fsFilter( } if( rc==SQLITE_OK ){ - rc = fsNext(pVtabCursor); + rc = fsNext(pVtabCursor); } return rc; } @@ -807,7 +807,7 @@ static sqlite3_module fsModule = { fsConnect, fsConnect, fsBestIndex, - fsDisconnect, + fsDisconnect, fsDisconnect, fsOpen, /* xOpen - open a cursor */ fsClose, /* xClose - close a cursor */ @@ -916,7 +916,7 @@ int Sqlitetestfs_Init(Tcl_Interp *interp){ }; int i; for(i=0; i=(iOff+nSector) ){ @@ -510,9 +510,9 @@ finish_rjf: ** Write data to an jt-file. */ static int jtWrite( - sqlite3_file *pFile, - const void *zBuf, - int iAmt, + sqlite3_file *pFile, + const void *zBuf, + int iAmt, sqlite_int64 iOfst ){ int rc; @@ -521,7 +521,7 @@ static int jtWrite( if( iOfst==0 ){ jt_file *pMain = locateDatabaseHandle(p->zName, 0); assert( pMain ); - + if( iAmt==28 ){ /* Zeroing the first journal-file header. This is the end of a ** transaction. */ @@ -543,9 +543,9 @@ static int jtWrite( } if( p->flags&SQLITE_OPEN_MAIN_DB && p->pWritable ){ - if( iAmt<(int)p->nPagesize - && p->nPagesize%iAmt==0 - && iOfst>=(PENDING_BYTE+512) + if( iAmt<(int)p->nPagesize + && p->nPagesize%iAmt==0 + && iOfst>=(PENDING_BYTE+512) && iOfst+iAmt<=PENDING_BYTE+p->nPagesize ){ /* No-op. This special case is hit when the backup code is copying a @@ -601,8 +601,8 @@ static int jtSync(sqlite3_file *pFile, int flags){ int rc; jt_file *pMain; /* The associated database file */ - /* The journal file is being synced. At this point, we inspect the - ** contents of the file up to this point and set each bit in the + /* The journal file is being synced. At this point, we inspect the + ** contents of the file up to this point and set each bit in the ** jt_file.pWritable bitvec of the main database file associated with ** this journal file. */ @@ -745,9 +745,9 @@ static int jtDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ ** is available, or false otherwise. */ static int jtAccess( - sqlite3_vfs *pVfs, - const char *zPath, - int flags, + sqlite3_vfs *pVfs, + const char *zPath, + int flags, int *pResOut ){ return sqlite3OsAccess(g.pVfs, zPath, flags, pResOut); @@ -759,9 +759,9 @@ static int jtAccess( ** of at least (JT_MAX_PATHNAME+1) bytes. */ static int jtFullPathname( - sqlite3_vfs *pVfs, - const char *zPath, - int nOut, + sqlite3_vfs *pVfs, + const char *zPath, + int nOut, char *zOut ){ return sqlite3OsFullPathname(g.pVfs, zPath, nOut, zOut); @@ -776,7 +776,7 @@ static void *jtDlOpen(sqlite3_vfs *pVfs, const char *zPath){ /* ** Populate the buffer zErrMsg (size nByte bytes) with a human readable -** utf-8 string describing the most recent error encountered associated +** utf-8 string describing the most recent error encountered associated ** with dynamic libraries. */ static void jtDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){ @@ -798,7 +798,7 @@ static void jtDlClose(sqlite3_vfs *pVfs, void *pHandle){ } /* -** Populate the buffer pointed to by zBufOut with nByte bytes of +** Populate the buffer pointed to by zBufOut with nByte bytes of ** random data. */ static int jtRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ @@ -806,7 +806,7 @@ static int jtRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ } /* -** Sleep for nMicro microseconds. Return the number of microseconds +** Sleep for nMicro microseconds. Return the number of microseconds ** actually slept. */ static int jtSleep(sqlite3_vfs *pVfs, int nMicro){ @@ -835,7 +835,7 @@ static int jtGetLastError(sqlite3_vfs *pVfs, int n, char *z){ */ /* -** Configure the jt VFS as a wrapper around the VFS named by parameter +** Configure the jt VFS as a wrapper around the VFS named by parameter ** zWrap. If the isDefault parameter is true, then the jt VFS is installed ** as the new default VFS for SQLite connections. If isDefault is not ** true, then the jt VFS is installed as non-default. In this case it diff --git a/third_party/sqlite/src/src/test_loadext.c b/third_party/sqlite/src/src/test_loadext.c index 6404a69714e44..2dd5b5ad8eba8 100644 --- a/third_party/sqlite/src/src/test_loadext.c +++ b/third_party/sqlite/src/src/test_loadext.c @@ -80,7 +80,7 @@ static void statusFunc( sqlite3_result_error(context, zMsg, -1); sqlite3_free(zMsg); return; - } + } if( argc==2 ){ sqlite3_result_int(context, mx); }else{ @@ -95,8 +95,8 @@ static void statusFunc( __declspec(dllexport) #endif int testloadext_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int nErr = 0; @@ -116,8 +116,8 @@ int testloadext_init( __declspec(dllexport) #endif int testbrokenext_init( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ char *zErr; diff --git a/third_party/sqlite/src/src/test_malloc.c b/third_party/sqlite/src/src/test_malloc.c index e8c248f958ffb..9283b9a68ff1e 100644 --- a/third_party/sqlite/src/src/test_malloc.c +++ b/third_party/sqlite/src/src/test_malloc.c @@ -24,7 +24,7 @@ #include /* -** This structure is used to encapsulate the global state variables used +** This structure is used to encapsulate the global state variables used ** by malloc() fault simulation. */ static struct MemFault { @@ -68,7 +68,7 @@ static int faultsimStep(void){ if( memfault.nRepeat<=0 ){ memfault.enable = 0; } - return 1; + return 1; } /* @@ -96,7 +96,7 @@ static void *faultsimRealloc(void *pOld, int n){ return p; } -/* +/* ** The following method calls are passed directly through to the underlying ** malloc system: ** @@ -135,7 +135,7 @@ static void faultsimConfig(int nDelay, int nRepeat){ memfault.nFail = 0; memfault.enable = nDelay>=0; - /* Sometimes, when running multi-threaded tests, the isBenignMode + /* Sometimes, when running multi-threaded tests, the isBenignMode ** variable is not properly incremented/decremented so that it is ** 0 when not inside a benign malloc block. This doesn't affect ** the multi-threaded tests, as they do not use this system. But @@ -183,7 +183,7 @@ static void faultsimEndBenign(void){ /* ** Add or remove the fault-simulation layer using sqlite3_config(). If -** the argument is non-zero, the +** the argument is non-zero, the */ static int faultsimInstall(int install){ static struct sqlite3_mem_methods m = { @@ -211,7 +211,7 @@ static int faultsimInstall(int install){ if( rc==SQLITE_OK ){ rc = sqlite3_config(SQLITE_CONFIG_MALLOC, &m); } - sqlite3_test_control(SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS, + sqlite3_test_control(SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS, faultsimBeginBenign, faultsimEndBenign ); }else{ @@ -516,8 +516,8 @@ static int SQLITE_TCLAPI test_memory_highwater( } if( objc==2 ){ if( Tcl_GetBooleanFromObj(interp, objv[1], &resetFlag) ) return TCL_ERROR; - } - Tcl_SetObjResult(interp, + } + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(sqlite3_memory_highwater(resetFlag))); return TCL_OK; } @@ -666,7 +666,7 @@ static int SQLITE_TCLAPI test_memdebug_fail( return TCL_ERROR; } } - + nBenign = faultsimBenignFailures(); nFail = faultsimFailures(); faultsimConfig(iFail, nRepeat); @@ -681,7 +681,7 @@ static int SQLITE_TCLAPI test_memdebug_fail( /* ** Usage: sqlite3_memdebug_pending ** -** Return the number of malloc() calls that will succeed before a +** Return the number of malloc() calls that will succeed before a ** simulated failure occurs. A negative return value indicates that ** no malloc() failure is scheduled. */ @@ -740,7 +740,7 @@ static int SQLITE_TCLAPI test_memdebug_settitle( return TCL_OK; } -#define MALLOC_LOG_FRAMES 10 +#define MALLOC_LOG_FRAMES 10 #define MALLOC_LOG_KEYINTS ( \ 10 * ((sizeof(int)>=sizeof(void*)) ? 1 : sizeof(void*)/sizeof(int)) \ ) @@ -809,8 +809,8 @@ static int SQLITE_TCLAPI test_memdebug_log( int iSub; static const char *MB_strs[] = { "start", "stop", "dump", "clear", "sync" }; - enum MB_enum { - MB_LOG_START, MB_LOG_STOP, MB_LOG_DUMP, MB_LOG_CLEAR, MB_LOG_SYNC + enum MB_enum { + MB_LOG_START, MB_LOG_STOP, MB_LOG_DUMP, MB_LOG_CLEAR, MB_LOG_SYNC }; if( !isInit ){ @@ -853,7 +853,7 @@ static int SQLITE_TCLAPI test_memdebug_log( MallocLog *pLog = (MallocLog *)Tcl_GetHashValue(pEntry); Tcl_WideInt *aKey = (Tcl_WideInt *)Tcl_GetHashKey(&aMallocLog, pEntry); int ii; - + apElem[0] = Tcl_NewIntObj(pLog->nCall); apElem[1] = Tcl_NewIntObj(pLog->nByte); for(ii=0; ii5 ){ - Tcl_WrongNumArgs(interp, 1, objv, + Tcl_WrongNumArgs(interp, 1, objv, "INSTALLFLAG DISCARDCHANCE PRNGSEEED HIGHSTRESS"); return TCL_ERROR; } @@ -1112,7 +1112,7 @@ static int SQLITE_TCLAPI test_db_config_lookaside( ** Usage: sqlite3_config_heap NBYTE NMINALLOC */ static int SQLITE_TCLAPI test_config_heap( - void * clientData, + void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] @@ -1149,7 +1149,7 @@ static int SQLITE_TCLAPI test_config_heap( ** Usage: sqlite3_config_heap_size NBYTE */ static int SQLITE_TCLAPI test_config_heap_size( - void * clientData, + void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] @@ -1179,7 +1179,7 @@ static int SQLITE_TCLAPI test_config_heap_size( ** opcodes and verify that they return errors. */ static int SQLITE_TCLAPI test_config_error( - void * clientData, + void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] @@ -1194,14 +1194,14 @@ static int SQLITE_TCLAPI test_config_error( if( objc==2 ){ if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; if( sqlite3_db_config(db, 99999)!=SQLITE_ERROR ){ - Tcl_AppendResult(interp, + Tcl_AppendResult(interp, "sqlite3_db_config(db, 99999) does not return SQLITE_ERROR", (char*)0); return TCL_ERROR; } }else{ if( sqlite3_config(99999)!=SQLITE_ERROR ){ - Tcl_AppendResult(interp, + Tcl_AppendResult(interp, "sqlite3_config(99999) does not return SQLITE_ERROR", (char*)0); return TCL_ERROR; @@ -1217,7 +1217,7 @@ static int SQLITE_TCLAPI test_config_error( ** SQLITE_CONFIG_URI. */ static int SQLITE_TCLAPI test_config_uri( - void * clientData, + void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] @@ -1246,7 +1246,7 @@ static int SQLITE_TCLAPI test_config_uri( ** SQLITE_CONFIG_COVERING_INDEX_SCAN. */ static int SQLITE_TCLAPI test_config_cis( - void * clientData, + void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] @@ -1274,7 +1274,7 @@ static int SQLITE_TCLAPI test_config_cis( ** Set the minimum PMA size. */ static int SQLITE_TCLAPI test_config_pmasz( - void * clientData, + void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] diff --git a/third_party/sqlite/src/src/test_multiplex.c b/third_party/sqlite/src/src/test_multiplex.c index ed8c9f7fa7e3f..68ad79aebaf4b 100644 --- a/third_party/sqlite/src/src/test_multiplex.c +++ b/third_party/sqlite/src/src/test_multiplex.c @@ -28,9 +28,9 @@ ** ** The procedure call above will create and register a new VFS shim named ** "multiplex". The multiplex VFS will use the VFS named by zOrigVfsName to -** do the actual disk I/O. (The zOrigVfsName parameter may be NULL, in +** do the actual disk I/O. (The zOrigVfsName parameter may be NULL, in ** which case the default VFS at the moment sqlite3_multiplex_initialize() -** is called will be used as the underlying real VFS.) +** is called will be used as the underlying real VFS.) ** ** If the makeDefault parameter is TRUE then multiplex becomes the new ** default VFS. Otherwise, you can use the multiplex VFS by specifying @@ -39,7 +39,7 @@ ** URI. ** ** The multiplex VFS allows databases up to 32 GiB in size. But it splits -** the files up into smaller pieces, so that they will work even on +** the files up into smaller pieces, so that they will work even on ** filesystems that do not support large files. The default chunk size ** is 2147418112 bytes (which is 64KiB less than 2GiB) but this can be ** changed at compile-time by defining the SQLITE_MULTIPLEX_CHUNK_SIZE @@ -58,10 +58,10 @@ #endif #include "sqlite3ext.h" -/* -** These should be defined to be the same as the values in +/* +** These should be defined to be the same as the values in ** sqliteInt.h. They are defined separately here so that -** the multiplex VFS shim can be built as a loadable +** the multiplex VFS shim can be built as a loadable ** module. */ #define UNUSED_PARAMETER(x) (void)(x) @@ -83,7 +83,7 @@ #endif /* This is the limit on the chunk size. It may be changed by calling -** the xFileControl() interface. It will be rounded up to a +** the xFileControl() interface. It will be rounded up to a ** multiple of MAX_PAGE_SIZE. We default it here to 2GiB less 64KiB. */ #ifndef SQLITE_MULTIPLEX_CHUNK_SIZE @@ -130,7 +130,7 @@ struct multiplexGroup { /* ** An instance of the following object represents each open connection -** to a file that is multiplex'ed. This object is a +** to a file that is multiplex'ed. This object is a ** subclass of sqlite3_file. The sqlite3_file object for the underlying ** VFS is appended to this structure. */ @@ -157,11 +157,11 @@ static struct { */ sqlite3_vfs sThisVfs; - /* The sIoMethods defines the methods used by sqlite3_file objects + /* The sIoMethods defines the methods used by sqlite3_file objects ** associated with this shim. It is initialized at start-time and does ** not require a mutex. ** - ** When the underlying VFS is called to open a file, it might return + ** When the underlying VFS is called to open a file, it might return ** either a version 1 or a version 2 sqlite3_file object. This shim ** has to create a wrapper sqlite3_file of the same version. Hence ** there are two I/O method structures, one for version 1 and the other @@ -199,16 +199,16 @@ static int multiplexStrlen30(const char *z){ ** nul-terminator. ** ** If iChunk is 0 (or 400 - the number for the first journal file chunk), -** the output is a copy of the input string. Otherwise, if +** the output is a copy of the input string. Otherwise, if ** SQLITE_ENABLE_8_3_NAMES is not defined or the input buffer does not contain -** a "." character, then the output is a copy of the input string with the -** three-digit zero-padded decimal representation if iChunk appended to it. +** a "." character, then the output is a copy of the input string with the +** three-digit zero-padded decimal representation if iChunk appended to it. ** For example: ** ** zBase="test.db", iChunk=4 -> zOut="test.db004" ** ** Or, if SQLITE_ENABLE_8_3_NAMES is defined and the input buffer contains -** a "." character, then everything after the "." is replaced by the +** a "." character, then everything after the "." is replaced by the ** three-digit representation of iChunk. ** ** zBase="test.db", iChunk=4 -> zOut="test.004" @@ -232,12 +232,12 @@ static void multiplexFilename( if( i>=n-4 ) n = i+1; if( flags & SQLITE_OPEN_MAIN_JOURNAL ){ /* The extensions on overflow files for main databases are 001, 002, - ** 003 and so forth. To avoid name collisions, add 400 to the + ** 003 and so forth. To avoid name collisions, add 400 to the ** extensions of journal files so that they are 401, 402, 403, .... */ iChunk += SQLITE_MULTIPLEX_JOURNAL_8_3_OFFSET; }else if( flags & SQLITE_OPEN_WAL ){ - /* To avoid name collisions, add 700 to the + /* To avoid name collisions, add 700 to the ** extensions of WAL files so that they are 701, 702, 703, .... */ iChunk += SQLITE_MULTIPLEX_WAL_8_3_OFFSET; @@ -294,8 +294,8 @@ static sqlite3_file *multiplexSubOpen( sqlite3_vfs *pOrigVfs = gMultiplex.pOrigVfs; /* Real VFS */ #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 + /* 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 ){ @@ -364,7 +364,7 @@ static sqlite3_int64 multiplexSubSize( if( pSub==0 ) return 0; *rc = pSub->pMethods->xFileSize(pSub, &sz); return sz; -} +} /* ** This is the implementation of the multiplex_control() SQL function. @@ -379,22 +379,22 @@ static void multiplexControlFunc( int op = 0; int iVal; - if( !db || argc!=2 ){ - rc = SQLITE_ERROR; + if( !db || argc!=2 ){ + rc = SQLITE_ERROR; }else{ /* extract params */ op = sqlite3_value_int(argv[0]); iVal = sqlite3_value_int(argv[1]); /* map function op to file_control op */ switch( op ){ - case 1: - op = MULTIPLEX_CTRL_ENABLE; + case 1: + op = MULTIPLEX_CTRL_ENABLE; break; - case 2: - op = MULTIPLEX_CTRL_SET_CHUNK_SIZE; + case 2: + op = MULTIPLEX_CTRL_SET_CHUNK_SIZE; break; - case 3: - op = MULTIPLEX_CTRL_SET_MAX_CHUNKS; + case 3: + op = MULTIPLEX_CTRL_SET_MAX_CHUNKS; break; default: rc = SQLITE_NOTFOUND; @@ -408,16 +408,16 @@ static void multiplexControlFunc( } /* -** This is the entry point to register the auto-extension for the +** This is the entry point to register the auto-extension for the ** multiplex_control() function. */ static int multiplexFuncInit( - sqlite3 *db, - char **pzErrMsg, + sqlite3 *db, + char **pzErrMsg, const sqlite3_api_routines *pApi ){ int rc; - rc = sqlite3_create_function(db, "multiplex_control", 2, SQLITE_ANY, + rc = sqlite3_create_function(db, "multiplex_control", 2, SQLITE_ANY, 0, multiplexControlFunc, 0, 0); return rc; } @@ -505,7 +505,7 @@ static int multiplexOpen( memset(pGroup, 0, sz); pMultiplexOpen->pGroup = pGroup; pGroup->bEnabled = (unsigned char)-1; - pGroup->bTruncate = (unsigned char)sqlite3_uri_boolean(zUri, "truncate", + pGroup->bTruncate = (unsigned char)sqlite3_uri_boolean(zUri, "truncate", (flags & SQLITE_OPEN_MAIN_DB)==0); pGroup->szChunk = (int)sqlite3_uri_int64(zUri, "chunksize", SQLITE_MULTIPLEX_CHUNK_SIZE); @@ -548,11 +548,11 @@ static int multiplexOpen( if( sz64==0 ){ if( flags & SQLITE_OPEN_MAIN_JOURNAL ){ /* If opening a main journal file and the first chunk is zero - ** bytes in size, delete any subsequent chunks from the + ** bytes in size, delete any subsequent chunks from the ** file-system. */ int iChunk = 1; do { - rc = pOrigVfs->xAccess(pOrigVfs, + rc = pOrigVfs->xAccess(pOrigVfs, pGroup->aReal[iChunk].z, SQLITE_ACCESS_EXISTS, &bExists ); if( rc==SQLITE_OK && bExists ){ @@ -570,7 +570,7 @@ static int multiplexOpen( ** ** Or, if the first overflow file does not exist and the main file is ** larger than the chunk size, that means the chunk size is too small. - ** But we have no way of determining the intended chunk size, so + ** But we have no way of determining the intended chunk size, so ** just disable the multiplexor all togethre. */ rc = pOrigVfs->xAccess(pOrigVfs, pGroup->aReal[1].z, @@ -615,7 +615,7 @@ static int multiplexDelete( rc = pOrigVfs->xDelete(pOrigVfs, zName, syncDir); if( rc==SQLITE_OK ){ /* If the main chunk was deleted successfully, also delete any subsequent - ** chunks - starting with the last (highest numbered). + ** chunks - starting with the last (highest numbered). */ int nName = (int)strlen(zName); char *z; @@ -692,7 +692,7 @@ static int multiplexCurrentTimeInt64(sqlite3_vfs *a, sqlite3_int64 *b){ /* xClose requests get passed through to the original VFS. ** We loop over all open chunk handles and close them. -** The group structure for this file is unlinked from +** The group structure for this file is unlinked from ** our list of groups and freed. */ static int multiplexClose(sqlite3_file *pConn){ @@ -1082,8 +1082,8 @@ static int multiplexShmUnmap(sqlite3_file *pConn, int deleteFlag){ /* ** CAPI: Initialize the multiplex VFS shim - sqlite3_multiplex_initialize() ** -** Use the VFS named zOrigVfsName as the VFS that does the actual work. -** Use the default if zOrigVfsName==NULL. +** Use the VFS named zOrigVfsName as the VFS that does the actual work. +** Use the default if zOrigVfsName==NULL. ** ** The multiplex VFS shim is named "multiplex". It will become the default ** VFS if makeDefault is non-zero. diff --git a/third_party/sqlite/src/src/test_multiplex.h b/third_party/sqlite/src/src/test_multiplex.h index 790c778a359cb..b7ddffd795464 100644 --- a/third_party/sqlite/src/src/test_multiplex.h +++ b/third_party/sqlite/src/src/test_multiplex.h @@ -13,8 +13,8 @@ ** This file contains a VFS "shim" - a layer that sits in between the ** pager and the real VFS. ** -** This particular shim enforces a multiplex system on DB files. -** This shim shards/partitions a single DB file into smaller +** This particular shim enforces a multiplex system on DB files. +** This shim shards/partitions a single DB file into smaller ** "chunks" such that the total DB file size may exceed the maximum ** file size of the underlying file system. ** @@ -33,8 +33,8 @@ ** shim. ** ** MULTIPLEX_CTRL_SET_CHUNK_SIZE: -** This file control is used to set the maximum allowed chunk -** size for a multiplex file set. The chunk size should be +** This file control is used to set the maximum allowed chunk +** size for a multiplex file set. The chunk size should be ** a multiple of SQLITE_MAX_PAGE_SIZE, and will be rounded up ** if not. ** @@ -53,26 +53,26 @@ extern "C" { /* ** CAPI: Initialize the multiplex VFS shim - sqlite3_multiplex_initialize() ** -** Use the VFS named zOrigVfsName as the VFS that does the actual work. -** Use the default if zOrigVfsName==NULL. +** Use the VFS named zOrigVfsName as the VFS that does the actual work. +** Use the default if zOrigVfsName==NULL. ** ** The multiplex VFS shim is named "multiplex". It will become the default ** VFS if makeDefault is non-zero. ** -** An auto-extension is registered which will make the function +** An auto-extension is registered which will make the function ** multiplex_control() available to database connections. This -** function gives access to the xFileControl interface of the +** function gives access to the xFileControl interface of the ** multiplex VFS shim. ** ** SELECT multiplex_control(,); -** +** ** =1 MULTIPLEX_CTRL_ENABLE ** =0 disable ** =1 enable -** +** ** =2 MULTIPLEX_CTRL_SET_CHUNK_SIZE ** int, chunk size -** +** ** =3 MULTIPLEX_CTRL_SET_MAX_CHUNKS ** int, max chunks ** diff --git a/third_party/sqlite/src/src/test_mutex.c b/third_party/sqlite/src/src/test_mutex.c index 8f43e5ad30ef8..974636fe58e4a 100644 --- a/third_party/sqlite/src/src/test_mutex.c +++ b/third_party/sqlite/src/src/test_mutex.c @@ -68,7 +68,7 @@ static int counterMutexNotheld(sqlite3_mutex *p){ ** return the value of g.disableInit as the result code. This can be used ** to simulate an initialization failure. */ -static int counterMutexInit(void){ +static int counterMutexInit(void){ int rc; if( g.disableInit ) return g.disableInit; rc = g.m.xMutexInit(); @@ -79,7 +79,7 @@ static int counterMutexInit(void){ /* ** Uninitialize the mutex subsystem */ -static int counterMutexEnd(void){ +static int counterMutexEnd(void){ g.isInit = 0; return g.m.xMutexEnd(); } @@ -502,9 +502,9 @@ int Sqlitetest_mutex_Init(Tcl_Interp *interp){ Tcl_CreateObjCommand(interp, aCmd[i].zName, aCmd[i].xProc, 0, 0); } - Tcl_LinkVar(interp, "disable_mutex_init", + Tcl_LinkVar(interp, "disable_mutex_init", (char*)&g.disableInit, TCL_LINK_INT); - Tcl_LinkVar(interp, "disable_mutex_try", + Tcl_LinkVar(interp, "disable_mutex_try", (char*)&g.disableTry, TCL_LINK_INT); return SQLITE_OK; } diff --git a/third_party/sqlite/src/src/test_onefile.c b/third_party/sqlite/src/src/test_onefile.c index 46c8bc9c839fe..7a99e3e7f4c2f 100644 --- a/third_party/sqlite/src/src/test_onefile.c +++ b/third_party/sqlite/src/src/test_onefile.c @@ -12,21 +12,21 @@ ** ** OVERVIEW: ** -** This file contains some example code demonstrating how the SQLite -** vfs feature can be used to have SQLite operate directly on an +** This file contains some example code demonstrating how the SQLite +** vfs feature can be used to have SQLite operate directly on an ** embedded media, without using an intermediate file system. ** ** Because this is only a demo designed to run on a workstation, the ** underlying media is simulated using a regular file-system file. The ** size of the file is fixed when it is first created (default size 10 MB). ** From SQLite's point of view, this space is used to store a single -** database file and the journal file. +** database file and the journal file. ** -** Any statement journal created is stored in volatile memory obtained -** from sqlite3_malloc(). Any attempt to create a temporary database file +** Any statement journal created is stored in volatile memory obtained +** from sqlite3_malloc(). Any attempt to create a temporary database file ** will fail (SQLITE_IOERR). To prevent SQLite from attempting this, -** it should be configured to store all temporary database files in -** main memory (see pragma "temp_store" or the SQLITE_TEMP_STORE compile +** it should be configured to store all temporary database files in +** main memory (see pragma "temp_store" or the SQLITE_TEMP_STORE compile ** time option). ** ** ASSUMPTIONS: @@ -44,7 +44,7 @@ ** FILE FORMAT: ** ** The basic principle is that the "database file" is stored at the -** beginning of the 10 MB blob and grows in a forward direction. The +** beginning of the 10 MB blob and grows in a forward direction. The ** "journal file" is stored at the end of the 10MB blob and grows ** in the reverse direction. If, during a transaction, insufficient ** space is available to expand either the journal or database file, @@ -59,14 +59,14 @@ ** size of the "database file". It is updated as part of the sync() ** operation. On startup, it can only be trusted if no journal file ** exists. If a journal-file does exist, then it stores the real size -** of the database region. The second and subsequent blocks store the +** of the database region. The second and subsequent blocks store the ** actual database content. ** -** The size of the "journal file" is not stored persistently in the +** The size of the "journal file" is not stored persistently in the ** file. When the system is running, the size of the journal file is ** stored in volatile memory. When recovering from a crash, this vfs ** reports a very large size for the journal file. The normal journal -** header and checksum mechanisms serve to prevent SQLite from +** header and checksum mechanisms serve to prevent SQLite from ** processing any data that lies past the logical end of the journal. ** ** When SQLite calls OsDelete() to delete the journal file, the final @@ -200,7 +200,7 @@ static fs_vfs_t fs_vfs = { fsSleep, /* xSleep */ fsCurrentTime, /* xCurrentTime */ 0 /* xCurrentTimeInt64 */ - }, + }, 0, /* pFileList */ 0 /* pParent */ }; @@ -264,9 +264,9 @@ static int tmpClose(sqlite3_file *pFile){ ** Read data from a tmp-file. */ static int tmpRead( - sqlite3_file *pFile, - void *zBuf, - int iAmt, + sqlite3_file *pFile, + void *zBuf, + int iAmt, sqlite_int64 iOfst ){ tmp_file *pTmp = (tmp_file *)pFile; @@ -281,9 +281,9 @@ static int tmpRead( ** Write data to a tmp-file. */ static int tmpWrite( - sqlite3_file *pFile, - const void *zBuf, - int iAmt, + sqlite3_file *pFile, + const void *zBuf, + int iAmt, sqlite_int64 iOfst ){ tmp_file *pTmp = (tmp_file *)pFile; @@ -398,9 +398,9 @@ static int fsClose(sqlite3_file *pFile){ ** Read data from an fs-file. */ static int fsRead( - sqlite3_file *pFile, - void *zBuf, - int iAmt, + sqlite3_file *pFile, + void *zBuf, + int iAmt, sqlite_int64 iOfst ){ int rc = SQLITE_OK; @@ -437,9 +437,9 @@ static int fsRead( ** Write data to an fs-file. */ static int fsWrite( - sqlite3_file *pFile, - const void *zBuf, - int iAmt, + sqlite3_file *pFile, + const void *zBuf, + int iAmt, sqlite_int64 iOfst ){ int rc = SQLITE_OK; @@ -607,7 +607,7 @@ static int fsOpen( assert(strlen("-journal")==8); nName = (int)strlen(zName)-((eType==JOURNAL_FILE)?8:0); - pReal=pFsVfs->pFileList; + pReal=pFsVfs->pFileList; for(; pReal && strncmp(pReal->zName, zName, nName); pReal=pReal->pNext); if( !pReal ){ @@ -692,7 +692,7 @@ static int fsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ assert(strlen("-journal")==8); assert(strcmp("-journal", &zPath[nName])==0); - pReal = pFsVfs->pFileList; + pReal = pFsVfs->pFileList; for(; pReal && strncmp(pReal->zName, zPath, nName); pReal=pReal->pNext); if( pReal ){ pF = pReal->pFile; @@ -709,9 +709,9 @@ static int fsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ ** is available, or false otherwise. */ static int fsAccess( - sqlite3_vfs *pVfs, - const char *zPath, - int flags, + sqlite3_vfs *pVfs, + const char *zPath, + int flags, int *pResOut ){ fs_vfs_t *pFsVfs = (fs_vfs_t *)pVfs; @@ -730,7 +730,7 @@ static int fsAccess( isJournal = 1; } - pReal = pFsVfs->pFileList; + pReal = pFsVfs->pFileList; for(; pReal && strncmp(pReal->zName, zPath, nName); pReal=pReal->pNext); *pResOut = (pReal && (!isJournal || pReal->nJournal>0)); @@ -762,7 +762,7 @@ static void *fsDlOpen(sqlite3_vfs *pVfs, const char *zPath){ /* ** Populate the buffer zErrMsg (size nByte bytes) with a human readable -** utf-8 string describing the most recent error encountered associated +** utf-8 string describing the most recent error encountered associated ** with dynamic libraries. */ static void fsDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){ @@ -787,7 +787,7 @@ static void fsDlClose(sqlite3_vfs *pVfs, void *pHandle){ } /* -** Populate the buffer pointed to by zBufOut with nByte bytes of +** Populate the buffer pointed to by zBufOut with nByte bytes of ** random data. */ static int fsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ @@ -796,7 +796,7 @@ static int fsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ } /* -** Sleep for nMicro microseconds. Return the number of microseconds +** Sleep for nMicro microseconds. Return the number of microseconds ** actually slept. */ static int fsSleep(sqlite3_vfs *pVfs, int nMicro){ diff --git a/third_party/sqlite/src/src/test_osinst.c b/third_party/sqlite/src/src/test_osinst.c index a008baba45deb..452dd33c0265a 100644 --- a/third_party/sqlite/src/src/test_osinst.c +++ b/third_party/sqlite/src/src/test_osinst.c @@ -17,18 +17,18 @@ /* ** This module contains code for a wrapper VFS that causes a log of -** most VFS calls to be written into a nominated file on disk. The log -** is stored in a compressed binary format to reduce the amount of IO +** most VFS calls to be written into a nominated file on disk. The log +** is stored in a compressed binary format to reduce the amount of IO ** overhead introduced into the application by logging. ** ** All calls on sqlite3_file objects except xFileControl() are logged. ** Additionally, calls to the xAccess(), xOpen(), and xDelete() ** methods are logged. The other sqlite3_vfs object methods (xDlXXX, -** xRandomness, xSleep, xCurrentTime, xGetLastError and xCurrentTimeInt64) +** xRandomness, xSleep, xCurrentTime, xGetLastError and xCurrentTimeInt64) ** are not logged. ** ** The binary log files are read using a virtual table implementation -** also contained in this file. +** also contained in this file. ** ** CREATING LOG FILES: ** @@ -97,7 +97,7 @@ #define OS_LOCK 11 #define OS_OPEN 12 #define OS_RANDOMNESS 13 -#define OS_READ 14 +#define OS_READ 14 #define OS_SECTORSIZE 15 #define OS_SLEEP 16 #define OS_SYNC 17 @@ -231,7 +231,7 @@ static sqlite3_uint64 vfslog_time(){ static sqlite3_uint64 vfslog_time(){ FILETIME ft; sqlite3_uint64 u64time = 0; - + GetSystemTimeAsFileTime(&ft); u64time |= ft.dwHighDateTime; @@ -271,9 +271,9 @@ static int vfslogClose(sqlite3_file *pFile){ ** Read data from an vfslog-file. */ static int vfslogRead( - sqlite3_file *pFile, - void *zBuf, - int iAmt, + sqlite3_file *pFile, + void *zBuf, + int iAmt, sqlite_int64 iOfst ){ int rc; @@ -440,10 +440,10 @@ static int vfslogShmLock(sqlite3_file *pFile, int ofst, int n, int flags){ return rc; } static int vfslogShmMap( - sqlite3_file *pFile, - int iRegion, - int szRegion, - int isWrite, + sqlite3_file *pFile, + int iRegion, + int szRegion, + int isWrite, volatile void **pp ){ int rc; @@ -525,9 +525,9 @@ static int vfslogDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ ** is available, or false otherwise. */ static int vfslogAccess( - sqlite3_vfs *pVfs, - const char *zPath, - int flags, + sqlite3_vfs *pVfs, + const char *zPath, + int flags, int *pResOut ){ int rc; @@ -546,9 +546,9 @@ static int vfslogAccess( ** of at least (INST_MAX_PATHNAME+1) bytes. */ static int vfslogFullPathname( - sqlite3_vfs *pVfs, - const char *zPath, - int nOut, + sqlite3_vfs *pVfs, + const char *zPath, + int nOut, char *zOut ){ return REALVFS(pVfs)->xFullPathname(REALVFS(pVfs), zPath, nOut, zOut); @@ -563,7 +563,7 @@ static void *vfslogDlOpen(sqlite3_vfs *pVfs, const char *zPath){ /* ** Populate the buffer zErrMsg (size nByte bytes) with a human readable -** utf-8 string describing the most recent error encountered associated +** utf-8 string describing the most recent error encountered associated ** with dynamic libraries. */ static void vfslogDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){ @@ -585,7 +585,7 @@ static void vfslogDlClose(sqlite3_vfs *pVfs, void *pHandle){ } /* -** Populate the buffer pointed to by zBufOut with nByte bytes of +** Populate the buffer pointed to by zBufOut with nByte bytes of ** random data. */ static int vfslogRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ @@ -593,7 +593,7 @@ static int vfslogRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ } /* -** Sleep for nMicro microseconds. Return the number of microseconds +** Sleep for nMicro microseconds. Return the number of microseconds ** actually slept. */ static int vfslogSleep(sqlite3_vfs *pVfs, int nMicro){ @@ -701,7 +701,7 @@ int sqlite3_vfslog_finalize(const char *zVfs){ pVfs = sqlite3_vfs_find(zVfs); if( !pVfs || pVfs->xOpen!=vfslogOpen ){ return SQLITE_ERROR; - } + } sqlite3_vfs_unregister(pVfs); vfslog_finalize((VfslogVfs *)pVfs); return SQLITE_OK; @@ -760,7 +760,7 @@ int sqlite3_vfslog_annotate(const char *zVfs, const char *zMsg){ pVfs = sqlite3_vfs_find(zVfs); if( !pVfs || pVfs->xOpen!=vfslogOpen ){ return SQLITE_ERROR; - } + } vfslog_call(pVfs, OS_ANNOTATE, 0, 0, 0, 0, 0); vfslog_string(pVfs, zMsg); return SQLITE_OK; @@ -842,7 +842,7 @@ static void dequote(char *z){ if( quote=='[' || quote=='\'' || quote=='"' || quote=='`' ){ int iIn = 1; /* Index of next byte to read from input */ int iOut = 0; /* Index of next byte to write to output */ - if( quote=='[' ) quote = ']'; + if( quote=='[' ) quote = ']'; while( z[iIn] ){ if( z[iIn]==quote ){ if( z[iIn+1]!=quote ) break; @@ -898,7 +898,7 @@ static int vlogConnect( if( rc==SQLITE_OK ){ p->pFd->pMethods->xFileSize(p->pFd, &p->nByte); - sqlite3_declare_vtab(db, + sqlite3_declare_vtab(db, "CREATE TABLE xxx(event, file, click, rc, size, offset)" ); *ppVtab = &p->base; @@ -978,7 +978,7 @@ static int vlogNext(sqlite3_vtab_cursor *pCursor){ eEvent = get32bits(pCsr->aBuf); if( (rc==SQLITE_OK) - && (eEvent==OS_OPEN || eEvent==OS_DELETE || eEvent==OS_ACCESS) + && (eEvent==OS_OPEN || eEvent==OS_DELETE || eEvent==OS_ACCESS) ){ char buf[4]; rc = p->pFd->pMethods->xRead(p->pFd, buf, 4, pCsr->iOffset+nRead); @@ -1020,7 +1020,7 @@ static int vlogEof(sqlite3_vtab_cursor *pCursor){ } static int vlogFilter( - sqlite3_vtab_cursor *pCursor, + sqlite3_vtab_cursor *pCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -1031,8 +1031,8 @@ static int vlogFilter( } static int vlogColumn( - sqlite3_vtab_cursor *pCursor, - sqlite3_context *ctx, + sqlite3_vtab_cursor *pCursor, + sqlite3_context *ctx, int i ){ unsigned int val; diff --git a/third_party/sqlite/src/src/test_pcache.c b/third_party/sqlite/src/src/test_pcache.c index 8fcfe7e26e3ff..568a2ec5245b1 100644 --- a/third_party/sqlite/src/src/test_pcache.c +++ b/third_party/sqlite/src/src/test_pcache.c @@ -9,17 +9,17 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** +** ** This file contains code used for testing the SQLite system. ** None of the code in this file goes into a deliverable build. -** +** ** This file contains an application-defined pager cache ** implementation that can be plugged in in place of the ** default pcache. This alternative pager cache will throw ** some errors that the default cache does not. ** ** This pagecache implementation is designed for simplicity -** not speed. +** not speed. */ #include "sqlite3.h" #include @@ -131,8 +131,8 @@ static unsigned testpcacheRandom(testpcache *p){ ** Allocate a new page cache instance. */ static sqlite3_pcache *testpcacheCreate( - int szPage, - int szExtra, + int szPage, + int szExtra, int bPurgeable ){ int nMem; @@ -225,7 +225,7 @@ static sqlite3_pcache_page *testpcacheFetch( return 0; } - /* Do not allocate if highStress is enabled and createFlag is not 2. + /* Do not allocate if highStress is enabled and createFlag is not 2. ** ** The highStress setting causes pagerStress() to be called much more ** often, which exercises the pager logic more intensely. diff --git a/third_party/sqlite/src/src/test_quota.h b/third_party/sqlite/src/src/test_quota.h index c17e15adca192..c6ef8a25d561d 100644 --- a/third_party/sqlite/src/src/test_quota.h +++ b/third_party/sqlite/src/src/test_quota.h @@ -40,7 +40,7 @@ extern "C" { /* ** Initialize the quota VFS shim. Use the VFS named zOrigVfsName ** as the VFS that does the actual work. Use the default if -** zOrigVfsName==NULL. +** zOrigVfsName==NULL. ** ** The quota VFS shim is named "quota". It will become the default ** VFS if makeDefault is non-zero. @@ -196,7 +196,7 @@ int sqlite3_quota_ferror(quota_FILE*); ** 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 +** Any attempt to "truncate" a file to a larger size results in ** undefined behavior. */ int sqlite3_quota_ftruncate(quota_FILE*, sqlite3_int64 newSize); @@ -252,7 +252,7 @@ long sqlite3_quota_file_available(quota_FILE*); ** A standard SQLite result code is returned (SQLITE_OK, SQLITE_NOMEM, etc.) ** When deleting a directory of files, if the deletion of any one ** file fails (for example due to an I/O error), then this routine -** returns immediately, with the error code, and does not try to +** returns immediately, with the error code, and does not try to ** delete any of the other files in the specified directory. ** ** All files are removed from quota management and deleted from disk. diff --git a/third_party/sqlite/src/src/test_rtree.c b/third_party/sqlite/src/src/test_rtree.c index 0c6dbf3cd736e..971dae7e3d83c 100644 --- a/third_party/sqlite/src/src/test_rtree.c +++ b/third_party/sqlite/src/src/test_rtree.c @@ -10,7 +10,7 @@ ** ************************************************************************* ** Code for testing all sorts of SQLite interfaces. This code -** is not included in the SQLite library. +** is not included in the SQLite library. */ #include "sqlite3.h" @@ -24,7 +24,7 @@ #include "sqliteInt.h" #ifdef SQLITE_ENABLE_RTREE -/* +/* ** Type used to cache parameter information for the "circle" r-tree geometry ** callback. */ @@ -55,7 +55,7 @@ static void circle_del(void *p){ */ static int circle_geom( sqlite3_rtree_geometry *p, - int nCoord, + int nCoord, sqlite3_rtree_dbl *aCoord, int *pRes ){ @@ -78,7 +78,7 @@ static int circle_geom( if( nCoord!=4 ) return SQLITE_ERROR; /* Test that the correct number of parameters (3) have been supplied, - ** and that the parameters are in range (that the radius of the circle + ** and that the parameters are in range (that the radius of the circle ** radius is greater than zero). */ if( p->nParam!=3 || p->aParam[2]<0.0 ) return SQLITE_ERROR; @@ -118,7 +118,7 @@ static int circle_geom( pCircle->mxArea = (xmax - xmin)*(ymax - ymin) + 1.0; } - /* Check if any of the 4 corners of the bounding-box being tested lie + /* Check if any of the 4 corners of the bounding-box being tested lie ** inside the circular region. If they do, then the bounding-box does ** intersect the region of interest. Set the output variable to true and ** return SQLITE_OK in this case. */ @@ -126,7 +126,7 @@ static int circle_geom( double x = (i&0x01) ? xmax : xmin; double y = (i&0x02) ? ymax : ymin; double d2; - + d2 = (x-pCircle->centerx)*(x-pCircle->centerx); d2 += (y-pCircle->centery)*(y-pCircle->centery); if( d2<(pCircle->radius*pCircle->radius) ){ @@ -140,10 +140,10 @@ static int circle_geom( ** cover part of the circular region, set the output variable to true ** and return SQLITE_OK. */ for(i=0; i<2; i++){ - if( xmin<=pCircle->aBox[i].xmin - && xmax>=pCircle->aBox[i].xmax - && ymin<=pCircle->aBox[i].ymin - && ymax>=pCircle->aBox[i].ymax + if( xmin<=pCircle->aBox[i].xmin + && xmax>=pCircle->aBox[i].xmax + && ymin<=pCircle->aBox[i].ymin + && ymax>=pCircle->aBox[i].ymax ){ *pRes = 1; return SQLITE_OK; @@ -157,7 +157,7 @@ static int circle_geom( } /* -** Implementation of "circle" r-tree geometry callback using the +** Implementation of "circle" r-tree geometry callback using the ** 2nd-generation interface that allows scoring. ** ** Two calling forms: @@ -254,7 +254,7 @@ static int circle_query_func(sqlite3_rtree_query_info *p){ pCircle->mxArea = 200.0*200.0; } - /* Check if any of the 4 corners of the bounding-box being tested lie + /* Check if any of the 4 corners of the bounding-box being tested lie ** inside the circular region. If they do, then the bounding-box does ** intersect the region of interest. Set the output variable to true and ** return SQLITE_OK in this case. */ @@ -262,7 +262,7 @@ static int circle_query_func(sqlite3_rtree_query_info *p){ double x = (i&0x01) ? xmax : xmin; double y = (i&0x02) ? ymax : ymin; double d2; - + d2 = (x-pCircle->centerx)*(x-pCircle->centerx); d2 += (y-pCircle->centery)*(y-pCircle->centery); if( d2<(pCircle->radius*pCircle->radius) ) nWithin++; @@ -274,10 +274,10 @@ static int circle_query_func(sqlite3_rtree_query_info *p){ ** and return SQLITE_OK. */ if( nWithin==0 ){ for(i=0; i<2; i++){ - if( xmin<=pCircle->aBox[i].xmin - && xmax>=pCircle->aBox[i].xmax - && ymin<=pCircle->aBox[i].ymin - && ymax>=pCircle->aBox[i].ymax + if( xmin<=pCircle->aBox[i].xmin + && xmax>=pCircle->aBox[i].xmax + && ymin<=pCircle->aBox[i].ymin + && ymax>=pCircle->aBox[i].ymax ){ nWithin = 1; break; @@ -319,7 +319,7 @@ static int circle_query_func(sqlite3_rtree_query_info *p){ return SQLITE_OK; } /* -** Implementation of "breadthfirstsearch" r-tree geometry callback using the +** Implementation of "breadthfirstsearch" r-tree geometry callback using the ** 2nd-generation interface that allows scoring. ** ** ... WHERE id MATCH breadthfirstsearch($x0,$x1,$y0,$y1) ... diff --git a/third_party/sqlite/src/src/test_schema.c b/third_party/sqlite/src/src/test_schema.c index cdf085797f09e..c1986aadd15ac 100644 --- a/third_party/sqlite/src/src/test_schema.c +++ b/third_party/sqlite/src/src/test_schema.c @@ -191,7 +191,7 @@ static int schemaNext(sqlite3_vtab_cursor *cur){ goto next_exit; } - /* Set zSql to the SQL to pull the list of tables from the + /* Set zSql to the SQL to pull the list of tables from the ** sqlite_master (or sqlite_temp_master) table of the database ** identified by the row pointed to by the SQL statement pCur->pDbList ** (iterating through a "PRAGMA database_list;" statement). @@ -221,7 +221,7 @@ static int schemaNext(sqlite3_vtab_cursor *cur){ ** identified by the rows pointed to by statements pCur->pDbList and ** pCur->pTableList. */ - zSql = sqlite3_mprintf("PRAGMA %Q.table_info(%Q)", + zSql = sqlite3_mprintf("PRAGMA %Q.table_info(%Q)", sqlite3_column_text(pCur->pDbList, 1), sqlite3_column_text(pCur->pTableList, 0) ); @@ -245,7 +245,7 @@ next_exit: ** Reset a schema table cursor. */ static int schemaFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -337,7 +337,7 @@ int Sqlitetestschema_Init(Tcl_Interp *interp){ }; int i; for(i=0; i-sqllog" exists in the same directly as the main database -** file when it is first opened ("" is replaced by the actual +** file when it is first opened ("" is replaced by the actual ** name of the main database file). ** ** OUTPUT: @@ -68,7 +68,7 @@ ** ERROR HANDLING: ** ** This module attempts to make a best effort to continue logging if an -** IO or other error is encountered. For example, if a log file cannot +** IO or other error is encountered. For example, if a log file cannot ** be opened logs are not collected for that connection, but other ** logging proceeds as expected. Errors are logged by calling sqlite3_log(). */ @@ -144,8 +144,8 @@ static int sqllog_isspace(char c){ /* ** The first argument points to a nul-terminated string containing an SQL ** command. Before returning, this function sets *pz to point to the start -** of the first token in this command, and *pn to the number of bytes in -** the token. This is used to check if the SQL command is an "ATTACH" or +** of the first token in this command, and *pn to the number of bytes in +** the token. This is used to check if the SQL command is an "ATTACH" or ** not. */ static void sqllogTokenize(const char *z, const char **pz, int *pn){ @@ -165,11 +165,11 @@ static void sqllogTokenize(const char *z, const char **pz, int *pn){ } /* -** Check if the logs directory already contains a copy of database file +** Check if the logs directory already contains a copy of database file ** zFile. If so, return a pointer to the full path of the copy. Otherwise, ** return NULL. ** -** If a non-NULL value is returned, then the caller must arrange to +** If a non-NULL value is returned, then the caller must arrange to ** eventually free it using sqlite3_free(). */ static char *sqllogFindFile(const char *zFile){ @@ -232,7 +232,7 @@ static int sqllogFindAttached( int rc; /* The "PRAGMA database_list" command returns a list of databases in the - ** order that they were attached. So a newly attached database is + ** order that they were attached. So a newly attached database is ** described by the last row returned. */ assert( sqllogglobal.bRec==0 ); sqllogglobal.bRec = 1; @@ -252,7 +252,7 @@ static int sqllogFindAttached( nVal2 = sqlite3_column_bytes(pStmt, 2); memcpy(zFile, zVal2, nVal2+1); - if( zSearch && strlen(zSearch)==nVal1 + if( zSearch && strlen(zSearch)==nVal1 && 0==sqlite3_strnicmp(zSearch, zVal1, nVal1) ){ break; @@ -270,7 +270,7 @@ static int sqllogFindAttached( /* -** Parameter zSearch is the name of a database attached to the database +** Parameter zSearch is the name of a database attached to the database ** connection associated with the first argument. This function creates ** a backup of this database in the logs directory. ** @@ -347,7 +347,7 @@ static void sqllogCopydb(struct SLConn *p, const char *zSearch, int bLog){ } if( bLog ){ - zFree = sqlite3_mprintf("ATTACH '%q' AS '%q'; -- clock=%d\n", + zFree = sqlite3_mprintf("ATTACH '%q' AS '%q'; -- clock=%d\n", zInit, zName, sqllogglobal.iClock++ ); }else{ @@ -360,7 +360,7 @@ static void sqllogCopydb(struct SLConn *p, const char *zSearch, int bLog){ } /* -** If it is not already open, open the log file for connection *p. +** If it is not already open, open the log file for connection *p. ** ** The SLGlobal.mutex mutex is always held when this function is called. */ @@ -369,7 +369,7 @@ static void sqllogOpenlog(struct SLConn *p){ if( p->fd==0 ){ char *zLog; - /* If it is still NULL, have global.zPrefix point to a copy of + /* If it is still NULL, have global.zPrefix point to a copy of ** environment variable $ENVIRONMENT_VARIABLE1_NAME. */ if( sqllogglobal.zPrefix[0]==0 ){ FILE *fd; @@ -417,7 +417,7 @@ static void testSqllogStmt(struct SLConn *p, const char *zSql){ /* ** The database handle passed as the only argument has just been opened. -** Return true if this module should log initial databases and SQL +** Return true if this module should log initial databases and SQL ** statements for this connection, or false otherwise. ** ** If an error occurs, sqlite3_log() is invoked to report it to the user @@ -431,7 +431,7 @@ static int sqllogTraceDb(sqlite3 *db){ if( rc==SQLITE_OK ){ int nFile = strlen(zFile); if( (SQLLOG_NAMESZ-nFile)<8 ){ - sqlite3_log(SQLITE_IOERR, + sqlite3_log(SQLITE_IOERR, "sqllogTraceDb(): database name too long (%d bytes)", nFile ); bRet = 0; @@ -462,7 +462,7 @@ static int sqllogTraceDb(sqlite3 *db){ ** ** The pCtx parameter is a copy of the pointer that was originally passed ** into the sqlite3_config(SQLITE_CONFIG_SQLLOG) statement. In this -** particular implementation, pCtx is always a pointer to the +** particular implementation, pCtx is always a pointer to the ** sqllogglobal global variable define above. */ static void testSqllog(void *pCtx, sqlite3 *db, const char *zSql, int eType){ @@ -539,7 +539,7 @@ static void testSqllog(void *pCtx, sqlite3 *db, const char *zSql, int eType){ /* ** This function is called either before sqlite3_initialized() or by it. -** It checks if the SQLITE_SQLLOG_DIR variable is defined, and if so +** It checks if the SQLITE_SQLLOG_DIR variable is defined, and if so ** registers an SQLITE_CONFIG_SQLLOG callback to record the applications ** database activity. */ diff --git a/third_party/sqlite/src/src/test_superlock.c b/third_party/sqlite/src/src/test_superlock.c index 45d0d623a03b4..3e6d3e81dd069 100644 --- a/third_party/sqlite/src/src/test_superlock.c +++ b/third_party/sqlite/src/src/test_superlock.c @@ -11,7 +11,7 @@ ************************************************************************* ** Example code for obtaining an exclusive lock on an SQLite database ** file. This method is complicated, but works for both WAL and rollback -** mode database files. The interface to the example code in this file +** mode database files. The interface to the example code in this file ** consists of the following two functions: ** ** sqlite3demo_superlock() @@ -56,7 +56,7 @@ static int superlockBusyHandler(void *pCtx, int UNUSED){ } /* -** This function is used to determine if the main database file for +** This function is used to determine if the main database file for ** connection db is open in WAL mode or not. If no error occurs and the ** database file is in WAL mode, set *pbWal to true and return SQLITE_OK. ** If it is not in WAL mode, set *pbWal to false. @@ -119,7 +119,7 @@ static int superlockWalLock( if( rc!=SQLITE_OK ) return rc; /* Obtain the "recovery" lock. Normally, this lock is only obtained by - ** clients running database recovery. + ** clients running database recovery. */ rc = superlockShmLock(fd, 2, 1, pBusy); if( rc!=SQLITE_OK ) return rc; @@ -136,7 +136,7 @@ static int superlockWalLock( memset((void *)p, 0, 32); /* Obtain exclusive locks on all the "read-lock" slots. Once these locks - ** are held, it is guaranteed that there are no active reader, writer or + ** are held, it is guaranteed that there are no active reader, writer or ** checkpointer clients. */ rc = superlockShmLock(fd, 3, SQLITE_SHM_NLOCK-3, pBusy); @@ -144,7 +144,7 @@ static int superlockWalLock( } /* -** Release a superlock held on a database file. The argument passed to +** Release a superlock held on a database file. The argument passed to ** this function must have been obtained from a successful call to ** sqlite3demo_superlock(). */ @@ -170,7 +170,7 @@ void sqlite3demo_superunlock(void *pLock){ ** returned and output variable *ppLock is populated with an opaque handle ** that may be used with sqlite3demo_superunlock() to release the lock. ** -** If an error occurs, *ppLock is set to 0 and an SQLite error code +** If an error occurs, *ppLock is set to 0 and an SQLite error code ** (e.g. SQLITE_BUSY) is returned. ** ** If a required lock cannot be obtained immediately and the xBusy parameter @@ -200,7 +200,7 @@ int sqlite3demo_superlock( ); /* Install a busy-handler and execute a BEGIN EXCLUSIVE. If this is not - ** a WAL database, this is all we need to do. + ** a WAL database, this is all we need to do. ** ** A wrapper function is used to invoke the busy-handler instead of ** registering the busy-handler function supplied by the user directly diff --git a/third_party/sqlite/src/src/test_syscall.c b/third_party/sqlite/src/src/test_syscall.c index 947f9a9d9d09e..20a55d96beb7b 100644 --- a/third_party/sqlite/src/src/test_syscall.c +++ b/third_party/sqlite/src/src/test_syscall.c @@ -12,7 +12,7 @@ ** ** The code in this file implements a Tcl interface used to test error ** handling in the os_unix.c module. Wrapper functions that support fault -** injection are registered as the low-level OS functions using the +** injection are registered as the low-level OS functions using the ** xSetSystemCall() method of the VFS. The Tcl interface is as follows: ** ** @@ -21,7 +21,7 @@ ** LIST must be a list consisting of zero or more of the following ** literal values: ** -** open close access getcwd stat fstat +** open close access getcwd stat fstat ** ftruncate fcntl read pread pread64 write ** pwrite pwrite64 fchmod fallocate mmap ** @@ -33,8 +33,8 @@ ** injection is disabled. Otherwise, fault injection is configured to ** cause a failure on the COUNT'th next call to a system call with a ** wrapper function installed. A COUNT value of 1 means fail the next -** system call. -** +** system call. +** ** Argument PERSIST is interpreted as a boolean. If true, the all ** system calls following the initial failure also fail. Otherwise, only ** the single transient failure is injected. @@ -44,7 +44,7 @@ ** in call CALL. Argument CALL must be one of the system call names ** listed above (under [test_syscall install]). ERRNO is a symbolic ** name (i.e. "EACCES"). Not all errno codes are supported. Add extra -** to the aErrno table in function test_syscall_errno() below as +** to the aErrno table in function test_syscall_errno() below as ** required. ** ** test_syscall reset ?SYSTEM-CALL? @@ -113,7 +113,7 @@ static int ts_fcntl(int fd, int cmd, ... ); static int ts_read(int fd, void *aBuf, size_t nBuf); static int ts_pread(int fd, void *aBuf, size_t nBuf, off_t off); /* Note: pread64() and pwrite64() actually use off64_t as the type on their -** last parameter. But that datatype is not defined on many systems +** last parameter. But that datatype is not defined on many systems ** (ex: Mac, OpenBSD). So substitute a likely equivalent: sqlite3_uint64 */ static int ts_pread64(int fd, void *aBuf, size_t nBuf, sqlite3_uint64 off); static int ts_write(int fd, const void *aBuf, size_t nBuf); @@ -192,7 +192,7 @@ static int tsIsFail(void){ ** the name of a system call in the aSyscall[] table. ** ** Usually, the current error-number is the value that errno should be set -** to if the named system call fails. The exception is "fallocate". See +** to if the named system call fails. The exception is "fallocate". See ** comments above the implementation of ts_fallocate() for details. */ static int tsErrno(const char *zFunc){ @@ -211,7 +211,7 @@ static int tsErrno(const char *zFunc){ /* ** A wrapper around tsIsFail(). If tsIsFail() returns non-zero, set the ** value of errno before returning. -*/ +*/ static int tsIsFailErrno(const char *zFunc){ if( tsIsFail() ){ errno = tsErrno(zFunc); @@ -235,7 +235,7 @@ static int ts_open(const char *zFile, int flags, int mode){ */ static int ts_close(int fd){ if( tsIsFail() ){ - /* Even if simulating an error, close the original file-descriptor. + /* Even if simulating an error, close the original file-descriptor. ** This is to stop the test process from running out of file-descriptors ** when running a long test. If a call to close() appears to fail, SQLite ** never attempts to use the file-descriptor afterwards (or even to close @@ -398,11 +398,11 @@ static int ts_fallocate(int fd, off_t off, off_t len){ } static void *ts_mmap( - void *pAddr, - size_t nByte, - int prot, - int flags, - int fd, + void *pAddr, + size_t nByte, + int prot, + int flags, + int fd, off_t iOff ){ if( tsIsFailErrno("mmap") ){ @@ -428,7 +428,7 @@ static int SQLITE_TCLAPI test_syscall_install( int objc, Tcl_Obj *CONST objv[] ){ - sqlite3_vfs *pVfs; + sqlite3_vfs *pVfs; int nElem; int i; Tcl_Obj **apElem; @@ -444,7 +444,7 @@ static int SQLITE_TCLAPI test_syscall_install( for(i=0; ixNextSystemCall(pVfs, 0); + for(zSys = pVfs->xNextSystemCall(pVfs, 0); zSys!=0; zSys = pVfs->xNextSystemCall(pVfs, zSys) ){ @@ -652,7 +652,7 @@ static int SQLITE_TCLAPI test_syscall_defaultvfs( int objc, Tcl_Obj *CONST objv[] ){ - sqlite3_vfs *pVfs; + sqlite3_vfs *pVfs; if( objc!=2 ){ Tcl_WrongNumArgs(interp, 2, objv, ""); @@ -736,7 +736,7 @@ static int SQLITE_TCLAPI test_syscall( Tcl_AppendResult(interp, "VFS does not support xSetSystemCall", 0); rc = TCL_ERROR; }else{ - rc = Tcl_GetIndexFromObjStruct(interp, + rc = Tcl_GetIndexFromObjStruct(interp, objv[1], aCmd, sizeof(aCmd[0]), "sub-command", 0, &iCmd ); } diff --git a/third_party/sqlite/src/src/test_tclvar.c b/third_party/sqlite/src/src/test_tclvar.c index 8f7352112dd82..bef8ca94d6a7e 100644 --- a/third_party/sqlite/src/src/test_tclvar.c +++ b/third_party/sqlite/src/src/test_tclvar.c @@ -39,8 +39,8 @@ typedef struct tclvar_vtab tclvar_vtab; typedef struct tclvar_cursor tclvar_cursor; -/* -** A tclvar virtual-table object +/* +** A tclvar virtual-table object */ struct tclvar_vtab { sqlite3_vtab base; @@ -66,7 +66,7 @@ static int tclvarConnect( char **pzErr ){ tclvar_vtab *pVtab; - static const char zSchema[] = + static const char zSchema[] = "CREATE TABLE whatever(name TEXT, arrayname TEXT, value TEXT)"; pVtab = sqlite3MallocZero( sizeof(*pVtab) ); if( pVtab==0 ) return SQLITE_NOMEM; @@ -162,7 +162,7 @@ static int tclvarNext(sqlite3_vtab_cursor *cur){ } static int tclvarFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ @@ -226,7 +226,7 @@ static int tclvarFilter( static int tclvarColumn(sqlite3_vtab_cursor *cur, sqlite3_context *ctx, int i){ Tcl_Obj *p1; Tcl_Obj *p2; - const char *z1; + const char *z1; const char *z2 = ""; tclvar_cursor *pCur = (tclvar_cursor*)cur; Tcl_Interp *interp = ((tclvar_vtab *)cur->pVtab)->interp; @@ -266,7 +266,7 @@ static int tclvarEof(sqlite3_vtab_cursor *cur){ } /* -** If nul-terminated string zStr does not already contain the character +** If nul-terminated string zStr does not already contain the character ** passed as the second argument, append it and return 0. Or, if there is ** already an instance of x in zStr, do nothing return 1; ** @@ -312,7 +312,7 @@ static int tclvarSetOmit(Tcl_Interp *interp){ ** value LIKE ? (omit flag set iff $::tclvar_set_omit) ** ** For each constraint present, the corresponding TCLVAR_XXX character is -** appended to the idxStr value. +** appended to the idxStr value. */ static int tclvarBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ tclvar_vtab *pTab = (tclvar_vtab*)tab; @@ -326,7 +326,7 @@ static int tclvarBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ for(ii=0; iinConstraint; ii++){ struct sqlite3_index_constraint const *pCons = &pIdxInfo->aConstraint[ii]; struct sqlite3_index_constraint_usage *pUsage; - + pUsage = &pIdxInfo->aConstraintUsage[ii]; if( pCons->usable ){ /* name = ? */ @@ -385,7 +385,7 @@ static sqlite3_module tclvarModule = { tclvarConnect, tclvarConnect, tclvarBestIndex, - tclvarDisconnect, + tclvarDisconnect, tclvarDisconnect, tclvarOpen, /* xOpen - open a cursor */ tclvarClose, /* xClose - close a cursor */ @@ -426,7 +426,7 @@ static int SQLITE_TCLAPI register_tclvar_module( if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; #ifndef SQLITE_OMIT_VIRTUALTABLE sqlite3_create_module(db, "tclvar", &tclvarModule, (void*)interp); - rc = Tcl_Eval(interp, + rc = Tcl_Eval(interp, "proc like {pattern str} {\n" " set p [string map {% * _ ?} $pattern]\n" " string match $p $str\n" @@ -468,7 +468,7 @@ int Sqlitetesttclvar_Init(Tcl_Interp *interp){ }; int i; for(i=0; ibase.nextPtr = 0; pEvent->base.proc = tclScriptEvent; @@ -124,9 +124,9 @@ static Tcl_ThreadCreateType tclScriptThread(ClientData pSqlThread){ Tcl_CreateObjCommand(interp, "sqlthread", sqlthread_proc, pSqlThread, 0); #if SQLITE_OS_UNIX && defined(SQLITE_ENABLE_UNLOCK_NOTIFY) Tcl_CreateObjCommand(interp, "sqlite3_blocking_step", blocking_step_proc,0,0); - Tcl_CreateObjCommand(interp, + Tcl_CreateObjCommand(interp, "sqlite3_blocking_prepare_v2", blocking_prepare_v2_proc, (void *)1, 0); - Tcl_CreateObjCommand(interp, + Tcl_CreateObjCommand(interp, "sqlite3_nonblocking_prepare_v2", blocking_prepare_v2_proc, 0, 0); #endif Sqlitetest1_Init(interp); @@ -305,7 +305,7 @@ static int SQLITE_TCLAPI sqlthread_open( #endif Md5_Register(db, 0, 0); sqlite3_busy_handler(db, xBusy, 0); - + if( sqlite3TestMakePointerStr(interp, zBuf, db) ) return TCL_ERROR; Tcl_AppendResult(interp, zBuf, 0); @@ -384,7 +384,7 @@ static int SQLITE_TCLAPI sqlthread_proc( ** when linked against both Tcl 8.4 and 8.5. Because [clock seconds] is ** implemented as a script in Tcl 8.5, it is not usually available to ** testfixture. -*/ +*/ static int SQLITE_TCLAPI clock_seconds_proc( ClientData clientData, Tcl_Interp *interp, @@ -410,9 +410,9 @@ static int SQLITE_TCLAPI clock_seconds_proc( ** blocking_step_notify() and the structure UnlockNotification is ** automatically extracted from this file and used as part of the ** documentation for the sqlite3_unlock_notify() API function. This -** should be considered if these functions are to be extended (i.e. to +** should be considered if these functions are to be extended (i.e. to ** support windows) in the future. -*/ +*/ #if SQLITE_OS_UNIX && defined(SQLITE_ENABLE_UNLOCK_NOTIFY) /* BEGIN_SQLITE_BLOCKING_STEP */ @@ -445,17 +445,17 @@ static void unlock_notify_cb(void **apArg, int nArg){ } /* -** This function assumes that an SQLite API call (either sqlite3_prepare_v2() +** This function assumes that an SQLite API call (either sqlite3_prepare_v2() ** or sqlite3_step()) has just returned SQLITE_LOCKED. The argument is the ** associated database connection. ** -** This function calls sqlite3_unlock_notify() to register for an -** unlock-notify callback, then blocks until that callback is delivered +** This function calls sqlite3_unlock_notify() to register for an +** unlock-notify callback, then blocks until that callback is delivered ** and returns SQLITE_OK. The caller should then retry the failed operation. ** -** Or, if sqlite3_unlock_notify() indicates that to block would deadlock -** the system, then this function returns SQLITE_LOCKED immediately. In -** this case the caller should not retry the operation and should roll +** Or, if sqlite3_unlock_notify() indicates that to block would deadlock +** the system, then this function returns SQLITE_LOCKED immediately. In +** this case the caller should not retry the operation and should roll ** back the current transaction (if any). */ static int wait_for_unlock_notify(sqlite3 *db){ @@ -471,11 +471,11 @@ static int wait_for_unlock_notify(sqlite3 *db){ rc = sqlite3_unlock_notify(db, unlock_notify_cb, (void *)&un); assert( rc==SQLITE_LOCKED || rc==SQLITE_OK ); - /* The call to sqlite3_unlock_notify() always returns either SQLITE_LOCKED - ** or SQLITE_OK. + /* The call to sqlite3_unlock_notify() always returns either SQLITE_LOCKED + ** or SQLITE_OK. ** ** If SQLITE_LOCKED was returned, then the system is deadlocked. In this - ** case this function needs to return SQLITE_LOCKED to the caller so + ** case this function needs to return SQLITE_LOCKED to the caller so ** that the current transaction can be rolled back. Otherwise, block ** until the unlock-notify callback is invoked, then return SQLITE_OK. */ @@ -589,7 +589,7 @@ static int SQLITE_TCLAPI blocking_prepare_v2_proc( int isBlocking = !(clientData==0); if( objc!=5 && objc!=4 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", + Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " DB sql bytes tailvar", 0); return TCL_ERROR; } @@ -637,9 +637,9 @@ int SqlitetestThread_Init(Tcl_Interp *interp){ Tcl_CreateObjCommand(interp, "clock_seconds", clock_seconds_proc, 0, 0); #if SQLITE_OS_UNIX && defined(SQLITE_ENABLE_UNLOCK_NOTIFY) Tcl_CreateObjCommand(interp, "sqlite3_blocking_step", blocking_step_proc,0,0); - Tcl_CreateObjCommand(interp, + Tcl_CreateObjCommand(interp, "sqlite3_blocking_prepare_v2", blocking_prepare_v2_proc, (void *)1, 0); - Tcl_CreateObjCommand(interp, + Tcl_CreateObjCommand(interp, "sqlite3_nonblocking_prepare_v2", blocking_prepare_v2_proc, 0, 0); #endif return TCL_OK; diff --git a/third_party/sqlite/src/src/test_vfs.c b/third_party/sqlite/src/src/test_vfs.c index fb987a6163a65..c17bc815c333b 100644 --- a/third_party/sqlite/src/src/test_vfs.c +++ b/third_party/sqlite/src/src/test_vfs.c @@ -109,7 +109,7 @@ struct Testvfs { /* ** The Testvfs.mask variable is set to a combination of the following. -** If a bit is clear in Testvfs.mask, then calls made by SQLite to the +** If a bit is clear in Testvfs.mask, then calls made by SQLite to the ** corresponding VFS method is ignored for purposes of: ** ** + Simulating IO errors, and @@ -274,7 +274,7 @@ static int tvfsInjectCantopenerr(Testvfs *p){ static void tvfsExecTcl( - Testvfs *p, + Testvfs *p, const char *zMethod, Tcl_Obj *arg1, Tcl_Obj *arg2, @@ -315,7 +315,7 @@ static int tvfsClose(sqlite3_file *pFile){ Testvfs *p = (Testvfs *)pFd->pVfs->pAppData; if( p->pScript && p->mask&TESTVFS_CLOSE_MASK ){ - tvfsExecTcl(p, "xClose", + tvfsExecTcl(p, "xClose", Tcl_NewStringObj(pFd->zFilename, -1), pFd->pShmId, 0, 0 ); } @@ -337,16 +337,16 @@ static int tvfsClose(sqlite3_file *pFile){ ** Read data from an tvfs-file. */ static int tvfsRead( - sqlite3_file *pFile, - void *zBuf, - int iAmt, + sqlite3_file *pFile, + void *zBuf, + int iAmt, sqlite_int64 iOfst ){ int rc = SQLITE_OK; TestvfsFd *pFd = tvfsGetFd(pFile); Testvfs *p = (Testvfs *)pFd->pVfs->pAppData; if( p->pScript && p->mask&TESTVFS_READ_MASK ){ - tvfsExecTcl(p, "xRead", + tvfsExecTcl(p, "xRead", Tcl_NewStringObj(pFd->zFilename, -1), pFd->pShmId, 0, 0 ); tvfsResultCode(p, &rc); @@ -364,9 +364,9 @@ static int tvfsRead( ** Write data to an tvfs-file. */ static int tvfsWrite( - sqlite3_file *pFile, - const void *zBuf, - int iAmt, + sqlite3_file *pFile, + const void *zBuf, + int iAmt, sqlite_int64 iOfst ){ int rc = SQLITE_OK; @@ -374,8 +374,8 @@ static int tvfsWrite( Testvfs *p = (Testvfs *)pFd->pVfs->pAppData; if( p->pScript && p->mask&TESTVFS_WRITE_MASK ){ - tvfsExecTcl(p, "xWrite", - Tcl_NewStringObj(pFd->zFilename, -1), pFd->pShmId, + tvfsExecTcl(p, "xWrite", + Tcl_NewStringObj(pFd->zFilename, -1), pFd->pShmId, Tcl_NewWideIntObj(iOfst), Tcl_NewIntObj(iAmt) ); tvfsResultCode(p, &rc); @@ -387,7 +387,7 @@ static int tvfsWrite( if( rc==SQLITE_OK && p->mask&TESTVFS_WRITE_MASK && tvfsInjectIoerr(p) ){ rc = SQLITE_IOERR; } - + if( rc==SQLITE_OK ){ rc = sqlite3OsWrite(pFd->pReal, zBuf, iAmt, iOfst); } @@ -403,12 +403,12 @@ static int tvfsTruncate(sqlite3_file *pFile, sqlite_int64 size){ Testvfs *p = (Testvfs *)pFd->pVfs->pAppData; if( p->pScript && p->mask&TESTVFS_TRUNCATE_MASK ){ - tvfsExecTcl(p, "xTruncate", + tvfsExecTcl(p, "xTruncate", Tcl_NewStringObj(pFd->zFilename, -1), pFd->pShmId, 0, 0 ); tvfsResultCode(p, &rc); } - + if( rc==SQLITE_OK ){ rc = sqlite3OsTruncate(pFd->pReal, size); } @@ -443,7 +443,7 @@ static int tvfsSync(sqlite3_file *pFile, int flags){ assert(0); } - tvfsExecTcl(p, "xSync", + tvfsExecTcl(p, "xSync", Tcl_NewStringObj(pFd->zFilename, -1), pFd->pShmId, Tcl_NewStringObj(zFlags, -1), 0 ); @@ -476,7 +476,7 @@ static int tvfsLock(sqlite3_file *pFile, int eLock){ if( p->pScript && p->mask&TESTVFS_LOCK_MASK ){ char zLock[30]; sqlite3_snprintf(sizeof(zLock),zLock,"%d",eLock); - tvfsExecTcl(p, "xLock", Tcl_NewStringObj(pFd->zFilename, -1), + tvfsExecTcl(p, "xLock", Tcl_NewStringObj(pFd->zFilename, -1), Tcl_NewStringObj(zLock, -1), 0, 0); } return sqlite3OsLock(pFd->pReal, eLock); @@ -491,7 +491,7 @@ static int tvfsUnlock(sqlite3_file *pFile, int eLock){ if( p->pScript && p->mask&TESTVFS_UNLOCK_MASK ){ char zLock[30]; sqlite3_snprintf(sizeof(zLock),zLock,"%d",eLock); - tvfsExecTcl(p, "xUnlock", Tcl_NewStringObj(pFd->zFilename, -1), + tvfsExecTcl(p, "xUnlock", Tcl_NewStringObj(pFd->zFilename, -1), Tcl_NewStringObj(zLock, -1), 0, 0); } if( p->mask&TESTVFS_WRITE_MASK && tvfsInjectIoerr(p) ){ @@ -592,7 +592,7 @@ static int tvfsOpen( memset(pTestfile, 0, sizeof(TestvfsFile)); pTestfile->pFd = pFd; - /* Evaluate the Tcl script: + /* Evaluate the Tcl script: ** ** SCRIPT xOpen FILENAME KEY-VALUE-ARGS ** @@ -673,7 +673,7 @@ static int tvfsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ Testvfs *p = (Testvfs *)pVfs->pAppData; if( p->pScript && p->mask&TESTVFS_DELETE_MASK ){ - tvfsExecTcl(p, "xDelete", + tvfsExecTcl(p, "xDelete", Tcl_NewStringObj(zPath, -1), Tcl_NewIntObj(dirSync), 0, 0 ); tvfsResultCode(p, &rc); @@ -689,9 +689,9 @@ static int tvfsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ ** is available, or false otherwise. */ static int tvfsAccess( - sqlite3_vfs *pVfs, - const char *zPath, - int flags, + sqlite3_vfs *pVfs, + const char *zPath, + int flags, int *pResOut ){ Testvfs *p = (Testvfs *)pVfs->pAppData; @@ -701,7 +701,7 @@ static int tvfsAccess( if( flags==SQLITE_ACCESS_EXISTS ) zArg = "SQLITE_ACCESS_EXISTS"; if( flags==SQLITE_ACCESS_READWRITE ) zArg = "SQLITE_ACCESS_READWRITE"; if( flags==SQLITE_ACCESS_READ ) zArg = "SQLITE_ACCESS_READ"; - tvfsExecTcl(p, "xAccess", + tvfsExecTcl(p, "xAccess", Tcl_NewStringObj(zPath, -1), Tcl_NewStringObj(zArg, -1), 0, 0 ); if( tvfsResultCode(p, &rc) ){ @@ -722,9 +722,9 @@ static int tvfsAccess( ** of at least (DEVSYM_MAX_PATHNAME+1) bytes. */ static int tvfsFullPathname( - sqlite3_vfs *pVfs, - const char *zPath, - int nOut, + sqlite3_vfs *pVfs, + const char *zPath, + int nOut, char *zOut ){ Testvfs *p = (Testvfs *)pVfs->pAppData; @@ -748,7 +748,7 @@ static void *tvfsDlOpen(sqlite3_vfs *pVfs, const char *zPath){ /* ** Populate the buffer zErrMsg (size nByte bytes) with a human readable -** utf-8 string describing the most recent error encountered associated +** utf-8 string describing the most recent error encountered associated ** with dynamic libraries. */ static void tvfsDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){ @@ -771,7 +771,7 @@ static void tvfsDlClose(sqlite3_vfs *pVfs, void *pHandle){ #endif /* SQLITE_OMIT_LOAD_EXTENSION */ /* -** Populate the buffer pointed to by zBufOut with nByte bytes of +** Populate the buffer pointed to by zBufOut with nByte bytes of ** random data. */ static int tvfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ @@ -779,7 +779,7 @@ static int tvfsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ } /* -** Sleep for nMicro microseconds. Return the number of microseconds +** Sleep for nMicro microseconds. Return the number of microseconds ** actually slept. */ static int tvfsSleep(sqlite3_vfs *pVfs, int nMicro){ @@ -804,7 +804,7 @@ static int tvfsShmOpen(sqlite3_file *pFile){ assert( 0==p->isFullshm ); assert( pFd->pShmId && pFd->pShm==0 && pFd->pNext==0 ); - /* Evaluate the Tcl script: + /* Evaluate the Tcl script: ** ** SCRIPT xShmOpen FILENAME */ @@ -880,7 +880,7 @@ static int tvfsShmMap( Tcl_ListObjAppendElement(p->interp, pArg, Tcl_NewIntObj(iPage)); Tcl_ListObjAppendElement(p->interp, pArg, Tcl_NewIntObj(pgsz)); Tcl_ListObjAppendElement(p->interp, pArg, Tcl_NewIntObj(isWrite)); - tvfsExecTcl(p, "xShmMap", + tvfsExecTcl(p, "xShmMap", Tcl_NewStringObj(pFd->pShm->zFile, -1), pFd->pShmId, pArg, 0 ); tvfsResultCode(p, &rc); @@ -929,7 +929,7 @@ static int tvfsShmLock( }else{ strcpy(&zLock[nLock], " exclusive"); } - tvfsExecTcl(p, "xShmLock", + tvfsExecTcl(p, "xShmLock", Tcl_NewStringObj(pFd->pShm->zFile, -1), pFd->pShmId, Tcl_NewStringObj(zLock, -1), 0 ); @@ -999,7 +999,7 @@ static int tvfsShmUnmap( assert( pFd->pShmId && pFd->pShm ); if( p->pScript && p->mask&TESTVFS_SHMCLOSE_MASK ){ - tvfsExecTcl(p, "xShmUnmap", + tvfsExecTcl(p, "xShmUnmap", Tcl_NewStringObj(pFd->pShm->zFile, -1), pFd->pShmId, 0, 0 ); tvfsResultCode(p, &rc); @@ -1026,9 +1026,9 @@ static int tvfsShmUnmap( } static int tvfsFetch( - sqlite3_file *pFile, - sqlite3_int64 iOfst, - int iAmt, + sqlite3_file *pFile, + sqlite3_int64 iOfst, + int iAmt, void **pp ){ TestvfsFd *pFd = tvfsGetFd(pFile); @@ -1048,8 +1048,8 @@ static int SQLITE_TCLAPI testvfs_obj_cmd( ){ Testvfs *p = (Testvfs *)cd; - enum DB_enum { - CMD_SHM, CMD_DELETE, CMD_FILTER, CMD_IOERR, CMD_SCRIPT, + enum DB_enum { + CMD_SHM, CMD_DELETE, CMD_FILTER, CMD_IOERR, CMD_SCRIPT, CMD_DEVCHAR, CMD_SECTORSIZE, CMD_FULLERR, CMD_CANTOPENERR }; struct TestvfsSubcmd { @@ -1068,13 +1068,13 @@ static int SQLITE_TCLAPI testvfs_obj_cmd( { 0, 0 } }; int i; - + if( objc<2 ){ Tcl_WrongNumArgs(interp, 1, objv, "SUBCOMMAND ..."); return TCL_ERROR; } if( Tcl_GetIndexFromObjStruct( - interp, objv[1], aSubcmd, sizeof(aSubcmd[0]), "subcommand", 0, &i) + interp, objv[1], aSubcmd, sizeof(aSubcmd[0]), "subcommand", 0, &i) ){ return TCL_ERROR; } @@ -1092,7 +1092,7 @@ static int SQLITE_TCLAPI testvfs_obj_cmd( } zName = ckalloc(p->pParent->mxPathname); rc = p->pParent->xFullPathname( - p->pParent, Tcl_GetString(objv[2]), + p->pParent, Tcl_GetString(objv[2]), p->pParent->mxPathname, zName ); if( rc!=SQLITE_OK ){ @@ -1304,8 +1304,8 @@ static int SQLITE_TCLAPI testvfs_obj_cmd( for(j=0; j2 && 0==strncmp("-noshm", zSwitch, nSwitch) ){ if( Tcl_GetBooleanFromObj(interp, objv[i+1], &isNoshm) ){ @@ -1503,7 +1503,7 @@ static int SQLITE_TCLAPI testvfs_cmd( /* Create the new object command before querying SQLite for a default VFS ** to use for 'real' IO operations. This is because creating the new VFS ** may delete an existing [testvfs] VFS of the same name. If such a VFS - ** is currently the default, the new [testvfs] may end up calling the + ** is currently the default, the new [testvfs] may end up calling the ** methods of a deleted object. */ Tcl_CreateObjCommand(interp, zVfs, testvfs_obj_cmd, p, testvfs_obj_del); diff --git a/third_party/sqlite/src/src/test_vfstrace.c b/third_party/sqlite/src/src/test_vfstrace.c index d0bc29f0c3ceb..15ba818dc5073 100644 --- a/third_party/sqlite/src/src/test_vfstrace.c +++ b/third_party/sqlite/src/src/test_vfstrace.c @@ -59,7 +59,7 @@ ** ** The call to vfstrace_register() simply creates the shim VFS that does ** tracing. The application must also arrange to use the new VFS for -** all database connections that are created and for which tracing is +** all database connections that are created and for which tracing is ** desired. This can be done by specifying the trace VFS using URI filename ** notation, or by specifying the trace VFS as the 4th parameter to ** sqlite3_open_v2() or by making the trace VFS be the default (by setting @@ -105,7 +105,7 @@ ** invariants are (1) you must have -DSQLITE_ENABLE_VFSTRACE so that ** the shell.c source file will know to include the -vfstrace command-line ** option and (2) you must compile and link the three source files -** shell,c, test_vfstrace.c, and sqlite3.c. +** shell,c, test_vfstrace.c, and sqlite3.c. */ #include #include @@ -306,9 +306,9 @@ static int vfstraceClose(sqlite3_file *pFile){ ** Read data from an vfstrace-file. */ static int vfstraceRead( - sqlite3_file *pFile, - void *zBuf, - int iAmt, + sqlite3_file *pFile, + void *zBuf, + int iAmt, sqlite_int64 iOfst ){ vfstrace_file *p = (vfstrace_file *)pFile; @@ -325,9 +325,9 @@ static int vfstraceRead( ** Write data to an vfstrace-file. */ static int vfstraceWrite( - sqlite3_file *pFile, - const void *zBuf, - int iAmt, + sqlite3_file *pFile, + const void *zBuf, + int iAmt, sqlite_int64 iOfst ){ vfstrace_file *p = (vfstrace_file *)pFile; @@ -441,7 +441,7 @@ static int vfstraceCheckReservedLock(sqlite3_file *pFile, int *pResOut){ vfstrace_file *p = (vfstrace_file *)pFile; vfstrace_info *pInfo = p->pInfo; int rc; - vfstrace_printf(pInfo, "%s.xCheckReservedLock(%s,%d)", + vfstrace_printf(pInfo, "%s.xCheckReservedLock(%s,%d)", pInfo->zVfsName, p->zFName); rc = p->pReal->pMethods->xCheckReservedLock(p->pReal, pResOut); vfstrace_print_errcode(pInfo, " -> %s", rc); @@ -561,10 +561,10 @@ static int vfstraceShmLock(sqlite3_file *pFile, int ofst, int n, int flags){ return rc; } static int vfstraceShmMap( - sqlite3_file *pFile, - int iRegion, - int szRegion, - int isWrite, + sqlite3_file *pFile, + int iRegion, + int szRegion, + int isWrite, void volatile **pp ){ vfstrace_file *p = (vfstrace_file *)pFile; @@ -670,9 +670,9 @@ static int vfstraceDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ ** is available, or false otherwise. */ static int vfstraceAccess( - sqlite3_vfs *pVfs, - const char *zPath, - int flags, + sqlite3_vfs *pVfs, + const char *zPath, + int flags, int *pResOut ){ vfstrace_info *pInfo = (vfstrace_info*)pVfs->pAppData; @@ -692,9 +692,9 @@ static int vfstraceAccess( ** of at least (DEVSYM_MAX_PATHNAME+1) bytes. */ static int vfstraceFullPathname( - sqlite3_vfs *pVfs, - const char *zPath, - int nOut, + sqlite3_vfs *pVfs, + const char *zPath, + int nOut, char *zOut ){ vfstrace_info *pInfo = (vfstrace_info*)pVfs->pAppData; @@ -720,7 +720,7 @@ static void *vfstraceDlOpen(sqlite3_vfs *pVfs, const char *zPath){ /* ** Populate the buffer zErrMsg (size nByte bytes) with a human readable -** utf-8 string describing the most recent error encountered associated +** utf-8 string describing the most recent error encountered associated ** with dynamic libraries. */ static void vfstraceDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){ @@ -752,7 +752,7 @@ static void vfstraceDlClose(sqlite3_vfs *pVfs, void *pHandle){ } /* -** Populate the buffer pointed to by zBufOut with nByte bytes of +** Populate the buffer pointed to by zBufOut with nByte bytes of ** random data. */ static int vfstraceRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ @@ -763,7 +763,7 @@ static int vfstraceRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ } /* -** Sleep for nMicro microseconds. Return the number of microseconds +** Sleep for nMicro microseconds. Return the number of microseconds ** actually slept. */ static int vfstraceSleep(sqlite3_vfs *pVfs, int nMicro){ @@ -825,7 +825,7 @@ static const char *vfstraceNextSystemCall(sqlite3_vfs *pVfs, const char *zName){ /* ** Clients invoke this routine to construct a new trace-vfs shim. ** -** Return SQLITE_OK on success. +** Return SQLITE_OK on success. ** ** SQLITE_NOMEM is returned in the case of a memory allocation error. ** SQLITE_NOTFOUND is returned if zOldVfsName does not exist. @@ -873,11 +873,11 @@ int vfstrace_register( pNew->xCurrentTimeInt64 = pRoot->xCurrentTimeInt64==0 ? 0 : vfstraceCurrentTimeInt64; if( pNew->iVersion>=3 ){ - pNew->xSetSystemCall = pRoot->xSetSystemCall==0 ? 0 : + pNew->xSetSystemCall = pRoot->xSetSystemCall==0 ? 0 : vfstraceSetSystemCall; - pNew->xGetSystemCall = pRoot->xGetSystemCall==0 ? 0 : + pNew->xGetSystemCall = pRoot->xGetSystemCall==0 ? 0 : vfstraceGetSystemCall; - pNew->xNextSystemCall = pRoot->xNextSystemCall==0 ? 0 : + pNew->xNextSystemCall = pRoot->xNextSystemCall==0 ? 0 : vfstraceNextSystemCall; } } diff --git a/third_party/sqlite/src/src/test_wsd.c b/third_party/sqlite/src/src/test_wsd.c index 99e4a056581f5..5d713fa32e636 100644 --- a/third_party/sqlite/src/src/test_wsd.c +++ b/third_party/sqlite/src/src/test_wsd.c @@ -10,7 +10,7 @@ ** ************************************************************************* ** -** The code in this file contains sample implementations of the +** The code in this file contains sample implementations of the ** sqlite3_wsd_init() and sqlite3_wsd_find() functions required if the ** SQLITE_OMIT_WSD symbol is defined at build time. */ diff --git a/third_party/sqlite/src/src/threads.c b/third_party/sqlite/src/src/threads.c index f128d69fc2355..40aef0765eb65 100644 --- a/third_party/sqlite/src/src/threads.c +++ b/third_party/sqlite/src/src/threads.c @@ -67,13 +67,13 @@ int sqlite3ThreadCreate( memset(p, 0, sizeof(*p)); p->xTask = xTask; p->pIn = pIn; - /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a + /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a ** function that returns SQLITE_ERROR when passed the argument 200, that - ** forces worker threads to run sequentially and deterministically + ** forces worker threads to run sequentially and deterministically ** for testing purposes. */ if( sqlite3FaultSim(200) ){ rc = 1; - }else{ + }else{ rc = pthread_create(&p->tid, 0, xTask, pIn); } if( rc ){ @@ -155,9 +155,9 @@ int sqlite3ThreadCreate( *ppThread = 0; p = sqlite3Malloc(sizeof(*p)); if( p==0 ) return SQLITE_NOMEM_BKPT; - /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a + /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a ** function that returns SQLITE_ERROR when passed the argument 200, that - ** forces worker threads to run sequentially and deterministically + ** forces worker threads to run sequentially and deterministically ** (via the sqlite3FaultSim() term of the conditional) for testing ** purposes. */ if( sqlite3GlobalConfig.bCoreMutex==0 || sqlite3FaultSim(200) ){ diff --git a/third_party/sqlite/src/src/tokenize.c b/third_party/sqlite/src/src/tokenize.c index 7bb1179e20aca..758ab834ad976 100644 --- a/third_party/sqlite/src/src/tokenize.c +++ b/third_party/sqlite/src/src/tokenize.c @@ -101,7 +101,7 @@ static const unsigned char aiClass[] = { ** lower-case ASCII equivalent. On ASCII machines, this is just ** an upper-to-lower case map. On EBCDIC machines we also need ** to adjust the encoding. The mapping is only valid for alphabetics -** which are the only characters for which this feature is used. +** which are the only characters for which this feature is used. ** ** Used by keywordhash.h */ @@ -133,7 +133,7 @@ const unsigned char ebcdicToAscii[] = { /* ** The sqlite3KeywordCode function looks up an identifier to determine if -** it is a keyword. If it is a keyword, the token code of that keyword is +** it is a keyword. If it is a keyword, the token code of that keyword is ** returned. If the input is not a keyword, TK_ID is returned. ** ** The implementation of this routine was generated by a program, @@ -150,14 +150,14 @@ const unsigned char ebcdicToAscii[] = { ** IdChar(X) will be true. Otherwise it is false. ** ** For ASCII, any character with the high-order bit set is -** allowed in an identifier. For 7-bit characters, +** allowed in an identifier. For 7-bit characters, ** sqlite3IsIdChar[X] must be 1. ** ** For EBCDIC, the rules are more complex but have the same ** end result. ** ** Ticket #1066. the SQL standard does not allow '$' in the -** middle of identifiers. But many SQL implementations do. +** middle of identifiers. But many SQL implementations do. ** SQLite will allow '$' in identifiers for compatibility. ** But the feature is undocumented. */ @@ -190,7 +190,7 @@ int sqlite3IsIdChar(u8 c){ return IdChar(c); } /* -** Return the length (in bytes) of the token that begins at z[0]. +** Return the length (in bytes) of the token that begins at z[0]. ** Store the token type in *tokenType before returning. */ int sqlite3GetToken(const unsigned char *z, int *tokenType){ @@ -368,7 +368,7 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ *tokenType = TK_FLOAT; } if( (z[i]=='e' || z[i]=='E') && - ( sqlite3Isdigit(z[i+1]) + ( sqlite3Isdigit(z[i+1]) || ((z[i+1]=='+' || z[i+1]=='-') && sqlite3Isdigit(z[i+2])) ) ){ @@ -469,7 +469,7 @@ int sqlite3GetToken(const unsigned char *z, int *tokenType){ /* ** Run the parser on the given SQL string. The parser structure is ** passed in. An SQLITE_ status code is returned. If an error occurs -** then an and attempt is made to write an error message into +** then an and attempt is made to write an error message into ** memory obtained from sqlite3_malloc() and to make *pzErrMsg point to that ** error message. */ @@ -590,7 +590,7 @@ int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){ #endif if( !IN_DECLARE_VTAB ){ - /* If the pParse->declareVtab flag is set, do not delete any table + /* If the pParse->declareVtab flag is set, do not delete any table ** structure built up in pParse->pNewTable. The calling code (see vtab.c) ** will take responsibility for freeing the Table structure. */ diff --git a/third_party/sqlite/src/src/treeview.c b/third_party/sqlite/src/src/treeview.c index 0ea512b5c6474..cb882ddd0ff81 100644 --- a/third_party/sqlite/src/src/treeview.c +++ b/third_party/sqlite/src/src/treeview.c @@ -12,7 +12,7 @@ ** ** This file contains C code to implement the TreeView debugging routines. ** These routines print a parse tree to standard output for debugging and -** analysis. +** analysis. ** ** The interfaces in this file is only available when compiling ** with SQLITE_DEBUG. @@ -177,7 +177,7 @@ void sqlite3TreeViewSelect(TreeView *pView, const Select *p, u8 moreToFollow){ sqlite3XPrintf(&x, " LEFT-JOIN"); } sqlite3StrAccumFinish(&x); - sqlite3TreeViewItem(pView, zLine, ipSrc->nSrc-1); + sqlite3TreeViewItem(pView, zLine, ipSrc->nSrc-1); if( pItem->pSelect ){ sqlite3TreeViewSelect(pView, pItem->pSelect, 0); } @@ -423,7 +423,7 @@ void sqlite3TreeViewExpr(TreeView *pView, const Expr *pExpr, u8 moreToFollow){ ** is set to the column of the pseudo-table to read, or to -1 to ** read the rowid field. */ - sqlite3TreeViewLine(pView, "%s(%d)", + sqlite3TreeViewLine(pView, "%s(%d)", pExpr->iTable ? "NEW" : "OLD", pExpr->iColumn); break; } diff --git a/third_party/sqlite/src/src/trigger.c b/third_party/sqlite/src/src/trigger.c index bdf964084bc5b..0f8092290c4e0 100644 --- a/third_party/sqlite/src/src/trigger.c +++ b/third_party/sqlite/src/src/trigger.c @@ -31,7 +31,7 @@ void sqlite3DeleteTriggerStep(sqlite3 *db, TriggerStep *pTriggerStep){ } /* -** Given table pTab, return a list of all the triggers attached to +** Given table pTab, return a list of all the triggers attached to ** the table. The list is connected by Trigger.pNext pointers. ** ** All of the triggers on pTab that are in the same database as pTab @@ -58,7 +58,7 @@ Trigger *sqlite3TriggerList(Parse *pParse, Table *pTab){ for(p=sqliteHashFirst(&pTmpSchema->trigHash); p; p=sqliteHashNext(p)){ Trigger *pTrig = (Trigger *)sqliteHashData(p); if( pTrig->pTabSchema==pTab->pSchema - && 0==sqlite3StrICmp(pTrig->table, pTab->zName) + && 0==sqlite3StrICmp(pTrig->table, pTab->zName) ){ pTrig->pNext = (pList ? pList : pTab->pTrigger); pList = pTrig; @@ -199,7 +199,7 @@ void sqlite3BeginTrigger( ** of triggers. */ if( pTab->pSelect && tr_tm!=TK_INSTEAD ){ - sqlite3ErrorMsg(pParse, "cannot create %s trigger on view: %S", + sqlite3ErrorMsg(pParse, "cannot create %s trigger on view: %S", (tr_tm == TK_BEFORE)?"BEFORE":"AFTER", pTableName, 0); goto trigger_cleanup; } @@ -288,8 +288,8 @@ void sqlite3FinishTrigger( } sqlite3TokenInit(&nameToken, pTrig->zName); sqlite3FixInit(&sFix, pParse, iDb, "trigger", &nameToken); - if( sqlite3FixTriggerStep(&sFix, pTrig->step_list) - || sqlite3FixExpr(&sFix, pTrig->pWhen) + if( sqlite3FixTriggerStep(&sFix, pTrig->step_list) + || sqlite3FixExpr(&sFix, pTrig->pWhen) ){ goto triggerfinish_cleanup; } @@ -343,7 +343,7 @@ triggerfinish_cleanup: ** a trigger step. Return a pointer to a TriggerStep structure. ** ** The parser calls this routine when it finds a SELECT statement in -** body of a TRIGGER. +** body of a TRIGGER. */ TriggerStep *sqlite3TriggerSelectStep(sqlite3 *db, Select *pSelect){ TriggerStep *pTriggerStep = sqlite3DbMallocZero(db, sizeof(TriggerStep)); @@ -458,7 +458,7 @@ TriggerStep *sqlite3TriggerDeleteStep( return pTriggerStep; } -/* +/* ** Recursively delete a Trigger structure */ void sqlite3DeleteTrigger(sqlite3 *db, Trigger *pTrigger){ @@ -472,7 +472,7 @@ void sqlite3DeleteTrigger(sqlite3 *db, Trigger *pTrigger){ } /* -** This function is called to drop a trigger from the database schema. +** This function is called to drop a trigger from the database schema. ** ** This may be called directly from the parser and therefore identifies ** the trigger by name. The sqlite3DropTriggerPtr() routine does the @@ -527,7 +527,7 @@ static Table *tableOfTrigger(Trigger *pTrigger){ /* -** Drop a trigger given a pointer to that trigger. +** Drop a trigger given a pointer to that trigger. */ void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){ Table *pTable; @@ -603,12 +603,12 @@ static int checkColumnOverlap(IdList *pIdList, ExprList *pEList){ for(e=0; enExpr; e++){ if( sqlite3IdListIndex(pIdList, pEList->a[e].zName)>=0 ) return 1; } - return 0; + return 0; } /* ** Return a list of all triggers on table pTab if there exists at least -** one trigger that must be fired when an operation of type 'op' is +** one trigger that must be fired when an operation of type 'op' is ** performed on the table, and, if that operation is an UPDATE, if at ** least one of the columns in pChanges is being modified. */ @@ -672,13 +672,13 @@ static SrcList *targetSrcList( } /* -** Generate VDBE code for the statements inside the body of a single +** Generate VDBE code for the statements inside the body of a single ** trigger. */ static int codeTriggerProgram( Parse *pParse, /* The parser context */ TriggerStep *pStepList, /* List of statements inside the trigger body */ - int orconf /* Conflict algorithm. (OE_Abort, etc) */ + int orconf /* Conflict algorithm. (OE_Abort, etc) */ ){ TriggerStep *pStep; Vdbe *v = pParse->pVdbe; @@ -706,25 +706,25 @@ static int codeTriggerProgram( switch( pStep->op ){ case TK_UPDATE: { - sqlite3Update(pParse, + sqlite3Update(pParse, targetSrcList(pParse, pStep), - sqlite3ExprListDup(db, pStep->pExprList, 0), - sqlite3ExprDup(db, pStep->pWhere, 0), + sqlite3ExprListDup(db, pStep->pExprList, 0), + sqlite3ExprDup(db, pStep->pWhere, 0), pParse->eOrconf ); break; } case TK_INSERT: { - sqlite3Insert(pParse, + sqlite3Insert(pParse, targetSrcList(pParse, pStep), - sqlite3SelectDup(db, pStep->pSelect, 0), - sqlite3IdListDup(db, pStep->pIdList), + sqlite3SelectDup(db, pStep->pSelect, 0), + sqlite3IdListDup(db, pStep->pIdList), pParse->eOrconf ); break; } case TK_DELETE: { - sqlite3DeleteFrom(pParse, + sqlite3DeleteFrom(pParse, targetSrcList(pParse, pStep), sqlite3ExprDup(db, pStep->pWhere, 0) ); @@ -738,7 +738,7 @@ static int codeTriggerProgram( sqlite3SelectDelete(db, pSelect); break; } - } + } if( pStep->op!=TK_SELECT ){ sqlite3VdbeAddOp0(v, OP_ResetCount); } @@ -783,7 +783,7 @@ static void transferParseError(Parse *pTo, Parse *pFrom){ } /* -** Create and populate a new TriggerPrg object with a sub-program +** Create and populate a new TriggerPrg object with a sub-program ** implementing trigger pTrigger with ON CONFLICT policy orconf. */ static TriggerPrg *codeRowTrigger( @@ -806,7 +806,7 @@ static TriggerPrg *codeRowTrigger( assert( pTop->pVdbe ); /* Allocate the TriggerPrg and SubProgram objects. To ensure that they - ** are freed if an error occurs, link them into the Parse.pTriggerPrg + ** are freed if an error occurs, link them into the Parse.pTriggerPrg ** list of the top-level Parse object sooner rather than later. */ pPrg = sqlite3DbMallocZero(db, sizeof(TriggerPrg)); if( !pPrg ) return 0; @@ -820,7 +820,7 @@ static TriggerPrg *codeRowTrigger( pPrg->aColmask[0] = 0xffffffff; pPrg->aColmask[1] = 0xffffffff; - /* Allocate and populate a new Parse context to use for coding the + /* Allocate and populate a new Parse context to use for coding the ** trigger sub-program. */ pSubParse = sqlite3StackAllocZero(db, sizeof(Parse)); if( !pSubParse ) return 0; @@ -835,7 +835,7 @@ static TriggerPrg *codeRowTrigger( v = sqlite3GetVdbe(pSubParse); if( v ){ - VdbeComment((v, "Start: %s.%s (%s %s%s%s ON %s)", + VdbeComment((v, "Start: %s.%s (%s %s%s%s ON %s)", pTrigger->zName, onErrorText(orconf), (pTrigger->tr_tm==TRIGGER_BEFORE ? "BEFORE" : "AFTER"), (pTrigger->op==TK_UPDATE ? "UPDATE" : ""), @@ -844,18 +844,18 @@ static TriggerPrg *codeRowTrigger( pTab->zName )); #ifndef SQLITE_OMIT_TRACE - sqlite3VdbeChangeP4(v, -1, + sqlite3VdbeChangeP4(v, -1, sqlite3MPrintf(db, "-- TRIGGER %s", pTrigger->zName), P4_DYNAMIC ); #endif /* If one was specified, code the WHEN clause. If it evaluates to false - ** (or NULL) the sub-vdbe is immediately halted by jumping to the + ** (or NULL) the sub-vdbe is immediately halted by jumping to the ** OP_Halt inserted at the end of the program. */ if( pTrigger->pWhen ){ pWhen = sqlite3ExprDup(db, pTrigger->pWhen, 0); - if( SQLITE_OK==sqlite3ResolveExprNames(&sNC, pWhen) - && db->mallocFailed==0 + if( SQLITE_OK==sqlite3ResolveExprNames(&sNC, pWhen) + && db->mallocFailed==0 ){ iEndTrigger = sqlite3VdbeMakeLabel(v); sqlite3ExprIfFalse(pSubParse, pWhen, iEndTrigger, SQLITE_JUMPIFNULL); @@ -892,7 +892,7 @@ static TriggerPrg *codeRowTrigger( return pPrg; } - + /* ** Return a pointer to a TriggerPrg object containing the sub-program for ** trigger pTrigger with default ON CONFLICT algorithm orconf. If no such @@ -914,8 +914,8 @@ static TriggerPrg *getRowTrigger( ** process of being coded). If this is the case, then an entry with ** a matching TriggerPrg.pTrigger field will be present somewhere ** in the Parse.pTriggerPrg list. Search for such an entry. */ - for(pPrg=pRoot->pTriggerPrg; - pPrg && (pPrg->pTrigger!=pTrigger || pPrg->orconf!=orconf); + for(pPrg=pRoot->pTriggerPrg; + pPrg && (pPrg->pTrigger!=pTrigger || pPrg->orconf!=orconf); pPrg=pPrg->pNext ); @@ -928,7 +928,7 @@ static TriggerPrg *getRowTrigger( } /* -** Generate code for the trigger program associated with trigger p on +** Generate code for the trigger program associated with trigger p on ** table pTab. The reg, orconf and ignoreJump parameters passed to this ** function are the same as those described in the header function for ** sqlite3CodeRowTrigger() @@ -946,7 +946,7 @@ void sqlite3CodeRowTriggerDirect( pPrg = getRowTrigger(pParse, p, pTab, orconf); assert( pPrg || pParse->nErr || pParse->db->mallocFailed ); - /* Code the OP_Program opcode in the parent VDBE. P4 of the OP_Program + /* Code the OP_Program opcode in the parent VDBE. P4 of the OP_Program ** is a pointer to the sub-vdbe containing the trigger program. */ if( pPrg ){ int bRecursive = (p->zName && 0==(pParse->db->flags&SQLITE_RecTriggers)); @@ -975,7 +975,7 @@ void sqlite3CodeRowTriggerDirect( ** If there are no triggers that fire at the specified time for the specified ** operation on pTab, this function is a no-op. ** -** The reg argument is the address of the first in an array of registers +** The reg argument is the address of the first in an array of registers ** that contain the values substituted for the new.* and old.* references ** in the trigger program. If N is the number of columns in table pTab ** (a copy of pTab->nCol), then registers are populated as follows: @@ -992,12 +992,12 @@ void sqlite3CodeRowTriggerDirect( ** reg+N+N+1 NEW.* value of right-most column of pTab ** ** For ON DELETE triggers, the registers containing the NEW.* values will -** never be accessed by the trigger program, so they are not allocated or -** populated by the caller (there is no data to populate them with anyway). +** never be accessed by the trigger program, so they are not allocated or +** populated by the caller (there is no data to populate them with anyway). ** Similarly, for ON INSERT triggers the values stored in the OLD.* registers ** are never accessed, and so are not allocated by the caller. So, for an ** ON INSERT trigger, the value passed to this function as parameter reg -** is not a readable register, although registers (reg+N) through +** is not a readable register, although registers (reg+N) through ** (reg+N+N+1) are. ** ** Parameter orconf is the default conflict resolution algorithm for the @@ -1029,12 +1029,12 @@ void sqlite3CodeRowTrigger( ** or else it must be a TEMP trigger. */ assert( p->pSchema!=0 ); assert( p->pTabSchema!=0 ); - assert( p->pSchema==p->pTabSchema + assert( p->pSchema==p->pTabSchema || p->pSchema==pParse->db->aDb[1].pSchema ); /* Determine whether we should code this trigger */ - if( p->op==op - && p->tr_tm==tr_tm + if( p->op==op + && p->tr_tm==tr_tm && checkColumnOverlap(p->pColumns, pChanges) ){ sqlite3CodeRowTriggerDirect(pParse, p, pTab, reg, orconf, ignoreJump); @@ -1043,9 +1043,9 @@ void sqlite3CodeRowTrigger( } /* -** Triggers may access values stored in the old.* or new.* pseudo-table. -** This function returns a 32-bit bitmask indicating which columns of the -** old.* or new.* tables actually are used by triggers. This information +** Triggers may access values stored in the old.* or new.* pseudo-table. +** This function returns a 32-bit bitmask indicating which columns of the +** old.* or new.* tables actually are used by triggers. This information ** may be used by the caller, for example, to avoid having to load the entire ** old.* record into memory when executing an UPDATE or DELETE command. ** @@ -1055,7 +1055,7 @@ void sqlite3CodeRowTrigger( ** are more than 32 columns in the table, and at least one of the columns ** with an index greater than 32 may be accessed, 0xffffffff is returned. ** -** It is not possible to determine if the old.rowid or new.rowid column is +** It is not possible to determine if the old.rowid or new.rowid column is ** accessed by triggers. The caller must always assume that it is. ** ** Parameter isNew must be either 1 or 0. If it is 0, then the mask returned diff --git a/third_party/sqlite/src/src/update.c b/third_party/sqlite/src/src/update.c index 8fca7eb9882e2..eb297b4e43357 100644 --- a/third_party/sqlite/src/src/update.c +++ b/third_party/sqlite/src/src/update.c @@ -30,10 +30,10 @@ static void updateVirtualTable( /* ** The most recently coded instruction was an OP_Column to retrieve the -** i-th column of table pTab. This routine sets the P4 parameter of the +** i-th column of table pTab. This routine sets the P4 parameter of the ** OP_Column to the default value, if any. ** -** The default value of a column is specified by a DEFAULT clause in the +** The default value of a column is specified by a DEFAULT clause in the ** column definition. This was either supplied by the user when the table ** was created, or added later to the table definition by an ALTER TABLE ** command. If the latter, then the row-records in the table btree on disk @@ -42,9 +42,9 @@ static void updateVirtualTable( ** If the former, then all row-records are guaranteed to include a value ** for the column and the P4 value is not required. ** -** Column definitions created by an ALTER TABLE command may only have +** Column definitions created by an ALTER TABLE command may only have ** literal default values specified: a number, null or a string. (If a more -** complicated default expression value was provided, it is evaluated +** complicated default expression value was provided, it is evaluated ** when the ALTER TABLE is executed and one of the literal values written ** into the sqlite_master table.) ** @@ -54,8 +54,8 @@ static void updateVirtualTable( ** sqlite3_value objects. ** ** If parameter iReg is not negative, code an OP_RealAffinity instruction -** on register iReg. This is used when an equivalent integer value is -** stored in place of an 8-byte floating point value in order to save +** on register iReg. This is used when an equivalent integer value is +** stored in place of an 8-byte floating point value in order to save ** space. */ void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i, int iReg){ @@ -66,7 +66,7 @@ void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i, int iReg){ Column *pCol = &pTab->aCol[i]; VdbeComment((v, "%s.%s", pTab->zName, pCol->zName)); assert( inCol ); - sqlite3ValueFromExpr(sqlite3VdbeDb(v), pCol->pDflt, enc, + sqlite3ValueFromExpr(sqlite3VdbeDb(v), pCol->pDflt, enc, pCol->affinity, &pValue); if( pValue ){ sqlite3VdbeAppendP4(v, pValue, P4_MEM); @@ -153,7 +153,7 @@ void sqlite3Update( } assert( pTabList->nSrc==1 ); - /* Locate the table which we want to update. + /* Locate the table which we want to update. */ pTab = sqlite3SrcListLookup(pParse, pTabList); if( pTab==0 ) goto update_cleanup; @@ -199,7 +199,7 @@ void sqlite3Update( pParse->nTab++; } - /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. + /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. ** Initialize aXRef[] and aToOpen[] to their default values. */ aXRef = sqlite3DbMallocRawNN(db, sizeof(int) * (pTab->nCol+nIdx) + nIdx+2 ); @@ -268,7 +268,7 @@ void sqlite3Update( assert( chngPk==0 || chngPk==1 ); chngKey = chngRowid + chngPk; - /* The SET expressions are not actually used inside the WHERE loop. + /* The SET expressions are not actually used inside the WHERE loop. ** So reset the colUsed mask. Unless this is a virtual table. In that ** case, set all bits of the colUsed mask (to ensure that the virtual ** table implementation makes all columns available). @@ -296,7 +296,7 @@ void sqlite3Update( reg = ++pParse->nMem; pParse->nMem += pIdx->nColumn; if( (onError==OE_Replace) - || (onError==OE_Default && pIdx->onError==OE_Replace) + || (onError==OE_Default && pIdx->onError==OE_Replace) ){ bReplace = 1; } @@ -308,7 +308,7 @@ void sqlite3Update( aRegIdx[j] = reg; } if( bReplace ){ - /* If REPLACE conflict resolution might be invoked, open cursors on all + /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ memset(aToOpen, 1, nIdx+1); } @@ -385,7 +385,7 @@ void sqlite3Update( sqlite3VdbeSetP4KeyInfo(pParse, pPk); } - /* Begin the database scan. + /* Begin the database scan. ** ** Do not consider a single-pass strategy for a multi-row update if ** there are any triggers or foreign keys to process, or rows may @@ -417,7 +417,7 @@ void sqlite3Update( } assert( iCur!=iDataCur || !HasRowid(pTab) ); } - + if( HasRowid(pTab) ){ /* Read the rowid of the current row of the WHERE scan. In ONEPASS_OFF ** mode, write the rowid into the FIFO. In either of the one-pass modes, @@ -430,7 +430,7 @@ void sqlite3Update( /* Read the PK of the current row into an array of registers. In ** ONEPASS_OFF mode, serialize the array into a record and store it in ** the ephemeral table. Or, in ONEPASS_SINGLE or MULTI mode, change - ** the OP_OpenEphemeral instruction to a Noop (the ephemeral table + ** the OP_OpenEphemeral instruction to a Noop (the ephemeral table ** is not required) and leave the PK fields in the array of registers. */ for(i=0; iaiColumn[i]>=0 ); @@ -512,7 +512,7 @@ void sqlite3Update( ** information is needed */ if( chngPk || hasFK || pTrigger ){ u32 oldmask = (hasFK ? sqlite3FkOldmask(pParse, pTab) : 0); - oldmask |= sqlite3TriggerColmask(pParse, + oldmask |= sqlite3TriggerColmask(pParse, pTrigger, pChanges, 0, TRIGGER_BEFORE|TRIGGER_AFTER, pTab, onError ); for(i=0; inCol; i++){ @@ -539,8 +539,8 @@ void sqlite3Update( ** If there are one or more BEFORE triggers, then do not populate the ** registers associated with columns that are (a) not modified by ** this UPDATE statement and (b) not accessed by new.* references. The - ** values for registers not modified by the UPDATE must be reloaded from - ** the database after the BEFORE triggers are fired anyway (as the trigger + ** values for registers not modified by the UPDATE must be reloaded from + ** the database after the BEFORE triggers are fired anyway (as the trigger ** may have modified them). So not loading those that are not going to ** be used eliminates some redundant opcodes. */ @@ -555,7 +555,7 @@ void sqlite3Update( if( j>=0 ){ sqlite3ExprCode(pParse, pChanges->a[j].pExpr, regNew+i); }else if( 0==(tmask&TRIGGER_BEFORE) || i>31 || (newmask & MASKBIT32(i)) ){ - /* This branch loads the value of a column that will not be changed + /* This branch loads the value of a column that will not be changed ** into a register. This is done if there are no BEFORE triggers, or ** if there are one or more BEFORE triggers that use this value via ** a new.* reference in a trigger program. @@ -574,11 +574,11 @@ void sqlite3Update( */ if( tmask&TRIGGER_BEFORE ){ sqlite3TableAffinity(v, pTab, regNew); - sqlite3CodeRowTrigger(pParse, pTrigger, TK_UPDATE, pChanges, + sqlite3CodeRowTrigger(pParse, pTrigger, TK_UPDATE, pChanges, TRIGGER_BEFORE, pTab, regOldRowid, onError, labelContinue); /* The row-trigger may have deleted the row being updated. In this - ** case, jump to the next row. No updates or AFTER triggers are + ** case, jump to the next row. No updates or AFTER triggers are ** required. This behavior - what happens when the row being updated ** is deleted or renamed by a BEFORE trigger - is left undefined in the ** documentation. @@ -591,9 +591,9 @@ void sqlite3Update( VdbeCoverage(v); } - /* If it did not delete it, the row-trigger may still have modified - ** some of the columns of the row being updated. Load the values for - ** all columns not modified by the update statement into their + /* If it did not delete it, the row-trigger may still have modified + ** some of the columns of the row being updated. Load the values for + ** all columns not modified by the update statement into their ** registers in case this has happened. */ for(i=0; inCol; i++){ @@ -632,7 +632,7 @@ void sqlite3Update( ** to process, delete the old record. Otherwise, add a noop OP_Delete ** to invoke the pre-update hook. ** - ** That (regNew==regnewRowid+1) is true is also important for the + ** That (regNew==regnewRowid+1) is true is also important for the ** pre-update hook. If the caller invokes preupdate_new(), the returned ** value is copied from memory cell (regNewRowid+1+iCol), where iCol ** is the column index supplied by the user. @@ -662,29 +662,29 @@ void sqlite3Update( if( hasFK ){ sqlite3FkCheck(pParse, pTab, 0, regNewRowid, aXRef, chngKey); } - + /* Insert the new index entries and the new record. */ sqlite3CompleteInsertion( - pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, - OPFLAG_ISUPDATE | (eOnePass==ONEPASS_MULTI ? OPFLAG_SAVEPOSITION : 0), + pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, + OPFLAG_ISUPDATE | (eOnePass==ONEPASS_MULTI ? OPFLAG_SAVEPOSITION : 0), 0, 0 ); /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key - ** to the row just updated. */ + ** to the row just updated. */ if( hasFK ){ sqlite3FkActions(pParse, pTab, pChanges, regOldRowid, aXRef, chngKey); } } - /* Increment the row counter + /* Increment the row counter */ if( (db->flags & SQLITE_CountRows) && !pParse->pTriggerTab){ sqlite3VdbeAddOp2(v, OP_AddImm, regRowCount, 1); } - sqlite3CodeRowTrigger(pParse, pTrigger, TK_UPDATE, pChanges, + sqlite3CodeRowTrigger(pParse, pTrigger, TK_UPDATE, pChanges, TRIGGER_AFTER, pTab, regOldRowid, onError, labelContinue); /* Repeat the above with the next record to be updated, until @@ -712,7 +712,7 @@ void sqlite3Update( } /* - ** Return the number of rows that were changed. If this routine is + ** Return the number of rows that were changed. If this routine is ** generating code because of a call to sqlite3NestedParse(), do not ** invoke the callback function. */ @@ -744,8 +744,8 @@ update_cleanup: /* ** Generate code for an UPDATE of a virtual table. ** -** There are two possible strategies - the default and the special -** "onepass" strategy. Onepass is only used if the virtual table +** There are two possible strategies - the default and the special +** "onepass" strategy. Onepass is only used if the virtual table ** implementation indicates that pWhere may match at most one row. ** ** The default strategy is to create an ephemeral table that contains @@ -843,7 +843,7 @@ static void updateVirtualTable( /* Begin scannning through the ephemeral table. */ addr = sqlite3VdbeAddOp1(v, OP_Rewind, ephemTab); VdbeCoverage(v); - /* Extract arguments from the current row of the ephemeral table and + /* Extract arguments from the current row of the ephemeral table and ** invoke the VUpdate method. */ for(i=0; ienc==SQLITE_UTF16LE ){ /* UTF-16 Little-endian -> UTF-8 */ while( zIn UTF-8 */ while( zIn=zEnd ) goto do_atof_calc; /*PREVENTS-HARMLESS-OVERREAD*/ @@ -495,7 +495,7 @@ do_atof_calc: } } }else{ - /* 1.0e+22 is the largest power of 10 than can be + /* 1.0e+22 is the largest power of 10 than can be ** represented exactly. */ while( e%22 ) { scale *= 1.0e+1; e -= 1; } while( e>0 ) { scale *= 1.0e+22; e -= 22; } @@ -553,11 +553,11 @@ static int compare2pow63(const char *zNum, int incr){ ** Convert zNum to a 64-bit signed integer. zNum must be decimal. This ** routine does *not* accept hexadecimal notation. ** -** If the zNum value is representable as a 64-bit twos-complement +** If the zNum value is representable as a 64-bit twos-complement ** integer, then write that value into *pNum and return 0. ** ** If zNum is exactly 9223372036854775808, return 2. This special -** case is broken out because while 9223372036854775808 cannot be a +** case is broken out because while 9223372036854775808 cannot be a ** signed 64-bit integer, its negative -9223372036854775808 can be. ** ** If zNum is too big for a 64-bit integer and is not @@ -788,7 +788,7 @@ static int SQLITE_NOINLINE putVarint64(unsigned char *p, u64 v){ v >>= 7; } return 9; - } + } n = 0; do{ buf[n++] = (u8)((v & 0x7f) | 0x80); @@ -998,8 +998,8 @@ u8 sqlite3GetVarint(const unsigned char *p, u64 *v){ ** If the varint stored in p[0] is larger than can fit in a 32-bit unsigned ** integer, then set *v to 0xffffffff. ** -** A MACRO version, getVarint32, is provided which inlines the -** single-byte case. All code should use the MACRO version as +** A MACRO version, getVarint32, is provided which inlines the +** single-byte case. All code should use the MACRO version as ** this function assumes the single-byte case has already been handled. */ u8 sqlite3GetVarint32(const unsigned char *p, u32 *v){ @@ -1217,7 +1217,7 @@ void *sqlite3HexToBlob(sqlite3 *db, const char *z, int n){ ** argument. The zType is a word like "NULL" or "closed" or "invalid". */ static void logBadConnection(const char *zType){ - sqlite3_log(SQLITE_MISUSE, + sqlite3_log(SQLITE_MISUSE, "API call with %s database connection pointer", zType ); @@ -1291,7 +1291,7 @@ int sqlite3AddInt64(i64 *pA, i64 iB){ if( iA<0 && -(iA + LARGEST_INT64) > iB + 1 ) return 1; } *pA += iB; - return 0; + return 0; #endif } int sqlite3SubInt64(i64 *pA, i64 iB){ @@ -1337,7 +1337,7 @@ int sqlite3MulInt64(i64 *pA, i64 iB){ } /* -** Compute the absolute value of a 32-bit signed integer, of possible. Or +** Compute the absolute value of a 32-bit signed integer, of possible. Or ** if the integer has a value of -2147483648, return +2147483647 */ int sqlite3AbsInt32(int x){ @@ -1377,11 +1377,11 @@ void sqlite3FileSuffix3(const char *zBaseFilename, char *z){ } #endif -/* +/* ** Find (an approximate) sum of two LogEst values. This computation is ** not a simple "+" operator because LogEst is stored as a logarithmic ** value. -** +** */ LogEst sqlite3LogEstAdd(LogEst a, LogEst b){ static const unsigned char x[] = { @@ -1489,8 +1489,8 @@ u64 sqlite3LogEstToInt(LogEst x){ ** Conceptually: ** ** struct VList { -** int nAlloc; // Number of allocated slots -** int nUsed; // Number of used slots +** int nAlloc; // Number of allocated slots +** int nUsed; // Number of used slots ** struct VListEntry { ** int iValue; // Value for this entry ** int nSlot; // Slots used by this entry @@ -1499,7 +1499,7 @@ u64 sqlite3LogEstToInt(LogEst x){ ** } ** ** During code generation, pointers to the variable names within the -** VList are taken. When that happens, nAlloc is set to zero as an +** VList are taken. When that happens, nAlloc is set to zero as an ** indication that the VList may never again be enlarged, since the ** accompanying realloc() would invalidate the pointers. */ diff --git a/third_party/sqlite/src/src/vacuum.c b/third_party/sqlite/src/src/vacuum.c index 25b1258510fc5..3f1cb2eab92ab 100644 --- a/third_party/sqlite/src/src/vacuum.c +++ b/third_party/sqlite/src/src/vacuum.c @@ -132,7 +132,7 @@ int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db, int iDb){ return SQLITE_ERROR; } - /* Save the current value of the database flags so that it can be + /* Save the current value of the database flags so that it can be ** restored before returning. Then set the writable-schema flag, and ** disable CHECK and foreign key constraints. */ saved_flags = db->flags; @@ -269,7 +269,7 @@ int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db, int iDb){ ); if( rc ) goto end_of_vacuum; - /* At this point, there is a write transaction open on both the + /* At this point, there is a write transaction open on both the ** vacuum database and the main database. Assuming no error occurs, ** both transactions are closed by this block - the main database ** transaction by sqlite3BtreeCopyFile() and the other by an explicit @@ -342,7 +342,7 @@ end_of_vacuum: } /* This both clears the schemas and reduces the size of the db->aDb[] - ** array. */ + ** array. */ sqlite3ResetAllSchemasOfConnection(db); return rc; diff --git a/third_party/sqlite/src/src/vdbe.c b/third_party/sqlite/src/src/vdbe.c index cb8a039abbafc..ebd68a6d16df7 100644 --- a/third_party/sqlite/src/src/vdbe.c +++ b/third_party/sqlite/src/src/vdbe.c @@ -140,7 +140,7 @@ int sqlite3_found_count = 0; static void vdbeTakeBranch(int iSrcLine, u8 I, u8 M){ if( iSrcLine<=2 && ALWAYS(iSrcLine>0) ){ M = iSrcLine; - /* Assert the truth of VdbeCoverageAlwaysTaken() and + /* Assert the truth of VdbeCoverageAlwaysTaken() and ** VdbeCoverageNeverTaken() */ assert( (M & I)==I ); }else{ @@ -189,7 +189,7 @@ static VdbeCursor *allocateCursor( u8 eCurType /* Type of the new cursor */ ){ /* Find the memory cell that will be used to store the blob of memory - ** required for this VdbeCursor structure. It is convenient to use a + ** required for this VdbeCursor structure. It is convenient to use a ** vdbe memory cell to manage the memory allocation required for a ** VdbeCursor structure for the following reasons: ** @@ -210,8 +210,8 @@ static VdbeCursor *allocateCursor( int nByte; VdbeCursor *pCx = 0; - nByte = - ROUND8(sizeof(VdbeCursor)) + 2*sizeof(u32)*nField + + nByte = + ROUND8(sizeof(VdbeCursor)) + 2*sizeof(u32)*nField + (eCurType==CURTYPE_BTREE?sqlite3BtreeCursorSize():0); assert( iCur>=0 && iCurnCursor ); @@ -272,7 +272,7 @@ static void applyNumericAffinity(Mem *pRec, int bTryForInt){ ** SQLITE_AFF_INTEGER: ** SQLITE_AFF_REAL: ** SQLITE_AFF_NUMERIC: -** Try to convert pRec to an integer representation or a +** Try to convert pRec to an integer representation or a ** floating-point representation if an integer representation ** is not possible. Note that the integer representation is ** always preferred, even if the affinity is REAL, because @@ -302,7 +302,7 @@ static void applyAffinity( }else if( affinity==SQLITE_AFF_TEXT ){ /* Only attempt the conversion to TEXT if there is an integer or real ** representation (blob and NULL do not get converted) but no string - ** representation. It would be harmless to repeat the conversion if + ** representation. It would be harmless to repeat the conversion if ** there is already a string rep, but it is pointless to waste those ** CPU cycles. */ if( 0==(pRec->flags&MEM_Str) ){ /*OPTIMIZATION-IF-FALSE*/ @@ -331,12 +331,12 @@ int sqlite3_value_numeric_type(sqlite3_value *pVal){ } /* -** Exported version of applyAffinity(). This one works on sqlite3_value*, +** Exported version of applyAffinity(). This one works on sqlite3_value*, ** not the internal Mem* type. */ void sqlite3ValueApplyAffinity( - sqlite3_value *pVal, - u8 affinity, + sqlite3_value *pVal, + u8 affinity, u8 enc ){ applyAffinity((Mem *)pVal, affinity, enc); @@ -362,7 +362,7 @@ static u16 SQLITE_NOINLINE computeNumericType(Mem *pMem){ /* ** Return the numeric type for pMem, either MEM_Int or MEM_Real or both or -** none. +** none. ** ** Unlike applyNumericAffinity(), this routine does not modify pMem->flags. ** But it does set pMem->u.r and pMem->u.i appropriately. @@ -502,8 +502,8 @@ static void registerTrace(int iReg, Mem *p){ #ifdef VDBE_PROFILE -/* -** hwtime.h contains inline assembler code for implementing +/* +** hwtime.h contains inline assembler code for implementing ** high-performance timing routines. */ #include "hwtime.h" @@ -514,9 +514,9 @@ static void registerTrace(int iReg, Mem *p){ /* ** This function is only called from within an assert() expression. It ** checks that the sqlite3.nTransaction variable is correctly set to -** the number of non-transaction savepoints currently in the +** the number of non-transaction savepoints currently in the ** linked list starting at sqlite3.pSavepoint. -** +** ** Usage: ** ** assert( checkSavepointCount(db) ); @@ -556,7 +556,7 @@ static Mem *out2Prerelease(Vdbe *p, VdbeOp *pOp){ /* ** Execute as much of a VDBE program as we can. -** This is the core of sqlite3_step(). +** This is the core of sqlite3_step(). */ int sqlite3VdbeExec( Vdbe *p /* The VDBE */ @@ -658,7 +658,7 @@ int sqlite3VdbeExec( sqlite3VdbePrintOp(stdout, (int)(pOp - aOp), pOp); } #endif - + /* Check to see if we need to simulate an interrupt. This only happens ** if we have a special test build. @@ -712,7 +712,7 @@ int sqlite3VdbeExec( #if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE) pOrigOp = pOp; #endif - + switch( pOp->opcode ){ /***************************************************************************** @@ -753,7 +753,7 @@ int sqlite3VdbeExec( /* Opcode: Goto * P2 * * * ** ** An unconditional jump to address P2. -** The next instruction executed will be +** The next instruction executed will be ** the one at index P2 from the beginning of ** the program. ** @@ -769,7 +769,7 @@ jump_to_p2_and_check_for_interrupt: /* Opcodes that are used as the bottom of a loop (OP_Next, OP_Prev, ** OP_VNext, OP_RowSetNext, or OP_SorterNext) all jump here upon ** completion. Check to see if sqlite3_interrupt() has been called - ** or if the progress callback needs to be invoked. + ** or if the progress callback needs to be invoked. ** ** This code uses unstructured "goto" statements and does not look clean. ** But that is not due to sloppy coding habits. The code is written this @@ -794,7 +794,7 @@ check_for_interrupt: } } #endif - + break; } @@ -926,7 +926,7 @@ case OP_HaltIfNull: { /* in3 */ ** whether or not to rollback the current transaction. Do not rollback ** if P2==OE_Fail. Do the rollback if P2==OE_Rollback. If P2==OE_Abort, ** then back out all changes that have occurred during this execution of the -** VDBE, but do not rollback the transaction. +** VDBE, but do not rollback the transaction. ** ** If P4 is not null then it is an error message string. ** @@ -958,7 +958,7 @@ case OP_Halt: { sqlite3VdbeSetChanges(db, p->nChange); pcx = sqlite3VdbeFrameRestore(pFrame); if( pOp->p2==OE_Ignore ){ - /* Instruction pcx is the OP_Program that invoked the sub-program + /* Instruction pcx is the OP_Program that invoked the sub-program ** currently being halted. If the p2 instruction of this OP_Halt ** instruction is set to OE_Ignore, then the sub-program is throwing ** an IGNORE exception. In this case jump to the address specified @@ -1046,7 +1046,7 @@ case OP_Real: { /* same as TK_FLOAT, out2 */ /* Opcode: String8 * P2 * P4 * ** Synopsis: r[P2]='P4' ** -** P4 points to a nul terminated UTF-8 string. This opcode is transformed +** P4 points to a nul terminated UTF-8 string. This opcode is transformed ** into a String opcode before it is executed for the first time. During ** this transformation, the length of string P4 is computed and stored ** as the P1 parameter. @@ -1081,7 +1081,7 @@ case OP_String8: { /* same as TK_STRING, out2 */ assert( rc==SQLITE_OK ); /* Fall through to the next case, OP_String */ } - + /* Opcode: String P1 P2 P3 P4 P5 ** Synopsis: r[P2]='P4' (len=P1) ** @@ -1344,8 +1344,8 @@ case OP_ResultRow: { goto abort_due_to_error; } - /* If the SQLITE_CountRows flag is set in sqlite3.flags mask, then - ** DML statements invoke this opcode to return the number of rows + /* If the SQLITE_CountRows flag is set in sqlite3.flags mask, then + ** DML statements invoke this opcode to return the number of rows ** modified to the user. This is the only way that a VM that ** opens a statement transaction may invoke this opcode. ** @@ -1466,15 +1466,15 @@ case OP_Concat: { /* same as TK_CONCAT, in1, in2, out3 */ ** Synopsis: r[P3]=r[P2]/r[P1] ** ** Divide the value in register P1 by the value in register P2 -** and store the result in register P3 (P3=P2/P1). If the value in -** register P1 is zero, then the result is NULL. If either input is +** and store the result in register P3 (P3=P2/P1). If the value in +** register P1 is zero, then the result is NULL. If either input is ** NULL, the result is NULL. */ /* Opcode: Remainder P1 P2 P3 * * ** Synopsis: r[P3]=r[P2]%r[P1] ** -** Compute the remainder after integer register P2 is divided by -** register P1 and store the result in register P3. +** Compute the remainder after integer register P2 is divided by +** register P1 and store the result in register P3. ** If the value in register P1 is zero the result is NULL. ** If either operand is NULL, the result is NULL. */ @@ -1598,7 +1598,7 @@ case OP_CollSeq: { ** successors. The result of the function is stored in register P3. ** Register P3 must not be one of the function inputs. ** -** P1 is a 32-bit bitmask indicating whether or not each argument to the +** P1 is a 32-bit bitmask indicating whether or not each argument to the ** function was determined to be constant at compile time. If the first ** argument was constant then bit 0 of P1 is set. This is used to determine ** whether meta data associated with a user function argument using the @@ -1615,7 +1615,7 @@ case OP_CollSeq: { ** from register P2 and successors. The result of the function is stored ** in register P3. Register P3 must not be one of the function inputs. ** -** P1 is a 32-bit bitmask indicating whether or not each argument to the +** P1 is a 32-bit bitmask indicating whether or not each argument to the ** function was determined to be constant at compile time. If the first ** argument was constant then bit 0 of P1 is set. This is used to determine ** whether meta data associated with a user function argument using the @@ -1785,7 +1785,7 @@ case OP_ShiftRight: { /* same as TK_RSHIFT, in1, in2, out3 */ /* Opcode: AddImm P1 P2 * * * ** Synopsis: r[P1]=r[P1]+P2 -** +** ** Add the constant P2 to the value in register P1. ** The result is always an integer. ** @@ -1800,7 +1800,7 @@ case OP_AddImm: { /* in1 */ } /* Opcode: MustBeInt P1 P2 * * * -** +** ** Force the value in register P1 to be an integer. If the value ** in P1 is not an integer and cannot be converted into an integer ** without data loss, then jump immediately to P2, or if P2==0 @@ -1848,7 +1848,7 @@ case OP_RealAffinity: { /* in1 */ ** Synopsis: affinity(r[P1]) ** ** Force the value in register P1 to be the type defined by P2. -** +** **
        **
      • TEXT **
      • BLOB @@ -1884,14 +1884,14 @@ case OP_Cast: { /* in1 */ ** store the result of comparison in register P2. ** ** The SQLITE_AFF_MASK portion of P5 must be an affinity character - -** SQLITE_AFF_TEXT, SQLITE_AFF_INTEGER, and so forth. An attempt is made +** SQLITE_AFF_TEXT, SQLITE_AFF_INTEGER, and so forth. An attempt is made ** to coerce both inputs according to this affinity before the ** comparison is made. If the SQLITE_AFF_MASK is 0x00, then numeric ** affinity is used. Note that the affinity conversions are stored ** back into the input registers P1 and P3. So this opcode can cause ** persistent changes to registers P1 and P3. ** -** Once any conversions have taken place, and neither value is NULL, +** Once any conversions have taken place, and neither value is NULL, ** the values are compared. If both values are blobs then memcmp() is ** used to determine the results of the comparison. If both values ** are text, then the appropriate collating function specified in @@ -1930,18 +1930,18 @@ case OP_Cast: { /* in1 */ ** the result of comparison (0 or 1 or NULL) into register P2. ** ** If the SQLITE_JUMPIFNULL bit of P5 is set and either reg(P1) or -** reg(P3) is NULL then the take the jump. If the SQLITE_JUMPIFNULL +** reg(P3) is NULL then the take the jump. If the SQLITE_JUMPIFNULL ** bit is clear then fall through if either operand is NULL. ** ** The SQLITE_AFF_MASK portion of P5 must be an affinity character - -** SQLITE_AFF_TEXT, SQLITE_AFF_INTEGER, and so forth. An attempt is made +** SQLITE_AFF_TEXT, SQLITE_AFF_INTEGER, and so forth. An attempt is made ** to coerce both inputs according to this affinity before the ** comparison is made. If the SQLITE_AFF_MASK is 0x00, then numeric ** affinity is used. Note that the affinity conversions are stored ** back into the input registers P1 and P3. So this opcode can cause ** persistent changes to registers P1 and P3. ** -** Once any conversions have taken place, and neither value is NULL, +** Once any conversions have taken place, and neither value is NULL, ** the values are compared. If both values are blobs then memcmp() is ** used to determine the results of the comparison. If both values ** are text, then the appropriate collating function specified in @@ -2118,7 +2118,7 @@ compare_op: ** ** This opcode must immediately follow an OP_Lt or OP_Gt comparison operator. ** If result of an OP_Eq comparison on the same two operands -** would have be NULL or false (0), then then jump to P2. +** would have be NULL or false (0), then then jump to P2. ** If the result of an OP_Eq comparison on the two previous operands ** would have been true (1), then fall through. */ @@ -2138,7 +2138,7 @@ case OP_ElseNotEq: { /* same as TK_ESCAPE, jump */ ** instruction. The permutation is stored in the P4 operand. ** ** The permutation is only valid until the next OP_Compare that has -** the OPFLAG_PERMUTE bit set in P5. Typically the OP_Permutation should +** the OPFLAG_PERMUTE bit set in P5. Typically the OP_Permutation should ** occur immediately prior to the OP_Compare. ** ** The first integer in the P4 integer array is the length of the array @@ -2302,7 +2302,7 @@ case OP_Or: { /* same as TK_OR, in1, in2, out3 */ ** Synopsis: r[P2]= !r[P1] ** ** Interpret the value in register P1 as a boolean value. Store the -** boolean complement in register P2. If the value in register P1 is +** boolean complement in register P2. If the value in register P1 is ** NULL, then a NULL is stored in P2. */ case OP_Not: { /* same as TK_NOT, in1, out2 */ @@ -2402,7 +2402,7 @@ case OP_IsNull: { /* same as TK_ISNULL, jump, in1 */ /* Opcode: NotNull P1 P2 * * * ** Synopsis: if r[P1]!=NULL goto P2 ** -** Jump to P2 if the value in register P1 is not NULL. +** Jump to P2 if the value in register P1 is not NULL. */ case OP_NotNull: { /* same as TK_NOTNULL, jump, in1 */ pIn1 = &aMem[pOp->p1]; @@ -2419,7 +2419,7 @@ case OP_NotNull: { /* same as TK_NOTNULL, jump, in1 */ ** Interpret the data that cursor P1 points to as a structure built using ** the MakeRecord instruction. (See the MakeRecord opcode for additional ** information about the format of the data.) Extract the P2-th column -** from this record. If there are less that (P2+1) +** from this record. If there are less that (P2+1) ** values in the record, extract a NULL. ** ** The value extracted is stored in register P3. @@ -2546,7 +2546,7 @@ case OP_Column: { */ if( pC->nHdrParsed<=p2 ){ /* If there is more header available for parsing in the record, try - ** to extract additional fields up through the p2+1-th field + ** to extract additional fields up through the p2+1-th field */ if( pC->iHdrOffsetaRow; } - + /* Fill in pC->aType[i] and aOffset[i] values through the p2-th field. */ op_column_read_header: i = pC->nHdrParsed; @@ -2742,13 +2742,13 @@ case OP_MakeRecord: { ** like this: ** ** ------------------------------------------------------------------------ - ** | hdr-size | type 0 | type 1 | ... | type N-1 | data0 | ... | data N-1 | + ** | hdr-size | type 0 | type 1 | ... | type N-1 | data0 | ... | data N-1 | ** ------------------------------------------------------------------------ ** ** Data(0) is taken from register P1. Data(1) comes from register P1+1 ** and so forth. ** - ** Each type field is a varint representing the serial type of the + ** Each type field is a varint representing the serial type of the ** corresponding data element (see sqlite3VdbeSerialType()). The ** hdr-size field is also a varint which is the offset from the beginning ** of the record to data0. @@ -2837,7 +2837,7 @@ case OP_MakeRecord: { goto too_big; } - /* Make sure the output register has a buffer large enough to store + /* Make sure the output register has a buffer large enough to store ** the new record. The output register (pOp->p3) is not allowed to ** be one of the input registers (because the following call to ** sqlite3VdbeMemClearAndResize() could clobber the value before it is used). @@ -2880,7 +2880,7 @@ case OP_MakeRecord: { /* Opcode: Count P1 P2 * * * ** Synopsis: r[P2]=count() ** -** Store the number of entries (an integer value) in the table or index +** Store the number of entries (an integer value) in the table or index ** opened by cursor P1 in register P2 */ #ifndef SQLITE_OMIT_BTREECOUNT @@ -2920,7 +2920,7 @@ case OP_Savepoint: { zName = pOp->p4.z; /* Assert that the p1 parameter is valid. Also that if there is no open - ** transaction, then there cannot be any savepoints. + ** transaction, then there cannot be any savepoints. */ assert( db->pSavepoint==0 || db->autoCommit==0 ); assert( p1==SAVEPOINT_BEGIN||p1==SAVEPOINT_RELEASE||p1==SAVEPOINT_ROLLBACK ); @@ -2930,7 +2930,7 @@ case OP_Savepoint: { if( p1==SAVEPOINT_BEGIN ){ if( db->nVdbeWrite>0 ){ - /* A new savepoint cannot be created if there are active write + /* A new savepoint cannot be created if there are active write ** statements (i.e. open read/write incremental blob handles). */ sqlite3VdbeError(p, "cannot open savepoint - SQL statements in progress"); @@ -2954,7 +2954,7 @@ case OP_Savepoint: { if( pNew ){ pNew->zName = (char *)&pNew[1]; memcpy(pNew->zName, zName, nName+1); - + /* If there is no open transaction, then mark this as a special ** "transaction savepoint". */ if( db->autoCommit ){ @@ -2977,7 +2977,7 @@ case OP_Savepoint: { /* Find the named savepoint. If there is no such savepoint, then an ** an error is returned to the user. */ for( - pSavepoint = db->pSavepoint; + pSavepoint = db->pSavepoint; pSavepoint && sqlite3StrICmp(pSavepoint->zName, zName); pSavepoint = pSavepoint->pNext ){ @@ -2987,7 +2987,7 @@ case OP_Savepoint: { sqlite3VdbeError(p, "no such savepoint: %s", zName); rc = SQLITE_ERROR; }else if( db->nVdbeWrite>0 && p1==SAVEPOINT_RELEASE ){ - /* It is not possible to release (commit) a savepoint if there are + /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ sqlite3VdbeError(p, "cannot release savepoint - " @@ -2996,8 +2996,8 @@ case OP_Savepoint: { }else{ /* Determine whether or not this is a transaction savepoint. If so, - ** and this is a RELEASE command, then the current transaction - ** is committed. + ** and this is a RELEASE command, then the current transaction + ** is committed. */ int isTransaction = pSavepoint->pNext==0 && db->isTransactionSavepoint; if( isTransaction && p1==SAVEPOINT_RELEASE ){ @@ -3039,8 +3039,8 @@ case OP_Savepoint: { db->flags = (db->flags | SQLITE_InternChanges); } } - - /* Regardless of whether this is a RELEASE or ROLLBACK, destroy all + + /* Regardless of whether this is a RELEASE or ROLLBACK, destroy all ** savepoints nested inside of the savepoint being operated on. */ while( db->pSavepoint!=pSavepoint ){ pTmp = db->pSavepoint; @@ -3049,8 +3049,8 @@ case OP_Savepoint: { db->nSavepoint--; } - /* If it is a RELEASE, then destroy the savepoint being operated on - ** too. If it is a ROLLBACK TO, then set the number of deferred + /* If it is a RELEASE, then destroy the savepoint being operated on + ** too. If it is a ROLLBACK TO, then set the number of deferred ** constraint violations present in the database to the value stored ** when the savepoint was created. */ if( p1==SAVEPOINT_RELEASE ){ @@ -3103,7 +3103,7 @@ case OP_AutoCommit: { db->autoCommit = 1; }else if( desiredAutoCommit && db->nVdbeWrite>0 ){ /* If this instruction implements a COMMIT and other VMs are writing - ** return an error indicating that the other VMs must complete first. + ** return an error indicating that the other VMs must complete first. */ sqlite3VdbeError(p, "cannot commit transaction - " "SQL statements in progress"); @@ -3133,7 +3133,7 @@ case OP_AutoCommit: { (!desiredAutoCommit)?"cannot start a transaction within a transaction":( (iRollback)?"cannot rollback - no transaction is active": "cannot commit - no transaction is active")); - + rc = SQLITE_ERROR; goto abort_due_to_error; } @@ -3144,7 +3144,7 @@ case OP_AutoCommit: { ** ** Begin a transaction on database P1 if a transaction is not already ** active. -** If P2 is non-zero, then a write-transaction is started, or if a +** If P2 is non-zero, then a write-transaction is started, or if a ** read-transaction is already active, it is upgraded to a write-transaction. ** If P2 is zero, then a read-transaction is started. ** @@ -3202,13 +3202,13 @@ case OP_Transaction: { goto abort_due_to_error; } - if( pOp->p2 && p->usesStmtJournal - && (db->autoCommit==0 || db->nVdbeRead>1) + if( pOp->p2 && p->usesStmtJournal + && (db->autoCommit==0 || db->nVdbeRead>1) ){ assert( sqlite3BtreeIsInTrans(pBt) ); if( p->iStatement==0 ){ assert( db->nStatement>=0 && db->nSavepoint>=0 ); - db->nStatement++; + db->nStatement++; p->iStatement = db->nSavepoint + db->nStatement; } @@ -3238,7 +3238,7 @@ case OP_Transaction: { if( pOp->p5 && (iMeta!=pOp->p3 || iGen!=pOp->p4.i) ){ sqlite3DbFree(db, p->zErrMsg); p->zErrMsg = sqlite3DbStrDup(db, "database schema has changed"); - /* If the schema-cookie from the database file matches the cookie + /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. ** @@ -3248,7 +3248,7 @@ case OP_Transaction: { ** prepared queries. If such a query is out-of-date, we do not want to ** discard the database schema, as the user code implementing the ** v-table would have to be ready for the sqlite3_vtab structure itself - ** to be invalidated whenever sqlite3_step() is called from within + ** to be invalidated whenever sqlite3_step() is called from within ** a v-table method. */ if( db->aDb[pOp->p1].pSchema->schema_cookie!=iMeta ){ @@ -3296,8 +3296,8 @@ case OP_ReadCookie: { /* out2 */ ** ** Write the integer value P3 into cookie number P2 of database P1. ** P2==1 is the schema version. P2==2 is the database format. -** P2==3 is the recommended pager cache -** size, and so forth. P1==0 is the main database file and P1==1 is the +** P2==3 is the recommended pager cache +** size, and so forth. P1==0 is the main database file and P1==1 is the ** database file used to store temporary tables. ** ** A transaction must be started before executing this opcode. @@ -3335,8 +3335,8 @@ case OP_SetCookie: { ** Synopsis: root=P2 iDb=P3 ** ** Open a read-only cursor for the database table whose root page is -** P2 in a database file. The database file is determined by P3. -** P3==0 means the main database, P3==1 means the database used for +** P2 in a database file. The database file is determined by P3. +** P3==0 means the main database, P3==1 means the database used for ** temporary tables, and P3>1 means used the corresponding attached ** database. Give the new cursor an identifier of P1. The P1 ** values need not be contiguous but all P1 values should be small integers. @@ -3355,9 +3355,9 @@ case OP_SetCookie: { ** SQLITE_BUSY error code. ** ** The P4 value may be either an integer (P4_INT32) or a pointer to -** a KeyInfo structure (P4_KEYINFO). If it is a pointer to a KeyInfo -** structure, then said structure defines the content and collating -** sequence of the index being opened. Otherwise, if P4 is an integer +** a KeyInfo structure (P4_KEYINFO). If it is a pointer to a KeyInfo +** structure, then said structure defines the content and collating +** sequence of the index being opened. Otherwise, if P4 is an integer ** value, it is set to the number of columns in the table. ** ** See also: OpenWrite, ReopenIdx @@ -3384,9 +3384,9 @@ case OP_SetCookie: { ** root page. ** ** The P4 value may be either an integer (P4_INT32) or a pointer to -** a KeyInfo structure (P4_KEYINFO). If it is a pointer to a KeyInfo -** structure, then said structure defines the content and collating -** sequence of the index being opened. Otherwise, if P4 is an integer +** a KeyInfo structure (P4_KEYINFO). If it is a pointer to a KeyInfo +** structure, then said structure defines the content and collating +** sequence of the index being opened. Otherwise, if P4 is an integer ** value, it is set to the number of columns in the table, or to the ** largest index of any column of the table that is actually used. ** @@ -3485,7 +3485,7 @@ case OP_OpenWrite: /* Set the VdbeCursor.isTable variable. Previous versions of ** SQLite used to check if the root-page flags were sane at this point ** and report database corruption if they were not, but this check has - ** since moved into the btree layer. */ + ** since moved into the btree layer. */ pCur->isTable = pOp->p4type!=P4_KEYINFO; open_cursor_set_hints: @@ -3505,7 +3505,7 @@ open_cursor_set_hints: ** Synopsis: nColumn=P2 ** ** Open a new cursor P1 to a transient table. -** The cursor is always opened read/write even if +** The cursor is always opened read/write even if ** the main database is read-only. The ephemeral ** table is deleted automatically when the cursor is closed. ** @@ -3527,12 +3527,12 @@ open_cursor_set_hints: ** by this opcode will be used for automatically created transient ** indices in joins. */ -case OP_OpenAutoindex: +case OP_OpenAutoindex: case OP_OpenEphemeral: { VdbeCursor *pCx; KeyInfo *pKeyInfo; - static const int vfsFlags = + static const int vfsFlags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | @@ -3544,7 +3544,7 @@ case OP_OpenEphemeral: { if( pCx==0 ) goto no_mem; pCx->nullRow = 1; pCx->isEphemeral = 1; - rc = sqlite3BtreeOpen(db->pVfs, 0, db, &pCx->pBtx, + rc = sqlite3BtreeOpen(db->pVfs, 0, db, &pCx->pBtx, BTREE_OMIT_JOURNAL | BTREE_SINGLE | pOp->p5, vfsFlags); if( rc==SQLITE_OK ){ rc = sqlite3BtreeBeginTrans(pCx->pBtx, 1); @@ -3558,7 +3558,7 @@ case OP_OpenEphemeral: { if( (pCx->pKeyInfo = pKeyInfo = pOp->p4.pKeyInfo)!=0 ){ int pgno; assert( pOp->p4type==P4_KEYINFO ); - rc = sqlite3BtreeCreateTable(pCx->pBtx, &pgno, BTREE_BLOBKEY | pOp->p5); + rc = sqlite3BtreeCreateTable(pCx->pBtx, &pgno, BTREE_BLOBKEY | pOp->p5); if( rc==SQLITE_OK ){ assert( pgno==MASTER_ROOT+1 ); assert( pKeyInfo->db==db ); @@ -3626,7 +3626,7 @@ case OP_SequenceTest: { ** ** Open a new cursor that points to a fake table that contains a single ** row of data. The content of that one row is the content of memory -** register P2. In other words, cursor P1 becomes an alias for the +** register P2. In other words, cursor P1 becomes an alias for the ** MEM_Blob content contained in register P2. ** ** A pseudo-table created by this opcode is used to hold a single @@ -3686,13 +3686,13 @@ case OP_ColumnsUsed: { /* Opcode: SeekGE P1 P2 P3 P4 * ** Synopsis: key=r[P3@P4] ** -** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), -** use the value in register P3 as the key. If cursor P1 refers -** to an SQL index, then P3 is the first in an array of P4 registers -** that are used as an unpacked index key. +** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), +** use the value in register P3 as the key. If cursor P1 refers +** to an SQL index, then P3 is the first in an array of P4 registers +** that are used as an unpacked index key. ** -** Reposition cursor P1 so that it points to the smallest entry that -** is greater than or equal to the key value. If there are no records +** Reposition cursor P1 so that it points to the smallest entry that +** is greater than or equal to the key value. If there are no records ** greater than or equal to the key and P2 is not zero, then jump to P2. ** ** If the cursor P1 was opened using the OPFLAG_SEEKEQ flag, then this @@ -3711,13 +3711,13 @@ case OP_ColumnsUsed: { /* Opcode: SeekGT P1 P2 P3 P4 * ** Synopsis: key=r[P3@P4] ** -** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), -** use the value in register P3 as a key. If cursor P1 refers -** to an SQL index, then P3 is the first in an array of P4 registers -** that are used as an unpacked index key. +** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), +** use the value in register P3 as a key. If cursor P1 refers +** to an SQL index, then P3 is the first in an array of P4 registers +** that are used as an unpacked index key. ** -** Reposition cursor P1 so that it points to the smallest entry that -** is greater than the key value. If there are no records greater than +** Reposition cursor P1 so that it points to the smallest entry that +** is greater than the key value. If there are no records greater than ** the key and P2 is not zero, then jump to P2. ** ** This opcode leaves the cursor configured to move in forward order, @@ -3726,16 +3726,16 @@ case OP_ColumnsUsed: { ** ** See also: Found, NotFound, SeekLt, SeekGe, SeekLe */ -/* Opcode: SeekLT P1 P2 P3 P4 * +/* Opcode: SeekLT P1 P2 P3 P4 * ** Synopsis: key=r[P3@P4] ** -** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), -** use the value in register P3 as a key. If cursor P1 refers -** to an SQL index, then P3 is the first in an array of P4 registers -** that are used as an unpacked index key. +** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), +** use the value in register P3 as a key. If cursor P1 refers +** to an SQL index, then P3 is the first in an array of P4 registers +** that are used as an unpacked index key. ** -** Reposition cursor P1 so that it points to the largest entry that -** is less than the key value. If there are no records less than +** Reposition cursor P1 so that it points to the largest entry that +** is less than the key value. If there are no records less than ** the key and P2 is not zero, then jump to P2. ** ** This opcode leaves the cursor configured to move in reverse order, @@ -3747,13 +3747,13 @@ case OP_ColumnsUsed: { /* Opcode: SeekLE P1 P2 P3 P4 * ** Synopsis: key=r[P3@P4] ** -** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), -** use the value in register P3 as a key. If cursor P1 refers -** to an SQL index, then P3 is the first in an array of P4 registers -** that are used as an unpacked index key. +** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), +** use the value in register P3 as a key. If cursor P1 refers +** to an SQL index, then P3 is the first in an array of P4 registers +** that are used as an unpacked index key. ** -** Reposition cursor P1 so that it points to the largest entry that -** is less than or equal to the key value. If there are no records +** Reposition cursor P1 so that it points to the largest entry that +** is less than or equal to the key value. If there are no records ** less than or equal to the key and P2 is not zero, then jump to P2. ** ** This opcode leaves the cursor configured to move in reverse order, @@ -3844,7 +3844,7 @@ case OP_SeekGT: { /* jump, in3 */ assert( (OP_SeekLT & 0x0001)==(OP_SeekGE & 0x0001) ); if( (oc & 0x0001)==(OP_SeekLT & 0x0001) ) oc++; } - } + } rc = sqlite3BtreeMovetoUnpacked(pC->uc.pCursor, 0, (u64)iKey, 0, &res); pC->movetoTarget = iKey; /* Used by OP_Delete */ if( rc!=SQLITE_OK ){ @@ -3959,9 +3959,9 @@ seek_not_found: ** If P4==0 then register P3 holds a blob constructed by MakeRecord. If ** P4>0 then register P3 is the first of P4 registers that form an unpacked ** record. -** +** ** Cursor P1 is on an index btree. If the record identified by P3 and P4 -** is not the prefix of any entry in P1 then a jump is made to P2. If P1 +** is not the prefix of any entry in P1 then a jump is made to P2. If P1 ** does contain an entry whose prefix matches the P3/P4 record then control ** falls through to the next instruction and P1 is left pointing at the ** matching entry. @@ -3978,7 +3978,7 @@ seek_not_found: ** If P4==0 then register P3 holds a blob constructed by MakeRecord. If ** P4>0 then register P3 is the first of P4 registers that form an unpacked ** record. -** +** ** Cursor P1 is on an index btree. If the record identified by P3 and P4 ** contains any NULL value, jump immediately to P2. If all terms of the ** record are not-NULL then a check is done to determine if any row in the @@ -4080,9 +4080,9 @@ case OP_Found: { /* jump, in3 */ ** ** P1 is the index of a cursor open on an SQL table btree (with integer ** keys). If register P3 does not contain an integer or if P1 does not -** contain a record with rowid P3 then jump immediately to P2. +** contain a record with rowid P3 then jump immediately to P2. ** Or, if P2 is 0, raise an SQLITE_CORRUPT error. If P1 does contain -** a record with rowid P3 then +** a record with rowid P3 then ** leave the cursor pointing at that record and fall through to the next ** instruction. ** @@ -4105,7 +4105,7 @@ case OP_Found: { /* jump, in3 */ ** P1 is the index of a cursor open on an SQL table btree (with integer ** keys). P3 is an integer rowid. If P1 does not contain a record with ** rowid P3 then jump immediately to P2. Or, if P2 is 0, raise an -** SQLITE_CORRUPT error. If P1 does contain a record with rowid P3 then +** SQLITE_CORRUPT error. If P1 does contain a record with rowid P3 then ** leave the cursor pointing at that record and fall through to the next ** instruction. ** @@ -4175,7 +4175,7 @@ case OP_NotExists: /* jump, in3 */ ** Find the next available sequence number for cursor P1. ** Write the sequence number into register P2. ** The sequence number on the cursor is incremented after this -** instruction. +** instruction. */ case OP_Sequence: { /* out2 */ assert( pOp->p1>=0 && pOp->p1nCursor ); @@ -4195,9 +4195,9 @@ case OP_Sequence: { /* out2 */ ** table that cursor P1 points to. The new record number is written ** written to register P2. ** -** If P3>0 then P3 is a register in the root frame of this VDBE that holds +** If P3>0 then P3 is a register in the root frame of this VDBE that holds ** the largest previously generated record number. No new record numbers are -** allowed to be less than this value. When this value reaches its maximum, +** allowed to be less than this value. When this value reaches its maximum, ** an SQLITE_FULL error is generated. The P3 register is updated with the ' ** generated record number. This P3 mechanism is used to help implement the ** AUTOINCREMENT feature. @@ -4345,8 +4345,8 @@ case OP_NewRowid: { /* out2 */ ** is part of an INSERT operation. The difference is only important to ** the update hook. ** -** Parameter P4 may point to a Table structure, or may be NULL. If it is -** not NULL, then the update-hook (sqlite3.xUpdateCallback) is invoked +** Parameter P4 may point to a Table structure, or may be NULL. If it is +** not NULL, then the update-hook (sqlite3.xUpdateCallback) is invoked ** following a successful insert. ** ** (WARNING/TODO: If P1 is a pseudo-cursor and P2 is dynamically @@ -4364,7 +4364,7 @@ case OP_NewRowid: { /* out2 */ ** This works exactly like OP_Insert except that the key is the ** integer value P3, not the value of the integer stored in register P3. */ -case OP_Insert: +case OP_Insert: case OP_InsertInt: { Mem *pData; /* MEM cell holding data for the record to be inserted */ Mem *pKey; /* MEM cell holding key for the record */ @@ -4411,7 +4411,7 @@ case OP_InsertInt: { #ifdef SQLITE_ENABLE_PREUPDATE_HOOK /* Invoke the pre-update hook, if any */ - if( db->xPreUpdateCallback + if( db->xPreUpdateCallback && pOp->p4type==P4_TABLE && !(pOp->p5 & OPFLAG_ISUPDATE) ){ @@ -4459,7 +4459,7 @@ case OP_InsertInt: { ** the cursor will be left pointing at either the next or the previous ** record in the table. If it is left pointing at the next record, then ** the next Next instruction will be a no-op. As a result, in this case -** it is ok to delete a record from within a Next loop. If +** it is ok to delete a record from within a Next loop. If ** OPFLAG_SAVEPOSITION bit of P5 is clear, then the cursor will be ** left in an undefined state. ** @@ -4475,11 +4475,11 @@ case OP_InsertInt: { ** P1 must not be pseudo-table. It has to be a real table with ** multiple rows. ** -** If P4 is not NULL then it points to a Table object. In this case either +** If P4 is not NULL then it points to a Table object. In this case either ** the update or pre-update hook, or both, may be invoked. The P1 cursor must -** have been positioned using OP_NotFound prior to invoking this opcode in -** this case. Specifically, if one is configured, the pre-update hook is -** invoked if P4 is not NULL. The update-hook is invoked if one is configured, +** have been positioned using OP_NotFound prior to invoking this opcode in +** this case. Specifically, if one is configured, the pre-update hook is +** invoked if P4 is not NULL. The update-hook is invoked if one is configured, ** P4 is not NULL, and the OPFLAG_NCHANGE flag is set in P2. ** ** If the OPFLAG_ISUPDATE flag is set in P2, then P3 contains the address @@ -4513,7 +4513,7 @@ case OP_Delete: { /* If the update-hook or pre-update-hook will be invoked, set zDb to ** the name of the db to pass as to it. Also set local pTab to a copy ** of p4.pTab. Finally, if p5 is true, indicating that this cursor was - ** last moved with OP_Next or OP_Prev, not Seek or NotFound, set + ** last moved with OP_Next or OP_Prev, not Seek or NotFound, set ** VdbeCursor.movetoTarget to the current rowid. */ if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){ assert( pC->iDb>=0 ); @@ -4531,20 +4531,20 @@ case OP_Delete: { #ifdef SQLITE_ENABLE_PREUPDATE_HOOK /* Invoke the pre-update-hook if required. */ if( db->xPreUpdateCallback && pOp->p4.pTab ){ - assert( !(opflags & OPFLAG_ISUPDATE) - || HasRowid(pTab)==0 - || (aMem[pOp->p3].flags & MEM_Int) + assert( !(opflags & OPFLAG_ISUPDATE) + || HasRowid(pTab)==0 + || (aMem[pOp->p3].flags & MEM_Int) ); sqlite3VdbePreUpdateHook(p, pC, - (opflags & OPFLAG_ISUPDATE) ? SQLITE_UPDATE : SQLITE_DELETE, + (opflags & OPFLAG_ISUPDATE) ? SQLITE_UPDATE : SQLITE_DELETE, zDb, pTab, pC->movetoTarget, pOp->p3 ); } if( opflags & OPFLAG_ISNOOP ) break; #endif - - /* Only flags that can be set are SAVEPOISTION and AUXDELETE */ + + /* Only flags that can be set are SAVEPOISTION and AUXDELETE */ assert( (pOp->p5 & ~(OPFLAG_SAVEPOSITION|OPFLAG_AUXDELETE))==0 ); assert( OPFLAG_SAVEPOSITION==BTREE_SAVEPOSITION ); assert( OPFLAG_AUXDELETE==BTREE_AUXDELETE ); @@ -4597,7 +4597,7 @@ case OP_ResetCount: { ** Synopsis: if key(P1)!=trim(r[P3],P4) goto P2 ** ** P1 is a sorter cursor. This instruction compares a prefix of the -** record blob in register P3 against a prefix of the entry that +** record blob in register P3 against a prefix of the entry that ** the sorter cursor currently points to. Only the first P4 fields ** of r[P3] and the sorter record are compared. ** @@ -4655,10 +4655,10 @@ case OP_SorterData: { /* Opcode: RowData P1 P2 P3 * * ** Synopsis: r[P2]=data ** -** Write into register P2 the complete row content for the row at +** Write into register P2 the complete row content for the row at ** which cursor P1 is currently pointing. -** There is no interpretation of the data. -** It is just copied onto the P2 register exactly as +** There is no interpretation of the data. +** It is just copied onto the P2 register exactly as ** it is found in the database file. ** ** If cursor P1 is an index, then the content is the key of the row. @@ -4798,7 +4798,7 @@ case OP_NullRow: { /* Opcode: Last P1 P2 P3 * * ** -** The next use of the Rowid or Column or Prev instruction for P1 +** The next use of the Rowid or Column or Prev instruction for P1 ** will refer to the last entry in the database table or index. ** If the table or index is empty and P2>0, then jump immediately to P2. ** If P2 is 0 or if the table or index is not empty, fall through @@ -4880,10 +4880,10 @@ case OP_Sort: { /* jump */ } /* Opcode: Rewind P1 P2 * * * ** -** The next use of the Rowid or Column or Next instruction for P1 +** The next use of the Rowid or Column or Next instruction for P1 ** will refer to the first entry in the database table or index. ** If the table or index is empty, jump immediately to P2. -** If the table or index is not empty, fall through to the following +** If the table or index is not empty, fall through to the following ** instruction. ** ** This opcode leaves the cursor configured to move in forward order, @@ -5070,7 +5070,7 @@ next_tail: ** run faster by avoiding an unnecessary seek on cursor P1. However, ** the OPFLAG_USESEEKRESULT flag must only be set if there have been no prior ** seeks on the cursor or if the most recent seek used a key equivalent -** to P2. +** to P2. ** ** This instruction only works for indices. The equivalent instruction ** for tables is OP_Insert. @@ -5106,7 +5106,7 @@ case OP_IdxInsert: { /* in2 */ x.aMem = aMem + pOp->p3; x.nMem = (u16)pOp->p4.i; rc = sqlite3BtreeInsert(pC->uc.pCursor, &x, - (pOp->p5 & (OPFLAG_APPEND|OPFLAG_SAVEPOSITION)), + (pOp->p5 & (OPFLAG_APPEND|OPFLAG_SAVEPOSITION)), ((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0) ); assert( pC->deferredMoveto==0 ); @@ -5120,7 +5120,7 @@ case OP_IdxInsert: { /* in2 */ ** Synopsis: key=r[P2@P3] ** ** The content of P3 registers starting at register P2 form -** an unpacked index key. This opcode removes that entry from the +** an unpacked index key. This opcode removes that entry from the ** index opened by cursor P1. */ case OP_IdxDelete: { @@ -5167,8 +5167,8 @@ case OP_IdxDelete: { ** ** P4 may be an array of integers (type P4_INTARRAY) containing ** one entry for each column in the P3 table. If array entry a(i) -** is non-zero, then reading column a(i)-1 from cursor P3 is -** equivalent to performing the deferred seek and then reading column i +** is non-zero, then reading column a(i)-1 from cursor P3 is +** equivalent to performing the deferred seek and then reading column i ** from P1. This information is stored in P3 and used to redirect ** reads against P3 over to P1, thus possibly avoiding the need to ** seek and read cursor P3. @@ -5239,9 +5239,9 @@ case OP_IdxRowid: { /* out2 */ /* Opcode: IdxGE P1 P2 P3 P4 P5 ** Synopsis: key=r[P3@P4] ** -** The P4 register values beginning with P3 form an unpacked index -** key that omits the PRIMARY KEY. Compare this key value against the index -** that P1 is currently pointing to, ignoring the PRIMARY KEY or ROWID +** The P4 register values beginning with P3 form an unpacked index +** key that omits the PRIMARY KEY. Compare this key value against the index +** that P1 is currently pointing to, ignoring the PRIMARY KEY or ROWID ** fields at the end. ** ** If the P1 index entry is greater than or equal to the key value @@ -5250,9 +5250,9 @@ case OP_IdxRowid: { /* out2 */ /* Opcode: IdxGT P1 P2 P3 P4 P5 ** Synopsis: key=r[P3@P4] ** -** The P4 register values beginning with P3 form an unpacked index -** key that omits the PRIMARY KEY. Compare this key value against the index -** that P1 is currently pointing to, ignoring the PRIMARY KEY or ROWID +** The P4 register values beginning with P3 form an unpacked index +** key that omits the PRIMARY KEY. Compare this key value against the index +** that P1 is currently pointing to, ignoring the PRIMARY KEY or ROWID ** fields at the end. ** ** If the P1 index entry is greater than the key value @@ -5261,7 +5261,7 @@ case OP_IdxRowid: { /* out2 */ /* Opcode: IdxLT P1 P2 P3 P4 P5 ** Synopsis: key=r[P3@P4] ** -** The P4 register values beginning with P3 form an unpacked index +** The P4 register values beginning with P3 form an unpacked index ** key that omits the PRIMARY KEY or ROWID. Compare this key value against ** the index that P1 is currently pointing to, ignoring the PRIMARY KEY or ** ROWID on the P1 index. @@ -5272,7 +5272,7 @@ case OP_IdxRowid: { /* out2 */ /* Opcode: IdxLE P1 P2 P3 P4 P5 ** Synopsis: key=r[P3@P4] ** -** The P4 register values beginning with P3 form an unpacked index +** The P4 register values beginning with P3 form an unpacked index ** key that omits the PRIMARY KEY or ROWID. Compare this key value against ** the index that P1 is currently pointing to, ignoring the PRIMARY KEY or ** ROWID on the P1 index. @@ -5339,8 +5339,8 @@ case OP_IdxGE: { /* jump */ ** might be moved into the newly deleted root page in order to keep all ** root pages contiguous at the beginning of the database. The former ** value of the root page that moved - its value before the move occurred - -** is stored in register P2. If no page -** movement was required (because the table being dropped was already +** is stored in register P2. If no page +** movement was required (because the table being dropped was already ** the last one in the database) then a zero is stored in register P2. ** If AUTOVACUUM is disabled then a zero is stored in register P2. ** @@ -5389,8 +5389,8 @@ case OP_Destroy: { /* out2 */ ** that is used to store tables create using CREATE TEMPORARY TABLE. ** ** If the P3 value is non-zero, then the table referred to must be an -** intkey table (an SQL table, not an index). In this case the row change -** count is incremented by the number of rows in the table being cleared. +** intkey table (an SQL table, not an index). In this case the row change +** count is incremented by the number of rows in the table being cleared. ** If P3 is greater than zero, then the value stored in register P3 is ** also incremented by the number of rows in the table being cleared. ** @@ -5398,7 +5398,7 @@ case OP_Destroy: { /* out2 */ */ case OP_Clear: { int nChange; - + nChange = 0; assert( p->readOnly==0 ); assert( DbMaskTest(p->btreeMask, pOp->p2) ); @@ -5427,7 +5427,7 @@ case OP_Clear: { */ case OP_ResetSorter: { VdbeCursor *pC; - + assert( pOp->p1>=0 && pOp->p1nCursor ); pC = p->apCsr[pOp->p1]; assert( pC!=0 ); @@ -5494,7 +5494,7 @@ case OP_CreateTable: { /* out2 */ /* Opcode: ParseSchema P1 * * P4 * ** ** Read and parse all entries from the SQLITE_MASTER table of database P1 -** that match the WHERE clause P4. +** that match the WHERE clause P4. ** ** This opcode invokes the parser to create a new virtual machine, ** then runs the new virtual machine. It is thus a re-entrant opcode. @@ -5506,7 +5506,7 @@ case OP_ParseSchema: { InitData initData; /* Any prepared statement that invokes this opcode will hold mutexes - ** on every btree. This is a prerequisite for invoking + ** on every btree. This is a prerequisite for invoking ** sqlite3InitCallback(). */ #ifdef SQLITE_DEBUG @@ -5546,7 +5546,7 @@ case OP_ParseSchema: { } goto abort_due_to_error; } - break; + break; } #if !defined(SQLITE_OMIT_ANALYZE) @@ -5560,7 +5560,7 @@ case OP_LoadAnalysis: { assert( pOp->p1>=0 && pOp->p1nDb ); rc = sqlite3AnalysisLoad(db, pOp->p1); if( rc ) goto abort_due_to_error; - break; + break; } #endif /* !defined(SQLITE_OMIT_ANALYZE) */ @@ -5568,7 +5568,7 @@ case OP_LoadAnalysis: { ** ** Remove the internal (in-memory) data structures that describe ** the table named P4 in database P1. This is called after a table -** is dropped from disk (using the Destroy opcode) in order to keep +** is dropped from disk (using the Destroy opcode) in order to keep ** the internal representation of the ** schema consistent with what is on disk. */ @@ -5594,7 +5594,7 @@ case OP_DropIndex: { ** ** Remove the internal (in-memory) data structures that describe ** the trigger named P4 in database P1. This is called after a trigger -** is dropped from disk (using the Destroy opcode) in order to keep +** is dropped from disk (using the Destroy opcode) in order to keep ** the internal representation of the ** schema consistent with what is on disk. */ @@ -5613,7 +5613,7 @@ case OP_DropTrigger: { ** ** The register P3 contains the maximum number of allowed errors. ** At most reg(P3) errors will be reported. -** In other words, the analysis stops as soon as reg(P1) errors are +** In other words, the analysis stops as soon as reg(P1) errors are ** seen. Reg(P1) is updated with the number of errors remaining. ** ** The root page numbers of all tables in the database are integers @@ -5691,7 +5691,7 @@ case OP_RowSetRead: { /* jump, in1, out3 */ i64 val; pIn1 = &aMem[pOp->p1]; - if( (pIn1->flags & MEM_RowSet)==0 + if( (pIn1->flags & MEM_RowSet)==0 || sqlite3RowSetNext(pIn1->u.pRowSet, &val)==0 ){ /* The boolean index is empty */ @@ -5765,13 +5765,13 @@ case OP_RowSetTest: { /* jump, in1, in3 */ /* Opcode: Program P1 P2 P3 P4 P5 ** -** Execute the trigger program passed as P4 (type P4_SUBPROGRAM). +** Execute the trigger program passed as P4 (type P4_SUBPROGRAM). ** -** P1 contains the address of the memory cell that contains the first memory -** cell in an array of values used as arguments to the sub-program. P2 -** contains the address to jump to if the sub-program throws an IGNORE -** exception using the RAISE() function. Register P3 contains the address -** of a memory cell in this (the parent) VM that is used to allocate the +** P1 contains the address of the memory cell that contains the first memory +** cell in an array of values used as arguments to the sub-program. P2 +** contains the address to jump to if the sub-program throws an IGNORE +** exception using the RAISE() function. Register P3 contains the address +** of a memory cell in this (the parent) VM that is used to allocate the ** memory required by the sub-vdbe at runtime. ** ** P4 is a pointer to the VM containing the trigger program. @@ -5791,17 +5791,17 @@ case OP_Program: { /* jump */ pProgram = pOp->p4.pProgram; pRt = &aMem[pOp->p3]; assert( pProgram->nOp>0 ); - - /* If the p5 flag is clear, then recursive invocation of triggers is + + /* If the p5 flag is clear, then recursive invocation of triggers is ** disabled for backwards compatibility (p5 is set if this sub-program ** is really a trigger, not a foreign key action, and the flag set ** and cleared by the "PRAGMA recursive_triggers" command is clear). - ** - ** It is recursive invocation of triggers, at the SQL level, that is - ** disabled. In some cases a single trigger may generate more than one - ** SubProgram (if the trigger may be executed with more than one different + ** + ** It is recursive invocation of triggers, at the SQL level, that is + ** disabled. In some cases a single trigger may generate more than one + ** SubProgram (if the trigger may be executed with more than one different ** ON CONFLICT algorithm). SubProgram structures associated with a - ** single trigger all have the same value for the SubProgram.token + ** single trigger all have the same value for the SubProgram.token ** variable. */ if( pOp->p5 ){ t = pProgram->token; @@ -5817,10 +5817,10 @@ case OP_Program: { /* jump */ /* Register pRt is used to store the memory required to save the state ** of the current program, and the memory required at runtime to execute - ** the trigger program. If this trigger has been fired before, then pRt + ** the trigger program. If this trigger has been fired before, then pRt ** is already allocated. Otherwise, it must be initialized. */ if( (pRt->flags&MEM_Frame)==0 ){ - /* SubProgram.nMem is set to the number of memory cells used by the + /* SubProgram.nMem is set to the number of memory cells used by the ** program stored in SubProgram.aOp. As well as these, one memory ** cell is required for each cursor used by the program. Set local ** variable nMem (and later, VdbeFrame.nChildMem) to this value. @@ -5861,7 +5861,7 @@ case OP_Program: { /* jump */ } }else{ pFrame = pRt->u.pFrame; - assert( pProgram->nMem+pProgram->nCsr==pFrame->nChildMem + assert( pProgram->nMem+pProgram->nCsr==pFrame->nChildMem || (pProgram->nCsr==0 && pProgram->nMem+1==pFrame->nChildMem) ); assert( pProgram->nCsr==pFrame->nChildCsr ); assert( (int)(pOp - aOp)==pFrame->pc ); @@ -5893,10 +5893,10 @@ case OP_Program: { /* jump */ /* Opcode: Param P1 P2 * * * ** -** This opcode is only ever present in sub-programs called via the -** OP_Program instruction. Copy a value currently stored in a memory -** cell of the calling (parent) frame to cell P2 in the current frames -** address space. This is used by trigger programs to access the new.* +** This opcode is only ever present in sub-programs called via the +** OP_Program instruction. Copy a value currently stored in a memory +** cell of the calling (parent) frame to cell P2 in the current frames +** address space. This is used by trigger programs to access the new.* ** and old.* values. ** ** The address of the cell in the parent frame is determined by adding @@ -5908,7 +5908,7 @@ case OP_Param: { /* out2 */ Mem *pIn; pOut = out2Prerelease(p, pOp); pFrame = p->pFrame; - pIn = &pFrame->aMem[pOp->p1 + pFrame->aOp[pFrame->pc].p1]; + pIn = &pFrame->aMem[pOp->p1 + pFrame->aOp[pFrame->pc].p1]; sqlite3VdbeMemShallowCopy(pOut, pIn, MEM_Ephem); break; } @@ -5920,8 +5920,8 @@ case OP_Param: { /* out2 */ ** Synopsis: fkctr[P1]+=P2 ** ** Increment a "constraint counter" by P2 (P2 may be negative or positive). -** If P1 is non-zero, the database constraint counter is incremented -** (deferred foreign key constraints). Otherwise, if P1 is zero, the +** If P1 is non-zero, the database constraint counter is incremented +** (deferred foreign key constraints). Otherwise, if P1 is zero, the ** statement counter is incremented (immediate foreign key constraints). */ case OP_FkCounter: { @@ -5939,7 +5939,7 @@ case OP_FkCounter: { ** Synopsis: if fkctr[P1]==0 goto P2 ** ** This opcode tests if a foreign key constraint-counter is currently zero. -** If so, jump to instruction P2. Otherwise, fall through to the next +** If so, jump to instruction P2. Otherwise, fall through to the next ** instruction. ** ** If P1 is non-zero, then the jump is taken if the database constraint-counter @@ -5965,7 +5965,7 @@ case OP_FkIfZero: { /* jump */ ** ** P1 is a register in the root frame of this VM (the root frame is ** different from the current frame if this instruction is being executed -** within a sub-program). Set the value of register P1 to the maximum of +** within a sub-program). Set the value of register P1 to the maximum of ** its current value and the value in register P2. ** ** This instruction throws an error if the memory cell is not initially @@ -6025,7 +6025,7 @@ case OP_IfPos: { /* jump, in1 */ ** and r[P2] is set to be the value of the LIMIT, r[P1]. ** ** if r[P1] is zero or negative, that means there is no LIMIT -** and r[P2] is set to -1. +** and r[P2] is set to -1. ** ** Otherwise, r[P2] is set to the sum of r[P1] and r[P3]. */ @@ -6057,7 +6057,7 @@ case OP_OffsetLimit: { /* in1, out2, in3 */ ** ** Register P1 must contain an integer. If the content of register P1 is ** initially greater than zero, then decrement the value in register P1. -** If it is non-zero (negative or positive) and then also jump to P2. +** If it is non-zero (negative or positive) and then also jump to P2. ** If register P1 is initially zero, leave it unchanged and fall through. */ case OP_IfNotZero: { /* jump, in1 */ @@ -6250,9 +6250,9 @@ case OP_Checkpoint: { } for(i=0, pMem = &aMem[pOp->p3]; i<3; i++, pMem++){ sqlite3VdbeMemSetInt64(pMem, (i64)aRes[i]); - } + } break; -}; +}; #endif #ifndef SQLITE_OMIT_PRAGMA @@ -6278,9 +6278,9 @@ case OP_JournalMode: { /* out2 */ pOut = out2Prerelease(p, pOp); eNew = pOp->p3; - assert( eNew==PAGER_JOURNALMODE_DELETE - || eNew==PAGER_JOURNALMODE_TRUNCATE - || eNew==PAGER_JOURNALMODE_PERSIST + assert( eNew==PAGER_JOURNALMODE_DELETE + || eNew==PAGER_JOURNALMODE_TRUNCATE + || eNew==PAGER_JOURNALMODE_PERSIST || eNew==PAGER_JOURNALMODE_OFF || eNew==PAGER_JOURNALMODE_MEMORY || eNew==PAGER_JOURNALMODE_WAL @@ -6299,7 +6299,7 @@ case OP_JournalMode: { /* out2 */ zFilename = sqlite3PagerFilename(pPager, 1); /* Do not allow a transition to journal_mode=WAL for a database - ** in temporary storage or if the VFS does not support shared memory + ** in temporary storage or if the VFS does not support shared memory */ if( eNew==PAGER_JOURNALMODE_WAL && (sqlite3Strlen30(zFilename)==0 /* Temp file */ @@ -6319,12 +6319,12 @@ case OP_JournalMode: { /* out2 */ ); goto abort_due_to_error; }else{ - + if( eOld==PAGER_JOURNALMODE_WAL ){ /* If leaving WAL mode, close the log file. If successful, the call - ** to PagerCloseWal() checkpoints and deletes the write-ahead-log - ** file. An EXCLUSIVE lock may still be held on the database file - ** after a successful return. + ** to PagerCloseWal() checkpoints and deletes the write-ahead-log + ** file. An EXCLUSIVE lock may still be held on the database file + ** after a successful return. */ rc = sqlite3PagerCloseWal(pPager, db); if( rc==SQLITE_OK ){ @@ -6335,7 +6335,7 @@ case OP_JournalMode: { /* out2 */ ** as an intermediate */ sqlite3PagerSetJournalMode(pPager, PAGER_JOURNALMODE_OFF); } - + /* Open a transaction on the database file. Regardless of the journal ** mode, this transaction always uses a rollback journal. */ @@ -6405,7 +6405,7 @@ case OP_IncrVacuum: { /* jump */ ** is executed using sqlite3_step() it will either automatically ** reprepare itself (if it was originally created using sqlite3_prepare_v2()) ** or it will fail with SQLITE_SCHEMA. -** +** ** If P1 is 0, then all SQL statements become expired. If P1 is non-zero, ** then only the currently executing statement is expired. */ @@ -6423,7 +6423,7 @@ case OP_Expire: { ** Synopsis: iDb=P1 root=P2 write=P3 ** ** Obtain a lock on a particular table. This instruction is only used when -** the shared-cache feature is enabled. +** the shared-cache feature is enabled. ** ** P1 is the index of the database in sqlite3.aDb[] of the database ** on which the lock is acquired. A readlock is obtained if P3==0 or @@ -6437,7 +6437,7 @@ case OP_Expire: { case OP_TableLock: { u8 isWriteLock = (u8)pOp->p3; if( isWriteLock || 0==(db->flags&SQLITE_ReadUncommitted) ){ - int p1 = pOp->p1; + int p1 = pOp->p1; assert( p1>=0 && p1nDb ); assert( DbMaskTest(p->btreeMask, p1) ); assert( isWriteLock==0 || isWriteLock==1 ); @@ -6457,7 +6457,7 @@ case OP_TableLock: { #ifndef SQLITE_OMIT_VIRTUALTABLE /* Opcode: VBegin * * * P4 * ** -** P4 may be a pointer to an sqlite3_vtab structure. If so, call the +** P4 may be a pointer to an sqlite3_vtab structure. If so, call the ** xBegin method for that table. ** ** Also, whether or not P4 is set, check that this is not being called from @@ -6477,7 +6477,7 @@ case OP_VBegin: { #ifndef SQLITE_OMIT_VIRTUALTABLE /* Opcode: VCreate P1 P2 * * * ** -** P2 is a register that holds the name of a virtual table in database +** P2 is a register that holds the name of a virtual table in database ** P1. Call the xCreate method for that table. */ case OP_VCreate: { @@ -6631,7 +6631,7 @@ case OP_VFilter: { /* jump */ ** Synopsis: r[P3]=vcolumn(P2) ** ** Store the value of the P2-th column of -** the row of the virtual-table that the +** the row of the virtual-table that the ** P1 cursor is pointing to into register P3. */ case OP_VColumn: { @@ -6697,7 +6697,7 @@ case OP_VNext: { /* jump */ /* Invoke the xNext() method of the module. There is no way for the ** underlying implementation to return an error if one occurs during - ** xNext(). Instead, if an error occurs, true is returned (indicating that + ** xNext(). Instead, if an error occurs, true is returned (indicating that ** data is available) and the error code returned when xColumn or ** some other method is next invoked on the save virtual table cursor. */ @@ -6751,23 +6751,23 @@ case OP_VRename: { ** ** P4 is a pointer to a virtual table object, an sqlite3_vtab structure. ** This opcode invokes the corresponding xUpdate method. P2 values -** are contiguous memory cells starting at P3 to pass to the xUpdate -** invocation. The value in register (P3+P2-1) corresponds to the +** are contiguous memory cells starting at P3 to pass to the xUpdate +** invocation. The value in register (P3+P2-1) corresponds to the ** p2th element of the argv array passed to xUpdate. ** ** The xUpdate method will do a DELETE or an INSERT or both. ** The argv[0] element (which corresponds to memory cell P3) -** is the rowid of a row to delete. If argv[0] is NULL then no -** deletion occurs. The argv[1] element is the rowid of the new -** row. This can be NULL to have the virtual table select the new -** rowid for itself. The subsequent elements in the array are +** is the rowid of a row to delete. If argv[0] is NULL then no +** deletion occurs. The argv[1] element is the rowid of the new +** row. This can be NULL to have the virtual table select the new +** rowid for itself. The subsequent elements in the array are ** the values of columns in the new row. ** ** If P2==1 then no insert is performed. argv[0] is the rowid of ** a row to delete. ** ** P1 is a boolean flag. If it is set to true and the xUpdate call -** is successful, then the value returned by sqlite3_last_insert_rowid() +** is successful, then the value returned by sqlite3_last_insert_rowid() ** is set to the value of the rowid for the row just inserted. ** ** P5 is the error actions (OE_Replace, OE_Fail, OE_Ignore, etc) to @@ -6782,7 +6782,7 @@ case OP_VUpdate: { Mem **apArg; Mem *pX; - assert( pOp->p2==1 || pOp->p5==OE_Fail || pOp->p5==OE_Rollback + assert( pOp->p2==1 || pOp->p5==OE_Fail || pOp->p5==OE_Rollback || pOp->p5==OE_Abort || pOp->p5==OE_Ignore || pOp->p5==OE_Replace ); assert( p->readOnly==0 ); @@ -7033,7 +7033,7 @@ abort_due_to_error: p->rc = rc; sqlite3SystemError(db, rc); testcase( sqlite3GlobalConfig.xLog!=0 ); - sqlite3_log(rc, "statement aborts at %d: [%s] %s", + sqlite3_log(rc, "statement aborts at %d: [%s] %s", (int)(pOp - aOp), p->zSql, p->zErrMsg); sqlite3VdbeHalt(p); if( rc==SQLITE_IOERR_NOMEM ) sqlite3OomFault(db); @@ -7049,8 +7049,8 @@ vdbe_return: testcase( nVmStep>0 ); p->aCounter[SQLITE_STMTSTATUS_VM_STEP] += (int)nVmStep; sqlite3VdbeLeave(p); - assert( rc!=SQLITE_OK || nExtraDelete==0 - || sqlite3_strlike("DELETE%",p->zSql,0)!=0 + assert( rc!=SQLITE_OK || nExtraDelete==0 + || sqlite3_strlike("DELETE%",p->zSql,0)!=0 ); return rc; diff --git a/third_party/sqlite/src/src/vdbe.h b/third_party/sqlite/src/src/vdbe.h index a35f3be3443be..38cb7b8e202b3 100644 --- a/third_party/sqlite/src/src/vdbe.h +++ b/third_party/sqlite/src/src/vdbe.h @@ -132,7 +132,7 @@ typedef struct VdbeOpList VdbeOpList; #define P5_ConstraintFK 4 /* -** The Vdbe.aColName array contains 5n Mem structures, where n is the +** The Vdbe.aColName array contains 5n Mem structures, where n is the ** number of columns of data returned by the statement. */ #define COLNAME_NAME 0 @@ -152,7 +152,7 @@ typedef struct VdbeOpList VdbeOpList; /* ** The following macro converts a relative address in the p2 field -** of a VdbeOp structure into a negative number so that +** of a VdbeOp structure into a negative number so that ** sqlite3VdbeAddOpList() knows that the address is relative. Calling ** the macro again restores the address. */ diff --git a/third_party/sqlite/src/src/vdbeInt.h b/third_party/sqlite/src/src/vdbeInt.h index 69eab56bc578b..78c6ce4e134e3 100644 --- a/third_party/sqlite/src/src/vdbeInt.h +++ b/third_party/sqlite/src/src/vdbeInt.h @@ -139,7 +139,7 @@ struct VdbeCursor { ** When a sub-program is executed (OP_Program), a structure of this type ** is allocated to store the current value of the program counter, as ** well as the current memory cell array and various other frame specific -** values stored in the Vdbe struct. When the sub-program is finished, +** values stored in the Vdbe struct. When the sub-program is finished, ** these values are copied back to the Vdbe from the VdbeFrame structure, ** restoring the state of the VM to as it was before the sub-program ** began executing. @@ -226,7 +226,7 @@ struct Mem { ** If the MEM_Str flag is set then Mem.z points at a string representation. ** Usually this is encoded in the same unicode encoding as the main ** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real +** set, then the string is nul terminated. The MEM_Int and MEM_Real ** flags may coexist with the MEM_Str flag. */ #define MEM_Null 0x0001 /* Value is NULL */ @@ -280,7 +280,7 @@ struct Mem { #endif /* -** Each auxiliary data pointer stored by a user defined function +** Each auxiliary data pointer stored by a user defined function ** implementation calling sqlite3_set_auxdata() is stored in an instance ** of this structure. All such structures associated with a single VM ** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed @@ -419,7 +419,7 @@ struct Vdbe { #define VDBE_MAGIC_DEAD 0x5606c3c8 /* The VDBE has been deallocated */ /* -** Structure used to store the context required by the +** Structure used to store the context required by the ** sqlite3_preupdate_*() API functions. */ struct PreUpdate { @@ -434,7 +434,7 @@ struct PreUpdate { i64 iKey1; /* First key value passed to hook */ i64 iKey2; /* Second key value passed to hook */ Mem *aNew; /* Array of new.* values */ - Table *pTab; /* Schema object being upated */ + Table *pTab; /* Schema object being upated */ Index *pPk; /* PK index if pTab is WITHOUT ROWID */ }; @@ -512,7 +512,7 @@ int sqlite3VdbeSorterRewind(const VdbeCursor *, int *); int sqlite3VdbeSorterWrite(const VdbeCursor *, Mem *); int sqlite3VdbeSorterCompare(const VdbeCursor *, Mem *, int, int *); -#if !defined(SQLITE_OMIT_SHARED_CACHE) +#if !defined(SQLITE_OMIT_SHARED_CACHE) void sqlite3VdbeEnter(Vdbe*); #else # define sqlite3VdbeEnter(X) diff --git a/third_party/sqlite/src/src/vdbeapi.c b/third_party/sqlite/src/src/vdbeapi.c index c54490c077cd5..889c70f6402e0 100644 --- a/third_party/sqlite/src/src/vdbeapi.c +++ b/third_party/sqlite/src/src/vdbeapi.c @@ -290,7 +290,7 @@ sqlite3_value *sqlite3_value_dup(const sqlite3_value *pOrig){ void sqlite3_value_free(sqlite3_value *pOld){ sqlite3ValueFree(pOld); } - + /**************************** sqlite3_result_ ******************************* ** The following routines are used by user-defined functions to specify @@ -331,9 +331,9 @@ static int invokeValueDestructor( return SQLITE_TOOBIG; } void sqlite3_result_blob( - sqlite3_context *pCtx, - const void *z, - int n, + sqlite3_context *pCtx, + const void *z, + int n, void (*xDel)(void *) ){ assert( n>=0 ); @@ -341,8 +341,8 @@ void sqlite3_result_blob( setResultStrOrError(pCtx, z, n, 0, xDel); } void sqlite3_result_blob64( - sqlite3_context *pCtx, - const void *z, + sqlite3_context *pCtx, + const void *z, sqlite3_uint64 n, void (*xDel)(void *) ){ @@ -397,8 +397,8 @@ void sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){ pOut->flags |= MEM_Subtype; } void sqlite3_result_text( - sqlite3_context *pCtx, - const char *z, + sqlite3_context *pCtx, + const char *z, int n, void (*xDel)(void *) ){ @@ -406,8 +406,8 @@ void sqlite3_result_text( setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel); } void sqlite3_result_text64( - sqlite3_context *pCtx, - const char *z, + sqlite3_context *pCtx, + const char *z, sqlite3_uint64 n, void (*xDel)(void *), unsigned char enc @@ -423,27 +423,27 @@ void sqlite3_result_text64( } #ifndef SQLITE_OMIT_UTF16 void sqlite3_result_text16( - sqlite3_context *pCtx, - const void *z, - int n, + sqlite3_context *pCtx, + const void *z, + int n, void (*xDel)(void *) ){ assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel); } void sqlite3_result_text16be( - sqlite3_context *pCtx, - const void *z, - int n, + sqlite3_context *pCtx, + const void *z, + int n, void (*xDel)(void *) ){ assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel); } void sqlite3_result_text16le( - sqlite3_context *pCtx, - const void *z, - int n, + sqlite3_context *pCtx, + const void *z, + int n, void (*xDel)(void *) ){ assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); @@ -474,7 +474,7 @@ void sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){ if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode; #endif if( pCtx->pOut->flags & MEM_Null ){ - sqlite3VdbeMemSetStr(pCtx->pOut, sqlite3ErrStr(errCode), -1, + sqlite3VdbeMemSetStr(pCtx->pOut, sqlite3ErrStr(errCode), -1, SQLITE_UTF8, SQLITE_STATIC); } } @@ -484,7 +484,7 @@ void sqlite3_result_error_toobig(sqlite3_context *pCtx){ assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); pCtx->isError = SQLITE_TOOBIG; pCtx->fErrorOrAux = 1; - sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1, + sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1, SQLITE_UTF8, SQLITE_STATIC); } @@ -498,7 +498,7 @@ void sqlite3_result_error_nomem(sqlite3_context *pCtx){ } /* -** This function is called after a transaction has been committed. It +** This function is called after a transaction has been committed. It ** invokes callbacks registered with sqlite3_wal_hook() as required. */ static int doWalCallbacks(sqlite3 *db){ @@ -527,7 +527,7 @@ static int doWalCallbacks(sqlite3 *db){ ** statement is completely executed or an error occurs. ** ** This routine implements the bulk of the logic behind the sqlite_step() -** API. The only thing omitted is the automatic recompile if a +** API. The only thing omitted is the automatic recompile if a ** schema change has occurred. That detail is handled by the ** outer sqlite3_step() wrapper procedure. */ @@ -541,15 +541,15 @@ static int sqlite3Step(Vdbe *p){ ** sqlite3_step() after any error or after SQLITE_DONE. But beginning ** with version 3.7.0, we changed this so that sqlite3_reset() would ** be called automatically instead of throwing the SQLITE_MISUSE error. - ** This "automatic-reset" change is not technically an incompatibility, + ** This "automatic-reset" change is not technically an incompatibility, ** since any application that receives an SQLITE_MISUSE is broken by ** definition. ** ** Nevertheless, some published applications that were originally written - ** for version 3.6.23 or earlier do in fact depend on SQLITE_MISUSE + ** for version 3.6.23 or earlier do in fact depend on SQLITE_MISUSE ** returns, and those were broken by the automatic-reset change. As a ** a work-around, the SQLITE_OMIT_AUTORESET compile-time restores the - ** legacy behavior of returning SQLITE_MISUSE for cases where the + ** legacy behavior of returning SQLITE_MISUSE for cases where the ** previous sqlite3_step() returned something other than a SQLITE_LOCKED ** or SQLITE_BUSY error. */ @@ -585,7 +585,7 @@ static int sqlite3Step(Vdbe *p){ db->u1.isInterrupted = 0; } - assert( db->nVdbeWrite>0 || db->autoCommit==0 + assert( db->nVdbeWrite>0 || db->autoCommit==0 || (db->nDeferredCons==0 && db->nDeferredImmCons==0) ); @@ -635,14 +635,14 @@ static int sqlite3Step(Vdbe *p){ p->rc = SQLITE_NOMEM_BKPT; } end_of_step: - /* At this point local variable rc holds the value that should be - ** returned if this statement was compiled using the legacy + /* At this point local variable rc holds the value that should be + ** returned if this statement was compiled using the legacy ** sqlite3_prepare() interface. According to the docs, this can only - ** be one of the values in the first assert() below. Variable p->rc - ** contains the value that would be returned if sqlite3_finalize() + ** be one of the values in the first assert() below. Variable p->rc + ** contains the value that would be returned if sqlite3_finalize() ** were called on statement p. */ - assert( rc==SQLITE_ROW || rc==SQLITE_DONE || rc==SQLITE_ERROR + assert( rc==SQLITE_ROW || rc==SQLITE_DONE || rc==SQLITE_ERROR || (rc&0xff)==SQLITE_BUSY || rc==SQLITE_MISUSE ); assert( (p->rc!=SQLITE_ROW && p->rc!=SQLITE_DONE) || p->rc==p->rcApp ); @@ -650,7 +650,7 @@ end_of_step: /* If this statement was prepared using sqlite3_prepare_v2(), and an ** error has occurred, then return the error code in p->rc to the ** caller. Set the error code in the database handle to the same value. - */ + */ rc = sqlite3VdbeTransferError(p); } return (rc&db->errMask); @@ -684,15 +684,15 @@ int sqlite3_step(sqlite3_stmt *pStmt){ assert( v->expired==0 ); } if( rc2!=SQLITE_OK ){ - /* This case occurs after failing to recompile an sql statement. - ** The error message from the SQL compiler has already been loaded - ** into the database handle. This block copies the error message + /* This case occurs after failing to recompile an sql statement. + ** The error message from the SQL compiler has already been loaded + ** into the database handle. This block copies the error message ** from the database handle into the statement and sets the statement - ** program counter to 0 to ensure that when the statement is + ** program counter to 0 to ensure that when the statement is ** finalized or reset the parser error message is available via ** sqlite3_errmsg() and sqlite3_errcode(). */ - const char *zErr = (const char *)sqlite3_value_text(db->pErr); + const char *zErr = (const char *)sqlite3_value_text(db->pErr); sqlite3DbFree(db, v->zErrMsg); if( !db->mallocFailed ){ v->zErrMsg = sqlite3DbStrDup(db, zErr); @@ -840,9 +840,9 @@ void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ ** deleted by calling the delete function specified when it was set. */ void sqlite3_set_auxdata( - sqlite3_context *pCtx, - int iArg, - void *pAux, + sqlite3_context *pCtx, + int iArg, + void *pAux, void (*xDelete)(void*) ){ AuxData *pAuxData; @@ -886,7 +886,7 @@ failed: #ifndef SQLITE_OMIT_DEPRECATED /* -** Return the number of times the Step function of an aggregate has been +** Return the number of times the Step function of an aggregate has been ** called. ** ** This function is deprecated. Do not use it for new code. It is @@ -931,9 +931,9 @@ static const Mem *columnNullValue(void){ ** these assert()s from failing, when building with SQLITE_DEBUG defined ** using gcc, we force nullMem to be 8-byte aligned using the magical ** __attribute__((aligned(8))) macro. */ - static const Mem nullMem + static const Mem nullMem #if defined(SQLITE_DEBUG) && defined(__GNUC__) - __attribute__((aligned(8))) + __attribute__((aligned(8))) #endif = { /* .u = */ {0}, @@ -979,9 +979,9 @@ static Mem *columnMem(sqlite3_stmt *pStmt, int i){ } /* -** This function is called after invoking an sqlite3_value_XXX function on a +** This function is called after invoking an sqlite3_value_XXX function on a ** column value (i.e. a value returned by evaluating an SQL expression in the -** select list of a SELECT statement) that may cause a malloc() failure. If +** select list of a SELECT statement) that may cause a malloc() failure. If ** malloc() has failed, the threads mallocFailed flag is cleared and the result ** code of statement pStmt set to SQLITE_NOMEM. ** @@ -1020,8 +1020,8 @@ const void *sqlite3_column_blob(sqlite3_stmt *pStmt, int i){ const void *val; val = sqlite3_value_blob( columnMem(pStmt,i) ); /* Even though there is no encoding conversion, value_blob() might - ** need to call malloc() to expand the result of a zeroblob() - ** expression. + ** need to call malloc() to expand the result of a zeroblob() + ** expression. */ columnMallocFailure(pStmt); return val; @@ -1225,11 +1225,11 @@ const void *sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){ /******************************* sqlite3_bind_ *************************** -** +** ** Routines used to attach values to wildcards in a compiled SQL statement. */ /* -** Unbind the value bound to variable i in virtual machine p. This is the +** Unbind the value bound to variable i in virtual machine p. This is the ** the same as binding a NULL value to the column. If the "i" parameter is ** out of range, then SQLITE_RANGE is returned. Othewise SQLITE_OK. ** @@ -1248,7 +1248,7 @@ static int vdbeUnbind(Vdbe *p, int i){ if( p->magic!=VDBE_MAGIC_RUN || p->pc>=0 ){ sqlite3Error(p->db, SQLITE_MISUSE); sqlite3_mutex_leave(p->db->mutex); - sqlite3_log(SQLITE_MISUSE, + sqlite3_log(SQLITE_MISUSE, "bind on a busy prepared statement: [%s]", p->zSql); return SQLITE_MISUSE_BKPT; } @@ -1263,7 +1263,7 @@ static int vdbeUnbind(Vdbe *p, int i){ pVar->flags = MEM_Null; sqlite3Error(p->db, SQLITE_OK); - /* If the bit corresponding to this variable in Vdbe.expmask is set, then + /* If the bit corresponding to this variable in Vdbe.expmask is set, then ** binding a new value to this variable invalidates the current query plan. ** ** IMPLEMENTATION-OF: R-48440-37595 If the specific value bound to host @@ -1318,10 +1318,10 @@ static int bindText( ** Bind a blob value to an SQL statement variable. */ int sqlite3_bind_blob( - sqlite3_stmt *pStmt, - int i, - const void *zData, - int nData, + sqlite3_stmt *pStmt, + int i, + const void *zData, + int nData, void (*xDel)(void*) ){ #ifdef SQLITE_ENABLE_API_ARMOR @@ -1330,10 +1330,10 @@ int sqlite3_bind_blob( return bindText(pStmt, i, zData, nData, xDel, 0); } int sqlite3_bind_blob64( - sqlite3_stmt *pStmt, - int i, - const void *zData, - sqlite3_uint64 nData, + sqlite3_stmt *pStmt, + int i, + const void *zData, + sqlite3_uint64 nData, void (*xDel)(void*) ){ assert( xDel!=SQLITE_DYNAMIC ); @@ -1385,20 +1385,20 @@ int sqlite3_bind_pointer(sqlite3_stmt *pStmt, int i, void *pPtr){ } return rc; } -int sqlite3_bind_text( - sqlite3_stmt *pStmt, - int i, - const char *zData, - int nData, +int sqlite3_bind_text( + sqlite3_stmt *pStmt, + int i, + const char *zData, + int nData, void (*xDel)(void*) ){ return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8); } -int sqlite3_bind_text64( - sqlite3_stmt *pStmt, - int i, - const char *zData, - sqlite3_uint64 nData, +int sqlite3_bind_text64( + sqlite3_stmt *pStmt, + int i, + const char *zData, + sqlite3_uint64 nData, void (*xDel)(void*), unsigned char enc ){ @@ -1412,10 +1412,10 @@ int sqlite3_bind_text64( } #ifndef SQLITE_OMIT_UTF16 int sqlite3_bind_text16( - sqlite3_stmt *pStmt, - int i, - const void *zData, - int nData, + sqlite3_stmt *pStmt, + int i, + const void *zData, + int nData, void (*xDel)(void*) ){ return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE); @@ -1479,7 +1479,7 @@ int sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){ /* ** Return the number of wildcards that can be potentially bound to. -** This routine is added to support DBD::SQLite. +** This routine is added to support DBD::SQLite. */ int sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){ Vdbe *p = (Vdbe*)pStmt; @@ -1664,8 +1664,8 @@ char *sqlite3_expanded_sql(sqlite3_stmt *pStmt){ ** if successful, or a NULL pointer if an OOM error is encountered. */ static UnpackedRecord *vdbeUnpackRecord( - KeyInfo *pKeyInfo, - int nKey, + KeyInfo *pKeyInfo, + int nKey, const void *pKey ){ UnpackedRecord *pRet; /* Return value */ @@ -1755,7 +1755,7 @@ int sqlite3_preupdate_count(sqlite3 *db){ ** only. It returns zero if the change that caused the callback was made ** immediately by a user SQL statement. Or, if the change was made by a ** trigger program, it returns the number of trigger programs currently -** on the stack (1 for a top-level trigger, 2 for a trigger fired by a +** on the stack (1 for a top-level trigger, 2 for a trigger fired by a ** top-level trigger etc.). ** ** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL diff --git a/third_party/sqlite/src/src/vdbeaux.c b/third_party/sqlite/src/src/vdbeaux.c index 68f6a5acc8419..99cf5ac83123e 100644 --- a/third_party/sqlite/src/src/vdbeaux.c +++ b/third_party/sqlite/src/src/vdbeaux.c @@ -10,7 +10,7 @@ ** ************************************************************************* ** This file contains code used for creating, destroying, and populating -** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.) +** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.) */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -88,13 +88,13 @@ void sqlite3VdbeSwap(Vdbe *pA, Vdbe *pB){ } /* -** Resize the Vdbe.aOp array so that it is at least nOp elements larger +** Resize the Vdbe.aOp array so that it is at least nOp elements larger ** than its current size. nOp is guaranteed to be less than or equal ** to 1024/sizeof(Op). ** ** If an out-of-memory error occurs while resizing the array, return -** SQLITE_NOMEM. In this case Vdbe.aOp and Parse.nOpAlloc remain -** unchanged (this is so that any opcodes already allocated can be +** SQLITE_NOMEM. In this case Vdbe.aOp and Parse.nOpAlloc remain +** unchanged (this is so that any opcodes already allocated can be ** correctly deallocated along with the rest of the Vdbe). */ static int growOpArray(Vdbe *v, int nOp){ @@ -102,7 +102,7 @@ static int growOpArray(Vdbe *v, int nOp){ Parse *p = v->pParse; /* The SQLITE_TEST_REALLOC_STRESS compile-time option is designed to force - ** more frequent reallocs and hence provide more opportunities for + ** more frequent reallocs and hence provide more opportunities for ** simulated OOM faults. SQLITE_TEST_REALLOC_STRESS is generally used ** during testing only. With SQLITE_TEST_REALLOC_STRESS grow the op array ** by the minimum* amount required until the size reaches 512. Normal @@ -355,7 +355,7 @@ int sqlite3VdbeMakeLabel(Vdbe *v){ int i = p->nLabel++; assert( v->magic==VDBE_MAGIC_INIT ); if( (i & (i-1))==0 ){ - p->aLabel = sqlite3DbReallocOrFree(p->db, p->aLabel, + p->aLabel = sqlite3DbReallocOrFree(p->db, p->aLabel, (i*2+1)*sizeof(p->aLabel[0])); } if( p->aLabel ){ @@ -398,19 +398,19 @@ void sqlite3VdbeReusable(Vdbe *p){ /* ** The following type and function are used to iterate through all opcodes -** in a Vdbe main program and each of the sub-programs (triggers) it may +** in a Vdbe main program and each of the sub-programs (triggers) it may ** invoke directly or indirectly. It should be used as follows: ** ** Op *pOp; ** VdbeOpIter sIter; ** ** memset(&sIter, 0, sizeof(sIter)); -** sIter.v = v; // v is of type Vdbe* +** sIter.v = v; // v is of type Vdbe* ** while( (pOp = opIterNext(&sIter)) ){ ** // Do something with pOp ** } ** sqlite3DbFree(v->db, sIter.apSub); -** +** */ typedef struct VdbeOpIter VdbeOpIter; struct VdbeOpIter { @@ -443,7 +443,7 @@ static Op *opIterNext(VdbeOpIter *p){ p->iSub++; p->iAddr = 0; } - + if( pRet->p4type==P4_SUBPROGRAM ){ int nByte = (p->nSub+1)*sizeof(SubProgram*); int j; @@ -497,8 +497,8 @@ int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){ while( (pOp = opIterNext(&sIter))!=0 ){ int opcode = pOp->opcode; - if( opcode==OP_Destroy || opcode==OP_VUpdate || opcode==OP_VRename - || ((opcode==OP_Halt || opcode==OP_HaltIfNull) + if( opcode==OP_Destroy || opcode==OP_VUpdate || opcode==OP_VRename + || ((opcode==OP_Halt || opcode==OP_HaltIfNull) && ((pOp->p1&0xff)==SQLITE_CONSTRAINT && pOp->p2==OE_Abort)) ){ hasAbort = 1; @@ -667,12 +667,12 @@ void sqlite3VdbeVerifyNoResultRow(Vdbe *p){ /* ** This function returns a pointer to the array of opcodes associated with ** the Vdbe passed as the first argument. It is the callers responsibility -** to arrange for the returned array to be eventually freed using the +** to arrange for the returned array to be eventually freed using the ** vdbeFreeOpArray() function. ** ** Before returning, *pnOp is set to the number of entries in the returned -** array. Also, *pnMaxArg is set to the larger of its current value and -** the number of entries in the Vdbe.apArg[] array required to execute the +** array. Also, *pnMaxArg is set to the larger of its current value and +** the number of entries in the Vdbe.apArg[] array required to execute the ** returned program. */ VdbeOp *sqlite3VdbeTakeOpArray(Vdbe *p, int *pnOp, int *pnMaxArg){ @@ -746,7 +746,7 @@ VdbeOp *sqlite3VdbeAddOpList( void sqlite3VdbeScanStatus( Vdbe *p, /* VM to add scanstatus() to */ int addrExplain, /* Address of OP_Explain (or 0) */ - int addrLoop, /* Address of loop counter */ + int addrLoop, /* Address of loop counter */ int addrVisit, /* Address of rows visited counter */ LogEst nEst, /* Estimated number of output rows */ const char *zName /* Name of table or index being scanned */ @@ -865,8 +865,8 @@ static void freeP4(sqlite3 *db, int p4type, void *p4){ /* ** Free the space allocated for aOp and any p4 values allocated for the -** opcodes contained within. If aOp is not NULL it is assumed to contain -** nOp entries. +** opcodes contained within. If aOp is not NULL it is assumed to contain +** nOp entries. */ static void vdbeFreeOpArray(sqlite3 *db, Op *aOp, int nOp){ if( aOp ){ @@ -875,7 +875,7 @@ static void vdbeFreeOpArray(sqlite3 *db, Op *aOp, int nOp){ if( pOp->p4type ) freeP4(db, pOp->p4type, pOp->p4.p); #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS sqlite3DbFree(db, pOp->zComment); -#endif +#endif } } sqlite3DbFree(db, aOp); @@ -928,7 +928,7 @@ int sqlite3VdbeDeletePriorOpcode(Vdbe *p, u8 op){ ** the string is made into memory obtained from sqlite3_malloc(). ** A value of n==0 means copy bytes of zP4 up to and including the ** first null byte. If n>0 then copy n+1 bytes of zP4. -** +** ** Other values of n (P4_STATIC, P4_COLLSEQ etc.) indicate that zP4 points ** to a string or structure that is guaranteed to exist for the lifetime of ** the Vdbe. In these cases we can just copy the pointer. @@ -989,7 +989,7 @@ void sqlite3VdbeChangeP4(Vdbe *p, int addr, const char *zP4, int n){ } /* -** Change the P4 operand of the most recently coded instruction +** Change the P4 operand of the most recently coded instruction ** to the value defined by the arguments. This is a high-speed ** version of sqlite3VdbeChangeP4(). ** @@ -1078,7 +1078,7 @@ void sqlite3VdbeSetLineNumber(Vdbe *v, int iLine){ ** routine, then a pointer to a dummy VdbeOp will be returned. That opcode ** is readable but not writable, though it is cast to a writable value. ** The return of a dummy opcode allows the call to continue functioning -** after an OOM fault without having to check to see if the return from +** after an OOM fault without having to check to see if the return from ** this routine is a valid pointer. But because the dummy.opcode is 0, ** dummy will never be written to. This is verified by code inspection and ** by running with Valgrind. @@ -1420,13 +1420,13 @@ void sqlite3VdbeUsesBtree(Vdbe *p, int i){ ** ** If SQLite is not threadsafe but does support shared-cache mode, then ** sqlite3BtreeEnter() is invoked to set the BtShared.db variables -** of all of BtShared structures accessible via the database handle +** of all of BtShared structures accessible via the database handle ** associated with the VM. ** ** If SQLite is not threadsafe and does not support shared-cache mode, this ** function is a no-op. ** -** The p->btreeMask field is a bitmask of all btrees that the prepared +** The p->btreeMask field is a bitmask of all btrees that the prepared ** statement p will ever use. Let N be the number of bits in p->btreeMask ** corresponding to btrees that use shared cache. Then the runtime of ** this routine is N*N. But as N is rarely more than 1, this should not @@ -1492,7 +1492,7 @@ void sqlite3VdbePrintOp(FILE *pOut, int pc, Op *pOp){ /* NB: The sqlite3OpcodeName() function is implemented by code created ** by the mkopcodeh.awk and mkopcodec.awk scripts which extract the ** information from the vdbe.c source text */ - fprintf(pOut, zFormat1, pc, + fprintf(pOut, zFormat1, pc, sqlite3OpcodeName(pOp->opcode), pOp->p1, pOp->p2, pOp->p3, zP4, pOp->p5, zCom ); @@ -1533,15 +1533,15 @@ static void releaseMemArray(Mem *p, int N){ assert( sqlite3VdbeCheckMemInvariants(p) ); /* This block is really an inlined version of sqlite3VdbeMemRelease() - ** that takes advantage of the fact that the memory cell value is + ** that takes advantage of the fact that the memory cell value is ** being set to NULL after releasing any dynamic resources. ** - ** The justification for duplicating code is that according to - ** callgrind, this causes a certain test case to hit the CPU 4.7 - ** percent less (x86 linux, gcc version 4.1.2, -O6) than if + ** The justification for duplicating code is that according to + ** callgrind, this causes a certain test case to hit the CPU 4.7 + ** percent less (x86 linux, gcc version 4.1.2, -O6) than if ** sqlite3MemRelease() were called from here. With -O2, this jumps - ** to 6.6 percent. The test case is inserting 1000 rows into a table - ** with no indexes using a single prepared INSERT statement, bind() + ** to 6.6 percent. The test case is inserting 1000 rows into a table + ** with no indexes using a single prepared INSERT statement, bind() ** and reset(). Inserts are grouped into a transaction. */ testcase( p->flags & MEM_Agg ); @@ -1679,7 +1679,7 @@ int sqlite3VdbeList( pMem->flags = MEM_Int; pMem->u.i = i; /* Program counter */ pMem++; - + pMem->flags = MEM_Static|MEM_Str|MEM_Term; pMem->z = (char*)sqlite3OpcodeName(pOp->opcode); /* Opcode */ assert( pMem->z!=0 ); @@ -1745,7 +1745,7 @@ int sqlite3VdbeList( sqlite3_snprintf(3, pMem->z, "%.2x", pOp->p5); /* P5 */ pMem->enc = SQLITE_UTF8; pMem++; - + #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS if( sqlite3VdbeMemClearAndResize(pMem, 500) ){ assert( p->db->mallocFailed ); @@ -1904,11 +1904,11 @@ void sqlite3VdbeRewind(Vdbe *p){ ** creating the virtual machine. This involves things such ** as allocating registers and initializing the program counter. ** After the VDBE has be prepped, it can be executed by one or more -** calls to sqlite3VdbeExec(). +** calls to sqlite3VdbeExec(). ** ** This function may be called exactly once on each virtual machine. ** After this routine is called the VM has been "packaged" and is ready -** to run. After this routine is called, further calls to +** to run. After this routine is called, further calls to ** sqlite3VdbeAddOp() functions are prohibited. This routine disconnects ** the Vdbe from the Parse object that helped generate it so that the ** the Vdbe becomes an independent entity and the Parse object can be @@ -1940,7 +1940,7 @@ void sqlite3VdbeMakeReady( nMem = pParse->nMem; nCursor = pParse->nTab; nArg = pParse->nMaxArg; - + /* Each cursor uses a memory cell. The first cursor (cursor 0) can ** use aMem[0] which is not otherwise used by the VDBE program. Allocate ** space at the end of aMem[] for cursors 1 and greater. @@ -1968,10 +1968,10 @@ void sqlite3VdbeMakeReady( p->expired = 0; /* Memory for registers, parameters, cursor, etc, is allocated in one or two - ** passes. On the first pass, we try to reuse unused memory at the + ** passes. On the first pass, we try to reuse unused memory at the ** end of the opcode array. If we are unable to satisfy all memory ** requirements by reusing the opcode array tail, then the second - ** pass will fill in the remainder using a fresh memory allocation. + ** pass will fill in the remainder using a fresh memory allocation. ** ** This two-pass approach that reuses as much memory as possible from ** the leftover memory at the end of the opcode array. This can significantly @@ -2013,7 +2013,7 @@ void sqlite3VdbeMakeReady( } /* -** Close a VDBE cursor and release all the resources that cursor +** Close a VDBE cursor and release all the resources that cursor ** happens to hold. */ void sqlite3VdbeFreeCursor(Vdbe *p, VdbeCursor *pCx){ @@ -2095,7 +2095,7 @@ int sqlite3VdbeFrameRestore(VdbeFrame *pFrame){ /* ** Close all cursors. ** -** Also release any dynamic memory held by the VM in the Vdbe.aMem memory +** Also release any dynamic memory held by the VM in the Vdbe.aMem memory ** cell array. This is necessary as the memory cell array may contain ** pointers to VdbeFrame objects, which may in turn contain pointers to ** open cursors. @@ -2131,7 +2131,7 @@ static void Cleanup(Vdbe *p){ sqlite3 *db = p->db; #ifdef SQLITE_DEBUG - /* Execute assert() statements to ensure that the Vdbe.apCsr[] and + /* Execute assert() statements to ensure that the Vdbe.apCsr[] and ** Vdbe.aMem[] arrays have already been cleaned up. */ int i; if( p->apCsr ) for(i=0; inCursor; i++) assert( p->apCsr[i]==0 ); @@ -2212,27 +2212,27 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ int needXcommit = 0; #ifdef SQLITE_OMIT_VIRTUALTABLE - /* With this option, sqlite3VtabSync() is defined to be simply - ** SQLITE_OK so p is not used. + /* With this option, sqlite3VtabSync() is defined to be simply + ** SQLITE_OK so p is not used. */ UNUSED_PARAMETER(p); #endif /* Before doing anything else, call the xSync() callback for any ** virtual module tables written in this transaction. This has to - ** be done before determining whether a master journal file is + ** be done before determining whether a master journal file is ** required, as an xSync() callback may add an attached database ** to the transaction. */ rc = sqlite3VtabSync(db, p); /* This loop determines (a) if the commit hook should be invoked and - ** (b) how many database files have open write transactions, not - ** including the temp database. (b) is important because if more than + ** (b) how many database files have open write transactions, not + ** including the temp database. (b) is important because if more than ** one database file has an open write transaction, a master journal ** file is required for an atomic commit. - */ - for(i=0; rc==SQLITE_OK && inDb; i++){ + */ + for(i=0; rc==SQLITE_OK && inDb; i++){ Btree *pBt = db->aDb[i].pBt; if( sqlite3BtreeIsInTrans(pBt) ){ /* Whether or not a database might need a master journal depends upon @@ -2252,7 +2252,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ pPager = sqlite3BtreePager(pBt); if( db->aDb[i].safety_level!=PAGER_SYNCHRONOUS_OFF && aMJNeeded[sqlite3PagerGetJournalMode(pPager)] - ){ + ){ assert( i!=1 ); nTrans++; } @@ -2277,8 +2277,8 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ ** master-journal. ** ** If the return value of sqlite3BtreeGetFilename() is a zero length - ** string, it means the main database is :memory: or a temp file. In - ** that case we do not support atomic multi-file commits, so use the + ** string, it means the main database is :memory: or a temp file. In + ** that case we do not support atomic multi-file commits, so use the ** simple case then too. */ if( 0==sqlite3Strlen30(sqlite3BtreeGetFilename(db->aDb[0].pBt)) @@ -2291,7 +2291,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ } } - /* Do the commit only if all databases successfully complete phase 1. + /* Do the commit only if all databases successfully complete phase 1. ** If one of the BtreeCommitPhaseOne() calls fails, this indicates an ** IO error while deleting or truncating a journal file. It is unlikely, ** but could happen. In this case abandon processing and return the error. @@ -2349,7 +2349,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ }while( rc==SQLITE_OK && res ); if( rc==SQLITE_OK ){ /* Open the master journal. */ - rc = sqlite3OsOpenMalloc(pVfs, zMaster, &pMaster, + rc = sqlite3OsOpenMalloc(pVfs, zMaster, &pMaster, SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE| SQLITE_OPEN_EXCLUSIVE|SQLITE_OPEN_MASTER_JOURNAL, 0 ); @@ -2358,7 +2358,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ sqlite3DbFree(db, zMaster); return rc; } - + /* Write the name of each database file in the transaction into the new ** master journal file. If an error occurs at this point close ** and delete the master journal file. All the individual journal files @@ -2406,7 +2406,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ ** in case the master journal file name was written into the journal ** file before the failure occurred. */ - for(i=0; rc==SQLITE_OK && inDb; i++){ + for(i=0; rc==SQLITE_OK && inDb; i++){ Btree *pBt = db->aDb[i].pBt; if( pBt ){ rc = sqlite3BtreeCommitPhaseOne(pBt, zMaster); @@ -2439,7 +2439,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ */ disable_simulated_io_errors(); sqlite3BeginBenignMalloc(); - for(i=0; inDb; i++){ + for(i=0; inDb; i++){ Btree *pBt = db->aDb[i].pBt; if( pBt ){ sqlite3BtreeCommitPhaseTwo(pBt, 1); @@ -2455,7 +2455,7 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){ return rc; } -/* +/* ** This routine checks that the sqlite3.nVdbeActive count variable ** matches the number of vdbe's in the list sqlite3.pVdbe that are ** currently active. An assertion fails if the two counts do not match. @@ -2491,10 +2491,10 @@ static void checkActiveVdbeCnt(sqlite3 *db){ ** If the Vdbe passed as the first argument opened a statement-transaction, ** close it now. Argument eOp must be either SAVEPOINT_ROLLBACK or ** SAVEPOINT_RELEASE. If it is SAVEPOINT_ROLLBACK, then the statement -** transaction is rolled back. If eOp is SAVEPOINT_RELEASE, then the +** transaction is rolled back. If eOp is SAVEPOINT_RELEASE, then the ** statement transaction is committed. ** -** If an IO error occurs, an SQLITE_IOERR_XXX error code is returned. +** If an IO error occurs, an SQLITE_IOERR_XXX error code is returned. ** Otherwise SQLITE_OK. */ static SQLITE_NOINLINE int vdbeCloseStatement(Vdbe *p, int eOp){ @@ -2507,7 +2507,7 @@ static SQLITE_NOINLINE int vdbeCloseStatement(Vdbe *p, int eOp){ assert( db->nStatement>0 ); assert( p->iStatement==(db->nStatement+db->nSavepoint) ); - for(i=0; inDb; i++){ + for(i=0; inDb; i++){ int rc2 = SQLITE_OK; Btree *pBt = db->aDb[i].pBt; if( pBt ){ @@ -2534,8 +2534,8 @@ static SQLITE_NOINLINE int vdbeCloseStatement(Vdbe *p, int eOp){ } } - /* If the statement transaction is being rolled back, also restore the - ** database handles deferred constraint counter to the value it had when + /* If the statement transaction is being rolled back, also restore the + ** database handles deferred constraint counter to the value it had when ** the statement transaction was opened. */ if( eOp==SAVEPOINT_ROLLBACK ){ db->nDeferredCons = p->nStmtDefCons; @@ -2552,20 +2552,20 @@ int sqlite3VdbeCloseStatement(Vdbe *p, int eOp){ /* -** This function is called when a transaction opened by the database -** handle associated with the VM passed as an argument is about to be +** This function is called when a transaction opened by the database +** handle associated with the VM passed as an argument is about to be ** committed. If there are outstanding deferred foreign key constraint ** violations, return SQLITE_ERROR. Otherwise, SQLITE_OK. ** -** If there are outstanding FK violations and this function returns +** If there are outstanding FK violations and this function returns ** SQLITE_ERROR, set the result of the VM to SQLITE_CONSTRAINT_FOREIGNKEY ** and write an error message to it. Then return SQLITE_ERROR. */ #ifndef SQLITE_OMIT_FOREIGN_KEY int sqlite3VdbeCheckFk(Vdbe *p, int deferred){ sqlite3 *db = p->db; - if( (deferred && (db->nDeferredCons+db->nDeferredImmCons)>0) - || (!deferred && p->nFkConstraint>0) + if( (deferred && (db->nDeferredCons+db->nDeferredImmCons)>0) + || (!deferred && p->nFkConstraint>0) ){ p->rc = SQLITE_CONSTRAINT_FOREIGNKEY; p->errorAction = OE_Abort; @@ -2595,7 +2595,7 @@ int sqlite3VdbeHalt(Vdbe *p){ /* This function contains the logic that determines if a statement or ** transaction will be committed or rolled back as a result of the - ** execution of this virtual machine. + ** execution of this virtual machine. ** ** If any of the following errors occur: ** @@ -2633,16 +2633,16 @@ int sqlite3VdbeHalt(Vdbe *p){ isSpecialError = mrc==SQLITE_NOMEM || mrc==SQLITE_IOERR || mrc==SQLITE_INTERRUPT || mrc==SQLITE_FULL; if( isSpecialError ){ - /* If the query was read-only and the error code is SQLITE_INTERRUPT, - ** no rollback is necessary. Otherwise, at least a savepoint - ** transaction must be rolled back to restore the database to a + /* If the query was read-only and the error code is SQLITE_INTERRUPT, + ** no rollback is necessary. Otherwise, at least a savepoint + ** transaction must be rolled back to restore the database to a ** consistent state. ** ** Even if the statement is read-only, it is important to perform - ** a statement or transaction rollback operation. If the error + ** a statement or transaction rollback operation. If the error ** occurred while writing to the journal, sub-journal or database ** file as part of an effort to free up cache space (see function - ** pagerStress() in pager.c), the rollback is required to restore + ** pagerStress() in pager.c), the rollback is required to restore ** the pager to a consistent state. */ if( !p->readOnly || mrc!=SQLITE_INTERRUPT ){ @@ -2664,16 +2664,16 @@ int sqlite3VdbeHalt(Vdbe *p){ if( p->rc==SQLITE_OK ){ sqlite3VdbeCheckFk(p, 0); } - - /* If the auto-commit flag is set and this is the only active writer - ** VM, then we do either a commit or rollback of the current transaction. + + /* If the auto-commit flag is set and this is the only active writer + ** VM, then we do either a commit or rollback of the current transaction. ** - ** Note: This block also runs if one of the special errors handled - ** above has occurred. + ** Note: This block also runs if one of the special errors handled + ** above has occurred. */ - if( !sqlite3VtabInSync(db) - && db->autoCommit - && db->nVdbeWrite==(p->readOnly==0) + if( !sqlite3VtabInSync(db) + && db->autoCommit + && db->nVdbeWrite==(p->readOnly==0) ){ if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){ rc = sqlite3VdbeCheckFk(p, 1); @@ -2683,10 +2683,10 @@ int sqlite3VdbeHalt(Vdbe *p){ return SQLITE_ERROR; } rc = SQLITE_CONSTRAINT_FOREIGNKEY; - }else{ - /* The auto-commit flag is true, the vdbe program was successful + }else{ + /* The auto-commit flag is true, the vdbe program was successful ** or hit an 'OR FAIL' constraint and there are no deferred foreign - ** key constraints to hold up the transaction. This means a commit + ** key constraints to hold up the transaction. This means a commit ** is required. */ rc = vdbeCommit(db, p); } @@ -2720,7 +2720,7 @@ int sqlite3VdbeHalt(Vdbe *p){ p->nChange = 0; } } - + /* If eStatementOp is non-zero, then a statement transaction needs to ** be committed or rolled back. Call sqlite3VdbeCloseStatement() to ** do so. If this operation returns an error, and the current statement @@ -2741,9 +2741,9 @@ int sqlite3VdbeHalt(Vdbe *p){ p->nChange = 0; } } - + /* If this was an INSERT, UPDATE or DELETE and no statement transaction - ** has been rolled back, update the database connection change-counter. + ** has been rolled back, update the database connection change-counter. */ if( p->changeCntOn ){ if( eStatementOp!=SAVEPOINT_ROLLBACK ){ @@ -2774,7 +2774,7 @@ int sqlite3VdbeHalt(Vdbe *p){ } /* If the auto-commit flag is set to true, then any locks that were held - ** by connection db have now been released. Call sqlite3ConnectionUnlocked() + ** by connection db have now been released. Call sqlite3ConnectionUnlocked() ** to invoke any required unlock-notify callbacks. */ if( db->autoCommit ){ @@ -2796,7 +2796,7 @@ void sqlite3VdbeResetStepResult(Vdbe *p){ /* ** Copy the error code and error message belonging to the VDBE passed -** as the first argument to its database handle (so that they will be +** as the first argument to its database handle (so that they will be ** returned by calls to sqlite3_errcode() and sqlite3_errmsg()). ** ** This function does not clear the VDBE error code or message, just @@ -2821,7 +2821,7 @@ int sqlite3VdbeTransferError(Vdbe *p){ #ifdef SQLITE_ENABLE_SQLLOG /* -** If an SQLITE_CONFIG_SQLLOG hook is registered and the VM has been run, +** If an SQLITE_CONFIG_SQLLOG hook is registered and the VM has been run, ** invoke it. */ static void vdbeInvokeSqllog(Vdbe *v){ @@ -2926,7 +2926,7 @@ int sqlite3VdbeReset(Vdbe *p){ p->magic = VDBE_MAGIC_RESET; return p->rc & db->errMask; } - + /* ** Clean up and delete a VDBE after execution. Return an integer which is ** the result code. Write any error message text into *pzErrMsg. @@ -2947,8 +2947,8 @@ int sqlite3VdbeFinalize(Vdbe *p){ ** the first argument. ** ** Or, if iOp is greater than or equal to zero, then the destructor is -** only invoked for those auxiliary data pointers created by the user -** function invoked by the OP_Function opcode at instruction iOp of +** only invoked for those auxiliary data pointers created by the user +** function invoked by the OP_Function opcode at instruction iOp of ** VM pVdbe, and only then if: ** ** * the associated function parameter is the 32nd or later (counting @@ -3219,7 +3219,7 @@ u32 sqlite3VdbeSerialType(Mem *pMem, int file_format, u32 *pLen){ ** The sizes for serial types less than 128 */ static const u8 sqlite3SmallTypeSizes[] = { - /* 0 1 2 3 4 5 6 7 8 9 */ + /* 0 1 2 3 4 5 6 7 8 9 */ /* 0 */ 0, 1, 2, 3, 4, 6, 8, 8, 0, 0, /* 10 */ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, /* 20 */ 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, @@ -3242,19 +3242,19 @@ u32 sqlite3VdbeSerialTypeLen(u32 serial_type){ if( serial_type>=128 ){ return (serial_type-12)/2; }else{ - assert( serial_type<12 + assert( serial_type<12 || sqlite3SmallTypeSizes[serial_type]==(serial_type - 12)/2 ); return sqlite3SmallTypeSizes[serial_type]; } } u8 sqlite3VdbeOneByteSerialTypeLen(u8 serial_type){ assert( serial_type<128 ); - return sqlite3SmallTypeSizes[serial_type]; + return sqlite3SmallTypeSizes[serial_type]; } /* -** If we are on an architecture with mixed-endian floating -** points (ex: ARM7) then swap the lower 4 bytes with the +** If we are on an architecture with mixed-endian floating +** points (ex: ARM7) then swap the lower 4 bytes with the ** upper 4 bytes. Return the result. ** ** For most architectures, this is a no-op. @@ -3276,7 +3276,7 @@ u8 sqlite3VdbeOneByteSerialTypeLen(u8 serial_type){ ** (2007-08-30) Frank van Vugt has studied this problem closely ** and has send his findings to the SQLite developers. Frank ** writes that some Linux kernels offer floating point hardware -** emulation that uses only 32-bit mantissas instead of a full +** emulation that uses only 32-bit mantissas instead of a full ** 48-bits as required by the IEEE standard. (This is the ** CONFIG_FPE_FASTFPE option.) On such systems, floating point ** byte swapping becomes very complicated. To avoid problems, @@ -3306,7 +3306,7 @@ static u64 floatSwap(u64 in){ #endif /* -** Write the serialized data blob for the value stored in pMem into +** Write the serialized data blob for the value stored in pMem into ** buf. It is assumed that the caller has allocated sufficient space. ** Return the number of bytes written. ** @@ -3317,7 +3317,7 @@ static u64 floatSwap(u64 in){ ** Return the number of bytes actually written into buf[]. The number ** of bytes in the zero-filled tail is included in the return value only ** if those bytes were zeroed in buf[]. -*/ +*/ u32 sqlite3VdbeSerialPut(u8 *buf, Mem *pMem, u32 serial_type){ u32 len; @@ -3371,7 +3371,7 @@ u32 sqlite3VdbeSerialPut(u8 *buf, Mem *pMem, u32 serial_type){ ** The few cases that require local variables are broken out into a separate ** routine so that in most cases the overhead of moving the stack pointer ** is avoided. -*/ +*/ static u32 SQLITE_NOINLINE serialGet( const unsigned char *buf, /* Buffer to deserialize from */ u32 serial_type, /* Serial type to deserialize */ @@ -3449,7 +3449,7 @@ u32 sqlite3VdbeSerialGet( /* EVIDENCE-OF: R-01849-26079 Value is a big-endian 32-bit ** twos-complement integer. */ pMem->u.i = FOUR_BYTE_INT(buf); -#ifdef __HP_cc +#ifdef __HP_cc /* Work around a sign-extension bug in the HP compiler for HP/UX */ if( buf[0]&0x80 ) pMem->u.i |= 0xffffffff80000000LL; #endif @@ -3501,7 +3501,7 @@ u32 sqlite3VdbeSerialGet( ** The space is either allocated using sqlite3DbMallocRaw() or from within ** the unaligned buffer passed via the second and third arguments (presumably ** stack space). If the former, then *ppFree is set to a pointer that should -** be eventually freed by the caller using sqlite3DbFree(). Or, if the +** be eventually freed by the caller using sqlite3DbFree(). Or, if the ** allocation comes from the pSpace/szSpace buffer, *ppFree is set to NULL ** before returning. ** @@ -3523,10 +3523,10 @@ UnpackedRecord *sqlite3VdbeAllocUnpackedRecord( } /* -** Given the nKey-byte encoding of a record in pKey[], populate the +** Given the nKey-byte encoding of a record in pKey[], populate the ** UnpackedRecord structure indicated by the fourth argument with the ** contents of the decoded record. -*/ +*/ void sqlite3VdbeRecordUnpack( KeyInfo *pKeyInfo, /* Information about the record format */ int nKey, /* Size of the binary record */ @@ -3534,7 +3534,7 @@ void sqlite3VdbeRecordUnpack( UnpackedRecord *p /* Populate this structure before returning. */ ){ const unsigned char *aKey = (const unsigned char *)pKey; - int d; + int d; u32 idx; /* Offset in aKey[] to read from */ u16 u; /* Unsigned loop counter */ u32 szHdr; @@ -3597,13 +3597,13 @@ static int vdbeRecordCompareDebug( /* Compilers may complain that mem1.u.i is potentially uninitialized. ** We could initialize it, as shown here, to silence those complaints. - ** But in fact, mem1.u.i will never actually be used uninitialized, and doing + ** But in fact, mem1.u.i will never actually be used uninitialized, and doing ** the unnecessary initialization has a measurable negative performance ** impact, since this routine is a very high runner. And so, we choose ** to ignore the compiler warnings and leave this variable uninitialized. */ /* mem1.u.i = 0; // not needed, here to silence compiler warning */ - + idx1 = getVarint32(aKey1, szHdr1); if( szHdr1>98307 ) return SQLITE_CORRUPT; d1 = szHdr1; @@ -3624,7 +3624,7 @@ static int vdbeRecordCompareDebug( ** sqlite3VdbeSerialTypeLen() in the common case. */ if( d1+serial_type1+2>(u32)nKey1 - && d1+sqlite3VdbeSerialTypeLen(serial_type1)>(u32)nKey1 + && d1+sqlite3VdbeSerialTypeLen(serial_type1)>(u32)nKey1 ){ break; } @@ -3680,7 +3680,7 @@ debugCompareEnd: ** incorrectly. */ static void vdbeAssertFieldCountWithinLimits( - int nKey, const void *pKey, /* The record to verify */ + int nKey, const void *pKey, /* The record to verify */ const KeyInfo *pKeyInfo /* Compare size with this KeyInfo */ ){ int nField = 0; @@ -3706,7 +3706,7 @@ static void vdbeAssertFieldCountWithinLimits( /* ** Both *pMem1 and *pMem2 contain string values. Compare the two values ** using the collation sequence pColl. As usual, return a negative , zero -** or positive value if *pMem1 is less than, equal to or greater than +** or positive value if *pMem1 is less than, equal to or greater than ** *pMem2, respectively. Similar in spirit to "rc = (*pMem1) - (*pMem2);". */ static int vdbeCompareMemString( @@ -3832,7 +3832,7 @@ int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const CollSeq *pColl){ f2 = pMem2->flags; combined_flags = f1|f2; assert( (combined_flags & MEM_RowSet)==0 ); - + /* If one value is NULL, it is less than the other. If both values ** are NULL, return 0. */ @@ -3882,7 +3882,7 @@ int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const CollSeq *pColl){ } assert( pMem1->enc==pMem2->enc || pMem1->db->mallocFailed ); - assert( pMem1->enc==SQLITE_UTF8 || + assert( pMem1->enc==SQLITE_UTF8 || pMem1->enc==SQLITE_UTF16LE || pMem1->enc==SQLITE_UTF16BE ); /* The collation sequence must be defined at this point, even if @@ -3897,7 +3897,7 @@ int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const CollSeq *pColl){ /* If a NULL pointer was passed as the collate function, fall through ** to the blob case and use memcmp(). */ } - + /* Both values must be blobs. Compare using memcmp(). */ return sqlite3BlobCompare(pMem1, pMem2); } @@ -3905,7 +3905,7 @@ int sqlite3MemCompare(const Mem *pMem1, const Mem *pMem2, const CollSeq *pColl){ /* ** The first argument passed to this function is a serial-type that -** corresponds to an integer - all values between 1 and 9 inclusive +** corresponds to an integer - all values between 1 and 9 inclusive ** except 7. The second points to a buffer containing an integer value ** serialized according to serial_type. This function deserializes ** and returns the value. @@ -3947,7 +3947,7 @@ static i64 vdbeRecordDecodeInt(u32 serial_type, const u8 *aKey){ /* ** This function compares the two table rows or index records ** specified by {nKey1, pKey1} and pPKey2. It returns a negative, zero -** or positive integer if key1 is less than, equal to or +** or positive integer if key1 is less than, equal to or ** greater than key2. The {nKey1, pKey1} key must be a blob ** created by the OP_MakeRecord opcode of the VDBE. The pPKey2 ** key must be a parsed key such as obtained from @@ -3956,12 +3956,12 @@ static i64 vdbeRecordDecodeInt(u32 serial_type, const u8 *aKey){ ** If argument bSkip is non-zero, it is assumed that the caller has already ** determined that the first fields of the keys are equal. ** -** Key1 and Key2 do not have to contain the same number of fields. If all -** fields that appear in both keys are equal, then pPKey2->default_rc is +** Key1 and Key2 do not have to contain the same number of fields. If all +** fields that appear in both keys are equal, then pPKey2->default_rc is ** returned. ** -** If database corruption is discovered, set pPKey2->errCode to -** SQLITE_CORRUPT and return 0. If an OOM error is encountered, +** If database corruption is discovered, set pPKey2->errCode to +** SQLITE_CORRUPT and return 0. If an OOM error is encountered, ** pPKey2->errCode is set to SQLITE_NOMEM and, if it is not NULL, the ** malloc-failed flag set on database handle (pPKey2->pKeyInfo->db). */ @@ -3993,7 +3993,7 @@ int sqlite3VdbeRecordCompareWithSkip( }else{ idx1 = getVarint32(aKey1, szHdr1); d1 = szHdr1; - if( d1>(unsigned)nKey1 ){ + if( d1>(unsigned)nKey1 ){ pPKey2->errCode = (u8)SQLITE_CORRUPT_BKPT; return 0; /* Corruption */ } @@ -4001,7 +4001,7 @@ int sqlite3VdbeRecordCompareWithSkip( } VVA_ONLY( mem1.szMalloc = 0; ) /* Only needed by assert() statements */ - assert( pPKey2->pKeyInfo->nField+pPKey2->pKeyInfo->nXField>=pPKey2->nField + assert( pPKey2->pKeyInfo->nField+pPKey2->pKeyInfo->nXField>=pPKey2->nField || CORRUPT_DB ); assert( pPKey2->pKeyInfo->aSortOrder!=0 ); assert( pPKey2->pKeyInfo->nField>0 ); @@ -4036,7 +4036,7 @@ int sqlite3VdbeRecordCompareWithSkip( serial_type = aKey1[idx1]; if( serial_type>=10 ){ /* Serial types 12 or greater are strings and blobs (greater than - ** numbers). Types 10 and 11 are currently "reserved for future + ** numbers). Types 10 and 11 are currently "reserved for future ** use", so it doesn't really matter what the results of comparing ** them to numberic values are. */ rc = +1; @@ -4082,7 +4082,7 @@ int sqlite3VdbeRecordCompareWithSkip( }else{ int nCmp = MIN(mem1.n, pRhs->n); rc = memcmp(&aKey1[d1], pRhs->z, nCmp); - if( rc==0 ) rc = mem1.n - pRhs->n; + if( rc==0 ) rc = mem1.n - pRhs->n; } } } @@ -4144,8 +4144,8 @@ int sqlite3VdbeRecordCompareWithSkip( /* rc==0 here means that one or both of the keys ran out of fields and ** all the fields up to that point were equal. Return the default_rc ** value. */ - assert( CORRUPT_DB - || vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, pPKey2->default_rc) + assert( CORRUPT_DB + || vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, pPKey2->default_rc) || pKeyInfo->db->mallocFailed ); pPKey2->eqSeen = 1; @@ -4160,8 +4160,8 @@ int sqlite3VdbeRecordCompare( /* -** This function is an optimized version of sqlite3VdbeRecordCompare() -** that (a) the first field of pPKey2 is an integer, and (b) the +** This function is an optimized version of sqlite3VdbeRecordCompare() +** that (a) the first field of pPKey2 is an integer, and (b) the ** size-of-header varint at the start of (pKey1/nKey1) fits in a single ** byte (i.e. is less than 128). ** @@ -4216,7 +4216,7 @@ static int vdbeRecordCompareInt( testcase( lhs<0 ); break; } - case 8: + case 8: lhs = 0; break; case 9: @@ -4224,11 +4224,11 @@ static int vdbeRecordCompareInt( break; /* This case could be removed without changing the results of running - ** this code. Including it causes gcc to generate a faster switch + ** this code. Including it causes gcc to generate a faster switch ** statement (since the range of switch targets now starts at zero and ** is contiguous) but does not cause any duplicate code to be generated - ** (as gcc is clever enough to combine the two like cases). Other - ** compilers might be similar. */ + ** (as gcc is clever enough to combine the two like cases). Other + ** compilers might be similar. */ case 0: case 7: return sqlite3VdbeRecordCompare(nKey1, pKey1, pPKey2); @@ -4242,7 +4242,7 @@ static int vdbeRecordCompareInt( }else if( vr2; }else if( pPKey2->nField>1 ){ - /* The first fields of the two keys are equal. Compare the trailing + /* The first fields of the two keys are equal. Compare the trailing ** fields. */ res = sqlite3VdbeRecordCompareWithSkip(nKey1, pKey1, pPKey2, 1); }else{ @@ -4257,9 +4257,9 @@ static int vdbeRecordCompareInt( } /* -** This function is an optimized version of sqlite3VdbeRecordCompare() +** This function is an optimized version of sqlite3VdbeRecordCompare() ** that (a) the first field of pPKey2 is a string, that (b) the first field -** uses the collation sequence BINARY and (c) that the size-of-header varint +** uses the collation sequence BINARY and (c) that the size-of-header varint ** at the start of (pKey1/nKey1) fits in a single byte. */ static int vdbeRecordCompareString( @@ -4275,7 +4275,7 @@ static int vdbeRecordCompareString( getVarint32(&aKey1[1], serial_type); if( serial_type<12 ){ res = pPKey2->r1; /* (pKey1/nKey1) is a number or a null */ - }else if( !(serial_type & 0x01) ){ + }else if( !(serial_type & 0x01) ){ res = pPKey2->r2; /* (pKey1/nKey1) is a blob */ }else{ int nCmp; @@ -4327,7 +4327,7 @@ RecordCompare sqlite3VdbeFindCompare(UnpackedRecord *p){ /* varintRecordCompareInt() and varintRecordCompareString() both assume ** that the size-of-header varint that occurs at the start of each record ** fits in a single byte (i.e. is 127 or less). varintRecordCompareInt() - ** also assumes that it is safe to overread a buffer by at least the + ** also assumes that it is safe to overread a buffer by at least the ** maximum possible legal header size plus 8 bytes. Because there is ** guaranteed to be at least 74 (but not 136) bytes of padding following each ** buffer passed to varintRecordCompareInt() this makes it convenient to @@ -4380,7 +4380,7 @@ int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 *rowid){ /* Get the size of the index entry. Only indices entries of less ** than 2GiB are support - anything large must be database corruption. ** Any corruption is detected in sqlite3BtreeParseCellPtr(), though, so - ** this code can safely assume that nCellKey is 32-bits + ** this code can safely assume that nCellKey is 32-bits */ assert( sqlite3BtreeCursorIsValid(pCur) ); nCellKey = sqlite3BtreePayloadSize(pCur); @@ -4443,7 +4443,7 @@ idx_rowid_corruption: ** ** pUnpacked is either created without a rowid or is truncated so that it ** omits the rowid at the end. The rowid at the end of the index entry -** is ignored as well. Hence, this routine only compares the prefixes +** is ignored as well. Hence, this routine only compares the prefixes ** of the keys prior to the final rowid, not the entire key. */ int sqlite3VdbeIdxKeyCompare( @@ -4479,7 +4479,7 @@ int sqlite3VdbeIdxKeyCompare( /* ** This routine sets the value to be returned by subsequent calls to -** sqlite3_changes() on the database handle 'db'. +** sqlite3_changes() on the database handle 'db'. */ void sqlite3VdbeSetChanges(sqlite3 *db, int nChange){ assert( sqlite3_mutex_held(db->mutex) ); @@ -4521,7 +4521,7 @@ sqlite3 *sqlite3VdbeDb(Vdbe *v){ /* ** Return a pointer to an sqlite3_value structure containing the value bound -** parameter iVar of VM v. Except, if the value is an SQL NULL, return +** parameter iVar of VM v. Except, if the value is an SQL NULL, return ** 0 instead. Unless it is NULL, apply affinity aff (one of the SQLITE_AFF_* ** constants) to the value before returning it. ** @@ -4577,7 +4577,7 @@ void sqlite3VtabImportErrmsg(Vdbe *p, sqlite3_vtab *pVtab){ #ifdef SQLITE_ENABLE_PREUPDATE_HOOK /* -** If the second argument is not NULL, release any allocations associated +** If the second argument is not NULL, release any allocations associated ** with the memory cells in the p->aMem[] array. Also free the UnpackedRecord ** structure itself, using sqlite3DbFree(). ** @@ -4631,7 +4631,7 @@ void sqlite3VdbePreUpdateHook( } } - assert( pCsr->nField==pTab->nCol + assert( pCsr->nField==pTab->nCol || (pCsr->nField==pTab->nCol+1 && op==SQLITE_DELETE && iReg==-1) ); diff --git a/third_party/sqlite/src/src/vdbeblob.c b/third_party/sqlite/src/src/vdbeblob.c index 5692c1c606d77..96a98649bfc43 100644 --- a/third_party/sqlite/src/src/vdbeblob.c +++ b/third_party/sqlite/src/src/vdbeblob.c @@ -48,7 +48,7 @@ struct Incrblob { ** sqlite3DbFree(). ** ** If an error does occur, then the b-tree cursor is closed. All subsequent -** calls to sqlite3_blob_read(), blob_write() or blob_reopen() will +** calls to sqlite3_blob_read(), blob_write() or blob_reopen() will ** immediately return SQLITE_ABORT. */ static int blobSeekToRow(Incrblob *p, sqlite3_int64 iRow, char **pzErr){ @@ -56,7 +56,7 @@ static int blobSeekToRow(Incrblob *p, sqlite3_int64 iRow, char **pzErr){ char *zErr = 0; /* Error message */ Vdbe *v = (Vdbe *)p->pStmt; - /* Set the value of register r[1] in the SQL statement to integer iRow. + /* Set the value of register r[1] in the SQL statement to integer iRow. ** This is done directly as a performance optimization */ v->aMem[1].flags = MEM_Int; @@ -202,7 +202,7 @@ int sqlite3_blob_open( } /* If the value is being opened for writing, check that the - ** column is not indexed, and that it is not part of a foreign key. + ** column is not indexed, and that it is not part of a foreign key. */ if( wrFlag ){ const char *zFault = 0; @@ -211,7 +211,7 @@ int sqlite3_blob_open( if( db->flags&SQLITE_ForeignKeys ){ /* Check that the column is not part of an FK child key definition. It ** is not necessary to check if it is part of a parent key, as parent - ** key columns must be indexed. The check below will pick up this + ** key columns must be indexed. The check below will pick up this ** case. */ FKey *pFKey; for(pFKey=pTab->pFKey; pFKey; pFKey=pFKey->pNextFrom){ @@ -245,8 +245,8 @@ int sqlite3_blob_open( pBlob->pStmt = (sqlite3_stmt *)sqlite3VdbeCreate(pParse); assert( pBlob->pStmt || db->mallocFailed ); if( pBlob->pStmt ){ - - /* This VDBE program seeks a btree cursor to the identified + + /* This VDBE program seeks a btree cursor to the identified ** db/table/row entry. The reason for using a vdbe program instead ** of writing code to use the b-tree layer directly is that the ** vdbe program will take advantage of the various transaction, @@ -254,11 +254,11 @@ int sqlite3_blob_open( ** ** After seeking the cursor, the vdbe executes an OP_ResultRow. ** Code external to the Vdbe then "borrows" the b-tree cursor and - ** uses it to implement the blob_read(), blob_write() and + ** uses it to implement the blob_read(), blob_write() and ** blob_bytes() functions. ** ** The sqlite3_blob_close() function finalizes the vdbe program, - ** which closes the b-tree cursor and (possibly) commits the + ** which closes the b-tree cursor and (possibly) commits the ** transaction. */ static const int iLn = VDBE_OFFSET_LINENO(2); @@ -275,14 +275,14 @@ int sqlite3_blob_open( int iDb = sqlite3SchemaToIndex(db, pTab->pSchema); VdbeOp *aOp; - sqlite3VdbeAddOp4Int(v, OP_Transaction, iDb, wrFlag, + sqlite3VdbeAddOp4Int(v, OP_Transaction, iDb, wrFlag, pTab->pSchema->schema_cookie, pTab->pSchema->iGeneration); - sqlite3VdbeChangeP5(v, 1); + sqlite3VdbeChangeP5(v, 1); aOp = sqlite3VdbeAddOpList(v, ArraySize(openBlob), openBlob, iLn); /* Make sure a mutex is held on the table to be accessed */ - sqlite3VdbeUsesBtree(v, iDb); + sqlite3VdbeUsesBtree(v, iDb); if( db->mallocFailed==0 ){ assert( aOp!=0 ); @@ -298,17 +298,17 @@ int sqlite3_blob_open( if( db->mallocFailed==0 ){ #endif - /* Remove either the OP_OpenWrite or OpenRead. Set the P2 + /* Remove either the OP_OpenWrite or OpenRead. Set the P2 ** parameter of the other to pTab->tnum. */ if( wrFlag ) aOp[1].opcode = OP_OpenWrite; aOp[1].p2 = pTab->tnum; - aOp[1].p3 = iDb; + aOp[1].p3 = iDb; /* Configure the number of columns. Configure the cursor to ** think that the table has one more column than it really ** does. An OP_Column to retrieve this imaginary column will ** always return an SQL NULL. This is useful because it means - ** we can invoke OP_Column to fill in the vdbe cursors type + ** we can invoke OP_Column to fill in the vdbe cursors type ** and offset cache without causing any IO. */ aOp[1].p4type = P4_INT32; @@ -321,7 +321,7 @@ int sqlite3_blob_open( sqlite3VdbeMakeReady(v, pParse); } } - + pBlob->iCol = iCol; pBlob->db = db; sqlite3BtreeLeaveAll(db); @@ -372,10 +372,10 @@ int sqlite3_blob_close(sqlite3_blob *pBlob){ ** Perform a read or write operation on a blob */ static int blobReadWrite( - sqlite3_blob *pBlob, - void *z, - int n, - int iOffset, + sqlite3_blob *pBlob, + void *z, + int n, + int iOffset, int (*xCall)(BtCursor*, u32, u32, void*) ){ int rc; @@ -405,14 +405,14 @@ static int blobReadWrite( #ifdef SQLITE_ENABLE_PREUPDATE_HOOK if( xCall==sqlite3BtreePutData && db->xPreUpdateCallback ){ - /* If a pre-update hook is registered and this is a write cursor, - ** invoke it here. - ** + /* If a pre-update hook is registered and this is a write cursor, + ** invoke it here. + ** ** TODO: The preupdate-hook is passed SQLITE_DELETE, even though this ** operation should really be an SQLITE_UPDATE. This is probably - ** incorrect, but is convenient because at this point the new.* values - ** are not easily obtainable. And for the sessions module, an - ** SQLITE_UPDATE where the PK columns do not change is handled in the + ** incorrect, but is convenient because at this point the new.* values + ** are not easily obtainable. And for the sessions module, an + ** SQLITE_UPDATE where the PK columns do not change is handled in the ** same way as an SQLITE_DELETE (the SQLITE_DELETE code is actually ** slightly more efficient). Since you cannot write to a PK column ** using the incremental-blob API, this works. For the sessions module @@ -472,8 +472,8 @@ int sqlite3_blob_bytes(sqlite3_blob *pBlob){ ** ** If an error occurs, or if the specified row does not exist or does not ** contain a blob or text value, then an error code is returned and the -** database handle error code and message set. If this happens, then all -** subsequent calls to sqlite3_blob_xxx() functions (except blob_close()) +** database handle error code and message set. If this happens, then all +** subsequent calls to sqlite3_blob_xxx() functions (except blob_close()) ** immediately return SQLITE_ABORT. */ int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){ diff --git a/third_party/sqlite/src/src/vdbemem.c b/third_party/sqlite/src/src/vdbemem.c index 2f7aedb321714..811a1c904185d 100644 --- a/third_party/sqlite/src/src/vdbemem.c +++ b/third_party/sqlite/src/src/vdbemem.c @@ -26,7 +26,7 @@ ** this: assert( sqlite3VdbeCheckMemInvariants(pMem) ); */ int sqlite3VdbeCheckMemInvariants(Mem *p){ - /* If MEM_Dyn is set then Mem.xDel!=0. + /* If MEM_Dyn is set then Mem.xDel!=0. ** Mem.xDel is might not be initialized if MEM_Dyn is clear. */ assert( (p->flags & MEM_Dyn)==0 || p->xDel!=0 ); @@ -53,7 +53,7 @@ int sqlite3VdbeCheckMemInvariants(Mem *p){ ** (4) A static string or blob */ if( (p->flags & (MEM_Str|MEM_Blob)) && p->n>0 ){ - assert( + assert( ((p->szMalloc>0 && p->z==p->zMalloc)? 1 : 0) + ((p->flags&MEM_Dyn)!=0 ? 1 : 0) + ((p->flags&MEM_Ephem)!=0 ? 1 : 0) + @@ -105,7 +105,7 @@ int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){ } /* -** Make sure pMem->z points to a writable allocation of at least +** Make sure pMem->z points to a writable allocation of at least ** min(n,32) bytes. ** ** If the bPreserve argument is true, then copy of the content of @@ -300,7 +300,7 @@ int sqlite3VdbeMemStringify(Mem *pMem, u8 enc, u8 bForce){ /* For a Real or Integer, use sqlite3_snprintf() to produce the UTF-8 ** string representation of the value. Then, if the required encoding ** is UTF-16le or UTF-16be do a translation. - ** + ** ** FIX ME: It would be better if sqlite3_snprintf() could do UTF-16. */ if( fg & MEM_Int ){ @@ -656,7 +656,7 @@ void sqlite3VdbeMemSetNull(Mem *pMem){ } } void sqlite3ValueSetNull(sqlite3_value *p){ - sqlite3VdbeMemSetNull((Mem*)p); + sqlite3VdbeMemSetNull((Mem*)p); } /* @@ -757,7 +757,7 @@ int sqlite3VdbeMemTooBig(Mem *p){ } return n>p->db->aLimit[SQLITE_LIMIT_LENGTH]; } - return 0; + return 0; } #ifdef SQLITE_DEBUG @@ -848,8 +848,8 @@ void sqlite3VdbeMemMove(Mem *pTo, Mem *pFrom){ ** Change the value of a Mem to be a string or a BLOB. ** ** The memory management strategy depends on the value of the xDel -** parameter. If the value passed is SQLITE_TRANSIENT, then the -** string is copied into a (possibly existing) buffer managed by the +** parameter. If the value passed is SQLITE_TRANSIENT, then the +** string is copied into a (possibly existing) buffer managed by the ** Mem structure. Otherwise, any existing buffer is freed and the ** pointer copied. ** @@ -992,7 +992,7 @@ int sqlite3VdbeMemFromBtree( assert( sqlite3BtreeCursorIsValid(pCur) ); assert( !VdbeMemDynamic(pMem) ); - /* Note: the calls to BtreeKeyFetch() and DataFetch() below assert() + /* Note: the calls to BtreeKeyFetch() and DataFetch() below assert() ** that both the BtShared and database handle mutexes are held. */ assert( (pMem->flags & MEM_RowSet)==0 ); zData = (char *)sqlite3BtreePayloadFetch(pCur, &available); @@ -1083,7 +1083,7 @@ sqlite3_value *sqlite3ValueNew(sqlite3 *db){ } /* -** Context object passed by sqlite3Stat4ProbeSetValue() through to +** Context object passed by sqlite3Stat4ProbeSetValue() through to ** valueNew(). See comments above valueNew() for details. */ struct ValueNewStat4Ctx { @@ -1098,9 +1098,9 @@ struct ValueNewStat4Ctx { ** the second argument to this function is NULL, the object is allocated ** by calling sqlite3ValueNew(). ** -** Otherwise, if the second argument is non-zero, then this function is +** Otherwise, if the second argument is non-zero, then this function is ** being called indirectly by sqlite3Stat4ProbeSetValue(). If it has not -** already been allocated, allocate the UnpackedRecord structure that +** already been allocated, allocate the UnpackedRecord structure that ** that function will return to its caller here. Then return a pointer to ** an sqlite3_value within the UnpackedRecord.a[] array. */ @@ -1114,7 +1114,7 @@ static sqlite3_value *valueNew(sqlite3 *db, struct ValueNewStat4Ctx *p){ int nByte; /* Bytes of space to allocate */ int i; /* Counter variable */ int nCol = pIdx->nColumn; /* Number of index columns including rowid */ - + nByte = sizeof(Mem) * nCol + ROUND8(sizeof(UnpackedRecord)); pRec = (UnpackedRecord*)sqlite3DbMallocZero(db, nByte); if( pRec ){ @@ -1135,7 +1135,7 @@ static sqlite3_value *valueNew(sqlite3 *db, struct ValueNewStat4Ctx *p){ if( pRec==0 ) return 0; p->ppRec[0] = pRec; } - + pRec->nField = p->iVal+1; return &pRec->aMem[p->iVal]; } @@ -1154,11 +1154,11 @@ static sqlite3_value *valueNew(sqlite3 *db, struct ValueNewStat4Ctx *p){ ** * the SQLITE_FUNC_NEEDCOLL function flag is not set, ** ** then this routine attempts to invoke the SQL function. Assuming no -** error occurs, output parameter (*ppVal) is set to point to a value +** error occurs, output parameter (*ppVal) is set to point to a value ** object containing the result before returning SQLITE_OK. ** ** Affinity aff is applied to the result of the function before returning. -** If the result is a text value, the sqlite3_value object uses encoding +** If the result is a text value, the sqlite3_value object uses encoding ** enc. ** ** If the conditions above are not met, this function returns SQLITE_OK @@ -1189,7 +1189,7 @@ static int valueFromFunction( if( pList ) nVal = pList->nExpr; pFunc = sqlite3FindFunction(db, p->u.zToken, nVal, enc, 0); assert( pFunc ); - if( (pFunc->funcFlags & (SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG))==0 + if( (pFunc->funcFlags & (SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG))==0 || (pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL) ){ return SQLITE_OK; @@ -1328,7 +1328,7 @@ static int valueFromExpr( } }else if( op==TK_UMINUS ) { /* This branch happens for multiple negative signs. Ex: -(-5) */ - if( SQLITE_OK==sqlite3ValueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal) + if( SQLITE_OK==sqlite3ValueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal) && pVal!=0 ){ sqlite3VdbeMemNumerify(pVal); @@ -1406,7 +1406,7 @@ int sqlite3ValueFromExpr( #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 /* ** The implementation of the sqlite_record() function. This function accepts -** a single argument of any type. The return value is a formatted database +** a single argument of any type. The return value is a formatted database ** record (a blob) containing the argument value. ** ** This is used to convert the value stored in the 'sample' column of the @@ -1516,8 +1516,8 @@ static int stat4ValueFromExpr( } /* -** This function is used to allocate and populate UnpackedRecord -** structures intended to be compared against sample index keys stored +** This function is used to allocate and populate UnpackedRecord +** structures intended to be compared against sample index keys stored ** in the sqlite_stat4 table. ** ** A single call to this function populates zero or more fields of the @@ -1528,14 +1528,14 @@ static int stat4ValueFromExpr( ** ** * The expression is a bound variable, and this is a reprepare, or ** -** * The sqlite3ValueFromExpr() function is able to extract a value +** * The sqlite3ValueFromExpr() function is able to extract a value ** from the expression (i.e. the expression is a literal value). ** ** Or, if pExpr is a TK_VECTOR, one field is populated for each of the ** vector components that match either of the two latter criteria listed ** above. ** -** Before any value is appended to the record, the affinity of the +** Before any value is appended to the record, the affinity of the ** corresponding column within index pIdx is applied to it. Before ** this function returns, output parameter *pnExtract is set to the ** number of values appended to the record. @@ -1586,9 +1586,9 @@ int sqlite3Stat4ProbeSetValue( /* ** Attempt to extract a value from expression pExpr using the methods -** as described for sqlite3Stat4ProbeSetValue() above. +** as described for sqlite3Stat4ProbeSetValue() above. ** -** If successful, set *ppVal to point to a new value object and return +** If successful, set *ppVal to point to a new value object and return ** SQLITE_OK. If no value can be extracted, but no other error occurs ** (e.g. OOM), return SQLITE_OK and set *ppVal to NULL. Or, if an error ** does occur, return an SQLite error code. The final value of *ppVal @@ -1608,7 +1608,7 @@ int sqlite3Stat4ValueFromExpr( ** the column value into *ppVal. If *ppVal is initially NULL then a new ** sqlite3_value object is allocated. ** -** If *ppVal is initially NULL then the caller is responsible for +** If *ppVal is initially NULL then the caller is responsible for ** ensuring that the value written into *ppVal is eventually freed. */ int sqlite3Stat4Column( diff --git a/third_party/sqlite/src/src/vdbesort.c b/third_party/sqlite/src/src/vdbesort.c index 631fb19616f2d..deb18551c86a4 100644 --- a/third_party/sqlite/src/src/vdbesort.c +++ b/third_party/sqlite/src/src/vdbesort.c @@ -55,7 +55,7 @@ ** is like Close() followed by Init() only ** much faster. ** -** The interfaces above must be called in a particular order. Write() can +** The interfaces above must be called in a particular order. Write() can ** only occur in between Init()/Reset() and Rewind(). Next(), Rowkey(), and ** Compare() can only occur in between Rewind() and Close()/Reset(). i.e. ** @@ -63,16 +63,16 @@ ** for each record: Write() ** Rewind() ** Rowkey()/Compare() -** Next() +** Next() ** Close() ** ** Algorithm: ** -** Records passed to the sorter via calls to Write() are initially held +** Records passed to the sorter via calls to Write() are initially held ** unsorted in main memory. Assuming the amount of memory used never exceeds ** a threshold, when Rewind() is called the set of records is sorted using ** an in-memory merge sort. In this case, no temporary files are required -** and subsequent calls to Rowkey(), Next() and Compare() read records +** and subsequent calls to Rowkey(), Next() and Compare() read records ** directly from main memory. ** ** If the amount of space used to store records in main memory exceeds the @@ -82,10 +82,10 @@ ** of PMAs may be created by merging existing PMAs together - for example ** merging two or more level-0 PMAs together creates a level-1 PMA. ** -** The threshold for the amount of main memory to use before flushing +** The threshold for the amount of main memory to use before flushing ** records to a PMA is roughly the same as the limit configured for the -** page-cache of the main database. Specifically, the threshold is set to -** the value returned by "PRAGMA main.page_size" multipled by +** page-cache of the main database. Specifically, the threshold is set to +** the value returned by "PRAGMA main.page_size" multipled by ** that returned by "PRAGMA main.cache_size", in bytes. ** ** If the sorter is running in single-threaded mode, then all PMAs generated @@ -102,7 +102,7 @@ ** than zero, and (b) worker threads have been enabled at runtime by calling ** "PRAGMA threads=N" with some value of N greater than 0. ** -** When Rewind() is called, any data remaining in memory is flushed to a +** When Rewind() is called, any data remaining in memory is flushed to a ** final PMA. So at this point the data is stored in some number of sorted ** PMAs within temporary files on disk. ** @@ -114,16 +114,16 @@ ** ** Or, if running in multi-threaded mode, then a background thread is ** launched to merge the existing PMAs. Once the background thread has -** merged T bytes of data into a single sorted PMA, the main thread +** merged T bytes of data into a single sorted PMA, the main thread ** begins reading keys from that PMA while the background thread proceeds ** with merging the next T bytes of data. And so on. ** -** Parameter T is set to half the value of the memory threshold used +** Parameter T is set to half the value of the memory threshold used ** by Write() above to determine when to create a new PMA. ** -** If there are more than SORTER_MAX_MERGE_COUNT PMAs in total when -** Rewind() is called, then a hierarchy of incremental-merges is used. -** First, T bytes of data from the first SORTER_MAX_MERGE_COUNT PMAs on +** If there are more than SORTER_MAX_MERGE_COUNT PMAs in total when +** Rewind() is called, then a hierarchy of incremental-merges is used. +** First, T bytes of data from the first SORTER_MAX_MERGE_COUNT PMAs on ** disk are merged together. Then T bytes of data from the second set, and ** so on, such that no operation ever merges more than SORTER_MAX_MERGE_COUNT ** PMAs at a time. This done is to improve locality. @@ -138,7 +138,7 @@ #include "sqliteInt.h" #include "vdbeInt.h" -/* +/* ** If SQLITE_DEBUG_SORTER_THREADS is defined, this module outputs various ** messages to stderr that may be helpful in understanding the performance ** characteristics of the sorter in multi-threaded mode. @@ -167,7 +167,7 @@ typedef struct SorterList SorterList; /* In-memory list of records */ typedef struct IncrMerger IncrMerger; /* Read & merge multiple PMAs */ /* -** A container for a temp file handle and the current amount of data +** A container for a temp file handle and the current amount of data ** stored in the file. */ struct SorterFile { @@ -207,17 +207,17 @@ struct SorterList { ** the MergeEngine.nTree variable. ** ** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of +** pairs of PMA keys together. Element i contains the result of ** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. +** aTree element is set to the index of it. ** ** For the purposes of this comparison, EOF is considered greater than any ** other key value. If the keys are equal (only possible with two EOF ** values), it doesn't matter which index is stored. ** -** The (N/4) elements of aTree[] that precede the final (N/2) described +** The (N/4) elements of aTree[] that precede the final (N/2) described ** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that +** And so on. So that aTree[1] contains the index of the PmaReader that ** currently points to the smallest key value. aTree[0] is unused. ** ** Example: @@ -233,7 +233,7 @@ struct SorterList { ** ** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } ** -** The current element is "Apple" (the value of the key indicated by +** The current element is "Apple" (the value of the key indicated by ** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will ** be advanced to the next key in its segment. Say the next key is ** "Eggplant": @@ -274,8 +274,8 @@ struct MergeEngine { ** each thread requries its own UnpackedRecord object to unpack records in ** as part of comparison operations. ** -** Before a background thread is launched, variable bDone is set to 0. Then, -** right before it exits, the thread itself sets bDone to 1. This is used for +** Before a background thread is launched, variable bDone is set to 0. Then, +** right before it exits, the thread itself sets bDone to 1. This is used for ** two purposes: ** ** 1. When flushing the contents of memory to a level-0 PMA on disk, to @@ -306,7 +306,7 @@ struct SortSubtask { /* -** Main sorter structure. A single instance of this is allocated for each +** Main sorter structure. A single instance of this is allocated for each ** sorter cursor created by the VDBE. ** ** mxKeysize: @@ -362,21 +362,21 @@ struct PmaReader { }; /* -** Normally, a PmaReader object iterates through an existing PMA stored +** Normally, a PmaReader object iterates through an existing PMA stored ** within a temp file. However, if the PmaReader.pIncr variable points to ** an object of the following type, it may be used to iterate/merge through ** multiple PMAs simultaneously. ** -** There are two types of IncrMerger object - single (bUseThread==0) and -** multi-threaded (bUseThread==1). +** There are two types of IncrMerger object - single (bUseThread==0) and +** multi-threaded (bUseThread==1). ** -** A multi-threaded IncrMerger object uses two temporary files - aFile[0] -** and aFile[1]. Neither file is allowed to grow to more than mxSz bytes in -** size. When the IncrMerger is initialized, it reads enough data from -** pMerger to populate aFile[0]. It then sets variables within the -** corresponding PmaReader object to read from that file and kicks off -** a background thread to populate aFile[1] with the next mxSz bytes of -** sorted record data from pMerger. +** A multi-threaded IncrMerger object uses two temporary files - aFile[0] +** and aFile[1]. Neither file is allowed to grow to more than mxSz bytes in +** size. When the IncrMerger is initialized, it reads enough data from +** pMerger to populate aFile[0]. It then sets variables within the +** corresponding PmaReader object to read from that file and kicks off +** a background thread to populate aFile[1] with the next mxSz bytes of +** sorted record data from pMerger. ** ** When the PmaReader reaches the end of aFile[0], it blocks until the ** background thread has finished populating aFile[1]. It then exchanges @@ -387,7 +387,7 @@ struct PmaReader { ** ** A single-threaded IncrMerger does not open any temporary files of its ** own. Instead, it has exclusive access to mxSz bytes of space beginning -** at offset iStartOff of file pTask->file2. And instead of using a +** at offset iStartOff of file pTask->file2. And instead of using a ** background thread to prepare data for the PmaReader, with a single ** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with ** keys from pMerger by the calling thread whenever the PmaReader runs out @@ -499,7 +499,7 @@ static int vdbePmaReadBlob( assert( p->aBuffer ); - /* If there is no more data to be read from the buffer, read the next + /* If there is no more data to be read from the buffer, read the next ** p->nBuffer bytes of data from the file into it. Or, if there are less ** than p->nBuffer bytes remaining in the PMA, read all remaining data. */ iBuf = p->iReadOff % p->nBuffer; @@ -520,11 +520,11 @@ static int vdbePmaReadBlob( assert( rc!=SQLITE_IOERR_SHORT_READ ); if( rc!=SQLITE_OK ) return rc; } - nAvail = p->nBuffer - iBuf; + nAvail = p->nBuffer - iBuf; if( nByte<=nAvail ){ /* The requested data is available in the in-memory buffer. In this - ** case there is no need to make a copy of the data, just return a + ** case there is no need to make a copy of the data, just return a ** pointer into the buffer to the caller. */ *ppOut = &p->aBuffer[iBuf]; p->iReadOff += nByte; @@ -603,7 +603,7 @@ static int vdbePmaReadVarint(PmaReader *p, u64 *pnOut){ /* ** Attempt to memory map file pFile. If successful, set *pp to point to the -** new mapping and return SQLITE_OK. If the mapping is not attempted +** new mapping and return SQLITE_OK. If the mapping is not attempted ** (because the file is too large or the VFS layer is configured not to use ** mmap), return SQLITE_OK and set *pp to NULL. ** @@ -624,7 +624,7 @@ static int vdbeSorterMapFile(SortSubtask *pTask, SorterFile *pFile, u8 **pp){ /* ** Attach PmaReader pReadr to file pFile (if it is not already attached to -** that file) and seek it to offset iOff within the file. Return SQLITE_OK +** that file) and seek it to offset iOff within the file. Return SQLITE_OK ** if successful, or an SQLite error code if an error occurs. */ static int vdbePmaReaderSeek( @@ -714,11 +714,11 @@ static int vdbePmaReaderNext(PmaReader *pReadr){ /* ** Initialize PmaReader pReadr to scan through the PMA stored in file pFile -** starting at offset iStart and ending at offset iEof-1. This function -** leaves the PmaReader pointing to the first key in the PMA (or EOF if the +** starting at offset iStart and ending at offset iEof-1. This function +** leaves the PmaReader pointing to the first key in the PMA (or EOF if the ** PMA is empty). ** -** If the pnByte parameter is NULL, then it is assumed that the file +** If the pnByte parameter is NULL, then it is assumed that the file ** contains a single PMA, and that that PMA omits the initial length varint. */ static int vdbePmaReaderInit( @@ -751,7 +751,7 @@ static int vdbePmaReaderInit( /* ** A version of vdbeSorterCompare() that assumes that it has already been -** determined that the first field of key1 is equal to the first field of +** determined that the first field of key1 is equal to the first field of ** key2. */ static int vdbeSorterCompareTail( @@ -769,7 +769,7 @@ static int vdbeSorterCompareTail( } /* -** Compare key1 (buffer pKey1, size nKey1 bytes) with key2 (buffer pKey2, +** Compare key1 (buffer pKey1, size nKey1 bytes) with key2 (buffer pKey2, ** size nKey2 bytes). Use (pTask->pKeyInfo) for the collation sequences ** used by the comparison. Return the result of the comparison. ** @@ -914,7 +914,7 @@ static int vdbeSorterCompareInt( ** is non-zero and the sorter is able to guarantee a stable sort, nField ** is used instead. This is used when sorting records for a CREATE INDEX ** statement. In this case, keys are always delivered to the sorter in -** order of the primary key, which happens to be make up the final part +** order of the primary key, which happens to be make up the final part ** of the records being sorted. So if the sort is stable, there is never ** any reason to compare PK fields and they can be ignored for a small ** performance boost. @@ -1014,7 +1014,7 @@ int sqlite3VdbeSorterInit( } } - if( (pKeyInfo->nField+pKeyInfo->nXField)<13 + if( (pKeyInfo->nField+pKeyInfo->nXField)<13 && (pKeyInfo->aColl[0]==0 || pKeyInfo->aColl[0]==db->pDfltColl) ){ pSorter->typeMask = SORTER_TYPE_INTEGER | SORTER_TYPE_TEXT; @@ -1038,7 +1038,7 @@ static void vdbeSorterRecordFree(sqlite3 *db, SorterRecord *pRecord){ } /* -** Free all resources owned by the object indicated by argument pTask. All +** Free all resources owned by the object indicated by argument pTask. All ** fields of *pTask are zeroed before returning. */ static void vdbeSortSubtaskCleanup(sqlite3 *db, SortSubtask *pTask){ @@ -1137,7 +1137,7 @@ static int vdbeSorterCreateThread( } /* -** Join all outstanding threads launched by SorterWrite() to create +** Join all outstanding threads launched by SorterWrite() to create ** level-0 PMAs. */ static int vdbeSorterJoinAll(VdbeSorter *pSorter, int rcin){ @@ -1146,10 +1146,10 @@ static int vdbeSorterJoinAll(VdbeSorter *pSorter, int rcin){ /* This function is always called by the main user thread. ** - ** If this function is being called after SorterRewind() has been called, + ** If this function is being called after SorterRewind() has been called, ** it is possible that thread pSorter->aTask[pSorter->nTask-1].pThread ** is currently attempt to join one of the other threads. To avoid a race - ** condition where this thread also attempts to join the same object, join + ** condition where this thread also attempts to join the same object, join ** thread pSorter->aTask[pSorter->nTask-1].pThread first. */ for(i=pSorter->nTask-1; i>=0; i--){ SortSubtask *pTask = &pSorter->aTask[i]; @@ -1321,8 +1321,8 @@ static int vdbeSorterOpenTempFile( } /* -** If it has not already been allocated, allocate the UnpackedRecord -** structure at pTask->pUnpacked. Return SQLITE_OK if successful (or +** If it has not already been allocated, allocate the UnpackedRecord +** structure at pTask->pUnpacked. Return SQLITE_OK if successful (or ** if no allocation was required), or SQLITE_NOMEM otherwise. */ static int vdbeSortAllocUnpacked(SortSubtask *pTask){ @@ -1385,14 +1385,14 @@ static SorterCompare vdbeSorterGetCompare(VdbeSorter *p){ if( p->typeMask==SORTER_TYPE_INTEGER ){ return vdbeSorterCompareInt; }else if( p->typeMask==SORTER_TYPE_TEXT ){ - return vdbeSorterCompareText; + return vdbeSorterCompareText; } return vdbeSorterCompare; } /* -** Sort the linked list of records headed at pTask->pList. Return -** SQLITE_OK if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if +** Sort the linked list of records headed at pTask->pList. Return +** SQLITE_OK if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if ** an error occurs. */ static int vdbeSorterSort(SortSubtask *pTask, SorterList *pList){ @@ -1442,8 +1442,8 @@ static int vdbeSorterSort(SortSubtask *pTask, SorterList *pList){ pList->pList = p; sqlite3_free(aSlot); - assert( pTask->pUnpacked->errCode==SQLITE_OK - || pTask->pUnpacked->errCode==SQLITE_NOMEM + assert( pTask->pUnpacked->errCode==SQLITE_OK + || pTask->pUnpacked->errCode==SQLITE_NOMEM ); return pTask->pUnpacked->errCode; } @@ -1484,8 +1484,8 @@ static void vdbePmaWriteBlob(PmaWriter *p, u8 *pData, int nData){ memcpy(&p->aBuffer[p->iBufEnd], &pData[nData-nRem], nCopy); p->iBufEnd += nCopy; if( p->iBufEnd==p->nBuffer ){ - p->eFWErr = sqlite3OsWrite(p->pFd, - &p->aBuffer[p->iBufStart], p->iBufEnd - p->iBufStart, + p->eFWErr = sqlite3OsWrite(p->pFd, + &p->aBuffer[p->iBufStart], p->iBufEnd - p->iBufStart, p->iWriteOff + p->iBufStart ); p->iBufStart = p->iBufEnd = 0; @@ -1500,7 +1500,7 @@ static void vdbePmaWriteBlob(PmaWriter *p, u8 *pData, int nData){ /* ** Flush any buffered data to disk and clean up the PMA-writer object. ** The results of using the PMA-writer after this call are undefined. -** Return SQLITE_OK if flushing the buffered data succeeds or is not +** Return SQLITE_OK if flushing the buffered data succeeds or is not ** required. Otherwise, return an SQLite error code. ** ** Before returning, set *piEof to the offset immediately following the @@ -1509,8 +1509,8 @@ static void vdbePmaWriteBlob(PmaWriter *p, u8 *pData, int nData){ static int vdbePmaWriterFinish(PmaWriter *p, i64 *piEof){ int rc; if( p->eFWErr==0 && ALWAYS(p->aBuffer) && p->iBufEnd>p->iBufStart ){ - p->eFWErr = sqlite3OsWrite(p->pFd, - &p->aBuffer[p->iBufStart], p->iBufEnd - p->iBufStart, + p->eFWErr = sqlite3OsWrite(p->pFd, + &p->aBuffer[p->iBufStart], p->iBufEnd - p->iBufStart, p->iWriteOff + p->iBufStart ); } @@ -1522,11 +1522,11 @@ static int vdbePmaWriterFinish(PmaWriter *p, i64 *piEof){ } /* -** Write value iVal encoded as a varint to the PMA. Return +** Write value iVal encoded as a varint to the PMA. Return ** SQLITE_OK if successful, or an SQLite error code if an error occurs. */ static void vdbePmaWriteVarint(PmaWriter *p, u64 iVal){ - int nByte; + int nByte; u8 aByte[10]; nByte = sqlite3PutVarint(aByte, iVal); vdbePmaWriteBlob(p, aByte, nByte); @@ -1534,7 +1534,7 @@ static void vdbePmaWriteVarint(PmaWriter *p, u64 iVal){ /* ** Write the current contents of in-memory linked-list pList to a level-0 -** PMA in the temp file belonging to sub-task pTask. Return SQLITE_OK if +** PMA in the temp file belonging to sub-task pTask. Return SQLITE_OK if ** successful, or an SQLite error code otherwise. ** ** The format of a PMA is: @@ -1542,8 +1542,8 @@ static void vdbePmaWriteVarint(PmaWriter *p, u64 iVal){ ** * A varint. This varint contains the total number of bytes of content ** in the PMA (not including the varint itself). ** -** * One or more records packed end-to-end in order of ascending keys. -** Each record consists of a varint followed by a blob of data (the +** * One or more records packed end-to-end in order of ascending keys. +** Each record consists of a varint followed by a blob of data (the ** key). The varint is the number of bytes in the blob of data. */ static int vdbeSorterListToPMA(SortSubtask *pTask, SorterList *pList){ @@ -1552,7 +1552,7 @@ static int vdbeSorterListToPMA(SortSubtask *pTask, SorterList *pList){ PmaWriter writer; /* Object used to write to the file */ #ifdef SQLITE_DEBUG - /* Set iSz to the expected size of file pTask->file after writing the PMA. + /* Set iSz to the expected size of file pTask->file after writing the PMA. ** This is used by an assert() statement at the end of this function. */ i64 iSz = pList->szPMA + sqlite3VarintLen(pList->szPMA) + pTask->file.iEof; #endif @@ -1705,7 +1705,7 @@ static int vdbeSorterFlushPMA(VdbeSorter *pSorter){ SortSubtask *pTask = 0; /* Thread context used to create new PMA */ int nWorker = (pSorter->nTask-1); - /* Set the flag to indicate that at least one PMA has been written. + /* Set the flag to indicate that at least one PMA has been written. ** Or will be, anyhow. */ pSorter->bUsePMA = 1; @@ -1715,7 +1715,7 @@ static int vdbeSorterFlushPMA(VdbeSorter *pSorter){ ** the background thread from a sub-tasks previous turn is still running, ** skip it. If the first (pSorter->nTask-1) sub-tasks are all still busy, ** fall back to using the final sub-task. The first (pSorter->nTask-1) - ** sub-tasks are prefered as they use background threads - the final + ** sub-tasks are prefered as they use background threads - the final ** sub-task uses the main thread. */ for(i=0; iiPrev + i + 1) % nWorker; @@ -1793,14 +1793,14 @@ int sqlite3VdbeSorterWrite( ** If using the single large allocation mode (pSorter->aMemory!=0), then ** flush the contents of memory to a new PMA if (a) at least one value is ** already in memory and (b) the new value will not fit in memory. - ** + ** ** Or, if using separate allocations for each record, flush the contents ** of memory to a PMA if either of the following are true: ** - ** * The total memory allocated for the in-memory list is greater + ** * The total memory allocated for the in-memory list is greater ** than (page-size * cache-size), or ** - ** * The total memory allocated for the in-memory list is greater + ** * The total memory allocated for the in-memory list is greater ** than (page-size * 10) and sqlite3HeapNearlyFull() returns true. */ nReq = pVal->n + sizeof(SorterRecord); @@ -1935,11 +1935,11 @@ static int vdbeIncrBgPopulate(IncrMerger *pIncr){ ** aFile[0] such that the PmaReader should start rereading it from the ** beginning. ** -** For single-threaded objects, this is accomplished by literally reading -** keys from pIncr->pMerger and repopulating aFile[0]. +** For single-threaded objects, this is accomplished by literally reading +** keys from pIncr->pMerger and repopulating aFile[0]. ** -** For multi-threaded objects, all that is required is to wait until the -** background thread is finished (if it is not already) and then swap +** For multi-threaded objects, all that is required is to wait until the +** background thread is finished (if it is not already) and then swap ** aFile[0] and aFile[1] in place. If the contents of pMerger have not ** been exhausted, this function also launches a new background thread ** to populate the new aFile[1]. @@ -2079,7 +2079,7 @@ static void vdbeMergeEngineCompare( #define INCRINIT_TASK 1 #define INCRINIT_ROOT 2 -/* +/* ** Forward reference required as the vdbeIncrMergeInit() and ** vdbePmaReaderIncrInit() routines are called mutually recursively when ** building a merge tree. @@ -2088,7 +2088,7 @@ static int vdbePmaReaderIncrInit(PmaReader *pReadr, int eMode); /* ** Initialize the MergeEngine object passed as the second argument. Once this -** function returns, the first key of merged data may be read from the +** function returns, the first key of merged data may be read from the ** MergeEngine object in the usual fashion. ** ** If argument eMode is INCRINIT_ROOT, then it is assumed that any IncrMerge @@ -2098,8 +2098,8 @@ static int vdbePmaReaderIncrInit(PmaReader *pReadr, int eMode); ** required is to call vdbePmaReaderNext() on each PmaReader to point it at ** its first key. ** -** Otherwise, if eMode is any value other than INCRINIT_ROOT, then use -** vdbePmaReaderIncrMergeInit() to initialize each PmaReader that feeds data +** Otherwise, if eMode is any value other than INCRINIT_ROOT, then use +** vdbePmaReaderIncrMergeInit() to initialize each PmaReader that feeds data ** to pMerger. ** ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. @@ -2149,19 +2149,19 @@ static int vdbeMergeEngineInit( ** object at (pReadr->pIncr). ** ** If argument eMode is set to INCRINIT_NORMAL, then all PmaReaders -** in the sub-tree headed by pReadr are also initialized. Data is then -** loaded into the buffers belonging to pReadr and it is set to point to +** in the sub-tree headed by pReadr are also initialized. Data is then +** loaded into the buffers belonging to pReadr and it is set to point to ** the first key in its range. ** ** If argument eMode is set to INCRINIT_TASK, then pReadr is guaranteed ** to be a multi-threaded PmaReader and this function is being called in a -** background thread. In this case all PmaReaders in the sub-tree are +** background thread. In this case all PmaReaders in the sub-tree are ** initialized as for INCRINIT_NORMAL and the aFile[1] buffer belonging to ** pReadr is populated. However, pReadr itself is not set up to point ** to its first key. A call to vdbePmaReaderNext() is still required to do -** that. +** that. ** -** The reason this function does not call vdbePmaReaderNext() immediately +** The reason this function does not call vdbePmaReaderNext() immediately ** in the INCRINIT_TASK case is that vdbePmaReaderNext() assumes that it has ** to block on thread (pTask->thread) before accessing aFile[1]. But, since ** this entire function is being run by thread (pTask->thread), that will @@ -2217,12 +2217,12 @@ static int vdbePmaReaderIncrMergeInit(PmaReader *pReadr, int eMode){ if( rc==SQLITE_OK && pIncr->bUseThread ){ /* Use the current thread to populate aFile[1], even though this ** PmaReader is multi-threaded. If this is an INCRINIT_TASK object, - ** then this function is already running in background thread - ** pIncr->pTask->thread. + ** then this function is already running in background thread + ** pIncr->pTask->thread. ** - ** If this is the INCRINIT_ROOT object, then it is running in the + ** If this is the INCRINIT_ROOT object, then it is running in the ** main VDBE thread. But that is Ok, as that thread cannot return - ** control to the VDBE or proceed with anything useful until the + ** control to the VDBE or proceed with anything useful until the ** first results are ready from this merger object anyway. */ assert( eMode==INCRINIT_ROOT || eMode==INCRINIT_TASK ); @@ -2239,7 +2239,7 @@ static int vdbePmaReaderIncrMergeInit(PmaReader *pReadr, int eMode){ #if SQLITE_MAX_WORKER_THREADS>0 /* -** The main routine for vdbePmaReaderIncrMergeInit() operations run in +** The main routine for vdbePmaReaderIncrMergeInit() operations run in ** background threads. */ static void *vdbePmaReaderBgIncrInit(void *pCtx){ @@ -2257,8 +2257,8 @@ static void *vdbePmaReaderBgIncrInit(void *pCtx){ ** (if pReadr->pIncr==0), then this function is a no-op. Otherwise, it invokes ** the vdbePmaReaderIncrMergeInit() function with the parameters passed to ** this routine to initialize the incremental merge. -** -** If the IncrMerger object is multi-threaded (IncrMerger.bUseThread==1), +** +** If the IncrMerger object is multi-threaded (IncrMerger.bUseThread==1), ** then a background thread is launched to call vdbePmaReaderIncrMergeInit(). ** Or, if the IncrMerger is single threaded, the same function is called ** using the current thread. @@ -2288,7 +2288,7 @@ static int vdbePmaReaderIncrInit(PmaReader *pReadr, int eMode){ ** to NULL and return an SQLite error code. ** ** When this function is called, *piOffset is set to the offset of the -** first PMA to read from pTask->file. Assuming no error occurs, it is +** first PMA to read from pTask->file. Assuming no error occurs, it is ** set to the offset immediately following the last byte of the last ** PMA before returning. If an error does occur, then the final value of ** *piOffset is undefined. @@ -2398,12 +2398,12 @@ static int vdbeSorterAddToTree( /* ** This function is called as part of a SorterRewind() operation on a sorter ** that has already written two or more level-0 PMAs to one or more temp -** files. It builds a tree of MergeEngine/IncrMerger/PmaReader objects that +** files. It builds a tree of MergeEngine/IncrMerger/PmaReader objects that ** can be used to incrementally merge all PMAs on disk. ** ** If successful, SQLITE_OK is returned and *ppOut set to point to the ** MergeEngine object at the root of the tree before returning. Or, if an -** error occurs, an SQLite error code is returned and the final value +** error occurs, an SQLite error code is returned and the final value ** of *ppOut is undefined. */ static int vdbeSorterMergeTreeBuild( @@ -2415,8 +2415,8 @@ static int vdbeSorterMergeTreeBuild( int iTask; #if SQLITE_MAX_WORKER_THREADS>0 - /* If the sorter uses more than one task, then create the top-level - ** MergeEngine here. This MergeEngine will read data from exactly + /* If the sorter uses more than one task, then create the top-level + ** MergeEngine here. This MergeEngine will read data from exactly ** one PmaReader per sub-task. */ assert( pSorter->bUseThreads || pSorter->nTask==1 ); if( pSorter->nTask>1 ){ @@ -2525,7 +2525,7 @@ static int vdbeSorterSetupMerge(VdbeSorter *pSorter){ } for(iTask=0; rc==SQLITE_OK && iTasknTask; iTask++){ /* Check that: - ** + ** ** a) The incremental merge object is configured to use the ** right task, and ** b) If it is using task (nTask-1), it is configured to run @@ -2588,7 +2588,7 @@ int sqlite3VdbeSorterRewind(const VdbeCursor *pCsr, int *pbEof){ return rc; } - /* Write the current in-memory list to a PMA. When the VdbeSorterWrite() + /* Write the current in-memory list to a PMA. When the VdbeSorterWrite() ** function flushes the contents of memory to disk, it immediately always ** creates a new list consisting of a single key immediately afterwards. ** So the list is never empty at this point. */ @@ -2600,7 +2600,7 @@ int sqlite3VdbeSorterRewind(const VdbeCursor *pCsr, int *pbEof){ vdbeSorterRewindDebug("rewind"); - /* Assuming no errors have occurred, set up a merger structure to + /* Assuming no errors have occurred, set up a merger structure to ** incrementally read and merge all remaining PMAs. */ assert( pSorter->pReader==0 ); if( rc==SQLITE_OK ){ @@ -2649,7 +2649,7 @@ int sqlite3VdbeSorterNext(sqlite3 *db, const VdbeCursor *pCsr, int *pbEof){ } /* -** Return a pointer to a buffer owned by the sorter that contains the +** Return a pointer to a buffer owned by the sorter that contains the ** current key. */ static void *vdbeSorterRowkey( diff --git a/third_party/sqlite/src/src/vdbetrace.c b/third_party/sqlite/src/src/vdbetrace.c index 7b47363991e0a..b565c5c485e44 100644 --- a/third_party/sqlite/src/src/vdbetrace.c +++ b/third_party/sqlite/src/src/vdbetrace.c @@ -48,8 +48,8 @@ static int findNextHostParameter(const char *zSql, int *pnToken){ /* ** This function returns a pointer to a nul-terminated string in memory ** obtained from sqlite3DbMalloc(). If sqlite3.nVdbeExec is 1, then the -** string contains a copy of zRawSql but with host parameters expanded to -** their current bindings. Or, if sqlite3.nVdbeExec is greater than 1, +** string contains a copy of zRawSql but with host parameters expanded to +** their current bindings. Or, if sqlite3.nVdbeExec is greater than 1, ** then the returned string holds a copy of zRawSql with "-- " prepended ** to each line of text. ** @@ -87,7 +87,7 @@ char *sqlite3VdbeExpandSql( char zBase[100]; /* Initial working space */ db = p->db; - sqlite3StrAccumInit(&out, 0, zBase, sizeof(zBase), + sqlite3StrAccumInit(&out, 0, zBase, sizeof(zBase), db->aLimit[SQLITE_LIMIT_LENGTH]); if( db->nVdbeExec>1 ){ while( *zRawSql ){ @@ -155,7 +155,7 @@ char *sqlite3VdbeExpandSql( nOut = SQLITE_TRACE_SIZE_LIMIT; while( nOutn && (pVar->z[nOut]&0xc0)==0x80 ){ nOut++; } } -#endif +#endif sqlite3XPrintf(&out, "'%.*q'", nOut, pVar->z); #ifdef SQLITE_TRACE_SIZE_LIMIT if( nOutn ){ diff --git a/third_party/sqlite/src/src/vtab.c b/third_party/sqlite/src/src/vtab.c index 30079cbb5ea94..4ba664374cc18 100644 --- a/third_party/sqlite/src/src/vtab.c +++ b/third_party/sqlite/src/src/vtab.c @@ -17,7 +17,7 @@ /* ** Before a virtual table xCreate() or xConnect() method is invoked, the ** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of +** this struct allocated on the stack. It is used by the implementation of ** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which ** are invoked only from within xCreate and xConnect methods. */ @@ -124,7 +124,7 @@ int sqlite3_create_module_v2( /* ** Lock the virtual table so that it cannot be disconnected. ** Locks nest. Every lock should have a corresponding unlock. -** If an unlock is omitted, resources leaks will occur. +** If an unlock is omitted, resources leaks will occur. ** ** If a disconnect is attempted while a virtual table is locked, ** the disconnect is deferred until all locks have been removed. @@ -136,7 +136,7 @@ void sqlite3VtabLock(VTable *pVTab){ /* ** pTab is a pointer to a Table structure representing a virtual-table. -** Return a pointer to the VTable object used by connection db to access +** Return a pointer to the VTable object used by connection db to access ** this virtual-table, if one has been created, or NULL otherwise. */ VTable *sqlite3GetVTable(sqlite3 *db, Table *pTab){ @@ -170,7 +170,7 @@ void sqlite3VtabUnlock(VTable *pVTab){ /* ** Table p is a virtual table. This function moves all elements in the ** p->pVTable list to the sqlite3.pDisconnect lists of their associated -** database connections to be disconnected at the next opportunity. +** database connections to be disconnected at the next opportunity. ** Except, if argument db is not NULL, then the entry associated with ** connection db is left in the p->pVTable list. */ @@ -179,8 +179,8 @@ static VTable *vtabDisconnectAll(sqlite3 *db, Table *p){ VTable *pVTable = p->pVTable; p->pVTable = 0; - /* Assert that the mutex (if any) associated with the BtShared database - ** that contains table p is held by the caller. See header comments + /* Assert that the mutex (if any) associated with the BtShared database + ** that contains table p is held by the caller. See header comments ** above function sqlite3VtabUnlockList() for an explanation of why ** this makes it safe to access the sqlite3.pDisconnect list of any ** database connection that may have an entry in the p->pVTable list. @@ -236,7 +236,7 @@ void sqlite3VtabDisconnect(sqlite3 *db, Table *p){ ** Disconnect all the virtual table objects in the sqlite3.pDisconnect list. ** ** This function may only be called when the mutexes associated with all -** shared b-tree databases opened using connection db are held by the +** shared b-tree databases opened using connection db are held by the ** caller. This is done to protect the sqlite3.pDisconnect list. The ** sqlite3.pDisconnect list is accessed only as follows: ** @@ -249,7 +249,7 @@ void sqlite3VtabDisconnect(sqlite3 *db, Table *p){ ** or, if the virtual table is stored in a non-sharable database, then ** the database handle mutex is held. ** -** As a result, a sqlite3.pDisconnect cannot be accessed simultaneously +** As a result, a sqlite3.pDisconnect cannot be accessed simultaneously ** by multiple threads. It is thread-safe. */ void sqlite3VtabUnlockList(sqlite3 *db){ @@ -275,12 +275,12 @@ void sqlite3VtabUnlockList(sqlite3 *db){ ** record. ** ** Since it is a virtual-table, the Table structure contains a pointer -** to the head of a linked list of VTable structures. Each VTable +** to the head of a linked list of VTable structures. Each VTable ** structure is associated with a single sqlite3* user of the schema. -** The reference count of the VTable structure associated with database -** connection db is decremented immediately (which may lead to the +** The reference count of the VTable structure associated with database +** connection db is decremented immediately (which may lead to the ** structure being xDisconnected and free). Any other VTable structures -** in the list are moved to the sqlite3.pDisconnect list of the associated +** in the list are moved to the sqlite3.pDisconnect list of the associated ** database connection. */ void sqlite3VtabClear(sqlite3 *db, Table *p){ @@ -358,7 +358,7 @@ void sqlite3VtabBeginParse( ** The second call, to obtain permission to create the table, is made now. */ if( pTable->azModuleArg ){ - sqlite3AuthCheck(pParse, SQLITE_CREATE_VTABLE, pTable->zName, + sqlite3AuthCheck(pParse, SQLITE_CREATE_VTABLE, pTable->zName, pTable->azModuleArg[0], pParse->db->aDb[iDb].zDbSName); } #endif @@ -390,7 +390,7 @@ void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){ addArgumentToVtab(pParse); pParse->sArg.z = 0; if( pTab->nModuleArg<1 ) return; - + /* If the CREATE VIRTUAL TABLE statement is being entered for the ** first time (in other words if the virtual table is actually being ** created now instead of just being read out of sqlite_master) then @@ -410,9 +410,9 @@ void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){ } zStmt = sqlite3MPrintf(db, "CREATE VIRTUAL TABLE %T", &pParse->sNameToken); - /* A slot for the record has already been allocated in the + /* A slot for the record has already been allocated in the ** SQLITE_MASTER table. We just need to update that slot with all - ** the information we've collected. + ** the information we've collected. ** ** The VM register number pParse->regRowid holds the rowid of an ** entry in the sqlite_master table tht was created for this vtab @@ -493,7 +493,7 @@ void sqlite3VtabArgExtend(Parse *pParse, Token *p){ ** to this procedure. */ static int vtabCallConstructor( - sqlite3 *db, + sqlite3 *db, Table *pTab, Module *pMod, int (*xConstruct)(sqlite3*,void*,int,const char*const*,sqlite3_vtab**,char**), @@ -512,7 +512,7 @@ static int vtabCallConstructor( /* Check that the virtual-table is not already being initialized */ for(pCtx=db->pVtabCtx; pCtx; pCtx=pCtx->pPrior){ if( pCtx->pTab==pTab ){ - *pzErr = sqlite3MPrintf(db, + *pzErr = sqlite3MPrintf(db, "vtable constructor called recursively: %s", pTab->zName ); return SQLITE_LOCKED; @@ -571,7 +571,7 @@ static int vtabCallConstructor( int iCol; u8 oooHidden = 0; /* If everything went according to plan, link the new VTable structure - ** into the linked list headed by pTab->pVTable. Then loop through the + ** into the linked list headed by pTab->pVTable. Then loop through the ** columns of the table to see if any of them contain the token "hidden". ** If so, set the Column COLFLAG_HIDDEN flag and remove the token from ** the type string. */ @@ -616,7 +616,7 @@ static int vtabCallConstructor( /* ** This function is invoked by the parser to call the xConnect() method -** of the virtual table pTab. If an error occurs, an error code is returned +** of the virtual table pTab. If an error occurs, an error code is returned ** and an error left in pParse. ** ** This call is a no-op if table pTab is not a virtual table. @@ -685,7 +685,7 @@ static void addToVTrans(sqlite3 *db, VTable *pVTab){ /* ** This function is invoked by the vdbe to call the xCreate method -** of the virtual table named zTab in database iDb. +** of the virtual table named zTab in database iDb. ** ** If an error occurs, *pzErr is set to point to an English language ** description of the error and an SQLITE_XXX error code is returned. @@ -704,8 +704,8 @@ int sqlite3VtabCallCreate(sqlite3 *db, int iDb, const char *zTab, char **pzErr){ zMod = pTab->azModuleArg[0]; pMod = (Module*)sqlite3HashFind(&db->aModule, zMod); - /* If the module has been registered and includes a Create method, - ** invoke it now. If the module has not been registered, return an + /* If the module has been registered and includes a Create method, + ** invoke it now. If the module has not been registered, return an ** error. Otherwise, do nothing. */ if( pMod==0 || pMod->pModule->xCreate==0 || pMod->pModule->xDestroy==0 ){ @@ -761,8 +761,8 @@ int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){ pParse->declareVtab = 1; pParse->db = db; pParse->nQueryLoop = 1; - - if( SQLITE_OK==sqlite3RunParser(pParse, zCreateTable, &zErr) + + if( SQLITE_OK==sqlite3RunParser(pParse, zCreateTable, &zErr) && pParse->pNewTable && !db->mallocFailed && !pParse->pNewTable->pSelect @@ -795,7 +795,7 @@ int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){ rc = SQLITE_ERROR; } pParse->declareVtab = 0; - + if( pParse->pVdbe ){ sqlite3VdbeFinalize(pParse->pVdbe); } @@ -853,7 +853,7 @@ int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab){ ** called is identified by the second argument, "offset", which is ** the offset of the method to call in the sqlite3_module structure. ** -** The array is cleared after invoking the callbacks. +** The array is cleared after invoking the callbacks. */ static void callFinaliser(sqlite3 *db, int offset){ int i; @@ -902,7 +902,7 @@ int sqlite3VtabSync(sqlite3 *db, Vdbe *p){ } /* -** Invoke the xRollback method of all virtual tables in the +** Invoke the xRollback method of all virtual tables in the ** sqlite3.aVTrans array. Then clear the array itself. */ int sqlite3VtabRollback(sqlite3 *db){ @@ -911,7 +911,7 @@ int sqlite3VtabRollback(sqlite3 *db){ } /* -** Invoke the xCommit method of all virtual tables in the +** Invoke the xCommit method of all virtual tables in the ** sqlite3.aVTrans array. Then clear the array itself. */ int sqlite3VtabCommit(sqlite3 *db){ @@ -933,7 +933,7 @@ int sqlite3VtabBegin(sqlite3 *db, VTable *pVTab){ /* Special case: If db->aVTrans is NULL and db->nVTrans is greater ** than zero, then this function is being called from within a - ** virtual module xSync() callback. It is illegal to write to + ** virtual module xSync() callback. It is illegal to write to ** virtual module tables in this case, so return SQLITE_LOCKED. */ if( sqlite3VtabInSync(db) ){ @@ -941,7 +941,7 @@ int sqlite3VtabBegin(sqlite3 *db, VTable *pVTab){ } if( !pVTab ){ return SQLITE_OK; - } + } pModule = pVTab->pVtab->pModule; if( pModule->xBegin ){ @@ -954,7 +954,7 @@ int sqlite3VtabBegin(sqlite3 *db, VTable *pVTab){ } } - /* Invoke the xBegin method. If successful, add the vtab to the + /* Invoke the xBegin method. If successful, add the vtab to the ** sqlite3.aVTrans[] array. */ rc = growVTrans(db); if( rc==SQLITE_OK ){ @@ -978,11 +978,11 @@ int sqlite3VtabBegin(sqlite3 *db, VTable *pVTab){ ** as the second argument to the virtual table method invoked. ** ** If op is SAVEPOINT_BEGIN, the xSavepoint method is invoked. If it is -** SAVEPOINT_ROLLBACK, the xRollbackTo method. Otherwise, if op is +** SAVEPOINT_ROLLBACK, the xRollbackTo method. Otherwise, if op is ** SAVEPOINT_RELEASE, then the xRelease method of each virtual table with ** an open transaction is invoked. ** -** If any virtual table method returns an error code other than SQLITE_OK, +** If any virtual table method returns an error code other than SQLITE_OK, ** processing is abandoned and the error returned to the caller of this ** function immediately. If all calls to virtual table methods are successful, ** SQLITE_OK is returned. @@ -1029,7 +1029,7 @@ int sqlite3VtabSavepoint(sqlite3 *db, int op, int iSavepoint){ ** This routine is used to allow virtual table implementations to ** overload MATCH, LIKE, GLOB, and REGEXP operators. ** -** Return either the pDef argument (indicating no change) or a +** Return either the pDef argument (indicating no change) or a ** new FuncDef structure that is marked as ephemeral using the ** SQLITE_FUNC_EPHEM flag. */ @@ -1061,9 +1061,9 @@ FuncDef *sqlite3VtabOverloadFunction( assert( pVtab->pModule!=0 ); pMod = (sqlite3_module *)pVtab->pModule; if( pMod->xFindFunction==0 ) return pDef; - + /* Call the xFindFunction method on the virtual table implementation - ** to see if the implementation wants to overload this function + ** to see if the implementation wants to overload this function */ zLowerName = sqlite3DbStrDup(db, pDef->zName); if( zLowerName ){ @@ -1174,7 +1174,7 @@ void sqlite3VtabEponymousTableClear(sqlite3 *db, Module *pMod){ Table *pTab = pMod->pEpoTab; if( pTab!=0 ){ /* Mark the table as Ephemeral prior to deleting it, so that the - ** sqlite3DeleteTable() routine will know that it is not stored in + ** sqlite3DeleteTable() routine will know that it is not stored in ** the schema. */ pTab->tabFlags |= TF_Ephemeral; sqlite3DeleteTable(db, pTab); @@ -1190,8 +1190,8 @@ void sqlite3VtabEponymousTableClear(sqlite3 *db, Module *pMod){ ** within an xUpdate method. */ int sqlite3_vtab_on_conflict(sqlite3 *db){ - static const unsigned char aMap[] = { - SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE + static const unsigned char aMap[] = { + SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE }; #ifdef SQLITE_ENABLE_API_ARMOR if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; @@ -1203,7 +1203,7 @@ int sqlite3_vtab_on_conflict(sqlite3 *db){ } /* -** Call from within the xCreate() or xConnect() methods to provide +** Call from within the xCreate() or xConnect() methods to provide ** the SQLite core with additional information about the behavior ** of the virtual table being implemented. */ diff --git a/third_party/sqlite/src/src/wal.c b/third_party/sqlite/src/src/wal.c index 09f605fe57624..0a3bc37a4e059 100644 --- a/third_party/sqlite/src/src/wal.c +++ b/third_party/sqlite/src/src/wal.c @@ -10,7 +10,7 @@ ** ************************************************************************* ** -** This file contains the implementation of a write-ahead log (WAL) used in +** This file contains the implementation of a write-ahead log (WAL) used in ** "journal_mode=WAL" mode. ** ** WRITE-AHEAD LOG (WAL) FILE FORMAT @@ -19,7 +19,7 @@ ** Each frame records the revised content of a single page from the ** database file. All changes to the database are recorded by writing ** frames into the WAL. Transactions commit when a frame is written that -** contains a commit marker. A single WAL can and usually does record +** contains a commit marker. A single WAL can and usually does record ** multiple transactions. Periodically, the content of the WAL is ** transferred back into the database file in an operation called a ** "checkpoint". @@ -45,11 +45,11 @@ ** ** Immediately following the wal-header are zero or more frames. Each ** frame consists of a 24-byte frame-header followed by a bytes -** of page data. The frame-header is six big-endian 32-bit unsigned +** of page data. The frame-header is six big-endian 32-bit unsigned ** integer values, as follows: ** ** 0: Page number. -** 4: For commit records, the size of the database image in pages +** 4: For commit records, the size of the database image in pages ** after the commit. For all other records, zero. ** 8: Salt-1 (copied from the header) ** 12: Salt-2 (copied from the header) @@ -75,7 +75,7 @@ ** the checksum. The checksum is computed by interpreting the input as ** an even number of unsigned 32-bit integers: x[0] through x[N]. The ** algorithm used for the checksum is as follows: -** +** ** for i from 0 to n-1 step 2: ** s0 += x[i] + s1; ** s1 += x[i+1] + s0; @@ -83,7 +83,7 @@ ** ** Note that s0 and s1 are both weighted checksums using fibonacci weights ** in reverse order (the largest fibonacci weight occurs on the first element -** of the sequence being summed.) The s1 value spans all 32-bit +** of the sequence being summed.) The s1 value spans all 32-bit ** terms of the sequence whereas s0 omits the final term. ** ** On a checkpoint, the WAL is first VFS.xSync-ed, then valid content of the @@ -116,19 +116,19 @@ ** multiple concurrent readers to view different versions of the database ** content simultaneously. ** -** The reader algorithm in the previous paragraphs works correctly, but +** The reader algorithm in the previous paragraphs works correctly, but ** because frames for page P can appear anywhere within the WAL, the ** reader has to scan the entire WAL looking for page P frames. If the ** WAL is large (multiple megabytes is typical) that scan can be slow, ** and read performance suffers. To overcome this problem, a separate ** data structure called the wal-index is maintained to expedite the ** search for frames of a particular page. -** +** ** WAL-INDEX FORMAT ** ** Conceptually, the wal-index is shared memory, though VFS implementations ** might choose to implement the wal-index using a mmapped file. Because -** the wal-index is shared memory, SQLite does not support journal_mode=WAL +** the wal-index is shared memory, SQLite does not support journal_mode=WAL ** on a network filesystem. All users of the database must be able to ** share memory. ** @@ -142,28 +142,28 @@ ** byte order of the host computer. ** ** The purpose of the wal-index is to answer this question quickly: Given -** a page number P and a maximum frame index M, return the index of the +** a page number P and a maximum frame index M, return the index of the ** last frame in the wal before frame M for page P in the WAL, or return ** NULL if there are no frames for page P in the WAL prior to M. ** ** The wal-index consists of a header region, followed by an one or -** more index blocks. +** more index blocks. ** ** The wal-index header contains the total number of frames within the WAL ** in the mxFrame field. ** -** Each index block except for the first contains information on +** Each index block except for the first contains information on ** HASHTABLE_NPAGE frames. The first index block contains information on -** HASHTABLE_NPAGE_ONE frames. The values of HASHTABLE_NPAGE_ONE and +** HASHTABLE_NPAGE_ONE frames. The values of HASHTABLE_NPAGE_ONE and ** HASHTABLE_NPAGE are selected so that together the wal-index header and ** first index block are the same size as all other index blocks in the ** wal-index. ** ** Each index block contains two sections, a page-mapping that contains the -** database page number associated with each wal frame, and a hash-table +** database page number associated with each wal frame, and a hash-table ** that allows readers to query an index block for a specific page number. ** The page-mapping is an array of HASHTABLE_NPAGE (or HASHTABLE_NPAGE_ONE -** for the first index block) 32-bit page numbers. The first entry in the +** for the first index block) 32-bit page numbers. The first entry in the ** first index-block contains the database page number corresponding to the ** first frame in the WAL file. The first entry in the second index block ** in the WAL file corresponds to the (HASHTABLE_NPAGE_ONE+1)th frame in @@ -184,8 +184,8 @@ ** ** The hash table consists of HASHTABLE_NSLOT 16-bit unsigned integers. ** HASHTABLE_NSLOT = 2*HASHTABLE_NPAGE, and there is one entry in the -** hash table for each page number in the mapping section, so the hash -** table is never more than half full. The expected number of collisions +** hash table for each page number in the mapping section, so the hash +** table is never more than half full. The expected number of collisions ** prior to finding a match is 1. Each entry of the hash table is an ** 1-based index of an entry in the mapping section of the same ** index block. Let K be the 1-based index of the largest entry in @@ -204,12 +204,12 @@ ** reached) until an unused hash slot is found. Let the first unused slot ** be at index iUnused. (iUnused might be less than iKey if there was ** wrap-around.) Because the hash table is never more than half full, -** the search is guaranteed to eventually hit an unused entry. Let +** the search is guaranteed to eventually hit an unused entry. Let ** iMax be the value between iKey and iUnused, closest to iUnused, ** where aHash[iMax]==P. If there is no iMax entry (if there exists ** no hash slot such that aHash[i]==p) then page P is not in the ** current index block. Otherwise the iMax-th mapping entry of the -** current index block corresponds to the last entry that references +** current index block corresponds to the last entry that references ** page P. ** ** A hash search begins with the last index block and moves toward the @@ -234,7 +234,7 @@ ** if no values greater than K0 had ever been inserted into the hash table ** in the first place - which is what reader one wants. Meanwhile, the ** second reader using K1 will see additional values that were inserted -** later, which is exactly what reader two wants. +** later, which is exactly what reader two wants. ** ** When a rollback occurs, the value of K is decreased. Hash table entries ** that correspond to frames greater than the new K value are removed @@ -262,7 +262,7 @@ int sqlite3WalTrace = 0; ** values in the wal-header are correct and (b) the version field is not ** WAL_MAX_VERSION, recovery fails and SQLite returns SQLITE_CANTOPEN. ** -** Similarly, if a client successfully reads a wal-index header (i.e. the +** Similarly, if a client successfully reads a wal-index header (i.e. the ** checksum test is successful) and finds that the version field is not ** WALINDEX_MAX_VERSION, then no read-transaction is opened and SQLite ** returns SQLITE_CANTOPEN. @@ -300,7 +300,7 @@ typedef struct WalCkptInfo WalCkptInfo; ** ** The szPage value can be any power of 2 between 512 and 32768, inclusive. ** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. +** added in 3.7.1 when support for 64K pages was added. */ struct WalIndexHdr { u32 iVersion; /* Wal-index version */ @@ -342,7 +342,7 @@ struct WalIndexHdr { ** There is one entry in aReadMark[] for each reader lock. If a reader ** holds read-lock K, then the value in aReadMark[K] is no greater than ** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is +** for any aReadMark[] means that entry is unused. aReadMark[0] is ** a special case; its value is never used and it exists as a place-holder ** to avoid having to offset aReadMark[] indexs by one. Readers holding ** WAL_READ_LOCK(0) always ignore the entire WAL and read all content @@ -362,7 +362,7 @@ struct WalIndexHdr { ** previous sentence is when nBackfill equals mxFrame (meaning that everything ** in the WAL has been backfilled into the database) then new readers ** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore +** get all their all content directly from the database file and ignore ** the WAL. ** ** Writers normally append new frames to the end of the WAL. However, @@ -405,14 +405,14 @@ struct WalCkptInfo { ** big-endian format in the first 4 bytes of a WAL file. ** ** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting +** file are calculated by treating all data as an array of 32-bit +** big-endian words. Otherwise, they are calculated by interpreting ** all data as 32-bit little-endian words. */ #define WAL_MAGIC 0x377f0682 /* -** Return the offset of frame iFrame in the write-ahead log file, +** Return the offset of frame iFrame in the write-ahead log file, ** assuming a database page size of szPage bytes. The offset returned ** is to the start of the write-ahead log frame-header. */ @@ -460,7 +460,7 @@ struct Wal { ** Candidate values for Wal.exclusiveMode. */ #define WAL_NORMAL_MODE 0 -#define WAL_EXCLUSIVE_MODE 1 +#define WAL_EXCLUSIVE_MODE 1 #define WAL_HEAPMEMORY_MODE 2 /* @@ -479,7 +479,7 @@ typedef u16 ht_slot; /* ** This structure is used to implement an iterator that loops through ** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the +** correspond to the same database page, the iterator visits only the ** frame most recently written to the WAL (in other words, the frame with ** the largest index). ** @@ -515,7 +515,7 @@ struct WalIterator { #define HASHTABLE_HASH_1 383 /* Should be prime */ #define HASHTABLE_NSLOT (HASHTABLE_NPAGE*2) /* Must be a power of 2 */ -/* +/* ** The block of page numbers associated with the first hash-table in a ** wal-index is smaller than usual. This is so that there is a complete ** hash-table on each aligned 32KB page of the wal-index. @@ -560,7 +560,7 @@ static int walIndexPage(Wal *pWal, int iPage, volatile u32 **ppPage){ pWal->apWiData[iPage] = (u32 volatile *)sqlite3MallocZero(WALINDEX_PGSZ); if( !pWal->apWiData[iPage] ) rc = SQLITE_NOMEM_BKPT; }else{ - rc = sqlite3OsShmMap(pWal->pDbFd, iPage, WALINDEX_PGSZ, + rc = sqlite3OsShmMap(pWal->pDbFd, iPage, WALINDEX_PGSZ, pWal->writeLock, (void volatile **)&pWal->apWiData[iPage] ); if( rc==SQLITE_READONLY ){ @@ -604,7 +604,7 @@ static volatile WalIndexHdr *walIndexHdr(Wal *pWal){ ) /* -** Generate or extend an 8 byte checksum based on the data in +** Generate or extend an 8 byte checksum based on the data in ** array aByte[] and the initial values of aIn[0] and aIn[1] (or ** initial values of 0 and 0 if aIn==NULL). ** @@ -676,11 +676,11 @@ static void walIndexWriteHdr(Wal *pWal){ /* ** This function encodes a single frame header and writes it to a buffer -** supplied by the caller. A frame-header is made up of a series of +** supplied by the caller. A frame-header is made up of a series of ** 4-byte big-endian integers, as follows: ** ** 0: Page number. -** 4: For commit records, the size of the database image in pages +** 4: For commit records, the size of the database image in pages ** after the commit. For all other records, zero. ** 8: Salt-1 (copied from the wal-header) ** 12: Salt-2 (copied from the wal-header) @@ -731,7 +731,7 @@ static int walDecodeFrame( assert( WAL_FRAME_HDRSIZE==24 ); /* A frame is only valid if the salt values in the frame-header - ** match the salt values in the wal-header. + ** match the salt values in the wal-header. */ if( memcmp(&pWal->hdr.aSalt, &aFrame[8], 8)!=0 ){ return 0; @@ -745,15 +745,15 @@ static int walDecodeFrame( } /* A frame is only valid if a checksum of the WAL header, - ** all prior frams, the first 16 bytes of this frame-header, - ** and the frame-data matches the checksum in the last 8 + ** all prior frams, the first 16 bytes of this frame-header, + ** and the frame-data matches the checksum in the last 8 ** bytes of this frame-header. */ nativeCksum = (pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN); walChecksumBytes(nativeCksum, aFrame, 8, aCksum, aCksum); walChecksumBytes(nativeCksum, aData, pWal->szPage, aCksum, aCksum); - if( aCksum[0]!=sqlite3Get4byte(&aFrame[16]) - || aCksum[1]!=sqlite3Get4byte(&aFrame[20]) + if( aCksum[0]!=sqlite3Get4byte(&aFrame[16]) + || aCksum[1]!=sqlite3Get4byte(&aFrame[20]) ){ /* Checksum failed. */ return 0; @@ -788,7 +788,7 @@ static const char *walLockName(int lockIdx){ } } #endif /*defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */ - + /* ** Set or release locks on the WAL. Locks are either shared or exclusive. @@ -845,15 +845,15 @@ static int walNextHash(int iPriorHash){ return (iPriorHash+1)&(HASHTABLE_NSLOT-1); } -/* +/* ** Return pointers to the hash table and page number array stored on ** page iHash of the wal-index. The wal-index is broken into 32KB pages ** numbered starting from 0. ** ** Set output variable *paHash to point to the start of the hash table -** in the wal-index file. Set *piZero to one less than the frame +** in the wal-index file. Set *piZero to one less than the frame ** number of the first frame indexed by this hash table. If a -** slot in the hash table is set to N, it refers to frame number +** slot in the hash table is set to N, it refers to frame number ** (*piZero+N) in the log. ** ** Finally, set *paPgno so that *paPgno[1] is the page number of the @@ -883,7 +883,7 @@ static int walHashGet( }else{ iZero = HASHTABLE_NPAGE_ONE + (iHash-1)*HASHTABLE_NPAGE; } - + *paPgno = &aPgno[-1]; *paHash = aHash; *piZero = iZero; @@ -894,7 +894,7 @@ static int walHashGet( /* ** Return the number of the wal-index page that contains the hash-table ** and page-number array that contain entries corresponding to WAL frame -** iFrame. The wal-index is broken up into 32KB pages. Wal-index pages +** iFrame. The wal-index is broken up into 32KB pages. Wal-index pages ** are numbered starting from 0. */ static int walFramePage(u32 iFrame){ @@ -946,7 +946,7 @@ static void walCleanupHash(Wal *pWal){ if( pWal->hdr.mxFrame==0 ) return; - /* Obtain pointers to the hash-table and page-number array containing + /* Obtain pointers to the hash-table and page-number array containing ** the entry that corresponds to frame pWal->hdr.mxFrame. It is guaranteed ** that the page said hash-table and array reside on is already mapped. */ @@ -964,9 +964,9 @@ static void walCleanupHash(Wal *pWal){ aHash[i] = 0; } } - + /* Zero the entries in the aPgno array that correspond to frames with - ** frame numbers greater than pWal->hdr.mxFrame. + ** frame numbers greater than pWal->hdr.mxFrame. */ nByte = (int)((char *)aHash - (char *)&aPgno[iLimit+1]); memset((void *)&aPgno[iLimit+1], 0, nByte); @@ -1011,9 +1011,9 @@ static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){ idx = iFrame - iZero; assert( idx <= HASHTABLE_NSLOT/2 + 1 ); - + /* If this is the first entry to be added to this hash-table, zero the - ** entire hash table and aPgno[] array before proceeding. + ** entire hash table and aPgno[] array before proceeding. */ if( idx==1 ){ int nByte = (int)((u8 *)&aHash[HASHTABLE_NSLOT] - (u8 *)&aPgno[1]); @@ -1022,8 +1022,8 @@ static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){ /* If the entry in aPgno[] is already set, then the previous writer ** must have exited unexpectedly in the middle of a transaction (after - ** writing one or more dirty pages to the WAL to free up memory). - ** Remove the remnants of that writers uncommitted transaction from + ** writing one or more dirty pages to the WAL to free up memory). + ** Remove the remnants of that writers uncommitted transaction from ** the hash-table before writing any new entries. */ if( aPgno[idx] ){ @@ -1073,7 +1073,7 @@ static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){ /* -** Recover the wal-index by reading the write-ahead log file. +** Recover the wal-index by reading the write-ahead log file. ** ** This routine first tries to establish an exclusive lock on the ** wal-index to prevent other threads/processes from doing anything @@ -1133,16 +1133,16 @@ static int walIndexRecover(Wal *pWal){ } /* If the database page size is not a power of two, or is greater than - ** SQLITE_MAX_PAGE_SIZE, conclude that the WAL file contains no valid + ** SQLITE_MAX_PAGE_SIZE, conclude that the WAL file contains no valid ** data. Similarly, if the 'magic' value is invalid, ignore the whole ** WAL file. */ magic = sqlite3Get4byte(&aBuf[0]); szPage = sqlite3Get4byte(&aBuf[8]); - if( (magic&0xFFFFFFFE)!=WAL_MAGIC - || szPage&(szPage-1) - || szPage>SQLITE_MAX_PAGE_SIZE - || szPage<512 + if( (magic&0xFFFFFFFE)!=WAL_MAGIC + || szPage&(szPage-1) + || szPage>SQLITE_MAX_PAGE_SIZE + || szPage<512 ){ goto finished; } @@ -1152,7 +1152,7 @@ static int walIndexRecover(Wal *pWal){ memcpy(&pWal->hdr.aSalt, &aBuf[16], 8); /* Verify that the WAL header checksum is correct */ - walChecksumBytes(pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN, + walChecksumBytes(pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN, aBuf, WAL_HDRSIZE-2*4, 0, pWal->hdr.aFrameCksum ); if( pWal->hdr.aFrameCksum[0]!=sqlite3Get4byte(&aBuf[24]) @@ -1216,7 +1216,7 @@ finished: pWal->hdr.aFrameCksum[1] = aFrameCksum[1]; walIndexWriteHdr(pWal); - /* Reset the checkpoint-header. This is safe because this thread is + /* Reset the checkpoint-header. This is safe because this thread is ** currently holding locks that exclude all other readers, writers and ** checkpointers. */ @@ -1261,8 +1261,8 @@ static void walIndexClose(Wal *pWal, int isDelete){ } } -/* -** Open a connection to the WAL file zWalName. The database file must +/* +** Open a connection to the WAL file zWalName. The database file must ** already be opened on connection pDbFd. The buffer that zWalName points ** to must remain valid for the lifetime of the returned Wal* handle. ** @@ -1272,7 +1272,7 @@ static void walIndexClose(Wal *pWal, int isDelete){ ** were to do this just after this client opened one of these files, the ** system would be badly broken. ** -** If the log file is successfully opened, SQLITE_OK is returned and +** If the log file is successfully opened, SQLITE_OK is returned and ** *ppWal is set to point to a new WAL handle. If an error occurs, ** an SQLite error code is returned and *ppWal is left unmodified. */ @@ -1436,7 +1436,7 @@ static void walMerge( ht_slot logpage; Pgno dbpage; - if( (iLeft=nRight || aContent[aLeft[iLeft]]aSegment[p->nSegment])[iZero]; iZero++; - + for(j=0; jaReadMark[i]; if( mxSafeFrame>y ){ @@ -1862,8 +1862,8 @@ static int walCheckpoint( } /* If this is an SQLITE_CHECKPOINT_RESTART or TRUNCATE operation, and the - ** entire wal file has been copied into the database file, then block - ** until all readers have finished using the wal file. This ensures that + ** entire wal file has been copied into the database file, then block + ** until all readers have finished using the wal file. This ensures that ** the next process to write to the database restarts the wal file. */ if( rc==SQLITE_OK && eMode!=SQLITE_CHECKPOINT_PASSIVE ){ @@ -1887,7 +1887,7 @@ static int walCheckpoint( ** writer clients should see that the entire log file has been ** checkpointed and behave accordingly. This seems unsafe though, ** as it would leave the system in a state where the contents of - ** the wal-index header do not match the contents of the + ** the wal-index header do not match the contents of the ** file-system. To avoid this, update the wal-index header to ** indicate that the log file contains zero valid frames. */ walRestartHdr(pWal, salt1); @@ -1949,7 +1949,7 @@ int sqlite3WalClose( if( pWal->exclusiveMode==WAL_NORMAL_MODE ){ pWal->exclusiveMode = WAL_EXCLUSIVE_MODE; } - rc = sqlite3WalCheckpoint(pWal, db, + rc = sqlite3WalCheckpoint(pWal, db, SQLITE_CHECKPOINT_PASSIVE, 0, 0, sync_flags, nBuf, zBuf, 0, 0 ); if( rc==SQLITE_OK ){ @@ -2030,7 +2030,7 @@ static int walIndexTryHdr(Wal *pWal, int *pChanged){ if( memcmp(&h1, &h2, sizeof(h1))!=0 ){ return 1; /* Dirty read */ - } + } if( h1.isInit==0 ){ return 1; /* Malformed header - probably all zeros */ } @@ -2060,7 +2060,7 @@ static int walIndexTryHdr(Wal *pWal, int *pChanged){ ** changed by this operation. If pWal->hdr is unchanged, set *pChanged ** to 0. ** -** If the wal-index header is successfully read, return SQLITE_OK. +** If the wal-index header is successfully read, return SQLITE_OK. ** Otherwise an SQLite error code. */ static int walIndexReadHdr(Wal *pWal, int *pChanged){ @@ -2068,7 +2068,7 @@ static int walIndexReadHdr(Wal *pWal, int *pChanged){ int badHdr; /* True if a header read failed */ volatile u32 *page0; /* Chunk of wal-index containing header */ - /* Ensure that page 0 of the wal-index (the page that contains the + /* Ensure that page 0 of the wal-index (the page that contains the ** wal-index header) is mapped. Return early if an error occurs here. */ assert( pChanged ); @@ -2080,7 +2080,7 @@ static int walIndexReadHdr(Wal *pWal, int *pChanged){ /* If the first page of the wal-index has been mapped, try to read the ** wal-index header immediately, without holding any lock. This usually - ** works, but may fail if the wal-index header is corrupt or currently + ** works, but may fail if the wal-index header is corrupt or currently ** being modified by another thread or process. */ badHdr = (page0 ? walIndexTryHdr(pWal, pChanged) : 1); @@ -2141,10 +2141,10 @@ static int walIndexReadHdr(Wal *pWal, int *pChanged){ ** ** The useWal parameter is true to force the use of the WAL and disable ** the case where the WAL is bypassed because it has been completely -** checkpointed. If useWal==0 then this routine calls walIndexReadHdr() -** to make a copy of the wal-index header into pWal->hdr. If the -** wal-index header has changed, *pChanged is set to 1 (as an indication -** to the caller that the local paget cache is obsolete and needs to be +** checkpointed. If useWal==0 then this routine calls walIndexReadHdr() +** to make a copy of the wal-index header into pWal->hdr. If the +** wal-index header has changed, *pChanged is set to 1 (as an indication +** to the caller that the local paget cache is obsolete and needs to be ** flushed.) When useWal==1, the wal-index header is assumed to already ** be loaded and the pChanged parameter is unused. ** @@ -2159,7 +2159,7 @@ static int walIndexReadHdr(Wal *pWal, int *pChanged){ ** bad luck when there is lots of contention for the wal-index, but that ** possibility is so small that it can be safely neglected, we believe. ** -** On success, this routine obtains a read lock on +** On success, this routine obtains a read lock on ** WAL_READ_LOCK(pWal->readLock). The pWal->readLock integer is ** in the range 0 <= pWal->readLock < WAL_NREADER. If pWal->readLock==(-1) ** that means the Wal does not hold any read lock. The reader must not @@ -2194,16 +2194,16 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ ** ** Circumstances that cause a RETRY should only last for the briefest ** instances of time. No I/O or other system calls are done while the - ** locks are held, so the locks should not be held for very long. But + ** locks are held, so the locks should not be held for very long. But ** if we are unlucky, another process that is holding a lock might get - ** paged out or take a page-fault that is time-consuming to resolve, + ** paged out or take a page-fault that is time-consuming to resolve, ** during the few nanoseconds that it is holding the lock. In that case, ** it might take longer than normal for the lock to free. ** ** After 5 RETRYs, we begin calling sqlite3OsSleep(). The first few ** calls to sqlite3OsSleep() have a delay of 1 microsecond. Really this ** is more of a scheduler yield than an actual delay. But on the 10th - ** an subsequent retries, the delays start becoming longer and longer, + ** an subsequent retries, the delays start becoming longer and longer, ** so that on the 100th (and last) RETRY we delay for 323 milliseconds. ** The total delay time before giving up is less than 10 seconds. */ @@ -2231,9 +2231,9 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ if( pWal->apWiData[0]==0 ){ /* This branch is taken when the xShmMap() method returns SQLITE_BUSY. ** We assume this is a transient condition, so return WAL_RETRY. The - ** xShmMap() implementation used by the default unix and win32 VFS - ** modules may return SQLITE_BUSY due to a race condition in the - ** code that determines whether or not the shared-memory region + ** xShmMap() implementation used by the default unix and win32 VFS + ** modules may return SQLITE_BUSY due to a race condition in the + ** code that determines whether or not the shared-memory region ** must be zeroed before the requested page is returned. */ rc = WAL_RETRY; @@ -2250,7 +2250,7 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ } pInfo = walCkptInfo(pWal); - if( !useWal && pInfo->nBackfill==pWal->hdr.mxFrame + if( !useWal && pInfo->nBackfill==pWal->hdr.mxFrame #ifdef SQLITE_ENABLE_SNAPSHOT && (pWal->pSnapshot==0 || pWal->hdr.mxFrame==0 || 0==memcmp(&pWal->hdr, pWal->pSnapshot, sizeof(WalIndexHdr))) @@ -2270,7 +2270,7 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ ** snapshot. Since holding READ_LOCK(0) prevents a checkpoint from ** happening, this is usually correct. ** - ** However, if frames have been appended to the log (or if the log + ** However, if frames have been appended to the log (or if the log ** is wrapped and written for that matter) before the READ_LOCK(0) ** is obtained, that is not necessarily true. A checkpointer may ** have started to backfill the appended frames but crashed before @@ -2351,9 +2351,9 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ ** to read any frames earlier than minFrame from the wal file - they ** can be safely read directly from the database file. ** - ** Because a ShmBarrier() call is made between taking the copy of + ** Because a ShmBarrier() call is made between taking the copy of ** nBackfill and checking that the wal-header in shared-memory still - ** matches the one cached in pWal->hdr, it is guaranteed that the + ** matches the one cached in pWal->hdr, it is guaranteed that the ** checkpointer that set nBackfill was not working with a wal-index ** header newer than that cached in pWal->hdr. If it were, that could ** cause a problem. The checkpointer could omit to checkpoint @@ -2381,15 +2381,15 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){ #ifdef SQLITE_ENABLE_SNAPSHOT /* -** Attempt to reduce the value of the WalCkptInfo.nBackfillAttempted +** Attempt to reduce the value of the WalCkptInfo.nBackfillAttempted ** variable so that older snapshots can be accessed. To do this, loop -** through all wal frames from nBackfillAttempted to (nBackfill+1), +** through all wal frames from nBackfillAttempted to (nBackfill+1), ** comparing their content to the corresponding page with the database ** file, if any. Set nBackfillAttempted to the frame number of the ** first frame for which the wal file content matches the db file. ** -** This is only really safe if the file-system is such that any page -** writes made by earlier checkpointers were atomic operations, which +** This is only really safe if the file-system is such that any page +** writes made by earlier checkpointers were atomic operations, which ** is not always true. It is also possible that nBackfillAttempted ** may be left set to a value larger than expected, if a wal frame ** contains content that duplicate of an earlier version of the same @@ -2512,14 +2512,14 @@ int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){ assert( pWal->readLock>0 || pWal->hdr.mxFrame==0 ); assert( pInfo->aReadMark[pWal->readLock]<=pSnapshot->mxFrame ); - /* It is possible that there is a checkpointer thread running + /* It is possible that there is a checkpointer thread running ** concurrent with this code. If this is the case, it may be that the - ** checkpointer has already determined that it will checkpoint - ** snapshot X, where X is later in the wal file than pSnapshot, but - ** has not yet set the pInfo->nBackfillAttempted variable to indicate + ** checkpointer has already determined that it will checkpoint + ** snapshot X, where X is later in the wal file than pSnapshot, but + ** has not yet set the pInfo->nBackfillAttempted variable to indicate ** its intent. To avoid the race condition this leads to, ensure that - ** there is no checkpointer process by taking a shared CKPT lock - ** before checking pInfo->nBackfillAttempted. + ** there is no checkpointer process by taking a shared CKPT lock + ** before checking pInfo->nBackfillAttempted. ** ** TODO: Does the aReadMark[] lock prevent a checkpointer from doing ** this already? @@ -2592,8 +2592,8 @@ int sqlite3WalFindFrame( /* If the "last page" field of the wal-index header snapshot is 0, then ** no data will be read from the wal under any circumstances. Return early - ** in this case as an optimization. Likewise, if pWal->readLock==0, - ** then the WAL is ignored by the reader so return early, as if the + ** in this case as an optimization. Likewise, if pWal->readLock==0, + ** then the WAL is ignored by the reader so return early, as if the ** WAL were empty. */ if( iLast==0 || pWal->readLock==0 ){ @@ -2606,9 +2606,9 @@ int sqlite3WalFindFrame( ** hash table (each hash table indexes up to HASHTABLE_NPAGE frames). ** ** This code might run concurrently to the code in walIndexAppend() - ** that adds entries to the wal-index (and possibly to this hash - ** table). This means the value just read from the hash - ** slot (aHash[iKey]) may have been added before or after the + ** that adds entries to the wal-index (and possibly to this hash + ** table). This means the value just read from the hash + ** slot (aHash[iKey]) may have been added before or after the ** current read transaction was opened. Values added after the ** read transaction was opened may have been written incorrectly - ** i.e. these slots may contain garbage data. However, we assume @@ -2616,13 +2616,13 @@ int sqlite3WalFindFrame( ** opened remain unmodified. ** ** For the reasons above, the if(...) condition featured in the inner - ** loop of the following block is more stringent that would be required + ** loop of the following block is more stringent that would be required ** if we had exclusive access to the hash-table: ** - ** (aPgno[iFrame]==pgno): + ** (aPgno[iFrame]==pgno): ** This condition filters out normal hash-table collisions. ** - ** (iFrame<=iLast): + ** (iFrame<=iLast): ** This condition filters out entries that were added to the hash ** table after the current read-transaction had started. */ @@ -2696,7 +2696,7 @@ int sqlite3WalReadFrame( return sqlite3OsRead(pWal->pWalFd, pOut, (nOut>sz ? sz : nOut), iOffset); } -/* +/* ** Return the size of the database in pages (or zero, if unknown). */ Pgno sqlite3WalDbsize(Wal *pWal){ @@ -2707,7 +2707,7 @@ Pgno sqlite3WalDbsize(Wal *pWal){ } -/* +/* ** This function starts a write transaction on the WAL. ** ** A read transaction must have already been started by a prior call @@ -2785,18 +2785,18 @@ int sqlite3WalUndo(Wal *pWal, int (*xUndo)(void *, Pgno), void *pUndoCtx){ if( ALWAYS(pWal->writeLock) ){ Pgno iMax = pWal->hdr.mxFrame; Pgno iFrame; - + /* Restore the clients cache of the wal-index header to the state it - ** was in before the client began writing to the database. + ** was in before the client began writing to the database. */ memcpy(&pWal->hdr, (void *)walIndexHdr(pWal), sizeof(WalIndexHdr)); - for(iFrame=pWal->hdr.mxFrame+1; - ALWAYS(rc==SQLITE_OK) && iFrame<=iMax; + for(iFrame=pWal->hdr.mxFrame+1; + ALWAYS(rc==SQLITE_OK) && iFrame<=iMax; iFrame++ ){ /* This call cannot fail. Unless the page for which the page number - ** is passed as the second argument is (a) in the cache and + ** is passed as the second argument is (a) in the cache and ** (b) has an outstanding reference, then xUndo is either a no-op ** (if (a) is false) or simply expels the page from the cache (if (b) ** is false). @@ -2814,10 +2814,10 @@ int sqlite3WalUndo(Wal *pWal, int (*xUndo)(void *, Pgno), void *pUndoCtx){ return rc; } -/* -** Argument aWalData must point to an array of WAL_SAVEPOINT_NDATA u32 -** values. This function populates the array with values required to -** "rollback" the write position of the WAL handle back to the current +/* +** Argument aWalData must point to an array of WAL_SAVEPOINT_NDATA u32 +** values. This function populates the array with values required to +** "rollback" the write position of the WAL handle back to the current ** point in the event of a savepoint rollback (via WalSavepointUndo()). */ void sqlite3WalSavepoint(Wal *pWal, u32 *aWalData){ @@ -2828,7 +2828,7 @@ void sqlite3WalSavepoint(Wal *pWal, u32 *aWalData){ aWalData[3] = pWal->nCkpt; } -/* +/* ** Move the write position of the WAL back to the point identified by ** the values in the aWalData[] array. aWalData must point to an array ** of WAL_SAVEPOINT_NDATA u32 values that has been previously populated @@ -3034,7 +3034,7 @@ static int walRewriteChecksums(Wal *pWal, u32 iLast){ return rc; } -/* +/* ** Write a set of frames to the log. The caller must hold the write-lock ** on the log file (obtained using sqlite3WalBeginWriteTransaction()). */ @@ -3101,7 +3101,7 @@ int sqlite3WalFrames( walChecksumBytes(1, aWalHdr, WAL_HDRSIZE-2*4, 0, aCksum); sqlite3Put4byte(&aWalHdr[24], aCksum[0]); sqlite3Put4byte(&aWalHdr[28], aCksum[1]); - + pWal->szPage = szPage; pWal->hdr.bigEndCksum = SQLITE_BIGENDIAN; pWal->hdr.aFrameCksum[0] = aCksum[0]; @@ -3143,7 +3143,7 @@ int sqlite3WalFrames( /* Check if this page has already been written into the wal file by ** the current transaction. If so, overwrite the existing frame and - ** set Wal.writeLock to WAL_WRITELOCK_RECKSUM - indicating that + ** set Wal.writeLock to WAL_WRITELOCK_RECKSUM - indicating that ** checksums must be recomputed when the transaction is committed. */ if( iFirst && (p->pDirty || isCommit==0) ){ u32 iWrite = 0; @@ -3230,7 +3230,7 @@ int sqlite3WalFrames( pWal->truncateOnCommit = 0; } - /* Append data to the wal-index. It is not necessary to lock the + /* Append data to the wal-index. It is not necessary to lock the ** wal-index to do this as the SQLITE_SHM_WRITE lock held on the wal-index ** guarantees that there are no other writers, and no data that may ** be in use by existing readers is being overwritten. @@ -3268,7 +3268,7 @@ int sqlite3WalFrames( return rc; } -/* +/* ** This routine is called to implement sqlite3_wal_checkpoint() and ** related interfaces. ** @@ -3305,7 +3305,7 @@ int sqlite3WalCheckpoint( if( pWal->readOnly ) return SQLITE_READONLY; WALTRACE(("WAL%p: checkpoint begins\n", pWal)); - /* IMPLEMENTATION-OF: R-62028-47212 All calls obtain an exclusive + /* IMPLEMENTATION-OF: R-62028-47212 All calls obtain an exclusive ** "checkpoint" lock on the database file. */ rc = walLockExclusive(pWal, WAL_CKPT_LOCK, 1); if( rc ){ @@ -3366,7 +3366,7 @@ int sqlite3WalCheckpoint( } if( isChanged ){ - /* If a new wal-index header was loaded before the checkpoint was + /* If a new wal-index header was loaded before the checkpoint was ** performed, then the pager-cache associated with pWal is now ** out of date. So zero the cached wal-index header to ensure that ** next time the pager opens a snapshot on this database it knows that @@ -3409,7 +3409,7 @@ int sqlite3WalCallback(Wal *pWal){ ** operation must occur while the pager is still holding the exclusive ** lock on the main database file. ** -** If op is one, then change from locking_mode=NORMAL into +** If op is one, then change from locking_mode=NORMAL into ** locking_mode=EXCLUSIVE. This means that the pWal->readLock must ** be released. Return 1 if the transition is made and 0 if the ** WAL is already in exclusive-locking mode - meaning that this @@ -3426,8 +3426,8 @@ int sqlite3WalExclusiveMode(Wal *pWal, int op){ assert( pWal->writeLock==0 ); assert( pWal->exclusiveMode!=WAL_HEAPMEMORY_MODE || op==-1 ); - /* pWal->readLock is usually set, but might be -1 if there was a - ** prior error while attempting to acquire are read-lock. This cannot + /* pWal->readLock is usually set, but might be -1 if there was a + ** prior error while attempting to acquire are read-lock. This cannot ** happen if the connection is actually in exclusive mode (as no xShmLock ** locks are taken in this case). Nor should the pager attempt to ** upgrade to exclusive-mode following such an error. @@ -3458,10 +3458,10 @@ int sqlite3WalExclusiveMode(Wal *pWal, int op){ return rc; } -/* +/* ** Return true if the argument is non-NULL and the WAL module is using ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the -** WAL module is using shared-memory, return false. +** WAL module is using shared-memory, return false. */ int sqlite3WalHeapMemory(Wal *pWal){ return (pWal && pWal->exclusiveMode==WAL_HEAPMEMORY_MODE ); @@ -3500,7 +3500,7 @@ void sqlite3WalSnapshotOpen(Wal *pWal, sqlite3_snapshot *pSnapshot){ pWal->pSnapshot = (WalIndexHdr*)pSnapshot; } -/* +/* ** Return a +ve value if snapshot p1 is newer than p2. A -ve value if ** p1 is older than p2 and zero if p1 and p2 are the same snapshot. */ diff --git a/third_party/sqlite/src/src/wal.h b/third_party/sqlite/src/src/wal.h index 4f6d01dad6291..df831b5349b67 100644 --- a/third_party/sqlite/src/src/wal.h +++ b/third_party/sqlite/src/src/wal.h @@ -9,8 +9,8 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** This header file defines the interface to the write-ahead logging -** system. Refer to the comments below and the header comment attached to +** This header file defines the interface to the write-ahead logging +** system. Refer to the comments below and the header comment attached to ** the implementation of each function in log.c for further details. */ @@ -49,8 +49,8 @@ #define WAL_SAVEPOINT_NDATA 4 -/* Connection to a write-ahead log (WAL) file. -** There is one object of this type for each pager. +/* Connection to a write-ahead log (WAL) file. +** There is one object of this type for each pager. */ typedef struct Wal Wal; @@ -61,7 +61,7 @@ int sqlite3WalClose(Wal *pWal, sqlite3*, int sync_flags, int, u8 *); /* Set the limiting size of a WAL file. */ void sqlite3WalLimit(Wal*, i64); -/* Used by readers to open (lock) and close (unlock) a snapshot. A +/* Used by readers to open (lock) and close (unlock) a snapshot. A ** snapshot is like a read-transaction. It is the state of the database ** at an instant in time. sqlite3WalOpenSnapshot gets a read lock and ** preserves the current state even if the other threads or processes @@ -96,7 +96,7 @@ int sqlite3WalSavepointUndo(Wal *pWal, u32 *aWalData); /* Write a frame or frames to the log. */ int sqlite3WalFrames(Wal *pWal, int, PgHdr *, Pgno, int, int); -/* Copy pages from the log to the database file */ +/* Copy pages from the log to the database file */ int sqlite3WalCheckpoint( Wal *pWal, /* Write-ahead log connection */ sqlite3 *db, /* Check this handle's interrupt flag */ @@ -124,7 +124,7 @@ int sqlite3WalExclusiveMode(Wal *pWal, int op); /* Return true if the argument is non-NULL and the WAL module is using ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the -** WAL module is using shared-memory, return false. +** WAL module is using shared-memory, return false. */ int sqlite3WalHeapMemory(Wal *pWal); diff --git a/third_party/sqlite/src/src/walker.c b/third_party/sqlite/src/src/walker.c index d1b1e96a2d1eb..64982c191dc63 100644 --- a/third_party/sqlite/src/src/walker.c +++ b/third_party/sqlite/src/src/walker.c @@ -93,7 +93,7 @@ int sqlite3WalkSelectExpr(Walker *pWalker, Select *p){ ** Walk the parse trees associated with all subqueries in the ** FROM clause of SELECT statement p. Do not invoke the select ** callback on p, but do invoke it on each FROM clause subquery -** and on any subqueries further down in the tree. Return +** and on any subqueries further down in the tree. Return ** WRC_Abort or WRC_Continue; */ int sqlite3WalkSelectFrom(Walker *pWalker, Select *p){ @@ -115,16 +115,16 @@ int sqlite3WalkSelectFrom(Walker *pWalker, Select *p){ } } return WRC_Continue; -} +} /* ** Call sqlite3WalkExpr() for every expression in Select statement p. ** Invoke sqlite3WalkSelect() for subqueries in the FROM clause and -** on the compound select chain, p->pPrior. +** on the compound select chain, p->pPrior. ** ** If it is not NULL, the xSelectCallback() callback is invoked before ** the walk of the expressions and FROM clause. The xSelectCallback2() -** method, if it is not NULL, is invoked following the walk of the +** method, if it is not NULL, is invoked following the walk of the ** expressions and FROM clause. ** ** Return WRC_Continue under normal conditions. Return WRC_Abort if diff --git a/third_party/sqlite/src/src/where.c b/third_party/sqlite/src/src/where.c index 80dfa20ed15c5..949047a3efa4c 100644 --- a/third_party/sqlite/src/src/where.c +++ b/third_party/sqlite/src/src/where.c @@ -85,7 +85,7 @@ int sqlite3WhereBreakLabel(WhereInfo *pWInfo){ ** operate directly on the rowis returned by a WHERE clause. Return ** ONEPASS_SINGLE (1) if the statement can operation directly because only ** a single row is to be changed. Return ONEPASS_MULTI (2) if the one-pass -** optimization can be used on multiple +** optimization can be used on multiple ** ** If the ONEPASS optimization is used (if this routine returns true) ** then also write the indices of open cursors used by ONEPASS @@ -333,7 +333,7 @@ static WhereTerm *whereScanInit( ** if pIdx!=0 and is one of the WO_xx operator codes specified by ** the op parameter. Return a pointer to the term. Return 0 if not found. ** -** If pIdx!=0 then it must be one of the indexes of table iCur. +** If pIdx!=0 then it must be one of the indexes of table iCur. ** Search for terms matching the iColumn-th column of pIdx ** rather than the iColumn-th column of table iCur. ** @@ -446,17 +446,17 @@ static int isDistinctRedundant( ){ Table *pTab; Index *pIdx; - int i; + int i; int iBase; /* If there is more than one table or sub-select in the FROM clause of - ** this query, then it will not be possible to show that the DISTINCT + ** this query, then it will not be possible to show that the DISTINCT ** clause is redundant. */ if( pTabList->nSrc!=1 ) return 0; iBase = pTabList->a[0].iCursor; pTab = pTabList->a[0].pTab; - /* If any of the expressions is an IPK column on table iBase, then return + /* If any of the expressions is an IPK column on table iBase, then return ** true. Note: The (p->iTable==iBase) part of this test may be false if the ** current SELECT is a correlated sub-query. */ @@ -507,7 +507,7 @@ static LogEst estLog(LogEst N){ ** Convert OP_Column opcodes to OP_Copy in previously generated code. ** ** This routine runs over generated VDBE code and translates OP_Column -** opcodes into OP_Copy when the table is being accessed via co-routine +** opcodes into OP_Copy when the table is being accessed via co-routine ** instead of via table lookup. ** ** If the bIncrRowid parameter is 0, then any OP_Rowid instructions on @@ -811,7 +811,7 @@ static void constructAutomaticIndex( sqlite3VdbeJumpHere(v, addrTop); sqlite3ReleaseTempReg(pParse, regRecord); sqlite3ExprCachePop(pParse); - + /* Jump here when skipping the initialization */ sqlite3VdbeJumpHere(v, addrInit); @@ -822,7 +822,7 @@ end_auto_index_create: #ifndef SQLITE_OMIT_VIRTUALTABLE /* -** Allocate and populate an sqlite3_index_info structure. It is the +** Allocate and populate an sqlite3_index_info structure. It is the ** responsibility of the caller to eventually release the structure ** by passing the pointer returned by this function to sqlite3_free(). */ @@ -860,7 +860,7 @@ static sqlite3_index_info *allocateIndexInfo( nTerm++; } - /* If the ORDER BY clause contains only columns in the current + /* If the ORDER BY clause contains only columns in the current ** virtual table then allocate space for the aOrderBy part of ** the sqlite3_index_info structure. */ @@ -933,7 +933,7 @@ static sqlite3_index_info *allocateIndexInfo( assert( pTerm->eOperator & (WO_IN|WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE|WO_MATCH) ); if( op & (WO_LT|WO_LE|WO_GT|WO_GE) - && sqlite3ExprIsVector(pTerm->pExpr->pRight) + && sqlite3ExprIsVector(pTerm->pExpr->pRight) ){ if( i<16 ) mNoOmit |= (1 << i); if( op==WO_LT ) pIdxCons[j].op = WO_LE; @@ -991,7 +991,7 @@ static int vtabBestIndex(Parse *pParse, Table *pTab, sqlite3_index_info *p){ ** Search for "xBestIndex malfunction" below */ for(i=0; inConstraint; i++){ if( !p->aConstraint[i].usable && p->aConstraintUsage[i].argvIndex>0 ){ - sqlite3ErrorMsg(pParse, + sqlite3ErrorMsg(pParse, "table %s: xBestIndex returned an invalid plan", pTab->zName); } } @@ -1012,8 +1012,8 @@ static int vtabBestIndex(Parse *pParse, Table *pTab, sqlite3_index_info *p){ ** Return the index of the sample that is the smallest sample that ** is greater than or equal to pRec. Note that this index is not an index ** into the aSample[] array - it is an index into a virtual set of samples -** based on the contents of aSample[] and the number of fields in record -** pRec. +** based on the contents of aSample[] and the number of fields in record +** pRec. */ static int whereKeyStats( Parse *pParse, /* Database connection */ @@ -1049,38 +1049,38 @@ static int whereKeyStats( ** consider prefixes of those samples. For example, if the set of samples ** in aSample is: ** - ** aSample[0] = (a, 5) - ** aSample[1] = (a, 10) - ** aSample[2] = (b, 5) - ** aSample[3] = (c, 100) + ** aSample[0] = (a, 5) + ** aSample[1] = (a, 10) + ** aSample[2] = (b, 5) + ** aSample[3] = (c, 100) ** aSample[4] = (c, 105) ** - ** Then the search space should ideally be the samples above and the - ** unique prefixes [a], [b] and [c]. But since that is hard to organize, + ** Then the search space should ideally be the samples above and the + ** unique prefixes [a], [b] and [c]. But since that is hard to organize, ** the code actually searches this set: ** - ** 0: (a) - ** 1: (a, 5) - ** 2: (a, 10) - ** 3: (a, 10) - ** 4: (b) - ** 5: (b, 5) - ** 6: (c) - ** 7: (c, 100) + ** 0: (a) + ** 1: (a, 5) + ** 2: (a, 10) + ** 3: (a, 10) + ** 4: (b) + ** 5: (b, 5) + ** 6: (c) + ** 7: (c, 100) ** 8: (c, 105) ** 9: (c, 105) ** ** For each sample in the aSample[] array, N samples are present in the - ** effective sample array. In the above, samples 0 and 1 are based on + ** effective sample array. In the above, samples 0 and 1 are based on ** sample aSample[0]. Samples 2 and 3 on aSample[1] etc. ** ** Often, sample i of each block of N effective samples has (i+1) fields. ** Except, each sample may be extended to ensure that it is greater than or - ** equal to the previous sample in the array. For example, in the above, - ** sample 2 is the first sample of a block of N samples, so at first it - ** appears that it should be 1 field in size. However, that would make it - ** smaller than sample 1, so the binary search would not work. As a result, - ** it is extended to two fields. The duplicates that this creates do not + ** equal to the previous sample in the array. For example, in the above, + ** sample 2 is the first sample of a block of N samples, so at first it + ** appears that it should be 1 field in size. However, that would make it + ** smaller than sample 1, so the binary search would not work. As a result, + ** it is extended to two fields. The duplicates that this creates do not ** cause any problems. */ nField = pRec->nField; @@ -1094,7 +1094,7 @@ static int whereKeyStats( iSamp = iTest / nField; if( iSamp>0 ){ /* The proposed effective sample is a prefix of sample aSample[iSamp]. - ** Specifically, the shortest prefix of at least (1 + iTest%nField) + ** Specifically, the shortest prefix of at least (1 + iTest%nField) ** fields that is greater than the previous effective sample. */ for(n=(iTest % nField) + 1; nnSample ); assert( iCol==nField-1 ); pRec->nField = nField; - assert( 0==sqlite3VdbeRecordCompare(aSample[i].n, aSample[i].p, pRec) - || pParse->db->mallocFailed + assert( 0==sqlite3VdbeRecordCompare(aSample[i].n, aSample[i].p, pRec) + || pParse->db->mallocFailed ); }else{ /* Unless i==pIdx->nSample, indicating that pRec is larger than @@ -1138,7 +1138,7 @@ static int whereKeyStats( ** (iCol+1) field prefix of sample i. */ assert( i<=pIdx->nSample && i>=0 ); pRec->nField = iCol+1; - assert( i==pIdx->nSample + assert( i==pIdx->nSample || sqlite3VdbeRecordCompare(aSample[i].n, aSample[i].p, pRec)>0 || pParse->db->mallocFailed ); @@ -1166,7 +1166,7 @@ static int whereKeyStats( aStat[0] = aSample[i].anLt[iCol]; aStat[1] = aSample[i].anEq[iCol]; }else{ - /* At this point, the (iCol+1) field prefix of aSample[i] is the first + /* At this point, the (iCol+1) field prefix of aSample[i] is the first ** sample that is greater than pRec. Or, if i==pIdx->nSample then pRec ** is larger than all samples in the array. */ tRowcnt iUpper, iGap; @@ -1198,7 +1198,7 @@ static int whereKeyStats( /* ** If it is not NULL, pTerm is a term that provides an upper or lower -** bound on a range scan. Without considering pTerm, it is estimated +** bound on a range scan. Without considering pTerm, it is estimated ** that the scan will visit nNew rows. This function returns the number ** estimated to be visited after taking pTerm into account. ** @@ -1235,18 +1235,18 @@ char sqlite3IndexColumnAffinity(sqlite3 *db, Index *pIdx, int iCol){ #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 -/* +/* ** This function is called to estimate the number of rows visited by a ** range-scan on a skip-scan index. For example: ** ** CREATE INDEX i1 ON t1(a, b, c); ** SELECT * FROM t1 WHERE a=? AND c BETWEEN ? AND ?; ** -** Value pLoop->nOut is currently set to the estimated number of rows -** visited for scanning (a=? AND b=?). This function reduces that estimate +** Value pLoop->nOut is currently set to the estimated number of rows +** visited for scanning (a=? AND b=?). This function reduces that estimate ** by some factor to account for the (c BETWEEN ? AND ?) expression based -** on the stat4 data for the index. this scan will be peformed multiple -** times (once for each (a,b) combination that matches a=?) is dealt with +** on the stat4 data for the index. this scan will be peformed multiple +** times (once for each (a,b) combination that matches a=?) is dealt with ** by the caller. ** ** It does this by scanning through all stat4 samples, comparing values @@ -1267,7 +1267,7 @@ char sqlite3IndexColumnAffinity(sqlite3 *db, Index *pIdx, int iCol){ ** estimate of the number of rows delivered remains unchanged), *pbDone ** is left as is. ** -** If an error occurs, an SQLite error code is returned. Otherwise, +** If an error occurs, an SQLite error code is returned. Otherwise, ** SQLITE_OK. */ static int whereRangeSkipScanEst( @@ -1285,7 +1285,7 @@ static int whereRangeSkipScanEst( int rc = SQLITE_OK; u8 aff = sqlite3IndexColumnAffinity(db, p, nEq); CollSeq *pColl; - + sqlite3_value *p1 = 0; /* Value extracted from pLower */ sqlite3_value *p2 = 0; /* Value extracted from pUpper */ sqlite3_value *pVal = 0; /* Value extracted from record */ @@ -1317,7 +1317,7 @@ static int whereRangeSkipScanEst( nDiff = (nUpper - nLower); if( nDiff<=0 ) nDiff = 1; - /* If there is both an upper and lower bound specified, and the + /* If there is both an upper and lower bound specified, and the ** comparisons indicate that they are close together, use the fallback ** method (assume that the scan visits 1/64 of the rows) for estimating ** the number of rows visited. Otherwise, estimate the number of rows @@ -1364,7 +1364,7 @@ static int whereRangeSkipScanEst( ** ** ... FROM t1 WHERE a = ? AND b > ? AND b < ? ... ** -** then nEq is set to 1 (as the range restricted column, b, is the second +** then nEq is set to 1 (as the range restricted column, b, is the second ** left-most column of the index). Or, if the query is: ** ** ... FROM t1 WHERE a > ? AND a < ? ... @@ -1372,13 +1372,13 @@ static int whereRangeSkipScanEst( ** then nEq is set to 0. ** ** When this function is called, *pnOut is set to the sqlite3LogEst() of the -** number of rows that the index scan is expected to visit without -** considering the range constraints. If nEq is 0, then *pnOut is the number of +** number of rows that the index scan is expected to visit without +** considering the range constraints. If nEq is 0, then *pnOut is the number of ** rows in the index. Assuming no error occurs, *pnOut is adjusted (reduced) ** to account for the range constraints pLower and pUpper. -** +** ** In the absence of sqlite_stat4 ANALYZE data, or if such data cannot be -** used, a single range inequality reduces the search space by a factor of 4. +** used, a single range inequality reduces the search space by a factor of 4. ** and a pair of constraints (x>? AND xu.btree.nBtm; int nTop = pLoop->u.btree.nTop; - /* Variable iLower will be set to the estimate of the number of rows in + /* Variable iLower will be set to the estimate of the number of rows in ** the index that are less than the lower bound of the range query. The ** lower bound being the concatenation of $P and $L, where $P is the ** key-prefix formed by the nEq values matched against the nEq left-most @@ -1413,7 +1413,7 @@ static int whereRangeScanEst( ** Or, if pLower is NULL or $L cannot be extracted from it (because it ** is not a simple variable or literal value), the lower bound of the ** range is $P. Due to a quirk in the way whereKeyStats() works, even - ** if $L is available, whereKeyStats() is called for both ($P) and + ** if $L is available, whereKeyStats() is called for both ($P) and ** ($P:$L) and the larger of the two returned values is used. ** ** Similarly, iUpper is to be set to the estimate of the number of rows @@ -1437,7 +1437,7 @@ static int whereRangeScanEst( iLower = 0; iUpper = p->nRowEst0; }else{ - /* Note: this call could be optimized away - since the same values must + /* Note: this call could be optimized away - since the same values must ** have been requested when testing key $P in whereEqualScanEst(). */ whereKeyStats(pParse, p, pRec, 0, a); iLower = a[0]; @@ -1525,7 +1525,7 @@ static int whereRangeScanEst( ** reduced by an additional 75%. This means that, by default, an open-ended ** range query (e.g. col > ?) is assumed to match 1/4 of the rows in the ** index. While a closed range (e.g. col BETWEEN ? AND ?) is estimated to - ** match 1/64 of the index. */ + ** match 1/64 of the index. */ if( pLower && pLower->truthProb>0 && pUpper && pUpper->truthProb>0 ){ nNew -= 20; } @@ -1552,7 +1552,7 @@ static int whereRangeScanEst( ** for that index. When pExpr==NULL that means the constraint is ** "x IS NULL" instead of "x=VALUE". ** -** Write the estimated row count into *pnRow and return SQLITE_OK. +** Write the estimated row count into *pnRow and return SQLITE_OK. ** If unable to make an estimate, leave *pnRow unchanged and return ** non-zero. ** @@ -1603,7 +1603,7 @@ static int whereEqualScanEst( WHERETRACE(0x10,("equality scan regions %s(%d): %d\n", p->zName, nEq-1, (int)a[1])); *pnRow = a[1]; - + return rc; } #endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */ @@ -1616,7 +1616,7 @@ static int whereEqualScanEst( ** ** WHERE x IN (1,2,3,4) ** -** Write the estimated row count into *pnRow and return SQLITE_OK. +** Write the estimated row count into *pnRow and return SQLITE_OK. ** If unable to make an estimate, leave *pnRow unchanged and return ** non-zero. ** @@ -1676,7 +1676,7 @@ static void whereTermPrint(WhereTerm *pTerm, int iTerm){ sqlite3_snprintf(sizeof(zLeft),zLeft,"left={%d:%d}", pTerm->leftCursor, pTerm->u.leftColumn); }else if( (pTerm->eOperator & WO_OR)!=0 && pTerm->u.pOrInfo!=0 ){ - sqlite3_snprintf(sizeof(zLeft),zLeft,"indexable=0x%lld", + sqlite3_snprintf(sizeof(zLeft),zLeft,"indexable=0x%lld", pTerm->u.pOrInfo->indexable); }else{ sqlite3_snprintf(sizeof(zLeft),zLeft,"left=%d", pTerm->leftCursor); @@ -1873,7 +1873,7 @@ static void whereInfoFree(sqlite3 *db, WhereInfo *pWInfo){ ** by Y. ** ** If X is a proper subset of Y then Y is a better choice and ought -** to have a lower cost. This routine returns TRUE when that cost +** to have a lower cost. This routine returns TRUE when that cost ** relationship is inverted and needs to be adjusted. The third rule ** was added because if X uses skip-scan less than Y it still might ** deserve a lower cost even if it is a proper subset of Y. @@ -1921,7 +1921,7 @@ static void whereLoopAdjustCost(const WhereLoop *p, WhereLoop *pTemplate){ if( p->iTab!=pTemplate->iTab ) continue; if( (p->wsFlags & WHERE_INDEXED)==0 ) continue; if( whereLoopCheaperProperSubset(p, pTemplate) ){ - /* Adjust pTemplate cost downward so that it is cheaper than its + /* Adjust pTemplate cost downward so that it is cheaper than its ** subset p. */ WHERETRACE(0x80,("subset cost adjustment %d,%d to %d,%d\n", pTemplate->rRun, pTemplate->nOut, p->rRun, p->nOut-1)); @@ -1966,7 +1966,7 @@ static WhereLoop **whereLoopFindLesser( /* In the current implementation, the rSetup value is either zero ** or the cost of building an automatic index (NlogN) and the NlogN ** is the same for compatible WhereLoops. */ - assert( p->rSetup==0 || pTemplate->rSetup==0 + assert( p->rSetup==0 || pTemplate->rSetup==0 || p->rSetup==pTemplate->rSetup ); /* whereLoopAddBtree() always generates and inserts the automatic index @@ -2031,7 +2031,7 @@ static WhereLoop **whereLoopFindLesser( ** ** When accumulating multiple loops (when pBuilder->pOrSet is NULL) we ** still might overwrite similar loops with the new template if the -** new template is better. Loops may be overwritten if the following +** new template is better. Loops may be overwritten if the following ** conditions are met: ** ** (1) They have the same iTab. @@ -2080,7 +2080,7 @@ static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){ whereLoopPrint(pTemplate, pBuilder->pWC); } #endif - return SQLITE_OK; + return SQLITE_OK; }else{ p = *ppPrev; } @@ -2211,7 +2211,7 @@ static void whereLoopOutputAdjust( if( pLoop->nOut > nRow-iReduce ) pLoop->nOut = nRow - iReduce; } -/* +/* ** Term pTerm is a vector range comparison operation. The first comparison ** in the vector can be optimized using column nEq of the index. This ** function returns the total number of vector elements that can be used @@ -2240,7 +2240,7 @@ static int whereRangeVectorLen( nCmp = MIN(nCmp, (pIdx->nColumn - nEq)); for(i=1; iop!=TK_COLUMN - || pLhs->iTable!=iCur - || pLhs->iColumn!=pIdx->aiColumn[i+nEq] + if( pLhs->op!=TK_COLUMN + || pLhs->iTable!=iCur + || pLhs->iColumn!=pIdx->aiColumn[i+nEq] || pIdx->aSortOrder[i+nEq]!=pIdx->aSortOrder[nEq] ){ break; @@ -2288,12 +2288,12 @@ static int whereRangeVectorLen( #endif /* -** We have so far matched pBuilder->pNew->u.btree.nEq terms of the +** We have so far matched pBuilder->pNew->u.btree.nEq terms of the ** index pIndex. Try to match one more. ** -** When this function is called, pBuilder->pNew->nOut contains the -** number of rows expected to be visited by filtering using the nEq -** terms only. If it is modified, this value is restored before this +** When this function is called, pBuilder->pNew->nOut contains the +** number of rows expected to be visited by filtering using the nEq +** terms only. If it is modified, this value is restored before this ** function returns. ** ** If pProbe->tnum==0, that means pIndex is a fake index used for the @@ -2396,9 +2396,9 @@ static int whereLoopAddBtreeIndex( pNew->prereq = (saved_prereq | pTerm->prereqRight) & ~pNew->maskSelf; assert( nInMul==0 - || (pNew->wsFlags & WHERE_COLUMN_NULL)!=0 - || (pNew->wsFlags & WHERE_COLUMN_IN)!=0 - || (pNew->wsFlags & WHERE_SKIPSCAN)!=0 + || (pNew->wsFlags & WHERE_COLUMN_NULL)!=0 + || (pNew->wsFlags & WHERE_COLUMN_IN)!=0 + || (pNew->wsFlags & WHERE_SKIPSCAN)!=0 ); if( eOp & WO_IN ){ @@ -2427,7 +2427,7 @@ static int whereLoopAddBtreeIndex( int iCol = pProbe->aiColumn[saved_nEq]; pNew->wsFlags |= WHERE_COLUMN_EQ; assert( saved_nEq==pNew->u.btree.nEq ); - if( iCol==XN_ROWID + if( iCol==XN_ROWID || (iCol>0 && nInMul==0 && saved_nEq==pProbe->nKeyCol-1) ){ if( iCol>=0 && pProbe->uniqNotNull==0 ){ @@ -2474,7 +2474,7 @@ static int whereLoopAddBtreeIndex( /* At this point pNew->nOut is set to the number of rows expected to ** be visited by the index scan before considering term pTerm, or the - ** values of nIn and nInMul. In other words, assuming that all + ** values of nIn and nInMul. In other words, assuming that all ** "x IN(...)" terms are replaced with "x = ?". This block updates ** the value of pNew->nOut to account for pTerm (but not nIn/nInMul). */ assert( pNew->nOut==saved_nOut ); @@ -2495,8 +2495,8 @@ static int whereLoopAddBtreeIndex( }else{ #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 tRowcnt nOut = 0; - if( nInMul==0 - && pProbe->nSample + if( nInMul==0 + && pProbe->nSample && pNew->u.btree.nEq<=pProbe->nSampleCol && ((eOp & WO_IN)==0 || !ExprHasProperty(pTerm->pExpr, EP_xIsSelect)) ){ @@ -2522,8 +2522,8 @@ static int whereLoopAddBtreeIndex( { pNew->nOut += (pProbe->aiRowLogEst[nEq] - pProbe->aiRowLogEst[nEq-1]); if( eOp & WO_ISNULL ){ - /* TUNING: If there is no likelihood() value, assume that a - ** "col IS NULL" expression matches twice as many rows + /* TUNING: If there is no likelihood() value, assume that a + ** "col IS NULL" expression matches twice as many rows ** as (col=?). */ pNew->nOut += 10; } @@ -2575,12 +2575,12 @@ static int whereLoopAddBtreeIndex( /* Consider using a skip-scan if there are no WHERE clause constraints ** available for the left-most terms of the index, and if the average - ** number of repeats in the left-most terms is at least 18. + ** number of repeats in the left-most terms is at least 18. ** ** The magic number 18 is selected on the basis that scanning 17 rows ** is almost always quicker than an index seek (even though if the index ** contains fewer than 2^17 rows we assume otherwise in other parts of - ** the code). And, even if it is not, it should not be too much slower. + ** the code). And, even if it is not, it should not be too much slower. ** On the other hand, the extra seeks could end up being significantly ** more expensive. */ assert( 42==sqlite3LogEst(18) ); @@ -2680,7 +2680,7 @@ static int whereUsablePartialIndex(int iTab, WhereClause *pWC, Expr *pWhere){ } for(i=0, pTerm=pWC->a; inTerm; i++, pTerm++){ Expr *pExpr = pTerm->pExpr; - if( sqlite3ExprImpliesExpr(pExpr, pWhere, iTab) + if( sqlite3ExprImpliesExpr(pExpr, pWhere, iTab) && (!ExprHasProperty(pExpr, EP_FromJoin) || pExpr->iRightJoinTable==iTab) ){ return 1; @@ -2703,18 +2703,18 @@ static int whereUsablePartialIndex(int iTab, WhereClause *pWC, Expr *pWhere){ ** cost = nRow * K // scan of covering index ** cost = nRow * (K+3.0) // scan of non-covering index ** -** where K is a value between 1.1 and 3.0 set based on the relative +** where K is a value between 1.1 and 3.0 set based on the relative ** estimated average size of the index and table records. ** ** For an index scan, where nVisit is the number of index rows visited -** by the scan, and nSeek is the number of seek operations required on +** by the scan, and nSeek is the number of seek operations required on ** the index b-tree: ** ** cost = nSeek * (log(nRow) + K * nVisit) // covering index ** cost = nSeek * (log(nRow) + (K+3.0) * nVisit) // non-covering index ** -** Normally, nSeek is 1. nSeek values greater than 1 come about if the -** WHERE clause includes "x IN (....)" terms used in place of "x=?". Or when +** Normally, nSeek is 1. nSeek values greater than 1 come about if the +** WHERE clause includes "x IN (....)" terms used in place of "x=?". Or when ** implicit "x IN (SELECT x FROM tbl)" terms are added for skip-scans. ** ** The estimated values (nRow, nVisit, nSeek) often contain a large amount @@ -2744,7 +2744,7 @@ static int whereLoopAddBtree( LogEst rLogSize; /* Logarithm of the number of rows in the table */ WhereClause *pWC; /* The parsed WHERE clause */ Table *pTab; /* Table being queried */ - + pNew = pBuilder->pNew; pWInfo = pBuilder->pWInfo; pTabList = pWInfo->pTabList; @@ -2922,7 +2922,7 @@ static int whereLoopAddBtree( if( pTerm->eOperator & (WO_EQ|WO_IS) ) nLookup -= 19; } } - + pNew->rRun = sqlite3LogEstAdd(pNew->rRun, nLookup); } ApplyCostMultiplier(pNew->rRun, pTab->costMult); @@ -2993,13 +2993,13 @@ static int whereLoopAddVirtualOne( *pbIn = 0; pNew->prereq = mPrereq; - /* Set the usable flag on the subset of constraints identified by + /* Set the usable flag on the subset of constraints identified by ** arguments mUsable and mExclude. */ pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint; for(i=0; ia[pIdxCons->iTermOffset]; pIdxCons->usable = 0; - if( (pTerm->prereqRight & mUsable)==pTerm->prereqRight + if( (pTerm->prereqRight & mUsable)==pTerm->prereqRight && (pTerm->eOperator & mExclude)==0 ){ pIdxCons->usable = 1; @@ -3107,8 +3107,8 @@ static int whereLoopAddVirtualOne( ** entries that occur before the virtual table in the FROM clause and are ** separated from it by at least one LEFT or CROSS JOIN. Similarly, the ** mUnusable mask contains all FROM clause entries that occur after the -** virtual table and are separated from it by at least one LEFT or -** CROSS JOIN. +** virtual table and are separated from it by at least one LEFT or +** CROSS JOIN. ** ** For example, if the query were: ** @@ -3116,9 +3116,9 @@ static int whereLoopAddVirtualOne( ** ** then mPrereq corresponds to (t1, t2) and mUnusable to (t5, t6). ** -** All the tables in mPrereq must be scanned before the current virtual -** table. So any terms for which all prerequisites are satisfied by -** mPrereq may be specified as "usable" in all calls to xBestIndex. +** All the tables in mPrereq must be scanned before the current virtual +** table. So any terms for which all prerequisites are satisfied by +** mPrereq may be specified as "usable" in all calls to xBestIndex. ** Conversely, all tables in mUnusable must be scanned after the current ** virtual table, so any terms for which the prerequisites overlap with ** mUnusable should always be configured as "not-usable" for xBestIndex. @@ -3147,7 +3147,7 @@ static int whereLoopAddVirtual( pNew = pBuilder->pNew; pSrc = &pWInfo->pTabList->a[pNew->iTab]; assert( IsVirtual(pSrc->pTab) ); - p = allocateIndexInfo(pParse, pWC, mUnusable, pSrc, pBuilder->pOrderBy, + p = allocateIndexInfo(pParse, pWC, mUnusable, pSrc, pBuilder->pOrderBy, &mNoOmit); if( p==0 ) return SQLITE_NOMEM_BKPT; pNew->rSetup = 0; @@ -3166,7 +3166,7 @@ static int whereLoopAddVirtual( /* If the call to xBestIndex() with all terms enabled produced a plan ** that does not require any source tables (IOW: a plan with mBest==0), - ** then there is no point in making any further calls to xBestIndex() + ** then there is no point in making any further calls to xBestIndex() ** since they will all return the same result (if the xBestIndex() ** implementation is sane). */ if( rc==SQLITE_OK && (mBest = (pNew->prereq & ~mPrereq))!=0 ){ @@ -3189,7 +3189,7 @@ static int whereLoopAddVirtual( } } - /* Call xBestIndex once for each distinct value of (prereqRight & ~mPrereq) + /* Call xBestIndex once for each distinct value of (prereqRight & ~mPrereq) ** in the set of terms that apply to the current virtual table. */ while( rc==SQLITE_OK ){ int i; @@ -3245,8 +3245,8 @@ static int whereLoopAddVirtual( ** btrees or virtual tables. */ static int whereLoopAddOr( - WhereLoopBuilder *pBuilder, - Bitmask mPrereq, + WhereLoopBuilder *pBuilder, + Bitmask mPrereq, Bitmask mUnusable ){ WhereInfo *pWInfo = pBuilder->pWInfo; @@ -3259,7 +3259,7 @@ static int whereLoopAddOr( WhereLoopBuilder sSubBuild; WhereOrSet sSum, sCur; struct SrcList_item *pItem; - + pWC = pBuilder->pWC; pWCEnd = pWC->a + pWC->nTerm; pNew = pBuilder->pNew; @@ -3269,14 +3269,14 @@ static int whereLoopAddOr( for(pTerm=pWC->a; pTermeOperator & WO_OR)!=0 - && (pTerm->u.pOrInfo->indexable & pNew->maskSelf)!=0 + && (pTerm->u.pOrInfo->indexable & pNew->maskSelf)!=0 ){ WhereClause * const pOrWC = &pTerm->u.pOrInfo->wc; WhereTerm * const pOrWCEnd = &pOrWC->a[pOrWC->nTerm]; WhereTerm *pOrTerm; int once = 1; int i, j; - + sSubBuild = *pBuilder; sSubBuild.pOrderBy = 0; sSubBuild.pOrSet = &sCur; @@ -3297,7 +3297,7 @@ static int whereLoopAddOr( } sCur.n = 0; #ifdef WHERETRACE_ENABLED - WHERETRACE(0x200, ("OR-term %d of %p has %d subterms:\n", + WHERETRACE(0x200, ("OR-term %d of %p has %d subterms:\n", (int)(pOrTerm-pOrWC->a), pTerm, sSubBuild.pWC->nTerm)); if( sqlite3WhereTrace & 0x400 ){ sqlite3WhereClausePrint(sSubBuild.pWC); @@ -3344,8 +3344,8 @@ static int whereLoopAddOr( /* TUNING: Currently sSum.a[i].rRun is set to the sum of the costs ** of all sub-scans required by the OR-scan. However, due to rounding ** errors, it may be that the cost of the OR-scan is equal to its - ** most expensive sub-scan. Add the smallest possible penalty - ** (equivalent to multiplying the cost by 1.07) to ensure that + ** most expensive sub-scan. Add the smallest possible penalty + ** (equivalent to multiplying the cost by 1.07) to ensure that ** this does not happen. Otherwise, for WHERE clauses such as the ** following where there is an index on "y": ** @@ -3365,7 +3365,7 @@ static int whereLoopAddOr( } /* -** Add all WhereLoop objects for all tables +** Add all WhereLoop objects for all tables */ static int whereLoopAddAll(WhereLoopBuilder *pBuilder){ WhereInfo *pWInfo = pBuilder->pWInfo; @@ -3422,17 +3422,17 @@ static int whereLoopAddAll(WhereLoopBuilder *pBuilder){ ** Examine a WherePath (with the addition of the extra WhereLoop of the 5th ** parameters) to see if it outputs rows in the requested ORDER BY ** (or GROUP BY) without requiring a separate sort operation. Return N: -** +** ** N>0: N terms of the ORDER BY clause are satisfied ** N==0: No terms of the ORDER BY clause are satisfied -** N<0: Unknown yet how many terms of ORDER BY might be satisfied. +** N<0: Unknown yet how many terms of ORDER BY might be satisfied. ** ** Note that processing for WHERE_GROUPBY and WHERE_DISTINCTBY is not as ** strict. With GROUP BY and DISTINCT the only requirement is that ** equivalent rows appear immediately adjacent to one another. GROUP BY ** and DISTINCT do not require rows to appear in any particular order as long ** as equivalent rows are grouped together. Thus for GROUP BY and DISTINCT -** the pOrderBy terms can be matched in any order. With ORDER BY, the +** the pOrderBy terms can be matched in any order. With ORDER BY, the ** pOrderBy terms must be matched in strict left-to-right order. */ static i8 wherePathSatisfiesOrderBy( @@ -3482,7 +3482,7 @@ static i8 wherePathSatisfiesOrderBy( ** row of the WhereLoop. Every one-row WhereLoop is automatically ** order-distinct. A WhereLoop that has no columns in the ORDER BY clause ** is not order-distinct. To be order-distinct is not quite the same as being - ** UNIQUE since a UNIQUE column or index can have multiple rows that + ** UNIQUE since a UNIQUE column or index can have multiple rows that ** are NULL and NULL values are equivalent for the purpose of order-distinct. ** To be order-distinct, the columns must be UNIQUE and NOT NULL. ** @@ -3531,7 +3531,7 @@ static i8 wherePathSatisfiesOrderBy( ~ready, eqOpMask, 0); if( pTerm==0 ) continue; if( pTerm->eOperator==WO_IN ){ - /* IN terms are only valid for sorting in the ORDER BY LIMIT + /* IN terms are only valid for sorting in the ORDER BY LIMIT ** optimization, and then only if they are actually used ** by the query plan */ assert( wctrlFlags & WHERE_ORDERBY_LIMIT ); @@ -3576,16 +3576,16 @@ static i8 wherePathSatisfiesOrderBy( for(j=0; j=pLoop->u.btree.nEq + assert( j>=pLoop->u.btree.nEq || (pLoop->aLTerm[j]==0)==(jnSkip) ); if( ju.btree.nEq && j>=pLoop->nSkip ){ u16 eOp = pLoop->aLTerm[j]->eOperator; /* Skip over == and IS and ISNULL terms. (Also skip IN terms when - ** doing WHERE_ORDERBY_LIMIT processing). + ** doing WHERE_ORDERBY_LIMIT processing). ** - ** If the current term is a column of an ((?,?) IN (SELECT...)) + ** If the current term is a column of an ((?,?) IN (SELECT...)) ** expression for which the SELECT returns more than one column, ** check that it is the only column used by this loop. Otherwise, ** if it is one of two or more, none of the columns can be @@ -3595,7 +3595,7 @@ static i8 wherePathSatisfiesOrderBy( testcase( isOrderDistinct ); isOrderDistinct = 0; } - continue; + continue; }else if( ALWAYS(eOp & WO_IN) ){ /* ALWAYS() justification: eOp is an equality operator due to the ** ju.btree.nEq constraint above. Any equality other @@ -3636,7 +3636,7 @@ static i8 wherePathSatisfiesOrderBy( } /* Find the ORDER BY term that corresponds to the j-th column - ** of the index and mark that ORDER BY term off + ** of the index and mark that ORDER BY term off */ isMatch = 0; for(i=0; bOnce && i0 ? -1 : nOrderBy; } @@ -3921,7 +3921,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ assert( 10==sqlite3LogEst(2) ); continue; } - /* At this point, pWLoop is a candidate to be the next loop. + /* At this point, pWLoop is a candidate to be the next loop. ** Compute its cost */ rUnsorted = sqlite3LogEstAdd(pWLoop->rSetup,pWLoop->rRun + pFrom->nRow); rUnsorted = sqlite3LogEstAdd(rUnsorted, pFrom->rUnsorted); @@ -3944,7 +3944,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ WHERETRACE(0x002, ("---- sort cost=%-3d (%d/%d) increases cost %3d to %-3d\n", - aSortCost[isOrdered], (nOrderBy-isOrdered), nOrderBy, + aSortCost[isOrdered], (nOrderBy-isOrdered), nOrderBy, rUnsorted, rCost)); }else{ rCost = rUnsorted; @@ -4053,8 +4053,8 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ mxCost = aTo[0].rCost; mxUnsorted = aTo[0].nRow; for(jj=1, pTo=&aTo[1]; jjrCost>mxCost - || (pTo->rCost==mxCost && pTo->rUnsorted>mxUnsorted) + if( pTo->rCost>mxCost + || (pTo->rCost==mxCost && pTo->rUnsorted>mxUnsorted) ){ mxCost = pTo->rCost; mxUnsorted = pTo->rUnsorted; @@ -4093,7 +4093,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ sqlite3DbFree(db, pSpace); return SQLITE_ERROR; } - + /* Find the lowest cost path. pFrom will be left pointing to that path */ pFrom = aFrom; for(ii=1; iinOBSat = 0; if( nLoop>0 ){ u32 wsFlags = pFrom->aLoop[nLoop-1]->wsFlags; - if( (wsFlags & WHERE_ONEROW)==0 + if( (wsFlags & WHERE_ONEROW)==0 && (wsFlags&(WHERE_IPK|WHERE_COLUMN_IN))!=(WHERE_IPK|WHERE_COLUMN_IN) ){ Bitmask m = 0; @@ -4151,7 +4151,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ && pWInfo->nOBSat==pWInfo->pOrderBy->nExpr && nLoop>0 ){ Bitmask revMask = 0; - int nOrder = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, + int nOrder = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, pFrom, 0, nLoop-1, pFrom->aLoop[nLoop-1], &revMask ); assert( pWInfo->sorted==0 ); @@ -4178,7 +4178,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ ** times for the common case. ** ** Return non-zero on success, if this query can be handled by this -** no-frills query planner. Return zero if this query needs the +** no-frills query planner. Return zero if this query needs the ** general-purpose query planner. */ static int whereShortCut(WhereLoopBuilder *pBuilder){ @@ -4218,8 +4218,8 @@ static int whereShortCut(WhereLoopBuilder *pBuilder){ int opMask; assert( pLoop->aLTermSpace==pLoop->aLTerm ); if( !IsUniqueIndex(pIdx) - || pIdx->pPartIdxWhere!=0 - || pIdx->nKeyCol>ArraySize(pLoop->aLTermSpace) + || pIdx->pPartIdxWhere!=0 + || pIdx->nKeyCol>ArraySize(pLoop->aLTermSpace) ) continue; opMask = pIdx->uniqNotNull ? (WO_EQ|WO_IS) : WO_EQ; for(j=0; jnKeyCol; j++){ @@ -4339,7 +4339,7 @@ static int whereShortCut(WhereLoopBuilder *pBuilder){ ** if there is one. If there is no ORDER BY clause or if this routine ** is called from an UPDATE or DELETE statement, then pOrderBy is NULL. ** -** The iIdxCur parameter is the cursor number of an index. If +** The iIdxCur parameter is the cursor number of an index. If ** WHERE_OR_SUBCLAUSE is set, iIdxCur is the cursor number of an index ** to use for OR clause processing. The WHERE clause should use this ** specific cursor. If WHERE_ONEPASS_DESIRED is set, then iIdxCur is @@ -4372,8 +4372,8 @@ WhereInfo *sqlite3WhereBegin( u8 bFordelete = 0; /* OPFLAG_FORDELETE or zero, as appropriate */ assert( (wctrlFlags & WHERE_ONEPASS_MULTIROW)==0 || ( - (wctrlFlags & WHERE_ONEPASS_DESIRED)!=0 - && (wctrlFlags & WHERE_OR_SUBCLAUSE)==0 + (wctrlFlags & WHERE_ONEPASS_DESIRED)!=0 + && (wctrlFlags & WHERE_OR_SUBCLAUSE)==0 )); /* Only one of WHERE_OR_SUBCLAUSE or WHERE_USE_LIMIT */ @@ -4396,7 +4396,7 @@ WhereInfo *sqlite3WhereBegin( } /* The number of tables in the FROM clause is limited by the number of - ** bits in a Bitmask + ** bits in a Bitmask */ testcase( pTabList->nSrc==BMS ); if( pTabList->nSrc>BMS ){ @@ -4404,7 +4404,7 @@ WhereInfo *sqlite3WhereBegin( return 0; } - /* This function normally generates a nested loop for all tables in + /* This function normally generates a nested loop for all tables in ** pTabList. But if the WHERE_OR_SUBCLAUSE flag is set, then we should ** only generate code for the first table in pTabList and assume that ** any cursors associated with subsequent tables are uninitialized. @@ -4435,7 +4435,7 @@ WhereInfo *sqlite3WhereBegin( pWInfo->wctrlFlags = wctrlFlags; pWInfo->iLimit = iAuxArg; pWInfo->savedNQueryLoop = pParse->nQueryLoop; - memset(&pWInfo->nOBSat, 0, + memset(&pWInfo->nOBSat, 0, offsetof(WhereInfo,sWC) - offsetof(WhereInfo,nOBSat)); memset(&pWInfo->a[0], 0, sizeof(WhereLoop)+nTabList*sizeof(WhereLevel)); assert( pWInfo->eOnePass==ONEPASS_OFF ); /* ONEPASS defaults to OFF */ @@ -4455,7 +4455,7 @@ WhereInfo *sqlite3WhereBegin( initMaskSet(pMaskSet); sqlite3WhereClauseInit(&pWInfo->sWC, pWInfo); sqlite3WhereSplit(&pWInfo->sWC, pWhere, TK_AND); - + /* Special case: a WHERE clause that is constant. Evaluate the ** expression and either jump over all of the code or fall thru. */ @@ -4533,7 +4533,7 @@ WhereInfo *sqlite3WhereBegin( if( nTabList!=1 || whereShortCut(&sWLB)==0 ){ rc = whereLoopAddAll(&sWLB); if( rc ) goto whereBeginError; - + #ifdef WHERETRACE_ENABLED if( sqlite3WhereTrace ){ /* Display all of the WhereLoop objects */ WhereLoop *p; @@ -4546,7 +4546,7 @@ WhereInfo *sqlite3WhereBegin( } } #endif - + wherePathSolver(pWInfo, 0); if( db->mallocFailed ) goto whereBeginError; if( pWInfo->pOrderBy ){ @@ -4806,7 +4806,7 @@ whereBeginError: } /* -** Generate the end of the WHERE loop. See comments on +** Generate the end of the WHERE loop. See comments on ** sqlite3WhereBegin() for additional information. */ void sqlite3WhereEnd(WhereInfo *pWInfo){ @@ -4871,8 +4871,8 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){ if( (ws & WHERE_IDX_ONLY)==0 ){ sqlite3VdbeAddOp1(v, OP_NullRow, pTabList->a[i].iCursor); } - if( (ws & WHERE_INDEXED) - || ((ws & WHERE_MULTI_OR) && pLevel->u.pCovidx) + if( (ws & WHERE_INDEXED) + || ((ws & WHERE_MULTI_OR) && pLevel->u.pCovidx) ){ sqlite3VdbeAddOp1(v, OP_NullRow, pLevel->iIdxCur); } @@ -4916,7 +4916,7 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){ ** from the index instead of from the table where possible. In some cases ** this optimization prevents the table from ever being read, which can ** yield a significant performance boost. - ** + ** ** Calls to the code generator in between sqlite3WhereBegin and ** sqlite3WhereEnd will have created code that references the table ** directly. This loop scans all that code looking for opcodes @@ -4950,7 +4950,7 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){ pOp->p2 = x; pOp->p1 = pLevel->iIdxCur; } - assert( (pLoop->wsFlags & WHERE_IDX_ONLY)==0 || x>=0 + assert( (pLoop->wsFlags & WHERE_IDX_ONLY)==0 || x>=0 || pWInfo->eOnePass ); }else if( pOp->opcode==OP_Rowid ){ pOp->p1 = pLevel->iIdxCur; diff --git a/third_party/sqlite/src/src/whereInt.h b/third_party/sqlite/src/src/whereInt.h index fd6ebe77b4a23..39226730c5a32 100644 --- a/third_party/sqlite/src/src/whereInt.h +++ b/third_party/sqlite/src/src/whereInt.h @@ -147,7 +147,7 @@ struct WhereLoop { /* This object holds the prerequisites and the cost of running a ** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information +** See WhereOrSet for additional information */ struct WhereOrCost { Bitmask prereq; /* Prerequisites */ @@ -199,7 +199,7 @@ struct WherePath { ** clause subexpression is separated from the others by AND operators, ** usually, or sometimes subexpressions separated by OR. ** -** All WhereTerms are collected into a single WhereClause structure. +** All WhereTerms are collected into a single WhereClause structure. ** The following identity holds: ** ** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm @@ -349,8 +349,8 @@ struct WhereAndInfo { ** An instance of the following structure keeps track of a mapping ** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. ** -** The VDBE cursor numbers are small integers contained in -** SrcList_item.iCursor and Expr.iTable fields. For any given WHERE +** The VDBE cursor numbers are small integers contained in +** SrcList_item.iCursor and Expr.iTable fields. For any given WHERE ** clause, the cursor numbers might not begin with 0 and they might ** contain gaps in the numbering sequence. But we want to make maximum ** use of the bits in our bitmasks. This structure provides a mapping diff --git a/third_party/sqlite/src/src/wherecode.c b/third_party/sqlite/src/src/wherecode.c index 58e040628ae87..2d475fb48381b 100644 --- a/third_party/sqlite/src/src/wherecode.c +++ b/third_party/sqlite/src/src/wherecode.c @@ -71,7 +71,7 @@ static void explainAppendTerm( } /* -** Argument pLevel describes a strategy for scanning table pTab. This +** Argument pLevel describes a strategy for scanning table pTab. This ** function appends text to pStr that describes the subset of table ** rows scanned by the strategy in the form of an SQL expression. ** @@ -112,7 +112,7 @@ static void explainIndexRange(StrAccum *pStr, WhereLoop *pLoop){ /* ** This function is a no-op unless currently processing an EXPLAIN QUERY PLAN ** command, or if either SQLITE_DEBUG or SQLITE_ENABLE_STMT_SCANSTATUS was -** defined at compile-time. If it is not a no-op, a single OP_Explain opcode +** defined at compile-time. If it is not a no-op, a single OP_Explain opcode ** is added to the output to describe the table scan strategy in pLevel. ** ** If an OP_Explain opcode is added to the VM, its address is returned. @@ -223,11 +223,11 @@ int sqlite3WhereExplainOneScan( #ifdef SQLITE_ENABLE_STMT_SCANSTATUS /* ** Configure the VM passed as the first argument with an -** sqlite3_stmt_scanstatus() entry corresponding to the scan used to -** implement level pLvl. Argument pSrclist is a pointer to the FROM +** sqlite3_stmt_scanstatus() entry corresponding to the scan used to +** implement level pLvl. Argument pSrclist is a pointer to the FROM ** clause that the scan reads data from. ** -** If argument addrExplain is not 0, it must be the address of an +** If argument addrExplain is not 0, it must be the address of an ** OP_Explain instruction that describes the same loop. */ void sqlite3WhereAddScanStatus( @@ -283,7 +283,7 @@ void sqlite3WhereAddScanStatus( ** ** Only the parent term was in the original WHERE clause. The child1 ** and child2 terms were added by the LIKE optimization. If both of -** the virtual child terms are valid, then testing of the parent can be +** the virtual child terms are valid, then testing of the parent can be ** skipped. ** ** Usually the parent term is marked as TERM_CODED. But if the parent @@ -314,7 +314,7 @@ static void disableTerm(WhereLevel *pLevel, WhereTerm *pTerm){ /* ** Code an OP_Affinity opcode to apply the column affinity string zAff -** to the n registers starting at base. +** to the n registers starting at base. ** ** As an optimization, SQLITE_AFF_BLOB entries (which are no-ops) at the ** beginning and end of zAff are ignored. If all entries in zAff are @@ -351,7 +351,7 @@ static void codeApplyAffinity(Parse *pParse, int base, int n, char *zAff){ } /* -** Expression pRight, which is the RHS of a comparison operation, is +** Expression pRight, which is the RHS of a comparison operation, is ** either a vector of n elements or, if n==1, a scalar expression. ** Before the comparison operation, affinity zAff is to be applied ** to the pRight values. This function modifies characters within the @@ -378,7 +378,7 @@ static void updateRangeAffinityStr( /* ** Generate code for a single equality term of the WHERE clause. An equality -** term can be either X=expr or X IN (...). pTerm is the term to be +** term can be either X=expr or X IN (...). pTerm is the term to be ** coded. ** ** The current value for the constraint is left in a register, the index @@ -466,12 +466,12 @@ static int codeEqualityTerm( Expr *pLeft = pX->pLeft; if( pSelect->pOrderBy ){ - /* If the SELECT statement has an ORDER BY clause, zero the - ** iOrderByCol variables. These are set to non-zero when an - ** ORDER BY term exactly matches one of the terms of the + /* If the SELECT statement has an ORDER BY clause, zero the + ** iOrderByCol variables. These are set to non-zero when an + ** ORDER BY term exactly matches one of the terms of the ** result-set. Since the result-set of the SELECT statement may - ** have been modified or reordered, these variables are no longer - ** set correctly. Since setting them is just an optimization, + ** have been modified or reordered, these variables are no longer + ** set correctly. Since setting them is just an optimization, ** it's easiest just to zero them here. */ ExprList *pOrderBy = pSelect->pOrderBy; for(i=0; inExpr; i++){ @@ -563,7 +563,7 @@ static int codeEqualityTerm( ** For example, consider table t1(a,b,c,d,e,f) with index i1(a,b,c). ** Suppose the WHERE clause is this: a==5 AND b IN (1,2,3) AND c>5 AND c<10 ** The index has as many as three equality constraints, but in this -** example, the third "c" value is an inequality. So only two +** example, the third "c" value is an inequality. So only two ** constraints are coded. This routine will generate code to evaluate ** a==5 and b IN (1,2,3). The current values for a and b will be stored ** in consecutive registers and the index of the first register is returned. @@ -653,7 +653,7 @@ static int codeAllEqualityTerms( testcase( pIdx->aiColumn[j]==XN_EXPR ); VdbeComment((v, "%s", explainIndexColumnName(pIdx, j))); } - } + } /* Evaluate the equality constraints */ @@ -662,7 +662,7 @@ static int codeAllEqualityTerms( int r1; pTerm = pLoop->aLTerm[j]; assert( pTerm!=0 ); - /* The following testcase is true for indices with redundant columns. + /* The following testcase is true for indices with redundant columns. ** Ex: CREATE INDEX i1 ON t1(a,b,a); SELECT * FROM t1 WHERE a=0 AND b=0; */ testcase( (pTerm->wtFlags & TERM_CODED)!=0 ); testcase( pTerm->wtFlags & TERM_VIRTUAL ); @@ -678,8 +678,8 @@ static int codeAllEqualityTerms( if( pTerm->eOperator & WO_IN ){ if( pTerm->pExpr->flags & EP_xIsSelect ){ /* No affinity ever needs to be (or should be) applied to a value - ** from the RHS of an "? IN (SELECT ...)" expression. The - ** sqlite3FindInIndex() routine has already ensured that the + ** from the RHS of an "? IN (SELECT ...)" expression. The + ** sqlite3FindInIndex() routine has already ensured that the ** affinity of the comparison has been applied to the value. */ if( zAff ) zAff[j] = SQLITE_AFF_BLOB; } @@ -706,7 +706,7 @@ static int codeAllEqualityTerms( #ifndef SQLITE_LIKE_DOESNT_MATCH_BLOBS /* ** If the most recently coded instruction is a constant range constraint -** (a string literal) that originated from the LIKE optimization, then +** (a string literal) that originated from the LIKE optimization, then ** set P3 and P5 on the OP_String opcode so that the string will be cast ** to a BLOB at appropriate times. ** @@ -731,7 +731,7 @@ static void whereLikeOptimizationStringFixup( assert( pLevel->iLikeRepCntr>0 ); pOp = sqlite3VdbeGetOp(v, -1); assert( pOp!=0 ); - assert( pOp->opcode==OP_String8 + assert( pOp->opcode==OP_String8 || pTerm->pWC->pWInfo->pParse->db->mallocFailed ); pOp->p3 = (int)(pLevel->iLikeRepCntr>>1); /* Register holding counter */ pOp->p5 = (u8)(pLevel->iLikeRepCntr&1); /* ASC or DESC */ @@ -774,7 +774,7 @@ static int codeCursorHintCheckExpr(Walker *pWalker, Expr *pExpr){ /* ** Test whether or not expression pExpr, which was part of a WHERE clause, ** should be included in the cursor-hint for a table that is on the rhs -** of a LEFT JOIN. Set Walker.eCode to non-zero before returning if the +** of a LEFT JOIN. Set Walker.eCode to non-zero before returning if the ** expression is not suitable. ** ** An expression is unsuitable if it might evaluate to non NULL even if @@ -787,9 +787,9 @@ static int codeCursorHintCheckExpr(Walker *pWalker, Expr *pExpr){ ** CASE WHEN col THEN 0 ELSE 1 END */ static int codeCursorHintIsOrFunction(Walker *pWalker, Expr *pExpr){ - if( pExpr->op==TK_IS - || pExpr->op==TK_ISNULL || pExpr->op==TK_ISNOT - || pExpr->op==TK_NOTNULL || pExpr->op==TK_CASE + if( pExpr->op==TK_IS + || pExpr->op==TK_ISNULL || pExpr->op==TK_ISNOT + || pExpr->op==TK_NOTNULL || pExpr->op==TK_CASE ){ pWalker->eCode = 1; }else if( pExpr->op==TK_FUNCTION ){ @@ -810,10 +810,10 @@ static int codeCursorHintIsOrFunction(Walker *pWalker, Expr *pExpr){ ** that accesses any table other than the one identified by ** CCurHint.iTabCur, then do the following: ** -** 1) allocate a register and code an OP_Column instruction to read +** 1) allocate a register and code an OP_Column instruction to read ** the specified column into the new register, and ** -** 2) transform the expression node to a TK_REGISTER node that reads +** 2) transform the expression node to a TK_REGISTER node that reads ** from the newly populated register. ** ** Also, if the node is a TK_COLUMN that does access the table idenified @@ -844,7 +844,7 @@ static int codeCursorHintFixExpr(Walker *pWalker, Expr *pExpr){ ** the parent context. Do not walk the function arguments in this case. ** ** todo: It should be possible to replace this node with a TK_REGISTER - ** expression, as the result of the expression must be stored in a + ** expression, as the result of the expression must be stored in a ** register at this point. The same holds for TK_AGG_COLUMN nodes. */ rc = WRC_Prune; } @@ -887,18 +887,18 @@ static void codeCursorHint( if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; if( pTerm->prereqAll & pLevel->notReady ) continue; - /* Any terms specified as part of the ON(...) clause for any LEFT + /* Any terms specified as part of the ON(...) clause for any LEFT ** JOIN for which the current table is not the rhs are omitted - ** from the cursor-hint. + ** from the cursor-hint. ** - ** If this table is the rhs of a LEFT JOIN, "IS" or "IS NULL" terms + ** If this table is the rhs of a LEFT JOIN, "IS" or "IS NULL" terms ** that were specified as part of the WHERE clause must be excluded. ** This is to address the following: ** ** SELECT ... t1 LEFT JOIN t2 ON (t1.a=t2.b) WHERE t2.c IS NULL; ** ** Say there is a single row in t2 that matches (t1.a=t2.b), but its - ** t2.c values is not NULL. If the (t2.c IS NULL) constraint is + ** t2.c values is not NULL. If the (t2.c IS NULL) constraint is ** pushed down to the cursor, this row is filtered out, causing ** SQLite to synthesize a row of NULL values. Which does match the ** WHERE clause, and so the query returns a row. Which is incorrect. @@ -911,7 +911,7 @@ static void codeCursorHint( */ if( pTabItem->fg.jointype & JT_LEFT ){ Expr *pExpr = pTerm->pExpr; - if( !ExprHasProperty(pExpr, EP_FromJoin) + if( !ExprHasProperty(pExpr, EP_FromJoin) || pExpr->iRightJoinTable!=pTabItem->iCursor ){ sWalker.eCode = 0; @@ -949,7 +949,7 @@ static void codeCursorHint( if( pExpr!=0 ){ sWalker.xExprCallback = codeCursorHintFixExpr; sqlite3WalkExpr(&sWalker, pExpr); - sqlite3VdbeAddOp4(v, OP_CursorHint, + sqlite3VdbeAddOp4(v, OP_CursorHint, (sHint.pIdx ? sHint.iIdxCur : sHint.iTabCur), 0, 0, (const char*)pExpr, P4_EXPR); } @@ -961,7 +961,7 @@ static void codeCursorHint( /* ** Cursor iCur is open on an intkey b-tree (a table). Register iRowid contains ** a rowid value just read from cursor iIdxCur, open on index pIdx. This -** function generates code to do a deferred seek of cursor iCur to the +** function generates code to do a deferred seek of cursor iCur to the ** rowid stored in register iRowid. ** ** Normally, this is just: @@ -971,8 +971,8 @@ static void codeCursorHint( ** However, if the scan currently being coded is a branch of an OR-loop and ** the statement currently being coded is a SELECT, then P3 of the OP_Seek ** is set to iIdxCur and P4 is set to point to an array of integers -** containing one entry for each column of the table cursor iCur is open -** on. For each table column, if the column is the i'th column of the +** containing one entry for each column of the table cursor iCur is open +** on. For each table column, if the column is the i'th column of the ** index, then the corresponding array entry is set to (i+1). If the column ** does not appear in the index at all, the array entry is set to 0. */ @@ -987,7 +987,7 @@ static void codeDeferredSeek( assert( iIdxCur>0 ); assert( pIdx->aiColumn[pIdx->nColumn-1]==-1 ); - + sqlite3VdbeAddOp3(v, OP_Seek, iIdxCur, 0, iCur); if( (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE) && DbMaskAllZero(sqlite3ParseToplevel(pParse)->writeMask) @@ -1076,7 +1076,7 @@ Bitmask sqlite3WhereCodeOneLoopStart( iCur = pTabItem->iCursor; pLevel->notReady = notReady & ~sqlite3WhereGetMask(&pWInfo->sMaskSet, iCur); bRev = (pWInfo->revMask>>iLevel)&1; - omitTable = (pLoop->wsFlags & WHERE_IDX_ONLY)!=0 + omitTable = (pLoop->wsFlags & WHERE_IDX_ONLY)!=0 && (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE)==0; VdbeModuleComment((v, "Begin WHERE-loop%d: %s",iLevel,pTabItem->pTab->zName)); @@ -1173,7 +1173,7 @@ Bitmask sqlite3WhereCodeOneLoopStart( sqlite3VdbeAddOp3(v, pOp->opcode, pOp->p1, pOp->p2, pOp->p3); } - /* Generate code that will continue to the next row if + /* Generate code that will continue to the next row if ** the IN constraint is not satisfied */ pCompare = sqlite3PExpr(pParse, TK_EQ, 0, 0); assert( pCompare!=0 || db->mallocFailed ); @@ -1251,7 +1251,7 @@ Bitmask sqlite3WhereCodeOneLoopStart( int r1, rTemp; /* Registers for holding the start boundary */ int op; /* Cursor seek operation */ - /* The following constant maps TK_xx codes into corresponding + /* The following constant maps TK_xx codes into corresponding ** seek opcodes. It depends on a particular ordering of TK_xx */ const u8 aMoveOp[] = { @@ -1300,8 +1300,8 @@ Bitmask sqlite3WhereCodeOneLoopStart( testcase( pEnd->wtFlags & TERM_VIRTUAL ); memEndValue = ++pParse->nMem; codeExprOrVector(pParse, pX->pRight, memEndValue, 1); - if( 0==sqlite3ExprIsVector(pX->pRight) - && (pX->op==TK_LT || pX->op==TK_GT) + if( 0==sqlite3ExprIsVector(pX->pRight) + && (pX->op==TK_LT || pX->op==TK_GT) ){ testOp = bRev ? OP_Le : OP_Ge; }else{ @@ -1330,14 +1330,14 @@ Bitmask sqlite3WhereCodeOneLoopStart( }else if( pLoop->wsFlags & WHERE_INDEXED ){ /* Case 4: A scan using an index. ** - ** The WHERE clause may contain zero or more equality + ** The WHERE clause may contain zero or more equality ** terms ("==" or "IN" operators) that refer to the N ** left-most columns of the index. It may also contain ** inequality constraints (>, <, >= or <=) on the indexed - ** column that immediately follows the N equalities. Only + ** column that immediately follows the N equalities. Only ** the right-most column can be an inequality - the rest must - ** use the "==" and "IN" operators. For example, if the - ** index is on (x,y,z), then the following clauses are all + ** use the "==" and "IN" operators. For example, if the + ** index is on (x,y,z), then the following clauses are all ** optimized: ** ** x=5 @@ -1358,7 +1358,7 @@ Bitmask sqlite3WhereCodeOneLoopStart( ** This case is also used when there are no WHERE clause ** constraints but an index is selected anyway, in order ** to force the output order to conform to an ORDER BY. - */ + */ static const u8 aStartOp[] = { 0, 0, @@ -1398,8 +1398,8 @@ Bitmask sqlite3WhereCodeOneLoopStart( iIdxCur = pLevel->iIdxCur; assert( nEq>=pLoop->nSkip ); - /* If this loop satisfies a sort order (pOrderBy) request that - ** was passed to this function to implement a "SELECT min(x) ..." + /* If this loop satisfies a sort order (pOrderBy) request that + ** was passed to this function to implement a "SELECT min(x) ..." ** query, then the caller will only allow the loop to run for ** a single iteration. This means that the first row returned ** should not have a NULL value stored in 'x'. If column 'x' is @@ -1418,15 +1418,15 @@ Bitmask sqlite3WhereCodeOneLoopStart( nExtraReg = 1; } - /* Find any inequality constraint terms for the start and end - ** of the range. + /* Find any inequality constraint terms for the start and end + ** of the range. */ j = nEq; if( pLoop->wsFlags & WHERE_BTM_LIMIT ){ pRangeStart = pLoop->aLTerm[j++]; nExtraReg = MAX(nExtraReg, pLoop->u.btree.nBtm); /* Like optimization range constraints always occur in pairs */ - assert( (pRangeStart->wtFlags & TERM_LIKEOPT)==0 || + assert( (pRangeStart->wtFlags & TERM_LIKEOPT)==0 || (pLoop->wsFlags & WHERE_TOP_LIMIT)!=0 ); } if( pLoop->wsFlags & WHERE_TOP_LIMIT ){ @@ -1459,7 +1459,7 @@ Bitmask sqlite3WhereCodeOneLoopStart( assert( pRangeEnd==0 || (pRangeEnd->wtFlags & TERM_VNULL)==0 ); /* If we are doing a reverse order scan on an ascending index, or - ** a forward order scan on a descending index, interchange the + ** a forward order scan on a descending index, interchange the ** start and end terms (pRangeStart and pRangeEnd). */ if( (nEqnKeyCol && bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC)) @@ -1504,7 +1504,7 @@ Bitmask sqlite3WhereCodeOneLoopStart( } if( zStartAff ){ updateRangeAffinityStr(pRight, nBtm, &zStartAff[nEq]); - } + } nConstraint += nBtm; testcase( pRangeStart->wtFlags & TERM_VIRTUAL ); if( sqlite3ExprIsVector(pRight)==0 ){ @@ -1592,7 +1592,7 @@ Bitmask sqlite3WhereCodeOneLoopStart( /* pIdx is a covering index. No need to access the main table. */ }else if( HasRowid(pIdx->pTable) ){ if( (pWInfo->wctrlFlags & WHERE_SEEK_TABLE) || ( - (pWInfo->wctrlFlags & WHERE_SEEK_UNIQ_TABLE) + (pWInfo->wctrlFlags & WHERE_SEEK_UNIQ_TABLE) && (pWInfo->eOnePass==ONEPASS_SINGLE) )){ iRowidReg = ++pParse->nMem; @@ -1722,15 +1722,15 @@ Bitmask sqlite3WhereCodeOneLoopStart( pOrTab = pWInfo->pTabList; } - /* Initialize the rowset register to contain NULL. An SQL NULL is + /* Initialize the rowset register to contain NULL. An SQL NULL is ** equivalent to an empty rowset. Or, create an ephemeral index ** capable of holding primary keys in the case of a WITHOUT ROWID. ** - ** Also initialize regReturn to contain the address of the instruction + ** Also initialize regReturn to contain the address of the instruction ** immediately following the OP_Return at the bottom of the loop. This ** is required in a few obscure LEFT JOIN cases where control jumps - ** over the top of the loop into the body of it. In this case the - ** correct response for the end-of-loop code (the OP_Return) is to + ** over the top of the loop into the body of it. In this case the + ** correct response for the end-of-loop code (the OP_Return) is to ** fall through to the next instruction, just as an OP_Next does if ** called on an uninitialized cursor. */ @@ -1755,7 +1755,7 @@ Bitmask sqlite3WhereCodeOneLoopStart( ** ** Actually, each subexpression is converted to "xN AND w" where w is ** the "interesting" terms of z - terms that did not originate in the - ** ON or USING clause of a LEFT JOIN, and terms that are usable as + ** ON or USING clause of a LEFT JOIN, and terms that are usable as ** indices. ** ** This optimization also only applies if the (x1 OR x2 OR ...) term @@ -1841,9 +1841,9 @@ Bitmask sqlite3WhereCodeOneLoopStart( ** ** Use some of the same optimizations as OP_RowSetTest: If iSet ** is zero, assume that the key cannot already be present in - ** the temp table. And if iSet is -1, assume that there is no - ** need to insert the key into the temp table, as it will never - ** be tested for. */ + ** the temp table. And if iSet is -1, assume that there is no + ** need to insert the key into the temp table, as it will never + ** be tested for. */ if( iSet ){ jmp1 = sqlite3VdbeAddOp4Int(v, OP_Found, regRowset, 0, r, nPk); VdbeCoverage(v); @@ -1882,8 +1882,8 @@ Bitmask sqlite3WhereCodeOneLoopStart( ** If the call to sqlite3WhereBegin() above resulted in a scan that ** uses an index, and this is either the first OR-connected term ** processed or the index is the same as that used by all previous - ** terms, set pCov to the candidate covering index. Otherwise, set - ** pCov to NULL to indicate that no candidate covering index will + ** terms, set pCov to the candidate covering index. Otherwise, set + ** pCov to NULL to indicate that no candidate covering index will ** be available. */ pSubLoop = pSubWInfo->a[0].pWLoop; @@ -2017,7 +2017,7 @@ Bitmask sqlite3WhereCodeOneLoopStart( } /* For a LEFT OUTER JOIN, generate code that will record the fact that - ** at least one row of the right table has matched the left table. + ** at least one row of the right table has matched the left table. */ if( pLevel->iLeftJoin ){ pLevel->addrFirst = sqlite3VdbeCurrentAddr(v); diff --git a/third_party/sqlite/src/src/whereexpr.c b/third_party/sqlite/src/src/whereexpr.c index 826d329b7f1d8..a53e610ae0244 100644 --- a/third_party/sqlite/src/src/whereexpr.c +++ b/third_party/sqlite/src/src/whereexpr.c @@ -114,7 +114,7 @@ static int allowedOp(int op){ ** collating sequence, then COLLATE operators are adjusted to ensure ** that the collating sequence does not change. For example: ** "Y collate NOCASE op X" becomes "X op Y" because any collation sequence on -** the left hand side of a comparison overrides any collation sequence +** the left hand side of a comparison overrides any collation sequence ** attached to the right. For the same reason the EP_Collate flag ** is not commuted. */ @@ -213,8 +213,8 @@ static int isLikeOrGlob( #endif pList = pExpr->x.pList; pLeft = pList->a[1].pExpr; - if( pLeft->op!=TK_COLUMN - || sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT + if( pLeft->op!=TK_COLUMN + || sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT || IsVirtual(pLeft->pTab) /* Value might be numeric */ ){ /* IMP: R-02065-49465 The left-hand side of the LIKE or GLOB operator must @@ -257,7 +257,7 @@ static int isLikeOrGlob( ** function, then no OP_Variable will be added to the program. ** This causes problems for the sqlite3_bind_parameter_name() ** API. To work around them, add a dummy OP_Variable here. - */ + */ int r1 = sqlite3GetTempReg(pParse); sqlite3ExprCodeTarget(pParse, pRight, r1); sqlite3VdbeChangeP3(v, sqlite3VdbeCurrentAddr(v)-1, 0); @@ -282,7 +282,7 @@ static int isLikeOrGlob( ** ** column OP expr ** -** where OP is one of MATCH, GLOB, LIKE or REGEXP and "column" is a +** where OP is one of MATCH, GLOB, LIKE or REGEXP and "column" is a ** column of a virtual table. ** ** If it is then return TRUE. If not, return FALSE. @@ -378,7 +378,7 @@ static WhereTerm *whereNthSubterm(WhereTerm *pTerm, int N){ ** ** The following is NOT generated: ** -** xy --> x!=y +** xy --> x!=y */ static void whereCombineDisjuncts( SrcList *pSrc, /* the FROM clause */ @@ -475,10 +475,10 @@ static void whereCombineDisjuncts( ** WhereTerm.u.pOrInfo->indexable |= the cursor number for table T ** ** A subterm is "indexable" if it is of the form -** "T.C " where C is any column of table T and +** "T.C " where C is any column of table T and ** is one of "=", "<", "<=", ">", ">=", "IS NULL", or "IN". ** A subterm is also indexable if it is an AND of two or more -** subsubterms at least one of which is indexable. Indexable AND +** subsubterms at least one of which is indexable. Indexable AND ** subterms have their eOperator set to WO_AND and they have ** u.pAndInfo set to a dynamically allocated WhereAndTerm object. ** @@ -569,8 +569,8 @@ static void exprAnalyzeOrTerm( if( !db->mallocFailed ){ for(j=0, pAndTerm=pAndWC->a; jnTerm; j++, pAndTerm++){ assert( pAndTerm->pExpr ); - if( allowedOp(pAndTerm->pExpr->op) - || pAndTerm->eOperator==WO_MATCH + if( allowedOp(pAndTerm->pExpr->op) + || pAndTerm->eOperator==WO_MATCH ){ b |= sqlite3WhereGetMask(&pWInfo->sMaskSet, pAndTerm->leftCursor); } @@ -666,7 +666,7 @@ static void exprAnalyzeOrTerm( pOrTerm->leftCursor))==0 ){ /* This term must be of the form t1.a==t2.b where t2 is in the ** chngToIN set but t1 is not. This term will be either preceded - ** or follwed by an inverted copy (t2.b==t1.a). Skip this term + ** or follwed by an inverted copy (t2.b==t1.a). Skip this term ** and use its inversion. */ testcase( pOrTerm->wtFlags & TERM_COPIED ); testcase( pOrTerm->wtFlags & TERM_VIRTUAL ); @@ -714,7 +714,7 @@ static void exprAnalyzeOrTerm( } /* At this point, okToChngToIN is true if original pTerm satisfies - ** case 1. In that case, construct a new virtual term that is + ** case 1. In that case, construct a new virtual term that is ** pTerm converted into an IN operator. */ if( okToChngToIN ){ @@ -843,8 +843,8 @@ static int exprMightBeIndexed( int i; int iCur; - /* If this expression is a vector to the left or right of a - ** inequality constraint (>, <, >= or <=), perform the processing + /* If this expression is a vector to the left or right of a + ** inequality constraint (>, <, >= or <=), perform the processing ** on the first element of the vector. */ assert( TK_GT+1==TK_LE && TK_GT+2==TK_LT && TK_GT+3==TK_GE ); assert( TK_ISeOperator = operatorMask(op) & opMask; } if( op==TK_IS ) pTerm->wtFlags |= TERM_IS; - if( pRight + if( pRight && exprMightBeIndexed(pSrc, op, pTerm->prereqRight, pRight, &iCur,&iColumn) ){ WhereTerm *pNew; @@ -1035,7 +1035,7 @@ static void exprAnalyze( for(i=0; i<2; i++){ Expr *pNewExpr; int idxNew; - pNewExpr = sqlite3PExpr(pParse, ops[i], + pNewExpr = sqlite3PExpr(pParse, ops[i], sqlite3ExprDup(db, pExpr->pLeft, 0), sqlite3ExprDup(db, pList->a[i].pExpr, 0)); transferJoinMarkings(pNewExpr, pExpr); @@ -1073,7 +1073,7 @@ static void exprAnalyze( ** bound is made all lowercase so that the bounds also work when comparing ** BLOBs. */ - if( pWC->op==TK_AND + if( pWC->op==TK_AND && isLikeOrGlob(pParse, pExpr, &pStr1, &isComplete, &noCase) ){ Expr *pLeft; /* LHS of LIKE/GLOB operator */ @@ -1109,7 +1109,7 @@ static void exprAnalyze( if( noCase ){ /* The point is to increment the last character before the first ** wildcard. But if we increment '@', that will push it into the - ** alphabetic range where case conversions will mess up the + ** alphabetic range where case conversions will mess up the ** inequality. To avoid this, make sure to also run the full ** LIKE on all candidate expressions by clearing the isComplete flag */ @@ -1162,7 +1162,7 @@ static void exprAnalyze( prereqColumn = sqlite3WhereExprUsage(pMaskSet, pLeft); if( (prereqExpr & prereqColumn)==0 ){ Expr *pNewExpr; - pNewExpr = sqlite3PExpr(pParse, TK_MATCH, + pNewExpr = sqlite3PExpr(pParse, TK_MATCH, 0, sqlite3ExprDup(db, pRight, 0)); idxNew = whereClauseInsert(pWC, pNewExpr, TERM_VIRTUAL|TERM_DYNAMIC); testcase( idxNew==0 ); @@ -1187,11 +1187,11 @@ static void exprAnalyze( ** ** This is only required if at least one side of the comparison operation ** is not a sub-select. */ - if( pWC->op==TK_AND + if( pWC->op==TK_AND && (pExpr->op==TK_EQ || pExpr->op==TK_IS) && (nLeft = sqlite3ExprVectorSize(pExpr->pLeft))>1 && sqlite3ExprVectorSize(pExpr->pRight)==nLeft - && ( (pExpr->pLeft->flags & EP_xIsSelect)==0 + && ( (pExpr->pLeft->flags & EP_xIsSelect)==0 || (pExpr->pRight->flags & EP_xIsSelect)==0) ){ int i; @@ -1213,7 +1213,7 @@ static void exprAnalyze( /* If there is a vector IN term - e.g. "(a, b) IN (SELECT ...)" - create ** a virtual term for each vector component. The expression object - ** used by each such virtual term is pExpr (the full vector IN(...) + ** used by each such virtual term is pExpr (the full vector IN(...) ** expression). The WhereTerm.iField variable identifies the index within ** the vector on the LHS that the virtual term represents. ** @@ -1387,7 +1387,7 @@ Bitmask sqlite3WhereExprListUsage(WhereMaskSet *pMaskSet, ExprList *pList){ /* -** Call exprAnalyze on all terms in a WHERE clause. +** Call exprAnalyze on all terms in a WHERE clause. ** ** Note that exprAnalyze() might add new virtual terms onto the ** end of the WHERE clause. We do not want to analyze these new @@ -1406,7 +1406,7 @@ void sqlite3WhereExprAnalyze( /* ** For table-valued-functions, transform the function arguments into -** new WHERE clause terms. +** new WHERE clause terms. ** ** Each function argument translates into an equality constraint against ** a HIDDEN column in the table. diff --git a/third_party/sqlite/src/test/8_3_names.test b/third_party/sqlite/src/test/8_3_names.test index 1d63f5dcc96ce..6d4a974e4eade 100644 --- a/third_party/sqlite/src/test/8_3_names.test +++ b/third_party/sqlite/src/test/8_3_names.test @@ -137,7 +137,7 @@ do_test 8_3_names-4.0 { SELECT * FROM t1, t2 ORDER BY x, y } } {1 2 1 4 3 2 3 4} - + ########################################################################## # WAL mode. diff --git a/third_party/sqlite/src/test/affinity3.test b/third_party/sqlite/src/test/affinity3.test index a335618a74f3a..6f212e5ed9d08 100644 --- a/third_party/sqlite/src/test/affinity3.test +++ b/third_party/sqlite/src/test/affinity3.test @@ -24,17 +24,17 @@ source $testdir/tester.tcl do_execsql_test affinity3-100 { CREATE TABLE customer (id INT PRIMARY KEY); CREATE TABLE apr (id INT PRIMARY KEY, apr REAL); - + CREATE VIEW v1 AS SELECT c.id, i.apr FROM customer c LEFT JOIN apr i ON i.id=c.id; - + CREATE VIEW v2 AS SELECT c.id, v1.apr FROM customer c LEFT JOIN v1 ON v1.id=c.id; - + INSERT INTO customer (id) VALUES (1); INSERT INTO apr (id, apr) VALUES (1, 12); INSERT INTO customer (id) VALUES (2); @@ -56,7 +56,7 @@ do_execsql_test affinity3-140 { } {1 0.12 real 2 0.1201 real} # Ticket https://www.sqlite.org/src/info/7ffd1ca1d2ad4ecf (2017-01-16) -# Incorrect affinity when using automatic indexes +# Incorrect affinity when using automatic indexes # do_execsql_test affinity3-200 { CREATE TABLE map_integer (id INT, name); diff --git a/third_party/sqlite/src/test/aggnested.test b/third_party/sqlite/src/test/aggnested.test index a87c751eda86d..ee7d9c0487955 100644 --- a/third_party/sqlite/src/test/aggnested.test +++ b/third_party/sqlite/src/test/aggnested.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file implements regression tests for SQLite library. # -# This file implements tests for processing aggregate queries with +# This file implements tests for processing aggregate queries with # subqueries in which the subqueries hold the aggregate functions # or in which the subqueries are themselves aggregate queries # @@ -52,17 +52,17 @@ do_test aggnested-1.4 { do_test aggnested-2.0 { sqlite3 db2 :memory: db2 eval { - CREATE TABLE t1 (A1 INTEGER NOT NULL,A2 INTEGER NOT NULL,A3 INTEGER NOT + CREATE TABLE t1 (A1 INTEGER NOT NULL,A2 INTEGER NOT NULL,A3 INTEGER NOT NULL,A4 INTEGER NOT NULL,PRIMARY KEY(A1)); REPLACE INTO t1 VALUES(1,11,111,1111); REPLACE INTO t1 VALUES(2,22,222,2222); REPLACE INTO t1 VALUES(3,33,333,3333); - CREATE TABLE t2 (B1 INTEGER NOT NULL,B2 INTEGER NOT NULL,B3 INTEGER NOT + CREATE TABLE t2 (B1 INTEGER NOT NULL,B2 INTEGER NOT NULL,B3 INTEGER NOT NULL,B4 INTEGER NOT NULL,PRIMARY KEY(B1)); REPLACE INTO t2 VALUES(1,88,888,8888); REPLACE INTO t2 VALUES(2,99,999,9999); SELECT (SELECT GROUP_CONCAT(CASE WHEN a1=1 THEN'A' ELSE 'B' END) FROM t2), - t1.* + t1.* FROM t1; } } {A,B,B 3 33 333 3333} @@ -232,6 +232,6 @@ do_test aggnested-3.16 { GROUP BY id1; } } {12 2 34 4} - + finish_test diff --git a/third_party/sqlite/src/test/all.test b/third_party/sqlite/src/test/all.test index f6e722f2dfaa0..6730ce4f65d4f 100644 --- a/third_party/sqlite/src/test/all.test +++ b/third_party/sqlite/src/test/all.test @@ -16,27 +16,27 @@ source $testdir/permutations.test run_test_suite full -run_test_suite no_optimization -run_test_suite memsubsys1 -run_test_suite memsubsys2 -run_test_suite singlethread -run_test_suite multithread -run_test_suite onefile -run_test_suite utf16 +run_test_suite no_optimization +run_test_suite memsubsys1 +run_test_suite memsubsys2 +run_test_suite singlethread +run_test_suite multithread +run_test_suite onefile +run_test_suite utf16 run_test_suite exclusive -run_test_suite persistent_journal -run_test_suite persistent_journal_error -run_test_suite no_journal +run_test_suite persistent_journal +run_test_suite persistent_journal_error +run_test_suite no_journal run_test_suite no_journal_error -run_test_suite autovacuum_ioerr -run_test_suite no_mutex_try -run_test_suite fullmutex -run_test_suite journaltest +run_test_suite autovacuum_ioerr +run_test_suite no_mutex_try +run_test_suite fullmutex +run_test_suite journaltest run_test_suite inmemory_journal -run_test_suite pcache0 -run_test_suite pcache10 -run_test_suite pcache50 -run_test_suite pcache90 +run_test_suite pcache0 +run_test_suite pcache10 +run_test_suite pcache50 +run_test_suite pcache90 run_test_suite pcache100 run_test_suite prepare run_test_suite mmap diff --git a/third_party/sqlite/src/test/alter.test b/third_party/sqlite/src/test/alter.test index 76c18cedc9df2..31cc95784a8c5 100644 --- a/third_party/sqlite/src/test/alter.test +++ b/third_party/sqlite/src/test/alter.test @@ -29,10 +29,10 @@ ifcapable !altertable { # alter-1.1.* - alter-1.7.*: Basic tests of ALTER TABLE, including tables # with implicit and explicit indices. These tests came from an earlier # fork of SQLite that also supported ALTER TABLE. -# alter-1.8.*: Tests for ALTER TABLE when the table resides in an +# alter-1.8.*: Tests for ALTER TABLE when the table resides in an # attached database. # alter-1.9.*: Tests for ALTER TABLE when their is whitespace between the -# table name and left parenthesis token. i.e: +# table name and left parenthesis token. i.e: # "CREATE TABLE abc (a, b, c);" # alter-2.*: Test error conditions and messages. # alter-3.*: Test ALTER TABLE on tables that have TRIGGERs attached to them. @@ -71,12 +71,12 @@ do_test alter-1.1 { do_test alter-1.2 { execsql [subst { CREATE $::temp TABLE objlist(type, name, tbl_name); - INSERT INTO objlist SELECT type, name, tbl_name + INSERT INTO objlist SELECT type, name, tbl_name FROM sqlite_master WHERE NAME!='objlist'; }] ifcapable tempdb { execsql { - INSERT INTO objlist SELECT type, name, tbl_name + INSERT INTO objlist SELECT type, name, tbl_name FROM temp.sqlite_master WHERE NAME!='objlist'; } } @@ -122,7 +122,7 @@ do_test alter-1.5 { FROM sqlite_master WHERE NAME!='objlist'; } catchsql { - INSERT INTO objlist SELECT type, name, tbl_name + INSERT INTO objlist SELECT type, name, tbl_name FROM sqlite_temp_master WHERE NAME!='objlist'; } execsql { @@ -152,10 +152,10 @@ ifcapable tempdb { execsql { CREATE TEMP TABLE objlist(type, name, tbl_name); INSERT INTO objlist SELECT type, name, tbl_name FROM sqlite_master; - INSERT INTO objlist - SELECT type, name, tbl_name FROM temp.sqlite_master + INSERT INTO objlist + SELECT type, name, tbl_name FROM temp.sqlite_master WHERE NAME!='objlist'; - SELECT type, name, tbl_name FROM objlist + SELECT type, name, tbl_name FROM objlist ORDER BY tbl_name, type desc, name; } } [list \ @@ -173,7 +173,7 @@ ifcapable tempdb { } } -# Create bogus application-defined functions for functions used +# Create bogus application-defined functions for functions used # internally by ALTER TABLE, to ensure that ALTER TABLE falls back # to the built-in functions. # @@ -201,7 +201,7 @@ do_test alter-1.7 { FROM sqlite_master WHERE NAME!='objlist'; } catchsql { - INSERT INTO objlist SELECT type, name, tbl_name + INSERT INTO objlist SELECT type, name, tbl_name FROM sqlite_temp_master WHERE NAME!='objlist'; } execsql { @@ -428,22 +428,22 @@ ifcapable attach { } {0 {}} do_test alter-3.2.3 { catchsql { - CREATE TABLE ON.t1(a, b, c); + CREATE TABLE ON.t1(a, b, c); } } {1 {near "ON": syntax error}} do_test alter-3.2.4 { catchsql { - CREATE TABLE 'ON'.t1(a, b, c); + CREATE TABLE 'ON'.t1(a, b, c); } } {0 {}} do_test alter-3.2.4 { catchsql { - CREATE TABLE 'ON'.ON(a, b, c); + CREATE TABLE 'ON'.ON(a, b, c); } } {1 {near "ON": syntax error}} do_test alter-3.2.5 { catchsql { - CREATE TABLE 'ON'.'ON'(a, b, c); + CREATE TABLE 'ON'.'ON'(a, b, c); } } {0 {}} } @@ -493,7 +493,7 @@ do_test alter-3.3.3 { execsql { ALTER TABLE tbl1 RENAME TO tbl2; INSERT INTO tbl2 VALUES('d', 'e', 'f'); - } + } set ::TRIGGER } {trig1 d e f} do_test alter-3.3.4 { @@ -501,19 +501,19 @@ do_test alter-3.3.4 { CREATE $::temp TRIGGER trig2 AFTER UPDATE ON tbl2 BEGIN SELECT trigfunc('trig2', new.a, new.b, new.c); END; - }] + }] } {} do_test alter-3.3.5 { execsql { ALTER TABLE tbl2 RENAME TO tbl3; INSERT INTO tbl3 VALUES('g', 'h', 'i'); - } + } set ::TRIGGER } {trig1 g h i} do_test alter-3.3.6 { execsql { UPDATE tbl3 SET a = 'G' where a = 'g'; - } + } set ::TRIGGER } {trig2 G h i} do_test alter-3.3.7 { @@ -607,7 +607,7 @@ execsql " set ::tbl_name2 "abcXdef" do_test alter-6.3 { execsql " - ALTER TABLE $::tbl_name RENAME TO $::tbl_name2 + ALTER TABLE $::tbl_name RENAME TO $::tbl_name2 " execsql " SELECT sql FROM sqlite_master WHERE oid = $::oid @@ -698,7 +698,7 @@ do_test alter-9.2 { } {{} {} {}} #------------------------------------------------------------------------ -# alter-10.X - Make sure ALTER TABLE works with multi-byte UTF-8 characters +# alter-10.X - Make sure ALTER TABLE works with multi-byte UTF-8 characters # in the names. # do_test alter-10.1 { @@ -796,7 +796,7 @@ do_test alter-12.4 { execsql { SELECT * FROM v1; } } {} do_test alter-12.5 { - catchsql { + catchsql { ALTER TABLE v1 ADD COLUMN new_column; } } {1 {Cannot add a column to a view}} diff --git a/third_party/sqlite/src/test/alter2.test b/third_party/sqlite/src/test/alter2.test index 14be637f970ff..ffb554162409a 100644 --- a/third_party/sqlite/src/test/alter2.test +++ b/third_party/sqlite/src/test/alter2.test @@ -9,7 +9,7 @@ # #************************************************************************* # This file implements regression tests for SQLite library. The -# focus of this script is testing that SQLite can handle a subtle +# focus of this script is testing that SQLite can handle a subtle # file format change that may be used in the future to implement # "ALTER TABLE ... ADD COLUMN". # @@ -27,20 +27,20 @@ ifcapable {!pragma} return # do_not_use_codec -# The file format change affects the way row-records stored in tables (but -# not indices) are interpreted. Before version 3.1.3, a row-record for a +# The file format change affects the way row-records stored in tables (but +# not indices) are interpreted. Before version 3.1.3, a row-record for a # table with N columns was guaranteed to contain exactly N fields. As # of version 3.1.3, the record may contain up to N fields. In this case -# the M fields that are present are the values for the left-most M +# the M fields that are present are the values for the left-most M # columns. The (N-M) rightmost columns contain NULL. # # If any records in the database contain less fields than their table -# has columns, then the file-format meta value should be set to (at least) 2. +# has columns, then the file-format meta value should be set to (at least) 2. # # This procedure sets the value of the file-format in file 'test.db' # to $newval. Also, the schema cookie is incremented. -# +# proc set_file_format {newval} { hexio_write test.db 44 [hexio_render_int32 $newval] set schemacookie [hexio_get_int [hexio_read test.db 40 4]] @@ -50,7 +50,7 @@ proc set_file_format {newval} { } # This procedure returns the value of the file-format in file 'test.db'. -# +# proc get_file_format {{fname test.db}} { return [hexio_get_int [hexio_read $fname 44 4]] } @@ -58,7 +58,7 @@ proc get_file_format {{fname test.db}} { # This procedure sets the SQL statement stored for table $tbl in the # sqlite_master table of file 'test.db' to $sql. Also set the file format # to the supplied value. This is 2 if the added column has a default that is -# NULL, or 3 otherwise. +# NULL, or 3 otherwise. # proc alter_table {tbl sql {file_format 2}} { sqlite3 dbat test.db @@ -73,7 +73,7 @@ proc alter_table {tbl sql {file_format 2}} { set_file_format 2 } -# Create bogus application-defined functions for functions used +# Create bogus application-defined functions for functions used # internally by ALTER TABLE, to ensure that ALTER TABLE falls back # to the built-in functions. # @@ -243,7 +243,7 @@ ifcapable trigger { #--------------------------------------------------------------------- # Check that an error occurs if the database is upgraded to a file -# format that SQLite does not support (in this case 5). Note: The +# format that SQLite does not support (in this case 5). Note: The # file format is checked each time the schema is read, so changing the # file format requires incrementing the schema cookie. # @@ -255,7 +255,7 @@ do_test alter2-4.1 { } {} do_test alter2-4.2 { # We have to run two queries here because the Tcl interface uses - # sqlite3_prepare_v2(). In this case, the first query encounters an + # sqlite3_prepare_v2(). In this case, the first query encounters an # SQLITE_SCHEMA error. Then, when trying to recompile the statement, the # "unsupported file format" error is encountered. So the error code # returned is SQLITE_SCHEMA, not SQLITE_ERROR as required by the following @@ -302,9 +302,9 @@ ifcapable vacuum { get_file_format } $default_file_format } - + #--------------------------------------------------------------------- -# Test that when a database with file-format 2 is opened, new +# Test that when a database with file-format 2 is opened, new # databases are still created with file-format 1. # do_test alter2-6.1 { @@ -328,11 +328,11 @@ do_test alter2-6.3 { execsql { CREATE TABLE t1(a, b); } - get_file_format + get_file_format } {2} #--------------------------------------------------------------------- -# Test that types and values for columns added with default values +# Test that types and values for columns added with default values # other than NULL work with SELECT statements. # do_test alter2-7.1 { @@ -373,9 +373,9 @@ do_test alter2-7.5 { #----------------------------------------------------------------------- # Test that UPDATE trigger tables work with default values, and that when -# a row is updated the default values are correctly transfered to the +# a row is updated the default values are correctly transfered to the # new row. -# +# ifcapable trigger { db function set_val {set ::val} do_test alter2-8.1 { @@ -383,7 +383,7 @@ db function set_val {set ::val} CREATE TRIGGER trig1 BEFORE UPDATE ON t1 BEGIN SELECT set_val( old.b||' '||typeof(old.b)||' '||old.c||' '||typeof(old.c)||' '|| - new.b||' '||typeof(new.b)||' '||new.c||' '||typeof(new.c) + new.b||' '||typeof(new.b)||' '||new.c||' '||typeof(new.c) ); END; } @@ -404,9 +404,9 @@ ifcapable trigger { #----------------------------------------------------------------------- # Test that DELETE trigger tables work with default values, and that when -# a row is updated the default values are correctly transfered to the +# a row is updated the default values are correctly transfered to the # new row. -# +# ifcapable trigger { do_test alter2-9.1 { execsql { @@ -427,7 +427,7 @@ ifcapable trigger { } #----------------------------------------------------------------------- -# Test creating an index on a column added with a default value. +# Test creating an index on a column added with a default value. # ifcapable bloblit { do_test alter2-10.1 { diff --git a/third_party/sqlite/src/test/alter3.test b/third_party/sqlite/src/test/alter3.test index 44b31c983391c..236f481baa9b8 100644 --- a/third_party/sqlite/src/test/alter3.test +++ b/third_party/sqlite/src/test/alter3.test @@ -9,7 +9,7 @@ # #************************************************************************* # This file implements regression tests for SQLite library. The -# focus of this script is testing that SQLite can handle a subtle +# focus of this script is testing that SQLite can handle a subtle # file format change that may be used in the future to implement # "ALTER TABLE ... ADD COLUMN". # @@ -48,7 +48,7 @@ if {[catch {sqlite3 -has-codec} r] || $r} { # # This procedure returns the value of the file-format in file 'test.db'. -# +# proc get_file_format {{fname test.db}} { return [hexio_get_int [hexio_read $fname 44 4]] } @@ -104,12 +104,12 @@ do_test alter3-1.7 { do_test alter3-1.99 { catchsql { # May not exist if foriegn-keys are omitted at compile time. - DROP TABLE t2; + DROP TABLE t2; } execsql { - DROP TABLE abc; - DROP TABLE t1; - DROP TABLE t3; + DROP TABLE abc; + DROP TABLE t1; + DROP TABLE t3; } } {} @@ -247,7 +247,7 @@ ifcapable attach { CREATE TABLE aux.t1 AS SELECT * FROM t1; PRAGMA aux.schema_version = 30; SELECT sql FROM aux.sqlite_master; - } + } } {{CREATE TABLE t1(a,b)}} do_test alter3-5.2 { execsql { @@ -319,7 +319,7 @@ ifcapable trigger&&tempdb { CREATE TEMP TRIGGER t1_b AFTER INSERT ON t1 BEGIN INSERT INTO log VALUES('b', new.a, new.b); END; - + INSERT INTO t1 VALUES(1, 2); SELECT * FROM log; } @@ -386,7 +386,7 @@ do_test alter3-8.2 { lappend cols c$i } set ::sql "CREATE TABLE t4([join $cols {, }])" - list + list } {} do_test alter3-8.2 { execsql { diff --git a/third_party/sqlite/src/test/alter4.test b/third_party/sqlite/src/test/alter4.test index 5155110cf58d0..63eb9936d83ca 100644 --- a/third_party/sqlite/src/test/alter4.test +++ b/third_party/sqlite/src/test/alter4.test @@ -9,7 +9,7 @@ # #************************************************************************* # This file implements regression tests for SQLite library. The -# focus of this script is testing that SQLite can handle a subtle +# focus of this script is testing that SQLite can handle a subtle # file format change that may be used in the future to implement # "ALTER TABLE ... ADD COLUMN". # @@ -111,12 +111,12 @@ do_test alter4-1.7 { do_test alter4-1.99 { catchsql { # May not exist if foriegn-keys are omitted at compile time. - DROP TABLE t2; + DROP TABLE t2; } execsql { - DROP TABLE abc; - DROP TABLE t1; - DROP TABLE t3; + DROP TABLE abc; + DROP TABLE t1; + DROP TABLE t3; } } {} @@ -248,7 +248,7 @@ ifcapable attach { CREATE TABLE aux.t1 AS SELECT * FROM t1; PRAGMA aux.schema_version = 30; SELECT sql FROM aux.sqlite_master; - } + } } {{CREATE TABLE t1(a,b)}} do_test alter4-5.2 { execsql { @@ -315,7 +315,7 @@ ifcapable trigger&&tempdb { CREATE TEMP TRIGGER t1_b AFTER INSERT ON t1 BEGIN INSERT INTO log VALUES('b', new.a, new.b); END; - + INSERT INTO t1 VALUES(1, 2); SELECT * FROM log; } @@ -346,7 +346,7 @@ do_test alter4-8.2 { lappend cols c$i } set ::sql "CREATE TABLE t4([join $cols {, }])" - list + list } {} do_test alter4-8.2 { execsql { @@ -370,7 +370,7 @@ do_execsql_test alter4-9.2 { SELECT typeof(a), a, typeof(b), b FROM t5; } { real 9.22337203685478e+18 } -do_execsql_test alter4-9.3 { +do_execsql_test alter4-9.3 { ALTER TABLE t5 ADD COLUMN c INTEGER DEFAULT (-(-9223372036854775808)); SELECT typeof(c), c FROM t5; } {real 9.22337203685478e+18} diff --git a/third_party/sqlite/src/test/altermalloc.test b/third_party/sqlite/src/test/altermalloc.test index a35e7d5a345ca..70aa4e8052bed 100644 --- a/third_party/sqlite/src/test/altermalloc.test +++ b/third_party/sqlite/src/test/altermalloc.test @@ -46,7 +46,7 @@ do_malloc_test altermalloc-1 -tclprep { # ifcapable vtab { do_malloc_test altermalloc-vtab -tclprep { - sqlite3 db2 test.db + sqlite3 db2 test.db sqlite3_db_config_lookaside db2 0 0 0 sqlite3_extended_result_codes db2 1 register_echo_module [sqlite3_connection_pointer db2] diff --git a/third_party/sqlite/src/test/analyze.test b/third_party/sqlite/src/test/analyze.test index af277cc835277..697c575537e4c 100644 --- a/third_party/sqlite/src/test/analyze.test +++ b/third_party/sqlite/src/test/analyze.test @@ -287,7 +287,7 @@ do_test analyze-4.3 { } } {} -# Verify that DROP TABLE and DROP INDEX remove entries from the +# Verify that DROP TABLE and DROP INDEX remove entries from the # sqlite_stat1, sqlite_stat3 and sqlite_stat4 tables. # do_test analyze-5.0 { diff --git a/third_party/sqlite/src/test/analyze3.test b/third_party/sqlite/src/test/analyze3.test index 2fb558d16a285..e8ac58264d43e 100644 --- a/third_party/sqlite/src/test/analyze3.test +++ b/third_party/sqlite/src/test/analyze3.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file implements regression tests for SQLite library. This file +# This file implements regression tests for SQLite library. This file # implements tests for range and LIKE constraints that use bound variables # instead of literal constant arguments. # @@ -26,15 +26,15 @@ ifcapable !stat4&&!stat3 { #---------------------------------------------------------------------- # Test Organization: # -# analyze3-1.*: Test that the values of bound parameters are considered +# analyze3-1.*: Test that the values of bound parameters are considered # in the same way as constants when planning queries that # use range constraints. # -# analyze3-2.*: Test that the values of bound parameters are considered +# analyze3-2.*: Test that the values of bound parameters are considered # in the same way as constants when planning queries that # use LIKE expressions in the WHERE clause. # -# analyze3-3.*: Test that binding to a variable does not invalidate the +# analyze3-3.*: Test that binding to a variable does not invalidate the # query plan when there is no way in which replanning the # query may produce a superior outcome. # @@ -44,10 +44,10 @@ ifcapable !stat4&&!stat3 { # analyze3-5.*: Check that the query plans of applicable statements are # invalidated if the values of SQL parameter are modified # using the clear_bindings() or transfer_bindings() APIs. -# +# # analyze3-6.*: Test that the problem fixed by commit [127a5b776d] is fixed. # -# analyze3-7.*: Test that some memory leaks discovered by fuzz testing +# analyze3-7.*: Test that some memory leaks discovered by fuzz testing # have been fixed. # @@ -67,14 +67,14 @@ proc sf_execsql {sql {db db}} { #------------------------------------------------------------------------- # -# analyze3-1.1.1: -# Create a table with two columns. Populate the first column (affinity -# INTEGER) with integer values from 100 to 1100. Create an index on this +# analyze3-1.1.1: +# Create a table with two columns. Populate the first column (affinity +# INTEGER) with integer values from 100 to 1100. Create an index on this # column. ANALYZE the table. # # analyze3-1.1.2 - 3.1.3 # Show that there are two possible plans for querying the table with -# a range constraint on the indexed column - "full table scan" or "use +# a range constraint on the indexed column - "full table scan" or "use # the index". When the range is specified using literal values, SQLite # is able to pick the best plan based on the samples in sqlite_stat3. # @@ -82,8 +82,8 @@ proc sf_execsql {sql {db db}} { # Show that using SQL variables produces the same results as using # literal values to constrain the range scan. # -# These tests also check that the compiler code considers column -# affinities when estimating the number of rows scanned by the "use +# These tests also check that the compiler code considers column +# affinities when estimating the number of rows scanned by the "use # index strategy". # do_test analyze3-1.1.1 { @@ -113,14 +113,14 @@ do_execsql_test analyze3-1.1.x { } {99 1000} # The first of the following two SELECT statements visits 99 rows. So -# it is better to use the index. But the second visits every row in +# it is better to use the index. But the second visits every row in # the table (1000 in total) so it is better to do a full-table scan. # do_eqp_test analyze3-1.1.2 { SELECT sum(y) FROM t1 WHERE x>200 AND x<300 } {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (x>? AND x0 AND x<1100 + SELECT sum(y) FROM t1 WHERE x>0 AND x<1100 } {0 0 0 {SCAN TABLE t1}} do_test analyze3-1.1.4 { @@ -326,7 +326,7 @@ do_test analyze3-2.11 { #------------------------------------------------------------------------- # This block of tests checks that statements are correctly marked as -# expired when the values bound to any parameters that may affect the +# expired when the values bound to any parameters that may affect the # query plan are modified. # drop_all_tables diff --git a/third_party/sqlite/src/test/analyze4.test b/third_party/sqlite/src/test/analyze4.test index 974ed89a867ce..a697ac0043f26 100644 --- a/third_party/sqlite/src/test/analyze4.test +++ b/third_party/sqlite/src/test/analyze4.test @@ -9,9 +9,9 @@ # #*********************************************************************** # -# This file implements regression tests for SQLite library. This file +# This file implements regression tests for SQLite library. This file # implements tests for ANALYZE to verify that multiple rows containing -# a NULL value count as distinct rows for the purposes of analyze +# a NULL value count as distinct rows for the purposes of analyze # statistics. # # Also include test cases for collating sequences on indices. @@ -50,7 +50,7 @@ do_test analyze4-1.1 { } {t1a {128 1} t1b {128 128}} # Change half of the b values from NULL to a constant. Verify -# that the number of rows selected in stat1 is half the total +# that the number of rows selected in stat1 is half the total # number of rows. # do_test analyze4-1.2 { @@ -62,7 +62,7 @@ do_test analyze4-1.2 { } {t1a {128 1} t1b {128 64}} # Change the t1.b values all back to NULL. Add columns t1.c and t1.d. -# Create a multi-column indices using t1.b and verify that ANALYZE +# Create a multi-column indices using t1.b and verify that ANALYZE # processes them correctly. # do_test analyze4-1.3 { diff --git a/third_party/sqlite/src/test/analyze5.test b/third_party/sqlite/src/test/analyze5.test index ac175c07b5953..5891e601e6896 100644 --- a/third_party/sqlite/src/test/analyze5.test +++ b/third_party/sqlite/src/test/analyze5.test @@ -57,7 +57,7 @@ do_test analyze5-1.0 { if {$i%2} {set v $u} {set v [string toupper $u]} db eval {INSERT INTO t1 VALUES($t,$u,$v,$w,$x,$y,$z)} } - db eval { + db eval { CREATE INDEX t1t ON t1(t); -- 0.5, 1.5, 2.5, and 3.5 CREATE INDEX t1u ON t1(u); -- text CREATE INDEX t1v ON t1(v); -- mixed case text @@ -69,7 +69,7 @@ do_test analyze5-1.0 { } ifcapable stat4 { db eval { - SELECT DISTINCT lindex(test_decode(sample),0) + SELECT DISTINCT lindex(test_decode(sample),0) FROM sqlite_stat4 WHERE idx='t1u' ORDER BY nlt; } } else { @@ -82,7 +82,7 @@ do_test analyze5-1.0 { do_test analyze5-1.1 { ifcapable stat4 { db eval { - SELECT DISTINCT lower(lindex(test_decode(sample), 0)) + SELECT DISTINCT lower(lindex(test_decode(sample), 0)) FROM sqlite_stat4 WHERE idx='t1v' ORDER BY 1 } } else { @@ -126,7 +126,7 @@ foreach {testid where index rows} { 20 {z>=-100 AND z<2} t1z 700 21 {z>=-100 AND z<=2} t1z 875 22 {z>=-100 AND z<3} t1z 875 - + 31 {z>=0.0 AND z<=0.0} t1z 400 32 {z>=1.0 AND z<=1.0} t1z 300 33 {z>=2.0 AND z<=2.0} t1z 175 @@ -149,7 +149,7 @@ foreach {testid where index rows} { 50 {z>=-100 AND z<2.0} t1z 700 51 {z>=-100 AND z<=2.0} t1z 875 52 {z>=-100 AND z<3.0} t1z 875 - + 101 {z=-1} t1z 1 102 {z=0} t1z 400 103 {z=1} t1z 300 @@ -164,7 +164,7 @@ foreach {testid where index rows} { 112 {z=4.0} t1z 1 113 {z=1.5} t1z 1 114 {z=2.5} t1z 1 - + 201 {z IN (-1)} t1z 1 202 {z IN (0)} t1z 400 203 {z IN (1)} t1z 300 diff --git a/third_party/sqlite/src/test/analyze8.test b/third_party/sqlite/src/test/analyze8.test index 1079e68080d1c..4b66c6420ab0c 100644 --- a/third_party/sqlite/src/test/analyze8.test +++ b/third_party/sqlite/src/test/analyze8.test @@ -84,12 +84,12 @@ do_test 2.1 { # There are many more values of c between 0 and 100000 than there are # between 800000 and 900000. So t1c is more selective for the latter # range. -# +# # Test 3.2 is a little unstable. It depends on the planner estimating # that (b BETWEEN 30 AND 34) will match more rows than (c BETWEEN # 800000 AND 900000). Which is a pretty close call (50 vs. 32), so # the planner could get it wrong with an unlucky set of samples. This -# case happens to work, but others ("b BETWEEN 40 AND 44" for example) +# case happens to work, but others ("b BETWEEN 40 AND 44" for example) # will fail. # do_execsql_test 3.0 { diff --git a/third_party/sqlite/src/test/analyze9.test b/third_party/sqlite/src/test/analyze9.test index 918577bd19c1b..e3cf6d8699e31 100644 --- a/third_party/sqlite/src/test/analyze9.test +++ b/third_party/sqlite/src/test/analyze9.test @@ -38,7 +38,7 @@ proc s {blob} { db function s s do_execsql_test 1.0 { - CREATE TABLE t1(a TEXT, b TEXT); + CREATE TABLE t1(a TEXT, b TEXT); INSERT INTO t1 VALUES('(0)', '(0)'); INSERT INTO t1 VALUES('(1)', '(1)'); INSERT INTO t1 VALUES('(2)', '(2)'); @@ -87,12 +87,12 @@ do_execsql_test 2.1 { ANALYZE; SELECT test_decode(sample) FROM sqlite_stat4; } { - {22.0 NULL x'656667' 2} + {22.0 NULL x'656667' 2} {{some text} 14 NULL 1} } #------------------------------------------------------------------------- -# +# reset_db do_execsql_test 3.1 { CREATE TABLE t2(a, b); @@ -125,7 +125,7 @@ do_execsql_test 3.3.2 { } [lrange [string repeat "10 " 100] 0 23] #------------------------------------------------------------------------- -# +# do_execsql_test 3.4 { DROP TABLE IF EXISTS t1; CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); @@ -143,7 +143,7 @@ do_execsql_test 3.4 { INSERT INTO t1 SELECT a+2,3,'three'||substr(c,4) FROM t1 WHERE c GLOB 'one-*'; INSERT INTO t1 SELECT a+3,4,'four'||substr(c,4) FROM t1 WHERE c GLOB 'one-*'; INSERT INTO t1 SELECT a+4,5,'five'||substr(c,4) FROM t1 WHERE c GLOB 'one-*'; - INSERT INTO t1 SELECT a+5,6,'six'||substr(c,4) FROM t1 WHERE c GLOB 'one-*'; + INSERT INTO t1 SELECT a+5,6,'six'||substr(c,4) FROM t1 WHERE c GLOB 'one-*'; CREATE INDEX t1b ON t1(b); ANALYZE; SELECT c FROM t1 WHERE b=3 AND a BETWEEN 30 AND 60; @@ -151,7 +151,7 @@ do_execsql_test 3.4 { #------------------------------------------------------------------------- -# These tests verify that the sample selection for stat4 appears to be +# These tests verify that the sample selection for stat4 appears to be # working as designed. # @@ -209,7 +209,7 @@ do_test 4.1 { } {24 297} do_execsql_test 4.2 { - SELECT + SELECT neq, lrange(nlt, 0, 2), lrange(ndlt, 0, 2), @@ -236,7 +236,7 @@ do_execsql_test 4.2 { } do_execsql_test 4.3 { - SELECT + SELECT neq, lrange(nlt, 0, 2), lrange(ndlt, 0, 2), @@ -244,7 +244,7 @@ do_execsql_test 4.3 { FROM sqlite_stat4 ORDER BY rowid DESC LIMIT 2; } { - {2 1 1 1} {295 296 296} {120 122 125} {201 4} + {2 1 1 1} {295 296 296} {120 122 125} {201 4} {5 3 1 1} {290 290 290} {119 119 119} {200 1} } @@ -254,13 +254,13 @@ do_execsql_test 4.5 { SELECT count(DISTINCT c) FROM t1 WHERE c<200 } 119 # Check that the perioidic samples are present. do_execsql_test 4.6 { SELECT count(*) FROM sqlite_stat4 - WHERE lindex(test_decode(sample), 3) IN + WHERE lindex(test_decode(sample), 3) IN ('34', '68', '102', '136', '170', '204', '238', '272') } {8} reset_db do_test 4.7 { - execsql { + execsql { BEGIN; CREATE TABLE t1(o,t INTEGER PRIMARY KEY); CREATE INDEX i1 ON t1(o); @@ -277,7 +277,7 @@ do_test 4.7 { do_execsql_test 4.8 { SELECT test_decode(sample) FROM sqlite_stat4; } { - {x 211} {x 423} {x 635} {x 847} + {x 211} {x 423} {x 635} {x 847} {x 1590} {x 3710} {x 5830} {x 7950} } @@ -590,8 +590,8 @@ do_eqp_test 13.3.2 { } {/SEARCH TABLE t1 USING INDEX i2/} #------------------------------------------------------------------------- -# Check also that affinities are taken into account when using stat4 data -# to estimate the number of rows scanned by any other constraint on a +# Check also that affinities are taken into account when using stat4 data +# to estimate the number of rows scanned by any other constraint on a # column other than the leftmost. # drop_all_tables @@ -723,9 +723,9 @@ do_execsql_test 14.4.3 { SELECT lrange(test_decode(sample), 0, 1) AS s FROM sqlite_stat4 WHERE lindex(s, 1)=='1' ORDER BY rowid } { - {0 1} {1 1} {2 1} {3 1} - {4 1} {5 1} {6 1} {7 1} - {8 1} {9 1} {10 1} {11 1} + {0 1} {1 1} {2 1} {3 1} + {4 1} {5 1} {6 1} {7 1} + {8 1} {9 1} {10 1} {11 1} {12 1} {13 1} {14 1} {15 1} } @@ -895,7 +895,7 @@ do_test 18.1 { # ifcapable view { do_test 19.1 { - reset_db + reset_db execsql { CREATE TABLE t1(x, y); CREATE INDEX i1 ON t1(x, y); @@ -910,7 +910,7 @@ ifcapable auth { return "SQLITE_OK" } do_test 19.2 { - reset_db + reset_db db auth authproc execsql { CREATE TABLE t1(x, y); @@ -948,7 +948,7 @@ do_execsql_test 20.2 { ANALYZE } for {set i 0} {$i<16} {incr i} { set val "$i $i $i $i" do_execsql_test 20.3.$i { - SELECT count(*) FROM sqlite_stat4 + SELECT count(*) FROM sqlite_stat4 WHERE lrange(test_decode(sample), 0, 3)=$val } {1} } @@ -964,8 +964,8 @@ do_execsql_test 21.0 { do_test 21.1 { for {set i 1} {$i < 100} {incr i} { - execsql { - INSERT INTO t2 VALUES(CASE WHEN $i < 80 THEN 'one' ELSE 'two' END, $i) + execsql { + INSERT INTO t2 VALUES(CASE WHEN $i < 80 THEN 'one' ELSE 'two' END, $i) } } execsql ANALYZE @@ -973,7 +973,7 @@ do_test 21.1 { # Condition (a='one') matches 80% of the table. (rowid<10) reduces this to # 10%, but (rowid<50) only reduces it to 50%. So in the first case below -# the index is used. In the second, it is not. +# the index is used. In the second, it is not. # do_eqp_test 21.2 { SELECT * FROM t2 WHERE a='one' AND rowid < 10 @@ -1031,8 +1031,8 @@ db func int_to_char int_to_char do_execsql_test 23.0 { CREATE TABLE t4( - a COLLATE nocase, b, c, - d, e, f, + a COLLATE nocase, b, c, + d, e, f, PRIMARY KEY(c, b, a) ) WITHOUT ROWID; CREATE INDEX i41 ON t4(e); @@ -1041,7 +1041,7 @@ do_execsql_test 23.0 { WITH data(a, b, c, d, e, f) AS ( SELECT int_to_char(0), 'xyz', 'zyx', '*', 0, 0 UNION ALL - SELECT + SELECT int_to_char(f+1), b, c, d, (e+1) % 2, f+1 FROM data WHERE f<1024 ) @@ -1050,13 +1050,13 @@ do_execsql_test 23.0 { } {} do_eqp_test 23.1 { - SELECT * FROM t4 WHERE + SELECT * FROM t4 WHERE (e=1 AND b='xyz' AND c='zyx' AND a<'AEA') AND f<300 } { 0 0 0 {SEARCH TABLE t4 USING INDEX i41 (e=? AND c=? AND b=? AND a? AND b=? term. Better than # (a<20) but not as good as (a<10). - do_eqp_test 25.4.1 { + do_eqp_test 25.4.1 { SELECT * FROM t6 WHERE a < 10 AND (b BETWEEN ? AND 60) } { 0 0 0 {SEARCH TABLE t6 USING INDEX aa (a? AND b 25) matches 76 rows -# (70 * 2/3 + 30). Before, due to the problem, the planner was estimating +# (70 * 2/3 + 30). Before, due to the problem, the planner was estimating # that this matched 100 rows. -# +# reset_db do_execsql_test 26.2.1 { BEGIN; CREATE TABLE t1(x, y, z); CREATE INDEX i1 ON t1(x, y); CREATE INDEX i2 ON t1(z); - - WITH + + WITH cnt(y) AS (SELECT 0 UNION ALL SELECT y+1 FROM cnt WHERE y<99), letters(x) AS ( SELECT 'A' UNION SELECT 'B' UNION SELECT 'C' UNION SELECT 'D' ) INSERT INTO t1(x, y) SELECT x, y FROM letters, cnt; - + WITH letters(x) AS ( SELECT 'A' UNION SELECT 'B' UNION SELECT 'C' UNION SELECT 'D' ) INSERT INTO t1(x, y) SELECT x, 70 FROM letters; - + WITH cnt(i) AS (SELECT 0 UNION ALL SELECT i+1 FROM cnt WHERE i<9999) INSERT INTO t1(x, y) SELECT i, i FROM cnt; - + UPDATE t1 SET z = (rowid / 95); ANALYZE; COMMIT; diff --git a/third_party/sqlite/src/test/analyzeA.test b/third_party/sqlite/src/test/analyzeA.test index a2da10edff570..a56fc3df831b6 100644 --- a/third_party/sqlite/src/test/analyzeA.test +++ b/third_party/sqlite/src/test/analyzeA.test @@ -28,12 +28,12 @@ ifcapable !stat4&&!stat3 { proc populate_stat3 {{bDropTable 1}} { # Open a second connection on database "test.db" and run ANALYZE. If this # is an ENABLE_STAT3 build, this is all that is required to create and - # populate the sqlite_stat3 table. - # + # populate the sqlite_stat3 table. + # sqlite3 db2 test.db execsql { ANALYZE } - # Now, if this is an ENABLE_STAT4 build, create and populate the + # Now, if this is an ENABLE_STAT4 build, create and populate the # sqlite_stat3 table based on the stat4 data gathered by the ANALYZE # above. Then drop the sqlite_stat4 table. # @@ -42,8 +42,8 @@ proc populate_stat3 {{bDropTable 1}} { execsql { PRAGMA writable_schema = on; CREATE TABLE sqlite_stat3(tbl,idx,neq,nlt,ndlt,sample); - INSERT INTO sqlite_stat3 - SELECT DISTINCT tbl, idx, + INSERT INTO sqlite_stat3 + SELECT DISTINCT tbl, idx, lindex(neq,0), lindex(nlt,0), lindex(ndlt,0), test_extract(sample, 0) FROM sqlite_stat4; } db2 @@ -71,14 +71,14 @@ proc populate_stat4 {{bDropTable 1}} { execsql { PRAGMA writable_schema = on; CREATE TABLE sqlite_stat4(tbl,idx,neq,nlt,ndlt,sample); - INSERT INTO sqlite_stat4 - SELECT tbl, idx, neq, nlt, ndlt, sqlite_record(sample) + INSERT INTO sqlite_stat4 + SELECT tbl, idx, neq, nlt, ndlt, sqlite_record(sample) FROM sqlite_stat3; } db2 if {$bDropTable} { execsql {DROP TABLE sqlite_stat3} db2 } execsql { PRAGMA writable_schema = off } } - + # Modify the database schema cookie to ensure that the other connection # reloads the schema. # @@ -100,7 +100,7 @@ proc populate_both {} { sqlite3 db2 test.db execsql { PRAGMA writable_schema = on; - UPDATE sqlite_stat3 SET idx = + UPDATE sqlite_stat3 SET idx = CASE idx WHEN 't1b' THEN 't1c' ELSE 't1b' END; PRAGMA writable_schema = off; @@ -111,7 +111,7 @@ proc populate_both {} { } foreach {tn analyze_cmd} { - 1 populate_stat4 + 1 populate_stat4 2 populate_stat3 3 populate_both } { @@ -141,16 +141,16 @@ foreach {tn analyze_cmd} { SELECT * FROM t1 WHERE b = 125 AND c = 16; } {0 0 0 {SEARCH TABLE t1 USING INDEX t1c (c=?)}} - do_execsql_test 1.$tn.3.1 { + do_execsql_test 1.$tn.3.1 { SELECT count(*) FROM t1 WHERE b BETWEEN 0 AND 50 } {6} - do_execsql_test 1.$tn.3.2 { + do_execsql_test 1.$tn.3.2 { SELECT count(*) FROM t1 WHERE c BETWEEN 0 AND 50 } {90} - do_execsql_test 1.$tn.3.3 { + do_execsql_test 1.$tn.3.3 { SELECT count(*) FROM t1 WHERE b BETWEEN 75 AND 125 } {90} - do_execsql_test 1.$tn.3.4 { + do_execsql_test 1.$tn.3.4 { SELECT count(*) FROM t1 WHERE c BETWEEN 75 AND 125 } {6} diff --git a/third_party/sqlite/src/test/analyzeB.test b/third_party/sqlite/src/test/analyzeB.test index e91e7d585e406..396177cf0a69b 100644 --- a/third_party/sqlite/src/test/analyzeB.test +++ b/third_party/sqlite/src/test/analyzeB.test @@ -24,7 +24,7 @@ ifcapable !stat3 { } do_execsql_test 1.0 { - CREATE TABLE t1(a TEXT, b TEXT); + CREATE TABLE t1(a TEXT, b TEXT); INSERT INTO t1 VALUES('(0)', '(0)'); INSERT INTO t1 VALUES('(1)', '(1)'); INSERT INTO t1 VALUES('(2)', '(2)'); @@ -76,11 +76,11 @@ do_execsql_test 2.1 { ANALYZE; SELECT quote(sample) FROM sqlite_stat3; } { - NULL 14 22.0 {'some text'} X'656667' + NULL 14 22.0 {'some text'} X'656667' } #------------------------------------------------------------------------- -# +# reset_db do_execsql_test 3.1 { CREATE TABLE t2(a, b); @@ -113,7 +113,7 @@ do_execsql_test 3.3.2 { } [lrange [string repeat "10 " 100] 0 23] #------------------------------------------------------------------------- -# +# do_execsql_test 3.4 { DROP TABLE IF EXISTS t1; CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); @@ -131,7 +131,7 @@ do_execsql_test 3.4 { INSERT INTO t1 SELECT a+2,3,'three'||substr(c,4) FROM t1 WHERE c GLOB 'one-*'; INSERT INTO t1 SELECT a+3,4,'four'||substr(c,4) FROM t1 WHERE c GLOB 'one-*'; INSERT INTO t1 SELECT a+4,5,'five'||substr(c,4) FROM t1 WHERE c GLOB 'one-*'; - INSERT INTO t1 SELECT a+5,6,'six'||substr(c,4) FROM t1 WHERE c GLOB 'one-*'; + INSERT INTO t1 SELECT a+5,6,'six'||substr(c,4) FROM t1 WHERE c GLOB 'one-*'; CREATE INDEX t1b ON t1(b); ANALYZE; SELECT c FROM t1 WHERE b=3 AND a BETWEEN 30 AND 60; @@ -139,7 +139,7 @@ do_execsql_test 3.4 { #------------------------------------------------------------------------- -# These tests verify that the sample selection for stat3 appears to be +# These tests verify that the sample selection for stat3 appears to be # working as designed. # @@ -230,7 +230,7 @@ do_execsql_test 4.5 { SELECT count(DISTINCT c) FROM t1 WHERE c<200 } 119 reset_db do_test 4.7 { - execsql { + execsql { BEGIN; CREATE TABLE t1(o,t INTEGER PRIMARY KEY); CREATE INDEX i1 ON t1(o); @@ -622,7 +622,7 @@ do_test 18.1 { # ifcapable view { do_test 19.1 { - reset_db + reset_db execsql { CREATE TABLE t1(x, y); CREATE INDEX i1 ON t1(x, y); @@ -637,7 +637,7 @@ ifcapable auth { return "SQLITE_OK" } do_test 19.2 { - reset_db + reset_db db auth authproc execsql { CREATE TABLE t1(x, y); diff --git a/third_party/sqlite/src/test/analyzeD.test b/third_party/sqlite/src/test/analyzeD.test index 4588aaeebc48e..faefc7a6b704f 100644 --- a/third_party/sqlite/src/test/analyzeD.test +++ b/third_party/sqlite/src/test/analyzeD.test @@ -85,7 +85,7 @@ do_eqp_test 1.4 { } do_test 1.5 { - execsql { + execsql { UPDATE t1 SET a=13 WHERE a = 3001; ANALYZE; } @@ -103,7 +103,7 @@ do_test 1.7 { sqlite3 db test.db } {} -# Same test as 1.4, except this time the 7 rows that match the a=? condition +# Same test as 1.4, except this time the 7 rows that match the a=? condition # do not feature larger values than all rows in the stat4 table. So SQLite # gets this right, even without stat1 data. do_eqp_test 1.8 { diff --git a/third_party/sqlite/src/test/async.test b/third_party/sqlite/src/test/async.test index e1bc08642e50a..442a001ce963c 100644 --- a/third_party/sqlite/src/test/async.test +++ b/third_party/sqlite/src/test/async.test @@ -43,9 +43,9 @@ set ASYNC_INCLUDE { # Enable asynchronous IO. sqlite3async_initialize "" 1 -# This proc flushes the contents of the async-IO queue through to the +# This proc flushes the contents of the async-IO queue through to the # underlying VFS. A couple of the test scripts identified in $ASYNC_INCLUDE -# above contain lines like "catch flush_async_queue" in places where +# above contain lines like "catch flush_async_queue" in places where # this is required for the tests to work in async mode. # proc flush_async_queue {} { @@ -66,7 +66,7 @@ foreach testfile [lsort -dictionary [glob $testdir/*.test]] { if {[lsearch -exact $ASYNC_INCLUDE $tail]<0} continue source $testfile - # Make sure everything is flushed through. This is because [source]ing + # Make sure everything is flushed through. This is because [source]ing # the next test file will delete the database file on disk (using # [delete_file]). If the asynchronous backend still has the file # open, it will become confused. diff --git a/third_party/sqlite/src/test/async2.test b/third_party/sqlite/src/test/async2.test index 7994a7219d748..25b1385060fd8 100644 --- a/third_party/sqlite/src/test/async2.test +++ b/third_party/sqlite/src/test/async2.test @@ -26,7 +26,7 @@ if { set setup_script { CREATE TABLE counter(c); INSERT INTO counter(c) VALUES (1); -} +} set sql_script { BEGIN; @@ -55,11 +55,11 @@ foreach err [list ioerr malloc-transient malloc-persistent] { sqlite3 db test.db execsql $::setup_script db close - + sqlite3async_initialize "" 1 sqlite3 db test.db sqlite3_db_config_lookaside db 0 0 0 - + switch -- $err { ioerr { set ::sqlite_io_error_pending $n } malloc-persistent { sqlite3_memdebug_fail $n -repeat 1 } @@ -116,7 +116,7 @@ foreach err [list ioerr malloc-transient malloc-persistent] { incr ::go -1 } } - + db close } } diff --git a/third_party/sqlite/src/test/async4.test b/third_party/sqlite/src/test/async4.test index 92a820173ea28..ad0d8653ab793 100644 --- a/third_party/sqlite/src/test/async4.test +++ b/third_party/sqlite/src/test/async4.test @@ -91,7 +91,7 @@ do_test async4.1.13 { execsql { CREATE TABLE t3(a, b, c) } db } {} do_test async4.1.14 { - execsql { + execsql { CREATE INDEX i1 ON t2(a); CREATE INDEX i2 ON t1(a); } db2 diff --git a/third_party/sqlite/src/test/atof1.test b/third_party/sqlite/src/test/atof1.test index 55f5e44d960d8..08ea0160f696c 100644 --- a/third_party/sqlite/src/test/atof1.test +++ b/third_party/sqlite/src/test/atof1.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # Tests of the sqlite3AtoF() function. # diff --git a/third_party/sqlite/src/test/attach.test b/third_party/sqlite/src/test/attach.test index 54be6a41ac91b..276bce7f7b28b 100644 --- a/third_party/sqlite/src/test/attach.test +++ b/third_party/sqlite/src/test/attach.test @@ -129,7 +129,7 @@ ifcapable schema_pragmas { do_test attach-1.11b { db_list db } {0 main 2 db2 3 db3 4 db4 5 db5 6 db6 7 db7 8 db8 9 db9} -} ;# ifcapable schema_pragmas +} ;# ifcapable schema_pragmas do_test attach-1.12 { catchsql { ATTACH 'test.db' as db2; @@ -337,7 +337,7 @@ do_test attach-2.10 { } db2 } {table t2 t2 table tx tx trigger r1 t2 index i2 t2} #do_test attach-2.11 { -# catchsql { +# catchsql { # SELECT * FROM t2 WHERE x>5; # } #} {1 {database schema has changed}} @@ -608,7 +608,7 @@ ifcapable !compound { ATTACH DATABASE 'test2.db' AS db2; INSERT INTO db2.t3 VALUES(13,14); INSERT INTO main.t3 VALUES(15,16); - } + } } ;# ifcapable !compound ifcapable view { @@ -776,7 +776,7 @@ ifcapable subquery { forcedelete test.db test.db-journal sqlite3 db test.db catchsql { - DETACH RAISE ( IGNORE ) IN ( SELECT "AAAAAA" . * ORDER BY + DETACH RAISE ( IGNORE ) IN ( SELECT "AAAAAA" . * ORDER BY REGISTER LIMIT "AAAAAA" . "AAAAAA" OFFSET RAISE ( IGNORE ) NOT NULL ) } } {1 {no such table: AAAAAA}} diff --git a/third_party/sqlite/src/test/attach2.test b/third_party/sqlite/src/test/attach2.test index f8705685419e6..a034b9c9ca9fd 100644 --- a/third_party/sqlite/src/test/attach2.test +++ b/third_party/sqlite/src/test/attach2.test @@ -116,7 +116,7 @@ do_test attach2-2.10 { do_test attach2-2.11 { # when the write failed in the previous test, the transaction should # have rolled back. - # + # # Update for version 3: A transaction is no longer rolled back if a # database is found to be busy. execsql {rollback} @@ -157,9 +157,9 @@ for {set i 2} {$i<=15} {incr i} { # A procedure to verify the status of locks on a database. # proc lock_status {testnum db expected_result} { - # If the database was compiled with OMIT_TEMPDB set, then + # If the database was compiled with OMIT_TEMPDB set, then # the lock_status list will not contain an entry for the temp - # db. But the test code doesn't know this, so its easiest + # db. But the test code doesn't know this, so its easiest # to filter it out of the $expected_result list here. ifcapable !tempdb { set expected_result [concat \ @@ -211,7 +211,7 @@ do_test attach2-4.4 { # to commit a write to test.db from db2 catchsql { INSERT INTO t1 VALUES(1, 2) - } db2 + } db2 } {1 {database is locked}} lock_status 4.4.1 db {main shared temp closed file2 unlocked} @@ -221,7 +221,7 @@ lock_status 4.4.2 db2 {main unlocked temp closed file2 unlocked} # are large enough to hold the entire change in memory. If either # is set too small, then changes will spill to the database, forcing # a reserved lock to promote to exclusive. That will mess up our -# test results. +# test results. set soft_limit [sqlite3_soft_heap_limit 0] @@ -266,7 +266,7 @@ do_test attach2-4.7 { # failing to obtain a write-lock on file2. catchsql { INSERT INTO t1 VALUES(1, 2) - } db2 + } db2 } {0 {}} lock_status 4.7.1 db {main shared temp closed file2 shared} diff --git a/third_party/sqlite/src/test/attach3.test b/third_party/sqlite/src/test/attach3.test index 1c8601c7b3547..d2f672f4abee4 100644 --- a/third_party/sqlite/src/test/attach3.test +++ b/third_party/sqlite/src/test/attach3.test @@ -26,7 +26,7 @@ ifcapable !attach { # The tests in this file were written before SQLite supported recursive # trigger invocation, and some tests depend on that to pass. So disable # recursive triggers for this file. -catchsql { pragma recursive_triggers = off } +catchsql { pragma recursive_triggers = off } # Create tables t1 and t2 in the main database execsql { @@ -149,7 +149,7 @@ do_test attach3-5.3 { } } {1 2 hello world} -# Drop the view +# Drop the view do_test attach3-6.1 { execsql { DROP VIEW aux.v1; @@ -186,7 +186,7 @@ do_test attach3-5.3 { INSERT INTO t3 VALUES(new.e*2, new.f*2); END}} -# Drop the trigger +# Drop the trigger do_test attach3-8.1 { execsql { DROP TRIGGER aux.tr1; @@ -204,7 +204,7 @@ ifcapable tempdb { execsql { CREATE TABLE main.t4(a, b, c); CREATE TABLE aux.t4(a, b, c); - CREATE TEMP TRIGGER tst_trigger BEFORE INSERT ON aux.t4 BEGIN + CREATE TEMP TRIGGER tst_trigger BEFORE INSERT ON aux.t4 BEGIN SELECT 'hello world'; END; SELECT count(*) FROM temp.sqlite_master; diff --git a/third_party/sqlite/src/test/attach4.test b/third_party/sqlite/src/test/attach4.test index 77dd7e41154f4..54a2c649d5c43 100644 --- a/third_party/sqlite/src/test/attach4.test +++ b/third_party/sqlite/src/test/attach4.test @@ -38,7 +38,7 @@ do_test 1.2.1 { db close foreach {name f} $files { forcedelete $f } sqlite3 db test.db - + foreach {name f} $files { if {$name == "main"} continue execsql "ATTACH '$f' AS $name" diff --git a/third_party/sqlite/src/test/auth.test b/third_party/sqlite/src/test/auth.test index 0044fddebec05..feaef90476afe 100644 --- a/third_party/sqlite/src/test/auth.test +++ b/third_party/sqlite/src/test/auth.test @@ -163,7 +163,7 @@ ifcapable tempdb { do_test auth-1.16 { execsql {SELECT name FROM sqlite_temp_master} } {} - + do_test auth-1.17 { proc auth {code arg1 arg2 arg3 arg4 args} { if {$code=="SQLITE_CREATE_TABLE"} { @@ -357,7 +357,7 @@ do_test auth-1.40 { } catchsql {SELECT a,c FROM t2 WHERE b IS NULL} } {1 {access to t2.b is prohibited}} - + do_test auth-1.41 { proc auth {code arg1 arg2 arg3 arg4 args} { if {$code=="SQLITE_UPDATE" && $arg1=="t2" && $arg2=="b"} { @@ -571,7 +571,7 @@ ifcapable view { do_test auth-1.79 { proc auth {code arg1 arg2 arg3 arg4 args} { if {$code=="SQLITE_CREATE_VIEW"} { - set ::authargs [list $arg1 $arg2 $arg3 $arg4] + set ::authargs [list $arg1 $arg2 $arg3 $arg4] return SQLITE_DENY } return SQLITE_OK @@ -587,7 +587,7 @@ do_test auth-1.81 { do_test auth-1.82 { proc auth {code arg1 arg2 arg3 arg4 args} { if {$code=="SQLITE_CREATE_VIEW"} { - set ::authargs [list $arg1 $arg2 $arg3 $arg4] + set ::authargs [list $arg1 $arg2 $arg3 $arg4] return SQLITE_IGNORE } return SQLITE_OK @@ -605,7 +605,7 @@ ifcapable tempdb { do_test auth-1.85 { proc auth {code arg1 arg2 arg3 arg4 args} { if {$code=="SQLITE_CREATE_TEMP_VIEW"} { - set ::authargs [list $arg1 $arg2 $arg3 $arg4] + set ::authargs [list $arg1 $arg2 $arg3 $arg4] return SQLITE_DENY } return SQLITE_OK @@ -621,7 +621,7 @@ ifcapable tempdb { do_test auth-1.88 { proc auth {code arg1 arg2 arg3 arg4 args} { if {$code=="SQLITE_CREATE_TEMP_VIEW"} { - set ::authargs [list $arg1 $arg2 $arg3 $arg4] + set ::authargs [list $arg1 $arg2 $arg3 $arg4] return SQLITE_IGNORE } return SQLITE_OK @@ -952,7 +952,7 @@ do_test auth-1.136.3 { execsql { INSERT INTO t2 VALUES(1,2,3); } - set ::authargs + set ::authargs } {SQLITE_INSERT t2 {} main {} SQLITE_INSERT tx {} main r2 SQLITE_READ t2 ROWID main r2} do_test auth-1.136.4 { execsql { @@ -1729,11 +1729,11 @@ ifcapable attach { db authorizer {} execsql {DETACH DATABASE test1} db authorizer ::auth - + # Authorization for ALTER TABLE. These tests are omitted if the library # was built without ALTER TABLE support. ifcapable altertable { - + do_test auth-1.263 { proc auth {code arg1 arg2 arg3 arg4 args} { if {$code=="SQLITE_ALTER_TABLE"} { @@ -1785,12 +1785,12 @@ ifcapable attach { do_test auth-1.270 { execsql {SELECT name FROM sqlite_temp_master WHERE type='table'} } {t1x} - + do_test auth-1.271 { set authargs } {temp t1x {} {}} } ;# ifcapable altertable - + } else { db authorizer {} db eval { @@ -1968,7 +1968,7 @@ ifcapable tempdb { } {} } -} ;# ifcapable reindex +} ;# ifcapable reindex ifcapable analyze { proc auth {code args} { @@ -2386,7 +2386,7 @@ ifcapable trigger { do_test auth-5.3.1 { execsql { CREATE TABLE t5 ( x ); - CREATE TRIGGER t5_tr1 AFTER INSERT ON t5 BEGIN + CREATE TRIGGER t5_tr1 AFTER INSERT ON t5 BEGIN UPDATE t5 SET x = 1 WHERE NEW.x = 0; END; } diff --git a/third_party/sqlite/src/test/auth3.test b/third_party/sqlite/src/test/auth3.test index 013486e5a03d1..eb6b5614cbdd1 100644 --- a/third_party/sqlite/src/test/auth3.test +++ b/third_party/sqlite/src/test/auth3.test @@ -25,7 +25,7 @@ if {[catch {db auth {}} msg]} { } # Disable the statement cache for these tests. -# +# db cache size 0 db authorizer ::auth @@ -39,7 +39,7 @@ proc auth {code arg1 arg2 arg3 arg4 args} { #-------------------------------------------------------------------------- # The following tests - auth3-1.* - test that return values of SQLITE_DENY, # SQLITE_IGNORE, SQLITE_OK and are correctly handled when returned -# by an SQLITE_DELETE authorization callback triggered by a +# by an SQLITE_DELETE authorization callback triggered by a # "DELETE FROM " statement. # do_test auth3-1.1 { @@ -62,7 +62,7 @@ do_test auth3.1.4 { } {1 2 3 4 5 6} do_test auth3-1.5 { set ::authcode SQLITE_IGNORE - execsql { + execsql { DELETE FROM t1; SELECT * FROM t1; } diff --git a/third_party/sqlite/src/test/autoinc.test b/third_party/sqlite/src/test/autoinc.test index 8ac12b1772153..aaca7591bf094 100644 --- a/third_party/sqlite/src/test/autoinc.test +++ b/third_party/sqlite/src/test/autoinc.test @@ -369,7 +369,7 @@ ifcapable tempdb { INSERT INTO t3 VALUES(NULL,4); } } {} - + ifcapable compound { do_test autoinc-4.4.1 { execsql { @@ -377,7 +377,7 @@ ifcapable tempdb { } } {10 1 11 3 20 2 21 4} } ;# ifcapable compound - + do_test autoinc-4.5 { execsql { SELECT 1, * FROM main.sqlite_sequence; @@ -559,8 +559,8 @@ do_test autoinc-9.1 { } {t3 0} ifcapable trigger { - catchsql { pragma recursive_triggers = off } - + catchsql { pragma recursive_triggers = off } + # Ticket #3928. Make sure that triggers to not make extra slots in # the SQLITE_SEQUENCE table. # @@ -589,11 +589,11 @@ ifcapable trigger { db eval { DROP TRIGGER t3928r1; DROP TRIGGER t3928r2; - CREATE TRIGGER t3928r3 BEFORE UPDATE ON t3928 + CREATE TRIGGER t3928r3 BEFORE UPDATE ON t3928 WHEN typeof(new.b)=='integer' BEGIN INSERT INTO t3928(b) VALUES('before-int-' || new.b); END; - CREATE TRIGGER t3928r4 AFTER UPDATE ON t3928 + CREATE TRIGGER t3928r4 AFTER UPDATE ON t3928 WHEN typeof(new.b)=='integer' BEGIN INSERT INTO t3928(b) VALUES('after-int-' || new.b); END; @@ -607,7 +607,7 @@ ifcapable trigger { SELECT * FROM sqlite_sequence WHERE name='t3928' } } {t3928 15} - + do_test autoinc-3928.5 { db eval { CREATE TABLE t3928b(x); @@ -638,7 +638,7 @@ ifcapable trigger { SELECT * FROM sqlite_sequence WHERE name LIKE 't3928%' ORDER BY name; } } {t3928 21 t3928c 6} - + # Ticket [a696379c1f0886615541a48b35bd8181a80e88f8] do_test autoinc-a69637.1 { db eval { diff --git a/third_party/sqlite/src/test/autoindex1.test b/third_party/sqlite/src/test/autoindex1.test index e2b8b1529e4d8..82ca1e45a0592 100644 --- a/third_party/sqlite/src/test/autoindex1.test +++ b/third_party/sqlite/src/test/autoindex1.test @@ -26,7 +26,7 @@ ifcapable {!autoindex} { return } -# Setup for logging +# Setup for logging db close sqlite3_shutdown test_sqlite3_log [list lappend ::log] @@ -181,8 +181,8 @@ do_execsql_test autoindex1-500 { SELECT b FROM t501 WHERE t501.a IN (SELECT x FROM t502 WHERE y=?); } { - 0 0 0 {SEARCH TABLE t501 USING INTEGER PRIMARY KEY (rowid=?)} - 0 0 0 {EXECUTE LIST SUBQUERY 1} + 0 0 0 {SEARCH TABLE t501 USING INTEGER PRIMARY KEY (rowid=?)} + 0 0 0 {EXECUTE LIST SUBQUERY 1} 1 0 0 {SCAN TABLE t502} } do_execsql_test autoindex1-501 { @@ -190,8 +190,8 @@ do_execsql_test autoindex1-501 { SELECT b FROM t501 WHERE t501.a IN (SELECT x FROM t502 WHERE y=t501.b); } { - 0 0 0 {SCAN TABLE t501} - 0 0 0 {EXECUTE CORRELATED LIST SUBQUERY 1} + 0 0 0 {SCAN TABLE t501} + 0 0 0 {EXECUTE CORRELATED LIST SUBQUERY 1} 1 0 0 {SEARCH TABLE t502 USING AUTOMATIC COVERING INDEX (y=?)} } do_execsql_test autoindex1-502 { @@ -200,8 +200,8 @@ do_execsql_test autoindex1-502 { WHERE t501.a=123 AND t501.a IN (SELECT x FROM t502 WHERE y=t501.b); } { - 0 0 0 {SEARCH TABLE t501 USING INTEGER PRIMARY KEY (rowid=?)} - 0 0 0 {EXECUTE CORRELATED LIST SUBQUERY 1} + 0 0 0 {SEARCH TABLE t501 USING INTEGER PRIMARY KEY (rowid=?)} + 0 0 0 {EXECUTE CORRELATED LIST SUBQUERY 1} 1 0 0 {SCAN TABLE t502} } @@ -247,15 +247,15 @@ do_execsql_test autoindex1-600 { Date_of_Registration text, Date_Last_Changed text, UNIQUE(Sheep_No)); - CREATE INDEX fo_flock_no_index + CREATE INDEX fo_flock_no_index ON flock_owner (flock_no); - CREATE INDEX fo_owner_change_date_index + CREATE INDEX fo_owner_change_date_index ON flock_owner (owner_change_date); - CREATE INDEX fo_owner_person_id_index + CREATE INDEX fo_owner_person_id_index ON flock_owner (owner_person_id); - CREATE INDEX sheep_org_flock_index + CREATE INDEX sheep_org_flock_index ON sheep (originating_flock); - CREATE INDEX sheep_reg_flock_index + CREATE INDEX sheep_reg_flock_index ON sheep (registering_flock); EXPLAIN QUERY PLAN SELECT x.sheep_no, x.registering_flock, x.date_of_registration @@ -274,11 +274,11 @@ do_execsql_test autoindex1-600 { WHERE y.sheep_no IS NULL ORDER BY x.registering_flock; } { - 1 0 0 {SCAN TABLE sheep AS s} - 1 1 1 {SEARCH TABLE flock_owner AS prev USING INDEX sqlite_autoindex_flock_owner_1 (flock_no=? AND owner_change_date? AND owner_change_date? AND owner_change_date 34; } { - 0 0 1 {SEARCH TABLE v USING INDEX ve (e>?)} + 0 0 1 {SEARCH TABLE v USING INDEX ve (e>?)} 0 1 0 {SEARCH TABLE u USING AUTOMATIC COVERING INDEX (b=?)} } diff --git a/third_party/sqlite/src/test/autoindex4.test b/third_party/sqlite/src/test/autoindex4.test index 0e7a80df216d9..9bb5d330251f8 100644 --- a/third_party/sqlite/src/test/autoindex4.test +++ b/third_party/sqlite/src/test/autoindex4.test @@ -52,7 +52,7 @@ do_execsql_test autoindex4-2.0 { # Ticket [2326c258d02ead33d] # Two joins, one with and the other without an ORDER BY clause. # The one without ORDER BY correctly returns two rows of result. -# The one with ORDER BY returns no rows. +# The one with ORDER BY returns no rows. # do_execsql_test autoindex4-3.0 { CREATE TABLE A(Name text); @@ -60,7 +60,7 @@ do_execsql_test autoindex4-3.0 { INSERT INTO Items VALUES('Item1','Parent'); INSERT INTO Items VALUES('Item2','Parent'); CREATE TABLE B(Name text); - + SELECT Items.ItemName FROM Items LEFT JOIN A ON (A.Name = Items.ItemName and Items.ItemName = 'dummy') @@ -70,7 +70,7 @@ do_execsql_test autoindex4-3.0 { } {Item1 Item2} do_execsql_test autoindex4-3.1 { CREATE INDEX Items_x1 ON Items(ItemName,Name) WHERE ItemName = 'dummy'; - + SELECT Items.ItemName FROM Items LEFT JOIN A ON (A.Name = Items.ItemName and Items.ItemName = 'dummy') diff --git a/third_party/sqlite/src/test/autoindex5.test b/third_party/sqlite/src/test/autoindex5.test index 649ae123a433a..30404b5511112 100644 --- a/third_party/sqlite/src/test/autoindex5.test +++ b/third_party/sqlite/src/test/autoindex5.test @@ -30,7 +30,7 @@ do_execsql_test autoindex5-1.0 { PRIMARY KEY (bug_name, package)); CREATE INDEX source_package_status_package ON source_package_status(package); - + CREATE TABLE source_packages (name TEXT NOT NULL, release TEXT NOT NULL, @@ -39,7 +39,7 @@ do_execsql_test autoindex5-1.0 { version TEXT NOT NULL, version_id INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (name, release, subrelease, archive)); - + CREATE TABLE bugs (name TEXT NOT NULL PRIMARY KEY, cve_status TEXT NOT NULL @@ -50,7 +50,7 @@ do_execsql_test autoindex5-1.0 { release_date TEXT NOT NULL, source_file TEXT NOT NULL, source_line INTEGER NOT NULL); - + CREATE TABLE package_notes (id INTEGER NOT NULL PRIMARY KEY, bug_name TEXT NOT NULL, @@ -66,13 +66,13 @@ do_execsql_test autoindex5-1.0 { ON package_notes(package); CREATE UNIQUE INDEX package_notes_bug ON package_notes(bug_name, package, release); - + CREATE TABLE debian_bugs (bug INTEGER NOT NULL, note INTEGER NOT NULL, PRIMARY KEY (bug, note)); - - + + CREATE VIEW debian_cve AS SELECT DISTINCT debian_bugs.bug, st.bug_name FROM package_notes, debian_bugs, source_package_status AS st @@ -124,6 +124,6 @@ do_execsql_test 2.1 { SELECT sum(z) FROM vvv WHERE x='aaa' ) FROM one; } {8.0} - + finish_test diff --git a/third_party/sqlite/src/test/autovacuum.test b/third_party/sqlite/src/test/autovacuum.test index 5c14ed85d3d28..a6d367ff35b5c 100644 --- a/third_party/sqlite/src/test/autovacuum.test +++ b/third_party/sqlite/src/test/autovacuum.test @@ -39,27 +39,27 @@ proc file_pages {} { # Test cases autovacuum-1.* work as follows: # # 1. A table with a single indexed field is created. -# 2. Approximately 20 rows are inserted into the table. Each row is long -# enough such that it uses at least 2 overflow pages for both the table +# 2. Approximately 20 rows are inserted into the table. Each row is long +# enough such that it uses at least 2 overflow pages for both the table # and index entry. # 3. The rows are deleted in a psuedo-random order. Sometimes only one row # is deleted per transaction, sometimes more than one. # 4. After each transaction the table data is checked to ensure it is correct # and a "PRAGMA integrity_check" is executed. -# 5. Once all the rows are deleted the file is checked to make sure it +# 5. Once all the rows are deleted the file is checked to make sure it # consists of exactly 4 pages. # -# Steps 2-5 are repeated for a few different psuedo-random delete patterns +# Steps 2-5 are repeated for a few different psuedo-random delete patterns # (defined by the $delete_orders list). set delete_orders [list] lappend delete_orders {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20} -lappend delete_orders {20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} +lappend delete_orders {20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} lappend delete_orders {8 18 2 4 14 11 13 3 10 7 9 5 12 17 19 15 20 6 16 1} lappend delete_orders {10 3 11 17 19 20 7 4 13 6 1 14 16 12 9 18 8 15 5 2} lappend delete_orders {{1 2 3 4 5 6 7 8 9 10} {11 12 13 14 15 16 17 18 19 20}} lappend delete_orders {{19 8 17 15} {16 11 9 14} {18 5 3 1} {13 20 7 2} {6 12}} -# The length of each table entry. +# The length of each table entry. # set ENTRY_LEN 3500 set ENTRY_LEN 3500 @@ -126,7 +126,7 @@ foreach delete_order $delete_orders { } #--------------------------------------------------------------------------- -# Tests cases autovacuum-2.* test that root pages are allocated +# Tests cases autovacuum-2.* test that root pages are allocated # and deallocated correctly at the start of the file. Operation is roughly as # follows: # @@ -245,7 +245,7 @@ do_test autovacuum-2.3.5 { } $::av4_data # Drop all the tables in the file. This puts all pages except the first 2 -# (the sqlite_master root-page and the first pointer map page) on the +# (the sqlite_master root-page and the first pointer map page) on the # free-list. do_test autovacuum-2.4.1 { execsql { @@ -577,7 +577,7 @@ do_test autovacuum-5.1 { # The problem is difficult to reproduce. The sequence of statements in # the following test are carefully designed make it occur and thus to # verify that this very obscure bug has been resolved. -# +# ifcapable integrityck&&memorydb { do_test autovacuum-6.1 { @@ -606,7 +606,7 @@ do_test autovacuum-6.1 { #--------------------------------------------------------------------- # Test cases autovacuum-7.X test the case where a page must be moved # and the destination location collides with at least one other -# entry in the page hash-table (internal to the pager.c module. +# entry in the page hash-table (internal to the pager.c module. # do_test autovacuum-7.1 { db close @@ -704,6 +704,6 @@ do_test autovacuum-9.5 { execsql { DELETE FROM t1 WHERE rowid > (SELECT max(a)/2 FROM t1) } file size test.db } $::sqlite_pending_byte - + finish_test diff --git a/third_party/sqlite/src/test/autovacuum_ioerr2.test b/third_party/sqlite/src/test/autovacuum_ioerr2.test index 891d00eb06bce..45d3a140044ee 100644 --- a/third_party/sqlite/src/test/autovacuum_ioerr2.test +++ b/third_party/sqlite/src/test/autovacuum_ioerr2.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing for correct handling of I/O errors # such as writes failing because the disk is full. -# +# # The tests in this file use special facilities that are only # available in the SQLite test fixture. # @@ -51,7 +51,7 @@ do_ioerr_test autovacuum-ioerr2-2 -tclprep { } for {set i 0} {$i<150} {incr i} { execsql { - INSERT INTO abc VALUES(randstr(100,100)); + INSERT INTO abc VALUES(randstr(100,100)); } } execsql COMMIT @@ -79,7 +79,7 @@ forcedelete backup.db ifcapable subquery { do_ioerr_test autovacuum-ioerr2-4 -tclprep { if {![file exists backup.db]} { - sqlite3 dbb backup.db + sqlite3 dbb backup.db execsql { PRAGMA auto_vacuum = 1; BEGIN; @@ -89,7 +89,7 @@ ifcapable subquery { } dbb for {set i 0} {$i<2500} {incr i} { execsql { - INSERT INTO abc VALUES(randstr(100,100)); + INSERT INTO abc VALUES(randstr(100,100)); } dbb } execsql { @@ -110,7 +110,7 @@ ifcapable subquery { BEGIN; DELETE FROM abc WHERE oid < 3; UPDATE abc SET a = randstr(100,100) WHERE oid > 2300; - UPDATE abc SET a = randstr(1100,1100) WHERE oid = + UPDATE abc SET a = randstr(1100,1100) WHERE oid = (select max(oid) from abc); COMMIT; } diff --git a/third_party/sqlite/src/test/avtrans.test b/third_party/sqlite/src/test/avtrans.test index 17a28606491ea..edf53ec9c38c5 100644 --- a/third_party/sqlite/src/test/avtrans.test +++ b/third_party/sqlite/src/test/avtrans.test @@ -24,7 +24,7 @@ source $testdir/tester.tcl do_test avtrans-1.0 { execsql { PRAGMA auto_vacuum=ON } wal_set_journal_mode - execsql { + execsql { CREATE TABLE one(a int PRIMARY KEY, b text); INSERT INTO one VALUES(1,'one'); INSERT INTO one VALUES(2,'two'); @@ -278,7 +278,7 @@ do_test avtrans-5.7 { # do_test avtrans-5.8 { execsql { - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name } @@ -287,7 +287,7 @@ do_test avtrans-5.9 { execsql { BEGIN TRANSACTION; CREATE TABLE t1(a int, b int, c int); - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -295,7 +295,7 @@ do_test avtrans-5.9 { do_test avtrans-5.10 { execsql { CREATE INDEX i1 ON t1(a); - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -303,7 +303,7 @@ do_test avtrans-5.10 { do_test avtrans-5.11 { execsql { COMMIT; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -315,7 +315,7 @@ do_test avtrans-5.12 { CREATE INDEX i2a ON t2(a); CREATE INDEX i2b ON t2(b); DROP TABLE t1; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -323,7 +323,7 @@ do_test avtrans-5.12 { do_test avtrans-5.13 { execsql { ROLLBACK; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -332,7 +332,7 @@ do_test avtrans-5.14 { execsql { BEGIN TRANSACTION; DROP INDEX i1; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -340,7 +340,7 @@ do_test avtrans-5.14 { do_test avtrans-5.15 { execsql { ROLLBACK; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -353,7 +353,7 @@ do_test avtrans-5.16 { CREATE INDEX i2x ON t2(x); CREATE INDEX i2y ON t2(y); INSERT INTO t2 VALUES(1,2,3); - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -361,7 +361,7 @@ do_test avtrans-5.16 { do_test avtrans-5.17 { execsql { COMMIT; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -381,7 +381,7 @@ do_test avtrans-5.20 { BEGIN TRANSACTION; DROP TABLE t1; DROP TABLE t2; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -395,7 +395,7 @@ do_test avtrans-5.21 { do_test avtrans-5.22 { execsql { ROLLBACK; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -842,7 +842,7 @@ do_test avtrans-9.1 { } {1024} # The following procedure computes a "signature" for table "t3". If -# T3 changes in any way, the signature should change. +# T3 changes in any way, the signature should change. # # This is used to test ROLLBACK. We gather a signature for t3, then # make lots of changes to t3, then rollback and take another signature. @@ -922,5 +922,5 @@ for {set i 2} {$i<=$limit} {incr i} { } integrity_check avtrans-10.1 wal_check_journal_mode avtrans-10.2 - + finish_test diff --git a/third_party/sqlite/src/test/backcompat.test b/third_party/sqlite/src/test/backcompat.test index 87ffc4b3eac6c..7575af6a17d49 100644 --- a/third_party/sqlite/src/test/backcompat.test +++ b/third_party/sqlite/src/test/backcompat.test @@ -19,7 +19,7 @@ # windows), where XXX can be any string. # # This test file uses the tcl code for controlling a second testfixture -# process located in lock_common.tcl. See the commments in lock_common.tcl +# process located in lock_common.tcl. See the commments in lock_common.tcl # for documentation of the available commands. # @@ -139,7 +139,7 @@ proc read_file_system {} { set ret } proc write_file_system {data} { - foreach f {test.db test.db-journal test.db-wal} d $data { + foreach f {test.db test.db-journal test.db-wal} d $data { if {[string length $d] == 0} { forcedelete $f } else { @@ -151,7 +151,7 @@ proc write_file_system {data} { #------------------------------------------------------------------------- # Actual tests begin here. # -# This first block of tests checks to see that the same database and +# This first block of tests checks to see that the same database and # journal files can be used by old and new versions. WAL and wal-index # files are tested separately below. # @@ -159,7 +159,7 @@ do_allbackcompat_test { # Test that database files are backwards compatible. # - do_test backcompat-1.1.1 { sql1 { + do_test backcompat-1.1.1 { sql1 { CREATE TABLE t1(a PRIMARY KEY, b UNIQUE); INSERT INTO t1 VALUES('abc', 'def'); } } {} @@ -257,7 +257,7 @@ unset ::incompatible #------------------------------------------------------------------------- -# Test that WAL and wal-index files may be shared between different +# Test that WAL and wal-index files may be shared between different # SQLite versions. # do_allbackcompat_test { @@ -299,8 +299,8 @@ do_allbackcompat_test { } #------------------------------------------------------------------------- -# Test that FTS3 tables may be read/written by different versions of -# SQLite. +# Test that FTS3 tables may be read/written by different versions of +# SQLite. # ifcapable fts3 { set contents { @@ -323,9 +323,9 @@ ifcapable fts3 { if {[code1 {set ::sqlite_options(fts3)}] && [code2 {set ::sqlite_options(fts3)}] } { - + do_test backcompat-3.1 { sql1 $contents } {} - + foreach {n q} { 1 "SELECT * FROM t1 ORDER BY a, b" 2 "SELECT rowid FROM t1 WHERE a MATCH 'five'" @@ -335,7 +335,7 @@ ifcapable fts3 { } { do_test backcompat-3.2 [list sql1 $q] [sql2 $q] } - + do_test backcompat-3.3 { sql1 { INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; @@ -346,7 +346,7 @@ ifcapable fts3 { INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; } } {} - + foreach {n q} { 1 "SELECT * FROM t1 ORDER BY a, b" 2 "SELECT rowid FROM t1 WHERE a MATCH 'five'" @@ -356,38 +356,38 @@ ifcapable fts3 { } { do_test backcompat-3.4 [list sql1 $q] [sql2 $q] } - + set alphabet "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 z 1 2 3 4" for {set i 0} {$i < 900} {incr i} { set term "[lindex $alphabet [expr $i/30]][lindex $alphabet [expr $i%30]] " sql1 "INSERT INTO t1 VALUES($i, '[string repeat $term 14]')" } - + foreach {n q} { 1 "SELECT * FROM t1 ORDER BY a, b" 2 "SELECT rowid FROM t1 WHERE a MATCH 'five'" 3 "SELECT * FROM t1 WHERE a MATCH 'five'" 4 "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'jk'" 5 "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'tug* OR eight'" - + 6 "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'aa'" 7 "SELECT offsets(t1) FROM t1 WHERE t1 MATCH '44'" 8 "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'a*'" } { do_test backcompat-3.5 [list sql1 $q] [sql2 $q] } - - do_test backcompat-3.6 { - sql1 "SELECT optimize(t1) FROM t1 LIMIT 1" + + do_test backcompat-3.6 { + sql1 "SELECT optimize(t1) FROM t1 LIMIT 1" } {{Index optimized}} - + foreach {n q} { 1 "SELECT * FROM t1 ORDER BY a, b" 2 "SELECT rowid FROM t1 WHERE a MATCH 'five'" 3 "SELECT * FROM t1 WHERE a MATCH 'five'" 4 "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'jk'" 5 "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'tug* OR eight'" - + 6 "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'aa'" 7 "SELECT offsets(t1) FROM t1 WHERE t1 MATCH '44'" 8 "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'a*'" @@ -396,10 +396,10 @@ ifcapable fts3 { } # Now test that an incremental merge can be started by one version - # and finished by another. And that the integrity-check still + # and finished by another. And that the integrity-check still # passes. do_test backcompat-3.8 { - sql1 { + sql1 { DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; CREATE TABLE t1(docid, words); @@ -418,8 +418,8 @@ ifcapable fts3 { } } {0 {0 1 2 3 4 5}} - if {[code1 { set ::sqlite_libversion }] >=3071200 - && [code2 { set ::sqlite_libversion }] >=3071200 + if {[code1 { set ::sqlite_libversion }] >=3071200 + && [code2 { set ::sqlite_libversion }] >=3071200 } { if {[code1 { set ::sqlite_libversion }]<3120000} { set res {0 {0 1} 1 0} @@ -447,8 +447,8 @@ ifcapable fts3 { } #------------------------------------------------------------------------- -# Test that Rtree tables may be read/written by different versions of -# SQLite. +# Test that Rtree tables may be read/written by different versions of +# SQLite. # ifcapable rtree { set contents { @@ -494,29 +494,29 @@ ifcapable rtree { if {[code1 {set ::sqlite_options(fts3)}] && [code2 {set ::sqlite_options(fts3)}] } { - + do_test backcompat-4.1 { sql1 $contents } {} - + foreach {n q} $::queries { do_test backcompat-4.2.$n [list sql1 $q] [sql2 $q] } - + do_test backcompat-4.3 { sql1 { INSERT INTO t1 SELECT id+100, x1+10.0, x2+10.0, y1-10.0, y2-10.0 FROM t1; } } {} - + foreach {n q} $::queries { do_test backcompat-4.4.$n [list sql1 $q] [sql2 $q] } - + do_test backcompat-4.5 { sql2 { INSERT INTO t1 SELECT id+200, x1+20.0, x2+20.0, y1-20.0, y2-20.0 FROM t1; } } {} - + foreach {n q} $::queries { do_test backcompat-4.6.$n [list sql1 $q] [sql2 $q] } - + } } } diff --git a/third_party/sqlite/src/test/backup.test b/third_party/sqlite/src/test/backup.test index 829b32452da01..95b5cd2156de3 100644 --- a/third_party/sqlite/src/test/backup.test +++ b/third_party/sqlite/src/test/backup.test @@ -40,7 +40,7 @@ do_not_use_codec # # backup-9.*: Test that passing a negative argument to backup_step() is # interpreted as "copy the whole file". -# +# # backup-10.*: Test writing the source database mid backup. # @@ -84,9 +84,9 @@ do_test backup-1.3.3 { info commands B } {} -# Simplest backup operation. Backup test.db to test2.db. test2.db is +# Simplest backup operation. Backup test.db to test2.db. test2.db is # initially empty. test.db uses the default page size. -# +# do_test backup-1.4.1 { sqlite3_backup B db2 main db main } {B} @@ -116,7 +116,7 @@ db2 close # 4) Integrity check the destination db. (backup-2.*.2) # 5) Check that the contents of the destination db is the same as that # of the source db. (backup-2.*.3) -# +# # The test is run with all possible combinations of the following # input parameters, except that if the destination is an in-memory # database, the only page size tested is 1024 bytes (the same as the @@ -172,7 +172,7 @@ foreach nPagePerStep {1 200} { catch { delete_file test2.db } eval $zOpenScript - # Set to true if copying to an in-memory destination. Copying to an + # Set to true if copying to an in-memory destination. Copying to an # in-memory destination is only possible if the initial destination # page size is the same as the source page size (in this case 1024 bytes). # @@ -200,14 +200,14 @@ foreach nPagePerStep {1 200} { INSERT INTO t1 VALUES(5, randstr(1000,1000)); COMMIT; } - - + + # Set up the content of the target database. execsql "PRAGMA ${file_dest}.page_size = ${pgsz_dest}" $db_dest if {$rows_dest != 0} { execsql " - BEGIN; + BEGIN; CREATE TABLE ${file_dest}.t1(a, b); CREATE INDEX ${file_dest}.i1 ON t1(a, b); " $db_dest @@ -218,21 +218,21 @@ foreach nPagePerStep {1 200} { } execsql COMMIT $db_dest } - + # Backup the source database. do_test backup-2.$iTest.1 { sqlite3_backup B $db_dest $file_dest db main while {[B step $nPagePerStep]=="SQLITE_OK"} {} B finish } {SQLITE_OK} - + # Run integrity check on the backup. do_test backup-2.$iTest.2 { execsql "PRAGMA ${file_dest}.integrity_check" $db_dest } {ok} - + test_contents backup-2.$iTest.3 db main $db_dest $file_dest - + } db close @@ -245,14 +245,14 @@ foreach nPagePerStep {1 200} { #--------------------------------------------------------------------- #--------------------------------------------------------------------- -# These tests, backup-3.*, ensure that nothing goes wrong if either +# These tests, backup-3.*, ensure that nothing goes wrong if either # the source or destination database are large enough to include the # the locking-page (the page that contains the range of bytes that # the locks are applied to). These tests assume that the pending -# byte is at offset 0x00010000 (64KB offset), as set by tester.tcl, +# byte is at offset 0x00010000 (64KB offset), as set by tester.tcl, # not at the 1GB offset as it usually is. # -# The test procedure is as follows (same procedure as used for +# The test procedure is as follows (same procedure as used for # the backup-2.* tests): # # 1) Populate the source database. @@ -262,7 +262,7 @@ foreach nPagePerStep {1 200} { # 5) Check that the contents of the destination db is the same as that # of the source db. (backup-3.*.3) # -# The test procedure is run with the following parameters varied: +# The test procedure is run with the following parameters varied: # # * Source database includes pending-byte page. # * Source database does not include pending-byte page. @@ -290,7 +290,7 @@ foreach nDestPgsz {512 1024 2048 4096} { execsql "PRAGMA page_size = $nDestPgsz" db2 foreach db {db db2} { execsql { - BEGIN; + BEGIN; CREATE TABLE t1(a, b); CREATE INDEX i1 ON t1(a, b); COMMIT; @@ -310,12 +310,12 @@ foreach nDestPgsz {512 1024 2048 4096} { while {[B step 10]=="SQLITE_OK"} {} B finish } {SQLITE_OK} - + # Run integrity check on the backup. do_test backup-3.$iTest.2 { execsql "PRAGMA integrity_check" db2 } {ok} - + test_contents backup-3.$iTest.3 db main db2 main db close @@ -360,10 +360,10 @@ do_test backup-3.$iTest.2 { #--------------------------------------------------------------------- # The following tests, backup-4.*, test various error conditions: -# +# # backup-4.1.*: Test invalid database names. # -# backup-4.2.*: Test that the source database cannot be detached while +# backup-4.2.*: Test that the source database cannot be detached while # a backup is in progress. # # backup-4.3.*: Test that the source database handle cannot be closed @@ -394,11 +394,11 @@ do_test backup-4.1.4 { do_test backup-4.2.1 { catch { forcedelete test3.db } catch { forcedelete test4.db } - execsql { + execsql { ATTACH 'test3.db' AS aux1; CREATE TABLE aux1.t1(a, b); } - execsql { + execsql { ATTACH 'test4.db' AS aux2; CREATE TABLE aux2.t2(a, b); } db2 @@ -474,7 +474,7 @@ db2 close # backup-5.x.1.*: Nothing special. Modify the database mid-backup. # # backup-5.x.2.*: Modify the database mid-backup so that one or more -# pages are written out due to cache stress. Then +# pages are written out due to cache stress. Then # rollback the transaction. # # backup-5.x.3.*: Database is vacuumed. @@ -488,7 +488,7 @@ db2 close # 1) Backing up file-to-file. The writer writes via an external pager. # 2) Backing up file-to-file. The writer writes via the same pager as # is used by the backup operation. -# 3) Backing up memory-to-file. +# 3) Backing up memory-to-file. # set iTest 0 forcedelete bak.db-wal @@ -524,7 +524,7 @@ foreach {writer file} {db test.db db3 test.db db :memory:} { } {SQLITE_DONE} do_test backup-5.$iTest.1.4 { B finish - } {SQLITE_OK} + } {SQLITE_OK} integrity_check backup-5.$iTest.1.5 db2 test_contents backup-5.$iTest.1.6 db main db2 main @@ -544,7 +544,7 @@ foreach {writer file} {db test.db db3 test.db db :memory:} { B step 50 } {SQLITE_OK} do_test backup-5.$iTest.2.3 { - execsql { + execsql { BEGIN; UPDATE t1 SET a = a + 1; ROLLBACK; @@ -553,7 +553,7 @@ foreach {writer file} {db test.db db3 test.db db :memory:} { } {SQLITE_DONE} do_test backup-5.$iTest.2.4 { B finish - } {SQLITE_OK} + } {SQLITE_OK} integrity_check backup-5.$iTest.2.5 db2 test_contents backup-5.$iTest.2.6 db main db2 main @@ -570,7 +570,7 @@ foreach {writer file} {db test.db db3 test.db db :memory:} { } {SQLITE_DONE} do_test backup-5.$iTest.3.4 { B finish - } {SQLITE_OK} + } {SQLITE_OK} integrity_check backup-5.$iTest.3.5 db2 test_contents backup-5.$iTest.3.6 db main db2 main @@ -582,7 +582,7 @@ foreach {writer file} {db test.db db3 test.db db :memory:} { B step 50 } {SQLITE_OK} do_test backup-5.$iTest.4.3 { - execsql { + execsql { PRAGMA page_size = 2048; VACUUM; } $writer @@ -590,7 +590,7 @@ foreach {writer file} {db test.db db3 test.db db :memory:} { } {SQLITE_DONE} do_test backup-5.$iTest.4.4 { B finish - } {SQLITE_OK} + } {SQLITE_OK} integrity_check backup-5.$iTest.4.5 db2 test_contents backup-5.$iTest.4.6 db main db2 main @@ -621,7 +621,7 @@ foreach {writer file} {db test.db db3 test.db db :memory:} { B step 8 } {SQLITE_OK} do_test backup-5.$iTest.5.3 { - execsql { + execsql { DELETE FROM t1; PRAGMA incremental_vacuum; } $writer @@ -629,7 +629,7 @@ foreach {writer file} {db test.db db3 test.db db :memory:} { } {SQLITE_DONE} do_test backup-5.$iTest.5.4 { B finish - } {SQLITE_OK} + } {SQLITE_OK} integrity_check backup-5.$iTest.5.5 db2 test_contents backup-5.$iTest.5.6 db main db2 main catch {db close} @@ -694,7 +694,7 @@ catch {db2 close} # # backup-7.1.*: Source database is externally locked (return SQLITE_BUSY). # -# backup-7.2.*: Attempt to step the backup process while a +# backup-7.2.*: Attempt to step the backup process while a # write-transaction is underway on the source pager (return # SQLITE_LOCKED). # @@ -733,7 +733,7 @@ do_test backup-7.1.3 { B step 5 } {SQLITE_OK} do_test backup-7.2.1 { - execsql { + execsql { BEGIN; INSERT INTO t1 VALUES(1, 4); } @@ -828,14 +828,14 @@ catch { db3 close } #----------------------------------------------------------------------- # The following tests, backup-9.*, test that: -# +# # * Passing 0 as an argument to sqlite3_backup_step() means no pages -# are backed up (backup-9.1.*), and -# * Passing a negative value as an argument to sqlite3_backup_step() means +# are backed up (backup-9.1.*), and +# * Passing a negative value as an argument to sqlite3_backup_step() means # all pages are backed up (backup-9.2.*). # # These tests reuse the database "test.db" left over from backup-7.*. -# +# do_test backup-9.1.1 { sqlite3 db2 test2.db sqlite3_backup B db2 main db main @@ -925,7 +925,7 @@ foreach {tn file rc} { } { do_test backup-10.$tn.1 { sqlite3 db $file - execsql { + execsql { CREATE TABLE t1(a INTEGER PRIMARY KEY, b BLOB); BEGIN; INSERT INTO t1 VALUES(NULL, randomblob(200)); diff --git a/third_party/sqlite/src/test/backup2.test b/third_party/sqlite/src/test/backup2.test index 989319923a9a5..3cd3d6f21ac92 100644 --- a/third_party/sqlite/src/test/backup2.test +++ b/third_party/sqlite/src/test/backup2.test @@ -180,7 +180,7 @@ do_test backup2-14 { set rc [catch {db restore} res] lappend rc $res } {1 {wrong # args: should be "db restore ?DATABASE? FILENAME"}} - + forcedelete bu1.db bu2.db bu3.db bu4.db finish_test diff --git a/third_party/sqlite/src/test/backup4.test b/third_party/sqlite/src/test/backup4.test index 2756995c3adb8..9bd7920b3bb6b 100644 --- a/third_party/sqlite/src/test/backup4.test +++ b/third_party/sqlite/src/test/backup4.test @@ -9,11 +9,11 @@ # #*********************************************************************** # -# The tests in this file verify that if an empty database (zero bytes in +# The tests in this file verify that if an empty database (zero bytes in # size) is used as the source of a backup operation, the final destination # database is one page in size. # -# The destination must consist of at least one page as truncating a +# The destination must consist of at least one page as truncating a # database file to zero bytes is equivalent to resetting the database # schema cookie and change counter. Doing that could cause other clients # to become confused and continue using out-of-date cache data. @@ -61,7 +61,7 @@ forcedelete test.db2 sqlite3 db test.db #------------------------------------------------------------------------- -# Test that if the source is zero bytes, the destination database +# Test that if the source is zero bytes, the destination database # consists of a single page only. # do_execsql_test 2.1 { diff --git a/third_party/sqlite/src/test/backup_ioerr.test b/third_party/sqlite/src/test/backup_ioerr.test index ca3fd3240d778..8faf43f910e86 100644 --- a/third_party/sqlite/src/test/backup_ioerr.test +++ b/third_party/sqlite/src/test/backup_ioerr.test @@ -17,8 +17,8 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl -proc data_checksum {db file} { - $db one "SELECT md5sum(a, b) FROM ${file}.t1" +proc data_checksum {db file} { + $db one "SELECT md5sum(a, b) FROM ${file}.t1" } proc test_contents {name db1 file1 db2 file2} { $db2 eval {select * from sqlite_master} @@ -73,7 +73,7 @@ proc clear_ioerr_simulation {} { } #-------------------------------------------------------------------- -# The following procedure runs with SQLite's IO error simulation +# The following procedure runs with SQLite's IO error simulation # enabled. # # 1) Start with a reasonably sized database. One that includes the @@ -91,7 +91,7 @@ proc clear_ioerr_simulation {} { # * the call to backup_step() returns an SQLITE_IOERR_XXX error code. # # * after the failed call to backup_step() but before the call to -# backup_finish() the destination database handle error code and +# backup_finish() the destination database handle error code and # error message remain unchanged. # # * the call to backup_finish() returns an SQLITE_IOERR_XXX error code. @@ -99,20 +99,20 @@ proc clear_ioerr_simulation {} { # * following the call to backup_finish(), the destination database # handle has been populated with an error code and error message. # -# 4) Write to the database via the source database connection. Check +# 4) Write to the database via the source database connection. Check # that: # # * If an IO error occurs while writing the source database, the -# write operation should report an IO error. The backup should +# write operation should report an IO error. The backup should # proceed as normal. # -# * If an IO error occurs while updating the backup, the write +# * If an IO error occurs while updating the backup, the write # operation should proceed normally. The error should be reported # from the next call to backup_step() (in step 5 of this test # procedure). # -# 5) Step the backup process to finish the backup. If an IO error is -# reported, then the backup process is concluded with a call to +# 5) Step the backup process to finish the backup. If an IO error is +# reported, then the backup process is concluded with a call to # backup_finish(). # # Test that if an IO error occurs, or if one occurred while updating @@ -125,8 +125,8 @@ proc clear_ioerr_simulation {} { # the contents of the backup database should match that of the # source database. # -# * If the backup fails (backup_finish() returns other than SQLITE_OK), -# then the contents of the backup database should be as they were +# * If the backup fails (backup_finish() returns other than SQLITE_OK), +# then the contents of the backup database should be as they were # before the operation was started. # # The following factors are varied: diff --git a/third_party/sqlite/src/test/backup_malloc.test b/third_party/sqlite/src/test/backup_malloc.test index 5444a70bdf763..26253a5559cbc 100644 --- a/third_party/sqlite/src/test/backup_malloc.test +++ b/third_party/sqlite/src/test/backup_malloc.test @@ -52,18 +52,18 @@ do_malloc_test backup_malloc-1 -tclprep { if {$rc == "SQLITE_NOMEM" || $rc == "SQLITE_IOERR_NOMEM"} { error "out of memory" } - + # Update the database. # execsql { UPDATE t1 SET a = a + 1 } - + # Finish doing the backup. # set rc [B step 5000] if {$rc == "SQLITE_NOMEM" || $rc == "SQLITE_IOERR_NOMEM"} { error "out of memory" } - + # Finalize the backup. B finish } -cleanup { @@ -109,9 +109,9 @@ do_faultsim_test 3 -faults oom* -prep { } } -test { - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} faultsim_integrity_check - + # Finalize the backup. catch { B finish } } diff --git a/third_party/sqlite/src/test/badutf.test b/third_party/sqlite/src/test/badutf.test index d09c933c1810d..fd93842cf7187 100644 --- a/third_party/sqlite/src/test/badutf.test +++ b/third_party/sqlite/src/test/badutf.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # This file checks to make sure SQLite is able to gracefully # handle malformed UTF-8. diff --git a/third_party/sqlite/src/test/badutf2.test b/third_party/sqlite/src/test/badutf2.test index 36b40fb95c742..06f3e10b2ca43 100644 --- a/third_party/sqlite/src/test/badutf2.test +++ b/third_party/sqlite/src/test/badutf2.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # This file checks to make sure SQLite is able to gracEFully # handle malformed UTF-8. @@ -52,7 +52,7 @@ do_test badutf2-4.0 { set S [sqlite3_prepare_v2 db "SELECT ?" -1 dummy] sqlite3_expired $S } {0} - + foreach { i len uval xstr ustr u2u } { 1 1 00 \x00 {} {} 2 1 01 \x01 "\\u0001" 01 diff --git a/third_party/sqlite/src/test/bestindex1.test b/third_party/sqlite/src/test/bestindex1.test index f90f96bf44339..9f38a8fc40445 100644 --- a/third_party/sqlite/src/test/bestindex1.test +++ b/third_party/sqlite/src/test/bestindex1.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # set testdir [file dirname $argv0] @@ -73,7 +73,7 @@ register_tcl_module db # "use" - Implement filtering. Use the constraint, but do not set omit. # "use2" - Do not implement filtering. Use the constraint anyway. # -# +# proc t1_vtab {mode method args} { switch -- $method { xConnect { @@ -138,11 +138,11 @@ foreach {tn mode} { do_execsql_test 2.2.$mode.2 {SELECT * FROM t1} {one 1 two 2 three 3 four 4} do_execsql_test 2.2.$mode.3 {SELECT rowid FROM t1} {1 2 3 4} - do_execsql_test 2.2.$mode.4 {SELECT rowid FROM t1 WHERE a='two'} {2} + do_execsql_test 2.2.$mode.4 {SELECT rowid FROM t1 WHERE a='two'} {2} do_execsql_test 2.2.$mode.5 { SELECT rowid FROM t1 WHERE a IN ('one', 'four') ORDER BY +rowid - } {1 4} + } {1 4} set plan(use) { 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 0:SELECT * FROM t1x WHERE a='%1%'} @@ -160,7 +160,7 @@ foreach {tn mode} { 0 0 0 {USE TEMP B-TREE FOR ORDER BY} } - do_eqp_test 2.2.$mode.6 { + do_eqp_test 2.2.$mode.6 { SELECT rowid FROM t1 WHERE a IN ('one', 'four') ORDER BY +rowid } $plan($mode) } @@ -211,10 +211,10 @@ proc vtab_command {method args} { set map [list] for {set i 0} {$i < [llength $vals]} {incr i} { - lappend map "%$i%" + lappend map "%$i%" set v [lindex $vals $i] - if {[string is integer $v]} { - lappend map $v + if {[string is integer $v]} { + lappend map $v } else { lappend map "'$v'" } @@ -250,7 +250,7 @@ do_execsql_test 3.2 { do_execsql_test 3.3 { SELECT primarykey FROM VirtualTableA } {1 2 3 4} do_execsql_test 3.4 { - SELECT * FROM + SELECT * FROM VirtualTableA a CROSS JOIN VirtualTableB b ON b.PrimaryKey=a.PrimaryKey WHERE a.ColumnA IN ('ValueA', 'ValueB') AND a.FlagA=0 } { @@ -261,9 +261,9 @@ do_execsql_test 3.4 { } do_execsql_test 3.5 { - SELECT * FROM + SELECT * FROM VirtualTableA a CROSS JOIN VirtualTableB b ON b.PrimaryKey=a.PrimaryKey - WHERE a.FlagA=0 AND a.ColumnA IN ('ValueA', 'ValueB') + WHERE a.FlagA=0 AND a.ColumnA IN ('ValueA', 'ValueB') } { 1 0 ValueA 1 0 ValueA 2 0 ValueA 2 0 ValueA diff --git a/third_party/sqlite/src/test/bestindex2.test b/third_party/sqlite/src/test/bestindex2.test index 8bc3fbc3233eb..31b4553cf2ab0 100644 --- a/third_party/sqlite/src/test/bestindex2.test +++ b/third_party/sqlite/src/test/bestindex2.test @@ -40,7 +40,7 @@ ifcapable !vtab { # # "WHERE a=? AND b=?" -> "cost 900 rows 900" # "WHERE c=? AND b "cost 1000 rows 1000" -# +# proc vtab_cmd {tbl cols method args} { switch -- $method { xConnect { @@ -105,23 +105,23 @@ do_eqp_test 1.3 { do_eqp_test 1.4 { SELECT * FROM t1,t2 WHERE c=a } { - 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 0:} + 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 0:} 0 1 1 {SCAN TABLE t2 VIRTUAL TABLE INDEX 0:indexed(c=?)} } do_eqp_test 1.5 { SELECT * FROM t1, t2 CROSS JOIN t3 WHERE t2.c = +t1.b AND t3.e=t2.d } { - 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 0:} - 0 1 1 {SCAN TABLE t2 VIRTUAL TABLE INDEX 0:indexed(c=?)} + 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 0:} + 0 1 1 {SCAN TABLE t2 VIRTUAL TABLE INDEX 0:indexed(c=?)} 0 2 2 {SCAN TABLE t3 VIRTUAL TABLE INDEX 0:indexed(e=?)} } do_eqp_test 1.6 { SELECT * FROM t1, t2, t3 WHERE t2.c = +t1.b AND t3.e = t2.d } { - 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 0:} - 0 1 1 {SCAN TABLE t2 VIRTUAL TABLE INDEX 0:indexed(c=?)} + 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 0:} + 0 1 1 {SCAN TABLE t2 VIRTUAL TABLE INDEX 0:indexed(c=?)} 0 2 2 {SCAN TABLE t3 VIRTUAL TABLE INDEX 0:indexed(e=?)} } @@ -129,12 +129,12 @@ do_execsql_test 1.7.1 { CREATE TABLE x1(a, b); } do_eqp_test 1.7.2 { - SELECT * FROM x1 CROSS JOIN t1, t2, t3 + SELECT * FROM x1 CROSS JOIN t1, t2, t3 WHERE t1.a = t2.c AND t1.b = t3.e } { - 0 0 0 {SCAN TABLE x1} + 0 0 0 {SCAN TABLE x1} 0 1 1 {SCAN TABLE t1 VIRTUAL TABLE INDEX 0:} - 0 2 2 {SCAN TABLE t2 VIRTUAL TABLE INDEX 0:indexed(c=?)} + 0 2 2 {SCAN TABLE t2 VIRTUAL TABLE INDEX 0:indexed(c=?)} 0 3 3 {SCAN TABLE t3 VIRTUAL TABLE INDEX 0:indexed(e=?)} } diff --git a/third_party/sqlite/src/test/bestindex3.test b/third_party/sqlite/src/test/bestindex3.test index 70c60d66dd8e2..05841e0c8cc62 100644 --- a/third_party/sqlite/src/test/bestindex3.test +++ b/third_party/sqlite/src/test/bestindex3.test @@ -26,7 +26,7 @@ ifcapable !vtab { # "CREATE TABLE t1 (a, b, c)" # # This virtual table supports both LIKE and = operators on all columns. -# +# proc vtab_cmd {bOmit method args} { switch -- $method { xConnect { @@ -45,7 +45,7 @@ proc vtab_cmd {bOmit method args} { array set C [lindex $clist $i] if {$C(usable) && ($C(op)=="like" || $C(op)=="eq")} { lappend ret $use $i - lappend ret idxstr + lappend ret idxstr lappend ret "[lindex {a b c} $C(column)] [string toupper $C(op)] ?" break } @@ -119,15 +119,15 @@ foreach omit {0 1} { DROP TABLE t1; CREATE VIRTUAL TABLE t1 USING tcl('vtab_cmd $omit'); " - do_execsql_test 1.6.$omit.1 { + do_execsql_test 1.6.$omit.1 { SELECT rowid FROM t1 WHERE c LIKE 'o%' } {3 4} - do_execsql_test 1.6.$omit.2 { + do_execsql_test 1.6.$omit.2 { SELECT rowid FROM t1 WHERE c LIKE 'o%' OR b='y' } {3 4 6} - do_execsql_test 1.6.$omit.3 { + do_execsql_test 1.6.$omit.3 { SELECT rowid FROM t1 WHERE c = 'three' OR c LIKE 'o%' } {1 6 3 4} } @@ -154,7 +154,7 @@ ifcapable !icu { } #------------------------------------------------------------------------- -# Test that any PRIMARY KEY within a sqlite3_decl_vtab() CREATE TABLE +# Test that any PRIMARY KEY within a sqlite3_decl_vtab() CREATE TABLE # statement is currently ignored. # proc vvv_command {method args} { diff --git a/third_party/sqlite/src/test/bestindex4.test b/third_party/sqlite/src/test/bestindex4.test index 64727bd0d77c3..482714aab1a7d 100644 --- a/third_party/sqlite/src/test/bestindex4.test +++ b/third_party/sqlite/src/test/bestindex4.test @@ -40,7 +40,7 @@ ifcapable !vtab { # 0x08 - ignore the "usable" flag (malfunction) # # -# +# proc vtab_cmd {param method args} { switch -- $method { xConnect { @@ -58,7 +58,7 @@ proc vtab_cmd {param method args} { for {set i 0} {$i < [llength $clist]} {incr i} { array unset C array set C [lindex $clist $i] - if { ($C(usable) || ($param & 0x08)) + if { ($C(usable) || ($param & 0x08)) && $C(op)=="eq" && ($param & 1<<$C(column)) } { lappend ret $use $i diff --git a/third_party/sqlite/src/test/between.test b/third_party/sqlite/src/test/between.test index df4c67995c46d..8e2d1c30e31cf 100644 --- a/third_party/sqlite/src/test/between.test +++ b/third_party/sqlite/src/test/between.test @@ -65,7 +65,7 @@ proc queryplan {sql} { lappend data $tab * } } - return $data + return $data } do_test between-1.1.1 { diff --git a/third_party/sqlite/src/test/bigfile2.test b/third_party/sqlite/src/test/bigfile2.test index de3b14b558ede..1324e54af0097 100644 --- a/third_party/sqlite/src/test/bigfile2.test +++ b/third_party/sqlite/src/test/bigfile2.test @@ -45,8 +45,8 @@ do_test 1.2 { # Now insert a large row. The overflow pages will be located past the 4GB # boundary. Then, after opening and closing the database, test that the row -# can be read back in. -# +# can be read back in. +# set str [string repeat k 30000] do_test 1.3 { sqlite3 db test.db diff --git a/third_party/sqlite/src/test/bigsort.test b/third_party/sqlite/src/test/bigsort.test index c711515973f4d..fc2c6c4afa45f 100644 --- a/third_party/sqlite/src/test/bigsort.test +++ b/third_party/sqlite/src/test/bigsort.test @@ -15,9 +15,9 @@ source $testdir/tester.tcl set testprefix bigsort #-------------------------------------------------------------------- -# At one point there was an overflow problem if the product of the -# cache-size and page-size was larger than 2^31. Causing an infinite -# loop if the product was also an integer multiple of 2^32, or +# At one point there was an overflow problem if the product of the +# cache-size and page-size was larger than 2^31. Causing an infinite +# loop if the product was also an integer multiple of 2^32, or # inefficiency otherwise. # # This test causes thrashing on machines with smaller amounts of diff --git a/third_party/sqlite/src/test/bind.test b/third_party/sqlite/src/test/bind.test index 34f3155b95253..c44668a055079 100644 --- a/third_party/sqlite/src/test/bind.test +++ b/third_party/sqlite/src/test/bind.test @@ -247,7 +247,7 @@ do_test bind-4.6 { do_test bind-5.1 { sqlite3_bind_null $VM 1 sqlite3_bind_null $VM 2 - sqlite3_bind_null $VM 3 + sqlite3_bind_null $VM 3 sqlite_step $VM N VALUES COLNAMES sqlite3_reset $VM execsql {SELECT rowid, * FROM t1} @@ -373,7 +373,7 @@ ifcapable {utf16} { } {bind or column index out of range} } do_test bind-8.4 { - sqlite3_bind_null $VM 1 + sqlite3_bind_null $VM 1 sqlite3_errmsg $DB } {not an error} do_test bind-8.5 { diff --git a/third_party/sqlite/src/test/bitvec.test b/third_party/sqlite/src/test/bitvec.test index d27f9274563ef..cdf250aca102a 100644 --- a/third_party/sqlite/src/test/bitvec.test +++ b/third_party/sqlite/src/test/bitvec.test @@ -101,7 +101,7 @@ do_test bitvec-1.18 { sqlite3BitvecBuiltinTest 400000 {1 5000 100000 1 2 400000 1 37 0} } 0 -# Attempt to induce hash collisions. +# Attempt to induce hash collisions. # unset -nocomplain start unset -nocomplain incr diff --git a/third_party/sqlite/src/test/boundary1.tcl b/third_party/sqlite/src/test/boundary1.tcl index 3896b50463844..dd3325af0e472 100644 --- a/third_party/sqlite/src/test/boundary1.tcl +++ b/third_party/sqlite/src/test/boundary1.tcl @@ -178,14 +178,14 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE rowid $op $r ORDER BY a" puts " \175" puts "\175 {[sort $aset]}" - + ################################################################ 2.x.y.2 puts "do_test $tname-2.$i.$subno.2 \173" puts " db eval \173" puts " SELECT a FROM t1 WHERE rowid $op $r ORDER BY a DESC" puts " \175" puts "\175 {[reverse [sort $aset]]}" - + ################################################################ 2.x.y.3 set aset {} foreach rx [sort $rset] { @@ -196,7 +196,7 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE rowid $op $r ORDER BY rowid" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.4 set aset {} foreach rx [reverse [sort $rset]] { @@ -207,7 +207,7 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE rowid $op $r ORDER BY rowid DESC" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.5 set aset {} set xset {} @@ -223,7 +223,7 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE rowid $op $r ORDER BY x" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.10 if {abs($r)>9223372036854775808 || [string length $r5]>15} continue set rset {} @@ -241,7 +241,7 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE rowid $op $r0 ORDER BY rowid" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.11 set aset {} foreach rx [reverse [sort $rset]] { @@ -270,7 +270,7 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE rowid $op $r5 ORDER BY rowid" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.13 set aset {} foreach rx [reverse [sort $rset]] { @@ -282,7 +282,7 @@ foreach r $nums3 { puts " \175" puts "\175 {$aset}" } - + } diff --git a/third_party/sqlite/src/test/boundary2.tcl b/third_party/sqlite/src/test/boundary2.tcl index b141166072d91..2f1dcadbc10f0 100644 --- a/third_party/sqlite/src/test/boundary2.tcl +++ b/third_party/sqlite/src/test/boundary2.tcl @@ -179,14 +179,14 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE r $op $r ORDER BY a" puts " \175" puts "\175 {[sort $aset]}" - + ################################################################ 2.x.y.2 puts "do_test $tname-2.$i.$subno.2 \173" puts " db eval \173" puts " SELECT a FROM t1 WHERE r $op $r ORDER BY a DESC" puts " \175" puts "\175 {[reverse [sort $aset]]}" - + ################################################################ 2.x.y.3 set aset {} foreach rx [sort $rset] { @@ -197,7 +197,7 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE r $op $r ORDER BY r" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.4 set aset {} foreach rx [reverse [sort $rset]] { @@ -208,7 +208,7 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE r $op $r ORDER BY r DESC" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.5 set aset {} set xset {} @@ -224,7 +224,7 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE r $op $r ORDER BY x" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.10 if {abs($r)>9223372036854775808 || [string length $r5]>15} continue set rset {} @@ -242,7 +242,7 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE r $op $r0 ORDER BY r" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.11 set aset {} foreach rx [reverse [sort $rset]] { @@ -271,7 +271,7 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE r $op $r5 ORDER BY r" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.13 set aset {} foreach rx [reverse [sort $rset]] { @@ -335,14 +335,14 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE r $op $r ORDER BY a" puts " \175" puts "\175 {[sort $aset]}" - + ################################################################ 2.x.y.2 puts "do_test $tname-4.$i.$subno.2 \173" puts " db eval \173" puts " SELECT a FROM t1 WHERE r $op $r ORDER BY a DESC" puts " \175" puts "\175 {[reverse [sort $aset]]}" - + ################################################################ 2.x.y.3 set aset {} foreach rx [sort $rset] { @@ -353,7 +353,7 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE r $op $r ORDER BY r" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.4 set aset {} foreach rx [reverse [sort $rset]] { @@ -364,7 +364,7 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE r $op $r ORDER BY r DESC" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.5 set aset {} set xset {} @@ -380,7 +380,7 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE r $op $r ORDER BY x" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.10 if {abs($r)>9223372036854775808 || [string length $r5]>15} continue set rset {} @@ -398,7 +398,7 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE r $op $r0 ORDER BY r" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.11 set aset {} foreach rx [reverse [sort $rset]] { @@ -427,7 +427,7 @@ foreach r $nums3 { puts " SELECT a FROM t1 WHERE r $op $r5 ORDER BY r" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.13 set aset {} foreach rx [reverse [sort $rset]] { diff --git a/third_party/sqlite/src/test/boundary3.tcl b/third_party/sqlite/src/test/boundary3.tcl index 5fc26d6113f08..5a47e5f005926 100644 --- a/third_party/sqlite/src/test/boundary3.tcl +++ b/third_party/sqlite/src/test/boundary3.tcl @@ -194,7 +194,7 @@ foreach r $nums3 { puts " WHERE t1.rowid $op $r ORDER BY t2.a" puts " \175" puts "\175 {[sort $aset]}" - + ################################################################ 2.x.y.2 puts "do_test $tname-2.$i.$subno.2 \173" puts " db eval \173" @@ -217,7 +217,7 @@ foreach r $nums3 { puts " ORDER BY t1.rowid" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.4 set aset {} foreach rx [reverse [sort $rset]] { @@ -230,7 +230,7 @@ foreach r $nums3 { puts " ORDER BY t1.rowid DESC" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.5 set aset {} set xset {} @@ -248,7 +248,7 @@ foreach r $nums3 { puts " ORDER BY x" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.10 if {[string length $r5]>15} continue set rset {} @@ -268,7 +268,7 @@ foreach r $nums3 { puts " ORDER BY t1.rowid" puts " \175" puts "\175 {$aset}" - + ################################################################ 2.x.y.11 set aset {} foreach rx [reverse [sort $rset]] { @@ -282,7 +282,7 @@ foreach r $nums3 { puts " \175" puts "\175 {$aset}" } - + } diff --git a/third_party/sqlite/src/test/btree02.test b/third_party/sqlite/src/test/btree02.test index de7c06d442a86..587bc242a58d3 100644 --- a/third_party/sqlite/src/test/btree02.test +++ b/third_party/sqlite/src/test/btree02.test @@ -12,7 +12,7 @@ # # The focus of this script is making multiple calls to saveCursorPosition() # and restoreCursorPosition() when cursors have eState==CURSOR_SKIPNEXT -# +# set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -45,7 +45,7 @@ do_test btree02-110 { db eval {DELETE FROM t1 WHERE a=$a} } db eval {COMMIT; BEGIN} - } + } db one {COMMIT; SELECT count(*) FROM t1;} } {20} diff --git a/third_party/sqlite/src/test/btreefault.test b/third_party/sqlite/src/test/btreefault.test index 61104c5a79ada..a7eb120f932be 100644 --- a/third_party/sqlite/src/test/btreefault.test +++ b/third_party/sqlite/src/test/btreefault.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file contains fault injection tests designed to test the btree.c +# This file contains fault injection tests designed to test the btree.c # module. # @@ -50,7 +50,7 @@ do_faultsim_test 1 -prep { execsql { PRAGMA incremental_vacuum = 10 } } -test { sqlite3_finalize $::STMT - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} faultsim_integrity_check } diff --git a/third_party/sqlite/src/test/cache.test b/third_party/sqlite/src/test/cache.test index ffc25c460e73b..ee1d7d4ce2b10 100644 --- a/third_party/sqlite/src/test/cache.test +++ b/third_party/sqlite/src/test/cache.test @@ -28,7 +28,7 @@ proc pager_cache_size {db} { return $stats(page) } -if {[permutation] == ""} { +if {[permutation] == ""} { do_test cache-1.1 { pager_cache_size db } {0} } @@ -43,7 +43,7 @@ do_test cache-1.2 { # At one point, repeatedly locking and unlocking the cache was causing # a resource leak of one page per repetition. The page wasn't actually -# leaked, but would not be reused until the pager-cache was full (i.e. +# leaked, but would not be reused until the pager-cache was full (i.e. # 2000 pages by default). # # This tests that once the pager-cache is initialized, it can be locked @@ -61,12 +61,12 @@ for {set ii 0} {$ii < 10} {incr ii} { # This block of tests checks that it is possible to set the cache_size of a # database to a small (< 10) value. More specifically: # -# cache-2.1.*: Test that "PRAGMA cache_size" appears to work with small +# cache-2.1.*: Test that "PRAGMA cache_size" appears to work with small # values. -# cache-2.2.*: Test that "PRAGMA main.cache_size" appears to work with +# cache-2.2.*: Test that "PRAGMA main.cache_size" appears to work with # small values. -# cache-2.3.*: Test cache_size=1 correctly spills/flushes the cache. -# cache-2.4.*: Test cache_size=0 correctly spills/flushes the cache. +# cache-2.3.*: Test cache_size=1 correctly spills/flushes the cache. +# cache-2.4.*: Test cache_size=0 correctly spills/flushes the cache. # # db_delete_and_reopen diff --git a/third_party/sqlite/src/test/cacheflush.test b/third_party/sqlite/src/test/cacheflush.test index 50461893ef1ce..069804a5d014d 100644 --- a/third_party/sqlite/src/test/cacheflush.test +++ b/third_party/sqlite/src/test/cacheflush.test @@ -17,7 +17,7 @@ source $testdir/tester.tcl set testprefix cacheflush test_set_config_pagecache 0 0 -# Run the supplied SQL on a copy of the database currently stored on +# Run the supplied SQL on a copy of the database currently stored on # disk in file $dbfile. proc diskquery {dbfile sql} { forcecopy $dbfile dq.db @@ -36,11 +36,11 @@ do_execsql_test 1.1.0 { INSERT INTO t1 VALUES(3, 4); } do_test 1.1.1 { - diskquery test.db { SELECT * FROM t1 } + diskquery test.db { SELECT * FROM t1 } } {1 2} do_test 1.1.2 { sqlite3_db_cacheflush db - diskquery test.db { SELECT * FROM t1 } + diskquery test.db { SELECT * FROM t1 } } {1 2 3 4} # Test that multiple pages may be flushed to disk. @@ -53,14 +53,14 @@ do_execsql_test 1.2.0 { INSERT INTO t2 VALUES('a', 'b'); } do_test 1.2.1 { - diskquery test.db { + diskquery test.db { SELECT * FROM t1; SELECT * FROM t2; } } {1 2 3 4} do_test 1.2.2 { sqlite3_db_cacheflush db - diskquery test.db { + diskquery test.db { SELECT * FROM t1; SELECT * FROM t2; } @@ -77,7 +77,7 @@ do_execsql_test 1.3.0 { INSERT INTO t3 VALUES('i', 'ii'); } do_test 1.3.1 { - diskquery test.db { + diskquery test.db { SELECT * FROM t1; SELECT * FROM t2; SELECT * FROM t3; @@ -89,7 +89,7 @@ do_test 1.3.2 { sqlite3_db_cacheflush db } } - diskquery test.db { + diskquery test.db { SELECT * FROM t1; SELECT * FROM t2; SELECT * FROM t3; @@ -97,7 +97,7 @@ do_test 1.3.2 { } {1 2 3 4 5 6 a b c d i ii} do_test 1.3.2 { sqlite3_db_cacheflush db - diskquery test.db { + diskquery test.db { SELECT * FROM t1; SELECT * FROM t2; SELECT * FROM t3; @@ -118,7 +118,7 @@ do_test 1.4.1 { BEGIN; SELECT * FROM t1; } - diskquery test.db { + diskquery test.db { SELECT * FROM t1; } } {1 2 3 4 5 6 7 8} @@ -126,14 +126,14 @@ do_test 1.4.2 { list [catch { sqlite3_db_cacheflush db } msg] $msg } {1 {database is locked}} do_test 1.4.3 { - diskquery test.db { + diskquery test.db { SELECT * FROM t1; } } {1 2 3 4 5 6 7 8} do_test 1.4.4 { db2 close sqlite3_db_cacheflush db - diskquery test.db { + diskquery test.db { SELECT * FROM t1; } } {1 2 3 4 5 6 7 8 9 10} @@ -224,7 +224,7 @@ do_test 3.0 { do_execsql_test 3.1 { PRAGMA integrity_check } ok do_execsql_test 3.2 { COMMIT } do_execsql_test 3.3 { PRAGMA integrity_check } ok -do_execsql_test 3.4 { +do_execsql_test 3.4 { SELECT count(*) FROM t1; SELECT count(*) FROM t2; } {2 2} @@ -254,7 +254,7 @@ do_test 4.0 { } {A B} do_test 4.1 { - execsql { + execsql { ROLLBACK TO one; } sqlite3_db_cacheflush db @@ -265,7 +265,7 @@ do_test 4.1 { } {A b} do_test 4.2 { - execsql { + execsql { INSERT INTO tb VALUES('c', randomblob(10)); INSERT INTO tb VALUES('d', randomblob(10)); INSERT INTO tb VALUES('e', randomblob(10)); @@ -278,7 +278,7 @@ do_test 4.2 { } {A b c d e} do_test 4.3 { - execsql { + execsql { SAVEPOINT two; UPDATE tb SET b = upper(b); } @@ -290,7 +290,7 @@ do_test 4.3 { } {A B C D E} do_test 4.4 { - execsql { + execsql { ROLLBACK TO two; } sqlite3_db_cacheflush db @@ -301,7 +301,7 @@ do_test 4.4 { } {A b c d e} do_test 4.4 { - execsql { + execsql { ROLLBACK TO one; } sqlite3_db_cacheflush db @@ -312,7 +312,7 @@ do_test 4.4 { } {A b} do_test 4.5 { - execsql { + execsql { ROLLBACK; SELECT a FROM ta; SELECT b FROM tb; diff --git a/third_party/sqlite/src/test/capi2.test b/third_party/sqlite/src/test/capi2.test index 39f50dd0795be..d8119176f3afe 100644 --- a/third_party/sqlite/src/test/capi2.test +++ b/third_party/sqlite/src/test/capi2.test @@ -30,7 +30,7 @@ proc get_row_values {STMT} { # of the SQL statement STMT. # # i.e. for: -# CREATE TABLE abc(a text, b integer); +# CREATE TABLE abc(a text, b integer); # SELECT * FROM abc; # # The result is {a b text integer} @@ -66,7 +66,7 @@ do_test capi2-1.5 { get_column_names $VM } {name rowid text INTEGER} do_test capi2-1.6 { - sqlite3_step $VM + sqlite3_step $VM } {SQLITE_DONE} do_test capi2-1.7 { list [sqlite3_column_count $VM] [get_row_values $VM] [get_column_names $VM] @@ -464,7 +464,7 @@ do_test capi2-6.8 { [get_column_names $VM1] } {SQLITE_ROW 1 3 {x counter}} do_test capi2-6.9 { - execsql {SELECT * FROM t2} + execsql {SELECT * FROM t2} } {2 3 3 4 1 2} do_test capi2-6.10 { list [sqlite3_step $VM1] \ @@ -641,7 +641,7 @@ do_test capi2-8.1 { set VM1 [sqlite3_prepare $DB {SELECT * FROM t2} -1 TAIL] sqlite3_finalize $VM1 } {SQLITE_OK} - + # Tickets #384 and #385 - make sure the TAIL argument to sqlite3_prepare # and all of the return pointers in sqlite_step can be null. # @@ -754,7 +754,7 @@ ifcapable view&&subquery { set ::DB [sqlite3_connection_pointer db] check_origins {select * from (select * from (select * from view1))} } [list {main tab1 col1} {main tab1 col2}] - + # This view will thwart the flattening optimization. do_test capi2-13.1 { execsql { diff --git a/third_party/sqlite/src/test/capi3.test b/third_party/sqlite/src/test/capi3.test index 84889f5fafaa6..b7d7481e5f5a0 100644 --- a/third_party/sqlite/src/test/capi3.test +++ b/third_party/sqlite/src/test/capi3.test @@ -33,7 +33,7 @@ proc utf16 {str {nt 1}} { return $r } -# Return the UTF-8 representation of the supplied UTF-16 string $str. +# Return the UTF-8 representation of the supplied UTF-16 string $str. proc utf8 {str} { # If $str ends in two 0x00 0x00 bytes, knock these off before # converting to UTF-8 using TCL. @@ -49,7 +49,7 @@ proc utf8 {str} { # These tests complement those in capi2.test. They are organized # as follows: # -# capi3-1.*: Test sqlite3_prepare +# capi3-1.*: Test sqlite3_prepare # capi3-2.*: Test sqlite3_prepare16 # capi3-3.*: Test sqlite3_open # capi3-4.*: Test sqlite3_open16 @@ -259,7 +259,7 @@ proc check_header {STMT test names decltypes} { # Column names in UTF-8 do_test $test.1 { set cnamelist [list] - foreach i $idxlist {lappend cnamelist [sqlite3_column_name $STMT $i]} + foreach i $idxlist {lappend cnamelist [sqlite3_column_name $STMT $i]} set cnamelist } $names @@ -277,7 +277,7 @@ proc check_header {STMT test names decltypes} { # Column names in UTF-8 do_test $test.3 { set cnamelist [list] - foreach i $idxlist {lappend cnamelist [sqlite3_column_name $STMT $i]} + foreach i $idxlist {lappend cnamelist [sqlite3_column_name $STMT $i]} set cnamelist } $names @@ -295,7 +295,7 @@ proc check_header {STMT test names decltypes} { # Column names in UTF-8 do_test $test.5 { set cnamelist [list] - foreach i $idxlist {lappend cnamelist [sqlite3_column_decltype $STMT $i]} + foreach i $idxlist {lappend cnamelist [sqlite3_column_decltype $STMT $i]} set cnamelist } $decltypes @@ -325,7 +325,7 @@ proc check_header {STMT test names decltypes} { [sqlite3_column_decltype16 $STMT $numcols] } {{} {} {} {} {} {} {} {}} } -} +} # This proc is used to test the following API calls: # @@ -356,16 +356,16 @@ proc check_origin_header {STMT test dbs tables cols} { set ::idxlist [list] set ::numcols [sqlite3_column_count $STMT] for {set i 0} {$i < $::numcols} {incr i} {lappend ::idxlist $i} - + # Database names in UTF-8 do_test $test.8 { set cnamelist [list] foreach i $idxlist { lappend cnamelist [sqlite3_column_database_name $STMT $i] - } + } set cnamelist } $dbs - + # Database names in UTF-16 ifcapable {utf16} { do_test $test.9 { @@ -376,16 +376,16 @@ proc check_origin_header {STMT test dbs tables cols} { set cnamelist } $dbs } - + # Table names in UTF-8 do_test $test.10 { set cnamelist [list] foreach i $idxlist { lappend cnamelist [sqlite3_column_table_name $STMT $i] - } + } set cnamelist } $tables - + # Table names in UTF-16 ifcapable {utf16} { do_test $test.11 { @@ -396,16 +396,16 @@ proc check_origin_header {STMT test dbs tables cols} { set cnamelist } $tables } - + # Origin names in UTF-8 do_test $test.12 { set cnamelist [list] foreach i $idxlist { lappend cnamelist [sqlite3_column_origin_name $STMT $i] - } + } set cnamelist } $cols - + # Origin declaration types in UTF-16 ifcapable {utf16} { do_test $test.13 { @@ -428,9 +428,9 @@ proc check_origin_header {STMT test dbs tables cols} { # sqlite3_column_text16 # sqlite3_column_double # -# $STMT is a compiled SQL statement for which the previous call -# to sqlite3_step returned SQLITE_ROW. $test is a prefix to use -# for test names within this proc. $types is a list of the +# $STMT is a compiled SQL statement for which the previous call +# to sqlite3_step returned SQLITE_ROW. $test is a prefix to use +# for test names within this proc. $types is a list of the # manifest types for the current row. $ints, $doubles and $strings # are lists of the integer, real and string representations of # the values in the current row. @@ -467,7 +467,7 @@ do_test $test.1 { } set types } $types - + # Integers do_test $test.2 { @@ -687,7 +687,7 @@ db close # This procedure sets the value of the file-format in file 'test.db' # to $newval. Also, the schema cookie is incremented. -# +# proc set_file_format {newval} { hexio_write test.db 44 [hexio_render_int32 $newval] set schemacookie [hexio_get_int [hexio_read test.db 40 4]] @@ -697,7 +697,7 @@ proc set_file_format {newval} { } # This procedure returns the value of the file-format in file 'test.db'. -# +# proc get_file_format {{fname test.db}} { return [hexio_get_int [hexio_read $fname 44 4]] } @@ -1001,7 +1001,7 @@ do_test capi3-11.21 { # The following tests - capi3-12.* - check that its Ok to start a # transaction while other VMs are active, and that its Ok to execute -# atomic updates in the same situation +# atomic updates in the same situation # do_test capi3-12.1 { set STMT [sqlite3_prepare $DB "SELECT a FROM t2" -1 TAIL] @@ -1042,7 +1042,7 @@ do_test capi3-12.8 { } } {1 2 3 4} -# Test cases capi3-13.* test the sqlite3_clear_bindings() and +# Test cases capi3-13.* test the sqlite3_clear_bindings() and # sqlite3_sleep APIs. # if {[llength [info commands sqlite3_clear_bindings]]>0} { @@ -1079,7 +1079,7 @@ if {[llength [info commands sqlite3_sleep]]>0} { } # Ticket #1219: Make sure binding APIs can handle a NULL pointer. -# +# if {[clang_sanitize_address]==0} { do_test capi3-14.1-misuse { set rc [catch {sqlite3_bind_text 0 1 hello 5} msg] @@ -1150,7 +1150,7 @@ do_test capi3-15.8 { set v1 } {12.3456} -# Make sure code is always generated even if an IF EXISTS or +# Make sure code is always generated even if an IF EXISTS or # IF NOT EXISTS clause is present that the table does not or # does exists. That way we will always have a prepared statement # to expire when the schema changes. diff --git a/third_party/sqlite/src/test/capi3c.test b/third_party/sqlite/src/test/capi3c.test index 57cf146c73dd1..1375481f80231 100644 --- a/third_party/sqlite/src/test/capi3c.test +++ b/third_party/sqlite/src/test/capi3c.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # This is a copy of the capi3.test file that has been adapted to # test the new sqlite3_prepare_v2 interface. @@ -35,7 +35,7 @@ proc utf16 {str {nt 1}} { return $r } -# Return the UTF-8 representation of the supplied UTF-16 string $str. +# Return the UTF-8 representation of the supplied UTF-16 string $str. proc utf8 {str} { # If $str ends in two 0x00 0x00 bytes, knock these off before # converting to UTF-8 using TCL. @@ -51,8 +51,8 @@ proc utf8 {str} { # These tests complement those in capi2.test. They are organized # as follows: # -# capi3c-1.*: Test sqlite3_prepare_v2 -# capi3c-2.*: Test sqlite3_prepare16_v2 +# capi3c-1.*: Test sqlite3_prepare_v2 +# capi3c-2.*: Test sqlite3_prepare16_v2 # capi3c-3.*: Test sqlite3_open # capi3c-4.*: Test sqlite3_open16 # capi3c-5.*: Test the various sqlite3_result_* APIs @@ -240,7 +240,7 @@ proc check_header {STMT test names decltypes} { # Column names in UTF-8 do_test $test.1 { set cnamelist [list] - foreach i $idxlist {lappend cnamelist [sqlite3_column_name $STMT $i]} + foreach i $idxlist {lappend cnamelist [sqlite3_column_name $STMT $i]} set cnamelist } $names @@ -258,7 +258,7 @@ proc check_header {STMT test names decltypes} { # Column names in UTF-8 do_test $test.3 { set cnamelist [list] - foreach i $idxlist {lappend cnamelist [sqlite3_column_name $STMT $i]} + foreach i $idxlist {lappend cnamelist [sqlite3_column_name $STMT $i]} set cnamelist } $names @@ -276,7 +276,7 @@ proc check_header {STMT test names decltypes} { # Column names in UTF-8 do_test $test.5 { set cnamelist [list] - foreach i $idxlist {lappend cnamelist [sqlite3_column_decltype $STMT $i]} + foreach i $idxlist {lappend cnamelist [sqlite3_column_decltype $STMT $i]} set cnamelist } $decltypes @@ -306,7 +306,7 @@ proc check_header {STMT test names decltypes} { [sqlite3_column_decltype16 $STMT $numcols] } {{} {} {} {} {} {} {} {}} } -} +} # This proc is used to test the following API calls: # @@ -338,16 +338,16 @@ ifcapable columnmetadata { set ::idxlist [list] set ::numcols [sqlite3_column_count $STMT] for {set i 0} {$i < $::numcols} {incr i} {lappend ::idxlist $i} - + # Database names in UTF-8 do_test $test.8 { set cnamelist [list] foreach i $idxlist { lappend cnamelist [sqlite3_column_database_name $STMT $i] - } + } set cnamelist } $dbs - + # Database names in UTF-16 ifcapable {utf16} { do_test $test.9 { @@ -358,16 +358,16 @@ ifcapable columnmetadata { set cnamelist } $dbs } - + # Table names in UTF-8 do_test $test.10 { set cnamelist [list] foreach i $idxlist { lappend cnamelist [sqlite3_column_table_name $STMT $i] - } + } set cnamelist } $tables - + # Table names in UTF-16 ifcapable {utf16} { do_test $test.11 { @@ -378,16 +378,16 @@ ifcapable columnmetadata { set cnamelist } $tables } - + # Origin names in UTF-8 do_test $test.12 { set cnamelist [list] foreach i $idxlist { lappend cnamelist [sqlite3_column_origin_name $STMT $i] - } + } set cnamelist } $cols - + # Origin declaration types in UTF-16 ifcapable {utf16} { do_test $test.13 { @@ -410,9 +410,9 @@ ifcapable columnmetadata { # sqlite3_column_text16 # sqlite3_column_double # -# $STMT is a compiled SQL statement for which the previous call -# to sqlite3_step returned SQLITE_ROW. $test is a prefix to use -# for test names within this proc. $types is a list of the +# $STMT is a compiled SQL statement for which the previous call +# to sqlite3_step returned SQLITE_ROW. $test is a prefix to use +# for test names within this proc. $types is a list of the # manifest types for the current row. $ints, $doubles and $strings # are lists of the integer, real and string representations of # the values in the current row. @@ -644,7 +644,7 @@ if {[clang_sanitize_address]==0} { # This procedure sets the value of the file-format in file 'test.db' # to $newval. Also, the schema cookie is incremented. -# +# proc set_file_format {newval} { hexio_write test.db 44 [hexio_render_int32 $newval] set schemacookie [hexio_get_int [hexio_read test.db 40 4]] @@ -654,7 +654,7 @@ proc set_file_format {newval} { } # This procedure returns the value of the file-format in file 'test.db'. -# +# proc get_file_format {{fname test.db}} { return [hexio_get_int [hexio_read $fname 44 4]] } @@ -940,7 +940,7 @@ do_test capi3c-11.21 { # The following tests - capi3c-12.* - check that its Ok to start a # transaction while other VMs are active, and that its Ok to execute -# atomic updates in the same situation +# atomic updates in the same situation # do_test capi3c-12.1 { set STMT [sqlite3_prepare_v2 $DB "SELECT a FROM t2" -1 TAIL] @@ -981,7 +981,7 @@ do_test capi3c-12.8 { } } {1 2 3 4} -# Test cases capi3c-13.* test the sqlite3_clear_bindings() and +# Test cases capi3c-13.* test the sqlite3_clear_bindings() and # sqlite3_sleep APIs. # if {[llength [info commands sqlite3_clear_bindings]]>0} { @@ -1042,7 +1042,7 @@ do_test capi3c-15.3 { sqlite3_finalize $STMT } {SQLITE_OK} -# Make sure code is always generated even if an IF EXISTS or +# Make sure code is always generated even if an IF EXISTS or # IF NOT EXISTS clause is present that the table does not or # does exists. That way we will always have a prepared statement # to expire when the schema changes. @@ -1369,7 +1369,7 @@ do_test capi3c-24.4 { } {INTEGER STRING DATETIME} do_test capi3c-24.5 { decltype { - SELECT (SELECT x FROM (SELECT c AS x)) + SELECT (SELECT x FROM (SELECT c AS x)) FROM (SELECT * FROM t5 ORDER BY c LIMIT 1) ORDER BY b } } {DATETIME} diff --git a/third_party/sqlite/src/test/capi3d.test b/third_party/sqlite/src/test/capi3d.test index 3b9b8375d180a..c32e666779ba1 100644 --- a/third_party/sqlite/src/test/capi3d.test +++ b/third_party/sqlite/src/test/capi3d.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # This file is devoted to testing the sqlite3_next_stmt and # sqlite3_stmt_readonly and sqlite3_stmt_busy interfaces. @@ -26,7 +26,7 @@ proc make_prepared_statements {N} { set plist {} for {set i 0} {$i<$N} {incr i} { set sql "SELECT $i FROM sqlite_master WHERE name LIKE '%$i%'" - if {rand()<0.33} { + if {rand()<0.33} { set s [sqlite3_prepare_v2 db $sql -1 notused] } else { ifcapable utf16 { diff --git a/third_party/sqlite/src/test/capi3e.test b/third_party/sqlite/src/test/capi3e.test index 3e478e79040ef..b2c6a39a88b9c 100644 --- a/third_party/sqlite/src/test/capi3e.test +++ b/third_party/sqlite/src/test/capi3e.test @@ -41,7 +41,7 @@ proc utf16 {str {nt 1}} { return $r } -# Return the UTF-8 representation of the supplied UTF-16 string $str. +# Return the UTF-8 representation of the supplied UTF-16 string $str. proc utf8 {str} { # If $str ends in two 0x00 0x00 bytes, knock these off before # converting to UTF-8 using TCL. diff --git a/third_party/sqlite/src/test/cast.test b/third_party/sqlite/src/test/cast.test index f47f4bb2bf3fc..80f1ca7cbdcf7 100644 --- a/third_party/sqlite/src/test/cast.test +++ b/third_party/sqlite/src/test/cast.test @@ -303,7 +303,7 @@ do_test case-3.31 { execsql {SELECT CAST(NULL AS numeric)} } {{}} -# Test to see if it is possible to trick SQLite into reading past +# Test to see if it is possible to trick SQLite into reading past # the end of a blob when converting it to a number. do_test cast-3.32.1 { set blob "1234567890" diff --git a/third_party/sqlite/src/test/cffault.test b/third_party/sqlite/src/test/cffault.test index 0d029ece37d8f..67ab335374af0 100644 --- a/third_party/sqlite/src/test/cffault.test +++ b/third_party/sqlite/src/test/cffault.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file contains fault-injection test cases for the +# This file contains fault-injection test cases for the # sqlite3_db_cacheflush API. # @@ -18,7 +18,7 @@ source $testdir/tester.tcl set testprefix cffault source $testdir/malloc_common.tcl -# Run the supplied SQL on a copy of the database currently stored on +# Run the supplied SQL on a copy of the database currently stored on # disk in file $dbfile. proc diskquery {dbfile sql} { forcecopy $dbfile dq.db diff --git a/third_party/sqlite/src/test/check.test b/third_party/sqlite/src/test/check.test index 43e447f70d7ad..ca7f3cab30f8a 100644 --- a/third_party/sqlite/src/test/check.test +++ b/third_party/sqlite/src/test/check.test @@ -35,7 +35,7 @@ do_test check-1.2 { execsql { INSERT INTO t1 VALUES(3,4); SELECT * FROM t1; - } + } } {3 4.0} do_test check-1.3 { catchsql { @@ -45,7 +45,7 @@ do_test check-1.3 { do_test check-1.4 { execsql { SELECT * FROM t1; - } + } } {3 4.0} do_test check-1.5 { catchsql { @@ -55,7 +55,7 @@ do_test check-1.5 { do_test check-1.6 { execsql { SELECT * FROM t1; - } + } } {3 4.0} do_test check-1.7 { catchsql { @@ -65,7 +65,7 @@ do_test check-1.7 { do_test check-1.8 { execsql { SELECT * FROM t1; - } + } } {3 4.0 {} 6.0} do_test check-1.9 { catchsql { @@ -75,7 +75,7 @@ do_test check-1.9 { do_test check-1.10 { execsql { SELECT * FROM t1; - } + } } {3 4.0 {} 6.0 2 {}} do_test check-1.11 { execsql { @@ -431,7 +431,7 @@ do_catchsql_test 7.3 { INSERT INTO t6 VALUES(11) } \ do_test 7.4 { sqlite3 db2 test.db - execsql { SELECT * FROM t6 } db2 + execsql { SELECT * FROM t6 } db2 } {9} do_test 7.5 { diff --git a/third_party/sqlite/src/test/closure01.test b/third_party/sqlite/src/test/closure01.test index 213ef4e9666e1..a7dda8f7d83ed 100644 --- a/third_party/sqlite/src/test/closure01.test +++ b/third_party/sqlite/src/test/closure01.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # Test cases for transitive_closure virtual table. set testdir [file dirname $argv0] @@ -27,7 +27,7 @@ do_execsql_test 1.0 { INSERT INTO t1(x, y) SELECT i, nullif(i,1)/2 FROM cnt; CREATE INDEX t1y ON t1(y); COMMIT; - CREATE VIRTUAL TABLE cx + CREATE VIRTUAL TABLE cx USING transitive_closure(tablename=t1, idcolumn=x, parentcolumn=y); } {} @@ -157,12 +157,12 @@ do_timed_execsql_test 1.10-cte { SELECT count(*), min(id), max(id) FROM below WHERE depth=5; } {32 32 63} -# Create a much smaller table t2 with only 32 elements +# Create a much smaller table t2 with only 32 elements db eval { CREATE TABLE t2(x INTEGER PRIMARY KEY, y INTEGER); INSERT INTO t2 SELECT x, y FROM t1 WHERE x<32; CREATE INDEX t2y ON t2(y); - CREATE VIRTUAL TABLE c2 + CREATE VIRTUAL TABLE c2 USING transitive_closure(tablename=t2, idcolumn=x, parentcolumn=y); } diff --git a/third_party/sqlite/src/test/collate1.test b/third_party/sqlite/src/test/collate1.test index 7cf5698454804..1173e89ff1f59 100644 --- a/third_party/sqlite/src/test/collate1.test +++ b/third_party/sqlite/src/test/collate1.test @@ -22,22 +22,22 @@ set testprefix collate1 # # collate1-1.* - Single-field ORDER BY with an explicit COLLATE clause. # collate1-2.* - Multi-field ORDER BY with an explicit COLLATE clause. -# collate1-3.* - ORDER BY using a default collation type. Also that an +# collate1-3.* - ORDER BY using a default collation type. Also that an # explict collate type overrides a default collate type. # collate1-4.* - ORDER BY using a data type. # # # Collation type 'HEX'. If an argument can be interpreted as a hexadecimal -# number, then it is converted to one before the comparison is performed. -# Numbers are less than other strings. If neither argument is a number, +# number, then it is converted to one before the comparison is performed. +# Numbers are less than other strings. If neither argument is a number, # [string compare] is used. # db collate HEX hex_collate proc hex_collate {lhs rhs} { set lhs_ishex [regexp {^(0x|)[1234567890abcdefABCDEF]+$} $lhs] set rhs_ishex [regexp {^(0x|)[1234567890abcdefABCDEF]+$} $rhs] - if {$lhs_ishex && $rhs_ishex} { + if {$lhs_ishex && $rhs_ishex} { set lhsx [scan $lhs %x] set rhsx [scan $rhs %x] if {$lhs < $rhs} {return -1} @@ -57,7 +57,7 @@ db function hex {format 0x%X} # Mimic the SQLite 2 collation type NUMERIC. db collate numeric numeric_collate proc numeric_collate {lhs rhs} { - if {$lhs == $rhs} {return 0} + if {$lhs == $rhs} {return 0} return [expr ($lhs>$rhs)?1:-1] } @@ -138,38 +138,38 @@ do_test collate1-2.4 { } {7 0xA 5 0xA 5 0x11 11 0x11 11 0x101 {} {}} do_test collate1-2.5 { execsql { - SELECT c1, c2 FROM collate1t1 + SELECT c1, c2 FROM collate1t1 ORDER BY 1 COLLATE binary DESC, 2 COLLATE hex DESC; } } {7 0xA 5 0x11 5 0xA 11 0x101 11 0x11 {} {}} do_test collate1-2.6 { execsql { - SELECT c1, c2 FROM collate1t1 + SELECT c1, c2 FROM collate1t1 ORDER BY 1 COLLATE binary ASC, 2 COLLATE hex ASC; } } {{} {} 11 0x11 11 0x101 5 0xA 5 0x11 7 0xA} do_test collate1-2.12.1 { execsql { - SELECT c1 COLLATE numeric, c2 FROM collate1t1 + SELECT c1 COLLATE numeric, c2 FROM collate1t1 ORDER BY 1, 2 COLLATE hex; } } {{} {} 5 0xA 5 0x11 7 0xA 11 0x11 11 0x101} do_test collate1-2.12.2 { execsql { - SELECT c1 COLLATE hex, c2 FROM collate1t1 + SELECT c1 COLLATE hex, c2 FROM collate1t1 ORDER BY 1 COLLATE numeric, 2 COLLATE hex; } } {{} {} 5 0xA 5 0x11 7 0xA 11 0x11 11 0x101} do_test collate1-2.12.3 { execsql { - SELECT c1, c2 COLLATE hex FROM collate1t1 + SELECT c1, c2 COLLATE hex FROM collate1t1 ORDER BY 1 COLLATE numeric, 2; } } {{} {} 5 0xA 5 0x11 7 0xA 11 0x11 11 0x101} do_test collate1-2.12.4 { execsql { SELECT c1 COLLATE numeric, c2 COLLATE hex - FROM collate1t1 + FROM collate1t1 ORDER BY 1, 2; } } {{} {} 5 0xA 5 0x11 7 0xA 11 0x11 11 0x101} @@ -189,14 +189,14 @@ do_test collate1-2.14 { do_test collate1-2.15 { execsql { SELECT c1 COLLATE binary, c2 COLLATE hex - FROM collate1t1 + FROM collate1t1 ORDER BY 1 DESC, 2 DESC; } } {7 0xA 5 0x11 5 0xA 11 0x101 11 0x11 {} {}} do_test collate1-2.16 { execsql { SELECT c1 COLLATE hex, c2 COLLATE binary - FROM collate1t1 + FROM collate1t1 ORDER BY 1 COLLATE binary ASC, 2 COLLATE hex ASC; } } {{} {} 11 0x11 11 0x101 5 0xA 5 0x11 7 0xA} @@ -207,7 +207,7 @@ do_test collate1-2.99 { } {} # -# These tests ensure that the default collation type for a column is used +# These tests ensure that the default collation type for a column is used # by an ORDER BY clause correctly. The focus is all the different ways # the column can be referenced. i.e. a, collate2t1.a, main.collate2t1.a etc. # @@ -363,18 +363,18 @@ do_execsql_test 6.5 { CREATE TABLE c1(x, y REFERENCES p1); } {} -do_execsql_test 6.6 { - INSERT INTO p1 VALUES('abc'); - INSERT INTO c1 VALUES(1, 'ABC'); +do_execsql_test 6.6 { + INSERT INTO p1 VALUES('abc'); + INSERT INTO c1 VALUES(1, 'ABC'); } ifcapable foreignkey { - do_catchsql_test 6.7 { - DELETE FROM p1 WHERE rowid = 1 + do_catchsql_test 6.7 { + DELETE FROM p1 WHERE rowid = 1 } {1 {FOREIGN KEY constraint failed}} } -do_execsql_test 6.8 { +do_execsql_test 6.8 { INSERT INTO p1 VALUES('abb'); INSERT INTO p1 VALUES('wxz'); INSERT INTO p1 VALUES('wxy'); diff --git a/third_party/sqlite/src/test/collate2.test b/third_party/sqlite/src/test/collate2.test index d5aadb4eb5681..3769842da8c2b 100644 --- a/third_party/sqlite/src/test/collate2.test +++ b/third_party/sqlite/src/test/collate2.test @@ -42,18 +42,18 @@ proc backwards_collate {a b} { } # The following values are used in these tests: -# NULL aa ab ba bb aA aB bA bB Aa Ab Ba Bb AA AB BA BB +# NULL aa ab ba bb aA aB bA bB Aa Ab Ba Bb AA AB BA BB # # The collation orders for each of the tested collation types are: # -# BINARY: NULL AA AB Aa Ab BA BB Ba Bb aA aB aa ab bA bB ba bb -# NOCASE: NULL aa aA Aa AA ab aB Ab AB ba bA Ba BA bb bB Bb BB -# BACKWARDS: NULL AA BA aA bA AB BB aB bB Aa Ba aa ba Ab Bb ab bb +# BINARY: NULL AA AB Aa Ab BA BB Ba Bb aA aB aa ab bA bB ba bb +# NOCASE: NULL aa aA Aa AA ab aB Ab AB ba bA Ba BA bb bB Bb BB +# BACKWARDS: NULL AA BA aA bA AB BB aB bB Aa Ba aa ba Ab Bb ab bb # # These tests verify that the default collation type for a column is used -# for comparison operators (<, >, <=, >=, =) involving that column and +# for comparison operators (<, >, <=, >=, =) involving that column and # an expression that is not a column with a default collation type. -# +# # The collation sequences BINARY and NOCASE are built-in, the BACKWARDS # collation sequence is implemented by the TCL proc backwards_collate # above. @@ -61,8 +61,8 @@ proc backwards_collate {a b} { do_test collate2-1.0 { execsql { CREATE TABLE collate2t1( - a COLLATE BINARY, - b COLLATE NOCASE, + a COLLATE BINARY, + b COLLATE NOCASE, c COLLATE BACKWARDS ); INSERT INTO collate2t1 VALUES( NULL, NULL, NULL ); @@ -87,7 +87,7 @@ do_test collate2-1.0 { INSERT INTO collate2t1 VALUES( 'BA', 'BA', 'BA' ); INSERT INTO collate2t1 VALUES( 'BB', 'BB', 'BB' ); } - if {[info exists collate_test_use_index]} { + if {[info exists collate_test_use_index]} { execsql { CREATE INDEX collate2t1_i1 ON collate2t1(a); CREATE INDEX collate2t1_i2 ON collate2t1(b); @@ -268,21 +268,21 @@ do_test collate2-1.18 { } {Aa Ba aa ba Ab Bb} do_test collate2-1.19 { execsql { - SELECT a FROM collate2t1 WHERE + SELECT a FROM collate2t1 WHERE CASE a WHEN 'aa' THEN 1 ELSE 0 END ORDER BY 1, oid; } } {aa} do_test collate2-1.20 { execsql { - SELECT b FROM collate2t1 WHERE + SELECT b FROM collate2t1 WHERE CASE b WHEN 'aa' THEN 1 ELSE 0 END ORDER BY 1, oid; } } {aa aA Aa AA} do_test collate2-1.21 { execsql { - SELECT c FROM collate2t1 WHERE + SELECT c FROM collate2t1 WHERE CASE c WHEN 'aa' THEN 1 ELSE 0 END ORDER BY 1, oid; } @@ -306,19 +306,19 @@ ifcapable subquery { } {aa bb} do_test collate2-1.25 { execsql { - SELECT a FROM collate2t1 + SELECT a FROM collate2t1 WHERE a IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb')); } } {aa bb} do_test collate2-1.26 { execsql { - SELECT b FROM collate2t1 + SELECT b FROM collate2t1 WHERE b IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb')); } } {aa bb aA bB Aa Bb AA BB} do_test collate2-1.27 { execsql { - SELECT c FROM collate2t1 + SELECT c FROM collate2t1 WHERE c IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb')); } } {aa bb} @@ -448,19 +448,19 @@ ifcapable subquery { } {ab ba aA aB bA bB Aa Ab Ba Bb AA AB BA BB} do_test collate2-2.25 { execsql { - SELECT a FROM collate2t1 + SELECT a FROM collate2t1 WHERE NOT a IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb')); } } {ab ba aA aB bA bB Aa Ab Ba Bb AA AB BA BB} do_test collate2-2.26 { execsql { - SELECT b FROM collate2t1 + SELECT b FROM collate2t1 WHERE NOT b IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb')); } } {ab ba aB bA Ab Ba AB BA} do_test collate2-2.27 { execsql { - SELECT c FROM collate2t1 + SELECT c FROM collate2t1 WHERE NOT c IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb')); } } {ab ba aA aB bA bB Aa Ab Ba Bb AA AB BA BB} @@ -590,19 +590,19 @@ ifcapable subquery { } {{} 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0} do_test collate2-3.25 { execsql { - SELECT a IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb')) + SELECT a IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb')) FROM collate2t1; } } {{} 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0} do_test collate2-3.26 { execsql { - SELECT b IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb')) + SELECT b IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb')) FROM collate2t1; } } {{} 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1} do_test collate2-3.27 { execsql { - SELECT c IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb')) + SELECT c IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb')) FROM collate2t1; } } {{} 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0} @@ -622,13 +622,13 @@ do_test collate2-4.0 { # is used. do_test collate2-4.1 { execsql { - SELECT collate2t1.a FROM collate2t1, collate2t2 + SELECT collate2t1.a FROM collate2t1, collate2t2 WHERE collate2t1.b = collate2t2.b; } } {aa aA Aa AA} do_test collate2-4.2 { execsql { - SELECT collate2t1.a FROM collate2t1, collate2t2 + SELECT collate2t1.a FROM collate2t1, collate2t2 WHERE collate2t2.b = collate2t1.b; } } {aa} @@ -637,14 +637,14 @@ do_test collate2-4.2 { # does not, the collation type is used. do_test collate2-4.3 { execsql { - SELECT collate2t1.a FROM collate2t1, collate2t3 + SELECT collate2t1.a FROM collate2t1, collate2t3 WHERE collate2t1.b = collate2t3.b||'' ORDER BY +collate2t1.a DESC; } } {aa aA Aa AA} do_test collate2-4.4 { execsql { - SELECT collate2t1.a FROM collate2t1, collate2t3 + SELECT collate2t1.a FROM collate2t1, collate2t3 WHERE collate2t3.b||'' = collate2t1.b ORDER BY +collate2t1.a DESC; } @@ -662,7 +662,7 @@ do_test collate2-4.5 { # # SQLite transforms the JOIN syntax into a WHERE clause internally, so # the focus of these tests is to ensure that the table on the left-hand-side -# of the join determines the collation type used. +# of the join determines the collation type used. # do_test collate2-5.0 { execsql { @@ -707,7 +707,7 @@ do_execsql_test 6.3 { SELECT * FROM t1 WHERE x BETWEEN 'a' COLLATE nocase AND 'c' COLLATE nocase; } {b B} do_execsql_test 6.4 { - SELECT * FROM t1 + SELECT * FROM t1 WHERE x COLLATE nocase BETWEEN 'a' COLLATE nocase AND 'c' COLLATE nocase; } {b B} do_execsql_test 6.5 { @@ -717,7 +717,7 @@ do_execsql_test 6.6 { SELECT * FROM t1 WHERE +x BETWEEN 'a' COLLATE nocase AND 'c' COLLATE nocase; } {b B} do_execsql_test 6.7 { - SELECT * FROM t1 + SELECT * FROM t1 WHERE +x COLLATE nocase BETWEEN 'a' COLLATE nocase AND 'c' COLLATE nocase; } {b B} diff --git a/third_party/sqlite/src/test/collate3.test b/third_party/sqlite/src/test/collate3.test index 99640d05b89be..26fd0cb730c40 100644 --- a/third_party/sqlite/src/test/collate3.test +++ b/third_party/sqlite/src/test/collate3.test @@ -27,7 +27,7 @@ source $testdir/tester.tcl # # -# These tests ensure that when a user executes a statement with an +# These tests ensure that when a user executes a statement with an # unknown collation sequence an error is returned. # do_test collate3-1.0 { @@ -63,8 +63,8 @@ execsql { proc caseless {a b} { string compare -nocase $a $b } do_test collate3-1.4 { db collate caseless caseless - execsql { - CREATE TABLE t1(a COLLATE caseless); + execsql { + CREATE TABLE t1(a COLLATE caseless); INSERT INTO t1 VALUES('Abc2'); INSERT INTO t1 VALUES('abc1'); INSERT INTO t1 VALUES('aBc3'); @@ -186,22 +186,22 @@ do_test collate3-2.1 { catchsql { SELECT * FROM collate3t1 ORDER BY 1 COLLATE string_compare; } -} {1 {no such collation sequence: string_compare}} +} {1 {no such collation sequence: string_compare}} do_test collate3-2.2 { catchsql { SELECT * FROM collate3t1 ORDER BY c1; } -} {1 {no such collation sequence: string_compare}} +} {1 {no such collation sequence: string_compare}} do_test collate3-2.3 { catchsql { SELECT * FROM collate3t1 WHERE c1 = 'xxx'; } -} {1 {no such collation sequence: string_compare}} +} {1 {no such collation sequence: string_compare}} do_test collate3-2.4 { catchsql { CREATE TABLE collate3t2(c1 COLLATE string_compare); } -} {1 {no such collation sequence: string_compare}} +} {1 {no such collation sequence: string_compare}} do_test collate3-2.5 { catchsql { CREATE INDEX collate3t1_i1 ON collate3t1(c1); @@ -216,7 +216,7 @@ do_test collate3-2.7.1 { catchsql { SELECT count(*) FROM collate3t1 GROUP BY c1; } -} {1 {no such collation sequence: string_compare}} +} {1 {no such collation sequence: string_compare}} # do_test collate3-2.7.2 { # catchsql { # SELECT * FROM collate3t1 GROUP BY c1; @@ -226,29 +226,29 @@ do_test collate3-2.7.2 { catchsql { SELECT * FROM collate3t1 GROUP BY c1; } -} {1 {no such collation sequence: string_compare}} +} {1 {no such collation sequence: string_compare}} do_test collate3-2.8 { catchsql { SELECT DISTINCT c1 FROM collate3t1; } -} {1 {no such collation sequence: string_compare}} +} {1 {no such collation sequence: string_compare}} ifcapable compound { do_test collate3-2.9 { catchsql { SELECT c1 FROM collate3t1 UNION SELECT c1 FROM collate3t1; } - } {1 {no such collation sequence: string_compare}} + } {1 {no such collation sequence: string_compare}} do_test collate3-2.10 { catchsql { SELECT c1 FROM collate3t1 EXCEPT SELECT c1 FROM collate3t1; } - } {1 {no such collation sequence: string_compare}} + } {1 {no such collation sequence: string_compare}} do_test collate3-2.11 { catchsql { SELECT c1 FROM collate3t1 INTERSECT SELECT c1 FROM collate3t1; } - } {1 {no such collation sequence: string_compare}} + } {1 {no such collation sequence: string_compare}} do_test collate3-2.12 { catchsql { SELECT c1 FROM collate3t1 UNION ALL SELECT c1 FROM collate3t1; @@ -258,33 +258,33 @@ ifcapable compound { catchsql { SELECT 10 UNION ALL SELECT 20 ORDER BY 1 COLLATE string_compare; } - } {1 {no such collation sequence: string_compare}} + } {1 {no such collation sequence: string_compare}} do_test collate3-2.14 { catchsql { SELECT 10 INTERSECT SELECT 20 ORDER BY 1 COLLATE string_compare; } - } {1 {no such collation sequence: string_compare}} + } {1 {no such collation sequence: string_compare}} do_test collate3-2.15 { catchsql { SELECT 10 EXCEPT SELECT 20 ORDER BY 1 COLLATE string_compare; } - } {1 {no such collation sequence: string_compare}} + } {1 {no such collation sequence: string_compare}} do_test collate3-2.16 { catchsql { SELECT 10 UNION SELECT 20 ORDER BY 1 COLLATE string_compare; } - } {1 {no such collation sequence: string_compare}} + } {1 {no such collation sequence: string_compare}} do_test collate3-2.17 { catchsql { SELECT c1 FROM collate3t1 UNION ALL SELECT c1 FROM collate3t1 ORDER BY 1; } - } {1 {no such collation sequence: string_compare}} + } {1 {no such collation sequence: string_compare}} } ;# ifcapable compound # # Create an index that uses a collation sequence then close and # re-open the database without re-registering the collation -# sequence. Then check that for the table with the index +# sequence. Then check that for the table with the index # * An INSERT fails, # * An UPDATE on the column with the index fails, # * An UPDATE on a different column succeeds. @@ -309,12 +309,12 @@ do_test collate3-3.1 { catchsql { INSERT INTO collate3t1 VALUES('xxx', 0); } -} {1 {no such collation sequence: string_compare}} +} {1 {no such collation sequence: string_compare}} do_test collate3-3.2 { catchsql { UPDATE collate3t1 SET c1 = 'xxx'; } -} {1 {no such collation sequence: string_compare}} +} {1 {no such collation sequence: string_compare}} do_test collate3-3.3 { catchsql { UPDATE collate3t1 SET c2 = 'xxx'; @@ -324,7 +324,7 @@ do_test collate3-3.4 { catchsql { DELETE FROM collate3t1 WHERE 1; } -} {1 {no such collation sequence: string_compare}} +} {1 {no such collation sequence: string_compare}} do_test collate3-3.5 { catchsql { SELECT * FROM collate3t1; @@ -351,34 +351,34 @@ do_test collate3-3.10 { catchsql { SELECT * FROM collate3t1 ORDER BY 1 COLLATE string_compare; } -} {1 {no such collation sequence: string_compare}} +} {1 {no such collation sequence: string_compare}} do_test collate3-3.11 { catchsql { SELECT * FROM collate3t1 ORDER BY c1; } -} {1 {no such collation sequence: string_compare}} +} {1 {no such collation sequence: string_compare}} do_test collate3-3.12 { catchsql { SELECT * FROM collate3t1 WHERE c1 = 'xxx'; } -} {1 {no such collation sequence: string_compare}} +} {1 {no such collation sequence: string_compare}} do_test collate3-3.13 { catchsql { CREATE TABLE collate3t2(c1 COLLATE string_compare); } -} {1 {no such collation sequence: string_compare}} +} {1 {no such collation sequence: string_compare}} do_test collate3-3.14 { catchsql { CREATE INDEX collate3t1_i2 ON collate3t1(c1); } -} {1 {no such collation sequence: string_compare}} +} {1 {no such collation sequence: string_compare}} do_test collate3-3.15 { execsql { DROP TABLE collate3t1; } } {} -# Check we can create an index that uses an explicit collation +# Check we can create an index that uses an explicit collation # sequence and then close and re-open the database. do_test collate3-4.6 { db collate user_defined "string compare" @@ -423,7 +423,7 @@ proc numeric_compare {lhs rhs} { return $res } -# Check we can create a view that uses an explicit collation +# Check we can create a view that uses an explicit collation # sequence and then close and re-open the database. ifcapable view { do_test collate3-4.9 { @@ -433,7 +433,7 @@ do_test collate3-4.9 { INSERT INTO collate3t1 VALUES('2', NULL); INSERT INTO collate3t1 VALUES('101', NULL); INSERT INTO collate3t1 VALUES('12', NULL); - CREATE VIEW collate3v1 AS SELECT * FROM collate3t1 + CREATE VIEW collate3v1 AS SELECT * FROM collate3t1 ORDER BY 1 COLLATE user_defined; SELECT * FROM collate3v1; } diff --git a/third_party/sqlite/src/test/collate4.test b/third_party/sqlite/src/test/collate4.test index b8c1c573c3bc5..645243a2a4e7d 100644 --- a/third_party/sqlite/src/test/collate4.test +++ b/third_party/sqlite/src/test/collate4.test @@ -42,7 +42,7 @@ proc cksort {sql} { return $data } -# +# # Test cases are organized roughly as follows: # # collate4-1.* ORDER BY. @@ -55,11 +55,11 @@ proc cksort {sql} { # # These tests - collate4-1.* - check that indices are correctly -# selected or not selected to implement ORDER BY clauses when -# user defined collation sequences are involved. +# selected or not selected to implement ORDER BY clauses when +# user defined collation sequences are involved. # -# Because these tests also exercise all the different ways indices -# can be created, they also serve to verify that indices are correctly +# Because these tests also exercise all the different ways indices +# can be created, they also serve to verify that indices are correctly # initialized with user-defined collation sequences when they are # created. # @@ -100,7 +100,7 @@ do_test collate4-1.1.6 { do_test collate4-1.1.7 { execsql { CREATE TABLE collate4t2( - a PRIMARY KEY COLLATE NOCASE, + a PRIMARY KEY COLLATE NOCASE, b UNIQUE COLLATE TEXT ); INSERT INTO collate4t2 VALUES( 'a', 'a' ); @@ -130,8 +130,8 @@ do_test collate4-1.1.13 { do_test collate4-1.1.14 { execsql { CREATE TABLE collate4t3( - b COLLATE TEXT, - a COLLATE NOCASE, + b COLLATE TEXT, + a COLLATE NOCASE, UNIQUE(a), PRIMARY KEY(b) ); INSERT INTO collate4t3 VALUES( 'a', 'a' ); @@ -231,8 +231,8 @@ do_test collate4-1.2.6 { do_test collate4-1.2.7 { execsql { CREATE TABLE collate4t2( - a COLLATE NOCASE, - b COLLATE TEXT, + a COLLATE NOCASE, + b COLLATE TEXT, PRIMARY KEY(a, b) ); INSERT INTO collate4t2 VALUES( 'a', 'a' ); @@ -295,11 +295,11 @@ do_test collate4-1.2.22 { cksort {SELECT a FROM collate4t3 ORDER BY a COLLATE text DESC, b} } {b a B A {} sort} do_test collate4-1.2.23 { - cksort {SELECT a FROM collate4t3 + cksort {SELECT a FROM collate4t3 ORDER BY a COLLATE text DESC, b COLLATE nocase} } {b a B A {} sort} do_test collate4-1.2.24 { - cksort {SELECT a FROM collate4t3 + cksort {SELECT a FROM collate4t3 ORDER BY a COLLATE text DESC, b COLLATE nocase DESC} } {b a B A {} nosort} @@ -313,8 +313,8 @@ do_test collate4-1.2.25 { # # These tests - collate4-2.* - check that indices are correctly -# selected or not selected to implement WHERE clauses when user -# defined collation sequences are involved. +# selected or not selected to implement WHERE clauses when user +# defined collation sequences are involved. # # Indices may optimise WHERE clauses using <, >, <=, >=, = or IN # operators. @@ -557,12 +557,12 @@ do_test collate4-3.15 { # Mimic the SQLite 2 collation type NUMERIC. db collate numeric numeric_collate proc numeric_collate {lhs rhs} { - if {$lhs == $rhs} {return 0} + if {$lhs == $rhs} {return 0} return [expr ($lhs>$rhs)?1:-1] } # -# These tests - collate4-4.* check that min() and max() only ever +# These tests - collate4-4.* check that min() and max() only ever # use indices constructed with built-in collation type numeric. # # CHANGED: min() and max() now use the collation type. If there @@ -669,11 +669,11 @@ do_test collate4-4.15 { } {} # -# These tests - collate4.6.* - ensure that implict INTEGER PRIMARY KEY -# indices do not confuse collation sequences. +# These tests - collate4.6.* - ensure that implict INTEGER PRIMARY KEY +# indices do not confuse collation sequences. # # These indices are never used for sorting in SQLite. And you can't -# create another index on an INTEGER PRIMARY KEY column, so we don't have +# create another index on an INTEGER PRIMARY KEY column, so we don't have # to test that. # (Revised 2004-Nov-22): The ROWID can be used for sorting now. # diff --git a/third_party/sqlite/src/test/collate5.test b/third_party/sqlite/src/test/collate5.test index 5f8697ea51ee3..654e5bebad807 100644 --- a/third_party/sqlite/src/test/collate5.test +++ b/third_party/sqlite/src/test/collate5.test @@ -34,7 +34,7 @@ db collate TEXT [list string compare] # Mimic the SQLite 2 collation type NUMERIC. db collate numeric numeric_collate proc numeric_collate {lhs rhs} { - if {$lhs == $rhs} {return 0} + if {$lhs == $rhs} {return 0} return [expr ($lhs>$rhs)?1:-1] } @@ -51,7 +51,7 @@ do_test collate5-1.0 { INSERT INTO collate5t1 VALUES('B', 'banana'); INSERT INTO collate5t1 VALUES('n', NULL); INSERT INTO collate5t1 VALUES('N', NULL); - } + } } {} do_test collate5-1.1 { execsql { @@ -115,7 +115,7 @@ do_test collate5-2.0 { INSERT INTO collate5t2 VALUES('A', 'apple'); INSERT INTO collate5t2 VALUES('b', 'banana'); INSERT INTO collate5t2 VALUES('B', 'Banana'); - } + } } {} do_test collate5-2.1.1 { @@ -156,7 +156,7 @@ do_test collate5-2.2.3 { } {A Apple N {}} do_test collate5-2.2.4 { execsql { - SELECT a, b FROM collate5t2 EXCEPT select a, b FROM collate5t1 + SELECT a, b FROM collate5t2 EXCEPT select a, b FROM collate5t1 where a != 'a'; } } {A apple a apple} @@ -200,7 +200,7 @@ do_test collate5-2.4.0 { BEGIN; CREATE TABLE collate5t3(a, b); } - foreach ii $::lens { + foreach ii $::lens { execsql "INSERT INTO collate5t3 VALUES($ii, '[string repeat a $ii]');" } expr [llength [execsql { @@ -214,7 +214,7 @@ do_test collate5-2.4.1 { unset ::lens # -# These tests - collate5-3.* - focus on compound SELECT queries that +# These tests - collate5-3.* - focus on compound SELECT queries that # feature ORDER BY clauses. # do_test collate5-3.0 { @@ -229,7 +229,7 @@ do_test collate5-3.1 { } {A A B B N a a b b n} do_test collate5-3.2 { execsql { - SELECT a FROM collate5t1 UNION ALL SELECT a FROM collate5t2 + SELECT a FROM collate5t1 UNION ALL SELECT a FROM collate5t2 ORDER BY 1 COLLATE TEXT; } } {A A B B N a a b b n} @@ -266,7 +266,7 @@ do_test collate5-3.20 { do_test collate5-4.0 { execsql { - CREATE TABLE collate5t1(a COLLATE NOCASE, b COLLATE NUMERIC); + CREATE TABLE collate5t1(a COLLATE NOCASE, b COLLATE NUMERIC); INSERT INTO collate5t1 VALUES('a', '1'); INSERT INTO collate5t1 VALUES('A', '1.0'); INSERT INTO collate5t1 VALUES('b', '2'); diff --git a/third_party/sqlite/src/test/collate6.test b/third_party/sqlite/src/test/collate6.test index d238639a5d377..fb9710e0d1ff7 100644 --- a/third_party/sqlite/src/test/collate6.test +++ b/third_party/sqlite/src/test/collate6.test @@ -25,7 +25,7 @@ ifcapable {!trigger} { return } -# Create a case-insensitive collation type NOCASE for use in testing. +# Create a case-insensitive collation type NOCASE for use in testing. # Normally, capital letters are less than their lower-case counterparts. db collate NOCASE nocase_collate proc nocase_collate {a b} { @@ -44,11 +44,11 @@ do_test collate6-1.0 { } } {} -# Test that the default collation sequence applies to new.* references +# Test that the default collation sequence applies to new.* references # in WHEN clauses. do_test collate6-1.1 { execsql { - CREATE TRIGGER collate6trig BEFORE INSERT ON collate6tab + CREATE TRIGGER collate6trig BEFORE INSERT ON collate6tab WHEN new.a = 'a' BEGIN INSERT INTO collate6log VALUES(new.a, new.b); END; @@ -70,10 +70,10 @@ do_test collate6-1.4 { execsql { DROP TRIGGER collate6trig; DELETE FROM collate6log; - } + } } {} -# Test that the default collation sequence applies to new.* references +# Test that the default collation sequence applies to new.* references # in the body of triggers. do_test collate6-1.5 { execsql { @@ -98,7 +98,7 @@ do_test collate6-1.8 { execsql { DROP TRIGGER collate6trig; DELETE FROM collate6log; - } + } } {} do_test collate6-1.9 { @@ -107,7 +107,7 @@ do_test collate6-1.9 { } } {} -# Test that an explicit collation sequence overrides an implicit +# Test that an explicit collation sequence overrides an implicit # one attached to a 'new' reference. # do_test collate6-2.1 { diff --git a/third_party/sqlite/src/test/collate9.test b/third_party/sqlite/src/test/collate9.test index 5a07773a1ce2f..e307460cf1da7 100644 --- a/third_party/sqlite/src/test/collate9.test +++ b/third_party/sqlite/src/test/collate9.test @@ -55,43 +55,43 @@ do_test collate9-1.1 { } } {} do_test collate9-1.2 { - execsql { + execsql { SELECT x FROM xy ORDER BY x } } {two three one} do_test collate9-1.3 { - execsql { + execsql { SELECT y FROM xy ORDER BY y } } {one three two} do_test collate9-1.4 { - cksort { + cksort { SELECT x FROM xy ORDER BY x } } {two three one sort} do_test collate9-1.5 { - execsql { + execsql { CREATE INDEX xy_i ON xy(x) } } {} do_test collate9-1.6 { - cksort { + cksort { SELECT x FROM xy ORDER BY x } } {two three one nosort} do_test collate9-2.1 { - execsql { + execsql { SELECT x, x < 'seven' FROM xy ORDER BY x } } {two 1 three 1 one 0} do_test collate9-2.2 { - execsql { + execsql { SELECT y, y < 'seven' FROM xy ORDER BY x } } {two 0 three 0 one 1} do_test collate9-2.3 { - execsql { + execsql { SELECT y, y COLLATE "reverse sort" < 'seven' FROM xy ORDER BY x } } {two 1 three 1 one 0} @@ -117,22 +117,22 @@ do_test collate9-3.1 { } } {} do_test collate9-3.2 { - cksort { - SELECT y FROM xy ORDER BY y + cksort { + SELECT y FROM xy ORDER BY y } } {one three two sort} do_test collate9-3.3 { - cksort { + cksort { SELECT y FROM xy ORDER BY y COLLATE "reverse sort" } } {two three one nosort} do_test collate9-3.4 { - cksort { + cksort { SELECT y AS aaa FROM xy ORDER BY aaa } } {one three two sort} do_test collate9-3.5 { - cksort { + cksort { SELECT y COLLATE "reverse sort" AS aaa FROM xy ORDER BY aaa } } {two three one nosort} diff --git a/third_party/sqlite/src/test/colmeta.test b/third_party/sqlite/src/test/colmeta.test index 21b0e0f38a59e..797c7c084a84f 100644 --- a/third_party/sqlite/src/test/colmeta.test +++ b/third_party/sqlite/src/test/colmeta.test @@ -81,7 +81,7 @@ ifcapable view { foreach {tn params results} $tests { set ::DB [sqlite3_connection_pointer db] - set tstbody [concat sqlite3_table_column_metadata $::DB $params] + set tstbody [concat sqlite3_table_column_metadata $::DB $params] do_test colmeta-$tn.1 { list [catch $tstbody msg] [set msg] } $results @@ -90,7 +90,7 @@ foreach {tn params results} $tests { sqlite3 db test.db set ::DB [sqlite3_connection_pointer db] - set tstbody [concat sqlite3_table_column_metadata $::DB $params] + set tstbody [concat sqlite3_table_column_metadata $::DB $params] do_test colmeta-$tn.2 { list [catch $tstbody msg] [set msg] } $results diff --git a/third_party/sqlite/src/test/colname.test b/third_party/sqlite/src/test/colname.test index e16304d4a98ea..37d152b5315c8 100644 --- a/third_party/sqlite/src/test/colname.test +++ b/third_party/sqlite/src/test/colname.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # The focus of this file is testing how SQLite generates the names # of columns in a result set. @@ -55,7 +55,7 @@ do_test colname-2.1 { INSERT INTO txyz VALUES(4,5,6); CREATE TABLE tboth(a,b,c,x,y,z); INSERT INTO tboth VALUES(11,12,13,14,15,16); - CREATE VIEW v1 AS SELECT tabC.a, txyZ.x, * + CREATE VIEW v1 AS SELECT tabC.a, txyZ.x, * FROM tabc, txyz ORDER BY 1 LIMIT 1; CREATE VIEW v2 AS SELECT tabC.a, txyZ.x, tboTh.a, tbotH.x, * FROM tabc, txyz, tboth ORDER BY 1 LIMIT 1; @@ -114,7 +114,7 @@ do_test colname-3.1 { PRAGMA full_column_names=OFF; CREATE VIEW v3 AS SELECT tabC.a, txyZ.x, * FROM tabc, txyz ORDER BY 1 LIMIT 1; - CREATE VIEW v4 AS SELECT tabC.a, txyZ.x, tboTh.a, tbotH.x, * + CREATE VIEW v4 AS SELECT tabC.a, txyZ.x, tboTh.a, tbotH.x, * FROM tabc, txyz, tboth ORDER BY 1 LIMIT 1; } execsql2 { @@ -180,7 +180,7 @@ do_test colname-4.1 { PRAGMA full_column_names=ON; CREATE VIEW v5 AS SELECT tabC.a, txyZ.x, * FROM tabc, txyz ORDER BY 1 LIMIT 1; - CREATE VIEW v6 AS SELECT tabC.a, txyZ.x, tboTh.a, tbotH.x, * + CREATE VIEW v6 AS SELECT tabC.a, txyZ.x, tboTh.a, tbotH.x, * FROM tabc, txyz, tboth ORDER BY 1 LIMIT 1; } execsql2 { diff --git a/third_party/sqlite/src/test/conflict.test b/third_party/sqlite/src/test/conflict.test index a39988adb0332..39b83dcdc95c6 100644 --- a/third_party/sqlite/src/test/conflict.test +++ b/third_party/sqlite/src/test/conflict.test @@ -58,7 +58,7 @@ foreach {i cmd t0 t1 t2 t3} { DELETE FROM t2; INSERT INTO t1 VALUES(1,2,3); BEGIN; - INSERT INTO t2 VALUES(1); + INSERT INTO t2 VALUES(1); $cmd INTO t1 VALUES(1,2,4); }]} r1] catch {execsql {COMMIT}} @@ -104,7 +104,7 @@ foreach {i cmd t0 t1 t2} { DELETE FROM t2; INSERT INTO t1 VALUES(1,2,3); BEGIN; - INSERT INTO t2 VALUES(1); + INSERT INTO t2 VALUES(1); $cmd INTO t1 VALUES(1,2,4); }]} r1] catch {execsql {COMMIT}} @@ -149,7 +149,7 @@ foreach {i cmd t0 t1 t2} { DELETE FROM t2; INSERT INTO t1 VALUES(1,2,3); BEGIN; - INSERT INTO t2 VALUES(1); + INSERT INTO t2 VALUES(1); $cmd INTO t1 VALUES(1,2,4); }]} r1] catch {execsql {COMMIT}} @@ -197,7 +197,7 @@ foreach {i conf1 cmd t0 t1 t2} { DELETE FROM t2; INSERT INTO t1 VALUES(1,2,3); BEGIN; - INSERT INTO t2 VALUES(1); + INSERT INTO t2 VALUES(1); $cmd INTO t1 VALUES(1,2,4); }]} r1] catch {execsql {COMMIT}} @@ -250,7 +250,7 @@ foreach {i conf1 cmd t0 t1 t2} { CREATE TABLE t1(a,b,c NOT NULL $conf1 DEFAULT 5); DELETE FROM t2; BEGIN; - INSERT INTO t2 VALUES(1); + INSERT INTO t2 VALUES(1); $cmd INTO t1 VALUES(1,2,NULL); }]} r1] catch {execsql {COMMIT}} @@ -285,7 +285,7 @@ do_test conflict-6.0 { # t3 Number of temporary files for tables # t4 Number of temporary files for statement journals # -# Update (2007-08-21): Since temporary table files are now opened lazily, +# Update (2007-08-21): Since temporary table files are now opened lazily, # and none of the following tests use large quantities of data, t3 is always 0. # # Update (2016-03-04): Subjournals now also open lazily, so t4 is also always 0. @@ -316,7 +316,7 @@ foreach {i conf1 cmd t0 t1 t2 t3 t4} { } do_test conflict-6.$i { db close - sqlite3 db test.db + sqlite3 db test.db if {$conf1!=""} {set conf1 "ON CONFLICT $conf1"} execsql {pragma temp_store=file} set ::sqlite_opentemp_count 0 @@ -661,13 +661,13 @@ do_test conflict-11.1 { COMMIT; } - + # Set a small cache size so that changes will spill into - # the database file. + # the database file. execsql { PRAGMA cache_size = 10; } - + # Make lots of changes. Because of the small cache, some # (most?) of these changes will spill into the disk file. # In other words, some of the changes will not be held in diff --git a/third_party/sqlite/src/test/conflict2.test b/third_party/sqlite/src/test/conflict2.test index f33e01d582709..57b156f123962 100644 --- a/third_party/sqlite/src/test/conflict2.test +++ b/third_party/sqlite/src/test/conflict2.test @@ -57,7 +57,7 @@ foreach {i cmd t0 t1 t2 t3} { DELETE FROM t2; INSERT INTO t1 VALUES(1,2,3); BEGIN; - INSERT INTO t2 VALUES(1); + INSERT INTO t2 VALUES(1); $cmd INTO t1 VALUES(1,2,4); }]} r1] catch {execsql {COMMIT}} @@ -103,7 +103,7 @@ foreach {i cmd t0 t1 t2} { DELETE FROM t2; INSERT INTO t1 VALUES(1,2,3); BEGIN; - INSERT INTO t2 VALUES(1); + INSERT INTO t2 VALUES(1); $cmd INTO t1 VALUES(1,2,4); }]} r1] catch {execsql {COMMIT}} @@ -148,7 +148,7 @@ foreach {i cmd t0 t1 t2} { DELETE FROM t2; INSERT INTO t1 VALUES(1,2,3); BEGIN; - INSERT INTO t2 VALUES(1); + INSERT INTO t2 VALUES(1); $cmd INTO t1 VALUES(1,2,4); }]} r1] catch {execsql {COMMIT}} @@ -196,7 +196,7 @@ foreach {i conf1 cmd t0 t1 t2} { DELETE FROM t2; INSERT INTO t1 VALUES(1,2,3); BEGIN; - INSERT INTO t2 VALUES(1); + INSERT INTO t2 VALUES(1); $cmd INTO t1 VALUES(1,2,4); }]} r1] catch {execsql {COMMIT}} @@ -249,7 +249,7 @@ foreach {i conf1 cmd t0 t1 t2} { CREATE TABLE t1(a,b,c NOT NULL $conf1 DEFAULT 5); DELETE FROM t2; BEGIN; - INSERT INTO t2 VALUES(1); + INSERT INTO t2 VALUES(1); $cmd INTO t1 VALUES(1,2,NULL); }]} r1] catch {execsql {COMMIT}} @@ -321,7 +321,7 @@ foreach {i conf1 cmd t0 t1 t2 t3 t4} { } do_test conflict2-6.$i { db close - sqlite3 db test.db + sqlite3 db test.db if {$conf1!=""} {set conf1 "ON CONFLICT $conf1"} execsql {pragma temp_store=file} set ::sqlite_opentemp_count 0 @@ -666,13 +666,13 @@ do_test conflict2-11.1 { COMMIT; } - + # Set a small cache size so that changes will spill into - # the database file. + # the database file. execsql { PRAGMA cache_size = 10; } - + # Make lots of changes. Because of the small cache, some # (most?) of these changes will spill into the disk file. # In other words, some of the changes will not be held in @@ -822,12 +822,12 @@ do_test conflict2-13.2 { } {1 3} # Test for an unreleased bug in the REPLACE conflict resolution -# discovered on 2013-11-09. +# discovered on 2013-11-09. # do_execsql_test conflict2-14.1 { DROP TABLE IF EXISTS t1; CREATE TABLE t1( - x TEXT PRIMARY KEY NOT NULL, + x TEXT PRIMARY KEY NOT NULL, y TEXT NOT NULL, z INTEGER ); @@ -841,7 +841,7 @@ do_execsql_test conflict2-14.1 { do_execsql_test conflict2-14.2 { DROP TABLE IF EXISTS t1; CREATE TABLE t1( - x TEXT PRIMARY KEY NOT NULL, + x TEXT PRIMARY KEY NOT NULL, y TEXT NOT NULL, z INTEGER ) WITHOUT ROWID; diff --git a/third_party/sqlite/src/test/conflict3.test b/third_party/sqlite/src/test/conflict3.test index b51a55ee71b15..fada7aa2083d6 100644 --- a/third_party/sqlite/src/test/conflict3.test +++ b/third_party/sqlite/src/test/conflict3.test @@ -27,7 +27,7 @@ ifcapable !conflict { do_execsql_test conflict-1.1 { CREATE TABLE t1( - a INTEGER PRIMARY KEY ON CONFLICT REPLACE, + a INTEGER PRIMARY KEY ON CONFLICT REPLACE, b UNIQUE ON CONFLICT IGNORE, c UNIQUE ON CONFLICT FAIL ); @@ -57,7 +57,7 @@ do_execsql_test conflict-1.4 { do_execsql_test conflict-2.1 { DROP TABLE t1; CREATE TABLE t1( - a INT PRIMARY KEY ON CONFLICT REPLACE, + a INT PRIMARY KEY ON CONFLICT REPLACE, b UNIQUE ON CONFLICT IGNORE, c UNIQUE ON CONFLICT FAIL ); @@ -87,7 +87,7 @@ do_execsql_test conflict-2.4 { do_execsql_test conflict-3.1 { DROP TABLE t1; CREATE TABLE t1( - a INT PRIMARY KEY ON CONFLICT REPLACE, + a INT PRIMARY KEY ON CONFLICT REPLACE, b UNIQUE ON CONFLICT IGNORE, c UNIQUE ON CONFLICT FAIL ) WITHOUT ROWID; @@ -207,7 +207,7 @@ do_execsql_test conflict-6.4 { do_execsql_test conflict-7.1 { DROP TABLE t1; CREATE TABLE t1( - a UNIQUE ON CONFLICT REPLACE, + a UNIQUE ON CONFLICT REPLACE, b INTEGER PRIMARY KEY ON CONFLICT IGNORE, c UNIQUE ON CONFLICT FAIL ); @@ -237,7 +237,7 @@ do_execsql_test conflict-7.4 { do_execsql_test conflict-8.1 { DROP TABLE t1; CREATE TABLE t1( - a UNIQUE ON CONFLICT REPLACE, + a UNIQUE ON CONFLICT REPLACE, b INT PRIMARY KEY ON CONFLICT IGNORE, c UNIQUE ON CONFLICT FAIL ); @@ -267,7 +267,7 @@ do_execsql_test conflict-8.4 { do_execsql_test conflict-9.1 { DROP TABLE t1; CREATE TABLE t1( - a UNIQUE ON CONFLICT REPLACE, + a UNIQUE ON CONFLICT REPLACE, b INT PRIMARY KEY ON CONFLICT IGNORE, c UNIQUE ON CONFLICT FAIL ) WITHOUT ROWID; @@ -297,7 +297,7 @@ do_execsql_test conflict-9.4 { do_execsql_test conflict-10.1 { DROP TABLE t1; CREATE TABLE t1( - a UNIQUE ON CONFLICT REPLACE, + a UNIQUE ON CONFLICT REPLACE, b UNIQUE ON CONFLICT IGNORE, c INTEGER PRIMARY KEY ON CONFLICT FAIL ); @@ -327,7 +327,7 @@ do_execsql_test conflict-10.4 { do_execsql_test conflict-11.1 { DROP TABLE t1; CREATE TABLE t1( - a UNIQUE ON CONFLICT REPLACE, + a UNIQUE ON CONFLICT REPLACE, b UNIQUE ON CONFLICT IGNORE, c PRIMARY KEY ON CONFLICT FAIL ) WITHOUT ROWID; diff --git a/third_party/sqlite/src/test/contrib01.test b/third_party/sqlite/src/test/contrib01.test index 43ea47c3e464f..22e400ace97f3 100644 --- a/third_party/sqlite/src/test/contrib01.test +++ b/third_party/sqlite/src/test/contrib01.test @@ -13,7 +13,7 @@ # This file contains test cases that were contributed on the sqlite-users # mailing list on 2013-06-05 by Mi Chen at mi.chen@echostar.com. # -# At the time it was contributed, this test failed on trunk, but +# At the time it was contributed, this test failed on trunk, but # worked on the NGQP. set testdir [file dirname $argv0] @@ -31,12 +31,12 @@ do_test contrib01-1.0 { G INTEGER NOT NULL, H INTEGER NOT NULL, PRIMARY KEY (B, C, D)); - + CREATE TABLE T2 (A INTEGER NOT NULL, B INTEGER NOT NULL, C INTEGER NOT NULL, PRIMARY KEY (A, B, C)); - + INSERT INTO T2(A, B, C) VALUES(702118,16183,15527); INSERT INTO T2(A, B, C) VALUES(702118,16183,15560); INSERT INTO T2(A, B, C) VALUES(702118,16183,15561); @@ -50,7 +50,7 @@ do_test contrib01-1.0 { INSERT INTO T2(A, B, C) VALUES(702118,16183,15638); INSERT INTO T2(A, B, C) VALUES(702118,16183,15681); INSERT INTO T2(A, B, C) VALUES(702118,16183,15682); - + INSERT INTO T1(B, C, D, E, F, G, H) VALUES(16183,15527,6,0,5,5,0); INSERT INTO T1(B, C, D, E, F, G, H) VALUES(16183,15560,6,0,5,2,0); INSERT INTO T1(B, C, D, E, F, G, H) VALUES(16183,15561,6,0,5,2,0); diff --git a/third_party/sqlite/src/test/corrupt.test b/third_party/sqlite/src/test/corrupt.test index 3e49a9ff18972..7ce909ce6f79e 100644 --- a/third_party/sqlite/src/test/corrupt.test +++ b/third_party/sqlite/src/test/corrupt.test @@ -115,7 +115,7 @@ for {set i [expr {1*256}]} {$i<$fsize-256} {incr i 256} { db_leave db set stats(ref) } {0} -} +} #------------------------------------------------------------------------ # For these tests, swap the rootpage entries of t1 (a table) and t1i1 (an @@ -218,7 +218,7 @@ do_test corrupt-5.1 { do_test corrupt-5.2 { db close - hexio_write test.db 108 00000000 + hexio_write test.db 108 00000000 sqlite3 db test.db catchsql { SELECT * FROM sqlite_master } } {1 {database disk image is malformed}} @@ -230,7 +230,7 @@ do_test corrupt-6.1 { db close forcedelete test.db test.db-journal sqlite3 db test.db - execsql { + execsql { PRAGMA page_size = 1024; CREATE TABLE t1(x); } @@ -249,7 +249,7 @@ do_test corrupt-6.1 { set offset [expr ($rootpage * 1024)-14+2] hexio_write test.db $offset 00FF - sqlite3 db test.db + sqlite3 db test.db catchsql { INSERT INTO t1 VALUES( randomblob(10) ) } } {1 {database disk image is malformed}} @@ -258,7 +258,7 @@ ifcapable oversize_cell_check { db close forcedelete test.db test.db-journal sqlite3 db test.db - execsql { + execsql { PRAGMA page_size = 1024; CREATE TABLE t1(x); } @@ -270,11 +270,11 @@ ifcapable oversize_cell_check { } } {} db close - - # Corrupt the root page of table t1 so that the first offset in the + + # Corrupt the root page of table t1 so that the first offset in the # cell-offset array points to the data for the SQL blob associated with # record (rowid=10). The root page still passes the checks in btreeInitPage(), - # because the start of said blob looks like the start of a legitimate + # because the start of said blob looks like the start of a legitimate # page cell. # # Test case cc-2 overwrites the blob so that it no longer looks like a @@ -285,7 +285,7 @@ ifcapable oversize_cell_check { # to run. After copying the contents of the root page to the new child, # btreeInitPage() is called on the child. This time, it detects corruption # (because the start of the blob associated with the (rowid=10) record - # no longer looks like a real cell). At one point the code assumed that + # no longer looks like a real cell). At one point the code assumed that # detecting corruption was not possible at that point, and an assert() failed. # set fd [open test.db r+] @@ -293,11 +293,11 @@ ifcapable oversize_cell_check { seek $fd [expr 1024+8] puts -nonewline $fd "\x03\x14" close $fd - + sqlite3 db test.db do_test corrupt-7.2 { - execsql { - UPDATE t1 SET x = X'870400020003000400050006000700080009000A' + execsql { + UPDATE t1 SET x = X'870400020003000400050006000700080009000A' WHERE rowid = 10; } } {} diff --git a/third_party/sqlite/src/test/corrupt2.test b/third_party/sqlite/src/test/corrupt2.test index efeb26bc8a63a..671d7658a4f00 100644 --- a/third_party/sqlite/src/test/corrupt2.test +++ b/third_party/sqlite/src/test/corrupt2.test @@ -132,20 +132,20 @@ do_test corrupt2-2.1 { forcedelete corrupt.db-journal forcecopy test.db corrupt.db - sqlite3 db2 corrupt.db + sqlite3 db2 corrupt.db execsql " $::presql CREATE INDEX a1 ON abc(a); CREATE INDEX a2 ON abc(b); PRAGMA writable_schema = 1; - UPDATE sqlite_master + UPDATE sqlite_master SET name = 'a3', sql = 'CREATE INDEX a3' || substr(sql, 16, 10000) WHERE type = 'index'; PRAGMA writable_schema = 0; " db2 db2 close - sqlite3 db2 corrupt.db + sqlite3 db2 corrupt.db catchsql " $::presql SELECT * FROM sqlite_master; @@ -157,7 +157,7 @@ db2 close do_test corrupt2-3.1 { forcedelete corrupt.db forcedelete corrupt.db-journal - sqlite3 db2 corrupt.db + sqlite3 db2 corrupt.db execsql " $::presql @@ -185,10 +185,10 @@ do_test corrupt2-3.1 { set zCelloffset [read $fd 2] binary scan $zCelloffset S iCelloffset seek $fd [expr 1024*3 + $iCelloffset] - puts -nonewline $fd "\00\00\00\00" + puts -nonewline $fd "\00\00\00\00" close $fd - sqlite3 db2 corrupt.db + sqlite3 db2 corrupt.db catchsql " $::presql DROP TABLE t1; @@ -207,7 +207,7 @@ unset -nocomplain result do_test corrupt2-5.1 { forcedelete corrupt.db forcedelete corrupt.db-journal - sqlite3 db2 corrupt.db + sqlite3 db2 corrupt.db execsql " $::presql @@ -241,7 +241,7 @@ do_test corrupt2-5.1 { puts -nonewline $fd $zChildPage close $fd - sqlite3 db2 corrupt.db + sqlite3 db2 corrupt.db db2 eval $::presql db2 eval {SELECT rowid FROM t1} { set result [db2 eval {pragma integrity_check}] @@ -264,7 +264,7 @@ proc corruption_test {args} { forcedelete corrupt.db forcedelete corrupt.db-journal - sqlite3 db corrupt.db + sqlite3 db corrupt.db db eval $::presql eval $A(-tclprep) db eval $A(-sqlprep) @@ -279,14 +279,14 @@ proc corruption_test {args} { ifcapable autovacuum { # The tests within this block - corrupt2-6.* - aim to test corruption # detection within an incremental-vacuum. When an incremental-vacuum - # step is executed, the last non-free page of the database file is + # step is executed, the last non-free page of the database file is # moved into a free space in the body of the file. After doing so, # the page reference in the parent page must be updated to refer # to the new location. These tests test the outcome of corrupting # that page reference before performing the incremental vacuum. # - # The last page in the database page is the second page + # The last page in the database page is the second page # in an overflow chain. # corruption_test -sqlprep { @@ -362,8 +362,8 @@ ifcapable autovacuum { hexio_write corrupt.db 28 00000000 } -test { do_test corrupt2-6.4 { - catchsql " - $::presql + catchsql " + $::presql BEGIN EXCLUSIVE; COMMIT; " @@ -393,7 +393,7 @@ corruption_test -sqlprep $sqlprep -corrupt { # set fd [open corrupt.db r+] fconfigure $fd -translation binary -encoding binary - seek $fd [expr 1024*2 + 8] + seek $fd [expr 1024*2 + 8] set zRightChild [read $fd 4] binary scan $zRightChild I iRightChild seek $fd [expr 1024*($iRightChild-1)] @@ -411,7 +411,7 @@ corruption_test -sqlprep $sqlprep -corrupt { # set fd [open corrupt.db r+] fconfigure $fd -translation binary -encoding binary - seek $fd [expr 1024*2 + 12] + seek $fd [expr 1024*2 + 12] set zCellOffset [read $fd 2] binary scan $zCellOffset S iCellOffset seek $fd [expr 1024*2 + $iCellOffset] @@ -432,7 +432,7 @@ corruption_test -sqlprep $sqlprep -corrupt { # set fd [open corrupt.db r+] fconfigure $fd -translation binary -encoding binary - seek $fd [expr 1024*1 + 8] + seek $fd [expr 1024*1 + 8] set zRightChild [read $fd 4] binary scan $zRightChild I iRightChild seek $fd [expr 1024*($iRightChild-1)] @@ -500,7 +500,7 @@ corruption_test -sqlprep { DELETE FROM t1; } -corrupt { set offset [expr [file size corrupt.db] - 1024] - hexio_write corrupt.db $offset FF + hexio_write corrupt.db $offset FF hexio_write corrupt.db 24 12345678 } -test { do_test corrupt2-11.1 { @@ -521,7 +521,7 @@ corruption_test -sqlprep { DELETE FROM t1; } -corrupt { set pgno [expr [file size corrupt.db] / 1024] - hexio_write corrupt.db [expr 1024+5*($pgno-3)] 03 + hexio_write corrupt.db [expr 1024+5*($pgno-3)] 03 hexio_write corrupt.db 24 12345678 } -test { do_test corrupt2-12.1 { @@ -532,11 +532,11 @@ corruption_test -sqlprep { ifcapable autovacuum { # It is not possible for the last page in a database file to be the # pending-byte page (AKA the locking page). This test verifies that if - # an attempt is made to commit a transaction to such an auto-vacuum + # an attempt is made to commit a transaction to such an auto-vacuum # database SQLITE_CORRUPT is returned. # corruption_test -tclprep { - db eval { + db eval { PRAGMA auto_vacuum = full; PRAGMA page_size = 1024; CREATE TABLE t1(a INTEGER PRIMARY KEY, b); @@ -579,7 +579,7 @@ do_execsql_test 14.1 { PRAGMA freelist_count; } {ok 3} -# There are now 3 free pages. Modify the header-field so that it +# There are now 3 free pages. Modify the header-field so that it # (incorrectly) says that just 2 are free. do_test 14.2 { db close diff --git a/third_party/sqlite/src/test/corrupt5.test b/third_party/sqlite/src/test/corrupt5.test index 3f5099630e74f..09d236a783e6d 100644 --- a/third_party/sqlite/src/test/corrupt5.test +++ b/third_party/sqlite/src/test/corrupt5.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to make sure SQLite does not crash or -# segfault if it sees a corrupt database file. Checks for +# segfault if it sees a corrupt database file. Checks for # malformed schema. # # $Id: corrupt5.test,v 1.3 2009/06/04 02:47:04 shane Exp $ diff --git a/third_party/sqlite/src/test/corrupt7.test b/third_party/sqlite/src/test/corrupt7.test index aa66cc7ece633..e76047817fa03 100644 --- a/third_party/sqlite/src/test/corrupt7.test +++ b/third_party/sqlite/src/test/corrupt7.test @@ -78,7 +78,7 @@ do_test corrupt7-2.2 { db eval {PRAGMA integrity_check(1)} } {{*** in database main *** On tree page 2 cell 15: Offset 1201 out of range 945..1020}} - + # The code path that was causing the buffer overrun that this test # case was checking for was removed. # @@ -99,10 +99,10 @@ On tree page 2 cell 15: Offset 1201 out of range 945..1020}} # incr cell_offset 1 # # # This write corrupts the "header-size" field of the database record -# # stored in the index cell. At one point this was causing sqlite to +# # stored in the index cell. At one point this was causing sqlite to # # reference invalid memory. # hexio_write test.db $cell_offset FFFF7F -# +# # sqlite3 db test.db # catchsql { # SELECT b FROM t1 WHERE b > 'o' AND b < 'p'; diff --git a/third_party/sqlite/src/test/corrupt9.test b/third_party/sqlite/src/test/corrupt9.test index bb37758b17b48..0ebc73879020e 100644 --- a/third_party/sqlite/src/test/corrupt9.test +++ b/third_party/sqlite/src/test/corrupt9.test @@ -135,6 +135,6 @@ do_test corrupt9-4.2 { REINDEX; } } {1 {database disk image is malformed}} - + finish_test diff --git a/third_party/sqlite/src/test/corruptA.test b/third_party/sqlite/src/test/corruptA.test index bb9912bd2bc25..f8efcb2bc3fbe 100644 --- a/third_party/sqlite/src/test/corruptA.test +++ b/third_party/sqlite/src/test/corruptA.test @@ -52,32 +52,32 @@ do_test corruptA-2.1 { forcecopy test.db-template test.db hexio_write test.db 19 $unreadable_version ;# the read format number sqlite3 db test.db - catchsql {SELECT * FROM t1} + catchsql {SELECT * FROM t1} } {1 {file is encrypted or is not a database}} - + do_test corruptA-2.2 { db close forcecopy test.db-template test.db hexio_write test.db 21 41 ;# max embedded payload fraction sqlite3 db test.db - catchsql {SELECT * FROM t1} + catchsql {SELECT * FROM t1} } {1 {file is encrypted or is not a database}} - + do_test corruptA-2.3 { db close forcecopy test.db-template test.db hexio_write test.db 22 1f ;# min embedded payload fraction sqlite3 db test.db - catchsql {SELECT * FROM t1} + catchsql {SELECT * FROM t1} } {1 {file is encrypted or is not a database}} - + do_test corruptA-2.4 { db close forcecopy test.db-template test.db hexio_write test.db 23 21 ;# min leaf payload fraction sqlite3 db test.db - catchsql {SELECT * FROM t1} + catchsql {SELECT * FROM t1} } {1 {file is encrypted or is not a database}} - + finish_test diff --git a/third_party/sqlite/src/test/corruptB.test b/third_party/sqlite/src/test/corruptB.test index c51cb5768026d..c926918fb9f65 100644 --- a/third_party/sqlite/src/test/corruptB.test +++ b/third_party/sqlite/src/test/corruptB.test @@ -64,7 +64,7 @@ do_test corruptB-1.3.2 { catchsql { SELECT * FROM t1 } } {1 {database disk image is malformed}} -# Set the left-child of a cell in a B-Tree rootpage to refer to the +# Set the left-child of a cell in a B-Tree rootpage to refer to the # root-page itself. # do_test corruptB-1.4.1 { diff --git a/third_party/sqlite/src/test/corruptC.test b/third_party/sqlite/src/test/corruptC.test index f404e4fb5b035..8c7f2e607e3c0 100644 --- a/third_party/sqlite/src/test/corruptC.test +++ b/third_party/sqlite/src/test/corruptC.test @@ -12,7 +12,7 @@ # # This file implements tests to make sure SQLite does not crash or # segfault if it sees a corrupt database file. It creates a base -# data base file, then tests that single byte corruptions in +# data base file, then tests that single byte corruptions in # increasingly larger quantities are handled gracefully. # # $Id: corruptC.test,v 1.14 2009/07/11 06:55:34 danielk1977 Exp $ @@ -69,10 +69,10 @@ forcecopy test.db test.bu sqlite3 db test.db set fsize [file size test.db] -# Set a quasi-random random seed. +# Set a quasi-random random seed. if {[info exists ::G(issoak)]} { # If we are doing SOAK tests, we want a different - # random seed for each run. Ideally we would like + # random seed for each run. Ideally we would like # to use [clock clicks] or something like that here. set qseed [file mtime test.db] } else { @@ -240,7 +240,7 @@ do_test corruptC-2.10 { # insert corrupt byte(s) hexio_write test.db 3130 [format %02x 0x02] - + sqlite3 db test.db catchsql {BEGIN; UPDATE t2 SET y='abcdef-uvwxyz'; ROLLBACK;} } {1 {database disk image is malformed}} @@ -252,7 +252,7 @@ do_test corruptC-2.11 { # insert corrupt byte(s) hexio_write test.db 55 [format %02x 0xa7] - + sqlite3 db test.db catchsql {BEGIN; CREATE TABLE t3 AS SELECT x,3 as y FROM t2 WHERE rowid%5!=0; ROLLBACK;} } {1 {database disk image is malformed}} @@ -264,7 +264,7 @@ do_test corruptC-2.12 { # insert corrupt byte(s) hexio_write test.db 974 [format %02x 0x2e] - + sqlite3 db test.db catchsql {SELECT count(*) FROM sqlite_master;} } {1 {malformed database schema (t1i1) - corrupt database}} @@ -276,7 +276,7 @@ do_test corruptC-2.13 { # insert corrupt byte(s) hexio_write test.db 102 [format %02x 0x12] - + sqlite3 db test.db catchsql {BEGIN; CREATE TABLE t3 AS SELECT x,3 as y FROM t2 WHERE rowid%5!=0; ROLLBACK;} } {1 {database disk image is malformed}} @@ -327,17 +327,17 @@ for {set tn 0} {$tn<$fsize} {incr tn 1} { db close if {$i==1} { # on the first corrupt value, use location $tn - # this ensures that we touch each location in the + # this ensures that we touch each location in the # file at least once. set roffset $tn - } else { + } else { # insert random byte at random location set roffset [random $fsize] } set rbyte [format %02x [random 255]] # You can uncomment the following to have it trace - # exactly how it's corrupting the file. This is + # exactly how it's corrupting the file. This is # useful for generating the "seed specific" tests # above. # set rline "$roffset $rbyte" @@ -346,7 +346,7 @@ for {set tn 0} {$tn<$fsize} {incr tn 1} { hexio_write test.db $roffset $rbyte sqlite3 db test.db - # do a few random operations to make sure that if + # do a few random operations to make sure that if # they error, they error gracefully instead of crashing. do_test corruptC-3.$tn.($qseed).$i.1 { catchsql {SELECT count(*) FROM sqlite_master} diff --git a/third_party/sqlite/src/test/corruptD.test b/third_party/sqlite/src/test/corruptD.test index 63474584c3f9a..90c29f6a8f173 100644 --- a/third_party/sqlite/src/test/corruptD.test +++ b/third_party/sqlite/src/test/corruptD.test @@ -26,14 +26,14 @@ database_may_be_corrupt #-------------------------------------------------------------------------- # OVERVIEW # -# This test file attempts to verify that SQLite does not read past the -# end of any in-memory buffers as a result of corrupted database page +# This test file attempts to verify that SQLite does not read past the +# end of any in-memory buffers as a result of corrupted database page # images. Usually this happens because a field within a database page # that contains an offset to some other structure within the same page # is set to too large a value. A database page contains the following # such fields: # -# 1. The page header field that contains the offset to the first +# 1. The page header field that contains the offset to the first # free block of space. # # 2. The first two bytes of all but the last free block on the free-block @@ -62,11 +62,11 @@ database_may_be_corrupt # (or similar) in order to verify that no overreads occur. # # TEST PLAN -# +# # Test cases corruptD-1.* are white-box tests. They attempt to corrupt # one of the above fields, then exercise each part of the code in btree.c # that uses said field. -# +# # Offset variables 1, 2, 3 and 4 are all checked to make sure they # will not result in buffer overruns as part of page initialization in # sqlite3BtreeInitPage(). Offsets 5 and 6 cannot be tested as part of @@ -74,7 +74,7 @@ database_may_be_corrupt # do_test corruptD-1.0 { - execsql { + execsql { PRAGMA auto_vacuum = 0; PRAGMA page_size = 1024; CREATE TABLE t1(a, b); @@ -106,7 +106,7 @@ proc restore_file {} { #------------------------------------------------------------------------- # The following tests, corruptD-1.1.*, focus on the page header field -# containing the offset of the first free block in a page. +# containing the offset of the first free block in a page. # do_test corruptD-1.1.1 { incr_change_counter @@ -137,7 +137,7 @@ do_test corruptD-1.2.2 { #------------------------------------------------------------------------- # The following tests, corruptD-1.5.*, focus on the offsets contained # in the cell offset array. -# +# # defragmentPage # diff --git a/third_party/sqlite/src/test/corruptF.test b/third_party/sqlite/src/test/corruptF.test index 8c4fd84219365..67ad3a6670fa0 100644 --- a/third_party/sqlite/src/test/corruptF.test +++ b/third_party/sqlite/src/test/corruptF.test @@ -25,8 +25,8 @@ database_may_be_corrupt proc str {i} { format %08d $i } -# Create a 6 page database containing a single table - t1. Table t1 -# consists of page 2 (the root page) and pages 5 and 6 (leaf pages). +# Create a 6 page database containing a single table - t1. Table t1 +# consists of page 2 (the root page) and pages 5 and 6 (leaf pages). # Database pages 3 and 4 are on the free list. # proc create_test_db {} { @@ -65,19 +65,19 @@ do_test 1.3 { hexio_read test.db 32 4 } 00000003 do_test 1.4 { hexio_read test.db [expr 2*1024] 12 } 000000000000000100000004 # Change the free-list entry to page 6 and reopen the db file. -do_test 1.5 { - hexio_write test.db [expr 2*1024 + 8] 00000006 +do_test 1.5 { + hexio_write test.db [expr 2*1024 + 8] 00000006 sqlite3 db test.db } {} # Now create a new table in the database file. The root of the new table # is page 6, which is also the right-most leaf page in table t1. # -do_execsql_test 1.6 { +do_execsql_test 1.6 { CREATE TABLE t4(x); SELECT * FROM sqlite_master; } { - table t1 t1 2 {CREATE TABLE t1(x)} + table t1 t1 2 {CREATE TABLE t1(x)} table t4 t4 6 {CREATE TABLE t4(x)} } @@ -100,7 +100,7 @@ db_save_and_close if 1 { for {set i 0} {$i < 128} {incr i} { db_restore_and_reopen - do_test 1.7.$i { + do_test 1.7.$i { set res [ catchsql { INSERT INTO t4 SELECT x FROM t1 WHERE rowid>$i } ] @@ -118,29 +118,29 @@ do_test 2.3 { hexio_read test.db 32 4 } 00000003 do_test 2.4 { hexio_read test.db [expr 2*1024] 12 } 000000000000000100000004 # Change the free-list entry to page 5 and reopen the db file. -do_test 2.5 { - hexio_write test.db [expr 2*1024 + 8] 00000005 +do_test 2.5 { + hexio_write test.db [expr 2*1024 + 8] 00000005 sqlite3 db test.db } {} # Now create a new table in the database file. The root of the new table # is page 5, which is also the right-most leaf page in table t1. # -do_execsql_test 2.6 { +do_execsql_test 2.6 { CREATE TABLE t4(x); SELECT * FROM sqlite_master; } { - table t1 t1 2 {CREATE TABLE t1(x)} + table t1 t1 2 {CREATE TABLE t1(x)} table t4 t4 5 {CREATE TABLE t4(x)} } db_save_and_close for {set i 127} {$i >= 0} {incr i -1} { db_restore_and_reopen - do_test 2.7.$i { + do_test 2.7.$i { set res [ - catchsql { - INSERT INTO t4 SELECT x FROM t1 WHERE rowid<$i ORDER BY rowid DESC + catchsql { + INSERT INTO t4 SELECT x FROM t1 WHERE rowid<$i ORDER BY rowid DESC } ] if {$res == "0 {}" || $res == "1 {database disk image is malformed}"} { diff --git a/third_party/sqlite/src/test/corruptH.test b/third_party/sqlite/src/test/corruptH.test index 9ba7522422be7..3d9046689a6e8 100644 --- a/third_party/sqlite/src/test/corruptH.test +++ b/third_party/sqlite/src/test/corruptH.test @@ -24,8 +24,8 @@ database_may_be_corrupt # mmap mode. # # The reason is that in mmap mode, the different queries may use different -# PgHdr objects for the same page (same data, but different PgHdr container -# objects). And so the corruption is not detected. +# PgHdr objects for the same page (same data, but different PgHdr container +# objects). And so the corruption is not detected. # if {[permutation]=="mmap"} { finish_test @@ -55,8 +55,8 @@ do_execsql_test 1.1 { # a leaf page. # do_test 1.2 { - db eval { SELECT name, rootpage FROM sqlite_master } { - set r($name) $rootpage + db eval { SELECT name, rootpage FROM sqlite_master } { + set r($name) $rootpage } db close hexio_write test.db [expr {($r(t2)-1)*1024 + 11}] [format %.2X $r(t1)] @@ -94,14 +94,14 @@ do_execsql_test 2.1 { } {} do_test 2.2 { - db eval { SELECT name, rootpage FROM sqlite_master } { - set r($name) $rootpage + db eval { SELECT name, rootpage FROM sqlite_master } { + set r($name) $rootpage } db close set fl [hexio_get_int [hexio_read test.db 32 4]] - hexio_write test.db [expr {($fl-1) * 1024 + 0}] 00000000 - hexio_write test.db [expr {($fl-1) * 1024 + 4}] 00000001 + hexio_write test.db [expr {($fl-1) * 1024 + 0}] 00000000 + hexio_write test.db [expr {($fl-1) * 1024 + 4}] 00000001 hexio_write test.db [expr {($fl-1) * 1024 + 8}] [format %.8X $r(t1)] hexio_write test.db 36 00000002 @@ -109,21 +109,21 @@ do_test 2.2 { } {} -# The trick here is that the root page of the tree scanned by the outer +# The trick here is that the root page of the tree scanned by the outer # query is also currently on the free-list. So while the first seek on -# the table (for a==1) works, by the time the second is attempted The +# the table (for a==1) works, by the time the second is attempted The # "INSERT INTO t2..." statements have recycled the root page of t1 and # used it as an index leaf. Normally, BtreeMovetoUnpacked() detects # that the PgHdr object associated with said root page does not match # the cursor (as it is now marked with PgHdr.intKey==0) and returns -# SQLITE_CORRUPT. +# SQLITE_CORRUPT. # set res23 {1 {database disk image is malformed}} do_test 2.3 { list [catch { set res [list] db eval { SELECT * FROM t1 WHERE a IN (1, 2) } { - db eval { + db eval { INSERT INTO t2 SELECT randomblob(100) FROM t2; INSERT INTO t2 SELECT randomblob(100) FROM t2; INSERT INTO t2 SELECT randomblob(100) FROM t2; @@ -153,8 +153,8 @@ do_execsql_test 3.1 { } {} do_test 3.2 { - db eval { SELECT name, rootpage FROM sqlite_master } { - set r($name) $rootpage + db eval { SELECT name, rootpage FROM sqlite_master } { + set r($name) $rootpage } db close @@ -166,7 +166,7 @@ do_test 3.2 { do_test 3.3 { list [catch { db eval { SELECT * FROM t1 WHERE a IN (1, 2) } { - db eval { + db eval { DELETE FROM t2 WHERE c=1; } } diff --git a/third_party/sqlite/src/test/corruptI.test b/third_party/sqlite/src/test/corruptI.test index cdcb94201e1d9..1126696900a58 100644 --- a/third_party/sqlite/src/test/corruptI.test +++ b/third_party/sqlite/src/test/corruptI.test @@ -90,7 +90,7 @@ if {[db one {SELECT sqlite_compileoption_used('ENABLE_OVERSIZE_CELL_CHECK')}]} { ) INSERT INTO t1 SELECT * FROM s; } {} - + do_test 3.2 { hexio_write test.db [expr 512+3] 0054 db close @@ -98,7 +98,7 @@ if {[db one {SELECT sqlite_compileoption_used('ENABLE_OVERSIZE_CELL_CHECK')}]} { execsql { INSERT INTO t1 VALUES(5, 'klmnopqrst') } execsql { INSERT INTO t1 VALUES(7, 'klmnopqrst') } } {} - + db close sqlite3 db test.db do_catchsql_test 3.3 { @@ -169,11 +169,11 @@ do_test 5.0 { } } {} -do_execsql_test 5.1 { - PRAGMA page_count +do_execsql_test 5.1 { + PRAGMA page_count } [expr $nPage+1] -do_test 5.2 { +do_test 5.2 { # The last page of the db is now the only leaf of the sqlite_master table. # Corrupt the db by adding it to the free-list as well (the second last # page of the db is the free-list trunk). @@ -211,7 +211,7 @@ do_test 6.1 { #------------------------------------------------------------------------- # See what happens if the sqlite_master entry associated with a PRIMARY -# KEY or UNIQUE index is removed. +# KEY or UNIQUE index is removed. # reset_db do_execsql_test 7.0 { diff --git a/third_party/sqlite/src/test/cost.test b/third_party/sqlite/src/test/cost.test index 9c10d821d927c..b938a45af31d3 100644 --- a/third_party/sqlite/src/test/cost.test +++ b/third_party/sqlite/src/test/cost.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -24,7 +24,7 @@ do_execsql_test 1.1 { do_eqp_test 1.2 { SELECT e FROM t3, t4 WHERE b=c ORDER BY b, d; } { - 0 0 0 {SCAN TABLE t3 USING COVERING INDEX i3} + 0 0 0 {SCAN TABLE t3 USING COVERING INDEX i3} 0 1 1 {SEARCH TABLE t4 USING INDEX i4 (c=?)} } @@ -34,7 +34,7 @@ do_execsql_test 2.1 { CREATE INDEX i1 ON t1(a); } -# It is better to use an index for ORDER BY than sort externally, even +# It is better to use an index for ORDER BY than sort externally, even # if the index is a non-covering index. do_eqp_test 2.2 { SELECT * FROM t1 ORDER BY a; @@ -53,13 +53,13 @@ do_execsql_test 3.1 { } do_eqp_test 3.2 { - SELECT a FROM t5 - WHERE b IS NULL OR c IS NULL OR d IS NULL + SELECT a FROM t5 + WHERE b IS NULL OR c IS NULL OR d IS NULL ORDER BY a; } { - 0 0 0 {SEARCH TABLE t5 USING INDEX t5b (b=?)} - 0 0 0 {SEARCH TABLE t5 USING INDEX t5c (c=?)} - 0 0 0 {SEARCH TABLE t5 USING INDEX t5d (d=?)} + 0 0 0 {SEARCH TABLE t5 USING INDEX t5b (b=?)} + 0 0 0 {SEARCH TABLE t5 USING INDEX t5c (c=?)} + 0 0 0 {SEARCH TABLE t5 USING INDEX t5d (d=?)} 0 0 0 {USE TEMP B-TREE FOR ORDER BY} } @@ -100,14 +100,14 @@ do_execsql_test 5.1 { do_eqp_test 5.2 { SELECT * FROM t2 ORDER BY x, y; } { - 0 0 0 {SCAN TABLE t2 USING INDEX t2i1} + 0 0 0 {SCAN TABLE t2 USING INDEX t2i1} 0 0 0 {USE TEMP B-TREE FOR RIGHT PART OF ORDER BY} } do_eqp_test 5.3 { SELECT * FROM t2 WHERE x BETWEEN ? AND ? ORDER BY rowid; } { - 0 0 0 {SEARCH TABLE t2 USING INDEX t2i1 (x>? AND x? AND x? AND b? AND b=950 AND b<=1010) OR (b IS NULL AND c NOT NULL) ORDER BY a } { - 0 0 0 {SEARCH TABLE t1 USING INDEX t1b (b>? AND b? AND b 450 } {1} - + set fin 0 for {set i 1} {$i<$repeats} {incr i} { set seed [expr {int(abs(rand()*10000))}] @@ -254,7 +254,7 @@ ifcapable attach { do_test crash-4.1.$i.3 { signature2 } $sig2 - } + } set i 0 set fin 0 while {[incr i]} { @@ -286,7 +286,7 @@ ifcapable attach { do_test crash-4.2.$i.3 { signature2 } $sig2 - } + } for {set i 1} {$i < 5} {incr i} { set sig [signature] set sig2 [signature2] @@ -337,7 +337,7 @@ do_test crash-5.3 { # The SQL below is used to expose a bug that existed in # sqlite3pager_movepage() during development of the auto-vacuum feature. It # functions as follows: -# +# # 1: Begin a transaction. # 2: Put page 4 on the free-list (was the overflow page for the row deleted). # 3: Write data to page 4 (it becomes the overflow page for the row inserted). @@ -385,7 +385,7 @@ do_test crash-6.2 { } $sig #-------------------------------------------------------------------------- -# These test cases test the case where the master journal file name is +# These test cases test the case where the master journal file name is # corrupted slightly so that the corruption has to be detected by the # checksum. do_test crash-7.1 { diff --git a/third_party/sqlite/src/test/crash2.test b/third_party/sqlite/src/test/crash2.test index c74f6c2ffa27c..7674d4cbe58ce 100644 --- a/third_party/sqlite/src/test/crash2.test +++ b/third_party/sqlite/src/test/crash2.test @@ -105,7 +105,7 @@ for {set i 1} {$i < 30} {incr i} { sqlite3 db test.db signature } $sig -} +} # Test case for crashing during database sync with simulated @@ -128,6 +128,6 @@ for {set i 1} {$i < 10} {incr i} { sqlite3 db test.db signature } $sig -} +} finish_test diff --git a/third_party/sqlite/src/test/crash3.test b/third_party/sqlite/src/test/crash3.test index 7958af992ed76..499b8d01ae66c 100644 --- a/third_party/sqlite/src/test/crash3.test +++ b/third_party/sqlite/src/test/crash3.test @@ -10,7 +10,7 @@ #*********************************************************************** # # This file contains tests that verify that SQLite can correctly rollback -# databases after crashes when using the special IO modes triggered +# databases after crashes when using the special IO modes triggered # by device IOCAP flags. # # $Id: crash3.test,v 1.4 2008/07/12 14:52:20 drh Exp $ @@ -50,7 +50,7 @@ proc do_test2 {name tcl res1 res2} { # the first sync() of either the database file or the journal file (often # the journal file is not required - meaning no crash occurs). # -# After the crash (or absence of a crash), open the database and +# After the crash (or absence of a crash), open the database and # verify that: # # * The integrity check passes, and @@ -58,7 +58,7 @@ proc do_test2 {name tcl res1 res2} { # to the right of the SQL statement below. # # The procedure is repeated 10 times for each SQL statement. Five times -# with the crash scheduled for midway through the first journal sync (if +# with the crash scheduled for midway through the first journal sync (if # any), and five times with the crash midway through the database sync. # set tn 1 @@ -85,7 +85,7 @@ foreach {sql res2} [list \ } } {} db close - + set crashfile test.db if {($ii%2)==0} { append crashfile -journal } set rand "SELECT randstr($tn,$tn);" @@ -94,7 +94,7 @@ foreach {sql res2} [list \ sqlite3 db test.db execsql { PRAGMA integrity_check; } }] {ok} - + do_test2 crash3-1.$tn.3 { execsql { SELECT * FROM abc } } {1 2 3} $res2 @@ -115,17 +115,17 @@ do_test crash3-2.0 { CREATE TABLE def(d PRIMARY KEY, e, f); PRAGMA default_cache_size = 10; INSERT INTO abc VALUES(randstr(10,1000),randstr(10,1000),randstr(10,1000)); - INSERT INTO abc + INSERT INTO abc SELECT randstr(10,1000),randstr(10,1000),randstr(10,1000) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randstr(10,1000),randstr(10,1000),randstr(10,1000) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randstr(10,1000),randstr(10,1000),randstr(10,1000) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randstr(10,1000),randstr(10,1000),randstr(10,1000) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randstr(10,1000),randstr(10,1000),randstr(10,1000) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randstr(10,1000),randstr(10,1000),randstr(10,1000) FROM abc; COMMIT; } @@ -147,13 +147,13 @@ foreach {::crashfile ::delay ::char} { SELECT randstr($ii,$ii+10); BEGIN; DELETE FROM abc WHERE random()%5; - INSERT INTO abc - SELECT randstr(10,1000),randstr(10,1000),randstr(10,1000) + INSERT INTO abc + SELECT randstr(10,1000),randstr(10,1000),randstr(10,1000) FROM abc WHERE (random()%5)==0; DELETE FROM def WHERE random()%5; - INSERT INTO def - SELECT randstr(10,1000),randstr(10,1000),randstr(10,1000) + INSERT INTO def + SELECT randstr(10,1000),randstr(10,1000),randstr(10,1000) FROM def WHERE (random()%5)==0; COMMIT; @@ -171,7 +171,7 @@ foreach {::crashfile ::delay ::char} { # The following block tests an interaction between IOCAP_ATOMIC and # IOCAP_SEQUENTIAL. At one point, if both flags were set, small -# journal files that contained only a single page, but were required +# journal files that contained only a single page, but were required # for some other reason (i.e. nTrunk) were not being written to # disk. # diff --git a/third_party/sqlite/src/test/crash4.test b/third_party/sqlite/src/test/crash4.test index f68caecdef3ee..06cc492c5071b 100644 --- a/third_party/sqlite/src/test/crash4.test +++ b/third_party/sqlite/src/test/crash4.test @@ -55,7 +55,7 @@ foreach cmd $sql_cmd_list { # Run the sequence of SQL statements shown above repeatedly. # Close and reopen the database right before the UPDATE statement. # On each repetition, introduce database corruption typical of -# what might be seen in a power loss or OS crash. +# what might be seen in a power loss or OS crash. # # Slowly increase the delay before the crash, repeating the test # over and over. Stop testing when the entire sequence of SQL diff --git a/third_party/sqlite/src/test/crash5.test b/third_party/sqlite/src/test/crash5.test index 83d1647a84696..4027a4e79cb47 100644 --- a/third_party/sqlite/src/test/crash5.test +++ b/third_party/sqlite/src/test/crash5.test @@ -9,7 +9,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This file tests aspects of recovery from a malloc() failure # in a CREATE INDEX statement. # @@ -31,8 +31,8 @@ db close for {set ii 0} {$ii < 10} {incr ii} { for {set jj 50} {$jj < 100} {incr jj} { - # Set up the database so that it is an auto-vacuum database - # containing a single table (root page 3) with a single row. + # Set up the database so that it is an auto-vacuum database + # containing a single table (root page 3) with a single row. # The row has an overflow page (page 4). forcedelete test.db test.db-journal sqlite3 db test.db @@ -48,13 +48,13 @@ for {set ii 0} {$ii < 10} {incr ii} { crashsql -delay 1 -file test.db-journal -seed $ii -tclbody [join [list \ [list set iFail $jj] { sqlite3_crashparams 0 [file join [get_pwd] test.db-journal] - + # Begin a transaction and evaluate a "CREATE INDEX" statement # with the iFail'th malloc() set to fail. This operation will # have to move the current contents of page 4 (the overflow # page) to make room for the new root page. The bug is that # if malloc() fails at a particular point in sqlite3PagerMovepage(), - # sqlite mistakenly thinks that the page being moved (page 4) has + # sqlite mistakenly thinks that the page being moved (page 4) has # been safely synced into the journal. If the page is written # to later in the transaction, it may be written out to the database # before the relevant part of the journal has been synced. @@ -63,7 +63,7 @@ for {set ii 0} {$ii < 10} {incr ii} { sqlite3_memdebug_fail $iFail -repeat 0 catch {db eval { CREATE UNIQUE INDEX i1 ON t1(a); }} msg # puts "$n $msg ac=[sqlite3_get_autocommit db]" - + # If the transaction is still active (it may not be if the malloc() # failure occurred in the OS layer), write to the database. Make sure # page 4 is among those written. @@ -80,11 +80,11 @@ for {set ii 0} {$ii < 10} {incr ii} { INSERT INTO t1 SELECT * FROM t1 WHERE rowid%2; -- 48 } } - + # If the right malloc() failed during the 'CREATE INDEX' above and - # the transaction was not rolled back, then the sqlite cache now + # the transaction was not rolled back, then the sqlite cache now # has a dirty page 4 that it incorrectly believes is already safely - # in the synced part of the journal file. When + # in the synced part of the journal file. When # sqlite3_release_memory() is called sqlite tries to free memory # by writing page 4 out to the db file. If it crashes later on, # before syncing the journal... Corruption! @@ -94,7 +94,7 @@ for {set ii 0} {$ii < 10} {incr ii} { }]] {} expr 1 } {1} - + sqlite3 db test.db do_test crash5-$ii.$jj.2 { db eval {pragma integrity_check} diff --git a/third_party/sqlite/src/test/crash6.test b/third_party/sqlite/src/test/crash6.test index 69c19464b3f4a..0a0bffc3a0b56 100644 --- a/third_party/sqlite/src/test/crash6.test +++ b/third_party/sqlite/src/test/crash6.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file tests that rollback journals for databases that use a +# This file tests that rollback journals for databases that use a # page-size other than the default page-size can be rolled back Ok. # # $Id: crash6.test,v 1.2 2008/04/14 15:27:19 drh Exp $ @@ -61,7 +61,7 @@ proc signature {} { return [db eval {SELECT count(*), md5sum(a), md5sum(b), md5sum(c) FROM abc}] } -# Test case for crashing during database sync with page-size values +# Test case for crashing during database sync with page-size values # from 1024 to 8192. # for {set ii 0} {$ii < 30} {incr ii} { @@ -79,7 +79,7 @@ for {set ii 0} {$ii < 30} {incr ii} { } $pagesize do_test crash6-3.$ii.1 { - + execsql BEGIN execsql {CREATE TABLE abc(a, b, c)} for {set n 0} {$n < 1000} {incr n} { @@ -113,6 +113,6 @@ for {set ii 0} {$ii < 30} {incr ii} { sqlite3 db test.db signature } $sig -} +} finish_test diff --git a/third_party/sqlite/src/test/crash7.test b/third_party/sqlite/src/test/crash7.test index 482999cbfd957..3ac221dc0493b 100644 --- a/third_party/sqlite/src/test/crash7.test +++ b/third_party/sqlite/src/test/crash7.test @@ -29,55 +29,55 @@ foreach f [list test.db test.db-journal] { db close delete_file test.db sqlite3 db test.db - + set from_size [expr 1024 << ($ii&3)] set to_size [expr 1024 << (($ii>>2)&3)] - + execsql " PRAGMA page_size = $from_size; BEGIN; CREATE TABLE abc(a PRIMARY KEY, b, c); INSERT INTO abc VALUES(randomblob(100), randomblob(200), randomblob(1000)); - INSERT INTO abc + INSERT INTO abc SELECT randomblob(1000), randomblob(200), randomblob(100) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randomblob(100), randomblob(200), randomblob(1000) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randomblob(100), randomblob(200), randomblob(1000) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randomblob(100), randomblob(200), randomblob(1000) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randomblob(100), randomblob(200), randomblob(1000) FROM abc WHERE [expr $ii&16]; - INSERT INTO abc + INSERT INTO abc SELECT randomblob(25), randomblob(45), randomblob(9456) FROM abc WHERE [expr $ii&32]; - INSERT INTO abc + INSERT INTO abc SELECT randomblob(100), randomblob(200), randomblob(1000) FROM abc WHERE [expr $ii&8]; - INSERT INTO abc + INSERT INTO abc SELECT randomblob(25), randomblob(45), randomblob(9456) FROM abc WHERE [expr $ii&4]; COMMIT; " - + set sig [signature] db close - + do_test crash7-1.$ii.crash { crashsql -file $f " PRAGMA page_size = $to_size; VACUUM; " } {1 {child process exited abnormally}} - + sqlite3 db test.db integrity_check crash7-1.$ii.integrity - } + } } db close diff --git a/third_party/sqlite/src/test/crash8.test b/third_party/sqlite/src/test/crash8.test index f3b6f6e244f34..bd60474943712 100644 --- a/third_party/sqlite/src/test/crash8.test +++ b/third_party/sqlite/src/test/crash8.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This test verifies a couple of specific potential data corruption +# This test verifies a couple of specific potential data corruption # scenarios involving crashes or power failures. # # Later: Also, some other specific scenarios required for coverage @@ -52,14 +52,14 @@ do_test crash8-1.1 { } {ok} -# Potential corruption scenario 1. A second process opens the database +# Potential corruption scenario 1. A second process opens the database # and modifies a large portion of it. It then opens a second transaction # and modifies a small part of the database, but crashes before it commits -# the transaction. +# the transaction. # # When the first process accessed the database again, it was rolling back # the aborted transaction, but was not purging its in-memory cache (which -# was loaded before the second process made its first, successful, +# was loaded before the second process made its first, successful, # modification). Producing an inconsistent cache. # do_test crash8-1.2 { @@ -78,7 +78,7 @@ do_test crash8-1.3 { # with a small in-memory cache. Such that more than one journal-header # was written to the file. It then opens a second transaction and makes # a smaller change that requires only a single journal-header to be -# written to the journal file. The second change is such that the +# written to the journal file. The second change is such that the # journal content written to the persistent journal file exactly overwrites # the first journal-header and set of subsequent records written by the # first, successful, change. The second process crashes before it can @@ -115,14 +115,14 @@ do_test crash8-2.3 { proc read_file {zFile} { set fd [open $zFile] - fconfigure $fd -translation binary + fconfigure $fd -translation binary set zData [read $fd] close $fd return $zData } proc write_file {zFile zData} { set fd [open $zFile w] - fconfigure $fd -translation binary + fconfigure $fd -translation binary puts -nonewline $fd $zData close $fd } @@ -130,14 +130,14 @@ proc write_file {zFile zData} { # The following tests check that SQLite will not roll back a hot-journal # file if the sector-size field in the first journal file header is # suspect. Definition of suspect: -# +# # a) Not a power of 2, or (crash8-3.5) # b) Greater than 0x01000000 (16MB), or (crash8-3.6) # c) Less than 512. (crash8-3.7) # # Also test that SQLite will not rollback a hot-journal file with a # suspect page-size. In this case "suspect" means: -# +# # a) Not a power of 2, or # b) Less than 512, or # c) Greater than SQLITE_MAX_PAGE_SIZE @@ -155,7 +155,7 @@ do_test crash8-3.2 { } {0} do_test crash8-3.3 { set zJournal [read_file test.db-journal] - execsql { + execsql { COMMIT; SELECT count(*) FROM t1; } @@ -169,7 +169,7 @@ do_test crash8-3.5 { set zJournal2 [string replace $zJournal 20 23 [binary format I 513]] write_file test.db-journal $zJournal2 - execsql { + execsql { SELECT count(*) FROM t1; PRAGMA integrity_check } @@ -177,7 +177,7 @@ do_test crash8-3.5 { do_test crash8-3.6 { set zJournal2 [string replace $zJournal 20 23 [binary format I 0x2000000]] write_file test.db-journal $zJournal2 - execsql { + execsql { SELECT count(*) FROM t1; PRAGMA integrity_check } @@ -185,7 +185,7 @@ do_test crash8-3.6 { do_test crash8-3.7 { set zJournal2 [string replace $zJournal 20 23 [binary format I 256]] write_file test.db-journal $zJournal2 - execsql { + execsql { SELECT count(*) FROM t1; PRAGMA integrity_check } @@ -195,7 +195,7 @@ do_test crash8-3.8 { set zJournal2 [string replace $zJournal 24 27 [binary format I 513]] write_file test.db-journal $zJournal2 - execsql { + execsql { SELECT count(*) FROM t1; PRAGMA integrity_check } @@ -204,7 +204,7 @@ do_test crash8-3.9 { set big [expr $SQLITE_MAX_PAGE_SIZE * 2] set zJournal2 [string replace $zJournal 24 27 [binary format I $big]] write_file test.db-journal $zJournal2 - execsql { + execsql { SELECT count(*) FROM t1; PRAGMA integrity_check } @@ -212,7 +212,7 @@ do_test crash8-3.9 { do_test crash8-3.10 { set zJournal2 [string replace $zJournal 24 27 [binary format I 256]] write_file test.db-journal $zJournal2 - execsql { + execsql { SELECT count(*) FROM t1; PRAGMA integrity_check } @@ -220,17 +220,17 @@ do_test crash8-3.10 { do_test crash8-3.11 { set fd [open test.db-journal w] - fconfigure $fd -translation binary + fconfigure $fd -translation binary puts -nonewline $fd $zJournal close $fd - execsql { + execsql { SELECT count(*) FROM t1; PRAGMA integrity_check } } {6 ok} -# If a connection running in persistent-journal mode is part of a +# If a connection running in persistent-journal mode is part of a # multi-file transaction, it must ensure that the master-journal name # appended to the journal file contents during the commit is located # at the end of the physical journal file. If there was already a @@ -371,7 +371,7 @@ if {$::tcl_platform(platform)=="unix"} { } execsql { PRAGMA integrity_check } } {ok} - + catch { db close } forcedelete test.db test.db-journal sqlite3 db test.db diff --git a/third_party/sqlite/src/test/crashtest1.c b/third_party/sqlite/src/test/crashtest1.c index 1f7035d18ea78..a2df5d6b93658 100644 --- a/third_party/sqlite/src/test/crashtest1.c +++ b/third_party/sqlite/src/test/crashtest1.c @@ -29,7 +29,7 @@ static void do_some_sql(int parent){ int rc = SQLITE_OK; sqlite *db; int cnt = 0; - static char zBig[] = + static char zBig[] = "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" "-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; @@ -50,7 +50,7 @@ static void do_some_sql(int parent){ srand(getpid()); while( rc==SQLITE_OK ){ cnt++; - rc = sqlite_exec_printf(db, + rc = sqlite_exec_printf(db, "INSERT INTO t1 VALUES(%d,'%d%s')", 0, 0, &zErr, rand(), rand(), zBig); } diff --git a/third_party/sqlite/src/test/createtab.test b/third_party/sqlite/src/test/createtab.test index 01e0b6122ec45..921a06e6a7fb3 100644 --- a/third_party/sqlite/src/test/createtab.test +++ b/third_party/sqlite/src/test/createtab.test @@ -47,14 +47,14 @@ for {set av 0} {$av<=$upperBound} {incr av} { } {4} set isUtf16 0 - ifcapable utf16 { + ifcapable utf16 { set isUtf16 [expr {[execsql {PRAGMA encoding}] != "UTF-8"}] } do_test createtab-$av.2 { file size test.db } [expr {1024*(4+($av!=0)+(${isUtf16}*2))}] - + # Start reading the table # do_test createtab-$av.3 { @@ -64,7 +64,7 @@ for {set av 0} {$av<=$upperBound} {incr av} { do_test createtab-$av.4 { sqlite3_column_int $STMT 0 } {1} - + # While still reading the table, create a new table. # do_test createtab-$av.5 { @@ -74,7 +74,7 @@ for {set av 0} {$av<=$upperBound} {incr av} { SELECT * FROM t2; } } {1 2} - + # Continue reading the original table. # do_test createtab-$av.6 { @@ -86,7 +86,7 @@ for {set av 0} {$av<=$upperBound} {incr av} { do_test createtab-$av.8 { sqlite3_column_int $STMT 0 } {2} - + # Do another cycle of creating a new database table while contining # to read the original table. # @@ -106,7 +106,7 @@ for {set av 0} {$av<=$upperBound} {incr av} { do_test createtab-$av.14 { sqlite3_column_int $STMT 0 } {3} - + # One more cycle. # do_test createtab-$av.21 { @@ -125,7 +125,7 @@ for {set av 0} {$av<=$upperBound} {incr av} { do_test createtab-$av.24 { sqlite3_column_int $STMT 0 } {4} - + # Finish reading. Do an integrity check on the database. # do_test createtab-$av.30 { @@ -142,5 +142,5 @@ for {set av 0} {$av<=$upperBound} {incr av} { integrity_check createtab-$av.40 } - + finish_test diff --git a/third_party/sqlite/src/test/cse.test b/third_party/sqlite/src/test/cse.test index 57cdef5acc2c2..a1ab3607a41ac 100644 --- a/third_party/sqlite/src/test/cse.test +++ b/third_party/sqlite/src/test/cse.test @@ -95,14 +95,14 @@ do_test cse-1.10 { } } {11 integer 11 integer 21 integer 21 integer} ifcapable compound { - do_test cse-1.11 { + do_test cse-1.11 { execsql { SELECT *,* FROM t1 WHERE a=2 UNION ALL SELECT *,* FROM t1 WHERE a=1 } } {2 21 22 23 24 25 2 21 22 23 24 25 1 11 12 13 14 15 1 11 12 13 14 15} - do_test cse-1.12 { + do_test cse-1.12 { execsql { SELECT coalesce(b,c,d,e), a, b, c, d, e FROM t1 WHERE a=2 UNION ALL @@ -147,7 +147,7 @@ for {set i 1} {$i<100} {incr i} { for {set j 0} {$j<$n} {incr j} { set r [expr {$j+int(rand()*5)}] if {$r>49} {set r [expr {99-$r}]} - lappend colset a$j a$r + lappend colset a$j a$r lappend answer $j $r } set sql "SELECT [join $colset ,] FROM t2" diff --git a/third_party/sqlite/src/test/csv01.test b/third_party/sqlite/src/test/csv01.test index 8151c47714666..f4c68e48d3d09 100644 --- a/third_party/sqlite/src/test/csv01.test +++ b/third_party/sqlite/src/test/csv01.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # Test cases for CSV virtual table. set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/ctime.test b/third_party/sqlite/src/test/ctime.test index 8ed556358ff8a..41e865c59ff74 100644 --- a/third_party/sqlite/src/test/ctime.test +++ b/third_party/sqlite/src/test/ctime.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file implements regression tests for SQLite library. # -# This file implements tests for the compile time diagnostic +# This file implements tests for the compile time diagnostic # functions. # diff --git a/third_party/sqlite/src/test/cursorhint2.test b/third_party/sqlite/src/test/cursorhint2.test index 616235b376d9c..383cab1030b82 100644 --- a/third_party/sqlite/src/test/cursorhint2.test +++ b/third_party/sqlite/src/test/cursorhint2.test @@ -35,8 +35,8 @@ proc extract_hints {sql} { OpenRead { set csr($a(p1)) $lookup($a(p2)) } - CursorHint { - lappend ret $csr($a(p1)) $a(p4) + CursorHint { + lappend ret $csr($a(p1)) $a(p4) } } } diff --git a/third_party/sqlite/src/test/date.test b/third_party/sqlite/src/test/date.test index 2d336e6c007dd..37a6355420bc3 100644 --- a/third_party/sqlite/src/test/date.test +++ b/third_party/sqlite/src/test/date.test @@ -196,7 +196,7 @@ datetest 3.13 {strftime('%%','2003-10-31 12:34:56.432')} % datetest 3.14 {strftime('%_','2003-10-31 12:34:56.432')} NULL datetest 3.15 {strftime('%Y-%m-%d','2003-10-31')} 2003-10-31 proc repeat {n txt} { - set x {} + set x {} while {$n>0} { append x $txt incr n -1 @@ -244,13 +244,13 @@ datetest 5.15 {datetime('1994-04-16 14:00:00 +05:00 Z')} NULL # and in New York.) # # On non-Vista Windows platform, '2006-03-31' is treated incorrectly as being -# in DST giving a 4 hour offset instead of 5. In 2007, DST was extended to +# in DST giving a 4 hour offset instead of 5. In 2007, DST was extended to # start three weeks earlier (second Sunday in March) and end one week # later (first Sunday in November). Older Windows systems apply this # new rule incorrectly to dates prior to 2007. # # It might be argued that this is masking a problem on non-Vista Windows -# platform. A ticket has already been opened for this issue +# platform. A ticket has already been opened for this issue # (http://www.sqlite.org/cvstrac/tktview?tn=2322). This is just to prevent # more confusion/reports of the issue. # @@ -313,7 +313,7 @@ if {$tzoffset_new==4} { {2006-04-02 03:00:00} datetest 6.4.2 {datetime('2007-03-11 07:00:00','localtime')}\ {2007-03-11 03:00:00} - + datetest 6.5 {datetime('2000-10-29 01:59:00','utc')} {2000-10-29 05:59:00} datetest 6.5.1 {datetime('2006-10-29 01:59:00','utc')} {2006-10-29 05:59:00} datetest 6.5.2 {datetime('2007-11-04 01:59:00','utc')} {2007-11-04 05:59:00} @@ -522,7 +522,7 @@ if {0==[sqlite3 -has-codec]} { sqlite3 db test.db db eval {SELECT * FROM t1} } {2454629.5} - + # Changing the least significant byte of the floating point value between # 00 and FF should always generate a time of either 23:59:59 or 00:00:00, # never 24:00:00 diff --git a/third_party/sqlite/src/test/dbfuzz.c b/third_party/sqlite/src/test/dbfuzz.c index ca1c6ea2177f5..029376dfec4ae 100644 --- a/third_party/sqlite/src/test/dbfuzz.c +++ b/third_party/sqlite/src/test/dbfuzz.c @@ -146,7 +146,7 @@ static VFile *findVFile(const char *zName){ int i; if( zName==0 ) return 0; for(i=0; i=VOLUME_ECHO ){ char *zQuote = sqlite3_mprintf("%q", zSql); printf("%d: %s %s\n", tno, zOp, zSql); diff --git a/third_party/sqlite/src/test/dbstatus.test b/third_party/sqlite/src/test/dbstatus.test index 711d66ebb3f8e..630686a5975a2 100644 --- a/third_party/sqlite/src/test/dbstatus.test +++ b/third_party/sqlite/src/test/dbstatus.test @@ -90,11 +90,11 @@ foreach ::lookaside_buffer_size {0 64 120} { # # 1. Open a connection to an empty database. Disable statement caching. # - # 2. Execute the SQL to create the database schema. Measure the total - # heap and lookaside memory allocated by SQLite, and the memory + # 2. Execute the SQL to create the database schema. Measure the total + # heap and lookaside memory allocated by SQLite, and the memory # allocated for the database schema according to sqlite3_db_status(). # - # 3. Drop all tables in the database schema. Measure the total memory + # 3. Drop all tables in the database schema. Measure the total memory # and the schema memory again. # # 4. Repeat step 2. @@ -112,7 +112,7 @@ foreach ::lookaside_buffer_size {0 64 120} { # c) Step 5 reports the same amount of schema and total memory used as # in step 3. # - foreach {tn schema} { + foreach {tn schema} { 1 { CREATE TABLE t1(a, b) } 2 { CREATE TABLE t1(a PRIMARY KEY, b REFERENCES t1, c UNIQUE) } 3 { @@ -146,9 +146,9 @@ foreach ::lookaside_buffer_size {0 64 120} { 7 { CREATE TABLE t1(a, b); CREATE TABLE t2(c, d); - CREATE VIEW v1 AS - SELECT * FROM t1 - UNION + CREATE VIEW v1 AS + SELECT * FROM t1 + UNION SELECT * FROM t2 UNION ALL SELECT c||b, d||a FROM t2 LEFT OUTER JOIN t1 GROUP BY c, d @@ -166,7 +166,7 @@ foreach ::lookaside_buffer_size {0 64 120} { } } { set tn "$::lookaside_buffer_size-$tn" - + # Step 1. db close forcedelete test.db @@ -176,32 +176,32 @@ foreach ::lookaside_buffer_size {0 64 120} { catch { register_echo_module db } ifcapable !vtab { if {[string match *x $tn]} continue } - + # Step 2. execsql $schema set nAlloc1 [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1] incr nAlloc1 [lookaside db] set nSchema1 [lindex [sqlite3_db_status db SQLITE_DBSTATUS_SCHEMA_USED 0] 1] - + # Step 3. drop_all_tables set nAlloc2 [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1] incr nAlloc2 [lookaside db] set nSchema2 [lindex [sqlite3_db_status db SQLITE_DBSTATUS_SCHEMA_USED 0] 1] - + # Step 4. execsql $schema set nAlloc3 [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1] incr nAlloc3 [lookaside db] set nSchema3 [lindex [sqlite3_db_status db SQLITE_DBSTATUS_SCHEMA_USED 0] 1] - + # Step 5. drop_all_tables set nAlloc4 [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1] incr nAlloc4 [lookaside db] set nSchema4 [lindex [sqlite3_db_status db SQLITE_DBSTATUS_SCHEMA_USED 0] 1] set nFree [expr {$nAlloc1-$nAlloc2}] - + # Tests for which the test name ends in an "k" report slightly less # memory than is actually freed when all schema items are finalized. # This is because memory allocated by KeyInfo objects is no longer @@ -221,7 +221,7 @@ foreach ::lookaside_buffer_size {0 64 120} { # dbstatus. # # Finally, on osx the estimate of memory used by the schema may be - # slightly low. + # slightly low. # if {[string match *k $tn] || [string match *x $tn] || $AUTOVACUUM @@ -232,11 +232,11 @@ foreach ::lookaside_buffer_size {0 64 120} { } else { do_test dbstatus-2.$tn.a { expr {$nSchema1-$nSchema2} } $nFree } - + do_test dbstatus-2.$tn.b { list $nAlloc1 $nSchema1 } "$nAlloc3 $nSchema3" do_test dbstatus-2.$tn.c { list $nAlloc2 $nSchema2 } "$nAlloc4 $nSchema4" } - + #------------------------------------------------------------------------- # Tests for SQLITE_DBSTATUS_STMT_USED. # @@ -246,11 +246,11 @@ foreach ::lookaside_buffer_size {0 64 120} { # 1. Open a connection to an empty database. Initialized the database # schema. # - # 2. Prepare a bunch of SQL statements. Measure the total heap and - # lookaside memory allocated by SQLite, and the memory allocated + # 2. Prepare a bunch of SQL statements. Measure the total heap and + # lookaside memory allocated by SQLite, and the memory allocated # for the prepared statements according to sqlite3_db_status(). # - # 3. Finalize all prepared statements. Measure the total memory + # 3. Finalize all prepared statements. Measure the total memory # and the prepared statement memory again. # # 4. Repeat step 2. @@ -268,7 +268,7 @@ foreach ::lookaside_buffer_size {0 64 120} { # c) Step 5 reports the same amount of schema and total memory used as # in step 3. # - foreach {tn schema statements} { + foreach {tn schema statements} { 1 { CREATE TABLE t1(a, b) } { SELECT * FROM t1; INSERT INTO t1 VALUES(1, 2); @@ -284,7 +284,7 @@ foreach ::lookaside_buffer_size {0 64 120} { END; } { INSERT INTO t1 VALUES(5, 'x'); - } + } 3 { PRAGMA recursive_triggers = 1; CREATE TABLE t1(a, b); @@ -297,7 +297,7 @@ foreach ::lookaside_buffer_size {0 64 120} { END; } { INSERT INTO t1 VALUES(10, 'x'); - } + } 4 { CREATE TABLE t1(a, b); } { @@ -323,36 +323,36 @@ foreach ::lookaside_buffer_size {0 64 120} { catch { register_echo_module db } ifcapable !vtab { if {[string match *x $tn]} continue } - + execsql $schema db cache flush - + # Step 2. execsql $statements set nAlloc1 [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1] incr nAlloc1 [lookaside db] set nStmt1 [lindex [sqlite3_db_status db SQLITE_DBSTATUS_STMT_USED 0] 1] execsql $statements - + # Step 3. db cache flush set nAlloc2 [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1] incr nAlloc2 [lookaside db] set nStmt2 [lindex [sqlite3_db_status db SQLITE_DBSTATUS_STMT_USED 0] 1] - + # Step 3. execsql $statements set nAlloc3 [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1] incr nAlloc3 [lookaside db] set nStmt3 [lindex [sqlite3_db_status db SQLITE_DBSTATUS_STMT_USED 0] 1] execsql $statements - + # Step 4. db cache flush set nAlloc4 [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1] incr nAlloc4 [lookaside db] set nStmt4 [lindex [sqlite3_db_status db SQLITE_DBSTATUS_STMT_USED 0] 1] - + set nFree [expr {$nAlloc1-$nAlloc2}] do_test dbstatus-3.$tn.a { expr $nStmt2 } {0} @@ -391,7 +391,7 @@ ifcapable shared_cache { } reset_db sqlite3 db file:test.db?cache=shared - + do_execsql_test 4.0 { PRAGMA auto_vacuum=NONE; CREATE TABLE t1(a, b, c); @@ -403,7 +403,7 @@ ifcapable shared_cache { INSERT INTO tt VALUES(1, 2, 3); } do_cacheused_test 4.1.1 db { 9000 9000 } - + sqlite3 db2 file:test.db?cache=shared do_cacheused_test 4.2.1 db2 { 4568 2284 } do_cacheused_test 4.2.2 db { 9000 6716 } diff --git a/third_party/sqlite/src/test/dbstatus2.test b/third_party/sqlite/src/test/dbstatus2.test index eff4b0207f840..47ef3622351b4 100644 --- a/third_party/sqlite/src/test/dbstatus2.test +++ b/third_party/sqlite/src/test/dbstatus2.test @@ -49,21 +49,21 @@ do_test 1.2 { db_hit_miss db } {{0 2 0} {0 4 0}} -do_test 1.3 { +do_test 1.3 { execsql { SELECT b FROM t1 WHERE a=2 } db_hit_miss db } {{0 6 0} {0 4 0}} -do_test 1.4 { +do_test 1.4 { execsql { SELECT b FROM t1 WHERE a=2 } db_hit_miss db } {{0 10 0} {0 4 0}} -do_test 1.5 { +do_test 1.5 { db_hit_miss db 1 } {{0 10 0} {0 4 0}} -do_test 1.6 { +do_test 1.6 { db_hit_miss db 0 } {{0 0 0} {0 0 0}} @@ -78,7 +78,7 @@ do_test 1.8 { sqlite3_db_status db CACHE_HIT 0 } {0 2 0} do_test 1.9 { sqlite3_db_status db CACHE_MISS 0 } {0 1 0} do_test 2.1 { db_write db } {0 0 0} -do_test 2.2 { +do_test 2.2 { execsql { INSERT INTO t1 VALUES(4, randomblob(600)) } db_write db } {0 4 0} @@ -87,16 +87,16 @@ do_test 2.4 { db_write db 0 } {0 0 0} do_test 2.5 { db_write db 1 } {0 0 0} if {[wal_is_capable]} { - do_test 2.6 { + do_test 2.6 { execsql { PRAGMA journal_mode = WAL } db_write db 1 } {0 1 0} } -do_test 2.7 { +do_test 2.7 { execsql { INSERT INTO t1 VALUES(5, randomblob(600)) } db_write db } {0 4 0} do_test 2.8 { db_write db 1 } {0 4 0} do_test 2.9 { db_write db 0 } {0 0 0} - + finish_test diff --git a/third_party/sqlite/src/test/default.test b/third_party/sqlite/src/test/default.test index 406eb53677ab3..82e99f5fed606 100644 --- a/third_party/sqlite/src/test/default.test +++ b/third_party/sqlite/src/test/default.test @@ -75,7 +75,7 @@ do_execsql_test default-3.1 { g LONG INTEGER DEFAULT( 3600*12 ) ); INSERT INTO t3 VALUES(null, 5, 'row1', '5.25', 'xyz', 321, '432'); - SELECT a, typeof(a), b, typeof(b), c, typeof(c), + SELECT a, typeof(a), b, typeof(b), c, typeof(c), d, typeof(d), e, typeof(e), f, typeof(f), g, typeof(g) FROM t3; } {1 integer 5 integer row1 text 5.25 real xyz text 321 text 432 integer} @@ -99,7 +99,7 @@ do_execsql_test default-3.3 { SELECT * FROM t300; } {2147483647 2147483648 9223372036854775807 -2147483647 -2147483648 -9223372036854775808 9.22337203685478e+18 9223372036854775807} -# Do now allow bound parameters in new DEFAULT values. +# Do now allow bound parameters in new DEFAULT values. # Silently convert bound parameters to NULL in DEFAULT causes # in the sqlite_master table, for backwards compatibility. # @@ -111,7 +111,7 @@ do_execsql_test default-4.0 { PRAGMA writable_schema=ON; UPDATE sqlite_master SET sql='CREATE TABLE t1(a TEXT, b TEXT DEFAULT(:xyz))'; } {} -db close +db close sqlite3 db test.db do_execsql_test default-4.1 { INSERT INTO t1(a) VALUES('xyzzy'); diff --git a/third_party/sqlite/src/test/delete.test b/third_party/sqlite/src/test/delete.test index 8e84ed4665886..fb1f0ad945ea2 100644 --- a/third_party/sqlite/src/test/delete.test +++ b/third_party/sqlite/src/test/delete.test @@ -285,7 +285,7 @@ do_test delete-8.1 { } } {1 {attempt to write a readonly database}} do_test delete-8.2 { - execsql {SELECT * FROM t3} + execsql {SELECT * FROM t3} } {123} do_test delete-8.3 { catchsql { @@ -293,7 +293,7 @@ do_test delete-8.3 { } } {1 {attempt to write a readonly database}} do_test delete-8.4 { - execsql {SELECT * FROM t3} + execsql {SELECT * FROM t3} } {123} # Update for v3: In v2 the DELETE statement would succeed because no @@ -321,9 +321,9 @@ forcedelete test.db test.db-journal # The following tests verify that SQLite correctly handles the case # where an index B-Tree is being scanned, the rowid column being read # from each index entry and another statement deletes some rows from -# the index B-Tree. At one point this (obscure) scenario was causing +# the index B-Tree. At one point this (obscure) scenario was causing # SQLite to return spurious SQLITE_CORRUPT errors and arguably incorrect -# query results. +# query results. # do_test delete-9.1 { sqlite3 db test.db diff --git a/third_party/sqlite/src/test/delete3.test b/third_party/sqlite/src/test/delete3.test index a31f6ec39e49e..b13fc043e5552 100644 --- a/third_party/sqlite/src/test/delete3.test +++ b/third_party/sqlite/src/test/delete3.test @@ -43,7 +43,7 @@ do_test delete3-1.1 { INSERT INTO t1 SELECT x+131072 FROM t1; INSERT INTO t1 SELECT x+262144 FROM t1; COMMIT; - SELECT count(*) FROM t1; + SELECT count(*) FROM t1; } } {524288} do_test delete3-1.2 { diff --git a/third_party/sqlite/src/test/delete4.test b/third_party/sqlite/src/test/delete4.test index 34ba9aaef89d5..5a154de67048c 100644 --- a/third_party/sqlite/src/test/delete4.test +++ b/third_party/sqlite/src/test/delete4.test @@ -94,8 +94,8 @@ do_execsql_test 3.3 { SELECT i FROM t1 ORDER BY i; } {1 3 5 7} -do_execsql_test 3.4 { - PRAGMA integrity_check; +do_execsql_test 3.4 { + PRAGMA integrity_check; } {ok} # Between 2015-09-14 and 2015-09-28, the following test cases would result diff --git a/third_party/sqlite/src/test/delete_db.test b/third_party/sqlite/src/test/delete_db.test index 09c44ff9f397e..6c1b948b079fb 100644 --- a/third_party/sqlite/src/test/delete_db.test +++ b/third_party/sqlite/src/test/delete_db.test @@ -24,7 +24,7 @@ proc delete_all {} { proc copydb {} { foreach f [glob -nocomplain test3*] { file delete $f } - foreach f [glob -nocomplain test2*] { + foreach f [glob -nocomplain test2*] { set p [string range $f 5 end] file copy "test2$p" "test3$p" } @@ -97,7 +97,7 @@ do_test 1.3.0 { copydb files } [list {*}{ - test3.database test3.database-journal test3.database001 + test3.database test3.database-journal test3.database001 test3.database002 test3.database003 }] do_test 1.3.1 { @@ -115,7 +115,7 @@ do_test 1.4.0 { copydb files } [list {*}{ - test3.database test3.database-shm test3.database-wal test3.database001 + test3.database test3.database-shm test3.database-wal test3.database001 test3.database002 test3.database003 }] do_test 1.4.1 { @@ -138,12 +138,12 @@ ifcapable 8_3_names { copydb files } {test3.db test3.nal} - + do_test 2.1.1 { sqlite3_delete_database test3.db files } {} - + do_test 2.2.0 { execsql { COMMIT; @@ -164,7 +164,7 @@ ifcapable 8_3_names { sqlite3_multiplex_initialize "" 0 sqlite3 db file:test2.db?8_3_names=1 -uri 1 -vfs multiplex sqlite3_multiplex_control db "main" chunk_size 32768 - + do_test 2.3.0 { execsql { PRAGMA auto_vacuum = 0; } execsql { @@ -177,14 +177,14 @@ ifcapable 8_3_names { copydb files } [list {*}{ - test3.001 test3.002 test3.003 test3.db test3.nal + test3.001 test3.002 test3.003 test3.db test3.nal }] do_test 2.3.1 { sqlite3_delete_database test3.db files } {} - - + + do_test 2.4.0 { execsql { COMMIT; @@ -194,7 +194,7 @@ ifcapable 8_3_names { copydb files } [list {*}{ - test3.001 test3.002 test3.003 test3.db test3.db-shm test3.wal + test3.001 test3.002 test3.003 test3.db test3.db-shm test3.wal }] do_test 2.4.1 { sqlite3_delete_database test3.db @@ -204,7 +204,7 @@ ifcapable 8_3_names { db close delete_all -sqlite3_multiplex_shutdown +sqlite3_multiplex_shutdown do_test 3.0 { file mkdir dir2.db diff --git a/third_party/sqlite/src/test/descidx1.test b/third_party/sqlite/src/test/descidx1.test index a223664ff32e3..bdb0b38614470 100644 --- a/third_party/sqlite/src/test/descidx1.test +++ b/third_party/sqlite/src/test/descidx1.test @@ -26,7 +26,7 @@ db eval {PRAGMA legacy_file_format=OFF} # This procedure sets the value of the file-format in file 'test.db' # to $newval. Also, the schema cookie is incremented. -# +# proc set_file_format {newval} { hexio_write test.db 44 [hexio_render_int32 $newval] set schemacookie [hexio_get_int [hexio_read test.db 40 4]] @@ -36,7 +36,7 @@ proc set_file_format {newval} { } # This procedure returns the value of the file-format in file 'test.db'. -# +# proc get_file_format {{fname test.db}} { return [hexio_get_int [hexio_read $fname 44 4]] } @@ -357,7 +357,7 @@ ifcapable vacuum { } get_file_format } {4} -} +} diff --git a/third_party/sqlite/src/test/descidx2.test b/third_party/sqlite/src/test/descidx2.test index fdc3eb079477c..236a7e288d0d1 100644 --- a/third_party/sqlite/src/test/descidx2.test +++ b/third_party/sqlite/src/test/descidx2.test @@ -27,7 +27,7 @@ db eval {PRAGMA legacy_file_format=OFF} # This procedure sets the value of the file-format in file 'test.db' # to $newval. Also, the schema cookie is incremented. -# +# proc set_file_format {newval} { hexio_write test.db 44 [hexio_render_int32 $newval] set schemacookie [hexio_get_int [hexio_read test.db 40 4]] @@ -37,7 +37,7 @@ proc set_file_format {newval} { } # This procedure returns the value of the file-format in file 'test.db'. -# +# proc get_file_format {{fname test.db}} { return [hexio_get_int [hexio_read $fname 44 4]] } diff --git a/third_party/sqlite/src/test/descidx3.test b/third_party/sqlite/src/test/descidx3.test index c375acc705fbf..9b9371bf443c8 100644 --- a/third_party/sqlite/src/test/descidx3.test +++ b/third_party/sqlite/src/test/descidx3.test @@ -30,7 +30,7 @@ db eval {PRAGMA legacy_file_format=OFF} # This procedure sets the value of the file-format in file 'test.db' # to $newval. Also, the schema cookie is incremented. -# +# proc set_file_format {newval} { hexio_write test.db 44 [hexio_render_int32 $newval] set schemacookie [hexio_get_int [hexio_read test.db 40 4]] @@ -40,7 +40,7 @@ proc set_file_format {newval} { } # This procedure returns the value of the file-format in file 'test.db'. -# +# proc get_file_format {{fname test.db}} { return [hexio_get_int [hexio_read $fname 44 4]] } @@ -129,7 +129,7 @@ do_test descidx3-3.5 { ifcapable subquery { # If the subquery capability is not compiled in to the binary, then - # the IN(...) operator is not available. Hence these tests cannot be + # the IN(...) operator is not available. Hence these tests cannot be # run. do_test descidx3-4.1 { lsort [execsql { diff --git a/third_party/sqlite/src/test/diskfull.test b/third_party/sqlite/src/test/diskfull.test index 391dfb4fcf440..040b5d3074a33 100644 --- a/third_party/sqlite/src/test/diskfull.test +++ b/third_party/sqlite/src/test/diskfull.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing for correct handling of disk full # errors. -# +# # $Id: diskfull.test,v 1.8 2008/07/12 14:52:20 drh Exp $ set testdir [file dirname $argv0] @@ -85,7 +85,7 @@ do_diskfull_test diskfull-2 VACUUM # forcedelete test.db # forcedelete test.db-journal # sqlite3 db test.db -# +# # do_test diskfull-3.1 { # execsql { # PRAGMA default_cache_size = 10; @@ -98,13 +98,13 @@ do_diskfull_test diskfull-2 VACUUM # INSERT INTO t3 SELECT randstr(100, 100), randstr(100, 100) FROM t3; # INSERT INTO t3 SELECT randstr(100, 100), randstr(100, 100) FROM t3; # INSERT INTO t3 SELECT randstr(100, 100), randstr(100, 100) FROM t3; -# UPDATE t3 +# UPDATE t3 # SET b = (SELECT a FROM t3 WHERE rowid = (SELECT max(rowid)-1 FROM t3)) # WHERE rowid = (SELECT max(rowid) FROM t3); # PRAGMA cache_size; # } # } {10} -# +# # do_diskfull_test diskfull-3.2 { # BEGIN; # INSERT INTO t3 VALUES( randstr(100, 100), randstr(100, 100) ); diff --git a/third_party/sqlite/src/test/distinct.test b/third_party/sqlite/src/test/distinct.test index dac2269b0bcf2..ace1b3de2f069 100644 --- a/third_party/sqlite/src/test/distinct.test +++ b/third_party/sqlite/src/test/distinct.test @@ -50,7 +50,7 @@ proc do_temptables_test {tn sql temptables} { uplevel [list do_test $tn [subst -novar { set ret "" db eval "EXPLAIN [set sql]" { - if {$opcode == "OpenEphemeral" || $opcode == "SorterOpen"} { + if {$opcode == "OpenEphemeral" || $opcode == "SorterOpen"} { if {$p5 != "08" && $p5!="00"} { error "p5 = $p5" } if {$p5 == "08"} { lappend ret hash @@ -65,8 +65,8 @@ proc do_temptables_test {tn sql temptables} { #------------------------------------------------------------------------- -# The following tests - distinct-1.* - check that the planner correctly -# detects cases where a UNIQUE index means that a DISTINCT clause is +# The following tests - distinct-1.* - check that the planner correctly +# detects cases where a UNIQUE index means that a DISTINCT clause is # redundant. Currently the planner only detects such cases when there # is a single table in the FROM clause. # @@ -144,7 +144,7 @@ foreach {tn noop sql} { #------------------------------------------------------------------------- # The following tests - distinct-2.* - test cases where an index is -# used to deliver results in order of the DISTINCT expressions. +# used to deliver results in order of the DISTINCT expressions. # drop_all_tables do_execsql_test 2.0 { @@ -200,7 +200,7 @@ do_test 3.1 { #------------------------------------------------------------------------- # Ticket [fccbde530a6583bf2748400919f1603d5425995c] (2014-01-08) # The logic that computes DISTINCT sometimes thinks that a zeroblob() -# and a blob of all zeros are different when they should be the same. +# and a blob of all zeros are different when they should be the same. # do_execsql_test 4.1 { DROP TABLE IF EXISTS t1; @@ -259,12 +259,12 @@ db close sqlite3 db :memory: do_execsql_test 6.1 { CREATE TABLE jjj(x); - SELECT (SELECT 'mmm' UNION SELECT DISTINCT max(name) ORDER BY 1) + SELECT (SELECT 'mmm' UNION SELECT DISTINCT max(name) ORDER BY 1) FROM sqlite_master; } {jjj} do_execsql_test 6.2 { CREATE TABLE nnn(x); - SELECT (SELECT 'mmm' UNION SELECT DISTINCT max(name) ORDER BY 1) + SELECT (SELECT 'mmm' UNION SELECT DISTINCT max(name) ORDER BY 1) FROM sqlite_master; } {mmm} diff --git a/third_party/sqlite/src/test/e_blobbytes.test b/third_party/sqlite/src/test/e_blobbytes.test index d38f56bf344dd..ad06a99c59295 100644 --- a/third_party/sqlite/src/test/e_blobbytes.test +++ b/third_party/sqlite/src/test/e_blobbytes.test @@ -17,7 +17,7 @@ set testprefix e_blobbytes do_execsql_test 1.0 { CREATE TABLE q1(r INTEGER PRIMARY KEY, s TEXT); WITH d(a, b) AS ( - SELECT 0, '' + SELECT 0, '' UNION ALL SELECT a+1, b||'.' FROM d WHERE a<10000 ) diff --git a/third_party/sqlite/src/test/e_blobclose.test b/third_party/sqlite/src/test/e_blobclose.test index 2683197854706..ca118e7dba8e5 100644 --- a/third_party/sqlite/src/test/e_blobclose.test +++ b/third_party/sqlite/src/test/e_blobclose.test @@ -43,7 +43,7 @@ do_execsql_test 1.3 { PRAGMA lock_status } {main unlocked temp closed} # there are no other open read-write blob handles or active write # statements, the current transaction is committed. # -# 2.1.*: Transaction is not committed if there are other open +# 2.1.*: Transaction is not committed if there are other open # read-write blob handles. # # 2.2.*: Transaction is not committed if not in auto-commit mode. @@ -58,19 +58,19 @@ do_test 2.1.1 { execsql { PRAGMA lock_status } } {main reserved temp closed} do_test 2.1.2 { - sqlite3_blob_close $B1 + sqlite3_blob_close $B1 execsql { PRAGMA lock_status } } {main reserved temp closed} do_test 2.1.3 { - sqlite3_blob_close $B2 + sqlite3_blob_close $B2 execsql { PRAGMA lock_status } } {main reserved temp closed} do_test 2.1.4 { - sqlite3_blob_close $B3 + sqlite3_blob_close $B3 execsql { PRAGMA lock_status } } {main shared temp closed} do_test 2.1.5 { - sqlite3_blob_close $B4 + sqlite3_blob_close $B4 execsql { PRAGMA lock_status } } {main unlocked temp closed} @@ -80,7 +80,7 @@ do_test 2.2.1 { } {main reserved temp closed} do_test 2.2.2 { execsql { BEGIN } - sqlite3_blob_close $B1 + sqlite3_blob_close $B1 execsql { PRAGMA lock_status } } {main reserved temp closed} do_test 2.2.3 { @@ -88,8 +88,8 @@ do_test 2.2.3 { execsql { PRAGMA lock_status } } {main unlocked temp closed} -proc val {} { - sqlite3_blob_close $::B +proc val {} { + sqlite3_blob_close $::B db eval { PRAGMA lock_status } } db func val val @@ -130,7 +130,7 @@ do_test 3.2 { do_test 3.3 { sqlite3 db2 test.db execsql { BEGIN ; SELECT * FROM x1 } db2 - sqlite3_blob_close $B + sqlite3_blob_close $B } {SQLITE_BUSY} # EVIDENCE-OF: R-41959-38737 Otherwise, if this function is passed a diff --git a/third_party/sqlite/src/test/e_blobopen.test b/third_party/sqlite/src/test/e_blobopen.test index a6168042e9d77..ff50b7c3d9183 100644 --- a/third_party/sqlite/src/test/e_blobopen.test +++ b/third_party/sqlite/src/test/e_blobopen.test @@ -259,7 +259,7 @@ test_blob_open 8 main t1 y 3 0 SQLITE_ERROR "cannot open value of type real" # KEY or UNIQUE constraint and the blob is being opened for read/write # access # -# Test cases 8.1.* show that such columns can be opened for read-access. +# Test cases 8.1.* show that such columns can be opened for read-access. # Tests 8.2.* show that read-write access is different. Columns "c" and "c" # are not part of an index, PK or UNIQUE constraint, so they work in both # cases. diff --git a/third_party/sqlite/src/test/e_blobwrite.test b/third_party/sqlite/src/test/e_blobwrite.test index 7b2249c243f6e..b41feb169988f 100644 --- a/third_party/sqlite/src/test/e_blobwrite.test +++ b/third_party/sqlite/src/test/e_blobwrite.test @@ -76,7 +76,7 @@ proc blob_write_error_test {tn B iOffset blob nData errcode errmsg} { set cmd [list sqlite3_blob_write $B $iOffset $blob $nData] uplevel [list do_test $tn.1 [subst -nocommands { - list [catch {$cmd} msg] [set msg] + list [catch {$cmd} msg] [set msg] }] [list $isError $ret]] # EVIDENCE-OF: R-34782-18311 Unless SQLITE_MISUSE is returned, this @@ -151,7 +151,7 @@ sqlite3_blob_close $B # the statement that expired the BLOB handle or by other independent # statements. # -# 3.1.*: not rolled back, +# 3.1.*: not rolled back, # 3.2.*: overwritten. # do_execsql_test 3.0 { diff --git a/third_party/sqlite/src/test/e_changes.test b/third_party/sqlite/src/test/e_changes.test index a77e22a2ee4a9..dc8f6dd42869b 100644 --- a/third_party/sqlite/src/test/e_changes.test +++ b/third_party/sqlite/src/test/e_changes.test @@ -14,7 +14,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix e_changes -# Like [do_execsql_test], except it appends the value returned by +# Like [do_execsql_test], except it appends the value returned by # [db changes] to the result of executing the SQL script. # proc do_changes_test {tn sql res} { @@ -37,11 +37,11 @@ do_execsql_test 1.0 { CREATE INDEX i2 ON t2(y); } foreach {tn schema} { - 1 { + 1 { CREATE TABLE t1(a, b); CREATE INDEX i1 ON t1(b); } - 2 { + 2 { CREATE TABLE t1(a, b, PRIMARY KEY(a, b)) WITHOUT ROWID; CREATE INDEX i1 ON t1(b); } @@ -113,7 +113,7 @@ foreach {tn schema} { # reset_db do_changes_test 2.1 { CREATE TABLE t1(x) } 0 -do_changes_test 2.2 { +do_changes_test 2.2 { WITH d(y) AS (SELECT 1 UNION ALL SELECT y+1 FROM d WHERE y<47) INSERT INTO t1 SELECT y FROM d; } 47 @@ -192,7 +192,7 @@ do_execsql_test 3.2.0 { do_changes_test 3.2.1 { DELETE FROM p1 WHERE one = 'a' } 1 do_changes_test 3.2.2 { DELETE FROM p1 WHERE one = 'b' } 1 do_changes_test 3.2.3 { DELETE FROM p1 WHERE one = 'c' } 1 -do_execsql_test 3.2.4 { +do_execsql_test 3.2.4 { SELECT * FROM c1; SELECT * FROM c2; SELECT * FROM c3; @@ -201,7 +201,7 @@ do_execsql_test 3.2.4 { do_changes_test 3.2.5 { UPDATE p1 SET one = 'g' WHERE one = 'd' } 1 do_changes_test 3.2.6 { UPDATE p1 SET one = 'h' WHERE one = 'e' } 1 do_changes_test 3.2.7 { UPDATE p1 SET one = 'i' WHERE one = 'f' } 1 -do_execsql_test 3.2.8 { +do_execsql_test 3.2.8 { SELECT * FROM c4; SELECT * FROM c5; SELECT * FROM c6; @@ -222,7 +222,7 @@ do_changes_test 3.3.1 { INSERT OR REPLACE INTO r1 VALUES('i', 1) } 1 do_changes_test 3.3.2 { INSERT OR REPLACE INTO r1 VALUES('iv', 'v') } 1 do_changes_test 3.3.3 { UPDATE OR REPLACE r1 SET b='v' WHERE a='iii' } 1 do_changes_test 3.3.4 { UPDATE OR REPLACE r1 SET b='vi',a='vii' WHERE a='ii' } 1 -do_execsql_test 3.3.5 { +do_execsql_test 3.3.5 { SELECT * FROM r1 ORDER BY a; } {i 1 iii v vii vi} diff --git a/third_party/sqlite/src/test/e_createtable.test b/third_party/sqlite/src/test/e_createtable.test index f07fbb9c74092..827e1abde6a80 100644 --- a/third_party/sqlite/src/test/e_createtable.test +++ b/third_party/sqlite/src/test/e_createtable.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file implements tests to verify that the "testable statements" in +# This file implements tests to verify that the "testable statements" in # the lang_createtable.html document are correct. # @@ -22,7 +22,7 @@ set ::testprefix e_createtable # # e_createtable-0.*: Test that the syntax diagrams are correct. # -# e_createtable-1.*: Test statements related to table and database names, +# e_createtable-1.*: Test statements related to table and database names, # the TEMP and TEMPORARY keywords, and the IF NOT EXISTS clause. # # e_createtable-2.*: Test "CREATE TABLE AS" statements. @@ -80,7 +80,7 @@ do_createtable_tests 0.1.2 -error { # syntax diagram column-constraint # do_createtable_tests 0.2.1 -repair { - drop_all_tables + drop_all_tables execsql { CREATE TABLE t2(x PRIMARY KEY) } } { 1.1 "CREATE TABLE t1(c1 text PRIMARY KEY)" {} @@ -113,13 +113,13 @@ do_createtable_tests 0.2.1 -repair { 7.2 "CREATE TABLE t1(c1 CONSTRAINT abc REFERENCES t2)" {} 8.1 { - CREATE TABLE t1(c1 + CREATE TABLE t1(c1 PRIMARY KEY NOT NULL UNIQUE CHECK(c1 IS 'ten') DEFAULT 123 REFERENCES t1 ); } {} 8.2 { - CREATE TABLE t1(c1 - REFERENCES t1 DEFAULT 123 CHECK(c1 IS 'ten') UNIQUE NOT NULL PRIMARY KEY + CREATE TABLE t1(c1 + REFERENCES t1 DEFAULT 123 CHECK(c1 IS 'ten') UNIQUE NOT NULL PRIMARY KEY ); } {} } @@ -127,7 +127,7 @@ do_createtable_tests 0.2.1 -repair { # -- syntax diagram table-constraint # do_createtable_tests 0.3.1 -repair { - drop_all_tables + drop_all_tables execsql { CREATE TABLE t2(x PRIMARY KEY) } } { 1.1 "CREATE TABLE t1(c1, c2, PRIMARY KEY(c1))" {} @@ -146,7 +146,7 @@ do_createtable_tests 0.3.1 -repair { # -- syntax diagram column-def # do_createtable_tests 0.4.1 -repair { - drop_all_tables + drop_all_tables } { 1 {CREATE TABLE t1( col1, @@ -161,7 +161,7 @@ do_createtable_tests 0.4.1 -repair { # -- syntax diagram create-table-stmt # do_createtable_tests 0.5.1 -repair { - drop_all_tables + drop_all_tables execsql { CREATE TABLE t2(a, b, c) } } { 1 "CREATE TABLE t1(a, b, c)" {} @@ -191,7 +191,7 @@ do_createtable_tests 0.5.1 -repair { # 2: MATCH PARTIAL # 3: MATCH SIMPLE # 4: MATCH STICK -# 5: +# 5: # # 1: ON DELETE SET NULL # 2: ON DELETE SET DEFAULT @@ -213,127 +213,127 @@ do_createtable_tests 0.5.1 -repair { # 4: DEFERRABLE INITIALLY DEFERRED # 5: DEFERRABLE INITIALLY IMMEDIATE # 6: DEFERRABLE -# 7: +# 7: # do_createtable_tests 0.6.1 -repair { - drop_all_tables + drop_all_tables execsql { CREATE TABLE t2(x PRIMARY KEY, y) } execsql { CREATE TABLE t3(i, j, UNIQUE(i, j) ) } } { - 11146 { CREATE TABLE t1(a - REFERENCES t2(x) MATCH FULL + 11146 { CREATE TABLE t1(a + REFERENCES t2(x) MATCH FULL ON DELETE SET NULL ON UPDATE RESTRICT DEFERRABLE )} {} - 11412 { CREATE TABLE t1(a - REFERENCES t2(x) - ON DELETE RESTRICT ON UPDATE SET NULL MATCH FULL + 11412 { CREATE TABLE t1(a + REFERENCES t2(x) + ON DELETE RESTRICT ON UPDATE SET NULL MATCH FULL NOT DEFERRABLE INITIALLY IMMEDIATE )} {} - 12135 { CREATE TABLE t1(a - REFERENCES t2(x) MATCH PARTIAL + 12135 { CREATE TABLE t1(a + REFERENCES t2(x) MATCH PARTIAL ON DELETE SET NULL ON UPDATE CASCADE DEFERRABLE INITIALLY IMMEDIATE )} {} - 12427 { CREATE TABLE t1(a - REFERENCES t2(x) MATCH PARTIAL - ON DELETE RESTRICT ON UPDATE SET DEFAULT + 12427 { CREATE TABLE t1(a + REFERENCES t2(x) MATCH PARTIAL + ON DELETE RESTRICT ON UPDATE SET DEFAULT )} {} - 12446 { CREATE TABLE t1(a - REFERENCES t2(x) MATCH PARTIAL + 12446 { CREATE TABLE t1(a + REFERENCES t2(x) MATCH PARTIAL ON DELETE RESTRICT ON UPDATE RESTRICT DEFERRABLE )} {} - 12522 { CREATE TABLE t1(a - REFERENCES t2(x) MATCH PARTIAL + 12522 { CREATE TABLE t1(a + REFERENCES t2(x) MATCH PARTIAL ON DELETE NO ACTION ON UPDATE SET DEFAULT NOT DEFERRABLE INITIALLY IMMEDIATE )} {} - 13133 { CREATE TABLE t1(a - REFERENCES t2(x) MATCH SIMPLE + 13133 { CREATE TABLE t1(a + REFERENCES t2(x) MATCH SIMPLE ON DELETE SET NULL ON UPDATE CASCADE NOT DEFERRABLE )} {} - 13216 { CREATE TABLE t1(a - REFERENCES t2(x) MATCH SIMPLE + 13216 { CREATE TABLE t1(a + REFERENCES t2(x) MATCH SIMPLE ON DELETE SET DEFAULT ON UPDATE SET NULL DEFERRABLE )} {} - 13263 { CREATE TABLE t1(a - REFERENCES t2(x) MATCH SIMPLE + 13263 { CREATE TABLE t1(a + REFERENCES t2(x) MATCH SIMPLE ON DELETE SET DEFAULT NOT DEFERRABLE )} {} - 13421 { CREATE TABLE t1(a - REFERENCES t2(x) MATCH SIMPLE + 13421 { CREATE TABLE t1(a + REFERENCES t2(x) MATCH SIMPLE ON DELETE RESTRICT ON UPDATE SET DEFAULT NOT DEFERRABLE INITIALLY DEFERRED )} {} - 13432 { CREATE TABLE t1(a - REFERENCES t2(x) MATCH SIMPLE + 13432 { CREATE TABLE t1(a + REFERENCES t2(x) MATCH SIMPLE ON DELETE RESTRICT ON UPDATE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE )} {} - 13523 { CREATE TABLE t1(a - REFERENCES t2(x) MATCH SIMPLE + 13523 { CREATE TABLE t1(a + REFERENCES t2(x) MATCH SIMPLE ON DELETE NO ACTION ON UPDATE SET DEFAULT NOT DEFERRABLE )} {} - 14336 { CREATE TABLE t1(a - REFERENCES t2(x) MATCH STICK + 14336 { CREATE TABLE t1(a + REFERENCES t2(x) MATCH STICK ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE )} {} - 14611 { CREATE TABLE t1(a - REFERENCES t2(x) MATCH STICK + 14611 { CREATE TABLE t1(a + REFERENCES t2(x) MATCH STICK ON UPDATE SET NULL NOT DEFERRABLE INITIALLY DEFERRED )} {} - 15155 { CREATE TABLE t1(a + 15155 { CREATE TABLE t1(a REFERENCES t2(x) ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY IMMEDIATE )} {} - 15453 { CREATE TABLE t1(a + 15453 { CREATE TABLE t1(a REFERENCES t2(x) ON DELETE RESTRICT ON UPDATE NO ACTION NOT DEFERRABLE )} {} - 15661 { CREATE TABLE t1(a + 15661 { CREATE TABLE t1(a REFERENCES t2(x) NOT DEFERRABLE INITIALLY DEFERRED )} {} - 21115 { CREATE TABLE t1(a - REFERENCES t2 MATCH FULL + 21115 { CREATE TABLE t1(a + REFERENCES t2 MATCH FULL ON DELETE SET NULL ON UPDATE SET NULL DEFERRABLE INITIALLY IMMEDIATE )} {} - 21123 { CREATE TABLE t1(a - REFERENCES t2 MATCH FULL + 21123 { CREATE TABLE t1(a + REFERENCES t2 MATCH FULL ON DELETE SET NULL ON UPDATE SET DEFAULT NOT DEFERRABLE )} {} - 21217 { CREATE TABLE t1(a - REFERENCES t2 MATCH FULL ON DELETE SET DEFAULT ON UPDATE SET NULL + 21217 { CREATE TABLE t1(a + REFERENCES t2 MATCH FULL ON DELETE SET DEFAULT ON UPDATE SET NULL )} {} - 21362 { CREATE TABLE t1(a - REFERENCES t2 MATCH FULL + 21362 { CREATE TABLE t1(a + REFERENCES t2 MATCH FULL ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE )} {} - 22143 { CREATE TABLE t1(a - REFERENCES t2 MATCH PARTIAL + 22143 { CREATE TABLE t1(a + REFERENCES t2 MATCH PARTIAL ON DELETE SET NULL ON UPDATE RESTRICT NOT DEFERRABLE )} {} - 22156 { CREATE TABLE t1(a - REFERENCES t2 MATCH PARTIAL + 22156 { CREATE TABLE t1(a + REFERENCES t2 MATCH PARTIAL ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE )} {} - 22327 { CREATE TABLE t1(a - REFERENCES t2 MATCH PARTIAL ON DELETE CASCADE ON UPDATE SET DEFAULT + 22327 { CREATE TABLE t1(a + REFERENCES t2 MATCH PARTIAL ON DELETE CASCADE ON UPDATE SET DEFAULT )} {} - 22663 { CREATE TABLE t1(a + 22663 { CREATE TABLE t1(a REFERENCES t2 MATCH PARTIAL NOT DEFERRABLE )} {} - 23236 { CREATE TABLE t1(a - REFERENCES t2 MATCH SIMPLE + 23236 { CREATE TABLE t1(a + REFERENCES t2 MATCH SIMPLE ON DELETE SET DEFAULT ON UPDATE CASCADE DEFERRABLE )} {} - 24155 { CREATE TABLE t1(a - REFERENCES t2 MATCH STICK + 24155 { CREATE TABLE t1(a + REFERENCES t2 MATCH STICK ON DELETE SET NULL ON UPDATE NO ACTION DEFERRABLE INITIALLY IMMEDIATE )} {} - 24522 { CREATE TABLE t1(a - REFERENCES t2 MATCH STICK + 24522 { CREATE TABLE t1(a + REFERENCES t2 MATCH STICK ON DELETE NO ACTION ON UPDATE SET DEFAULT NOT DEFERRABLE INITIALLY IMMEDIATE )} {} - 24625 { CREATE TABLE t1(a - REFERENCES t2 MATCH STICK + 24625 { CREATE TABLE t1(a + REFERENCES t2 MATCH STICK ON UPDATE SET DEFAULT DEFERRABLE INITIALLY IMMEDIATE )} {} - 25454 { CREATE TABLE t1(a - REFERENCES t2 + 25454 { CREATE TABLE t1(a + REFERENCES t2 ON DELETE RESTRICT ON UPDATE NO ACTION DEFERRABLE INITIALLY DEFERRED )} {} } @@ -525,9 +525,9 @@ do_createtable_tests 1.8 { # EXISTS" clause is specified. # do_createtable_tests 1.9 -error { %s } { - 1 "CREATE TABLE IF NOT EXISTS i1(a, b)" + 1 "CREATE TABLE IF NOT EXISTS i1(a, b)" {{there is already an index named i1}} - 2 "CREATE TABLE IF NOT EXISTS auxa.idx1(a, b)" + 2 "CREATE TABLE IF NOT EXISTS auxa.idx1(a, b)" {{there is already an index named idx1}} } @@ -571,12 +571,12 @@ do_execsql_test e_createtable-1.11.1.1 { SELECT * FROM t4; } {} do_execsql_test e_createtable-1.11.1.2 { DROP TABLE t1 } {} -do_catchsql_test e_createtable-1.11.1.3 { - SELECT * FROM t1 +do_catchsql_test e_createtable-1.11.1.3 { + SELECT * FROM t1 } {1 {no such table: t1}} do_execsql_test e_createtable-1.11.1.4 { DROP TABLE t3 } {} -do_catchsql_test e_createtable-1.11.1.5 { - SELECT * FROM t3 +do_catchsql_test e_createtable-1.11.1.5 { + SELECT * FROM t3 } {1 {no such table: t3}} do_execsql_test e_createtable-1.11.2.1 { @@ -679,7 +679,7 @@ do_createtable_tests 2.2 -tclquery { # the new table is BINARY. # # The following tests create tables based on SELECT statements that read -# from tables that have primary keys, constraints and explicit default +# from tables that have primary keys, constraints and explicit default # collation sequences. None of this is transfered to the definition of # the new table as stored in the sqlite_master table. # @@ -724,7 +724,7 @@ do_execsql_test e_createtable-2.4.0 { # # Each test case below is specified as the name of a table to create # using "CREATE TABLE ... AS SELECT ..." and a SELECT statement to use in -# creating it. The table is created. +# creating it. The table is created. # # Test cases 2.4.*.1 check that after it has been created, the data in the # table is the same as the data returned by the SELECT statement executed as @@ -759,7 +759,7 @@ foreach {tn tbl select} { }] [execsql $select] # Check that the rowids in the new table are a contiguous block starting - # with rowid 1. Note that this will fail if SELECT statement $select + # with rowid 1. Note that this will fail if SELECT statement $select # returns 0 rows (as max(rowid) will be NULL). do_execsql_test e_createtable-2.4.$tn.2 [subst { SELECT min(rowid), count(rowid)==max(rowid) FROM $tbl @@ -850,7 +850,7 @@ do_createtable_tests 3.2.3 -query { # None of the columns in table t1 have an explicit DEFAULT clause. # So testing that the default value of all columns in table t1 is # NULL serves to verify the above. -# +# do_createtable_tests 3.2.3 -query { SELECT quote(x), quote(y), quote(z) FROM t1 } -repair { @@ -914,12 +914,12 @@ do_createtable_tests 3.4.2 -repair { # set sqlite_current_time 1000000000 do_createtable_tests 3.5 -query { - SELECT quote(a), quote(b), quote(c), quote(d), quote(e), quote(f), + SELECT quote(a), quote(b), quote(c), quote(d), quote(e), quote(f), quote(g), quote(h), quote(i), quote(j), quote(k) FROM t4 ORDER BY rowid DESC LIMIT 1; } { 1 "INSERT INTO t4 DEFAULT VALUES" { - NULL {'string constant'} X'424C4F42' 1 -1 3.14 -3.14 + NULL {'string constant'} X'424C4F42' 1 -1 3.14 -3.14 'acd' '01:46:40' '2001-09-09' {'2001-09-09 01:46:40'} } @@ -942,8 +942,8 @@ do_createtable_tests 3.5 -query { # do_execsql_test e_createtable-3.6.1 { CREATE TABLE t5( - a DEFAULT NULL, - b DEFAULT 'text value', + a DEFAULT NULL, + b DEFAULT 'text value', c DEFAULT X'424C4F42', d DEFAULT -45678.6, e DEFAULT 394507 @@ -958,7 +958,7 @@ do_execsql_test e_createtable-3.6.2 { # expression in parentheses, then the expression is evaluated once for # each row inserted and the results used in the new row. # -# Test case 3.6.4 demonstrates that the expression is evaluated +# Test case 3.6.4 demonstrates that the expression is evaluated # separately for each row if the INSERT is an "INSERT INTO ... SELECT ..." # command. # @@ -987,7 +987,7 @@ do_execsql_test e_createtable-3.7.4 { # in the new row is a text representation of the current UTC date and/or # time. # -# This is difficult to test literally without knowing what time the +# This is difficult to test literally without knowing what time the # user will run the tests. Instead, we test that the three cases # above set the value to the current date and/or time according to # the xCurrentTime() method of the VFS. Which is usually the same @@ -997,8 +997,8 @@ do_execsql_test e_createtable-3.7.4 { set sqlite_current_time 1000000000 do_execsql_test e_createtable-3.8.1 { CREATE TABLE t7( - a DEFAULT CURRENT_TIME, - b DEFAULT CURRENT_DATE, + a DEFAULT CURRENT_TIME, + b DEFAULT CURRENT_DATE, c DEFAULT CURRENT_TIMESTAMP ); } {} @@ -1016,7 +1016,7 @@ do_execsql_test e_createtable-3.8.2 { # EVIDENCE-OF: R-07677-44926 The format for CURRENT_TIMESTAMP is # "YYYY-MM-DD HH:MM:SS". # -# The three above are demonstrated by tests 1, 2 and 3 below. +# The three above are demonstrated by tests 1, 2 and 3 below. # Respectively. # do_createtable_tests 3.8.3 -query { @@ -1066,7 +1066,7 @@ do_catchsql_test e_createtable-3.10.2 [subst { # EVIDENCE-OF: R-27775-64721 Both of these limits can be lowered at # runtime using the sqlite3_limit() C/C++ interface. # -# A 30,000 byte blob consumes 30,003 bytes of record space. A record +# A 30,000 byte blob consumes 30,003 bytes of record space. A record # that contains 3 such blobs consumes (30,000*3)+1 bytes of space. Tests # 3.11.4 and 3.11.5, which verify that SQLITE_MAX_LENGTH may be lowered # at runtime, are based on this calculation. @@ -1079,7 +1079,7 @@ do_catchsql_test e_createtable-3.11.2 [subst { CREATE TABLE t11([columns 501]); }] {1 {too many columns on t11}} -# Check that it is not possible to raise the column limit above its +# Check that it is not possible to raise the column limit above its # default compile time value. # sqlite3_limit db SQLITE_LIMIT_COLUMN [expr $::SQLITE_MAX_COLUMN+2] @@ -1097,13 +1097,13 @@ do_catchsql_test e_createtable-3.11.5 { } {1 {string or blob too big}} #------------------------------------------------------------------------- -# Tests for statements regarding constraints (PRIMARY KEY, UNIQUE, NOT +# Tests for statements regarding constraints (PRIMARY KEY, UNIQUE, NOT # NULL and CHECK constraints). # # EVIDENCE-OF: R-52382-54248 Each table in SQLite may have at most one # PRIMARY KEY. -# +# # EVIDENCE-OF: R-31826-01813 An error is raised if more than one PRIMARY # KEY clause appears in a CREATE TABLE statement. # @@ -1139,7 +1139,7 @@ do_catchsql_test 4.1.4 { } {1 {PRIMARY KEY missing on table t7}} -proc table_pk {tbl} { +proc table_pk {tbl} { set pk [list] db eval "pragma table_info($tbl)" a { if {$a(pk)} { lappend pk $a(name) } @@ -1230,12 +1230,12 @@ do_createtable_tests 4.3.3 -error {UNIQUE constraint failed: t1.x} { } do_createtable_tests 4.3.3 -error {UNIQUE constraint failed: t2.x, t2.y} { 6 "UPDATE t2 SET x=0, y='zero' WHERE y='two'" {"columns x, y are"} - 7 "UPDATE t2 SET x='brambles', y='two' WHERE y='three'" + 7 "UPDATE t2 SET x='brambles', y='two' WHERE y='three'" {"columns x, y are"} 8 "UPDATE t2 SET x=45.5, y='one' WHERE y='zero'" {"columns x, y are"} - 9 "UPDATE t2 SET x=X'ABCDEF', y='three' WHERE y='one'" + 9 "UPDATE t2 SET x=X'ABCDEF', y='three' WHERE y='one'" {"columns x, y are"} - 10 "UPDATE t2 SET x=0.0, y='zero' WHERE y='three'" + 10 "UPDATE t2 SET x=0.0, y='zero' WHERE y='three'" {"columns x, y are"} } @@ -1384,7 +1384,7 @@ do_execsql_test 4.10.0 { CREATE TABLE t2(a, b, c, UNIQUE(b, c)); } do_createtable_tests 4.10 { - 1 "EXPLAIN QUERY PLAN SELECT * FROM t1 WHERE b = 5" + 1 "EXPLAIN QUERY PLAN SELECT * FROM t1 WHERE b = 5" {0 0 0 {SEARCH TABLE t1 USING INDEX sqlite_autoindex_t1_1 (b=?)}} 2 "EXPLAIN QUERY PLAN SELECT * FROM t2 ORDER BY b, c" @@ -1398,9 +1398,9 @@ do_createtable_tests 4.10 { # column definition or specified as a table constraint. In practice it # makes no difference. # -# All the tests that deal with CHECK constraints below (4.11.* and +# All the tests that deal with CHECK constraints below (4.11.* and # 4.12.*) are run once for a table with the check constraint attached -# to a column definition, and once with a table where the check +# to a column definition, and once with a table where the check # condition is specified as a table constraint. # # EVIDENCE-OF: R-55435-14303 Each time a new row is inserted into the @@ -1565,7 +1565,7 @@ foreach {tn tbl res ac data} { catchsql COMMIT do_execsql_test 4.15.$tn.1 "BEGIN; INSERT INTO $tbl VALUES(3, 'three')" - do_catchsql_test 4.15.$tn.2 " + do_catchsql_test 4.15.$tn.2 " INSERT INTO $tbl SELECT ((a%2)*a+3), 'string' FROM $tbl; " $res @@ -1583,7 +1583,7 @@ foreach {tn tbl res ac data} { catchsql COMMIT do_execsql_test 4.16.$tn.1 "BEGIN; INSERT INTO $tbl VALUES(3, 'three')" - do_catchsql_test 4.16.$tn.2 " + do_catchsql_test 4.16.$tn.2 " INSERT INTO $tbl SELECT a+3, CASE a WHEN 2 THEN NULL ELSE 'xx' END FROM $tbl " $res @@ -1605,7 +1605,7 @@ foreach {tn tbl res ac data} { catchsql COMMIT do_execsql_test 4.17.$tn.1 "BEGIN; INSERT INTO $tbl VALUES(3, 'three')" - do_catchsql_test 4.17.$tn.2 " + do_catchsql_test 4.17.$tn.2 " INSERT INTO $tbl SELECT ((a%2)*a+3), 'three' FROM $tbl " $res @@ -1618,7 +1618,7 @@ catchsql COMMIT # include a conflict-clause or it is a CHECK constraint, the default # conflict resolution algorithm is ABORT. # -# The first half of the above is tested along with explicit ON +# The first half of the above is tested along with explicit ON # CONFLICT clauses above (specifically, the tests involving t1_xx, t2_xx # and t3_xx). The following just tests that the default conflict # handling for CHECK constraints is ABORT. @@ -1629,7 +1629,7 @@ do_execsql_test 4.18.1 { INSERT INTO t4 VALUES(3, 4); } do_execsql_test 4.18.2 { BEGIN; INSERT INTO t4 VALUES(5, 6) } -do_catchsql_test 4.18.3 { +do_catchsql_test 4.18.3 { INSERT INTO t4 SELECT a+4, b+4 FROM t4 } {1 {CHECK constraint failed: t4}} do_test e_createtable-4.18.4 { sqlite3_get_autocommit db } 0 @@ -1703,7 +1703,7 @@ do_execsql_test 5.2.0 { } do_createtable_tests 5.2 { 1 "SELECT oid, rowid, _rowid_ FROM t2" {one 1 1 three 2 2} - 2 "SELECT oid, rowid, _rowid_ FROM t3" {1 1 six 2 2 eight} + 2 "SELECT oid, rowid, _rowid_ FROM t3" {1 1 six 2 2 eight} 3 "SELECT oid, rowid, _rowid_ FROM t4" {1 eleven 1 2 fourteen 2} } @@ -1731,7 +1731,7 @@ proc is_integer_primary_key {tbl col} { # not become an alias for the rowid and is not classified as an integer # primary key. # -do_createtable_tests 5.3 -tclquery { +do_createtable_tests 5.3 -tclquery { is_integer_primary_key t5 pk } -repair { catchsql { DROP TABLE t5 } @@ -1758,7 +1758,7 @@ do_execsql_test 5.4.1 { CREATE TABLE t7(pk BIGINT primary key); CREATE TABLE t8(pk SHORT INTEGER primary key); CREATE TABLE t9(pk UNSIGNED INTEGER primary key); -} +} do_test e_createtable-5.4.2.1 { is_integer_primary_key t6 pk } 0 do_test e_createtable-5.4.2.2 { is_integer_primary_key t7 pk } 0 do_test e_createtable-5.4.2.3 { is_integer_primary_key t8 pk } 0 @@ -1775,17 +1775,17 @@ do_execsql_test 5.4.3 { SELECT typeof(pk), pk FROM t9; } {integer 2 integer 2 integer 2 integer 2} -do_catchsql_test 5.4.4.1 { - INSERT INTO t6 VALUES(2) +do_catchsql_test 5.4.4.1 { + INSERT INTO t6 VALUES(2) } {1 {UNIQUE constraint failed: t6.pk}} -do_catchsql_test 5.4.4.2 { - INSERT INTO t7 VALUES(2) +do_catchsql_test 5.4.4.2 { + INSERT INTO t7 VALUES(2) } {1 {UNIQUE constraint failed: t7.pk}} -do_catchsql_test 5.4.4.3 { - INSERT INTO t8 VALUES(2) +do_catchsql_test 5.4.4.3 { + INSERT INTO t8 VALUES(2) } {1 {UNIQUE constraint failed: t8.pk}} -do_catchsql_test 5.4.4.4 { - INSERT INTO t9 VALUES(2) +do_catchsql_test 5.4.4.4 { + INSERT INTO t9 VALUES(2) } {1 {UNIQUE constraint failed: t9.pk}} # EVIDENCE-OF: R-56094-57830 the following three table declarations all @@ -1798,7 +1798,7 @@ do_catchsql_test 5.4.4.4 { # in "x" being an alias for the rowid: CREATE TABLE t(x INTEGER PRIMARY # KEY DESC, y, z); # -do_createtable_tests 5 -tclquery { +do_createtable_tests 5 -tclquery { is_integer_primary_key t x } -repair { catchsql { DROP TABLE t } @@ -1821,14 +1821,14 @@ do_execsql_test 5.7.0 { CREATE TABLE t11(a, b INTEGER PRIMARY KEY); INSERT INTO t11 VALUES('ten', 10); } -do_createtable_tests 5.7.1 -query { +do_createtable_tests 5.7.1 -query { SELECT rowid, _rowid_, oid FROM t10; } { 1 "UPDATE t10 SET rowid = 5" {5 5 5} 2 "UPDATE t10 SET _rowid_ = 6" {6 6 6} 3 "UPDATE t10 SET oid = 7" {7 7 7} } -do_createtable_tests 5.7.2 -query { +do_createtable_tests 5.7.2 -query { SELECT rowid, _rowid_, oid, b FROM t11; } { 1 "UPDATE t11 SET rowid = 5" {5 5 5 5} @@ -1840,20 +1840,20 @@ do_createtable_tests 5.7.2 -query { # EVIDENCE-OF: R-58706-14229 Similarly, an INSERT statement may provide # a value to use as the rowid for each row inserted. # -do_createtable_tests 5.8.1 -query { +do_createtable_tests 5.8.1 -query { SELECT rowid, _rowid_, oid FROM t10; -} -repair { - execsql { DELETE FROM t10 } +} -repair { + execsql { DELETE FROM t10 } } { 1 "INSERT INTO t10(oid) VALUES(15)" {15 15 15} 2 "INSERT INTO t10(rowid) VALUES(16)" {16 16 16} 3 "INSERT INTO t10(_rowid_) VALUES(17)" {17 17 17} 4 "INSERT INTO t10(a, b, oid) VALUES(1,2,3)" {3 3 3} } -do_createtable_tests 5.8.2 -query { +do_createtable_tests 5.8.2 -query { SELECT rowid, _rowid_, oid, b FROM t11; -} -repair { - execsql { DELETE FROM t11 } +} -repair { + execsql { DELETE FROM t11 } } { 1 "INSERT INTO t11(oid) VALUES(15)" {15 15 15 15} 2 "INSERT INTO t11(rowid) VALUES(16)" {16 16 16 16} @@ -1870,7 +1870,7 @@ do_createtable_tests 5.8.2 -query { # which show that: # # 1. Attempts to UPDATE a rowid column to a non-integer value fail, -# 2. Attempts to INSERT a real, string or blob value into a rowid +# 2. Attempts to INSERT a real, string or blob value into a rowid # column fail, and # 3. Attempting to INSERT a NULL value into a rowid column causes the # system to automatically select an integer value to use. @@ -1911,7 +1911,7 @@ do_createtable_tests 5.9.2 -error { # "datatype mismatch" error occurs and the statement is aborted. # do_execsql_test 5.10.0 { DELETE FROM t12 } -do_createtable_tests 5.10.1 -error { +do_createtable_tests 5.10.1 -error { datatype mismatch } { 1 "INSERT INTO t12(x) VALUES(4.1)" {} @@ -1920,8 +1920,8 @@ do_createtable_tests 5.10.1 -error { 4 "INSERT INTO t12(x) VALUES(X'3900')" {} 5 "INSERT INTO t12(x) VALUES(X'39')" {} } -do_createtable_tests 5.10.2 -query { - SELECT typeof(x), x FROM t12 +do_createtable_tests 5.10.2 -query { + SELECT typeof(x), x FROM t12 } -repair { execsql { DELETE FROM t12 } } { @@ -1937,13 +1937,13 @@ do_createtable_tests 5.10.2 -query { # chooses an integer value to use as the rowid automatically. # do_execsql_test 5.11.0 { DELETE FROM t12 } -do_createtable_tests 5.11 -query { +do_createtable_tests 5.11 -query { SELECT typeof(x), x FROM t12 WHERE y IS (SELECT max(y) FROM t12) } { 1 "INSERT INTO t12 DEFAULT VALUES" {integer 1} 2 "INSERT INTO t12(y) VALUES(5)" {integer 2} 3 "INSERT INTO t12(x,y) VALUES(NULL, 10)" {integer 3} - 4 "INSERT INTO t12(x,y) SELECT NULL, 15 FROM t12" + 4 "INSERT INTO t12(x,y) SELECT NULL, 15 FROM t12" {integer 4 integer 5 integer 6} 5 "INSERT INTO t12(y) SELECT 20 FROM t12 LIMIT 3" {integer 7 integer 8 integer 9} diff --git a/third_party/sqlite/src/test/e_delete.test b/third_party/sqlite/src/test/e_delete.test index 9bd93229e2c9e..b4e046c945daf 100644 --- a/third_party/sqlite/src/test/e_delete.test +++ b/third_party/sqlite/src/test/e_delete.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file implements tests to verify that the "testable statements" in +# This file implements tests to verify that the "testable statements" in # the lang_delete.html document are correct. # set testdir [file dirname $argv0] @@ -149,7 +149,7 @@ do_delete_tests e_delete-2.1 -error { # attached is not in the temp database, then DELETE statements within # the trigger body must operate on tables within the same database as # it. -# +# # This is tested in two parts. First, check that if a table of the # specified name does not exist, an error is raised. Secondly, test # that if tables with the specified name exist in multiple databases, @@ -182,7 +182,7 @@ do_delete_tests e_delete-2.2.2 { END; INSERT INTO aux.t8 VALUES(1, 2); - SELECT count(*) FROM aux.t9 + SELECT count(*) FROM aux.t9 UNION ALL SELECT count(*) FROM aux2.t9; } {0 1} @@ -193,7 +193,7 @@ do_delete_tests e_delete-2.2.2 { END; INSERT INTO main.t8 VALUES(1, 2); - SELECT count(*) FROM temp.t7 + SELECT count(*) FROM temp.t7 UNION ALL SELECT count(*) FROM main.t7 UNION ALL @@ -222,7 +222,7 @@ do_execsql_test e_delete-2.3.1 { SELECT count(*) FROM temp.t7 UNION ALL SELECT count(*) FROM main.t7 UNION ALL SELECT count(*) FROM aux.t7 UNION ALL SELECT count(*) FROM aux2.t7; - SELECT count(*) FROM main.t8 UNION ALL SELECT count(*) FROM aux.t8 + SELECT count(*) FROM main.t8 UNION ALL SELECT count(*) FROM aux.t8 UNION ALL SELECT count(*) FROM aux2.t8; SELECT count(*) FROM aux.t9 UNION ALL SELECT count(*) FROM aux2.t9; @@ -242,7 +242,7 @@ do_execsql_test e_delete-2.3.3 { SELECT count(*) FROM temp.t7 UNION ALL SELECT count(*) FROM main.t7 UNION ALL SELECT count(*) FROM aux.t7 UNION ALL SELECT count(*) FROM aux2.t7; - SELECT count(*) FROM main.t8 UNION ALL SELECT count(*) FROM aux.t8 + SELECT count(*) FROM main.t8 UNION ALL SELECT count(*) FROM aux.t8 UNION ALL SELECT count(*) FROM aux2.t8; SELECT count(*) FROM aux.t9 UNION ALL SELECT count(*) FROM aux2.t9; @@ -455,7 +455,7 @@ do_delete_tests e_delete-3.9 -repair rebuild_t1 -query { # In practice, rows are always deleted in rowid order. # do_delete_tests e_delete-3.10 -repair { - rebuild_t1 + rebuild_t1 catchsql { DROP TABLE t1log } execsql { CREATE TABLE t1log(x); @@ -473,5 +473,5 @@ do_delete_tests e_delete-3.10 -repair { } } - + finish_test diff --git a/third_party/sqlite/src/test/e_droptrigger.test b/third_party/sqlite/src/test/e_droptrigger.test index 84dfe7279a4a2..8d9c123c4e02f 100644 --- a/third_party/sqlite/src/test/e_droptrigger.test +++ b/third_party/sqlite/src/test/e_droptrigger.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file implements tests to verify that the "testable statements" in +# This file implements tests to verify that the "testable statements" in # the lang_droptrigger.html document are correct. # @@ -74,25 +74,25 @@ proc droptrigger_reopen_db {{event INSERT}} { do_droptrigger_tests 1.1 -repair { droptrigger_reopen_db } -tclquery { - list_all_triggers + list_all_triggers } { - 1 "DROP TRIGGER main.tr1" + 1 "DROP TRIGGER main.tr1" {main.tr2 temp.tr1 aux.tr1 aux.tr2 aux.tr3} - 2 "DROP TRIGGER IF EXISTS main.tr1" + 2 "DROP TRIGGER IF EXISTS main.tr1" {main.tr2 temp.tr1 aux.tr1 aux.tr2 aux.tr3} - 3 "DROP TRIGGER tr1" + 3 "DROP TRIGGER tr1" {main.tr1 main.tr2 aux.tr1 aux.tr2 aux.tr3} - 4 "DROP TRIGGER IF EXISTS tr1" + 4 "DROP TRIGGER IF EXISTS tr1" {main.tr1 main.tr2 aux.tr1 aux.tr2 aux.tr3} - 5 "DROP TRIGGER aux.tr1" + 5 "DROP TRIGGER aux.tr1" {main.tr1 main.tr2 temp.tr1 aux.tr2 aux.tr3} - 6 "DROP TRIGGER IF EXISTS aux.tr1" + 6 "DROP TRIGGER IF EXISTS aux.tr1" {main.tr1 main.tr2 temp.tr1 aux.tr2 aux.tr3} - 7 "DROP TRIGGER IF EXISTS aux.xxx" + 7 "DROP TRIGGER IF EXISTS aux.xxx" {main.tr1 main.tr2 temp.tr1 aux.tr1 aux.tr2 aux.tr3} - 8 "DROP TRIGGER IF EXISTS aux.xxx" + 8 "DROP TRIGGER IF EXISTS aux.xxx" {main.tr1 main.tr2 temp.tr1 aux.tr1 aux.tr2 aux.tr3} } diff --git a/third_party/sqlite/src/test/e_dropview.test b/third_party/sqlite/src/test/e_dropview.test index 04c4ad8c4b678..9add2a07ae1a2 100644 --- a/third_party/sqlite/src/test/e_dropview.test +++ b/third_party/sqlite/src/test/e_dropview.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file implements tests to verify that the "testable statements" in +# This file implements tests to verify that the "testable statements" in # the lang_dropview.html document are correct. # @@ -24,7 +24,7 @@ proc dropview_reopen_db {} { db eval { ATTACH 'test.db2' AS aux; - CREATE TABLE t1(a, b); + CREATE TABLE t1(a, b); INSERT INTO t1 VALUES('a main', 'b main'); CREATE VIEW v1 AS SELECT * FROM t1; CREATE VIEW v2 AS SELECT * FROM t1; @@ -100,7 +100,7 @@ do_execsql_test 2.1 { do_execsql_test 2.2 {; SELECT * FROM sqlite_master WHERE name = 'new view'; } { - view {new view} {new view} 0 + view {new view} {new view} 0 {CREATE VIEW "new view" AS SELECT * FROM t1 AS x, t1 AS y} } do_execsql_test 2.3 { @@ -117,7 +117,7 @@ do_catchsql_test 2.4 { # # For each view in the database, check that it can be queried. Then drop # it. Check that it can no longer be queried and is no longer listed -# in any schema table. Then check that the contents of the db tables have +# in any schema table. Then check that the contents of the db tables have # not changed # set databasedata [list_all_data] @@ -162,7 +162,7 @@ do_test 3.5.4 { list_all_data } $databasedata # the IF EXISTS clause is not present, it is an error. # do_dropview_tests 4 -repair { - dropview_reopen_db + dropview_reopen_db } -errorformat { no such view: %s } { diff --git a/third_party/sqlite/src/test/e_expr.test b/third_party/sqlite/src/test/e_expr.test index de7b43c92e184..36c9e7b5c5e2d 100644 --- a/third_party/sqlite/src/test/e_expr.test +++ b/third_party/sqlite/src/test/e_expr.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file implements tests to verify that the "testable statements" in +# This file implements tests to verify that the "testable statements" in # the lang_expr.html document are correct. # @@ -64,8 +64,8 @@ foreach {prec opl} { 7 AND 8 OR } { - foreach op $opl { - set ::opprec($op) $prec + foreach op $opl { + set ::opprec($op) $prec lappend oplist $op } } @@ -122,7 +122,7 @@ foreach op1 $oplist { # If $op2 groups more tightly than $op1, then the result # of executing $sql1 whould be the same as executing $sql3. - # If $op1 groups more tightly, or if $op1 and $op2 have + # If $op1 groups more tightly, or if $op1 and $op2 have # the same precedence, then executing $sql1 should return # the same value as $sql2. # @@ -151,33 +151,33 @@ do_test e_expr-1.1 { array names untested } {} # was returning {1 1 0}. This would seem to indicate that LIKE has the # same precedence as '<'. Which is incorrect. It has lower precedence. # -do_execsql_test e_expr-1.2.1 { +do_execsql_test e_expr-1.2.1 { SELECT 0 < 2 LIKE 1, (0 < 2) LIKE 1, 0 < (2 LIKE 1) } {1 1 0} -do_execsql_test e_expr-1.2.2 { +do_execsql_test e_expr-1.2.2 { SELECT 0 LIKE 0 < 2, (0 LIKE 0) < 2, 0 LIKE (0 < 2) } {0 1 0} # Showing that LIKE and == have the same precedence # -do_execsql_test e_expr-1.2.3 { +do_execsql_test e_expr-1.2.3 { SELECT 2 LIKE 2 == 1, (2 LIKE 2) == 1, 2 LIKE (2 == 1) } {1 1 0} -do_execsql_test e_expr-1.2.4 { +do_execsql_test e_expr-1.2.4 { SELECT 2 == 2 LIKE 1, (2 == 2) LIKE 1, 2 == (2 LIKE 1) } {1 1 0} -# Showing that < groups more tightly than == (< has higher precedence). +# Showing that < groups more tightly than == (< has higher precedence). # -do_execsql_test e_expr-1.2.5 { +do_execsql_test e_expr-1.2.5 { SELECT 0 < 2 == 1, (0 < 2) == 1, 0 < (2 == 1) } {1 1 0} -do_execsql_test e_expr-1.6 { +do_execsql_test e_expr-1.6 { SELECT 0 == 0 < 2, (0 == 0) < 2, 0 == (0 < 2) } {0 1 0} #------------------------------------------------------------------------- -# Check that the four unary prefix operators mentioned in the +# Check that the four unary prefix operators mentioned in the # documentation exist. # # EVIDENCE-OF: R-13958-53419 Supported unary prefix operators are these: @@ -247,7 +247,7 @@ foreach {tn a b} { } { set as [db one "SELECT $a"] set bs [db one "SELECT $b"] - + do_execsql_test e_expr-5.$tn "SELECT $a || $b" [list "${as}${bs}"] } @@ -263,7 +263,7 @@ do_execsql_test e_expr-6.3 {SELECT -72%-5} {-2} do_execsql_test e_expr-6.4 {SELECT -72%5} {-2} #------------------------------------------------------------------------- -# Test that the results of all binary operators are either numeric or +# Test that the results of all binary operators are either numeric or # NULL, except for the || operator, which may evaluate to either a text # value or NULL. # @@ -279,7 +279,7 @@ set literals { 13 NULL } foreach op $oplist { - foreach {n1 rhs} $literals { + foreach {n1 rhs} $literals { foreach {n2 lhs} $literals { set t [db one " SELECT typeof($lhs $op $rhs) "] @@ -327,7 +327,7 @@ do_execsql_test e_expr-8.1.14 { SELECT 'ab' != NULL } {{}} do_execsql_test e_expr-8.1.15 { SELECT NULL != 'ab' } {{}} do_execsql_test e_expr-8.1.16 { SELECT 'ab' != 'ab' } {0} -foreach {n1 rhs} $literals { +foreach {n1 rhs} $literals { foreach {n2 lhs} $literals { if {$rhs!="NULL" && $lhs!="NULL"} { set eq [execsql "SELECT $lhs = $rhs, $lhs != $rhs"] @@ -347,10 +347,10 @@ foreach {n1 rhs} $literals { #------------------------------------------------------------------------- # Run some tests on the COLLATE "unary postfix operator". # -# This collation sequence reverses both arguments before using +# This collation sequence reverses both arguments before using # [string compare] to compare them. For example, when comparing the # strings 'one' and 'four', return the result of: -# +# # string compare eno ruof # proc reverse_str {zStr} { @@ -394,18 +394,18 @@ do_execsql_test e_expr-9.19 { SELECT ('abcd' <> 'ABCD') COLLATE nocase } 1 do_execsql_test e_expr-9.20 { SELECT 'abcd' IS NOT 'ABCD' COLLATE nocase } 0 do_execsql_test e_expr-9.21 { SELECT ('abcd' IS NOT 'ABCD') COLLATE nocase } 1 -do_execsql_test e_expr-9.22 { - SELECT 'bbb' BETWEEN 'AAA' AND 'CCC' COLLATE nocase +do_execsql_test e_expr-9.22 { + SELECT 'bbb' BETWEEN 'AAA' AND 'CCC' COLLATE nocase } 1 -do_execsql_test e_expr-9.23 { - SELECT ('bbb' BETWEEN 'AAA' AND 'CCC') COLLATE nocase +do_execsql_test e_expr-9.23 { + SELECT ('bbb' BETWEEN 'AAA' AND 'CCC') COLLATE nocase } 0 # EVIDENCE-OF: R-58731-25439 The collating sequence set by the COLLATE # operator overrides the collating sequence determined by the COLLATE # clause in a table column definition. # -do_execsql_test e_expr-9.24 { +do_execsql_test e_expr-9.24 { CREATE TABLE t24(a COLLATE NOCASE, b); INSERT INTO t24 VALUES('aaa', 1); INSERT INTO t24 VALUES('bbb', 2); @@ -545,7 +545,7 @@ foreach {tn sql} [list \ # holds a spot for a named parameter with the name :AAAA. # # Identifiers in SQLite consist of alphanumeric, '_' and '$' characters, -# and any UTF characters with codepoints larger than 127 (non-ASCII +# and any UTF characters with codepoints larger than 127 (non-ASCII # characters). # parameter_test e_expr-11.2.1 {SELECT :AAAA} {1 :AAAA} -1 @@ -576,7 +576,7 @@ parameter_test e_expr-11.3.6 "SELECT @\u0080" "1 @\u0080" -1 # include one or more occurrences of "::" and a suffix enclosed in # "(...)" containing any text at all. # -# Note: Looks like an identifier cannot consist entirely of "::" +# Note: Looks like an identifier cannot consist entirely of "::" # characters or just a suffix. Also, the other named variable characters # (: and @) work the same way internally. Why not just document it that way? # @@ -592,7 +592,7 @@ parameter_test e_expr-11.4.6 "SELECT \$\u0080" "1 \$\u0080" -1 parameter_test e_expr-11.5.1 {SELECT $::::a(++--++)} {1 $::::a(++--++)} -1 parameter_test e_expr-11.5.2 {SELECT $::a()} {1 $::a()} -1 parameter_test e_expr-11.5.3 {SELECT $::1(::#$)} {1 $::1(::#$)} -1 - + # EVIDENCE-OF: R-11370-04520 Named parameters are also numbered. The # number assigned is one greater than the largest parameter number # already assigned. @@ -624,7 +624,7 @@ do_test e_expr-11.7.1 { list [sqlite3_column_type $stmt 0] \ [sqlite3_column_type $stmt 1] \ [sqlite3_column_type $stmt 2] \ - [sqlite3_column_type $stmt 3] + [sqlite3_column_type $stmt 3] } {NULL NULL NULL NULL} do_test e_expr-11.7.1 { sqlite3_finalize $stmt } SQLITE_OK @@ -636,14 +636,14 @@ do_test e_expr-11.7.1 { sqlite3_finalize $stmt } SQLITE_OK do_execsql_test e_expr-12.1.1 { SELECT 0, +0, -0 } {0 0 0} do_execsql_test e_expr-12.1.2 { SELECT 1, +1, -1 } {1 1 -1} do_execsql_test e_expr-12.1.3 { SELECT 2, +2, -2 } {2 2 -2} -do_execsql_test e_expr-12.1.4 { - SELECT 1.4, +1.4, -1.4 +do_execsql_test e_expr-12.1.4 { + SELECT 1.4, +1.4, -1.4 } {1.4 1.4 -1.4} -do_execsql_test e_expr-12.1.5 { - SELECT 1.5e+5, +1.5e+5, -1.5e+5 +do_execsql_test e_expr-12.1.5 { + SELECT 1.5e+5, +1.5e+5, -1.5e+5 } {150000.0 150000.0 -150000.0} -do_execsql_test e_expr-12.1.6 { - SELECT 0.0001, +0.0001, -0.0001 +do_execsql_test e_expr-12.1.6 { + SELECT 0.0001, +0.0001, -0.0001 } {0.0001 0.0001 -0.0001} # -- syntax diagram literal-value @@ -688,7 +688,7 @@ foreach {tn expr} { 12 :world 13 $tcl 14 $tcl(array) - + 15 cname 16 tblname.cname 17 dbname.tblname.cname @@ -720,21 +720,21 @@ foreach {tn expr} { 41 "EXPR1 IS NOT EXPR2" 42 "EXPR1 AND EXPR2" 43 "EXPR1 OR EXPR2" - + 44 "count(*)" 45 "count(DISTINCT EXPR)" 46 "substr(EXPR, 10, 20)" 47 "changes()" - + 48 "( EXPR )" - + 49 "CAST ( EXPR AS integer )" 50 "CAST ( EXPR AS 'abcd' )" 51 "CAST ( EXPR AS 'ab$ $cd' )" - + 52 "EXPR COLLATE nocase" 53 "EXPR COLLATE binary" - + 54 "EXPR1 LIKE EXPR2" 55 "EXPR1 LIKE EXPR2 ESCAPE EXPR" 56 "EXPR1 GLOB EXPR2" @@ -751,11 +751,11 @@ foreach {tn expr} { 67 "EXPR1 NOT REGEXP EXPR2 ESCAPE EXPR" 68 "EXPR1 NOT MATCH EXPR2" 69 "EXPR1 NOT MATCH EXPR2 ESCAPE EXPR" - + 70 "EXPR ISNULL" 71 "EXPR NOTNULL" 72 "EXPR NOT NULL" - + 73 "EXPR1 IS EXPR2" 74 "EXPR1 IS NOT EXPR2" @@ -787,16 +787,16 @@ foreach {tn expr} { } { # If the expression string being parsed contains "EXPR2", then replace - # string "EXPR1" and "EXPR2" with arbitrary SQL expressions. If it + # string "EXPR1" and "EXPR2" with arbitrary SQL expressions. If it # contains "EXPR", then replace EXPR with an arbitrary SQL expression. - # + # set elist [list $expr] if {[string match *EXPR2* $expr]} { set elist [list] foreach {e1 e2} { cname "34+22" } { lappend elist [string map [list EXPR1 $e1 EXPR2 $e2] $expr] } - } + } if {[string match *EXPR* $expr]} { set elist2 [list] foreach el $elist { @@ -810,7 +810,7 @@ foreach {tn expr} { set x 0 foreach e $elist { incr x - do_test e_expr-12.3.$tn.$x { + do_test e_expr-12.3.$tn.$x { set rc [catch { execsql "SELECT $e FROM tblname" } msg] } {0} } @@ -861,7 +861,7 @@ foreach {tn x expr res nEval} { # EVIDENCE-OF: R-05155-34454 The precedence of the BETWEEN operator is # the same as the precedence as operators == and != and LIKE and groups # left to right. -# +# # Therefore, BETWEEN groups more tightly than operator "AND", but less # so than "<". # @@ -957,11 +957,11 @@ ifcapable !icu { # then the expression following the ESCAPE keyword must evaluate to a # string consisting of a single character. # -do_catchsql_test e_expr-14.6.1 { - SELECT 'A' LIKE 'a' ESCAPE '12' +do_catchsql_test e_expr-14.6.1 { + SELECT 'A' LIKE 'a' ESCAPE '12' } {1 {ESCAPE expression must be a single character}} -do_catchsql_test e_expr-14.6.2 { - SELECT 'A' LIKE 'a' ESCAPE '' +do_catchsql_test e_expr-14.6.2 { + SELECT 'A' LIKE 'a' ESCAPE '' } {1 {ESCAPE expression must be a single character}} do_catchsql_test e_expr-14.6.3 { SELECT 'A' LIKE 'a' ESCAPE 'x' } {0 1} do_catchsql_test e_expr-14.6.4 "SELECT 'A' LIKE 'a' ESCAPE '\u00e6'" {0 1} @@ -1073,10 +1073,10 @@ sqlite3 db test.db # There is a regexp function if ICU is enabled though. # ifcapable !icu { - do_catchsql_test e_expr-18.1.1 { - SELECT regexp('abc', 'def') + do_catchsql_test e_expr-18.1.1 { + SELECT regexp('abc', 'def') } {1 {no such function: regexp}} - do_catchsql_test e_expr-18.1.2 { + do_catchsql_test e_expr-18.1.2 { SELECT 'abc' REGEXP 'def' } {1 {no such function: REGEXP}} } @@ -1104,10 +1104,10 @@ sqlite3 db test.db # EVIDENCE-OF: R-42037-37826 The default match() function implementation # raises an exception and is not really useful for anything. # -do_catchsql_test e_expr-19.1.1 { - SELECT 'abc' MATCH 'def' +do_catchsql_test e_expr-19.1.1 { + SELECT 'abc' MATCH 'def' } {1 {unable to use function MATCH in the requested context}} -do_catchsql_test e_expr-19.1.2 { +do_catchsql_test e_expr-19.1.2 { SELECT match('abc', 'def') } {1 {unable to use function MATCH in the requested context}} @@ -1156,16 +1156,16 @@ db func var var foreach {a b c} {0 0 0} break set varlist [list] do_execsql_test e_expr-21.1.1 { - SELECT CASE WHEN var('a') THEN 'A' - WHEN var('b') THEN 'B' + SELECT CASE WHEN var('a') THEN 'A' + WHEN var('b') THEN 'B' WHEN var('c') THEN 'C' END } {{}} do_test e_expr-21.1.2 { set varlist } {a b c} set varlist [list] do_execsql_test e_expr-21.1.3 { - SELECT CASE WHEN var('c') THEN 'C' - WHEN var('b') THEN 'B' - WHEN var('a') THEN 'A' + SELECT CASE WHEN var('c') THEN 'C' + WHEN var('b') THEN 'B' + WHEN var('a') THEN 'A' ELSE 'no result' END } {{no result}} @@ -1177,24 +1177,24 @@ do_test e_expr-21.1.4 { set varlist } {c b a} # foreach {a b c} {0 1 0} break do_execsql_test e_expr-21.2.1 { - SELECT CASE WHEN var('a') THEN 'A' - WHEN var('b') THEN 'B' - WHEN var('c') THEN 'C' + SELECT CASE WHEN var('a') THEN 'A' + WHEN var('b') THEN 'B' + WHEN var('c') THEN 'C' ELSE 'no result' END } {B} foreach {a b c} {0 1 1} break do_execsql_test e_expr-21.2.2 { - SELECT CASE WHEN var('a') THEN 'A' - WHEN var('b') THEN 'B' + SELECT CASE WHEN var('a') THEN 'A' + WHEN var('b') THEN 'B' WHEN var('c') THEN 'C' ELSE 'no result' END } {B} foreach {a b c} {0 0 1} break do_execsql_test e_expr-21.2.3 { - SELECT CASE WHEN var('a') THEN 'A' - WHEN var('b') THEN 'B' + SELECT CASE WHEN var('a') THEN 'A' + WHEN var('b') THEN 'B' WHEN var('c') THEN 'C' ELSE 'no result' END @@ -1206,8 +1206,8 @@ do_execsql_test e_expr-21.2.3 { # foreach {a b c} {0 0 0} break do_execsql_test e_expr-21.3.1 { - SELECT CASE WHEN var('a') THEN 'A' - WHEN var('b') THEN 'B' + SELECT CASE WHEN var('a') THEN 'A' + WHEN var('b') THEN 'B' WHEN var('c') THEN 'C' ELSE 'no result' END @@ -1218,8 +1218,8 @@ do_execsql_test e_expr-21.3.1 { # db nullvalue null do_execsql_test e_expr-21.3.2 { - SELECT CASE WHEN var('a') THEN 'A' - WHEN var('b') THEN 'B' + SELECT CASE WHEN var('a') THEN 'A' + WHEN var('b') THEN 'B' WHEN var('c') THEN 'C' END } {null} @@ -1351,17 +1351,17 @@ do_execsql_test e_expr-24.1.2 { set varlist [list] foreach {a b c} {0 1 0} break do_execsql_test e_expr-25.1.1 { - SELECT CASE WHEN var('a') THEN 'A' - WHEN var('b') THEN 'B' - WHEN var('c') THEN 'C' + SELECT CASE WHEN var('a') THEN 'A' + WHEN var('b') THEN 'B' + WHEN var('c') THEN 'C' END } {B} do_test e_expr-25.1.2 { set ::varlist } {a b} set varlist [list] do_execsql_test e_expr-25.1.3 { - SELECT CASE '0' WHEN var('a') THEN 'A' - WHEN var('b') THEN 'B' - WHEN var('c') THEN 'C' + SELECT CASE '0' WHEN var('a') THEN 'A' + WHEN var('b') THEN 'B' + WHEN var('c') THEN 'C' END } {A} do_test e_expr-25.1.4 { set ::varlist } {a} @@ -1398,10 +1398,10 @@ do_execsql_test e_expr-26.1.4 { do_test e_expr-26.1.5 { set ::evalcount } {3} set ::evalcount 0 do_execsql_test e_expr-26.1.6 { - SELECT CASE - WHEN ceval(x)=w1 THEN r1 - WHEN ceval(x)=w2 THEN r2 - ELSE r3 END + SELECT CASE + WHEN ceval(x)=w1 THEN r1 + WHEN ceval(x)=w2 THEN r2 + ELSE r3 END FROM t2 } {R1 R2 R3} do_test e_expr-26.1.6 { set ::evalcount } {5} @@ -1423,7 +1423,7 @@ do_execsql_test e_expr-27.1.1 { SELECT typeof(a), a, typeof(b), b, typeof(c), c FROM t3; } {blob UVU text 1.23abc real 4.5} do_execsql_test e_expr-27.1.2 { - SELECT + SELECT typeof(CAST(X'555655' as TEXT)), CAST(X'555655' as TEXT), typeof(CAST('1.23abc' as REAL)), CAST('1.23abc' as REAL), typeof(CAST(4.5 as INTEGER)), CAST(4.5 as INTEGER) @@ -1441,7 +1441,7 @@ do_expr_test e_expr-27.2.4 { CAST(NULL AS number) } null {} # is determined by applying the rules for determining column affinity to # the type-name. # -# The R-29283-15561 requirement above is demonstrated by all of the +# The R-29283-15561 requirement above is demonstrated by all of the # subsequent e_expr-26 tests. # # EVIDENCE-OF: R-43522-35548 Casting a value to a type-name with no @@ -1517,13 +1517,13 @@ rename db db2 sqlite3 db :memory: ifcapable {utf16} { db eval { PRAGMA encoding = 'utf-16le' } -do_expr_test e_expr-29.1.5 { +do_expr_test e_expr-29.1.5 { CAST (X'31002E0032003300' AS REAL) } real 1.23 -do_expr_test e_expr-29.1.6 { +do_expr_test e_expr-29.1.6 { CAST (X'3200330030002E003000' AS REAL) } real 230.0 -do_expr_test e_expr-29.1.7 { +do_expr_test e_expr-29.1.7 { CAST (X'2D0039002E0038003700' AS REAL) } real -9.87 -do_expr_test e_expr-29.1.8 { +do_expr_test e_expr-29.1.8 { CAST (X'30002E003000300030003100' AS REAL) } real 0.0001 } db close @@ -1558,11 +1558,11 @@ do_expr_test e_expr-29.4.3 { CAST('XXI' AS REAL) } real 0.0 # do_expr_test e_expr-30.1.1 { CAST(X'313233' AS INTEGER) } integer 123 do_expr_test e_expr-30.1.2 { CAST(X'2D363738' AS INTEGER) } integer -678 -do_expr_test e_expr-30.1.3 { - CAST(X'31303030303030' AS INTEGER) +do_expr_test e_expr-30.1.3 { + CAST(X'31303030303030' AS INTEGER) } integer 1000000 -do_expr_test e_expr-30.1.4 { - CAST(X'2D31313235383939393036383432363234' AS INTEGER) +do_expr_test e_expr-30.1.4 { + CAST(X'2D31313235383939393036383432363234' AS INTEGER) } integer -1125899906842624 rename db db2 @@ -1571,11 +1571,11 @@ ifcapable {utf16} { execsql { PRAGMA encoding = 'utf-16be' } do_expr_test e_expr-30.1.5 { CAST(X'003100320033' AS INTEGER) } integer 123 do_expr_test e_expr-30.1.6 { CAST(X'002D003600370038' AS INTEGER) } integer -678 -do_expr_test e_expr-30.1.7 { - CAST(X'0031003000300030003000300030' AS INTEGER) +do_expr_test e_expr-30.1.7 { + CAST(X'0031003000300030003000300030' AS INTEGER) } integer 1000000 -do_expr_test e_expr-30.1.8 { - CAST(X'002D0031003100320035003800390039003900300036003800340032003600320034' AS INTEGER) +do_expr_test e_expr-30.1.8 { + CAST(X'002D0031003100320035003800390039003900300036003800340032003600320034' AS INTEGER) } integer -1125899906842624 } db close @@ -1630,10 +1630,10 @@ do_expr_test e_expr-31.1.4 { CAST(-0.99999 AS INTEGER) } integer 0 # do_expr_test e_expr-31.2.1 { CAST(2e+50 AS INT) } integer 9223372036854775807 do_expr_test e_expr-31.2.2 { CAST(-2e+50 AS INT) } integer -9223372036854775808 -do_expr_test e_expr-31.2.3 { +do_expr_test e_expr-31.2.3 { CAST(-9223372036854775809.0 AS INT) } integer -9223372036854775808 -do_expr_test e_expr-31.2.4 { +do_expr_test e_expr-31.2.4 { CAST(9223372036854775809.0 AS INT) } integer 9223372036854775807 @@ -1656,10 +1656,10 @@ do_expr_test e_expr-32.1.5 { CAST('11.1abc' AS NUMERIC) } real 11.1 do_expr_test e_expr-32.2.1 { CAST(13.0 AS NUMERIC) } real 13.0 do_expr_test e_expr-32.2.2 { CAST(13.5 AS NUMERIC) } real 13.5 -do_expr_test e_expr-32.2.3 { +do_expr_test e_expr-32.2.3 { CAST(-9223372036854775808 AS NUMERIC) } integer -9223372036854775808 -do_expr_test e_expr-32.2.4 { +do_expr_test e_expr-32.2.4 { CAST(9223372036854775807 AS NUMERIC) } integer 9223372036854775807 @@ -1715,7 +1715,7 @@ do_execsql_test e_expr-34.1 { # EVIDENCE-OF: R-25588-27181 The EXISTS operator always evaluates to one # of the integer values 0 and 1. # -# This statement is not tested by itself. Instead, all e_expr-34.* tests +# This statement is not tested by itself. Instead, all e_expr-34.* tests # following this point explicitly test that specific invocations of EXISTS # return either integer 0 or integer 1. # @@ -1806,10 +1806,10 @@ do_expr_test e_expr-35.1.2 { (SELECT NULL) } null {} do_expr_test e_expr-35.1.3 { (SELECT count(*) FROM t2) } integer 3 do_expr_test e_expr-35.1.4 { (SELECT 4 FROM t2) } integer 4 -do_expr_test e_expr-35.1.5 { +do_expr_test e_expr-35.1.5 { (SELECT b FROM t2 UNION SELECT a+1 FROM t2) } null {} -do_expr_test e_expr-35.1.6 { +do_expr_test e_expr-35.1.6 { (SELECT a FROM t2 UNION SELECT COALESCE(b, 55) FROM t2 ORDER BY 1) } integer 4 @@ -1854,7 +1854,7 @@ foreach {tn expr restype resval} { 7 { ( SELECT sum(x) FROM t4 ) } integer 6 8 { ( SELECT group_concat(y,'') FROM t4 ) } text onetwothree - 9 { ( SELECT max(x) FROM t4 WHERE y LIKE '___') } integer 2 + 9 { ( SELECT max(x) FROM t4 WHERE y LIKE '___') } integer 2 } { do_expr_test e_expr-36.3.$tn $expr $restype $resval diff --git a/third_party/sqlite/src/test/e_fkey.test b/third_party/sqlite/src/test/e_fkey.test index 99f1ae8e62bc0..9aca06833f263 100644 --- a/third_party/sqlite/src/test/e_fkey.test +++ b/third_party/sqlite/src/test/e_fkey.test @@ -12,8 +12,8 @@ # This file implements tests to verify the "testable statements" in the # foreignkeys.in document. # -# The tests in this file are arranged to mirror the structure of -# foreignkey.in, with one exception: The statements in section 2, which +# The tests in this file are arranged to mirror the structure of +# foreignkey.in, with one exception: The statements in section 2, which # deals with enabling/disabling foreign key support, is tested first, # before section 1. This is because some statements in section 2 deal # with builds that do not include complete foreign key support (because @@ -99,7 +99,7 @@ ifcapable !trigger&&foreignkey { # foreign key definitions cannot even be parsed (attempting to specify a # foreign key definition is a syntax error). # -# Specifically, test that foreign key constraints cannot even be parsed +# Specifically, test that foreign key constraints cannot even be parsed # in such a build. # reset_db @@ -148,7 +148,7 @@ do_test e_fkey-4.1 { INSERT INTO c VALUES('hello'); UPDATE p SET i = 'world'; SELECT * FROM c; - } + } } {hello} do_test e_fkey-4.2 { execsql { @@ -159,7 +159,7 @@ do_test e_fkey-4.2 { INSERT INTO c VALUES('hello'); UPDATE p SET i = 'world'; SELECT * FROM c; - } + } } {world} #------------------------------------------------------------------------- @@ -171,19 +171,19 @@ do_test e_fkey-4.2 { # This also tests the example code in section 2 of foreignkeys.in. # # EVIDENCE-OF: R-11255-19907 -# +# reset_db do_test e_fkey-5.1 { execsql { PRAGMA foreign_keys } } {0} do_test e_fkey-5.2 { - execsql { + execsql { PRAGMA foreign_keys = ON; PRAGMA foreign_keys; } } {1} do_test e_fkey-5.3 { - execsql { + execsql { PRAGMA foreign_keys = OFF; PRAGMA foreign_keys; } @@ -247,12 +247,12 @@ execsql "PRAGMA foreign_keys = ON" do_test e_fkey-7.1 { execsql { CREATE TABLE artist( - artistid INTEGER PRIMARY KEY, + artistid INTEGER PRIMARY KEY, artistname TEXT ); CREATE TABLE track( - trackid INTEGER, - trackname TEXT, + trackid INTEGER, + trackname TEXT, trackartist INTEGER, FOREIGN KEY(trackartist) REFERENCES artist(artistid) ); @@ -276,7 +276,7 @@ do_test e_fkey-8.2 { } {} #------------------------------------------------------------------------- -# Attempting to delete a row from the 'artist' table while there are +# Attempting to delete a row from the 'artist' table while there are # dependent rows in the track table also fails. # # EVIDENCE-OF: R-24401-52400 as will attempting to delete a row from the @@ -286,7 +286,7 @@ do_test e_fkey-9.1 { catchsql { DELETE FROM artist WHERE artistid = 2 } } {1 {FOREIGN KEY constraint failed}} do_test e_fkey-9.2 { - execsql { + execsql { DELETE FROM track WHERE trackartist = 2; DELETE FROM artist WHERE artistid = 2; } @@ -321,7 +321,7 @@ do_test e_fkey-10.4 { catchsql { DELETE FROM artist WHERE artistid = 5} } {1 {FOREIGN KEY constraint failed}} do_test e_fkey-10.5 { - execsql { + execsql { UPDATE track SET trackartist = NULL WHERE trackid = 1; DELETE FROM artist WHERE artistid = 5; } @@ -330,7 +330,7 @@ do_test e_fkey-10.5 { #------------------------------------------------------------------------- # Test that the following is true fo all rows in the track table: # -# trackartist IS NULL OR +# trackartist IS NULL OR # EXISTS(SELECT 1 FROM artist WHERE artistid=trackartist) # # EVIDENCE-OF: R-52486-21352 Expressed in SQL, this means that for every @@ -338,14 +338,14 @@ do_test e_fkey-10.5 { # trackartist IS NULL OR EXISTS(SELECT 1 FROM artist WHERE # artistid=trackartist) -# This procedure executes a test case to check that statement +# This procedure executes a test case to check that statement # R-52486-21352 is true after executing the SQL statement passed. # as the second argument. proc test_r52486_21352 {tn sql} { set res [catchsql $sql] set results { - {0 {}} - {1 {UNIQUE constraint failed: artist.artistid}} + {0 {}} + {1 {UNIQUE constraint failed: artist.artistid}} {1 {FOREIGN KEY constraint failed}} } if {[lsearch $results $res]<0} { @@ -355,7 +355,7 @@ proc test_r52486_21352 {tn sql} { do_test e_fkey-11.$tn { execsql { SELECT count(*) FROM track WHERE NOT ( - trackartist IS NULL OR + trackartist IS NULL OR EXISTS(SELECT 1 FROM artist WHERE artistid=trackartist) ) } @@ -363,7 +363,7 @@ proc test_r52486_21352 {tn sql} { } # Execute a series of random INSERT, UPDATE and DELETE operations -# (some of which may fail due to FK or PK constraint violations) on +# (some of which may fail due to FK or PK constraint violations) on # the two tables in the example schema. Test that R-52486-21352 # is true after executing each operation. # @@ -397,12 +397,12 @@ drop_all_tables do_test e_fkey-12.1 { execsql { CREATE TABLE artist( - artistid INTEGER PRIMARY KEY, + artistid INTEGER PRIMARY KEY, artistname TEXT ); CREATE TABLE track( - trackid INTEGER, - trackname TEXT, + trackid INTEGER, + trackname TEXT, trackartist INTEGER NOT NULL, FOREIGN KEY(trackartist) REFERENCES artist(artistid) ); @@ -421,12 +421,12 @@ drop_all_tables do_test e_fkey-13.1 { execsql { CREATE TABLE artist( - artistid INTEGER PRIMARY KEY, + artistid INTEGER PRIMARY KEY, artistname TEXT ); CREATE TABLE track( - trackid INTEGER, - trackname TEXT, + trackid INTEGER, + trackname TEXT, trackartist INTEGER, FOREIGN KEY(trackartist) REFERENCES artist(artistid) ); @@ -444,7 +444,7 @@ do_test e_fkey-13.3 { execsql { INSERT INTO track VALUES(14, 'Mr. Bojangles', NULL) } } {} do_test e_fkey-13.4 { - catchsql { + catchsql { UPDATE track SET trackartist = 3 WHERE trackname = 'Mr. Bojangles'; } } {1 {FOREIGN KEY constraint failed}} @@ -492,7 +492,7 @@ do_test e_fkey-14.4 { # each parent key column contains a value equal to the value in its # associated child key column. # -# Test also that the usual comparison rules are used when testing if there +# Test also that the usual comparison rules are used when testing if there # is a matching row in the parent table of a foreign key constraint. # # EVIDENCE-OF: R-57765-12380 In the above paragraph, the term "equal" @@ -600,14 +600,14 @@ do_test e_fkey-17.4 { ########################################################################### #------------------------------------------------------------------------- -# A parent key must be either a PRIMARY KEY, subject to a UNIQUE +# A parent key must be either a PRIMARY KEY, subject to a UNIQUE # constraint, or have a UNIQUE index created on it. # # EVIDENCE-OF: R-13435-26311 Usually, the parent key of a foreign key # constraint is the primary key of the parent table. If they are not the # primary key, then the parent key columns must be collectively subject # to a UNIQUE constraint or have a UNIQUE index. -# +# # Also test that if a parent key is not subject to a PRIMARY KEY or UNIQUE # constraint, but does have a UNIQUE index created on it, then the UNIQUE index # must use the default collation sequences associated with the parent key @@ -634,15 +634,15 @@ proc test_efkey_57 {tn isError sql} { test_efkey_57 2 0 { CREATE TABLE t1(x PRIMARY KEY) } test_efkey_57 3 0 { CREATE TABLE t1(x UNIQUE) } test_efkey_57 4 0 { CREATE TABLE t1(x); CREATE UNIQUE INDEX t1i ON t1(x) } -test_efkey_57 5 1 { - CREATE TABLE t1(x); +test_efkey_57 5 1 { + CREATE TABLE t1(x); CREATE UNIQUE INDEX t1i ON t1(x COLLATE nocase); } test_efkey_57 6 1 { CREATE TABLE t1(x) } test_efkey_57 7 1 { CREATE TABLE t1(x, y, PRIMARY KEY(x, y)) } test_efkey_57 8 1 { CREATE TABLE t1(x, y, UNIQUE(x, y)) } -test_efkey_57 9 1 { - CREATE TABLE t1(x, y); +test_efkey_57 9 1 { + CREATE TABLE t1(x, y); CREATE UNIQUE INDEX t1i ON t1(x, y); } @@ -713,7 +713,7 @@ do_test e_fkey-19.5 { #------------------------------------------------------------------------- # Test errors in the database schema that are detected while preparing -# DML statements. The error text for these messages always matches +# DML statements. The error text for these messages always matches # either "foreign key mismatch" or "no such table*" (using [string match]). # # EVIDENCE-OF: R-45488-08504 If the database schema contains foreign key @@ -803,7 +803,7 @@ foreach {tn tbl ptbl err} { # Test the example of foreign key mismatch errors caused by implicitly # mapping a child key to the primary key of the parent table when the # child key consists of a different number of columns to that primary key. -# +# drop_all_tables do_test e_fkey-21.1 { execsql { @@ -840,7 +840,7 @@ do_test e_fkey-21.8 { } {1 {foreign key mismatch - "child10" referencing "parent2"}} #------------------------------------------------------------------------- -# Test errors that are reported when creating the child table. +# Test errors that are reported when creating the child table. # Specifically: # # * different number of child and parent key columns, and @@ -885,7 +885,7 @@ foreach fk [list OFF ON] { # clause to a column definition creates a foreign # key constraint that maps the column to the primary key of # . -# +# do_test e_fkey-23.1 { execsql { CREATE TABLE p1(a, b, PRIMARY KEY(a, b)); @@ -947,7 +947,7 @@ foreach {tn c} [list 2 c1 3 c2 4 c3] { #------------------------------------------------------------------------- # EVIDENCE-OF: R-00279-52283 # -# Test an example showing that when a row is deleted from the parent +# Test an example showing that when a row is deleted from the parent # table, the child table is queried for orphaned rows as follows: # # SELECT rowid FROM track WHERE trackartist = ? @@ -959,12 +959,12 @@ foreach {tn c} [list 2 c1 3 c2 4 c3] { do_test e_fkey-25.1 { execsql { CREATE TABLE artist( - artistid INTEGER PRIMARY KEY, + artistid INTEGER PRIMARY KEY, artistname TEXT ); CREATE TABLE track( - trackid INTEGER, - trackname TEXT, + trackid INTEGER, + trackname TEXT, trackartist INTEGER, FOREIGN KEY(trackartist) REFERENCES artist(artistid) ); @@ -975,14 +975,14 @@ do_execsql_test e_fkey-25.2 { EXPLAIN QUERY PLAN DELETE FROM artist WHERE 1; EXPLAIN QUERY PLAN SELECT rowid FROM track WHERE trackartist = ?; } { - 0 0 0 {SCAN TABLE artist} + 0 0 0 {SCAN TABLE artist} 0 0 0 {SCAN TABLE track} } do_execsql_test e_fkey-25.3 { PRAGMA foreign_keys = ON; EXPLAIN QUERY PLAN DELETE FROM artist WHERE 1; } { - 0 0 0 {SCAN TABLE artist} + 0 0 0 {SCAN TABLE artist} 0 0 0 {SCAN TABLE track} } do_test e_fkey-25.4 { @@ -1017,13 +1017,13 @@ do_test e_fkey-25.7 { # EVIDENCE-OF: R-47936-10044 Or, more generally: # SELECT rowid FROM WHERE = :parent_key_value # -# Test that when a row is deleted from the parent table of an FK +# Test that when a row is deleted from the parent table of an FK # constraint, the child table is queried for orphaned rows. The # query is equivalent to: # # SELECT rowid FROM WHERE = :parent_key_value # -# Also test that when a row is inserted into the parent table, or when the +# Also test that when a row is inserted into the parent table, or when the # parent key values of an existing row are modified, a query equivalent # to the following is planned. In some cases it is not executed, but it # is always planned. @@ -1040,14 +1040,14 @@ do_test e_fkey-26.1 { execsql { CREATE TABLE parent(x, y, UNIQUE(y, x)) } } {} foreach {tn sql} { - 2 { + 2 { CREATE TABLE child(a, b, FOREIGN KEY(a, b) REFERENCES parent(x, y)) } - 3 { + 3 { CREATE TABLE child(a, b, FOREIGN KEY(a, b) REFERENCES parent(x, y)); CREATE INDEX childi ON child(a, b); } - 4 { + 4 { CREATE TABLE child(a, b, FOREIGN KEY(a, b) REFERENCES parent(x, y)); CREATE UNIQUE INDEX childi ON child(b, a); } @@ -1083,12 +1083,12 @@ drop_all_tables do_test e_fkey-27.1 { execsql { CREATE TABLE artist( - artistid INTEGER PRIMARY KEY, + artistid INTEGER PRIMARY KEY, artistname TEXT ); CREATE TABLE track( trackid INTEGER, - trackname TEXT, + trackname TEXT, trackartist INTEGER REFERENCES artist ); CREATE INDEX trackindex ON track(trackartist); @@ -1100,14 +1100,14 @@ do_test e_fkey-27.2 { do_execsql_test e_fkey-27.3 { EXPLAIN QUERY PLAN UPDATE artist SET artistid = ?, artistname = ? } { - 0 0 0 {SCAN TABLE artist} - 0 0 0 {SEARCH TABLE track USING COVERING INDEX trackindex (trackartist=?)} + 0 0 0 {SCAN TABLE artist} + 0 0 0 {SEARCH TABLE track USING COVERING INDEX trackindex (trackartist=?)} 0 0 0 {SEARCH TABLE track USING COVERING INDEX trackindex (trackartist=?)} } do_execsql_test e_fkey-27.4 { EXPLAIN QUERY PLAN DELETE FROM artist } { - 0 0 0 {SCAN TABLE artist} + 0 0 0 {SCAN TABLE artist} 0 0 0 {SEARCH TABLE track USING COVERING INDEX trackindex (trackartist=?)} } @@ -1123,24 +1123,24 @@ do_execsql_test e_fkey-27.4 { # cardinality. # foreach {tn sql err} { - 1 "CREATE TABLE c(jj REFERENCES p(x, y))" + 1 "CREATE TABLE c(jj REFERENCES p(x, y))" {foreign key on jj should reference only one column of table p} 2 "CREATE TABLE c(jj REFERENCES p())" {near ")": syntax error} - 3 "CREATE TABLE c(jj, FOREIGN KEY(jj) REFERENCES p(x, y))" + 3 "CREATE TABLE c(jj, FOREIGN KEY(jj) REFERENCES p(x, y))" {number of columns in foreign key does not match the number of columns in the referenced table} - 4 "CREATE TABLE c(jj, FOREIGN KEY(jj) REFERENCES p())" + 4 "CREATE TABLE c(jj, FOREIGN KEY(jj) REFERENCES p())" {near ")": syntax error} - 5 "CREATE TABLE c(ii, jj, FOREIGN KEY(jj, ii) REFERENCES p())" + 5 "CREATE TABLE c(ii, jj, FOREIGN KEY(jj, ii) REFERENCES p())" {near ")": syntax error} - 6 "CREATE TABLE c(ii, jj, FOREIGN KEY(jj, ii) REFERENCES p(x))" + 6 "CREATE TABLE c(ii, jj, FOREIGN KEY(jj, ii) REFERENCES p(x))" {number of columns in foreign key does not match the number of columns in the referenced table} - 7 "CREATE TABLE c(ii, jj, FOREIGN KEY(jj, ii) REFERENCES p(x,y,z))" + 7 "CREATE TABLE c(ii, jj, FOREIGN KEY(jj, ii) REFERENCES p(x,y,z))" {number of columns in foreign key does not match the number of columns in the referenced table} } { drop_all_tables @@ -1167,7 +1167,7 @@ do_test e_fkey-28.9 { #------------------------------------------------------------------------- # EVIDENCE-OF: R-24676-09859 # -# Test the example schema in the "Composite Foreign Key Constraints" +# Test the example schema in the "Composite Foreign Key Constraints" # section. # do_test e_fkey-29.1 { @@ -1257,7 +1257,7 @@ do_test e_fkey-31.3 { execsql { INSERT INTO prince VALUES(1, 2) } } {} -# Test that operating inside a transaction makes no difference to +# Test that operating inside a transaction makes no difference to # immediate constraint violation handling. do_test e_fkey-31.4 { execsql { @@ -1354,7 +1354,7 @@ test_efkey_35 4 0 "INSERT INTO child VALUES('x', 'y')" # # EVIDENCE-OF: R-09005-28791 # -# Also test that adding any of the following to a foreign key definition +# Also test that adding any of the following to a foreign key definition # makes the constraint IMMEDIATE: # # NOT DEFERRABLE INITIALLY DEFERRED @@ -1469,19 +1469,19 @@ test_efkey_29 33 "ROLLBACK" 0 #------------------------------------------------------------------------- # EVIDENCE-OF: R-24499-57071 # -# Test an example from foreignkeys.html dealing with a deferred foreign +# Test an example from foreignkeys.html dealing with a deferred foreign # key constraint. # do_test e_fkey-35.1 { drop_all_tables execsql { CREATE TABLE artist( - artistid INTEGER PRIMARY KEY, + artistid INTEGER PRIMARY KEY, artistname TEXT ); CREATE TABLE track( trackid INTEGER, - trackname TEXT, + trackname TEXT, trackartist INTEGER REFERENCES artist(artistid) DEFERRABLE INITIALLY DEFERRED ); } @@ -1501,7 +1501,7 @@ do_test e_fkey-35.3 { } {} #------------------------------------------------------------------------- -# Verify that a nested savepoint may be released without satisfying +# Verify that a nested savepoint may be released without satisfying # deferred foreign key constraints. # # EVIDENCE-OF: R-07223-48323 A nested savepoint transaction may be @@ -1582,7 +1582,7 @@ do_test e_fkey-37.6 { } {} #------------------------------------------------------------------------- -# Test that if a COMMIT operation fails due to deferred foreign key +# Test that if a COMMIT operation fails due to deferred foreign key # constraints, any nested savepoints remain open. # # EVIDENCE-OF: R-37736-42616 If a COMMIT statement (or the RELEASE of a @@ -1663,7 +1663,7 @@ do_test e_fkey-38.8 { do_test e_fkey-39.1 { execsql { CREATE TABLE p(a, b PRIMARY KEY, c); - CREATE TABLE c1(d, e, f DEFAULT 'k0' REFERENCES p + CREATE TABLE c1(d, e, f DEFAULT 'k0' REFERENCES p ON UPDATE SET DEFAULT ON DELETE SET NULL ); @@ -1710,21 +1710,21 @@ do_test e_fkey-39.4 { # # EVIDENCE-OF: R-19803-45884 If an action is not explicitly specified, # it defaults to "NO ACTION". -# +# drop_all_tables do_test e_fkey-40.1 { execsql { CREATE TABLE parent(x PRIMARY KEY, y); - CREATE TABLE child1(a, + CREATE TABLE child1(a, b REFERENCES parent ON UPDATE NO ACTION ON DELETE RESTRICT ); - CREATE TABLE child2(a, + CREATE TABLE child2(a, b REFERENCES parent ON UPDATE RESTRICT ON DELETE SET NULL ); - CREATE TABLE child3(a, + CREATE TABLE child3(a, b REFERENCES parent ON UPDATE SET NULL ON DELETE SET DEFAULT ); - CREATE TABLE child4(a, + CREATE TABLE child4(a, b REFERENCES parent ON UPDATE SET DEFAULT ON DELETE CASCADE ); @@ -1761,7 +1761,7 @@ drop_all_tables do_test e_fkey-41.1 { execsql { CREATE TABLE parent(p1, p2, PRIMARY KEY(p1, p2)); - CREATE TABLE child(c1, c2, + CREATE TABLE child(c1, c2, FOREIGN KEY(c1, c2) REFERENCES parent ON UPDATE NO ACTION ON DELETE NO ACTION @@ -1803,10 +1803,10 @@ do_test e_fkey-41.1 { execsql { CREATE TABLE parent(p1, p2); CREATE UNIQUE INDEX parent_i ON parent(p1, p2); - CREATE TABLE child1(c1, c2, + CREATE TABLE child1(c1, c2, FOREIGN KEY(c2, c1) REFERENCES parent(p1, p2) ON DELETE RESTRICT ); - CREATE TABLE child2(c1, c2, + CREATE TABLE child2(c1, c2, FOREIGN KEY(c2, c1) REFERENCES parent(p1, p2) ON UPDATE RESTRICT ); } @@ -1828,7 +1828,7 @@ do_test e_fkey-41.4 { #------------------------------------------------------------------------- # Test that RESTRICT is slightly different from NO ACTION for IMMEDIATE -# constraints, in that it is enforced immediately, not at the end of the +# constraints, in that it is enforced immediately, not at the end of the # statement. # # EVIDENCE-OF: R-37997-42187 The difference between the effect of a @@ -1860,7 +1860,7 @@ do_test e_fkey-42.2 { catchsql { UPDATE parent SET x = 'key one' WHERE x = 'key1' } } {1 {FOREIGN KEY constraint failed}} do_test e_fkey-42.3 { - execsql { + execsql { UPDATE parent SET x = 'key two' WHERE x = 'key2'; SELECT * FROM child2; } @@ -1888,7 +1888,7 @@ do_test e_fkey-42.5 { catchsql { DELETE FROM parent WHERE x = 'key1' } } {1 {FOREIGN KEY constraint failed}} do_test e_fkey-42.6 { - execsql { + execsql { DELETE FROM parent WHERE x = 'key2'; SELECT * FROM child2; } @@ -1911,7 +1911,7 @@ do_test e_fkey-42.8 { catchsql { REPLACE INTO parent VALUES('key1') } } {1 {FOREIGN KEY constraint failed}} do_test e_fkey-42.9 { - execsql { + execsql { REPLACE INTO parent VALUES('key2'); SELECT * FROM child2; } @@ -2156,7 +2156,7 @@ do_test e_fkey-47.3 { } } {{} {} 4 11 5 10} do_test e_fkey-47.4 { - execsql { + execsql { UPDATE p1 SET b = 6 WHERE b IS NULL; SELECT d, c FROM c1; } @@ -2168,19 +2168,19 @@ do_test e_fkey-46.5 { #------------------------------------------------------------------------- # EVIDENCE-OF: R-65058-57158 # -# Test an example from the "ON DELETE and ON UPDATE Actions" section +# Test an example from the "ON DELETE and ON UPDATE Actions" section # of foreignkeys.html. # drop_all_tables do_test e_fkey-48.1 { execsql { CREATE TABLE artist( - artistid INTEGER PRIMARY KEY, + artistid INTEGER PRIMARY KEY, artistname TEXT ); CREATE TABLE track( trackid INTEGER, - trackname TEXT, + trackname TEXT, trackartist INTEGER REFERENCES artist(artistid) ON UPDATE CASCADE ); @@ -2205,7 +2205,7 @@ do_test e_fkey-48.4 { #------------------------------------------------------------------------- -# Verify that adding an FK action does not absolve the user of the +# Verify that adding an FK action does not absolve the user of the # requirement not to violate the foreign key constraint. # # EVIDENCE-OF: R-53968-51642 Configuring an ON UPDATE or ON DELETE @@ -2247,7 +2247,7 @@ do_test e_fkey-49.4 { #------------------------------------------------------------------------- # EVIDENCE-OF: R-11856-19836 # -# Test an example from the "ON DELETE and ON UPDATE Actions" section +# Test an example from the "ON DELETE and ON UPDATE Actions" section # of foreignkeys.html. This example shows that adding an "ON DELETE DEFAULT" # clause does not abrogate the need to satisfy the foreign key constraint # (R-28220-46694). @@ -2262,12 +2262,12 @@ drop_all_tables do_test e_fkey-50.1 { execsql { CREATE TABLE artist( - artistid INTEGER PRIMARY KEY, + artistid INTEGER PRIMARY KEY, artistname TEXT ); CREATE TABLE track( trackid INTEGER, - trackname TEXT, + trackname TEXT, trackartist INTEGER DEFAULT 0 REFERENCES artist(artistid) ON DELETE SET DEFAULT ); INSERT INTO artist VALUES(3, 'Sammy Davis Jr.'); @@ -2293,14 +2293,14 @@ do_test e_fkey-50.5 { #------------------------------------------------------------------------- # EVIDENCE-OF: R-09564-22170 # -# Check that the order of steps in an UPDATE or DELETE on a parent +# Check that the order of steps in an UPDATE or DELETE on a parent # table is as follows: # # 1. Execute applicable BEFORE trigger programs, # 2. Check local (non foreign key) constraints, # 3. Update or delete the row in the parent table, # 4. Perform any required foreign key actions, -# 5. Execute applicable AFTER trigger programs. +# 5. Execute applicable AFTER trigger programs. # drop_all_tables do_test e_fkey-51.1 { @@ -2356,7 +2356,7 @@ drop_all_tables do_test e_fkey-52.1 { execsql { CREATE TABLE zeus(a INTEGER COLLATE NOCASE, b, PRIMARY KEY(a, b)); - CREATE TABLE apollo(c, d, + CREATE TABLE apollo(c, d, FOREIGN KEY(c, d) REFERENCES zeus ON UPDATE CASCADE ); INSERT INTO zeus VALUES('abc', 'xyz'); @@ -2401,9 +2401,9 @@ do_test e_fkey-52.6 { #------------------------------------------------------------------------- # EVIDENCE-OF: R-35129-58141 # -# Test an example from the "ON DELETE and ON UPDATE Actions" section +# Test an example from the "ON DELETE and ON UPDATE Actions" section # of foreignkeys.html. This example demonstrates that ON UPDATE actions -# only take place if at least one parent key column is set to a value +# only take place if at least one parent key column is set to a value # that is distinct from its previous value. # drop_all_tables @@ -2454,7 +2454,7 @@ do_test e_fkey-53.3 { # # EVIDENCE-OF: R-08908-23439 A CREATE TABLE command operates the same # whether or not foreign key constraints are enabled. -# +# foreach {tn zCreateTbl lRes} { 1 "CREATE TABLE t1(a, b REFERENCES t1)" {0 {}} 2 "CREATE TABLE t1(a, b REFERENCES t2)" {0 {}} @@ -2464,9 +2464,9 @@ foreach {tn zCreateTbl lRes} { 6 "CREATE TABLE t1(a, b, FOREIGN KEY(a,b) REFERENCES t2(n,d))" {0 {}} 7 "CREATE TABLE t1(a, b, FOREIGN KEY(a,b) REFERENCES t1(a,b))" {0 {}} - A "CREATE TABLE t1(a, b, FOREIGN KEY(c,b) REFERENCES t2)" + A "CREATE TABLE t1(a, b, FOREIGN KEY(c,b) REFERENCES t2)" {1 {unknown column "c" in foreign key definition}} - B "CREATE TABLE t1(a, b, FOREIGN KEY(c,b) REFERENCES t2(d))" + B "CREATE TABLE t1(a, b, FOREIGN KEY(c,b) REFERENCES t2(d))" {1 {number of columns in foreign key does not match the number of columns in the referenced table}} } { do_test e_fkey-54.$tn.off { @@ -2488,7 +2488,7 @@ foreach {tn zCreateTbl lRes} { # to do so returns an error. # proc test_efkey_6 {tn zAlter isError} { - drop_all_tables + drop_all_tables do_test e_fkey-56.$tn.1 " execsql { CREATE TABLE tbl(a, b) } @@ -2577,11 +2577,11 @@ do_test e_fkey-57.1 { CREATE TABLE c4(c, d, FOREIGN KEY(c, d) REFERENCES p ON DELETE RESTRICT); CREATE TABLE c5(c, d, FOREIGN KEY(c, d) REFERENCES p ON DELETE NO ACTION); - CREATE TABLE c6(c, d, - FOREIGN KEY(c, d) REFERENCES p ON DELETE RESTRICT + CREATE TABLE c6(c, d, + FOREIGN KEY(c, d) REFERENCES p ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED ); - CREATE TABLE c7(c, d, + CREATE TABLE c7(c, d, FOREIGN KEY(c, d) REFERENCES p ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED ); @@ -2633,7 +2633,7 @@ do_test e_fkey-57.7 { # violated, the DROP TABLE statement fails and the table is not dropped. # do_test e_fkey-58.1 { - execsql { + execsql { DELETE FROM c1; DELETE FROM c2; DELETE FROM c3; @@ -2668,10 +2668,10 @@ do_test e_fkey-58.4 { # at that point. # do_test e_fkey-59.1 { - execsql { + execsql { DELETE FROM c1 ; DELETE FROM c2 ; DELETE FROM c3 ; DELETE FROM c4 ; DELETE FROM c5 ; DELETE FROM c6 ; - DELETE FROM c7 + DELETE FROM c7 } } {} do_test e_fkey-59.2 { @@ -2745,7 +2745,7 @@ do_test e_fkey-60.6 { # Test that the special behaviors of ALTER and DROP TABLE are only # activated when foreign keys are enabled. Special behaviors are: # -# 1. ADD COLUMN not allowing a REFERENCES clause with a non-NULL +# 1. ADD COLUMN not allowing a REFERENCES clause with a non-NULL # default value. # 2. Modifying foreign key definitions when a parent table is RENAMEd. # 3. Running an implicit DELETE FROM command as part of DROP TABLE. @@ -2847,7 +2847,7 @@ foreach zMatch [list SIMPLE PARTIAL FULL Simple parTIAL FuLL ] { execsql { INSERT INTO c VALUES('y', NULL, 'x') } execsql { INSERT INTO c VALUES('z', NULL, NULL) } - # Check that the FK is enforced properly if there are no NULL values + # Check that the FK is enforced properly if there are no NULL values # in the child key columns. catchsql { INSERT INTO c VALUES('a', 2, 4) } } {1 {FOREIGN KEY constraint failed}} @@ -2871,9 +2871,9 @@ do_test e_fkey-62.2 { do_test e_fkey-62.3 { execsql { CREATE TABLE p(a, b, PRIMARY KEY(a, b)); - CREATE TABLE cd(c, d, + CREATE TABLE cd(c, d, FOREIGN KEY(c, d) REFERENCES p DEFERRABLE INITIALLY DEFERRED); - CREATE TABLE ci(c, d, + CREATE TABLE ci(c, d, FOREIGN KEY(c, d) REFERENCES p DEFERRABLE INITIALLY IMMEDIATE); BEGIN; } @@ -2888,7 +2888,7 @@ do_test e_fkey-62.6 { catchsql { COMMIT } } {1 {FOREIGN KEY constraint failed}} do_test e_fkey-62.7 { - execsql { + execsql { DELETE FROM cd; COMMIT; } @@ -2906,7 +2906,7 @@ do_test e_fkey-62.7 { # proc test_on_delete_recursion {limit} { drop_all_tables - execsql { + execsql { BEGIN; CREATE TABLE t0(a PRIMARY KEY, b); INSERT INTO t0 VALUES('x0', NULL); @@ -2927,7 +2927,7 @@ proc test_on_delete_recursion {limit} { } proc test_on_update_recursion {limit} { drop_all_tables - execsql { + execsql { BEGIN; CREATE TABLE t0(a PRIMARY KEY); INSERT INTO t0 VALUES('xxx'); @@ -3013,7 +3013,7 @@ foreach recursive_triggers_setting [list 0 1 ON OFF] { execsql { SELECT count(*) FROM t1 WHERE a = 1 } } {1} do_test e_fkey-64.$recursive_triggers_setting.3 { - execsql { + execsql { DELETE FROM t1 WHERE a = 1; SELECT count(*) FROM t1; } diff --git a/third_party/sqlite/src/test/e_fts3.test b/third_party/sqlite/src/test/e_fts3.test index 2a580ca313424..0d6ef2e8848b1 100644 --- a/third_party/sqlite/src/test/e_fts3.test +++ b/third_party/sqlite/src/test/e_fts3.test @@ -42,7 +42,7 @@ proc error_test {tn sql result} { # The body of the following [foreach] block contains test cases to verify # that the example code in fts3.html works as expected. The tests run three # times, with different values for DO_MALLOC_TEST. -# +# # DO_MALLOC_TEST=0: Run tests with no OOM errors. # DO_MALLOC_TEST=1: Run tests with transient OOM errors. # DO_MALLOC_TEST=2: Run tests with persistent OOM errors. @@ -56,7 +56,7 @@ foreach {DO_MALLOC_TEST enc} { #if {$DO_MALLOC_TEST} break -# Reset the database and database connection. If this iteration of the +# Reset the database and database connection. If this iteration of the # [foreach] loop is testing with OOM errors, disable the lookaside buffer. # db close @@ -74,7 +74,7 @@ proc mit {blob} { db func mit mit ########################################################################## -# Test the example CREATE VIRTUAL TABLE statements in section 1.1 +# Test the example CREATE VIRTUAL TABLE statements in section 1.1 # of fts3.in. # ddl_test 1.1.1.1 {CREATE VIRTUAL TABLE data USING fts3()} @@ -136,7 +136,7 @@ ddl_test 1.1.7.4 {DROP TABLE papers} ddl_test 1.1.7.5 {DROP TABLE simpledata} read_test 1.1.7.6 {SELECT * FROM sqlite_master} {} -# The following is not one of the examples in section 1.1. It tests +# The following is not one of the examples in section 1.1. It tests # specifying an FTS3 table with no module arguments using a slightly # different syntax. ddl_test 1.1.8.1 {CREATE VIRTUAL TABLE data USING fts3;} @@ -150,7 +150,7 @@ ddl_test 1.2.1.1 { CREATE VIRTUAL TABLE pages USING fts3(title, body); } write_test 1.2.1.2 pages_content { - INSERT INTO pages(docid, title, body) + INSERT INTO pages(docid, title, body) VALUES(53, 'Home Page', 'SQLite is a software...'); } read_test 1.2.1.3 { @@ -158,7 +158,7 @@ read_test 1.2.1.3 { } {53 {Home Page} {SQLite is a software...}} write_test 1.2.1.4 pages_content { - INSERT INTO pages(title, body) + INSERT INTO pages(title, body) VALUES('Download', 'All SQLite source code...'); } read_test 1.2.1.5 { @@ -201,7 +201,7 @@ ddl_test 1.2.2.8 { DROP TABLE docs } # Test the examples in section 1.3 (querying FTS3 tables) # ddl_test 1.3.1.1 { CREATE VIRTUAL TABLE mail USING fts3(subject, body) } -read_test 1.3.1.2 { +read_test 1.3.1.2 { SELECT * FROM mail WHERE rowid = 15; -- Fast. Rowid lookup. SELECT * FROM mail WHERE body MATCH 'sqlite'; -- Fast. Full-text query. SELECT * FROM mail WHERE mail MATCH 'search'; -- Fast. Full-text query. @@ -214,15 +214,15 @@ ddl_test 1.3.1.3 { DROP TABLE mail } ddl_test 1.3.2.1 { CREATE VIRTUAL TABLE mail USING fts3(subject, body) } write_test 1.3.2.2 mail_content { - INSERT INTO mail(docid, subject, body) + INSERT INTO mail(docid, subject, body) VALUES(1, 'software feedback', 'found it too slow') } write_test 1.3.2.3 mail_content { - INSERT INTO mail(docid, subject, body) + INSERT INTO mail(docid, subject, body) VALUES(2, 'software feedback', 'no feedback') } write_test 1.3.2.4 mail_content { - INSERT INTO mail(docid, subject, body) + INSERT INTO mail(docid, subject, body) VALUES(3, 'slow lunch order', 'was a software problem') } read_test 1.3.2.5 { @@ -243,8 +243,8 @@ ddl_test 1.3.3.1 { CREATE VIRTUAL TABLE docs USING fts3(content) } read_test 1.3.3.2 { SELECT * FROM docs WHERE docs MATCH 'sqlite' } {} read_test 1.3.3.3 { SELECT * FROM docs WHERE docs.docs MATCH 'sqlite' } {} read_test 1.3.3.4 { SELECT * FROM docs WHERE main.docs.docs MATCH 'sqlite' } {} -do_error_test e_fts3-1.3.3.5 { - SELECT * FROM docs WHERE main.docs MATCH 'sqlite' +do_error_test e_fts3-1.3.3.5 { + SELECT * FROM docs WHERE main.docs MATCH 'sqlite' } {no such column: main.docs} ddl_test 1.3.2.8 { DROP TABLE docs } @@ -268,29 +268,29 @@ foreach {tn title body} { set R($tn) [list $title $body] } -read_test 1.4.1.11 { +read_test 1.4.1.11 { SELECT * FROM docs WHERE docs MATCH 'linux' } [concat $R(2) $R(4) $R(5) $R(6) $R(7) $R(8)] -read_test 1.4.1.12 { +read_test 1.4.1.12 { SELECT * FROM docs WHERE docs MATCH 'lin*' } [concat $R(2) $R(3) $R(4) $R(5) $R(6) $R(7) $R(8) $R(9)] -read_test 1.4.1.13 { +read_test 1.4.1.13 { SELECT * FROM docs WHERE docs MATCH 'title:linux problems' } [concat $R(5)] -read_test 1.4.1.14 { +read_test 1.4.1.14 { SELECT * FROM docs WHERE body MATCH 'title:linux driver' } [concat $R(6)] -read_test 1.4.1.15 { +read_test 1.4.1.15 { SELECT * FROM docs WHERE docs MATCH '"linux applications"' } [concat $R(8)] -read_test 1.4.1.16 { +read_test 1.4.1.16 { SELECT * FROM docs WHERE docs MATCH '"lin* app*"' } [concat $R(8) $R(9)] ddl_test 1.4.1.17 { DROP TABLE docs } unset R ddl_test 1.4.2.1 { CREATE VIRTUAL TABLE docs USING fts3() } -write_test 1.4.2.2 docs_content { +write_test 1.4.2.2 docs_content { INSERT INTO docs VALUES( 'SQLite is an ACID compliant embedded relational database management system') } @@ -319,7 +319,7 @@ foreach {tn docid content} { 4 3 "sqlite is a database" } { set R($docid) $content - write_test 1.5.1.$tn docs_content { + write_test 1.5.1.$tn docs_content { INSERT INTO docs(docid, content) VALUES($docid, $content) } } @@ -340,7 +340,7 @@ read_test 1.5.1.8 { } {} write_test 1.5.2.1 docs_content { - INSERT INTO docs + INSERT INTO docs SELECT 'sqlite is also a library' UNION ALL SELECT 'library software' } @@ -353,13 +353,13 @@ read_test 1.5.2.3 { SELECT docid FROM docs WHERE docs MATCH 'library' } {3 4 5} write_test 1.5.2.4 docs_content { - INSERT INTO docs + INSERT INTO docs SELECT 'the sqlite library runs on linux' UNION ALL SELECT 'as does the sqlite database (on linux)' UNION ALL SELECT 'the sqlite database is accessed by the sqlite library' } read_test 1.5.2.2 { - SELECT docid FROM docs + SELECT docid FROM docs WHERE docs MATCH '("sqlite database" OR "sqlite library") AND linux'; } {6 7} read_test 1.5.2.3 { @@ -399,22 +399,22 @@ ddl_test 1.6.1.5 { DROP TABLE docs } # ddl_test 1.7.1.1 { CREATE VIRTUAL TABLE mail USING fts3(subject, body) } -write_test 1.7.1.2 mail_content { +write_test 1.7.1.2 mail_content { INSERT INTO mail VALUES( 'hello world', 'This message is a hello world message.'); } -write_test 1.7.1.3 mail_content { +write_test 1.7.1.3 mail_content { INSERT INTO mail VALUES( 'urgent: serious', 'This mail is seen as a more serious mail'); } -read_test 1.7.1.4 { +read_test 1.7.1.4 { SELECT offsets(mail) FROM mail WHERE mail MATCH 'world'; } {{0 0 6 5 1 0 24 5}} -read_test 1.7.1.5 { +read_test 1.7.1.5 { SELECT offsets(mail) FROM mail WHERE mail MATCH 'message' } {{1 0 5 7 1 0 30 7}} -read_test 1.7.1.6 { +read_test 1.7.1.6 { SELECT offsets(mail) FROM mail WHERE mail MATCH '"serious mail"' } {{1 0 28 7 1 1 36 4}} @@ -436,33 +436,33 @@ read_test 1.7.2.4 { ddl_test 1.7.3.1 { DROP TABLE IF EXISTS t1 } ddl_test 1.7.3.2 { CREATE VIRTUAL TABLE t1 USING fts3(a, b) } -write_test 1.7.3.3 t1_content { +write_test 1.7.3.3 t1_content { INSERT INTO t1 VALUES( 'transaction default models default', 'Non transaction reads'); } -write_test 1.7.3.4 t1_content { +write_test 1.7.3.4 t1_content { INSERT INTO t1 VALUES('the default transaction', 'these semantics present'); } -write_test 1.7.3.5 t1_content { +write_test 1.7.3.5 t1_content { INSERT INTO t1 VALUES('single request', 'default data'); } -read_test 1.7.3.6 { - SELECT mit(matchinfo(t1)) FROM t1 +read_test 1.7.3.6 { + SELECT mit(matchinfo(t1)) FROM t1 WHERE t1 MATCH 'default transaction "these semantics"'; } {{3 2 1 3 2 0 1 1 1 2 2 0 1 1 0 0 0 1 1 1}} ########################################################################## # Test the example in section 5 (custom tokenizers). # -ddl_test 1.8.1.1 { CREATE VIRTUAL TABLE simple USING fts3(tokenize=simple) } -write_test 1.8.1.2 simple_content { +ddl_test 1.8.1.1 { CREATE VIRTUAL TABLE simple USING fts3(tokenize=simple) } +write_test 1.8.1.2 simple_content { INSERT INTO simple VALUES('Right now they''re very frustrated') } -read_test 1.8.1.3 {SELECT docid FROM simple WHERE simple MATCH 'Frustrated'} {1} +read_test 1.8.1.3 {SELECT docid FROM simple WHERE simple MATCH 'Frustrated'} {1} read_test 1.8.1.4 {SELECT docid FROM simple WHERE simple MATCH 'Frustration'} {} -ddl_test 1.8.2.1 { CREATE VIRTUAL TABLE porter USING fts3(tokenize=porter) } -write_test 1.8.2.2 porter_content { +ddl_test 1.8.2.1 { CREATE VIRTUAL TABLE porter USING fts3(tokenize=porter) } +write_test 1.8.2.2 porter_content { INSERT INTO porter VALUES('Right now they''re very frustrated') } read_test 1.8.2.4 { @@ -480,7 +480,7 @@ read_test 1.8.2.4 { set DO_MALLOC_TEST 0 ddl_test 2.1.0 { DROP TABLE IF EXISTS t1 } ddl_test 2.1.1 { CREATE VIRTUAL TABLE t1 USING fts3(a, b) } -write_test 2.1.2 t1_content { +write_test 2.1.2 t1_content { INSERT INTO t1 VALUES('one two three', x'A1B2C3D4E5F6'); } error_test 2.1.3 { @@ -508,7 +508,7 @@ error_test 2.1.8 { # opening a database handle). This case was not tested by the OOM testing # of the document examples above. # -do_malloc_test e_fts3-3 -tclbody { +do_malloc_test e_fts3-3 -tclbody { if {[catch {sqlite3 db test.db}]} { error "out of memory" } } #------------------------------------------------------------------------- @@ -527,10 +527,10 @@ write_test 4.3 t4_content { INSERT INTO t4 VALUES('a stately pleasure', 'dome decree'); } do_test e_fts3-4.4 { - execsql { SELECT optimize(t4) FROM t4 LIMIT 1 } + execsql { SELECT optimize(t4) FROM t4 LIMIT 1 } } {{Index optimized}} do_test e_fts3-4.5 { - execsql { SELECT optimize(t4) FROM t4 LIMIT 1 } + execsql { SELECT optimize(t4) FROM t4 LIMIT 1 } } {{Index already optimal}} #------------------------------------------------------------------------- @@ -543,16 +543,16 @@ ddl_test 5.1 { CREATE VIRTUAL TABLE t5 USING fts3(x) } write_test 5.2 t5_content { INSERT INTO t5 VALUES('In Xanadu did Kubla Khan A stately pleasure-dome decree Where Alph, the sacred river, ran Through caverns measureless to man Down to a sunless sea. So twice five miles of fertile ground With walls and towers were girdled round : And there were gardens bright with sinuous rills, Where blossomed many an incense-bearing tree ; And here were forests ancient as the hills, Enfolding sunny spots of greenery.'); } -read_test 5.3 { +read_test 5.3 { SELECT snippet(t5) FROM t5 WHERE t5 MATCH 'miles' } {{...to a sunless sea. So twice five miles of fertile ground With walls and towers...}} -read_test 5.4 { +read_test 5.4 { SELECT snippet(t5, '') FROM t5 WHERE t5 MATCH 'miles' } {{...to a sunless sea. So twice five miles of fertile ground With walls and towers...}} -read_test 5.5 { +read_test 5.5 { SELECT snippet(t5, '', '') FROM t5 WHERE t5 MATCH 'miles' } {{...to a sunless sea. So twice five miles of fertile ground With walls and towers...}} -read_test 5.6 { +read_test 5.6 { SELECT snippet(t5, '', '', 'XXX') FROM t5 WHERE t5 MATCH 'miles' } {{XXXto a sunless sea. So twice five miles of fertile ground With walls and towersXXX}} #------------------------------------------------------------------------- @@ -580,7 +580,7 @@ read_test 6.8 { SELECT * FROM t6 WHERE x MATCH NULL } {} # 2. That it is an error to use the "docid" or "rowid" column of # an FTS3 table as the LHS of a MATCH operator. # -# 3. That it is an error to AND together two MATCH expressions in +# 3. That it is an error to AND together two MATCH expressions in # that refer to a single FTS3 table in a WHERE clause. # # @@ -673,7 +673,7 @@ foreach DO_MALLOC_TEST {0 1 2} { # set DO_MALLOC_TEST 0 ddl_test 10.1.1 { CREATE VIRTUAL TABLE ta USING fts3 } -write_test 10.1.2 ta_content { +write_test 10.1.2 ta_content { INSERT INTO ta VALUES('During a summer vacation in 1790') } write_test 10.1.3 ta_content { INSERT INTO ta VALUES('Wordsworth went on a walking tour') } @@ -686,16 +686,16 @@ error_test 10.1.6 { } {database disk image is malformed} write_test 10.2.1 ta_content { DELETE FROM ta } -write_test 10.2.2 ta_content { +write_test 10.2.2 ta_content { INSERT INTO ta VALUES('debate demonstrated the rising difficulty') } -write_test 10.2.3 ta_content { +write_test 10.2.3 ta_content { INSERT INTO ta VALUES('Google released its browser beta') } set blob [db one {SELECT root FROM ta_segdir WHERE rowid = 2}] binary scan $blob "a6 a3 a*" start middle end set middle "\x0E\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x06\x06" set blob [binary format "a6 a* a*" $start $middle $end] -write_test 10.2.4 ta_segdir { +write_test 10.2.4 ta_segdir { UPDATE ta_segdir SET root = $blob WHERE rowid = 2 } error_test 10.2.5 { diff --git a/third_party/sqlite/src/test/e_insert.test b/third_party/sqlite/src/test/e_insert.test index 32d75cbbd7269..1610f0f29783a 100644 --- a/third_party/sqlite/src/test/e_insert.test +++ b/third_party/sqlite/src/test/e_insert.test @@ -28,7 +28,7 @@ ifcapable !compound { # e_insert-0.*: Test the syntax diagram. # # e_insert-1.*: Test statements of the form "INSERT ... VALUES(...)". -# +# # e_insert-2.*: Test statements of the form "INSERT ... SELECT ...". # # e_insert-3.*: Test statements of the form "INSERT ... DEFAULT VALUES". @@ -165,7 +165,7 @@ do_insert_tests e_insert-1.1 { # correct number of columns (for table a2, 3 columns) works. So these # tests just show that other values cause an error. # -do_insert_tests e_insert-1.2 -error { +do_insert_tests e_insert-1.2 -error { table %s has %d columns but %d values were supplied } { 1 "INSERT INTO a2 VALUES(1)" {a2 3 1} @@ -195,7 +195,7 @@ do_insert_tests e_insert-1.3 { # the number of values in each term of the VALUE list must match the # number of specified columns. # -do_insert_tests e_insert-1.4 -error { +do_insert_tests e_insert-1.4 -error { %d values for %d columns } { 1 "INSERT INTO a2(a, b, c) VALUES(1)" {1 3} @@ -304,10 +304,10 @@ do_insert_tests e_insert-2.3 { 3 "INSERT INTO a1 SELECT 'a'||a, 'b'||b FROM a1 LIMIT 2 OFFSET 1" {} 4 "INSERT INTO a1 SELECT * FROM a1 ORDER BY b, a" {} S "SELECT * FROM a1" { - x y + x y x y y x y x - ax by ay bx + ax by ay bx ay bx ax by y x y x x y x y } } @@ -361,7 +361,7 @@ do_insert_tests e_insert-3.2 { # EVIDENCE-OF: R-03421-22330 The REPLACE command is an alias for the # "INSERT OR REPLACE" variant of the INSERT command. # -# This is a dup of R-23110-47146. Therefore it is also verified +# This is a dup of R-23110-47146. Therefore it is also verified # by e_select-4.2.*. This requirement is the only one from # lang_replace.html. # @@ -376,16 +376,16 @@ foreach {tn sql error ac data } { 1.3 "INSERT OR IGNORE INTO a4 VALUES(3, 'c')" {} 1 {1 a 3 a 2 b} 1.4 "BEGIN" {} 0 {1 a 3 a 2 b} 1.5 "INSERT INTO a4 VALUES(1, 'd')" {UNIQUE constraint failed: a4.c} 0 {1 a 3 a 2 b} - 1.6 "INSERT OR ABORT INTO a4 VALUES(1, 'd')" + 1.6 "INSERT OR ABORT INTO a4 VALUES(1, 'd')" {UNIQUE constraint failed: a4.c} 0 {1 a 3 a 2 b} - 1.7 "INSERT OR ROLLBACK INTO a4 VALUES(1, 'd')" + 1.7 "INSERT OR ROLLBACK INTO a4 VALUES(1, 'd')" {UNIQUE constraint failed: a4.c} 1 {1 a 3 a 2 b} 1.8 "INSERT INTO a4 SELECT 4, 'e' UNION ALL SELECT 3, 'e'" {UNIQUE constraint failed: a4.c} 1 {1 a 3 a 2 b} 1.9 "INSERT OR FAIL INTO a4 SELECT 4, 'e' UNION ALL SELECT 3, 'e'" {UNIQUE constraint failed: a4.c} 1 {1 a 3 a 2 b 4 e} - 2.1 "INSERT INTO a4 VALUES(2,'f')" + 2.1 "INSERT INTO a4 VALUES(2,'f')" {UNIQUE constraint failed: a4.c} 1 {1 a 3 a 2 b 4 e} 2.2 "REPLACE INTO a4 VALUES(2, 'f')" {} 1 {1 a 3 a 4 e 2 f} } { diff --git a/third_party/sqlite/src/test/e_reindex.test b/third_party/sqlite/src/test/e_reindex.test index c6a9e0352f0ed..8296a66dda5f7 100644 --- a/third_party/sqlite/src/test/e_reindex.test +++ b/third_party/sqlite/src/test/e_reindex.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file implements tests to verify that the "testable statements" in +# This file implements tests to verify that the "testable statements" in # the lang_reindex.html document are correct. # @@ -85,7 +85,7 @@ do_execsql_test e_reindex-1.4 { } {ok} #------------------------------------------------------------------------- -# The remaining tests in this file focus on testing that the REINDEX +# The remaining tests in this file focus on testing that the REINDEX # command reindexes the correct subset of the indexes in the database. # They all use the following dataset. # diff --git a/third_party/sqlite/src/test/e_resolve.test b/third_party/sqlite/src/test/e_resolve.test index f4bb1a43174cb..7cacff294532f 100644 --- a/third_party/sqlite/src/test/e_resolve.test +++ b/third_party/sqlite/src/test/e_resolve.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file implements tests to verify that the "testable statements" in +# This file implements tests to verify that the "testable statements" in # the lang_naming.html document are correct. # @@ -108,7 +108,7 @@ do_execsql_test 5.1 { SELECT * FROM n3 } {at1 n3} do_execsql_test 5.2 { SELECT * FROM n4 } {at2 n4} #------------------------------------------------------------------------- -# EVIDENCE-OF: R-37286-42536 +# EVIDENCE-OF: R-37286-42536 # db close forcedelete test.db file.db diff --git a/third_party/sqlite/src/test/e_select.test b/third_party/sqlite/src/test/e_select.test index 9aa2de6038f9b..d9c799a7604d8 100644 --- a/third_party/sqlite/src/test/e_select.test +++ b/third_party/sqlite/src/test/e_select.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file implements tests to verify that the "testable statements" in +# This file implements tests to verify that the "testable statements" in # the lang_select.html document are correct. # @@ -58,9 +58,9 @@ set t1_cross_t1 [list \ # This proc is a specialized version of [do_execsql_test]. # -# The second argument to this proc must be a SELECT statement that -# features a cross join of some time. Instead of the usual ",", -# "CROSS JOIN" or "INNER JOIN" join-op, the string %JOIN% must be +# The second argument to this proc must be a SELECT statement that +# features a cross join of some time. Instead of the usual ",", +# "CROSS JOIN" or "INNER JOIN" join-op, the string %JOIN% must be # substituted. # # This test runs the SELECT three times - once with: @@ -121,7 +121,7 @@ do_select_tests e_select-0.2 { 0000.1 "SELECT 1, 2, 3 " {1 2 3} 1000.1 "SELECT DISTINCT 1, 2, 3 " {1 2 3} 2000.1 "SELECT ALL 1, 2, 3 " {1 2 3} - + 0100.1 "SELECT a, b, a||b FROM t1 " { a one aone b two btwo c three cthree } @@ -170,21 +170,21 @@ do_select_tests e_select-0.2 { 0102.2 "SELECT count(*), max(a) FROM t1 GROUP BY b HAVING count(*)=2" { } 1101.1 "SELECT DISTINCT count(*), max(a) FROM t1 GROUP BY b" {1 a 1 c 1 b} - 1102.1 "SELECT DISTINCT count(*), max(a) FROM t1 + 1102.1 "SELECT DISTINCT count(*), max(a) FROM t1 GROUP BY b HAVING count(*)=1" { 1 a 1 c 1 b } - 1102.2 "SELECT DISTINCT count(*), max(a) FROM t1 - GROUP BY b HAVING count(*)=2" { + 1102.2 "SELECT DISTINCT count(*), max(a) FROM t1 + GROUP BY b HAVING count(*)=2" { } 2101.1 "SELECT ALL count(*), max(a) FROM t1 GROUP BY b" {1 a 1 c 1 b} - 2102.1 "SELECT ALL count(*), max(a) FROM t1 + 2102.1 "SELECT ALL count(*), max(a) FROM t1 GROUP BY b HAVING count(*)=1" { 1 a 1 c 1 b } - 2102.2 "SELECT ALL count(*), max(a) FROM t1 - GROUP BY b HAVING count(*)=2" { + 2102.2 "SELECT ALL count(*), max(a) FROM t1 + GROUP BY b HAVING count(*)=2" { } 0011.1 "SELECT 1, 2, 3 WHERE 1 GROUP BY 2" {1 2 3} @@ -192,7 +192,7 @@ do_select_tests e_select-0.2 { 0012.2 "SELECT 1, 2, 3 WHERE 0 GROUP BY 2 HAVING count(*)>1" {} 1011.1 "SELECT DISTINCT 1, 2, 3 WHERE 0 GROUP BY 2" {} - 1012.1 "SELECT DISTINCT 1, 2, 3 WHERE 1 GROUP BY 2 HAVING count(*)=1" + 1012.1 "SELECT DISTINCT 1, 2, 3 WHERE 1 GROUP BY 2 HAVING count(*)=1" {1 2 3} 1012.2 "SELECT DISTINCT 1, 2, 3 WHERE NULL GROUP BY 2 HAVING count(*)>1" {} @@ -201,27 +201,27 @@ do_select_tests e_select-0.2 { 2012.2 "SELECT ALL 1, 2, 3 WHERE 'abc' GROUP BY 2 HAVING count(*)>1" {} 0111.1 "SELECT count(*), max(a) FROM t1 WHERE a='a' GROUP BY b" {1 a} - 0112.1 "SELECT count(*), max(a) FROM t1 + 0112.1 "SELECT count(*), max(a) FROM t1 WHERE a='c' GROUP BY b HAVING count(*)=1" {1 c} - 0112.2 "SELECT count(*), max(a) FROM t1 + 0112.2 "SELECT count(*), max(a) FROM t1 WHERE 0 GROUP BY b HAVING count(*)=2" { } - 1111.1 "SELECT DISTINCT count(*), max(a) FROM t1 WHERE a<'c' GROUP BY b" + 1111.1 "SELECT DISTINCT count(*), max(a) FROM t1 WHERE a<'c' GROUP BY b" {1 a 1 b} 1112.1 "SELECT DISTINCT count(*), max(a) FROM t1 WHERE a>'a' GROUP BY b HAVING count(*)=1" { 1 c 1 b } 1112.2 "SELECT DISTINCT count(*), max(a) FROM t1 WHERE 0 - GROUP BY b HAVING count(*)=2" { + GROUP BY b HAVING count(*)=2" { } - 2111.1 "SELECT ALL count(*), max(a) FROM t1 WHERE b>'one' GROUP BY b" + 2111.1 "SELECT ALL count(*), max(a) FROM t1 WHERE b>'one' GROUP BY b" {1 c 1 b} 2112.1 "SELECT ALL count(*), max(a) FROM t1 WHERE a!='b' GROUP BY b HAVING count(*)=1" { 1 a 1 c } - 2112.2 "SELECT ALL count(*), max(a) FROM t1 + 2112.2 "SELECT ALL count(*), max(a) FROM t1 WHERE 0 GROUP BY b HAVING count(*)=2" { } } @@ -247,7 +247,7 @@ do_select_tests e_select-0.4 { 4 "SELECT t1.rowid FROM t1" {1 2 3} 5 "SELECT t1.rowid FROM t1 JOIN t2" {1 1 1 2 2 2 3 3 3} - 6 "SELECT t1.rowid FROM t1 JOIN t2 JOIN t3" + 6 "SELECT t1.rowid FROM t1 JOIN t2 JOIN t3" {1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3} 7 "SELECT t1.rowid FROM t1 NATURAL JOIN t3" {1 2} @@ -296,23 +296,23 @@ do_select_tests e_select-0.7 { 8 "SELECT * FROM t1 ORDER BY b LIMIT 10 OFFSET 5" {} 9 "SELECT * FROM t1 ORDER BY a,b LIMIT 10, 5" {} - 10 "SELECT * FROM t1 UNION SELECT b, a FROM t1" + 10 "SELECT * FROM t1 UNION SELECT b, a FROM t1" {a one b two c three one a three c two b} - 11 "SELECT * FROM t1 UNION SELECT b, a FROM t1 ORDER BY b" + 11 "SELECT * FROM t1 UNION SELECT b, a FROM t1 ORDER BY b" {one a two b three c a one c three b two} - 12 "SELECT * FROM t1 UNION SELECT b, a FROM t1 ORDER BY b, a" + 12 "SELECT * FROM t1 UNION SELECT b, a FROM t1 ORDER BY b, a" {one a two b three c a one c three b two} - 13 "SELECT * FROM t1 UNION SELECT b, a FROM t1 LIMIT 10" + 13 "SELECT * FROM t1 UNION SELECT b, a FROM t1 LIMIT 10" {a one b two c three one a three c two b} - 14 "SELECT * FROM t1 UNION SELECT b, a FROM t1 LIMIT 10 OFFSET 5" + 14 "SELECT * FROM t1 UNION SELECT b, a FROM t1 LIMIT 10 OFFSET 5" {two b} - 15 "SELECT * FROM t1 UNION SELECT b, a FROM t1 LIMIT 10, 5" + 15 "SELECT * FROM t1 UNION SELECT b, a FROM t1 LIMIT 10, 5" {} - 16 "SELECT * FROM t1 UNION SELECT b, a FROM t1 ORDER BY a LIMIT 10" + 16 "SELECT * FROM t1 UNION SELECT b, a FROM t1 ORDER BY a LIMIT 10" {a one b two c three one a three c two b} - 17 "SELECT * FROM t1 UNION SELECT b, a FROM t1 ORDER BY b LIMIT 10 OFFSET 5" + 17 "SELECT * FROM t1 UNION SELECT b, a FROM t1 ORDER BY b LIMIT 10 OFFSET 5" {b two} - 18 "SELECT * FROM t1 UNION SELECT b, a FROM t1 ORDER BY a,b LIMIT 10, 5" + 18 "SELECT * FROM t1 UNION SELECT b, a FROM t1 ORDER BY a,b LIMIT 10, 5" {} } @@ -348,9 +348,9 @@ do_execsql_test e_select-1.2.0 { } {} do_select_tests e_select-1.2 { 1 "SELECT quote(x), quote(y) FROM xx" { - 'IiJlsIPepMuAhU' X'10B00B897A15BAA02E3F98DCE8F2' - NULL -16.87 - -17.89 'linguistically' + 'IiJlsIPepMuAhU' X'10B00B897A15BAA02E3F98DCE8F2' + NULL -16.87 + -17.89 'linguistically' } 2 "SELECT count(*), count(x), count(y) FROM xx" {3 2 3} @@ -362,18 +362,18 @@ do_select_tests e_select-1.2 { # joined into a single dataset for the simple SELECT statement to # operate on. # -# There are more detailed tests for subsequent requirements that add +# There are more detailed tests for subsequent requirements that add # more detail to this idea. We just add a single test that shows that # data is coming from each of the three tables following the FROM clause # here to show that the statement, vague as it is, is not incorrect. # do_select_tests e_select-1.3 { 1 "SELECT * FROM t1, t2, t3" { - a one a I a 1 a one a I b 2 a one b II a 1 - a one b II b 2 a one c III a 1 a one c III b 2 - b two a I a 1 b two a I b 2 b two b II a 1 - b two b II b 2 b two c III a 1 b two c III b 2 - c three a I a 1 c three a I b 2 c three b II a 1 + a one a I a 1 a one a I b 2 a one b II a 1 + a one b II b 2 a one c III a 1 a one c III b 2 + b two a I a 1 b two a I b 2 b two b II a 1 + b two b II b 2 b two c III a 1 b two c III b 2 + c three a I a 1 c three a I b 2 c three b II a 1 c three b II b 2 c three c III a 1 c three c III b 2 } } @@ -390,7 +390,7 @@ do_select_tests e_select-1.3 { # # The tests are built on this assertion. Really, they test that the output # of a CROSS JOIN, JOIN, INNER JOIN or "," join matches the expected result -# of calculating the cartesian product of the left and right-hand datasets. +# of calculating the cartesian product of the left and right-hand datasets. # # EVIDENCE-OF: R-46256-57243 There is no difference between the "INNER # JOIN", "JOIN" and "," join operators. @@ -470,34 +470,34 @@ do_join_test e_select-1.4.2.1 { # of Nleft×Nright rows, each containing Mleft+Mright columns. # # x1, x2 (Nlhs=3, Nrhs=2) (Mlhs=2, Mrhs=3) -do_join_test e_select-1.4.3.1 { - SELECT count(*) FROM x1 %JOIN% x2 +do_join_test e_select-1.4.3.1 { + SELECT count(*) FROM x1 %JOIN% x2 } [expr 3*2] -do_test e_select-1.4.3.2 { +do_test e_select-1.4.3.2 { expr {[llength [execsql {SELECT * FROM x1, x2}]] / 6} } [expr 2+3] # x2, x3 (Nlhs=2, Nrhs=5) (Mlhs=3, Mrhs=4) -do_join_test e_select-1.4.3.3 { - SELECT count(*) FROM x2 %JOIN% x3 +do_join_test e_select-1.4.3.3 { + SELECT count(*) FROM x2 %JOIN% x3 } [expr 2*5] -do_test e_select-1.4.3.4 { +do_test e_select-1.4.3.4 { expr {[llength [execsql {SELECT * FROM x2 JOIN x3}]] / 10} } [expr 3+4] # x3, x1 (Nlhs=5, Nrhs=3) (Mlhs=4, Mrhs=2) -do_join_test e_select-1.4.3.5 { - SELECT count(*) FROM x3 %JOIN% x1 +do_join_test e_select-1.4.3.5 { + SELECT count(*) FROM x3 %JOIN% x1 } [expr 5*3] -do_test e_select-1.4.3.6 { +do_test e_select-1.4.3.6 { expr {[llength [execsql {SELECT * FROM x3 CROSS JOIN x1}]] / 15} } [expr 4+2] # x3, x3 (Nlhs=5, Nrhs=5) (Mlhs=4, Mrhs=4) -do_join_test e_select-1.4.3.7 { - SELECT count(*) FROM x3 %JOIN% x3 +do_join_test e_select-1.4.3.7 { + SELECT count(*) FROM x3 %JOIN% x3 } [expr 5*5] -do_test e_select-1.4.3.8 { +do_test e_select-1.4.3.8 { expr {[llength [execsql {SELECT * FROM x3 INNER JOIN x3 AS x4}]] / 25} } [expr 4+4] @@ -532,7 +532,7 @@ foreach {tn select res} [list \ {one I two II three III} \ 10 { SELECT t1.b, t2.b FROM t1 %JOIN% t2 ON (t1.a = 'a') } \ {one I one II one III} \ - 11 { SELECT t1.b, t2.b + 11 { SELECT t1.b, t2.b FROM t1 %JOIN% t2 ON (CASE WHEN t1.a = 'a' THEN NULL ELSE 1 END) } \ {two I two II two III three I three II three III} \ ] { @@ -549,7 +549,7 @@ do_select_tests e_select-1.4 -error { 1 { SELECT * FROM t1, t3 USING (b) } "b" 2 { SELECT * FROM t3, t1 USING (c) } "c" 3 { SELECT * FROM t3, (SELECT a AS b, b AS c FROM t1) USING (a) } "a" -} +} # EVIDENCE-OF: R-22776-52830 For each pair of named columns, the # expression "lhs.X = rhs.X" is evaluated for each row of the cartesian @@ -559,7 +559,7 @@ do_select_tests e_select-1.4 -error { do_select_tests e_select-1.5 { 1 { SELECT * FROM t1, t3 USING (a) } {a one 1 b two 2} 2 { SELECT * FROM t3, t4 USING (a,c) } {b 2} -} +} # EVIDENCE-OF: R-54046-48600 When comparing values as a result of a # USING clause, the normal rules for handling affinities, collation @@ -583,7 +583,7 @@ do_execsql_test e_select-1.6.0 { foreach {tn select res} { 1 { SELECT * FROM t5 %JOIN% t6 USING (a) } {AA cc cc BB dd DD} 2 { SELECT * FROM t6 %JOIN% t5 USING (a) } {} - 3 { SELECT * FROM (SELECT a COLLATE nocase, b FROM t6) %JOIN% t5 USING (a) } + 3 { SELECT * FROM (SELECT a COLLATE nocase, b FROM t6) %JOIN% t5 USING (a) } {aa cc cc bb DD dd} 4 { SELECT * FROM t5 %JOIN% t6 USING (a,b) } {AA cc} 5 { SELECT * FROM t6 %JOIN% t5 USING (a,b) } {} @@ -599,24 +599,24 @@ foreach {tn select res} { # clause and its equivalent ON constraint. # foreach {tn select res} { - 1a { SELECT * FROM t1 %JOIN% t2 USING (a) } + 1a { SELECT * FROM t1 %JOIN% t2 USING (a) } {a one I b two II c three III} 1b { SELECT * FROM t1 %JOIN% t2 ON (t1.a=t2.a) } {a one a I b two b II c three c III} - 2a { SELECT * FROM t3 %JOIN% t4 USING (a) } + 2a { SELECT * FROM t3 %JOIN% t4 USING (a) } {a 1 {} b 2 2} - 2b { SELECT * FROM t3 %JOIN% t4 ON (t3.a=t4.a) } + 2b { SELECT * FROM t3 %JOIN% t4 ON (t3.a=t4.a) } {a 1 a {} b 2 b 2} 3a { SELECT * FROM t3 %JOIN% t4 USING (a,c) } {b 2} 3b { SELECT * FROM t3 %JOIN% t4 ON (t3.a=t4.a AND t3.c=t4.c) } {b 2 b 2} - 4a { SELECT * FROM (SELECT a COLLATE nocase, b FROM t6) AS x - %JOIN% t5 USING (a) } + 4a { SELECT * FROM (SELECT a COLLATE nocase, b FROM t6) AS x + %JOIN% t5 USING (a) } {aa cc cc bb DD dd} 4b { SELECT * FROM (SELECT a COLLATE nocase, b FROM t6) AS x - %JOIN% t5 ON (x.a=t5.a) } + %JOIN% t5 ON (x.a=t5.a) } {aa cc AA cc bb DD BB dd} } { do_join_test e_select-1.7.$tn $select $res @@ -652,7 +652,7 @@ do_select_tests e_select-1.8 { # do_select_tests e_select-1.9 { 1a "SELECT * FROM t7 JOIN t8 ON (t7.a=t8.a)" {x ex 24 x abc 24} - 1b "SELECT * FROM t7 LEFT JOIN t8 ON (t7.a=t8.a)" + 1b "SELECT * FROM t7 LEFT JOIN t8 ON (t7.a=t8.a)" {x ex 24 x abc 24 y why 25 {} {} {}} 2a "SELECT * FROM t7 JOIN t8 USING (a)" {x ex 24 abc 24} 2b "SELECT * FROM t7 LEFT JOIN t8 USING (a)" {x ex 24 abc 24 y why 25 {} {}} @@ -682,7 +682,7 @@ do_select_tests e_select-1-10 { 6a "SELECT * FROM t3 LEFT JOIN t4 USING (a,c)" {a 1 b 2} 6b "SELECT * FROM t3 NATURAL LEFT JOIN t4" {a 1 b 2} -} +} # EVIDENCE-OF: R-49566-01570 If the left and right-hand input datasets # feature no common column names, then the NATURAL keyword has no effect @@ -712,7 +712,7 @@ foreach {tn sql} { } #------------------------------------------------------------------------- -# The next block of tests - e_select-3.* - concentrate on verifying +# The next block of tests - e_select-3.* - concentrate on verifying # statements made regarding WHERE clause processing. # drop_all_tables @@ -805,10 +805,10 @@ do_select_tests e_select-4.1 { 7 "SELECT max(a), * FROM z1" {63 63 born -26} 8 "SELECT *, min(a) FROM z1" {-5 {} 75 -5} - 9 "SELECT *,* FROM z1,z2 LIMIT 1" { + 9 "SELECT *,* FROM z1,z2 LIMIT 1" { 51.65 -59.58 belfries {} 21 51.65 -59.58 belfries {} 21 } - 10 "SELECT z1.*,z1.* FROM z2,z1 LIMIT 1" { + 10 "SELECT z1.*,z1.* FROM z2,z1 LIMIT 1" { 51.65 -59.58 belfries 51.65 -59.58 belfries } } @@ -880,9 +880,9 @@ do_select_tests e_select-4.4 { 2 "SELECT a IS NULL, b+1, * FROM z1" { 0 -58.58 51.65 -59.58 belfries - 0 {} -5 {} 75 + 0 {} -5 {} 75 0 -22.18 -2.2 -23.18 suiters - 1 68 {} 67 quartets + 1 68 {} 67 quartets 0 -31.3 -1.04 -32.3 aspen 0 1 63 born -26 } @@ -939,10 +939,10 @@ do_execsql_test e_select-4.6.0 { INSERT INTO a2 VALUES(10, 4); } {} do_select_tests e_select-4.6 { - 1 "SELECT one, two, count(*) FROM a1" {4 10 4} - 2 "SELECT one, two, count(*) FROM a1 WHERE one<3" {2 3 2} - 3 "SELECT one, two, count(*) FROM a1 WHERE one>3" {4 10 1} - 4 "SELECT *, count(*) FROM a1 JOIN a2" {4 10 10 4 16} + 1 "SELECT one, two, count(*) FROM a1" {4 10 4} + 2 "SELECT one, two, count(*) FROM a1 WHERE one<3" {2 3 2} + 3 "SELECT one, two, count(*) FROM a1 WHERE one>3" {4 10 1} + 4 "SELECT *, count(*) FROM a1 JOIN a2" {4 10 10 4 16} 5 "SELECT *, sum(three) FROM a1 NATURAL JOIN a2" {3 6 2 3} 6 "SELECT *, sum(three) FROM a1 NATURAL JOIN a2" {3 6 2 3} 7 "SELECT group_concat(three, ''), a1.* FROM a1 NATURAL JOIN a2" {12 3 6} @@ -958,7 +958,7 @@ do_select_tests e_select-4.7 { 3 "SELECT max(one) IS NULL, one IS NULL, two IS NULL FROM a1 WHERE two=7" { 1 1 1 } -} +} # EVIDENCE-OF: R-64138-28774 An aggregate query without a GROUP BY # clause always returns exactly one row of data, even if there are zero @@ -977,7 +977,7 @@ foreach {tn select} { while {"SQLITE_ROW" == [sqlite3_step $::stmt]} { incr nRow } set rc [sqlite3_finalize $::stmt] - # Test that $nRow==1 and that statement execution was successful + # Test that $nRow==1 and that statement execution was successful # (rc==SQLITE_OK). do_test e_select-4.$tn [list list $rc $nRow] {SQLITE_OK 1} } @@ -1040,7 +1040,7 @@ do_select_tests e_select-4.9 { do_select_tests e_select-4.10 { 1 "SELECT group_concat(y) FROM b2 GROUP BY x" {/#,# 3 #,#/} 2 "SELECT count(*) FROM b2 GROUP BY CASE WHEN y<4 THEN NULL ELSE 0 END" {4 1} -} +} # EVIDENCE-OF: R-10470-30318 The usual rules for selecting a collation # sequence with which to compare text values apply when evaluating @@ -1144,7 +1144,7 @@ do_select_tests e_select-4.15 { 4 "SELECT 1+sum(j), max(j)+1 FROM c2 GROUP BY (j%2)" {81 37 41 22} 5 "SELECT count(*), round(avg(i),2) FROM c1, c2 ON (i=down) GROUP BY j%2" {3 4.33 1 2.0} -} +} # EVIDENCE-OF: R-62913-19830 Otherwise, it is evaluated against a single # arbitrarily chosen row from within the group. @@ -1160,7 +1160,7 @@ do_select_tests e_select-4.15 { 4 "SELECT i, j FROM c2 GROUP BY i%2 HAVING j>30" {9 36} 5 "SELECT count(*), i, k FROM c2 NATURAL JOIN c3 GROUP BY substr(k, 1, 1)" {2 5 boron 2 2 helium 1 3 lithium} -} +} # EVIDENCE-OF: R-19334-12811 Each group of input dataset rows # contributes a single row to the set of result rows. @@ -1175,7 +1175,7 @@ do_select_tests e_select.4.16 -count { 1 "SELECT i, j FROM c2 GROUP BY i%2" 2 2 "SELECT i, j FROM c2 GROUP BY i" 9 3 "SELECT i, j FROM c2 GROUP BY i HAVING i<5" 4 -} +} #------------------------------------------------------------------------- # The following tests attempt to verify statements made regarding the ALL @@ -1243,7 +1243,7 @@ do_select_tests e_select-5 { 4.1 "SELECT DISTINCT x FROM h2" {One Two Three Four} 4.2 "SELECT DISTINCT x FROM h1, h2 ON (x=b)" {One Four} -} +} # EVIDENCE-OF: R-02054-15343 For the purposes of detecting duplicate # rows, two NULL values are considered to be equal. @@ -1308,63 +1308,63 @@ do_select_tests e_select-7.1 -error { 18 "SELECT a, b FROM j1 EXCEPT SELECT g FROM j3" {EXCEPT} 19 "SELECT a, b FROM j1 EXCEPT SELECT * FROM j3,j2" {EXCEPT} 20 "SELECT * FROM j3,j2 EXCEPT SELECT a, b FROM j1" {EXCEPT} -} +} # EVIDENCE-OF: R-01450-11152 As the components of a compound SELECT must # be simple SELECT statements, they may not contain ORDER BY or LIMIT # clauses. -# +# foreach {tn select op1 op2} { - 1 "SELECT * FROM j1 ORDER BY a UNION ALL SELECT * FROM j2,j3" + 1 "SELECT * FROM j1 ORDER BY a UNION ALL SELECT * FROM j2,j3" {ORDER BY} {UNION ALL} 2 "SELECT count(*) FROM j1 ORDER BY 1 UNION ALL SELECT max(e) FROM j2" {ORDER BY} {UNION ALL} 3 "SELECT count(*), * FROM j1 ORDER BY 1,2,3 UNION ALL SELECT *,* FROM j2" {ORDER BY} {UNION ALL} - 4 "SELECT * FROM j1 LIMIT 10 UNION ALL SELECT * FROM j2,j3" + 4 "SELECT * FROM j1 LIMIT 10 UNION ALL SELECT * FROM j2,j3" LIMIT {UNION ALL} - 5 "SELECT * FROM j1 LIMIT 10 OFFSET 5 UNION ALL SELECT * FROM j2,j3" + 5 "SELECT * FROM j1 LIMIT 10 OFFSET 5 UNION ALL SELECT * FROM j2,j3" LIMIT {UNION ALL} - 6 "SELECT a FROM j1 LIMIT (SELECT e FROM j2) UNION ALL SELECT g FROM j2,j3" + 6 "SELECT a FROM j1 LIMIT (SELECT e FROM j2) UNION ALL SELECT g FROM j2,j3" LIMIT {UNION ALL} - 7 "SELECT * FROM j1 ORDER BY a UNION SELECT * FROM j2,j3" + 7 "SELECT * FROM j1 ORDER BY a UNION SELECT * FROM j2,j3" {ORDER BY} {UNION} 8 "SELECT count(*) FROM j1 ORDER BY 1 UNION SELECT max(e) FROM j2" {ORDER BY} {UNION} 9 "SELECT count(*), * FROM j1 ORDER BY 1,2,3 UNION SELECT *,* FROM j2" {ORDER BY} {UNION} - 10 "SELECT * FROM j1 LIMIT 10 UNION SELECT * FROM j2,j3" + 10 "SELECT * FROM j1 LIMIT 10 UNION SELECT * FROM j2,j3" LIMIT {UNION} - 11 "SELECT * FROM j1 LIMIT 10 OFFSET 5 UNION SELECT * FROM j2,j3" + 11 "SELECT * FROM j1 LIMIT 10 OFFSET 5 UNION SELECT * FROM j2,j3" LIMIT {UNION} - 12 "SELECT a FROM j1 LIMIT (SELECT e FROM j2) UNION SELECT g FROM j2,j3" + 12 "SELECT a FROM j1 LIMIT (SELECT e FROM j2) UNION SELECT g FROM j2,j3" LIMIT {UNION} - 13 "SELECT * FROM j1 ORDER BY a EXCEPT SELECT * FROM j2,j3" + 13 "SELECT * FROM j1 ORDER BY a EXCEPT SELECT * FROM j2,j3" {ORDER BY} {EXCEPT} 14 "SELECT count(*) FROM j1 ORDER BY 1 EXCEPT SELECT max(e) FROM j2" {ORDER BY} {EXCEPT} 15 "SELECT count(*), * FROM j1 ORDER BY 1,2,3 EXCEPT SELECT *,* FROM j2" {ORDER BY} {EXCEPT} - 16 "SELECT * FROM j1 LIMIT 10 EXCEPT SELECT * FROM j2,j3" + 16 "SELECT * FROM j1 LIMIT 10 EXCEPT SELECT * FROM j2,j3" LIMIT {EXCEPT} - 17 "SELECT * FROM j1 LIMIT 10 OFFSET 5 EXCEPT SELECT * FROM j2,j3" + 17 "SELECT * FROM j1 LIMIT 10 OFFSET 5 EXCEPT SELECT * FROM j2,j3" LIMIT {EXCEPT} - 18 "SELECT a FROM j1 LIMIT (SELECT e FROM j2) EXCEPT SELECT g FROM j2,j3" + 18 "SELECT a FROM j1 LIMIT (SELECT e FROM j2) EXCEPT SELECT g FROM j2,j3" LIMIT {EXCEPT} - 19 "SELECT * FROM j1 ORDER BY a INTERSECT SELECT * FROM j2,j3" + 19 "SELECT * FROM j1 ORDER BY a INTERSECT SELECT * FROM j2,j3" {ORDER BY} {INTERSECT} 20 "SELECT count(*) FROM j1 ORDER BY 1 INTERSECT SELECT max(e) FROM j2" {ORDER BY} {INTERSECT} 21 "SELECT count(*), * FROM j1 ORDER BY 1,2,3 INTERSECT SELECT *,* FROM j2" {ORDER BY} {INTERSECT} - 22 "SELECT * FROM j1 LIMIT 10 INTERSECT SELECT * FROM j2,j3" + 22 "SELECT * FROM j1 LIMIT 10 INTERSECT SELECT * FROM j2,j3" LIMIT {INTERSECT} - 23 "SELECT * FROM j1 LIMIT 10 OFFSET 5 INTERSECT SELECT * FROM j2,j3" + 23 "SELECT * FROM j1 LIMIT 10 OFFSET 5 INTERSECT SELECT * FROM j2,j3" LIMIT {INTERSECT} - 24 "SELECT a FROM j1 LIMIT (SELECT e FROM j2) INTERSECT SELECT g FROM j2,j3" + 24 "SELECT a FROM j1 LIMIT (SELECT e FROM j2) INTERSECT SELECT g FROM j2,j3" LIMIT {INTERSECT} } { set err "$op1 clause should come after $op2 not before" @@ -1379,31 +1379,31 @@ foreach {tn select} { 1 "SELECT * FROM j1 UNION ALL SELECT * FROM j2,j3 ORDER BY a" 2 "SELECT count(*) FROM j1 UNION ALL SELECT max(e) FROM j2 ORDER BY 1" 3 "SELECT count(*), * FROM j1 UNION ALL SELECT *,* FROM j2 ORDER BY 1,2,3" - 4 "SELECT * FROM j1 UNION ALL SELECT * FROM j2,j3 LIMIT 10" - 5 "SELECT * FROM j1 UNION ALL SELECT * FROM j2,j3 LIMIT 10 OFFSET 5" - 6 "SELECT a FROM j1 UNION ALL SELECT g FROM j2,j3 LIMIT (SELECT 10)" + 4 "SELECT * FROM j1 UNION ALL SELECT * FROM j2,j3 LIMIT 10" + 5 "SELECT * FROM j1 UNION ALL SELECT * FROM j2,j3 LIMIT 10 OFFSET 5" + 6 "SELECT a FROM j1 UNION ALL SELECT g FROM j2,j3 LIMIT (SELECT 10)" 7 "SELECT * FROM j1 UNION SELECT * FROM j2,j3 ORDER BY a" 8 "SELECT count(*) FROM j1 UNION SELECT max(e) FROM j2 ORDER BY 1" 8b "VALUES('8b') UNION SELECT max(e) FROM j2 ORDER BY 1" 9 "SELECT count(*), * FROM j1 UNION SELECT *,* FROM j2 ORDER BY 1,2,3" - 10 "SELECT * FROM j1 UNION SELECT * FROM j2,j3 LIMIT 10" - 11 "SELECT * FROM j1 UNION SELECT * FROM j2,j3 LIMIT 10 OFFSET 5" - 12 "SELECT a FROM j1 UNION SELECT g FROM j2,j3 LIMIT (SELECT 10)" + 10 "SELECT * FROM j1 UNION SELECT * FROM j2,j3 LIMIT 10" + 11 "SELECT * FROM j1 UNION SELECT * FROM j2,j3 LIMIT 10 OFFSET 5" + 12 "SELECT a FROM j1 UNION SELECT g FROM j2,j3 LIMIT (SELECT 10)" 13 "SELECT * FROM j1 EXCEPT SELECT * FROM j2,j3 ORDER BY a" 14 "SELECT count(*) FROM j1 EXCEPT SELECT max(e) FROM j2 ORDER BY 1" 15 "SELECT count(*), * FROM j1 EXCEPT SELECT *,* FROM j2 ORDER BY 1,2,3" - 16 "SELECT * FROM j1 EXCEPT SELECT * FROM j2,j3 LIMIT 10" - 17 "SELECT * FROM j1 EXCEPT SELECT * FROM j2,j3 LIMIT 10 OFFSET 5" - 18 "SELECT a FROM j1 EXCEPT SELECT g FROM j2,j3 LIMIT (SELECT 10)" + 16 "SELECT * FROM j1 EXCEPT SELECT * FROM j2,j3 LIMIT 10" + 17 "SELECT * FROM j1 EXCEPT SELECT * FROM j2,j3 LIMIT 10 OFFSET 5" + 18 "SELECT a FROM j1 EXCEPT SELECT g FROM j2,j3 LIMIT (SELECT 10)" 19 "SELECT * FROM j1 INTERSECT SELECT * FROM j2,j3 ORDER BY a" 20 "SELECT count(*) FROM j1 INTERSECT SELECT max(e) FROM j2 ORDER BY 1" 21 "SELECT count(*), * FROM j1 INTERSECT SELECT *,* FROM j2 ORDER BY 1,2,3" - 22 "SELECT * FROM j1 INTERSECT SELECT * FROM j2,j3 LIMIT 10" - 23 "SELECT * FROM j1 INTERSECT SELECT * FROM j2,j3 LIMIT 10 OFFSET 5" - 24 "SELECT a FROM j1 INTERSECT SELECT g FROM j2,j3 LIMIT (SELECT 10)" + 22 "SELECT * FROM j1 INTERSECT SELECT * FROM j2,j3 LIMIT 10" + 23 "SELECT * FROM j1 INTERSECT SELECT * FROM j2,j3 LIMIT 10 OFFSET 5" + 24 "SELECT a FROM j1 INTERSECT SELECT g FROM j2,j3 LIMIT (SELECT 10)" } { do_test e_select-7.3.$tn { catch {execsql $select} msg } 0 } @@ -1445,12 +1445,12 @@ do_select_tests e_select-7.4 { 2 {SELECT * FROM q1 WHERE a=16 UNION ALL SELECT 'x', * FROM q2 WHERE oid=1} {16 -87.66 {} x legible 1} - 3 {SELECT count(*) FROM q1 UNION ALL SELECT min(e) FROM q2} + 3 {SELECT count(*) FROM q1 UNION ALL SELECT min(e) FROM q2} {3 -16.56} - 4 {SELECT * FROM q2 UNION ALL SELECT * FROM q3} + 4 {SELECT * FROM q2 UNION ALL SELECT * FROM q3} {legible 1 beauty 2 -65.91 4 emanating -16.56 beauty 2 beauty 2} -} +} # EVIDENCE-OF: R-20560-39162 The UNION operator works the same way as # UNION ALL, except that duplicate rows are removed from the final @@ -1463,12 +1463,12 @@ do_select_tests e_select-7.5 { 2 {SELECT * FROM q1 WHERE a=16 UNION SELECT 'x', * FROM q2 WHERE oid=1} {16 -87.66 {} x legible 1} - 3 {SELECT count(*) FROM q1 UNION SELECT min(e) FROM q2} + 3 {SELECT count(*) FROM q1 UNION SELECT min(e) FROM q2} {-16.56 3} - 4 {SELECT * FROM q2 UNION SELECT * FROM q3} + 4 {SELECT * FROM q2 UNION SELECT * FROM q3} {-65.91 4 beauty 2 emanating -16.56 legible 1} -} +} # EVIDENCE-OF: R-45764-31737 The INTERSECT operator returns the # intersection of the results of the left and right SELECTs. @@ -1485,7 +1485,7 @@ do_select_tests e_select-7.6 { do_select_tests e_select-7.7 { 1 {SELECT a FROM q1 EXCEPT SELECT d FROM q2} {16} - 2 {SELECT * FROM q2 EXCEPT SELECT * FROM q3} + 2 {SELECT * FROM q2 EXCEPT SELECT * FROM q3} {-65.91 4 emanating -16.56 legible 1} } @@ -1526,7 +1526,7 @@ do_select_tests e_select-7.9 { 15 {SELECT c FROM q1 INTERSECT SELECT g FROM q3} {} 16 {SELECT c FROM q1 EXCEPT SELECT g FROM q3} {null -42.47} } -db nullvalue {} +db nullvalue {} # EVIDENCE-OF: R-51232-50224 The collation sequence used to compare two # text values is determined as if the columns of the left and right-hand @@ -1588,13 +1588,13 @@ do_select_tests e_select-7.11 { # other words, if "A", "B" and "C" are all simple SELECT statements, (A # op B op C) is processed as ((A op B) op C). # -# e_select-7.12.1: Precedence of UNION vs. INTERSECT -# e_select-7.12.2: Precedence of UNION vs. UNION ALL +# e_select-7.12.1: Precedence of UNION vs. INTERSECT +# e_select-7.12.2: Precedence of UNION vs. UNION ALL # e_select-7.12.3: Precedence of UNION vs. EXCEPT -# e_select-7.12.4: Precedence of INTERSECT vs. UNION ALL +# e_select-7.12.4: Precedence of INTERSECT vs. UNION ALL # e_select-7.12.5: Precedence of INTERSECT vs. EXCEPT # e_select-7.12.6: Precedence of UNION ALL vs. EXCEPT -# e_select-7.12.7: Check that "a EXCEPT b EXCEPT c" is processed as +# e_select-7.12.7: Check that "a EXCEPT b EXCEPT c" is processed as # "(a EXCEPT b) EXCEPT c". # # The INTERSECT and EXCEPT operations are mutually commutative. So @@ -1669,7 +1669,7 @@ do_execsql_test e_select-8.1.0 { # do_select_tests e_select-8.1 { 1 "SELECT * FROM d1 ORDER BY x, y, z" { - 1 2 -20 1 2 3 1 2 7 1 2 8 + 1 2 -20 1 2 3 1 2 7 1 2 8 1 4 93 1 5 -1 2 4 93 2 5 -1 } } @@ -1688,33 +1688,33 @@ do_select_tests e_select-8.1 { # do_select_tests e_select-8 { 2.1 "SELECT * FROM d1 ORDER BY x ASC, y ASC, z ASC" { - 1 2 -20 1 2 3 1 2 7 1 2 8 + 1 2 -20 1 2 3 1 2 7 1 2 8 1 4 93 1 5 -1 2 4 93 2 5 -1 } 2.2 "SELECT * FROM d1 ORDER BY x DESC, y DESC, z DESC" { - 2 5 -1 2 4 93 1 5 -1 1 4 93 - 1 2 8 1 2 7 1 2 3 1 2 -20 + 2 5 -1 2 4 93 1 5 -1 1 4 93 + 1 2 8 1 2 7 1 2 3 1 2 -20 } 2.3 "SELECT * FROM d1 ORDER BY x DESC, y ASC, z DESC" { - 2 4 93 2 5 -1 1 2 8 1 2 7 - 1 2 3 1 2 -20 1 4 93 1 5 -1 + 2 4 93 2 5 -1 1 2 8 1 2 7 + 1 2 3 1 2 -20 1 4 93 1 5 -1 } 2.4 "SELECT * FROM d1 ORDER BY x DESC, y ASC, z ASC" { - 2 4 93 2 5 -1 1 2 -20 1 2 3 - 1 2 7 1 2 8 1 4 93 1 5 -1 + 2 4 93 2 5 -1 1 2 -20 1 2 3 + 1 2 7 1 2 8 1 4 93 1 5 -1 } 3.1 "SELECT * FROM d1 ORDER BY x, y, z" { - 1 2 -20 1 2 3 1 2 7 1 2 8 + 1 2 -20 1 2 3 1 2 7 1 2 8 1 4 93 1 5 -1 2 4 93 2 5 -1 } 3.3 "SELECT * FROM d1 ORDER BY x DESC, y, z DESC" { - 2 4 93 2 5 -1 1 2 8 1 2 7 - 1 2 3 1 2 -20 1 4 93 1 5 -1 + 2 4 93 2 5 -1 1 2 8 1 2 7 + 1 2 3 1 2 -20 1 4 93 1 5 -1 } 3.4 "SELECT * FROM d1 ORDER BY x DESC, y, z" { - 2 4 93 2 5 -1 1 2 -20 1 2 3 - 1 2 7 1 2 8 1 4 93 1 5 -1 + 2 4 93 2 5 -1 1 2 -20 1 2 3 + 1 2 7 1 2 8 1 4 93 1 5 -1 } } @@ -1725,40 +1725,40 @@ do_select_tests e_select-8 { # do_select_tests e_select-8.4 { 1 "SELECT * FROM d1 ORDER BY 1 ASC, 2 ASC, 3 ASC" { - 1 2 -20 1 2 3 1 2 7 1 2 8 + 1 2 -20 1 2 3 1 2 7 1 2 8 1 4 93 1 5 -1 2 4 93 2 5 -1 } 2 "SELECT * FROM d1 ORDER BY 1 DESC, 2 DESC, 3 DESC" { - 2 5 -1 2 4 93 1 5 -1 1 4 93 - 1 2 8 1 2 7 1 2 3 1 2 -20 + 2 5 -1 2 4 93 1 5 -1 1 4 93 + 1 2 8 1 2 7 1 2 3 1 2 -20 } 3 "SELECT * FROM d1 ORDER BY 1 DESC, 2 ASC, 3 DESC" { - 2 4 93 2 5 -1 1 2 8 1 2 7 - 1 2 3 1 2 -20 1 4 93 1 5 -1 + 2 4 93 2 5 -1 1 2 8 1 2 7 + 1 2 3 1 2 -20 1 4 93 1 5 -1 } 4 "SELECT * FROM d1 ORDER BY 1 DESC, 2 ASC, 3 ASC" { - 2 4 93 2 5 -1 1 2 -20 1 2 3 - 1 2 7 1 2 8 1 4 93 1 5 -1 + 2 4 93 2 5 -1 1 2 -20 1 2 3 + 1 2 7 1 2 8 1 4 93 1 5 -1 } 5 "SELECT * FROM d1 ORDER BY 1, 2, 3" { - 1 2 -20 1 2 3 1 2 7 1 2 8 + 1 2 -20 1 2 3 1 2 7 1 2 8 1 4 93 1 5 -1 2 4 93 2 5 -1 } 6 "SELECT * FROM d1 ORDER BY 1 DESC, 2, 3 DESC" { - 2 4 93 2 5 -1 1 2 8 1 2 7 - 1 2 3 1 2 -20 1 4 93 1 5 -1 + 2 4 93 2 5 -1 1 2 8 1 2 7 + 1 2 3 1 2 -20 1 4 93 1 5 -1 } 7 "SELECT * FROM d1 ORDER BY 1 DESC, 2, 3" { - 2 4 93 2 5 -1 1 2 -20 1 2 3 - 1 2 7 1 2 8 1 4 93 1 5 -1 + 2 4 93 2 5 -1 1 2 -20 1 2 3 + 1 2 7 1 2 8 1 4 93 1 5 -1 } 8 "SELECT z, x FROM d1 ORDER BY 2" { - /# 1 # 1 # 1 # 1 + /# 1 # 1 # 1 # 1 # 1 # 1 # 2 # 2/ } 9 "SELECT z, x FROM d1 ORDER BY 1" { /-20 1 -1 # -1 # 3 1 - 7 1 8 1 93 # 93 #/ + 7 1 8 1 93 # 93 #/ } } @@ -1790,15 +1790,15 @@ do_select_tests e_select-8.5 { # do_select_tests e_select-8.6 { 1 "SELECT * FROM d1 ORDER BY x+y+z" { - 1 2 -20 1 5 -1 1 2 3 2 5 -1 + 1 2 -20 1 5 -1 1 2 3 2 5 -1 1 2 7 1 2 8 1 4 93 2 4 93 } 2 "SELECT * FROM d1 ORDER BY x*z" { - 1 2 -20 2 5 -1 1 5 -1 1 2 3 + 1 2 -20 2 5 -1 1 5 -1 1 2 3 1 2 7 1 2 8 1 4 93 2 4 93 } 3 "SELECT * FROM d1 ORDER BY y*z" { - 1 2 -20 2 5 -1 1 5 -1 1 2 3 + 1 2 -20 2 5 -1 1 5 -1 1 2 3 1 2 7 1 2 8 2 4 93 1 4 93 } } @@ -1813,20 +1813,20 @@ do_select_tests e_select-8.7.1 -error { } { 1 "SELECT x FROM d1 UNION ALL SELECT a FROM d2 ORDER BY x*z" 1st 2 "SELECT x,z FROM d1 UNION ALL SELECT a,b FROM d2 ORDER BY x, x/z" 2nd -} +} do_select_tests e_select-8.7.2 { 1 "SELECT x*z FROM d1 UNION ALL SELECT a FROM d2 ORDER BY x*z" { - -20 -2 -1 3 7 8 93 186 babied barked commercials gently + -20 -2 -1 3 7 8 93 186 babied barked commercials gently iterate lad pragmatist reemphasizes rejoicing solemnness } 2 "SELECT x, x/z FROM d1 UNION ALL SELECT a,b FROM d2 ORDER BY x, x/z" { - 1 -1 1 0 1 0 1 0 1 0 1 0 2 -2 2 0 + 1 -1 1 0 1 0 1 0 1 0 1 0 2 -2 2 0 babied charitableness barked interrupted commercials bathrobe gently failings iterate sexton lad relenting pragmatist guarded reemphasizes reply rejoicing liabilities solemnness annexed } -} +} do_execsql_test e_select-8.8.0 { CREATE TABLE d3(a); @@ -1870,9 +1870,9 @@ do_execsql_test e_select-8.9.2 { SELECT x COLLATE binary FROM d4 ORDER BY 1 COLLATE nocase } {abc DEF ghi JKL} -# EVIDENCE-OF: R-09398-26102 Otherwise, if the ORDER BY expression is -# an alias to an expression that has been assigned a collation sequence -# using the postfix COLLATE operator, then the collation sequence +# EVIDENCE-OF: R-09398-26102 Otherwise, if the ORDER BY expression is +# an alias to an expression that has been assigned a collation sequence +# using the postfix COLLATE operator, then the collation sequence # assigned to the aliased expression is used. # # In the test 8.10.2, the only result-column expression has no alias. So the @@ -1920,7 +1920,7 @@ do_execsql_test e_select-8.13.0 { CREATE TABLE d5(a, b); CREATE TABLE d6(c, d); CREATE TABLE d7(e, f); - + INSERT INTO d5 VALUES(1, 'f'); INSERT INTO d6 VALUES(2, 'e'); INSERT INTO d7 VALUES(3, 'd'); @@ -1950,26 +1950,26 @@ do_select_tests e_select-8.13 { ORDER BY 1 } {1 2 3 4 5 6} - 5 { SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY b } + 5 { SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY b } {f 1 c 4 4 c 1 f} - 6 { SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY 2 } + 6 { SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY 2 } {f 1 c 4 4 c 1 f} - 7 { SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY a } + 7 { SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY a } {1 f 4 c c 4 f 1} - 8 { SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY 1 } + 8 { SELECT a, b FROM d5 UNION ALL SELECT b, a FROM d5 ORDER BY 1 } {1 f 4 c c 4 f 1} - 9 { SELECT a, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY a+1 } + 9 { SELECT a, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY a+1 } {f 2 c 5 4 c 1 f} - 10 { SELECT a, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY 2 } + 10 { SELECT a, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY 2 } {f 2 c 5 4 c 1 f} - 11 { SELECT a+1, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY a+1 } + 11 { SELECT a+1, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY a+1 } {2 f 5 c c 5 f 2} - 12 { SELECT a+1, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY 1 } + 12 { SELECT a+1, b FROM d5 UNION ALL SELECT b, a+1 FROM d5 ORDER BY 1 } {2 f 5 c c 5 f 2} -} +} # EVIDENCE-OF: R-39265-04070 If no matching expression can be found in # the result columns of any constituent SELECT, it is an error. @@ -1983,12 +1983,12 @@ do_select_tests e_select-8.14 -error { 4 { SELECT * FROM d5 INTERSECT SELECT * FROM d6 ORDER BY blah } 1st 5 { SELECT * FROM d5 INTERSECT SELECT * FROM d6 ORDER BY c,d,c+d } 3rd 6 { SELECT * FROM d5 EXCEPT SELECT * FROM d7 ORDER BY 1,2,b,a/b } 4th -} +} # EVIDENCE-OF: R-03407-11483 Each term of the ORDER BY clause is # processed separately and may be matched against result columns from # different SELECT statements in the compound. -# +# do_select_tests e_select-8.15 { 1 { SELECT a, b FROM d5 UNION ALL SELECT c-1, d FROM d6 ORDER BY a, d } {1 e 1 f 4 b 4 c} @@ -1996,7 +1996,7 @@ do_select_tests e_select-8.15 { {1 e 1 f 4 b 4 c} 3 { SELECT a, b FROM d5 UNION ALL SELECT c-1, d FROM d6 ORDER BY 1, 2 } {1 e 1 f 4 b 4 c} -} +} #------------------------------------------------------------------------- @@ -2039,7 +2039,7 @@ do_execsql_test e_select-9.0 { do_select_tests e_select-9.1 { 1 { SELECT b FROM f1 ORDER BY a LIMIT 5 } {a b c d e} 2 { SELECT b FROM f1 ORDER BY a LIMIT 2+3 } {a b c d e} - 3 { SELECT b FROM f1 ORDER BY a LIMIT (SELECT a FROM f1 WHERE b = 'e') } + 3 { SELECT b FROM f1 ORDER BY a LIMIT (SELECT a FROM f1 WHERE b = 'e') } {a b c d e} 4 { SELECT b FROM f1 ORDER BY a LIMIT 5.0 } {a b c d e} 5 { SELECT b FROM f1 ORDER BY a LIMIT '5' } {a b c d e} @@ -2056,16 +2056,16 @@ do_select_tests e_select-9.2 -error "datatype mismatch" { 3 { SELECT b FROM f1 ORDER BY a LIMIT X'ABCD' } {} 4 { SELECT b FROM f1 ORDER BY a LIMIT 5.1 } {} 5 { SELECT b FROM f1 ORDER BY a LIMIT (SELECT group_concat(b) FROM f1) } {} -} +} # EVIDENCE-OF: R-03014-26414 If the LIMIT expression evaluates to a # negative value, then there is no upper bound on the number of rows # returned. # do_select_tests e_select-9.4 { - 1 { SELECT b FROM f1 ORDER BY a LIMIT -1 } + 1 { SELECT b FROM f1 ORDER BY a LIMIT -1 } {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 z} - 2 { SELECT b FROM f1 ORDER BY a LIMIT length('abc')-100 } + 2 { SELECT b FROM f1 ORDER BY a LIMIT length('abc')-100 } {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 z} 3 { SELECT b FROM f1 ORDER BY a LIMIT (SELECT count(*) FROM f1)/2 - 14 } {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 z} @@ -2089,7 +2089,7 @@ do_select_tests e_select-9.5 { do_select_tests e_select-9.6 { 1 { SELECT b FROM f1 WHERE a>21 ORDER BY a LIMIT 10 } {v w x y z} 2 { SELECT count(*) FROM f1 GROUP BY a/5 ORDER BY 1 LIMIT 10 } {2 4 5 5 5 5} -} +} # EVIDENCE-OF: R-24188-24349 The expression attached to the optional @@ -2097,13 +2097,13 @@ do_select_tests e_select-9.6 { # integer, or a value that can be losslessly converted to an integer. # foreach {tn select} { - 1 { SELECT b FROM f1 ORDER BY a LIMIT 2 OFFSET 'hello' } - 2 { SELECT b FROM f1 ORDER BY a LIMIT 2 OFFSET NULL } - 3 { SELECT b FROM f1 ORDER BY a LIMIT 2 OFFSET X'ABCD' } - 4 { SELECT b FROM f1 ORDER BY a LIMIT 2 OFFSET 5.1 } - 5 { SELECT b FROM f1 ORDER BY a - LIMIT 2 OFFSET (SELECT group_concat(b) FROM f1) - } + 1 { SELECT b FROM f1 ORDER BY a LIMIT 2 OFFSET 'hello' } + 2 { SELECT b FROM f1 ORDER BY a LIMIT 2 OFFSET NULL } + 3 { SELECT b FROM f1 ORDER BY a LIMIT 2 OFFSET X'ABCD' } + 4 { SELECT b FROM f1 ORDER BY a LIMIT 2 OFFSET 5.1 } + 5 { SELECT b FROM f1 ORDER BY a + LIMIT 2 OFFSET (SELECT group_concat(b) FROM f1) + } } { do_catchsql_test e_select-9.7.$tn $select {1 {datatype mismatch}} } @@ -2117,9 +2117,9 @@ foreach {tn select} { do_select_tests e_select-9.8 { 1 { SELECT b FROM f1 ORDER BY a LIMIT 10 OFFSET 5} {f g h i j k l m n o} 2 { SELECT b FROM f1 ORDER BY a LIMIT 2+3 OFFSET 10} {k l m n o} - 3 { SELECT b FROM f1 ORDER BY a - LIMIT (SELECT a FROM f1 WHERE b='j') - OFFSET (SELECT a FROM f1 WHERE b='b') + 3 { SELECT b FROM f1 ORDER BY a + LIMIT (SELECT a FROM f1 WHERE b='j') + OFFSET (SELECT a FROM f1 WHERE b='b') } {c d e f g h i j k l} 4 { SELECT b FROM f1 ORDER BY a LIMIT '5' OFFSET 3.0 } {d e f g h} 5 { SELECT b FROM f1 ORDER BY a LIMIT '5' OFFSET 0 } {a b c d e} @@ -2145,7 +2145,7 @@ do_select_tests e_select-9.10 { 1 { SELECT b FROM f1 ORDER BY a LIMIT 5 OFFSET -1 } {a b c d e} 2 { SELECT b FROM f1 ORDER BY a LIMIT 5 OFFSET -500 } {a b c d e} 3 { SELECT b FROM f1 ORDER BY a LIMIT 5 OFFSET 0 } {a b c d e} -} +} # EVIDENCE-OF: R-19509-40356 Instead of a separate OFFSET clause, the # LIMIT clause may specify two scalar expressions separated by a comma. @@ -2156,8 +2156,8 @@ do_select_tests e_select-9.10 { do_select_tests e_select-9.11 { 1 { SELECT b FROM f1 ORDER BY a LIMIT 5, 10 } {f g h i j k l m n o} 2 { SELECT b FROM f1 ORDER BY a LIMIT 10, 2+3 } {k l m n o} - 3 { SELECT b FROM f1 ORDER BY a - LIMIT (SELECT a FROM f1 WHERE b='b'), (SELECT a FROM f1 WHERE b='j') + 3 { SELECT b FROM f1 ORDER BY a + LIMIT (SELECT a FROM f1 WHERE b='b'), (SELECT a FROM f1 WHERE b='j') } {c d e f g h i j k l} 4 { SELECT b FROM f1 ORDER BY a LIMIT 3.0, '5' } {d e f g h} 5 { SELECT b FROM f1 ORDER BY a LIMIT 0, '5' } {a b c d e} diff --git a/third_party/sqlite/src/test/e_select2.test b/third_party/sqlite/src/test/e_select2.test index 8330894428e4f..76720cf853a87 100644 --- a/third_party/sqlite/src/test/e_select2.test +++ b/third_party/sqlite/src/test/e_select2.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file implements tests to verify that the "testable statements" in +# This file implements tests to verify that the "testable statements" in # the lang_select.html document are correct. # @@ -49,7 +49,7 @@ source $testdir/tester.tcl # te_tbljoin ?SWITCHES? LHS-TABLE RHS-TABLE # te_join ?SWITCHES? LHS-DATASET RHS-DATASET # -# This command joins the two datasets and returns the resulting dataset. If +# This command joins the two datasets and returns the resulting dataset. If # there are no switches specified, then the results is the cartesian product # of the two inputs. The [te_tbljoin] command reads the left and right-hand # datasets from the specified tables. The [te_join] command is passed the @@ -66,7 +66,7 @@ source $testdir/tester.tcl # to it, in the following order: # # * The list of column-names from the left-hand dataset. -# * A single row from the left-hand dataset (one "data row" list as +# * A single row from the left-hand dataset (one "data row" list as # described above. # * The list of column-names from the right-hand dataset. # * A single row from the right-hand dataset. @@ -77,7 +77,7 @@ source $testdir/tester.tcl # The -using option specifies a list of the columns from the right-hand # dataset that should be omitted from the output dataset. # -# If the -left option is present, the join is done LEFT JOIN style. +# If the -left option is present, the join is done LEFT JOIN style. # Specifically, an extra row is inserted if after the -on script is run there # exist rows in the left-hand dataset that have no corresponding rows in # the output. See the implementation for more specific comments. @@ -101,7 +101,7 @@ source $testdir/tester.tcl # # These two procs are used to extract datasets from the database, either # by reading the contents of a named table (te_read_tbl), or by executing -# a SELECT statement (t3_read_sql). +# a SELECT statement (t3_read_sql). # # See the comment above, describing "te_* commands", for details of the # return values. @@ -194,7 +194,7 @@ proc te_join {data1 data2 args} { lappend rret [concat $r1 $nullrowlist] } } - + list $cret $rret } @@ -210,8 +210,8 @@ proc te_apply_affinity {affinity typevar valvar} { integer { if {[string is double $val]} { set type REAL } if {[string is wideinteger $val]} { set type INTEGER } - if {$type == "REAL" && int($val)==$val} { - set type INTEGER + if {$type == "REAL" && int($val)==$val} { + set type INTEGER set val [expr {int($val)}] } } @@ -514,13 +514,13 @@ do_execsql_test e_select-2.2.0 { # subquery statement. # foreach {tn subselect select spec} { - 1 "SELECT * FROM t2" "SELECT * FROM t1 JOIN %ss%" + 1 "SELECT * FROM t2" "SELECT * FROM t1 JOIN %ss%" {t1 %ss%} - 2 "SELECT * FROM t2" "SELECT * FROM t1 JOIN %ss% AS x ON (t1.a=x.a)" + 2 "SELECT * FROM t2" "SELECT * FROM t1 JOIN %ss% AS x ON (t1.a=x.a)" {t1 %ss% -on {te_equals 0 0}} - 3 "SELECT * FROM t2" "SELECT * FROM %ss% AS x JOIN t1 ON (t1.a=x.a)" + 3 "SELECT * FROM t2" "SELECT * FROM %ss% AS x JOIN t1 ON (t1.a=x.a)" {%ss% t1 -on {te_equals 0 0}} 4 "SELECT * FROM t1, t2" "SELECT * FROM %ss% AS x JOIN t3" diff --git a/third_party/sqlite/src/test/e_totalchanges.test b/third_party/sqlite/src/test/e_totalchanges.test index ee163c914f383..a10cf25eafab8 100644 --- a/third_party/sqlite/src/test/e_totalchanges.test +++ b/third_party/sqlite/src/test/e_totalchanges.test @@ -14,7 +14,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix e_totalchanges -# Like [do_execsql_test], except it appends the value returned by +# Like [do_execsql_test], except it appends the value returned by # [db total_changes] to the result of executing the SQL script. # proc do_tc_test {tn sql res} { @@ -73,16 +73,16 @@ do_execsql_test 1.2.1 { sqlite3 db test.db ; # To reset total_changes do_tc_test 1.2.2 { CREATE TABLE log(detail); - CREATE TRIGGER t1_after_insert AFTER INSERT ON t1 BEGIN + CREATE TRIGGER t1_after_insert AFTER INSERT ON t1 BEGIN INSERT INTO log VALUES('inserted into t1'); END; - CREATE TRIGGER t1_before_delete BEFORE DELETE ON t1 BEGIN + CREATE TRIGGER t1_before_delete BEFORE DELETE ON t1 BEGIN INSERT INTO log VALUES('deleting from t1'); INSERT INTO log VALUES('here we go!'); END; - CREATE TRIGGER t1_after_update AFTER UPDATE ON t1 BEGIN + CREATE TRIGGER t1_after_update AFTER UPDATE ON t1 BEGIN INSERT INTO log VALUES('update'); DELETE FROM log; END; diff --git a/third_party/sqlite/src/test/e_update.test b/third_party/sqlite/src/test/e_update.test index a13b059b32920..1c58fecd738bd 100644 --- a/third_party/sqlite/src/test/e_update.test +++ b/third_party/sqlite/src/test/e_update.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file implements tests to verify that the "testable statements" in +# This file implements tests to verify that the "testable statements" in # the lang_update.html document are correct. # set testdir [file dirname $argv0] @@ -107,8 +107,8 @@ do_update_tests e_update-0 { # statement. # # Test cases e_update-1.1.1.* test the "identified by the -# qualified-table-name" part of the statement above. Tests -# e_update-1.1.2.* show that the "zero or more rows" part is +# qualified-table-name" part of the statement above. Tests +# e_update-1.1.2.* show that the "zero or more rows" part is # accurate. # do_execsql_test e_update-1.1.0 { @@ -210,7 +210,7 @@ do_execsql_test e_update-1.5.0 { do_update_tests e_update-1.5 -query { SELECT * FROM t2 } { - 1 "UPDATE t2 SET c = 1+1 WHERE a=2" + 1 "UPDATE t2 SET c = 1+1 WHERE a=2" {3 1 4 1 5 9 2 6 2} 2 "UPDATE t2 SET b = 4/2, c=CAST((0.4*5) AS INTEGER) WHERE a<3" @@ -277,27 +277,27 @@ do_execsql_test e_update-1.8.0 { INSERT INTO t3 VALUES(4, 'four'); } {} foreach {tn sql error ac data } { - 1 "UPDATE t3 SET b='one' WHERE a=3" + 1 "UPDATE t3 SET b='one' WHERE a=3" {UNIQUE constraint failed: t3.b} 1 {1 one 2 two 3 three 4 four} - 2 "UPDATE OR REPLACE t3 SET b='one' WHERE a=3" + 2 "UPDATE OR REPLACE t3 SET b='one' WHERE a=3" {} 1 {2 two 3 one 4 four} 3 "UPDATE OR FAIL t3 SET b='three'" {UNIQUE constraint failed: t3.b} 1 {2 three 3 one 4 four} - 4 "UPDATE OR IGNORE t3 SET b='three' WHERE a=3" + 4 "UPDATE OR IGNORE t3 SET b='three' WHERE a=3" {} 1 {2 three 3 one 4 four} - 5 "UPDATE OR ABORT t3 SET b='three' WHERE a=3" + 5 "UPDATE OR ABORT t3 SET b='three' WHERE a=3" {UNIQUE constraint failed: t3.b} 1 {2 three 3 one 4 four} 6 "BEGIN" {} 0 {2 three 3 one 4 four} - 7 "UPDATE t3 SET b='three' WHERE a=3" + 7 "UPDATE t3 SET b='three' WHERE a=3" {UNIQUE constraint failed: t3.b} 0 {2 three 3 one 4 four} - 8 "UPDATE OR ABORT t3 SET b='three' WHERE a=3" + 8 "UPDATE OR ABORT t3 SET b='three' WHERE a=3" {UNIQUE constraint failed: t3.b} 0 {2 three 3 one 4 four} 9 "UPDATE OR FAIL t3 SET b='two'" @@ -538,7 +538,7 @@ do_update_tests e_update-3.1 -query { SELECT s FROM t7 } { # do_update_tests e_update-3.2 -query { SELECT s FROM t7 } { 1 "UPDATE t7 SET s = q LIMIT -1" {1 2 3 4 5 6 7 8 9 10} - 2 "UPDATE t7 SET s = r WHERE q>4 LIMIT -1" + 2 "UPDATE t7 SET s = r WHERE q>4 LIMIT -1" {1 2 3 4 five six seven eight nine ten} 3 "UPDATE t7 SET s = 'X' LIMIT -1" {X X X X X X X X X X} } @@ -601,5 +601,5 @@ do_update_tests e_update-3.5 -query { SELECT x FROM t8 ; DELETE FROM t8 } { } ;# ifcapable update_delete_limit - + finish_test diff --git a/third_party/sqlite/src/test/e_uri.test b/third_party/sqlite/src/test/e_uri.test index 95b53f1d6ba39..71da32eb56687 100644 --- a/third_party/sqlite/src/test/e_uri.test +++ b/third_party/sqlite/src/test/e_uri.test @@ -18,7 +18,7 @@ db close proc parse_uri {uri} { testvfs tvfs2 - testvfs tvfs + testvfs tvfs tvfs filter xOpen tvfs script parse_uri_open_cb @@ -297,15 +297,15 @@ foreach {tn uri read write create} { sqlite3 db test.db db eval { CREATE TABLE t1(a, b) ; INSERT INTO t1 VALUES('a', 'b') ;} db close - + # Test READ access: - do_test 8.$tn.r { + do_test 8.$tn.r { sqlite3 db $uri catchsql { SELECT * FROM t1 } } $RES(r,$read) - + # Test WRITE access: - do_test 8.$tn.w { + do_test 8.$tn.w { sqlite3 db $uri catchsql { INSERT INTO t1 VALUES(1, 2) } } $RES(w,$write) diff --git a/third_party/sqlite/src/test/e_vacuum.test b/third_party/sqlite/src/test/e_vacuum.test index 3fd34afd43155..7f62f8b9a5002 100644 --- a/third_party/sqlite/src/test/e_vacuum.test +++ b/third_party/sqlite/src/test/e_vacuum.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file implements tests to verify that the "testable statements" in +# This file implements tests to verify that the "testable statements" in # the lang_vacuum.html document are correct. # @@ -78,8 +78,8 @@ do_execsql_test e_vacuum-0.1 { VACUUM } {} # reclaims this space and reduces the size of the database file. # foreach {tn avmode sz} { - 1 none 7 - 2 full 8 + 1 none 7 + 2 full 8 3 incremental 8 } { set nPage [create_db "PRAGMA auto_vacuum = $avmode"] @@ -96,7 +96,7 @@ foreach {tn avmode sz} { do_execsql_test e_vacuum-1.1.$tn.2 {PRAGMA freelist_count} 0 } else { set freelist [expr {$nPage - $sz}] - if {$avmode == "incremental"} { + if {$avmode == "incremental"} { # The page size is 1024 bytes. Therefore, assuming the database contains # somewhere between 207 and 411 pages (it does), there are 2 pointer-map # pages. @@ -119,24 +119,24 @@ foreach {tn avmode sz} { # e_vacuum-1.2.1 - Perform many INSERT, UPDATE and DELETE ops on table t1. # e_vacuum-1.2.2 - Verify that t1 and its indexes are now quite fragmented. # e_vacuum-1.2.3 - Run VACUUM. -# e_vacuum-1.2.4 - Verify that t1 and its indexes are now much +# e_vacuum-1.2.4 - Verify that t1 and its indexes are now much # less fragmented. # ifcapable vtab&&compound { - create_db + create_db register_dbstat_vtab db do_execsql_test e_vacuum-1.2.1 { DELETE FROM t1 WHERE a%2; INSERT INTO t1 SELECT b, a FROM t2 WHERE a%2; UPDATE t1 SET b=randomblob(600) WHERE (a%2)==0; } {} - + do_test e_vacuum-1.2.2.1 { expr [fragment_count t1]>100 } 1 do_test e_vacuum-1.2.2.2 { expr [fragment_count sqlite_autoindex_t1_1]>100 } 1 do_test e_vacuum-1.2.2.3 { expr [fragment_count sqlite_autoindex_t1_2]>100 } 1 - + do_execsql_test e_vacuum-1.2.3 { VACUUM } {} - + # In practice, the tables and indexes each end up stored as two fragments - # one containing the root page and another containing all other pages. # @@ -172,7 +172,7 @@ if {![nonzero_reserved_bytes]} { execsql VACUUM execsql { PRAGMA page_size ; PRAGMA auto_vacuum } } {2048 0} - + # EVIDENCE-OF: R-48521-51450 When in write-ahead log mode, only the # auto_vacuum support property can be changed using VACUUM. # @@ -189,7 +189,7 @@ if {![nonzero_reserved_bytes]} { } {2048 1} } } - + # EVIDENCE-OF: R-55119-57913 By default, VACUUM only works only on the # main database. forcedelete test.db2 @@ -250,14 +250,14 @@ do_execsql_test e_vacuum-3.1.4 { # is run. # do_execsql_test e_vacuum-3.2.1.1 { BEGIN } {} -do_catchsql_test e_vacuum-3.2.1.2 { - VACUUM +do_catchsql_test e_vacuum-3.2.1.2 { + VACUUM } {1 {cannot VACUUM from within a transaction}} do_execsql_test e_vacuum-3.2.1.3 { COMMIT } {} do_execsql_test e_vacuum-3.2.1.4 { VACUUM } {} do_execsql_test e_vacuum-3.2.1.5 { SAVEPOINT x } {} -do_catchsql_test e_vacuum-3.2.1.6 { - VACUUM +do_catchsql_test e_vacuum-3.2.1.6 { + VACUUM } {1 {cannot VACUUM from within a transaction}} do_execsql_test e_vacuum-3.2.1.7 { COMMIT } {} do_execsql_test e_vacuum-3.2.1.8 { VACUUM } {} diff --git a/third_party/sqlite/src/test/e_wal.test b/third_party/sqlite/src/test/e_wal.test index 77ac83a0aef74..a8ef016c104e8 100644 --- a/third_party/sqlite/src/test/e_wal.test +++ b/third_party/sqlite/src/test/e_wal.test @@ -33,7 +33,7 @@ testvfs oldvfs -iversion 1 # # All three done with VFS "oldvfs", which has iVersion==1 and so does # not support shared memory. -# +# sqlite3 db test.db -vfs oldvfs do_execsql_test 1.1.1 { PRAGMA journal_mode = WAL; diff --git a/third_party/sqlite/src/test/e_walauto.test b/third_party/sqlite/src/test/e_walauto.test index 7665b1bf735f9..526e1ae7f1a60 100644 --- a/third_party/sqlite/src/test/e_walauto.test +++ b/third_party/sqlite/src/test/e_walauto.test @@ -49,7 +49,7 @@ proc do_autocommit_threshold_test {tn value} { db eval { INSERT INTO t1 VALUES(randomblob(100), randomblob(100)) } if {[read_mxframe] >= $value} break } - + set nBackfillNew [read_nbackfill] uplevel [list do_test $tn "expr $nBackfillNew > $nBackfillSaved" 1] } @@ -157,7 +157,7 @@ foreach {tn code} { file size test.db-wal } 0 do_test 1.$tn.11.2 { - autocheckpoint db 100 + autocheckpoint db 100 for {set i 0} {$i < 1000} {incr i} { db eval { INSERT INTO t1 VALUES(randomblob(100), randomblob(100)) } } @@ -171,7 +171,7 @@ foreach {tn code} { expr {[file size test.db-wal] < (1 * 1024 * 1024)} } 0 - # EVIDENCE-OF: R-33080-59193 Checkpoints initiated by this mechanism + # EVIDENCE-OF: R-33080-59193 Checkpoints initiated by this mechanism # are PASSIVE. # set ::busy_callback_count 0 @@ -181,7 +181,7 @@ foreach {tn code} { } do_test 1.$tn.12.1 { sqlite3_wal_checkpoint_v2 db truncate - autocheckpoint db 100 + autocheckpoint db 100 db busy busy_callback db eval { INSERT INTO t1 VALUES(randomblob(100), randomblob(100)) } db eval { INSERT INTO t1 VALUES(randomblob(100), randomblob(100)) } diff --git a/third_party/sqlite/src/test/e_walckpt.test b/third_party/sqlite/src/test/e_walckpt.test index 3b1f3b015a6a8..60671cf928f40 100644 --- a/third_party/sqlite/src/test/e_walckpt.test +++ b/third_party/sqlite/src/test/e_walckpt.test @@ -75,14 +75,14 @@ proc wal_checkpoint_v2 {db args} { } -# The following tests are run 3 times, each using a different method of +# The following tests are run 3 times, each using a different method of # invoking a checkpoint: # # 1) Using sqlite3_wal_checkpoint_v2() # 2) Using "PRAGMA wal_checkpoint" # 3) Using sqlite3_wal_checkpoint() in place of checkpoint_v2(PASSIVE) # -# Cases (2) and (3) are to show that the following statements are +# Cases (2) and (3) are to show that the following statements are # correct, respectively: # # EVIDENCE-OF: R-36706-10507 The PRAGMA wal_checkpoint command can be @@ -91,7 +91,7 @@ proc wal_checkpoint_v2 {db args} { # EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is # equivalent to # sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). -# +# foreach {tn script} { 1 { proc checkpoint {db mode args} { @@ -199,7 +199,7 @@ foreach {tn script} { # *pnLog and *pnCkpt set to -1. # if {$tn==3} { - # With sqlite3_wal_checkpoint() the two output variables cannot be + # With sqlite3_wal_checkpoint() the two output variables cannot be # tested. So just test that no error is returned when attempting to # checkpoint a db in rollback mode. do_test $tn.2.2.a { checkpoint db passive aux3 } {} @@ -230,7 +230,7 @@ foreach {tn script} { reset_db - + #----------------------------------------------------------------------- # EVIDENCE-OF: R-10421-19736 If any other process is running a @@ -260,7 +260,7 @@ foreach {tn script} { # Connection [db] runs a checkpoint. During this checkpoint, each # time it calls xWrite() to write a page into the database file, we - # attempt to start a checkpoint using [db2]. According to the + # attempt to start a checkpoint using [db2]. According to the # first requirement being tested, this should return SQLITE_BUSY. According # to the second, the busy-handler belonging to [db2] should not be # invoked. @@ -274,7 +274,7 @@ foreach {tn script} { set rc [catch {checkpoint db2 passive} msg] if {0==[regexp "database is locked" $msg] && $msg!="1 -1 -1"} { lappend ::write_errors "$rc $msg" - } + } incr ::write_count } db2 busy busy_callback @@ -312,7 +312,7 @@ foreach {tn script} { } 3 { - # Close first the writer, then later the reader. And finally the + # Close first the writer, then later the reader. And finally the # [db6] reader. if {$n==5} { catch {db2 eval commit} } if {$n==10} { catch {db3 eval commit} } @@ -322,7 +322,7 @@ foreach {tn script} { } } - foreach {mode busy_handler_mode} { + foreach {mode busy_handler_mode} { passive 1 full 1 full 2 full 3 restart 1 restart 2 restart 3 @@ -410,7 +410,7 @@ foreach {tn script} { set ::read_ok -1 set ::write_ok -1 set ::seen_writer_lock 0 - + set ::checkpoint_ongoing 1 do_test $tp.3 { checkpoint db $mode main @@ -447,14 +447,14 @@ foreach {tn script} { do_test $tp.5 { set ::sync_counter } 0 do_test $tp.6 { set ::busy_handler_counter } 0 db4 close - + db2 eval COMMIT db3 eval COMMIT - + # EVIDENCE-OF: R-65499-53765 On the other hand, passive mode might leave # the checkpoint unfinished if there are concurrent readers or writers. # - # The reader and writer have now dropped their locks. And so a + # The reader and writer have now dropped their locks. And so a # checkpoint now is able to checkpoint more frames. Showing that the # attempt above was left "unfinished". # @@ -477,7 +477,7 @@ foreach {tn script} { if { $mode=="full" || $mode=="restart" || $mode=="truncate" } { # EVIDENCE-OF: R-59782-36818 The SQLITE_CHECKPOINT_FULL, RESTART and - # TRUNCATE modes also obtain the exclusive "writer" lock on the + # TRUNCATE modes also obtain the exclusive "writer" lock on the # database file. # # Or at least attempts to obtain. @@ -491,7 +491,7 @@ foreach {tn script} { # busy-handler callback) until there is no database writer and all # readers are reading from the most recent database snapshot. # - # The test below shows that both the reader and writer have + # The test below shows that both the reader and writer have # finished: # # Also restated by the following two. That both busy_handler_mode @@ -707,7 +707,7 @@ sqlite3 db2 test.db do_test 6.1 { execsql { - PRAGMA auto_vacuum = 0; + PRAGMA auto_vacuum = 0; PRAGMA journal_mode = WAL; CREATE TABLE t1(a, b); INSERT INTO t1 VALUES(1, 2); @@ -737,7 +737,7 @@ do_test 6.2 { # do_test 6.4 { lrange [wal_checkpoint_v2 db passive] 1 2 -} {4 3} +} {4 3} # EVIDENCE-OF: R-37257-17813 Note that upon successful completion of an # SQLITE_CHECKPOINT_TRUNCATE, the log file will have been truncated to diff --git a/third_party/sqlite/src/test/e_walhook.test b/third_party/sqlite/src/test/e_walhook.test index c963524a9749d..f47d3eb747f33 100644 --- a/third_party/sqlite/src/test/e_walhook.test +++ b/third_party/sqlite/src/test/e_walhook.test @@ -48,7 +48,7 @@ do_test 1.3 { } 1 do_test 1.4 { - execsql { + execsql { BEGIN; INSERT INTO t1 VALUES(3); INSERT INTO t1 VALUES(4); @@ -141,7 +141,7 @@ do_execsql_test 4.4 { # previously registered write-ahead log callback. set ::old_wal_hook 0 proc my_old_wal_hook {args} { - incr ::old_wal_hook + incr ::old_wal_hook return 0 } db wal_hook my_old_wal_hook @@ -150,7 +150,7 @@ do_test 5.1 { set ::old_wal_hook } {1} -# Replace old_wal_hook. Observe that it is not invoked after it has +# Replace old_wal_hook. Observe that it is not invoked after it has # been replaced. proc my_new_wal_hook {args} { return 0 } db wal_hook my_new_wal_hook diff --git a/third_party/sqlite/src/test/enc.test b/third_party/sqlite/src/test/enc.test index 5c24bbb7f65f6..b857b4b88a487 100644 --- a/third_party/sqlite/src/test/enc.test +++ b/third_party/sqlite/src/test/enc.test @@ -67,7 +67,7 @@ proc swap_byte_order {utf16} { # byte-order mark info, refer to section 3.10 of the unicode standard. # # 5. Take the byte-order marked UTF-16 strings from step 4 and ensure -# that SQLite can convert them both to native byte order UTF-16 +# that SQLite can convert them both to native byte order UTF-16 # strings, sans BOM. # # Coverage: @@ -79,7 +79,7 @@ proc swap_byte_order {utf16} { # sqlite_utf16to16be (step 5) # proc test_conversion {testname str} { - + # Step 1. set utf16le_sqlite3 [test_translate $str UTF8 UTF16LE] set utf16le_tcl [encoding convertto unicode $str] @@ -99,7 +99,7 @@ proc test_conversion {testname str} { } do_bincmp_test $testname.2 $utf16be_sqlite3 $utf16be_tcl set utf16be $utf16be_tcl - + # Step 3. if { $::tcl_platform(byteOrder)=="littleEndian" } { set utf16 $utf16le diff --git a/third_party/sqlite/src/test/enc2.test b/third_party/sqlite/src/test/enc2.test index 3eb3aa27c3641..3dee0bd18e9c7 100644 --- a/third_party/sqlite/src/test/enc2.test +++ b/third_party/sqlite/src/test/enc2.test @@ -42,7 +42,7 @@ ifcapable {!utf16} { db close -# Return the UTF-8 representation of the supplied UTF-16 string $str. +# Return the UTF-8 representation of the supplied UTF-16 string $str. proc utf8 {str} { # If $str ends in two 0x00 0x00 bytes, knock these off before # converting to UTF-8 using TCL. @@ -63,7 +63,7 @@ set dbcontents { CREATE TABLE t1(a PRIMARY KEY, b, c); INSERT INTO t1 VALUES('one', 'I', 1); } -# This proc tests that we can open and manipulate the test.db +# This proc tests that we can open and manipulate the test.db # database, and that it is possible to retreive values in # various text encodings. # @@ -81,7 +81,7 @@ do_test $t.2 { execsql {SELECT * FROM t1} } {one I 1 two II 2} -# Insert some data +# Insert some data do_test $t.3 { execsql { INSERT INTO t1 VALUES('three','III',3); @@ -302,7 +302,7 @@ do_test enc2-5-12 { } } {1 {no such collation sequence: test_collate}} do_test enc2-5.13 { - add_test_collate_needed $DB + add_test_collate_needed $DB set res [execsql {SELECT * FROM t5 ORDER BY 1 COLLATE test_collate; }] lappend res $::test_collate_enc } {one two three four five UTF-16BE} @@ -440,7 +440,7 @@ forcedelete test.db # 1: Open an empty database file assuming UTF-16 encoding. # 2: Open the same database with a different handle assuming UTF-8. Create # a table using this handle. -# 3: Read the sqlite_master table from the first handle. +# 3: Read the sqlite_master table from the first handle. # 4: Ensure the first handle recognises the database encoding is UTF-8. # do_test enc2-7.1 { diff --git a/third_party/sqlite/src/test/enc3.test b/third_party/sqlite/src/test/enc3.test index 7ede2b716f427..f3f61a0d32d7b 100644 --- a/third_party/sqlite/src/test/enc3.test +++ b/third_party/sqlite/src/test/enc3.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # The focus of this file is testing of the proper handling of conversions # to the native text representation. diff --git a/third_party/sqlite/src/test/enc4.test b/third_party/sqlite/src/test/enc4.test index 94869b6fb7505..487cccedb743e 100644 --- a/third_party/sqlite/src/test/enc4.test +++ b/third_party/sqlite/src/test/enc4.test @@ -58,7 +58,7 @@ foreach enc $encodings { set S [sqlite3_prepare_v2 db "SELECT $init+?" -1 dummy] sqlite3_expired $S } {0} - + set k 1 foreach val $vals { for {set x 1} {$x<16} {incr x} { @@ -70,7 +70,7 @@ foreach enc $encodings { sqlite3_step $S sqlite3_column_text $S 0 } [list $part] - + do_realnum_test enc4-$i.$j.$k.4.$x { sqlite3_reset $S sqlite3_bind_text16 $S 1 [encoding convertto unicode $val] [expr $x*2] @@ -78,7 +78,7 @@ foreach enc $encodings { sqlite3_column_text $S 0 } [list $part] } - + incr k } diff --git a/third_party/sqlite/src/test/eqp.test b/third_party/sqlite/src/test/eqp.test index c955a80c21387..12e916dca98f7 100644 --- a/third_party/sqlite/src/test/eqp.test +++ b/third_party/sqlite/src/test/eqp.test @@ -43,16 +43,16 @@ do_execsql_test 1.1 { do_eqp_test 1.2 { SELECT * FROM t2, t1 WHERE t1.a=1 OR t1.b=2; } { - 0 0 1 {SEARCH TABLE t1 USING INDEX i1 (a=?)} - 0 0 1 {SEARCH TABLE t1 USING INDEX i2 (b=?)} + 0 0 1 {SEARCH TABLE t1 USING INDEX i1 (a=?)} + 0 0 1 {SEARCH TABLE t1 USING INDEX i2 (b=?)} 0 1 0 {SCAN TABLE t2} } do_eqp_test 1.3 { SELECT * FROM t2 CROSS JOIN t1 WHERE t1.a=1 OR t1.b=2; } { 0 0 0 {SCAN TABLE t2} - 0 1 1 {SEARCH TABLE t1 USING INDEX i1 (a=?)} - 0 1 1 {SEARCH TABLE t1 USING INDEX i2 (b=?)} + 0 1 1 {SEARCH TABLE t1 USING INDEX i1 (a=?)} + 0 1 1 {SEARCH TABLE t1 USING INDEX i2 (b=?)} } do_eqp_test 1.3 { SELECT a FROM t1 ORDER BY a @@ -211,44 +211,44 @@ do_eqp_test 3.1.4 { det 3.2.1 { SELECT * FROM (SELECT * FROM t1 ORDER BY x LIMIT 10) ORDER BY y LIMIT 5 } { - 1 0 0 {SCAN TABLE t1} - 1 0 0 {USE TEMP B-TREE FOR ORDER BY} - 0 0 0 {SCAN SUBQUERY 1} + 1 0 0 {SCAN TABLE t1} + 1 0 0 {USE TEMP B-TREE FOR ORDER BY} + 0 0 0 {SCAN SUBQUERY 1} 0 0 0 {USE TEMP B-TREE FOR ORDER BY} } det 3.2.2 { - SELECT * FROM + SELECT * FROM (SELECT * FROM t1 ORDER BY x LIMIT 10) AS x1, (SELECT * FROM t2 ORDER BY x LIMIT 10) AS x2 ORDER BY x2.y LIMIT 5 } { - 1 0 0 {SCAN TABLE t1} - 1 0 0 {USE TEMP B-TREE FOR ORDER BY} - 2 0 0 {SCAN TABLE t2 USING INDEX t2i1} - 0 0 0 {SCAN SUBQUERY 1 AS x1} - 0 1 1 {SCAN SUBQUERY 2 AS x2} + 1 0 0 {SCAN TABLE t1} + 1 0 0 {USE TEMP B-TREE FOR ORDER BY} + 2 0 0 {SCAN TABLE t2 USING INDEX t2i1} + 0 0 0 {SCAN SUBQUERY 1 AS x1} + 0 1 1 {SCAN SUBQUERY 2 AS x2} 0 0 0 {USE TEMP B-TREE FOR ORDER BY} } det 3.3.1 { SELECT * FROM t1 WHERE y IN (SELECT y FROM t2) } { - 0 0 0 {SCAN TABLE t1} - 0 0 0 {EXECUTE LIST SUBQUERY 1} + 0 0 0 {SCAN TABLE t1} + 0 0 0 {EXECUTE LIST SUBQUERY 1} 1 0 0 {SCAN TABLE t2} } det 3.3.2 { SELECT * FROM t1 WHERE y IN (SELECT y FROM t2 WHERE t1.x!=t2.x) } { - 0 0 0 {SCAN TABLE t1} - 0 0 0 {EXECUTE CORRELATED LIST SUBQUERY 1} + 0 0 0 {SCAN TABLE t1} + 0 0 0 {EXECUTE CORRELATED LIST SUBQUERY 1} 1 0 0 {SCAN TABLE t2} } det 3.3.3 { SELECT * FROM t1 WHERE EXISTS (SELECT y FROM t2 WHERE t1.x!=t2.x) } { - 0 0 0 {SCAN TABLE t1} - 0 0 0 {EXECUTE CORRELATED SCALAR SUBQUERY 1} + 0 0 0 {SCAN TABLE t1} + 0 0 0 {EXECUTE CORRELATED SCALAR SUBQUERY 1} 1 0 0 {SCAN TABLE t2} } @@ -258,114 +258,114 @@ det 3.3.3 { do_eqp_test 4.1.1 { SELECT * FROM t1 UNION ALL SELECT * FROM t2 } { - 1 0 0 {SCAN TABLE t1} - 2 0 0 {SCAN TABLE t2} - 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (UNION ALL)} + 1 0 0 {SCAN TABLE t1} + 2 0 0 {SCAN TABLE t2} + 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (UNION ALL)} } do_eqp_test 4.1.2 { SELECT * FROM t1 UNION ALL SELECT * FROM t2 ORDER BY 2 } { - 1 0 0 {SCAN TABLE t1} + 1 0 0 {SCAN TABLE t1} 1 0 0 {USE TEMP B-TREE FOR ORDER BY} - 2 0 0 {SCAN TABLE t2} + 2 0 0 {SCAN TABLE t2} 2 0 0 {USE TEMP B-TREE FOR ORDER BY} - 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (UNION ALL)} + 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (UNION ALL)} } do_eqp_test 4.1.3 { SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY 2 } { - 1 0 0 {SCAN TABLE t1} + 1 0 0 {SCAN TABLE t1} 1 0 0 {USE TEMP B-TREE FOR ORDER BY} - 2 0 0 {SCAN TABLE t2} + 2 0 0 {SCAN TABLE t2} 2 0 0 {USE TEMP B-TREE FOR ORDER BY} - 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (UNION)} + 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (UNION)} } do_eqp_test 4.1.4 { SELECT * FROM t1 INTERSECT SELECT * FROM t2 ORDER BY 2 } { - 1 0 0 {SCAN TABLE t1} + 1 0 0 {SCAN TABLE t1} 1 0 0 {USE TEMP B-TREE FOR ORDER BY} - 2 0 0 {SCAN TABLE t2} + 2 0 0 {SCAN TABLE t2} 2 0 0 {USE TEMP B-TREE FOR ORDER BY} - 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (INTERSECT)} + 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (INTERSECT)} } do_eqp_test 4.1.5 { SELECT * FROM t1 EXCEPT SELECT * FROM t2 ORDER BY 2 } { - 1 0 0 {SCAN TABLE t1} + 1 0 0 {SCAN TABLE t1} 1 0 0 {USE TEMP B-TREE FOR ORDER BY} - 2 0 0 {SCAN TABLE t2} + 2 0 0 {SCAN TABLE t2} 2 0 0 {USE TEMP B-TREE FOR ORDER BY} - 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (EXCEPT)} + 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (EXCEPT)} } do_eqp_test 4.2.2 { SELECT * FROM t1 UNION ALL SELECT * FROM t2 ORDER BY 1 } { - 1 0 0 {SCAN TABLE t1} + 1 0 0 {SCAN TABLE t1} 1 0 0 {USE TEMP B-TREE FOR ORDER BY} - 2 0 0 {SCAN TABLE t2 USING INDEX t2i1} - 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (UNION ALL)} + 2 0 0 {SCAN TABLE t2 USING INDEX t2i1} + 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (UNION ALL)} } do_eqp_test 4.2.3 { SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY 1 } { - 1 0 0 {SCAN TABLE t1} + 1 0 0 {SCAN TABLE t1} 1 0 0 {USE TEMP B-TREE FOR ORDER BY} - 2 0 0 {SCAN TABLE t2 USING INDEX t2i1} + 2 0 0 {SCAN TABLE t2 USING INDEX t2i1} 2 0 0 {USE TEMP B-TREE FOR RIGHT PART OF ORDER BY} - 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (UNION)} + 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (UNION)} } do_eqp_test 4.2.4 { SELECT * FROM t1 INTERSECT SELECT * FROM t2 ORDER BY 1 } { - 1 0 0 {SCAN TABLE t1} + 1 0 0 {SCAN TABLE t1} 1 0 0 {USE TEMP B-TREE FOR ORDER BY} - 2 0 0 {SCAN TABLE t2 USING INDEX t2i1} + 2 0 0 {SCAN TABLE t2 USING INDEX t2i1} 2 0 0 {USE TEMP B-TREE FOR RIGHT PART OF ORDER BY} - 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (INTERSECT)} + 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (INTERSECT)} } do_eqp_test 4.2.5 { SELECT * FROM t1 EXCEPT SELECT * FROM t2 ORDER BY 1 } { - 1 0 0 {SCAN TABLE t1} + 1 0 0 {SCAN TABLE t1} 1 0 0 {USE TEMP B-TREE FOR ORDER BY} - 2 0 0 {SCAN TABLE t2 USING INDEX t2i1} + 2 0 0 {SCAN TABLE t2 USING INDEX t2i1} 2 0 0 {USE TEMP B-TREE FOR RIGHT PART OF ORDER BY} - 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (EXCEPT)} + 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (EXCEPT)} } do_eqp_test 4.3.1 { SELECT x FROM t1 UNION SELECT x FROM t2 } { - 1 0 0 {SCAN TABLE t1} - 2 0 0 {SCAN TABLE t2 USING COVERING INDEX t2i1} - 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 USING TEMP B-TREE (UNION)} + 1 0 0 {SCAN TABLE t1} + 2 0 0 {SCAN TABLE t2 USING COVERING INDEX t2i1} + 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 USING TEMP B-TREE (UNION)} } do_eqp_test 4.3.2 { SELECT x FROM t1 UNION SELECT x FROM t2 UNION SELECT x FROM t1 } { - 2 0 0 {SCAN TABLE t1} - 3 0 0 {SCAN TABLE t2 USING COVERING INDEX t2i1} + 2 0 0 {SCAN TABLE t1} + 3 0 0 {SCAN TABLE t2 USING COVERING INDEX t2i1} 1 0 0 {COMPOUND SUBQUERIES 2 AND 3 USING TEMP B-TREE (UNION)} - 4 0 0 {SCAN TABLE t1} + 4 0 0 {SCAN TABLE t1} 0 0 0 {COMPOUND SUBQUERIES 1 AND 4 USING TEMP B-TREE (UNION)} } do_eqp_test 4.3.3 { SELECT x FROM t1 UNION SELECT x FROM t2 UNION SELECT x FROM t1 ORDER BY 1 } { - 2 0 0 {SCAN TABLE t1} - 2 0 0 {USE TEMP B-TREE FOR ORDER BY} - 3 0 0 {SCAN TABLE t2 USING COVERING INDEX t2i1} - 1 0 0 {COMPOUND SUBQUERIES 2 AND 3 (UNION)} - 4 0 0 {SCAN TABLE t1} - 4 0 0 {USE TEMP B-TREE FOR ORDER BY} + 2 0 0 {SCAN TABLE t1} + 2 0 0 {USE TEMP B-TREE FOR ORDER BY} + 3 0 0 {SCAN TABLE t2 USING COVERING INDEX t2i1} + 1 0 0 {COMPOUND SUBQUERIES 2 AND 3 (UNION)} + 4 0 0 {SCAN TABLE t1} + 4 0 0 {USE TEMP B-TREE FOR ORDER BY} 0 0 0 {COMPOUND SUBQUERIES 1 AND 4 (UNION)} } #------------------------------------------------------------------------- -# This next block of tests verifies that the examples on the +# This next block of tests verifies that the examples on the # lang_explain.html page are correct. # drop_all_tables @@ -518,9 +518,9 @@ det 5.13 "SELECT a FROM t1 EXCEPT SELECT d FROM t2 ORDER BY 1" { if {![nonzero_reserved_bytes]} { #------------------------------------------------------------------------- - # The following tests - eqp-6.* - test that the example C code on + # The following tests - eqp-6.* - test that the example C code on # documentation page eqp.html works. The C code is duplicated in test1.c - # and wrapped in Tcl command [print_explain_query_plan] + # and wrapped in Tcl command [print_explain_query_plan] # set boilerplate { proc explain_query_plan {db sql} { @@ -533,13 +533,13 @@ if {![nonzero_reserved_bytes]} { db close exit } - + # Do a "Print Explain Query Plan" test. proc do_peqp_test {tn sql res} { set fd [open script.tcl w] puts $fd [string map [list %SQL% $sql] $::boilerplate] close $fd - + uplevel do_test $tn [list { set fd [open "|[info nameofexec] script.tcl"] set data [read $fd] @@ -547,7 +547,7 @@ if {![nonzero_reserved_bytes]} { set data }] [list $res] } - + do_peqp_test 6.1 { SELECT a, b FROM t1 EXCEPT SELECT d, 99 FROM t2 ORDER BY 1 } [string trimleft { @@ -585,7 +585,7 @@ do_execsql_test 7.3 { INSERT INTO t2(a,b) VALUES(1, 2); INSERT INTO t2(a,b) VALUES(3, 4); INSERT INTO t2(a,b) VALUES(5, 6); - + ANALYZE; } diff --git a/third_party/sqlite/src/test/errmsg.test b/third_party/sqlite/src/test/errmsg.test index 8df8a704f4ae2..91f1fec8d4ec8 100644 --- a/third_party/sqlite/src/test/errmsg.test +++ b/third_party/sqlite/src/test/errmsg.test @@ -56,7 +56,7 @@ db func sql_error sql_error do_test 1.1 { error_messages "SELECT sql_error('custom message')" } [list {*}{ - SQLITE_ERROR {SQL logic error or missing database} + SQLITE_ERROR {SQL logic error or missing database} SQLITE_ERROR {custom message} }] do_test 1.2 { @@ -77,7 +77,7 @@ do_execsql_test 2.1 { do_test 2.2 { error_messages "INSERT INTO t1 VALUES('ghi', 'def')" } [list {*}{ - SQLITE_ERROR {SQL logic error or missing database} + SQLITE_ERROR {SQL logic error or missing database} SQLITE_CONSTRAINT {UNIQUE constraint failed: t1.b} }] verify_ex_errcode 2.2b SQLITE_CONSTRAINT_UNIQUE @@ -101,7 +101,7 @@ do_execsql_test 3.1.1 { do_test 3.1.2 { error_messages "SELECT a FROM t2" "DROP TABLE t2" } [list {*}{ - SQLITE_ERROR {SQL logic error or missing database} + SQLITE_ERROR {SQL logic error or missing database} SQLITE_SCHEMA {database schema has changed} }] do_execsql_test 3.2.1 { @@ -111,7 +111,7 @@ do_execsql_test 3.2.1 { do_test 3.2.2 { error_messages_v2 "SELECT a FROM t2" "DROP TABLE t2" } [list {*}{ - SQLITE_ERROR {no such table: t2} + SQLITE_ERROR {no such table: t2} SQLITE_ERROR {no such table: t2} }] diff --git a/third_party/sqlite/src/test/eval.test b/third_party/sqlite/src/test/eval.test index 360d158f3c8a4..237d6d1a30e0d 100644 --- a/third_party/sqlite/src/test/eval.test +++ b/third_party/sqlite/src/test/eval.test @@ -22,7 +22,7 @@ source $testdir/tester.tcl # do_test eval-1.1 { execsql { - CREATE TABLE t1(x INTEGER PRIMARY KEY); + CREATE TABLE t1(x INTEGER PRIMARY KEY); INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); INSERT INTO t1 SELECT x+2 FROM t1; diff --git a/third_party/sqlite/src/test/exclusive.test b/third_party/sqlite/src/test/exclusive.test index 45f9318205481..b4cf257aab596 100644 --- a/third_party/sqlite/src/test/exclusive.test +++ b/third_party/sqlite/src/test/exclusive.test @@ -9,7 +9,7 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The focus -# of these tests is exclusive access mode (i.e. the thing activated by +# of these tests is exclusive access mode (i.e. the thing activated by # "PRAGMA locking_mode = EXCLUSIVE"). # # $Id: exclusive.test,v 1.15 2009/06/26 12:30:40 danielk1977 Exp $ @@ -37,43 +37,43 @@ do_test exclusive-1.0 { pragma locking_mode; pragma main.locking_mode; pragma temp.locking_mode; - } + } } [list normal normal exclusive] do_test exclusive-1.1 { execsql { pragma locking_mode = exclusive; - } + } } {exclusive} do_test exclusive-1.2 { execsql { pragma locking_mode; pragma main.locking_mode; pragma temp.locking_mode; - } + } } [list exclusive exclusive exclusive] do_test exclusive-1.3 { execsql { pragma locking_mode = normal; - } + } } {normal} do_test exclusive-1.4 { execsql { pragma locking_mode; pragma main.locking_mode; pragma temp.locking_mode; - } + } } [list normal normal exclusive] do_test exclusive-1.5 { execsql { pragma locking_mode = invalid; - } + } } {normal} do_test exclusive-1.6 { execsql { pragma locking_mode; pragma main.locking_mode; pragma temp.locking_mode; - } + } } [list normal normal exclusive] ifcapable attach { do_test exclusive-1.7 { @@ -144,7 +144,7 @@ ifcapable attach { pragma aux3.locking_mode; } } [list normal exclusive normal normal normal] - + do_test exclusive-1.99 { execsql { DETACH aux; @@ -155,7 +155,7 @@ ifcapable attach { } #---------------------------------------------------------------------- -# Test cases exclusive-2.X verify that connections in exclusive +# Test cases exclusive-2.X verify that connections in exclusive # locking_mode do not relinquish locks. # do_test exclusive-2.0 { @@ -173,7 +173,7 @@ do_test exclusive-2.1 { } db2 } {1 2 3 4 5 6} do_test exclusive-2.2 { - # This causes connection 'db' (in exclusive mode) to establish + # This causes connection 'db' (in exclusive mode) to establish # a shared-lock on the db. The other connection should now be # locked out as a writer. execsql { @@ -244,12 +244,12 @@ do_test exclusive-2.11 { db2 close #---------------------------------------------------------------------- -# Tests exclusive-3.X - test that a connection in exclusive mode -# truncates instead of deletes the journal file when committing +# Tests exclusive-3.X - test that a connection in exclusive mode +# truncates instead of deletes the journal file when committing # a transaction. # # These tests are not run on windows because the windows backend -# opens the journal file for exclusive access, preventing its contents +# opens the journal file for exclusive access, preventing its contents # from being inspected externally. # if {$tcl_platform(platform) != "windows"} { @@ -318,7 +318,7 @@ if {$tcl_platform(platform) != "windows"} { # # The following procedure computes a "signature" for table "t3". If -# T3 changes in any way, the signature should change. +# T3 changes in any way, the signature should change. # # This is used to test ROLLBACK. We gather a signature for t3, then # make lots of changes to t3, then rollback and take another signature. @@ -408,7 +408,7 @@ foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] { set extrafds 0 if {$using_proxy!=0} { set extrafds 2 -} +} do_test exclusive-5.0 { execsql { diff --git a/third_party/sqlite/src/test/exclusive2.test b/third_party/sqlite/src/test/exclusive2.test index 92fcd76ab3858..a24c3fb4d0f7f 100644 --- a/third_party/sqlite/src/test/exclusive2.test +++ b/third_party/sqlite/src/test/exclusive2.test @@ -104,10 +104,10 @@ do_test exclusive2-1.0 { # It can't tell the db has changed because we reset the change-counter. # 9: Increment the change-counter. # 10: Ensure that the first connection now sees the updated database. It -# sees the change-counter has been incremented and discards the +# sees the change-counter has been incremented and discards the # invalid in-memory cache. # -# This will only work if the database cache is large enough to hold +# This will only work if the database cache is large enough to hold # the entire database. In the case of 1024 byte pages, this means # the cache size must be at least 17. Otherwise, some pages will be # loaded from the database file in step 8. @@ -133,7 +133,7 @@ do_test exclusive2-1.1 { } } {64} do_test exclusive2-1.2.1 { - # Make sure the pager cache is large enough to store the + # Make sure the pager cache is large enough to store the # entire database. set nPage [expr [file size test.db]/1024] if {$::SQLITE_DEFAULT_CACHE_SIZE < $nPage} { @@ -179,10 +179,10 @@ do_test exclusive2-1.11 { db2 close #-------------------------------------------------------------------- -# These tests - exclusive2-2.X - are similar to exclusive2-1.X, +# These tests - exclusive2-2.X - are similar to exclusive2-1.X, # except that they are run with locking_mode=EXCLUSIVE. # -# 1-3: Build a database with exclusive-access connection 1, +# 1-3: Build a database with exclusive-access connection 1, # calculate a signature. # 4: Corrupt the database by writing 10000 bytes of garbage # starting at the beginning of page 2. Check that connection 1 @@ -217,7 +217,7 @@ do_test exclusive2-2.1 { } } {64} do_test exclusive2-2.2.1 { - # Make sure the pager cache is large enough to store the + # Make sure the pager cache is large enough to store the # entire database. set nPage [expr [file size test.db]/1024] if {$::SQLITE_DEFAULT_CACHE_SIZE < $nPage} { diff --git a/third_party/sqlite/src/test/expr.test b/third_party/sqlite/src/test/expr.test index 7a6d4772590e2..9c77a53d0ab49 100644 --- a/third_party/sqlite/src/test/expr.test +++ b/third_party/sqlite/src/test/expr.test @@ -534,7 +534,7 @@ test_expr expr-5.67b {t1='abc_', t2='A%7_'} {t1 LIKE t2 ESCAPE '7'} $NCSL test_expr expr-5.68a {t1='abc7', t2='a%7_'} {t1 LIKE t2 ESCAPE '7'} 0 test_expr expr-5.68b {t1='abc7', t2='A%7_'} {t1 LIKE t2 ESCAPE '7'} 0 -# These are the same test as the block above, but using a multi-byte +# These are the same test as the block above, but using a multi-byte # character as the escape character. if {"\u1234"!="u1234"} { test_expr expr-5.69a "t1='abc', t2='a_c'" \ @@ -704,8 +704,8 @@ test_expr expr-case.11 {i1=null} \ test_expr expr-case.12 {i1=1} \ {CASE i1 WHEN 1 THEN null WHEN 2 THEN 'two' ELSE 3 END} {{}} test_expr expr-case.13 {i1=7} \ - { CASE WHEN i1 < 5 THEN 'low' - WHEN i1 < 10 THEN 'medium' + { CASE WHEN i1 < 5 THEN 'low' + WHEN i1 < 10 THEN 'medium' WHEN i1 < 15 THEN 'high' ELSE 'error' END} medium diff --git a/third_party/sqlite/src/test/extension01.test b/third_party/sqlite/src/test/extension01.test index 97b772680e5ee..a60b73a6fd44e 100644 --- a/third_party/sqlite/src/test/extension01.test +++ b/third_party/sqlite/src/test/extension01.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This file implements tests for various small extensions. # diff --git a/third_party/sqlite/src/test/fallocate.test b/third_party/sqlite/src/test/fallocate.test index f523c2cc4a834..1325b746c5bbf 100644 --- a/third_party/sqlite/src/test/fallocate.test +++ b/third_party/sqlite/src/test/fallocate.test @@ -82,7 +82,7 @@ if {!$skipwaltests} { forcedelete test.db sqlite3 db test.db file_control_chunksize_test db main [expr 32*1024] - + do_test fallocate-2.1 { execsql { PRAGMA page_size = 1024; @@ -91,26 +91,26 @@ if {!$skipwaltests} { } file size test.db } [expr 32*1024] - + do_test fallocate-2.2 { execsql { INSERT INTO t1 VALUES(1, zeroblob(35*1024)) } execsql { PRAGMA wal_checkpoint } file size test.db } [expr 64*1024] - + do_test fallocate-2.3 { execsql { DELETE FROM t1 } execsql { VACUUM } file size test.db } [expr 64*1024] - + do_test fallocate-2.4 { execsql { PRAGMA wal_checkpoint } file size test.db } [expr 32*1024] - + do_test fallocate-2.5 { - execsql { + execsql { INSERT INTO t1 VALUES(2, randomblob(35*1024)); PRAGMA wal_checkpoint; INSERT INTO t1 VALUES(3, randomblob(128)); @@ -119,21 +119,21 @@ if {!$skipwaltests} { } file size test.db } [expr 64*1024] - + do_test fallocate-2.6 { sqlite3 db2 test.db execsql { BEGIN ; SELECT count(a) FROM t1 } db2 - execsql { + execsql { INSERT INTO t1 VALUES(4, randomblob(128)); PRAGMA wal_checkpoint; } file size test.db } [expr 64*1024] - + do_test fallocate-2.7 { execsql { SELECT count(b) FROM t1 } db2 } {1} - + do_test fallocate-2.8 { execsql { COMMIT } db2 execsql { PRAGMA wal_checkpoint } diff --git a/third_party/sqlite/src/test/filefmt.test b/third_party/sqlite/src/test/filefmt.test index 087a955c39832..be9dac2063d1d 100644 --- a/third_party/sqlite/src/test/filefmt.test +++ b/third_party/sqlite/src/test/filefmt.test @@ -182,7 +182,7 @@ do_test filefmt-2.2.3 { sql36231 { INSERT INTO t1 VALUES(a_string(3000)) } } {} -do_execsql_test filefmt-2.2.4 { +do_execsql_test filefmt-2.2.4 { PRAGMA integrity_check; BEGIN; INSERT INTO t2 VALUES(2); @@ -198,7 +198,7 @@ sqlite3 db test.db integrity_check filefmt-2.2.7 #-------------------------------------------------------------------------- -# Check that ticket 89b8c9ac54 is fixed. Before the fix, the SELECT +# Check that ticket 89b8c9ac54 is fixed. Before the fix, the SELECT # statement would return SQLITE_CORRUPT. The database file was not actually # corrupted, but SQLite was reporting that it was. # @@ -209,8 +209,8 @@ do_execsql_test filefmt-3.1 { PRAGMA auto_vacuum = 1; CREATE TABLE t1(a, b); } {} -do_test filefmt-3.2 { - sql36231 { DROP TABLE t1 } +do_test filefmt-3.2 { + sql36231 { DROP TABLE t1 } } {} do_execsql_test filefmt-3.3 { SELECT * FROM sqlite_master; @@ -236,16 +236,16 @@ do_execsql_test filefmt-4.1 { INSERT INTO t2 SELECT randomblob(100), randomblob(100) FROM t1; } -do_test filefmt-4.2 { +do_test filefmt-4.2 { sql36231 { INSERT INTO t2 SELECT * FROM t1 } } {} -do_test filefmt-4.3 { +do_test filefmt-4.3 { forcedelete bak.db db backup bak.db } {} -do_test filefmt-4.4 { +do_test filefmt-4.4 { sqlite3 db2 bak.db db2 eval { PRAGMA integrity_check } } {ok} diff --git a/third_party/sqlite/src/test/fkey1.test b/third_party/sqlite/src/test/fkey1.test index d9b038a02253c..cde0a31de87fd 100644 --- a/third_party/sqlite/src/test/fkey1.test +++ b/third_party/sqlite/src/test/fkey1.test @@ -156,13 +156,13 @@ do_execsql_test fkey1-4.2 { # do_execsql_test fkey1-5.1 { CREATE TABLE t11( - x INTEGER PRIMARY KEY, + x INTEGER PRIMARY KEY, parent REFERENCES t11 ON DELETE CASCADE ); INSERT INTO t11 VALUES (1, NULL), (2, 1), (3, 2); } {} -# The REPLACE part of this statement deletes the row (2, 1). Then the +# The REPLACE part of this statement deletes the row (2, 1). Then the # DELETE CASCADE caused by deleting that row removes the (3, 2) row. Which # would have been the parent of the new row being inserted. Causing an # FK violation. @@ -174,7 +174,7 @@ do_catchsql_test fkey1-5.2 { # A similar test to the above. do_execsql_test fkey1-5.3 { CREATE TABLE Foo ( - Id INTEGER PRIMARY KEY, + Id INTEGER PRIMARY KEY, ParentId INTEGER REFERENCES Foo(Id) ON DELETE CASCADE, C1 ); INSERT OR REPLACE INTO Foo(Id, ParentId, C1) VALUES (1, null, 'A'); diff --git a/third_party/sqlite/src/test/fkey2.test b/third_party/sqlite/src/test/fkey2.test index c2ae3788f5b0a..5c46313da538a 100644 --- a/third_party/sqlite/src/test/fkey2.test +++ b/third_party/sqlite/src/test/fkey2.test @@ -24,9 +24,9 @@ ifcapable {!foreignkey||!trigger} { #------------------------------------------------------------------------- # Test structure: # -# fkey2-1.*: Simple tests to check that immediate and deferred foreign key +# fkey2-1.*: Simple tests to check that immediate and deferred foreign key # constraints work when not inside a transaction. -# +# # fkey2-2.*: Tests to verify that deferred foreign keys work inside # explicit transactions (i.e that processing really is deferred). # @@ -39,12 +39,12 @@ ifcapable {!foreignkey||!trigger} { # fkey2-5.*: Check that if foreign-keys are enabled, it is not possible # to write to an FK column using the incremental blob API. # -# fkey2-6.*: Test that FK processing is automatically disabled when +# fkey2-6.*: Test that FK processing is automatically disabled when # running VACUUM. # # fkey2-7.*: Test using an IPK as the key in the child (referencing) table. # -# fkey2-8.*: Test that enabling/disabling foreign key support while a +# fkey2-8.*: Test that enabling/disabling foreign key support while a # transaction is active is not possible. # # fkey2-9.*: Test SET DEFAULT actions. @@ -60,17 +60,17 @@ ifcapable {!foreignkey||!trigger} { # # fkey2-14.*: Test the ALTER TABLE and DROP TABLE commands. # -# fkey2-15.*: Test that if there are no (known) outstanding foreign key +# fkey2-15.*: Test that if there are no (known) outstanding foreign key # constraint violations in the database, inserting into a parent # table or deleting from a child table does not cause SQLite # to check if this has repaired an outstanding violation. # -# fkey2-16.*: Test that rows that refer to themselves may be inserted, +# fkey2-16.*: Test that rows that refer to themselves may be inserted, # updated and deleted. # # fkey2-17.*: Test that the "count_changes" pragma does not interfere with # FK constraint processing. -# +# # fkey2-18.*: Test that the authorization callback is invoked when processing # FK constraints. # @@ -139,7 +139,7 @@ set FkeySimpleTests { 4.17 "UPDATE t7 SET a = 10" {0 {}} 5.1 "INSERT INTO t9 VALUES(1, 3)" {1 {no such table: main.nosuchtable}} - 5.2 "INSERT INTO t10 VALUES(1, 3)" + 5.2 "INSERT INTO t10 VALUES(1, 3)" {1 {foreign key mismatch - "t10" referencing "t9"}} } @@ -333,7 +333,7 @@ fkey2-2-test 32 1 "RELEASE save" fkey2-2-test 33 1 "DELETE FROM leaf WHERE cellid = 'b'" fkey2-2-test 34 0 "DELETE FROM leaf WHERE cellid = 'c'" fkey2-2-test 35 0 "COMMIT" -fkey2-2-test 36 0 "SELECT * FROM node" {2 {}} +fkey2-2-test 36 0 "SELECT * FROM node" {2 {}} fkey2-2-test 37 0 "SELECT * FROM leaf" {a 2} fkey2-2-test 38 0 "SAVEPOINT outer" @@ -361,10 +361,10 @@ fkey2-2-test 58 0 "RELEASE outer" fkey2-2-test 59 0 "SELECT * FROM node" {2 {} 3 2 4 {}} fkey2-2-test 60 0 "SELECT * FROM leaf" {a 2 d 3 e 3 f 4} -# The following set of tests check that if a statement that affects -# multiple rows violates some foreign key constraints, then strikes a -# constraint that causes the statement-transaction to be rolled back, -# the deferred constraint counter is correctly reset to the value it +# The following set of tests check that if a statement that affects +# multiple rows violates some foreign key constraints, then strikes a +# constraint that causes the statement-transaction to be rolled back, +# the deferred constraint counter is correctly reset to the value it # had before the statement-transaction was opened. # fkey2-2-test 61 0 "BEGIN" @@ -399,11 +399,11 @@ do_test fkey2-3.1.1 { execsql { CREATE TABLE ab(a PRIMARY KEY, b); CREATE TABLE cd( - c PRIMARY KEY REFERENCES ab ON UPDATE CASCADE ON DELETE CASCADE, + c PRIMARY KEY REFERENCES ab ON UPDATE CASCADE ON DELETE CASCADE, d ); CREATE TABLE ef( - e REFERENCES cd ON UPDATE CASCADE, + e REFERENCES cd ON UPDATE CASCADE, f, CHECK (e!=5) ); } @@ -440,14 +440,14 @@ do_test fkey2-3.2.2 { } {1 b 1 d 1 e} #------------------------------------------------------------------------- -# Test cases fkey2-4.* test that recursive foreign key actions +# Test cases fkey2-4.* test that recursive foreign key actions # (i.e. CASCADE) are allowed even if recursive triggers are disabled. # drop_all_tables do_test fkey2-4.1 { execsql { CREATE TABLE t1( - node PRIMARY KEY, + node PRIMARY KEY, parent REFERENCES t1 ON DELETE CASCADE ); CREATE TABLE t2(node PRIMARY KEY, parent); @@ -466,14 +466,14 @@ do_test fkey2-4.1 { } {} do_test fkey2-4.2 { execsql { PRAGMA recursive_triggers = off } - execsql { + execsql { BEGIN; DELETE FROM t1 WHERE node = 1; SELECT node FROM t1; } } {} do_test fkey2-4.3 { - execsql { + execsql { DELETE FROM t2 WHERE node = 1; SELECT node FROM t2; ROLLBACK; @@ -481,14 +481,14 @@ do_test fkey2-4.3 { } {4 5 6 7} do_test fkey2-4.4 { execsql { PRAGMA recursive_triggers = on } - execsql { + execsql { BEGIN; DELETE FROM t1 WHERE node = 1; SELECT node FROM t1; } } {} do_test fkey2-4.3 { - execsql { + execsql { DELETE FROM t2 WHERE node = 1; SELECT node FROM t2; ROLLBACK; @@ -545,7 +545,7 @@ ifcapable vacuum { #------------------------------------------------------------------------- # Test that it is possible to use an INTEGER PRIMARY KEY as the child key # of a foreign constraint. -# +# drop_all_tables do_test fkey2-7.1 { execsql { @@ -557,7 +557,7 @@ do_test fkey2-7.2 { catchsql { INSERT INTO t2 VALUES(1, 'A'); } } {1 {FOREIGN KEY constraint failed}} do_test fkey2-7.3 { - execsql { + execsql { INSERT INTO t1 VALUES(1, 2); INSERT INTO t1 VALUES(2, 3); INSERT INTO t2 VALUES(1, 'A'); @@ -585,7 +585,7 @@ do_test fkey2-7.9 { #------------------------------------------------------------------------- # Test that it is not possible to enable/disable FK support while a # transaction is open. -# +# drop_all_tables proc fkey2-8-test {tn zSql value} { do_test fkey-2.8.$tn.1 [list execsql $zSql] {} @@ -651,8 +651,8 @@ do_test fkey2-9.2.1 { execsql { CREATE TABLE pp(a, b, c, PRIMARY KEY(b, c)); CREATE TABLE cc(d DEFAULT 3, e DEFAULT 1, f DEFAULT 2, - FOREIGN KEY(f, d) REFERENCES pp - ON UPDATE SET DEFAULT + FOREIGN KEY(f, d) REFERENCES pp + ON UPDATE SET DEFAULT ON DELETE SET NULL ); INSERT INTO pp VALUES(1, 2, 3); @@ -683,7 +683,7 @@ do_execsql_test fkey2-9.3.0 { } {} #------------------------------------------------------------------------- -# The following tests, fkey2-10.*, test "foreign key mismatch" and +# The following tests, fkey2-10.*, test "foreign key mismatch" and # other errors. # set tn 0 @@ -708,7 +708,7 @@ foreach zSql [list { } {/1 {foreign key mismatch - "c" referencing "."}/} } -# "rowid" cannot be used as part of a child or parent key definition +# "rowid" cannot be used as part of a child or parent key definition # unless it happens to be the name of an explicitly declared column. # do_test fkey2-10.2.1 { @@ -769,30 +769,30 @@ do_test fkey2-12.1.1 { execsql { CREATE TABLE t1(a, b PRIMARY KEY); CREATE TABLE t2( - x REFERENCES t1 ON UPDATE RESTRICT DEFERRABLE INITIALLY DEFERRED + x REFERENCES t1 ON UPDATE RESTRICT DEFERRABLE INITIALLY DEFERRED ); INSERT INTO t1 VALUES(1, 'one'); INSERT INTO t1 VALUES(2, 'two'); INSERT INTO t1 VALUES(3, 'three'); } } {} -do_test fkey2-12.1.2 { +do_test fkey2-12.1.2 { execsql "BEGIN" execsql "INSERT INTO t2 VALUES('two')" } {} -do_test fkey2-12.1.3 { +do_test fkey2-12.1.3 { execsql "UPDATE t1 SET b = 'four' WHERE b = 'one'" } {} -do_test fkey2-12.1.4 { +do_test fkey2-12.1.4 { catchsql "UPDATE t1 SET b = 'five' WHERE b = 'two'" } {1 {FOREIGN KEY constraint failed}} -do_test fkey2-12.1.5 { +do_test fkey2-12.1.5 { execsql "DELETE FROM t1 WHERE b = 'two'" } {} -do_test fkey2-12.1.6 { +do_test fkey2-12.1.6 { catchsql "COMMIT" } {1 {FOREIGN KEY constraint failed}} -do_test fkey2-12.1.7 { +do_test fkey2-12.1.7 { execsql { INSERT INTO t1 VALUES(2, 'two'); COMMIT; @@ -803,7 +803,7 @@ drop_all_tables do_test fkey2-12.2.1 { execsql { CREATE TABLE t1(x COLLATE NOCASE PRIMARY KEY); - CREATE TRIGGER tt1 AFTER DELETE ON t1 + CREATE TRIGGER tt1 AFTER DELETE ON t1 WHEN EXISTS ( SELECT 1 FROM t2 WHERE old.x = y ) BEGIN INSERT INTO t1 VALUES(old.x); @@ -873,14 +873,14 @@ do_test fkey2-12.3.3 { catchsql { INSERT INTO down(c39, c38) VALUES('yes', 'no') } } {1 {FOREIGN KEY constraint failed}} do_test fkey2-12.3.4 { - execsql { + execsql { INSERT INTO up(c34, c35) VALUES('yes', 'no'); INSERT INTO down(c39, c38) VALUES('yes', 'no'); } catchsql { DELETE FROM up WHERE c34 = 'yes' } } {1 {FOREIGN KEY constraint failed}} do_test fkey2-12.3.5 { - execsql { + execsql { DELETE FROM up WHERE c34 = 'possibly'; SELECT c34, c35 FROM up; SELECT c39, c38 FROM down; @@ -926,14 +926,14 @@ foreach {tn stmt} { } {1 2 3 2 3 1} } do_test fkey2-13.1.3 { - execsql { + execsql { REPLACE INTO pp(rowid, a, b, c) VALUES(1, 2, 2, 3); SELECT rowid, * FROM pp; SELECT * FROM cc; } } {1 2 2 3 2 3 1} do_test fkey2-13.1.4 { - execsql { + execsql { REPLACE INTO pp(rowid, a, b, c) VALUES(2, 2, 2, 3); SELECT rowid, * FROM pp; SELECT * FROM cc; @@ -952,7 +952,7 @@ drop_all_tables ifcapable altertable { do_test fkey2-14.1.1 { # Adding a column with a REFERENCES clause is not supported. - execsql { + execsql { CREATE TABLE t1(a PRIMARY KEY); CREATE TABLE t2(a, b); } @@ -971,15 +971,15 @@ ifcapable altertable { catchsql { ALTER TABLE t2 ADD COLUMN g DEFAULT CURRENT_TIME REFERENCES t1 } } {1 {Cannot add a REFERENCES column with non-NULL default value}} do_test fkey2-14.1.6 { - execsql { + execsql { PRAGMA foreign_keys = off; ALTER TABLE t2 ADD COLUMN h DEFAULT 'text' REFERENCES t1; PRAGMA foreign_keys = on; SELECT sql FROM sqlite_master WHERE name='t2'; } } {{CREATE TABLE t2(a, b, c REFERENCES t1, d DEFAULT NULL REFERENCES t1, e REFERENCES t1 DEFAULT NULL, h DEFAULT 'text' REFERENCES t1)}} - - + + # Test the sqlite_rename_parent() function directly. # proc test_rename_parent {zCreate zOld zNew} { @@ -994,7 +994,7 @@ ifcapable altertable { do_test fkey2-14.2.1.3 { test_rename_parent {CREATE TABLE t1(a REFERENCES "t2")} t2 t3 } {{CREATE TABLE t1(a REFERENCES "t3")}} - + # Test ALTER TABLE RENAME TABLE a bit. # do_test fkey2-14.2.2.1 { @@ -1039,7 +1039,7 @@ ifcapable altertable { drop_all_tables do_test fkey2-14.1tmp.1 { # Adding a column with a REFERENCES clause is not supported. - execsql { + execsql { CREATE TEMP TABLE t1(a PRIMARY KEY); CREATE TEMP TABLE t2(a, b); } @@ -1058,7 +1058,7 @@ ifcapable altertable { catchsql { ALTER TABLE t2 ADD COLUMN g DEFAULT CURRENT_TIME REFERENCES t1 } } {1 {Cannot add a REFERENCES column with non-NULL default value}} do_test fkey2-14.1tmp.6 { - execsql { + execsql { PRAGMA foreign_keys = off; ALTER TABLE t2 ADD COLUMN h DEFAULT 'text' REFERENCES t1; PRAGMA foreign_keys = on; @@ -1075,7 +1075,7 @@ ifcapable altertable { do_test fkey2-14.2tmp.1.3 { test_rename_parent {CREATE TABLE t1(a REFERENCES "t2")} t2 t3 } {{CREATE TABLE t1(a REFERENCES "t3")}} - + # Test ALTER TABLE RENAME TABLE a bit. # do_test fkey2-14.2tmp.2.1 { @@ -1120,7 +1120,7 @@ ifcapable altertable { drop_all_tables do_test fkey2-14.1aux.1 { # Adding a column with a REFERENCES clause is not supported. - execsql { + execsql { ATTACH ':memory:' AS aux; CREATE TABLE aux.t1(a PRIMARY KEY); CREATE TABLE aux.t2(a, b); @@ -1140,7 +1140,7 @@ ifcapable altertable { catchsql { ALTER TABLE t2 ADD COLUMN g DEFAULT CURRENT_TIME REFERENCES t1 } } {1 {Cannot add a REFERENCES column with non-NULL default value}} do_test fkey2-14.1aux.6 { - execsql { + execsql { PRAGMA foreign_keys = off; ALTER TABLE t2 ADD COLUMN h DEFAULT 'text' REFERENCES t1; PRAGMA foreign_keys = on; @@ -1157,7 +1157,7 @@ ifcapable altertable { do_test fkey2-14.2aux.1.3 { test_rename_parent {CREATE TABLE t1(a REFERENCES "t2")} t2 t3 } {{CREATE TABLE t1(a REFERENCES "t3")}} - + # Test ALTER TABLE RENAME TABLE a bit. # do_test fkey2-14.2aux.2.1 { @@ -1253,7 +1253,7 @@ do_test fkey-2.14.3.9 { } {} do_test fkey-2.14.3.10 { execsql { - CREATE TABLE cc(a, b, + CREATE TABLE cc(a, b, FOREIGN KEY(a, b) REFERENCES pp DEFERRABLE INITIALLY DEFERRED ); } @@ -1268,7 +1268,7 @@ do_test fkey-2.14.3.10 { } } {} do_test fkey-2.14.3.11 { - execsql { + execsql { BEGIN; DROP TABLE cc; DROP TABLE pp; @@ -1295,7 +1295,7 @@ do_test fkey-2.14.3.13 { drop_all_tables do_test fkey-2.14.4.1 { execsql { - CREATE TABLE t1(x REFERENCES v); + CREATE TABLE t1(x REFERENCES v); CREATE VIEW v AS SELECT * FROM t1; } } {} @@ -1317,7 +1317,7 @@ ifcapable vtab { } #------------------------------------------------------------------------- -# The following tests, fkey2-15.*, test that unnecessary FK related scans +# The following tests, fkey2-15.*, test that unnecessary FK related scans # and lookups are avoided when the constraint counters are zero. # drop_all_tables @@ -1362,7 +1362,7 @@ do_test fkey2-15.1.6 { } } {1} do_test fkey2-15.1.7 { - execsql { + execsql { BEGIN; DELETE FROM pp WHERE a = 2; } @@ -1428,7 +1428,7 @@ foreach {tn zSchema} { drop_all_tables do_test fkey2-17.1.1 { execsql { PRAGMA count_changes = 1 } - execsql { + execsql { CREATE TABLE one(a, b, c, UNIQUE(b, c)); CREATE TABLE two(d, e, f, FOREIGN KEY(e, f) REFERENCES one(b, c)); INSERT INTO one VALUES(1, 2, 3); @@ -1481,7 +1481,7 @@ do_test fkey2-17.1.9 { do_test fkey2-17.1.10 { execsql { CREATE TABLE three( - g, h, i, + g, h, i, FOREIGN KEY(h, i) REFERENCES one(b, c) DEFERRABLE INITIALLY DEFERRED ); } @@ -1507,7 +1507,7 @@ do_test fkey2-17.2.1 { execsql { CREATE TABLE high("a'b!" PRIMARY KEY, b); CREATE TABLE low( - c, + c, "d&6" REFERENCES high ON UPDATE CASCADE ON DELETE CASCADE ); } @@ -1577,7 +1577,7 @@ ifcapable auth { execsql { INSERT INTO short VALUES(1, 3, 2) } set authargs } {SQLITE_INSERT short {} main {} SQLITE_READ long b main {}} - + # As must an insert on the child table of a deferred constraint. set authargs {} do_test fkey2-18.4 { @@ -1757,10 +1757,10 @@ foreach {tn update} { } #------------------------------------------------------------------------- -# The following block of tests, those prefixed with "fkey2-genfkey.", are -# the same tests that were used to test the ".genfkey" command provided -# by the shell tool. So these tests show that the built-in foreign key -# implementation is more or less compatible with the triggers generated +# The following block of tests, those prefixed with "fkey2-genfkey.", are +# the same tests that were used to test the ".genfkey" command provided +# by the shell tool. So these tests show that the built-in foreign key +# implementation is more or less compatible with the triggers generated # by genfkey. # drop_all_tables @@ -1805,7 +1805,7 @@ do_test fkey2-genfkey.1.11 { execsql { UPDATE t2 SET e = NULL } } {} do_test fkey2-genfkey.1.12 { - execsql { + execsql { UPDATE t1 SET a = 10; DELETE FROM t1; DELETE FROM t2; @@ -1822,7 +1822,7 @@ do_test fkey2-genfkey.1.14 { catchsql { INSERT INTO t3 VALUES(3, 1, 4) } } {1 {FOREIGN KEY constraint failed}} do_test fkey2-genfkey.1.15 { - execsql { + execsql { INSERT INTO t1 VALUES(1, 1, 4); INSERT INTO t3 VALUES(3, 1, 4); } @@ -1845,8 +1845,8 @@ do_test fkey2-genfkey.2.1 { execsql { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c, UNIQUE(b, c)); CREATE TABLE t2(e REFERENCES t1 ON UPDATE CASCADE ON DELETE CASCADE, f); - CREATE TABLE t3(g, h, i, - FOREIGN KEY (h, i) + CREATE TABLE t3(g, h, i, + FOREIGN KEY (h, i) REFERENCES t1(b, c) ON UPDATE CASCADE ON DELETE CASCADE ); } @@ -1891,8 +1891,8 @@ do_test fkey2-genfkey.3.1 { execsql { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c, UNIQUE(c, b)); CREATE TABLE t2(e REFERENCES t1 ON UPDATE SET NULL ON DELETE SET NULL, f); - CREATE TABLE t3(g, h, i, - FOREIGN KEY (h, i) + CREATE TABLE t3(g, h, i, + FOREIGN KEY (h, i) REFERENCES t1(b, c) ON UPDATE SET NULL ON DELETE SET NULL ); } diff --git a/third_party/sqlite/src/test/fkey3.test b/third_party/sqlite/src/test/fkey3.test index a8d038202074c..fd8f5a97af6be 100644 --- a/third_party/sqlite/src/test/fkey3.test +++ b/third_party/sqlite/src/test/fkey3.test @@ -81,13 +81,13 @@ do_test fkey3-2.1 { #------------------------------------------------------------------------- -# The following tests - fkey-3.* - test some edge cases to do with +# The following tests - fkey-3.* - test some edge cases to do with # inserting rows into tables that have foreign keys where the parent # table is the same as the child table. Especially cases where the # new row being inserted matches itself. # do_execsql_test 3.1.1 { - CREATE TABLE t3(a, b, c, d, + CREATE TABLE t3(a, b, c, d, UNIQUE(a, b), FOREIGN KEY(c, d) REFERENCES t3(a, b) ); @@ -125,8 +125,8 @@ do_execsql_test 3.4.2 { INSERT INTO t6 VALUES(NULL, 'a', 1, 'a'); } {} do_execsql_test 3.4.3 { INSERT INTO t6 VALUES(2, 'a', 2, 'a'); } {} do_execsql_test 3.4.4 { INSERT INTO t6 VALUES(NULL, 'a', 1, 'a'); } {} do_execsql_test 3.4.5 { INSERT INTO t6 VALUES(5, 'a', 2, 'a'); } {} -do_catchsql_test 3.4.6 { - INSERT INTO t6 VALUES(NULL, 'a', 65, 'a'); +do_catchsql_test 3.4.6 { + INSERT INTO t6 VALUES(NULL, 'a', 65, 'a'); } {1 {FOREIGN KEY constraint failed}} do_execsql_test 3.4.7 { @@ -147,10 +147,10 @@ do_execsql_test 3.5.1 { } do_execsql_test 3.5.2 { INSERT INTO t7 VALUES('x', 1, 'x', NULL) } {} do_execsql_test 3.5.3 { INSERT INTO t7 VALUES('x', 2, 'x', 2) } {} -do_catchsql_test 3.5.4 { +do_catchsql_test 3.5.4 { INSERT INTO t7 VALUES('x', 450, 'x', NULL); } {1 {FOREIGN KEY constraint failed}} -do_catchsql_test 3.5.5 { +do_catchsql_test 3.5.5 { INSERT INTO t7 VALUES('x', 450, 'x', 451); } {1 {FOREIGN KEY constraint failed}} @@ -161,8 +161,8 @@ do_execsql_test 3.6.1 { CREATE UNIQUE INDEX t8i2 ON t8(c); INSERT INTO t8 VALUES(1, 1, 1, 1, 1); } -do_catchsql_test 3.6.2 { - UPDATE t8 SET d = 2; +do_catchsql_test 3.6.2 { + UPDATE t8 SET d = 2; } {1 {FOREIGN KEY constraint failed}} do_execsql_test 3.6.3 { UPDATE t8 SET d = 1; } do_execsql_test 3.6.4 { UPDATE t8 SET e = 2; } diff --git a/third_party/sqlite/src/test/fkey5.test b/third_party/sqlite/src/test/fkey5.test index b9e1fc2eeccd0..acb19f21b731a 100644 --- a/third_party/sqlite/src/test/fkey5.test +++ b/third_party/sqlite/src/test/fkey5.test @@ -72,7 +72,7 @@ do_test fkey5-1.1 { PRAGMA foreign_key_check; } -} {} +} {} do_test fkey5-1.2 { db eval { INSERT INTO c1 VALUES(90),(87),(88); diff --git a/third_party/sqlite/src/test/fkey6.test b/third_party/sqlite/src/test/fkey6.test index b658f20fea196..c46e9cc61cf3a 100644 --- a/third_party/sqlite/src/test/fkey6.test +++ b/third_party/sqlite/src/test/fkey6.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file implements regression tests for SQLite library. # -# This file tests the PRAGMA defer_foreign_keys and +# This file tests the PRAGMA defer_foreign_keys and # SQLITE_DBSTATUS_DEFERRED_FKS # # EVIDENCE-OF: R-18981-16292 When the defer_foreign_keys PRAGMA is on, diff --git a/third_party/sqlite/src/test/fkey7.test b/third_party/sqlite/src/test/fkey7.test index 6c646a9a7f869..8b76fc813377d 100644 --- a/third_party/sqlite/src/test/fkey7.test +++ b/third_party/sqlite/src/test/fkey7.test @@ -55,11 +55,11 @@ ifcapable incrblob { CREATE TABLE pX(x PRIMARY KEY); CREATE TABLE cX(a INTEGER PRIMARY KEY, b REFERENCES pX); } - + do_catchsql_test 2.1 { INSERT INTO cX VALUES(11, zeroblob(40)); } {1 {FOREIGN KEY constraint failed}} - + do_test 2.2 { set stmt [sqlite3_prepare_v2 db "INSERT INTO cX VALUES(11, ?)" -1] sqlite3_bind_zeroblob $stmt 1 45 diff --git a/third_party/sqlite/src/test/fkey_malloc.test b/third_party/sqlite/src/test/fkey_malloc.test index 382e6f67d9538..0135adc5ed2ed 100644 --- a/third_party/sqlite/src/test/fkey_malloc.test +++ b/third_party/sqlite/src/test/fkey_malloc.test @@ -36,7 +36,7 @@ do_malloc_test fkey_malloc-2 -sqlprep { PRAGMA foreign_keys = 1; CREATE TABLE t1(a, b, UNIQUE(a, b)); } -sqlbody { - CREATE TABLE t2(x, y, + CREATE TABLE t2(x, y, FOREIGN KEY(x, y) REFERENCES t1(a, b) DEFERRABLE INITIALLY DEFERRED ); BEGIN; @@ -69,7 +69,7 @@ proc catch_fk_error {zSql} { if {[string match {*foreign key*} $msg]} { return "" } - if {$msg eq "out of memory" + if {$msg eq "out of memory" || $msg eq "FOREIGN KEY constraint failed" || $msg eq "constraint failed" } { @@ -108,7 +108,7 @@ do_malloc_test fkey_malloc-5 -sqlprep { do_malloc_test fkey_malloc-6 -sqlprep { PRAGMA foreign_keys = 1; CREATE TABLE t1( - x PRIMARY KEY, + x PRIMARY KEY, y REFERENCES t1 ON DELETE RESTRICT ON UPDATE SET DEFAULT ); INSERT INTO t1 VALUES('abc', 'abc'); diff --git a/third_party/sqlite/src/test/fordelete.test b/third_party/sqlite/src/test/fordelete.test index 9a382d97f5c16..305a6e9a214f8 100644 --- a/third_party/sqlite/src/test/fordelete.test +++ b/third_party/sqlite/src/test/fordelete.test @@ -17,10 +17,10 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl set ::testprefix fordelete -# This function returns a list of the tables or indexes opened with -# OP_OpenWrite instructions when the SQL statement passed as the only +# This function returns a list of the tables or indexes opened with +# OP_OpenWrite instructions when the SQL statement passed as the only # argument is executed. If the OPFLAG_FORDELETE flag is specified on -# the OP_OpenWrite, an asterix is appended to the object name. The list +# the OP_OpenWrite, an asterix is appended to the object name. The list # is sorted in [lsort] order before it is returned. # proc analyze_delete_program {sql} { @@ -30,7 +30,7 @@ proc analyze_delete_program {sql} { } { set T($rootpage) $name } - + # For each OpenWrite instruction generated for the proposed DELETE # statement, add the following array entries: # @@ -48,7 +48,7 @@ proc analyze_delete_program {sql} { set obj $T($root) set O($obj) "" - if {"0x$R(p5)" & 0x08} { + if {"0x$R(p5)" & 0x08} { set O($obj) * } else { set O($obj) "" @@ -114,7 +114,7 @@ foreach {tn sql res} { # # 0x01 0x00 # -# is interpreted by OP_Column as a vector of NULL values (assuming the +# is interpreted by OP_Column as a vector of NULL values (assuming the # default column values are NULL). Also test that: # # 0x00 @@ -128,7 +128,7 @@ do_execsql_test 3.0 { do_test 3.1 { set root [db one { SELECT rootpage FROM sqlite_master WHERE name = 'x1' }] - db eval { + db eval { BEGIN IMMEDIATE; } set bt [btree_from_db db] @@ -144,7 +144,7 @@ do_test 3.1 { do_test 3.2 { set root [db one { SELECT rootpage FROM sqlite_master WHERE name = 'x2' }] - db eval { + db eval { BEGIN IMMEDIATE; } set bt [btree_from_db db] @@ -161,7 +161,7 @@ do_test 3.2 { #------------------------------------------------------------------------- # -reset_db +reset_db do_execsql_test 4.0 { CREATE TABLE log(x); CREATE TABLE p1(one PRIMARY KEY, two); @@ -179,7 +179,7 @@ do_execsql_test 4.1 { CREATE TABLE tbl(a PRIMARY KEY, b, c); CREATE TABLE log(a, b, c); INSERT INTO "tbl" VALUES(1,2,3); - CREATE TRIGGER the_trigger BEFORE DELETE ON tbl BEGIN + CREATE TRIGGER the_trigger BEFORE DELETE ON tbl BEGIN INSERT INTO log VALUES(1, 2,3); END; COMMIT; diff --git a/third_party/sqlite/src/test/fts-9fd058691.test b/third_party/sqlite/src/test/fts-9fd058691.test index b228482d46bb8..5a3ba75cf79ef 100644 --- a/third_party/sqlite/src/test/fts-9fd058691.test +++ b/third_party/sqlite/src/test/fts-9fd058691.test @@ -9,7 +9,7 @@ # This file implements regression tests for the FTS SQLite module. # # This file implements tests to verify that ticket [9fd058691] has been -# fixed. +# fixed. # set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/fts1b.test b/third_party/sqlite/src/test/fts1b.test index 2bbe1aab80047..3d6870671d073 100644 --- a/third_party/sqlite/src/test/fts1b.test +++ b/third_party/sqlite/src/test/fts1b.test @@ -33,7 +33,7 @@ proc fill_multilanguage_fulltext_t1 {} { set english {one two three four five} set spanish {un dos tres cuatro cinco} set german {eine zwei drei vier funf} - + for {set i 1} {$i<=31} {incr i} { set cmd "INSERT INTO t1 VALUES" set vset {} diff --git a/third_party/sqlite/src/test/fts1c.test b/third_party/sqlite/src/test/fts1c.test index a12469593aa5b..de78b996569e0 100644 --- a/third_party/sqlite/src/test/fts1c.test +++ b/third_party/sqlite/src/test/fts1c.test @@ -33,7 +33,7 @@ do_test fts1c-1.1 { BEGIN TRANSACTION; INSERT INTO email([from],[to],subject,body) VALUES('savita.puthigai@enron.com', 'traders.eol@enron.com, traders.eol@enron.com', 'EnronOnline- Change to Autohedge', 'Effective Monday, October 22, 2001 the following changes will be made to the Autohedge functionality on EnronOnline. -The volume on the hedge will now respect the minimum volume and volume increment settings on the parent product. See rules below: +The volume on the hedge will now respect the minimum volume and volume increment settings on the parent product. See rules below: ? If the transaction volume on the child is less than half of the parent''s minimum volume no hedge will occur. ? If the transaction volume on the child is more than half the parent''s minimum volume but less than half the volume increment on the parent, the hedge will volume will be the parent''s minimum volume. @@ -49,9 +49,9 @@ Volume on Autohedge transaction Volume Hedged 1 - 2499 0 2500 - 5499 5000 5500 - 6499 6000'); -INSERT INTO email([from],[to],subject,body) VALUES('dana.davis@enron.com', 'laynie.east@enron.com, lisa.king@enron.com, lisa.best@enron.com,', 'Leaving Early', 'FYI: -If it''s ok with everyone''s needs, I would like to leave @4pm. If you think -you will need my assistance past the 4 o''clock hour just let me know; I''ll +INSERT INTO email([from],[to],subject,body) VALUES('dana.davis@enron.com', 'laynie.east@enron.com, lisa.king@enron.com, lisa.best@enron.com,', 'Leaving Early', 'FYI: +If it''s ok with everyone''s needs, I would like to leave @4pm. If you think +you will need my assistance past the 4 o''clock hour just let me know; I''ll be more than willing to stay.'); INSERT INTO email([from],[to],subject,body) VALUES('enron_update@concureworkplace.com', 'louise.kitchen@enron.com', '<> - CC02.06.02', 'The following expense report is ready for approval: @@ -70,17 +70,17 @@ Could you print off the current work request report by 1:30 today? Gentlemen, -I''d like to review this today at 1:30 in our office. Also, could you provide +I''d like to review this today at 1:30 in our office. Also, could you provide me with your activity reports so I can have Julie enter this information. JD'); -INSERT INTO email([from],[to],subject,body) VALUES('v.weldon@enron.com', 'gary.l.carrier@usa.dupont.com, scott.joyce@bankofamerica.com', 'Enron News', 'This could turn into something big.... +INSERT INTO email([from],[to],subject,body) VALUES('v.weldon@enron.com', 'gary.l.carrier@usa.dupont.com, scott.joyce@bankofamerica.com', 'Enron News', 'This could turn into something big.... http://biz.yahoo.com/rf/010129/n29305829.html'); INSERT INTO email([from],[to],subject,body) VALUES('mark.haedicke@enron.com', 'paul.simons@enron.com', 'Re: First Polish Deal!', 'Congrats! Things seem to be building rapidly now on the Continent. Mark'); INSERT INTO email([from],[to],subject,body) VALUES('e..carter@enron.com', 't..robinson@enron.com', 'FW: Producers Newsletter 9-24-2001', ' The producer lumber pricing sheet. -----Original Message----- -From: Johnson, Jay +From: Johnson, Jay Sent: Tuesday, October 16, 2001 3:42 PM To: Carter, Karen E. Subject: FW: Producers Newsletter 9-24-2001 @@ -88,14 +88,14 @@ Subject: FW: Producers Newsletter 9-24-2001 -----Original Message----- -From: Daigre, Sergai +From: Daigre, Sergai Sent: Friday, September 21, 2001 8:33 PM Subject: Producers Newsletter 9-24-2001 '); -INSERT INTO email([from],[to],subject,body) VALUES('david.delainey@enron.com', 'kenneth.lay@enron.com', 'Greater Houston Partnership', 'Ken, in response to the letter from Mr Miguel San Juan, my suggestion would -be to offer up the Falcon for their use; however, given the tight time frame -and your recent visit with Mr. Fox that it would be difficult for either you +INSERT INTO email([from],[to],subject,body) VALUES('david.delainey@enron.com', 'kenneth.lay@enron.com', 'Greater Houston Partnership', 'Ken, in response to the letter from Mr Miguel San Juan, my suggestion would +be to offer up the Falcon for their use; however, given the tight time frame +and your recent visit with Mr. Fox that it would be difficult for either you or me to participate. I spoke to Max and he agrees with this approach. @@ -117,7 +117,7 @@ lachandra.fenceroy@enron.com 877.498.3401 Pager -----Original Message----- -From: Bisbee, Joanne +From: Bisbee, Joanne Sent: Wednesday, September 26, 2001 7:50 AM To: Fenceroy, LaChandra Subject: FW: Bus Applications Meeting Follow Up @@ -125,7 +125,7 @@ Subject: FW: Bus Applications Meeting Follow Up Lachandra, Please get with David Duff today and see what this is about. Who are our TW accounting business users? -----Original Message----- -From: Koh, Wendy +From: Koh, Wendy Sent: Tuesday, September 25, 2001 2:41 PM To: Bisbee, Joanne Subject: Bus Applications Meeting Follow Up @@ -138,7 +138,7 @@ INSERT INTO email([from],[to],subject,body) VALUES('danny.mccarty@enron.com', 'f Dan -----Original Message----- -From: Fagan, Fran +From: Fagan, Fran Sent: Thursday, December 20, 2001 11:10 AM To: McCarty, Danny Subject: worksheets @@ -152,7 +152,7 @@ Sr. HR Rep 713.853.5219 - << File: McCartyMerit.xls >> << File: mccartyBonusCommercial_UnP.xls >> + << File: McCartyMerit.xls >> << File: mccartyBonusCommercial_UnP.xls >> '); INSERT INTO email([from],[to],subject,body) VALUES('bert.meyers@enron.com', 'shift.dl-portland@enron.com', 'OCTOBER SCHEDULE', 'TEAM, @@ -164,7 +164,7 @@ INSERT INTO email([from],[to],subject,body) VALUES('errol.mclaughlin@enron.com', INSERT INTO email([from],[to],subject,body) VALUES('patrice.mims@enron.com', 'calvin.eakins@enron.com', 'Re: Small business supply assistance', 'Hi Calvin -I spoke with Rickey (boy, is he long-winded!!). Gave him the name of our +I spoke with Rickey (boy, is he long-winded!!). Gave him the name of our credit guy, Russell Diamond. Thank for your help!'); @@ -176,17 +176,17 @@ Here is the information on staffing and outside services. Call if you need anyt Jim '); -INSERT INTO email([from],[to],subject,body) VALUES('gelliott@industrialinfo.com', 'pcopello@industrialinfo.com', 'ECAAR (Gavin), WSCC (Diablo Canyon), & NPCC (Seabrook)', 'Dear Power Outage Database Customer, -Attached you will find an excel document. The outages contained within are forced or rescheduled outages. Your daily delivery will still contain these outages. -In addition to the two excel documents, there is a dbf file that is formatted like your daily deliveries you receive nightly. This will enable you to load the data into your regular database. Any questions please let me know. Thanks. -Greg Elliott -IIR, Inc. -713-783-5147 x 3481 -outages@industrialinfo.com -THE INFORMATION CONTAINED IN THIS E-MAIL IS LEGALLY PRIVILEGED AND CONFIDENTIAL INFORMATION INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY NAMED ABOVE. YOU ARE HEREBY NOTIFIED THAT ANY DISSEMINATION, DISTRIBUTION, OR COPY OF THIS E-MAIL TO UNAUTHORIZED ENTITIES IS STRICTLY PROHIBITED. IF YOU HAVE RECEIVED THIS +INSERT INTO email([from],[to],subject,body) VALUES('gelliott@industrialinfo.com', 'pcopello@industrialinfo.com', 'ECAAR (Gavin), WSCC (Diablo Canyon), & NPCC (Seabrook)', 'Dear Power Outage Database Customer, +Attached you will find an excel document. The outages contained within are forced or rescheduled outages. Your daily delivery will still contain these outages. +In addition to the two excel documents, there is a dbf file that is formatted like your daily deliveries you receive nightly. This will enable you to load the data into your regular database. Any questions please let me know. Thanks. +Greg Elliott +IIR, Inc. +713-783-5147 x 3481 +outages@industrialinfo.com +THE INFORMATION CONTAINED IN THIS E-MAIL IS LEGALLY PRIVILEGED AND CONFIDENTIAL INFORMATION INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY NAMED ABOVE. YOU ARE HEREBY NOTIFIED THAT ANY DISSEMINATION, DISTRIBUTION, OR COPY OF THIS E-MAIL TO UNAUTHORIZED ENTITIES IS STRICTLY PROHIBITED. IF YOU HAVE RECEIVED THIS E-MAIL IN ERROR, PLEASE DELETE IT. - - OUTAGE.dbf - - 111201R.xls + - OUTAGE.dbf + - 111201R.xls - 111201.xls '); INSERT INTO email([from],[to],subject,body) VALUES('enron.announcements@enron.com', 'all_ena_egm_eim@enron.com', 'EWS Brown Bag', 'MARK YOUR LUNCH CALENDARS NOW ! @@ -210,35 +210,35 @@ INSERT INTO email([from],[to],subject,body) VALUES('chris.germany@enron.com', 'i "Immer, Ingrid" on 12/21/2000 11:48:47 AM To: "''chris.germany@enron.com''" -cc: +cc: Subject: About St Pauls - <> -? -?http://www.stpaulshouston.org/about.html + <> +? +?http://www.stpaulshouston.org/about.html -Chris, +Chris, -I like the looks of this place.? What do you think about going here Christmas -eve?? They have an 11:00 a.m. service and a candlelight service at 5:00 p.m., +I like the looks of this place.? What do you think about going here Christmas +eve?? They have an 11:00 a.m. service and a candlelight service at 5:00 p.m., among others. -Let me know.?? ii +Let me know.?? ii - About St Pauls.url '); INSERT INTO email([from],[to],subject,body) VALUES('nas@cpuc.ca.gov', 'skatz@sempratrading.com, kmccrea@sablaw.com, thompson@wrightlaw.com,', 'Reply Brief filed July 31, 2000', ' - CPUC01-#76371-v1-Revised_Reply_Brief__Due_today_7_31_.doc'); INSERT INTO email([from],[to],subject,body) VALUES('gascontrol@aglresources.com', 'dscott4@enron.com, lcampbel@enron.com', 'Alert Posted 10:00 AM November 20,2000: E-GAS Request Reminder', 'Alert Posted 10:00 AM November 20,2000: E-GAS Request Reminder -As discussed in the Winter Operations Meeting on Sept.29,2000, -E-Gas(Emergency Gas) will not be offered this winter as a service from AGLC. -Marketers and Poolers can receive gas via Peaking and IBSS nominations(daisy +As discussed in the Winter Operations Meeting on Sept.29,2000, +E-Gas(Emergency Gas) will not be offered this winter as a service from AGLC. +Marketers and Poolers can receive gas via Peaking and IBSS nominations(daisy chain) from other marketers up to the 6 p.m. Same Day 2 nomination cycle. '); -INSERT INTO email([from],[to],subject,body) VALUES('dutch.quigley@enron.com', 'rwolkwitz@powermerchants.com', '', ' +INSERT INTO email([from],[to],subject,body) VALUES('dutch.quigley@enron.com', 'rwolkwitz@powermerchants.com', '', ' Here is a goody for you'); INSERT INTO email([from],[to],subject,body) VALUES('ryan.o''rourke@enron.com', 'k..allen@enron.com, randy.bhatia@enron.com, frank.ermis@enron.com,', 'TRV Notification: (West VaR - 11/07/2001)', 'The report named: West VaR , published as of 11/07/2001 is now available for viewing on the website.'); @@ -268,23 +268,23 @@ adam -----Original Message----- -From: Royed, Jeff +From: Royed, Jeff Sent: Tuesday, September 25, 2001 11:37 AM To: Bayer, Adam Subject: Curve Fetch File Let me know if it works. It may be required to have a certain version of Oracle for it to work properly. - + Jeff Royed -Enron +Enron Energy Operations Phone: 713-853-5295'); INSERT INTO email([from],[to],subject,body) VALUES('matt.smith@enron.com', 'yan.wang@enron.com', 'Report Formats', 'Yan, -The merged reports look great. I believe the only orientation changes are to -"unmerge" the following six reports: +The merged reports look great. I believe the only orientation changes are to +"unmerge" the following six reports: 31 Keystone Receipts 15 Questar Pipeline @@ -298,16 +298,16 @@ The orientation of the individual reports should be correct. Thanks. Mat PS. Just a reminder to add the "*" by the title of calculated points.'); -INSERT INTO email([from],[to],subject,body) VALUES('michelle.lokay@enron.com', 'jimboman@bigfoot.com', 'Egyptian Festival', '---------------------- Forwarded by Michelle Lokay/ET&S/Enron on 09/07/2000 +INSERT INTO email([from],[to],subject,body) VALUES('michelle.lokay@enron.com', 'jimboman@bigfoot.com', 'Egyptian Festival', '---------------------- Forwarded by Michelle Lokay/ET&S/Enron on 09/07/2000 10:08 AM --------------------------- "Karkour, Randa" on 09/07/2000 09:01:04 AM -To: "''Agheb (E-mail)" , "Leila Mankarious (E-mail)" -, "''Marymankarious (E-mail)" -, "Michelle lokay (E-mail)" , "Ramy +To: "''Agheb (E-mail)" , "Leila Mankarious (E-mail)" +, "''Marymankarious (E-mail)" +, "Michelle lokay (E-mail)" , "Ramy Mankarious (E-mail)" -cc: +cc: Subject: Egyptian Festival @@ -321,26 +321,26 @@ Subject: Egyptian Festival INSERT INTO email([from],[to],subject,body) VALUES('errol.mclaughlin@enron.com', 'sherry.dawson@enron.com', 'Urgent!!! --- New EAST books', 'This has to be done.................................. Thanks ----------------------- Forwarded by Errol McLaughlin/Corp/Enron on 12/20/2000 +---------------------- Forwarded by Errol McLaughlin/Corp/Enron on 12/20/2000 08:39 AM --------------------------- - - - + + + From: William Kelly @ ECT 12/20/2000 08:31 AM - -To: Kam Keiser/HOU/ECT@ECT, Darron C Giron/HOU/ECT@ECT, David + +To: Kam Keiser/HOU/ECT@ECT, Darron C Giron/HOU/ECT@ECT, David Baumbach/HOU/ECT@ECT, Errol McLaughlin/Corp/Enron@ENRON -cc: Kimat Singla/HOU/ECT@ECT, Kulvinder Fowler/NA/Enron@ENRON, Kyle R -Lilly/HOU/ECT@ECT, Jeff Royed/Corp/Enron@ENRON, Alejandra -Chavez/NA/Enron@ENRON, Crystal Hyde/HOU/ECT@ECT +cc: Kimat Singla/HOU/ECT@ECT, Kulvinder Fowler/NA/Enron@ENRON, Kyle R +Lilly/HOU/ECT@ECT, Jeff Royed/Corp/Enron@ENRON, Alejandra +Chavez/NA/Enron@ENRON, Crystal Hyde/HOU/ECT@ECT Subject: New EAST books -We have new book names in TAGG for our intramonth portfolios and it is -extremely important that any deal booked to the East is communicated quickly -to someone on my team. I know it will take some time for the new names to -sink in and I do not want us to miss any positions or P&L. +We have new book names in TAGG for our intramonth portfolios and it is +extremely important that any deal booked to the East is communicated quickly +to someone on my team. I know it will take some time for the new names to +sink in and I do not want us to miss any positions or P&L. Thanks for your help on this. @@ -348,19 +348,19 @@ New: Scott Neal : East Northeast Dick Jenkins: East Marketeast -WK +WK '); -INSERT INTO email([from],[to],subject,body) VALUES('david.forster@enron.com', 'eol.wide@enron.com', 'Change to Stack Manager', 'Effective immediately, there is a change to the Stack Manager which will +INSERT INTO email([from],[to],subject,body) VALUES('david.forster@enron.com', 'eol.wide@enron.com', 'Change to Stack Manager', 'Effective immediately, there is a change to the Stack Manager which will affect any Inactive Child. -An inactive Child with links to Parent products will not have their +An inactive Child with links to Parent products will not have their calculated prices updated until the Child product is Activated. -When the Child Product is activated, the price will be recalculated and +When the Child Product is activated, the price will be recalculated and updated BEFORE it is displayed on the web. -This means that if you are inputting a basis price on a Child product, you -will not see the final, calculated price until you Activate the product, at +This means that if you are inputting a basis price on a Child product, you +will not see the final, calculated price until you Activate the product, at which time the customer will also see it. If you have any questions, please contact the Help Desk on: @@ -382,7 +382,7 @@ Vince "John H Herbert" on 07/28/2000 08:38:08 AM To: "Vince J Kaminski" -cc: +cc: Subject: Light reading - see pieces beginning on page 7 @@ -412,7 +412,7 @@ fax 713-646-8272 cell 713-539-4760'); INSERT INTO email([from],[to],subject,body) VALUES('eric.bass@enron.com', 'dale.neuner@enron.com', '5 X 24', 'Dale, -Have you heard anything more on the 5 X 24s? We would like to get this +Have you heard anything more on the 5 X 24s? We would like to get this product out ASAP. @@ -420,36 +420,36 @@ Thanks, Eric'); INSERT INTO email([from],[to],subject,body) VALUES('messenger@smartreminders.com', 'm..tholt@enron.com', '10% Coupon - PrintPal Printer Cartridges - 100% Guaranteed', '[IMAGE] -[IMAGE][IMAGE][IMAGE] +[IMAGE][IMAGE][IMAGE] Dear SmartReminders Member, - [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] - - - - - - - - - - - - - - - - - - - - + [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] + + + + + + + + + + + + + + + + + + + + We respect your privacy and are a Certified Participant of the BBBOnLine - Privacy Program. To be removed from future offers,click here. + Privacy Program. To be removed from future offers,click here. SmartReminders.com is a permission based service. To unsubscribe click here . '); -INSERT INTO email([from],[to],subject,body) VALUES('benjamin.rogers@enron.com', 'mark.bernstein@enron.com', '', 'The guy you are talking about left CIN under a "cloud of suspicion" sort of -speak. He was the one who got into several bad deals and PPA''s in California -for CIN, thus he left on a bad note. Let me know if you need more detail +INSERT INTO email([from],[to],subject,body) VALUES('benjamin.rogers@enron.com', 'mark.bernstein@enron.com', '', 'The guy you are talking about left CIN under a "cloud of suspicion" sort of +speak. He was the one who got into several bad deals and PPA''s in California +for CIN, thus he left on a bad note. Let me know if you need more detail than that, I felt this was the type of info you were looking for. Thanks! Ben'); INSERT INTO email([from],[to],subject,body) VALUES('enron_update@concureworkplace.com', 'michelle.cash@enron.com', 'Expense Report Receipts Not Received', 'Employee Name: Michelle Cash @@ -468,7 +468,7 @@ Fax:(415) 782-7854 ----- Forwarded by Susan J Mara/NA/Enron on 06/08/2001 12:24 PM ----- - "Milner, Marcie" 06/08/2001 11:13 AM To: "''smara@enron.com''" cc: Subject: CAISO Emergency Motion + "Milner, Marcie" 06/08/2001 11:13 AM To: "''smara@enron.com''" cc: Subject: CAISO Emergency Motion Sue, did you see this emergency motion the CAISO filed today? Apparently @@ -480,7 +480,7 @@ doing? Marcie -http://www.caiso.com/docs/2001/06/08/200106081005526469.pdf +http://www.caiso.com/docs/2001/06/08/200106081005526469.pdf '); INSERT INTO email([from],[to],subject,body) VALUES('fletcher.sturm@enron.com', 'eloy.escobar@enron.com', 'Re: General Brinks Position Meeting', 'Eloy, @@ -489,27 +489,27 @@ Who is General Brinks? Fletch'); INSERT INTO email([from],[to],subject,body) VALUES('nailia.dindarova@enron.com', 'richard.shapiro@enron.com', 'Documents for Mark Frevert (on EU developments and lessons from', 'Rick, -Here are the documents that Peter has prepared for Mark Frevert. +Here are the documents that Peter has prepared for Mark Frevert. Nailia ----------------------- Forwarded by Nailia Dindarova/LON/ECT on 25/06/2001 +---------------------- Forwarded by Nailia Dindarova/LON/ECT on 25/06/2001 16:36 --------------------------- Nailia Dindarova 25/06/2001 15:36 To: Michael Brown/Enron@EUEnronXGate -cc: Ross Sankey/Enron@EUEnronXGate, Eric Shaw/ENRON@EUEnronXGate, Peter -Styles/LON/ECT@ECT +cc: Ross Sankey/Enron@EUEnronXGate, Eric Shaw/ENRON@EUEnronXGate, Peter +Styles/LON/ECT@ECT -Subject: Documents for Mark Frevert (on EU developments and lessons from +Subject: Documents for Mark Frevert (on EU developments and lessons from California) Michael, -These are the documents that Peter promised to give to you for Mark Frevert. -He has now handed them to him in person but asked me to transmit them +These are the documents that Peter promised to give to you for Mark Frevert. +He has now handed them to him in person but asked me to transmit them electronically to you, as well as Eric and Ross. Nailia @@ -542,30 +542,30 @@ Peggy (See attached file: accenture-dealpoints v2.doc) - accenture-dealpoints v2.doc '); -INSERT INTO email([from],[to],subject,body) VALUES('thomas.martin@enron.com', 'thomas.martin@enron.com', 'Re: Guadalupe Power Partners LP', '---------------------- Forwarded by Thomas A Martin/HOU/ECT on 03/20/2001 +INSERT INTO email([from],[to],subject,body) VALUES('thomas.martin@enron.com', 'thomas.martin@enron.com', 'Re: Guadalupe Power Partners LP', '---------------------- Forwarded by Thomas A Martin/HOU/ECT on 03/20/2001 03:49 PM --------------------------- Thomas A Martin 10/11/2000 03:55 PM To: Patrick Wade/HOU/ECT@ECT -cc: -Subject: Re: Guadalupe Power Partners LP +cc: +Subject: Re: Guadalupe Power Partners LP -The deal is physically served at Oasis Waha or Oasis Katy and is priced at -either HSC, Waha or Katytailgate GD at buyers option three days prior to +The deal is physically served at Oasis Waha or Oasis Katy and is priced at +either HSC, Waha or Katytailgate GD at buyers option three days prior to NYMEX close. '); -INSERT INTO email([from],[to],subject,body) VALUES('judy.townsend@enron.com', 'dan.junek@enron.com, chris.germany@enron.com', 'Columbia Distribution''s Capacity Available for Release - Sum', '---------------------- Forwarded by Judy Townsend/HOU/ECT on 03/09/2001 11:04 +INSERT INTO email([from],[to],subject,body) VALUES('judy.townsend@enron.com', 'dan.junek@enron.com, chris.germany@enron.com', 'Columbia Distribution''s Capacity Available for Release - Sum', '---------------------- Forwarded by Judy Townsend/HOU/ECT on 03/09/2001 11:04 AM --------------------------- agoddard@nisource.com on 03/08/2001 09:16:57 AM -To: " - *Koch, Kent" , " - -*Millar, Debra" , " - *Burke, Lynn" +To: " - *Koch, Kent" , " - +*Millar, Debra" , " - *Burke, Lynn" -cc: " - *Heckathorn, Tom" +cc: " - *Heckathorn, Tom" Subject: Columbia Distribution''s Capacity Available for Release - Sum @@ -586,17 +586,17 @@ Aaron Goddard - 2001Summer.doc '); -INSERT INTO email([from],[to],subject,body) VALUES('rhonda.denton@enron.com', 'tim.belden@enron.com, dana.davis@enron.com, genia.fitzgerald@enron.com,', 'Split Rock Energy LLC', 'We have received the executed EEI contract from this CP dated 12/12/2000. +INSERT INTO email([from],[to],subject,body) VALUES('rhonda.denton@enron.com', 'tim.belden@enron.com, dana.davis@enron.com, genia.fitzgerald@enron.com,', 'Split Rock Energy LLC', 'We have received the executed EEI contract from this CP dated 12/12/2000. Copies will be distributed to Legal and Credit.'); INSERT INTO email([from],[to],subject,body) VALUES('kerrymcelroy@dwt.com', 'jack.speer@alcoa.com, crow@millernash.com, michaelearly@earthlink.net,', 'Oral Argument Request', ' - Oral Argument Request.doc'); -INSERT INTO email([from],[to],subject,body) VALUES('mike.carson@enron.com', 'rlmichaelis@hormel.com', '', 'Did you come in town this wk end..... My new number at our house is : +INSERT INTO email([from],[to],subject,body) VALUES('mike.carson@enron.com', 'rlmichaelis@hormel.com', '', 'Did you come in town this wk end..... My new number at our house is : 713-668-3712...... my cell # is 281-381-7332 the kid'); INSERT INTO email([from],[to],subject,body) VALUES('cooper.richey@enron.com', 'trycooper@hotmail.com', 'FW: Contact Info', ' -----Original Message----- -From: Punja, Karim +From: Punja, Karim Sent: Thursday, December 13, 2001 2:35 PM To: Richey, Cooper Subject: Contact Info @@ -610,7 +610,7 @@ I hope we can stay in touch. Home# 234-0249 email: kpunja@hotmail.com -Take Care, +Take Care, Karim. '); @@ -634,44 +634,44 @@ San Antonio, Texas May 2-4, 2001 Westin Riverwalk See attached memo for more details!! -? Registration for the law conference this year will be handled through an -Online RSVP Form on the Enron Law Conference Website at -http://lawconference.corp.enron.com. The website is still under construction -and will not be available until Thursday, March 15, 2001. +? Registration for the law conference this year will be handled through an +Online RSVP Form on the Enron Law Conference Website at +http://lawconference.corp.enron.com. The website is still under construction +and will not be available until Thursday, March 15, 2001. -? We will send you another e-mail to confirm when the Law Conference Website -is operational. +? We will send you another e-mail to confirm when the Law Conference Website +is operational. -? Please complete the Online RSVP Form as soon as it is available and submit -it no later than Friday, March 30th. +? Please complete the Online RSVP Form as soon as it is available and submit +it no later than Friday, March 30th. '); -INSERT INTO email([from],[to],subject,body) VALUES('tori.kuykendall@enron.com', 'heath.b.taylor@accenture.com', 'Re:', 'hey - thats funny about john - he definitely remembers him - i''ll call pat -and let him know - we are coming on saturday - i just havent had a chance to -call you guys back -- looking forward to it -- i probably need the +INSERT INTO email([from],[to],subject,body) VALUES('tori.kuykendall@enron.com', 'heath.b.taylor@accenture.com', 'Re:', 'hey - thats funny about john - he definitely remembers him - i''ll call pat +and let him know - we are coming on saturday - i just havent had a chance to +call you guys back -- looking forward to it -- i probably need the directions again though'); INSERT INTO email([from],[to],subject,body) VALUES('darron.giron@enron.com', 'bryce.baxter@enron.com', 'Re: Feedback for Audrey Cook', 'Bryce, -I''ll get it done today. +I''ll get it done today. DG 3-9573 - - - + + + From: Bryce Baxter 06/12/2000 07:15 PM - + To: Darron C Giron/HOU/ECT@ECT -cc: +cc: Subject: Feedback for Audrey Cook -You were identified as a reviewer for Audrey Cook. If possible, could you -complete her feedback by end of business Wednesday? It will really help me +You were identified as a reviewer for Audrey Cook. If possible, could you +complete her feedback by end of business Wednesday? It will really help me in the PRC process to have your input. Thanks. '); @@ -697,7 +697,7 @@ INSERT INTO email([from],[to],subject,body) VALUES('darrell.schoolcraft@enron.co ds - + '); INSERT INTO email([from],[to],subject,body) VALUES('mcominsky@aol.com', 'cpatman@bracepatt.com, james_derrick@enron.com', 'Jurisprudence Luncheon', 'Carrin & Jim -- @@ -721,8 +721,8 @@ Anti-Defamation League 713/627-3490, ext. 122 713/627-2011 (fax) MCominsky@aol.com'); -INSERT INTO email([from],[to],subject,body) VALUES('phillip.love@enron.com', 'todagost@utmb.edu, gbsonnta@utmb.edu', 'New President', 'I had a little bird put a word in my ear. Is there any possibility for Ben -Raimer to be Bush''s secretary of HHS? Just curious about that infamous UTMB +INSERT INTO email([from],[to],subject,body) VALUES('phillip.love@enron.com', 'todagost@utmb.edu, gbsonnta@utmb.edu', 'New President', 'I had a little bird put a word in my ear. Is there any possibility for Ben +Raimer to be Bush''s secretary of HHS? Just curious about that infamous UTMB rumor mill. Hope things are well, happy holidays. PL'); INSERT INTO email([from],[to],subject,body) VALUES('marie.heard@enron.com', 'ehamilton@fna.com', 'ISDA Master Agreement', 'Erin: @@ -741,7 +741,7 @@ marie.heard@enron.com '); INSERT INTO email([from],[to],subject,body) VALUES('andrea.ring@enron.com', 'beverly.beaty@enron.com', 'Re: Tennessee Buy - Louis Dreyfus', 'Beverly - once again thanks so much for your help on this. - + '); INSERT INTO email([from],[to],subject,body) VALUES('karolyn.criado@enron.com', 'j..bonin@enron.com, felicia.case@enron.com, b..clapp@enron.com,', 'Price List week of Oct. 8-9, 2001', ' @@ -752,7 +752,7 @@ Karolyn Criado 3-9441 - + '); INSERT INTO email([from],[to],subject,body) VALUES('kevin.presto@enron.com', 'edward.baughman@enron.com, billy.braddock@enron.com', 'Associated', 'Please begin working on filling our Associated short position in 02. I would like to take this risk off the books. @@ -762,9 +762,9 @@ In addition, please find out what a buy-out of VEPCO would cost us. With Roger We also need to continue to explore a JEA buy-out. Thanks.'); -INSERT INTO email([from],[to],subject,body) VALUES('stacy.dickson@enron.com', 'gregg.penman@enron.com', 'RE: Constellation TC 5-7-01', 'Gregg, +INSERT INTO email([from],[to],subject,body) VALUES('stacy.dickson@enron.com', 'gregg.penman@enron.com', 'RE: Constellation TC 5-7-01', 'Gregg, -I am at home with a sick baby. (Lots of fun!) I will call you about this +I am at home with a sick baby. (Lots of fun!) I will call you about this tomorrow. Stacy'); @@ -774,18 +774,18 @@ INSERT INTO email([from],[to],subject,body) VALUES('joe.quenet@enron.com', 'dfin INSERT INTO email([from],[to],subject,body) VALUES('k..allen@enron.com', 'jacqestc@aol.com', '', 'Jacques, I sent you a fax of Kevin Kolb''s comments on the release. The payoff on the note would be $36,248 ($36090(principal) + $158 (accrued interest)). -This is assuming we wrap this up on Tuesday. +This is assuming we wrap this up on Tuesday. Please email to confirm that their changes are ok so I can set up a meeting on Tuesday to reach closure. Phillip'); INSERT INTO email([from],[to],subject,body) VALUES('kourtney.nelson@enron.com', 'mike.swerzbin@enron.com', 'Adjusted L/R Balance', 'Mike, -I placed the adjusted L/R Balance on the Enronwest site. It is under the "Staff/Kourtney Nelson". There are two links: +I placed the adjusted L/R Balance on the Enronwest site. It is under the "Staff/Kourtney Nelson". There are two links: -1) "Adj L_R" is the same data/format from the weekly strategy meeting. +1) "Adj L_R" is the same data/format from the weekly strategy meeting. 2) "New Gen 2001_2002" link has all of the supply side info that is used to calculate the L/R balance - -Please note the Data Flag column, a value of "3" indicates the project was cancelled, on hold, etc and is not included in the calc. + -Please note the Data Flag column, a value of "3" indicates the project was cancelled, on hold, etc and is not included in the calc. Both of these sheets are interactive Excel spreadsheets and thus you can play around with the data as you please. Also, James Bruce is working to get his gen report on the web. That will help with your access to information on new gen. @@ -796,14 +796,14 @@ Kourtney Kourtney Nelson -Fundamental Analysis +Fundamental Analysis Enron North America (503) 464-8280 kourtney.nelson@enron.com'); INSERT INTO email([from],[to],subject,body) VALUES('d..thomas@enron.com', 'naveed.ahmed@enron.com', 'FW: Current Enron TCC Portfolio', ' -----Original Message----- -From: Grace, Rebecca M. +From: Grace, Rebecca M. Sent: Monday, December 17, 2001 9:44 AM To: Thomas, Paul D. Cc: Cashion, Jim; Allen, Thresa A.; May, Tom @@ -821,19 +821,19 @@ Rebecca -----Original Message----- -From: Thomas, Paul D. +From: Thomas, Paul D. Sent: Monday, December 17, 2001 9:08 AM To: Grace, Rebecca M. Subject: FW: Current Enron TCC Portfolio - << File: enrontccs.xls >> + << File: enrontccs.xls >> Rebecca, Let me know if you see any differences. Paul X 3-0403 -----Original Message----- -From: Thomas, Paul D. +From: Thomas, Paul D. Sent: Monday, December 17, 2001 9:04 AM To: Ahmed, Naveed Subject: FW: Current Enron TCC Portfolio @@ -842,32 +842,32 @@ Subject: FW: Current Enron TCC Portfolio -----Original Message----- -From: Thomas, Paul D. +From: Thomas, Paul D. Sent: Thursday, December 13, 2001 10:01 AM To: Baughman, Edward D. Subject: Current Enron TCC Portfolio '); -INSERT INTO email([from],[to],subject,body) VALUES('stephanie.panus@enron.com', 'william.bradford@enron.com, debbie.brackett@enron.com,', 'Coastal Merchant Energy/El Paso Merchant Energy', 'Coastal Merchant Energy, L.P. merged with and into El Paso Merchant Energy, -L.P., effective February 1, 2001, with the surviving entity being El Paso -Merchant Energy, L.P. We currently have ISDA Master Agreements with both -counterparties. Please see the attached memo regarding the existing Masters +INSERT INTO email([from],[to],subject,body) VALUES('stephanie.panus@enron.com', 'william.bradford@enron.com, debbie.brackett@enron.com,', 'Coastal Merchant Energy/El Paso Merchant Energy', 'Coastal Merchant Energy, L.P. merged with and into El Paso Merchant Energy, +L.P., effective February 1, 2001, with the surviving entity being El Paso +Merchant Energy, L.P. We currently have ISDA Master Agreements with both +counterparties. Please see the attached memo regarding the existing Masters and let us know which agreement should be terminated. Thanks, Stephanie '); -INSERT INTO email([from],[to],subject,body) VALUES('kam.keiser@enron.com', 'c..kenne@enron.com', 'RE: What about this too???', ' +INSERT INTO email([from],[to],subject,body) VALUES('kam.keiser@enron.com', 'c..kenne@enron.com', 'RE: What about this too???', ' -----Original Message----- -From: Kenne, Dawn C. +From: Kenne, Dawn C. Sent: Wednesday, February 06, 2002 11:50 AM To: Keiser, Kam Subject: What about this too??? - << File: Netco Trader Matrix.xls >> + << File: Netco Trader Matrix.xls >> '); INSERT INTO email([from],[to],subject,body) VALUES('chris.meyer@enron.com', 'joe.parks@enron.com', 'Centana', 'Talked to Chip. We do need Cash Committe approval given the netting feature of your deal, which means Batch Funding Request. Please update per my previous e-mail and forward. @@ -903,7 +903,7 @@ We got a request for guest access through MG. The company is called Escondida and is a subsidiary of BHP Australia. Please advise if I can set up a guest account or not. -F.Y.I.: MG is planning to put a "in w/h Chile" contract for Copper on-line as +F.Y.I.: MG is planning to put a "in w/h Chile" contract for Copper on-line as soon as Enron has done the due diligence for this country. Thanks ! @@ -948,10 +948,10 @@ Please refer to the Worldwide Customer Support card for a complete technical sup INSERT INTO email([from],[to],subject,body) VALUES('geoff.storey@enron.com', 'dutch.quigley@enron.com', 'RE:', 'duke contact? -----Original Message----- -From: Quigley, Dutch +From: Quigley, Dutch Sent: Wednesday, October 31, 2001 10:14 AM To: Storey, Geoff -Subject: RE: +Subject: RE: bp corp Albert LaMore 281-366-4962 @@ -959,30 +959,30 @@ running the reports now -----Original Message----- -From: Storey, Geoff +From: Storey, Geoff Sent: Wednesday, October 31, 2001 10:10 AM To: Quigley, Dutch -Subject: RE: +Subject: RE: give me a contact over there too BP -----Original Message----- -From: Quigley, Dutch +From: Quigley, Dutch Sent: Wednesday, October 31, 2001 9:42 AM To: Storey, Geoff -Subject: +Subject: Coral Jeff Whitnah 713-767-5374 Relaint Steve McGinn 713-207-4000'); -INSERT INTO email([from],[to],subject,body) VALUES('pete.davis@enron.com', 'pete.davis@enron.com', 'Start Date: 4/22/01; HourAhead hour: 3; ', 'Start Date: 4/22/01; HourAhead hour: 3; No ancillary schedules awarded. +INSERT INTO email([from],[to],subject,body) VALUES('pete.davis@enron.com', 'pete.davis@enron.com', 'Start Date: 4/22/01; HourAhead hour: 3; ', 'Start Date: 4/22/01; HourAhead hour: 3; No ancillary schedules awarded. Variances detected. Variances detected in Load schedule. LOG MESSAGES: -PARSING FILE -->> O:\Portland\WestDesk\California Scheduling\ISO Final +PARSING FILE -->> O:\Portland\WestDesk\California Scheduling\ISO Final Schedules\2001042203.txt ---- Load Schedule ---- @@ -995,12 +995,12 @@ $$$ Variance found in table tblLoads. SC_ID: EPMI '); -INSERT INTO email([from],[to],subject,body) VALUES('john.postlethwaite@enron.com', 'john.zufferli@enron.com', 'Reference', 'John, hope things are going well up there for you. The big day is almost here for you and Jessica. I was wondering if I could use your name as a job reference if need be. I am just trying to get everything in order just in case something happens. +INSERT INTO email([from],[to],subject,body) VALUES('john.postlethwaite@enron.com', 'john.zufferli@enron.com', 'Reference', 'John, hope things are going well up there for you. The big day is almost here for you and Jessica. I was wondering if I could use your name as a job reference if need be. I am just trying to get everything in order just in case something happens. John'); -INSERT INTO email([from],[to],subject,body) VALUES('jeffrey.shankman@enron.com', 'lschiffm@jonesday.com', 'Re:', 'I saw you called on the cell this a.m. Sorry I missed you. (I was in the -shower). I have had a shitty week--I suspect my silence (not only to you, -but others) after our phone call is a result of the week. I''m seeing Glen at +INSERT INTO email([from],[to],subject,body) VALUES('jeffrey.shankman@enron.com', 'lschiffm@jonesday.com', 'Re:', 'I saw you called on the cell this a.m. Sorry I missed you. (I was in the +shower). I have had a shitty week--I suspect my silence (not only to you, +but others) after our phone call is a result of the week. I''m seeing Glen at 11:15....talk to you'); INSERT INTO email([from],[to],subject,body) VALUES('litebytz@enron.com', '', 'Lite Bytz RSVP', ' This week''s Lite Bytz presentation will feature the following TOOLZ speaker: @@ -1131,8 +1131,8 @@ do_test fts1c-4.2 { SELECT snippet(email) FROM email WHERE email MATCH 'christmas candlelight' } -} {{... place.? What do you think about going here Christmas -eve?? They have an 11:00 a.m. service and a candlelight service at 5:00 p.m., +} {{... place.? What do you think about going here Christmas +eve?? They have an 11:00 a.m. service and a candlelight service at 5:00 p.m., among others. ...}} do_test fts1c-4.3 { @@ -1162,7 +1162,7 @@ do_test fts1c-4.6 { SELECT snippet(email) FROM email WHERE email MATCH 'chris is here' } -} {{chris.germany@enron.com ... Sounds good to me. I bet this is next to the Warick?? Hotel. ... place.? What do you think about going here Christmas +} {{chris.germany@enron.com ... Sounds good to me. I bet this is next to the Warick?? Hotel. ... place.? What do you think about going here Christmas eve?? They have an 11:00 a.m. ...}} do_test fts1c-4.7 { execsql { @@ -1177,7 +1177,7 @@ do_test fts1c-4.8 { SELECT snippet(email) FROM email WHERE email MATCH 'ancillary load davis' } -} {{pete.davis@enron.com ... Start Date: 4/22/01; HourAhead hour: 3; No ancillary schedules awarded. +} {{pete.davis@enron.com ... Start Date: 4/22/01; HourAhead hour: 3; No ancillary schedules awarded. Variances detected. Variances detected in Load schedule. @@ -1192,7 +1192,7 @@ do_test fts1c-5.1 { SELECT snippet(email) FROM email WHERE email MATCH 'questar enron OR com' } -} {{matt.smith@enron.com ... six reports: +} {{matt.smith@enron.com ... six reports: 31 Keystone Receipts 15 Questar Pipeline @@ -1203,7 +1203,7 @@ do_test fts1c-5.2 { SELECT snippet(email) FROM email WHERE email MATCH 'enron OR com questar' } -} {{matt.smith@enron.com ... six reports: +} {{matt.smith@enron.com ... six reports: 31 Keystone Receipts 15 Questar Pipeline diff --git a/third_party/sqlite/src/test/fts1d.test b/third_party/sqlite/src/test/fts1d.test index ea2303489ce10..fe3ac732beea9 100644 --- a/third_party/sqlite/src/test/fts1d.test +++ b/third_party/sqlite/src/test/fts1d.test @@ -38,7 +38,7 @@ do_test fts1d-1.2 { } {{running and jumping}} do_test fts1d-1.3 { execsql { - INSERT INTO t1(rowid, content) + INSERT INTO t1(rowid, content) VALUES(2, 'abcdefghijklmnopqrstuvwyxz'); SELECT rowid, snippet(t1) FROM t1 WHERE t1 MATCH 'abcdefghijqrstuvwyxz' } @@ -50,7 +50,7 @@ do_test fts1d-1.4 { } {2 abcdefghijklmnopqrstuvwyxz} do_test fts1d-1.5 { execsql { - INSERT INTO t1(rowid, content) + INSERT INTO t1(rowid, content) VALUES(3, 'The value is 123456789'); SELECT rowid, snippet(t1) FROM t1 WHERE t1 MATCH '123789' } diff --git a/third_party/sqlite/src/test/fts1o.test b/third_party/sqlite/src/test/fts1o.test index 61fd74ca0efc4..780f00c9ccc6c 100644 --- a/third_party/sqlite/src/test/fts1o.test +++ b/third_party/sqlite/src/test/fts1o.test @@ -92,7 +92,7 @@ do_test fts1o-3.6 { } {{one three four} {one four} {one four two}} #--------------------------------------------------------------------- -# Test that it is possible to rename an fts1 table in an attached +# Test that it is possible to rename an fts1 table in an attached # database. # forcedelete test2.db test2.db-journal diff --git a/third_party/sqlite/src/test/fts1porter.test b/third_party/sqlite/src/test/fts1porter.test index 0ca87a01edfa4..76ec001692796 100644 --- a/third_party/sqlite/src/test/fts1porter.test +++ b/third_party/sqlite/src/test/fts1porter.test @@ -23566,7 +23566,7 @@ set porter_test_data { zone zone zounds zound zwagger zwagger -} +} # Create a full-text index to use for testing the stemmer. # diff --git a/third_party/sqlite/src/test/fts2b.test b/third_party/sqlite/src/test/fts2b.test index 169cd8a0a3d42..926dc1aa55cd0 100644 --- a/third_party/sqlite/src/test/fts2b.test +++ b/third_party/sqlite/src/test/fts2b.test @@ -33,7 +33,7 @@ proc fill_multilanguage_fulltext_t1 {} { set english {one two three four five} set spanish {un dos tres cuatro cinco} set german {eine zwei drei vier funf} - + for {set i 1} {$i<=31} {incr i} { set cmd "INSERT INTO t1 VALUES" set vset {} diff --git a/third_party/sqlite/src/test/fts2c.test b/third_party/sqlite/src/test/fts2c.test index cc6c9bbb5dcc2..b3d7895d99021 100644 --- a/third_party/sqlite/src/test/fts2c.test +++ b/third_party/sqlite/src/test/fts2c.test @@ -33,7 +33,7 @@ do_test fts2c-1.1 { BEGIN TRANSACTION; INSERT INTO email([from],[to],subject,body) VALUES('savita.puthigai@enron.com', 'traders.eol@enron.com, traders.eol@enron.com', 'EnronOnline- Change to Autohedge', 'Effective Monday, October 22, 2001 the following changes will be made to the Autohedge functionality on EnronOnline. -The volume on the hedge will now respect the minimum volume and volume increment settings on the parent product. See rules below: +The volume on the hedge will now respect the minimum volume and volume increment settings on the parent product. See rules below: ? If the transaction volume on the child is less than half of the parent''s minimum volume no hedge will occur. ? If the transaction volume on the child is more than half the parent''s minimum volume but less than half the volume increment on the parent, the hedge will volume will be the parent''s minimum volume. @@ -49,9 +49,9 @@ Volume on Autohedge transaction Volume Hedged 1 - 2499 0 2500 - 5499 5000 5500 - 6499 6000'); -INSERT INTO email([from],[to],subject,body) VALUES('dana.davis@enron.com', 'laynie.east@enron.com, lisa.king@enron.com, lisa.best@enron.com,', 'Leaving Early', 'FYI: -If it''s ok with everyone''s needs, I would like to leave @4pm. If you think -you will need my assistance past the 4 o''clock hour just let me know; I''ll +INSERT INTO email([from],[to],subject,body) VALUES('dana.davis@enron.com', 'laynie.east@enron.com, lisa.king@enron.com, lisa.best@enron.com,', 'Leaving Early', 'FYI: +If it''s ok with everyone''s needs, I would like to leave @4pm. If you think +you will need my assistance past the 4 o''clock hour just let me know; I''ll be more than willing to stay.'); INSERT INTO email([from],[to],subject,body) VALUES('enron_update@concureworkplace.com', 'louise.kitchen@enron.com', '<> - CC02.06.02', 'The following expense report is ready for approval: @@ -70,17 +70,17 @@ Could you print off the current work request report by 1:30 today? Gentlemen, -I''d like to review this today at 1:30 in our office. Also, could you provide +I''d like to review this today at 1:30 in our office. Also, could you provide me with your activity reports so I can have Julie enter this information. JD'); -INSERT INTO email([from],[to],subject,body) VALUES('v.weldon@enron.com', 'gary.l.carrier@usa.dupont.com, scott.joyce@bankofamerica.com', 'Enron News', 'This could turn into something big.... +INSERT INTO email([from],[to],subject,body) VALUES('v.weldon@enron.com', 'gary.l.carrier@usa.dupont.com, scott.joyce@bankofamerica.com', 'Enron News', 'This could turn into something big.... http://biz.yahoo.com/rf/010129/n29305829.html'); INSERT INTO email([from],[to],subject,body) VALUES('mark.haedicke@enron.com', 'paul.simons@enron.com', 'Re: First Polish Deal!', 'Congrats! Things seem to be building rapidly now on the Continent. Mark'); INSERT INTO email([from],[to],subject,body) VALUES('e..carter@enron.com', 't..robinson@enron.com', 'FW: Producers Newsletter 9-24-2001', ' The producer lumber pricing sheet. -----Original Message----- -From: Johnson, Jay +From: Johnson, Jay Sent: Tuesday, October 16, 2001 3:42 PM To: Carter, Karen E. Subject: FW: Producers Newsletter 9-24-2001 @@ -88,14 +88,14 @@ Subject: FW: Producers Newsletter 9-24-2001 -----Original Message----- -From: Daigre, Sergai +From: Daigre, Sergai Sent: Friday, September 21, 2001 8:33 PM Subject: Producers Newsletter 9-24-2001 '); -INSERT INTO email([from],[to],subject,body) VALUES('david.delainey@enron.com', 'kenneth.lay@enron.com', 'Greater Houston Partnership', 'Ken, in response to the letter from Mr Miguel San Juan, my suggestion would -be to offer up the Falcon for their use; however, given the tight time frame -and your recent visit with Mr. Fox that it would be difficult for either you +INSERT INTO email([from],[to],subject,body) VALUES('david.delainey@enron.com', 'kenneth.lay@enron.com', 'Greater Houston Partnership', 'Ken, in response to the letter from Mr Miguel San Juan, my suggestion would +be to offer up the Falcon for their use; however, given the tight time frame +and your recent visit with Mr. Fox that it would be difficult for either you or me to participate. I spoke to Max and he agrees with this approach. @@ -117,7 +117,7 @@ lachandra.fenceroy@enron.com 877.498.3401 Pager -----Original Message----- -From: Bisbee, Joanne +From: Bisbee, Joanne Sent: Wednesday, September 26, 2001 7:50 AM To: Fenceroy, LaChandra Subject: FW: Bus Applications Meeting Follow Up @@ -125,7 +125,7 @@ Subject: FW: Bus Applications Meeting Follow Up Lachandra, Please get with David Duff today and see what this is about. Who are our TW accounting business users? -----Original Message----- -From: Koh, Wendy +From: Koh, Wendy Sent: Tuesday, September 25, 2001 2:41 PM To: Bisbee, Joanne Subject: Bus Applications Meeting Follow Up @@ -138,7 +138,7 @@ INSERT INTO email([from],[to],subject,body) VALUES('danny.mccarty@enron.com', 'f Dan -----Original Message----- -From: Fagan, Fran +From: Fagan, Fran Sent: Thursday, December 20, 2001 11:10 AM To: McCarty, Danny Subject: worksheets @@ -152,7 +152,7 @@ Sr. HR Rep 713.853.5219 - << File: McCartyMerit.xls >> << File: mccartyBonusCommercial_UnP.xls >> + << File: McCartyMerit.xls >> << File: mccartyBonusCommercial_UnP.xls >> '); INSERT INTO email([from],[to],subject,body) VALUES('bert.meyers@enron.com', 'shift.dl-portland@enron.com', 'OCTOBER SCHEDULE', 'TEAM, @@ -164,7 +164,7 @@ INSERT INTO email([from],[to],subject,body) VALUES('errol.mclaughlin@enron.com', INSERT INTO email([from],[to],subject,body) VALUES('patrice.mims@enron.com', 'calvin.eakins@enron.com', 'Re: Small business supply assistance', 'Hi Calvin -I spoke with Rickey (boy, is he long-winded!!). Gave him the name of our +I spoke with Rickey (boy, is he long-winded!!). Gave him the name of our credit guy, Russell Diamond. Thank for your help!'); @@ -176,17 +176,17 @@ Here is the information on staffing and outside services. Call if you need anyt Jim '); -INSERT INTO email([from],[to],subject,body) VALUES('gelliott@industrialinfo.com', 'pcopello@industrialinfo.com', 'ECAAR (Gavin), WSCC (Diablo Canyon), & NPCC (Seabrook)', 'Dear Power Outage Database Customer, -Attached you will find an excel document. The outages contained within are forced or rescheduled outages. Your daily delivery will still contain these outages. -In addition to the two excel documents, there is a dbf file that is formatted like your daily deliveries you receive nightly. This will enable you to load the data into your regular database. Any questions please let me know. Thanks. -Greg Elliott -IIR, Inc. -713-783-5147 x 3481 -outages@industrialinfo.com -THE INFORMATION CONTAINED IN THIS E-MAIL IS LEGALLY PRIVILEGED AND CONFIDENTIAL INFORMATION INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY NAMED ABOVE. YOU ARE HEREBY NOTIFIED THAT ANY DISSEMINATION, DISTRIBUTION, OR COPY OF THIS E-MAIL TO UNAUTHORIZED ENTITIES IS STRICTLY PROHIBITED. IF YOU HAVE RECEIVED THIS +INSERT INTO email([from],[to],subject,body) VALUES('gelliott@industrialinfo.com', 'pcopello@industrialinfo.com', 'ECAAR (Gavin), WSCC (Diablo Canyon), & NPCC (Seabrook)', 'Dear Power Outage Database Customer, +Attached you will find an excel document. The outages contained within are forced or rescheduled outages. Your daily delivery will still contain these outages. +In addition to the two excel documents, there is a dbf file that is formatted like your daily deliveries you receive nightly. This will enable you to load the data into your regular database. Any questions please let me know. Thanks. +Greg Elliott +IIR, Inc. +713-783-5147 x 3481 +outages@industrialinfo.com +THE INFORMATION CONTAINED IN THIS E-MAIL IS LEGALLY PRIVILEGED AND CONFIDENTIAL INFORMATION INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY NAMED ABOVE. YOU ARE HEREBY NOTIFIED THAT ANY DISSEMINATION, DISTRIBUTION, OR COPY OF THIS E-MAIL TO UNAUTHORIZED ENTITIES IS STRICTLY PROHIBITED. IF YOU HAVE RECEIVED THIS E-MAIL IN ERROR, PLEASE DELETE IT. - - OUTAGE.dbf - - 111201R.xls + - OUTAGE.dbf + - 111201R.xls - 111201.xls '); INSERT INTO email([from],[to],subject,body) VALUES('enron.announcements@enron.com', 'all_ena_egm_eim@enron.com', 'EWS Brown Bag', 'MARK YOUR LUNCH CALENDARS NOW ! @@ -210,35 +210,35 @@ INSERT INTO email([from],[to],subject,body) VALUES('chris.germany@enron.com', 'i "Immer, Ingrid" on 12/21/2000 11:48:47 AM To: "''chris.germany@enron.com''" -cc: +cc: Subject: About St Pauls - <> -? -?http://www.stpaulshouston.org/about.html + <> +? +?http://www.stpaulshouston.org/about.html -Chris, +Chris, -I like the looks of this place.? What do you think about going here Christmas -eve?? They have an 11:00 a.m. service and a candlelight service at 5:00 p.m., +I like the looks of this place.? What do you think about going here Christmas +eve?? They have an 11:00 a.m. service and a candlelight service at 5:00 p.m., among others. -Let me know.?? ii +Let me know.?? ii - About St Pauls.url '); INSERT INTO email([from],[to],subject,body) VALUES('nas@cpuc.ca.gov', 'skatz@sempratrading.com, kmccrea@sablaw.com, thompson@wrightlaw.com,', 'Reply Brief filed July 31, 2000', ' - CPUC01-#76371-v1-Revised_Reply_Brief__Due_today_7_31_.doc'); INSERT INTO email([from],[to],subject,body) VALUES('gascontrol@aglresources.com', 'dscott4@enron.com, lcampbel@enron.com', 'Alert Posted 10:00 AM November 20,2000: E-GAS Request Reminder', 'Alert Posted 10:00 AM November 20,2000: E-GAS Request Reminder -As discussed in the Winter Operations Meeting on Sept.29,2000, -E-Gas(Emergency Gas) will not be offered this winter as a service from AGLC. -Marketers and Poolers can receive gas via Peaking and IBSS nominations(daisy +As discussed in the Winter Operations Meeting on Sept.29,2000, +E-Gas(Emergency Gas) will not be offered this winter as a service from AGLC. +Marketers and Poolers can receive gas via Peaking and IBSS nominations(daisy chain) from other marketers up to the 6 p.m. Same Day 2 nomination cycle. '); -INSERT INTO email([from],[to],subject,body) VALUES('dutch.quigley@enron.com', 'rwolkwitz@powermerchants.com', '', ' +INSERT INTO email([from],[to],subject,body) VALUES('dutch.quigley@enron.com', 'rwolkwitz@powermerchants.com', '', ' Here is a goody for you'); INSERT INTO email([from],[to],subject,body) VALUES('ryan.o''rourke@enron.com', 'k..allen@enron.com, randy.bhatia@enron.com, frank.ermis@enron.com,', 'TRV Notification: (West VaR - 11/07/2001)', 'The report named: West VaR , published as of 11/07/2001 is now available for viewing on the website.'); @@ -268,23 +268,23 @@ adam -----Original Message----- -From: Royed, Jeff +From: Royed, Jeff Sent: Tuesday, September 25, 2001 11:37 AM To: Bayer, Adam Subject: Curve Fetch File Let me know if it works. It may be required to have a certain version of Oracle for it to work properly. - + Jeff Royed -Enron +Enron Energy Operations Phone: 713-853-5295'); INSERT INTO email([from],[to],subject,body) VALUES('matt.smith@enron.com', 'yan.wang@enron.com', 'Report Formats', 'Yan, -The merged reports look great. I believe the only orientation changes are to -"unmerge" the following six reports: +The merged reports look great. I believe the only orientation changes are to +"unmerge" the following six reports: 31 Keystone Receipts 15 Questar Pipeline @@ -298,16 +298,16 @@ The orientation of the individual reports should be correct. Thanks. Mat PS. Just a reminder to add the "*" by the title of calculated points.'); -INSERT INTO email([from],[to],subject,body) VALUES('michelle.lokay@enron.com', 'jimboman@bigfoot.com', 'Egyptian Festival', '---------------------- Forwarded by Michelle Lokay/ET&S/Enron on 09/07/2000 +INSERT INTO email([from],[to],subject,body) VALUES('michelle.lokay@enron.com', 'jimboman@bigfoot.com', 'Egyptian Festival', '---------------------- Forwarded by Michelle Lokay/ET&S/Enron on 09/07/2000 10:08 AM --------------------------- "Karkour, Randa" on 09/07/2000 09:01:04 AM -To: "''Agheb (E-mail)" , "Leila Mankarious (E-mail)" -, "''Marymankarious (E-mail)" -, "Michelle lokay (E-mail)" , "Ramy +To: "''Agheb (E-mail)" , "Leila Mankarious (E-mail)" +, "''Marymankarious (E-mail)" +, "Michelle lokay (E-mail)" , "Ramy Mankarious (E-mail)" -cc: +cc: Subject: Egyptian Festival @@ -321,26 +321,26 @@ Subject: Egyptian Festival INSERT INTO email([from],[to],subject,body) VALUES('errol.mclaughlin@enron.com', 'sherry.dawson@enron.com', 'Urgent!!! --- New EAST books', 'This has to be done.................................. Thanks ----------------------- Forwarded by Errol McLaughlin/Corp/Enron on 12/20/2000 +---------------------- Forwarded by Errol McLaughlin/Corp/Enron on 12/20/2000 08:39 AM --------------------------- - - - + + + From: William Kelly @ ECT 12/20/2000 08:31 AM - -To: Kam Keiser/HOU/ECT@ECT, Darron C Giron/HOU/ECT@ECT, David + +To: Kam Keiser/HOU/ECT@ECT, Darron C Giron/HOU/ECT@ECT, David Baumbach/HOU/ECT@ECT, Errol McLaughlin/Corp/Enron@ENRON -cc: Kimat Singla/HOU/ECT@ECT, Kulvinder Fowler/NA/Enron@ENRON, Kyle R -Lilly/HOU/ECT@ECT, Jeff Royed/Corp/Enron@ENRON, Alejandra -Chavez/NA/Enron@ENRON, Crystal Hyde/HOU/ECT@ECT +cc: Kimat Singla/HOU/ECT@ECT, Kulvinder Fowler/NA/Enron@ENRON, Kyle R +Lilly/HOU/ECT@ECT, Jeff Royed/Corp/Enron@ENRON, Alejandra +Chavez/NA/Enron@ENRON, Crystal Hyde/HOU/ECT@ECT Subject: New EAST books -We have new book names in TAGG for our intramonth portfolios and it is -extremely important that any deal booked to the East is communicated quickly -to someone on my team. I know it will take some time for the new names to -sink in and I do not want us to miss any positions or P&L. +We have new book names in TAGG for our intramonth portfolios and it is +extremely important that any deal booked to the East is communicated quickly +to someone on my team. I know it will take some time for the new names to +sink in and I do not want us to miss any positions or P&L. Thanks for your help on this. @@ -348,19 +348,19 @@ New: Scott Neal : East Northeast Dick Jenkins: East Marketeast -WK +WK '); -INSERT INTO email([from],[to],subject,body) VALUES('david.forster@enron.com', 'eol.wide@enron.com', 'Change to Stack Manager', 'Effective immediately, there is a change to the Stack Manager which will +INSERT INTO email([from],[to],subject,body) VALUES('david.forster@enron.com', 'eol.wide@enron.com', 'Change to Stack Manager', 'Effective immediately, there is a change to the Stack Manager which will affect any Inactive Child. -An inactive Child with links to Parent products will not have their +An inactive Child with links to Parent products will not have their calculated prices updated until the Child product is Activated. -When the Child Product is activated, the price will be recalculated and +When the Child Product is activated, the price will be recalculated and updated BEFORE it is displayed on the web. -This means that if you are inputting a basis price on a Child product, you -will not see the final, calculated price until you Activate the product, at +This means that if you are inputting a basis price on a Child product, you +will not see the final, calculated price until you Activate the product, at which time the customer will also see it. If you have any questions, please contact the Help Desk on: @@ -382,7 +382,7 @@ Vince "John H Herbert" on 07/28/2000 08:38:08 AM To: "Vince J Kaminski" -cc: +cc: Subject: Light reading - see pieces beginning on page 7 @@ -412,7 +412,7 @@ fax 713-646-8272 cell 713-539-4760'); INSERT INTO email([from],[to],subject,body) VALUES('eric.bass@enron.com', 'dale.neuner@enron.com', '5 X 24', 'Dale, -Have you heard anything more on the 5 X 24s? We would like to get this +Have you heard anything more on the 5 X 24s? We would like to get this product out ASAP. @@ -420,36 +420,36 @@ Thanks, Eric'); INSERT INTO email([from],[to],subject,body) VALUES('messenger@smartreminders.com', 'm..tholt@enron.com', '10% Coupon - PrintPal Printer Cartridges - 100% Guaranteed', '[IMAGE] -[IMAGE][IMAGE][IMAGE] +[IMAGE][IMAGE][IMAGE] Dear SmartReminders Member, - [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] - - - - - - - - - - - - - - - - - - - - + [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] + + + + + + + + + + + + + + + + + + + + We respect your privacy and are a Certified Participant of the BBBOnLine - Privacy Program. To be removed from future offers,click here. + Privacy Program. To be removed from future offers,click here. SmartReminders.com is a permission based service. To unsubscribe click here . '); -INSERT INTO email([from],[to],subject,body) VALUES('benjamin.rogers@enron.com', 'mark.bernstein@enron.com', '', 'The guy you are talking about left CIN under a "cloud of suspicion" sort of -speak. He was the one who got into several bad deals and PPA''s in California -for CIN, thus he left on a bad note. Let me know if you need more detail +INSERT INTO email([from],[to],subject,body) VALUES('benjamin.rogers@enron.com', 'mark.bernstein@enron.com', '', 'The guy you are talking about left CIN under a "cloud of suspicion" sort of +speak. He was the one who got into several bad deals and PPA''s in California +for CIN, thus he left on a bad note. Let me know if you need more detail than that, I felt this was the type of info you were looking for. Thanks! Ben'); INSERT INTO email([from],[to],subject,body) VALUES('enron_update@concureworkplace.com', 'michelle.cash@enron.com', 'Expense Report Receipts Not Received', 'Employee Name: Michelle Cash @@ -468,7 +468,7 @@ Fax:(415) 782-7854 ----- Forwarded by Susan J Mara/NA/Enron on 06/08/2001 12:24 PM ----- - "Milner, Marcie" 06/08/2001 11:13 AM To: "''smara@enron.com''" cc: Subject: CAISO Emergency Motion + "Milner, Marcie" 06/08/2001 11:13 AM To: "''smara@enron.com''" cc: Subject: CAISO Emergency Motion Sue, did you see this emergency motion the CAISO filed today? Apparently @@ -480,7 +480,7 @@ doing? Marcie -http://www.caiso.com/docs/2001/06/08/200106081005526469.pdf +http://www.caiso.com/docs/2001/06/08/200106081005526469.pdf '); INSERT INTO email([from],[to],subject,body) VALUES('fletcher.sturm@enron.com', 'eloy.escobar@enron.com', 'Re: General Brinks Position Meeting', 'Eloy, @@ -489,27 +489,27 @@ Who is General Brinks? Fletch'); INSERT INTO email([from],[to],subject,body) VALUES('nailia.dindarova@enron.com', 'richard.shapiro@enron.com', 'Documents for Mark Frevert (on EU developments and lessons from', 'Rick, -Here are the documents that Peter has prepared for Mark Frevert. +Here are the documents that Peter has prepared for Mark Frevert. Nailia ----------------------- Forwarded by Nailia Dindarova/LON/ECT on 25/06/2001 +---------------------- Forwarded by Nailia Dindarova/LON/ECT on 25/06/2001 16:36 --------------------------- Nailia Dindarova 25/06/2001 15:36 To: Michael Brown/Enron@EUEnronXGate -cc: Ross Sankey/Enron@EUEnronXGate, Eric Shaw/ENRON@EUEnronXGate, Peter -Styles/LON/ECT@ECT +cc: Ross Sankey/Enron@EUEnronXGate, Eric Shaw/ENRON@EUEnronXGate, Peter +Styles/LON/ECT@ECT -Subject: Documents for Mark Frevert (on EU developments and lessons from +Subject: Documents for Mark Frevert (on EU developments and lessons from California) Michael, -These are the documents that Peter promised to give to you for Mark Frevert. -He has now handed them to him in person but asked me to transmit them +These are the documents that Peter promised to give to you for Mark Frevert. +He has now handed them to him in person but asked me to transmit them electronically to you, as well as Eric and Ross. Nailia @@ -542,30 +542,30 @@ Peggy (See attached file: accenture-dealpoints v2.doc) - accenture-dealpoints v2.doc '); -INSERT INTO email([from],[to],subject,body) VALUES('thomas.martin@enron.com', 'thomas.martin@enron.com', 'Re: Guadalupe Power Partners LP', '---------------------- Forwarded by Thomas A Martin/HOU/ECT on 03/20/2001 +INSERT INTO email([from],[to],subject,body) VALUES('thomas.martin@enron.com', 'thomas.martin@enron.com', 'Re: Guadalupe Power Partners LP', '---------------------- Forwarded by Thomas A Martin/HOU/ECT on 03/20/2001 03:49 PM --------------------------- Thomas A Martin 10/11/2000 03:55 PM To: Patrick Wade/HOU/ECT@ECT -cc: -Subject: Re: Guadalupe Power Partners LP +cc: +Subject: Re: Guadalupe Power Partners LP -The deal is physically served at Oasis Waha or Oasis Katy and is priced at -either HSC, Waha or Katytailgate GD at buyers option three days prior to +The deal is physically served at Oasis Waha or Oasis Katy and is priced at +either HSC, Waha or Katytailgate GD at buyers option three days prior to NYMEX close. '); -INSERT INTO email([from],[to],subject,body) VALUES('judy.townsend@enron.com', 'dan.junek@enron.com, chris.germany@enron.com', 'Columbia Distribution''s Capacity Available for Release - Sum', '---------------------- Forwarded by Judy Townsend/HOU/ECT on 03/09/2001 11:04 +INSERT INTO email([from],[to],subject,body) VALUES('judy.townsend@enron.com', 'dan.junek@enron.com, chris.germany@enron.com', 'Columbia Distribution''s Capacity Available for Release - Sum', '---------------------- Forwarded by Judy Townsend/HOU/ECT on 03/09/2001 11:04 AM --------------------------- agoddard@nisource.com on 03/08/2001 09:16:57 AM -To: " - *Koch, Kent" , " - -*Millar, Debra" , " - *Burke, Lynn" +To: " - *Koch, Kent" , " - +*Millar, Debra" , " - *Burke, Lynn" -cc: " - *Heckathorn, Tom" +cc: " - *Heckathorn, Tom" Subject: Columbia Distribution''s Capacity Available for Release - Sum @@ -586,17 +586,17 @@ Aaron Goddard - 2001Summer.doc '); -INSERT INTO email([from],[to],subject,body) VALUES('rhonda.denton@enron.com', 'tim.belden@enron.com, dana.davis@enron.com, genia.fitzgerald@enron.com,', 'Split Rock Energy LLC', 'We have received the executed EEI contract from this CP dated 12/12/2000. +INSERT INTO email([from],[to],subject,body) VALUES('rhonda.denton@enron.com', 'tim.belden@enron.com, dana.davis@enron.com, genia.fitzgerald@enron.com,', 'Split Rock Energy LLC', 'We have received the executed EEI contract from this CP dated 12/12/2000. Copies will be distributed to Legal and Credit.'); INSERT INTO email([from],[to],subject,body) VALUES('kerrymcelroy@dwt.com', 'jack.speer@alcoa.com, crow@millernash.com, michaelearly@earthlink.net,', 'Oral Argument Request', ' - Oral Argument Request.doc'); -INSERT INTO email([from],[to],subject,body) VALUES('mike.carson@enron.com', 'rlmichaelis@hormel.com', '', 'Did you come in town this wk end..... My new number at our house is : +INSERT INTO email([from],[to],subject,body) VALUES('mike.carson@enron.com', 'rlmichaelis@hormel.com', '', 'Did you come in town this wk end..... My new number at our house is : 713-668-3712...... my cell # is 281-381-7332 the kid'); INSERT INTO email([from],[to],subject,body) VALUES('cooper.richey@enron.com', 'trycooper@hotmail.com', 'FW: Contact Info', ' -----Original Message----- -From: Punja, Karim +From: Punja, Karim Sent: Thursday, December 13, 2001 2:35 PM To: Richey, Cooper Subject: Contact Info @@ -610,7 +610,7 @@ I hope we can stay in touch. Home# 234-0249 email: kpunja@hotmail.com -Take Care, +Take Care, Karim. '); @@ -634,44 +634,44 @@ San Antonio, Texas May 2-4, 2001 Westin Riverwalk See attached memo for more details!! -? Registration for the law conference this year will be handled through an -Online RSVP Form on the Enron Law Conference Website at -http://lawconference.corp.enron.com. The website is still under construction -and will not be available until Thursday, March 15, 2001. +? Registration for the law conference this year will be handled through an +Online RSVP Form on the Enron Law Conference Website at +http://lawconference.corp.enron.com. The website is still under construction +and will not be available until Thursday, March 15, 2001. -? We will send you another e-mail to confirm when the Law Conference Website -is operational. +? We will send you another e-mail to confirm when the Law Conference Website +is operational. -? Please complete the Online RSVP Form as soon as it is available and submit -it no later than Friday, March 30th. +? Please complete the Online RSVP Form as soon as it is available and submit +it no later than Friday, March 30th. '); -INSERT INTO email([from],[to],subject,body) VALUES('tori.kuykendall@enron.com', 'heath.b.taylor@accenture.com', 'Re:', 'hey - thats funny about john - he definitely remembers him - i''ll call pat -and let him know - we are coming on saturday - i just havent had a chance to -call you guys back -- looking forward to it -- i probably need the +INSERT INTO email([from],[to],subject,body) VALUES('tori.kuykendall@enron.com', 'heath.b.taylor@accenture.com', 'Re:', 'hey - thats funny about john - he definitely remembers him - i''ll call pat +and let him know - we are coming on saturday - i just havent had a chance to +call you guys back -- looking forward to it -- i probably need the directions again though'); INSERT INTO email([from],[to],subject,body) VALUES('darron.giron@enron.com', 'bryce.baxter@enron.com', 'Re: Feedback for Audrey Cook', 'Bryce, -I''ll get it done today. +I''ll get it done today. DG 3-9573 - - - + + + From: Bryce Baxter 06/12/2000 07:15 PM - + To: Darron C Giron/HOU/ECT@ECT -cc: +cc: Subject: Feedback for Audrey Cook -You were identified as a reviewer for Audrey Cook. If possible, could you -complete her feedback by end of business Wednesday? It will really help me +You were identified as a reviewer for Audrey Cook. If possible, could you +complete her feedback by end of business Wednesday? It will really help me in the PRC process to have your input. Thanks. '); @@ -697,7 +697,7 @@ INSERT INTO email([from],[to],subject,body) VALUES('darrell.schoolcraft@enron.co ds - + '); INSERT INTO email([from],[to],subject,body) VALUES('mcominsky@aol.com', 'cpatman@bracepatt.com, james_derrick@enron.com', 'Jurisprudence Luncheon', 'Carrin & Jim -- @@ -721,8 +721,8 @@ Anti-Defamation League 713/627-3490, ext. 122 713/627-2011 (fax) MCominsky@aol.com'); -INSERT INTO email([from],[to],subject,body) VALUES('phillip.love@enron.com', 'todagost@utmb.edu, gbsonnta@utmb.edu', 'New President', 'I had a little bird put a word in my ear. Is there any possibility for Ben -Raimer to be Bush''s secretary of HHS? Just curious about that infamous UTMB +INSERT INTO email([from],[to],subject,body) VALUES('phillip.love@enron.com', 'todagost@utmb.edu, gbsonnta@utmb.edu', 'New President', 'I had a little bird put a word in my ear. Is there any possibility for Ben +Raimer to be Bush''s secretary of HHS? Just curious about that infamous UTMB rumor mill. Hope things are well, happy holidays. PL'); INSERT INTO email([from],[to],subject,body) VALUES('marie.heard@enron.com', 'ehamilton@fna.com', 'ISDA Master Agreement', 'Erin: @@ -741,7 +741,7 @@ marie.heard@enron.com '); INSERT INTO email([from],[to],subject,body) VALUES('andrea.ring@enron.com', 'beverly.beaty@enron.com', 'Re: Tennessee Buy - Louis Dreyfus', 'Beverly - once again thanks so much for your help on this. - + '); INSERT INTO email([from],[to],subject,body) VALUES('karolyn.criado@enron.com', 'j..bonin@enron.com, felicia.case@enron.com, b..clapp@enron.com,', 'Price List week of Oct. 8-9, 2001', ' @@ -752,7 +752,7 @@ Karolyn Criado 3-9441 - + '); INSERT INTO email([from],[to],subject,body) VALUES('kevin.presto@enron.com', 'edward.baughman@enron.com, billy.braddock@enron.com', 'Associated', 'Please begin working on filling our Associated short position in 02. I would like to take this risk off the books. @@ -762,9 +762,9 @@ In addition, please find out what a buy-out of VEPCO would cost us. With Roger We also need to continue to explore a JEA buy-out. Thanks.'); -INSERT INTO email([from],[to],subject,body) VALUES('stacy.dickson@enron.com', 'gregg.penman@enron.com', 'RE: Constellation TC 5-7-01', 'Gregg, +INSERT INTO email([from],[to],subject,body) VALUES('stacy.dickson@enron.com', 'gregg.penman@enron.com', 'RE: Constellation TC 5-7-01', 'Gregg, -I am at home with a sick baby. (Lots of fun!) I will call you about this +I am at home with a sick baby. (Lots of fun!) I will call you about this tomorrow. Stacy'); @@ -774,18 +774,18 @@ INSERT INTO email([from],[to],subject,body) VALUES('joe.quenet@enron.com', 'dfin INSERT INTO email([from],[to],subject,body) VALUES('k..allen@enron.com', 'jacqestc@aol.com', '', 'Jacques, I sent you a fax of Kevin Kolb''s comments on the release. The payoff on the note would be $36,248 ($36090(principal) + $158 (accrued interest)). -This is assuming we wrap this up on Tuesday. +This is assuming we wrap this up on Tuesday. Please email to confirm that their changes are ok so I can set up a meeting on Tuesday to reach closure. Phillip'); INSERT INTO email([from],[to],subject,body) VALUES('kourtney.nelson@enron.com', 'mike.swerzbin@enron.com', 'Adjusted L/R Balance', 'Mike, -I placed the adjusted L/R Balance on the Enronwest site. It is under the "Staff/Kourtney Nelson". There are two links: +I placed the adjusted L/R Balance on the Enronwest site. It is under the "Staff/Kourtney Nelson". There are two links: -1) "Adj L_R" is the same data/format from the weekly strategy meeting. +1) "Adj L_R" is the same data/format from the weekly strategy meeting. 2) "New Gen 2001_2002" link has all of the supply side info that is used to calculate the L/R balance - -Please note the Data Flag column, a value of "3" indicates the project was cancelled, on hold, etc and is not included in the calc. + -Please note the Data Flag column, a value of "3" indicates the project was cancelled, on hold, etc and is not included in the calc. Both of these sheets are interactive Excel spreadsheets and thus you can play around with the data as you please. Also, James Bruce is working to get his gen report on the web. That will help with your access to information on new gen. @@ -796,14 +796,14 @@ Kourtney Kourtney Nelson -Fundamental Analysis +Fundamental Analysis Enron North America (503) 464-8280 kourtney.nelson@enron.com'); INSERT INTO email([from],[to],subject,body) VALUES('d..thomas@enron.com', 'naveed.ahmed@enron.com', 'FW: Current Enron TCC Portfolio', ' -----Original Message----- -From: Grace, Rebecca M. +From: Grace, Rebecca M. Sent: Monday, December 17, 2001 9:44 AM To: Thomas, Paul D. Cc: Cashion, Jim; Allen, Thresa A.; May, Tom @@ -821,19 +821,19 @@ Rebecca -----Original Message----- -From: Thomas, Paul D. +From: Thomas, Paul D. Sent: Monday, December 17, 2001 9:08 AM To: Grace, Rebecca M. Subject: FW: Current Enron TCC Portfolio - << File: enrontccs.xls >> + << File: enrontccs.xls >> Rebecca, Let me know if you see any differences. Paul X 3-0403 -----Original Message----- -From: Thomas, Paul D. +From: Thomas, Paul D. Sent: Monday, December 17, 2001 9:04 AM To: Ahmed, Naveed Subject: FW: Current Enron TCC Portfolio @@ -842,32 +842,32 @@ Subject: FW: Current Enron TCC Portfolio -----Original Message----- -From: Thomas, Paul D. +From: Thomas, Paul D. Sent: Thursday, December 13, 2001 10:01 AM To: Baughman, Edward D. Subject: Current Enron TCC Portfolio '); -INSERT INTO email([from],[to],subject,body) VALUES('stephanie.panus@enron.com', 'william.bradford@enron.com, debbie.brackett@enron.com,', 'Coastal Merchant Energy/El Paso Merchant Energy', 'Coastal Merchant Energy, L.P. merged with and into El Paso Merchant Energy, -L.P., effective February 1, 2001, with the surviving entity being El Paso -Merchant Energy, L.P. We currently have ISDA Master Agreements with both -counterparties. Please see the attached memo regarding the existing Masters +INSERT INTO email([from],[to],subject,body) VALUES('stephanie.panus@enron.com', 'william.bradford@enron.com, debbie.brackett@enron.com,', 'Coastal Merchant Energy/El Paso Merchant Energy', 'Coastal Merchant Energy, L.P. merged with and into El Paso Merchant Energy, +L.P., effective February 1, 2001, with the surviving entity being El Paso +Merchant Energy, L.P. We currently have ISDA Master Agreements with both +counterparties. Please see the attached memo regarding the existing Masters and let us know which agreement should be terminated. Thanks, Stephanie '); -INSERT INTO email([from],[to],subject,body) VALUES('kam.keiser@enron.com', 'c..kenne@enron.com', 'RE: What about this too???', ' +INSERT INTO email([from],[to],subject,body) VALUES('kam.keiser@enron.com', 'c..kenne@enron.com', 'RE: What about this too???', ' -----Original Message----- -From: Kenne, Dawn C. +From: Kenne, Dawn C. Sent: Wednesday, February 06, 2002 11:50 AM To: Keiser, Kam Subject: What about this too??? - << File: Netco Trader Matrix.xls >> + << File: Netco Trader Matrix.xls >> '); INSERT INTO email([from],[to],subject,body) VALUES('chris.meyer@enron.com', 'joe.parks@enron.com', 'Centana', 'Talked to Chip. We do need Cash Committe approval given the netting feature of your deal, which means Batch Funding Request. Please update per my previous e-mail and forward. @@ -903,7 +903,7 @@ We got a request for guest access through MG. The company is called Escondida and is a subsidiary of BHP Australia. Please advise if I can set up a guest account or not. -F.Y.I.: MG is planning to put a "in w/h Chile" contract for Copper on-line as +F.Y.I.: MG is planning to put a "in w/h Chile" contract for Copper on-line as soon as Enron has done the due diligence for this country. Thanks ! @@ -948,10 +948,10 @@ Please refer to the Worldwide Customer Support card for a complete technical sup INSERT INTO email([from],[to],subject,body) VALUES('geoff.storey@enron.com', 'dutch.quigley@enron.com', 'RE:', 'duke contact? -----Original Message----- -From: Quigley, Dutch +From: Quigley, Dutch Sent: Wednesday, October 31, 2001 10:14 AM To: Storey, Geoff -Subject: RE: +Subject: RE: bp corp Albert LaMore 281-366-4962 @@ -959,30 +959,30 @@ running the reports now -----Original Message----- -From: Storey, Geoff +From: Storey, Geoff Sent: Wednesday, October 31, 2001 10:10 AM To: Quigley, Dutch -Subject: RE: +Subject: RE: give me a contact over there too BP -----Original Message----- -From: Quigley, Dutch +From: Quigley, Dutch Sent: Wednesday, October 31, 2001 9:42 AM To: Storey, Geoff -Subject: +Subject: Coral Jeff Whitnah 713-767-5374 Relaint Steve McGinn 713-207-4000'); -INSERT INTO email([from],[to],subject,body) VALUES('pete.davis@enron.com', 'pete.davis@enron.com', 'Start Date: 4/22/01; HourAhead hour: 3; ', 'Start Date: 4/22/01; HourAhead hour: 3; No ancillary schedules awarded. +INSERT INTO email([from],[to],subject,body) VALUES('pete.davis@enron.com', 'pete.davis@enron.com', 'Start Date: 4/22/01; HourAhead hour: 3; ', 'Start Date: 4/22/01; HourAhead hour: 3; No ancillary schedules awarded. Variances detected. Variances detected in Load schedule. LOG MESSAGES: -PARSING FILE -->> O:\Portland\WestDesk\California Scheduling\ISO Final +PARSING FILE -->> O:\Portland\WestDesk\California Scheduling\ISO Final Schedules\2001042203.txt ---- Load Schedule ---- @@ -995,12 +995,12 @@ $$$ Variance found in table tblLoads. SC_ID: EPMI '); -INSERT INTO email([from],[to],subject,body) VALUES('john.postlethwaite@enron.com', 'john.zufferli@enron.com', 'Reference', 'John, hope things are going well up there for you. The big day is almost here for you and Jessica. I was wondering if I could use your name as a job reference if need be. I am just trying to get everything in order just in case something happens. +INSERT INTO email([from],[to],subject,body) VALUES('john.postlethwaite@enron.com', 'john.zufferli@enron.com', 'Reference', 'John, hope things are going well up there for you. The big day is almost here for you and Jessica. I was wondering if I could use your name as a job reference if need be. I am just trying to get everything in order just in case something happens. John'); -INSERT INTO email([from],[to],subject,body) VALUES('jeffrey.shankman@enron.com', 'lschiffm@jonesday.com', 'Re:', 'I saw you called on the cell this a.m. Sorry I missed you. (I was in the -shower). I have had a shitty week--I suspect my silence (not only to you, -but others) after our phone call is a result of the week. I''m seeing Glen at +INSERT INTO email([from],[to],subject,body) VALUES('jeffrey.shankman@enron.com', 'lschiffm@jonesday.com', 'Re:', 'I saw you called on the cell this a.m. Sorry I missed you. (I was in the +shower). I have had a shitty week--I suspect my silence (not only to you, +but others) after our phone call is a result of the week. I''m seeing Glen at 11:15....talk to you'); INSERT INTO email([from],[to],subject,body) VALUES('litebytz@enron.com', '', 'Lite Bytz RSVP', ' This week''s Lite Bytz presentation will feature the following TOOLZ speaker: @@ -1131,8 +1131,8 @@ do_test fts2c-4.2 { SELECT snippet(email) FROM email WHERE email MATCH 'christmas candlelight' } -} {{... place.? What do you think about going here Christmas -eve?? They have an 11:00 a.m. service and a candlelight service at 5:00 p.m., +} {{... place.? What do you think about going here Christmas +eve?? They have an 11:00 a.m. service and a candlelight service at 5:00 p.m., among others. ...}} do_test fts2c-4.3 { @@ -1162,7 +1162,7 @@ do_test fts2c-4.6 { SELECT snippet(email) FROM email WHERE email MATCH 'chris is here' } -} {{chris.germany@enron.com ... Sounds good to me. I bet this is next to the Warick?? Hotel. ... place.? What do you think about going here Christmas +} {{chris.germany@enron.com ... Sounds good to me. I bet this is next to the Warick?? Hotel. ... place.? What do you think about going here Christmas eve?? They have an 11:00 a.m. ...}} do_test fts2c-4.7 { execsql { @@ -1177,7 +1177,7 @@ do_test fts2c-4.8 { SELECT snippet(email) FROM email WHERE email MATCH 'ancillary load davis' } -} {{pete.davis@enron.com ... Start Date: 4/22/01; HourAhead hour: 3; No ancillary schedules awarded. +} {{pete.davis@enron.com ... Start Date: 4/22/01; HourAhead hour: 3; No ancillary schedules awarded. Variances detected. Variances detected in Load schedule. @@ -1192,7 +1192,7 @@ do_test fts2c-5.1 { SELECT snippet(email) FROM email WHERE email MATCH 'questar enron OR com' } -} {{matt.smith@enron.com ... six reports: +} {{matt.smith@enron.com ... six reports: 31 Keystone Receipts 15 Questar Pipeline @@ -1203,7 +1203,7 @@ do_test fts2c-5.2 { SELECT snippet(email) FROM email WHERE email MATCH 'enron OR com questar' } -} {{matt.smith@enron.com ... six reports: +} {{matt.smith@enron.com ... six reports: 31 Keystone Receipts 15 Questar Pipeline diff --git a/third_party/sqlite/src/test/fts2d.test b/third_party/sqlite/src/test/fts2d.test index d8090d8f0ccf3..5f4f5ed63be77 100644 --- a/third_party/sqlite/src/test/fts2d.test +++ b/third_party/sqlite/src/test/fts2d.test @@ -38,7 +38,7 @@ do_test fts2d-1.2 { } {{running and jumping}} do_test fts2d-1.3 { execsql { - INSERT INTO t1(rowid, content) + INSERT INTO t1(rowid, content) VALUES(2, 'abcdefghijklmnopqrstuvwyxz'); SELECT rowid, snippet(t1) FROM t1 WHERE t1 MATCH 'abcdefghijqrstuvwyxz' } @@ -50,7 +50,7 @@ do_test fts2d-1.4 { } {2 abcdefghijklmnopqrstuvwyxz} do_test fts2d-1.5 { execsql { - INSERT INTO t1(rowid, content) + INSERT INTO t1(rowid, content) VALUES(3, 'The value is 123456789'); SELECT rowid, snippet(t1) FROM t1 WHERE t1 MATCH '123789' } diff --git a/third_party/sqlite/src/test/fts2o.test b/third_party/sqlite/src/test/fts2o.test index 63e71b958a43f..f35031bbd853f 100644 --- a/third_party/sqlite/src/test/fts2o.test +++ b/third_party/sqlite/src/test/fts2o.test @@ -105,7 +105,7 @@ do_test fts2o-2.12 { } {{one three four} {one four} {one four two}} #------------------------------------------------------------------- -# Close, delete and reopen the database. The following test should +# Close, delete and reopen the database. The following test should # be run on an initially empty db. # db close @@ -131,7 +131,7 @@ do_test fts2o-3.2 { } {{one three four} {one four} {one two} {one three four} {one four} {one two}} #--------------------------------------------------------------------- -# Test that it is possible to rename an fts2 table in an attached +# Test that it is possible to rename an fts2 table in an attached # database. # forcedelete test2.db test2.db-journal diff --git a/third_party/sqlite/src/test/fts2token.test b/third_party/sqlite/src/test/fts2token.test index de5f94d7fc5a1..62a450256aa5e 100644 --- a/third_party/sqlite/src/test/fts2token.test +++ b/third_party/sqlite/src/test/fts2token.test @@ -8,8 +8,8 @@ # May you share freely, never taking more than you give. # #************************************************************************* -# This file implements regression tests for SQLite library. The focus -# of this script is testing the pluggable tokeniser feature of the +# This file implements regression tests for SQLite library. The focus +# of this script is testing the pluggable tokeniser feature of the # FTS2 module. # # $Id: fts2token.test,v 1.3 2007/06/25 12:05:40 danielk1977 Exp $ @@ -49,7 +49,7 @@ proc escape_string {str} { # 3: Test that the value returned for tokenizer 'blah' is now the # same as that retrieved for 'simple'. # -# 4: Test that it is now possible to create an fts2 table using +# 4: Test that it is now possible to create an fts2 table using # tokenizer 'blah' (it was not possible in step 1). # # 5: Test that the table created to use tokenizer 'blah' is usable. @@ -119,7 +119,7 @@ ifcapable icu { #-------------------------------------------------------------------------- # Test cases fts2token-4.* test the ICU tokenizer. In practice, this # tokenizer only has two modes - "thai" and "everybody else". Some other -# Asian languages (Lao, Khmer etc.) require the same special treatment as +# Asian languages (Lao, Khmer etc.) require the same special treatment as # Thai, but ICU doesn't support them yet. # ifcapable icu { @@ -130,14 +130,14 @@ ifcapable icu { lindex $::out 0 } $output } - + do_icu_test fts2token-4.1 en_US {} {} do_icu_test fts2token-4.2 en_US {Test cases fts2} [list \ 0 test Test 1 cases cases 2 fts2 fts2 ] # The following test shows that ICU is smart enough to recognise - # Thai chararacters, even when the locale is set to English/United + # Thai chararacters, even when the locale is set to English/United # States. # set input "\u0e2d\u0e30\u0e44\u0e23\u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a" diff --git a/third_party/sqlite/src/test/fts3_common.tcl b/third_party/sqlite/src/test/fts3_common.tcl index 2ed1f70bf626b..41c235abddb50 100644 --- a/third_party/sqlite/src/test/fts3_common.tcl +++ b/third_party/sqlite/src/test/fts3_common.tcl @@ -47,7 +47,7 @@ #------------------------------------------------------------------------- # USAGE: fts3_build_db_1 SWITCHES N # -# Build a sample FTS table in the database opened by database connection +# Build a sample FTS table in the database opened by database connection # [db]. The name of the new table is "t1". # proc fts3_build_db_1 {args} { @@ -95,7 +95,7 @@ proc fts3_build_db_1 {args} { #------------------------------------------------------------------------- # USAGE: fts3_build_db_2 N ARGS # -# Build a sample FTS table in the database opened by database connection +# Build a sample FTS table in the database opened by database connection # [db]. The name of the new table is "t2". # proc fts3_build_db_2 {args} { @@ -142,7 +142,7 @@ proc fts3_build_db_2 {args} { # # This proc is used to verify that the full-text index is consistent with # the contents of the fts3 table. In other words, it checks that the -# data in the %_contents table matches that in the %_segdir and %_segments +# data in the %_contents table matches that in the %_segdir and %_segments # tables. # # This is not an efficient procedure. It uses a lot of memory and a lot @@ -156,13 +156,13 @@ proc fts3_build_db_2 {args} { # # set C($iDocid,$iCol,$iPosition) $zTerm # -# 2) Iterate through each column of each row of the %_content table. +# 2) Iterate through each column of each row of the %_content table. # Tokenize all documents, and check that for each token there is # a corresponding entry in the $C array. After checking a token, # [unset] the $C array entry. # # 3) Check that array $C is now empty. -# +# # proc fts3_integrity_check {tbl} { @@ -261,8 +261,8 @@ proc fts3_terms {tbl where} { # USAGE: fts3_doclist TBL TERM WHERE # # Argument TBL must be the name of an FTS3 table. TERM is a term that may -# or may not be present in the table. Argument WHERE is used to select a -# subset of the b-tree segments in the associated full-text index as +# or may not be present in the table. Argument WHERE is used to select a +# subset of the b-tree segments in the associated full-text index as # described above for [fts3_terms]. # # This function returns the results of merging the doclists associated @@ -272,7 +272,7 @@ proc fts3_terms {tbl where} { # [$docid ?$col[$off1 $off2...]?...] # # The formatting is odd for a Tcl command in order to be compatible with -# the original C-language implementation. If argument WHERE is "1", then +# the original C-language implementation. If argument WHERE is "1", then # any empty doclists are omitted from the returned list. # proc fts3_doclist {tbl term where} { @@ -288,7 +288,7 @@ proc fts3_doclist {tbl term where} { set lPos [list] set lCol [list] incr docid [gobble_varint doclist] - + while {[set iDelta [gobble_varint doclist]] > 0} { if {$iDelta == 1} { lappend lCol [list $iCol $lPos] @@ -301,11 +301,11 @@ proc fts3_doclist {tbl term where} { lappend lPos $iPos } } - + if {[llength $lPos]>0} { lappend lCol [list $iCol $lPos] } - + if {$where != "1" || [llength $lCol]>0} { set ret($docid) $lCol } else { @@ -343,7 +343,7 @@ proc gobble_string {varname nLength} { return $ret } -# The argument is a blob of data representing an FTS3 segment leaf. +# The argument is a blob of data representing an FTS3 segment leaf. # Return a list consisting of alternating terms (strings) and doclists # (blobs of data). # @@ -370,7 +370,7 @@ proc fts3_readleaf {blob} { proc fts3_read2 {tbl where varname} { upvar $varname a array unset a - db eval " SELECT start_block, leaves_end_block, root + db eval " SELECT start_block, leaves_end_block, root FROM ${tbl}_segdir WHERE $where ORDER BY level ASC, idx DESC " { @@ -379,8 +379,8 @@ proc fts3_read2 {tbl where varname} { if {$c==0} { foreach {t d} [fts3_readleaf $root] { lappend a($t) $d } } else { - db eval " SELECT block - FROM ${tbl}_segments + db eval " SELECT block + FROM ${tbl}_segments WHERE blockid>=$start_block AND blockid<=$leaves_end_block ORDER BY blockid " { @@ -393,15 +393,15 @@ proc fts3_read2 {tbl where varname} { proc fts3_read {tbl where varname} { upvar $varname a array unset a - db eval " SELECT start_block, leaves_end_block, root + db eval " SELECT start_block, leaves_end_block, root FROM ${tbl}_segdir WHERE $where ORDER BY level DESC, idx ASC " { if {$start_block == 0} { foreach {t d} [fts3_readleaf $root] { lappend a($t) $d } } else { - db eval " SELECT block - FROM ${tbl}_segments + db eval " SELECT block + FROM ${tbl}_segments WHERE blockid>=$start_block AND blockid<$leaves_end_block ORDER BY blockid " { diff --git a/third_party/sqlite/src/test/fts3ab.test b/third_party/sqlite/src/test/fts3ab.test index 86124f78c4b44..dd77bd28a67c3 100644 --- a/third_party/sqlite/src/test/fts3ab.test +++ b/third_party/sqlite/src/test/fts3ab.test @@ -33,7 +33,7 @@ proc fill_multilanguage_fulltext_t1 {} { set english {one two three four five} set spanish {un dos tres cuatro cinco} set german {eine zwei drei vier funf} - + for {set i 1} {$i<=31} {incr i} { set cmd "INSERT INTO t1 VALUES" set vset {} diff --git a/third_party/sqlite/src/test/fts3ac.test b/third_party/sqlite/src/test/fts3ac.test index 84da924b6e8ae..e9710b143f3e6 100644 --- a/third_party/sqlite/src/test/fts3ac.test +++ b/third_party/sqlite/src/test/fts3ac.test @@ -33,7 +33,7 @@ do_test fts3ac-1.1 { BEGIN TRANSACTION; INSERT INTO email([from],[to],subject,body) VALUES('savita.puthigai@enron.com', 'traders.eol@enron.com, traders.eol@enron.com', 'EnronOnline- Change to Autohedge', 'Effective Monday, October 22, 2001 the following changes will be made to the Autohedge functionality on EnronOnline. -The volume on the hedge will now respect the minimum volume and volume increment settings on the parent product. See rules below: +The volume on the hedge will now respect the minimum volume and volume increment settings on the parent product. See rules below: ? If the transaction volume on the child is less than half of the parent''s minimum volume no hedge will occur. ? If the transaction volume on the child is more than half the parent''s minimum volume but less than half the volume increment on the parent, the hedge will volume will be the parent''s minimum volume. @@ -49,9 +49,9 @@ Volume on Autohedge transaction Volume Hedged 1 - 2499 0 2500 - 5499 5000 5500 - 6499 6000'); -INSERT INTO email([from],[to],subject,body) VALUES('dana.davis@enron.com', 'laynie.east@enron.com, lisa.king@enron.com, lisa.best@enron.com,', 'Leaving Early', 'FYI: -If it''s ok with everyone''s needs, I would like to leave @4pm. If you think -you will need my assistance past the 4 o''clock hour just let me know; I''ll +INSERT INTO email([from],[to],subject,body) VALUES('dana.davis@enron.com', 'laynie.east@enron.com, lisa.king@enron.com, lisa.best@enron.com,', 'Leaving Early', 'FYI: +If it''s ok with everyone''s needs, I would like to leave @4pm. If you think +you will need my assistance past the 4 o''clock hour just let me know; I''ll be more than willing to stay.'); INSERT INTO email([from],[to],subject,body) VALUES('enron_update@concureworkplace.com', 'louise.kitchen@enron.com', '<> - CC02.06.02', 'The following expense report is ready for approval: @@ -70,17 +70,17 @@ Could you print off the current work request report by 1:30 today? Gentlemen, -I''d like to review this today at 1:30 in our office. Also, could you provide +I''d like to review this today at 1:30 in our office. Also, could you provide me with your activity reports so I can have Julie enter this information. JD'); -INSERT INTO email([from],[to],subject,body) VALUES('v.weldon@enron.com', 'gary.l.carrier@usa.dupont.com, scott.joyce@bankofamerica.com', 'Enron News', 'This could turn into something big.... +INSERT INTO email([from],[to],subject,body) VALUES('v.weldon@enron.com', 'gary.l.carrier@usa.dupont.com, scott.joyce@bankofamerica.com', 'Enron News', 'This could turn into something big.... http://biz.yahoo.com/rf/010129/n29305829.html'); INSERT INTO email([from],[to],subject,body) VALUES('mark.haedicke@enron.com', 'paul.simons@enron.com', 'Re: First Polish Deal!', 'Congrats! Things seem to be building rapidly now on the Continent. Mark'); INSERT INTO email([from],[to],subject,body) VALUES('e..carter@enron.com', 't..robinson@enron.com', 'FW: Producers Newsletter 9-24-2001', ' The producer lumber pricing sheet. -----Original Message----- -From: Johnson, Jay +From: Johnson, Jay Sent: Tuesday, October 16, 2001 3:42 PM To: Carter, Karen E. Subject: FW: Producers Newsletter 9-24-2001 @@ -88,14 +88,14 @@ Subject: FW: Producers Newsletter 9-24-2001 -----Original Message----- -From: Daigre, Sergai +From: Daigre, Sergai Sent: Friday, September 21, 2001 8:33 PM Subject: Producers Newsletter 9-24-2001 '); -INSERT INTO email([from],[to],subject,body) VALUES('david.delainey@enron.com', 'kenneth.lay@enron.com', 'Greater Houston Partnership', 'Ken, in response to the letter from Mr Miguel San Juan, my suggestion would -be to offer up the Falcon for their use; however, given the tight time frame -and your recent visit with Mr. Fox that it would be difficult for either you +INSERT INTO email([from],[to],subject,body) VALUES('david.delainey@enron.com', 'kenneth.lay@enron.com', 'Greater Houston Partnership', 'Ken, in response to the letter from Mr Miguel San Juan, my suggestion would +be to offer up the Falcon for their use; however, given the tight time frame +and your recent visit with Mr. Fox that it would be difficult for either you or me to participate. I spoke to Max and he agrees with this approach. @@ -117,7 +117,7 @@ lachandra.fenceroy@enron.com 877.498.3401 Pager -----Original Message----- -From: Bisbee, Joanne +From: Bisbee, Joanne Sent: Wednesday, September 26, 2001 7:50 AM To: Fenceroy, LaChandra Subject: FW: Bus Applications Meeting Follow Up @@ -125,7 +125,7 @@ Subject: FW: Bus Applications Meeting Follow Up Lachandra, Please get with David Duff today and see what this is about. Who are our TW accounting business users? -----Original Message----- -From: Koh, Wendy +From: Koh, Wendy Sent: Tuesday, September 25, 2001 2:41 PM To: Bisbee, Joanne Subject: Bus Applications Meeting Follow Up @@ -138,7 +138,7 @@ INSERT INTO email([from],[to],subject,body) VALUES('danny.mccarty@enron.com', 'f Dan -----Original Message----- -From: Fagan, Fran +From: Fagan, Fran Sent: Thursday, December 20, 2001 11:10 AM To: McCarty, Danny Subject: worksheets @@ -152,7 +152,7 @@ Sr. HR Rep 713.853.5219 - << File: McCartyMerit.xls >> << File: mccartyBonusCommercial_UnP.xls >> + << File: McCartyMerit.xls >> << File: mccartyBonusCommercial_UnP.xls >> '); INSERT INTO email([from],[to],subject,body) VALUES('bert.meyers@enron.com', 'shift.dl-portland@enron.com', 'OCTOBER SCHEDULE', 'TEAM, @@ -164,7 +164,7 @@ INSERT INTO email([from],[to],subject,body) VALUES('errol.mclaughlin@enron.com', INSERT INTO email([from],[to],subject,body) VALUES('patrice.mims@enron.com', 'calvin.eakins@enron.com', 'Re: Small business supply assistance', 'Hi Calvin -I spoke with Rickey (boy, is he long-winded!!). Gave him the name of our +I spoke with Rickey (boy, is he long-winded!!). Gave him the name of our credit guy, Russell Diamond. Thank for your help!'); @@ -176,17 +176,17 @@ Here is the information on staffing and outside services. Call if you need anyt Jim '); -INSERT INTO email([from],[to],subject,body) VALUES('gelliott@industrialinfo.com', 'pcopello@industrialinfo.com', 'ECAAR (Gavin), WSCC (Diablo Canyon), & NPCC (Seabrook)', 'Dear Power Outage Database Customer, -Attached you will find an excel document. The outages contained within are forced or rescheduled outages. Your daily delivery will still contain these outages. -In addition to the two excel documents, there is a dbf file that is formatted like your daily deliveries you receive nightly. This will enable you to load the data into your regular database. Any questions please let me know. Thanks. -Greg Elliott -IIR, Inc. -713-783-5147 x 3481 -outages@industrialinfo.com -THE INFORMATION CONTAINED IN THIS E-MAIL IS LEGALLY PRIVILEGED AND CONFIDENTIAL INFORMATION INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY NAMED ABOVE. YOU ARE HEREBY NOTIFIED THAT ANY DISSEMINATION, DISTRIBUTION, OR COPY OF THIS E-MAIL TO UNAUTHORIZED ENTITIES IS STRICTLY PROHIBITED. IF YOU HAVE RECEIVED THIS +INSERT INTO email([from],[to],subject,body) VALUES('gelliott@industrialinfo.com', 'pcopello@industrialinfo.com', 'ECAAR (Gavin), WSCC (Diablo Canyon), & NPCC (Seabrook)', 'Dear Power Outage Database Customer, +Attached you will find an excel document. The outages contained within are forced or rescheduled outages. Your daily delivery will still contain these outages. +In addition to the two excel documents, there is a dbf file that is formatted like your daily deliveries you receive nightly. This will enable you to load the data into your regular database. Any questions please let me know. Thanks. +Greg Elliott +IIR, Inc. +713-783-5147 x 3481 +outages@industrialinfo.com +THE INFORMATION CONTAINED IN THIS E-MAIL IS LEGALLY PRIVILEGED AND CONFIDENTIAL INFORMATION INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY NAMED ABOVE. YOU ARE HEREBY NOTIFIED THAT ANY DISSEMINATION, DISTRIBUTION, OR COPY OF THIS E-MAIL TO UNAUTHORIZED ENTITIES IS STRICTLY PROHIBITED. IF YOU HAVE RECEIVED THIS E-MAIL IN ERROR, PLEASE DELETE IT. - - OUTAGE.dbf - - 111201R.xls + - OUTAGE.dbf + - 111201R.xls - 111201.xls '); INSERT INTO email([from],[to],subject,body) VALUES('enron.announcements@enron.com', 'all_ena_egm_eim@enron.com', 'EWS Brown Bag', 'MARK YOUR LUNCH CALENDARS NOW ! @@ -210,35 +210,35 @@ INSERT INTO email([from],[to],subject,body) VALUES('chris.germany@enron.com', 'i "Immer, Ingrid" on 12/21/2000 11:48:47 AM To: "''chris.germany@enron.com''" -cc: +cc: Subject: About St Pauls - <> -? -?http://www.stpaulshouston.org/about.html + <> +? +?http://www.stpaulshouston.org/about.html -Chris, +Chris, -I like the looks of this place.? What do you think about going here Christmas -eve?? They have an 11:00 a.m. service and a candlelight service at 5:00 p.m., +I like the looks of this place.? What do you think about going here Christmas +eve?? They have an 11:00 a.m. service and a candlelight service at 5:00 p.m., among others. -Let me know.?? ii +Let me know.?? ii - About St Pauls.url '); INSERT INTO email([from],[to],subject,body) VALUES('nas@cpuc.ca.gov', 'skatz@sempratrading.com, kmccrea@sablaw.com, thompson@wrightlaw.com,', 'Reply Brief filed July 31, 2000', ' - CPUC01-#76371-v1-Revised_Reply_Brief__Due_today_7_31_.doc'); INSERT INTO email([from],[to],subject,body) VALUES('gascontrol@aglresources.com', 'dscott4@enron.com, lcampbel@enron.com', 'Alert Posted 10:00 AM November 20,2000: E-GAS Request Reminder', 'Alert Posted 10:00 AM November 20,2000: E-GAS Request Reminder -As discussed in the Winter Operations Meeting on Sept.29,2000, -E-Gas(Emergency Gas) will not be offered this winter as a service from AGLC. -Marketers and Poolers can receive gas via Peaking and IBSS nominations(daisy +As discussed in the Winter Operations Meeting on Sept.29,2000, +E-Gas(Emergency Gas) will not be offered this winter as a service from AGLC. +Marketers and Poolers can receive gas via Peaking and IBSS nominations(daisy chain) from other marketers up to the 6 p.m. Same Day 2 nomination cycle. '); -INSERT INTO email([from],[to],subject,body) VALUES('dutch.quigley@enron.com', 'rwolkwitz@powermerchants.com', '', ' +INSERT INTO email([from],[to],subject,body) VALUES('dutch.quigley@enron.com', 'rwolkwitz@powermerchants.com', '', ' Here is a goody for you'); INSERT INTO email([from],[to],subject,body) VALUES('ryan.o''rourke@enron.com', 'k..allen@enron.com, randy.bhatia@enron.com, frank.ermis@enron.com,', 'TRV Notification: (West VaR - 11/07/2001)', 'The report named: West VaR , published as of 11/07/2001 is now available for viewing on the website.'); @@ -268,23 +268,23 @@ adam -----Original Message----- -From: Royed, Jeff +From: Royed, Jeff Sent: Tuesday, September 25, 2001 11:37 AM To: Bayer, Adam Subject: Curve Fetch File Let me know if it works. It may be required to have a certain version of Oracle for it to work properly. - + Jeff Royed -Enron +Enron Energy Operations Phone: 713-853-5295'); INSERT INTO email([from],[to],subject,body) VALUES('matt.smith@enron.com', 'yan.wang@enron.com', 'Report Formats', 'Yan, -The merged reports look great. I believe the only orientation changes are to -"unmerge" the following six reports: +The merged reports look great. I believe the only orientation changes are to +"unmerge" the following six reports: 31 Keystone Receipts 15 Questar Pipeline @@ -298,16 +298,16 @@ The orientation of the individual reports should be correct. Thanks. Mat PS. Just a reminder to add the "*" by the title of calculated points.'); -INSERT INTO email([from],[to],subject,body) VALUES('michelle.lokay@enron.com', 'jimboman@bigfoot.com', 'Egyptian Festival', '---------------------- Forwarded by Michelle Lokay/ET&S/Enron on 09/07/2000 +INSERT INTO email([from],[to],subject,body) VALUES('michelle.lokay@enron.com', 'jimboman@bigfoot.com', 'Egyptian Festival', '---------------------- Forwarded by Michelle Lokay/ET&S/Enron on 09/07/2000 10:08 AM --------------------------- "Karkour, Randa" on 09/07/2000 09:01:04 AM -To: "''Agheb (E-mail)" , "Leila Mankarious (E-mail)" -, "''Marymankarious (E-mail)" -, "Michelle lokay (E-mail)" , "Ramy +To: "''Agheb (E-mail)" , "Leila Mankarious (E-mail)" +, "''Marymankarious (E-mail)" +, "Michelle lokay (E-mail)" , "Ramy Mankarious (E-mail)" -cc: +cc: Subject: Egyptian Festival @@ -321,26 +321,26 @@ Subject: Egyptian Festival INSERT INTO email([from],[to],subject,body) VALUES('errol.mclaughlin@enron.com', 'sherry.dawson@enron.com', 'Urgent!!! --- New EAST books', 'This has to be done.................................. Thanks ----------------------- Forwarded by Errol McLaughlin/Corp/Enron on 12/20/2000 +---------------------- Forwarded by Errol McLaughlin/Corp/Enron on 12/20/2000 08:39 AM --------------------------- - - - + + + From: William Kelly @ ECT 12/20/2000 08:31 AM - -To: Kam Keiser/HOU/ECT@ECT, Darron C Giron/HOU/ECT@ECT, David + +To: Kam Keiser/HOU/ECT@ECT, Darron C Giron/HOU/ECT@ECT, David Baumbach/HOU/ECT@ECT, Errol McLaughlin/Corp/Enron@ENRON -cc: Kimat Singla/HOU/ECT@ECT, Kulvinder Fowler/NA/Enron@ENRON, Kyle R -Lilly/HOU/ECT@ECT, Jeff Royed/Corp/Enron@ENRON, Alejandra -Chavez/NA/Enron@ENRON, Crystal Hyde/HOU/ECT@ECT +cc: Kimat Singla/HOU/ECT@ECT, Kulvinder Fowler/NA/Enron@ENRON, Kyle R +Lilly/HOU/ECT@ECT, Jeff Royed/Corp/Enron@ENRON, Alejandra +Chavez/NA/Enron@ENRON, Crystal Hyde/HOU/ECT@ECT Subject: New EAST books -We have new book names in TAGG for our intramonth portfolios and it is -extremely important that any deal booked to the East is communicated quickly -to someone on my team. I know it will take some time for the new names to -sink in and I do not want us to miss any positions or P&L. +We have new book names in TAGG for our intramonth portfolios and it is +extremely important that any deal booked to the East is communicated quickly +to someone on my team. I know it will take some time for the new names to +sink in and I do not want us to miss any positions or P&L. Thanks for your help on this. @@ -348,19 +348,19 @@ New: Scott Neal : East Northeast Dick Jenkins: East Marketeast -WK +WK '); -INSERT INTO email([from],[to],subject,body) VALUES('david.forster@enron.com', 'eol.wide@enron.com', 'Change to Stack Manager', 'Effective immediately, there is a change to the Stack Manager which will +INSERT INTO email([from],[to],subject,body) VALUES('david.forster@enron.com', 'eol.wide@enron.com', 'Change to Stack Manager', 'Effective immediately, there is a change to the Stack Manager which will affect any Inactive Child. -An inactive Child with links to Parent products will not have their +An inactive Child with links to Parent products will not have their calculated prices updated until the Child product is Activated. -When the Child Product is activated, the price will be recalculated and +When the Child Product is activated, the price will be recalculated and updated BEFORE it is displayed on the web. -This means that if you are inputting a basis price on a Child product, you -will not see the final, calculated price until you Activate the product, at +This means that if you are inputting a basis price on a Child product, you +will not see the final, calculated price until you Activate the product, at which time the customer will also see it. If you have any questions, please contact the Help Desk on: @@ -382,7 +382,7 @@ Vince "John H Herbert" on 07/28/2000 08:38:08 AM To: "Vince J Kaminski" -cc: +cc: Subject: Light reading - see pieces beginning on page 7 @@ -412,7 +412,7 @@ fax 713-646-8272 cell 713-539-4760'); INSERT INTO email([from],[to],subject,body) VALUES('eric.bass@enron.com', 'dale.neuner@enron.com', '5 X 24', 'Dale, -Have you heard anything more on the 5 X 24s? We would like to get this +Have you heard anything more on the 5 X 24s? We would like to get this product out ASAP. @@ -420,36 +420,36 @@ Thanks, Eric'); INSERT INTO email([from],[to],subject,body) VALUES('messenger@smartreminders.com', 'm..tholt@enron.com', '10% Coupon - PrintPal Printer Cartridges - 100% Guaranteed', '[IMAGE] -[IMAGE][IMAGE][IMAGE] +[IMAGE][IMAGE][IMAGE] Dear SmartReminders Member, - [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] - - - - - - - - - - - - - - - - - - - - + [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] [IMAGE] + + + + + + + + + + + + + + + + + + + + We respect your privacy and are a Certified Participant of the BBBOnLine - Privacy Program. To be removed from future offers,click here. + Privacy Program. To be removed from future offers,click here. SmartReminders.com is a permission based service. To unsubscribe click here . '); -INSERT INTO email([from],[to],subject,body) VALUES('benjamin.rogers@enron.com', 'mark.bernstein@enron.com', '', 'The guy you are talking about left CIN under a "cloud of suspicion" sort of -speak. He was the one who got into several bad deals and PPA''s in California -for CIN, thus he left on a bad note. Let me know if you need more detail +INSERT INTO email([from],[to],subject,body) VALUES('benjamin.rogers@enron.com', 'mark.bernstein@enron.com', '', 'The guy you are talking about left CIN under a "cloud of suspicion" sort of +speak. He was the one who got into several bad deals and PPA''s in California +for CIN, thus he left on a bad note. Let me know if you need more detail than that, I felt this was the type of info you were looking for. Thanks! Ben'); INSERT INTO email([from],[to],subject,body) VALUES('enron_update@concureworkplace.com', 'michelle.cash@enron.com', 'Expense Report Receipts Not Received', 'Employee Name: Michelle Cash @@ -468,7 +468,7 @@ Fax:(415) 782-7854 ----- Forwarded by Susan J Mara/NA/Enron on 06/08/2001 12:24 PM ----- - "Milner, Marcie" 06/08/2001 11:13 AM To: "''smara@enron.com''" cc: Subject: CAISO Emergency Motion + "Milner, Marcie" 06/08/2001 11:13 AM To: "''smara@enron.com''" cc: Subject: CAISO Emergency Motion Sue, did you see this emergency motion the CAISO filed today? Apparently @@ -480,7 +480,7 @@ doing? Marcie -http://www.caiso.com/docs/2001/06/08/200106081005526469.pdf +http://www.caiso.com/docs/2001/06/08/200106081005526469.pdf '); INSERT INTO email([from],[to],subject,body) VALUES('fletcher.sturm@enron.com', 'eloy.escobar@enron.com', 'Re: General Brinks Position Meeting', 'Eloy, @@ -489,27 +489,27 @@ Who is General Brinks? Fletch'); INSERT INTO email([from],[to],subject,body) VALUES('nailia.dindarova@enron.com', 'richard.shapiro@enron.com', 'Documents for Mark Frevert (on EU developments and lessons from', 'Rick, -Here are the documents that Peter has prepared for Mark Frevert. +Here are the documents that Peter has prepared for Mark Frevert. Nailia ----------------------- Forwarded by Nailia Dindarova/LON/ECT on 25/06/2001 +---------------------- Forwarded by Nailia Dindarova/LON/ECT on 25/06/2001 16:36 --------------------------- Nailia Dindarova 25/06/2001 15:36 To: Michael Brown/Enron@EUEnronXGate -cc: Ross Sankey/Enron@EUEnronXGate, Eric Shaw/ENRON@EUEnronXGate, Peter -Styles/LON/ECT@ECT +cc: Ross Sankey/Enron@EUEnronXGate, Eric Shaw/ENRON@EUEnronXGate, Peter +Styles/LON/ECT@ECT -Subject: Documents for Mark Frevert (on EU developments and lessons from +Subject: Documents for Mark Frevert (on EU developments and lessons from California) Michael, -These are the documents that Peter promised to give to you for Mark Frevert. -He has now handed them to him in person but asked me to transmit them +These are the documents that Peter promised to give to you for Mark Frevert. +He has now handed them to him in person but asked me to transmit them electronically to you, as well as Eric and Ross. Nailia @@ -542,30 +542,30 @@ Peggy (See attached file: accenture-dealpoints v2.doc) - accenture-dealpoints v2.doc '); -INSERT INTO email([from],[to],subject,body) VALUES('thomas.martin@enron.com', 'thomas.martin@enron.com', 'Re: Guadalupe Power Partners LP', '---------------------- Forwarded by Thomas A Martin/HOU/ECT on 03/20/2001 +INSERT INTO email([from],[to],subject,body) VALUES('thomas.martin@enron.com', 'thomas.martin@enron.com', 'Re: Guadalupe Power Partners LP', '---------------------- Forwarded by Thomas A Martin/HOU/ECT on 03/20/2001 03:49 PM --------------------------- Thomas A Martin 10/11/2000 03:55 PM To: Patrick Wade/HOU/ECT@ECT -cc: -Subject: Re: Guadalupe Power Partners LP +cc: +Subject: Re: Guadalupe Power Partners LP -The deal is physically served at Oasis Waha or Oasis Katy and is priced at -either HSC, Waha or Katytailgate GD at buyers option three days prior to +The deal is physically served at Oasis Waha or Oasis Katy and is priced at +either HSC, Waha or Katytailgate GD at buyers option three days prior to NYMEX close. '); -INSERT INTO email([from],[to],subject,body) VALUES('judy.townsend@enron.com', 'dan.junek@enron.com, chris.germany@enron.com', 'Columbia Distribution''s Capacity Available for Release - Sum', '---------------------- Forwarded by Judy Townsend/HOU/ECT on 03/09/2001 11:04 +INSERT INTO email([from],[to],subject,body) VALUES('judy.townsend@enron.com', 'dan.junek@enron.com, chris.germany@enron.com', 'Columbia Distribution''s Capacity Available for Release - Sum', '---------------------- Forwarded by Judy Townsend/HOU/ECT on 03/09/2001 11:04 AM --------------------------- agoddard@nisource.com on 03/08/2001 09:16:57 AM -To: " - *Koch, Kent" , " - -*Millar, Debra" , " - *Burke, Lynn" +To: " - *Koch, Kent" , " - +*Millar, Debra" , " - *Burke, Lynn" -cc: " - *Heckathorn, Tom" +cc: " - *Heckathorn, Tom" Subject: Columbia Distribution''s Capacity Available for Release - Sum @@ -586,17 +586,17 @@ Aaron Goddard - 2001Summer.doc '); -INSERT INTO email([from],[to],subject,body) VALUES('rhonda.denton@enron.com', 'tim.belden@enron.com, dana.davis@enron.com, genia.fitzgerald@enron.com,', 'Split Rock Energy LLC', 'We have received the executed EEI contract from this CP dated 12/12/2000. +INSERT INTO email([from],[to],subject,body) VALUES('rhonda.denton@enron.com', 'tim.belden@enron.com, dana.davis@enron.com, genia.fitzgerald@enron.com,', 'Split Rock Energy LLC', 'We have received the executed EEI contract from this CP dated 12/12/2000. Copies will be distributed to Legal and Credit.'); INSERT INTO email([from],[to],subject,body) VALUES('kerrymcelroy@dwt.com', 'jack.speer@alcoa.com, crow@millernash.com, michaelearly@earthlink.net,', 'Oral Argument Request', ' - Oral Argument Request.doc'); -INSERT INTO email([from],[to],subject,body) VALUES('mike.carson@enron.com', 'rlmichaelis@hormel.com', '', 'Did you come in town this wk end..... My new number at our house is : +INSERT INTO email([from],[to],subject,body) VALUES('mike.carson@enron.com', 'rlmichaelis@hormel.com', '', 'Did you come in town this wk end..... My new number at our house is : 713-668-3712...... my cell # is 281-381-7332 the kid'); INSERT INTO email([from],[to],subject,body) VALUES('cooper.richey@enron.com', 'trycooper@hotmail.com', 'FW: Contact Info', ' -----Original Message----- -From: Punja, Karim +From: Punja, Karim Sent: Thursday, December 13, 2001 2:35 PM To: Richey, Cooper Subject: Contact Info @@ -610,7 +610,7 @@ I hope we can stay in touch. Home# 234-0249 email: kpunja@hotmail.com -Take Care, +Take Care, Karim. '); @@ -634,44 +634,44 @@ San Antonio, Texas May 2-4, 2001 Westin Riverwalk See attached memo for more details!! -? Registration for the law conference this year will be handled through an -Online RSVP Form on the Enron Law Conference Website at -http://lawconference.corp.enron.com. The website is still under construction -and will not be available until Thursday, March 15, 2001. +? Registration for the law conference this year will be handled through an +Online RSVP Form on the Enron Law Conference Website at +http://lawconference.corp.enron.com. The website is still under construction +and will not be available until Thursday, March 15, 2001. -? We will send you another e-mail to confirm when the Law Conference Website -is operational. +? We will send you another e-mail to confirm when the Law Conference Website +is operational. -? Please complete the Online RSVP Form as soon as it is available and submit -it no later than Friday, March 30th. +? Please complete the Online RSVP Form as soon as it is available and submit +it no later than Friday, March 30th. '); -INSERT INTO email([from],[to],subject,body) VALUES('tori.kuykendall@enron.com', 'heath.b.taylor@accenture.com', 'Re:', 'hey - thats funny about john - he definitely remembers him - i''ll call pat -and let him know - we are coming on saturday - i just havent had a chance to -call you guys back -- looking forward to it -- i probably need the +INSERT INTO email([from],[to],subject,body) VALUES('tori.kuykendall@enron.com', 'heath.b.taylor@accenture.com', 'Re:', 'hey - thats funny about john - he definitely remembers him - i''ll call pat +and let him know - we are coming on saturday - i just havent had a chance to +call you guys back -- looking forward to it -- i probably need the directions again though'); INSERT INTO email([from],[to],subject,body) VALUES('darron.giron@enron.com', 'bryce.baxter@enron.com', 'Re: Feedback for Audrey Cook', 'Bryce, -I''ll get it done today. +I''ll get it done today. DG 3-9573 - - - + + + From: Bryce Baxter 06/12/2000 07:15 PM - + To: Darron C Giron/HOU/ECT@ECT -cc: +cc: Subject: Feedback for Audrey Cook -You were identified as a reviewer for Audrey Cook. If possible, could you -complete her feedback by end of business Wednesday? It will really help me +You were identified as a reviewer for Audrey Cook. If possible, could you +complete her feedback by end of business Wednesday? It will really help me in the PRC process to have your input. Thanks. '); @@ -697,7 +697,7 @@ INSERT INTO email([from],[to],subject,body) VALUES('darrell.schoolcraft@enron.co ds - + '); INSERT INTO email([from],[to],subject,body) VALUES('mcominsky@aol.com', 'cpatman@bracepatt.com, james_derrick@enron.com', 'Jurisprudence Luncheon', 'Carrin & Jim -- @@ -721,8 +721,8 @@ Anti-Defamation League 713/627-3490, ext. 122 713/627-2011 (fax) MCominsky@aol.com'); -INSERT INTO email([from],[to],subject,body) VALUES('phillip.love@enron.com', 'todagost@utmb.edu, gbsonnta@utmb.edu', 'New President', 'I had a little bird put a word in my ear. Is there any possibility for Ben -Raimer to be Bush''s secretary of HHS? Just curious about that infamous UTMB +INSERT INTO email([from],[to],subject,body) VALUES('phillip.love@enron.com', 'todagost@utmb.edu, gbsonnta@utmb.edu', 'New President', 'I had a little bird put a word in my ear. Is there any possibility for Ben +Raimer to be Bush''s secretary of HHS? Just curious about that infamous UTMB rumor mill. Hope things are well, happy holidays. PL'); INSERT INTO email([from],[to],subject,body) VALUES('marie.heard@enron.com', 'ehamilton@fna.com', 'ISDA Master Agreement', 'Erin: @@ -741,7 +741,7 @@ marie.heard@enron.com '); INSERT INTO email([from],[to],subject,body) VALUES('andrea.ring@enron.com', 'beverly.beaty@enron.com', 'Re: Tennessee Buy - Louis Dreyfus', 'Beverly - once again thanks so much for your help on this. - + '); INSERT INTO email([from],[to],subject,body) VALUES('karolyn.criado@enron.com', 'j..bonin@enron.com, felicia.case@enron.com, b..clapp@enron.com,', 'Price List week of Oct. 8-9, 2001', ' @@ -752,7 +752,7 @@ Karolyn Criado 3-9441 - + '); INSERT INTO email([from],[to],subject,body) VALUES('kevin.presto@enron.com', 'edward.baughman@enron.com, billy.braddock@enron.com', 'Associated', 'Please begin working on filling our Associated short position in 02. I would like to take this risk off the books. @@ -762,9 +762,9 @@ In addition, please find out what a buy-out of VEPCO would cost us. With Roger We also need to continue to explore a JEA buy-out. Thanks.'); -INSERT INTO email([from],[to],subject,body) VALUES('stacy.dickson@enron.com', 'gregg.penman@enron.com', 'RE: Constellation TC 5-7-01', 'Gregg, +INSERT INTO email([from],[to],subject,body) VALUES('stacy.dickson@enron.com', 'gregg.penman@enron.com', 'RE: Constellation TC 5-7-01', 'Gregg, -I am at home with a sick baby. (Lots of fun!) I will call you about this +I am at home with a sick baby. (Lots of fun!) I will call you about this tomorrow. Stacy'); @@ -774,18 +774,18 @@ INSERT INTO email([from],[to],subject,body) VALUES('joe.quenet@enron.com', 'dfin INSERT INTO email([from],[to],subject,body) VALUES('k..allen@enron.com', 'jacqestc@aol.com', '', 'Jacques, I sent you a fax of Kevin Kolb''s comments on the release. The payoff on the note would be $36,248 ($36090(principal) + $158 (accrued interest)). -This is assuming we wrap this up on Tuesday. +This is assuming we wrap this up on Tuesday. Please email to confirm that their changes are ok so I can set up a meeting on Tuesday to reach closure. Phillip'); INSERT INTO email([from],[to],subject,body) VALUES('kourtney.nelson@enron.com', 'mike.swerzbin@enron.com', 'Adjusted L/R Balance', 'Mike, -I placed the adjusted L/R Balance on the Enronwest site. It is under the "Staff/Kourtney Nelson". There are two links: +I placed the adjusted L/R Balance on the Enronwest site. It is under the "Staff/Kourtney Nelson". There are two links: -1) "Adj L_R" is the same data/format from the weekly strategy meeting. +1) "Adj L_R" is the same data/format from the weekly strategy meeting. 2) "New Gen 2001_2002" link has all of the supply side info that is used to calculate the L/R balance - -Please note the Data Flag column, a value of "3" indicates the project was cancelled, on hold, etc and is not included in the calc. + -Please note the Data Flag column, a value of "3" indicates the project was cancelled, on hold, etc and is not included in the calc. Both of these sheets are interactive Excel spreadsheets and thus you can play around with the data as you please. Also, James Bruce is working to get his gen report on the web. That will help with your access to information on new gen. @@ -796,14 +796,14 @@ Kourtney Kourtney Nelson -Fundamental Analysis +Fundamental Analysis Enron North America (503) 464-8280 kourtney.nelson@enron.com'); INSERT INTO email([from],[to],subject,body) VALUES('d..thomas@enron.com', 'naveed.ahmed@enron.com', 'FW: Current Enron TCC Portfolio', ' -----Original Message----- -From: Grace, Rebecca M. +From: Grace, Rebecca M. Sent: Monday, December 17, 2001 9:44 AM To: Thomas, Paul D. Cc: Cashion, Jim; Allen, Thresa A.; May, Tom @@ -821,19 +821,19 @@ Rebecca -----Original Message----- -From: Thomas, Paul D. +From: Thomas, Paul D. Sent: Monday, December 17, 2001 9:08 AM To: Grace, Rebecca M. Subject: FW: Current Enron TCC Portfolio - << File: enrontccs.xls >> + << File: enrontccs.xls >> Rebecca, Let me know if you see any differences. Paul X 3-0403 -----Original Message----- -From: Thomas, Paul D. +From: Thomas, Paul D. Sent: Monday, December 17, 2001 9:04 AM To: Ahmed, Naveed Subject: FW: Current Enron TCC Portfolio @@ -842,32 +842,32 @@ Subject: FW: Current Enron TCC Portfolio -----Original Message----- -From: Thomas, Paul D. +From: Thomas, Paul D. Sent: Thursday, December 13, 2001 10:01 AM To: Baughman, Edward D. Subject: Current Enron TCC Portfolio '); -INSERT INTO email([from],[to],subject,body) VALUES('stephanie.panus@enron.com', 'william.bradford@enron.com, debbie.brackett@enron.com,', 'Coastal Merchant Energy/El Paso Merchant Energy', 'Coastal Merchant Energy, L.P. merged with and into El Paso Merchant Energy, -L.P., effective February 1, 2001, with the surviving entity being El Paso -Merchant Energy, L.P. We currently have ISDA Master Agreements with both -counterparties. Please see the attached memo regarding the existing Masters +INSERT INTO email([from],[to],subject,body) VALUES('stephanie.panus@enron.com', 'william.bradford@enron.com, debbie.brackett@enron.com,', 'Coastal Merchant Energy/El Paso Merchant Energy', 'Coastal Merchant Energy, L.P. merged with and into El Paso Merchant Energy, +L.P., effective February 1, 2001, with the surviving entity being El Paso +Merchant Energy, L.P. We currently have ISDA Master Agreements with both +counterparties. Please see the attached memo regarding the existing Masters and let us know which agreement should be terminated. Thanks, Stephanie '); -INSERT INTO email([from],[to],subject,body) VALUES('kam.keiser@enron.com', 'c..kenne@enron.com', 'RE: What about this too???', ' +INSERT INTO email([from],[to],subject,body) VALUES('kam.keiser@enron.com', 'c..kenne@enron.com', 'RE: What about this too???', ' -----Original Message----- -From: Kenne, Dawn C. +From: Kenne, Dawn C. Sent: Wednesday, February 06, 2002 11:50 AM To: Keiser, Kam Subject: What about this too??? - << File: Netco Trader Matrix.xls >> + << File: Netco Trader Matrix.xls >> '); INSERT INTO email([from],[to],subject,body) VALUES('chris.meyer@enron.com', 'joe.parks@enron.com', 'Centana', 'Talked to Chip. We do need Cash Committe approval given the netting feature of your deal, which means Batch Funding Request. Please update per my previous e-mail and forward. @@ -903,7 +903,7 @@ We got a request for guest access through MG. The company is called Escondida and is a subsidiary of BHP Australia. Please advise if I can set up a guest account or not. -F.Y.I.: MG is planning to put a "in w/h Chile" contract for Copper on-line as +F.Y.I.: MG is planning to put a "in w/h Chile" contract for Copper on-line as soon as Enron has done the due diligence for this country. Thanks ! @@ -948,10 +948,10 @@ Please refer to the Worldwide Customer Support card for a complete technical sup INSERT INTO email([from],[to],subject,body) VALUES('geoff.storey@enron.com', 'dutch.quigley@enron.com', 'RE:', 'duke contact? -----Original Message----- -From: Quigley, Dutch +From: Quigley, Dutch Sent: Wednesday, October 31, 2001 10:14 AM To: Storey, Geoff -Subject: RE: +Subject: RE: bp corp Albert LaMore 281-366-4962 @@ -959,30 +959,30 @@ running the reports now -----Original Message----- -From: Storey, Geoff +From: Storey, Geoff Sent: Wednesday, October 31, 2001 10:10 AM To: Quigley, Dutch -Subject: RE: +Subject: RE: give me a contact over there too BP -----Original Message----- -From: Quigley, Dutch +From: Quigley, Dutch Sent: Wednesday, October 31, 2001 9:42 AM To: Storey, Geoff -Subject: +Subject: Coral Jeff Whitnah 713-767-5374 Relaint Steve McGinn 713-207-4000'); -INSERT INTO email([from],[to],subject,body) VALUES('pete.davis@enron.com', 'pete.davis@enron.com', 'Start Date: 4/22/01; HourAhead hour: 3; ', 'Start Date: 4/22/01; HourAhead hour: 3; No ancillary schedules awarded. +INSERT INTO email([from],[to],subject,body) VALUES('pete.davis@enron.com', 'pete.davis@enron.com', 'Start Date: 4/22/01; HourAhead hour: 3; ', 'Start Date: 4/22/01; HourAhead hour: 3; No ancillary schedules awarded. Variances detected. Variances detected in Load schedule. LOG MESSAGES: -PARSING FILE -->> O:\Portland\WestDesk\California Scheduling\ISO Final +PARSING FILE -->> O:\Portland\WestDesk\California Scheduling\ISO Final Schedules\2001042203.txt ---- Load Schedule ---- @@ -995,12 +995,12 @@ $$$ Variance found in table tblLoads. SC_ID: EPMI '); -INSERT INTO email([from],[to],subject,body) VALUES('john.postlethwaite@enron.com', 'john.zufferli@enron.com', 'Reference', 'John, hope things are going well up there for you. The big day is almost here for you and Jessica. I was wondering if I could use your name as a job reference if need be. I am just trying to get everything in order just in case something happens. +INSERT INTO email([from],[to],subject,body) VALUES('john.postlethwaite@enron.com', 'john.zufferli@enron.com', 'Reference', 'John, hope things are going well up there for you. The big day is almost here for you and Jessica. I was wondering if I could use your name as a job reference if need be. I am just trying to get everything in order just in case something happens. John'); -INSERT INTO email([from],[to],subject,body) VALUES('jeffrey.shankman@enron.com', 'lschiffm@jonesday.com', 'Re:', 'I saw you called on the cell this a.m. Sorry I missed you. (I was in the -shower). I have had a shitty week--I suspect my silence (not only to you, -but others) after our phone call is a result of the week. I''m seeing Glen at +INSERT INTO email([from],[to],subject,body) VALUES('jeffrey.shankman@enron.com', 'lschiffm@jonesday.com', 'Re:', 'I saw you called on the cell this a.m. Sorry I missed you. (I was in the +shower). I have had a shitty week--I suspect my silence (not only to you, +but others) after our phone call is a result of the week. I''m seeing Glen at 11:15....talk to you'); INSERT INTO email([from],[to],subject,body) VALUES('litebytz@enron.com', '', 'Lite Bytz RSVP', ' This week''s Lite Bytz presentation will feature the following TOOLZ speaker: @@ -1131,7 +1131,7 @@ do_test fts3ac-4.2 { SELECT snippet(email) FROM email WHERE email MATCH 'christmas candlelight' } -} {{...here Christmas +} {{...here Christmas eve?? They have an 11:00 a.m. service and a candlelight service...}} do_test fts3ac-4.3 { @@ -1159,7 +1159,7 @@ do_test fts3ac-4.6 { SELECT snippet(email) FROM email WHERE email MATCH 'chris is here' } -} {{...chris.germany@enron.com'" <chris...bet this is next to...about going here Christmas +} {{...chris.germany@enron.com'" <chris...bet this is next to...about going here Christmas eve...}} do_test fts3ac-4.7 { execsql { diff --git a/third_party/sqlite/src/test/fts3ad.test b/third_party/sqlite/src/test/fts3ad.test index e373339d4e74b..2b1961558d263 100644 --- a/third_party/sqlite/src/test/fts3ad.test +++ b/third_party/sqlite/src/test/fts3ad.test @@ -38,7 +38,7 @@ do_test fts3ad-1.2 { } {{running and jumping}} do_test fts3ad-1.3 { execsql { - INSERT INTO t1(rowid, content) + INSERT INTO t1(rowid, content) VALUES(2, 'abcdefghijklmnopqrstuvwyxz'); SELECT rowid, snippet(t1) FROM t1 WHERE t1 MATCH 'abcdefghijqrstuvwyxz' } @@ -50,7 +50,7 @@ do_test fts3ad-1.4 { } {2 abcdefghijklmnopqrstuvwyxz} do_test fts3ad-1.5 { execsql { - INSERT INTO t1(rowid, content) + INSERT INTO t1(rowid, content) VALUES(3, 'The value is 123456789'); SELECT rowid, snippet(t1) FROM t1 WHERE t1 MATCH '123789' } diff --git a/third_party/sqlite/src/test/fts3ah.test b/third_party/sqlite/src/test/fts3ah.test index 3810ec37b5c8c..a24d34e5a5485 100644 --- a/third_party/sqlite/src/test/fts3ah.test +++ b/third_party/sqlite/src/test/fts3ah.test @@ -1,4 +1,4 @@ -# 2006 October 31 +# 2006 October 31 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: diff --git a/third_party/sqlite/src/test/fts3al.test b/third_party/sqlite/src/test/fts3al.test index 02cc0d1695297..78d60f53c02d7 100644 --- a/third_party/sqlite/src/test/fts3al.test +++ b/third_party/sqlite/src/test/fts3al.test @@ -56,7 +56,7 @@ do_test fts3al-1.3 { # # UPDATE: The above is no longer true; there is no such code in fts3. # But leave the test in just the same. -# +# set word "\x80xxxxx\x80xxxxx\x80xxxxx\x80xxxxx\x80xxxxx\x80xxxxx\x80" set phrase1 "$word $word $word target $word $word $word" diff --git a/third_party/sqlite/src/test/fts3ao.test b/third_party/sqlite/src/test/fts3ao.test index 60f0aa7d90e49..c19c721dddfd7 100644 --- a/third_party/sqlite/src/test/fts3ao.test +++ b/third_party/sqlite/src/test/fts3ao.test @@ -107,7 +107,7 @@ do_test fts3ao-2.12 { } {{one three four} {one four} {one four two}} #------------------------------------------------------------------- -# Close, delete and reopen the database. The following test should +# Close, delete and reopen the database. The following test should # be run on an initially empty db. # db close @@ -133,7 +133,7 @@ do_test fts3ao-3.2 { } {{one three four} {one four} {one two} {one three four} {one four} {one two}} #--------------------------------------------------------------------- -# Test that it is possible to rename an fts3 table in an attached +# Test that it is possible to rename an fts3 table in an attached # database. # forcedelete test2.db test2.db-journal @@ -169,7 +169,7 @@ do_test fts3ao-3.3 { } {{one three four} {one four} {one two}} #--------------------------------------------------------------------- -# Test that it is possible to rename an fts3 table within a +# Test that it is possible to rename an fts3 table within a # transaction. # do_test fts3ao-4.1 { diff --git a/third_party/sqlite/src/test/fts3atoken.test b/third_party/sqlite/src/test/fts3atoken.test index 4ce38762d6a9c..e88c2fc8a3c95 100644 --- a/third_party/sqlite/src/test/fts3atoken.test +++ b/third_party/sqlite/src/test/fts3atoken.test @@ -8,8 +8,8 @@ # May you share freely, never taking more than you give. # #************************************************************************* -# This file implements regression tests for SQLite library. The focus -# of this script is testing the pluggable tokeniser feature of the +# This file implements regression tests for SQLite library. The focus +# of this script is testing the pluggable tokeniser feature of the # FTS3 module. # # $Id: fts3atoken.test,v 1.1 2007/08/20 17:38:42 shess Exp $ @@ -51,7 +51,7 @@ proc escape_string {str} { # 3: Test that the value returned for tokenizer 'blah' is now the # same as that retrieved for 'simple'. # -# 4: Test that it is now possible to create an fts3 table using +# 4: Test that it is now possible to create an fts3 table using # tokenizer 'blah' (it was not possible in step 1). # # 5: Test that the table created to use tokenizer 'blah' is usable. @@ -128,7 +128,7 @@ ifcapable icu { #-------------------------------------------------------------------------- # Test cases fts3atoken-4.* test the ICU tokenizer. In practice, this # tokenizer only has two modes - "thai" and "everybody else". Some other -# Asian languages (Lao, Khmer etc.) require the same special treatment as +# Asian languages (Lao, Khmer etc.) require the same special treatment as # Thai, but ICU doesn't support them yet. # ifcapable icu { @@ -139,14 +139,14 @@ ifcapable icu { lindex $::out 0 } $output } - + do_icu_test fts3atoken-4.1 en_US {} {} do_icu_test fts3atoken-4.2 en_US {Test cases fts3} [list \ 0 test Test 1 cases cases 2 fts3 fts3 ] # The following test shows that ICU is smart enough to recognise - # Thai chararacters, even when the locale is set to English/United + # Thai chararacters, even when the locale is set to English/United # States. # set input "\u0e2d\u0e30\u0e44\u0e23\u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a" diff --git a/third_party/sqlite/src/test/fts3auto.test b/third_party/sqlite/src/test/fts3auto.test index 20640d29ac7c4..7c0d77f9a1bf7 100644 --- a/third_party/sqlite/src/test/fts3auto.test +++ b/third_party/sqlite/src/test/fts3auto.test @@ -25,7 +25,7 @@ set sqlite_fts3_enable_parentheses 1 # # do_fts3query_test # fts3_make_deferrable -# fts3_zero_long_segments +# fts3_zero_long_segments # # @@ -37,7 +37,7 @@ set sqlite_fts3_enable_parentheses 1 # The name and column names used by $TABLE must not require any quoting or # escaping when used in SQL statements. # -# $MATCHINFO may be any expression accepted by the FTS4 MATCH operator, +# $MATCHINFO may be any expression accepted by the FTS4 MATCH operator, # except that the ":token" syntax is not supported. Tcl list # commands are used to tokenize the expression. Any parenthesis must appear # either as separate list elements, or as the first (for opening) or last @@ -50,7 +50,7 @@ set sqlite_fts3_enable_parentheses 1 # # If the "deferred" option is supplied, it is passed a list of tokens that # are deferred by FTS and result in the relevant matchinfo() stats being an -# approximation. +# approximation. # set sqlite_fts3_enable_parentheses 1 proc do_fts3query_test {tn args} { @@ -91,19 +91,19 @@ proc do_fts3query_test {tn args} { do_execsql_test $tn$title.1 " SELECT docid FROM $tbl WHERE $tbl MATCH '$match' ORDER BY docid ASC - " [lsort -integer -incr [array names aHit]] + " [lsort -integer -incr [array names aHit]] do_execsql_test $tn$title.2 " SELECT docid FROM $tbl WHERE $tbl MATCH '$match' ORDER BY docid DESC - " [lsort -integer -decr [array names aHit]] + " [lsort -integer -decr [array names aHit]] do_execsql_test $tn$title.3 " - SELECT docid, mit(matchinfo($tbl, 'x')) FROM $tbl + SELECT docid, mit(matchinfo($tbl, 'x')) FROM $tbl WHERE $tbl MATCH '$match' ORDER BY docid DESC " $matchinfo_desc do_execsql_test $tn$title.4 " - SELECT docid, mit(matchinfo($tbl, 'x')) FROM $tbl + SELECT docid, mit(matchinfo($tbl, 'x')) FROM $tbl WHERE $tbl MATCH '$match' ORDER BY docid ASC " $matchinfo_asc } @@ -134,9 +134,9 @@ proc fts3_make_deferrable {tbl token {nRow 0}} { # fts3_zero_long_segments TABLE ?LIMIT? # proc fts3_zero_long_segments {tbl limit} { - execsql " - UPDATE ${tbl}_segments - SET block = zeroblob(length(block)) + execsql " + UPDATE ${tbl}_segments + SET block = zeroblob(length(block)) WHERE length(block)>$limit " return [db changes] @@ -173,9 +173,9 @@ proc fix_phrase_expr {cols expr colfiltervar} { return $out } -proc fix_near_expr {cols expr colfiltervar} { +proc fix_near_expr {cols expr colfiltervar} { upvar $colfiltervar iColFilter - + set iColFilter -1 set out [list] @@ -201,7 +201,7 @@ proc get_single_near_results {tbl expr deferred arrayvar nullvar} { # Calculate the expected results using [fts3_near_match]. The following # loop populates the "hits" and "counts" arrays as follows: - # + # # 1. For each document in the table that matches the NEAR expression, # hits($docid) is set to 1. The set of docids that match the expression # can therefore be found using [array names hits]. @@ -230,7 +230,7 @@ proc get_single_near_results {tbl expr deferred arrayvar nullvar} { # This block populates the nHit and nDoc arrays. For each phrase/column # in the query/table, array elements are set as follows: # - # nHit($iPhrase,$iCol) - Total number of hits for phrase $iPhrase in + # nHit($iPhrase,$iCol) - Total number of hits for phrase $iPhrase in # column $iCol. # # nDoc($iPhrase,$iCol) - Number of documents with at least one hit for @@ -312,8 +312,8 @@ proc get_single_near_results {tbl expr deferred arrayvar nullvar} { proc matching_brackets {expr} { - if {[string range $expr 0 0]!="(" || [string range $expr end end] !=")"} { - return 0 + if {[string range $expr 0 0]!="(" || [string range $expr end end] !=")"} { + return 0 } set iBracket 1 @@ -410,7 +410,7 @@ proc get_near_results {tbl expr deferred arrayvar {nullvar ""}} { #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- -# The following test cases - fts3auto-1.* - focus on testing the Tcl +# The following test cases - fts3auto-1.* - focus on testing the Tcl # command [fts3_near_match], which is used by other tests in this file. # proc test_fts3_near_match {tn doc expr res} { @@ -436,7 +436,7 @@ test_fts3_near_match 1.3.1 $A {"c d" 5 "i j" 1 "e f"} {0 0 0} test_fts3_near_match 1.3.2 $A {"c d" 5 "i j" 2 "e f"} {1 1 1} #-------------------------------------------------------------------------- -# Test cases fts3auto-2.* run some simple tests using the +# Test cases fts3auto-2.* run some simple tests using the # [do_fts3query_test] proc. # foreach {tn create} { @@ -526,7 +526,7 @@ foreach {tn create} { } #-------------------------------------------------------------------------- -# +# foreach {tn create} { 1 "fts4(x, y)" 2 "fts4(x, y, order=DESC)" @@ -547,7 +547,7 @@ foreach {tn create} { do_fts3query_test 4.$tn.1.4 t1 {one NEAR/2 five} do_fts3query_test 4.$tn.1.5 t1 {one NEAR/3 five} - do_test 4.$tn.2 { + do_test 4.$tn.2 { set limit [fts3_make_deferrable t1 five] execsql { INSERT INTO t1(t1) VALUES('optimize') } ifcapable fts4_deferred { diff --git a/third_party/sqlite/src/test/fts3aux1.test b/third_party/sqlite/src/test/fts3aux1.test index b6111f8470a94..f5eceeac900e7 100644 --- a/third_party/sqlite/src/test/fts3aux1.test +++ b/third_party/sqlite/src/test/fts3aux1.test @@ -26,15 +26,15 @@ do_execsql_test 1.1 { CREATE VIRTUAL TABLE terms USING fts4aux(t1); SELECT term, documents, occurrences FROM terms WHERE col = '*'; } { - five 2 2 four 2 2 one 2 2 seven 1 1 + five 2 2 four 2 2 one 2 2 seven 1 1 six 1 1 three 3 3 two 1 1 } do_execsql_test 1.2 { INSERT INTO t1 VALUES('one one one three three three'); SELECT term, documents, occurrences FROM terms WHERE col = '*'; -} { - five 2 2 four 2 2 one 3 5 seven 1 1 +} { + five 2 2 four 2 2 one 3 5 seven 1 1 six 1 1 three 4 6 two 1 1 } @@ -60,13 +60,13 @@ do_execsql_test 1.4 { # The following tests verify that the fts4aux module uses the full-text # index to reduce the number of rows scanned in the following circumstances: # -# * when there is equality comparison against the term column using the -# BINARY collating sequence. +# * when there is equality comparison against the term column using the +# BINARY collating sequence. # -# * when there is a range constraint on the term column using the BINARY -# collating sequence. +# * when there is a range constraint on the term column using the BINARY +# collating sequence. # -# And also uses the full-text index to optimize ORDER BY clauses of the +# And also uses the full-text index to optimize ORDER BY clauses of the # form "ORDER BY term ASC" or equivalent. # # Test organization is: @@ -74,7 +74,7 @@ do_execsql_test 1.4 { # fts3aux1-2.1.*: equality constraints. # fts3aux1-2.2.*: range constraints. # fts3aux1-2.3.*: ORDER BY optimization. -# +# do_execsql_test 2.0 { DROP TABLE t1; @@ -84,13 +84,13 @@ do_execsql_test 2.0 { INSERT INTO x1(x1) VALUES('nodesize=24'); CREATE VIRTUAL TABLE terms USING fts4aux(x1); - CREATE VIEW terms_v AS + CREATE VIEW terms_v AS SELECT term, documents, occurrences FROM terms WHERE col = '*'; INSERT INTO x1 VALUES('braes brag bragged bragger bragging'); INSERT INTO x1 VALUES('brags braid braided braiding braids'); INSERT INTO x1 VALUES('brain brainchild brained braining brains'); - INSERT INTO x1 VALUES('brainstem brainstems brainstorm brainstorms'); + INSERT INTO x1 VALUES('brainstem brainstems brainstorm brainstorms'); } proc rec {varname x} { @@ -124,7 +124,7 @@ do_test 2.1.2.2 { set cnt } {19} -# Similar to the test immediately above, but using a term ("breakfast") that +# Similar to the test immediately above, but using a term ("breakfast") that # is not featured in the dataset. # do_test 2.1.3.1 { @@ -186,46 +186,46 @@ do_test 2.2.2.2 { do_execsql_test 2.2.2.3 { SELECT term, documents, occurrences FROM terms_v WHERE term>'brain' } { - brainchild 1 1 brained 1 1 braining 1 1 brains 1 1 + brainchild 1 1 brained 1 1 braining 1 1 brains 1 1 brainstem 1 1 brainstems 1 1 brainstorm 1 1 brainstorms 1 1 } do_execsql_test 2.2.2.4 { SELECT term, documents, occurrences FROM terms_v WHERE +term>'brain' } { - brainchild 1 1 brained 1 1 braining 1 1 brains 1 1 + brainchild 1 1 brained 1 1 braining 1 1 brains 1 1 brainstem 1 1 brainstems 1 1 brainstorm 1 1 brainstorms 1 1 } do_execsql_test 2.2.2.5 { SELECT term, documents, occurrences FROM terms_v WHERE term>='brain' } { brain 1 1 - brainchild 1 1 brained 1 1 braining 1 1 brains 1 1 + brainchild 1 1 brained 1 1 braining 1 1 brains 1 1 brainstem 1 1 brainstems 1 1 brainstorm 1 1 brainstorms 1 1 } do_execsql_test 2.2.2.6 { SELECT term, documents, occurrences FROM terms_v WHERE +term>='brain' } { brain 1 1 - brainchild 1 1 brained 1 1 braining 1 1 brains 1 1 + brainchild 1 1 brained 1 1 braining 1 1 brains 1 1 brainstem 1 1 brainstems 1 1 brainstorm 1 1 brainstorms 1 1 } do_execsql_test 2.2.2.7 { SELECT term, documents, occurrences FROM terms_v WHERE term>='abc' } { - braes 1 1 brag 1 1 bragged 1 1 bragger 1 1 - bragging 1 1 brags 1 1 braid 1 1 braided 1 1 - braiding 1 1 braids 1 1 brain 1 1 brainchild 1 1 - brained 1 1 braining 1 1 brains 1 1 brainstem 1 1 + braes 1 1 brag 1 1 bragged 1 1 bragger 1 1 + bragging 1 1 brags 1 1 braid 1 1 braided 1 1 + braiding 1 1 braids 1 1 brain 1 1 brainchild 1 1 + brained 1 1 braining 1 1 brains 1 1 brainstem 1 1 brainstems 1 1 brainstorm 1 1 brainstorms 1 1 } do_execsql_test 2.2.2.8 { SELECT term, documents, occurrences FROM terms_v WHERE +term>='abc' } { - braes 1 1 brag 1 1 bragged 1 1 bragger 1 1 - bragging 1 1 brags 1 1 braid 1 1 braided 1 1 - braiding 1 1 braids 1 1 brain 1 1 brainchild 1 1 - brained 1 1 braining 1 1 brains 1 1 brainstem 1 1 + braes 1 1 brag 1 1 bragged 1 1 bragger 1 1 + bragging 1 1 brags 1 1 braid 1 1 braided 1 1 + braiding 1 1 braids 1 1 brain 1 1 brainchild 1 1 + brained 1 1 braining 1 1 brains 1 1 brainstem 1 1 brainstems 1 1 brainstorm 1 1 brainstorms 1 1 } @@ -254,67 +254,67 @@ do_test 2.2.3.2 { do_execsql_test 2.2.3.3 { SELECT term, documents, occurrences FROM terms_v WHERE term<'brain' } { - braes 1 1 brag 1 1 bragged 1 1 bragger 1 1 bragging 1 1 + braes 1 1 brag 1 1 bragged 1 1 bragger 1 1 bragging 1 1 brags 1 1 braid 1 1 braided 1 1 braiding 1 1 braids 1 1 } do_execsql_test 2.2.3.4 { SELECT term, documents, occurrences FROM terms_v WHERE +term<'brain' } { - braes 1 1 brag 1 1 bragged 1 1 bragger 1 1 bragging 1 1 + braes 1 1 brag 1 1 bragged 1 1 bragger 1 1 bragging 1 1 brags 1 1 braid 1 1 braided 1 1 braiding 1 1 braids 1 1 } do_execsql_test 2.2.3.5 { SELECT term, documents, occurrences FROM terms_v WHERE term<='brain' } { - braes 1 1 brag 1 1 bragged 1 1 bragger 1 1 bragging 1 1 + braes 1 1 brag 1 1 bragged 1 1 bragger 1 1 bragging 1 1 brags 1 1 braid 1 1 braided 1 1 braiding 1 1 braids 1 1 brain 1 1 } do_execsql_test 2.2.3.6 { SELECT term, documents, occurrences FROM terms_v WHERE +term<='brain' } { - braes 1 1 brag 1 1 bragged 1 1 bragger 1 1 bragging 1 1 + braes 1 1 brag 1 1 bragged 1 1 bragger 1 1 bragging 1 1 brags 1 1 braid 1 1 braided 1 1 braiding 1 1 braids 1 1 brain 1 1 } do_test 2.2.4.1 { set cnt 0 - execsql { - SELECT term, documents, occurrences FROM terms - WHERE rec('cnt', term) AND term BETWEEN 'brags' AND 'brain' + execsql { + SELECT term, documents, occurrences FROM terms + WHERE rec('cnt', term) AND term BETWEEN 'brags' AND 'brain' } set cnt } {12} do_test 2.2.4.2 { set cnt 0 - execsql { - SELECT term, documents, occurrences FROM terms - WHERE rec('cnt', term) AND +term BETWEEN 'brags' AND 'brain' + execsql { + SELECT term, documents, occurrences FROM terms + WHERE rec('cnt', term) AND +term BETWEEN 'brags' AND 'brain' } set cnt } {38} do_execsql_test 2.2.4.3 { - SELECT term, documents, occurrences FROM terms_v - WHERE rec('cnt', term) AND term BETWEEN 'brags' AND 'brain' + SELECT term, documents, occurrences FROM terms_v + WHERE rec('cnt', term) AND term BETWEEN 'brags' AND 'brain' } { - brags 1 1 braid 1 1 braided 1 1 braiding 1 1 braids 1 1 brain 1 1 + brags 1 1 braid 1 1 braided 1 1 braiding 1 1 braids 1 1 brain 1 1 } do_execsql_test 2.2.4.4 { - SELECT term, documents, occurrences FROM terms_v - WHERE rec('cnt', term) AND +term BETWEEN 'brags' AND 'brain' + SELECT term, documents, occurrences FROM terms_v + WHERE rec('cnt', term) AND +term BETWEEN 'brags' AND 'brain' } { - brags 1 1 braid 1 1 braided 1 1 braiding 1 1 braids 1 1 brain 1 1 + brags 1 1 braid 1 1 braided 1 1 braiding 1 1 braids 1 1 brain 1 1 } do_execsql_test 2.2.4.5 { - SELECT term, documents, occurrences FROM terms_v - WHERE rec('cnt', term) AND term > 'brags' AND term < 'brain' + SELECT term, documents, occurrences FROM terms_v + WHERE rec('cnt', term) AND term > 'brags' AND term < 'brain' } { braid 1 1 braided 1 1 braiding 1 1 braids 1 1 } do_execsql_test 2.2.4.6 { - SELECT term, documents, occurrences FROM terms_v - WHERE rec('cnt', term) AND +term > 'brags' AND +term < 'brain' + SELECT term, documents, occurrences FROM terms_v + WHERE rec('cnt', term) AND +term > 'brags' AND +term < 'brain' } { braid 1 1 braided 1 1 braiding 1 1 braids 1 1 } @@ -343,8 +343,8 @@ foreach {tn sort orderby} { } #------------------------------------------------------------------------- -# The next set of tests, fts3aux1-3.*, test error conditions in the -# fts4aux module. Except, fault injection testing (OOM, IO error etc.) is +# The next set of tests, fts3aux1-3.*, test error conditions in the +# fts4aux module. Except, fault injection testing (OOM, IO error etc.) is # done in fts3fault2.test # @@ -410,23 +410,23 @@ proc do_plansql_test {tn sql r} { do_plansql_test 4.2 { SELECT y FROM x2, terms WHERE y = term AND col = '*' } { - 0 0 0 {SCAN TABLE x2} - 0 1 1 {SCAN TABLE terms VIRTUAL TABLE INDEX 1:} + 0 0 0 {SCAN TABLE x2} + 0 1 1 {SCAN TABLE terms VIRTUAL TABLE INDEX 1:} a b c d e f g h i j k l } do_plansql_test 4.3 { SELECT y FROM terms, x2 WHERE y = term AND col = '*' } { - 0 0 1 {SCAN TABLE x2} - 0 1 0 {SCAN TABLE terms VIRTUAL TABLE INDEX 1:} + 0 0 1 {SCAN TABLE x2} + 0 1 0 {SCAN TABLE terms VIRTUAL TABLE INDEX 1:} a b c d e f g h i j k l } do_plansql_test 4.4 { SELECT y FROM x3, terms WHERE y = term AND col = '*' } { - 0 0 1 {SCAN TABLE terms VIRTUAL TABLE INDEX 0:} + 0 0 1 {SCAN TABLE terms VIRTUAL TABLE INDEX 0:} 0 1 0 {SEARCH TABLE x3 USING COVERING INDEX i1 (y=?)} a b c d e f g h i j k l } @@ -434,7 +434,7 @@ do_plansql_test 4.4 { do_plansql_test 4.5 { SELECT y FROM terms, x3 WHERE y = term AND occurrences>1 AND col = '*' } { - 0 0 0 {SCAN TABLE terms VIRTUAL TABLE INDEX 0:} + 0 0 0 {SCAN TABLE terms VIRTUAL TABLE INDEX 0:} 0 1 1 {SEARCH TABLE x3 USING COVERING INDEX i1 (y=?)} a k l } @@ -469,10 +469,10 @@ do_execsql_test 6.1 { CREATE VIRTUAL TABLE temp.aux1 USING fts4aux(main, ft1); SELECT * FROM aux1; } { - a * 2 3 a 0 2 3 - b * 2 3 b 0 1 1 b 1 1 2 - c * 2 2 c 1 2 2 - d * 2 2 d 1 2 2 + a * 2 3 a 0 2 3 + b * 2 3 b 0 1 1 b 1 1 2 + c * 2 2 c 1 2 2 + d * 2 2 d 1 2 2 e * 1 2 e 0 1 2 } @@ -485,21 +485,21 @@ do_execsql_test 6.2 { CREATE VIRTUAL TABLE temp.aux2 USING fts4aux(att, ft1); SELECT * FROM aux2; } { - v * 2 3 v 0 2 3 - w * 2 3 w 0 1 1 w 1 1 2 - x * 2 2 x 1 2 2 - y * 2 2 y 1 2 2 + v * 2 3 v 0 2 3 + w * 2 3 w 0 1 1 w 1 1 2 + x * 2 2 x 1 2 2 + y * 2 2 y 1 2 2 z * 1 2 z 0 1 2 } foreach {tn q res1 res2} { 1 { SELECT * FROM %%% WHERE term = 'a' } {a * 2 3 a 0 2 3} {} - 2 { SELECT * FROM %%% WHERE term = 'x' } {} {x * 2 2 x 1 2 2} + 2 { SELECT * FROM %%% WHERE term = 'x' } {} {x * 2 2 x 1 2 2} - 3 { SELECT * FROM %%% WHERE term >= 'y' } + 3 { SELECT * FROM %%% WHERE term >= 'y' } {} {y * 2 2 y 1 2 2 z * 1 2 z 0 1 2} - 4 { SELECT * FROM %%% WHERE term <= 'c' } + 4 { SELECT * FROM %%% WHERE term <= 'c' } {a * 2 3 a 0 2 3 b * 2 3 b 0 1 1 b 1 1 2 c * 2 2 c 1 2 2} {} } { set sql1 [string map {%%% aux1} $q] diff --git a/third_party/sqlite/src/test/fts3aux2.test b/third_party/sqlite/src/test/fts3aux2.test index e108fc4b80b58..f163f7a9051d7 100644 --- a/third_party/sqlite/src/test/fts3aux2.test +++ b/third_party/sqlite/src/test/fts3aux2.test @@ -56,89 +56,89 @@ do_execsql_test 1.2.7 { } {} do_execsql_test 1.3.1 { - SELECT term, documents, occurrences, languageid + SELECT term, documents, occurrences, languageid FROM terms WHERE col = '*' AND languageid=1; } { - four 1 1 1 one 1 1 1 three 1 1 1 two 1 1 1 + four 1 1 1 one 1 1 1 three 1 1 1 two 1 1 1 } do_execsql_test 1.3.2 { - SELECT term, col, documents, occurrences, languageid + SELECT term, col, documents, occurrences, languageid FROM terms WHERE languageid=1; } { - four * 1 1 1 four 1 1 1 1 - one * 1 1 1 one 0 1 1 1 - three * 1 1 1 three 1 1 1 1 - two * 1 1 1 two 0 1 1 1 + four * 1 1 1 four 1 1 1 1 + one * 1 1 1 one 0 1 1 1 + three * 1 1 1 three 1 1 1 1 + two * 1 1 1 two 0 1 1 1 } do_execsql_test 1.3.3 { - SELECT term, col, documents, occurrences, languageid + SELECT term, col, documents, occurrences, languageid FROM terms WHERE languageid=1 AND term='zero' } { } do_execsql_test 1.3.4 { - SELECT term, col, documents, occurrences, languageid + SELECT term, col, documents, occurrences, languageid FROM terms WHERE languageid='1' AND term='two' } { - two * 1 1 1 two 0 1 1 1 + two * 1 1 1 two 0 1 1 1 } do_execsql_test 1.3.5 { - SELECT term, col, documents, occurrences, languageid + SELECT term, col, documents, occurrences, languageid FROM terms WHERE languageid='+1' AND term>'four' } { - one * 1 1 1 one 0 1 1 1 - three * 1 1 1 three 1 1 1 1 - two * 1 1 1 two 0 1 1 1 + one * 1 1 1 one 0 1 1 1 + three * 1 1 1 three 1 1 1 1 + two * 1 1 1 two 0 1 1 1 } do_execsql_test 1.4.1 { - SELECT term, documents, occurrences, languageid + SELECT term, documents, occurrences, languageid FROM terms WHERE col = '*' AND languageid=2; } { eight 1 1 2 five 1 1 2 seven 1 1 2 six 1 1 2 } do_execsql_test 1.4.2 { - SELECT term, col, documents, occurrences, languageid + SELECT term, col, documents, occurrences, languageid FROM terms WHERE languageid=2; } { - eight * 1 1 2 eight 1 1 1 2 - five * 1 1 2 five 0 1 1 2 - seven * 1 1 2 seven 1 1 1 2 + eight * 1 1 2 eight 1 1 1 2 + five * 1 1 2 five 0 1 1 2 + seven * 1 1 2 seven 1 1 1 2 six * 1 1 2 six 0 1 1 2 } do_execsql_test 1.4.3 { - SELECT term, col, documents, occurrences, languageid + SELECT term, col, documents, occurrences, languageid FROM terms WHERE languageid=2 AND term='five'; } { - five * 1 1 2 five 0 1 1 2 + five * 1 1 2 five 0 1 1 2 } do_execsql_test 1.4.4 { - SELECT term, col, documents, occurrences, languageid - FROM terms WHERE term='five' AND languageid=2 + SELECT term, col, documents, occurrences, languageid + FROM terms WHERE term='five' AND languageid=2 } { - five * 1 1 2 five 0 1 1 2 + five * 1 1 2 five 0 1 1 2 } do_execsql_test 1.4.5 { - SELECT term, col, documents, occurrences, languageid + SELECT term, col, documents, occurrences, languageid FROM terms WHERE term>='seven' AND languageid=2 } { - seven * 1 1 2 seven 1 1 1 2 + seven * 1 1 2 seven 1 1 1 2 six * 1 1 2 six 0 1 1 2 } do_execsql_test 1.4.6 { - SELECT term, col, documents, occurrences, languageid + SELECT term, col, documents, occurrences, languageid FROM terms WHERE term>='e' AND term<'seven' AND languageid=2 } { - eight * 1 1 2 eight 1 1 1 2 - five * 1 1 2 five 0 1 1 2 + eight * 1 1 2 eight 1 1 1 2 + five * 1 1 2 five 0 1 1 2 } finish_test diff --git a/third_party/sqlite/src/test/fts3b.test b/third_party/sqlite/src/test/fts3b.test index 9bde3a254c288..f283e7a742751 100644 --- a/third_party/sqlite/src/test/fts3b.test +++ b/third_party/sqlite/src/test/fts3b.test @@ -212,7 +212,7 @@ do_test fts3b-4.9 { execsql { SELECT docid FROM t4 WHERE t4 MATCH 'testing' } } {12} do_test fts3b-4.10 { - execsql { + execsql { UPDATE t4 SET docid = 14 WHERE docid = 12; SELECT docid FROM t4 WHERE t4 MATCH 'testing'; } diff --git a/third_party/sqlite/src/test/fts3comp1.test b/third_party/sqlite/src/test/fts3comp1.test index 9f13aaa64ea59..549ecb89ea948 100644 --- a/third_party/sqlite/src/test/fts3comp1.test +++ b/third_party/sqlite/src/test/fts3comp1.test @@ -17,7 +17,7 @@ source $testdir/tester.tcl ifcapable !fts3 { finish_test ; return } set ::testprefix fts3comp1 -# Create a pretend compression system. +# Create a pretend compression system. # # Each time the [zip] function is called, an entry is added to the ::strings # array mapping from an integer key to the string argument to zip. The key @@ -45,14 +45,14 @@ foreach {tn zip unzip} { sqlite3 db test.db db func $zip zip db func $unzip unzip - + # Create a table that uses zip/unzip. Check that content inserted into # the table can be read back (using a full-scan query). Check that the # underlying %_content table contains the compressed (integer) values. # do_execsql_test 1.$tn.0 " CREATE VIRTUAL TABLE t1 USING fts4( - a, b, + a, b, compress='$zip', uncompress='$unzip' ); " @@ -63,7 +63,7 @@ foreach {tn zip unzip} { do_execsql_test 1.$tn.2 { SELECT c0a, c1b FROM t1_content; } {1 2} - + # Insert another row and check that it can be read back. Also that the # %_content table still contains all compressed content. This time, try # full-text index and by-docid queries too. @@ -75,14 +75,14 @@ foreach {tn zip unzip} { do_execsql_test 1.$tn.4 { SELECT c0a, c1b FROM t1_content; } {1 2 3 4} - + do_execsql_test 1.$tn.5 { SELECT a, b FROM t1 WHERE docid = 2 } {{three six nine} {four eight twelve}} do_execsql_test 1.$tn.6 { SELECT a, b FROM t1 WHERE t1 MATCH 'two' } {{one two three} {two four six}} - + # Delete a row and check that the full-text index is correctly updated. # Inspect the full-text index using an fts4aux table. # @@ -90,14 +90,14 @@ foreach {tn zip unzip} { CREATE VIRTUAL TABLE terms USING fts4aux(t1); SELECT term, documents, occurrences FROM terms WHERE col = '*'; } { - eight 1 1 four 2 2 nine 1 1 one 1 1 + eight 1 1 four 2 2 nine 1 1 one 1 1 six 2 2 three 2 2 twelve 1 1 two 1 2 } do_execsql_test 1.$tn.8 { DELETE FROM t1 WHERE docid = 1; SELECT term, documents, occurrences FROM terms WHERE col = '*'; } { - eight 1 1 four 1 1 nine 1 1 + eight 1 1 four 1 1 nine 1 1 six 1 1 three 1 1 twelve 1 1 } do_execsql_test 1.$tn.9 { SELECT c0a, c1b FROM t1_content } {3 4} diff --git a/third_party/sqlite/src/test/fts3conf.test b/third_party/sqlite/src/test/fts3conf.test index 6766a95408ad5..2c6d821335158 100644 --- a/third_party/sqlite/src/test/fts3conf.test +++ b/third_party/sqlite/src/test/fts3conf.test @@ -52,7 +52,7 @@ proc fts3_integrity {tn db tbl} { DROP TABLE temp.fts3check2; DROP TABLE temp.fts3check3; } - + uplevel [list do_test $tn [list set {} $m1] $m2] } @@ -99,7 +99,7 @@ foreach {tn sql uses constraint data} [subst { 20 "UPDATE OR REPLACE $T4" 1 0 {{e f g h} {a b c d}} }] { db_restore_and_reopen - execsql { + execsql { BEGIN; INSERT INTO t1(rowid, x) VALUES(3, 'i j k l'); } @@ -179,9 +179,9 @@ do_execsql_test 3.8 { } {X'0200000002000000'} #------------------------------------------------------------------------- -# Test that the xSavepoint is invoked correctly if the first write -# operation within a transaction is to a virtual table. -# +# Test that the xSavepoint is invoked correctly if the first write +# operation within a transaction is to a virtual table. +# do_catchsql_test 4.1.1 { CREATE VIRTUAL TABLE t0 USING fts4; BEGIN; @@ -230,23 +230,23 @@ do_execsql_test 4.3.2 { do_execsql_test 4.4.1 { CREATE TABLE A(ID INTEGER PRIMARY KEY, AnotherID INTEGER, Notes TEXT); CREATE VIRTUAL TABLE AFTS USING FTS4 (Notes); - CREATE TRIGGER A_DeleteTrigger AFTER DELETE ON A FOR EACH ROW BEGIN - DELETE FROM AFTS WHERE rowid=OLD.ID; + CREATE TRIGGER A_DeleteTrigger AFTER DELETE ON A FOR EACH ROW BEGIN + DELETE FROM AFTS WHERE rowid=OLD.ID; END; CREATE TABLE B(ID INTEGER PRIMARY KEY,Notes TEXT); CREATE VIRTUAL TABLE BFTS USING FTS3 (Notes); - CREATE TRIGGER B_DeleteTrigger AFTER DELETE ON B FOR EACH ROW BEGIN - DELETE FROM BFTS WHERE rowid=OLD.ID; + CREATE TRIGGER B_DeleteTrigger AFTER DELETE ON B FOR EACH ROW BEGIN + DELETE FROM BFTS WHERE rowid=OLD.ID; END; } - + do_execsql_test 4.4.2 { BEGIN TRANSACTION; DELETE FROM A WHERE AnotherID=1; DELETE FROM B WHERE ID=1; COMMIT; } - + finish_test diff --git a/third_party/sqlite/src/test/fts3corrupt.test b/third_party/sqlite/src/test/fts3corrupt.test index cb50e3e46ae52..e933a0ad7d873 100644 --- a/third_party/sqlite/src/test/fts3corrupt.test +++ b/third_party/sqlite/src/test/fts3corrupt.test @@ -41,9 +41,9 @@ do_catchsql_test 1.3 { INSERT INTO t1 VALUES('world'); } {1 {database disk image is malformed}} do_test 1.3.1 { sqlite3_extended_errcode db } SQLITE_CORRUPT_VTAB -do_execsql_test 1.4 { +do_execsql_test 1.4 { DROP TABLE t1; -} +} # This block of tests checks that corruption is correctly detected if the # length field of a term on a leaf node indicates that the term extends past diff --git a/third_party/sqlite/src/test/fts3cov.test b/third_party/sqlite/src/test/fts3cov.test index c43999d2da04c..765c7e268dbe7 100644 --- a/third_party/sqlite/src/test/fts3cov.test +++ b/third_party/sqlite/src/test/fts3cov.test @@ -22,20 +22,20 @@ set DO_MALLOC_TEST 0 set testprefix fts3cov #-------------------------------------------------------------------------- -# When it first needs to read a block from the %_segments table, the FTS3 -# module compiles an SQL statement for that purpose. The statement is -# stored and reused each subsequent time a block is read. This test case +# When it first needs to read a block from the %_segments table, the FTS3 +# module compiles an SQL statement for that purpose. The statement is +# stored and reused each subsequent time a block is read. This test case # tests the effects of an OOM error occuring while compiling the statement. # # Similarly, when FTS3 first needs to scan through a set of segment leaves # to find a set of documents that matches a term, it allocates a string -# containing the text of the required SQL, and compiles one or more +# containing the text of the required SQL, and compiles one or more # statements to traverse the leaves. This test case tests that OOM errors # that occur while allocating this string and statement are handled correctly # also. # do_test fts3cov-1.1 { - execsql { + execsql { CREATE VIRTUAL TABLE t1 USING fts3(x); INSERT INTO t1(t1) VALUES('nodesize=24'); BEGIN; @@ -55,13 +55,13 @@ do_restart_select_test fts3cov-1.2 { set DO_MALLOC_TEST 0 #-------------------------------------------------------------------------- -# When querying the full-text index, if an expected internal node block is -# missing from the %_segments table, or if a NULL value is stored in the -# %_segments table instead of a binary blob, database corruption should be +# When querying the full-text index, if an expected internal node block is +# missing from the %_segments table, or if a NULL value is stored in the +# %_segments table instead of a binary blob, database corruption should be # reported. # # Even with tiny 24 byte nodes, it takes a fair bit of data to produce a -# segment b-tree that uses the %_segments table to store internal nodes. +# segment b-tree that uses the %_segments table to store internal nodes. # do_test fts3cov-2.1 { execsql { @@ -116,7 +116,7 @@ do_error_test fts3cov-2.5 { # 0x01 # # The following tests check that malloc errors encountered while appending -# the "0x01 " data to the dynamically growable blob used to +# the "0x01 " data to the dynamically growable blob used to # accumulate the doclist in memory are handled correctly. # do_test fts3cov-3.1 { @@ -128,7 +128,7 @@ do_test fts3cov-3.1 { } execsql "CREATE VIRTUAL TABLE t2 USING fts3([join $cols ,])" } {} -set DO_MALLOC_TEST 1 +set DO_MALLOC_TEST 1 do_write_test fts3cov-3.2 t2_content " INSERT INTO t2(docid, [join $cols ,]) VALUES(1, [join $vals ,]) " @@ -142,7 +142,7 @@ do_write_test fts3cov-3.4 t2_content " #------------------------------------------------------------------------- # If too much data accumulates in the pending-terms hash table, it is # flushed to the database automatically, even if the transaction has not -# finished. The following tests check the effects of encountering an OOM +# finished. The following tests check the effects of encountering an OOM # while doing this. # do_test fts3cov-4.1 { @@ -152,7 +152,7 @@ do_test fts3cov-4.1 { INSERT INTO t3(t3) VALUES('maxpending=100'); } } {} -set DO_MALLOC_TEST 1 +set DO_MALLOC_TEST 1 do_write_test fts3cov-4.2 t3_content { INSERT INTO t3(docid, x) SELECT 1, 'Then Christabel stretched forth her hand,' UNION ALL @@ -172,13 +172,13 @@ do_write_test fts3cov-4.2 t3_content { # out to be untrue, then an extra buffer must be malloc'd for each term. # This test case tests these paths and the effects of said mallocs failing # by inserting insert a document with some fairly large terms into a -# full-text table with a very small node-size. +# full-text table with a very small node-size. # # Test this handling of large terms in three contexts: # # 1. When flushing the pending-terms table. -# 2. When optimizing the data structures using the INSERT syntax. -# 2. When optimizing the data structures using the deprecated SELECT syntax. +# 2. When optimizing the data structures using the INSERT syntax. +# 2. When optimizing the data structures using the deprecated SELECT syntax. # do_test fts3cov-5.1 { execsql { @@ -251,7 +251,7 @@ do_write_test fts3cov-6.4 t5_content { # 1. When the row being updated is the only row in the table. # 2. When it is not. # -# The two cases above take different paths because in case 1 all data +# The two cases above take different paths because in case 1 all data # structures can simply be emptied before inserting the new row record. # In case 2, the data structures actually have to be updated. # @@ -272,12 +272,12 @@ do_test fts3cov-7.2 { } {1 D E F 5 A B C} #------------------------------------------------------------------------- -# If a set of documents are modified within a transaction, the +# If a set of documents are modified within a transaction, the # pending-terms table must be flushed each time a document with a docid -# less than or equal to the previous docid is modified. +# less than or equal to the previous docid is modified. # -# This test checks the effects of an OOM error occuring when the -# pending-terms table is flushed for this reason as part of a DELETE +# This test checks the effects of an OOM error occuring when the +# pending-terms table is flushed for this reason as part of a DELETE # statement. # do_malloc_test fts3cov-8 -sqlprep { @@ -339,7 +339,7 @@ do_malloc_test fts3cov-10 -sqlprep { # no longer. # do_test fts3cov-11.1 { - execsql { + execsql { CREATE VIRTUAL TABLE xx USING fts3; INSERT INTO xx VALUES('one two three'); INSERT INTO xx VALUES('four five six'); diff --git a/third_party/sqlite/src/test/fts3d.test b/third_party/sqlite/src/test/fts3d.test index 83af4d2a374ae..436d1911c45c9 100644 --- a/third_party/sqlite/src/test/fts3d.test +++ b/third_party/sqlite/src/test/fts3d.test @@ -361,11 +361,11 @@ do_test fts3d-6.5 { do_test fts3d-6.6 { execsql { INSERT INTO xyz(xyz) VALUES('merge=2,2') } sqlite3 db test.db - execsql { + execsql { ALTER TABLE xyz RENAME TO ott; SELECT name FROM sqlite_master WHERE name GLOB '???_*' ORDER BY 1; } } {ott_content ott_segdir ott_segments ott_stat} - + finish_test diff --git a/third_party/sqlite/src/test/fts3defer.test b/third_party/sqlite/src/test/fts3defer.test index 532d4dfa6a6d2..7f3391720c192 100644 --- a/third_party/sqlite/src/test/fts3defer.test +++ b/third_party/sqlite/src/test/fts3defer.test @@ -34,7 +34,7 @@ set ::testprefix fts3defer # "a" with all zeroes and fts3defer-1.4.* repeats the tests from 1.2. If # the tests still work, we can conclude that the doclist for "a" was not # used. -# +# set aaa [string repeat "a " 15000] @@ -52,7 +52,7 @@ set tests { 1 {SELECT rowid FROM t1 WHERE t1 MATCH '"a dog"'} {1} 2 {SELECT rowid FROM t1 WHERE t1 MATCH '"is a dog"'} {1} 3 {SELECT rowid FROM t1 WHERE t1 MATCH '"a longer phrase"'} {3} - 4 {SELECT snippet(t1) FROM t1 WHERE t1 MATCH '"a longer phrase"'} + 4 {SELECT snippet(t1) FROM t1 WHERE t1 MATCH '"a longer phrase"'} {"an instance of a longer phrase"} 5 {SELECT rowid FROM t1 WHERE t1 MATCH 'a dog'} {1} } @@ -61,8 +61,8 @@ do_select_tests 1.2 $tests do_execsql_test 1.3 { SELECT count(*) FROM t1_segments WHERE length(block)>10000; - UPDATE t1_segments - SET block = zeroblob(length(block)) + UPDATE t1_segments + SET block = zeroblob(length(block)) WHERE length(block)>10000; } {1} @@ -74,7 +74,7 @@ do_execsql_test 1.5 { DROP TABLE t1 } #-------------------------------------------------------------------------- # These tests - fts3defer-2.* - are more rigorous. They test that for a -# variety of queries, FTS3 and FTS4 return the same results. And that +# variety of queries, FTS3 and FTS4 return the same results. And that # zeroing the very large doclists that FTS4 does not load does not change # the results. # @@ -249,8 +249,8 @@ foreach {tn setup} { set ::testprefix fts3defer-2.$tn set DO_MALLOC_TEST 0 - do_execsql_test 0 { - SELECT count(*) FROM t1_segments WHERE length(block)>10000 + do_execsql_test 0 { + SELECT count(*) FROM t1_segments WHERE length(block)>10000 } {2} do_select_test 1.1 { @@ -286,9 +286,9 @@ foreach {tn setup} { if { $fts3_simple_deferred_tokens_only==0 } { do_select_test 1.11 { - SELECT rowid FROM t1 + SELECT rowid FROM t1 WHERE t1 MATCH '( - zdu OR zexh OR zf OR zhbrzadb OR zidhxhbtv OR + zdu OR zexh OR zf OR zhbrzadb OR zidhxhbtv OR zk OR zkhdvkw OR zm OR zsmhnf ) vgsld' } {10 13 17 31 35 51 58 88 89 90 93 100} @@ -322,22 +322,22 @@ foreach {tn setup} { do_select_test 3.1 { SELECT snippet(t1, '[', ']') FROM t1 WHERE t1 MATCH '"zm agmckuiu"' } { - {zm [zm] [agmckuiu] uhzq nsab jk rrkx duszemmzl hyq jk} - {jk [zm] [agmckuiu] urvysbnykk jk jk zm zm jk jk} - {[zm] [agmckuiu] zexh fibokdry jk uhzq bu tugflixoex xnxhf sk} + {zm [zm] [agmckuiu] uhzq nsab jk rrkx duszemmzl hyq jk} + {jk [zm] [agmckuiu] urvysbnykk jk jk zm zm jk jk} + {[zm] [agmckuiu] zexh fibokdry jk uhzq bu tugflixoex xnxhf sk} {zm zf uenvbm jk azavwm zm [zm] [agmckuiu] zm jk} } do_select_test 3.2 { SELECT snippet(t1, '[', ']') FROM t1 WHERE t1 MATCH 'xnxhf jk' } { - {[xnxhf] [jk] [jk] agmckuiu duszemmzl [jk] zm zm [jk] vgsld} - {[jk] [xnxhf] igju [jk] xh [jk] nvfasfh zm js [jk]} - {[jk] jcpiwj zm [xnxhf] zm mjpavjuhw mj drir pa pvjrjlas} - {gazrt [jk] ephknonq myjp uenvbm wuvajhwqz [jk] zm [xnxhf] nvfasfh} - {zm aayxpmve csjqxhgj [xnxhf] xr [jk] aayxpmve [xnxhf] zm zm} - {zm agmckuiu zexh fibokdry [jk] uhzq bu tugflixoex [xnxhf] sk} - {lwa hi [xnxhf] qdyerbws zk njtc [jk] uhzq zm [jk]} + {[xnxhf] [jk] [jk] agmckuiu duszemmzl [jk] zm zm [jk] vgsld} + {[jk] [xnxhf] igju [jk] xh [jk] nvfasfh zm js [jk]} + {[jk] jcpiwj zm [xnxhf] zm mjpavjuhw mj drir pa pvjrjlas} + {gazrt [jk] ephknonq myjp uenvbm wuvajhwqz [jk] zm [xnxhf] nvfasfh} + {zm aayxpmve csjqxhgj [xnxhf] xr [jk] aayxpmve [xnxhf] zm zm} + {zm agmckuiu zexh fibokdry [jk] uhzq bu tugflixoex [xnxhf] sk} + {lwa hi [xnxhf] qdyerbws zk njtc [jk] uhzq zm [jk]} {zm azavwm igju qzzqdxq [jk] [xnxhf] abthnzcv [jk] nvfasfh zm} } @@ -350,14 +350,14 @@ foreach {tn setup} { do_select_test 4.2 { SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'duszemmzl jk fibokdry' } { - {0 2 3 8 0 1 36 2 0 0 58 9} - {0 0 0 9 0 1 13 2 0 1 16 2 0 2 19 8 0 1 53 2} - {0 1 4 2 0 0 20 9 0 1 30 2 0 1 33 2 0 2 48 8} + {0 2 3 8 0 1 36 2 0 0 58 9} + {0 0 0 9 0 1 13 2 0 1 16 2 0 2 19 8 0 1 53 2} + {0 1 4 2 0 0 20 9 0 1 30 2 0 1 33 2 0 2 48 8} {0 1 17 2 0 1 20 2 0 1 26 2 0 0 29 9 0 2 39 8} } do_select_test 4.3 { - SELECT offsets(t1) FROM t1 + SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'vgsld (hrlipdm OR (aapmve NEAR duszemmzl))' } {{0 0 0 5 0 1 15 7 0 0 36 5}} @@ -366,7 +366,7 @@ foreach {tn setup} { # zeroed. Change this by messing with the [set dmt_modes] commands above. # foreach DO_MALLOC_TEST $dmt_modes { - + # Phrase search. # do_select_test 5.$DO_MALLOC_TEST.1 { @@ -382,25 +382,25 @@ foreach {tn setup} { do_select_test 5.$DO_MALLOC_TEST.3 { SELECT snippet(t1, '[', ']') FROM t1 WHERE t1 MATCH '"zm aayxpmve"' } { - {[zm] [aayxpmve] csjqxhgj xnxhf xr jk aayxpmve xnxhf zm zm} - {duszemmzl zk jk jk fibokdry jseuhjnzo [zm] [aayxpmve] zk jk} + {[zm] [aayxpmve] csjqxhgj xnxhf xr jk aayxpmve xnxhf zm zm} + {duszemmzl zk jk jk fibokdry jseuhjnzo [zm] [aayxpmve] zk jk} {zf jmfiqhwnjg js igju [zm] [aayxpmve] zm mbxnljomiv csjqxhgj nvfasfh} } - + # snippet() function with multiple tokens. do_select_test 5.$DO_MALLOC_TEST.4 { SELECT snippet(t1, '[', ']') FROM t1 WHERE t1 MATCH 'zm zhbrzadb' } { {[zm] jk [zm] [zm] [zhbrzadb] uenvbm aayxpmve urvysbnykk duszemmzl jk} } - + # snippet() function with phrase. do_select_test 5.$DO_MALLOC_TEST.5 { SELECT offsets(t1) FROM t1 WHERE t1 MATCH '"zm aayxpmve"' } { {0 0 0 2 0 1 3 8} {0 0 38 2 0 1 41 8} {0 0 22 2 0 1 25 8} } - + # snippet() function with multiple tokens. do_select_test 5.$DO_MALLOC_TEST.6 { SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'zm zhbrzadb' @@ -412,7 +412,7 @@ foreach {tn setup} { } do_select_test 6.1 { - SELECT rowid FROM t1 + SELECT rowid FROM t1 WHERE t1 MATCH 'vgsld (hrlipdm OR (aayxpmve duszemmzl))' } {10} do_select_test 6.2.1 { diff --git a/third_party/sqlite/src/test/fts3defer2.test b/third_party/sqlite/src/test/fts3defer2.test index 275e0f0eb36fe..ae352d46ae892 100644 --- a/third_party/sqlite/src/test/fts3defer2.test +++ b/third_party/sqlite/src/test/fts3defer2.test @@ -14,7 +14,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl source $testdir/malloc_common.tcl ifcapable !fts3||!fts4_deferred { - finish_test + finish_test return } @@ -31,7 +31,7 @@ db func mit mit #----------------------------------------------------------------------------- # This block of tests - fts3defer2-1.* - test the interaction of deferred NEAR # expressions and the snippet, offsets and matchinfo functions. -# +# do_execsql_test 1.1.1 { CREATE VIRTUAL TABLE t1 USING fts4; } @@ -82,7 +82,7 @@ do_execsql_test 1.3.1 { DROP TABLE t1 } #----------------------------------------------------------------------------- # Test cases fts3defer2-2.* focus specifically on the matchinfo function. -# +# do_execsql_test 2.1.1 "CREATE VIRTUAL TABLE t2 USING fts4" do_execsql_test 2.1.2 "INSERT INTO t2 VALUES('[string repeat {a } 10000]')" do_execsql_test 2.1.3 "INSERT INTO t2 VALUES('b [string repeat {z } 10000]')" @@ -94,7 +94,7 @@ do_execsql_test 2.1.5 { foreach {tn sql} { 1 {} 2 { INSERT INTO t2(t2) VALUES('optimize') } - 3 { UPDATE t2_segments SET block = zeroblob(length(block)) + 3 { UPDATE t2_segments SET block = zeroblob(length(block)) WHERE length(block)>10000; } } { @@ -148,7 +148,7 @@ do_execsql_test 2.3.2 " foreach {tn sql} { 1 {} 2 { INSERT INTO t3(t3) VALUES('optimize') } - 3 { UPDATE t3_segments SET block = zeroblob(length(block)) + 3 { UPDATE t3_segments SET block = zeroblob(length(block)) WHERE length(block)>10000; } } { diff --git a/third_party/sqlite/src/test/fts3defer3.test b/third_party/sqlite/src/test/fts3defer3.test index a795e92bcf1ab..fd2275bd404b6 100644 --- a/third_party/sqlite/src/test/fts3defer3.test +++ b/third_party/sqlite/src/test/fts3defer3.test @@ -17,7 +17,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl source $testdir/malloc_common.tcl ifcapable !fts3||!fts4_deferred { - finish_test + finish_test return } set testprefix fts3defer3 @@ -42,21 +42,21 @@ do_test 1.1 { execsql COMMIT } {} -# Check that the db contains two doclists. A small one for "a" and a +# Check that the db contains two doclists. A small one for "a" and a # larger one for "b". # do_execsql_test 1.2 { SELECT blockid, length(block) FROM t1_segments; } [list 1 8 2 $nDoclist] -# Query for 'a b'. Although this test doesn't prove so, token "b" will +# Query for 'a b'. Although this test doesn't prove so, token "b" will # be deferred because of the very large associated doclist. # do_execsql_test 1.3 { SELECT docid, content FROM t1 WHERE t1 MATCH 'a b'; } {200 {a b}} -# Zero out the doclist for token "b" within the database file. Now the +# Zero out the doclist for token "b" within the database file. Now the # only queries that use token "b" that will work are those that defer # it. Any query that tries to use the doclist belonging to token "b" # will fail. diff --git a/third_party/sqlite/src/test/fts3expr.test b/third_party/sqlite/src/test/fts3expr.test index b186a157d1011..5e42f8f41925b 100644 --- a/third_party/sqlite/src/test/fts3expr.test +++ b/third_party/sqlite/src/test/fts3expr.test @@ -329,7 +329,7 @@ do_test fts3expr-3.18 { # The following tests, fts3expr-4.*, test the parsers response to syntax # errors in query expressions. This is done using a real fts3 table and # MATCH clauses, not the parser test interface. -# +# do_test fts3expr-4.1 { execsql { CREATE VIRTUAL TABLE t1 USING fts3(a, b, c) } } {} @@ -387,7 +387,7 @@ do_test fts3expr-4.5.2 { #------------------------------------------------------------------------ # The following OOM tests are designed to cover cases in fts3_expr.c. -# +# source $testdir/malloc_common.tcl do_malloc_test fts3expr-malloc-1 -sqlbody { SELECT fts3_exprtest('simple', 'a b c "d e f"', 'a', 'b', 'c') @@ -403,7 +403,7 @@ do_malloc_test fts3expr-malloc-2 -tclprep { #------------------------------------------------------------------------ # The following tests are not very important. They cover error handling # cases in the test code, which makes test coverage easier to measure. -# +# do_test fts3expr-5.1 { catchsql { SELECT fts3_exprtest('simple', 'a b') } } {1 {Usage: fts3_exprtest(tokenizer, expr, col1, ...}} @@ -417,7 +417,7 @@ do_test fts3expr-5.3 { #------------------------------------------------------------------------ # The next set of tests verifies that things actually work as they are # supposed to when using the new syntax. -# +# do_test fts3expr-6.1 { execsql { CREATE VIRTUAL TABLE t1 USING fts3(a); @@ -439,7 +439,7 @@ foreach {id expr res} { 2 "five four NOT one" {24 26 28 30} - 3 "five AND four OR one" + 3 "five AND four OR one" {1 3 5 7 9 11 13 15 17 19 21 23 24 25 26 27 28 29 30 31} 4 "five AND (four OR one)" {17 19 21 23 24 25 26 27 28 29 30 31} @@ -451,13 +451,13 @@ foreach {id expr res} { 7 "(five OR one) AND two AND three" {7 15 22 23 30 31} - 8 "five OR one AND two AND three" + 8 "five OR one AND two AND three" {7 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31} - 9 "five OR one two three" + 9 "five OR one two three" {7 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31} - 10 "five OR \"one two three\"" + 10 "five OR \"one two three\"" {7 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31} 11 "one two OR four five NOT three" {3 7 11 15 19 23 24 25 26 27 31} diff --git a/third_party/sqlite/src/test/fts3expr2.test b/third_party/sqlite/src/test/fts3expr2.test index c3d161730b47f..2caff0936c655 100644 --- a/third_party/sqlite/src/test/fts3expr2.test +++ b/third_party/sqlite/src/test/fts3expr2.test @@ -24,23 +24,23 @@ ifcapable !fts3 { } # Test overview: -# +# # The tests in this file are pseudo-randomly generated. They test # the fts3 match expression parser via the test interface # SQL function "fts3_exprtest" (see comments in fts3_expr.c). # # Each test case works as follows: -# +# # 1. A random expression tree is generated using proc [random_expr_tree]. # 2. The expression tree is converted to the text of an equivalent # fts3 expression using proc [tree_to_expr]. -# 3. The test SQL function "fts3_exprtest" is used to parse the +# 3. The test SQL function "fts3_exprtest" is used to parse the # expression text generated in step (2), returning a parsed expression # tree. -# 4. Test that the tree returned in step (3) matches that generated in +# 4. Test that the tree returned in step (3) matches that generated in # step (1). # -# In step (2), 4 different fts3 expressions are created from each +# In step (2), 4 different fts3 expressions are created from each # expression tree by varying the following boolean properties: # # * Whether or not superflous parenthesis are included. i.e. if @@ -75,7 +75,7 @@ proc random_phrase {} { list P [lindex $phrases [rnd [llength $phrases]]] } -# Generate and return a pseudo-random expression tree. Using the same +# Generate and return a pseudo-random expression tree. Using the same # format returned by the [test_fts3expr2] proc. # proc random_expr_tree {iHeight} { @@ -136,10 +136,10 @@ proc tree_to_expr {tree all_brackets implicit_and} { if {$iLeftPrec > $iPrec || $all_brackets} { set zLeft "($zLeft)" - } + } if {$iRightPrec >= $iPrec || $all_brackets} { set zRight "($zRight)" - } + } return "$zLeft $op $zRight" } diff --git a/third_party/sqlite/src/test/fts3expr3.test b/third_party/sqlite/src/test/fts3expr3.test index 83c153218c854..ba4392d7e53a8 100644 --- a/third_party/sqlite/src/test/fts3expr3.test +++ b/third_party/sqlite/src/test/fts3expr3.test @@ -124,7 +124,7 @@ proc balanced_andor_tree {nEntry} { if 1 { -# Test that queries like "1 AND 2 AND 3 AND 4..." are transformed to +# Test that queries like "1 AND 2 AND 3 AND 4..." are transformed to # balanced trees by FTS. # for {set i 1} {$i < 100} {incr i} { @@ -157,7 +157,7 @@ for {set i 2} {$i < 64} {incr i 4} { } [balanced_andor_tree $i] } -# These exceed the depth limit. +# These exceed the depth limit. # for {set i 65} {$i < 70} {incr i} { do_test 3.$i { @@ -165,7 +165,7 @@ for {set i 65} {$i < 70} {incr i} { } {1 {Error parsing expression}} } -# This also exceeds the depth limit. +# This also exceeds the depth limit. # do_test 4.1.1 { @@ -209,21 +209,21 @@ do_faultsim_test fts3expr3-fault-1 -faults oom-* -body { #------------------------------------------------------------------- foreach {tn expr res} { - 1 {1 OR 2 OR 3 OR 4} {OR {OR {P 1} {P 2}} {OR {P 3} {P 4}}} - 2 {1 OR (2 AND 3 AND 4 AND 5)} + 1 {1 OR 2 OR 3 OR 4} {OR {OR {P 1} {P 2}} {OR {P 3} {P 4}}} + 2 {1 OR (2 AND 3 AND 4 AND 5)} {OR {P 1} {AND {AND {P 2} {P 3}} {AND {P 4} {P 5}}}} - 3 {(2 AND 3 AND 4 AND 5) OR 1} + 3 {(2 AND 3 AND 4 AND 5) OR 1} {OR {AND {AND {P 2} {P 3}} {AND {P 4} {P 5}}} {P 1}} - 4 {1 AND (2 OR 3 OR 4 OR 5)} + 4 {1 AND (2 OR 3 OR 4 OR 5)} {AND {P 1} {OR {OR {P 2} {P 3}} {OR {P 4} {P 5}}}} - 5 {(2 OR 3 OR 4 OR 5) AND 1} + 5 {(2 OR 3 OR 4 OR 5) AND 1} {AND {OR {OR {P 2} {P 3}} {OR {P 4} {P 5}}} {P 1}} - 6 {(2 OR 3 OR 4 OR 5) NOT 1} + 6 {(2 OR 3 OR 4 OR 5) NOT 1} {NOT {OR {OR {P 2} {P 3}} {OR {P 4} {P 5}}} {P 1}} - 7 {1 NOT (2 OR 3 OR 4 OR 5)} + 7 {1 NOT (2 OR 3 OR 4 OR 5)} {NOT {P 1} {OR {OR {P 2} {P 3}} {OR {P 4} {P 5}}}} 8 {(1 OR 2 OR 3 OR 4) NOT (5 AND 6 AND 7 AND 8)} diff --git a/third_party/sqlite/src/test/fts3fault.test b/third_party/sqlite/src/test/fts3fault.test index 7d94332059583..661d74e6b64d3 100644 --- a/third_party/sqlite/src/test/fts3fault.test +++ b/third_party/sqlite/src/test/fts3fault.test @@ -20,12 +20,12 @@ ifcapable !fts3 { finish_test ; return } if 0 { -# Test error handling in the sqlite3Fts3Init() function. This is the +# Test error handling in the sqlite3Fts3Init() function. This is the # function that registers the FTS3 module and various support functions # with SQLite. # -do_faultsim_test 1 -body { - sqlite3 db test.db +do_faultsim_test 1 -body { + sqlite3 db test.db expr 0 } -test { catch { db close } @@ -41,7 +41,7 @@ do_execsql_test 2.0 { INSERT INTO t1 VALUES('test renaming the table'); INSERT INTO t1 VALUES(' after it has been written'); } -do_faultsim_test 2 -prep { +do_faultsim_test 2 -prep { sqlite3 db test.db execsql { BEGIN; @@ -51,10 +51,10 @@ do_faultsim_test 2 -prep { } -body { execsql { ALTER TABLE t1 RENAME TO t2 } } -test { - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} } -# Test error handling in the special case where a single prefix query +# Test error handling in the special case where a single prefix query # matches terms that reside on a large range of leaf nodes. # do_test fts3fault-3.0 { @@ -68,25 +68,25 @@ do_test fts3fault-3.0 { execsql { COMMIT } } {} -do_faultsim_test 3 -faults oom-transient -prep { +do_faultsim_test 3 -faults oom-transient -prep { sqlite3 db test.db execsql { SELECT * FROM t3 WHERE t3 MATCH 'x' } } -body { execsql { SELECT count(rowid) FROM t3 WHERE t3 MATCH 'aa*' } } -test { - faultsim_test_result {0 1000} + faultsim_test_result {0 1000} } do_test fts3fault-4.0 { faultsim_delete_and_reopen - execsql { - CREATE VIRTUAL TABLE t4 USING fts4; + execsql { + CREATE VIRTUAL TABLE t4 USING fts4; INSERT INTO t4 VALUES('The British Government called on'); INSERT INTO t4 VALUES('as pesetas then became much'); } } {} faultsim_save_and_close -do_faultsim_test 4 -prep { +do_faultsim_test 4 -prep { faultsim_restore_and_reopen execsql { SELECT content FROM t4 } } -body { @@ -97,16 +97,16 @@ do_faultsim_test 4 -prep { do_test fts3fault-5.0 { faultsim_delete_and_reopen - execsql { - CREATE VIRTUAL TABLE t5 USING fts4; + execsql { + CREATE VIRTUAL TABLE t5 USING fts4; INSERT INTO t5 VALUES('The British Government called on'); INSERT INTO t5 VALUES('as pesetas then became much'); } } {} faultsim_save_and_close -do_faultsim_test 5 -prep { +do_faultsim_test 5 -prep { faultsim_restore_and_reopen - execsql { + execsql { BEGIN; INSERT INTO t5 VALUES('influential in shaping his future outlook'); INSERT INTO t5 VALUES('might be acceptable to the British electorate'); @@ -122,7 +122,7 @@ do_test fts3fault-6.0 { execsql { CREATE VIRTUAL TABLE t6 USING fts4 } } {} faultsim_save_and_close -do_faultsim_test 6 -prep { +do_faultsim_test 6 -prep { faultsim_restore_and_reopen execsql { SELECT rowid FROM t6 } } -body { @@ -133,14 +133,14 @@ do_faultsim_test 6 -prep { # Test various malloc failures while processing FTS4 parameters. # -do_faultsim_test 7.1 -prep { +do_faultsim_test 7.1 -prep { faultsim_delete_and_reopen } -body { execsql { CREATE VIRTUAL TABLE t1 USING fts4(a, b, matchinfo=fts3) } } -test { faultsim_test_result {0 {}} } -do_faultsim_test 7.2 -prep { +do_faultsim_test 7.2 -prep { faultsim_delete_and_reopen } -body { execsql { CREATE VIRTUAL TABLE t1 USING fts4(a, b, matchinfo=fs3) } @@ -149,7 +149,7 @@ do_faultsim_test 7.2 -prep { {1 {vtable constructor failed: t1}} \ {1 {SQL logic error or missing database}} } -do_faultsim_test 7.3 -prep { +do_faultsim_test 7.3 -prep { faultsim_delete_and_reopen } -body { execsql { CREATE VIRTUAL TABLE t1 USING fts4(a, b, matchnfo=fts3) } @@ -181,7 +181,7 @@ do_test 8.0 { faultsim_save_and_close } {} -do_faultsim_test 8.1 -faults oom-t* -prep { +do_faultsim_test 8.1 -faults oom-t* -prep { faultsim_restore_and_reopen db func mit mit } -body { @@ -190,7 +190,7 @@ do_faultsim_test 8.1 -faults oom-t* -prep { faultsim_test_result {0 {{1 1 1 1 4 2 1 5 5}}} } -do_faultsim_test 8.2 -faults oom-t* -prep { +do_faultsim_test 8.2 -faults oom-t* -prep { faultsim_restore_and_reopen db func mit mit } -body { @@ -198,7 +198,7 @@ do_faultsim_test 8.2 -faults oom-t* -prep { } -test { faultsim_test_result {0 3} } -do_faultsim_test 8.3 -prep { +do_faultsim_test 8.3 -prep { faultsim_restore_and_reopen db func mit mit } -body { @@ -206,7 +206,7 @@ do_faultsim_test 8.3 -prep { } -test { faultsim_test_result {0 10002} } -do_faultsim_test 8.4 -prep { +do_faultsim_test 8.4 -prep { faultsim_restore_and_reopen db func mit mit } -body { diff --git a/third_party/sqlite/src/test/fts3fault2.test b/third_party/sqlite/src/test/fts3fault2.test index 030ff73dc23e1..cff087cc9e844 100644 --- a/third_party/sqlite/src/test/fts3fault2.test +++ b/third_party/sqlite/src/test/fts3fault2.test @@ -139,7 +139,7 @@ ifcapable fts3_unicode { } faultsim_save_and_close } {} - + do_faultsim_test 5.1 -faults oom* -prep { faultsim_restore_and_reopen db eval {SELECT * FROM sqlite_master} diff --git a/third_party/sqlite/src/test/fts3first.test b/third_party/sqlite/src/test/fts3first.test index 673f818debc98..116e1e2d5f672 100644 --- a/third_party/sqlite/src/test/fts3first.test +++ b/third_party/sqlite/src/test/fts3first.test @@ -88,7 +88,7 @@ foreach x {1 2} { do_execsql_test 1.$x.$tn.2 {SELECT docid FROM x2 WHERE x2 MATCH $match} $rev } - do_execsql_test 1.$x.[expr $tn+1] { + do_execsql_test 1.$x.[expr $tn+1] { INSERT INTO x1(x1) VALUES('optimize'); INSERT INTO x2(x2) VALUES('optimize'); } {} @@ -126,8 +126,8 @@ foreach {tn match res} { {1 1 1 0 1 1 1 2 2} } 3 {^X Y} { - {0 1 1 0 1 1 1 2 2 0 6 5 0 5 4 1 4 4} - {0 1 1 1 1 1 0 2 2 1 6 5 0 5 4 0 4 4} + {0 1 1 0 1 1 1 2 2 0 6 5 0 5 4 1 4 4} + {0 1 1 1 1 1 0 2 2 1 6 5 0 5 4 0 4 4} {1 1 1 0 1 1 1 2 2 1 6 5 0 5 4 1 4 4} } } { diff --git a/third_party/sqlite/src/test/fts3join.test b/third_party/sqlite/src/test/fts3join.test index 0fb8c62022463..ba1ffa5256947 100644 --- a/third_party/sqlite/src/test/fts3join.test +++ b/third_party/sqlite/src/test/fts3join.test @@ -57,8 +57,8 @@ do_execsql_test 2.2 { SELECT * FROM ft2, ft3 WHERE y MATCH x; } {abc abc} do_execsql_test 2.3 { SELECT * FROM ft3, ft2 WHERE x MATCH y; } {abc abc} do_execsql_test 2.4 { SELECT * FROM ft3, ft2 WHERE y MATCH x; } {abc abc} -do_catchsql_test 2.5 { - SELECT * FROM ft3, ft2 WHERE y MATCH x AND x MATCH y; +do_catchsql_test 2.5 { + SELECT * FROM ft3, ft2 WHERE y MATCH x AND x MATCH y; } {1 {unable to use function MATCH in the requested context}} finish_test diff --git a/third_party/sqlite/src/test/fts3malloc.test b/third_party/sqlite/src/test/fts3malloc.test index ed30fe24c8ab0..88d5cefdd9cf8 100644 --- a/third_party/sqlite/src/test/fts3malloc.test +++ b/third_party/sqlite/src/test/fts3malloc.test @@ -10,7 +10,7 @@ #*********************************************************************** # # This file contains tests to verify that malloc() errors that occur -# within the FTS3 module code are handled correctly. +# within the FTS3 module code are handled correctly. # set testdir [file dirname $argv0] @@ -78,7 +78,7 @@ do_write_test fts3_malloc-1.7 sqlite_master { do_test fts3_malloc-2.0 { - execsql { + execsql { DROP TABLE ft1; DROP TABLE ft2; DROP TABLE ft3; @@ -107,12 +107,12 @@ foreach {tn sql result} { 5 "SELECT a FROM ft" { {one} {two} {one two} - {three} {one three} {two three} - {one two three} {four} {one four} - {two four} {one two four} {three four} - {one three four} {two three four} {one two three four} - {five} {one five} {two five} - {one two five} {three five} {one three five} + {three} {one three} {two three} + {one two three} {four} {one four} + {two four} {one two four} {three four} + {one three four} {two three four} {one two three four} + {five} {one five} {two five} + {one two five} {three five} {one three five} {two three five} {one two three five} {four five} {one four five} {two four five} {one two four five} {three four five} {one three four five} {two three four five} @@ -123,7 +123,7 @@ foreach {tn sql result} { {one} {one two} {one three} {one two three} {one four} {one two four} {one three four} {one two three four} {one five} {one two five} {one three five} {one two three five} - {one four five} {one two four five} + {one four five} {one two four five} {one three four five} {one two three four five} } @@ -131,21 +131,21 @@ foreach {tn sql result} { {one} {one two} {one three} {one two three} {one four} {one two four} {one three four} {one two three four} {one five} {one two five} {one three five} {one two three five} - {one four five} {one two four five} + {one four five} {one two four five} {one three four five} {one two three four five} } 8 "SELECT a FROM ft WHERE a MATCH 'o* t*'" { - {one two} {one three} {one two three} - {one two four} {one three four} {one two three four} - {one two five} {one three five} {one two three five} + {one two} {one three} {one two three} + {one two four} {one three four} {one two three four} + {one two five} {one three five} {one two three five} {one two four five} {one three four five} {one two three four five} } 9 "SELECT a FROM ft WHERE a MATCH '\"o* t*\"'" { - {one two} {one three} {one two three} - {one two four} {one three four} {one two three four} - {one two five} {one three five} {one two three five} + {one two} {one three} {one two three} + {one two four} {one three four} {one two three four} + {one two five} {one three five} {one two three five} {one two four five} {one three four five} {one two three four five} } @@ -155,7 +155,7 @@ foreach {tn sql result} { 11 {SELECT a FROM ft WHERE a MATCH '"one two three"'} { {one two three} - {one two three four} + {one two three four} {one two three five} {one two three four five} } @@ -178,18 +178,18 @@ foreach {tn sql result} { } 14 {SELECT a FROM ft WHERE b MATCH 'neung'} { - {one} {one two} + {one} {one two} {one three} {one two three} - {one four} {one two four} + {one four} {one two four} {one three four} {one two three four} - {one five} {one two five} + {one five} {one two five} {one three five} {one two three five} - {one four five} {one two four five} + {one four five} {one two four five} {one three four five} {one two three four five} } 15 {SELECT a FROM ft WHERE b MATCH '"neung song sahm"'} { - {one two three} {one two three four} + {one two three} {one two three four} {one two three five} {one two three four five} } @@ -201,8 +201,8 @@ foreach {tn sql result} { 17 {SELECT a FROM ft WHERE b MATCH 'song OR sahm'} { {two} {one two} {three} {one three} {two three} {one two three} - {two four} {one two four} {three four} - {one three four} {two three four} {one two three four} + {two four} {one two four} {three four} + {one three four} {two three four} {one two three four} {two five} {one two five} {three five} {one three five} {two three five} {one two three five} {two four five} {one two four five} {three four five} @@ -210,25 +210,25 @@ foreach {tn sql result} { } 18 {SELECT a FROM ft WHERE a MATCH 'three NOT two'} { - {three} {one three} {three four} + {three} {one three} {three four} {one three four} {three five} {one three five} {three four five} {one three four five} } 19 {SELECT a FROM ft WHERE b MATCH 'sahm NOT song'} { - {three} {one three} {three four} + {three} {one three} {three four} {one three four} {three five} {one three five} {three four five} {one three four five} } 20 {SELECT a FROM ft WHERE ft MATCH 'sahm NOT song'} { - {three} {one three} {three four} + {three} {one three} {three four} {one three four} {three five} {one three five} {three four five} {one three four five} } 21 {SELECT a FROM ft WHERE b MATCH 'neung NEAR song NEAR sahm'} { - {one two three} {one two three four} + {one two three} {one two three four} {one two three five} {one two three four five} } diff --git a/third_party/sqlite/src/test/fts3matchinfo.test b/third_party/sqlite/src/test/fts3matchinfo.test index 8cbcd69041491..94ed82138203e 100644 --- a/third_party/sqlite/src/test/fts3matchinfo.test +++ b/third_party/sqlite/src/test/fts3matchinfo.test @@ -88,8 +88,8 @@ do_execsql_test 3.4 { # full identifier (i.e. "fts3matchinfo-1.1") or, if global var $testprefix # is set, just the numeric component (i.e. "1.1"). # -# The second argument is the name of an FTSX table. The third is the -# full text of a WHERE/MATCH expression to query the table for +# The second argument is the name of an FTSX table. The third is the +# full text of a WHERE/MATCH expression to query the table for # (i.e. "t1 MATCH 'abc'"). The final argument - $results - should be a # key-value list (serialized array) with matchinfo() format specifiers # as keys, and the results of executing the statement: @@ -121,7 +121,7 @@ do_execsql_test 3.4 { # } # # And this command would compute the expected results for matchinfo(t1, 'pcx') -# based on the results of matchinfo(t1, 'p'), matchinfo(t1, 'c') and +# based on the results of matchinfo(t1, 'p'), matchinfo(t1, 'c') and # matchinfo(t1, 'x') in order to test 'pcx'. # proc do_matchinfo_test {tn tbl expr results} { @@ -136,7 +136,7 @@ proc do_matchinfo_test {tn tbl expr results} { if {[llength $res]>$nRow} { set nRow [llength $res] } } - # Construct expected results for any formats for which the caller + # Construct expected results for any formats for which the caller # supplied result is "-". # foreach {fmt res} $results { @@ -229,13 +229,13 @@ do_matchinfo_test 4.1.4 t4 {t4 MATCH '"a b" c'} { s {{2 0} {0 2}} } do_matchinfo_test 4.1.5 t4 {t4 MATCH 'a "b c"'} { s {{2 0} {0 2}} } do_matchinfo_test 4.1.6 t4 {t4 MATCH 'd d'} { s {{1 0} {0 1}} } do_matchinfo_test 4.1.7 t4 {t4 MATCH 'f OR abcd'} { - x { - {0 1 1 1 1 1 0 0 0 0 0 0} + x { + {0 1 1 1 1 1 0 0 0 0 0 0} {1 1 1 0 1 1 0 0 0 0 0 0} } } do_matchinfo_test 4.1.8 t4 {t4 MATCH 'f -abcd'} { - x { + x { {0 1 1 1 1 1} {1 1 1 0 1 1} } @@ -248,9 +248,9 @@ do_execsql_test 4.2.0 { INSERT INTO t5 VALUES('c b c b c'); INSERT INTO t5 VALUES('x x x x x'); } -do_matchinfo_test 4.2.1 t5 {t5 MATCH 'a a'} { +do_matchinfo_test 4.2.1 t5 {t5 MATCH 'a a'} { x {{5 8 2 5 8 2} {3 8 2 3 8 2}} - s {2 1} + s {2 1} } do_matchinfo_test 4.2.2 t5 {t5 MATCH 'a b'} { s {2} } do_matchinfo_test 4.2.3 t5 {t5 MATCH 'a b a'} { s {3} } @@ -263,9 +263,9 @@ do_execsql_test 4.3.0 "INSERT INTO t5 VALUES('x y [string repeat {b } 50000]')"; # It used to be that the second 'a' token would be deferred. That doesn't # work any longer. if 0 { - do_matchinfo_test 4.3.1 t5 {t5 MATCH 'a a'} { + do_matchinfo_test 4.3.1 t5 {t5 MATCH 'a a'} { x {{5 8 2 5 5 5} {3 8 2 3 5 5}} - s {2 1} + s {2 1} } } @@ -279,8 +279,8 @@ do_execsql_test 4.4.0.1 { INSERT INTO t5(t5) VALUES('optimize') } ifcapable fts4_deferred { do_execsql_test 4.4.0.2 { - UPDATE t5_segments - SET block = zeroblob(length(block)) + UPDATE t5_segments + SET block = zeroblob(length(block)) WHERE length(block)>10000; } } @@ -313,17 +313,17 @@ do_execsql_test 5.1 { INSERT INTO t8 VALUES('u v w', 'x y z'); } -do_catchsql_test 5.2.1 { +do_catchsql_test 5.2.1 { SELECT matchinfo(t7, 'a') FROM t7 WHERE t7 MATCH 'x y' } {1 {unrecognized matchinfo request: a}} -do_catchsql_test 5.2.2 { +do_catchsql_test 5.2.2 { SELECT matchinfo(t7, 'l') FROM t7 WHERE t7 MATCH 'x y' } {1 {unrecognized matchinfo request: l}} -do_catchsql_test 5.2.3 { +do_catchsql_test 5.2.3 { SELECT matchinfo(t7, 'n') FROM t7 WHERE t7 MATCH 'x y' } {1 {unrecognized matchinfo request: n}} -do_catchsql_test 5.3.1 { +do_catchsql_test 5.3.1 { SELECT matchinfo(t8, 'l') FROM t8 WHERE t8 MATCH 'x y' } {1 {unrecognized matchinfo request: l}} @@ -340,7 +340,7 @@ do_execsql_test 6.1 { } {{0 0 20 2 0 0 27 2}} do_catchsql_test 6.2 { - UPDATE t9_content SET c0content = 'this record is used to'; + UPDATE t9_content SET c0content = 'this record is used to'; SELECT offsets(t9) FROM t9 WHERE t9 MATCH 'to'; } {1 {database disk image is malformed}} @@ -360,13 +360,13 @@ do_execsql_test 7.3 { SELECT typeof(matchinfo(t10)), length(matchinfo(t10)) FROM t10 WHERE docid=1; } {blob 0} do_execsql_test 7.4 { - SELECT typeof(matchinfo(t10)), length(matchinfo(t10)) + SELECT typeof(matchinfo(t10)), length(matchinfo(t10)) FROM t10 WHERE t10 MATCH 'record' } {blob 20 blob 20} #------------------------------------------------------------------------- -# Test a special case - matchinfo('nxa') with many zero length documents. -# Special because "x" internally uses a statement used by both "n" and "a". +# Test a special case - matchinfo('nxa') with many zero length documents. +# Special because "x" internally uses a statement used by both "n" and "a". # This was causing a problem at one point in the obscure case where the # total number of bytes of data stored in an fts3 table was greater than # the number of rows. i.e. when the following query returns true: @@ -448,7 +448,7 @@ do_execsql_test 10.1 { GROUP BY docId ORDER BY 1; } {1 1 one 2 2 two 3 3 three} - + #--------------------------------------------------------------------------- # Test the 'y' matchinfo flag # @@ -477,11 +477,11 @@ foreach {tn expr res} { 2 "b" { 1 {0 1} 2 {1 0} 3 {1 2} 4 {0 1} 5 {0 1} - 6 {2 2} 8 {2 1} 9 {1 3} + 6 {2 2} 8 {2 1} 9 {1 3} } 3 "y:a" { - 1 {0 2} 3 {0 1} + 1 {0 2} 3 {0 1} 7 {0 1} 8 {0 2} 9 {0 1} 10 {0 3} } @@ -497,12 +497,12 @@ foreach {tn expr res} { 6 "a AND b" { 1 {1 2 0 1} 2 {1 0 1 0} 3 {0 1 1 2} 4 {1 0 0 1} 5 {1 0 0 1} - 6 {1 0 2 2} 8 {1 2 2 1} 9 {1 1 1 3} + 6 {1 0 2 2} 8 {1 2 2 1} 9 {1 1 1 3} } 7 "a OR (a AND b)" { - 1 {1 2 1 2 0 1} 2 {1 0 1 0 1 0} 3 {0 1 0 1 1 2} 4 {1 0 1 0 0 1} - 5 {1 0 1 0 0 1} 6 {1 0 1 0 2 2} 7 {2 1 0 0 0 0} 8 {1 2 1 2 2 1} + 1 {1 2 1 2 0 1} 2 {1 0 1 0 1 0} 3 {0 1 0 1 1 2} 4 {1 0 1 0 0 1} + 5 {1 0 1 0 0 1} 6 {1 0 1 0 2 2} 7 {2 1 0 0 0 0} 8 {1 2 1 2 2 1} 9 {1 1 1 1 1 3} 10 {1 3 0 0 0 0} } diff --git a/third_party/sqlite/src/test/fts3near.test b/third_party/sqlite/src/test/fts3near.test index 2d9981e535519..7f4e25f02497d 100644 --- a/third_party/sqlite/src/test/fts3near.test +++ b/third_party/sqlite/src/test/fts3near.test @@ -64,28 +64,28 @@ do_test fts3near-1.11 { } {1} do_test fts3near-1.12 { execsql {SELECT docid FROM t1 WHERE content MATCH 'five NEAR/1 "two three"'} -} {2 3} +} {2 3} do_test fts3near-1.13 { execsql {SELECT docid FROM t1 WHERE content MATCH 'one NEAR five'} -} {1 3} +} {1 3} do_test fts3near-1.14 { execsql {SELECT docid FROM t1 WHERE content MATCH 'four NEAR four'} -} {} +} {} do_test fts3near-1.15 { execsql {SELECT docid FROM t1 WHERE content MATCH 'one NEAR two NEAR one'} -} {3} +} {3} do_test fts3near-1.16 { execsql { SELECT docid FROM t1 WHERE content MATCH '"one three" NEAR/0 "four five"' } -} {1} +} {1} do_test fts3near-1.17 { execsql { SELECT docid FROM t1 WHERE content MATCH '"four five" NEAR/0 "one three"' } -} {1} +} {1} # Output format of the offsets() function: @@ -175,7 +175,7 @@ db eval { This specification defines Cascading Style Sheets, level 2 (CSS2). CSS2 is a style sheet language that allows authors and users to attach style (e.g., fonts, spacing, and aural cues) to structured documents (e.g., HTML documents and XML applications). By separating the presentation style of documents from the content of documents, CSS2 simplifies Web authoring and site maintenance. CSS2 builds on CSS1 (see [CSS1]) and, with very few exceptions, all valid CSS1 style sheets are valid CSS2 style sheets. CSS2 supports media-specific style sheets so that authors may tailor the presentation of their documents to visual browsers, aural devices, printers, braille devices, handheld devices, etc. This specification also supports content positioning, downloadable fonts, table layout, features for internationalization, automatic counters and numbering, and some properties related to user interface. - ') + ') } do_test fts3near-4.1 { execsql { diff --git a/third_party/sqlite/src/test/fts3offsets.test b/third_party/sqlite/src/test/fts3offsets.test index 4a1e63aa4c0b8..a4651026a8a89 100644 --- a/third_party/sqlite/src/test/fts3offsets.test +++ b/third_party/sqlite/src/test/fts3offsets.test @@ -38,7 +38,7 @@ proc extract {offsets text} { set iOff [expr $s+$n] } append res [string range $text $iOff end] - + set res } db func extract extract @@ -53,8 +53,8 @@ do_execsql_test 1.1.0 { do_execsql_test 1.1.1 { SELECT oid,extract(offsets(xx), x) FROM xx WHERE xx MATCH 'a OR (b NEAR/1 c)'; } { - 1 {(A) x x x (B) (C) x x} - 2 {(A) (B) (C) x (B) x x C} + 1 {(A) x x x (B) (C) x x} + 2 {(A) (B) (C) x (B) x x C} 3 {(A) x x (B) (C) x x x} } @@ -68,7 +68,7 @@ do_execsql_test 1.2.1 { SELECT oid,extract(offsets(xx), x) FROM xx WHERE xx MATCH 'a OR (b NEAR/1 c)'; } { 1 {(A) x x x (B) (C) x x} - 2 {(A) x x C x x x C} + 2 {(A) x x C x x x C} 3 {(A) x x (B) (C) x x x} } @@ -90,7 +90,7 @@ do_execsql_test 1.3.1 { 3 {(A) (B) (C)} 4 {(A) (B) (C) x x x x x x x B} 5 {(A) x x x x x x x x x C} - 6 {(A) x x x x x x x x x x x B} + 6 {(A) x x x x x x x x x x x B} 7 {(A) (B) (C)} } @@ -114,7 +114,7 @@ do_execsql_test 1.4.1 { 5 {(A) (B) (C)} 4 {(A) (B) (C) x x x x x x x B} 3 {(A) x x x x x x x x x C} - 2 {(A) x x x x x x x x x x x B} + 2 {(A) x x x x x x x x x x x B} 1 {(A) (B) (C)} } diff --git a/third_party/sqlite/src/test/fts3prefix.test b/third_party/sqlite/src/test/fts3prefix.test index e8d2b2b5fb251..763a0672a6f40 100644 --- a/third_party/sqlite/src/test/fts3prefix.test +++ b/third_party/sqlite/src/test/fts3prefix.test @@ -51,8 +51,8 @@ proc fts3_terms_and_prefixes {db tbl prefixlengths} { if {[string length $a(term)]<$len} continue incr nExpect set prefix [string range $a(term) 0 [expr $len-1]] - set r [$db one { - SELECT count(*) FROM temp.prefixes WHERE + set r [$db one { + SELECT count(*) FROM temp.prefixes WHERE term = $prefix AND docid = $a(docid) AND col = $a(col) AND pos = $a(pos) }] if {$r != 1} { @@ -64,13 +64,13 @@ proc fts3_terms_and_prefixes {db tbl prefixlengths} { if {$nCount != $nExpect} { error "prefixes.count(*) is $nCount expected $nExpect" } - + execsql { DROP TABLE temp.prefixes } execsql { DROP TABLE temp.terms } set list [list] $db eval " - SELECT sum( 1 << (16*(level%1024)) ) AS total, (level/1024) AS tree + SELECT sum( 1 << (16*(level%1024)) ) AS total, (level/1024) AS tree FROM ${tbl}_segdir GROUP BY tree " { lappend list [list $total $tree] diff --git a/third_party/sqlite/src/test/fts3prefix2.test b/third_party/sqlite/src/test/fts3prefix2.test index e033fb6bcb82e..023023f37a9fc 100644 --- a/third_party/sqlite/src/test/fts3prefix2.test +++ b/third_party/sqlite/src/test/fts3prefix2.test @@ -22,7 +22,7 @@ ifcapable !fts3 { } do_execsql_test 1.0 { PRAGMA page_size = 512 } -do_execsql_test 1.1 { +do_execsql_test 1.1 { CREATE VIRTUAL TABLE t1 USING fts4(x, prefix="2,3"); BEGIN; diff --git a/third_party/sqlite/src/test/fts3query.test b/third_party/sqlite/src/test/fts3query.test index 7d5ae991f70da..0731ddea15906 100644 --- a/third_party/sqlite/src/test/fts3query.test +++ b/third_party/sqlite/src/test/fts3query.test @@ -74,9 +74,9 @@ do_test fts3query-3.1 { execsql { CREATE VIRTUAL TABLE foobar using FTS3(description, tokenize porter); INSERT INTO foobar (description) values (' - Filed under: Emerging Technologies, EV/Plug-in, Hybrid, Chevrolet, GM, - ZENN 2011 Chevy Volt - Click above for high-res image gallery There are - 16 days left in the month of December. Besides being time for most + Filed under: Emerging Technologies, EV/Plug-in, Hybrid, Chevrolet, GM, + ZENN 2011 Chevy Volt - Click above for high-res image gallery There are + 16 days left in the month of December. Besides being time for most Americans to kick their Christmas shopping sessions into high gear and start planning their resolutions for 2010, it also means that there''s precious little time for EEStor to "deliver functional technology" to @@ -84,7 +84,7 @@ do_test fts3query-3.1 { company are too great for us to forget about entirely. We''d love for EEStor''s claims to be independently verified and proven accurate, as would just about anyone else looking to break free of petroleum in fav - '); + '); } } {} @@ -118,25 +118,25 @@ do_test fts3query-4.1 { do_eqp_test fts3query-4.2 { SELECT t1.number FROM t1, ft WHERE t1.number=ft.rowid ORDER BY t1.date } { - 0 0 0 {SCAN TABLE t1 USING COVERING INDEX i1} + 0 0 0 {SCAN TABLE t1 USING COVERING INDEX i1} 0 1 1 {SCAN TABLE ft VIRTUAL TABLE INDEX 1:} } do_eqp_test fts3query-4.3 { SELECT t1.number FROM ft, t1 WHERE t1.number=ft.rowid ORDER BY t1.date } { - 0 0 1 {SCAN TABLE t1 USING COVERING INDEX i1} + 0 0 1 {SCAN TABLE t1 USING COVERING INDEX i1} 0 1 0 {SCAN TABLE ft VIRTUAL TABLE INDEX 1:} } do_eqp_test fts3query-4.4 { SELECT t1.number FROM t1, bt WHERE t1.number=bt.rowid ORDER BY t1.date } { - 0 0 0 {SCAN TABLE t1 USING COVERING INDEX i1} + 0 0 0 {SCAN TABLE t1 USING COVERING INDEX i1} 0 1 1 {SEARCH TABLE bt USING INTEGER PRIMARY KEY (rowid=?)} } do_eqp_test fts3query-4.5 { SELECT t1.number FROM bt, t1 WHERE t1.number=bt.rowid ORDER BY t1.date } { - 0 0 1 {SCAN TABLE t1 USING COVERING INDEX i1} + 0 0 1 {SCAN TABLE t1 USING COVERING INDEX i1} 0 1 0 {SEARCH TABLE bt USING INTEGER PRIMARY KEY (rowid=?)} } @@ -152,7 +152,7 @@ do_select_tests 5.2 -errorformat { wrong number of arguments to function %s() } { 1 "SELECT matchinfo() FROM t2 WHERE t2 MATCH 'history'" matchinfo - 3 "SELECT snippet(t2, 1, 2, 3, 4, 5, 6) FROM t2 WHERE t2 MATCH 'history'" + 3 "SELECT snippet(t2, 1, 2, 3, 4, 5, 6) FROM t2 WHERE t2 MATCH 'history'" snippet } do_select_tests 5.3 -errorformat { @@ -180,7 +180,7 @@ do_execsql_test 5.5 { DROP TABLE t2 } # Test the snippet() function with 1 to 6 arguments. -# +# do_execsql_test 6.1 { CREATE VIRTUAL TABLE t3 USING FTS4(a, b); INSERT INTO t3 VALUES('no gestures', 'another intriguing discovery by observing the hand gestures (called beats) people make while speaking. Research has shown that such gestures do more than add visual emphasis to our words (many people gesture while they''re on the telephone, for example); it seems they actually help our brains find words'); @@ -189,27 +189,27 @@ do_select_tests 6.2 { 1 "SELECT snippet(t3) FROM t3 WHERE t3 MATCH 'gestures'" {{...hand gestures (called beats) people make while speaking. Research has shown that such gestures do...}} - 2 "SELECT snippet(t3, 'XXX') FROM t3 WHERE t3 MATCH 'gestures'" + 2 "SELECT snippet(t3, 'XXX') FROM t3 WHERE t3 MATCH 'gestures'" {{...hand XXXgestures (called beats) people make while speaking. Research has shown that such XXXgestures do...}} - 3 "SELECT snippet(t3, 'XXX', 'YYY') FROM t3 WHERE t3 MATCH 'gestures'" + 3 "SELECT snippet(t3, 'XXX', 'YYY') FROM t3 WHERE t3 MATCH 'gestures'" {{...hand XXXgesturesYYY (called beats) people make while speaking. Research has shown that such XXXgesturesYYY do...}} - 4 "SELECT snippet(t3, 'XXX', 'YYY', 'ZZZ') FROM t3 WHERE t3 MATCH 'gestures'" + 4 "SELECT snippet(t3, 'XXX', 'YYY', 'ZZZ') FROM t3 WHERE t3 MATCH 'gestures'" {{ZZZhand XXXgesturesYYY (called beats) people make while speaking. Research has shown that such XXXgesturesYYY doZZZ}} - 5 "SELECT snippet(t3, 'XXX', 'YYY', 'ZZZ', 1) FROM t3 WHERE t3 MATCH 'gestures'" + 5 "SELECT snippet(t3, 'XXX', 'YYY', 'ZZZ', 1) FROM t3 WHERE t3 MATCH 'gestures'" {{ZZZhand XXXgesturesYYY (called beats) people make while speaking. Research has shown that such XXXgesturesYYY doZZZ}} - 6 "SELECT snippet(t3, 'XXX', 'YYY', 'ZZZ', 0) FROM t3 WHERE t3 MATCH 'gestures'" + 6 "SELECT snippet(t3, 'XXX', 'YYY', 'ZZZ', 0) FROM t3 WHERE t3 MATCH 'gestures'" {{no XXXgesturesYYY}} - 7 "SELECT snippet(t3, 'XXX', 'YYY', 'ZZZ', 1, 5) FROM t3 WHERE t3 MATCH 'gestures'" + 7 "SELECT snippet(t3, 'XXX', 'YYY', 'ZZZ', 1, 5) FROM t3 WHERE t3 MATCH 'gestures'" {{ZZZthe hand XXXgesturesYYY (called beatsZZZ}} } # Test some range queries on the rowid field. -# +# do_execsql_test 7.1 { CREATE VIRTUAL TABLE ft4 USING fts4(x); CREATE TABLE t4(x); @@ -245,15 +245,15 @@ foreach {tn iFirst iLast} [subst { 7 $SMALLINT $SMALLINT 8 $LARGEINT $SMALLINT }] { - set res [db eval { - SELECT rowid FROM t4 WHERE rowid BETWEEN $iFirst AND $iLast + set res [db eval { + SELECT rowid FROM t4 WHERE rowid BETWEEN $iFirst AND $iLast } ] do_execsql_test 7.2.$tn.1.[llength $res] { SELECT rowid FROM ft4 WHERE rowid BETWEEN $iFirst AND $iLast } $res - set res [db eval { - SELECT rowid FROM t4 WHERE rowid BETWEEN $iFirst AND $iLast + set res [db eval { + SELECT rowid FROM t4 WHERE rowid BETWEEN $iFirst AND $iLast ORDER BY +rowid DESC } ] do_execsql_test 7.2.$tn.2.[llength $res] { diff --git a/third_party/sqlite/src/test/fts3rnd.test b/third_party/sqlite/src/test/fts3rnd.test index 97af54925f395..38d9ced7416b1 100644 --- a/third_party/sqlite/src/test/fts3rnd.test +++ b/third_party/sqlite/src/test/fts3rnd.test @@ -23,25 +23,25 @@ # # 2. The following is performed 100 times: # -# a. A row is inserted into the database. The row contents are +# a. A row is inserted into the database. The row contents are # generated as in step 1. The docid is a pseudo-randomly selected # value between 0 and 1000000. -# +# # b. A psuedo-randomly selected row is updated. One of its columns is # set to contain a new document generated in the same way as the # documents in step 1. -# +# # c. A psuedo-randomly selected row is deleted. -# +# # d. For each of several types of fts3 queries, 10 SELECT queries # of the form: -# +# # SELECT docid FROM WHERE MATCH '' -# +# # are evaluated. The results are compared to those calculated by # Tcl code in this file. The patterns used for the different query # types are: -# +# # 1. query = # 2. query = # 3. query = " " @@ -55,11 +55,11 @@ # 11. query = NEAR OR NEAR # 12. query = NEAR NOT NEAR # 13. query = NEAR AND NEAR -# +# # where is a term psuedo-randomly selected from the vocabulary # and prefix is the first 2 characters of such a term followed by # a "*" character. -# +# # Every second iteration, steps (a) through (d) above are performed # within a single transaction. This forces the queries in (d) to # read data from both the database and the in-memory hash table @@ -161,7 +161,7 @@ proc simple_phrase {zPrefix} { } # This [proc] is used to test the FTS3 matchinfo() function. -# +# proc simple_token_matchinfo {zToken bDesc} { set nDoc(0) 0 @@ -197,7 +197,7 @@ proc simple_token_matchinfo {zToken bDesc} { } set ret -} +} proc simple_near {termlist nNear} { set ret [list] @@ -214,7 +214,7 @@ proc simple_near {termlist nNear} { if {$iStart < 0} {set iStart 0} foreach i2 [lsearch -exact -all [lrange $v $iStart $iEnd] $T] { incr i2 $iStart - if {$i2 != $i} { lappend l2 $i2 } + if {$i2 != $i} { lappend l2 $i2 } } } set l [lsort -uniq -integer $l2] @@ -223,7 +223,7 @@ proc simple_near {termlist nNear} { if {[llength $l]} { #puts "MATCH($key): $v" lappend ret $key - } + } } } @@ -231,7 +231,7 @@ proc simple_near {termlist nNear} { } # The following three procs: -# +# # setup_not A B # setup_or A B # setup_and A B @@ -293,19 +293,19 @@ foreach {nodesize order} { execsql "INSERT INTO t1(t1) VALUES('nodesize=$nodesize')" for {set i 0} {$i < 100} {incr i} { insert_row $i } } - + for {set iTest 1} {$iTest <= $NUM_TRIALS} {incr iTest} { catchsql COMMIT set DO_MALLOC_TEST 0 set nRep 10 - if {$iTest==100 && $nodesize==50} { - set DO_MALLOC_TEST 1 + if {$iTest==100 && $nodesize==50} { + set DO_MALLOC_TEST 1 set nRep 2 } set ::testprefix fts3rnd-1.$testname.$iTest - + # Delete one row, update one row and insert one row. # set rows [array names ::t1] @@ -325,13 +325,13 @@ foreach {nodesize order} { delete_row $iDelete if {0==($iTest%2)} { execsql COMMIT } - if {0==($iTest%2)} { - #do_test 0 { fts3_integrity_check t1 } ok + if {0==($iTest%2)} { + #do_test 0 { fts3_integrity_check t1 } ok } # Pick 10 terms from the vocabulary. Check that the results of querying # the database for the set of documents containing each of these terms - # is the same as the result obtained by scanning the contents of the Tcl + # is the same as the result obtained by scanning the contents of the Tcl # array for each term. # for {set i 0} {$i < 10} {incr i} { @@ -399,7 +399,7 @@ foreach {nodesize order} { set terms [list [random_term] [random_term]] set match [join $terms " NEAR "] do_orderbydocid_test 6.$i { - SELECT docid FROM t1 WHERE t1 MATCH $match + SELECT docid FROM t1 WHERE t1 MATCH $match } [simple_near $terms 10] } @@ -413,7 +413,7 @@ foreach {nodesize order} { SELECT docid FROM t1 WHERE t1 MATCH $match } [simple_near $terms $nNear] } - + # Set operations on simple term queries. # foreach {tn op proc} { @@ -430,7 +430,7 @@ foreach {nodesize order} { } [$proc [simple_phrase $term1] [simple_phrase $term2]] } } - + # Set operations on NEAR queries. # foreach {tn op proc} { diff --git a/third_party/sqlite/src/test/fts3shared.test b/third_party/sqlite/src/test/fts3shared.test index 0943c0510fcb6..a580a1c7c9396 100644 --- a/third_party/sqlite/src/test/fts3shared.test +++ b/third_party/sqlite/src/test/fts3shared.test @@ -7,7 +7,7 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The -# focus of this file is the interactions between the FTS3/4 module +# focus of this file is the interactions between the FTS3/4 module # and shared-cache mode. # @@ -53,9 +53,9 @@ do_execsql_test fts3shared-1.2 { # on that table and so the SELECT fails. # do_test fts3shared-1.3 { - catchsql { + catchsql { BEGIN; - SELECT rowid FROM t1 WHERE t1 MATCH 'stars' + SELECT rowid FROM t1 WHERE t1 MATCH 'stars' } db2 } {1 {database table is locked}} @@ -129,12 +129,12 @@ do_test 2.3.6 { catchsql "SELECT * FROM t2aux" dbR } $LOCKED do_test 2.3.7 { execsql COMMIT dbW } {} do_test 2.3.8 { execsql COMMIT dbR } {} -# Test that once a connection has read from the FTS or fts4aux table, +# Test that once a connection has read from the FTS or fts4aux table, # another connection may not write to the FTS table. # foreach {tn sql} { 1 "SELECT * FROM t1 WHERE rowid=1" - 2 "SELECT * FROM t1 WHERE t1 MATCH 'a'" + 2 "SELECT * FROM t1 WHERE t1 MATCH 'a'" 3 "SELECT rowid FROM t1 WHERE t1 MATCH 'a'" 4 "SELECT * FROM t1" 5 "SELECT * FROM t1aux" @@ -147,14 +147,14 @@ foreach {tn sql} { catchsql "INSERT INTO t1 VALUES('p q r')" dbW } $LOCKED - execsql ROLLBACK dbR - execsql ROLLBACK dbW + execsql ROLLBACK dbR + execsql ROLLBACK dbW } # Same test as 2.4.*, except with a content= table. # foreach {tn sql} { - 2 "SELECT * FROM t2 WHERE t2 MATCH 'a'" + 2 "SELECT * FROM t2 WHERE t2 MATCH 'a'" 3 "SELECT rowid FROM t2 WHERE t2 MATCH 'a'" 5 "SELECT * FROM t2aux" } { @@ -166,8 +166,8 @@ foreach {tn sql} { catchsql "INSERT INTO t2(rowid, a, b) VALUES(3, 's t u', 'v w x')" dbW } $LOCKED - execsql ROLLBACK dbR - execsql ROLLBACK dbW + execsql ROLLBACK dbR + execsql ROLLBACK dbW } dbW close diff --git a/third_party/sqlite/src/test/fts3snippet.test b/third_party/sqlite/src/test/fts3snippet.test index 887011cd1116b..1896338aea2b3 100644 --- a/third_party/sqlite/src/test/fts3snippet.test +++ b/third_party/sqlite/src/test/fts3snippet.test @@ -9,8 +9,8 @@ # #************************************************************************* # -# The tests in this file test the FTS3 auxillary functions offsets(), -# snippet() and matchinfo() work. At time of writing, running this file +# The tests in this file test the FTS3 auxillary functions offsets(), +# snippet() and matchinfo() work. At time of writing, running this file # provides full coverage of fts3_snippet.c. # @@ -43,7 +43,7 @@ proc do_offsets_test {name expr args} { SELECT offsets(ft) FROM ft WHERE ft MATCH $expr } $result } - + # Document text used by a few tests. Contains the English names of all # integers between 1 and 300. # @@ -152,17 +152,17 @@ foreach {DO_MALLOC_TEST enc} { } {} do_offsets_test $T.1.2 {xxx} {0 0 0 3 0 0 4 3 0 0 8 3 0 0 12 3} do_offsets_test $T.1.3 {"xxx xxx"} { - 0 0 0 3 0 0 4 3 0 1 4 3 0 0 8 3 + 0 0 0 3 0 0 4 3 0 1 4 3 0 0 8 3 0 1 8 3 0 1 12 3 } do_offsets_test $T.1.4 {"xxx xxx" xxx} { - 0 0 0 3 0 2 0 3 0 0 4 3 0 1 4 3 - 0 2 4 3 0 0 8 3 0 1 8 3 0 2 8 3 + 0 0 0 3 0 2 0 3 0 0 4 3 0 1 4 3 + 0 2 4 3 0 0 8 3 0 1 8 3 0 2 8 3 0 1 12 3 0 2 12 3 } do_offsets_test $T.1.5 {xxx "xxx xxx"} { - 0 0 0 3 0 1 0 3 0 0 4 3 0 1 4 3 - 0 2 4 3 0 0 8 3 0 1 8 3 0 2 8 3 + 0 0 0 3 0 1 0 3 0 0 4 3 0 1 4 3 + 0 2 4 3 0 0 8 3 0 1 8 3 0 2 8 3 0 0 12 3 0 2 12 3 } @@ -188,7 +188,7 @@ foreach {DO_MALLOC_TEST enc} { do_error_test $T.2.3 { SELECT offsets(ft) FROM ft WHERE ft MATCH 'onehundred' } {database disk image is malformed} - + ########################################################################## # Test the snippet function. # @@ -216,7 +216,7 @@ foreach {DO_MALLOC_TEST enc} { do_snippet_test $T.3.9 eight 0 5 "...six seven {eight} nine ten" do_snippet_test $T.3.10 nine 0 5 "...six seven eight {nine} ten" do_snippet_test $T.3.11 ten 0 5 "...six seven eight nine {ten}" - + do_test $T.4.1 { execsql { INSERT INTO ft VALUES( @@ -231,13 +231,13 @@ foreach {DO_MALLOC_TEST enc} { ); } } {} - + do_snippet_test $T.4.2 {one nine} 0 5 { {one} two three...eight {nine} ten } { {one} two three...eight {nine} ten... } - + do_snippet_test $T.4.3 {one nine} 0 -5 { {one} two three four five...six seven eight {nine} ten } { @@ -252,14 +252,14 @@ foreach {DO_MALLOC_TEST enc} { do_snippet_test $T.4.5 {three nineteen} 0 -5 { ...{nineteen} twenty one two {three}... } - + do_snippet_test $T.4.6 {four nineteen} 0 -5 { ...two three {four} five six...seventeen eighteen {nineteen} twenty one... } do_snippet_test $T.4.7 {four NEAR nineteen} 0 -5 { ...seventeen eighteen {nineteen} twenty one...two three {four} five six... } - + do_snippet_test $T.4.8 {four nineteen} 0 5 { ...three {four} five...eighteen {nineteen} twenty... } @@ -279,33 +279,33 @@ foreach {DO_MALLOC_TEST enc} { } { ...two three {four} five six... } - + do_test $T.5.1 { execsql { DROP TABLE IF EXISTS ft; CREATE VIRTUAL TABLE ft USING fts3(a, b, c); INSERT INTO ft VALUES( - 'one two three four five', - 'four five six seven eight', + 'one two three four five', + 'four five six seven eight', 'seven eight nine ten eleven' ); } } {} - + do_snippet_test $T.5.2 {five} -1 3 {...three four {five}} do_snippet_test $T.5.3 {five} 0 3 {...three four {five}} do_snippet_test $T.5.4 {five} 1 3 {four {five} six...} do_snippet_test $T.5.5 {five} 2 3 {seven eight nine...} - + do_test $T.5.6 { execsql { UPDATE ft SET b = NULL } } {} - + do_snippet_test $T.5.7 {five} -1 3 {...three four {five}} do_snippet_test $T.5.8 {five} 0 3 {...three four {five}} do_snippet_test $T.5.9 {five} 1 3 {} do_snippet_test $T.5.10 {five} 2 3 {seven eight nine...} - + do_snippet_test $T.5.11 {one "seven eight nine"} -1 -3 { {one} two three...{seven} {eight} {nine}... } @@ -343,7 +343,7 @@ foreach {DO_MALLOC_TEST enc} { execsql COMMIT } {} eval [list do_snippet_test $T.7.2 {one two} -1 3] $testresults - + ########################################################################## # Test the matchinfo function. # @@ -370,7 +370,7 @@ foreach {DO_MALLOC_TEST enc} { INSERT INTO ft VALUES($ten || ' ' || $ten); } } {} - + do_matchinfo_test $T.8.2 "one" {1 1 1 3 2} {1 1 2 3 2} do_matchinfo_test $T.8.3 "one NEAR/3 ten" {2 1 1 1 1 1 1 1} do_matchinfo_test $T.8.4 "five NEAR/4 ten" \ @@ -423,13 +423,13 @@ foreach {DO_MALLOC_TEST enc} { do_select_test $T.9.9 { SELECT mit(matchinfo(ft)), mit(matchinfo(ft)) - FROM ft WHERE ft MATCH 'two OR "threehundred one"' + FROM ft WHERE ft MATCH 'two OR "threehundred one"' } [normalize { {2 2 1 3 3 1 6 3 0 0 0 0 3 2} {2 2 1 3 3 1 6 3 0 0 0 0 3 2} {2 2 1 3 3 2 6 3 0 0 0 1 3 2} {2 2 1 3 3 2 6 3 0 0 0 1 3 2} - {2 2 1 3 3 3 6 3 0 0 0 2 3 2} + {2 2 1 3 3 3 6 3 0 0 0 2 3 2} {2 2 1 3 3 3 6 3 0 0 0 2 3 2} }] @@ -483,8 +483,8 @@ do_execsql_test 2.2 { } do_execsql_test 2.3 { - SELECT snippet(t2, '[', ']') FROM t2 - WHERE t2 MATCH 'one OR (four AND six)' + SELECT snippet(t2, '[', ']') FROM t2 + WHERE t2 MATCH 'one OR (four AND six)' ORDER BY docid DESC } { {five [one] two three [four]} @@ -509,8 +509,8 @@ do_execsql_test 2.5 { } do_execsql_test 2.6 { - SELECT snippet(t2, '[', ']') FROM t2 - WHERE t2 MATCH 'one OR (four AND six)' + SELECT snippet(t2, '[', ']') FROM t2 + WHERE t2 MATCH 'one OR (four AND six)' ORDER BY docid DESC } { {five [one] two three [four]} diff --git a/third_party/sqlite/src/test/fts3sort.test b/third_party/sqlite/src/test/fts3sort.test index 218bf3e827c91..5892f4be85d0e 100644 --- a/third_party/sqlite/src/test/fts3sort.test +++ b/third_party/sqlite/src/test/fts3sort.test @@ -57,7 +57,7 @@ foreach {t param} { build_database $nRow $param execsql { SELECT count(*) FROM t1 } } $nRow - + foreach {tn query} { 1 "SELECT docid, * FROM t1" 2 "SELECT docid, * FROM t1 WHERE t1 MATCH 'aa'" @@ -74,45 +74,45 @@ foreach {t param} { 13 "SELECT docid, content FROM t1 WHERE t1 MATCH 'aa NEAR/2 bb NEAR/3 cc'" 14 "SELECT docid, content FROM t1 WHERE t1 MATCH '\"aa bb cc\"'" } { - + unset -nocomplain A B C D set A_list [list] set B_list [list] set C_list [list] set D_list [list] - + unset -nocomplain X - db eval "$query ORDER BY rowid ASC" X { - set A($X(docid)) [array get X] + db eval "$query ORDER BY rowid ASC" X { + set A($X(docid)) [array get X] lappend A_list $X(docid) } unset -nocomplain X - db eval "$query ORDER BY rowid DESC" X { - set B($X(docid)) [array get X] + db eval "$query ORDER BY rowid DESC" X { + set B($X(docid)) [array get X] lappend B_list $X(docid) } unset -nocomplain X - db eval "$query ORDER BY docid ASC" X { - set C($X(docid)) [array get X] + db eval "$query ORDER BY docid ASC" X { + set C($X(docid)) [array get X] lappend C_list $X(docid) } unset -nocomplain X - db eval "$query ORDER BY docid DESC" X { - set D($X(docid)) [array get X] + db eval "$query ORDER BY docid DESC" X { + set D($X(docid)) [array get X] lappend D_list $X(docid) } - + do_test $tn.1 { set A_list } [lsort -integer -increasing $A_list] do_test $tn.2 { set B_list } [lsort -integer -decreasing $B_list] do_test $tn.3 { set C_list } [lsort -integer -increasing $C_list] do_test $tn.4 { set D_list } [lsort -integer -decreasing $D_list] - + unset -nocomplain DATA unset -nocomplain X - db eval "$query" X { - set DATA($X(docid)) [array get X] + db eval "$query" X { + set DATA($X(docid)) [array get X] } - + do_test $tn.5 { lsort [array get A] } [lsort [array get DATA]] do_test $tn.6 { lsort [array get B] } [lsort [array get DATA]] do_test $tn.7 { lsort [array get C] } [lsort [array get DATA]] diff --git a/third_party/sqlite/src/test/fts3tok1.test b/third_party/sqlite/src/test/fts3tok1.test index 09b07e9db1970..b3f6ea7385a13 100644 --- a/third_party/sqlite/src/test/fts3tok1.test +++ b/third_party/sqlite/src/test/fts3tok1.test @@ -29,8 +29,8 @@ do_execsql_test 1.0 { foreach {tn tbl} {1 t1 2 t2 3 t3} { do_execsql_test 1.$tn.1 "SELECT * FROM $tbl WHERE input = 'one two three'" { - {one two three} one 0 3 0 - {one two three} two 4 7 1 + {one two three} one 0 3 0 + {one two three} two 4 7 1 {one two three} three 8 13 2 } @@ -80,8 +80,8 @@ do_execsql_test 1.11 { do_execsql_test 1.12 { SELECT * FROM t1 WHERE input < 'b' AND input = 'a b c'; } { - {a b c} a 0 1 0 - {a b c} b 2 3 1 + {a b c} a 0 1 0 + {a b c} b 2 3 1 {a b c} c 4 5 2 } @@ -93,8 +93,8 @@ do_execsql_test 1.13.1 { do_execsql_test 1.13.2 { SELECT * FROM c1, t1 WHERE input = x AND c1.rowid=t1.rowid; } { - {a b c} {a b c} a 0 1 0 - {d e f} {d e f} e 2 3 1 + {a b c} {a b c} a 0 1 0 + {d e f} {d e f} e 2 3 1 } @@ -111,12 +111,12 @@ do_catchsql_test 2.1 { } {1 {SQL logic error or missing database}} do_catchsql_test 2.2 { - CREATE VIRTUAL TABLE t USING fts4(tokenize=simple""); + CREATE VIRTUAL TABLE t USING fts4(tokenize=simple""); } {0 {}} ifcapable fts3_unicode { do_catchsql_test 2.3 { - CREATE VIRTUAL TABLE u USING fts4(tokenize=unicode61""); + CREATE VIRTUAL TABLE u USING fts4(tokenize=unicode61""); } {1 {unknown tokenizer}} } diff --git a/third_party/sqlite/src/test/fts3tok_err.test b/third_party/sqlite/src/test/fts3tok_err.test index df0d4beebd266..823d3628035e1 100644 --- a/third_party/sqlite/src/test/fts3tok_err.test +++ b/third_party/sqlite/src/test/fts3tok_err.test @@ -26,11 +26,11 @@ do_faultsim_test fts3tok_err-1 -faults oom* -prep { } -body { execsql { CREATE VIRTUAL TABLE t1 USING fts3tokenize("simple"); } } -test { - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} } do_test fts3tok_err-2.prep { - faultsim_delete_and_reopen + faultsim_delete_and_reopen execsql { CREATE VIRTUAL TABLE t1 USING fts3tokenize("simple"); } faultsim_save_and_close } {} @@ -38,9 +38,9 @@ do_test fts3tok_err-2.prep { do_faultsim_test fts3tok_err-2 -faults oom* -prep { faultsim_restore_and_reopen } -body { - execsql { SELECT token FROM t1 WHERE input = 'A galaxy far, far away' } + execsql { SELECT token FROM t1 WHERE input = 'A galaxy far, far away' } } -test { - faultsim_test_result {0 {a galaxy far far away}} + faultsim_test_result {0 {a galaxy far far away}} } diff --git a/third_party/sqlite/src/test/fts3varint.test b/third_party/sqlite/src/test/fts3varint.test index ca0189dbfcb10..706c88085a62b 100644 --- a/third_party/sqlite/src/test/fts3varint.test +++ b/third_party/sqlite/src/test/fts3varint.test @@ -27,13 +27,13 @@ proc do_fts3_varint_test {tn list} { } do_fts3_varint_test 1.0 { - 1 10 100 1000 10000 100000 1000000 + 1 10 100 1000 10000 100000 1000000 10000000 100000000 1000000000 10000000000 100000000000 1000000000000 10000000000000 } do_fts3_varint_test 1.1 { - -1 -10 -100 -1000 -10000 -100000 -1000000 + -1 -10 -100 -1000 -10000 -100000 -1000000 -10000000 -100000000 -1000000000 -10000000000 -100000000000 -1000000000000 -10000000000000 } @@ -92,25 +92,25 @@ do_fts3_varint_test 2.50 { 1125899906842623 1125899906842624 1125899906842625 } do_fts3_varint_test 2.51 { 2251799813685247 2251799813685248 2251799813685249 } do_fts3_varint_test 2.52 { 4503599627370495 4503599627370496 4503599627370497 } do_fts3_varint_test 2.53 { 9007199254740991 9007199254740992 9007199254740993 } -do_fts3_varint_test 2.54 { +do_fts3_varint_test 2.54 { 18014398509481983 18014398509481984 18014398509481985 } -do_fts3_varint_test 2.55 { +do_fts3_varint_test 2.55 { 36028797018963967 36028797018963968 36028797018963969 } -do_fts3_varint_test 2.56 { +do_fts3_varint_test 2.56 { 72057594037927935 72057594037927936 72057594037927937 } -do_fts3_varint_test 2.57 { +do_fts3_varint_test 2.57 { 144115188075855871 144115188075855872 144115188075855873 } -do_fts3_varint_test 2.58 { +do_fts3_varint_test 2.58 { 288230376151711743 288230376151711744 288230376151711745 } -do_fts3_varint_test 2.59 { +do_fts3_varint_test 2.59 { 576460752303423487 576460752303423488 576460752303423489 } -do_fts3_varint_test 2.60 { +do_fts3_varint_test 2.60 { 1152921504606846975 1152921504606846976 1152921504606846977 } -do_fts3_varint_test 2.61 { +do_fts3_varint_test 2.61 { 2305843009213693951 2305843009213693952 2305843009213693953 } -do_fts3_varint_test 2.62 { +do_fts3_varint_test 2.62 { 4611686018427387903 4611686018427387904 4611686018427387905 } -do_fts3_varint_test 2.63 { +do_fts3_varint_test 2.63 { 9223372036854775807 9223372036854775808 9223372036854775809 } do_fts3_varint_test 3.0 { 18446744073709551615 -18446744073709551615 } diff --git a/third_party/sqlite/src/test/fts4aa.test b/third_party/sqlite/src/test/fts4aa.test index e6c7f9336e417..095c522026f66 100644 --- a/third_party/sqlite/src/test/fts4aa.test +++ b/third_party/sqlite/src/test/fts4aa.test @@ -119,7 +119,7 @@ do_test fts4aa-1.8 { } {} ifcapable fts4_deferred { do_test fts4aa-1.9 { - # Note: Token 'in' is being deferred in the following query. + # Note: Token 'in' is being deferred in the following query. db eval { SELECT docid, mit(matchinfo(t1, 'pcxnal')) FROM t1 WHERE t1 MATCH 'joseph died in egypt' diff --git a/third_party/sqlite/src/test/fts4check.test b/third_party/sqlite/src/test/fts4check.test index 1e2f6b234fb66..ee7b7c68d4a7b 100644 --- a/third_party/sqlite/src/test/fts4check.test +++ b/third_party/sqlite/src/test/fts4check.test @@ -128,7 +128,7 @@ do_test 3.0 { } foreach docid [execsql {SELECT docid FROM t1 ORDER BY 1 ASC}] { execsql { - INSERT INTO t3(x, y, langid) + INSERT INTO t3(x, y, langid) SELECT x, y, (docid%9)*4 FROM t1 WHERE docid=$docid; } } @@ -165,8 +165,8 @@ do_execsql_test 4.0 { do_execsql_test 4.1 { PRAGMA writable_schema = 1; - UPDATE sqlite_master - SET sql = 'CREATE VIRTUAL TABLE t4 USING fts4(a, b, c)' + UPDATE sqlite_master + SET sql = 'CREATE VIRTUAL TABLE t4 USING fts4(a, b, c)' WHERE name = 't4'; } diff --git a/third_party/sqlite/src/test/fts4content.test b/third_party/sqlite/src/test/fts4content.test index 67642b6b8a2b2..b516768989f48 100644 --- a/third_party/sqlite/src/test/fts4content.test +++ b/third_party/sqlite/src/test/fts4content.test @@ -24,7 +24,7 @@ ifcapable !fts3 { #------------------------------------------------------------------------- # Test organization: -# +# # 1.* - Warm-body tests. # # 2.* - Querying a content=xxx FTS table. @@ -38,7 +38,7 @@ ifcapable !fts3 { # # 6.* - Test the effects of messing with the schema of table xxx after # creating a content=xxx FTS index. -# +# # 7.* - Test that if content=xxx is specified and table xxx does not # exist, the FTS table can still be used for INSERT and some # SELECT statements. @@ -61,8 +61,8 @@ do_execsql_test 1.1.1 { do_execsql_test 1.1.2 { PRAGMA table_info(ft1); } { - 0 a {} 0 {} 0 - 1 b {} 0 {} 0 + 0 a {} 0 {} 0 + 1 b {} 0 {} 0 2 c {} 0 {} 0 } @@ -78,18 +78,18 @@ do_execsql_test 1.2.1 { CREATE VIRTUAL TABLE ft1 USING fts4(content=t1, b); PRAGMA table_info(ft1); } { - 0 b {} 0 {} 0 + 0 b {} 0 {} 0 } -do_execsql_test 1.2.2 { - SELECT *, rowid FROM ft1 +do_execsql_test 1.2.2 { + SELECT *, rowid FROM ft1 } {{x y} 1} #------------------------------------------------------------------------- # The following block of tests - 2.* - test that a content=xxx FTS table # can be queried. Also tested are cases where rows identified in the FTS -# are missing from the content table, and cases where the index is +# are missing from the content table, and cases where the index is # inconsistent with the content table. -# +# do_execsql_test 2.0 { CREATE TABLE t2(x); INSERT INTO t2 VALUES('O S W W F U C R Q I C N P Z Y Y E Y Y E'); -- 1 @@ -118,8 +118,8 @@ do_execsql_test 2.1 { CREATE VIRTUAL TABLE ft2 USING fts4(content=t2); INSERT INTO ft2(ft2) VALUES('rebuild'); - -- Modify the backing table a bit: Row 17 is missing and the contents - -- of row 20 do not match the FTS index contents. + -- Modify the backing table a bit: Row 17 is missing and the contents + -- of row 20 do not match the FTS index contents. DELETE FROM t2 WHERE rowid = 17; UPDATE t2 SET x = 'a b c d e f g h i j' WHERE rowid = 20; } @@ -173,9 +173,9 @@ foreach {tn match result} { #------------------------------------------------------------------------- # The following block of tests - 3.* - test that the FTS index can be -# modified by writing to the table. But that this has no effect on the +# modified by writing to the table. But that this has no effect on the # content table. -# +# do_execsql_test 3.1 { CREATE TABLE t3(x, y); @@ -193,7 +193,7 @@ do_execsql_test 3.1.3 { SELECT * FROM t3 } {} # This DELETE does not work, since there is no row in [t3] to base the # DELETE on. So the SELECT on [ft3] still returns rowid 21. -do_execsql_test 3.1.4 { +do_execsql_test 3.1.4 { DELETE FROM ft3; SELECT rowid FROM ft3 WHERE ft3 MATCH '"a b c"'; } {21} @@ -301,7 +301,7 @@ foreach {tn match rowidlist} { #------------------------------------------------------------------------- # Test cases 4.* test the 'rebuild' command. On content=xxx and regular # FTS tables. -# +# do_execsql_test 4.0 { CREATE TABLE t4(x); CREATE VIRTUAL TABLE ft4 USING fts4(content=t4); @@ -361,13 +361,13 @@ do_execsql_test 4.2.6 { #------------------------------------------------------------------------- # Test cases 5.* test that the following commands do not create/move or # delete a %_content table when used with a content=xxx FTS table. -# +# do_execsql_test 5.1.1 { CREATE TABLE t5(a, b, c, d); CREATE VIRTUAL TABLE ft5 USING fts4(content=t5); SELECT name FROM sqlite_master WHERE name LIKE '%t5%'; } { - t5 ft5 ft5_segments ft5_segdir + t5 ft5 ft5_segments ft5_segdir sqlite_autoindex_ft5_segdir_1 ft5_docsize ft5_stat } do_execsql_test 5.1.2 { @@ -379,7 +379,7 @@ do_execsql_test 5.1.2 { do_execsql_test 5.1.3 { SELECT name FROM sqlite_master WHERE name LIKE '%t6%'; } { - ft6 ft6_segments ft6_segdir + ft6 ft6_segments ft6_segdir sqlite_autoindex_ft6_segdir_1 ft6_docsize ft6_stat } do_execsql_test 5.1.4 { @@ -405,8 +405,8 @@ do_execsql_test 5.1.7 { } #------------------------------------------------------------------------- -# Test cases 6.* test -# +# Test cases 6.* test +# do_catchsql_test 6.1.1 { CREATE VIRTUAL TABLE ft7 USING fts4(content=t7); } {1 {no such table: main.t7}} @@ -431,7 +431,7 @@ sqlite3 db test.db do_execsql_test 6.2.3 { SELECT name FROM sqlite_master WHERE name LIKE '%t7%' } { - ft7 ft7_segments ft7_segdir sqlite_autoindex_ft7_segdir_1 + ft7 ft7_segments ft7_segdir sqlite_autoindex_ft7_segdir_1 ft7_docsize ft7_stat } do_catchsql_test 6.2.4 { @@ -473,7 +473,7 @@ do_catchsql_test 6.2.11 { #------------------------------------------------------------------------- # Test cases 7.* -# +# do_execsql_test 7.1.1 { CREATE VIRTUAL TABLE ft8 USING fts4(content=nosuchtable, x); INSERT INTO ft8(docid, x) VALUES(13, 'U O N X G'); @@ -508,7 +508,7 @@ do_catchsql_test 7.2.4 { #------------------------------------------------------------------------- # Test cases 8.* -# +# do_execsql_test 8.1 { CREATE TABLE t10(a, b); INSERT INTO t10 VALUES( @@ -529,7 +529,7 @@ do_execsql_test 8.6 { SELECT rowid FROM ft10 WHERE ft10 MATCH 'abas*'; } {1} #------------------------------------------------------------------------- # Test cases 9.* -# +# reset_db register_echo_module [sqlite3_connection_pointer db] @@ -550,7 +550,7 @@ do_execsql_test 9.3 { SELECT rowid, * FROM ft1 WHERE ft1 MATCH 'a' } {1 {a b} {c d} 2 {e f} {a b}} -do_execsql_test 9.4 { +do_execsql_test 9.4 { DELETE FROM ft1 WHERE docid=1; } @@ -566,7 +566,7 @@ do_execsql_test 9.6 { #------------------------------------------------------------------------- # Test cases 10.* -# +# reset_db register_fs_module [sqlite3_connection_pointer db] @@ -589,7 +589,7 @@ do_execsql_test 10.1 { CREATE VIRTUAL TABLE vt USING fs(idx); SELECT path, data FROM vt; } { - 1 {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 z} + 1 {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 z} 2 {a b c d e f g h i j k l m a b c d e f g h i j k l m} 3 {n o p q r s t u v w x y z n o p q r s t u v w x y z} } @@ -627,7 +627,7 @@ do_execsql_test 10.7 { #------------------------------------------------------------------------- # Test cases 11.* -# +# reset_db do_catchsql_test 11.1 { diff --git a/third_party/sqlite/src/test/fts4docid.test b/third_party/sqlite/src/test/fts4docid.test index 2328b6ec1d3cf..f6d5a3ac3d862 100644 --- a/third_party/sqlite/src/test/fts4docid.test +++ b/third_party/sqlite/src/test/fts4docid.test @@ -104,9 +104,9 @@ foreach {tn where result} { set q "SELECT docid FROM t1 $w $order" if {$tn2<5} { - set r [lsort -integer -increasing $result] + set r [lsort -integer -increasing $result] } else { - set r [lsort -integer -decreasing $result] + set r [lsort -integer -decreasing $result] } do_execsql_test 3.$tn.$tn2 $q $r diff --git a/third_party/sqlite/src/test/fts4growth.test b/third_party/sqlite/src/test/fts4growth.test index 4dc2212464215..1c6cf03f8f764 100644 --- a/third_party/sqlite/src/test/fts4growth.test +++ b/third_party/sqlite/src/test/fts4growth.test @@ -55,7 +55,7 @@ do_test 1.4 { } { execsql { INSERT INTO x1 VALUES($L) } } - execsql { + execsql { INSERT INTO x1(x1) VALUES('merge=4,4'); SELECT level, end_block, length(root) FROM x1_segdir; } @@ -90,7 +90,7 @@ do_test 1.6 { } { execsql { INSERT INTO x1 VALUES($L) } } - execsql { + execsql { SELECT level, end_block, length(root) FROM x1_segdir; } } {1 {224 921} 2 1 {226 1230} 7 0 {0 98} 98} @@ -101,11 +101,11 @@ do_execsql_test 1.7 { #------------------------------------------------------------------------- # -do_execsql_test 2.1 { +do_execsql_test 2.1 { CREATE TABLE t1(docid, words); CREATE VIRTUAL TABLE x2 USING fts4; } -fts_kjv_genesis +fts_kjv_genesis do_test 2.2 { foreach id [db eval {SELECT docid FROM t1}] { execsql { @@ -120,18 +120,18 @@ do_test 2.2 { } } {} -do_execsql_test 2.3 { +do_execsql_test 2.3 { SELECT count(*) FROM x2_segdir WHERE level=2; SELECT count(*) FROM x2_segdir WHERE level=3; } {6 0} -do_execsql_test 2.4 { +do_execsql_test 2.4 { INSERT INTO x2(x2) VALUES('merge=4,4'); SELECT count(*) FROM x2_segdir WHERE level=2; SELECT count(*) FROM x2_segdir WHERE level=3; } {6 1} -do_execsql_test 2.5 { +do_execsql_test 2.5 { SELECT end_block FROM x2_segdir WHERE level=3; INSERT INTO x2(x2) VALUES('merge=4,4'); SELECT end_block FROM x2_segdir WHERE level=3; @@ -140,18 +140,18 @@ do_execsql_test 2.5 { } {{5588 -3950} {5588 -11766} {5588 -15541}} do_execsql_test 2.6 { - SELECT sum(length(block)) FROM x2_segdir, x2_segments WHERE + SELECT sum(length(block)) FROM x2_segdir, x2_segments WHERE blockid BETWEEN start_block AND leaves_end_block AND level=3 } {15541} -do_execsql_test 2.7 { +do_execsql_test 2.7 { INSERT INTO x2(x2) VALUES('merge=1000,4'); SELECT end_block FROM x2_segdir WHERE level=3; } {{5588 127563}} do_execsql_test 2.8 { - SELECT sum(length(block)) FROM x2_segdir, x2_segments WHERE + SELECT sum(length(block)) FROM x2_segdir, x2_segments WHERE blockid BETWEEN start_block AND leaves_end_block AND level=3 } {127563} @@ -203,7 +203,7 @@ do_test 3.1.2 { execsql { SELECT count(*) FROM x3_segdir } } {0} do_test 3.1.3 { - db transaction { + db transaction { insert_doc 1 2 3 4 5 6 7 8 9 delete_doc 9 8 7 } @@ -225,7 +225,7 @@ do_test 3.2.2 { execsql { SELECT level, idx, second(end_block) FROM x3_segdir } } {1 0 412} -# This assumes the crisis merge happens when there are already 16 +# This assumes the crisis merge happens when there are already 16 # segments and one more is added. # do_test 3.3.1 { @@ -241,7 +241,7 @@ do_test 3.3.2 { } {1 0 412} #-------------------------------------------------------------------------- -# Check a theory on a bug in fts4 - that segments with idx==0 were not +# Check a theory on a bug in fts4 - that segments with idx==0 were not # being incrementally merged correctly. Theory turned out to be false. # do_execsql_test 4.1 { @@ -251,13 +251,13 @@ do_execsql_test 4.1 { CREATE VIRTUAL TABLE x4 USING fts4(words); } do_test 4.2 { - fts_kjv_genesis + fts_kjv_genesis execsql { INSERT INTO x4 SELECT words FROM t1 } execsql { INSERT INTO x4 SELECT words FROM t1 } } {} do_execsql_test 4.3 { - SELECT level, idx, second(end_block) FROM x4_segdir + SELECT level, idx, second(end_block) FROM x4_segdir } {0 0 117483 0 1 118006} do_execsql_test 4.4 { @@ -287,7 +287,7 @@ do_execsql_test 5.1 { CREATE TABLE t1(docid, words); CREATE VIRTUAL TABLE x2 USING fts4; } -fts_kjv_genesis +fts_kjv_genesis proc first {L} {lindex $L 0} db func first first @@ -356,7 +356,7 @@ do_execsql_test 6.3 { INSERT INTO x5 SELECT words FROM t1 LIMIT 100 OFFSET 100; SELECT level, idx, end_block FROM x5_segdir; } { - 0 0 {10 9216} 0 1 {21 9330} 0 2 {31 8850} + 0 0 {10 9216} 0 1 {21 9330} 0 2 {31 8850} 0 3 {40 8689} 1 0 {1320 -3117} 0 4 {1329 8297} } @@ -387,7 +387,7 @@ do_execsql_test 7.1 { INSERT INTO x6 SELECT words FROM t1; SELECT level, idx, end_block FROM x6_segdir; } { - 0 0 {118 117483} 0 1 {238 118006} 0 2 {358 118006} + 0 0 {118 117483} 0 1 {238 118006} 0 2 {358 118006} 0 3 {478 118006} 0 4 {598 118006} 0 5 {718 118006} } @@ -395,7 +395,7 @@ do_execsql_test 7.2 { INSERT INTO x6(x6) VALUES('merge=25,4'); SELECT level, idx, end_block FROM x6_segdir; } { - 0 0 {118 117483} 0 1 {238 118006} 0 2 {358 118006} + 0 0 {118 117483} 0 1 {238 118006} 0 2 {358 118006} 0 3 {478 118006} 0 4 {598 118006} 0 5 {718 118006} 1 0 {23694 -69477} } @@ -404,7 +404,7 @@ do_execsql_test 7.3 { UPDATE x6_segdir SET end_block = first(end_block) WHERE level=1; SELECT level, idx, end_block FROM x6_segdir; } { - 0 0 {118 117483} 0 1 {238 118006} 0 2 {358 118006} + 0 0 {118 117483} 0 1 {238 118006} 0 2 {358 118006} 0 3 {478 118006} 0 4 {598 118006} 0 5 {718 118006} 1 0 23694 } @@ -413,7 +413,7 @@ do_execsql_test 7.4 { INSERT INTO x6(x6) VALUES('merge=25,4'); SELECT level, idx, end_block FROM x6_segdir; } { - 0 0 {118 117483} 0 1 {238 118006} 0 2 {358 118006} + 0 0 {118 117483} 0 1 {238 118006} 0 2 {358 118006} 0 3 {478 118006} 0 4 {598 118006} 0 5 {718 118006} 1 0 23694 } @@ -433,7 +433,7 @@ do_execsql_test 7.6 { } do_execsql_test 7.7 { - SELECT sum(length(block)) FROM x6_segments + SELECT sum(length(block)) FROM x6_segments } {635247} diff --git a/third_party/sqlite/src/test/fts4growth2.test b/third_party/sqlite/src/test/fts4growth2.test index bcccf89c87a53..6dd22ae5b82c6 100644 --- a/third_party/sqlite/src/test/fts4growth2.test +++ b/third_party/sqlite/src/test/fts4growth2.test @@ -26,7 +26,7 @@ ifcapable !fts3 { source $testdir/genesis.tcl do_execsql_test 1.0 { CREATE TABLE t1(docid, words); } -fts_kjv_genesis +fts_kjv_genesis proc structure {} { puts [ db eval {SELECT level, count(*) FROM x1_segdir GROUP BY level} ] @@ -34,11 +34,11 @@ proc structure {} { proc tt {val} { execsql { - DELETE FROM x1 + DELETE FROM x1 WHERE docid IN (SELECT docid FROM t1 WHERE (rowid-1)%4==$val+0); } execsql { - INSERT INTO x1(docid, content) + INSERT INTO x1(docid, content) SELECT docid, words FROM t1 WHERE (rowid%4)==$val+0; } } @@ -52,8 +52,8 @@ do_test 1.2 { for {set i 0} {$i < 40} {incr i} { tt 0 ; tt 1 ; tt 2 ; tt 3 } - execsql { - SELECT max(level) FROM x1_segdir; + execsql { + SELECT max(level) FROM x1_segdir; SELECT count(*) FROM x1_segdir WHERE level=2; } } {2 1} @@ -62,8 +62,8 @@ do_test 1.3 { for {set i 0} {$i < 40} {incr i} { tt 0 ; tt 1 ; tt 2 ; tt 3 } - execsql { - SELECT max(level) FROM x1_segdir; + execsql { + SELECT max(level) FROM x1_segdir; SELECT count(*) FROM x1_segdir WHERE level=2; } } {2 1} diff --git a/third_party/sqlite/src/test/fts4incr.test b/third_party/sqlite/src/test/fts4incr.test index 92104888b427a..3b1ee7c82f0ae 100644 --- a/third_party/sqlite/src/test/fts4incr.test +++ b/third_party/sqlite/src/test/fts4incr.test @@ -21,7 +21,7 @@ ifcapable !fts3 { return } -# Create the fts_kjv_genesis procedure which fills and FTS3/4 table +# Create the fts_kjv_genesis procedure which fills and FTS3/4 table # with the complete text of the Book of Genesis. # source $testdir/genesis.tcl @@ -39,7 +39,7 @@ foreach {tn q res} { 1 { SELECT count(*) FROM t1 WHERE t1 MATCH 'and' AND docid < 1010000} 224 2 { SELECT count(*) FROM t1 WHERE t1 MATCH '"in the"' AND docid < 1010000} 47 3 { SELECT count(*) FROM t1 WHERE t1 MATCH '"And God"' AND docid < 1010000} 33 - 4 { SELECT count(*) FROM t1 WHERE t1 + 4 { SELECT count(*) FROM t1 WHERE t1 MATCH '"land of canaan"' AND docid < 1030000 } 7 } { foreach s {0 1} { diff --git a/third_party/sqlite/src/test/fts4langid.test b/third_party/sqlite/src/test/fts4langid.test index fdb1876be8acd..0ec1d126d0a76 100644 --- a/third_party/sqlite/src/test/fts4langid.test +++ b/third_party/sqlite/src/test/fts4langid.test @@ -37,7 +37,7 @@ set ::testprefix fts4langid # # 2.3.* - Same as 2.1.*, after a 'rebuild' command. # -# 3.* - Tests with content= tables. Both where there is a real +# 3.* - Tests with content= tables. Both where there is a real # underlying content table and where there is not. # # 4.* - Test that if one is provided, the tokenizer xLanguage method @@ -71,7 +71,7 @@ do_execsql_test 1.10 {SELECT lang_id FROM t1} {0 4 0} do_execsql_test 1.11 { CREATE VIRTUAL TABLE t2 USING fts4; INSERT INTO t2 VALUES('abc'); -} +} do_execsql_test 1.12 { SELECT rowid FROM t2 WHERE content MATCH 'abc' } 1 do_execsql_test 1.13 { @@ -234,7 +234,7 @@ proc filter_list {list langid} { set res } -do_test 2.0 { +do_test 2.0 { reset_db build_multilingual_db_1 db } {} @@ -251,7 +251,7 @@ proc do_test_query1 {tn query res_script} { } } -# Run some queries. +# Run some queries. do_test_query1 2.1.1 {delta} { rowid_list delta } do_test_query1 2.1.2 {"zero one two"} { rowid_list "zero one two" } do_test_query1 2.1.3 {zero one two} { @@ -279,7 +279,7 @@ do_test_query1 2.2.4 {"zero one" OR "one two"} { # And rebuild. # -do_test 2.3 { +do_test 2.3 { reset_db build_multilingual_db_1 db execsql { INSERT INTO t2(t2) VALUES('rebuild') } @@ -347,13 +347,13 @@ do_test_query1 3.3.4 {"zero one" OR "one two"} { proc build_multilingual_db_2 {db} { $db eval { CREATE VIRTUAL TABLE t4 USING fts4( - tokenize=testtokenizer, + tokenize=testtokenizer, languageid=lid ); } for {set i 0} {$i < 50} {incr i} { - execsql { - INSERT INTO t4(docid, content, lid) VALUES($i, 'The Quick Brown Fox', $i) + execsql { + INSERT INTO t4(docid, content, lid) VALUES($i, 'The Quick Brown Fox', $i) } } } @@ -399,7 +399,7 @@ proc build_multilingual_db_3 {db} { execsql { INSERT INTO t5(docid, content, lid) VALUES( $lid, 'My language is ' || $lid, $lid - ) + ) } } } @@ -415,7 +415,7 @@ do_execsql_test 5.1.1 { do_execsql_test 5.1.2 {SELECT docid FROM t5 WHERE t5 MATCH 'language'} 0 foreach langid [list 0 1 2 [expr 1<<30]] { - do_execsql_test 5.2.$langid { + do_execsql_test 5.2.$langid { SELECT docid FROM t5 WHERE t5 MATCH 'language' AND lid = $langid } $langid } @@ -442,7 +442,7 @@ do_test 5.3.3 { do_execsql_test 5.3.4 { INSERT INTO t6(t6) VALUES('optimize') } {} do_execsql_test 5.3.5 { SELECT docid FROM t6 WHERE t6 MATCH 'belong' } {1} -do_execsql_test 5.3.6 { +do_execsql_test 5.3.6 { SELECT docid FROM t6 WHERE t6 MATCH 'belong' AND lid=$lid } {2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21} diff --git a/third_party/sqlite/src/test/fts4merge.test b/third_party/sqlite/src/test/fts4merge.test index eac18311d3ce7..26634de0d8774 100644 --- a/third_party/sqlite/src/test/fts4merge.test +++ b/third_party/sqlite/src/test/fts4merge.test @@ -36,48 +36,48 @@ foreach mod {fts3 fts4} { # do_test 1.0 { fts3_build_db_1 -module $mod 1004 } {} do_test 1.1 { fts3_integrity_check t1 } {ok} - do_execsql_test 1.1 { - SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level + do_execsql_test 1.1 { + SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level } { - 0 {0 1 2 3 4 5 6 7 8 9 10 11} + 0 {0 1 2 3 4 5 6 7 8 9 10 11} 1 {0 1 2 3 4 5 6 7 8 9 10 11 12 13} 2 {0 1 2} } - + for {set i 0} {$i<20} {incr i} { do_execsql_test 1.2.$i.1 { INSERT INTO t1(t1) VALUES('merge=1') } do_test 1.2.$i.2 { fts3_integrity_check t1 } ok - do_execsql_test 1.2.$i.3 { + do_execsql_test 1.2.$i.3 { SELECT docid FROM t1 WHERE t1 MATCH 'zero one two three' } {123 132 213 231 312 321} } - - do_execsql_test 1.3 { - SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level + + do_execsql_test 1.3 { + SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level } { 2 {0 1 2 3} } - + for {set i 0} {$i<100} {incr i} { do_execsql_test 1.4.$i { INSERT INTO t1(t1) VALUES('merge=1,4') } do_test 1.4.$i.2 { fts3_integrity_check t1 } ok - do_execsql_test 1.4.$i.3 { + do_execsql_test 1.4.$i.3 { SELECT docid FROM t1 WHERE t1 MATCH 'zero one two three' } {123 132 213 231 312 321} } - - do_execsql_test 1.5 { - SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level + + do_execsql_test 1.5 { + SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level } { 3 0 } - + #------------------------------------------------------------------------- # Test cases 2.* test that errors in the xxx part of the 'merge=xxx' are # handled correctly. # do_execsql_test 2.0 "CREATE VIRTUAL TABLE t2 USING $mod" - + foreach {tn arg} { 1 {merge=abc} 2 {merge=%%%} @@ -87,37 +87,37 @@ foreach mod {fts3 fts4} { 6 {merge=6,six} 7 {merge=6,1} } { - do_catchsql_test 2.$tn { + do_catchsql_test 2.$tn { INSERT INTO t2(t2) VALUES($arg); } {1 {SQL logic error or missing database}} } - + #------------------------------------------------------------------------- # Test cases 3.* # - do_test 3.0 { + do_test 3.0 { reset_db execsql { PRAGMA page_size = 512 } - fts3_build_db_2 -module $mod 30040 + fts3_build_db_2 -module $mod 30040 } {} do_test 3.1 { fts3_integrity_check t2 } {ok} - - do_execsql_test 3.2 { - SELECT level, group_concat(idx, ' ') FROM t2_segdir GROUP BY level + + do_execsql_test 3.2 { + SELECT level, group_concat(idx, ' ') FROM t2_segdir GROUP BY level } { - 0 {0 1 2 3 4 5 6} - 1 {0 1 2 3 4} - 2 {0 1 2 3 4} + 0 {0 1 2 3 4 5 6} + 1 {0 1 2 3 4} + 2 {0 1 2 3 4} 3 {0 1 2 3 4 5 6} } - - do_execsql_test 3.3 { + + do_execsql_test 3.3 { INSERT INTO t2(t2) VALUES('merge=1000000,2'); - SELECT level, group_concat(idx, ' ') FROM t2_segdir GROUP BY level + SELECT level, group_concat(idx, ' ') FROM t2_segdir GROUP BY level } { 4 0 } - + #------------------------------------------------------------------------- # Test cases 4.* # @@ -127,14 +127,14 @@ foreach mod {fts3 fts4} { CREATE VIRTUAL TABLE t4 USING $mod; PRAGMA main.page_size; " {512} - + do_test 4.2 { foreach x {a c b d e f g h i j k l m n o p} { execsql "INSERT INTO t4 VALUES('[string repeat $x 600]')" } execsql {SELECT level, group_concat(idx, ' ') FROM t4_segdir GROUP BY level} } {0 {0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15}} - + foreach {tn expect} { 1 "0 {0 1 2 3 4 5 6 7 8 9 10 11 12 13} 1 0" 2 "0 {0 1 2 3 4 5 6 7 8 9 10 11 12} 1 0" @@ -151,18 +151,18 @@ foreach mod {fts3 fts4} { SELECT level, group_concat(idx, ' ') FROM t4_segdir GROUP BY level; } $expect } - + do_execsql_test 4.4.1 { SELECT quote(value) FROM t4_stat WHERE rowid=1 } {X'0006'} - + do_execsql_test 4.4.2 { DELETE FROM t4_stat WHERE rowid=1; INSERT INTO t4(t4) VALUES('merge=1,12'); SELECT level, group_concat(idx, ' ') FROM t4_segdir GROUP BY level; } "0 {0 1 2 3 4 5} 1 0" - - + + #------------------------------------------------------------------------- # Test cases 5.* # @@ -172,64 +172,64 @@ foreach mod {fts3 fts4} { # # * There are less segments on the input level that the disrupted # incremental merge operated on, or - # - # * Sufficient segments exist on the input level but the segments - # contain keys smaller than the largest key in the potential output + # + # * Sufficient segments exist on the input level but the segments + # contain keys smaller than the largest key in the potential output # segment. - # + # do_test 5.1 { reset_db fts3_build_db_1 -module $mod 1000 } {} - + do_execsql_test 5.2 { SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level; } { - 0 {0 1 2 3 4 5 6 7} - 1 {0 1 2 3 4 5 6 7 8 9 10 11 12 13} + 0 {0 1 2 3 4 5 6 7} + 1 {0 1 2 3 4 5 6 7 8 9 10 11 12 13} 2 {0 1 2} } - + do_execsql_test 5.3 { INSERT INTO t1(t1) VALUES('merge=1,5'); INSERT INTO t1(t1) VALUES('merge=1,5'); SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level; } { - 1 {0 1 2 3 4 5 6 7 8 9 10 11 12 13 14} + 1 {0 1 2 3 4 5 6 7 8 9 10 11 12 13 14} 2 {0 1 2 3} } - + do_execsql_test 5.4 {SELECT quote(value) from t1_stat WHERE rowid=1} {X'010F'} do_test 5.5 { foreach docid [execsql {SELECT docid FROM t1}] { execsql {INSERT INTO t1 SELECT * FROM t1 WHERE docid=$docid} } } {} - + do_execsql_test 5.6 {SELECT quote(value) from t1_stat WHERE rowid=1} {X'010F'} - + do_execsql_test 5.7 { SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level; SELECT quote(value) from t1_stat WHERE rowid=1; } { - 0 {0 1 2 3 4 5 6 7} - 1 {0 1 2 3 4 5 6 7 8 9 10 11 12} - 2 {0 1 2 3 4 5 6 7} + 0 {0 1 2 3 4 5 6 7} + 1 {0 1 2 3 4 5 6 7 8 9 10 11 12} + 2 {0 1 2 3 4 5 6 7} X'010F' } - + do_execsql_test 5.8 { INSERT INTO t1(t1) VALUES('merge=1,6'); INSERT INTO t1(t1) VALUES('merge=1,6'); SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level; SELECT quote(value) from t1_stat WHERE rowid=1; } { - 1 {0 1 2 3 4 5 6 7 8 9 10 11 12 13} + 1 {0 1 2 3 4 5 6 7 8 9 10 11 12 13} 2 {0 1 2 3 4 5 6 7 8} X'010E' } - + do_test 5.8.1 { fts3_integrity_check t1 } ok - + do_test 5.9 { set L [expr 16*16*7 + 16*3 + 12] foreach docid [execsql { @@ -238,14 +238,14 @@ foreach mod {fts3 fts4} { execsql {INSERT INTO t1 SELECT * FROM t1 WHERE docid=$docid} } } {} - + do_execsql_test 5.10 { SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level; SELECT quote(value) from t1_stat WHERE rowid=1; } { 0 {0 1 2 3 4 5 6 7 8 9 10 11} 1 0 2 0 3 0 X'010E' } - + do_execsql_test 5.11 { INSERT INTO t1(t1) VALUES('merge=1,6'); SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level; @@ -253,7 +253,7 @@ foreach mod {fts3 fts4} { } { 1 {0 1} 2 0 3 0 X'010E' } - + #------------------------------------------------------------------------- # Test cases 6.* # @@ -279,13 +279,13 @@ foreach mod {fts3 fts4} { INSERT INTO t1 VALUES($d); COMMIT; } - + execsql { INSERT INTO t1(t1) VALUES('merge=1,2'); INSERT INTO t1(t1) VALUES('merge=1,2'); } } {} - + #------------------------------------------------------------------------- # Test cases 7.* # @@ -297,12 +297,12 @@ foreach mod {fts3 fts4} { reset_db fts3_build_db_1 -module $mod 1000 } {} - + do_execsql_test 7.1 { SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level } { - 0 {0 1 2 3 4 5 6 7} - 1 {0 1 2 3 4 5 6 7 8 9 10 11 12 13} + 0 {0 1 2 3 4 5 6 7} + 1 {0 1 2 3 4 5 6 7 8 9 10 11 12 13} 2 {0 1 2} } do_test 7.2 { diff --git a/third_party/sqlite/src/test/fts4merge2.test b/third_party/sqlite/src/test/fts4merge2.test index 308b6929fab03..0dfd7292f5006 100644 --- a/third_party/sqlite/src/test/fts4merge2.test +++ b/third_party/sqlite/src/test/fts4merge2.test @@ -22,7 +22,7 @@ do_faultsim_test 1.1 -faults oom-* -prep { } -body { execsql { INSERT INTO t1(t1) VALUES('merge=32,4') } } -test { - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} } do_faultsim_test 1.2 -faults oom-t* -prep { @@ -32,7 +32,7 @@ do_faultsim_test 1.2 -faults oom-t* -prep { execsql { INSERT INTO t1(t1) VALUES('merge=1,2') } execsql { INSERT INTO t1(t1) VALUES('merge=1,2') } } -test { - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} } finish_test diff --git a/third_party/sqlite/src/test/fts4merge3.test b/third_party/sqlite/src/test/fts4merge3.test index 08b68b97d9653..a955620ded165 100644 --- a/third_party/sqlite/src/test/fts4merge3.test +++ b/third_party/sqlite/src/test/fts4merge3.test @@ -48,37 +48,37 @@ do_all_bc_test { set x [sql2 "PRAGMA page_count"] expr {$x>=1284 && $x<=1286} } {1} - do_test 1.5 { sql2 { + do_test 1.5 { sql2 { SELECT level, count(*) FROM t2_segdir GROUP BY level ORDER BY 1 } } [list 0 15 1 1 2 14 3 4] # Run some incr-merge operations on the db. for {set i 0} {$i<10} {incr i} { do_test 1.6.$i.1 { sql1 { INSERT INTO t2(t2) VALUES('merge=2,2') } } {} - do_test 1.6.$i.2 { - sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" + do_test 1.6.$i.2 { + sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" } {1485} } - do_test 1.7 { sql2 { + do_test 1.7 { sql2 { SELECT level, count(*) FROM t2_segdir GROUP BY level ORDER BY 1 } } {2 15 3 5} - # Using the old connection, insert many rows. + # Using the old connection, insert many rows. do_test 1.8 { for {set i 0} {$i < 1500} {incr i} { sql2 "INSERT INTO t2 SELECT content FROM t2 WHERE docid = $i" } } {} - do_test 1.9 { sql2 { + do_test 1.9 { sql2 { SELECT level, count(*) FROM t2_segdir GROUP BY level ORDER BY 1 } } [list 0 12 1 13 2 4 3 6] # Run a big incr-merge operation on the db. do_test 1.10 { sql1 { INSERT INTO t2(t2) VALUES('merge=2000,2') } } {} - do_test 1.11 { - sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" + do_test 1.11 { + sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" } {1485 21485} do_test 1.12 { @@ -86,16 +86,16 @@ do_all_bc_test { sql2 "INSERT INTO t2 SELECT content FROM t2 WHERE docid = $i" } } {} - do_test 1.13 { - sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" + do_test 1.13 { + sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" } {1485 21485 22985} - do_test 1.14 { + do_test 1.14 { sql2 "INSERT INTO t2(t2) VALUES('optimize')" - sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" + sql2 "SELECT docid FROM t2 WHERE t2 MATCH 'abc'" } {1485 21485 22985} - do_test 1.15 { sql2 { + do_test 1.15 { sql2 { SELECT level, count(*) FROM t2_segdir GROUP BY level ORDER BY 1 } } {4 1} } diff --git a/third_party/sqlite/src/test/fts4merge4.test b/third_party/sqlite/src/test/fts4merge4.test index 038e460d0e1c0..6c730eee95d3f 100644 --- a/third_party/sqlite/src/test/fts4merge4.test +++ b/third_party/sqlite/src/test/fts4merge4.test @@ -80,9 +80,9 @@ foreach {tn am expected} { execsql { INSERT INTO t2(t2) VALUES($am) }; eval $openclose - + for {set i 0} {$i < 100} {incr i} { - execsql { + execsql { BEGIN; INSERT INTO t2 VALUES($doc); INSERT INTO t2 VALUES($doc); @@ -92,7 +92,7 @@ foreach {tn am expected} { COMMIT; } } - + execsql { SELECT level, count(*) FROM t2_segdir GROUP BY level } } [list {*}$expected] } diff --git a/third_party/sqlite/src/test/fts4noti.test b/third_party/sqlite/src/test/fts4noti.test index 670720397023c..cea28c7f709d6 100644 --- a/third_party/sqlite/src/test/fts4noti.test +++ b/third_party/sqlite/src/test/fts4noti.test @@ -53,17 +53,17 @@ do_execsql_test 1.x { SELECT name FROM sqlite_master } {cc} # Test that notindexed columns are not indexed. # foreach {tn schema} { - 1 { - CREATE VIRTUAL TABLE t1 USING fts4(a, b, c, notindexed=b); + 1 { + CREATE VIRTUAL TABLE t1 USING fts4(a, b, c, notindexed=b); } - 2 { + 2 { CREATE TABLE c1(a, b, c); INSERT INTO c1 VALUES('one two', 'three four', 'five six'); INSERT INTO c1 VALUES('three four', 'five six', 'one two'); - CREATE VIRTUAL TABLE t1 USING fts4(content=c1, notindexed=b); + CREATE VIRTUAL TABLE t1 USING fts4(content=c1, notindexed=b); } - 3 { - CREATE VIRTUAL TABLE t1 USING fts4(content="", a, b, c, notindexed=b); + 3 { + CREATE VIRTUAL TABLE t1 USING fts4(content="", a, b, c, notindexed=b); } } { execsql $schema @@ -85,15 +85,15 @@ foreach {tn schema} { if {$tn!=3} { do_execsql_test 2.$tn.9 { INSERT INTO t1(t1) VALUES('rebuild') } - + do_execsql_test 2.$tn.10 { SELECT docid FROM t1 WHERE t1 MATCH 'one' } {1 2} do_execsql_test 2.$tn.11 { SELECT docid FROM t1 WHERE t1 MATCH 'three' } {2} do_execsql_test 2.$tn.12 { SELECT docid FROM t1 WHERE t1 MATCH 'five' } {1} - - do_execsql_test 2.$tn.13 { + + do_execsql_test 2.$tn.13 { SELECT a,b,c FROM t1 WHERE docid=1 } {{one two} {three four} {five six}} - do_execsql_test 2.$tn.14 { + do_execsql_test 2.$tn.14 { SELECT a,b,c FROM t1 WHERE docid=2 } {{three four} {five six} {one two}} } @@ -112,7 +112,7 @@ do_test 3.2 { set v [string repeat " 1" 50000] set v1 "x $v" set v2 "y $v" - execsql { + execsql { INSERT INTO t2 VALUES(1, 'x y z'); INSERT INTO t2 VALUES(2, $v1); INSERT INTO t2 VALUES(3, $v2); @@ -128,7 +128,7 @@ do_execsql_test 3.5 { SELECT x FROM t2 WHERE t2 MATCH 'x' } {1 2} do_execsql_test 3.6 { SELECT x FROM t2 WHERE t2 MATCH 'x 1' } {2} do_execsql_test 3.x { DROP TABLE t2 } - + #------------------------------------------------------------------------- # Test that the types of notindexed columns are not modified. # diff --git a/third_party/sqlite/src/test/fts4onepass.test b/third_party/sqlite/src/test/fts4onepass.test index 46cb4b794b09d..4962fe7fc6284 100644 --- a/third_party/sqlite/src/test/fts4onepass.test +++ b/third_party/sqlite/src/test/fts4onepass.test @@ -29,7 +29,7 @@ do_execsql_test 1.0 { } #------------------------------------------------------------------------- -# Check that UPDATE and DELETE statements that feature "WHERE rowid=?" or +# Check that UPDATE and DELETE statements that feature "WHERE rowid=?" or # or "WHERE docid=?" clauses do not use statement journals. But that other # DELETE and UPDATE statements do. # @@ -55,7 +55,7 @@ foreach {tn sql uses} { #------------------------------------------------------------------------- # Check that putting a "DELETE/UPDATE ... WHERE rowid=?" statement in a -# trigger program does not prevent the VM from using a statement +# trigger program does not prevent the VM from using a statement # transaction. Even if the calling statement cannot hit a constraint. # do_execsql_test 2.0 { @@ -84,7 +84,7 @@ foreach {tn sql uses} { #------------------------------------------------------------------------- # Test that an "UPDATE ... WHERE rowid=?" works and does not corrupt the -# index when it strikes a constraint. Both inside and outside a +# index when it strikes a constraint. Both inside and outside a # transaction. # foreach {tn tcl1 tcl2} { @@ -111,7 +111,7 @@ foreach {tn tcl1 tcl2} { 1 { UPDATE ft2 SET docid=2 WHERE docid=1 } { 1 {a b c} 2 {a b d} 3 {a b e} } - 2 { + 2 { INSERT INTO ft2(rowid, content) VALUES(4, 'a b f'); UPDATE ft2 SET docid=5 WHERE docid=4; UPDATE ft2 SET docid=3 WHERE docid=5; @@ -136,7 +136,7 @@ foreach {tn tcl1 tcl2} { } { do_catchsql_test 3.$tn.$tn2.a $sql {1 {constraint failed}} do_execsql_test 3.$tn.$tn2.b { SELECT rowid, content FROM ft2 } $content - do_execsql_test 3.$tn.$tn2.c { + do_execsql_test 3.$tn.$tn2.c { INSERT INTO ft2(ft2) VALUES('integrity-check'); } } diff --git a/third_party/sqlite/src/test/fts4opt.test b/third_party/sqlite/src/test/fts4opt.test index 0d0ed9f4f0c87..3c3d578c7e2c3 100644 --- a/third_party/sqlite/src/test/fts4opt.test +++ b/third_party/sqlite/src/test/fts4opt.test @@ -21,7 +21,7 @@ ifcapable !fts3 { return } -# Create the fts_kjv_genesis procedure which fills and FTS3/4 table +# Create the fts_kjv_genesis procedure which fills and FTS3/4 table # with the complete text of the Book of Genesis. # source $testdir/genesis.tcl @@ -43,19 +43,19 @@ proc prepare_for_optimize {db tbl} { level, idx, start_block, leaves_end_block, end_block, root ); - INSERT INTO temp.tmp_segdir - SELECT + INSERT INTO temp.tmp_segdir + SELECT 1024*(o.level / 1024) + 32, -- level sum(o.leveli.idx)), -- idx o.start_block, o.leaves_end_block, o.end_block, o.root -- other - FROM %_segdir o, %_segdir i + FROM %_segdir o, %_segdir i WHERE (o.level / 1024) = (i.level / 1024) GROUP BY o.level, o.idx; - + DELETE FROM %_segdir; INSERT INTO %_segdir SELECT * FROM temp.tmp_segdir; DROP TABLE temp.tmp_segdir; - + COMMIT; }] } @@ -70,9 +70,9 @@ do_test 1.1 { do_execsql_test 1.2 { SELECT level, count(*) FROM t2_segdir GROUP BY level } { - 0 13 1 15 2 5 - 1024 13 1025 15 1026 5 - 2048 13 2049 15 2050 5 + 0 13 1 15 2 5 + 1024 13 1025 15 1026 5 + 2048 13 2049 15 2050 5 3072 13 3073 15 3074 5 } @@ -83,9 +83,9 @@ do_execsql_test 1.4 { INSERT INTO t2(t2) VALUES('integrity-check') } do_execsql_test 1.5 { SELECT level, count(*) FROM t2_segdir GROUP BY level } { - 32 33 - 1056 33 - 2080 33 + 32 33 + 1056 33 + 2080 33 3104 33 } @@ -131,9 +131,9 @@ do_test 2.1 { do_execsql_test 2.2 { SELECT level, count(*) FROM t2_segdir GROUP BY level } { - 0 10 1 15 2 12 - 1024 10 1025 15 1026 12 - 2048 10 2049 15 2050 12 + 0 10 1 15 2 12 + 1024 10 1025 15 1026 12 + 2048 10 2049 15 2050 12 3072 10 3073 15 3074 12 } @@ -144,9 +144,9 @@ do_execsql_test 2.4 { INSERT INTO t2(t2) VALUES('integrity-check') } do_execsql_test 2.5 { SELECT level, count(*) FROM t2_segdir GROUP BY level } { - 32 37 - 1056 37 - 2080 37 + 32 37 + 1056 37 + 2080 37 3104 37 } diff --git a/third_party/sqlite/src/test/fts4unicode.test b/third_party/sqlite/src/test/fts4unicode.test index 500cfcdcaa7e7..4939cd629d4e7 100644 --- a/third_party/sqlite/src/test/fts4unicode.test +++ b/third_party/sqlite/src/test/fts4unicode.test @@ -88,7 +88,7 @@ set docs [list { Added the sqlite3_db_readonly() interface. } { Added the SQLITE_FCNTL_PRAGMA file control, giving VFS implementations the - ability to add new PRAGMA statements or to override built-in PRAGMAs. + ability to add new PRAGMA statements or to override built-in PRAGMAs. } { Queries of the form: "SELECT max(x), y FROM table" returns the value of y on the same row that contains the maximum x value. @@ -97,16 +97,16 @@ set docs [list { } { Documented support for the FTS4 content option. This feature has actually been in the code since version 3.7.9 but is only now considered to be - officially supported. + officially supported. } { Pending statements no longer block ROLLBACK. Instead, the pending statement - will return SQLITE_ABORT upon next access after the ROLLBACK. + will return SQLITE_ABORT upon next access after the ROLLBACK. } { Improvements to the handling of CSV inputs in the command-line shell } { Fix a bug introduced in version 3.7.10 that might cause a LEFT JOIN to be incorrectly converted into an INNER JOIN if the WHERE clause indexable terms - connected by OR. + connected by OR. }] set map(a) [list "\u00C4" "\u00E4"] ; # LATIN LETTER A WITH DIAERESIS @@ -119,12 +119,12 @@ set map(h) [list "\u1E26" "\u1E27"] ; # LATIN LETTER H WITH DIAERESIS set map(w) [list "\u1E84" "\u1E85"] ; # LATIN LETTER W WITH DIAERESIS set map(x) [list "\u1E8C" "\u1E8D"] ; # LATIN LETTER X WITH DIAERESIS foreach k [array names map] { - lappend mappings [string toupper $k] [lindex $map($k) 0] + lappend mappings [string toupper $k] [lindex $map($k) 0] lappend mappings $k [lindex $map($k) 1] } -proc mapdoc {doc} { +proc mapdoc {doc} { set doc [regsub -all {[[:space:]]+} $doc " "] - string map $::mappings [string trim $doc] + string map $::mappings [string trim $doc] } do_test 2.0 { @@ -145,11 +145,11 @@ do_test 2.1 { foreach {tn query snippet} { 2 "row" { - ...returns the value of y on the same [row] that contains + ...returns the value of y on the same [row] that contains the maximum x value. } 3 "ROW" { - ...returns the value of y on the same [row] that contains + ...returns the value of y on the same [row] that contains the maximum x value. } 4 "rollback" { @@ -171,7 +171,7 @@ foreach {tn query snippet} { } #------------------------------------------------------------------------- -# Make sure the unicode61 tokenizer does not crash if it is passed a +# Make sure the unicode61 tokenizer does not crash if it is passed a # NULL pointer. reset_db do_execsql_test 3.1 { @@ -261,17 +261,17 @@ do_test 4.3 { do_unicode_token_test3 5.1 {tokenchars=} { sqlite3_reset sqlite3_column_int } { - 0 sqlite3 sqlite3 - 1 reset reset - 2 sqlite3 sqlite3 - 3 column column + 0 sqlite3 sqlite3 + 1 reset reset + 2 sqlite3 sqlite3 + 3 column column 4 int int } do_unicode_token_test3 5.2 {tokenchars=_} { sqlite3_reset sqlite3_column_int } { - 0 sqlite3_reset sqlite3_reset + 0 sqlite3_reset sqlite3_reset 1 sqlite3_column_int sqlite3_column_int } @@ -293,7 +293,7 @@ do_unicode_token_test3 5.4 {tokenchars=xyz} { do_unicode_token_test3 5.5 {tokenchars=_} {separators=zyx} { sqlite3_resetxsqlite3_column_intyhonda_phantom } { - 0 sqlite3_reset sqlite3_reset + 0 sqlite3_reset sqlite3_reset 1 sqlite3_column_int sqlite3_column_int 2 honda_phantom honda_phantom } @@ -313,7 +313,7 @@ do_unicode_token_test3 5.7 \ 3 \u2445timer \u2445timer \ ] -# Check that it is not possible to add a standalone diacritic codepoint +# Check that it is not possible to add a standalone diacritic codepoint # to either separators or tokenchars. do_unicode_token_test3 5.8 "separators=\u0301" \ "hello\u0301world \u0301helloworld" \ @@ -344,14 +344,14 @@ proc do_tokenize {tokenizer txt} { set res } -# Argument $lCodepoint must be a list of codepoints (integers) that +# Argument $lCodepoint must be a list of codepoints (integers) that # correspond to whitespace characters. This command creates a string -# $W from the codepoints, then tokenizes "${W}hello{$W}world${W}" +# $W from the codepoints, then tokenizes "${W}hello{$W}world${W}" # using tokenizer $tokenizer. The test passes if the tokenizer successfully # extracts the two 5 character tokens. # proc do_isspace_test {tn tokenizer lCp} { - set whitespace [format [string repeat %c [llength $lCp]] {*}$lCp] + set whitespace [format [string repeat %c [llength $lCp]] {*}$lCp] set txt "${whitespace}hello${whitespace}world${whitespace}" uplevel [list do_test $tn [list do_tokenize $tokenizer $txt] {hello world}] } @@ -359,7 +359,7 @@ proc do_isspace_test {tn tokenizer lCp} { set tokenizers [list unicode61] ifcapable icu { lappend tokenizers icu } -# Some tests to check that the tokenizers can both identify white-space +# Some tests to check that the tokenizers can both identify white-space # codepoints. All codepoints tested below are of type "Zs" in the # UnicodeData.txt file. # @@ -477,7 +477,7 @@ foreach {tn sql} { CREATE VIRTUAL TABLE t7 USING fts4(tokenize=unicode61 `separators=x\xC4`); } } { - do_execsql_test 9.$tn.0 { + do_execsql_test 9.$tn.0 { DROP TABLE IF EXISTS t5; DROP TABLE IF EXISTS t5aux; DROP TABLE IF EXISTS t6; @@ -492,7 +492,7 @@ foreach {tn sql} { INSERT INTO t5 VALUES('one two three/four.five.six'); SELECT * FROM t5aux; } { - four.five.six * 1 1 four.five.six 0 1 1 + four.five.six * 1 1 four.five.six 0 1 1 {one two three} * 1 1 {one two three} 0 1 1 } @@ -501,7 +501,7 @@ foreach {tn sql} { INSERT INTO t6 VALUES('alpha=beta"gamma/delta[epsilon]zeta'); SELECT * FROM t6aux; } { - {alpha=beta"gamma} * 1 1 {alpha=beta"gamma} 0 1 1 + {alpha=beta"gamma} * 1 1 {alpha=beta"gamma} 0 1 1 {delta[epsilon]zeta} * 1 1 {delta[epsilon]zeta} 0 1 1 } @@ -510,8 +510,8 @@ foreach {tn sql} { INSERT INTO t7 VALUES('alephxbeth\xC4gimel'); SELECT * FROM t7aux; } { - aleph * 1 1 aleph 0 1 1 - beth * 1 1 beth 0 1 1 + aleph * 1 1 aleph 0 1 1 + beth * 1 1 beth 0 1 1 gimel * 1 1 gimel 0 1 1 } } @@ -530,10 +530,10 @@ do_execsql_test 10.1 { CREATE VIRTUAL TABLE t1aux USING fts4aux(t1); SELECT * FROM t1aux; } { - .single=word * 1 1 .single=word 0 1 1 - four * 1 1 four 0 1 1 - one * 1 1 one 0 1 1 - three * 1 1 three 0 1 1 + .single=word * 1 1 .single=word 0 1 1 + four * 1 1 four 0 1 1 + one * 1 1 one 0 1 1 + three * 1 1 three 0 1 1 two * 1 1 two 0 1 1 } @@ -547,13 +547,13 @@ do_execsql_test 10.2 { CREATE VIRTUAL TABLE t2aux USING fts4aux(t2); SELECT * FROM t2aux; } { - one * 1 1 one 0 1 1 - onebtwoathree * 1 1 onebtwoathree 0 1 1 - three * 1 1 three 0 1 1 + one * 1 1 one 0 1 1 + onebtwoathree * 1 1 onebtwoathree 0 1 1 + three * 1 1 three 0 1 1 two * 1 1 two 0 1 1 } -# Test that the tokenchars and separators options work with the +# Test that the tokenchars and separators options work with the # fts3tokenize table. # do_execsql_test 11.1 { diff --git a/third_party/sqlite/src/test/func.test b/third_party/sqlite/src/test/func.test index 98ae8ddeb59b0..abebc3cc640b2 100644 --- a/third_party/sqlite/src/test/func.test +++ b/third_party/sqlite/src/test/func.test @@ -507,7 +507,7 @@ if {$encoding=="UTF-16le"} { execsql {SELECT hex(replace('aabcdefg','a','aaa'))} } {616161616161626364656667} } - + # Use the "sqlite_register_test_function" TCL command which is part of # the text fixture in order to verify correct operation of some of # the user-defined SQL function APIs that are not used by the built-in @@ -576,7 +576,7 @@ do_test func-11.1 { # Test that destructors passed to sqlite3 by calls to sqlite3_result_text() # etc. are called. These tests use two special user-defined functions -# (implemented in func.c) only available in test builds. +# (implemented in func.c) only available in test builds. # # Function test_destructor() takes one argument and returns a copy of the # text form of that argument. A destructor is associated with the return @@ -713,7 +713,7 @@ do_execsql_test 13.8.6 { do_test func-14.1 { catch { db function [string repeat X 254] {return "hello"} - } + } } {0} do_test func-14.2 { catch { @@ -861,7 +861,7 @@ ifcapable compound&&subquery { do_test func-18.15 { catchsql { - SELECT sum(x) FROM + SELECT sum(x) FROM (SELECT 9223372036854775807 AS x UNION ALL SELECT 10 AS x); } @@ -869,14 +869,14 @@ do_test func-18.15 { if {[working_64bit_int]} { do_test func-18.16 { catchsql { - SELECT sum(x) FROM + SELECT sum(x) FROM (SELECT 9223372036854775807 AS x UNION ALL SELECT -10 AS x); } } {0 9223372036854775797} do_test func-18.17 { catchsql { - SELECT sum(x) FROM + SELECT sum(x) FROM (SELECT -9223372036854775807 AS x UNION ALL SELECT 10 AS x); } @@ -884,7 +884,7 @@ if {[working_64bit_int]} { } do_test func-18.18 { catchsql { - SELECT sum(x) FROM + SELECT sum(x) FROM (SELECT -9223372036854775807 AS x UNION ALL SELECT -10 AS x); } @@ -1024,8 +1024,8 @@ do_test func-21.8 { ifcapable tclvar { do_test func-21.9 { - # Attempt to exploit a buffer-overflow that at one time existed - # in the REPLACE function. + # Attempt to exploit a buffer-overflow that at one time existed + # in the REPLACE function. set ::str "[string repeat A 29998]CC[string repeat A 35537]" set ::rep [string repeat B 65536] execsql { @@ -1339,7 +1339,7 @@ do_test func-29.6 { # do_execsql_test func-29.10 { CREATE TABLE t29b(a,b,c,d,e,f,g,h,i); - INSERT INTO t29b + INSERT INTO t29b VALUES(1, hex(randomblob(2000)), null, 0, 1, '', zeroblob(0),'x',x'01'); SELECT typeof(c), typeof(d), typeof(e), typeof(f), typeof(g), typeof(h), typeof(i) FROM t29b; @@ -1377,7 +1377,7 @@ for {set i 65536} {$i<=0x10ffff} {incr i 139} { # Test char(). # -do_execsql_test func-31.1 { - SELECT char(), length(char()), typeof(char()) +do_execsql_test func-31.1 { + SELECT char(), length(char()), typeof(char()) } {{} 0 text} finish_test diff --git a/third_party/sqlite/src/test/func3.test b/third_party/sqlite/src/test/func3.test index 3b1613b56c6d4..a5ff1ee0bb1d3 100644 --- a/third_party/sqlite/src/test/func3.test +++ b/third_party/sqlite/src/test/func3.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing that destructor functions associated -# with functions created using sqlite3_create_function_v2() is +# with functions created using sqlite3_create_function_v2() is # correctly invoked. # set testdir [file dirname $argv0] @@ -63,7 +63,7 @@ do_test func3-3.2 { sqlite3 db test.db do_test func3-4.1 { set destroyed 0 - set rc [catch { + set rc [catch { sqlite3_create_function_v2 db f3 -1 any -func f3 -step f3 -destroy destroy } msg] list $rc $msg diff --git a/third_party/sqlite/src/test/func5.test b/third_party/sqlite/src/test/func5.test index bfd545b4e3041..b7cc1adea9b8b 100644 --- a/third_party/sqlite/src/test/func5.test +++ b/third_party/sqlite/src/test/func5.test @@ -38,7 +38,7 @@ do_execsql_test func5-1.2 { # and it really is non-deterministic, returning a different result each # time. But counter2() is marked as deterministic, so it does get factored # out of the loop. counter2() has the same implementation as counter1(), -# returning a different result on each invocation, but because it is +# returning a different result on each invocation, but because it is # only invoked once outside of the loop, it appears to return the same # result multiple times. # diff --git a/third_party/sqlite/src/test/fuzz-oss1.test b/third_party/sqlite/src/test/fuzz-oss1.test index e77b7ed0f87de..7340f4bb35ab0 100644 --- a/third_party/sqlite/src/test/fuzz-oss1.test +++ b/third_party/sqlite/src/test/fuzz-oss1.test @@ -28,7 +28,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl -# Schema and query extracted from Skrooge.org. +# Schema and query extracted from Skrooge.org. # do_test fuzz-oss1-skrooge { db eval { diff --git a/third_party/sqlite/src/test/fuzz.test b/third_party/sqlite/src/test/fuzz.test index 0deed3b636452..8d4af7a7bff52 100644 --- a/third_party/sqlite/src/test/fuzz.test +++ b/third_party/sqlite/src/test/fuzz.test @@ -10,12 +10,12 @@ #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is generating semi-random strings of SQL -# (a.k.a. "fuzz") and sending it into the parser to try to +# (a.k.a. "fuzz") and sending it into the parser to try to # generate errors. # # The tests in this file are really about testing fuzzily generated -# SQL parse-trees. The majority of the fuzzily generated SQL is -# valid as far as the parser is concerned. +# SQL parse-trees. The majority of the fuzzily generated SQL is +# valid as far as the parser is concerned. # # The most complicated trees are for SELECT statements. # @@ -72,8 +72,8 @@ do_test fuzz-1.6 { do_test fuzz-1.7 { execsql { - SELECT ( SELECT zeroblob(1000) FROM ( - SELECT * FROM (SELECT 'first') ORDER BY NOT 'in') + SELECT ( SELECT zeroblob(1000) FROM ( + SELECT * FROM (SELECT 'first') ORDER BY NOT 'in') ) } } [execsql {SELECT zeroblob(1000)}] @@ -95,7 +95,7 @@ do_test fuzz-1.9 { } {} do_test fuzz-1.10 { - # Bug in calculation of Parse.ckOffset causing an assert() + # Bug in calculation of Parse.ckOffset causing an assert() # to fail. Probably harmless. execsql { SELECT coalesce(1, substr( 1, 2, length('in' IN (SELECT 1)))) @@ -159,7 +159,7 @@ do_test fuzz-1.14.1 { CREATE TABLE abc(a, b, c); INSERT INTO abc VALUES(123, 456, 789); } - + # The [a] reference in the sub-select was causing a problem. Because # the internal walkSelectExpr() function was not considering compound # SELECT operators. @@ -215,14 +215,14 @@ do_test fuzz-1.16.3 { SELECT 456, 'injection' ORDER BY 56.1 ASC, -56.1 DESC ) ) - GROUP BY (SELECT ALL (SELECT DISTINCT 'hardware')) + GROUP BY (SELECT ALL (SELECT DISTINCT 'hardware')) HAVING ( SELECT DISTINCT c FROM ( SELECT ALL -2147483648, 'experiments' ORDER BY -56.1 ASC, -56.1 DESC ) - GROUP BY (SELECT DISTINCT 456) IN + GROUP BY (SELECT DISTINCT 456) IN (SELECT DISTINCT 'injection') NOT IN (SELECT ALL -456) HAVING EXISTS ( SELECT ALL 'injection' @@ -276,10 +276,10 @@ do_test fuzz-1.18 { ) ) OFFSET EXISTS ( - SELECT ALL + SELECT ALL (SELECT ALL -2147483648) NOT IN ( SELECT ALL 123456789.1234567899 - ) IN (SELECT 2147483649) + ) IN (SELECT 2147483649) FROM sqlite_master ) NOT IN (SELECT ALL 'The') ) @@ -288,12 +288,12 @@ do_test fuzz-1.18 { } {0 {{}}} # At one point the following INSERT statement caused an assert() to fail. -# +# do_test fuzz-1.19 { execsql { CREATE TABLE t1(a) } catchsql { - INSERT INTO t1 VALUES( - CASE WHEN NULL THEN NULL ELSE ( SELECT 0 ORDER BY 456 ) END + INSERT INTO t1 VALUES( + CASE WHEN NULL THEN NULL ELSE ( SELECT 0 ORDER BY 456 ) END ) } } {1 {1st ORDER BY term out of range - should be between 1 and 1}} @@ -321,7 +321,7 @@ set ::TableList [list abc def ghi] do_fuzzy_test fuzz-3.2 -template {[Select]} #---------------------------------------------------------------- -# Insert a small amount of data into the database and then run +# Insert a small amount of data into the database and then run # some more generated SELECT statements. # do_test fuzz-4.1 { @@ -352,7 +352,7 @@ do_test fuzz-5.3 {execsql COMMIT} {} integrity_check fuzz-5.4.integrity #---------------------------------------------------------------- -# Now that there is data in the database, run some more SELECT +# Now that there is data in the database, run some more SELECT # statements # set ::ColumnList [list a b c] diff --git a/third_party/sqlite/src/test/fuzz2.test b/third_party/sqlite/src/test/fuzz2.test index 51dfce140b00d..0432b763e7dc1 100644 --- a/third_party/sqlite/src/test/fuzz2.test +++ b/third_party/sqlite/src/test/fuzz2.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # This file checks error recovery from malformed SQL strings. # @@ -31,7 +31,7 @@ do_test fuzz2-2.1 { fuzzcatch {SELECT 1 WHERE ( #61 NOT MATCH ROUND( 1 ) )} } {1} do_test fuzz2-2.2 { - fuzzcatch {SELECT 1 LIMIT NOT #59 COLLATE AAAAAA NOT IN + fuzzcatch {SELECT 1 LIMIT NOT #59 COLLATE AAAAAA NOT IN ( "AAAAAA" NOTNULL <= x'414141414141' IS NULL , ( ROUND ( 1.0 ) ) )} } {1} do_test fuzz2-2.3 { @@ -105,7 +105,7 @@ do_test fuzz2-5.5 { } {1} # Test cases discovered by Michal Zalewski on 2015-01-03 and reported on the -# sqlite-users mailing list. All of these cases cause segfaults in +# sqlite-users mailing list. All of these cases cause segfaults in # SQLite 3.8.7.4 and earlier. # do_test fuzz2-6.1 { @@ -122,7 +122,7 @@ do_test fuzz2-6.4a { catchsql {INSERT INTO t0 SELECT strftime();} } {0 {}} do_test fuzz2-6.4b { - db eval {SELECT quote(t) FROM t0} + db eval {SELECT quote(t) FROM t0} } {NULL} # Another test case discovered by Michal Zalewski, this on on 2015-01-22. diff --git a/third_party/sqlite/src/test/fuzz3.test b/third_party/sqlite/src/test/fuzz3.test index 6d2a01c7d3de7..37438e2abc5aa 100644 --- a/third_party/sqlite/src/test/fuzz3.test +++ b/third_party/sqlite/src/test/fuzz3.test @@ -39,13 +39,13 @@ proc rstring {n} { proc rvalue {} { switch -- [expr int(rand()*5)] { 0 { # SQL NULL value. - return NULL + return NULL } 1 { # Integer value. - return [expr int(rand()*1024)] + return [expr int(rand()*1024)] } 2 { # Real value. - return [expr rand()] + return [expr rand()] } 3 { # String value. set n [expr int(rand()*2500)] @@ -106,7 +106,7 @@ proc purge_pcache {} { } } -# This block creates a database to work with. +# This block creates a database to work with. # do_test fuzz3-1 { execsql { @@ -138,18 +138,18 @@ for {set ii 0} {$ii < 5000} {incr ii} { set iTest 0 foreach sql { - {SELECT * FROM t2 ORDER BY d} - {SELECT * FROM t1} - {SELECT * FROM t2} - {SELECT * FROM t1 ORDER BY a} - {SELECT * FROM t1 WHERE a = (SELECT a FROM t1 WHERE rowid=25)} - {SELECT * FROM t2 WHERE d = (SELECT d FROM t2 WHERE rowid=1)} - {SELECT * FROM t2 WHERE d = (SELECT d FROM t2 WHERE rowid=50)} - {PRAGMA integrity_check} + {SELECT * FROM t2 ORDER BY d} + {SELECT * FROM t1} + {SELECT * FROM t2} + {SELECT * FROM t1 ORDER BY a} + {SELECT * FROM t1 WHERE a = (SELECT a FROM t1 WHERE rowid=25)} + {SELECT * FROM t2 WHERE d = (SELECT d FROM t2 WHERE rowid=1)} + {SELECT * FROM t2 WHERE d = (SELECT d FROM t2 WHERE rowid=50)} + {PRAGMA integrity_check} } { do_test fuzz3-$ii.$iNew.[incr iTest] { foreach {rc msg} [catchsql $sql] {} - if {$rc == 0 + if {$rc == 0 || $msg eq "database or disk is full" || $msg eq "database disk image is malformed" || $msg eq "file is encrypted or is not a database" @@ -161,7 +161,7 @@ for {set ii 0} {$ii < 5000} {incr ii} { } {ok} } - # Restore the original database file content. Test that the correct + # Restore the original database file content. Test that the correct # checksum is now returned. # purge_pcache diff --git a/third_party/sqlite/src/test/fuzz_common.tcl b/third_party/sqlite/src/test/fuzz_common.tcl index 4ab7dff5c9ba7..332a8f438a6c5 100644 --- a/third_party/sqlite/src/test/fuzz_common.tcl +++ b/third_party/sqlite/src/test/fuzz_common.tcl @@ -34,7 +34,7 @@ proc fuzz {TemplateList} { # proc Literal {} { set TemplateList { - 456 0 -456 1 -1 + 456 0 -456 1 -1 2147483648 2147483647 2147483649 -2147483647 -2147483648 -2147483649 'The' 'first' 'experiments' 'in' 'hardware' 'fault' 'injection' zeroblob(1000) @@ -102,7 +102,7 @@ proc Expr { {c {}} } { {[Expr $c] IN ([Select 1])} \ {[Expr $c] NOT IN ([Select 1])} \ {EXISTS ([Select 1])} \ - } + } set res [fuzz $TemplateList] incr ::ExprDepth -1 return $res @@ -166,8 +166,8 @@ proc SimpleSelect {{nRes 0}} { {[SelectKw] [ResultSet $nRes] FROM ([Select])} \ {[SelectKw] [ResultSet $nRes $::ColumnList] FROM [Table]} \ { - [SelectKw] [ResultSet $nRes $::ColumnList] - FROM ([Select]) + [SelectKw] [ResultSet $nRes $::ColumnList] + FROM ([Select]) GROUP BY [Expr] HAVING [Expr] } \ @@ -178,17 +178,17 @@ proc SimpleSelect {{nRes 0}} { {[SelectKw] * FROM [Table]} \ {[SelectKw] * FROM [Table] WHERE [Expr $::ColumnList]} \ { - [SelectKw] * - FROM [Table],[Table] AS t2 - WHERE [Expr $::ColumnList] + [SelectKw] * + FROM [Table],[Table] AS t2 + WHERE [Expr $::ColumnList] } { - [SelectKw] * - FROM [Table] LEFT OUTER JOIN [Table] AS t2 + [SelectKw] * + FROM [Table] LEFT OUTER JOIN [Table] AS t2 ON [Expr $::ColumnList] - WHERE [Expr $::ColumnList] + WHERE [Expr $::ColumnList] } } - } + } fuzz $TemplateList } @@ -200,10 +200,10 @@ proc SimpleSelect {{nRes 0}} { # proc Select {{nMulti 0}} { set TemplateList { - {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} - {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} - {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} - {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} + {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} + {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} + {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} + {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti]} {[SimpleSelect $nMulti] ORDER BY [Expr] DESC} {[SimpleSelect $nMulti] ORDER BY [Expr] ASC} {[SimpleSelect $nMulti] ORDER BY [Expr] ASC, [Expr] DESC} @@ -246,8 +246,8 @@ proc Column {} { # proc Update {} { set TemplateList { - {UPDATE [Table] - SET [Column] = [Expr $::ColumnList] + {UPDATE [Table] + SET [Column] = [Expr $::ColumnList] WHERE [Expr $::ColumnList]} } fuzz $TemplateList @@ -274,8 +274,8 @@ proc Statement {} { # of strings. proc Identifier {} { set TemplateList { - This just chooses randomly a fixed - We would also thank the developers + This just chooses randomly a fixed + We would also thank the developers for their analysis Samba } fuzz $TemplateList @@ -285,7 +285,7 @@ proc Check {} { # Use a large value for $::SelectDepth, because sub-selects are # not allowed in expressions used by CHECK constraints. # - set sd $::SelectDepth + set sd $::SelectDepth set ::SelectDepth 500 set TemplateList { {} @@ -349,17 +349,17 @@ set ::log [open fuzzy.log w] # # Usage: do_fuzzy_test ?? -# +# # -template # -errorlist # -repeats -# +# proc do_fuzzy_test {testname args} { set ::fuzzyopts(-errorlist) [list] set ::fuzzyopts(-repeats) $::REPEATS array set ::fuzzyopts $args - lappend ::fuzzyopts(-errorlist) {parser stack overflow} + lappend ::fuzzyopts(-errorlist) {parser stack overflow} lappend ::fuzzyopts(-errorlist) {ORDER BY} lappend ::fuzzyopts(-errorlist) {GROUP BY} lappend ::fuzzyopts(-errorlist) {datatype mismatch} diff --git a/third_party/sqlite/src/test/fuzz_malloc.test b/third_party/sqlite/src/test/fuzz_malloc.test index 1e31babd92e0d..608875de7fdd8 100644 --- a/third_party/sqlite/src/test/fuzz_malloc.test +++ b/third_party/sqlite/src/test/fuzz_malloc.test @@ -35,11 +35,11 @@ if {[info exists G(isquick)]} { # # Usage: do_fuzzy_malloc_test ?? -# +# # -template # -sqlprep # -repeats -# +# proc do_fuzzy_malloc_test {testname args} { set ::fuzzyopts(-repeats) $::REPEATS set ::fuzzyopts(-sqlprep) {} @@ -67,7 +67,7 @@ proc do_fuzzy_malloc_test {testname args} { } #---------------------------------------------------------------- -# Test malloc failure during parsing (and execution) of a fuzzily +# Test malloc failure during parsing (and execution) of a fuzzily # generated expressions. # do_fuzzy_malloc_test fuzzy_malloc-1 -template {Select [Expr]} @@ -79,7 +79,7 @@ set ::SQLPREP { CREATE TABLE def(a, b, c); CREATE TABLE ghi(a, b, c); INSERT INTO abc VALUES(1.5, 3, 'a short string'); - INSERT INTO def VALUES(NULL, X'ABCDEF', + INSERT INTO def VALUES(NULL, X'ABCDEF', 'a longer string. Long enough that it doesn''t fit in Mem.zShort'); INSERT INTO ghi VALUES(zeroblob(1000), 'hello world', -1257900987654321); COMMIT; diff --git a/third_party/sqlite/src/test/fuzzcheck.c b/third_party/sqlite/src/test/fuzzcheck.c index 75d519566fc81..10f4af33f4b5e 100644 --- a/third_party/sqlite/src/test/fuzzcheck.c +++ b/third_party/sqlite/src/test/fuzzcheck.c @@ -41,7 +41,7 @@ ** generated by a fuzzer, that need to be checked to make sure they do not ** present a security risk. ** -** This program also includes some command-line options to help with +** This program also includes some command-line options to help with ** creation and maintenance of the source content database. The command ** ** ./fuzzcheck database.db --load-sql FILE... @@ -241,7 +241,7 @@ static VFile *findVFile(const char *zName){ int i; if( zName==0 ) return 0; for(i=0; iC) are ignored. Test NULL in # the "to" column of a fuzzer data table. -# +# # 1.5.3 - Test out-of-range values for the cost field of the data table. # # 1.5.4 - Test out-of-range values for the string fields of the data table. @@ -1613,7 +1613,7 @@ do_execsql_test 5.4.2 { INSERT INTO "fuzzer [x] rules table" VALUES( 0, 'x', '123456789012345678901234567890123456789012345678901', 2 ); -} +} do_catchsql_test 5.4.3 { CREATE VIRTUAL TABLE x USING fuzzer('fuzzer [x] rules table'); } {1 {fuzzer: maximum string length is 50}} @@ -1624,7 +1624,7 @@ do_execsql_test 5.4.4 { INSERT INTO "fuzzer [x] rules table" VALUES( 0, '123456789012345678901234567890123456789012345678901', 'x', 2 ); -} +} do_catchsql_test 5.4.5 { CREATE VIRTUAL TABLE x USING fuzzer('fuzzer [x] rules table'); } {1 {fuzzer: maximum string length is 50}} @@ -1633,7 +1633,7 @@ do_execsql_test 5.5.1 { DROP TABLE IF EXISTS x; DELETE FROM "fuzzer [x] rules table"; INSERT INTO "fuzzer [x] rules table" VALUES(-1, 'x', 'y', 2); -} +} do_catchsql_test 5.5.2 { CREATE VIRTUAL TABLE x USING fuzzer('fuzzer [x] rules table'); } {1 {fuzzer: ruleset must be between 0 and 2147483647}} @@ -1642,13 +1642,13 @@ do_execsql_test 5.5.3 { DROP TABLE IF EXISTS x; DELETE FROM "fuzzer [x] rules table"; INSERT INTO "fuzzer [x] rules table" VALUES((1<<32)+100, 'x', 'y', 2); -} +} do_catchsql_test 5.5.4 { CREATE VIRTUAL TABLE x USING fuzzer('fuzzer [x] rules table'); } {1 {fuzzer: ruleset must be between 0 and 2147483647}} #------------------------------------------------------------------------- -# Test using different types of quotes with CREATE VIRTUAL TABLE +# Test using different types of quotes with CREATE VIRTUAL TABLE # arguments. # do_execsql_test 7.1 { @@ -1663,8 +1663,8 @@ foreach {tn sql} { } { do_execsql_test 7.2.$tn.1 { DROP TABLE IF EXISTS x2 } do_execsql_test 7.2.$tn.2 $sql - do_execsql_test 7.2.$tn.3 { - SELECT word FROM x2 WHERE word MATCH 'aaa' + do_execsql_test 7.2.$tn.3 { + SELECT word FROM x2 WHERE word MATCH 'aaa' } {aaa baa aba aab bab abb bba bbb} } @@ -1680,28 +1680,28 @@ do_execsql_test 8.1 { } do_execsql_test 8.2.1 { - SELECT cFrom, cTo, word - FROM x3_rules CROSS JOIN x3 + SELECT cFrom, cTo, word + FROM x3_rules CROSS JOIN x3 WHERE word MATCH 'a' AND cost=distance AND ruleset=2 ORDER BY +cTo; } {a x x a y y a z z} do_execsql_test 8.2.2 { - SELECT cFrom, cTo, word + SELECT cFrom, cTo, word FROM x3 CROSS JOIN x3_rules WHERE word MATCH 'a' AND cost=distance AND ruleset=2 ORDER BY +cTo DESC } {a z z a y y a x x} do_execsql_test 8.2.3 { - SELECT cFrom, cTo, word - FROM x3_rules, x3 + SELECT cFrom, cTo, word + FROM x3_rules, x3 WHERE word MATCH 'a' AND cost=distance AND ruleset=2 ORDER BY +cTo DESC; } {a z z a y y a x x} do_execsql_test 8.2.4 { - SELECT cFrom, cTo, word + SELECT cFrom, cTo, word FROM x3, x3_rules WHERE word MATCH 'a' AND cost=distance AND ruleset=2 ORDER BY +cTo DESC; @@ -1709,8 +1709,8 @@ do_execsql_test 8.2.4 { do_execsql_test 8.2.5 { CREATE INDEX i1 ON x3_rules(cost); - SELECT cFrom, cTo, word - FROM x3_rules, x3 + SELECT cFrom, cTo, word + FROM x3_rules, x3 WHERE word MATCH 'a' AND cost=distance AND ruleset=2 ORDER BY +cTo DESC; } {a z z a y y a x x} @@ -1720,16 +1720,16 @@ do_execsql_test 8.2.5 { } {a z y x a z y x a z y x} do_execsql_test 8.2.6 { - SELECT word FROM x3_rules, x3 - WHERE word MATCH x3_rules.cFrom - AND ruleset=2 + SELECT word FROM x3_rules, x3 + WHERE word MATCH x3_rules.cFrom + AND ruleset=2 AND x3_rules.cost=8; } {a z y x} do_execsql_test 8.2.7 { CREATE TABLE t1(a, b); CREATE INDEX i2 ON t1(b); - SELECT word, distance FROM x3, t1 + SELECT word, distance FROM x3, t1 WHERE x3.word MATCH t1.a AND ruleset=2 AND distance=t1.b; } {} @@ -1741,11 +1741,11 @@ do_execsql_test 8.2.8 { CREATE VIRTUAL TABLE x3 USING fuzzer(x3_rules); SELECT * FROM x3_rules; } { - 2 a x 10 - 2 a y 9 - 2 a z 8 - 1 a t 5 - 1 a u 4 + 2 a x 10 + 2 a y 9 + 2 a z 8 + 1 a t 5 + 1 a u 4 1 a v 3 } @@ -1804,9 +1804,9 @@ do_execsql_test 10.1 { } do_execsql_test 10.2 { - SELECT word, distance FROM x5 WHERE word MATCH - 'aaaaaaaaaXaaaaaaaaaXaaaaaaaaaXaaaaaaaaaXaaaaaaaaa' || - 'aaaaaaaaaXaaaaaaaaaXaaaaaaaaaXaaaaaaaaaXaaaaaaaaa' || + SELECT word, distance FROM x5 WHERE word MATCH + 'aaaaaaaaaXaaaaaaaaaXaaaaaaaaaXaaaaaaaaaXaaaaaaaaa' || + 'aaaaaaaaaXaaaaaaaaaXaaaaaaaaaXaaaaaaaaaXaaaaaaaaa' || 'aaaaaaaaaXaaaaaaaaaXaaaaaaaaaXaaaaaaaaaXaaaaaaaaa' } {} diff --git a/third_party/sqlite/src/test/fuzzer2.test b/third_party/sqlite/src/test/fuzzer2.test index 44ee9e312c540..e690e88bdc3e8 100644 --- a/third_party/sqlite/src/test/fuzzer2.test +++ b/third_party/sqlite/src/test/fuzzer2.test @@ -42,10 +42,10 @@ do_test 1.1.2 { set LETTERS {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 z} set cost 1 db transaction { - foreach c1 $LETTERS { - foreach c2 $LETTERS { - foreach c3 $LETTERS { - foreach c4 $LETTERS { + foreach c1 $LETTERS { + foreach c2 $LETTERS { + foreach c3 $LETTERS { + foreach c4 $LETTERS { db eval {INSERT INTO x1_rules VALUES(0, $c1||$c2, $c3||$c4, $cost)} set cost [expr ($cost%1000) + 1] } @@ -65,7 +65,7 @@ do_execsql_test 1.2.1 { SELECT word FROM x1 WHERE word MATCH 'xx' LIMIT 10; } {xx hw hx hy hz ia ib ic id ie} do_execsql_test 1.2.2 { - SELECT cTo FROM x1_rules WHERE cFrom='xx' + SELECT cTo FROM x1_rules WHERE cFrom='xx' ORDER BY cost asc, rowid asc LIMIT 9; } {hw hx hy hz ia ib ic id ie} diff --git a/third_party/sqlite/src/test/fuzzerfault.test b/third_party/sqlite/src/test/fuzzerfault.test index 6449612a66d60..5517d08aa9a0c 100644 --- a/third_party/sqlite/src/test/fuzzerfault.test +++ b/third_party/sqlite/src/test/fuzzerfault.test @@ -9,7 +9,7 @@ # #*********************************************************************** # This file implements regression tests for TCL interface to the -# SQLite library. +# SQLite library. # set testdir [file dirname $argv0] @@ -32,7 +32,7 @@ do_faultsim_test 1 -prep { faultsim_restore_and_reopen load_static_extension db fuzzer } -body { - execsql { + execsql { CREATE VIRTUAL TABLE x1 USING fuzzer(x1_rules); SELECT word FROM x1 WHERE word MATCH 'xax'; } @@ -58,7 +58,7 @@ do_faultsim_test 2 -prep { faultsim_restore_and_reopen load_static_extension db fuzzer } -body { - execsql { + execsql { SELECT count(*) FROM x2 WHERE word MATCH 'abc'; } } -test { @@ -69,7 +69,7 @@ do_test 3-pre1 { faultsim_delete_and_reopen execsql { CREATE TABLE x1_rules(ruleset, cFrom, cTo, cost); - INSERT INTO x1_rules VALUES(0, 'a', + INSERT INTO x1_rules VALUES(0, 'a', '123456789012345678901234567890a1234567890123456789', 10 ); } @@ -80,7 +80,7 @@ do_faultsim_test 3 -prep { faultsim_restore_and_reopen load_static_extension db fuzzer } -body { - execsql { + execsql { CREATE VIRTUAL TABLE x1 USING fuzzer(x1_rules); SELECT count(*) FROM (SELECT * FROM x1 WHERE word MATCH 'a' LIMIT 2); } diff --git a/third_party/sqlite/src/test/gcfault.test b/third_party/sqlite/src/test/gcfault.test index d54b78fafcba1..1e2fc8ef5c4ce 100644 --- a/third_party/sqlite/src/test/gcfault.test +++ b/third_party/sqlite/src/test/gcfault.test @@ -9,7 +9,7 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The -# focus of this file is testing OOM error handling within the built-in +# focus of this file is testing OOM error handling within the built-in # group_concat() function. # diff --git a/third_party/sqlite/src/test/hidden.test b/third_party/sqlite/src/test/hidden.test index 1db2cad12ed0e..d26f82e74b2e7 100644 --- a/third_party/sqlite/src/test/hidden.test +++ b/third_party/sqlite/src/test/hidden.test @@ -51,20 +51,20 @@ foreach {tn view} { do_execsql_test 2.$tn.2 { SELECT a, b, __hidden__c FROM v1; } {1 2 3} - + do_execsql_test 2.$tn.3 { SELECT * FROM v1; } {1 2} - + do_execsql_test 2.$tn.4 { CREATE TRIGGER tr1 INSTEAD OF INSERT ON v1 BEGIN INSERT INTO x1 VALUES(new.a, new.b, new.__hidden__c); END; - + INSERT INTO v1 VALUES(4, 5); SELECT * FROM x1; } {1 2 3 4 5 {}} - + do_execsql_test 2.$tn.5 { INSERT INTO v1(a, b, __hidden__c) VALUES(7, 8, 9); SELECT * FROM x1; diff --git a/third_party/sqlite/src/test/hook.test b/third_party/sqlite/src/test/hook.test index 9ba220cdede54..71d3363d56897 100644 --- a/third_party/sqlite/src/test/hook.test +++ b/third_party/sqlite/src/test/hook.test @@ -9,7 +9,7 @@ # #*********************************************************************** # This file implements regression tests for TCL interface to the -# SQLite library. +# SQLite library. # # The focus of the tests in this file is the following interface: # @@ -68,7 +68,7 @@ do_test hook-3.5 { do_test hook-3.6 { set commit_cnt {} proc commit_hook {} { - set ::commit_cnt [execsql {SELECT * FROM t2}] + set ::commit_cnt [execsql {SELECT * FROM t2}] return 1 } catchsql { @@ -118,14 +118,14 @@ db2 close #---------------------------------------------------------------------------- # Tests for the update-hook. # -# 4.1.* - Very simple tests. Test that the update hook is invoked correctly -# for INSERT, DELETE and UPDATE statements, including DELETE +# 4.1.* - Very simple tests. Test that the update hook is invoked correctly +# for INSERT, DELETE and UPDATE statements, including DELETE # statements with no WHERE clause. # 4.2.* - Check that the update-hook is invoked for rows modified by trigger -# bodies. Also that the database name is correctly reported when +# bodies. Also that the database name is correctly reported when # an attached database is modified. -# 4.3.* - Do some sorting, grouping, compound queries, population and -# depopulation of indices, to make sure the update-hook is not +# 4.3.* - Do some sorting, grouping, compound queries, population and +# depopulation of indices, to make sure the update-hook is not # invoked incorrectly. # # EVIDENCE-OF: R-21999-45122 The sqlite3_update_hook() interface @@ -225,7 +225,7 @@ ifcapable trigger { } set ::update_hook } {} - + set ::update_hook {} do_test hook-4.2.1 { catchsql { @@ -291,7 +291,7 @@ ifcapable trigger { } } -# Test that other vdbe operations involving btree structures do not +# Test that other vdbe operations involving btree structures do not # incorrectly invoke the update-hook. set ::update_hook {} do_test hook-4.3.1 { @@ -358,8 +358,8 @@ db update_hook {} #---------------------------------------------------------------------------- # Test the rollback-hook. The rollback-hook is a bit more complicated than -# either the commit or update hooks because a rollback can happen -# explicitly (an sql ROLLBACK statement) or implicitly (a constraint or +# either the commit or update hooks because a rollback can happen +# explicitly (an sql ROLLBACK statement) or implicitly (a constraint or # error condition). # # hook-5.1.* - Test explicit rollbacks. @@ -367,12 +367,12 @@ db update_hook {} # # hook-5.3.* - Test implicit rollbacks caused by IO errors. # hook-5.4.* - Test implicit rollbacks caused by malloc() failure. -# hook-5.5.* - Test hot-journal rollbacks. Or should the rollback hook +# hook-5.5.* - Test hot-journal rollbacks. Or should the rollback hook # not be called for these? # do_test hook-5.0 { - # Configure the rollback hook to increment global variable + # Configure the rollback hook to increment global variable # $::rollback_hook each time it is invoked. set ::rollback_hook 0 db rollback_hook [list incr ::rollback_hook] @@ -465,12 +465,12 @@ ifcapable !preupdate { # 7.4.1 - Test that the pre-update-hook is invoked only once if a row being # deleted is removed by a BEFORE trigger. # -# 7.4.2 - Test that the pre-update-hook is invoked if a BEFORE trigger +# 7.4.2 - Test that the pre-update-hook is invoked if a BEFORE trigger # removes a row being updated. In this case the update hook should # be invoked with SQLITE_INSERT as the opcode when inserting the # new version of the row. -# -# TODO: Short records (those created before a column is added to a table +# +# TODO: Short records (those created before a column is added to a table # using ALTER TABLE) # @@ -506,9 +506,9 @@ sqlite3 db test.db db preupdate hook preupdate_hook # Set up a schema to use for tests 7.1.* to 7.3.*. -do_execsql_test 7.0 { - CREATE TABLE t1(a, b); - CREATE TABLE t2(x, y); +do_execsql_test 7.0 { + CREATE TABLE t1(a, b); + CREATE TABLE t2(x, y); CREATE TABLE t3(i, j, UNIQUE(i)); INSERT INTO t2 VALUES('a', 'b'); @@ -517,7 +517,7 @@ do_execsql_test 7.0 { INSERT INTO t3 VALUES(4, 16); INSERT INTO t3 VALUES(5, 25); INSERT INTO t3 VALUES(6, 36); -} +} do_preupdate_test 7.1.1 { INSERT INTO t1 VALUES('x', 'y') @@ -569,7 +569,7 @@ do_preupdate_test 7.2.2 { DELETE main t1 5 5 c d } -do_execsql_test 7.3.0 { +do_execsql_test 7.3.0 { DELETE FROM t1; DELETE FROM t2; DELETE FROM t3; @@ -761,7 +761,7 @@ forcedelete test.db sqlite3 db test.db db preupdate hook preupdate_hook -do_execsql_test 7.6.1 { +do_execsql_test 7.6.1 { CREATE TABLE t1(x PRIMARY KEY); CREATE TABLE t2(x PRIMARY KEY); CREATE TABLE t3(x PRIMARY KEY); @@ -805,7 +805,7 @@ do_preupdate_test 7.6.4 { DELETE main t4 1 1 3 abc } -do_execsql_test 7.6.5 { +do_execsql_test 7.6.5 { DROP TRIGGER a; DROP TRIGGER b; DROP TRIGGER c; DROP TRIGGER d; DROP TRIGGER e; DROP TRIGGER f; DROP TRIGGER g; DROP TRIGGER h; DROP TRIGGER i; @@ -885,12 +885,12 @@ do_preupdate_test 9.5 { INSERT INTO t2 DEFAULT VALUES; } { INSERT main t2 1 1 0 {} 1 -} +} do_preupdate_test 9.6 { INSERT INTO t1 DEFAULT VALUES; } { INSERT main t1 458 458 0 458 {} {} {} -} +} do_execsql_test 10.0 { diff --git a/third_party/sqlite/src/test/hook2.test b/third_party/sqlite/src/test/hook2.test index 9ae1103a7d9ad..060790d38d4e0 100644 --- a/third_party/sqlite/src/test/hook2.test +++ b/third_party/sqlite/src/test/hook2.test @@ -9,7 +9,7 @@ # #*********************************************************************** # The tests in this file focus on the pre-update hook. -# +# set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -142,7 +142,7 @@ do_preupdate_test 2.1.4 { do_preupdate_test 2.1.5 { REPLACE INTO t2(c, b) VALUES(33, 32) } { - DELETE main t2 0 0 4 1 1 + DELETE main t2 0 0 4 1 1 DELETE main t2 0 0 31 32 33 INSERT main t2 0 0 4 32 33 } @@ -150,9 +150,9 @@ do_preupdate_test 2.1.5 { do_execsql_test 2.2.0 { SELECT * FROM t2 ORDER BY b,c; } { - 1 2 3 - 45 22 23 - 4 32 33 + 1 2 3 + 45 22 23 + 4 32 33 11 100 100 } do_preupdate_test 2.2.1 { @@ -163,8 +163,8 @@ do_preupdate_test 2.2.1 { do_preupdate_test 2.2.2 { DELETE FROM t2; } { - DELETE main t2 0 0 1 2 3 - DELETE main t2 0 0 4 32 33 + DELETE main t2 0 0 1 2 3 + DELETE main t2 0 0 4 32 33 DELETE main t2 0 0 11 100 100 } @@ -213,6 +213,6 @@ do_preupdate_test 2.3.5 { DELETE main t3 0 0 4 bb f UPDATE main t3 0 0 3 3 3 3 bb 2 } - + finish_test diff --git a/third_party/sqlite/src/test/icu.test b/third_party/sqlite/src/test/icu.test index 743bcfaea1107..127072ffa52d9 100644 --- a/third_party/sqlite/src/test/icu.test +++ b/third_party/sqlite/src/test/icu.test @@ -27,9 +27,9 @@ execsql {INSERT INTO test1 VALUES(1,2,1.1,2.2,'hello','world')} proc test_expr {name settings expr result} { do_test $name [format { lindex [db eval { - BEGIN; - UPDATE test1 SET %s; - SELECT %s FROM test1; + BEGIN; + UPDATE test1 SET %s; + SELECT %s FROM test1; ROLLBACK; }] 0 } $settings $expr] $result @@ -54,7 +54,7 @@ set ::ograve "\xF2" # That German letter that looks a bit like a B. The # upper-case version of which is "SS" (two characters). # -set ::szlig "\xDF" +set ::szlig "\xDF" # Tests of the upper()/lower() functions. # @@ -119,19 +119,19 @@ do_test icu-4.3 { } {apricot cherry chokecherry yamot peach plum} #------------------------------------------------------------------------- -# Test that it is not possible to call the ICU regex() function with +# Test that it is not possible to call the ICU regex() function with # anything other than exactly two arguments. See also: # # http://src.chromium.org/viewvc/chrome/trunk/src/third_party/sqlite/icu-regexp.patch?revision=34807&view=markup # do_catchsql_test icu-5.1 { SELECT regexp('a[abc]c.*', 'abc') } {0 1} -do_catchsql_test icu-5.2 { - SELECT regexp('a[abc]c.*') +do_catchsql_test icu-5.2 { + SELECT regexp('a[abc]c.*') } {1 {wrong number of arguments to function regexp()}} -do_catchsql_test icu-5.3 { - SELECT regexp('a[abc]c.*', 'abc', 'c') +do_catchsql_test icu-5.3 { + SELECT regexp('a[abc]c.*', 'abc', 'c') } {1 {wrong number of arguments to function regexp()}} -do_catchsql_test icu-5.4 { +do_catchsql_test icu-5.4 { SELECT 'abc' REGEXP 'a[abc]c.*' } {0 1} do_catchsql_test icu-5.4 { SELECT 'abc' REGEXP } {1 {near " ": syntax error}} diff --git a/third_party/sqlite/src/test/ieee754.test b/third_party/sqlite/src/test/ieee754.test index bf0676429b7b3..4dddb6f298840 100644 --- a/third_party/sqlite/src/test/ieee754.test +++ b/third_party/sqlite/src/test/ieee754.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # Tests of the iee754 extension # diff --git a/third_party/sqlite/src/test/in.test b/third_party/sqlite/src/test/in.test index 4e10800481391..85736b3985f8e 100644 --- a/third_party/sqlite/src/test/in.test +++ b/third_party/sqlite/src/test/in.test @@ -54,7 +54,7 @@ do_test in-1.7 { } {101 102 103 4 5 6 7 8 9 10} # The rest of this file concentrates on testing the IN operator. -# Skip this if the library is compiled with SQLITE_OMIT_SUBQUERY +# Skip this if the library is compiled with SQLITE_OMIT_SUBQUERY # (because the IN operator is unavailable). # ifcapable !subquery { @@ -126,7 +126,7 @@ do_test in-3.3 { # do_test in-4.1 { execsql { - UPDATE t1 SET b=b*2 + UPDATE t1 SET b=b*2 WHERE b IN (SELECT b FROM t1 WHERE a>8) } execsql {SELECT b FROM t1 ORDER BY b} @@ -297,7 +297,7 @@ do_test in-8.2 { do_test in-9.1 { execsql { CREATE TABLE t4 AS SELECT a FROM tb; - SELECT * FROM t4; + SELECT * FROM t4; } } {1 2 3 5 7 9 11} do_test in-9.2 { @@ -490,12 +490,12 @@ do_test in-12.15 { #------------------------------------------------------------------------ -# The following tests check that NULL is handled correctly when it +# The following tests check that NULL is handled correctly when it # appears as part of a set of values on the right-hand side of an # IN or NOT IN operator. # # When it appears in such a set, NULL is handled as an "unknown value". -# If, because of the unknown value in the set, the result of the expression +# If, because of the unknown value in the set, the result of the expression # cannot be determined, then it itself evaluates to NULL. # @@ -503,7 +503,7 @@ do_test in-12.15 { # do_test in-13.1 { db nullvalue "null" - execsql { SELECT + execsql { SELECT 1 IN (NULL, 1, 2), -- The value 1 is a member of the set, return true. 3 IN (NULL, 1, 2), -- Ambiguous, return NULL. 1 NOT IN (NULL, 1, 2), -- The value 1 is a member of the set, return false. @@ -512,7 +512,7 @@ do_test in-13.1 { } {1 null 0 null} do_test in-13.2 { - execsql { + execsql { CREATE TABLE t7(a, b, c NOT NULL); INSERT INTO t7 VALUES(1, 1, 1); INSERT INTO t7 VALUES(2, 2, 2); @@ -552,14 +552,14 @@ do_test in-13.9 { 6 NOT IN (SELECT b FROM t7), 2 NOT IN (SELECT c FROM t7), 6 NOT IN (SELECT c FROM t7) - } + } } {0 null 0 1 0 1} do_test in-13.10 { - execsql { + execsql { SELECT b IN ( - SELECT inside.a - FROM t7 AS inside + SELECT inside.a + FROM t7 AS inside WHERE inside.b BETWEEN outside.b+1 AND outside.b+2 ) FROM t7 AS outside ORDER BY b; @@ -569,8 +569,8 @@ do_test in-13.10 { do_test in-13.11 { execsql { SELECT b NOT IN ( - SELECT inside.a - FROM t7 AS inside + SELECT inside.a + FROM t7 AS inside WHERE inside.b BETWEEN outside.b+1 AND outside.b+2 ) FROM t7 AS outside ORDER BY b; @@ -591,7 +591,7 @@ do_test in-13.12 { 6 IN (SELECT b FROM t7), 2 IN (SELECT c FROM t7), 6 IN (SELECT c FROM t7) - } + } } {1 null 1 0 1 0} do_test in-13.13 { @@ -603,7 +603,7 @@ do_test in-13.13 { 6 NOT IN (SELECT b FROM t7), 2 NOT IN (SELECT c FROM t7), 6 NOT IN (SELECT c FROM t7) - } + } } {0 null 0 1 0 1} do_test in-13.14 { diff --git a/third_party/sqlite/src/test/in2.test b/third_party/sqlite/src/test/in2.test index 43240824a7528..218aee4d2351f 100644 --- a/third_party/sqlite/src/test/in2.test +++ b/third_party/sqlite/src/test/in2.test @@ -49,11 +49,11 @@ do_test in2-2 { # Records are inserted in sorted order. # # The string of zero-length is stored in a b-tree cell with 3 bytes -# of payload. Moving this cell from a leaf node to a internal node -# during b-tree balancing was causing an assertion failure. +# of payload. Moving this cell from a leaf node to a internal node +# during b-tree balancing was causing an assertion failure. # -# This bug only applied to b-trees generated to evaluate IN (..) -# clauses, as it is impossible for persistent b-trees (SQL tables + +# This bug only applied to b-trees generated to evaluate IN (..) +# clauses, as it is impossible for persistent b-trees (SQL tables + # indices) to contain cells smaller than 4 bytes. # for {set ::ii 3} {$::ii < $::N} {incr ::ii} { diff --git a/third_party/sqlite/src/test/in3.test b/third_party/sqlite/src/test/in3.test index 012c9b4452600..527a096684a10 100644 --- a/third_party/sqlite/src/test/in3.test +++ b/third_party/sqlite/src/test/in3.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file tests the optimisations made in November 2007 of expressions +# This file tests the optimisations made in November 2007 of expressions # of the following form: # # IN (SELECT FROM ) @@ -67,7 +67,7 @@ do_test in3-1.5 { } {0 1 3 5} # Because none of the sub-select queries in the following statements -# match the pattern ("SELECT FROM
        "), the following do +# match the pattern ("SELECT FROM
        "), the following do # require a temp table. # do_test in3-1.6 { @@ -90,7 +90,7 @@ do_test in3-1.10 { exec_neph { SELECT a FROM t1 WHERE a IN (SELECT a FROM t1 ORDER BY a); } } {0 1 3 5} -# These do use the temp-table. Adding the LIMIT clause means the +# These do use the temp-table. Adding the LIMIT clause means the # ORDER BY cannot be ignored. do_test in3-1.11 { exec_neph {SELECT a FROM t1 WHERE a IN (SELECT a FROM t1 ORDER BY a LIMIT 1)} @@ -113,7 +113,7 @@ ifcapable compound { } {1 1 3 5} } -# The first of these queries has to use the temp-table, because the +# The first of these queries has to use the temp-table, because the # collation sequence used for the index on "t1.a" does not match the # collation sequence used by the "IN" comparison. The second does not # require a temp-table, because the collation sequences match. @@ -155,8 +155,8 @@ do_test in3-2.1 { } {} do_test in3-2.2 { execsql { - SELECT rowid - FROM t1 + SELECT rowid + FROM t1 WHERE rowid IN (SELECT rowid FROM t1 WHERE rowid IN (1, 2)); } } {1 2} @@ -167,7 +167,7 @@ do_test in3-2.3 { } {2 4} do_test in3-2.4 { execsql { - SELECT rowid FROM t1 WHERE rowid IN + SELECT rowid FROM t1 WHERE rowid IN (select rowid from t1 where rowid IN (-1,2,4)) } } {2 4} @@ -206,7 +206,7 @@ do_test in3-3.2 { exec_neph { SELECT x IN (SELECT a FROM t1) FROM t2 } } {0 0} do_test in3-3.3 { - # Logically, numeric affinity is applied to both sides before + # Logically, numeric affinity is applied to both sides before # the comparison. Therefore it is possible to use index t1_i2. exec_neph { SELECT x IN (SELECT b FROM t1) FROM t2 } } {0 1} @@ -222,12 +222,12 @@ do_test in3-3.5 { exec_neph { SELECT y IN (SELECT a FROM t1) FROM t2 } } {1 1} do_test in3-3.6 { - # Numeric affinity is applied to both sides before + # Numeric affinity is applied to both sides before # the comparison. Therefore it is possible to use index t1_i2. exec_neph { SELECT y IN (SELECT b FROM t1) FROM t2 } } {0 1} do_test in3-3.7 { - # Numeric affinity is applied before the comparison takes place. + # Numeric affinity is applied before the comparison takes place. # Making it impossible to use index t1_i3. exec_neph { SELECT y IN (SELECT c FROM t1) FROM t2 } } {1 1} @@ -272,9 +272,9 @@ do_test in3-4.6 { do_test in3-5.1 { execsql { CREATE TABLE Folders( - folderid INTEGER PRIMARY KEY, - parentid INTEGER, - rootid INTEGER, + folderid INTEGER PRIMARY KEY, + parentid INTEGER, + rootid INTEGER, path VARCHAR(255) ); } diff --git a/third_party/sqlite/src/test/in4.test b/third_party/sqlite/src/test/in4.test index a89961f82bb3f..d48b9a49b17dc 100644 --- a/third_party/sqlite/src/test/in4.test +++ b/third_party/sqlite/src/test/in4.test @@ -93,9 +93,9 @@ do_test in4-2.8 { # # IN () # -# i.e. IN expressions with a literal empty set. -# -# This has led to crashes on more than one occasion. Test case in4-3.2 +# i.e. IN expressions with a literal empty set. +# +# This has led to crashes on more than one occasion. Test case in4-3.2 # was added in reponse to a bug reported on the mailing list on 11/7/2008. # See also tickets #3602 and #185. # diff --git a/third_party/sqlite/src/test/incrblob.test b/third_party/sqlite/src/test/incrblob.test index c56689ee1bbcf..812709b573913 100644 --- a/third_party/sqlite/src/test/incrblob.test +++ b/third_party/sqlite/src/test/incrblob.test @@ -85,7 +85,7 @@ do_test incrblob-1.3.10 { } {} #------------------------------------------------------------------------ -# incrblob-2.*: +# incrblob-2.*: # # Test that the following operations use ptrmap pages to reduce # unnecessary reads: @@ -156,13 +156,13 @@ foreach AutoVacuumMode [list 0 1] { db close sqlite3 db test.db execsql "PRAGMA mmap_size = 0" - + # Read the last 20 bytes of the blob via a blob handle. set ::blob [db incrblob blobs v 1] seek $::blob -20 end set ::fragment [read $::blob] close $::blob - + # If the database is not in auto-vacuum mode, the whole of # the overflow-chain must be scanned. In auto-vacuum mode, # sqlite uses the ptrmap pages to avoid reading the other pages. @@ -179,14 +179,14 @@ foreach AutoVacuumMode [list 0 1] { db close sqlite3 db test.db execsql "PRAGMA mmap_size = 0" - + # Write the second-to-last 20 bytes of the blob via a blob handle. # set ::blob [db incrblob blobs v 1] seek $::blob -40 end puts -nonewline $::blob "1234567890abcdefghij" flush $::blob - + # If the database is not in auto-vacuum mode, the whole of # the overflow-chain must be scanned. In auto-vacuum mode, # sqlite uses the ptrmap pages to avoid reading the other pages. @@ -210,7 +210,7 @@ foreach AutoVacuumMode [list 0 1] { sqlite3 db test.db execsql { PRAGMA mmap_size = 0 } - execsql { SELECT i FROM blobs } + execsql { SELECT i FROM blobs } } {45} do_test incrblob-2.$AutoVacuumMode.9 { @@ -220,7 +220,7 @@ foreach AutoVacuumMode [list 0 1] { sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit) #------------------------------------------------------------------------ -# incrblob-3.*: +# incrblob-3.*: # # Test the outcome of trying to write to a read-only blob handle. # @@ -245,14 +245,14 @@ do_test incrblob-3.3 { } "1234567890abcdefghij" do_test incrblob-3.4 { set rc [catch { - sqlite3_blob_write $::blob 20 "qwertyuioplkjhgfds" + sqlite3_blob_write $::blob 20 "qwertyuioplkjhgfds" } msg] list $rc $msg } {1 SQLITE_READONLY} catch {close $::blob} #------------------------------------------------------------------------ -# incrblob-4.*: +# incrblob-4.*: # # Try a couple of error conditions: # @@ -274,13 +274,13 @@ catch {close $::blob} do_test incrblob-4.1 { set rc [catch { set ::blob [db incrblob blobs v 2] - } msg ] + } msg ] list $rc $msg } {1 {no such rowid: 2}} do_test incrblob-4.2 { set rc [catch { set ::blob [db incrblob blobs blue 1] - } msg ] + } msg ] list $rc $msg } {1 {no such column: "blue"}} do_test incrblob-4.3 { @@ -292,14 +292,14 @@ do_test incrblob-4.3 { do_test incrblob-4.4 { set rc [catch { set ::blob [db incrblob nosuchdb blobs v 1] - } msg ] + } msg ] list $rc $msg } {1 {no such table: nosuchdb.blobs}} do_test incrblob-4.5 { set rc [catch { set ::blob [db incrblob blobs i 1] - } msg ] + } msg ] list $rc $msg } {1 {cannot open value of type integer}} do_test incrblob-4.6 { @@ -308,13 +308,13 @@ do_test incrblob-4.6 { } set rc [catch { set ::blob [db incrblob blobs v 2] - } msg ] + } msg ] list $rc $msg } {1 {cannot open value of type real}} do_test incrblob-4.7 { set rc [catch { set ::blob [db incrblob blobs i 2] - } msg ] + } msg ] list $rc $msg } {1 {cannot open value of type null}} @@ -324,7 +324,7 @@ do_test incrblob-4.8.1 { } set rc [catch { set ::blob [db incrblob blobs k 3] - } msg ] + } msg ] list $rc $msg } {1 {cannot open indexed column for writing}} do_test incrblob-4.8.2 { @@ -334,13 +334,13 @@ do_test incrblob-4.8.2 { } set rc [catch { set ::blob [db incrblob -readonly t3 a 1] - } msg ] + } msg ] list $rc $msg } {1 {cannot open value of type null}} do_test incrblob-4.8.3 { set rc [catch { set ::blob [db incrblob -readonly t3 rowid 1] - } msg ] + } msg ] list $rc $msg } {1 {no such column: "rowid"}} @@ -382,7 +382,7 @@ ifcapable vtab { #------------------------------------------------------------------------ -# incrblob-5.*: +# incrblob-5.*: # # Test that opening a blob in an attached database works. # @@ -419,18 +419,18 @@ unset -nocomplain ::data unset -nocomplain ::text #------------------------------------------------------------------------ -# incrblob-6.*: +# incrblob-6.*: # # Test that opening a blob for write-access is impossible if # another connection has the database RESERVED lock. # # Then test that blob writes that take place inside of a # transaction are not visible to external connections until -# after the transaction is commited and the blob channel +# after the transaction is commited and the blob channel # closed. # # This test does not work with the "memsubsys1" configuration. -# Permutation memsubsys1 configures a very small static allocation +# Permutation memsubsys1 configures a very small static allocation # for use as page-cache memory. This causes SQLite to upgrade # to an exclusive lock when writing earlier than usual, which # makes some of these tests fail. @@ -468,7 +468,7 @@ if {[permutation] != "memsubsys1"} { do_test incrblob-6.6 { close $::blob } {} - + do_test incrblob-6.7 { set ::blob [db2 incrblob blobs i 4] gets $::blob @@ -481,8 +481,8 @@ if {[permutation] != "memsubsys1"} { puts -nonewline $::blob "invocation" flush $::blob } {} - - # At this point commit should be illegal (because + + # At this point commit should be illegal (because # there is an open blob channel). # do_test incrblob-6.11 { @@ -490,7 +490,7 @@ if {[permutation] != "memsubsys1"} { COMMIT; } db2 } {1 {cannot commit transaction - SQL statements in progress}} - + do_test incrblob-6.12 { execsql { SELECT * FROM blobs WHERE rowid = 4; @@ -651,7 +651,7 @@ do_test incrblob-7.6 { # Test that if either the "offset" or "amount" arguments to # sqlite3_blob_write() are less than zero, SQLITE_ERROR is returned. -# +# do_test incrblob-8.1 { execsql { INSERT INTO t1 VALUES(314159, 'sqlite') } set ::b [db incrblob t1 b 314159] diff --git a/third_party/sqlite/src/test/incrblob2.test b/third_party/sqlite/src/test/incrblob2.test index b6c75cd6c75fc..2d700b918c98c 100644 --- a/third_party/sqlite/src/test/incrblob2.test +++ b/third_party/sqlite/src/test/incrblob2.test @@ -39,7 +39,7 @@ foreach iOffset [list 0 256 4094] { puts $fd "[string repeat x $iOffset]SQLite version 3.6.0" close $fd } {} - + do_test incrblob2-1.$iOffset.2 { set fd1 [db incrblob blobs data 1] set fd2 [db incrblob blobs data 1] @@ -51,33 +51,33 @@ foreach iOffset [list 0 256 4094] { } read $fd1 6 } {SQLite} - + do_test incrblob2-1.$iOffset.3 { read $fd2 6 } {SQLite} - + do_test incrblob2-1.$iOffset.4 { seek $fd2 $iOffset start seek $fd1 $iOffset start puts -nonewline $fd2 "etiLQS" } {} - + do_test incrblob2-1.$iOffset.5 { seek $fd1 $iOffset start read $fd1 6 } {etiLQS} - + do_test incrblob2-1.$iOffset.6 { seek $fd2 $iOffset start read $fd2 6 } {etiLQS} - + do_test incrblob2-1.$iOffset.7 { seek $fd1 $iOffset start read $fd1 6 } {etiLQS} - + do_test incrblob2-1.$iOffset.8 { close $fd1 close $fd2 @@ -99,7 +99,7 @@ foreach iOffset [list 0 256 4094] { puts -nonewline $fd1 "123456" } {} - + do_test incrblob2-2.$iOffset.2 { read $fd2 6 } {123456} @@ -128,7 +128,7 @@ do_test incrblob2-3.4 { } {} #-------------------------------------------------------------------------- -# The following tests - incrblob2-4.* - test that blob handles are +# The following tests - incrblob2-4.* - test that blob handles are # invalidated at the correct times. # do_test incrblob2-4.1 { @@ -205,7 +205,7 @@ do_test incrblob2-4.6 { aborted_handles } {3 14 15 92} -# Clobber row 65 using UPDATE OR REPLACE on row 35. This should abort +# Clobber row 65 using UPDATE OR REPLACE on row 35. This should abort # handles 35 and 65. # do_test incrblob2-4.7 { @@ -237,7 +237,7 @@ do_test incrblob2-4.10 { do_test incrblob2-4.1.X { for {set ii 1} {$ii < 100} {incr ii} { - close $handles($ii) + close $handles($ii) } } {} @@ -307,7 +307,7 @@ do_test incrblob2-6.1 { DELETE FROM t1; INSERT INTO t1 VALUES(1, zeroblob(100)); } - + set rdHandle [db incrblob -readonly t1 data 1] set wrHandle [db incrblob t1 data 1] @@ -371,7 +371,7 @@ sqlite3_memory_highwater 1 do_test incrblob2-7.1 { db eval { CREATE TABLE t2(B BLOB); - INSERT INTO t2 VALUES(zeroblob(10 * 1024 * 1024)); + INSERT INTO t2 VALUES(zeroblob(10 * 1024 * 1024)); } expr {[sqlite3_memory_highwater]<(5 * 1024 * 1024)} } {1} @@ -396,7 +396,7 @@ do_test incrblob2-7.5 { #--------------------------------------------------------------------------- # The following tests, incrblob2-8.*, test that nothing terrible happens -# when a statement transaction is rolled back while there are open +# when a statement transaction is rolled back while there are open # incremental-blob handles. At one point an assert() was failing when # this was attempted. # @@ -405,7 +405,7 @@ do_test incrblob2-8.1 { set h [db incrblob t2 B 1] set rc [catch { db eval {SELECT rowid FROM t2} { execsql "DROP TABLE t2" } - } msg] + } msg] list $rc $msg } {1 {database table is locked}} do_test incrblob2-8.2 { diff --git a/third_party/sqlite/src/test/incrblob3.test b/third_party/sqlite/src/test/incrblob3.test index 5f2e860d08e62..6bbb06901f1be 100644 --- a/third_party/sqlite/src/test/incrblob3.test +++ b/third_party/sqlite/src/test/incrblob3.test @@ -190,7 +190,7 @@ do_test incrblob3-6.3 { } {1 {no such column: "content"}} do_test incrblob3-6.4.1 { - execsql { + execsql { CREATE TABLE t1(a, b); CREATE INDEX i1 ON t1(b); INSERT INTO t1 VALUES(zeroblob(100), zeroblob(100)); @@ -207,7 +207,7 @@ do_test incrblob3-6.4.3 { } {} do_test incrblob3-6.5.1 { - execsql { + execsql { CREATE TABLE p1(a PRIMARY KEY); CREATE TABLE c1(a, b REFERENCES p1); PRAGMA foreign_keys = 1; @@ -232,7 +232,7 @@ do_test incrblob3-6.5.4 { } {} -# Test that sqlite3_blob_open() handles transient and persistent schema +# Test that sqlite3_blob_open() handles transient and persistent schema # errors correctly. # do_test incrblob3-7.1 { @@ -261,7 +261,7 @@ proc access_method {args} { } do_test incrblob3-7.2 { - sqlite3 db test.db + sqlite3 db test.db sqlite3_db_config_lookaside db 0 0 0 list [catch {db incrblob blobs v 1} msg] $msg } {1 {database schema has changed}} diff --git a/third_party/sqlite/src/test/incrblob4.test b/third_party/sqlite/src/test/incrblob4.test index dbff8eb7d58c7..f2e3f3a3f1a4a 100644 --- a/third_party/sqlite/src/test/incrblob4.test +++ b/third_party/sqlite/src/test/incrblob4.test @@ -31,9 +31,9 @@ proc populate_t1 {} { } -do_test 1.1 { +do_test 1.1 { create_t1 - populate_t1 + populate_t1 } {} do_test 1.2 { @@ -48,10 +48,10 @@ do_test 1.3 { -do_test 2.1 { +do_test 2.1 { reset_db create_t1 - populate_t1 + populate_t1 } {} do_test 2.2 { @@ -71,7 +71,7 @@ do_test 2.3 { do_test 3.1 { reset_db create_t1 - populate_t1 + populate_t1 } {} do_test 3.2 { diff --git a/third_party/sqlite/src/test/incrblob_err.test b/third_party/sqlite/src/test/incrblob_err.test index 0db8b0dcba6bb..8c90cc0ab03f5 100644 --- a/third_party/sqlite/src/test/incrblob_err.test +++ b/third_party/sqlite/src/test/incrblob_err.test @@ -39,7 +39,7 @@ do_malloc_test 1 -tclprep { fconfigure $::blob -translation binary set rc [catch {puts -nonewline $::blob $::data}] if {$rc} { error "out of memory" } -} +} do_malloc_test 2 -tclprep { execsql { @@ -49,8 +49,8 @@ do_malloc_test 2 -tclprep { } -tclbody { set ::blob [db incrblob blobs v 1] set rc [catch {set ::r [read $::blob]}] - if {$rc} { - error "out of memory" + if {$rc} { + error "out of memory" } elseif {$::r ne $::data} { error "Bad data read..." } @@ -64,14 +64,14 @@ do_malloc_test 3 -tclprep { } -tclbody { set ::blob [db incrblob blobs v 1] set rc [catch {set ::r [read $::blob]}] - if {$rc} { - error "out of memory" + if {$rc} { + error "out of memory" } elseif {$::r ne $::data} { error "Bad data read..." } set rc [catch {close $::blob}] - if {$rc} { - error "out of memory" + if {$rc} { + error "out of memory" } } @@ -109,7 +109,7 @@ do_ioerr_test incrblob_err-7 -cksum 1 -sqlprep { CREATE TABLE blobs(k INTEGER PRIMARY KEY, v BLOB); INSERT INTO blobs VALUES(1, zeroblob(500 * 1020)); } -tclbody { - # Read some data from the end of the large blob inserted into table + # Read some data from the end of the large blob inserted into table # "blobs". This forces the IO error to occur while reading a pointer # map page for the purposes of seeking to the end of the blob. # @@ -125,7 +125,7 @@ do_ioerr_test incrblob_err-8 -cksum 1 -sqlprep { CREATE TABLE blobs(k INTEGER PRIMARY KEY, v BLOB); INSERT INTO blobs VALUES(1, zeroblob(500 * 1020)); } -tclbody { - # Read some data from the end of the large blob inserted into table + # Read some data from the end of the large blob inserted into table # "blobs". This forces the IO error to occur while reading a pointer # map page for the purposes of seeking to the end of the blob. # diff --git a/third_party/sqlite/src/test/incrvacuum.test b/third_party/sqlite/src/test/incrvacuum.test index 91f5c8e1e00c7..db2af5f9a1af6 100644 --- a/third_party/sqlite/src/test/incrvacuum.test +++ b/third_party/sqlite/src/test/incrvacuum.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing the incremental vacuum feature. # -# Note: There are also some tests for incremental vacuum and IO +# Note: There are also some tests for incremental vacuum and IO # errors in incrvacuum_ioerr.test. # # $Id: incrvacuum.test,v 1.23 2009/02/18 20:31:18 drh Exp $ @@ -167,7 +167,7 @@ do_test incrvacuum-3.4 { } {3} #--------------------------------------------------------------------- -# Try to run a very simple incremental vacuum. Also verify that +# Try to run a very simple incremental vacuum. Also verify that # PRAGMA incremental_vacuum is a harmless no-op against a database that # does not support auto-vacuum. # @@ -264,7 +264,7 @@ do_test incrvacuum-5.2.5 { # the other with no auto-vacuum completely disabled. After executing # each element of the following list on both databases, test that # the integrity-check passes and the contents of each are identical. -# +# set TestScriptList [list { BEGIN; CREATE TABLE t1(a, b); @@ -302,7 +302,7 @@ set TestScriptList [list { ] # If this build omits subqueries, step 2 in the above list will not -# work. Replace it with "" in this case. +# work. Replace it with "" in this case. # ifcapable !subquery { lset TestScriptList 2 "" } @@ -357,13 +357,13 @@ db2 close # End of test cases 5.3.* #--------------------------------------------------------------------- -# The following tests - incrvacuum-6.* - test running incremental +# The following tests - incrvacuum-6.* - test running incremental # vacuum while another statement (a read) is being executed. # for {set jj 0} {$jj < 10} {incr jj} { # Build some test data. Two tables are created in an empty # database. tbl1 data is a contiguous block starting at page 5 (pages - # 3 and 4 are the table roots). tbl2 is a contiguous block starting + # 3 and 4 are the table roots). tbl2 is a contiguous block starting # right after tbl1. # # Then drop tbl1 so that when an incr vacuum is run the pages @@ -389,7 +389,7 @@ for {set jj 0} {$jj < 10} {incr jj} { expr {[file size test.db] / 1024} } {36} - # Run a linear scan query on tbl2. After reading ($jj*100) rows, + # Run a linear scan query on tbl2. After reading ($jj*100) rows, # run the incremental vacuum to shrink the database. # do_test incrvacuum-6.${jj}.2 { @@ -459,7 +459,7 @@ while 1 { # with an incremental-vacuum if it is the first statement executed # after an existing database is opened. # -# At one point, this would always return SQLITE_SCHEMA (which +# At one point, this would always return SQLITE_SCHEMA (which # causes an infinite loop in tclsqlite.c if using the Tcl interface). # do_test incrvacuum-8.1 { @@ -589,7 +589,7 @@ do_test incrvacuum-10.8 { #---------------------------------------------------------------- # Test that if we set the auto_vacuum mode to 'incremental', then -# create a database, thereafter that database defaults to incremental +# create a database, thereafter that database defaults to incremental # vacuum mode. # db close @@ -777,7 +777,7 @@ do_test incrvacuum-15.1 { catchsql {INSERT INTO t2 SELECT * FROM t1} - execsql { + execsql { COMMIT; PRAGMA integrity_check; } diff --git a/third_party/sqlite/src/test/incrvacuum2.test b/third_party/sqlite/src/test/incrvacuum2.test index 6ec66c9debc51..26f1f2f9cc867 100644 --- a/third_party/sqlite/src/test/incrvacuum2.test +++ b/third_party/sqlite/src/test/incrvacuum2.test @@ -138,7 +138,7 @@ if {[wal_is_capable]} { # At one point, when a specific page was being extracted from the b-tree # free-list (e.g. during an incremental-vacuum), all trunk pages that # occurred before the specific page in the free-list trunk were being - # written to the journal or wal file. This is not necessary. Only the + # written to the journal or wal file. This is not necessary. Only the # extracted page and the page that contains the pointer to it need to # be journalled. # @@ -154,7 +154,7 @@ if {[wal_is_capable]} { # trunk page), and # 2. The leaf page transformed into a trunk page to replace the recycled # page, and - # 3. The trunk page that contained a pointer to the leaf page used + # 3. The trunk page that contained a pointer to the leaf page used # in (2), and # 4. Page 1. Page 1 is always updated, even in WAL mode, since it contains # the "number of free-list pages" field. @@ -185,7 +185,7 @@ if {[wal_is_capable]} { } do_test 4.2 { - execsql { + execsql { PRAGMA journal_mode = WAL; PRAGMA incremental_vacuum(1); } @@ -206,7 +206,7 @@ if {[wal_is_capable]} { set newsz [file size test.db-wal] if {$newsz>$maxsz} {set maxsz $newsz} } - set maxsz + set maxsz } [expr {32+3*(512+24)}] } diff --git a/third_party/sqlite/src/test/incrvacuum3.test b/third_party/sqlite/src/test/incrvacuum3.test index e901bfe1f59bd..5d59f203ae2a2 100644 --- a/third_party/sqlite/src/test/incrvacuum3.test +++ b/third_party/sqlite/src/test/incrvacuum3.test @@ -11,7 +11,7 @@ # This file implements regression tests for the SQLite library, focusing # on the incremental vacuum feature. # -# The tests in this file were added at the same time as optimizations +# The tests in this file were added at the same time as optimizations # were made to: # # * Truncate the database after a rollback mode commit, and @@ -36,11 +36,11 @@ proc check_on_disk {} { # Copy the wal and journal files for database "test.db" to "test2.db". forcedelete test2.db test2.db-journal test2.db-wal - if {[file exists test.db-journal]} { - forcecopy test.db-journal test2.db-journal + if {[file exists test.db-journal]} { + forcecopy test.db-journal test2.db-journal } - if {[file exists test.db-wal]} { - forcecopy test.db-wal test2.db-wal + if {[file exists test.db-wal]} { + forcecopy test.db-wal test2.db-wal } # Now copy the database file itself. Do this using open/read/puts @@ -83,7 +83,7 @@ foreach {T jrnl_mode} { PRAGMA auto_vacuum = 2; } db eval "PRAGMA journal_mode = $jrnl_mode" - + foreach {tn sql} { 1 { CREATE TABLE t1(x UNIQUE); @@ -97,12 +97,12 @@ foreach {T jrnl_mode} { INSERT INTO t1 SELECT randomblob(400) FROM t1; -- 128 INSERT INTO t1 SELECT randomblob(400) FROM t1; -- 256 } - + 2 { DELETE FROM t1 WHERE rowid%8; } - - 3 { + + 3 { BEGIN; PRAGMA incremental_vacuum = 100; INSERT INTO t1 SELECT randomblob(400) FROM t1; -- 64 @@ -110,8 +110,8 @@ foreach {T jrnl_mode} { INSERT INTO t1 SELECT randomblob(400) FROM t1; -- 256 ROLLBACK; } - - 4 { + + 4 { BEGIN; SAVEPOINT one; PRAGMA incremental_vacuum = 100; @@ -120,20 +120,20 @@ foreach {T jrnl_mode} { INSERT INTO t1 SELECT randomblob(400) FROM t1; -- 128 INSERT INTO t1 SELECT randomblob(400) FROM t1; -- 256 } - + 5 { ROLLBACK to two } - + 6 { ROLLBACK to one } - - 7 { + + 7 { INSERT INTO t1 SELECT randomblob(400) FROM t1; -- 64 PRAGMA incremental_vacuum = 1000; INSERT INTO t1 SELECT randomblob(400) FROM t1; -- 128 INSERT INTO t1 SELECT randomblob(400) FROM t1; -- 256 ROLLBACK; } - - 8 { + + 8 { BEGIN; INSERT INTO t1 SELECT randomblob(400) FROM t1; -- 64 PRAGMA incremental_vacuum = 1000; diff --git a/third_party/sqlite/src/test/incrvacuum_ioerr.test b/third_party/sqlite/src/test/incrvacuum_ioerr.test index 50f7fa2029b20..7c007dbed39a2 100644 --- a/third_party/sqlite/src/test/incrvacuum_ioerr.test +++ b/third_party/sqlite/src/test/incrvacuum_ioerr.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing for correct handling of I/O errors # such as writes failing because the disk is full. -# +# # The tests in this file use special facilities that are only # available in the SQLite test fixture. # @@ -37,7 +37,7 @@ do_ioerr_test incrvacuum-ioerr-1 -cksum 1 -sqlprep { DELETE FROM abc; PRAGMA incremental_vacuum; COMMIT; -} +} # do_ioerr_test incrvacuum-ioerr-3 -start 1 -cksum 1 -tclprep { # db eval { @@ -110,12 +110,12 @@ ifcapable shared_cache { catch { db close } forcedelete test.db set ::enable_shared_cache [sqlite3_enable_shared_cache 1] - + # Create two connections to a single shared-cache: # sqlite3 db1 test.db sqlite3 db2 test.db - + # Create a database with around 20 free pages. # do_test incrvacuum-ioerr-4.0 { @@ -132,17 +132,17 @@ ifcapable shared_cache { execsql COMMIT db1 execsql {DELETE FROM a WHERE oid} db1 } {} - + set ::rc 1 for {set iTest 1} {$::rc && $iTest<2000} {incr iTest} { - + # Figure out how big the database is and how many free pages it # has before running incremental-vacuum. # set nFree [execsql {pragma freelist_count} db1] set nPage [execsql {pragma page_count} db1] puts "nFree=$nFree nPage=$nPage" - + # Now run incremental-vacuum to vacuum 5 pages from the db file. # The iTest'th I/O call is set to fail. # @@ -152,25 +152,25 @@ ifcapable shared_cache { set ::rc [catch {execsql {pragma incremental_vacuum(5)} db1} msg] expr {$::rc==0 || $msg eq "disk I/O error"} } {1} - + set ::sqlite_io_error_pending 0 set ::sqlite_io_error_persist 0 set ::sqlite_io_error_hit 0 set ::sqlite_io_error_hardhit 0 - + set nFree2 [execsql {pragma freelist_count} db1] set nPage2 [execsql {pragma page_count} db1] - + do_test incrvacuum-ioerr-4.$iTest.2 { set shrink [expr {$nPage-$nPage2}] expr {$shrink==0 || $shrink==5 || ($nFree<5 && $shrink==$nFree)} } {1} - + do_test incrvacuum-ioerr-4.$iTest.3 { expr {$nPage - $nPage2} } [expr {$nFree - $nFree2}] } - + # Close the two database connections and restore the default # shared-cache mode setting. # diff --git a/third_party/sqlite/src/test/index.test b/third_party/sqlite/src/test/index.test index 712f42c3a4c8f..6422213554947 100644 --- a/third_party/sqlite/src/test/index.test +++ b/third_party/sqlite/src/test/index.test @@ -24,13 +24,13 @@ do_test index-1.1 { execsql {SELECT name FROM sqlite_master WHERE type!='meta' ORDER BY name} } {index1 test1} do_test index-1.1b { - execsql {SELECT name, sql, tbl_name, type FROM sqlite_master + execsql {SELECT name, sql, tbl_name, type FROM sqlite_master WHERE name='index1'} } {index1 {CREATE INDEX index1 ON test1(f1)} test1 index} do_test index-1.1c { db close sqlite3 db test.db - execsql {SELECT name, sql, tbl_name, type FROM sqlite_master + execsql {SELECT name, sql, tbl_name, type FROM sqlite_master WHERE name='index1'} } {index1 {CREATE INDEX index1 ON test1(f1)} test1 index} do_test index-1.1d { @@ -82,7 +82,7 @@ do_test index-3.1 { set sql "CREATE INDEX [format index%02d $i] ON test1(f[expr {($i%5)+1}])" execsql $sql } - execsql {SELECT name FROM sqlite_master + execsql {SELECT name FROM sqlite_master WHERE type='index' AND tbl_name='test1' ORDER BY name} } $r @@ -99,7 +99,7 @@ integrity_check index-3.2.3 # do_test index-3.3 { execsql {DROP TABLE test1} - execsql {SELECT name FROM sqlite_master + execsql {SELECT name FROM sqlite_master WHERE type='index' AND tbl_name='test1' ORDER BY name} } {} @@ -230,7 +230,7 @@ do_test index-7.2 { } {16} do_test index-7.3 { execsql { - SELECT name FROM sqlite_master + SELECT name FROM sqlite_master WHERE type='index' AND tbl_name='test1' } } {sqlite_autoindex_test1_1} @@ -688,7 +688,7 @@ ifcapable conflict { DROP TABLE t7; DROP TABLE t8; CREATE TABLE t7( - a PRIMARY KEY ON CONFLICT FAIL, + a PRIMARY KEY ON CONFLICT FAIL, UNIQUE(a) ON CONFLICT IGNORE ); } @@ -732,6 +732,6 @@ do_test index-21.2 { } } {0 {9 5 1}} - + finish_test diff --git a/third_party/sqlite/src/test/index3.test b/third_party/sqlite/src/test/index3.test index 4c00a852d214b..fae79c370a0b7 100644 --- a/third_party/sqlite/src/test/index3.test +++ b/third_party/sqlite/src/test/index3.test @@ -41,18 +41,18 @@ integrity_check index3-1.4 # Backwards compatibility test: # -# Verify that CREATE INDEX statements that use strings instead of +# Verify that CREATE INDEX statements that use strings instead of # identifiers for the the column names continue to work correctly. # This is undocumented behavior retained for backwards compatiblity. # do_execsql_test index3-2.1 { DROP TABLE t1; - CREATE TABLE t1(a, b, c, d, e, + CREATE TABLE t1(a, b, c, d, e, PRIMARY KEY('a'), UNIQUE('b' COLLATE nocase DESC)); CREATE INDEX t1c ON t1('c'); CREATE INDEX t1d ON t1('d' COLLATE binary ASC); WITH RECURSIVE c(x) AS (VALUES(1) UNION SELECT x+1 FROM c WHERE x<30) - INSERT INTO t1(a,b,c,d,e) + INSERT INTO t1(a,b,c,d,e) SELECT x, printf('ab%03xxy',x), x, x, x FROM c; } {} do_execsql_test index3-2.2 { @@ -74,7 +74,7 @@ do_execsql_test index3-2.4 { do_execsql_test index3-2.5 { SELECT name FROM sqlite_master WHERE tbl_name LIKE 't2_' ORDER BY name } {t2a t2b t2c t2d} - + diff --git a/third_party/sqlite/src/test/index4.test b/third_party/sqlite/src/test/index4.test index 4fbfa5291b17d..69f721f45c46a 100644 --- a/third_party/sqlite/src/test/index4.test +++ b/third_party/sqlite/src/test/index4.test @@ -44,7 +44,7 @@ do_execsql_test 1.2 { CREATE INDEX i1 ON t1(x); } do_execsql_test 1.3 { - PRAGMA integrity_check + PRAGMA integrity_check } {ok} # The same test again - this time with limited memory. @@ -60,7 +60,7 @@ ifcapable memorymanage { CREATE INDEX i2 ON t1(x); } do_execsql_test 1.5 { - PRAGMA integrity_check + PRAGMA integrity_check } {ok} sqlite3_soft_heap_limit $soft_limit @@ -85,7 +85,7 @@ do_execsql_test 1.6 { INSERT INTO t1 SELECT randomblob(4202) FROM t1; -- 128 INSERT INTO t1 SELECT randomblob(5202) FROM t1; -- 256 COMMIT; - CREATE INDEX i1 ON t1(x); + CREATE INDEX i1 ON t1(x); PRAGMA integrity_check } {ok} @@ -95,7 +95,7 @@ do_execsql_test 1.7 { CREATE TABLE t1(x); INSERT INTO t1 VALUES('a'); COMMIT; - CREATE INDEX i1 ON t1(x); + CREATE INDEX i1 ON t1(x); PRAGMA integrity_check } {ok} @@ -104,7 +104,7 @@ do_execsql_test 1.8 { DROP TABLE t1; CREATE TABLE t1(x); COMMIT; - CREATE INDEX i1 ON t1(x); + CREATE INDEX i1 ON t1(x); PRAGMA integrity_check } {ok} diff --git a/third_party/sqlite/src/test/index5.test b/third_party/sqlite/src/test/index5.test index 4c0aa0431e626..46ca2e53c8d09 100644 --- a/third_party/sqlite/src/test/index5.test +++ b/third_party/sqlite/src/test/index5.test @@ -28,7 +28,7 @@ do_test 1.1 { execsql { INSERT INTO t1 VALUES(randstr(100,100)) } } execsql COMMIT - execsql { + execsql { CREATE INDEX i1 ON t1(x); DROP INDEX I1; PRAGMA main.page_size; @@ -60,8 +60,8 @@ do_test 1.3 { set iNext [lindex $::write_list $i] if {$iNext==($iPrev+1)} { incr nForward - } elseif {$iNext==($iPrev-1)} { - incr nBackward + } elseif {$iNext==($iPrev-1)} { + incr nBackward } else { incr nNoncont } diff --git a/third_party/sqlite/src/test/index6.test b/third_party/sqlite/src/test/index6.test index f6177b44e9571..227f0d4382c09 100644 --- a/third_party/sqlite/src/test/index6.test +++ b/third_party/sqlite/src/test/index6.test @@ -318,15 +318,15 @@ do_execsql_test index6-8.0 { do_eqp_test index6-8.1 { SELECT * FROM t8a LEFT JOIN t8b ON (x = 'value' AND y = a) } { - 0 0 0 {SCAN TABLE t8a} + 0 0 0 {SCAN TABLE t8a} 0 1 1 {SEARCH TABLE t8b USING INDEX i8c (y=?)} } do_execsql_test index6-8.2 { SELECT * FROM t8a LEFT JOIN t8b ON (x = 'value' AND y = a) } { - 1 one value 1 - 2 two {} {} + 1 one value 1 + 2 two {} {} 3 three value 3 } @@ -388,6 +388,6 @@ do_execsql_test index6-11.1 { do_execsql_test index6-11.2 { EXPLAIN QUERY PLAN SELECT a FROM t11 WHERE b<>99 AND c<>98; } {/USING INDEX t11x/} - + finish_test diff --git a/third_party/sqlite/src/test/indexedby.test b/third_party/sqlite/src/test/indexedby.test index 83c7a5ccccc4e..1e274794a306c 100644 --- a/third_party/sqlite/src/test/indexedby.test +++ b/third_party/sqlite/src/test/indexedby.test @@ -41,25 +41,25 @@ proc EQP {sql} { # These tests are to check that "EXPLAIN QUERY PLAN" is working as expected. # do_execsql_test indexedby-1.2 { - EXPLAIN QUERY PLAN select * from t1 WHERE a = 10; + EXPLAIN QUERY PLAN select * from t1 WHERE a = 10; } {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?)}} do_execsql_test indexedby-1.3 { - EXPLAIN QUERY PLAN select * from t1 ; + EXPLAIN QUERY PLAN select * from t1 ; } {0 0 0 {SCAN TABLE t1}} do_execsql_test indexedby-1.4 { - EXPLAIN QUERY PLAN select * from t1, t2 WHERE c = 10; + EXPLAIN QUERY PLAN select * from t1, t2 WHERE c = 10; } { - 0 0 1 {SEARCH TABLE t2 USING INDEX i3 (c=?)} + 0 0 1 {SEARCH TABLE t2 USING INDEX i3 (c=?)} 0 1 0 {SCAN TABLE t1} } -# Parser tests. Test that an INDEXED BY or NOT INDEX clause can be +# Parser tests. Test that an INDEXED BY or NOT INDEX clause can be # attached to a table in the FROM clause, but not to a sub-select or # SQL view. Also test that specifying an index that does not exist or # is attached to a different table is detected as an error. # # EVIDENCE-OF: R-07004-11522 -- syntax diagram qualified-table-name -# +# # EVIDENCE-OF: R-58230-57098 The "INDEXED BY index-name" phrase # specifies that the named index must be used in order to look up values # on the preceding table. @@ -127,11 +127,11 @@ do_execsql_test indexedby-3.1.2 { do_execsql_test indexedby-3.2 { - EXPLAIN QUERY PLAN + EXPLAIN QUERY PLAN SELECT * FROM t1 INDEXED BY i1 WHERE a = 'one' AND b = 'two' } {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?)}} do_execsql_test indexedby-3.3 { - EXPLAIN QUERY PLAN + EXPLAIN QUERY PLAN SELECT * FROM t1 INDEXED BY i2 WHERE a = 'one' AND b = 'two' } {0 0 0 {SEARCH TABLE t1 USING INDEX i2 (b=?)}} do_test indexedby-3.4 { @@ -148,12 +148,12 @@ do_test indexedby-3.7 { } {0 {}} do_execsql_test indexedby-3.8 { - EXPLAIN QUERY PLAN - SELECT * FROM t3 INDEXED BY sqlite_autoindex_t3_1 ORDER BY e + EXPLAIN QUERY PLAN + SELECT * FROM t3 INDEXED BY sqlite_autoindex_t3_1 ORDER BY e } {0 0 0 {SCAN TABLE t3 USING INDEX sqlite_autoindex_t3_1}} do_execsql_test indexedby-3.9 { - EXPLAIN QUERY PLAN - SELECT * FROM t3 INDEXED BY sqlite_autoindex_t3_1 WHERE e = 10 + EXPLAIN QUERY PLAN + SELECT * FROM t3 INDEXED BY sqlite_autoindex_t3_1 WHERE e = 10 } {0 0 0 {SEARCH TABLE t3 USING INDEX sqlite_autoindex_t3_1 (e=?)}} do_test indexedby-3.10 { catchsql { SELECT * FROM t3 INDEXED BY sqlite_autoindex_t3_1 WHERE f = 10 } @@ -165,15 +165,15 @@ do_test indexedby-3.11 { # Tests for multiple table cases. # do_execsql_test indexedby-4.1 { - EXPLAIN QUERY PLAN SELECT * FROM t1, t2 WHERE a = c + EXPLAIN QUERY PLAN SELECT * FROM t1, t2 WHERE a = c } { - 0 0 0 {SCAN TABLE t1} + 0 0 0 {SCAN TABLE t1} 0 1 1 {SEARCH TABLE t2 USING INDEX i3 (c=?)} } do_execsql_test indexedby-4.2 { - EXPLAIN QUERY PLAN SELECT * FROM t1 INDEXED BY i1, t2 WHERE a = c + EXPLAIN QUERY PLAN SELECT * FROM t1 INDEXED BY i1, t2 WHERE a = c } { - 0 0 1 {SCAN TABLE t2} + 0 0 1 {SCAN TABLE t2} 0 1 0 {SEARCH TABLE t1 USING INDEX i1 (a=?)} } do_test indexedby-4.3 { @@ -193,10 +193,10 @@ do_test indexedby-4.4 { # do_execsql_test indexedby-5.1 { CREATE VIEW v2 AS SELECT * FROM t1 INDEXED BY i1 WHERE a > 5; - EXPLAIN QUERY PLAN SELECT * FROM v2 + EXPLAIN QUERY PLAN SELECT * FROM v2 } {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a>?)}} do_execsql_test indexedby-5.2 { - EXPLAIN QUERY PLAN SELECT * FROM v2 WHERE b = 10 + EXPLAIN QUERY PLAN SELECT * FROM v2 WHERE b = 10 } {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a>?)}} do_test indexedby-5.3 { execsql { DROP INDEX i1 } @@ -215,12 +215,12 @@ do_test indexedby-5.5 { } {0 {}} # Test that "NOT INDEXED" may use the rowid index, but not others. -# +# do_execsql_test indexedby-6.1 { - EXPLAIN QUERY PLAN SELECT * FROM t1 WHERE b = 10 ORDER BY rowid + EXPLAIN QUERY PLAN SELECT * FROM t1 WHERE b = 10 ORDER BY rowid } {0 0 0 {SEARCH TABLE t1 USING INDEX i2 (b=?)}} do_execsql_test indexedby-6.2 { - EXPLAIN QUERY PLAN SELECT * FROM t1 NOT INDEXED WHERE b = 10 ORDER BY rowid + EXPLAIN QUERY PLAN SELECT * FROM t1 NOT INDEXED WHERE b = 10 ORDER BY rowid } {0 0 0 {SCAN TABLE t1}} # EVIDENCE-OF: R-40297-14464 The INDEXED BY phrase forces the SQLite @@ -228,15 +228,15 @@ do_execsql_test indexedby-6.2 { # UPDATE statement. # # Test that "INDEXED BY" can be used in a DELETE statement. -# +# do_execsql_test indexedby-7.1 { - EXPLAIN QUERY PLAN DELETE FROM t1 WHERE a = 5 + EXPLAIN QUERY PLAN DELETE FROM t1 WHERE a = 5 } {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?)}} do_execsql_test indexedby-7.2 { - EXPLAIN QUERY PLAN DELETE FROM t1 NOT INDEXED WHERE a = 5 + EXPLAIN QUERY PLAN DELETE FROM t1 NOT INDEXED WHERE a = 5 } {0 0 0 {SCAN TABLE t1}} do_execsql_test indexedby-7.3 { - EXPLAIN QUERY PLAN DELETE FROM t1 INDEXED BY i1 WHERE a = 5 + EXPLAIN QUERY PLAN DELETE FROM t1 INDEXED BY i1 WHERE a = 5 } {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?)}} do_execsql_test indexedby-7.4 { EXPLAIN QUERY PLAN DELETE FROM t1 INDEXED BY i1 WHERE a = 5 AND b = 10 @@ -249,22 +249,22 @@ do_test indexedby-7.6 { } {1 {no query solution}} # Test that "INDEXED BY" can be used in an UPDATE statement. -# +# do_execsql_test indexedby-8.1 { - EXPLAIN QUERY PLAN UPDATE t1 SET rowid=rowid+1 WHERE a = 5 + EXPLAIN QUERY PLAN UPDATE t1 SET rowid=rowid+1 WHERE a = 5 } {0 0 0 {SEARCH TABLE t1 USING COVERING INDEX i1 (a=?)}} do_execsql_test indexedby-8.2 { - EXPLAIN QUERY PLAN UPDATE t1 NOT INDEXED SET rowid=rowid+1 WHERE a = 5 + EXPLAIN QUERY PLAN UPDATE t1 NOT INDEXED SET rowid=rowid+1 WHERE a = 5 } {0 0 0 {SCAN TABLE t1}} do_execsql_test indexedby-8.3 { - EXPLAIN QUERY PLAN UPDATE t1 INDEXED BY i1 SET rowid=rowid+1 WHERE a = 5 + EXPLAIN QUERY PLAN UPDATE t1 INDEXED BY i1 SET rowid=rowid+1 WHERE a = 5 } {0 0 0 {SEARCH TABLE t1 USING COVERING INDEX i1 (a=?)}} do_execsql_test indexedby-8.4 { - EXPLAIN QUERY PLAN + EXPLAIN QUERY PLAN UPDATE t1 INDEXED BY i1 SET rowid=rowid+1 WHERE a = 5 AND b = 10 } {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?)}} do_execsql_test indexedby-8.5 { - EXPLAIN QUERY PLAN + EXPLAIN QUERY PLAN UPDATE t1 INDEXED BY i2 SET rowid=rowid+1 WHERE a = 5 AND b = 10 } {0 0 0 {SEARCH TABLE t1 USING INDEX i2 (b=?)}} do_test indexedby-8.6 { diff --git a/third_party/sqlite/src/test/indexexpr1.test b/third_party/sqlite/src/test/indexexpr1.test index 2b375a5855af6..6ab0764a54aae 100644 --- a/third_party/sqlite/src/test/indexexpr1.test +++ b/third_party/sqlite/src/test/indexexpr1.test @@ -18,7 +18,7 @@ source $testdir/tester.tcl do_execsql_test indexexpr1-100 { CREATE TABLE t1(a,b,c); INSERT INTO t1(a,b,c) - /* 123456789 123456789 123456789 123456789 123456789 123456789 */ + /* 123456789 123456789 123456789 123456789 123456789 123456789 */ VALUES('In_the_beginning_was_the_Word',1,1), ('and_the_Word_was_with_God',1,2), ('and_the_Word_was_God',1,3), diff --git a/third_party/sqlite/src/test/indexfault.test b/third_party/sqlite/src/test/indexfault.test index efe493219edc9..798bd507d01fd 100644 --- a/third_party/sqlite/src/test/indexfault.test +++ b/third_party/sqlite/src/test/indexfault.test @@ -85,7 +85,7 @@ do_faultsim_test 1.1 -prep { faultsim_restore_and_reopen } -body { execsql { CREATE INDEX i1 ON t1(x) } - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} faultsim_integrity_check } ifcapable memorymanage { @@ -94,7 +94,7 @@ ifcapable memorymanage { faultsim_restore_and_reopen } -body { execsql { CREATE INDEX i1 ON t1(x) } - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} } sqlite3_soft_heap_limit $soft_limit } @@ -112,25 +112,25 @@ do_execsql_test 2.0 { randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30) ); - INSERT INTO t1 SELECT + INSERT INTO t1 SELECT randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30) FROM t1; -- 2 - INSERT INTO t1 SELECT + INSERT INTO t1 SELECT randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30) FROM t1; -- 4 - INSERT INTO t1 SELECT + INSERT INTO t1 SELECT randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30) FROM t1; -- 8 - INSERT INTO t1 SELECT + INSERT INTO t1 SELECT randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30) FROM t1; -- 16 - INSERT INTO t1 SELECT + INSERT INTO t1 SELECT randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30) FROM t1; -- 32 - INSERT INTO t1 SELECT + INSERT INTO t1 SELECT randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30) FROM t1; -- 64 - INSERT INTO t1 SELECT + INSERT INTO t1 SELECT randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30), randomblob(30) FROM t1; -- 128 COMMIT; @@ -141,7 +141,7 @@ do_faultsim_test 2.1 -prep { faultsim_restore_and_reopen } -body { execsql { CREATE INDEX i1 ON t1(t,u,v,w,x,y,z) } - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} faultsim_integrity_check } ifcapable memorymanage { @@ -150,7 +150,7 @@ ifcapable memorymanage { faultsim_restore_and_reopen } -body { execsql { CREATE INDEX i1 ON t1(t,u,v,w,x,y,z) } - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} } sqlite3_soft_heap_limit $soft_limit } @@ -170,15 +170,15 @@ ifcapable memorymanage { # 3.5: After a certain amount of data has been read from the main database # file (and written into the temporary b-tree), sqlite3_release_memory() # is called to free as much memory as possible. This causes the temp -# b-tree to be flushed to disk. So that before its contents can be +# b-tree to be flushed to disk. So that before its contents can be # transfered to a PMA they must be read back from disk - creating extra # opportunities for IO errors. # install_custom_faultsim -# Set up a table to build indexes on. Save the setup using the +# Set up a table to build indexes on. Save the setup using the # [faultsim_save_and_close] mechanism. -# +# sqlite3 db test.db do_execsql_test 3.0 { BEGIN; @@ -211,7 +211,7 @@ do_faultsim_test 3.1 -faults custom -prep { faultsim_restore_and_reopen } -body { execsql { CREATE INDEX i1 ON t1(x) } - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} } ifcapable memorymanage { set soft_limit [sqlite3_soft_heap_limit 50000] @@ -219,7 +219,7 @@ ifcapable memorymanage { faultsim_restore_and_reopen } -body { execsql { CREATE INDEX i1 ON t1(x) } - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} } sqlite3_soft_heap_limit $soft_limit } @@ -248,7 +248,7 @@ do_faultsim_test 3.3 -faults custom -prep { set ::nTmpOpen 0 } -body { execsql { CREATE INDEX i1 ON t1(x) } - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} } ifcapable memorymanage { @@ -258,7 +258,7 @@ ifcapable memorymanage { set ::nTmpOpen 0 } -body { execsql { CREATE INDEX i1 ON t1(x) } - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} } sqlite3_soft_heap_limit $soft_limit } @@ -271,7 +271,7 @@ uninstall_custom_faultsim # called to free as much memory as possible. This causes the temp b-tree to be # flushed to disk. So that before its contents can be transfered to a PMA they # must be read back from disk - creating extra opportunities for IO errors. -# +# install_custom_faultsim catch { db close } @@ -293,7 +293,7 @@ do_execsql_test 4.0 { } faultsim_save_and_close -testvfs tvfs +testvfs tvfs tvfs script xRead tvfs filter xRead set ::nRead 0 @@ -334,7 +334,7 @@ do_faultsim_test 4.2 -faults custom -prep { sqlite3_soft_heap_limit 0 } -body { execsql { CREATE INDEX i1 ON t1(x) } - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} } uninstall_custom_faultsim diff --git a/third_party/sqlite/src/test/init.test b/third_party/sqlite/src/test/init.test index 7cb18f492ac14..5a23ab3fe5201 100644 --- a/third_party/sqlite/src/test/init.test +++ b/third_party/sqlite/src/test/init.test @@ -10,7 +10,7 @@ #*********************************************************************** # # This file implements regression tests for SQLite library. The -# focus of this file is testing the effects of a failure in +# focus of this file is testing the effects of a failure in # sqlite3_initialize(). # # diff --git a/third_party/sqlite/src/test/insert.test b/third_party/sqlite/src/test/insert.test index cb675b90d1666..1e27f75b6694a 100644 --- a/third_party/sqlite/src/test/insert.test +++ b/third_party/sqlite/src/test/insert.test @@ -91,7 +91,7 @@ do_test insert-1.6c { do_test insert-2.1 { execsql { CREATE TABLE test2( - f1 int default -111, + f1 int default -111, f2 real default +4.32, f3 int default +222, f4 int default 7.89 @@ -115,7 +115,7 @@ do_test insert-2.10 { execsql { DROP TABLE test2; CREATE TABLE test2( - f1 int default 111, + f1 int default 111, f2 real default -4.32, f3 text default hi, f4 text default 'abc-123', @@ -250,7 +250,7 @@ ifcapable tempdb { expr {[lsearch $x OpenEphemeral]>0} } {1} } - + do_test insert-5.4 { # Verify that table "test1" begins on page 3. This should be the same # page number used by "t4" above. @@ -289,7 +289,7 @@ ifcapable tempdb { # Ticket #334: REPLACE statement corrupting indices. # ifcapable conflict { - # The REPLACE command is not available if SQLITE_OMIT_CONFLICT is + # The REPLACE command is not available if SQLITE_OMIT_CONFLICT is # defined at compilation time. do_test insert-6.1 { execsql { @@ -328,8 +328,8 @@ ifcapable conflict { } {} } -# Test that the special optimization for queries of the form -# "SELECT max(x) FROM tbl" where there is an index on tbl(x) works with +# Test that the special optimization for queries of the form +# "SELECT max(x) FROM tbl" where there is an index on tbl(x) works with # INSERT statments. do_test insert-7.1 { execsql { diff --git a/third_party/sqlite/src/test/insert2.test b/third_party/sqlite/src/test/insert2.test index 977fbc584ac2d..8012fc9004ded 100644 --- a/third_party/sqlite/src/test/insert2.test +++ b/third_party/sqlite/src/test/insert2.test @@ -57,7 +57,7 @@ do_test insert2-1.2.1 { catch {execsql {DROP TABLE t1}} execsql { CREATE TABLE t1(log int, cnt int); - INSERT INTO t1 + INSERT INTO t1 SELECT log, count(*) FROM d1 GROUP BY log EXCEPT SELECT n-1,log FROM d1; } @@ -72,7 +72,7 @@ do_test insert2-1.3.1 { execsql { CREATE TABLE t1(log int, cnt int); PRAGMA count_changes=off; - INSERT INTO t1 + INSERT INTO t1 SELECT log, count(*) FROM d1 GROUP BY log INTERSECT SELECT n-1,log FROM d1; } @@ -236,19 +236,19 @@ ifcapable tempdb { CREATE TEMPORARY TABLE DepCheck(troveId INT, depNum INT, flagCount INT, isProvides BOOL, class INTEGER, name STRING, flag STRING); - INSERT INTO DepCheck + INSERT INTO DepCheck VALUES(-1, 0, 1, 0, 2, 'libc.so.6', 'GLIBC_2.0'); - INSERT INTO Dependencies - SELECT DISTINCT - NULL, - DepCheck.class, - DepCheck.name, - DepCheck.flag - FROM DepCheck LEFT OUTER JOIN Dependencies ON - DepCheck.class == Dependencies.class AND - DepCheck.name == Dependencies.name AND - DepCheck.flag == Dependencies.flag - WHERE + INSERT INTO Dependencies + SELECT DISTINCT + NULL, + DepCheck.class, + DepCheck.name, + DepCheck.flag + FROM DepCheck LEFT OUTER JOIN Dependencies ON + DepCheck.class == Dependencies.class AND + DepCheck.name == Dependencies.name AND + DepCheck.flag == Dependencies.flag + WHERE Dependencies.depId is NULL; }; } {} @@ -276,7 +276,7 @@ ifcapable subquery { } {1 2 1 3 1 4} } -do_execsql_test 6.0 { +do_execsql_test 6.0 { CREATE TABLE t5(a, b, c DEFAULT 'c', d); } do_execsql_test 6.1 { diff --git a/third_party/sqlite/src/test/insert3.test b/third_party/sqlite/src/test/insert3.test index 6b253e0ab7912..6acd4456b7568 100644 --- a/third_party/sqlite/src/test/insert3.test +++ b/third_party/sqlite/src/test/insert3.test @@ -62,13 +62,13 @@ ifcapable compound { do_test insert3-1.4.1 { execsql { INSERT INTO t1 SELECT * FROM t1; - SELECT 'a:', x, y FROM log UNION ALL + SELECT 'a:', x, y FROM log UNION ALL SELECT 'b:', x, y FROM log2 ORDER BY x; } } {a: 5 4 b: 10 2 b: 20 1 a: 453 2 a: hello 4 b: hi 2 b: world 1} do_test insert3-1.4.2 { execsql { - SELECT 'a:', x, y FROM log UNION ALL + SELECT 'a:', x, y FROM log UNION ALL SELECT 'b:', x, y FROM log2 ORDER BY x, y; } } {a: 5 4 b: 10 2 b: 20 1 a: 453 2 a: hello 4 b: hi 2 b: world 1} @@ -179,7 +179,7 @@ sqlite3 db test.db # tests are included to ensure that that bug is fixed. # do_test insert3-4.1 { - execsql { + execsql { CREATE TABLE t1(a, b, c); CREATE INDEX i1 ON t1(a, b); BEGIN; diff --git a/third_party/sqlite/src/test/insert4.test b/third_party/sqlite/src/test/insert4.test index 3eece87e5f9ea..d953e6e7f827f 100644 --- a/third_party/sqlite/src/test/insert4.test +++ b/third_party/sqlite/src/test/insert4.test @@ -21,7 +21,7 @@ ifcapable !view||!subquery { return } -# The sqlite3_xferopt_count variable is incremented whenever the +# The sqlite3_xferopt_count variable is incremented whenever the # insert transfer optimization applies. # # This procedure runs a test to see if the sqlite3_xferopt_count is @@ -127,11 +127,11 @@ xferopt_test insert4-2.4.4 0 # transfer is successful and that the transfer optimization was used or # not, as appropriate. # -# xfer_check TESTID XFER-USED INIT-DATA DEST-SCHEMA SRC-SCHEMA +# xfer_check TESTID XFER-USED INIT-DATA DEST-SCHEMA SRC-SCHEMA # # The TESTID argument is the symbolic name for this test. The XFER-USED # argument is true if the transfer optimization should be employed and -# false if not. INIT-DATA is a single row of data that is to be +# false if not. INIT-DATA is a single row of data that is to be # transfered. DEST-SCHEMA and SRC-SCHEMA are table declarations for # the destination and source tables. # @@ -199,7 +199,7 @@ xfer_check insert4-3.8 0 {1 9} \ # Do run the transfer optimization if the destination table and -# source table have the same NOT NULL constraints or if the +# source table have the same NOT NULL constraints or if the # source table has extra NOT NULL constraints. # xfer_check insert4-3.9 1 {1 9} \ @@ -244,7 +244,7 @@ ifcapable vacuum { INSERT INTO t4 VALUES(NULL,0); INSERT INTO t4 VALUES(NULL,1); INSERT INTO t4 VALUES(NULL,1); - VACUUM; + VACUUM; } } {} } @@ -257,7 +257,7 @@ do_test insert4-5.1 { } {1 {no such table: nosuchtable}} do_test insert4-5.2 { # Number of columns does not match. - catchsql { + catchsql { CREATE TABLE t5(a, b, c); INSERT INTO t4 SELECT * FROM t5; } @@ -266,7 +266,7 @@ do_test insert4-5.2 { do_test insert4-6.1 { set ::sqlite3_xferopt_count 0 execsql { - CREATE INDEX t2_i2 ON t2(x, y COLLATE nocase); + CREATE INDEX t2_i2 ON t2(x, y COLLATE nocase); CREATE INDEX t2_i1 ON t2(x ASC, y DESC); CREATE INDEX t3_i1 ON t3(a, b); INSERT INTO t2 SELECT * FROM t3; @@ -457,7 +457,7 @@ do_test insert4-8.6 { execsql { SELECT * FROM t1; } -} {-99 100 1 2} +} {-99 100 1 2} do_test insert4-8.7 { execsql { DROP TABLE IF EXISTS t1; @@ -477,7 +477,7 @@ do_test insert4-8.8 { execsql { SELECT * FROM t1; } -} {1 2} +} {1 2} do_test insert4-8.9 { execsql { DROP TABLE IF EXISTS t1; @@ -502,7 +502,7 @@ do_test insert4-8.11 { execsql { SELECT * FROM t1; } -} {1 2} +} {1 2} do_test insert4-8.21 { execsql { diff --git a/third_party/sqlite/src/test/insert5.test b/third_party/sqlite/src/test/insert5.test index 1e58902e07884..3a27cf187b135 100644 --- a/third_party/sqlite/src/test/insert5.test +++ b/third_party/sqlite/src/test/insert5.test @@ -22,11 +22,11 @@ ifcapable !subquery { return } -# Return true if the compilation of the sql passed as an argument +# Return true if the compilation of the sql passed as an argument # includes the opcode OpenEphemeral. An "INSERT INTO ... SELECT" # statement includes such an opcode if a temp-table is used # to store intermediate results. -# +# proc uses_temp_table {sql} { return [expr {[lsearch [execsql "EXPLAIN $sql"] OpenEphemeral]>=0}] } @@ -36,12 +36,12 @@ proc uses_temp_table {sql} { do_test insert5-1.0 { forcedelete test2.db test2.db-journal execsql { - CREATE TABLE MAIN(Id INTEGER, Id1 INTEGER); - CREATE TABLE B(Id INTEGER, Id1 INTEGER); + CREATE TABLE MAIN(Id INTEGER, Id1 INTEGER); + CREATE TABLE B(Id INTEGER, Id1 INTEGER); CREATE VIEW v1 AS SELECT * FROM B; CREATE VIEW v2 AS SELECT * FROM MAIN; - INSERT INTO MAIN(Id,Id1) VALUES(2,3); - INSERT INTO B(Id,Id1) VALUES(2,3); + INSERT INTO MAIN(Id,Id1) VALUES(2,3); + INSERT INTO B(Id,Id1) VALUES(2,3); } } {} @@ -50,8 +50,8 @@ do_test insert5-1.0 { ifcapable compound { do_test insert5-1.1 { execsql { - INSERT INTO B - SELECT * FROM B UNION ALL + INSERT INTO B + SELECT * FROM B UNION ALL SELECT * FROM MAIN WHERE exists (select * FROM B WHERE B.Id = MAIN.Id); SELECT * FROM B; } @@ -79,8 +79,8 @@ do_test insert5-2.4 { uses_temp_table { INSERT INTO b SELECT id1, (SELECT id FROM b) FROM main } } {1} do_test insert5-2.5 { - uses_temp_table { - INSERT INTO b + uses_temp_table { + INSERT INTO b SELECT * FROM main WHERE id = (SELECT id1 FROM b WHERE main.id = b.id) } } {1} do_test insert5-2.6 { @@ -90,8 +90,8 @@ do_test insert5-2.7 { uses_temp_table { INSERT INTO b SELECT * FROM v2 } } {0} do_test insert5-2.8 { - uses_temp_table { - INSERT INTO b + uses_temp_table { + INSERT INTO b SELECT * FROM main WHERE id > 10 AND max(id1, (SELECT id FROM b)) > 10; } } {1} @@ -100,16 +100,16 @@ do_test insert5-2.8 { # or ORDER BY of a sub-query is no longer supported. # # do_test insert5-2.9 { -# uses_temp_table { -# INSERT INTO b -# SELECT * FROM main +# uses_temp_table { +# INSERT INTO b +# SELECT * FROM main # WHERE id > 10 AND (SELECT count(*) FROM v2 GROUP BY main.id) # } # } {} do_test insert5-2.9 { - catchsql { - INSERT INTO b - SELECT * FROM main + catchsql { + INSERT INTO b + SELECT * FROM main WHERE id > 10 AND (SELECT count(*) FROM v2 GROUP BY main.id) } } {1 {no such column: main.id}} diff --git a/third_party/sqlite/src/test/instrfault.test b/third_party/sqlite/src/test/instrfault.test index 0ddb12c84beb0..03566e0393243 100644 --- a/third_party/sqlite/src/test/instrfault.test +++ b/third_party/sqlite/src/test/instrfault.test @@ -9,7 +9,7 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The -# focus of this file is testing OOM error handling within the built-in +# focus of this file is testing OOM error handling within the built-in # INSTR() function. # diff --git a/third_party/sqlite/src/test/interrupt2.test b/third_party/sqlite/src/test/interrupt2.test index b9c66bd1f4c1a..6aaf98cffeb9a 100644 --- a/third_party/sqlite/src/test/interrupt2.test +++ b/third_party/sqlite/src/test/interrupt2.test @@ -9,7 +9,7 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The -# focus of this script is using the sqlite_interrupt() API to +# focus of this script is using the sqlite_interrupt() API to # interrupt WAL checkpoint operations. # @@ -41,7 +41,7 @@ proc write_cb {method args} { return 0 } -sqlite3 db test.db +sqlite3 db test.db do_execsql_test 1.0 { CREATE TABLE t1(a, b); CREATE INDEX t1a ON t1(a); @@ -64,7 +64,7 @@ foreach idelay { do_execsql_test 1.$idelay.2 { SELECT count(*) FROM t1 } 1000 set ::trigger_interrupt $idelay - do_test 1.$idelay.3 { + do_test 1.$idelay.3 { list [catch { sqlite3_wal_checkpoint_v2 db truncate } msg] $msg } {1 {SQLITE_INTERRUPT - interrupted}} do_execsql_test 1.$idelay.4 { SELECT count(*) FROM t1 } 1000 @@ -87,7 +87,7 @@ do_test 2.1 { incr i -1 if {$i==0} { set ::trigger_interrupt 10 - set cres [catch { sqlite3_wal_checkpoint_v2 db truncate } msg] + set cres [catch { sqlite3_wal_checkpoint_v2 db truncate } msg] lappend cres $msg } } @@ -132,7 +132,7 @@ do_test 3.2.2 { # Check the effect of an interrupt during an automatic checkpoint # db_restore_and_reopen -do_test 4.0 { +do_test 4.0 { execsql { PRAGMA wal_autocheckpoint = 10 } set ::trigger_interrupt 10 execsql { CREATE TABLE t2(x, y) } @@ -147,7 +147,7 @@ do_test 4.1 { expr $nFrame2 > $nFrame1 } {1} -# The auto-checkpoint in test 4.0 should not have been interrupted. So +# The auto-checkpoint in test 4.0 should not have been interrupted. So # this db write should not cause the wal file to grow. do_test 4.2 { set nFrame1 [wal_frame_count test.db-wal 1024] diff --git a/third_party/sqlite/src/test/io.test b/third_party/sqlite/src/test/io.test index e1af808a3f9d7..39d5d6dfd1596 100644 --- a/third_party/sqlite/src/test/io.test +++ b/third_party/sqlite/src/test/io.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# The focus of this file is testing some specific characteristics of the +# The focus of this file is testing some specific characteristics of the # IO traffic generated by SQLite (making sure SQLite is not writing out # more database pages than it has to, stuff like that). # @@ -28,22 +28,22 @@ sqlite3 db test.db -vfs devsym # # io-2.* - Test the "atomic-write optimization". # -# io-3.* - Test the IO traffic enhancements triggered when the -# IOCAP_SEQUENTIAL device capability flag is set (no +# io-3.* - Test the IO traffic enhancements triggered when the +# IOCAP_SEQUENTIAL device capability flag is set (no # fsync() calls on the journal file). # -# io-4.* - Test the IO traffic enhancements triggered when the -# IOCAP_SAFE_APPEND device capability flag is set (fewer +# io-4.* - Test the IO traffic enhancements triggered when the +# IOCAP_SAFE_APPEND device capability flag is set (fewer # fsync() calls on the journal file, no need to set nRec # field in the single journal header). # -# io-5.* - Test that the default page size is selected and used +# io-5.* - Test that the default page size is selected and used # correctly. # -# io-6.* - Test that the pager-cache is not being flushed unnecessarily +# io-6.* - Test that the pager-cache is not being flushed unnecessarily # after a transaction that uses the special atomic-write path # is committed. -# +# set ::nWrite 0 proc nWrite {db} { @@ -97,9 +97,9 @@ do_test io-1.3 { nWrite db } {4} -# Insert another 3 240 byte records. After this, the tree consists of -# the root-node, which is close to empty, and two leaf pages, both of -# which are full. +# Insert another 3 240 byte records. After this, the tree consists of +# the root-node, which is close to empty, and two leaf pages, both of +# which are full. do_test io-1.4 { set ret [list] execsql { INSERT INTO abc VALUES(6,randstr(230,230)); } @@ -146,7 +146,7 @@ do_test io-2.2 { # Set the device-characteristic mask to include the SQLITE_IOCAP_ATOMIC, # then do another INSERT similar to the one in io-2.2. This should # only write 1 page and require a single fsync(). -# +# # The single fsync() is the database file. Only one page is reported as # written because page 1 - the change-counter page - is written using # an out-of-band method that bypasses the write counter. @@ -209,7 +209,7 @@ do_test io-2.5.3 { # journal file is not actually created until the 'COMMIT' statement # is executed. # -# Changed 2010-03-27: The size of the database is now stored in +# Changed 2010-03-27: The size of the database is now stored in # bytes 28..31 and so when a page is added to the database, page 1 # is immediately modified and the journal file immediately comes into # existence. To fix this test, the BEGIN is changed into a a @@ -244,7 +244,7 @@ do_test io-2.6.4 { # Test that if the database modification is part of multi-file commit, # the journal file is always created. In this case, the journal file # is created during execution of the COMMIT statement, so we have to -# use the same technique to check that it is created as in the above +# use the same technique to check that it is created as in the above # block. forcedelete test2.db test2.db-journal ifcapable attach { @@ -330,7 +330,7 @@ do_test io-2.9.3 { execsql { COMMIT } } {} -# Test a couple of the more specific IOCAP_ATOMIC flags +# Test a couple of the more specific IOCAP_ATOMIC flags # (i.e IOCAP_ATOMIC2K etc.). # do_test io-2.10.1 { @@ -355,20 +355,20 @@ do_test io-2.10.3 { } {} do_test io-2.11.0 { - execsql { + execsql { PRAGMA locking_mode = exclusive; PRAGMA locking_mode; } } {exclusive exclusive} do_test io-2.11.1 { - execsql { + execsql { INSERT INTO abc VALUES(11, 12); } file exists test.db-journal } {0} do_test io-2.11.2 { - execsql { + execsql { PRAGMA locking_mode = normal; INSERT INTO abc VALUES(13, 14); } @@ -413,7 +413,7 @@ ifcapable pager_pragmas { INSERT INTO abc SELECT * FROM abc; INSERT INTO abc SELECT * FROM abc; } - # File has grown - showing there was a cache-spill - but there + # File has grown - showing there was a cache-spill - but there # have been no calls to fsync(). The file is probably about 30KB. # But some VFS implementations (symbian) buffer writes so the actual # size may be a little less than that. So this test case just tests @@ -513,11 +513,11 @@ do_test io-4.3.3 { } {1} if {$tcl_platform(platform) != "symbian"} { # This test is not run on symbian because the file-buffer makes it - # difficult to predict the exact size of the file as reported by + # difficult to predict the exact size of the file as reported by # [file size]. do_test io-4.3.4 { - # The UPDATE statement in the statement above modifies 41 pages - # (all pages in the database except page 1 and the root page of + # The UPDATE statement in the statement above modifies 41 pages + # (all pages in the database except page 1 and the root page of # abc). Because the cache_size is set to 10, this must have required # at least 4 cache-spills. If there were no journal headers written # to the journal file after the cache-spill, then the size of the diff --git a/third_party/sqlite/src/test/ioerr.test b/third_party/sqlite/src/test/ioerr.test index e59647fe5013a..0e1c845f1bc45 100644 --- a/third_party/sqlite/src/test/ioerr.test +++ b/third_party/sqlite/src/test/ioerr.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing for correct handling of I/O errors # such as writes failing because the disk is full. -# +# # The tests in this file use special facilities that are only # available in the SQLite test fixture. # @@ -45,21 +45,21 @@ do_ioerr_test ioerr-1 -erc 1 -ckrefcount 1 -sqlprep { DELETE FROM t1 WHERE a<100; } -exclude [expr [string match [execsql {pragma auto_vacuum}] 1] ? 4 : 0] -# Test for IO errors during a VACUUM. +# Test for IO errors during a VACUUM. # # The first IO call is excluded from the test. This call attempts to read # the file-header of the temporary database used by VACUUM. Since the # database doesn't exist at that point, the IO error is not detected. -# -# Additionally, if auto-vacuum is enabled, the 12th IO error is not +# +# Additionally, if auto-vacuum is enabled, the 12th IO error is not # detected. Same reason as the 8th in the test case above. -# +# ifcapable vacuum { - do_ioerr_test ioerr-2 -cksum true -ckrefcount true -sqlprep { - BEGIN; - CREATE TABLE t1(a, b, c); - INSERT INTO t1 VALUES(1, randstr(50,50), randstr(50,50)); - INSERT INTO t1 SELECT a+2, b||'-'||rowid, c||'-'||rowid FROM t1; + do_ioerr_test ioerr-2 -cksum true -ckrefcount true -sqlprep { + BEGIN; + CREATE TABLE t1(a, b, c); + INSERT INTO t1 VALUES(1, randstr(50,50), randstr(50,50)); + INSERT INTO t1 SELECT a+2, b||'-'||rowid, c||'-'||rowid FROM t1; INSERT INTO t1 SELECT a+4, b||'-'||rowid, c||'-'||rowid FROM t1; INSERT INTO t1 SELECT a+8, b||'-'||rowid, c||'-'||rowid FROM t1; INSERT INTO t1 SELECT a+16, b||'-'||rowid, c||'-'||rowid FROM t1; @@ -86,7 +86,7 @@ do_ioerr_test ioerr-3 -ckrefcount true -tclprep { } for {set i 0} {$i<150} {incr i} { execsql { - INSERT INTO abc VALUES(randstr(100,100)); + INSERT INTO abc VALUES(randstr(100,100)); } } execsql COMMIT @@ -97,7 +97,7 @@ do_ioerr_test ioerr-3 -ckrefcount true -tclprep { UPDATE abc SET a = randstr(90,90); COMMIT; CREATE TABLE abc3(a); -} +} # Test IO errors that can occur retrieving a record header that flows over # onto an overflow page. @@ -116,7 +116,7 @@ do_ioerr_test ioerr-4 -ckrefcount true -tclprep { # Test IO errors that may occur during a multi-file commit. # -# Tests 8 and 17 are excluded when auto-vacuum is enabled for the same +# Tests 8 and 17 are excluded when auto-vacuum is enabled for the same # reason as in test cases ioerr-1.XXX ifcapable attach { set ex "" @@ -133,11 +133,11 @@ ifcapable attach { } -exclude $ex } -# Test IO errors when replaying two hot journals from a 2-file +# Test IO errors when replaying two hot journals from a 2-file # transaction. This test only runs on UNIX. # # It cannot be run under the "exclusive" permutation. In that case, the -# locks held by the connection in the local (this) process prevent a +# locks held by the connection in the local (this) process prevent a # second connection from attempting the multi-file transaction. # ifcapable crashtest&&attach { @@ -164,12 +164,12 @@ ifcapable crashtest&&attach { SELECT * FROM aux.sqlite_master; } } -} +} # Test handling of IO errors that occur while rolling back hot journal # files. # -# These tests can't be run on windows because the windows version of +# These tests can't be run on windows because the windows version of # SQLite holds a mandatory exclusive lock on journal files it has open. # if {$tcl_platform(platform)!="windows"} { @@ -235,7 +235,7 @@ if {$tcl_platform(platform)=="unix"} { } } -# For test coverage: Cause an IO error during statement playback (i.e. +# For test coverage: Cause an IO error during statement playback (i.e. # a constraint). do_ioerr_test ioerr-10 -ckrefcount true -tclprep { execsql { @@ -273,7 +273,7 @@ do_ioerr_test ioerr-11 -ckrefcount true -erc 1 -sqlprep { } # Test that an io error encountered in a sync() caused by a call to -# sqlite3_release_memory() is handled Ok. Only try this if +# sqlite3_release_memory() is handled Ok. Only try this if # memory-management is enabled. # ifcapable memorymanage { @@ -287,7 +287,7 @@ ifcapable memorymanage { INSERT INTO t1 SELECT randstr(50,50), randstr(9,9), randstr(90,90) FROM t1; INSERT INTO t1 SELECT randstr(50,50), randstr(9,9), randstr(90,90) FROM t1; } -tclbody { - sqlite3_release_memory + sqlite3_release_memory } -sqlbody { COMMIT; } @@ -325,7 +325,7 @@ do_ioerr_test ioerr-12 -ckrefcount true -erc 1 -tclprep { # Create a test database. Page 2 is the root page of table t1. The only # row inserted into t1 has an overflow page - page 3. Page 3 will be # coresident on the 2048 byte sector with the next page to be allocated. - # + # db eval { PRAGMA page_size = 1024 } db eval { CREATE TABLE t1(x) } db eval { INSERT INTO t1 VALUES(randomblob(1100)); } @@ -430,7 +430,7 @@ do_ioerr_test ioerr-15 -tclprep { INSERT INTO t2 VALUES(randstr(22000,22000)); DELETE FROM t1 WHERE oid = 83; COMMIT; -} +} # This test verifies that IO errors that occur within the obscure branch # of code executed by tkt3762.test are correctly reported. diff --git a/third_party/sqlite/src/test/ioerr2.test b/third_party/sqlite/src/test/ioerr2.test index c08c3453f3077..62952aa5ebd28 100644 --- a/third_party/sqlite/src/test/ioerr2.test +++ b/third_party/sqlite/src/test/ioerr2.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing for correct handling of I/O errors # such as writes failing because the disk is full. -# +# # The tests in this file use special facilities that are only # available in the SQLite test fixture. # @@ -49,7 +49,7 @@ proc check_db {testname} { # Run an integrity-check. If "disk I/O error" is returned, the # pager must be in error state. In this case open a new database - # connection. Otherwise, try a ROLLBACK, in case a transaction + # connection. Otherwise, try a ROLLBACK, in case a transaction # is still active. set rc [catch {execsql {PRAGMA integrity_check}} msg] if {$rc && ($msg eq "disk I/O error" || $msg eq "database is locked")} { @@ -80,9 +80,9 @@ set sql { PRAGMA default_cache_size = 10; BEGIN; DELETE FROM t1 WHERE (oid%7)==0; - INSERT INTO t1 SELECT randstr(400,400), randstr(400,400) + INSERT INTO t1 SELECT randstr(400,400), randstr(400,400) WHERE (random()%7)==0; - UPDATE t1 SET a = randstr(400,400), b = randstr(400,400) + UPDATE t1 SET a = randstr(400,400), b = randstr(400,400) WHERE (random()%7)==0; ROLLBACK; } @@ -115,7 +115,7 @@ foreach bPersist [list 0 1] { # When this test was written, an IO error within the UPDATE statement caused # a rollback, which tripped all read-cursors, causing the outer SELECT to # fail with "abort due to ROLLBACK". Now, the loop continues until the UPDATE -# is run successfully. At this point the next IO error occurs within the +# is run successfully. At this point the next IO error occurs within the # SELECT - throwing the "disk I/O error" that the test case now expects. # do_test ioerr2-5 { diff --git a/third_party/sqlite/src/test/ioerr5.test b/third_party/sqlite/src/test/ioerr5.test index a430f53407420..4dfc66da78e98 100644 --- a/third_party/sqlite/src/test/ioerr5.test +++ b/third_party/sqlite/src/test/ioerr5.test @@ -10,7 +10,7 @@ #*********************************************************************** # # This file tests that if sqlite3_release_memory() is called to reclaim -# memory from a pager that is in the error-state, SQLite does not +# memory from a pager that is in the error-state, SQLite does not # incorrectly write dirty pages out to the database (not safe to do # once the pager is in error state). # @@ -34,7 +34,7 @@ set ::soft_limit [sqlite3_soft_heap_limit 1048576] # ("SQLITE_OK", "SQLITE_IOERR" etc.). The actual results returned by the # SQL statement, if it is a SELECT, are not available. # -# This can be useful for testing because it forces SQLite to make an extra +# This can be useful for testing because it forces SQLite to make an extra # call to sqlite3_malloc() when translating from the supplied UTF-16 to # the UTF-8 encoding used internally. # @@ -83,7 +83,7 @@ foreach locking_mode {normal exclusive} { opendatabases execsql { pragma locking_mode=exclusive } set nRow [db one {SELECT count(*) FROM a}] - + # Dirty (at least) one of the pages in the cache. do_test ioerr5-1.$locking_mode-$iFail.1 { execsql { @@ -93,14 +93,14 @@ foreach locking_mode {normal exclusive} { } {} # Open a read-only cursor on table "a". If the COMMIT below is - # interrupted by a persistent IO error, the pager will transition to + # interrupted by a persistent IO error, the pager will transition to # PAGER_ERROR state. If there are no other read-only cursors open, - # from there the pager immediately discards all cached data and + # from there the pager immediately discards all cached data and # switches to PAGER_OPEN state. This read-only cursor stops that # from happening, leaving the pager stuck in PAGER_ERROR state. # set channel [db incrblob -readonly a Name [db last_insert_rowid]] - + # Now try to commit the transaction. Cause an IO error to occur # within this operation, which moves the pager into the error state. # @@ -113,7 +113,7 @@ foreach locking_mode {normal exclusive} { set ::sqlite_io_error_hit 0 set ::sqlite_io_error_persist 0 set ::sqlite_io_error_pending 0 - + # Read the contents of the database file into a Tcl variable. # set fd [open test.db] @@ -121,7 +121,7 @@ foreach locking_mode {normal exclusive} { set zDatabase [read $fd] close $fd - # Set a very low soft-limit and then try to compile an SQL statement + # Set a very low soft-limit and then try to compile an SQL statement # from UTF-16 text. To do this, SQLite will need to reclaim memory # from the pager that is in error state. Including that associated # with the dirty page. @@ -172,7 +172,7 @@ foreach locking_mode {exclusive normal} { opendatabases execsql { pragma locking_mode=exclusive } set nRow [db one {SELECT count(*) FROM a}] - + do_test ioerr5-2.$locking_mode-$iFail.1 { execsql { BEGIN EXCLUSIVE; diff --git a/third_party/sqlite/src/test/join.test b/third_party/sqlite/src/test/join.test index 2b6951213fe58..9bce1bac92845 100644 --- a/third_party/sqlite/src/test/join.test +++ b/third_party/sqlite/src/test/join.test @@ -24,7 +24,7 @@ do_test join-1.1 { INSERT INTO t1 VALUES(2,3,4); INSERT INTO t1 VALUES(3,4,5); SELECT * FROM t1; - } + } } {1 2 3 2 3 4 3 4 5} do_test join-1.2 { execsql { @@ -33,7 +33,7 @@ do_test join-1.2 { INSERT INTO t2 VALUES(2,3,4); INSERT INTO t2 VALUES(3,4,5); SELECT * FROM t2; - } + } } {1 2 3 2 3 4 3 4 5} # A FROM clause of the form: "
        ,
        ON " is not @@ -189,7 +189,7 @@ do_test join-1.12 { ifcapable subquery { do_test join-1.13 { execsql2 { - SELECT * FROM t1 NATURAL JOIN + SELECT * FROM t1 NATURAL JOIN (SELECT b as 'c', c as 'd', d as 'e' FROM t2) as t3 } } {a 1 b 2 c 3 d 4 e 5} @@ -208,7 +208,7 @@ do_test join-1.15 { INSERT INTO t3 VALUES(3,4,5); INSERT INTO t3 VALUES(4,5,6); SELECT * FROM t3; - } + } } {2 3 4 3 4 5 4 5 6} do_test join-1.16 { execsql { @@ -227,7 +227,7 @@ do_test join-1.18 { INSERT INTO t4 VALUES(3,4,5); INSERT INTO t4 VALUES(4,5,6); SELECT * FROM t4; - } + } } {2 3 4 3 4 5 4 5 6} do_test join-1.19.1 { execsql { @@ -474,10 +474,10 @@ do_test join-8.1 { INSERT INTO t9 VALUES(2,22); CREATE TABLE t10(x INTEGER PRIMARY KEY, y); INSERT INTO t10 VALUES(1,2); - INSERT INTO t10 VALUES(3,3); + INSERT INTO t10 VALUES(3,3); CREATE TABLE t11(p INTEGER PRIMARY KEY, q); INSERT INTO t11 VALUES(2,111); - INSERT INTO t11 VALUES(3,333); + INSERT INTO t11 VALUES(3,333); CREATE VIEW v10_11 AS SELECT x, q FROM t10, t11 WHERE t10.y=t11.p; COMMIT; SELECT * FROM t9 LEFT JOIN v10_11 ON( a=x ); @@ -563,7 +563,7 @@ ifcapable subquery { CREATE INDEX i22 ON t22(q); SELECT a FROM t21 LEFT JOIN t22 ON b=p WHERE q= (SELECT max(m.q) FROM t22 m JOIN t21 n ON n.b=m.p WHERE n.c=1); - } + } } {} # Test a LEFT JOIN when the right-hand side of hte join is an empty diff --git a/third_party/sqlite/src/test/join2.test b/third_party/sqlite/src/test/join2.test index 9372e770c33c4..df0602642a975 100644 --- a/third_party/sqlite/src/test/join2.test +++ b/third_party/sqlite/src/test/join2.test @@ -24,7 +24,7 @@ do_test join2-1.1 { INSERT INTO t1 VALUES(2,22); INSERT INTO t1 VALUES(3,33); SELECT * FROM t1; - } + } } {1 11 2 22 3 33} do_test join2-1.2 { execsql { @@ -33,7 +33,7 @@ do_test join2-1.2 { INSERT INTO t2 VALUES(33,333); INSERT INTO t2 VALUES(44,444); SELECT * FROM t2; - } + } } {11 111 33 333 44 444}; do_test join2-1.3 { execsql { @@ -42,7 +42,7 @@ do_test join2-1.3 { INSERT INTO t3 VALUES(444,4444); INSERT INTO t3 VALUES(555,5555); SELECT * FROM t3; - } + } } {111 1111 444 4444 555 5555} do_test join2-1.4 { diff --git a/third_party/sqlite/src/test/join4.test b/third_party/sqlite/src/test/join4.test index 77db25ffb0282..704ac33f66ca5 100644 --- a/third_party/sqlite/src/test/join4.test +++ b/third_party/sqlite/src/test/join4.test @@ -26,7 +26,7 @@ ifcapable tempdb { insert into t1 values(2,'two'); insert into t1 values(3,'three'); insert into t1 values(4,'four'); - + create temp table t2(x integer, y varchar(10), z varchar(10)); insert into t2 values(2,'niban','ok'); insert into t2 values(4,'yonban','err'); @@ -43,7 +43,7 @@ ifcapable tempdb { insert into t1 values(2,'two'); insert into t1 values(3,'three'); insert into t1 values(4,'four'); - + create table t2(x integer, y varchar(10), z varchar(10)); insert into t2 values(2,'niban','ok'); insert into t2 values(4,'yonban','err'); diff --git a/third_party/sqlite/src/test/join6.test b/third_party/sqlite/src/test/join6.test index 7fbf508e57f6a..fd7bca7132096 100644 --- a/third_party/sqlite/src/test/join6.test +++ b/third_party/sqlite/src/test/join6.test @@ -36,7 +36,7 @@ do_test join6-1.1 { } {1 2} do_test join6-1.2 { execsql { - SELECT t1.a, t3.b + SELECT t1.a, t3.b FROM t1 LEFT JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.a=t3.a; } } {1 {}} @@ -86,15 +86,15 @@ do_test join6-3.1 { CREATE TABLE t1(a,x,y); INSERT INTO t1 VALUES(1,91,92); INSERT INTO t1 VALUES(2,93,94); - + CREATE TABLE t2(b,y,z); INSERT INTO t2 VALUES(3,92,93); INSERT INTO t2 VALUES(4,94,95); - + CREATE TABLE t3(c,x,z); INSERT INTO t3 VALUES(5,91,93); INSERT INTO t3 VALUES(6,99,95); - + SELECT * FROM t1 NATURAL JOIN t2 NATURAL JOIN t3; } } {1 91 92 3 93 5} diff --git a/third_party/sqlite/src/test/journal2.test b/third_party/sqlite/src/test/journal2.test index 7cbe0ef2c5bf6..4d2a9ab83d152 100644 --- a/third_party/sqlite/src/test/journal2.test +++ b/third_party/sqlite/src/test/journal2.test @@ -51,7 +51,7 @@ proc journal_op_catcher {method filename args} { # if {[info exists ::tvfs_error_on_write]} { if {[lsearch {xDelete xWrite xTruncate} $method]>=0} { - return SQLITE_IOERR + return SQLITE_IOERR } } @@ -90,7 +90,7 @@ do_test journal2-1.1 { } {xOpen test.db-journal xClose test.db-journal xDelete test.db-journal} do_test journal2-1.2 { set ::oplog [list] - execsql { + execsql { PRAGMA journal_mode = truncate; INSERT INTO t1 VALUES(1, 2); } @@ -148,10 +148,10 @@ do_test journal2-1.11 { # modified before the transaction is committed. # # Then, enable simulated IO errors in all calls to xDelete, xWrite -# and xTruncate before committing the transaction and closing the +# and xTruncate before committing the transaction and closing the # database file. From the point of view of other file-system users, it # appears as if the process hosting [db2] unexpectedly exited. -# +# do_test journal2-1.12 { sqlite3 db2 test.db execsql { @@ -212,7 +212,7 @@ if {[wal_is_capable]} { set ::oplog } {} do_test journal2-2.2 { - execsql { + execsql { CREATE TABLE t1(x); INSERT INTO t1 VALUES(3.14159); } diff --git a/third_party/sqlite/src/test/journal3.test b/third_party/sqlite/src/test/journal3.test index 939cc27c7084b..daaa1e3c52db4 100644 --- a/third_party/sqlite/src/test/journal3.test +++ b/third_party/sqlite/src/test/journal3.test @@ -17,7 +17,7 @@ source $testdir/lock_common.tcl source $testdir/malloc_common.tcl #------------------------------------------------------------------------- -# If a connection is required to create a journal file, it creates it with +# If a connection is required to create a journal file, it creates it with # the same file-system permissions as the database file itself. Test this. # if {$::tcl_platform(platform) == "unix"} { @@ -45,7 +45,7 @@ if {$::tcl_platform(platform) == "unix"} { do_test journal3-1.2.$tn.2 { file exists test.db-journal } {0} do_test journal3-1.2.$tn.3 { sqlite3 db test.db - execsql { + execsql { BEGIN; INSERT INTO tx DEFAULT VALUES; } diff --git a/third_party/sqlite/src/test/jrnlmode.test b/third_party/sqlite/src/test/jrnlmode.test index 2ba56f2b00a95..c68ecfe72e361 100644 --- a/third_party/sqlite/src/test/jrnlmode.test +++ b/third_party/sqlite/src/test/jrnlmode.test @@ -51,61 +51,61 @@ do_test jrnlmode-1.0 { PRAGMA journal_mode; PRAGMA main.journal_mode; PRAGMA temp.journal_mode; - } + } } [list delete delete [temp_journal_mode delete]] do_test jrnlmode-1.1 { execsql { PRAGMA journal_mode = persist; - } + } } {persist} do_test jrnlmode-1.2 { execsql { PRAGMA journal_mode; PRAGMA main.journal_mode; PRAGMA temp.journal_mode; - } + } } [list persist persist [temp_journal_mode persist]] do_test jrnlmode-1.4 { execsql { PRAGMA journal_mode = off; - } + } } {off} do_test jrnlmode-1.5 { execsql { PRAGMA journal_mode; PRAGMA main.journal_mode; PRAGMA temp.journal_mode; - } + } } [list off off [temp_journal_mode off]] do_test jrnlmode-1.6 { execsql { PRAGMA journal_mode = delete; - } + } } {delete} do_test jrnlmode-1.7 { execsql { PRAGMA journal_mode; PRAGMA main.journal_mode; PRAGMA Temp.journal_mode; - } + } } [list delete delete [temp_journal_mode delete]] do_test jrnlmode-1.7.1 { execsql { PRAGMA journal_mode = truncate; - } + } } {truncate} do_test jrnlmode-1.7.2 { execsql { PRAGMA journal_mode; PRAGMA main.journal_mode; PRAGMA temp.journal_mode; - } + } } [list truncate truncate [temp_journal_mode truncate]] do_test jrnlmode-1.8 { execsql { PRAGMA journal_mode = off; PRAGMA journal_mode = invalid; - } + } } {off off} ifcapable attach { do_test jrnlmode-1.9 { @@ -247,20 +247,20 @@ ifcapable attach { sqlite3 db test.db do_test jrnlmode-3.1 { - execsql { - CREATE TABLE x(n INTEGER); - ATTACH 'test2.db' AS a; - create table a.x ( n integer ); - insert into a.x values(1); - insert into a.x values (2); - insert into a.x values (3); - insert into a.x values (4); + execsql { + CREATE TABLE x(n INTEGER); + ATTACH 'test2.db' AS a; + create table a.x ( n integer ); + insert into a.x values(1); + insert into a.x values (2); + insert into a.x values (3); + insert into a.x values (4); } } {} - + do_test jrnlmode-3.2 { execsql { PRAGMA journal_mode=off; } - execsql { + execsql { BEGIN IMMEDIATE; INSERT OR IGNORE INTO main.x SELECT * FROM a.x; COMMIT; @@ -315,7 +315,7 @@ ifcapable pragma { execsql { PRAGMA journal_size_limit } } {-1} do_test jrnlmode-5.3 { - execsql { + execsql { ATTACH 'test2.db' AS aux; PRAGMA aux.journal_mode=persist; PRAGMA aux.journal_size_limit; @@ -361,15 +361,15 @@ ifcapable pragma { execsql { BEGIN; INSERT INTO t3 VALUES(randomblob(1000),randomblob(1000),randomblob(1000)); - INSERT INTO t3 + INSERT INTO t3 SELECT randomblob(1000),randomblob(1000),randomblob(1000) FROM t3; - INSERT INTO t3 + INSERT INTO t3 SELECT randomblob(1000),randomblob(1000),randomblob(1000) FROM t3; - INSERT INTO t3 + INSERT INTO t3 SELECT randomblob(1000),randomblob(1000),randomblob(1000) FROM t3; - INSERT INTO t3 + INSERT INTO t3 SELECT randomblob(1000),randomblob(1000),randomblob(1000) FROM t3; - INSERT INTO t3 + INSERT INTO t3 SELECT randomblob(1000),randomblob(1000),randomblob(1000) FROM t3; INSERT INTO t2 SELECT * FROM t3; INSERT INTO t1 SELECT * FROM t2; diff --git a/third_party/sqlite/src/test/jrnlmode2.test b/third_party/sqlite/src/test/jrnlmode2.test index 6ea87d704b3f8..d026e17e715cd 100644 --- a/third_party/sqlite/src/test/jrnlmode2.test +++ b/third_party/sqlite/src/test/jrnlmode2.test @@ -27,13 +27,13 @@ ifcapable {!pager_pragmas} { # In persistent journal mode, if: # # * There is a persistent journal in the file-system, AND -# * there exists a connection with a shared lock on the db file, +# * there exists a connection with a shared lock on the db file, # # then a second connection cannot open a read-transaction on the database. # The reason is because while determining that the persistent-journal is # not a hot-journal, SQLite currently grabs an exclusive lock on the # database file. If this fails because another connection has a shared -# lock, then SQLITE_BUSY is returned to the user. +# lock, then SQLITE_BUSY is returned to the user. # # jrnlmode2-2.*: Demonstrate bug #3751: # @@ -45,7 +45,7 @@ ifcapable {!pager_pragmas} { # attempts to obtain an exclusive lock on the database file (this is a # bug). The attempt to obtain an exclusive (write) lock on a read-only file # fails at the OS level. Under unix, fcntl() reports an EBADF - "Bad file -# descriptor" - error. +# descriptor" - error. # do_test jrnlmode2-1.1 { diff --git a/third_party/sqlite/src/test/jrnlmode3.test b/third_party/sqlite/src/test/jrnlmode3.test index 43da6579abc1c..572ad93db3a1a 100644 --- a/third_party/sqlite/src/test/jrnlmode3.test +++ b/third_party/sqlite/src/test/jrnlmode3.test @@ -112,7 +112,7 @@ foreach fromjmode $all_journal_modes { db eval "PRAGMA journal_mode=$tojmode" } $fromjmode - # Rollback the transaction. + # Rollback the transaction. # do_test jrnlmode3-3.$cnt.4 { db eval { diff --git a/third_party/sqlite/src/test/json101.test b/third_party/sqlite/src/test/json101.test index 37123eef1d7d0..6c7946ae659a3 100644 --- a/third_party/sqlite/src/test/json101.test +++ b/third_party/sqlite/src/test/json101.test @@ -326,7 +326,7 @@ do_execsql_test json-6.4 { # White-space tests. Note that form-feed is not white-space in JSON. # ticket [57eec374ae1d0a1d4a23077a95f4e173fe269113] -# +# foreach {tn isvalid ws} { 7.1 1 char(0x20) 7.2 1 char(0x09) diff --git a/third_party/sqlite/src/test/json102.test b/third_party/sqlite/src/test/json102.test index a4d88dbeaa09b..abf775f544003 100644 --- a/third_party/sqlite/src/test/json102.test +++ b/third_party/sqlite/src/test/json102.test @@ -283,7 +283,7 @@ do_execsql_test json102-1132 { } ;# end ifcapable vtab #------------------------------------------------------------------------- -# Test that json_valid() correctly identifies non-ascii range +# Test that json_valid() correctly identifies non-ascii range # characters as non-whitespace. # do_execsql_test json102-1201 { SELECT json_valid(char(32) || '"xyz"') } 1 diff --git a/third_party/sqlite/src/test/json103.test b/third_party/sqlite/src/test/json103.test index d7d12e3378259..d2cf317eb9de4 100644 --- a/third_party/sqlite/src/test/json103.test +++ b/third_party/sqlite/src/test/json103.test @@ -61,7 +61,7 @@ do_execsql_test json103-220 { } {0 {{"n3":3,"n6":6}} 1 {{"n1":1,"n4":4}} 2 {{"n2":2,"n5":5}}} # ticket https://www.sqlite.org/src/info/f45ac567eaa9f93c 2016-01-30 -# Invalid JSON generated by json_group_array() +# Invalid JSON generated by json_group_array() # # The underlying problem is a failure to reset Mem.eSubtype # diff --git a/third_party/sqlite/src/test/keyword1.test b/third_party/sqlite/src/test/keyword1.test index 2bc1ff5494f05..2f996b05c6e6a 100644 --- a/third_party/sqlite/src/test/keyword1.test +++ b/third_party/sqlite/src/test/keyword1.test @@ -91,7 +91,7 @@ set exprkw { current_timestamp raise } -foreach kw $kwlist { +foreach kw $kwlist { do_test keyword1-$kw.1 { if {$kw=="if"} { db eval "CREATE TABLE \"$kw\"($kw $kw)" diff --git a/third_party/sqlite/src/test/kvtest.c b/third_party/sqlite/src/test/kvtest.c index 4fa733f1a7baf..2e11e84db6917 100644 --- a/third_party/sqlite/src/test/kvtest.c +++ b/third_party/sqlite/src/test/kvtest.c @@ -60,7 +60,7 @@ ** ./kvtest run x1.db --count 10000 --max-id 1000000 ** ./kvtest run x1 --count 10000 --max-id 1000000 */ -static const char zHelp[] = +static const char zHelp[] = "Usage: kvtest COMMAND ARGS...\n" "\n" " kvtest init DBFILE --count N --size M --pagesize X\n" @@ -448,8 +448,8 @@ static int exportMain(int argc, char **argv){ /* ** Read the content of file zName into memory obtained from sqlite3_malloc64() -** and return a pointer to the buffer. The caller is responsible for freeing -** the memory. +** and return a pointer to the buffer. The caller is responsible for freeing +** the memory. ** ** If parameter pnByte is not NULL, (*pnByte) is set to the number of bytes ** read. @@ -648,7 +648,7 @@ static int runMain(int argc, char **argv){ unsigned char *pData = 0; /* Content of the blob */ int nAlloc = 0; /* Space allocated for pData[] */ const char *zJMode = 0; /* Journal mode */ - + assert( strcmp(argv[1],"run")==0 ); assert( argc>=3 ); @@ -800,7 +800,7 @@ static int runMain(int argc, char **argv){ }else{ /* CASE 3: Reading from database using SQL */ if( pStmt==0 ){ - rc = sqlite3_prepare_v2(db, + rc = sqlite3_prepare_v2(db, "SELECT v FROM kv WHERE k=?1", -1, &pStmt, 0); if( rc ){ fatalError("cannot prepare query: %s", sqlite3_errmsg(db)); diff --git a/third_party/sqlite/src/test/lastinsert.test b/third_party/sqlite/src/test/lastinsert.test index c5bc267d1a23e..7566fa7bd1a5b 100644 --- a/third_party/sqlite/src/test/lastinsert.test +++ b/third_party/sqlite/src/test/lastinsert.test @@ -166,7 +166,7 @@ do_test lastinsert-3.4 { # ---------------------------------------------------------------------------- # 4.x - tests with instead of insert trigger -# These may not be run if either views or triggers were disabled at +# These may not be run if either views or triggers were disabled at # compile-time ifcapable {view && trigger} { diff --git a/third_party/sqlite/src/test/laststmtchanges.test b/third_party/sqlite/src/test/laststmtchanges.test index ea4c3892b75d2..182826108523f 100644 --- a/third_party/sqlite/src/test/laststmtchanges.test +++ b/third_party/sqlite/src/test/laststmtchanges.test @@ -14,7 +14,7 @@ # Note 1: changes() remains constant within a statement and only updates # once the statement is finished (triggers count as part of # statement). -# Note 2: changes() is changed within the context of a trigger much like +# Note 2: changes() is changed within the context of a trigger much like # last_insert_rowid() (see lastinsert.test), but is restored once # the trigger exits. # Note 3: changes() is not changed by a change to a view (since everything @@ -131,7 +131,7 @@ do_test laststmtchanges-2.3 { # Total changes caused by firing the trigger above: # -# 1 from "insert into t1 values(77)" + +# 1 from "insert into t1 values(77)" + # 1 from "insert into t2 values (NULL, changes(), NULL);" + # 5 from "update t0 set x=x;" + # 1 from "update t2 set v2=changes();" diff --git a/third_party/sqlite/src/test/like.test b/third_party/sqlite/src/test/like.test index 8082b35123708..a0706cc18aa7f 100644 --- a/third_party/sqlite/src/test/like.test +++ b/third_party/sqlite/src/test/like.test @@ -152,7 +152,7 @@ do_test like-2.4 { ifcapable !like_opt { finish_test return -} +} # This procedure executes the SQL. Then it appends to the result the # "sort" or "nosort" keyword (as in the cksort procedure above) then @@ -176,7 +176,7 @@ proc queryplan {sql} { lappend data $tab * } } - return $data + return $data } # Perform tests on the like optimization. @@ -504,7 +504,7 @@ do_test like-5.18 { # when constructing the comparison. Example: "ab" becomes "ac". # In other words, the last character is increased by one. # -# Make sure this happens correctly when the last character is a +# Make sure this happens correctly when the last character is a # "z" and we are doing case-insensitive comparisons. # # Ticket #2959 diff --git a/third_party/sqlite/src/test/limit.test b/third_party/sqlite/src/test/limit.test index d72749770c574..407cb60f718cb 100644 --- a/third_party/sqlite/src/test/limit.test +++ b/third_party/sqlite/src/test/limit.test @@ -109,7 +109,7 @@ ifcapable subquery { } do_test limit-4.1 { - ifcapable subquery { + ifcapable subquery { execsql { BEGIN; CREATE TABLE t3(x); @@ -330,7 +330,7 @@ do_test limit-7.11 { } {31} do_test limit-7.12 { execsql { - SELECT a+27 FROM t6 INTERSECT SELECT x FROM t2 + SELECT a+27 FROM t6 INTERSECT SELECT x FROM t2 ORDER BY 1 DESC LIMIT 1 OFFSET 1; } } {30} @@ -475,7 +475,7 @@ do_test limit-12.4 { } {1 {no such column: x}} # Ticket [db4d96798da8b] -# LIMIT does not work with nested views containing UNION ALL +# LIMIT does not work with nested views containing UNION ALL # do_test limit-13.1 { db eval { diff --git a/third_party/sqlite/src/test/loadext.test b/third_party/sqlite/src/test/loadext.test index 24ee7a6802d11..a234e22b28edd 100644 --- a/third_party/sqlite/src/test/loadext.test +++ b/third_party/sqlite/src/test/loadext.test @@ -82,7 +82,7 @@ if {![file exists $testextension]} { set cmdline [concat exec gcc $gcc_shared] lappend cmdline -Wall -I$srcdir -I. -I.. -g $testextsrc -o $testextension - + if {[catch $cmdline msg]} { puts "Skipping loadext tests: Test extension not built..." puts $msg @@ -175,7 +175,7 @@ do_test loadext-2.3 { list $rc $msg } /[list 1 [format $dlerror_nosymbol $testextension icecream]]/ -# Try to load an extension for which the entry point fails (returns non-zero) +# Try to load an extension for which the entry point fails (returns non-zero) # do_test loadext-2.4 { set rc [catch { diff --git a/third_party/sqlite/src/test/lock.test b/third_party/sqlite/src/test/lock.test index 534aa3b9a44aa..cbb7818d2fb6c 100644 --- a/third_party/sqlite/src/test/lock.test +++ b/third_party/sqlite/src/test/lock.test @@ -393,7 +393,7 @@ do_test lock-6.1 { } {} do_test lock-6.2 { - execsql { + execsql { BEGIN; INSERT INTO t4 VALUES(1, 'one'); INSERT INTO t4 VALUES(2, 'two'); @@ -416,13 +416,13 @@ do_test lock-6.5 { sqlite3_finalize $STMT } {SQLITE_OK} -# At one point the following set of conditions would cause SQLite to +# At one point the following set of conditions would cause SQLite to # retain a RESERVED or EXCLUSIVE lock after the transaction was committed: -# +# # * The journal-mode is set to something other than 'delete', and # * there exists one or more active read-only statements, and # * a transaction that modified zero database pages is committed. -# +# #set temp_status unlocked #if {$TEMP_STORE>=2} {set temp_status unknown} set temp_status unknown diff --git a/third_party/sqlite/src/test/lock2.test b/third_party/sqlite/src/test/lock2.test index ea2e5573a9c10..97925d106a30e 100644 --- a/third_party/sqlite/src/test/lock2.test +++ b/third_party/sqlite/src/test/lock2.test @@ -27,7 +27,7 @@ source $testdir/lock_common.tcl # lock2-1.4: Try for a RESERVED lock with process 2. This fails. # lock2-1.5: Try to upgrade the first process to EXCLUSIVE, this fails so # it gets PENDING. -# lock2-1.6: Release the SHARED lock held by the second process. +# lock2-1.6: Release the SHARED lock held by the second process. # lock2-1.7: Attempt to reaquire a SHARED lock with the second process. # this fails due to the PENDING lock. # lock2-1.8: Ensure the first process can now upgrade to EXCLUSIVE. @@ -81,7 +81,7 @@ do_test lock2-1.7 { catch { db eval { BEGIN; SELECT * FROM sqlite_master; - } } msg + } } msg set msg } } {database is locked} diff --git a/third_party/sqlite/src/test/lock4.test b/third_party/sqlite/src/test/lock4.test index b0b1c74fbec61..3eaf050a040d4 100644 --- a/third_party/sqlite/src/test/lock4.test +++ b/third_party/sqlite/src/test/lock4.test @@ -44,14 +44,14 @@ do_test lock4-1.1 { # 4. Commit the change to test2.db. # # Meanwhile, this process will: -# +# # A. Get an exclusive lock on test.db # B. Attempt to read from test2.db but get an SQLITE_BUSY error. # C. Commit the changes to test.db thus alloing the other process # to continue. # do_test lock4-1.2 { - + # Create a script for the second process to run. # set out [open test2-script.tcl w] @@ -100,9 +100,9 @@ do_test lock4-1.3 { while {[file exists test2.db-journal]} { after 10 } - # The other process has committed its transaction on test2.db by - # deleting the journal file. But it might retain the lock for a - # fraction longer + # The other process has committed its transaction on test2.db by + # deleting the journal file. But it might retain the lock for a + # fraction longer # after 25 db2 eval { @@ -110,7 +110,7 @@ do_test lock4-1.3 { } } {2} - + do_test lock4-999.1 { rename db2 {} } {} diff --git a/third_party/sqlite/src/test/lock5.test b/third_party/sqlite/src/test/lock5.test index 99214afb19b48..d146a1301bc39 100644 --- a/third_party/sqlite/src/test/lock5.test +++ b/third_party/sqlite/src/test/lock5.test @@ -167,7 +167,7 @@ do_test lock5-none.3 { execsql { SELECT * FROM t1; } db2 } {1 2} do_test lock5-none.4 { - execsql { + execsql { BEGIN; SELECT * FROM t1; } db2 diff --git a/third_party/sqlite/src/test/lock6.test b/third_party/sqlite/src/test/lock6.test index b47d18f7a9acf..c64ffab535633 100644 --- a/third_party/sqlite/src/test/lock6.test +++ b/third_party/sqlite/src/test/lock6.test @@ -39,7 +39,7 @@ proc testfixture {chan cmd} { set r "" while { 1 } { set line [gets $chan] - if { $line == "OVER" } { + if { $line == "OVER" } { return $r } append r $line @@ -94,7 +94,7 @@ ifcapable lock_proxy_pragmas&&prefer_proxy_locking { set ::tf1 [launch_testfixture] testfixture $::tf1 "sqlite3_test_control_pending_byte $::sqlite_pending_byte" testfixture $::tf1 { - set sqlite_hostid_num 2 + set sqlite_hostid_num 2 sqlite3 db test.db -key xyzzy set lockpath [db eval { PRAGMA lock_proxy_file=":auto:"; @@ -104,8 +104,8 @@ ifcapable lock_proxy_pragmas&&prefer_proxy_locking { string match "*test.db:auto:" $lockpath } } {1} - - set sqlite_hostid_num 3 + + set sqlite_hostid_num 3 do_test lock6-1.2 { execsql {pragma lock_status} } {main unlocked temp closed} @@ -114,7 +114,7 @@ ifcapable lock_proxy_pragmas&&prefer_proxy_locking { do_test lock6-1.3 { list [catch { sqlite3 db test.db - execsql { select * from sqlite_master } + execsql { select * from sqlite_master } } msg] $msg } {1 {database is locked}} @@ -138,7 +138,7 @@ ifcapable lock_proxy_pragmas&&prefer_proxy_locking { PRAGMA lock_proxy_file; } db } {notmine} - + do_test lock6-1.5 { testfixture $::tf1 { db eval { @@ -156,12 +156,12 @@ ifcapable lock_proxy_pragmas&&prefer_proxy_locking { select * from sqlite_master; } db } {} - + catch {close $::tf1} set env(SQLITE_FORCE_PROXY_LOCKING) $using_proxy set sqlite_hostid_num 0 sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit) } - + finish_test diff --git a/third_party/sqlite/src/test/lock_common.tcl b/third_party/sqlite/src/test/lock_common.tcl index a758e7af2e4d5..d6efafb441794 100644 --- a/third_party/sqlite/src/test/lock_common.tcl +++ b/third_party/sqlite/src/test/lock_common.tcl @@ -30,9 +30,9 @@ proc do_multiclient_test {varname script} { faultsim_delete_and_reopen proc code1 {tcl} { uplevel #0 $tcl } - + # Open connections [db2] and [db3]. Depending on which iteration this - # is, the connections may be created in this interpreter, or in + # is, the connections may be created in this interpreter, or in # interpreters running in other OS processes. As such, the [db2] and [db3] # commands should only be accessed within [code2] and [code3] blocks, # respectively. @@ -40,14 +40,14 @@ proc do_multiclient_test {varname script} { eval $code code2 { sqlite3 db2 test.db } code3 { sqlite3 db3 test.db } - - # Shorthand commands. Execute SQL using database connection [db2] or + + # Shorthand commands. Execute SQL using database connection [db2] or # [db3]. Return the results. # proc sql1 {sql} { db eval $sql } proc sql2 {sql} { code2 [list db2 eval $sql] } proc sql3 {sql} { code3 [list db3 eval $sql] } - + proc csql1 {sql} { list [catch { sql1 $sql } msg] $msg } proc csql2 {sql} { list [catch { sql2 $sql } msg] $msg } proc csql3 {sql} { list [catch { sql3 $sql } msg] $msg } @@ -74,7 +74,7 @@ proc launch_testfixture {{prg ""}} { if {[file tail $prg]==$prg} { set prg [file join . $prg] } set chan [open "|$prg tf_main.tcl" r+] fconfigure $chan -buffering line - set rc [catch { + set rc [catch { testfixture $chan "sqlite3_test_control_pending_byte $::sqlite_pending_byte" }] if {$rc} { @@ -96,7 +96,7 @@ proc testfixture {chan cmd args} { set r "" while { 1 } { set line [gets $chan] - if { $line == "OVER" } { + if { $line == "OVER" } { set res [lindex $r 1] if { [lindex $r 0] } { error $res } return $res diff --git a/third_party/sqlite/src/test/lookaside.test b/third_party/sqlite/src/test/lookaside.test index a89110ee1d7bf..5a57b62f6df42 100644 --- a/third_party/sqlite/src/test/lookaside.test +++ b/third_party/sqlite/src/test/lookaside.test @@ -21,7 +21,7 @@ ifcapable !lookaside { return } -# The tests in this file configure the lookaside allocator after a +# The tests in this file configure the lookaside allocator after a # connection is opened. This will not work if there is any "presql" # configured (SQL run within the [sqlite3] wrapper in tester.tcl). if {[info exists ::G(perm:presql)]} { diff --git a/third_party/sqlite/src/test/main.test b/third_party/sqlite/src/test/main.test index 9346cf6ced4e5..05c8834573571 100644 --- a/third_party/sqlite/src/test/main.test +++ b/third_party/sqlite/src/test/main.test @@ -204,7 +204,7 @@ ifcapable {trigger} { ifcapable {explain} { do_test main-1.27.5 { db complete { - EXPLAIN + EXPLAIN CREATE TEMP TRIGGER xyz AFTER DELETE backend BEGIN UPDATE pqr SET a=5; } @@ -310,7 +310,7 @@ if {[permutation] == ""} { } {0 {}} } -# Here are some tests for tokenize.c. +# Here are some tests for tokenize.c. # do_test main-3.1 { catch {db close} @@ -474,31 +474,31 @@ do_test main-3.6 { # The following test-case tests the linked list code used to manage # sqlite3_vfs structures. -if {$::tcl_platform(platform)=="unix" +if {$::tcl_platform(platform)=="unix" && [info command sqlite3async_initialize]!=""} { ifcapable threadsafe { do_test main-4.1 { sqlite3_crash_enable 1 sqlite3_crash_enable 0 - + sqlite3async_initialize "" 1 sqlite3async_shutdown - + sqlite3_crash_enable 1 sqlite3async_initialize "" 1 sqlite3_crash_enable 0 sqlite3async_shutdown - + sqlite3_crash_enable 1 sqlite3async_initialize "" 1 sqlite3async_shutdown sqlite3_crash_enable 0 - + sqlite3async_initialize "" 1 sqlite3_crash_enable 1 sqlite3_crash_enable 0 sqlite3async_shutdown - + sqlite3async_initialize "" 1 sqlite3_crash_enable 1 sqlite3async_shutdown @@ -534,5 +534,5 @@ if {[info exists ::env(TEST_FAILURE)]} { set x 123 } $res } - + finish_test diff --git a/third_party/sqlite/src/test/malloc.test b/third_party/sqlite/src/test/malloc.test index dbf4699b2794a..316267dfc210f 100644 --- a/third_party/sqlite/src/test/malloc.test +++ b/third_party/sqlite/src/test/malloc.test @@ -9,8 +9,8 @@ # #*********************************************************************** # -# This file attempts to check the behavior of the SQLite library in -# an out-of-memory situation. When compiled with -DSQLITE_DEBUG=1, +# This file attempts to check the behavior of the SQLite library in +# an out-of-memory situation. When compiled with -DSQLITE_DEBUG=1, # the SQLite library accepts a special command (sqlite3_memdebug_fail N C) # which causes the N-th malloc to fail. This special feature is used # to see what happens in the library if a malloc were to really fail @@ -62,7 +62,7 @@ ifcapable bloblit&&subquery { DELETE FROM t1 WHERE a IN (SELECT min(a) FROM t1); SELECT count(*), group_concat(e) FROM t1; SELECT b FROM t1 ORDER BY 1 COLLATE nocase; - } + } } # Ensure that no file descriptors were leaked. @@ -90,7 +90,7 @@ ifcapable subquery { DELETE FROM t1 WHERE a>=10; DROP INDEX i1; DELETE FROM t1; - } + } } # Ensure that no file descriptors were leaked. @@ -114,7 +114,7 @@ do_malloc_test 3 -sqlbody { DROP INDEX i1; DELETE FROM t1; ROLLBACK; -} +} # Ensure that no file descriptors were leaked. @@ -140,7 +140,7 @@ ifcapable subquery { DROP INDEX i1; DELETE FROM t1; COMMIT; - } + } } # Ensure that no file descriptors were leaked. @@ -164,7 +164,7 @@ ifcapable trigger { END; INSERT INTO t1(a,b) VALUES(2,3); COMMIT; - } + } } # Ensure that no file descriptors were leaked. @@ -192,7 +192,7 @@ ifcapable vacuum { COMMIT; } -sqlbody { VACUUM; - } + } } autoinstall_test_functions @@ -211,11 +211,11 @@ do_malloc_test 7 -sqlprep { # This block is designed to test that some malloc failures that may # occur in vdbeapi.c. Specifically, if a malloc failure that occurs # when converting UTF-16 text to integers and real numbers is handled -# correctly. +# correctly. # # This is done by retrieving a string from the database engine and -# manipulating it using the sqlite3_column_*** APIs. This doesn't -# actually return an error to the user when a malloc() fails.. That +# manipulating it using the sqlite3_column_*** APIs. This doesn't +# actually return an error to the user when a malloc() fails.. That # could be viewed as a bug. # # These tests only run if UTF-16 support is compiled in. @@ -266,7 +266,7 @@ do_malloc_test 9 -sqlprep { COMMIT; } -# This block tests malloc() failures that occur while opening a +# This block tests malloc() failures that occur while opening a # connection to a database. do_malloc_test 10 -tclprep { catch {db2 close} @@ -302,7 +302,7 @@ do_malloc_test 12 -tclbody { sqlite3_finalize $::STMT } -# Test malloc errors when replaying two hot journals from a 2-file +# Test malloc errors when replaying two hot journals from a 2-file # transaction. ifcapable crashtest&&attach { do_malloc_test 13 -tclprep { @@ -320,7 +320,7 @@ ifcapable crashtest&&attach { } -tclbody { db eval {ATTACH 'test2.db' as aux;} set rc [catch {db eval { - SELECT * FROM t1; + SELECT * FROM t1; SELECT * FROM t2; }} err] if {$rc && $err!="no such table: t1"} { @@ -363,7 +363,7 @@ proc string_compare {a b} { return [string compare $a $b] } -# Test for malloc() failures in sqlite3_create_collation() and +# Test for malloc() failures in sqlite3_create_collation() and # sqlite3_create_collation16(). # ifcapable utf16 { @@ -373,10 +373,10 @@ ifcapable utf16 { if {$msg=="SQLITE_NOMEM"} {set msg "out of memory"} error $msg } - + db complete {SELECT "hello """||'world"' [microsoft], * FROM anicetable;} db complete {-- Useful comment} - + execsql { CREATE TABLE t1(a, b COLLATE string_compare); INSERT INTO t1 VALUES(10, 'string'); @@ -402,7 +402,7 @@ ifcapable utf16 { do_malloc_test 17 -tclbody { set DB2 0 set STMT 0 - + # open database using sqlite3_open16() set filename [encoding convertto unicode test.db] append filename "\x00\x00" @@ -411,7 +411,7 @@ ifcapable utf16 { error "out of memory" } sqlite3_extended_result_codes $DB2 1 - + # Prepare statement set rc [catch {sqlite3_prepare $DB2 {SELECT * FROM sqlite_master} -1 X} msg] if {[sqlite3_errcode $DB2] eq "SQLITE_IOERR+12"} { @@ -424,14 +424,14 @@ ifcapable utf16 { error [string range $msg 4 end] } set STMT $msg - + # Finalize statement set rc [sqlite3_finalize $STMT] if {$rc!="SQLITE_OK"} { error [sqlite3_errmsg $DB2] } set STMT 0 - + # Close database set rc [sqlite3_close $DB2] if {$rc!="SQLITE_OK"} { @@ -465,8 +465,8 @@ ifcapable utf16 { } # This test is aimed at coverage testing. Specificly, it is supposed to -# cause a malloc() only used when converting between the two utf-16 -# encodings to fail (i.e. little-endian->big-endian). It only actually +# cause a malloc() only used when converting between the two utf-16 +# encodings to fail (i.e. little-endian->big-endian). It only actually # hits this malloc() on little-endian hosts. # set static_string "\x00h\x00e\x00l\x00l\x00o" @@ -514,7 +514,7 @@ ifcapable attach { ATTACH DATABASE 'test2.db' AS t2; SELECT * FROM t1; DETACH DATABASE t2; - } + } } # Test malloc failure whilst installing a foreign key. @@ -522,7 +522,7 @@ ifcapable attach { ifcapable foreignkey { do_malloc_test 21 -sqlbody { CREATE TABLE abc(a, b, c, FOREIGN KEY(a) REFERENCES abc(b)) - } + } } # Test malloc failure in an sqlite3_prepare_v2() call. @@ -553,21 +553,21 @@ ifcapable {pager_pragmas} { BEGIN; CREATE TABLE abc(a, b, c); CREATE INDEX abc_i ON abc(a, b, c); - INSERT INTO abc + INSERT INTO abc VALUES(randstr(100,100), randstr(100,100), randstr(100,100)); - INSERT INTO abc + INSERT INTO abc SELECT randstr(100,100), randstr(100,100), randstr(100,100) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randstr(100,100), randstr(100,100), randstr(100,100) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randstr(100,100), randstr(100,100), randstr(100,100) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randstr(100,100), randstr(100,100), randstr(100,100) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randstr(100,100), randstr(100,100), randstr(100,100) FROM abc; COMMIT; } - + # This puts the pager into error state. # db eval BEGIN @@ -631,8 +631,8 @@ do_malloc_test 25 -sqlprep { # The database set up by -sqlprep script contains a single table B-Tree # of height 2. In the -tclbody script, the existing database connection # is closed and a new one opened and used to insert a new row into the -# table B-Tree. By using a new connection, the outcome of a malloc() -# failure while seeking to the right-hand side of the B-Tree to insert +# table B-Tree. By using a new connection, the outcome of a malloc() +# failure while seeking to the right-hand side of the B-Tree to insert # a new record can be tested. # do_malloc_test 26 -sqlprep { @@ -726,11 +726,11 @@ do_malloc_test 31 -sqlprep { } # When written, this test provoked an obscure change-counter bug. -# +# # If, when running in exclusive mode, a malloc() failure occurs # after the database file change-counter has been written but # before the transaction has been committed, then the transaction -# is automatically rolled back. However, internally the +# is automatically rolled back. However, internally the # Pager.changeCounterDone flag was being left set. This means # that if the same connection attempts another transaction following # the malloc failure and rollback, the change counter will not @@ -754,13 +754,13 @@ do_malloc_test 32 -tclprep { # into the second connections pager cache. # sqlite3 db2 test.db - db2 eval { + db2 eval { PRAGMA locking_mode = normal; SELECT b FROM t1; } } -tclbody { - # Running in exclusive mode, perform a database transaction that + # Running in exclusive mode, perform a database transaction that # modifies both the database table and index. For iterations where # the malloc failure occurs after updating the change counter but # before committing the transaction, this should result in the @@ -775,7 +775,7 @@ do_malloc_test 32 -tclprep { # then this should result in the database contents being updated but # the change-counter left as it is. # - db eval { + db eval { PRAGMA locking_mode = normal; UPDATE t1 SET a = a + 3; } @@ -857,8 +857,8 @@ if {[db eval {PRAGMA locking_mode}]!="exclusive"} { SELECT * FROM t1; } -cleanup { # Try to write to the database using connection [db2]. If connection [db] - # has correctly released the shared lock, this write attempt should - # succeed. If [db] has not released the lock, this should hit an + # has correctly released the shared lock, this write attempt should + # succeed. If [db] has not released the lock, this should hit an # SQLITE_BUSY error. do_test malloc-36.$zRepeat.${::n}.unlocked { execsql {INSERT INTO t1 VALUES(3, 4)} db2 @@ -899,7 +899,7 @@ do_faultsim_test 40.3 -faults oom-trans* -body { SELECT * FROM t1 ORDER BY 1 COLLATE utf16bin; } } -test { - faultsim_test_result {0 {abcde fghij klmno pqrst uvwxy}} + faultsim_test_result {0 {abcde fghij klmno pqrst uvwxy}} faultsim_integrity_check } diff --git a/third_party/sqlite/src/test/malloc3.test b/third_party/sqlite/src/test/malloc3.test index f4a6c3bbe9087..66e58b5b1b566 100644 --- a/third_party/sqlite/src/test/malloc3.test +++ b/third_party/sqlite/src/test/malloc3.test @@ -47,7 +47,7 @@ if {[permutation]=="inmemory_journal"} { #-------------------------------------------------------------------------- # NOTES ON RECOVERING FROM A MALLOC FAILURE -# +# # The tests in this file test the behaviours described in the following # paragraphs. These tests test the behaviour of the system when malloc() fails # inside of a call to _prepare(), _step(), _finalize() or _reset(). The @@ -147,7 +147,7 @@ if {[permutation]=="inmemory_journal"} { # # If a transaction has been automatically rolled back, then the driver # program executes all the SQL specified as part of SQL or PREP primitives -# between the current SQL statement and the most recent "BEGIN". Any +# between the current SQL statement and the most recent "BEGIN". Any # TEST block immediately proceeding the SQL statement is evaluated, and # then the SQL statement reexecuted with the incremented N value. # @@ -193,7 +193,7 @@ proc SQL {a1 {a2 ""}} { } # TEST_AUTOCOMMIT -- -# +# # A shorthand test to see if a transaction is active or not. The first # argument - $id - is the integer number of the test case. The second # argument is either 1 or 0, the expected value of the auto-commit flag. @@ -216,8 +216,8 @@ TEST 1 { execsql {SELECT tbl_name FROM sqlite_master;} } {} } -SQL { - CREATE TABLE IF NOT EXISTS abc(a, b, c); +SQL { + CREATE TABLE IF NOT EXISTS abc(a, b, c); } TEST 2 { do_test $testid.1 { @@ -297,7 +297,7 @@ TEST 6 { do_test $testid.2 { execsql { SELECT min( - (oid == a) AND 'String value ' || a == b AND a == length(c) + (oid == a) AND 'String value ' || a == b AND a == length(c) ) FROM abc; } } {1} @@ -312,7 +312,7 @@ TEST 7 { do_test $testid { execsql { SELECT min( - (oid == a) AND 'String value ' || a == b AND a == length(c) + (oid == a) AND 'String value ' || a == b AND a == length(c) ) FROM abc; } } {1} @@ -327,7 +327,7 @@ TEST 9 { do_test $testid { execsql { SELECT min( - (oid == a) AND 'String value ' || a == b AND a == length(c) + (oid == a) AND 'String value ' || a == b AND a == length(c) ) FROM abc; } } {1} @@ -481,7 +481,7 @@ TEST 29 { } {a b c a b c 1 2 3 1 2 3} } -# Test a simple multi-file transaction +# Test a simple multi-file transaction # forcedelete test2.db ifcapable attach { @@ -519,12 +519,12 @@ TEST 32 { } } SQL BEGIN -TEST 33 { +TEST 33 { do_test $testid { execsql {SELECT * FROM ghi} } {a b c 1 2 3} } -SQL -norollback { +SQL -norollback { -- There is a unique index on ghi(g), so this statement may not cause -- an automatic ROLLBACK. Hence the "-norollback" switch. INSERT INTO ghi SELECT '2'||g, h, i FROM ghi; @@ -557,7 +557,7 @@ proc run_test {arglist iRepeat {pcstart 0} {iFailStart 1}} { -prep {db eval $v2} -debug {eval $v2} } - set nac [sqlite3_get_autocommit $::DB] ;# New Auto-Commit + set nac [sqlite3_get_autocommit $::DB] ;# New Auto-Commit if {$ac && !$nac} {set begin_pc $i} } @@ -575,7 +575,7 @@ proc run_test {arglist iRepeat {pcstart 0} {iFailStart 1}} { switch -- $k { - -test { + -test { foreach {id script} $v {} set testid "malloc3-(test $id).$iterid" eval $script @@ -591,7 +591,7 @@ proc run_test {arglist iRepeat {pcstart 0} {iFailStart 1}} { set ac [sqlite3_get_autocommit $::DB] ;# Auto-Commit sqlite3_memdebug_fail $iFail -repeat 0 set rc [catch {db eval [lindex $v 2]} msg] ;# True error occurs - set nac [sqlite3_get_autocommit $::DB] ;# New Auto-Commit + set nac [sqlite3_get_autocommit $::DB] ;# New Auto-Commit if {$rc != 0 && $nac && !$ac} { # Before [db eval] the auto-commit flag was clear. Now it @@ -608,7 +608,7 @@ proc run_test {arglist iRepeat {pcstart 0} {iFailStart 1}} { # Successful execution of sql. The number of failed malloc() # calls should be equal to the number of benign failures. # Otherwise a malloc() failed and the error was not reported. - # + # set expr {$nFail!=$nBenign} if {[expr $expr]} { error "Unreported malloc() failure, test \"$testid\", $expr" @@ -619,7 +619,7 @@ proc run_test {arglist iRepeat {pcstart 0} {iFailStart 1}} { # is clear. We can deduce that a "BEGIN" statement has just # been successfully executed. set begin_pc $pc - } + } incr pc set iFail 1 diff --git a/third_party/sqlite/src/test/malloc5.test b/third_party/sqlite/src/test/malloc5.test index 8114005e8b70b..93840d37b31ff 100644 --- a/third_party/sqlite/src/test/malloc5.test +++ b/third_party/sqlite/src/test/malloc5.test @@ -9,11 +9,11 @@ # #*********************************************************************** # -# This file contains test cases focused on the two memory-management APIs, +# This file contains test cases focused on the two memory-management APIs, # sqlite3_soft_heap_limit() and sqlite3_release_memory(). # # Prior to version 3.6.2, calling sqlite3_release_memory() or exceeding -# the configured soft heap limit could cause sqlite to upgrade database +# the configured soft heap limit could cause sqlite to upgrade database # locks and flush dirty pages to the file system. As of 3.6.2, this is # no longer the case. In version 3.6.2, sqlite3_release_memory() only # reclaims clean pages. This test file has been updated accordingly. @@ -67,7 +67,7 @@ do_test malloc5-1.2 { execsql {PRAGMA cache_size=2; SELECT * FROM sqlite_master } db2 } {} do_test malloc5-1.3 { - # Call [sqlite3_release_memory] when there is exactly one unused page + # Call [sqlite3_release_memory] when there is exactly one unused page # in the cache belonging to db2. # set ::pgalloc [sqlite3_release_memory] @@ -112,7 +112,7 @@ do_test malloc5-1.5 { } [value_in_range $::pgalloc $::mrange] do_test malloc5-1.6 { - # Manipulate the cache so that it contains two unused pages. One requires + # Manipulate the cache so that it contains two unused pages. One requires # a journal-sync to free, the other does not. db2 close execsql { @@ -124,7 +124,7 @@ do_test malloc5-1.6 { } [value_in_range $::pgalloc $::mrange] do_test malloc5-1.7 { - # Database should not be locked this time. + # Database should not be locked this time. sqlite3 db2 test.db catchsql { SELECT * FROM abc } db2 } {0 {}} @@ -147,7 +147,7 @@ do_test malloc5-1.9 { } {} do_test malloc5-2.1 { - # Put some data in tables abc and def. Both tables are still wholly + # Put some data in tables abc and def. Both tables are still wholly # contained within their root pages. execsql { INSERT INTO abc VALUES(1, 2, 3); @@ -157,13 +157,13 @@ do_test malloc5-2.1 { } } {} do_test malloc5-2.2 { - # Load the root-page for table def into the cache. Then query table abc. + # Load the root-page for table def into the cache. Then query table abc. # Halfway through the query call sqlite3_release_memory(). The goal of this - # test is to make sure we don't free pages that are in use (specifically, + # test is to make sure we don't free pages that are in use (specifically, # the root of table abc). sqlite3_release_memory set nRelease 0 - execsql { + execsql { BEGIN; SELECT * FROM def; } @@ -202,17 +202,17 @@ do_test malloc5-3.2 { db2 close puts "Highwater mark: [sqlite3_memory_highwater]" -# The following two test cases each execute a transaction in which +# The following two test cases each execute a transaction in which # 10000 rows are inserted into table abc. The first test case is used # to ensure that more than 1MB of dynamic memory is used to perform -# the transaction. +# the transaction. # # The second test case sets the "soft-heap-limit" to 100,000 bytes (0.1 MB) -# and tests to see that this limit is not exceeded at any point during +# and tests to see that this limit is not exceeded at any point during # transaction execution. # -# Before executing malloc5-4.* we save the value of the current soft heap -# limit in variable ::soft_limit. The original value is restored after +# Before executing malloc5-4.* we save the value of the current soft heap +# limit in variable ::soft_limit. The original value is restored after # running the tests. # set ::soft_limit [sqlite3_soft_heap_limit -1] @@ -312,20 +312,20 @@ do_test malloc5-6.1.1 { BEGIN; CREATE TABLE abc(a PRIMARY KEY, b, c); INSERT INTO abc VALUES(randstr(50,50), randstr(75,75), randstr(100,100)); - INSERT INTO abc + INSERT INTO abc SELECT randstr(50,50), randstr(75,75), randstr(100,100) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randstr(50,50), randstr(75,75), randstr(100,100) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randstr(50,50), randstr(75,75), randstr(100,100) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randstr(50,50), randstr(75,75), randstr(100,100) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randstr(50,50), randstr(75,75), randstr(100,100) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randstr(50,50), randstr(75,75), randstr(100,100) FROM abc; COMMIT; - } + } forcecopy test.db test2.db sqlite3 db2 test2.db db2 eval {PRAGMA cache_size=2} @@ -366,14 +366,14 @@ do_test malloc5-6.3.1 { # btree layer holds a reference to page 1 in the db2 cache. execsql { BEGIN; - UPDATE abc SET c = randstr(100,100) + UPDATE abc SET c = randstr(100,100) WHERE rowid = 1 OR rowid = (SELECT max(rowid) FROM abc); } db2 execsql { SELECT * FROM abc } db expr [nPage db] + [nPage db2] } {4} do_test malloc5-6.3.2 { - # Try to release 7700 bytes. This should release all the + # Try to release 7700 bytes. This should release all the # non-dirty pages held by db2. sqlite3_release_memory [expr 7*1132] list [nPage db] [nPage db2] diff --git a/third_party/sqlite/src/test/malloc6.test b/third_party/sqlite/src/test/malloc6.test index ded3d1e63347d..e61320274a56b 100644 --- a/third_party/sqlite/src/test/malloc6.test +++ b/third_party/sqlite/src/test/malloc6.test @@ -44,7 +44,7 @@ do_malloc_test malloc6-1 -tclprep { primary key(a,b,c) ); DROP TABLE IF EXISTS t1; -} +} # Ensure that no file descriptors were leaked. do_test malloc6-1.X { diff --git a/third_party/sqlite/src/test/malloc7.test b/third_party/sqlite/src/test/malloc7.test index 3e301c8018efd..17e3662a2e64b 100644 --- a/third_party/sqlite/src/test/malloc7.test +++ b/third_party/sqlite/src/test/malloc7.test @@ -35,7 +35,7 @@ do_malloc_test malloc7-1 -sqlprep { set nbyte [string length $sql16] set ::STMT [sqlite3_prepare16 db $sql16 $nbyte DUMMY] sqlite3_finalize $::STMT -} +} # Ensure that no file descriptors were leaked. diff --git a/third_party/sqlite/src/test/malloc8.test b/third_party/sqlite/src/test/malloc8.test index 9192eaf512dde..fa1ea7b477856 100644 --- a/third_party/sqlite/src/test/malloc8.test +++ b/third_party/sqlite/src/test/malloc8.test @@ -27,7 +27,7 @@ if {!$MEMDEBUG} { # The setup is a database with UTF-16 encoding that contains a single -# large string. We will be running lots of queries against this +# large string. We will be running lots of queries against this # database. Because we will be extracting the string as UTF-8, there # is a type conversion that occurs and thus an opportunity for malloc() # to fail and for sqlite3_value_text() to return 0 even though @@ -37,7 +37,7 @@ if {!$MEMDEBUG} { do_malloc_test malloc8-1 -sqlprep { PRAGMA encoding='UTF-16'; CREATE TABLE t1(a); - INSERT INTO t1 + INSERT INTO t1 VALUES('0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ'); } -sqlbody { SELECT lower(a), upper(a), quote(a), trim(a), trim('x',a) FROM t1; @@ -45,7 +45,7 @@ do_malloc_test malloc8-1 -sqlprep { do_malloc_test malloc8-2 -sqlprep { PRAGMA encoding='UTF-16'; CREATE TABLE t1(a); - INSERT INTO t1 + INSERT INTO t1 VALUES('0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ'); } -sqlbody { SELECT replace(a,'x','y'), replace('x',a,'y'), replace('x','y',a) @@ -54,7 +54,7 @@ do_malloc_test malloc8-2 -sqlprep { do_malloc_test malloc8-3 -sqlprep { PRAGMA encoding='UTF-16'; CREATE TABLE t1(a); - INSERT INTO t1 + INSERT INTO t1 VALUES('0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ'); } -sqlbody { SELECT length(a), substr(a, 4, 4) FROM t1; @@ -63,7 +63,7 @@ ifcapable datetime { do_malloc_test malloc8-4 -sqlprep { PRAGMA encoding='UTF-16'; CREATE TABLE t1(a); - INSERT INTO t1 + INSERT INTO t1 VALUES('0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ'); } -sqlbody { SELECT julianday(a,a) FROM t1; @@ -72,7 +72,7 @@ ifcapable datetime { do_malloc_test malloc8-5 -sqlprep { PRAGMA encoding='UTF-16'; CREATE TABLE t1(a); - INSERT INTO t1 + INSERT INTO t1 VALUES('0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ'); } -sqlbody { SELECT 1 FROM t1 WHERE a LIKE 'hello' ESCAPE NULL; @@ -80,7 +80,7 @@ do_malloc_test malloc8-5 -sqlprep { do_malloc_test malloc8-6 -sqlprep { PRAGMA encoding='UTF-16'; CREATE TABLE t1(a); - INSERT INTO t1 + INSERT INTO t1 VALUES('0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ'); } -sqlbody { SELECT hex(randomblob(100)); diff --git a/third_party/sqlite/src/test/mallocA.test b/third_party/sqlite/src/test/mallocA.test index a78073d833c29..e2c896008758d 100644 --- a/third_party/sqlite/src/test/mallocA.test +++ b/third_party/sqlite/src/test/mallocA.test @@ -100,13 +100,13 @@ ifcapable stat3 { do_test 6.3-prep { execsql { PRAGMA writable_schema = 1; - CREATE TABLE sqlite_stat4 AS - SELECT tbl, idx, neq, nlt, ndlt, sqlite_record(sample) AS sample + CREATE TABLE sqlite_stat4 AS + SELECT tbl, idx, neq, nlt, ndlt, sqlite_record(sample) AS sample FROM sqlite_stat3; } } {} do_faultsim_test 6.3 -faults oom* -body { - execsql { + execsql { ANALYZE sqlite_master; SELECT rowid FROM t1 WHERE a='abc' AND b<'y'; } diff --git a/third_party/sqlite/src/test/mallocC.test b/third_party/sqlite/src/test/mallocC.test index 7943353cc7562..2b083310820e9 100644 --- a/third_party/sqlite/src/test/mallocC.test +++ b/third_party/sqlite/src/test/mallocC.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This file tests aspects of the malloc failure while parsing # CREATE TABLE statements in auto_vacuum mode. # @@ -37,7 +37,7 @@ proc do_mallocC_test {tn args} { sqlite3_memdebug_fail $::n -repeat 1 do_test mallocC-$tn.$::n.1 { set res [catchsql [string trim $::mallocopts(-sql)]] - set rc [expr { + set rc [expr { 0==[string compare $res {1 {out of memory}}] || [db errorcode] == 3082 || 0==[lindex $res 0] @@ -104,7 +104,7 @@ if {0} { do_mallocC_test 1 -sql { BEGIN; - -- Allocate 32 new root pages. This will exercise the 'extract specific + -- Allocate 32 new root pages. This will exercise the 'extract specific -- page from the freelist' code when in auto-vacuum mode (see the -- allocatePage() routine in btree.c). CREATE TABLE t1(a UNIQUE, b UNIQUE, c UNIQUE); diff --git a/third_party/sqlite/src/test/mallocD.test b/third_party/sqlite/src/test/mallocD.test index 08a2ba439967a..346cf0b122997 100644 --- a/third_party/sqlite/src/test/mallocD.test +++ b/third_party/sqlite/src/test/mallocD.test @@ -27,12 +27,12 @@ db close sqlite3_simulate_device -char atomic sqlite3 db test.db -vfs devsym -set PREP { +set PREP { PRAGMA page_size = 1024; CREATE TABLE abc(a, b, c); } -do_malloc_test mallocD-1 -sqlprep $PREP -sqlbody { +do_malloc_test mallocD-1 -sqlprep $PREP -sqlbody { INSERT INTO abc VALUES(1, 2, 3); } diff --git a/third_party/sqlite/src/test/mallocE.test b/third_party/sqlite/src/test/mallocE.test index e87bc8b3afc3b..92a5b8a08675e 100644 --- a/third_party/sqlite/src/test/mallocE.test +++ b/third_party/sqlite/src/test/mallocE.test @@ -10,7 +10,7 @@ #*********************************************************************** # # This test script checks that tickets #2784 and #2789 have been fixed. -# +# # $Id: mallocE.test,v 1.3 2008/02/18 22:24:58 drh Exp $ set testdir [file dirname $argv0] @@ -27,19 +27,19 @@ if {!$MEMDEBUG} { # ticket #2784 # -set PREP { +set PREP { PRAGMA page_size = 1024; CREATE TABLE t1(a, b, c); CREATE TABLE t2(x, y, z); } -do_malloc_test mallocE-1 -sqlprep $PREP -sqlbody { +do_malloc_test mallocE-1 -sqlprep $PREP -sqlbody { SELECT p, q FROM (SELECT a+b AS p, b+c AS q FROM t1, t2 WHERE c>5) LEFT JOIN t2 ON p=x; } # Ticket #2789 # -do_malloc_test mallocE-2 -sqlprep $PREP -sqlbody { +do_malloc_test mallocE-2 -sqlprep $PREP -sqlbody { SELECT x, y2 FROM (SELECT a+b AS x, b+c AS y2 FROM t1, t2 WHERE c>5) LEFT JOIN t2 USING(x) WHERE y2>11; } diff --git a/third_party/sqlite/src/test/mallocF.test b/third_party/sqlite/src/test/mallocF.test index 0015005fec91a..536fc59bd40cd 100644 --- a/third_party/sqlite/src/test/mallocF.test +++ b/third_party/sqlite/src/test/mallocF.test @@ -11,7 +11,7 @@ # # This test script checks that tickets #2794, #2795, #2796, and #2797 # have been fixed. -# +# # $Id: mallocF.test,v 1.4 2008/02/18 22:24:58 drh Exp $ set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/mallocG.test b/third_party/sqlite/src/test/mallocG.test index 4f2395db9cdf1..62d66e31b9c44 100644 --- a/third_party/sqlite/src/test/mallocG.test +++ b/third_party/sqlite/src/test/mallocG.test @@ -10,7 +10,7 @@ #*********************************************************************** # # This test script checks malloc failures in various obscure operations. -# +# # $Id: mallocG.test,v 1.5 2008/08/01 18:47:02 drh Exp $ set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/mallocH.test b/third_party/sqlite/src/test/mallocH.test index 7017b381ab1d8..a8ab2b73752cd 100644 --- a/third_party/sqlite/src/test/mallocH.test +++ b/third_party/sqlite/src/test/mallocH.test @@ -10,7 +10,7 @@ #*********************************************************************** # # This test script checks malloc failures in various obscure operations. -# +# # $Id: mallocH.test,v 1.2 2008/08/01 20:10:09 drh Exp $ set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/mallocI.test b/third_party/sqlite/src/test/mallocI.test index ee4a603dee177..eb5accde8fe8a 100644 --- a/third_party/sqlite/src/test/mallocI.test +++ b/third_party/sqlite/src/test/mallocI.test @@ -10,7 +10,7 @@ #*********************************************************************** # # This test script checks malloc failures in various obscure operations. -# +# # $Id: mallocI.test,v 1.3 2009/08/10 04:26:39 danielk1977 Exp $ set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/mallocJ.test b/third_party/sqlite/src/test/mallocJ.test index e63f6b794a7e5..9903dbc17de98 100644 --- a/third_party/sqlite/src/test/mallocJ.test +++ b/third_party/sqlite/src/test/mallocJ.test @@ -9,9 +9,9 @@ # #*********************************************************************** # -# This test script checks malloc failures in LIMIT operations for +# This test script checks malloc failures in LIMIT operations for # UPDATE/DELETE statements. -# +# # $Id: mallocJ.test,v 1.6 2009/01/09 02:49:32 drh Exp $ set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/mallocK.test b/third_party/sqlite/src/test/mallocK.test index 45ee7905c3adf..3b220290710b8 100644 --- a/third_party/sqlite/src/test/mallocK.test +++ b/third_party/sqlite/src/test/mallocK.test @@ -10,7 +10,7 @@ #*********************************************************************** # # This test script checks malloc failures in WHERE clause analysis. -# +# # $Id: mallocK.test,v 1.3 2009/01/08 21:00:03 drh Exp $ set testdir [file dirname $argv0] @@ -122,7 +122,7 @@ ifcapable stat4 { do_eqp_test 6.1 { SELECT DISTINCT c FROM t3 WHERE b BETWEEN '.xx..' AND '.xxxx'; } { - 0 0 0 {SEARCH TABLE t3 USING INDEX i3 (ANY(a) AND b>? AND b? AND b, is used as a prefix of the test names # taken by tests executed by this command. Options are as follows. All @@ -363,7 +363,7 @@ proc do_one_faultsim_test {testname args} { eval $O(-prep) # Start the fault-injection. Run the -body script. Stop the fault - # injection. Local var $nfail is set to the total number of faults + # injection. Local var $nfail is set to the total number of faults # injected into the system this trial. # eval $O(-injectstart) $iFail @@ -414,7 +414,7 @@ proc do_one_faultsim_test {testname args} { # successfully, the loop ends. # proc do_malloc_test {tn args} { - array unset ::mallocopts + array unset ::mallocopts array set ::mallocopts $args if {[string is integer $tn]} { @@ -438,7 +438,7 @@ proc do_malloc_test {tn args} { for {set ::n $start} {$::go && $::n <= $end} {incr ::n} { # If $::iRepeat is 0, then the malloc() failure is transient - it - # fails and then subsequent calls succeed. If $::iRepeat is 1, + # fails and then subsequent calls succeed. If $::iRepeat is 1, # then the failure is persistent - once malloc() fails it keeps # failing. # @@ -448,13 +448,13 @@ proc do_malloc_test {tn args} { foreach file [glob -nocomplain test.db-mj*] {forcedelete $file} do_test ${tn}.${zRepeat}.${::n} { - - # Remove all traces of database files test.db and test2.db - # from the file-system. Then open (empty database) "test.db" + + # Remove all traces of database files test.db and test2.db + # from the file-system. Then open (empty database) "test.db" # with the handle [db]. - # - catch {db close} - catch {db2 close} + # + catch {db close} + catch {db2 close} forcedelete test.db forcedelete test.db-journal forcedelete test.db-wal @@ -469,7 +469,7 @@ proc do_malloc_test {tn args} { sqlite3_extended_result_codes db 1 } sqlite3_db_config_lookaside db 0 0 0 - + # Execute any -tclprep and -sqlprep scripts. # if {[info exists ::mallocopts(-tclprep)]} { @@ -478,8 +478,8 @@ proc do_malloc_test {tn args} { if {[info exists ::mallocopts(-sqlprep)]} { execsql $::mallocopts(-sqlprep) } - - # Now set the ${::n}th malloc() to fail and execute the -tclbody + + # Now set the ${::n}th malloc() to fail and execute the -tclbody # and -sqlbody scripts. # sqlite3_memdebug_fail $::n -repeat $::iRepeat @@ -515,7 +515,7 @@ proc do_malloc_test {tn args} { } elseif {!$isFail} { set v2 $msg } elseif { - [info command db]=="" || + [info command db]=="" || [db errorcode]==7 || $msg=="out of memory" } { @@ -526,7 +526,7 @@ proc do_malloc_test {tn args} { } lappend isFail $v2 } {1 1} - + if {[info exists ::mallocopts(-cleanup)]} { catch [list uplevel #0 $::mallocopts(-cleanup)] msg } @@ -573,7 +573,7 @@ proc do_error_test {name sql error} { proc doPassiveTest {isRestart name sql catchres} { if {![info exists ::DO_MALLOC_TEST]} { set ::DO_MALLOC_TEST 1 } - if {[info exists ::testprefix] + if {[info exists ::testprefix] && [string is integer [string range $name 0 0]] } { set name $::testprefix.$name @@ -630,7 +630,7 @@ proc doPassiveTest {isRestart name sql catchres} { #------------------------------------------------------------------------- -# Test a single write to the database. In this case a "write" is a +# Test a single write to the database. In this case a "write" is a # DELETE, UPDATE or INSERT statement. # # If OOM testing is performed, there are several acceptable outcomes: diff --git a/third_party/sqlite/src/test/manydb.test b/third_party/sqlite/src/test/manydb.test index 974a5b8ebe7b8..327453e4dc68b 100644 --- a/third_party/sqlite/src/test/manydb.test +++ b/third_party/sqlite/src/test/manydb.test @@ -29,7 +29,7 @@ foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] { set num_fd_per_openwrite_db 3 if {$using_proxy>0} { set num_fd_per_openwrite_db 5 -} +} # First test how many file descriptors are available for use. To open a # database for writing SQLite requires 3 file descriptors (the database, the diff --git a/third_party/sqlite/src/test/mem5.test b/third_party/sqlite/src/test/mem5.test index 6365f1c64b290..a70fefa436006 100644 --- a/third_party/sqlite/src/test/mem5.test +++ b/third_party/sqlite/src/test/mem5.test @@ -20,7 +20,7 @@ ifcapable !mem5 { return } -# The tests in this file configure the lookaside allocator after a +# The tests in this file configure the lookaside allocator after a # connection is opened. This will not work if there is any "presql" # configured (SQL run within the [sqlite3] wrapper in tester.tcl). if {[info exists ::G(perm:presql)]} { diff --git a/third_party/sqlite/src/test/memdb.test b/third_party/sqlite/src/test/memdb.test index 7bad26f526b5e..77274be0ac59a 100644 --- a/third_party/sqlite/src/test/memdb.test +++ b/third_party/sqlite/src/test/memdb.test @@ -49,7 +49,7 @@ do_test memdb-1.1 { } {1024} # The following procedure computes a "signature" for table "t3". If -# T3 changes in any way, the signature should change. +# T3 changes in any way, the signature should change. # # This is used to test ROLLBACK. We gather a signature for t3, then # make lots of changes to t3, then rollback and take another signature. @@ -181,7 +181,7 @@ foreach {i conf cmd t0 t1 t2} { DELETE FROM t2; INSERT INTO t1 VALUES(1,2,3); BEGIN $conf; - INSERT INTO t2 VALUES(1); + INSERT INTO t2 VALUES(1); $cmd INTO t1 VALUES(1,2,4); }]} r1] catch {execsql {COMMIT}} @@ -290,7 +290,7 @@ do_test memdb-6.5 { SELECT a FROM t2 UNION SELECT b FROM t2 ORDER BY 1; } } {1 2 3 4 5} -} ;# ifcapable compound +} ;# ifcapable compound do_test memdb-6.6 { execsql { CREATE INDEX i2 ON t2(c); @@ -406,7 +406,7 @@ do_test memdb-8.2 { } 0 # Test that auto-vacuum works with in-memory databases. -# +# ifcapable autovacuum { do_test memdb-9.1 { db close diff --git a/third_party/sqlite/src/test/memleak.test b/third_party/sqlite/src/test/memleak.test index a24a901f50748..433131e53b7a2 100644 --- a/third_party/sqlite/src/test/memleak.test +++ b/third_party/sqlite/src/test/memleak.test @@ -44,7 +44,7 @@ set EXCLUDE { crash.test autovacuum_crash.test } -# Test files btree2.test and btree4.test don't work if the +# Test files btree2.test and btree4.test don't work if the # SQLITE_DEFAULT_AUTOVACUUM macro is defined to true (because they depend # on tables being allocated starting at page 2). # @@ -54,7 +54,7 @@ ifcapable default_autovacuum { } if {[sqlite3 -has-codec]} { - # lappend EXCLUDE + # lappend EXCLUDE } if {[llength $argv]>0} { set FILELIST $argv diff --git a/third_party/sqlite/src/test/memsubsys2.test b/third_party/sqlite/src/test/memsubsys2.test index 68e4e22d323c8..22ba6b3b6bcba 100644 --- a/third_party/sqlite/src/test/memsubsys2.test +++ b/third_party/sqlite/src/test/memsubsys2.test @@ -124,7 +124,7 @@ do_test memsubsys2-3.8 { do_test memsubsys2-3.9 { sqlite3_free 0 } {} - + # Test 4: Verify that turning on memstatus reenables the statistics # tracking. @@ -168,7 +168,7 @@ do_test memsubsys2-4.10 { do_test memsubsys2-4.11 { sqlite3_memory_used } {0} - + diff --git a/third_party/sqlite/src/test/minmax3.test b/third_party/sqlite/src/test/minmax3.test index 483fa612d27d4..dee0c4918fd07 100644 --- a/third_party/sqlite/src/test/minmax3.test +++ b/third_party/sqlite/src/test/minmax3.test @@ -27,7 +27,7 @@ proc count sql { # This procedure sets the value of the file-format in file 'test.db' # to $newval. Also, the schema cookie is incremented. -# +# proc set_file_format {newval} { hexio_write test.db 44 [hexio_render_int32 $newval] set schemacookie [hexio_get_int [hexio_read test.db 40 4]] diff --git a/third_party/sqlite/src/test/minmax4.test b/third_party/sqlite/src/test/minmax4.test index 8063538bfd770..dfcf0d811a3c8 100644 --- a/third_party/sqlite/src/test/minmax4.test +++ b/third_party/sqlite/src/test/minmax4.test @@ -9,11 +9,11 @@ # #*********************************************************************** # -# Test for queries of the form: +# Test for queries of the form: # # SELECT p, max(q) FROM t1; # -# Demonstration that the value returned for p is on the same row as +# Demonstration that the value returned for p is on the same row as # the maximum q. # diff --git a/third_party/sqlite/src/test/misc1.test b/third_party/sqlite/src/test/misc1.test index e646bfd09804c..45165f9ce8f59 100644 --- a/third_party/sqlite/src/test/misc1.test +++ b/third_party/sqlite/src/test/misc1.test @@ -20,7 +20,7 @@ source $testdir/tester.tcl # Mimic the SQLite 2 collation type NUMERIC. db collate numeric numeric_collate proc numeric_collate {lhs rhs} { - if {$lhs == $rhs} {return 0} + if {$lhs == $rhs} {return 0} return [expr ($lhs>$rhs)?1:-1] } @@ -432,7 +432,7 @@ do_test misc1-12.13 { } {1 4 4} # There was a problem with realloc() in the OP_MemStore operation of -# the VDBE. A buffer was being reallocated but some pointers into +# the VDBE. A buffer was being reallocated but some pointers into # the old copy of the buffer were not being moved over to the new copy. # The following code tests for the problem. # @@ -574,7 +574,7 @@ do_test misc1-17.1 { CREATE TABLE RealTable(TestID INTEGER PRIMARY KEY, TestString TEXT); CREATE TEMP TABLE TempTable(TestID INTEGER PRIMARY KEY, TestString TEXT); CREATE TEMP TRIGGER trigTest_1 AFTER UPDATE ON TempTable BEGIN - INSERT INTO RealTable(TestString) + INSERT INTO RealTable(TestString) SELECT new.TestString FROM TempTable LIMIT 1; END; INSERT INTO TempTable(TestString) VALUES ('1'); @@ -694,7 +694,7 @@ do_catchsql_test misc1-23.3 { } {0 {}} -# At one point, running this would read one byte passed the end of a +# At one point, running this would read one byte passed the end of a # buffer, upsetting valgrind. # do_test misc1-24.0 { diff --git a/third_party/sqlite/src/test/misc2.test b/third_party/sqlite/src/test/misc2.test index bb544c5fbb578..1b074f3e3e2d6 100644 --- a/third_party/sqlite/src/test/misc2.test +++ b/third_party/sqlite/src/test/misc2.test @@ -21,7 +21,7 @@ source $testdir/tester.tcl # The tests in this file were written before SQLite supported recursive # trigger invocation, and some tests depend on that to pass. So disable # recursive triggers for this file. -catchsql { pragma recursive_triggers = off } +catchsql { pragma recursive_triggers = off } ifcapable {trigger} { # Test for ticket #360 @@ -132,7 +132,7 @@ ifcapable view { do_test misc2-5.1 { execsql { CREATE TABLE x(a,b); - CREATE VIEW y AS + CREATE VIEW y AS SELECT x1.b AS p, x2.b AS q FROM x AS x1, x AS x2 WHERE x1.a=x2.a; CREATE VIEW z AS SELECT y1.p, y2.p FROM y AS y1, y AS y2 WHERE y1.q=y2.q; @@ -258,7 +258,7 @@ ifcapable tclvar { } execsql {SELECT * FROM t1} } {1 2 3 4 5 6 7 8 9 10} - + # Repeat the tests 7.1 through 7.8 about but this time do the SELECTs # in reverse order so that we exercise the sqlite3BtreePrev() routine # instead of sqlite3BtreeNext() @@ -363,7 +363,7 @@ ifcapable tclvar { db close forcedelete test.db sqlite3 db test.db -catchsql { pragma recursive_triggers = off } +catchsql { pragma recursive_triggers = off } # Ticket #453. If the SQL ended with "-", the tokenizer was calling that # an incomplete token, which caused problem. The solution was to just call @@ -386,12 +386,12 @@ ifcapable tempdb { INSERT INTO counts SELECT n+4 FROM counts; INSERT INTO counts SELECT n+8 FROM counts; COMMIT; - + CREATE TEMP TABLE x AS SELECT dim1.n, dim2.n, dim3.n FROM counts AS dim1, counts AS dim2, counts AS dim3 WHERE dim1.n<10 AND dim2.n<10 AND dim3.n<10; - + SELECT count(*) FROM x; } } {1000} @@ -402,7 +402,7 @@ ifcapable tempdb { SELECT dim1.n, dim2.n, dim3.n FROM counts AS dim1, counts AS dim2, counts AS dim3 WHERE dim1.n>=6 AND dim2.n>=6 AND dim3.n>=6; - + SELECT count(*) FROM x; } } {1000} @@ -413,7 +413,7 @@ ifcapable tempdb { SELECT dim1.n, dim2.n, dim3.n, dim4.n FROM counts AS dim1, counts AS dim2, counts AS dim3, counts AS dim4 WHERE dim1.n<5 AND dim2.n<5 AND dim3.n<5 AND dim4.n<5; - + SELECT count(*) FROM x; } } [expr 5*5*5*5] diff --git a/third_party/sqlite/src/test/misc4.test b/third_party/sqlite/src/test/misc4.test index 79e756ec631bb..eda26bb708964 100644 --- a/third_party/sqlite/src/test/misc4.test +++ b/third_party/sqlite/src/test/misc4.test @@ -60,7 +60,7 @@ ifcapable tempdb { SELECT * FROM temp.t2; } } {1} - + # Drop the temporary table, then rerun the prepared statement to # recreate it again. This recreates ticket #807. # @@ -99,14 +99,14 @@ do_test misc4-2.4 { # Ticket #966 # do_test misc4-3.1 { - execsql { + execsql { CREATE TABLE Table1(ID integer primary key, Value TEXT); INSERT INTO Table1 VALUES(1, 'x'); CREATE TABLE Table2(ID integer NOT NULL, Value TEXT); INSERT INTO Table2 VALUES(1, 'z'); INSERT INTO Table2 VALUES (1, 'a'); } - catchsql { + catchsql { SELECT ID, max(Value) FROM Table2 GROUP BY 1, 2 ORDER BY 1, 2; } } {1 {aggregate functions are not allowed in the GROUP BY clause}} @@ -119,14 +119,14 @@ ifcapable compound { } } {1 x 1 z} do_test misc4-3.3 { - catchsql { + catchsql { SELECT ID, Value FROM Table1 UNION SELECT ID, max(Value) FROM Table2 GROUP BY 1, 2 ORDER BY 1, 2; } } {1 {aggregate functions are not allowed in the GROUP BY clause}} do_test misc4-3.4 { - catchsql { + catchsql { SELECT ID, max(Value) FROM Table2 GROUP BY 1, 2 UNION SELECT ID, Value FROM Table1 ORDER BY 1, 2; @@ -143,12 +143,12 @@ ifcapable subquery { create table b(key varchar, period integer); insert into a values('01','data01'); insert into a values('+1','data+1'); - + insert into b values ('01',1); insert into b values ('01',2); insert into b values ('+1',3); insert into b values ('+1',4); - + select a.*, x.* from a, (select key,sum(period) from b group by key) as x where a.key=x.key order by 1 desc; @@ -180,7 +180,7 @@ ifcapable view { insert into t4 values (1,2); insert into t5 values (1,3); create view myview as select t4.a a from t4 inner join t5 on t4.a=t5.a; - create table problem as select * from myview; + create table problem as select * from myview; } execsql2 { select * FROM problem; diff --git a/third_party/sqlite/src/test/misc5.test b/third_party/sqlite/src/test/misc5.test index 0e7e34dd161c6..be1ca05d3679a 100644 --- a/third_party/sqlite/src/test/misc5.test +++ b/third_party/sqlite/src/test/misc5.test @@ -18,7 +18,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl -# Build records using the MakeRecord opcode such that the size of the +# Build records using the MakeRecord opcode such that the size of the # header is at the transition point in the size of a varint. # # This test causes an assertion failure or a buffer overrun in version @@ -473,36 +473,36 @@ ifcapable subquery { INSERT INTO songs VALUES(4,'three',5); INSERT INTO songs VALUES(5,'one',7); INSERT INTO songs VALUES(6,'two',11); - SELECT DISTINCT artist - FROM ( - SELECT DISTINCT artist - FROM songs - WHERE songid IN ( - SELECT songid - FROM songs - WHERE LOWER(artist) = ( + SELECT DISTINCT artist + FROM ( + SELECT DISTINCT artist + FROM songs + WHERE songid IN ( + SELECT songid + FROM songs + WHERE LOWER(artist) = ( -- This sub-query is indeterminate. Because there is no ORDER BY, -- it may return 'one', 'two' or 'three'. Because of this, the - -- outermost parent query may correctly return any of 'one', 'two' + -- outermost parent query may correctly return any of 'one', 'two' -- or 'three' as well. - SELECT DISTINCT LOWER(artist) - FROM ( + SELECT DISTINCT LOWER(artist) + FROM ( -- This sub-query returns the table: -- -- two 14 -- one 10 -- three 5 -- - SELECT DISTINCT artist,sum(timesplayed) AS total - FROM songs - GROUP BY LOWER(artist) - ORDER BY total DESC - LIMIT 10 - ) - WHERE artist <> '' - ) - ) - ) + SELECT DISTINCT artist,sum(timesplayed) AS total + FROM songs + GROUP BY LOWER(artist) + ORDER BY total DESC + LIMIT 10 + ) + WHERE artist <> '' + ) + ) + ) ORDER BY LOWER(artist) ASC; } } {two} @@ -549,8 +549,8 @@ sqlite3 db test.db ifcapable subquery&&compound { do_test misc5-6.1 { catchsql { - SELECT * FROM sqlite_master - UNION ALL + SELECT * FROM sqlite_master + UNION ALL SELECT * FROM sqlite_master LIMIT (SELECT count(*) FROM blah); } @@ -560,9 +560,9 @@ ifcapable subquery&&compound { CREATE TABLE logs(msg TEXT, timestamp INTEGER, dbtime TEXT); } catchsql { - SELECT * FROM logs WHERE logs.oid >= (SELECT head FROM logs_base) - UNION ALL - SELECT * FROM logs + SELECT * FROM logs WHERE logs.oid >= (SELECT head FROM logs_base) + UNION ALL + SELECT * FROM logs LIMIT (SELECT lmt FROM logs_base) ; } } {1 {no such table: logs_base}} @@ -601,7 +601,7 @@ do_test misc5-7.2 { } db2 } {0 {}} db2 close - + # Ticket #1911 # diff --git a/third_party/sqlite/src/test/misc7.test b/third_party/sqlite/src/test/misc7.test index 8fd5fe7546207..4045a73434913 100644 --- a/third_party/sqlite/src/test/misc7.test +++ b/third_party/sqlite/src/test/misc7.test @@ -80,10 +80,10 @@ proc do_fileopen_test {prefix sql} { db eval $::sql } msg] if {$rc == 0} {set ::go 0} - + expr {$rc == 0 || ($rc == 1 && [string first unable $msg]==0)} } 1 - + close [lindex $fd_list 0] set fd_list [lrange $fd_list 1 end] incr ::n @@ -105,7 +105,7 @@ if {$tcl_platform(platform)!="windows"} { INSERT INTO abc SELECT a+2, b, c FROM abc; COMMIT; } - + do_fileopen_test misc7-6.2 { PRAGMA temp.cache_size = 1000; } @@ -122,7 +122,7 @@ execsql { INSERT INTO abc VALUES(2, 3, 4); INSERT INTO abc SELECT a+2, b, c FROM abc; } - + #-------------------------------------------------------------------- # Test that the sqlite3_busy_timeout call seems to delay approximately @@ -202,8 +202,8 @@ ifcapable utf16 { do_test misc7-9 { execsql { - SELECT * - FROM (SELECT name+1 AS one FROM sqlite_master LIMIT 1 OFFSET 1) + SELECT * + FROM (SELECT name+1 AS one FROM sqlite_master LIMIT 1 OFFSET 1) WHERE one LIKE 'hello%'; } } {} @@ -247,7 +247,7 @@ ifcapable vtab { } -tclbody { register_echo_module [sqlite3_connection_pointer db] execsql {SELECT * FROM t1 WHERE a = 1;} - } + } # The case where the virtual table module returns a very large number # as the cost of a scan (greater than SQLITE_BIG_DOUBLE in the code). @@ -275,12 +275,12 @@ ifcapable explain { } do_execsql_test misc7-14.2 { EXPLAIN QUERY PLAN SELECT * FROM abc AS t2 WHERE a = 1; - } {0 0 0 + } {0 0 0 {SEARCH TABLE abc AS t2 USING INDEX sqlite_autoindex_abc_1 (a=?)} } do_execsql_test misc7-14.3 { EXPLAIN QUERY PLAN SELECT * FROM abc AS t2 ORDER BY a; - } {0 0 0 + } {0 0 0 {SCAN TABLE abc AS t2 USING INDEX sqlite_autoindex_abc_1} } } @@ -300,23 +300,23 @@ do_test misc7-15.1 { PRAGMA cache_size = 10; BEGIN; CREATE TABLE abc(a PRIMARY KEY, b, c); - INSERT INTO abc + INSERT INTO abc VALUES(randstr(100,100), randstr(100,100), randstr(100,100)); - INSERT INTO abc SELECT + INSERT INTO abc SELECT randstr(100,100), randstr(100,100), randstr(100,100) FROM abc; - INSERT INTO abc SELECT + INSERT INTO abc SELECT randstr(100,100), randstr(100,100), randstr(100,100) FROM abc; - INSERT INTO abc SELECT + INSERT INTO abc SELECT randstr(100,100), randstr(100,100), randstr(100,100) FROM abc; - INSERT INTO abc SELECT + INSERT INTO abc SELECT randstr(100,100), randstr(100,100), randstr(100,100) FROM abc; - INSERT INTO abc SELECT + INSERT INTO abc SELECT randstr(100,100), randstr(100,100), randstr(100,100) FROM abc; - INSERT INTO abc SELECT + INSERT INTO abc SELECT randstr(100,100), randstr(100,100), randstr(100,100) FROM abc; - INSERT INTO abc SELECT + INSERT INTO abc SELECT randstr(100,100), randstr(100,100), randstr(100,100) FROM abc; - INSERT INTO abc SELECT + INSERT INTO abc SELECT randstr(100,100), randstr(100,100), randstr(100,100) FROM abc; COMMIT; } @@ -325,7 +325,7 @@ do_test misc7-15.1 { do_test misc7-15.2 { execsql { DELETE FROM abc WHERE rowid > 12; - INSERT INTO abc SELECT + INSERT INTO abc SELECT randstr(100,100), randstr(100,100), randstr(100,100) FROM abc; } } {} @@ -345,7 +345,7 @@ do_ioerr_test misc7-16 -sqlprep { INSERT INTO t3 SELECT randstr(100, 100), randstr(100, 100) FROM t3; INSERT INTO t3 SELECT randstr(100, 100), randstr(100, 100) FROM t3; INSERT INTO t3 SELECT randstr(100, 100), randstr(100, 100) FROM t3; - UPDATE t3 + UPDATE t3 SET b = 'hello world' WHERE rowid >= (SELECT max(rowid)-1 FROM t3); } -tclbody { @@ -398,12 +398,12 @@ if {$tcl_platform(platform)!="windows"} { execsql { COMMIT; } - + db close forcecopy bak.db test.db forcecopy bak.db-journal test.db-journal sqlite3 db test.db - + catch {file attributes test.db-journal -permissions r--------} catch {file attributes test.db-journal -readonly 1} catchsql { @@ -412,7 +412,7 @@ if {$tcl_platform(platform)!="windows"} { } {1 {unable to open database file}} do_test misc7-17.2 { # Note that the -readonly flag must be cleared before the -permissions - # are set. Otherwise, when using tcl 8.5 on mac, the fact that the + # are set. Otherwise, when using tcl 8.5 on mac, the fact that the # -readonly flag is set causes the attempt to set the permissions # to fail. catch {file attributes test.db-journal -readonly 0} @@ -421,14 +421,14 @@ if {$tcl_platform(platform)!="windows"} { SELECT count(*) FROM t3; } } {0 32} - + # sqlite3_test_control_pending_page [expr ($::sqlite_pending_byte / 1024) + 1] set ::pending_byte_page [expr ($::sqlite_pending_byte / 1024) + 1] - sqlite3_test_control_pending_byte $::sqlite_pending_byte + sqlite3_test_control_pending_byte $::sqlite_pending_byte do_test misc7-17.3 { db eval { pragma writable_schema = true; - UPDATE sqlite_master + UPDATE sqlite_master SET rootpage = $pending_byte_page WHERE type = 'table' AND name = 't3'; } @@ -436,13 +436,13 @@ if {$tcl_platform(platform)!="windows"} { SELECT rootpage FROM sqlite_master WHERE type = 'table' AND name = 't3'; } } $::pending_byte_page - + do_test misc7-17.4 { db close sqlite3 db test.db catchsql { SELECT count(*) FROM t3; - } + } } {1 {database disk image is malformed}} } } @@ -490,7 +490,7 @@ do_test misc7-21.1 { list $rc $msg } {1 {unable to open database file}} -# Try to do hot-journal rollback with a read-only connection. The +# Try to do hot-journal rollback with a read-only connection. The # error code should be SQLITE_READONLY_ROLLBACK. # do_test misc7-22.1 { @@ -509,13 +509,13 @@ do_test misc7-22.1 { } } {1 {attempt to write a readonly database}} do_test misc7-22.2 { execsql { SELECT * FROM t1 } } {1 2 3 4} -do_test misc7-22.3 { +do_test misc7-22.3 { set fd [open test.db-journal w] puts $fd [string repeat abc 1000] close $fd catchsql { SELECT * FROM t1 } } {1 {attempt to write a readonly database}} -do_test misc7-22.4 { +do_test misc7-22.4 { sqlite3_extended_errcode db } SQLITE_READONLY_ROLLBACK diff --git a/third_party/sqlite/src/test/misc8.test b/third_party/sqlite/src/test/misc8.test index b639dd1463d0a..dcc6d21e2f387 100644 --- a/third_party/sqlite/src/test/misc8.test +++ b/third_party/sqlite/src/test/misc8.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file implements regression tests for SQLite library. # The focus of this script is testing the "eval.c" loadable extension. -# +# set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -82,15 +82,15 @@ do_execsql_test misc8-2.1 { printf('DELETE FROM t2 WHERE c=%d AND %d>5', a+c, a+c) ) FROM t1, t2; } { - 0 1 {} 10 1 {} - 0 2 {} 10 2 {} - 0 3 {} 10 3 {} - 0 4 {} 10 4 {} - 0 5 {} 10 5 {} - 0 6 {} 10 {} {} - 0 7 {} 10 {} {} + 0 1 {} 10 1 {} + 0 2 {} 10 2 {} + 0 3 {} 10 3 {} + 0 4 {} 10 4 {} + 0 5 {} 10 5 {} + 0 6 {} 10 {} {} + 0 7 {} 10 {} {} 0 8 {} 10 {} {} - 0 9 {} 10 {} {} + 0 9 {} 10 {} {} 0 10 {} 10 {} {} } diff --git a/third_party/sqlite/src/test/misuse.test b/third_party/sqlite/src/test/misuse.test index d5d836cbfbf13..b9e11b2712cac 100644 --- a/third_party/sqlite/src/test/misuse.test +++ b/third_party/sqlite/src/test/misuse.test @@ -73,7 +73,7 @@ ifcapable {utf16} { do_test misuse-1.4 { catchsql2 { SELECT x_sqlite_exec('SELECT * FROM t1') AS xyz; - } + } } {0 {xyz {1 2}}} } do_test misuse-1.5 { diff --git a/third_party/sqlite/src/test/mmap1.test b/third_party/sqlite/src/test/mmap1.test index c7c72c0ab2c93..6f2d0eb5f4906 100644 --- a/third_party/sqlite/src/test/mmap1.test +++ b/third_party/sqlite/src/test/mmap1.test @@ -28,7 +28,7 @@ proc nRead {db} { return $stats(read) } -# Return a Tcl script that registers a user-defined scalar function +# Return a Tcl script that registers a user-defined scalar function # named rblob() with database handle $dbname. The function returns a # sequence of pseudo-random blobs based on seed value $seed. # diff --git a/third_party/sqlite/src/test/mmap2.test b/third_party/sqlite/src/test/mmap2.test index 1f8346b915eac..8c4b46626c5fb 100644 --- a/third_party/sqlite/src/test/mmap2.test +++ b/third_party/sqlite/src/test/mmap2.test @@ -9,11 +9,11 @@ # #*********************************************************************** # -# This file tests the effect of the mmap() or mremap() system calls -# returning an error on the library. +# This file tests the effect of the mmap() or mremap() system calls +# returning an error on the library. # -# If either mmap() or mremap() fails, SQLite should log an error -# message, then continue accessing the database using read() and +# If either mmap() or mremap() fails, SQLite should log an error +# message, then continue accessing the database using read() and # write() exclusively. # @@ -35,12 +35,12 @@ sqlite3_shutdown test_sqlite3_log xLog proc xLog {error_code msg} { if {[string match os_unix.c* $msg]} { - lappend ::log $msg + lappend ::log $msg } } foreach syscall {mmap mremap} { - test_syscall uninstall + test_syscall uninstall if {[catch {test_syscall install $syscall}]} continue for {set i 1} {$i < 20} {incr i} { @@ -80,8 +80,8 @@ foreach syscall {mmap mremap} { } db close -test_syscall uninstall +test_syscall uninstall sqlite3_shutdown -test_sqlite3_log +test_sqlite3_log sqlite3_initialize finish_test diff --git a/third_party/sqlite/src/test/mmap4.test b/third_party/sqlite/src/test/mmap4.test index 97015489cc182..4f971b399658c 100644 --- a/third_party/sqlite/src/test/mmap4.test +++ b/third_party/sqlite/src/test/mmap4.test @@ -9,13 +9,13 @@ # #*********************************************************************** # -# This file tests the effect of the mmap() or mremap() system calls -# returning an error on the library. +# This file tests the effect of the mmap() or mremap() system calls +# returning an error on the library. # -# If either mmap() or mremap() fails, SQLite should log an error -# message, then continue accessing the database using read() and +# If either mmap() or mremap() fails, SQLite should log an error +# message, then continue accessing the database using read() and # write() exclusively. -# +# set testdir [file dirname $argv0] source $testdir/tester.tcl ifcapable !mmap { @@ -25,7 +25,7 @@ ifcapable !mmap { source $testdir/lock_common.tcl set testprefix mmap4 -# Return a Tcl script that registers a user-defined scalar function +# Return a Tcl script that registers a user-defined scalar function # named rblob() with database handle $dbname. The function returns a # sequence of pseudo-random blobs based on seed value $seed. # diff --git a/third_party/sqlite/src/test/mmapfault.test b/third_party/sqlite/src/test/mmapfault.test index 10c5e258b8086..5e9bcc667ee86 100644 --- a/third_party/sqlite/src/test/mmapfault.test +++ b/third_party/sqlite/src/test/mmapfault.test @@ -53,7 +53,7 @@ do_faultsim_test 1 -prep { } -body { execsql { INSERT INTO t1 VALUES(a_string(200), a_string(300)) } } -test { - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} if {[sqlite3_get_autocommit db]} { sqlite3 db2 test.db @@ -64,8 +64,8 @@ do_faultsim_test 1 -prep { execsql { INSERT INTO t1 VALUES(a_string(201), a_string(301)) } set nRow [db one {SELECT count(*) FROM t1}] - if {$nRow!=5 && $nRow!=66 && $nRow!=65} { - error "Database content appears incorrect (2) ($nRow)" + if {$nRow!=5 && $nRow!=66 && $nRow!=65} { + error "Database content appears incorrect (2) ($nRow)" } catch { execsql COMMIT } diff --git a/third_party/sqlite/src/test/multiplex.test b/third_party/sqlite/src/test/multiplex.test index 6ea328906ee27..43b09b6365562 100644 --- a/third_party/sqlite/src/test/multiplex.test +++ b/third_party/sqlite/src/test/multiplex.test @@ -28,9 +28,9 @@ set g_chunk_size [ expr ($::SQLITE_MAX_PAGE_SIZE*16384) ] set g_max_chunks 32 # This handles appending the chunk number -# to the end of the filename. if +# to the end of the filename. if # SQLITE_MULTIPLEX_EXT_OVWR is defined, then -# it overwrites the last 2 bytes of the +# it overwrites the last 2 bytes of the # file name with the chunk number. proc multiplex_name {name chunk} { if {$chunk==0} { return $name } @@ -41,7 +41,7 @@ proc multiplex_name {name chunk} { return $name$num } -# This saves off the parameters and calls the +# This saves off the parameters and calls the # underlying sqlite3_multiplex_control() API. proc multiplex_set {db name chunk_size max_chunks} { global g_chunk_size @@ -49,13 +49,13 @@ proc multiplex_set {db name chunk_size max_chunks} { set g_chunk_size [ expr (($chunk_size+($::SQLITE_MAX_PAGE_SIZE-1)) & ~($::SQLITE_MAX_PAGE_SIZE-1)) ] set g_max_chunks $max_chunks set rc [catch {sqlite3_multiplex_control $db $name chunk_size $chunk_size} msg] - if { $rc==0 } { + if { $rc==0 } { set rc [catch {sqlite3_multiplex_control $db $name max_chunks $max_chunks} msg] } list $msg } -# This attempts to delete the base file and +# This attempts to delete the base file and # and files with the chunk extension. proc multiplex_delete {name} { global g_max_chunks @@ -71,7 +71,7 @@ db close sqlite3_shutdown test_sqlite3_log xLog proc xLog {error_code msg} { - lappend ::log $error_code $msg + lappend ::log $error_code $msg } unset -nocomplain log @@ -136,7 +136,7 @@ do_test multiplex-1.13.6 { db close } do_test multiplex-1.13.7 { sqlite3_multiplex_shutdown } {SQLITE_OK} #------------------------------------------------------------------------- -# Some simple warm-body tests with a single database file in rollback +# Some simple warm-body tests with a single database file in rollback # mode: # # multiplex-2.1.*: Test simple writing to a multiplex file. @@ -233,8 +233,8 @@ do_test multiplex-2.5.2 { } } {delete} -do_test multiplex-2.5.3 { - execsql { +do_test multiplex-2.5.3 { + execsql { INSERT INTO t1 VALUES(1, 'one'); INSERT INTO t1 VALUES(2, randomblob(4000)); INSERT INTO t1 VALUES(3, 'three'); @@ -293,8 +293,8 @@ foreach jmode $all_journal_modes { db eval "PRAGMA journal_mode = $jmode;" } $jmode - do_test multiplex-2.6.3.$sz.$jmode { - execsql { + do_test multiplex-2.6.3.$sz.$jmode { + execsql { CREATE TABLE t1(a PRIMARY KEY, b); INSERT INTO t1 VALUES(1, 'one'); INSERT INTO t1 VALUES(2, randomblob($g_chunk_size)); @@ -324,8 +324,8 @@ do_test multiplex-2.7.2 { sqlite3_multiplex_initialize "" 1 } do_test multiplex-2.7.3 { sqlite3 db test.db } {} do_test multiplex-2.7.4 { lindex [ catchsql { SELECT multiplex_control(2, 65536); } ] 0 } {0} do_test multiplex-2.7.5 { lindex [ catchsql { SELECT multiplex_control(1, 0); } ] 0 } {0} -do_test multiplex-2.7.6 { - execsql { +do_test multiplex-2.7.6 { + execsql { CREATE TABLE t1(a PRIMARY KEY, b); INSERT INTO t1 VALUES(1, randomblob(1000)); } @@ -333,8 +333,8 @@ do_test multiplex-2.7.6 { # verify only one file, and file size is less than chunks size do_test multiplex-2.7.7 { expr ([file size [multiplex_name test.db 0]] < 65536) } {1} do_test multiplex-2.7.8 { file exists [multiplex_name test.db 1] } {0} -do_test multiplex-2.7.9 { - execsql { +do_test multiplex-2.7.9 { + execsql { INSERT INTO t1 VALUES(2, randomblob(65536)); } } {} @@ -414,20 +414,20 @@ do_test multiplex-3.2.3 { execsql { INSERT INTO t1 VALUES('v', 'w') } db1b } {} do_test multiplex-3.2.4 { execsql { INSERT INTO t1 VALUES('t', 'u') } db2a } {} do_test multiplex-3.2.5 { execsql { INSERT INTO t1 VALUES('r', 's') } db2b } {} -do_test multiplex-3.2.6 { +do_test multiplex-3.2.6 { execsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db1a } {} -do_test multiplex-3.2.7 { +do_test multiplex-3.2.7 { execsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db1b } {} -do_test multiplex-3.2.8 { +do_test multiplex-3.2.8 { execsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db2a } {} -do_test multiplex-3.2.9 { +do_test multiplex-3.2.9 { execsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db2b } {} -do_test multiplex-3.3.1 { +do_test multiplex-3.3.1 { execsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db1a execsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db1b execsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db2a @@ -495,7 +495,7 @@ do_test multiplex-4.1.12 { #------------------------------------------------------------------------- -# The following tests test that the multiplex VFS handles malloc and IO +# The following tests test that the multiplex VFS handles malloc and IO # errors. # @@ -549,7 +549,7 @@ do_faultsim_test multiplex-5.5 -prep { } #------------------------------------------------------------------------- -# Test that you can vacuum a multiplex'ed DB. +# Test that you can vacuum a multiplex'ed DB. ifcapable vacuum { @@ -593,6 +593,6 @@ do_test multiplex-6.99 { catch { db close } catch { sqlite3_multiplex_shutdown } sqlite3_shutdown -test_sqlite3_log +test_sqlite3_log sqlite3_initialize finish_test diff --git a/third_party/sqlite/src/test/multiplex2.test b/third_party/sqlite/src/test/multiplex2.test index bdfc05b82f637..c78c0ead65b25 100644 --- a/third_party/sqlite/src/test/multiplex2.test +++ b/third_party/sqlite/src/test/multiplex2.test @@ -42,7 +42,7 @@ do_multiclient_test tn { INSERT INTO t1 SELECT randomblob(10), randomblob(4000) FROM t1; -- 256 INSERT INTO t1 SELECT randomblob(10), randomblob(4000) FROM t1; -- 512 SELECT count(*) FROM t1; - } + } do_test multiplex-1.$tn.1 { sql1 { SELECT count(*) FROM t1 } } 512 do_test multiplex-1.$tn.2 { sql2 { SELECT count(*) FROM t1 } } 512 diff --git a/third_party/sqlite/src/test/multiplex3.test b/third_party/sqlite/src/test/multiplex3.test index c1e741acdb33d..7527ad9cc610b 100644 --- a/third_party/sqlite/src/test/multiplex3.test +++ b/third_party/sqlite/src/test/multiplex3.test @@ -99,7 +99,7 @@ do_faultsim_test 1 -prep { # # 1. Create a large database. # 2. Set the pager cache to be very small. -# 3. Open a transaction. +# 3. Open a transaction. # 4. Run the following 100 times: # a. Update a row. # b. Copy all files on disk to a new db location, including the journal. @@ -107,7 +107,7 @@ do_faultsim_test 1 -prep { # the database created in step 1 (proving the journal was rolled # back). -do_test 2.0 { +do_test 2.0 { setup_and_save_db multiplex_restore_db sqlite3 db file:test.db?8_3_names=1 @@ -117,7 +117,7 @@ do_test 2.0 { for {set iTest 1} {$iTest<=100} {incr iTest} { do_test 2.$iTest { - execsql { + execsql { UPDATE t1 SET a=randomblob(12), b=randomblob(1400) WHERE rowid=5*$iTest } foreach f [glob -nocomplain test.*] {forcecopy $f "xx_$f"} diff --git a/third_party/sqlite/src/test/mutex2.test b/third_party/sqlite/src/test/mutex2.test index 9dfb03e0dea1b..dede7de71549c 100644 --- a/third_party/sqlite/src/test/mutex2.test +++ b/third_party/sqlite/src/test/mutex2.test @@ -28,7 +28,7 @@ sqlite3_shutdown install_mutex_counters 1 # Fix the mutex subsystem so that it will not initialize. In other words, -# make it so that sqlite3_initialize() always fails. +# make it so that sqlite3_initialize() always fails. # do_test mutex2-1.1 { set ::disable_mutex_init 10 diff --git a/third_party/sqlite/src/test/nan.test b/third_party/sqlite/src/test/nan.test index 27fa04a3517a8..e1fe0780d77d3 100644 --- a/third_party/sqlite/src/test/nan.test +++ b/third_party/sqlite/src/test/nan.test @@ -81,7 +81,7 @@ if {$tcl_platform(platform) != "symbian"} { } # The following block of tests, nan-1.2.*, are the same as the nan-1.1.* -# tests above, except that the SELECT queries used to validate data +# tests above, except that the SELECT queries used to validate data # convert floating point values to text internally before returning them # to Tcl. This allows the tests to be run on platforms where Tcl has # problems converting "inf" and "-inf" from floating point to text format. @@ -366,7 +366,7 @@ do_realnum_test nan-4.35 { } } {0.0 real} - + diff --git a/third_party/sqlite/src/test/nolock.test b/third_party/sqlite/src/test/nolock.test index e732dcf13bd8f..16de1a35ec176 100644 --- a/third_party/sqlite/src/test/nolock.test +++ b/third_party/sqlite/src/test/nolock.test @@ -198,7 +198,7 @@ if {[permutation]!="inmemory_journal"} { } } {delete youngling} db close - + do_test nolock-4.2 { forcedelete test.db sqlite3 db test.db diff --git a/third_party/sqlite/src/test/notify1.test b/third_party/sqlite/src/test/notify1.test index be6a122585da9..5766ea72218d3 100644 --- a/third_party/sqlite/src/test/notify1.test +++ b/third_party/sqlite/src/test/notify1.test @@ -24,7 +24,7 @@ db close set ::enable_shared_cache [sqlite3_enable_shared_cache 1] #------------------------------------------------------------------------- -# Warm body test. Test that an unlock-notify callback can be registered +# Warm body test. Test that an unlock-notify callback can be registered # and that it is invoked. # do_test notify1-1.1 { @@ -88,11 +88,11 @@ do_test notify1-1.15 { } {1 2} #------------------------------------------------------------------------- -# The following tests, notify1-2.*, test that deadlock is detected +# The following tests, notify1-2.*, test that deadlock is detected # correctly. -# +# do_test notify1-2.1 { - execsql { + execsql { CREATE TABLE t2(a, b); INSERT INTO t2 VALUES('I', 'II'); } @@ -180,7 +180,7 @@ do_test notify1-2.3.8 { set lUnlock } {} do_test notify1-2.3.9 { - db3 unlock_notify {lappend lUnlock db3} + db3 unlock_notify {lappend lUnlock db3} set lUnlock } {db3} do_test notify1-2.3.10 { @@ -196,10 +196,10 @@ catch { db2 close } catch { db close } #------------------------------------------------------------------------- -# The following tests, notify1-3.* and notify1-4.*, test that callbacks -# can be issued when there are many (>16) connections waiting on a single +# The following tests, notify1-3.* and notify1-4.*, test that callbacks +# can be issued when there are many (>16) connections waiting on a single # unlock event. -# +# foreach {tn nConn} {3 20 4 76} { do_test notify1-$tn.1 { sqlite3 db test.db @@ -240,7 +240,7 @@ db close # These tests, notify1-5.*, test that a malloc() failure that occurs while # allocating an array to use as an argument to an unlock-notify callback # is handled correctly. -# +# source $testdir/malloc_common.tcl do_malloc_test notify1-5 -tclprep { set ::lUnlock [list] @@ -275,7 +275,7 @@ do_malloc_test notify1-5 -tclprep { #------------------------------------------------------------------------- # Test cases notify1-6.* test cases where the following occur: -# +# # notify1-6.1.*: Test encountering an SQLITE_LOCKED error when the # "blocking connection" has already been set by a previous # SQLITE_LOCKED. @@ -289,7 +289,7 @@ do_malloc_test notify1-5 -tclprep { # transaction, the unlock-notify callback is not invoked. # # notify1-6.4.*: Like 6.3.*, except that instead of the second blocker -# committing its transaction, the first does. The +# committing its transaction, the first does. The # unlock-notify callback is therefore invoked. # db close @@ -303,11 +303,11 @@ do_test notify1-6.1.1 { CREATE TABLE t1(a, b); CREATE TABLE two.t2(a, b); } - execsql { + execsql { BEGIN; INSERT INTO t1 VALUES(1, 2); } db2 - execsql { + execsql { BEGIN; INSERT INTO t2 VALUES(1, 2); } db3 @@ -333,7 +333,7 @@ do_test notify1-6.2.3 { } {1} do_test notify1-6.3.1 { - execsql { + execsql { BEGIN; INSERT INTO t1 VALUES(3, 4); } db2 @@ -355,7 +355,7 @@ do_test notify1-6.3.5 { } {0} do_test notify1-6.4.1 { - execsql { + execsql { BEGIN; INSERT INTO t2 VALUES(3, 4); } db3 @@ -373,7 +373,7 @@ db2 close db3 close #------------------------------------------------------------------------- -# Test cases notify1-7.* tests that when more than one distinct +# Test cases notify1-7.* tests that when more than one distinct # unlock-notify function is registered, all are invoked correctly. # proc unlock_notify {} { @@ -408,7 +408,7 @@ do_test notify1-7.6 { } {2} #------------------------------------------------------------------------- -# Test cases notify1-8.* tests that the correct SQLITE_LOCKED extended +# Test cases notify1-8.* tests that the correct SQLITE_LOCKED extended # error code is returned in various scenarios. # do_test notify1-8.1 { @@ -434,7 +434,7 @@ do_test notify1-8.4 { } {SQLITE_LOCKED_SHAREDCACHE} do_test notify1-8.X { - execsql { COMMIT } + execsql { COMMIT } } {} #------------------------------------------------------------------------- @@ -451,7 +451,7 @@ do_test notify1-9.2 { execsql { SELECT * FROM t1 } db3 } {1 2 3 4 5 6 7 8} do_test notify1-9.3 { - catchsql { + catchsql { BEGIN; INSERT INTO t1 VALUES(9, 10); } @@ -477,7 +477,7 @@ do_test notify1-9.8 { execsql { SELECT * FROM t1 } db3 } {1 2 3 4 5 6 7 8} do_test notify1-9.9 { - catchsql { + catchsql { BEGIN; INSERT INTO t1 VALUES(9, 10); } diff --git a/third_party/sqlite/src/test/notify2.test b/third_party/sqlite/src/test/notify2.test index 12c6a537ef114..61d9261219e6a 100644 --- a/third_party/sqlite/src/test/notify2.test +++ b/third_party/sqlite/src/test/notify2.test @@ -75,7 +75,7 @@ set sql $zSql return $lRes } - proc execsql_retry {db sql} { + proc execsql_retry {db sql} { set msg "SQLITE_LOCKED blah..." while { [string match SQLITE_LOCKED* $msg] } { catch { execsql_blocking $db $sql } msg @@ -114,8 +114,8 @@ set sql $zSql foreach {tbl database} [select_one {t1 main} {t2 aux2} {t3 aux3}] {} set SQL($ii) [string map [list xxx $tbl yyy $database] [select_one { - SELECT - (SELECT b FROM xxx WHERE a=(SELECT max(a) FROM xxx))==total(a) + SELECT + (SELECT b FROM xxx WHERE a=(SELECT max(a) FROM xxx))==total(a) FROM xxx WHERE a!=(SELECT max(a) FROM xxx); } { DELETE FROM xxx WHERE a<(SELECT max(a)-100 FROM xxx); @@ -148,7 +148,7 @@ set sql $zSql if {$rc && [string match "SQLITE_LOCKED*" $msg]} { sqlite3_close $::DB opendb - } + } } elseif {$rc} { # Hit some other kind of error. This is a malfunction. error $msg @@ -178,7 +178,7 @@ foreach {iTest xStep xPrepare} { # Set up the database schema used by this test. Each thread opens file # test.db as the main database, then attaches files test2.db and test3.db # as auxillary databases. Each file contains a single table (t1, t2 and t3, in - # files test.db, test2.db and test3.db, respectively). + # files test.db, test2.db and test3.db, respectively). # do_test notify2-$iTest.1.1 { sqlite3 db test.db @@ -232,10 +232,10 @@ foreach {iTest xStep xPrepare} { # The following tests checks to make sure sqlite3_blocking_step() is # faster than sqlite3_step(). "Faster" in this case means uses fewer -# CPU cycles. This is not always the same as faster in wall-clock time -# for this type of test. The number of CPU cycles per transaction is -# roughly proportional to the number of attempts made (i.e. one plus the -# number of SQLITE_BUSY or SQLITE_LOCKED errors that require the transaction +# CPU cycles. This is not always the same as faster in wall-clock time +# for this type of test. The number of CPU cycles per transaction is +# roughly proportional to the number of attempts made (i.e. one plus the +# number of SQLITE_BUSY or SQLITE_LOCKED errors that require the transaction # to be retried). So this test just measures that a greater percentage of # transactions attempted using blocking_step() succeed. # @@ -251,11 +251,11 @@ puts [array get anWrite] do_test notify2-3 { set blocking [expr { double($anSuccess(sqlite3_blocking_step)) / - double($anAttempt(sqlite3_blocking_step)) + double($anAttempt(sqlite3_blocking_step)) }] set non [expr { double($anSuccess(sqlite3_step)) / - double($anAttempt(sqlite3_step)) + double($anAttempt(sqlite3_step)) }] puts -nonewline [format " blocking: %.1f%% non-blocking %.1f%% ..." \ [expr $blocking*100.0] [expr $non*100.0]] diff --git a/third_party/sqlite/src/test/notify3.test b/third_party/sqlite/src/test/notify3.test index 4b5e8016b4d70..e2ed5f043f20e 100644 --- a/third_party/sqlite/src/test/notify3.test +++ b/third_party/sqlite/src/test/notify3.test @@ -17,9 +17,9 @@ source $testdir/tester.tcl # This script only runs if shared-cache and unlock-notify are available. # -ifcapable !unlock_notify||!shared_cache { - finish_test - return +ifcapable !unlock_notify||!shared_cache { + finish_test + return } set esc [sqlite3_enable_shared_cache 1] @@ -29,20 +29,20 @@ forcedelete test.db2 test.db2-journal test.db2-wal sqlite3 db2 test.db2 do_test notify3-1.1 { - execsql { - CREATE TABLE t1(a, b); + execsql { + CREATE TABLE t1(a, b); INSERT INTO t1 VALUES('t1 A', 't1 B'); } } {} do_test notify3-1.2 { - execsql { + execsql { CREATE TABLE t2(a, b); INSERT INTO t2 VALUES('t2 A', 't2 B'); } db2 } {} do_test notify3-1.3 { - execsql { + execsql { BEGIN EXCLUSIVE; INSERT INTO t2 VALUES('t2 C', 't2 D'); } db2 @@ -81,7 +81,7 @@ db close set err {{1 {unable to open database: test.db2}}} set noerr {{0 {}}} -# When a new database is attached, the connection doing the attaching +# When a new database is attached, the connection doing the attaching # tries to load any unloaded schemas for both the new database and any # already attached databases (including the main database). If it is # unable to load any such schemas, then the ATTACH statement fails. @@ -94,7 +94,7 @@ set noerr {{0 {}}} # # This test does not work for test-permutations that specify SQL to # be executed as part of the [sqlite3] command that opens the database. -# Executing such SQL causes SQLite to load the database schema into memory +# Executing such SQL causes SQLite to load the database schema into memory # earlier than expected, causing test cases to fail. # if {[presql] == ""} { @@ -115,27 +115,27 @@ if {[presql] == ""} { 6 1 1 0 $noerr SQLITE_OK SQLITE_OK 7 1 1 1 $noerr SQLITE_OK SQLITE_OK " { - + do_test notify3-2.$tn.1 { catch { db1 close } catch { db2 close } sqlite3 db1 test.db sqlite3 db2 test.db2 - + sqlite3_extended_result_codes db1 $enable_extended_errors sqlite3_extended_result_codes db2 $enable_extended_errors - + if { $db1_loaded } { db1 eval "SELECT * FROM sqlite_master" } if { $db2_loaded } { db2 eval "SELECT * FROM sqlite_master" } - + db2 eval "BEGIN EXCLUSIVE" catchsql "ATTACH 'test.db2' AS two" db1 } $result - + do_test notify3-2.$tn.2 { list [sqlite3_errcode db1] [sqlite3_extended_errcode db1] } [list $error1 $error2] - + do_test notify3-2.$tn.3 { db1 unlock_notify {set invoked 1} set invoked 0 diff --git a/third_party/sqlite/src/test/null.test b/third_party/sqlite/src/test/null.test index e8eeb9740bdd3..422a4f4b8b057 100644 --- a/third_party/sqlite/src/test/null.test +++ b/third_party/sqlite/src/test/null.test @@ -97,7 +97,7 @@ do_test null-2.8 { # do_test null-3.1 { execsql { - select count(*), count(b), count(c), sum(b), sum(c), + select count(*), count(b), count(c), sum(b), sum(c), avg(b), avg(c), min(b), max(b) from t1; } } {7 4 6 2 3 0.5 0.5 0 1} diff --git a/third_party/sqlite/src/test/numcast.test b/third_party/sqlite/src/test/numcast.test index 926bbe4b21b3f..02faec1e38a6e 100644 --- a/third_party/sqlite/src/test/numcast.test +++ b/third_party/sqlite/src/test/numcast.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # This particular file does testing of casting strings into numeric # values. # diff --git a/third_party/sqlite/src/test/offset1.test b/third_party/sqlite/src/test/offset1.test index 91dc0b00a14bd..14f1c8e358c1e 100644 --- a/third_party/sqlite/src/test/offset1.test +++ b/third_party/sqlite/src/test/offset1.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This file implements test cases for the [b65cb2c8d91f6685841d7d1e13b6] # bug: Correct handling of LIMIT and OFFSET on a UNION ALL query where # the right-hand SELECT contains an ORDER BY in a subquery. diff --git a/third_party/sqlite/src/test/orderby1.test b/third_party/sqlite/src/test/orderby1.test index 831936ae96809..448b7df9a6775 100644 --- a/third_party/sqlite/src/test/orderby1.test +++ b/third_party/sqlite/src/test/orderby1.test @@ -151,7 +151,7 @@ do_test 1.6c { SELECT name FROM album CROSS JOIN track USING (aid) ORDER BY title DESC, tn DESC } -} {~/ORDER BY/} ;# ORDER BY +} {~/ORDER BY/} ;# ORDER BY # Reconstruct the test data to use indices rather than integer primary keys. @@ -447,7 +447,7 @@ do_test 4.0 { CREATE UNIQUE INDEX t42xy ON t42(x,y); INSERT INTO t41 VALUES(1,1),(3,1); INSERT INTO t42 VALUES(1,13),(1,15),(3,14),(3,16); - + SELECT b, y FROM t41 CROSS JOIN t42 ON x=a ORDER BY b, y; } } {1 13 1 14 1 15 1 16} @@ -477,8 +477,8 @@ do_execsql_test 6.0 { INSERT INTO abc VALUES(4, 5, 6); INSERT INTO abc VALUES(7, 8, 9); SELECT ( - SELECT 'hardware' FROM ( - SELECT 'software' ORDER BY 'firmware' ASC, 'sportswear' DESC + SELECT 'hardware' FROM ( + SELECT 'software' ORDER BY 'firmware' ASC, 'sportswear' DESC ) GROUP BY 1 HAVING length(b) ) FROM abc; @@ -512,7 +512,7 @@ do_execsql_test 8.0 { do_eqp_test 8.1 { SELECT * FROM t1 ORDER BY a, b; } { - 0 0 0 {SCAN TABLE t1 USING INDEX i1} + 0 0 0 {SCAN TABLE t1 USING INDEX i1} 0 0 0 {USE TEMP B-TREE FOR RIGHT PART OF ORDER BY} } diff --git a/third_party/sqlite/src/test/orderby2.test b/third_party/sqlite/src/test/orderby2.test index cfd647715244a..1f29046ba7dfe 100644 --- a/third_party/sqlite/src/test/orderby2.test +++ b/third_party/sqlite/src/test/orderby2.test @@ -75,7 +75,7 @@ do_test 2.0 { CREATE TABLE t32(c,d); CREATE INDEX t32cd ON t32(c,d); CREATE TABLE t33(e,f); CREATE INDEX t33ef ON t33(e,f); CREATE TABLE t34(g,h); CREATE INDEX t34gh ON t34(g,h); - + INSERT INTO t31 VALUES(1,4), (2,3), (1,3); INSERT INTO t32 VALUES(4,5), (3,6), (3,7), (4,8); INSERT INTO t33 VALUES(5,9), (7,10), (6,11), (8,12), (8,13), (7,14); @@ -108,7 +108,7 @@ do_test 2.3 { WHERE c=b AND e=d AND g=f ORDER BY a ASC, c ASC, e ASC, g ASC; } -} {1,3,6,11 1,3,7,10 1,3,7,14 1,4,5,9 1,4,8,12 1,4,8,12 1,4,8,13 2,3,6,11 2,3,7,10 2,3,7,14} +} {1,3,6,11 1,3,7,10 1,3,7,14 1,4,5,9 1,4,8,12 1,4,8,12 1,4,8,13 2,3,6,11 2,3,7,10 2,3,7,14} optimization_control db all on db cache flush diff --git a/third_party/sqlite/src/test/orderby3.test b/third_party/sqlite/src/test/orderby3.test index f005f0d2e8b76..e268ff07af5de 100644 --- a/third_party/sqlite/src/test/orderby3.test +++ b/third_party/sqlite/src/test/orderby3.test @@ -26,13 +26,13 @@ do_execsql_test 1.0 { CREATE TABLE t1(a INTEGER PRIMARY KEY); CREATE TABLE t2(b INTEGER PRIMARY KEY, c INTEGER); CREATE TABLE t3(d INTEGER); - + INSERT INTO t1 VALUES(1),(2),(3); - + INSERT INTO t2 VALUES(3, 1); INSERT INTO t2 VALUES(4, 2); INSERT INTO t2 VALUES(5, 3); - + INSERT INTO t3 VALUES(4),(3),(5); } {} do_execsql_test 1.1.asc { diff --git a/third_party/sqlite/src/test/orderby7.test b/third_party/sqlite/src/test/orderby7.test index 8c5fc9a85fec4..175fc8659b44b 100644 --- a/third_party/sqlite/src/test/orderby7.test +++ b/third_party/sqlite/src/test/orderby7.test @@ -33,7 +33,7 @@ do_execsql_test 1.0 { (5,'that prevented this from working correctly.'), (11,'a row that occurs twice'), (12,'a row that occurs twice'); - + CREATE TABLE t1(x TEXT PRIMARY KEY, y); INSERT OR IGNORE INTO t1 SELECT content, rowid+100 FROM fts; } {} diff --git a/third_party/sqlite/src/test/orderby9.test b/third_party/sqlite/src/test/orderby9.test index 581951c79563e..ec012118930ef 100644 --- a/third_party/sqlite/src/test/orderby9.test +++ b/third_party/sqlite/src/test/orderby9.test @@ -9,7 +9,7 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. -# +# # This file seeks to verify that expressions (and especially functions) # that are in both the ORDER BY clause and the result set are only # evaluated once. @@ -40,7 +40,7 @@ proc bigintcompare {a b} { do_test 1.0 { set l1 {} # If random() is only evaluated once and then reused for each row, then - # the output should appear in sorted order. If random() is evaluated + # the output should appear in sorted order. If random() is evaluated # separately for the result set and the ORDER BY clause, then the output # order will be random. db eval {SELECT random() AS y FROM t1 ORDER BY 1;} {lappend l1 $y} diff --git a/third_party/sqlite/src/test/oserror.test b/third_party/sqlite/src/test/oserror.test index 246a9d40232e9..a60533452f0e2 100644 --- a/third_party/sqlite/src/test/oserror.test +++ b/third_party/sqlite/src/test/oserror.test @@ -24,7 +24,7 @@ sqlite3_shutdown test_sqlite3_log xLog proc xLog {error_code msg} { if {[string match os_* $msg]} { - lappend ::log $msg + lappend ::log $msg } } @@ -37,14 +37,14 @@ proc do_re_test {tn script expression} { set res } }]] [list $expression] - + } #-------------------------------------------------------------------------- # Tests oserror-1.* test failures in the open() system call. # -# Test a failure in open() due to too many files. +# Test a failure in open() due to too many files. # # The xOpen() method of the unix VFS calls getcwd() as well as open(). # Although this does not appear to be documented in the man page, on OSX @@ -61,8 +61,8 @@ if {![clang_sanitize_address]} { do_test 1.1.2 { catch { for {set i 0} {$i < 2000} {incr i} { dbh_$i close } } } {1} - do_re_test 1.1.3 { - lindex $::log 0 + do_re_test 1.1.3 { + lindex $::log 0 } {^os_unix.c:\d+: \(\d+\) (open|getcwd)\(.*test.db\) - } } @@ -93,7 +93,7 @@ do_test 1.4.1 { list [catch { sqlite3 dbh /root/test.db } msg] $msg } {1 {unable to open database file}} -do_re_test 1.4.2 { +do_re_test 1.4.2 { lindex $::log 0 } {^os_unix.c:\d*: \(\d+\) (open|readlink|lstat)\(.*test.db\) - } @@ -110,19 +110,19 @@ ifcapable wal { execsql { SELECT * FROM sqlite_master } dbh } msg] $msg } {1 {disk I/O error}} - - do_re_test 2.1.2 { - lindex $::log 0 + + do_re_test 2.1.2 { + lindex $::log 0 } {^os_unix.c:\d+: \(\d+\) unlink\(.*test.db-wal\) - } - do_test 2.1.3 { + do_test 2.1.3 { catch { dbh close } forcedelete test.db-wal } {} } - + test_syscall reset sqlite3_shutdown -test_sqlite3_log +test_sqlite3_log sqlite3_initialize finish_test diff --git a/third_party/sqlite/src/test/pager1.test b/third_party/sqlite/src/test/pager1.test index c25c837b670b9..aa23e795f24ee 100644 --- a/third_party/sqlite/src/test/pager1.test +++ b/third_party/sqlite/src/test/pager1.test @@ -81,7 +81,7 @@ db func a_string a_string do_multiclient_test tn { - # Create and populate a database table using connection [db]. Check + # Create and populate a database table using connection [db]. Check # that connections [db2] and [db3] can see the schema and content. # do_test pager1-$tn.1 { @@ -112,15 +112,15 @@ do_multiclient_test tn { # other connections (specifically [db2]) from writing to the database. # # Even if [db2] opens a transaction first, it may not write to the - # database. After the attempt to write the db within a transaction, + # database. After the attempt to write the db within a transaction, # [db2] is left with an open transaction, but not a read-lock on # the main database. So it does not prevent [db] from committing. # - do_test pager1-$tn.8 { + do_test pager1-$tn.8 { csql2 { UPDATE t1 SET a = a + 10 } } {1 {database is locked}} - do_test pager1-$tn.9 { - csql2 { + do_test pager1-$tn.9 { + csql2 { BEGIN; UPDATE t1 SET a = a + 10; } @@ -137,8 +137,8 @@ do_multiclient_test tn { # Check that, as noted above, [db2] really did keep an open transaction # after the attempt to write the database failed. # - do_test pager1-$tn.14 { - csql2 { BEGIN } + do_test pager1-$tn.14 { + csql2 { BEGIN } } {1 {cannot start a transaction within a transaction}} do_test pager1-$tn.15 { sql2 { ROLLBACK } } {} @@ -147,10 +147,10 @@ do_multiclient_test tn { # of any transaction). After this fails, check that [db3] can read # the db (showing that [db] did not take a PENDING lock etc.) # - do_test pager1-$tn.15 { + do_test pager1-$tn.15 { sql2 { BEGIN; SELECT * FROM t1; } } {1 one 2 two 3 three} - do_test pager1-$tn.16 { + do_test pager1-$tn.16 { csql1 { UPDATE t1 SET a = a + 10 } } {1 {database is locked}} do_test pager1-$tn.17 { sql3 { SELECT * FROM t1 } } {1 one 2 two 3 three} @@ -159,17 +159,17 @@ do_multiclient_test tn { # This works - [db] gets a RESERVED lock which does not conflict with # the SHARED lock [db2] is holding. # - do_test pager1-$tn.18 { - sql1 { - BEGIN; - UPDATE t1 SET a = a + 10; + do_test pager1-$tn.18 { + sql1 { + BEGIN; + UPDATE t1 SET a = a + 10; } } {} - do_test pager1-$tn-19 { - sql1 { PRAGMA lock_status } + do_test pager1-$tn-19 { + sql1 { PRAGMA lock_status } } {main reserved temp closed} - do_test pager1-$tn-20 { - sql2 { PRAGMA lock_status } + do_test pager1-$tn-20 { + sql2 { PRAGMA lock_status } } {main shared temp closed} # Check that all connections can still read the database. Only [db] sees @@ -180,7 +180,7 @@ do_multiclient_test tn { do_test pager1-$tn.23 { sql3 { SELECT * FROM t1 } } {1 one 2 two 3 three} # Because [db2] still has the SHARED lock, [db] is unable to commit the - # transaction. If it tries, an error is returned and the connection + # transaction. If it tries, an error is returned and the connection # upgrades to a PENDING lock. # # Once this happens, [db] can read the database and see the new content, @@ -189,8 +189,8 @@ do_multiclient_test tn { # the database. # do_test pager1-$tn.24 { csql1 { COMMIT } } {1 {database is locked}} - do_test pager1-$tn-25 { - sql1 { PRAGMA lock_status } + do_test pager1-$tn-25 { + sql1 { PRAGMA lock_status } } {main pending temp closed} do_test pager1-$tn.26 { sql1 { SELECT * FROM t1 } } {11 one 12 two 13 three} do_test pager1-$tn.27 { sql2 { SELECT * FROM t1 } } {1 one 2 two 3 three} @@ -204,7 +204,7 @@ do_multiclient_test tn { do_test pager1-$tn.30 { csql2 { SELECT * FROM t1 } } {1 {database is locked}} do_test pager1-$tn.31 { csql3 { SELECT * FROM t1 } } {1 {database is locked}} - # [db] is now able to commit the transaction. Once the transaction is + # [db] is now able to commit the transaction. Once the transaction is # committed, all three connections can read the new content. # do_test pager1-$tn.25 { sql1 { UPDATE t1 SET a = a+10 } } {} @@ -223,11 +223,11 @@ do_multiclient_test tn { } db busy busy - do_test pager1-$tn.29 { - sql1 { BEGIN ; INSERT INTO t1 VALUES('x', 'y') } + do_test pager1-$tn.29 { + sql1 { BEGIN ; INSERT INTO t1 VALUES('x', 'y') } } {} - do_test pager1-$tn.30 { - sql2 { BEGIN ; SELECT * FROM t1 } + do_test pager1-$tn.30 { + sql2 { BEGIN ; SELECT * FROM t1 } } {21 one 22 two 23 three} do_test pager1-$tn.31 { sql1 COMMIT } {} do_test pager1-$tn.32 { set ::nbusy } {0 1 2 3 4 5 6} @@ -241,13 +241,13 @@ do_multiclient_test tn { # # pager1-3.1.3.*: Use a journal created in synchronous=off mode as part # of a savepoint rollback. -# +# do_test pager1-3.1.1 { faultsim_delete_and_reopen execsql { CREATE TABLE t1(a PRIMARY KEY, b); CREATE TABLE counter( - i CHECK (i<5), + i CHECK (i<5), u CHECK (u<10) ); INSERT INTO counter VALUES(0, 0); @@ -369,7 +369,7 @@ foreach {tn sql tcl} { # pager1.4.2.*: Test that if the master journal pointer at the end of a # hot-journal file appears to be corrupt (checksum does not # compute) the associated journal is rolled back (and no -# xAccess() call to check for the presence of any master +# xAccess() call to check for the presence of any master # journal file is made). # # pager1.4.3.*: Test that the contents of a hot-journal are ignored if the @@ -390,10 +390,10 @@ foreach {tn sql tcl} { # pager1.4.7.*: Test that if a hot-journal file exists but a client can # open it for reading only, the database cannot be accessed and # SQLITE_CANTOPEN is returned. -# +# do_test pager1.4.1.1 { faultsim_delete_and_reopen - execsql { + execsql { CREATE TABLE x(y, z); INSERT INTO x VALUES(1, 2); } @@ -522,7 +522,7 @@ db close # Set up a VFS that snapshots the file-system just before a master journal # file is deleted to commit a multi-file transaction. Specifically, the -# file-system is saved just before the xDelete() call to remove the +# file-system is saved just before the xDelete() call to remove the # master journal file from the file-system. # set pwd [get_pwd] @@ -531,7 +531,7 @@ tv script copy_on_mj_delete set ::mj_filename_length 0 set ::mj_delete_cnt 0 proc copy_on_mj_delete {method filename args} { - if {[string match *mj* [file tail $filename]]} { + if {[string match *mj* [file tail $filename]]} { # # NOTE: Is the file name relative? If so, add the length of the current # directory. @@ -542,7 +542,7 @@ proc copy_on_mj_delete {method filename args} { } else { set ::mj_filename_length [string length $filename] } - faultsim_save + faultsim_save incr ::mj_delete_cnt } return SQLITE_OK @@ -550,7 +550,7 @@ proc copy_on_mj_delete {method filename args} { foreach {tn1 tcl} { 1 { set prefix "test.db" } - 2 { + 2 { # This test depends on the underlying VFS being able to open paths # 512 bytes in length. The idea is to create a hot-journal file that # contains a master-journal pointer so large that it could contain @@ -582,62 +582,62 @@ foreach {tn1 tcl} { } { eval $tcl foreach {tn2 sql usesMJ} { - o { + o { PRAGMA main.synchronous=OFF; PRAGMA aux.synchronous=OFF; PRAGMA journal_mode = DELETE; } 0 - o512 { + o512 { PRAGMA main.synchronous=OFF; PRAGMA aux.synchronous=OFF; PRAGMA main.page_size = 512; PRAGMA aux.page_size = 512; PRAGMA journal_mode = DELETE; } 0 - n { + n { PRAGMA main.synchronous=NORMAL; PRAGMA aux.synchronous=NORMAL; PRAGMA journal_mode = DELETE; } 1 - f { + f { PRAGMA main.synchronous=FULL; PRAGMA aux.synchronous=FULL; PRAGMA journal_mode = DELETE; } 1 - w1 { + w1 { PRAGMA main.synchronous=NORMAL; PRAGMA aux.synchronous=NORMAL; PRAGMA journal_mode = WAL; } 0 - w2 { + w2 { PRAGMA main.synchronous=NORMAL; PRAGMA aux.synchronous=NORMAL; PRAGMA main.journal_mode=DELETE; PRAGMA aux.journal_mode=WAL; } 0 - o1a { + o1a { PRAGMA main.synchronous=FULL; PRAGMA aux.synchronous=OFF; PRAGMA journal_mode=DELETE; } 0 - o1b { + o1b { PRAGMA main.synchronous=OFF; PRAGMA aux.synchronous=NORMAL; PRAGMA journal_mode=DELETE; } 0 - m1 { + m1 { PRAGMA main.synchronous=NORMAL; PRAGMA aux.synchronous=NORMAL; PRAGMA main.journal_mode=DELETE; PRAGMA aux.journal_mode = MEMORY; } 0 - t1 { + t1 { PRAGMA main.synchronous=NORMAL; PRAGMA aux.synchronous=NORMAL; PRAGMA main.journal_mode=DELETE; PRAGMA aux.journal_mode = TRUNCATE; } 1 - p1 { + p1 { PRAGMA main.synchronous=NORMAL; PRAGMA aux.synchronous=NORMAL; PRAGMA main.journal_mode=DELETE; @@ -646,8 +646,8 @@ foreach {tn1 tcl} { } { set tn "${tn1}.${tn2}" - - # Set up a connection to have two databases, test.db (main) and + + # Set up a connection to have two databases, test.db (main) and # test.db2 (aux). Then run a multi-file transaction on them. The # VFS will snapshot the file-system just before the master-journal # file is deleted to commit the transaction. @@ -683,7 +683,7 @@ foreach {tn1 tcl} { do_test pager1-4.4.$tn.1b { set ::mj_delete_cnt } $usesMJ - + # Check that the transaction was committed successfully. # do_execsql_test pager1-4.4.$tn.2 { @@ -692,7 +692,7 @@ foreach {tn1 tcl} { do_execsql_test pager1-4.4.$tn.3 { SELECT * FROM b } {won too free double-you why zed} - + if {$usesMJ} { # Restore the file-system and reopen the databases. Check that it now # appears that the transaction was not committed (because the file-system @@ -705,7 +705,7 @@ foreach {tn1 tcl} { do_execsql_test pager1-4.4.$tn.5 {SELECT * FROM a} {double-you why zed} do_execsql_test pager1-4.4.$tn.6 {SELECT * FROM b} {won too free} } - + # Restore the file-system again. This time, before reopening the databases, # delete the master-journal file from the file-system. It now appears that # the transaction was committed (no master-journal file == no rollback). @@ -744,7 +744,7 @@ tv sectorsize 512 tv script copy_on_journal_delete tv filter xDelete proc copy_on_journal_delete {method filename args} { - if {[string match *journal $filename]} faultsim_save + if {[string match *journal $filename]} faultsim_save return SQLITE_OK } faultsim_delete_and_reopen @@ -771,14 +771,14 @@ do_execsql_test pager1.4.5.2 { # Now try four tests: # -# pager1-4.5.3: Restore the file-system. Check that the whole transaction +# pager1-4.5.3: Restore the file-system. Check that the whole transaction # is rolled back. # # pager1-4.5.4: Restore the file-system. Corrupt the first record in the # journal. Check the transaction is not rolled back. # # pager1-4.5.5: Restore the file-system. Corrupt the second record in the -# journal. Check that the first record in the transaction is +# journal. Check that the first record in the transaction is # played back, but not the second. # # pager1-4.5.6: Restore the file-system. Try to open the database with a @@ -818,9 +818,9 @@ db close tv script copy_on_mj_delete tv filter xDelete proc copy_on_mj_delete {method filename args} { - if {[string match *mj* [file tail $filename]]} { + if {[string match *mj* [file tail $filename]]} { set ::mj_filename $filename - faultsim_save + faultsim_save } return SQLITE_OK } @@ -891,7 +891,7 @@ do_test pager1.4.6.9 { [file tail $::mj_filename] [file tail $::mj_filename1] ]] -# The master-journal $::mj_filename1 contains pointers to test.db and +# The master-journal $::mj_filename1 contains pointers to test.db and # test.db2. However the hot-journal associated with test.db2 points to # a different master-journal. Therefore, reading from test.db only should # be enough to cause SQLite to delete $::mj_filename1. @@ -921,7 +921,7 @@ tv sectorsize 512 tv script copy_on_journal_delete tv filter xDelete proc copy_on_journal_delete {method filename args} { - if {[string match *journal $filename]} faultsim_save + if {[string match *journal $filename]} faultsim_save return SQLITE_OK } faultsim_delete_and_reopen @@ -939,7 +939,7 @@ do_execsql_test pager1.4.7.1 { } {delete} tv filter {} db close -tv delete +tv delete catch { test_syscall install fchmod test_syscall fault 1 1 @@ -994,13 +994,13 @@ do_test pager1.4.8.3 { # pager1-5.4.*: Check that with synchronous=normal, the master-journal file # name is added to a journal file immediately after the last # journal record. But with synchronous=full, extra unused space -# is allocated between the last journal record and the +# is allocated between the last journal record and the # master-journal file name so that the master-journal file # name does not lie on the same sector as the last journal file # record. # # pager1-5.5.*: Check that in journal_mode=PERSIST mode, a journal file is -# truncated to zero bytes when a multi-file transaction is +# truncated to zero bytes when a multi-file transaction is # committed (instead of the first couple of bytes being zeroed). # # @@ -1086,10 +1086,10 @@ do_test pager1-5.4.1 { } # The size of the journal file is now: - # + # # 1) 512 byte header + # 2) 2 * (1024+8) byte records + - # 3) 20+N bytes of master-journal pointer, where N is the size of + # 3) 20+N bytes of master-journal pointer, where N is the size of # the master-journal name encoded as utf-8 with no nul term. # set mj_pointer [expr { @@ -1139,7 +1139,7 @@ tv delete do_test pager1-5.5.1 { sqlite3 db test.db - execsql { + execsql { ATTACH 'test.db2' AS aux; PRAGMA journal_mode = PERSIST; CREATE TABLE t3(a, b); @@ -1218,7 +1218,7 @@ do_execsql_test pager1-6.12 { PRAGMA max_page_count } {11} ifcapable wal { faultsim_delete_and_reopen foreach {tn sql res js ws} [subst { - + 1 { CREATE TABLE t1(a, b); PRAGMA auto_vacuum=OFF; @@ -1228,28 +1228,28 @@ ifcapable wal { PRAGMA journal_mode=TRUNCATE; INSERT INTO t1 VALUES(1, 2); } {exclusive truncate} 0 -1 - + 2 { BEGIN IMMEDIATE; SELECT * FROM t1; COMMIT; } {1 2} 0 -1 - + 3 { BEGIN; SELECT * FROM t1; COMMIT; } {1 2} 0 -1 - + 4 { PRAGMA journal_mode = WAL } wal -1 -1 5 { INSERT INTO t1 VALUES(3, 4) } {} -1 [wal_file_size 1 1024] 6 { PRAGMA locking_mode = NORMAL } exclusive -1 [wal_file_size 1 1024] 7 { INSERT INTO t1 VALUES(5, 6); } {} -1 [wal_file_size 2 1024] - + 8 { PRAGMA journal_mode = TRUNCATE } truncate 0 -1 9 { INSERT INTO t1 VALUES(7, 8) } {} 0 -1 10 { SELECT * FROM t1 } {1 2 3 4 5 6 7 8} 0 -1 - + }] { do_execsql_test pager1-7.1.$tn.1 $sql $res catch { set J -1 ; set J [file size test.db-journal] } @@ -1281,7 +1281,7 @@ do_test pager1-7.2.3 { } {persist -1} #------------------------------------------------------------------------- -# The following tests, pager1-8.*, test that the special filenames +# The following tests, pager1-8.*, test that the special filenames # ":memory:" and "" open temporary databases. # foreach {tn filename} { @@ -1323,7 +1323,7 @@ foreach {tn filename} { # source db is written to during the backup op. # # pager1-9.2.*: Test that a backup completes successfully even if the -# source db is written to and then rolled back during a +# source db is written to and then rolled back during a # backup operation. # do_test pager1-9.0.1 { @@ -1374,7 +1374,7 @@ do_test pager1-9.2.1 { B step 30 } {SQLITE_OK} do_test pager1-9.2.2 { - execsql { + execsql { BEGIN; UPDATE ab SET b = a_string(301); ROLLBACK; @@ -1461,7 +1461,7 @@ db2 close testvfs tv -default 1 foreach sectorsize { 16 - 32 64 128 256 512 1024 2048 + 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 } { tv sectorsize $sectorsize @@ -1486,7 +1486,7 @@ foreach sectorsize { } [expr $sectorsize > 65536 ? 65536 : ($sectorsize<32 ? 512 : $sectorsize)] do_test pager1-10.$sectorsize.2 { - execsql { + execsql { INSERT INTO t3 VALUES(a_string(300), a_string(300)); INSERT INTO t3 SELECT * FROM t3; /* 2 */ INSERT INTO t3 SELECT * FROM t3; /* 4 */ @@ -1499,7 +1499,7 @@ foreach sectorsize { do_test pager1-10.$sectorsize.3 { db close sqlite3 db test.db - execsql { + execsql { PRAGMA cache_size = 10; BEGIN; } @@ -1528,7 +1528,7 @@ foreach sectorsize { SELECT * FROM t5; } } {1 2} - + } db close @@ -1606,20 +1606,20 @@ do_test pager1-11.4 { do_execsql_test pager1-11.5 { SELECT count(*) FROM zz } {32} db close tv delete - + #------------------------------------------------------------------------- # Test "PRAGMA page_size" # testvfs tv -default 1 tv sectorsize 1024 foreach pagesize { - 512 1024 2048 4096 8192 16384 32768 + 512 1024 2048 4096 8192 16384 32768 } { faultsim_delete_and_reopen # The sector-size (according to the VFS) is 1024 bytes. So if the # page-size requested using "PRAGMA page_size" is greater than the - # compile time value of SQLITE_MAX_PAGE_SIZE, then the effective + # compile time value of SQLITE_MAX_PAGE_SIZE, then the effective # page-size remains 1024 bytes. # set eff $pagesize @@ -1635,13 +1635,13 @@ foreach pagesize { } $eff do_test pager1-12.$pagesize.2 { sqlite3 db2 test.db - execsql { + execsql { SELECT count(*) FROM v; PRAGMA main.page_size; } db2 } [list 1 $eff] do_test pager1-12.$pagesize.3 { - execsql { + execsql { SELECT count(*) FROM v; PRAGMA main.page_size; } @@ -1654,9 +1654,9 @@ tv delete #------------------------------------------------------------------------- # Test specal "PRAGMA journal_mode=PERSIST" test cases. # -# pager1-13.1.*: This tests a special case encountered in persistent +# pager1-13.1.*: This tests a special case encountered in persistent # journal mode: If the journal associated with a transaction -# is smaller than the journal file (because a previous +# is smaller than the journal file (because a previous # transaction left a very large non-hot journal file in the # file-system), then SQLite has to be careful that there is # not a journal-header left over from a previous transaction @@ -1684,7 +1684,7 @@ faultsim_delete_and_reopen db func a_string a_string # The UPDATE statement at the end of this test case creates a really big -# journal. Since the cache-size is only 10 pages, the journal contains +# journal. Since the cache-size is only 10 pages, the journal contains # frequent journal headers. # do_execsql_test pager1-13.1.1 { @@ -1707,15 +1707,15 @@ do_execsql_test pager1-13.1.1 { if {$::tcl_platform(platform)!="windows"} { # Run transactions of increasing sizes. Eventually, one (or more than one) -# of these will write just enough content that one of the old headers created +# of these will write just enough content that one of the old headers created # by the transaction in the block above lies immediately after the content # journalled by the current transaction. # for {set nUp 1} {$nUp<64} {incr nUp} { - do_execsql_test pager1-13.1.2.$nUp.1 { + do_execsql_test pager1-13.1.2.$nUp.1 { UPDATE t1 SET b = a_string(399) WHERE a <= $nUp } {} - do_execsql_test pager1-13.1.2.$nUp.2 { PRAGMA integrity_check } {ok} + do_execsql_test pager1-13.1.2.$nUp.2 { PRAGMA integrity_check } {ok} # Try to access the snapshot of the file-system. # @@ -1738,10 +1738,10 @@ do_execsql_test pager1-13.2.1 { UPDATE t1 SET b = a_string(400); } {} for {set nUp 1} {$nUp<64} {incr nUp} { - do_execsql_test pager1-13.2.2.$nUp.1 { + do_execsql_test pager1-13.2.2.$nUp.1 { UPDATE t1 SET b = a_string(399) WHERE a <= $nUp } {} - do_execsql_test pager1-13.2.2.$nUp.2 { PRAGMA integrity_check } {ok} + do_execsql_test pager1-13.2.2.$nUp.2 { PRAGMA integrity_check } {ok} sqlite3 db2 sv_test.db do_test pager1-13.2.2.$nUp.3 { execsql { SELECT sum(length(b)) FROM t1 } db2 @@ -1844,7 +1844,7 @@ for {set ii [expr $::file_len-5]} {$ii < [expr $::file_len+20]} {incr ii} { #------------------------------------------------------------------------- -# Test the pagers response to the b-tree layer requesting illegal page +# Test the pagers response to the b-tree layer requesting illegal page # numbers: # # + The locking page, @@ -1858,7 +1858,7 @@ ifcapable !direct_read { do_test pager1-18.1 { faultsim_delete_and_reopen db func a_string a_string - execsql { + execsql { PRAGMA page_size = 1024; CREATE TABLE t1(a, b); INSERT INTO t1 VALUES(a_string(500), a_string(200)); @@ -1998,16 +1998,16 @@ do_test pager1-19.1 { } {} #------------------------------------------------------------------------- -# Test a couple of special cases that come up while committing +# Test a couple of special cases that come up while committing # transactions: # -# pager1-20.1.*: Committing an in-memory database transaction when the +# pager1-20.1.*: Committing an in-memory database transaction when the # database has not been modified at all. # # pager1-20.2.*: As above, but with a normal db in exclusive-locking mode. # # pager1-20.3.*: Committing a transaction in WAL mode where the database has -# been modified, but all dirty pages have been flushed to +# been modified, but all dirty pages have been flushed to # disk before the commit. # do_test pager1-20.1.1 { @@ -2277,7 +2277,7 @@ do_test pager1-24.1.2 { recursive_select 64 x2 } {} do_test pager1-24.1.3 { - execsql { + execsql { UPDATE x1 SET z = a_string(300) WHERE rowid>40; COMMIT; PRAGMA integrity_check; @@ -2376,15 +2376,15 @@ do_test pager1.27.1 { } {} #------------------------------------------------------------------------- -# Test that attempting to open a write-transaction with -# locking_mode=exclusive in WAL mode fails if there are other clients on +# Test that attempting to open a write-transaction with +# locking_mode=exclusive in WAL mode fails if there are other clients on # the same database. # catch { db close } ifcapable wal { do_multiclient_test tn { do_test pager1-28.$tn.1 { - sql1 { + sql1 { PRAGMA journal_mode = WAL; CREATE TABLE t1(a, b); INSERT INTO t1 VALUES('a', 'b'); @@ -2393,11 +2393,11 @@ ifcapable wal { do_test pager1-28.$tn.2 { sql2 { SELECT * FROM t1 } } {a b} do_test pager1-28.$tn.3 { sql1 { PRAGMA locking_mode=exclusive } } {exclusive} - do_test pager1-28.$tn.4 { + do_test pager1-28.$tn.4 { csql1 { BEGIN; INSERT INTO t1 VALUES('c', 'd'); } } {1 {database is locked}} code2 { db2 close ; sqlite3 db2 test.db } - do_test pager1-28.$tn.4 { + do_test pager1-28.$tn.4 { sql1 { INSERT INTO t1 VALUES('c', 'd'); COMMIT } } {} } @@ -2410,7 +2410,7 @@ ifcapable wal { # do_multiclient_test tn { do_test pager1-28.$tn.1 { - sql1 { + sql1 { PRAGMA journal_mode = PERSIST; CREATE TABLE t1(a, b); INSERT INTO t1 VALUES('a', 'b'); @@ -2421,7 +2421,7 @@ do_multiclient_test tn { do_test pager1-28.$tn.4 { file exists test.db-journal } 0 do_test pager1-28.$tn.5 { - sql1 { + sql1 { PRAGMA journal_mode = PERSIST; INSERT INTO t1 VALUES('c', 'd'); } @@ -2487,7 +2487,7 @@ if {[nonzero_reserved_bytes]} { } #------------------------------------------------------------------------- -# Test that if an empty database file (size 0 bytes) is opened in +# Test that if an empty database file (size 0 bytes) is opened in # exclusive-locking mode, any journal file is deleted from the file-system # without being rolled back. And that the RESERVED lock obtained while # doing this is not released. @@ -2537,7 +2537,7 @@ do_test pager1-31.1 { } copy_file test.db test.db2 copy_file test.db-journal test.db2-journal - + hexio_write test.db2-journal 24 00000000 sqlite3 db2 test.db2 execsql { PRAGMA integrity_check } db2 @@ -2666,7 +2666,7 @@ do_multiclient_test tn { INSERT INTO t1 VALUES(1, 2); } - do_test 36.$tn.1 { + do_test 36.$tn.1 { sql2 { PRAGMA max_page_count = 2 } list [catch { sql2 { CREATE TABLE t2(x) } } msg] $msg } {1 {database or disk is full}} @@ -2674,7 +2674,7 @@ do_multiclient_test tn { sql1 { PRAGMA checkpoint_fullfsync = 1 } sql1 { CREATE TABLE t2(x) } - do_test 36.$tn.2 { + do_test 36.$tn.2 { sql2 { INSERT INTO t2 VALUES('xyz') } list [catch { sql2 { CREATE TABLE t3(x) } } msg] $msg } {1 {database or disk is full}} diff --git a/third_party/sqlite/src/test/pager2.test b/third_party/sqlite/src/test/pager2.test index 0e2b33b833956..15f2e38641471 100644 --- a/third_party/sqlite/src/test/pager2.test +++ b/third_party/sqlite/src/test/pager2.test @@ -24,7 +24,7 @@ foreach code [list { set sql { PRAGMA journal_mode = memory } } { set s 1024 - set sql { + set sql { PRAGMA journal_mode = memory; PRAGMA locking_mode = exclusive; } @@ -49,7 +49,7 @@ foreach code [list { tv devchar {} eval $code tv sectorsize $s - + do_test pager2-1.$otn.0 { faultsim_delete_and_reopen execsql $sql @@ -64,19 +64,19 @@ foreach code [list { foreach x { 100 x 0 100 x - 70 22 96 59 96 50 22 56 21 16 37 64 43 40 0 38 22 38 55 0 6 - 43 62 32 93 54 18 13 29 45 66 29 25 61 31 53 82 75 25 96 86 10 69 - 2 29 6 60 80 95 42 82 85 50 68 96 90 39 78 69 87 97 48 74 65 43 + 70 22 96 59 96 50 22 56 21 16 37 64 43 40 0 38 22 38 55 0 6 + 43 62 32 93 54 18 13 29 45 66 29 25 61 31 53 82 75 25 96 86 10 69 + 2 29 6 60 80 95 42 82 85 50 68 96 90 39 78 69 87 97 48 74 65 43 x - 86 34 26 50 41 85 58 44 89 22 6 51 45 46 58 32 97 6 1 12 32 2 - 69 39 48 71 33 31 5 58 90 43 24 54 12 9 18 57 4 38 91 42 27 45 - 50 38 56 29 10 0 26 37 83 1 78 15 47 30 75 62 46 29 68 5 30 4 - 27 96 33 95 79 75 56 10 29 70 32 75 52 88 5 36 50 57 46 63 88 65 + 86 34 26 50 41 85 58 44 89 22 6 51 45 46 58 32 97 6 1 12 32 2 + 69 39 48 71 33 31 5 58 90 43 24 54 12 9 18 57 4 38 91 42 27 45 + 50 38 56 29 10 0 26 37 83 1 78 15 47 30 75 62 46 29 68 5 30 4 + 27 96 33 95 79 75 56 10 29 70 32 75 52 88 5 36 50 57 46 63 88 65 x - 44 95 64 20 24 35 69 61 61 2 35 92 42 46 23 98 78 1 38 72 79 35 - 94 37 13 59 5 93 27 58 80 75 58 7 67 13 10 76 84 4 8 70 81 45 - 8 41 98 5 60 26 92 29 91 90 2 62 40 4 5 22 80 15 83 76 52 88 - 29 5 68 73 72 7 54 17 89 32 81 94 51 28 53 71 8 42 54 59 70 79 + 44 95 64 20 24 35 69 61 61 2 35 92 42 46 23 98 78 1 38 72 79 35 + 94 37 13 59 5 93 27 58 80 75 58 7 67 13 10 76 84 4 8 70 81 45 + 8 41 98 5 60 26 92 29 91 90 2 62 40 4 5 22 80 15 83 76 52 88 + 29 5 68 73 72 7 54 17 89 32 81 94 51 28 53 71 8 42 54 59 70 79 x } { incr tn @@ -84,12 +84,12 @@ foreach code [list { if {$x == "x"} { execsql { COMMIT ; BEGIN } set lowpoint $now - do_test pager2.1.$otn.$tn { + do_test pager2.1.$otn.$tn { sqlite3 db2 test.db execsql { SELECT COALESCE(max(i), 0) FROM t1; PRAGMA integrity_check; - } + } } [list $lowpoint ok] db2 close } else { @@ -106,7 +106,7 @@ foreach code [list { execsql { INSERT INTO t1(j) VALUES(randomblob(1500)) } } } - do_execsql_test pager2.1.$otn.$tn { + do_execsql_test pager2.1.$otn.$tn { SELECT COALESCE(max(i), 0) FROM t1; PRAGMA integrity_check; } [list $x ok] @@ -119,7 +119,7 @@ tv delete #------------------------------------------------------------------------- # pager2-2.1: Test a ROLLBACK with journal_mode=off. -# pager2-2.2: Test shrinking the database (auto-vacuum) with +# pager2-2.2: Test shrinking the database (auto-vacuum) with # journal_mode=off # do_test pager2-2.1 { diff --git a/third_party/sqlite/src/test/pagerfault.test b/third_party/sqlite/src/test/pagerfault.test index 2e70171b20b22..85c83117e3f09 100644 --- a/third_party/sqlite/src/test/pagerfault.test +++ b/third_party/sqlite/src/test/pagerfault.test @@ -57,7 +57,7 @@ do_faultsim_test pagerfault-1 -prep { } -body { execsql { SELECT count(*) FROM t1 } } -test { - faultsim_test_result {0 4} + faultsim_test_result {0 4} faultsim_integrity_check if {[db one { SELECT count(*) FROM t1 }] != 4} { error "Database content appears incorrect" @@ -65,7 +65,7 @@ do_faultsim_test pagerfault-1 -prep { } #------------------------------------------------------------------------- -# Test fault-injection while rolling back a hot-journal file with a +# Test fault-injection while rolling back a hot-journal file with a # page-size different from the current value stored on page 1 of the # database file. # @@ -81,8 +81,8 @@ do_test pagerfault-2-pre1 { PRAGMA page_size = 4096; BEGIN; CREATE TABLE abc(a, b, c); - INSERT INTO abc VALUES('o', 't', 't'); - INSERT INTO abc VALUES('f', 'f', 's'); + INSERT INTO abc VALUES('o', 't', 't'); + INSERT INTO abc VALUES('f', 'f', 's'); INSERT INTO abc SELECT * FROM abc; -- 4 INSERT INTO abc SELECT * FROM abc; -- 8 INSERT INTO abc SELECT * FROM abc; -- 16 @@ -107,7 +107,7 @@ do_faultsim_test pagerfault-2 -prep { faultsim_integrity_check set res [db eval { SELECT * FROM abc }] if {$res != $answer} { error "Database content appears incorrect ($res)" } -} +} #------------------------------------------------------------------------- # Test fault-injection while rolling back hot-journals that were created @@ -154,7 +154,7 @@ do_test pagerfault-3-pre1 { do_faultsim_test pagerfault-3 -prep { faultsim_restore_and_reopen } -body { - execsql { + execsql { ATTACH 'test.db2' AS aux; SELECT count(*) FROM t2; SELECT count(*) FROM t1; @@ -177,7 +177,7 @@ do_faultsim_test pagerfault-3 -prep { do_faultsim_test pagerfault-4 -prep { faultsim_delete_and_reopen } -body { - execsql { + execsql { CREATE TABLE x(y); INSERT INTO x VALUES('z'); SELECT * FROM x; @@ -193,7 +193,7 @@ do_faultsim_test pagerfault-4 -prep { # # pagerfault-5.1: With no journal_size_limit configured. # pagerfault-5.2: With a journal_size_limit configured. -# pagerfault-5.4: Multi-file transaction. One connection has a +# pagerfault-5.4: Multi-file transaction. One connection has a # journal_size_limit of 0, the other has no limit. # do_test pagerfault-5-pre1 { @@ -220,7 +220,7 @@ do_faultsim_test pagerfault-5.1 -prep { do_faultsim_test pagerfault-5.2 -prep { faultsim_restore_and_reopen db func a_string a_string - execsql { + execsql { PRAGMA journal_mode = PERSIST; PRAGMA journal_size_limit = 2048; } @@ -234,7 +234,7 @@ do_faultsim_test pagerfault-5.3 -faults oom-transient -prep { faultsim_restore_and_reopen db func a_string a_string forcedelete test2.db test2.db-journal test2.db-wal - execsql { + execsql { PRAGMA journal_mode = PERSIST; ATTACH 'test2.db' AS aux; PRAGMA aux.journal_mode = PERSIST; @@ -260,7 +260,7 @@ do_faultsim_test pagerfault-5.3 -faults oom-transient -prep { } #------------------------------------------------------------------------- -# Test fault-injection as part of a commit when using +# Test fault-injection as part of a commit when using # journal_mode=TRUNCATE. # do_test pagerfault-6-pre1 { @@ -318,13 +318,13 @@ do_faultsim_test pagerfault-6.2 -faults cantopen-* -prep { # INSERT INTO t1 VALUES(2, randomblob(1502)); # INSERT INTO t1 VALUES(3, randomblob(1503)); # INSERT INTO t1 VALUES(4, randomblob(1504)); -# INSERT INTO t1 +# INSERT INTO t1 # SELECT x, randomblob(1500+oid+(SELECT max(oid) FROM t1)) FROM t1; -# INSERT INTO t1 +# INSERT INTO t1 # SELECT x, randomblob(1500+oid+(SELECT max(oid) FROM t1)) FROM t1; -# INSERT INTO t1 +# INSERT INTO t1 # SELECT x, randomblob(1500+oid+(SELECT max(oid) FROM t1)) FROM t1; -# INSERT INTO t1 +# INSERT INTO t1 # SELECT x, randomblob(1500+oid+(SELECT max(oid) FROM t1)) FROM t1; # } # faultsim_save_and_close @@ -332,7 +332,7 @@ do_faultsim_test pagerfault-6.2 -faults cantopen-* -prep { # do_faultsim_test pagerfault-6 -prep { # faultsim_restore_and_reopen # } -body { -# execsql { +# execsql { # BEGIN; # UPDATE t1 SET x=x+4 WHERE x=1; # SAVEPOINT one; @@ -384,7 +384,7 @@ do_test pagerfault-7-pre1 { } {} do_faultsim_test pagerfault-7 -prep { faultsim_restore_and_reopen - execsql { + execsql { PRAGMA cache_size = 10; BEGIN; UPDATE t1 SET b = randomblob(1500); @@ -423,7 +423,7 @@ do_test pagerfault-8-pre2 { } {1} do_faultsim_test pagerfault-8 -prep { faultsim_restore_and_reopen - execsql { + execsql { BEGIN; DELETE FROM t1 WHERE a>32; } @@ -435,7 +435,7 @@ do_faultsim_test pagerfault-8 -prep { } #------------------------------------------------------------------------- -# This test case is specially designed so that during a savepoint +# This test case is specially designed so that during a savepoint # rollback, a new cache entry must be allocated (see comments surrounding # the call to sqlite3PagerAcquire() from within pager_playback_one_page() # for details). Test the effects of injecting an OOM at this point. @@ -456,7 +456,7 @@ do_test pagerfault-9-pre1 { } {} do_faultsim_test pagerfault-9.1 -prep { faultsim_restore_and_reopen - execsql { + execsql { BEGIN; INSERT INTO t1 VALUES(randomblob(900)); INSERT INTO t1 VALUES(randomblob(900)); @@ -476,8 +476,8 @@ do_faultsim_test pagerfault-9.1 -prep { faultsim_integrity_check set sl [db one { SELECT COALESCE(sum(length(x)), 'null') FROM t1 }] - if {$sl!="null" && $sl!=1800} { - error "Content looks no good... ($sl)" + if {$sl!="null" && $sl!=1800} { + error "Content looks no good... ($sl)" } } @@ -626,7 +626,7 @@ ss_layer delete #------------------------------------------------------------------------- # Test fault injection when SQLite opens a database where the size of the # database file is zero bytes but the accompanying journal file is larger -# than that. In this scenario SQLite should delete the journal file +# than that. In this scenario SQLite should delete the journal file # without rolling it back, even if it is in all other respects a valid # hot-journal file. # @@ -708,9 +708,9 @@ do_faultsim_test pagerfault-14c -prep { catch { db2 close } faultsim_restore_and_reopen sqlite3 db2 test.db2 - db2 eval { - PRAGMA synchronous = off; - PRAGMA page_size = 4096; + db2 eval { + PRAGMA synchronous = off; + PRAGMA page_size = 4096; CREATE TABLE xx(a); } } -body { @@ -817,7 +817,7 @@ do_faultsim_test pagerfault-17b -prep { } do_faultsim_test pagerfault-17c -prep { faultsim_restore_and_reopen - execsql { + execsql { PRAGMA locking_mode = exclusive; PRAGMA journal_mode = wal; } @@ -861,7 +861,7 @@ do_faultsim_test pagerfault-17e -prep { } #------------------------------------------------------------------------- -# Test fault-injection when changing from journal_mode=persist to +# Test fault-injection when changing from journal_mode=persist to # journal_mode=delete (this involves deleting the journal file). # do_test pagerfault-18-pre1 { @@ -900,9 +900,9 @@ do_faultsim_test pagerfault-19a -prep { COMMIT; } } -body { - execsql { + execsql { CREATE TABLE t2(a, b); - INSERT INTO t2 SELECT * FROM t1; + INSERT INTO t2 SELECT * FROM t1; DELETE FROM t1; } } -test { @@ -925,7 +925,7 @@ do_test pagerfault-19-pre1 { do_faultsim_test pagerfault-19b -prep { faultsim_restore_and_reopen } -body { - execsql { + execsql { BEGIN; UPDATE t4 SET x = x+1; UPDATE t6 SET x = x+1; @@ -958,7 +958,7 @@ do_test pagerfault-20-pre1 { do_faultsim_test pagerfault-20 -prep { faultsim_restore_and_reopen } -body { - execsql { + execsql { BEGIN; CREATE TABLE t1(a, b); CREATE TABLE t2(a, b); @@ -991,7 +991,7 @@ do_faultsim_test pagerfault-21 -prep { #------------------------------------------------------------------------- -# Test fault-injection and rollback when the nReserve header value +# Test fault-injection and rollback when the nReserve header value # is non-zero. # do_test pagerfault-21-pre1 { @@ -1098,7 +1098,7 @@ do_faultsim_test pagerfault-22 -prep { # Provoke an OOM error during a commit of multi-file transaction. One of # the databases written during the transaction is an in-memory database. # This test causes rollback of the in-memory database after CommitPhaseOne() -# has successfully returned. i.e. the series of calls for the aborted commit +# has successfully returned. i.e. the series of calls for the aborted commit # is: # # PagerCommitPhaseOne() -> SQLITE_OK @@ -1109,16 +1109,16 @@ do_faultsim_test pagerfault-22 -prep { do_faultsim_test pagerfault-23 -prep { sqlite3 db :memory: foreach f [glob -nocomplain test.db*] { forcedelete $f } - db eval { + db eval { ATTACH 'test.db2' AS aux; CREATE TABLE t1(a, b); CREATE TABLE aux.t2(a, b); } } -body { - execsql { + execsql { BEGIN; INSERT INTO t1 VALUES(1,2); - INSERT INTO t2 VALUES(3,4); + INSERT INTO t2 VALUES(3,4); COMMIT; } } -test { @@ -1141,7 +1141,7 @@ do_faultsim_test pagerfault-24 -prep { proc lockrows {n} { if {$n==0} { return "" } - db eval { SELECT * FROM t1 WHERE oid = $n } { + db eval { SELECT * FROM t1 WHERE oid = $n } { return [lockrows [expr {$n-1}]] } } @@ -1167,7 +1167,7 @@ do_faultsim_test pagerfault-25 -prep { faultsim_restore_and_reopen db func a_string a_string set ::channel [db incrblob -readonly t1 a 1] - execsql { + execsql { PRAGMA cache_size = 10; BEGIN; INSERT INTO t1 VALUES(a_string(3000)); @@ -1179,7 +1179,7 @@ do_faultsim_test pagerfault-25 -prep { catch { lockrows 30 } catch { db eval COMMIT } close $::channel - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} } do_faultsim_test pagerfault-26 -prep { @@ -1204,13 +1204,13 @@ do_faultsim_test pagerfault-26 -prep { if {$contents != "1 2"} { error "Bad database contents ($contents)" } set sz [file size test.db] - if {$testrc!=0 && $sz!=1024*3 && $sz!=4096*3} { + if {$testrc!=0 && $sz!=1024*3 && $sz!=4096*3} { error "Expected file size to be 3072 or 12288 bytes - actual size $sz bytes" } - if {$testrc==0 && $sz!=4096*3} { + if {$testrc==0 && $sz!=4096*3} { error "Expected file size to be 12288 bytes - actual size $sz bytes" } -} +} do_test pagerfault-27-pre { faultsim_delete_and_reopen @@ -1233,7 +1233,7 @@ do_test pagerfault-27-pre { do_faultsim_test pagerfault-27 -faults ioerr-persistent -prep { faultsim_restore_and_reopen db func a_string a_string - execsql { + execsql { PRAGMA cache_size = 10; BEGIN EXCLUSIVE; } @@ -1290,7 +1290,7 @@ do_faultsim_test pagerfault-28a -faults oom* -prep { db2 eval { SELECT count(*) FROM t2 } db func a_string a_string - execsql { + execsql { BEGIN; INSERT INTO t1 VALUES(a_string(2000), a_string(2000)); INSERT INTO t1 VALUES(a_string(2000), a_string(2000)); @@ -1334,7 +1334,7 @@ db2 close # 3) Same again. # # 4a) Stop injecting errors. Allow the rollback to succeed. Check that -# the database is Ok. Or, +# the database is Ok. Or, # # 4b) Close and reopen the db. Check that the db is Ok. # @@ -1452,7 +1452,7 @@ do_faultsim_test pagerfault-33a -prep { execsql { VACUUM } } -test { faultsim_test_result {0 {}} -} +} do_faultsim_test pagerfault-33b -prep { sqlite3 db "" execsql { @@ -1463,7 +1463,7 @@ do_faultsim_test pagerfault-33b -prep { execsql { VACUUM } } -test { faultsim_test_result {0 {}} -} +} do_test pagerfault-34-pre { reset_db @@ -1483,7 +1483,7 @@ do_faultsim_test pagerfault-34 -prep { execsql COMMIT } -test { faultsim_test_result {0 {}} -} +} do_test pagerfault-35-pre { faultsim_delete_and_reopen diff --git a/third_party/sqlite/src/test/pagerfault2.test b/third_party/sqlite/src/test/pagerfault2.test index 7f6c995efd603..c43de75dc5065 100644 --- a/third_party/sqlite/src/test/pagerfault2.test +++ b/third_party/sqlite/src/test/pagerfault2.test @@ -11,9 +11,9 @@ # # The tests in this file test the pager modules response to various # fault conditions (OOM, IO error, disk full etc.). They are similar -# to those in file pagerfault1.test. +# to those in file pagerfault1.test. # -# More specifically, the tests in this file are those deemed too slow to +# More specifically, the tests in this file are those deemed too slow to # run as part of pagerfault1.test. # @@ -57,7 +57,7 @@ do_test pagerfault2-1-pre1 { do_faultsim_test pagerfault2-1 -faults oom-transient -prep { faultsim_restore_and_reopen sqlite3_db_config_lookaside db 0 256 4096 - execsql { + execsql { BEGIN; SELECT * FROM t1; INSERT INTO t1 VALUES(5, 6); @@ -82,7 +82,7 @@ do_faultsim_test pagerfault2-2 -faults oom-transient -prep { sqlite3_db_config_lookaside db 0 256 4096 db func a_string a_string - execsql { + execsql { PRAGMA cache_size = 20; BEGIN; INSERT INTO t1 VALUES(a_string(401), a_string(402)); diff --git a/third_party/sqlite/src/test/pagerfault3.test b/third_party/sqlite/src/test/pagerfault3.test index a4301cd17d2b3..1224c0d775693 100644 --- a/third_party/sqlite/src/test/pagerfault3.test +++ b/third_party/sqlite/src/test/pagerfault3.test @@ -21,7 +21,7 @@ if {[permutation] == "inmemory_journal"} { } # Create a database with page-size 2048 bytes that uses 2 pages. Populate -# it so that if the page-size is changed to 1024 bytes and the db vacuumed, +# it so that if the page-size is changed to 1024 bytes and the db vacuumed, # the new db size is 3 pages. # do_test pagerfault3-pre1 { @@ -36,7 +36,7 @@ do_test pagerfault3-pre1 { do_test pagerfault3-pre2 { faultsim_save_and_close faultsim_restore_and_reopen - execsql { + execsql { PRAGMA page_size = 1024; VACUUM; PRAGMA page_count; @@ -51,12 +51,12 @@ do_test pagerfault3-pre2 { do_faultsim_test pagerfault3-1 -faults ioerr-transient -prep { faultsim_restore_and_reopen } -body { - execsql { + execsql { PRAGMA page_size = 1024; VACUUM; } } -test { - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} faultsim_integrity_check } diff --git a/third_party/sqlite/src/test/pageropt.test b/third_party/sqlite/src/test/pageropt.test index f58b8ee7811b0..ccb764445af0b 100644 --- a/third_party/sqlite/src/test/pageropt.test +++ b/third_party/sqlite/src/test/pageropt.test @@ -23,7 +23,7 @@ ifcapable {!pager_pragmas||secure_delete||direct_read} { return } -# A non-zero reserved_bytes value changes the number of pages in the +# A non-zero reserved_bytes value changes the number of pages in the # database file, which messes up the results in this test. if {[nonzero_reserved_bytes]} {finish_test; return;} diff --git a/third_party/sqlite/src/test/pagesize.test b/third_party/sqlite/src/test/pagesize.test index 88005300124d7..321568b5f9a0c 100644 --- a/third_party/sqlite/src/test/pagesize.test +++ b/third_party/sqlite/src/test/pagesize.test @@ -74,7 +74,7 @@ if {![info exists SQLITE_MAX_PAGE_SIZE] || $SQLITE_MAX_PAGE_SIZE>=8192} { PRAGMA page_size } } 8192 -} +} foreach PGSZ {512 2048 4096 8192} { if {[info exists SQLITE_MAX_PAGE_SIZE] && $SQLITE_MAX_PAGE_SIZE<$PGSZ} continue diff --git a/third_party/sqlite/src/test/parser1.test b/third_party/sqlite/src/test/parser1.test index c708dded1f215..4b9d9dfe61525 100644 --- a/third_party/sqlite/src/test/parser1.test +++ b/third_party/sqlite/src/test/parser1.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file implements regression tests for SQLite library. # The focus of this script is testing details of the SQL language parser. -# +# set testdir [file dirname $argv0] source $testdir/tester.tcl diff --git a/third_party/sqlite/src/test/pcache.test b/third_party/sqlite/src/test/pcache.test index 5d9d93edb77eb..b5fc58ca0e9c4 100644 --- a/third_party/sqlite/src/test/pcache.test +++ b/third_party/sqlite/src/test/pcache.test @@ -85,8 +85,8 @@ do_test pcache-1.6.1 { pcache_stats } {current 11 max 22 min 20 recyclable 0} -# At this point connection db2 has a read lock on the database file and a -# single pinned page in its cache. Connection [db] is holding 10 dirty +# At this point connection db2 has a read lock on the database file and a +# single pinned page in its cache. Connection [db] is holding 10 dirty # pages. It cannot recycle them because of the read lock held by db2. # do_test pcache-1.6.2 { @@ -102,19 +102,19 @@ do_test pcache-1.6.2 { CREATE INDEX i9 ON t9(a, b); CREATE INDEX i10 ON t9(a, b); CREATE INDEX i11 ON t9(a, b); - } + } pcache_stats } {current 23 max 22 min 20 recyclable 0} do_test pcache-1.7 { execsql { CREATE TABLE t10(a, b, c); - } + } pcache_stats } {current 24 max 22 min 20 recyclable 0} # Rolling back the transaction held by db2 at this point releases a pinned -# page. Because the number of allocated pages is greater than the +# page. Because the number of allocated pages is greater than the # configured maximum, this page should be freed immediately instead of # recycled. # @@ -139,7 +139,7 @@ do_test pcache-1.11 { } {current 12 max 20 min 10 recyclable 12} do_test pcache-1.12 { - execsql { + execsql { SELECT * FROM t1 ORDER BY a; SELECT * FROM t1; SELECT * FROM t2 ORDER BY a; SELECT * FROM t2; SELECT * FROM t3 ORDER BY a; SELECT * FROM t3; @@ -165,7 +165,7 @@ do_test pcache-1.14 { } {current 2 max 15 min 10 recyclable 2} do_test pcache-1.15 { - execsql { + execsql { SELECT * FROM t1 ORDER BY a; SELECT * FROM t1; SELECT * FROM t2 ORDER BY a; SELECT * FROM t2; SELECT * FROM t3 ORDER BY a; SELECT * FROM t3; diff --git a/third_party/sqlite/src/test/percentile.test b/third_party/sqlite/src/test/percentile.test index b2bd061e866b8..3cdaa7486aaaf 100644 --- a/third_party/sqlite/src/test/percentile.test +++ b/third_party/sqlite/src/test/percentile.test @@ -149,7 +149,7 @@ do_test percentile-1.18 { execsql { UPDATE t1 SET x=NULL; SELECT ifnull(percentile(x, 50),'NULL') FROM t1 - } + } } {NULL} # Exactly one non-NULL entry @@ -158,7 +158,7 @@ do_test percentile-1.19 { execsql { UPDATE t1 SET x=12345 WHERE rowid=5; SELECT percentile(x, 0), percentile(x, 50), percentile(x,100) FROM t1 - } + } } {12345.0 12345.0 12345.0} # Infinity as an input diff --git a/third_party/sqlite/src/test/permutations.test b/third_party/sqlite/src/test/permutations.test index 7f81dcbb27843..eb1276986e96f 100644 --- a/third_party/sqlite/src/test/permutations.test +++ b/third_party/sqlite/src/test/permutations.test @@ -17,7 +17,7 @@ db close #------------------------------------------------------------------------- # test_suite NAME OPTIONS # -# where available options are: +# where available options are: # # -description TITLE (default "") # -initialize SCRIPT (default "") @@ -78,7 +78,7 @@ proc test_set {args} { } #------------------------------------------------------------------------- -# Set up the following global list variables containing the names of +# Set up the following global list variables containing the names of # various test scripts: # # $alltests @@ -89,11 +89,11 @@ foreach f [glob $testdir/*.test] { lappend alltests [file tail $f] } foreach f [glob -nocomplain \ $testdir/../ext/rtree/*.test \ $testdir/../ext/fts5/test/*.test \ -] { - lappend alltests $f +] { + lappend alltests $f } -foreach f [glob -nocomplain $testdir/../ext/session/*.test] { - lappend alltests $f +foreach f [glob -nocomplain $testdir/../ext/session/*.test] { + lappend alltests $f } if {$::tcl_platform(platform)!="unix"} { @@ -111,11 +111,11 @@ set allquicktests [test_set $alltests -exclude { corruptC.test crash.test crash2.test crash3.test crash4.test crash5.test crash6.test crash7.test delete3.test e_fts3.test fts3rnd.test fkey_malloc.test fuzz.test fuzz3.test fuzz_malloc.test in2.test loadext.test - misc7.test mutex2.test notify2.test onefile.test pagerfault2.test - savepoint4.test savepoint6.test select9.test - speed1.test speed1p.test speed2.test speed3.test speed4.test + misc7.test mutex2.test notify2.test onefile.test pagerfault2.test + savepoint4.test savepoint6.test select9.test + speed1.test speed1p.test speed2.test speed3.test speed4.test speed4p.test sqllimits1.test tkt2686.test thread001.test thread002.test - thread003.test thread004.test thread005.test trans2.test vacuum3.test + thread003.test thread004.test thread005.test trans2.test vacuum3.test incrvacuum_ioerr.test autovacuum_crash.test btree8.test shared_err.test vtab_err.test walslow.test walcrash.test walcrash3.test walthread.test rtree3.test indexfault.test securedel2.test @@ -231,8 +231,8 @@ test_suite "quick" -prefix "" -description { test_suite "full" -prefix "" -description { Full test suite. Takes a long time. -} -files [ - test_set $alltests +} -files [ + test_set $alltests ] -initialize { unset -nocomplain ::G(isquick) } @@ -240,7 +240,7 @@ test_suite "full" -prefix "" -description { test_suite "threads" -prefix "" -description { All multi-threaded tests. } -files { - notify2.test thread001.test thread002.test thread003.test + notify2.test thread001.test thread002.test thread003.test thread004.test thread005.test walthread.test } @@ -251,9 +251,9 @@ test_suite "fts3" -prefix "" -description { fts3af.test fts3ag.test fts3ah.test fts3ai.test fts3aj.test fts3ak.test fts3al.test fts3am.test fts3an.test fts3ao.test fts3atoken.test fts3b.test fts3c.test fts3cov.test fts3d.test - fts3defer.test fts3defer2.test fts3e.test fts3expr.test fts3expr2.test + fts3defer.test fts3defer2.test fts3e.test fts3expr.test fts3expr2.test fts3expr3.test - fts3near.test fts3query.test fts3shared.test fts3snippet.test + fts3near.test fts3query.test fts3shared.test fts3snippet.test fts3sort.test fts3fault.test fts3malloc.test fts3matchinfo.test fts3aux1.test fts3comp1.test fts3auto.test @@ -278,7 +278,7 @@ test_suite "fts5-light" -prefix "" -description { ] test_suite "nofaultsim" -prefix "" -description { - "Very" quick test suite. Runs in less than 5 minutes on a workstation. + "Very" quick test suite. Runs in less than 5 minutes on a workstation. This test suite is the same as the "quick" tests, except that some files that test malloc and IO errors are omitted. } -files [ @@ -310,7 +310,7 @@ test_suite "queryplanner" -prefix "" -description { e_droptrigger.test e_dropview.test e_expr.test e_insert.test eqp.test e_reindex.test e_resolve.test e_select2.test e_select.test e_update.test exists.test expr.test fkey1.test fkey2.test fkey3.test - fkey4.test fkey5.test func2.test func3.test func.test + fkey4.test fkey5.test func2.test func3.test func.test in3.test in4.test in5.test index2.test index3.test index4.test index5.test indexedby.test index.test insert2.test insert3.test insert4.test insert5.test insert.test @@ -389,18 +389,18 @@ lappend ::testsuitelist xxx test_suite "coverage-wal" -description { Coverage tests for file wal.c. } -files { - wal.test wal2.test wal3.test walmode.test + wal.test wal2.test wal3.test walmode.test walbak.test walhook.test walcrash2.test walcksum.test walfault.test walbig.test walnoshm.test wal5.test -} +} test_suite "coverage-pager" -description { Coverage tests for file pager.c. } -files { pager1.test pager2.test pagerfault.test pagerfault2.test walfault.test walbak.test journal2.test tkt-9d68c883.test -} +} test_suite "coverage-analyze" -description { Coverage tests for file analyze.c. @@ -408,13 +408,13 @@ test_suite "coverage-analyze" -description { analyze3.test analyze4.test analyze5.test analyze6.test analyze7.test analyze8.test analyze9.test analyzeA.test analyze.test analyzeB.test mallocA.test -} +} test_suite "coverage-sorter" -description { Coverage tests for file vdbesort.c. } -files { sort.test sortfault.test -} +} lappend ::testsuitelist xxx @@ -424,7 +424,7 @@ lappend ::testsuitelist xxx # Run some tests using pre-allocated page and scratch blocks. # -# mmap1.test is excluded because a good number of its tests depend on +# mmap1.test is excluded because a good number of its tests depend on # the page-cache being larger than the database. But this permutation # causes the effective limit on the page-cache to be just 24 pages. # @@ -612,10 +612,10 @@ test_suite "utf16" -description { conflict.test date.test delete.test expr.test fkey1.test func.test hook.test index.test insert2.test insert.test interrupt.test in.test intpkey.test ioerr.test join2.test join.test lastinsert.test - laststmtchanges.test limit.test lock2.test lock.test main.test + laststmtchanges.test limit.test lock2.test lock.test main.test memdb.test minmax.test misc1.test misc2.test misc3.test notnull.test null.test progress.test quote.test rowid.test select1.test select2.test - select3.test select4.test select5.test select6.test sort.test + select3.test select4.test select5.test select6.test sort.test subselect.test tableapi.test table.test temptable.test trace.test trigger1.test trigger2.test trigger3.test trigger4.test types2.test types.test unique.test update.test @@ -630,9 +630,9 @@ test_suite "exclusive" -description { } -presql { pragma locking_mode = 'exclusive' } -files { - rollback.test select1.test select2.test + rollback.test select1.test select2.test malloc.test ioerr.test -} +} # Run some tests in exclusive locking mode with truncated journals. # @@ -644,7 +644,7 @@ test_suite "exclusive-truncate" -description { } -files { delete.test delete2.test insert.test rollback.test select1.test select2.test update.test malloc.test ioerr.test -} +} # Run some tests in persistent journal mode. # @@ -654,7 +654,7 @@ test_suite "persistent_journal" -description { pragma journal_mode = persist } -files { delete.test delete2.test insert.test rollback.test select1.test - select2.test trans.test update.test vacuum.test + select2.test trans.test update.test vacuum.test } # Run some tests in truncating journal mode. @@ -665,7 +665,7 @@ test_suite "truncate_journal" -description { pragma journal_mode = truncate } -files { delete.test delete2.test insert.test rollback.test select1.test - select2.test trans.test update.test vacuum.test + select2.test trans.test update.test vacuum.test malloc.test ioerr.test } @@ -687,7 +687,7 @@ test_suite "no_journal" -description { pragma journal_mode = persist } -files { delete.test delete2.test insert.test rollback.test select1.test - select2.test trans.test update.test vacuum.test + select2.test trans.test update.test vacuum.test } # Run some error tests in no journal mode. @@ -732,7 +732,7 @@ test_suite "inmemory_journal" -description { # Exclude test scripts that use tcl IO to access journal files or count # the number of fsync() calls. - pager.test exclusive.test jrnlmode.test sync.test misc1.test + pager.test exclusive.test jrnlmode.test sync.test misc1.test journal1.test conflict.test crash8.test tkt3457.test io.test journal3.test 8_3_names.test @@ -751,11 +751,11 @@ test_suite "inmemory_journal" -description { # statement switches the database out of wal mode at inopportune # times. snapshot_fault.test - + # This test assumes a journal file is created on disk. delete_db.test - - # This test depends on a successful recovery from the pager error + + # This test depends on a successful recovery from the pager error # state. Which is not possible with an in-memory journal fts5fault1.test }] @@ -784,7 +784,7 @@ ifcapable mem3 { # allocator. sqlite3_install_memsys3 } - install_malloc_faultsim 1 + install_malloc_faultsim 1 sqlite3_initialize autoinstall_test_functions } -shutdown { @@ -792,7 +792,7 @@ ifcapable mem3 { sqlite3_shutdown sqlite3_config_heap 0 0 sqlite3_config_lookaside 100 500 - install_malloc_faultsim 1 + install_malloc_faultsim 1 sqlite3_initialize autoinstall_test_functions } @@ -813,7 +813,7 @@ ifcapable mem5 { sqlite3_shutdown sqlite3_config_heap 25000000 64 sqlite3_config_lookaside 0 0 - install_malloc_faultsim 1 + install_malloc_faultsim 1 sqlite3_initialize autoinstall_test_functions } -shutdown { @@ -821,7 +821,7 @@ ifcapable mem5 { sqlite3_shutdown sqlite3_config_heap 0 0 sqlite3_config_lookaside 100 500 - install_malloc_faultsim 1 + install_malloc_faultsim 1 sqlite3_initialize autoinstall_test_functions } @@ -829,14 +829,14 @@ ifcapable mem5 { test_suite "memsys5-2" -description { Run tests using the allocator in mem5.c in a different configuration. } -files { - select1.test + select1.test } -initialize { catch {db close} sqlite3_shutdown sqlite3_config_memstatus 0 sqlite3_config_heap 40000000 16 sqlite3_config_lookaside 0 0 - install_malloc_faultsim 1 + install_malloc_faultsim 1 sqlite3_initialize autoinstall_test_functions } -shutdown { @@ -844,7 +844,7 @@ ifcapable mem5 { sqlite3_shutdown sqlite3_config_heap 0 0 sqlite3_config_lookaside 100 500 - install_malloc_faultsim 1 + install_malloc_faultsim 1 sqlite3_initialize autoinstall_test_functions } @@ -939,7 +939,7 @@ foreach discard_rate {0 10 50 90 100} { sqlite3_shutdown sqlite3_config_alt_pcache 0 0 0 sqlite3_config_lookaside 100 500 - install_malloc_faultsim 1 + install_malloc_faultsim 1 sqlite3_initialize autoinstall_test_functions } -files ${perm-alt-pcache-testset} @@ -953,7 +953,7 @@ test_suite "journaltest" -description { } -shutdown { unregister_jt_vfs } -files [test_set $::allquicktests -exclude { - wal* incrvacuum.test ioerr.test corrupt4.test io.test crash8.test + wal* incrvacuum.test ioerr.test corrupt4.test io.test crash8.test async4.test bigfile.test backcompat.test e_wal* fstat.test mmap2.test pager1.test syscall.test tkt3457.test *malloc* mmap* multiplex* nolock* pager2.test *fault* rowal* snapshot* superlock* symlink.test @@ -968,7 +968,7 @@ if {[info commands register_demovfs] != ""} { } -shutdown { unregister_demovfs } -files { - insert.test insert2.test insert3.test rollback.test + insert.test insert2.test insert3.test rollback.test select1.test select2.test select3.test } } @@ -987,7 +987,7 @@ test_suite "wal" -description { fts3ae.test fts3af.test fts3ag.test fts3ah.test fts3ai.test fts3aj.test fts3ak.test fts3al.test fts3am.test fts3an.test fts3ao.test fts3b.test - fts3c.test fts3d.test fts3e.test fts3query.test + fts3c.test fts3d.test fts3e.test fts3query.test } test_suite "rtree" -description { @@ -995,11 +995,11 @@ test_suite "rtree" -description { } -files [glob -nocomplain $::testdir/../ext/rtree/*.test] test_suite "session" -description { - All session module related tests. + All session module related tests. } -files [glob -nocomplain $::testdir/../ext/session/*.test] test_suite "session_eec" -description { - All session module related tests with sqlite3_extended_result_codes() set. + All session module related tests with sqlite3_extended_result_codes() set. } -files [ glob -nocomplain $::testdir/../ext/session/*.test ] -dbconfig { @@ -1047,7 +1047,7 @@ test_suite "prepare" -description { # run_tests NAME OPTIONS # -# where available options are: +# where available options are: # # -description TITLE # -initialize SCRIPT diff --git a/third_party/sqlite/src/test/pragma.test b/third_party/sqlite/src/test/pragma.test index 44498d076bbbd..0abc5e97c92f0 100644 --- a/third_party/sqlite/src/test/pragma.test +++ b/third_party/sqlite/src/test/pragma.test @@ -291,26 +291,26 @@ ifcapable pager_pragmas&&attach { forcedelete test2.db-journal execsql { ATTACH 'test2.db' AS aux; - } + } } {} do_test pragma-2.2 { execsql { pragma aux.synchronous; - } + } } {2} do_test pragma-2.3 { execsql { pragma aux.synchronous = OFF; pragma aux.synchronous; pragma synchronous; - } + } } {0 2} do_test pragma-2.4 { execsql { pragma aux.synchronous = ON; pragma synchronous; pragma aux.synchronous; - } + } } {2 1} } ;# ifcapable pager_pragmas @@ -372,7 +372,7 @@ ifcapable attach { PRAGMA integrity_check=0 } } {{row 1 missing from index i2} {row 2 missing from index i2} {wrong # of entries in index i2} {row 1 missing from index i2} {row 2 missing from index i2} {wrong # of entries in index i2}} - + # Add additional corruption by appending unused pages to the end of # the database file testerr.db # @@ -551,27 +551,27 @@ do_test pragma-4.1 { ATTACH 'test2.db' AS aux; pragma aux.cache_size; pragma aux.default_cache_size; - } + } } [list $DFLT_CACHE_SZ $DFLT_CACHE_SZ] do_test pragma-4.2 { execsql { pragma aux.cache_size = 50; pragma aux.cache_size; pragma aux.default_cache_size; - } + } } [list 50 $DFLT_CACHE_SZ] do_test pragma-4.3 { execsql { pragma aux.default_cache_size = 456; pragma aux.cache_size; pragma aux.default_cache_size; - } + } } {456 456} do_test pragma-4.4 { execsql { pragma cache_size; pragma default_cache_size; - } + } } [list $DFLT_CACHE_SZ $DFLT_CACHE_SZ] do_test pragma-4.5 { execsql { @@ -579,7 +579,7 @@ do_test pragma-4.5 { ATTACH 'test3.db' AS aux; pragma aux.cache_size; pragma aux.default_cache_size; - } + } } [list $DFLT_CACHE_SZ $DFLT_CACHE_SZ] do_test pragma-4.6 { execsql { @@ -587,7 +587,7 @@ do_test pragma-4.6 { ATTACH 'test2.db' AS aux; pragma aux.cache_size; pragma aux.default_cache_size; - } + } } {456 456} } ;# ifcapable pager_pragmas @@ -597,18 +597,18 @@ ifcapable pager_pragmas { do_test pragma-5.0 { execsql { pragma synchronous; - } + } } {2} do_test pragma-5.1 { catchsql { BEGIN; pragma synchronous = OFF; - } + } } {1 {Safety level may not be changed inside a transaction}} do_test pragma-5.2 { execsql { pragma synchronous; - } + } } {2} catchsql {COMMIT;} } ;# ifcapable pager_pragmas @@ -641,7 +641,7 @@ db nullvalue <> do_test pragma-6.2.2 { execsql { CREATE TABLE t5( - a TEXT DEFAULT CURRENT_TIMESTAMP, + a TEXT DEFAULT CURRENT_TIMESTAMP, b DEFAULT (5+3), c TEXT, d INTEGER DEFAULT NULL, @@ -739,7 +739,7 @@ do_test pragma-6.5.2 { ifcapable tempdb { # Test for ticket #3320. When a temp table of the same name exists, make - # sure the schema of the main table can still be queried using + # sure the schema of the main table can still be queried using # "pragma table_info": do_test pragma-6.6.1 { execsql { @@ -767,7 +767,7 @@ ifcapable tempdb { do_test pragma-6.7 { execsql { CREATE TABLE test_table( - one INT NOT NULL DEFAULT -1, + one INT NOT NULL DEFAULT -1, two text, three VARCHAR(45, 65) DEFAULT 'abcde', four REAL DEFAULT X'abcdef', @@ -1010,7 +1010,7 @@ ifcapable vacuum { ifcapable attach { db eval {ATTACH 'test2.db' AS aux} - + # Check that the user-version in the auxilary database can be manipulated ( # and that we aren't accidentally manipulating the same in the main db). do_test pragma-8.2.5 { @@ -1033,7 +1033,7 @@ ifcapable attach { PRAGMA main.user_version; } } {2} - + # Now check that a ROLLBACK resets the user-version if it has been modified # within a transaction. do_test pragma-8.2.9 { @@ -1191,24 +1191,24 @@ ifcapable wsd { " } {} do_test pragma-9.6 { - execsql { + execsql { PRAGMA temp_store_directory; } } [list [file nativename [get_pwd]]] do_test pragma-9.7 { - catchsql { + catchsql { PRAGMA temp_store_directory='/NON/EXISTENT/PATH/FOOBAR'; } } {1 {not a writable directory}} do_test pragma-9.8 { - execsql { + execsql { PRAGMA temp_store_directory=''; } } {} if {![info exists TEMP_STORE] || $TEMP_STORE<=1} { ifcapable tempdb { do_test pragma-9.9 { - execsql { + execsql { PRAGMA temp_store_directory; PRAGMA temp_store=FILE; CREATE TEMP TABLE temp_store_directory_test(a integer); @@ -1294,22 +1294,22 @@ do_test pragma-10.0 { CREATE TABLE t1(a PRIMARY KEY); CREATE TABLE t1_mirror(a); CREATE TABLE t1_mirror2(a); - CREATE TRIGGER t1_bi BEFORE INSERT ON t1 BEGIN + CREATE TRIGGER t1_bi BEFORE INSERT ON t1 BEGIN INSERT INTO t1_mirror VALUES(new.a); END; - CREATE TRIGGER t1_ai AFTER INSERT ON t1 BEGIN + CREATE TRIGGER t1_ai AFTER INSERT ON t1 BEGIN INSERT INTO t1_mirror2 VALUES(new.a); END; - CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 BEGIN + CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 BEGIN UPDATE t1_mirror SET a = new.a WHERE a = old.a; END; - CREATE TRIGGER t1_au AFTER UPDATE ON t1 BEGIN + CREATE TRIGGER t1_au AFTER UPDATE ON t1 BEGIN UPDATE t1_mirror2 SET a = new.a WHERE a = old.a; END; - CREATE TRIGGER t1_bd BEFORE DELETE ON t1 BEGIN + CREATE TRIGGER t1_bd BEFORE DELETE ON t1 BEGIN DELETE FROM t1_mirror WHERE a = old.a; END; - CREATE TRIGGER t1_ad AFTER DELETE ON t1 BEGIN + CREATE TRIGGER t1_ad AFTER DELETE ON t1 BEGIN DELETE FROM t1_mirror2 WHERE a = old.a; END; } @@ -1399,13 +1399,13 @@ do_test pragma-13.1 { } } {} -} ;# ifcapable bloblit +} ;# ifcapable bloblit ifcapable pager_pragmas { db close forcedelete test.db sqlite3 db test.db - + # EVIDENCE-OF: R-15672-33611 PRAGMA schema.page_count; Return the total # number of pages in the database file. # @@ -1415,7 +1415,7 @@ ifcapable pager_pragmas { } {0 0} do_test pragma-14.2 { - execsql { + execsql { CREATE TABLE abc(a, b, c); PRAGMA page_count; PRAGMA main.page_count; @@ -1427,7 +1427,7 @@ ifcapable pager_pragmas { } {2} do_test pragma-14.3 { - execsql { + execsql { BEGIN; CREATE TABLE def(a, b, c); PRAGMA page_count; @@ -1463,7 +1463,7 @@ ifcapable pager_pragmas { execsql { ATTACH 'test2.db' AS aux; PRAGMA aux.page_count; - } + } } {5} do_test pragma-14.6uc { execsql {pragma AUX.PAGE_COUNT} @@ -1493,7 +1493,7 @@ ifcapable pager_pragmas { # Evaluating this statement will cause the schema to be reloaded (because # the schema was changed by another connection in pragma-15.2). At one # point there was a bug that reset the cache_size to its default value - # when this happened. + # when this happened. execsql { SELECT * FROM sqlite_master } execsql { PRAGMA cache_size } } {59} @@ -1525,7 +1525,7 @@ ifcapable lock_proxy_pragmas&&prefer_proxy_locking { } execsql { PRAGMA lock_proxy_file; - } + } } {mylittleproxy} do_test pragma-16.2 { @@ -1578,7 +1578,7 @@ ifcapable lock_proxy_pragmas&&prefer_proxy_locking { PRAGMA lock_proxy_file; } db2 } {myotherproxy} - + do_test pragma-16.6 { db2 close sqlite3 db2 test2.db @@ -1588,23 +1588,23 @@ ifcapable lock_proxy_pragmas&&prefer_proxy_locking { } db2] string match "*test2.db:auto:" $lockpath } {1} - + set sqlite_hostid_num 2 do_test pragma-16.7 { list [catch { sqlite3 db test2.db - execsql { + execsql { PRAGMA lock_proxy_file=":auto:"; select * from sqlite_master; } } msg] $msg } {1 {database is locked}} db close - + do_test pragma-16.8 { list [catch { sqlite3 db test2.db - execsql { select * from sqlite_master } + execsql { select * from sqlite_master } } msg] $msg } {1 {database is locked}} @@ -1613,12 +1613,12 @@ ifcapable lock_proxy_pragmas&&prefer_proxy_locking { execsql { PRAGMA lock_proxy_file="yetanotherproxy"; PRAGMA lock_proxy_file; - } + } } {yetanotherproxy} do_test pragma-16.8.2 { execsql { create table mine(x); - } + } } {} db close @@ -1762,7 +1762,7 @@ if {![nonzero_reserved_bytes]} { db close forcedelete test.db sqlite3 db test.db - execsql { + execsql { PRAGMA page_size = 1024; PRAGMA auto_vacuum = 0; CREATE TABLE t1(a PRIMARY KEY, b); @@ -1775,27 +1775,27 @@ if {![nonzero_reserved_bytes]} { forcecopy test.db testerr.db hexio_write testerr.db 15000 [string repeat 55 100] } {100} - + set mainerr {*** in database main *** Multiple uses for byte 672 of page 15} set auxerr {*** in database aux *** Multiple uses for byte 672 of page 15} - + set mainerr {/{\*\*\* in database main \*\*\* Multiple uses for byte 672 of page 15}.*/} set auxerr {/{\*\*\* in database aux \*\*\* Multiple uses for byte 672 of page 15}.*/} - + do_test 22.2 { catch { db close } sqlite3 db testerr.db execsql { PRAGMA integrity_check } } $mainerr - + do_test 22.3.1 { catch { db close } sqlite3 db test.db - execsql { + execsql { ATTACH 'testerr.db' AS 'aux'; PRAGMA integrity_check; } @@ -1806,11 +1806,11 @@ Multiple uses for byte 672 of page 15}.*/} do_test 22.3.3 { execsql { PRAGMA aux.integrity_check; } } $auxerr - + do_test 22.4.1 { catch { db close } sqlite3 db testerr.db - execsql { + execsql { ATTACH 'test.db' AS 'aux'; PRAGMA integrity_check; } @@ -1822,7 +1822,7 @@ Multiple uses for byte 672 of page 15}.*/} execsql { PRAGMA aux.integrity_check; } } {ok} } - + db close forcedelete test.db test.db-wal test.db-journal sqlite3 db test.db diff --git a/third_party/sqlite/src/test/pragma2.test b/third_party/sqlite/src/test/pragma2.test index 5896e52687cfd..d9783e93358ba 100644 --- a/third_party/sqlite/src/test/pragma2.test +++ b/third_party/sqlite/src/test/pragma2.test @@ -101,7 +101,7 @@ ifcapable attach { PRAGMA aux.freelist_count; } } {9} - + do_test pragma2-3.1 { execsql { PRAGMA aux.freelist_count; @@ -270,6 +270,6 @@ do_execsql_test pragma2-5.3 { PRAGMA cache_spill(-51); PRAGMA cache_spill; } {3} - + test_restore_config_pagecache finish_test diff --git a/third_party/sqlite/src/test/pragma3.test b/third_party/sqlite/src/test/pragma3.test index 8a4f4f9d84acd..71865b74215b7 100644 --- a/third_party/sqlite/src/test/pragma3.test +++ b/third_party/sqlite/src/test/pragma3.test @@ -24,7 +24,7 @@ do_execsql_test pragma3-101 { PRAGMA temp.data_version; } {1} -# Writing to the pragma is a no-op +# Writing to the pragma is a no-op do_execsql_test pragma3-102 { PRAGMA main.data_version=1234; PRAGMA main.data_version; diff --git a/third_party/sqlite/src/test/progress.test b/third_party/sqlite/src/test/progress.test index f6d7229243aa5..bd458228de026 100644 --- a/third_party/sqlite/src/test/progress.test +++ b/third_party/sqlite/src/test/progress.test @@ -97,8 +97,8 @@ do_test progress-1.2 { } } 10 -# Test that an active transaction remains active and not rolled back -# after the progress query abandons a query. +# Test that an active transaction remains active and not rolled back +# after the progress query abandons a query. # # UPDATE: It is now recognised that this is a sure route to database # corruption. So the transaction is rolled back. diff --git a/third_party/sqlite/src/test/ptrchng.test b/third_party/sqlite/src/test/ptrchng.test index 75525f981c575..bcb51d6e072f9 100644 --- a/third_party/sqlite/src/test/ptrchng.test +++ b/third_party/sqlite/src/test/ptrchng.test @@ -39,7 +39,7 @@ do_test ptrchng-1.1 { execsql { CREATE TABLE t1(x INTEGER PRIMARY KEY, y BLOB); INSERT INTO t1 VALUES(1, 'abc'); - INSERT INTO t1 VALUES(2, + INSERT INTO t1 VALUES(2, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234356789'); INSERT INTO t1 VALUES(3, x'626c6f62'); INSERT INTO t1 VALUES(4, diff --git a/third_party/sqlite/src/test/quota.test b/third_party/sqlite/src/test/quota.test index 5d0bda3ad3b27..e0e02f443aacd 100644 --- a/third_party/sqlite/src/test/quota.test +++ b/third_party/sqlite/src/test/quota.test @@ -38,7 +38,7 @@ do_test quota-1.8 { sqlite3_quota_shutdown } {SQLITE_OK} #------------------------------------------------------------------------- -# Some simple warm-body tests with a single database file in rollback +# Some simple warm-body tests with a single database file in rollback # mode: # # quota-2.1.*: Test that SQLITE_FULL is returned if the database would @@ -55,7 +55,7 @@ do_test quota-1.8 { sqlite3_quota_shutdown } {SQLITE_OK} # file. Check that this fails and the quota system still works # afterwards. Then close the database and successfully shut # down the quota system. -# +# sqlite3_quota_initialize "" 1 unset -nocomplain quota_request_ok @@ -172,7 +172,7 @@ do_test quota-3.1.6 { } {SQLITE_OK} do_test quota-3.2.1 { - delete_file force test.db test2.db + delete_file force test.db test2.db sqlite3_quota_set * 4096 {} sqlite3 db1a test.db @@ -200,16 +200,16 @@ do_test quota-3.2.3 { execsql { INSERT INTO t1 VALUES('v', 'w') } db1b } {} do_test quota-3.2.4 { execsql { INSERT INTO t1 VALUES('t', 'u') } db2a } {} do_test quota-3.2.5 { execsql { INSERT INTO t1 VALUES('r', 's') } db2b } {} -do_test quota-3.2.6 { +do_test quota-3.2.6 { catchsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db1a } {1 {database or disk is full}} -do_test quota-3.2.7 { +do_test quota-3.2.7 { catchsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db1b } {1 {database or disk is full}} -do_test quota-3.2.8 { +do_test quota-3.2.8 { catchsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db2a } {1 {database or disk is full}} -do_test quota-3.2.9 { +do_test quota-3.2.9 { catchsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db2b } {1 {database or disk is full}} @@ -223,7 +223,7 @@ proc quota_callback {file limitvar size} { set limit 0 } sqlite3_quota_set * 4096 quota_callback -do_test quota-3.3.1 { +do_test quota-3.3.1 { execsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db1a execsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db1b execsql { INSERT INTO t1 VALUES(randomblob(500), randomblob(500)) } db2a @@ -355,7 +355,7 @@ if {$tcl_platform(platform)=="windows"} { set quotagroup *\\quota-test-A?.db } else { set quotagroup */quota-test-A?.db -} +} foreach file [glob -nocomplain quota-test-A*] { forcedelete $file } @@ -406,7 +406,7 @@ if {$tcl_platform(platform)=="windows"} { set quotagroup *\\quota-test-B* } else { set quotagroup */quota-test-B* -} +} foreach file [glob -nocomplain quota-test-B*] { forcedelete $file } @@ -469,7 +469,7 @@ do_test quota-4.9.2 { } {} #------------------------------------------------------------------------- -# The following tests test that the quota VFS handles malloc and IO +# The following tests test that the quota VFS handles malloc and IO # errors. # diff --git a/third_party/sqlite/src/test/quota2.test b/third_party/sqlite/src/test/quota2.test index 8682bd86a3314..f6abf7a197dfb 100644 --- a/third_party/sqlite/src/test/quota2.test +++ b/third_party/sqlite/src/test/quota2.test @@ -48,9 +48,9 @@ proc standard_path {x} { # new quota size to cover the last write. These three values are # appended to the global variable $::quota. The filename is processed # to convert every \ character into / and to change the name of the -# working directory to PWD. +# working directory to PWD. # -# The quota is increased to the request if the ::quota_request_ok +# The quota is increased to the request if the ::quota_request_ok # global variable is true. # set ::quota {} diff --git a/third_party/sqlite/src/test/quote.test b/third_party/sqlite/src/test/quote.test index f13d6f9ee9485..44ab209afcda9 100644 --- a/third_party/sqlite/src/test/quote.test +++ b/third_party/sqlite/src/test/quote.test @@ -84,6 +84,6 @@ do_test quote-1.6 { } msg ] lappend r $msg } {0 {}} - + finish_test diff --git a/third_party/sqlite/src/test/randexpr1.tcl b/third_party/sqlite/src/test/randexpr1.tcl index 37ebf531e8509..ba4a413aa3205 100644 --- a/third_party/sqlite/src/test/randexpr1.tcl +++ b/third_party/sqlite/src/test/randexpr1.tcl @@ -2,7 +2,7 @@ # complicated expressions. # # The generated tests are intended to verify expression evaluation -# in SQLite against expression evaluation TCL. +# in SQLite against expression evaluation TCL. # # Terms of the $intexpr list each contain two sub-terms. diff --git a/third_party/sqlite/src/test/rdonly.test b/third_party/sqlite/src/test/rdonly.test index 404c613b21173..bac7f75fe3963 100644 --- a/third_party/sqlite/src/test/rdonly.test +++ b/third_party/sqlite/src/test/rdonly.test @@ -78,7 +78,7 @@ do_test rdonly-1.5 { } {0 {1 2}} # Now, after connection [db] has loaded the database schema, modify the -# write-version of the file (and the change-counter, so that the +# write-version of the file (and the change-counter, so that the # write-version is reloaded). This way, SQLite does not discover that # the database is read-only until after it is locked. # diff --git a/third_party/sqlite/src/test/regexp1.test b/third_party/sqlite/src/test/regexp1.test index 0e63cd98c8009..797a70d27ee2d 100644 --- a/third_party/sqlite/src/test/regexp1.test +++ b/third_party/sqlite/src/test/regexp1.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This file implements test for the REGEXP operator in test_regexp.c. # @@ -111,7 +111,7 @@ do_execsql_test regexp1-1.27 { } {4} do_execsql_test regexp1-2.1 { - SELECT 'aaaabbbbcccc' REGEXP 'ab*c', + SELECT 'aaaabbbbcccc' REGEXP 'ab*c', 'aaaacccc' REGEXP 'ab*c'; } {1 1} do_execsql_test regexp1-2.2 { diff --git a/third_party/sqlite/src/test/regexp2.test b/third_party/sqlite/src/test/regexp2.test index e3922042cc78f..22897d769bcb1 100644 --- a/third_party/sqlite/src/test/regexp2.test +++ b/third_party/sqlite/src/test/regexp2.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This file implements tests for the REGEXP operator in ext/misc/regexp.c. # It focuses on the use of the sqlite3_set_auxdata()/get_auxdata() APIs. # @@ -102,7 +102,7 @@ do_execsql_test 2.3 { } {1 a_abc_1 2 a_abc_1 1 a_abc_1 2 a_abc_1 1 a_abc_1 2 a_abc_1} #------------------------------------------------------------------------- -# Test that trigger parameters (i.e. new.* and old.*) refs are not +# Test that trigger parameters (i.e. new.* and old.*) refs are not # considered to be constant across separate invocations of the trigger. # do_execsql_test 3.0 { diff --git a/third_party/sqlite/src/test/releasetest.tcl b/third_party/sqlite/src/test/releasetest.tcl index 99823e3b1c3f4..6c74ba77b7c72 100755 --- a/third_party/sqlite/src/test/releasetest.tcl +++ b/third_party/sqlite/src/test/releasetest.tcl @@ -979,7 +979,7 @@ proc cleanup {dir} { foreach f [glob -nocomplain [file join $dir *]] { set tail [file tail $f] - if {[info exists K($tail)]==0} { + if {[info exists K($tail)]==0} { file delete -force $f } } diff --git a/third_party/sqlite/src/test/resolver01.test b/third_party/sqlite/src/test/resolver01.test index 59bb3c021a7c2..a02e1dee0cf15 100644 --- a/third_party/sqlite/src/test/resolver01.test +++ b/third_party/sqlite/src/test/resolver01.test @@ -191,7 +191,7 @@ do_execsql_test resolver01-6.1 { SELECT min(name) FROM t61 GROUP BY lower(name); } {} do_execsql_test resolver01-6.2 { - SELECT min(name) AS name FROM t61 GROUP BY lower(name); + SELECT min(name) AS name FROM t61 GROUP BY lower(name); } {} do_execsql_test resolver01-6.3 { CREATE TABLE t63(name); diff --git a/third_party/sqlite/src/test/rollback.test b/third_party/sqlite/src/test/rollback.test index 7abafece6176f..9cf99e6a25cae 100644 --- a/third_party/sqlite/src/test/rollback.test +++ b/third_party/sqlite/src/test/rollback.test @@ -55,7 +55,7 @@ ifcapable conflict { INSERT INTO t3 SELECT a FROM t1; } } {1 {UNIQUE constraint failed: t3.a}} - + # Try to continue with the SELECT statement # do_test rollback-1.5 { @@ -79,7 +79,7 @@ do_test rollback-1.9 { sqlite3_finalize $STMT } {SQLITE_OK} -if {$tcl_platform(platform) == "unix" +if {$tcl_platform(platform) == "unix" && [permutation] ne "onefile" && [permutation] ne "inmemory_journal" } { @@ -98,7 +98,7 @@ if {$tcl_platform(platform) == "unix" # At this point files testA.db and testA.db-journal are present in the # file system. This block adds a master-journal file pointer to the # end of testA.db-journal. The master-journal file does not exist. - # + # set mj [file normalize testA.db-mj-123] binary scan $mj c* a set cksum 0 @@ -126,7 +126,7 @@ if {$tcl_platform(platform) == "unix" # the master-journal file and return SQLITE_CANTOPEN when it could not # be opened. This is incorrect, it should simply delete the journal # file and proceed with the query. - # + # do_test rollback-2.2 { sqlite3 db2 testA.db execsql { diff --git a/third_party/sqlite/src/test/rollback2.test b/third_party/sqlite/src/test/rollback2.test index 3ba0f3f9fdb8e..92df0e4d4c015 100644 --- a/third_party/sqlite/src/test/rollback2.test +++ b/third_party/sqlite/src/test/rollback2.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file containst tests to verify that ROLLBACK or ROLLBACK TO +# This file containst tests to verify that ROLLBACK or ROLLBACK TO # operations interact correctly with ongoing SELECT statements. # diff --git a/third_party/sqlite/src/test/rollbackfault.test b/third_party/sqlite/src/test/rollbackfault.test index 4d060b43c8b8a..e55beddf1f19c 100644 --- a/third_party/sqlite/src/test/rollbackfault.test +++ b/third_party/sqlite/src/test/rollbackfault.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# Test that errors encountered during a ROLLBACK operation correctly +# Test that errors encountered during a ROLLBACK operation correctly # affect ongoing SQL statements. # @@ -41,17 +41,17 @@ foreach f {oom ioerr} { set sql2 { SELECT i FROM t1 WHERE (i%2)==0 ORDER BY h } set ::s1 [sqlite3_prepare db $sql1 -1 dummy] set ::s2 [sqlite3_prepare db $sql2 -1 dummy] - + for {set i 0} {$i < 10} {incr i} { sqlite3_step $::s1 } for {set i 0} {$i < 3} {incr i} { sqlite3_step $::s2 } - + execsql { BEGIN; DELETE FROM t1 WHERE (i%2) } } -body { execsql { ROLLBACK } } -test { - + set res1 [list] set res2 [list] while {"SQLITE_ROW" == [sqlite3_step $::s1]} { @@ -62,10 +62,10 @@ foreach f {oom ioerr} { } set rc1 [sqlite3_finalize $::s1] set rc2 [sqlite3_finalize $::s2] - + catchsql { ROLLBACK } - - if {$rc1=="SQLITE_OK" && $rc2=="SQLITE_OK" + + if {$rc1=="SQLITE_OK" && $rc2=="SQLITE_OK" && $res1=="22 24 26 28 30 32 34 36 38 40" && $res2=="8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40" } { diff --git a/third_party/sqlite/src/test/rowallock.test b/third_party/sqlite/src/test/rowallock.test index a1cab8d327c2c..a77298a022be3 100644 --- a/third_party/sqlite/src/test/rowallock.test +++ b/third_party/sqlite/src/test/rowallock.test @@ -25,7 +25,7 @@ ifcapable !mmap { do_multiclient_test tn { code2 { db2 close } code3 { db3 close } - + do_execsql_test 1.$tn.1 { PRAGMA page_size = 4096; CREATE TABLE t1(a, b); @@ -34,8 +34,8 @@ do_multiclient_test tn { PRAGMA journal_mode = wal; } {wal} - code1 { - db close + code1 { + db close sqlite3 db test.db -readonly 1 } diff --git a/third_party/sqlite/src/test/rowid.test b/third_party/sqlite/src/test/rowid.test index 56336453faa1a..42666f41b28ed 100644 --- a/third_party/sqlite/src/test/rowid.test +++ b/third_party/sqlite/src/test/rowid.test @@ -260,14 +260,14 @@ do_test rowid-4.5 { execsql {CREATE INDEX idxt2 ON t2(y)} set sqlite_search_count 0 concat [execsql { - SELECT t1.x FROM t2, t1 + SELECT t1.x FROM t2, t1 WHERE t2.y==256 AND t1.rowid==t2.rowid }] $sqlite_search_count } {4 3} do_test rowid-4.5.1 { set sqlite_search_count 0 concat [execsql { - SELECT t1.x FROM t2, t1 + SELECT t1.x FROM t2, t1 WHERE t1.OID==t2.rowid AND t2.y==81 }] $sqlite_search_count } {3 3} @@ -371,7 +371,7 @@ ifcapable subquery { INSERT INTO t2(b) VALUES(33); INSERT INTO t2(b) VALUES(44); INSERT INTO t2(b) VALUES(55); - SELECT b FROM t2 WHERE a NOT IN(1,2,1000000,1000001,2147483647) + SELECT b FROM t2 WHERE a NOT IN(1,2,1000000,1000001,2147483647) ORDER BY b; } } {11 22 33 44 55} diff --git a/third_party/sqlite/src/test/rowvalue.test b/third_party/sqlite/src/test/rowvalue.test index 5f2701c733815..8dba82c146531 100644 --- a/third_party/sqlite/src/test/rowvalue.test +++ b/third_party/sqlite/src/test/rowvalue.test @@ -130,7 +130,7 @@ do_execsql_test 6.0 { INSERT INTO hh VALUES('GHI', 3, 'v'); INSERT INTO hh VALUES('ghi', 3, 'vi'); - CREATE INDEX hh_ab ON hh(a, b); + CREATE INDEX hh_ab ON hh(a, b); } do_execsql_test 6.1 { @@ -174,7 +174,7 @@ do_execsql_test 7.0 { foreach {tn sql res eqp} { - 1 "SELECT * FROM xy WHERE (i, j) IS (2, 2)" {2 2 2} + 1 "SELECT * FROM xy WHERE (i, j) IS (2, 2)" {2 2 2} "0 0 0 {SEARCH TABLE xy USING INTEGER PRIMARY KEY (rowid=?)}" 2 "SELECT * FROM xy WHERE (k, j) < (2, 3)" {1 1 1 2 2 2} @@ -217,7 +217,7 @@ foreach {tn q res} { 4 "(a, b) < (4, 3)" {1 2 3} } { do_execsql_test 9.$tn "SELECT c FROM t2 WHERE $q" $res -} +} do_execsql_test 10.0 { CREATE TABLE dual(dummy); INSERT INTO dual(dummy) VALUES('X'); @@ -370,7 +370,7 @@ do_execsql_test 16.4 { INSERT INTO t16c VALUES(2, 'w', 'x', 'y', 'z'); SELECT * FROM t16c; } { - 1 D A B C + 1 D A B C 2 w x y z } diff --git a/third_party/sqlite/src/test/rowvalue2.test b/third_party/sqlite/src/test/rowvalue2.test index 1502e31a545a7..9f9b50acf04b8 100644 --- a/third_party/sqlite/src/test/rowvalue2.test +++ b/third_party/sqlite/src/test/rowvalue2.test @@ -26,7 +26,7 @@ do_execsql_test 1.0 { CREATE INDEX i1 ON t1(a, b); } -do_execsql_test 1.1.1 { SELECT c FROM t1 WHERE (a, b) >= (1, 0) } {2 3} +do_execsql_test 1.1.1 { SELECT c FROM t1 WHERE (a, b) >= (1, 0) } {2 3} do_execsql_test 1.1.2 { SELECT c FROM t1 WHERE (a, b) > (1, 0) } {3} #------------------------------------------------------------------------- @@ -108,7 +108,7 @@ foreach {tn idx} { foreach op [list > >= < <= == IS] { do_execsql_test 3.1.$tn.$w.$op [subst -novar { - SELECT rowid FROM t3 WHERE (a, b, c) [set op] ($a, $b, $c) + SELECT rowid FROM t3 WHERE (a, b, c) [set op] ($a, $b, $c) ORDER BY +rowid }] [db eval [subst -novar { SELECT rowid FROM t3 WHERE w [set op] $w ORDER BY +rowid diff --git a/third_party/sqlite/src/test/rowvalue3.test b/third_party/sqlite/src/test/rowvalue3.test index 988eea90084aa..46197989e2f43 100644 --- a/third_party/sqlite/src/test/rowvalue3.test +++ b/third_party/sqlite/src/test/rowvalue3.test @@ -78,7 +78,7 @@ foreach {tn idx} { do_execsql_test 2.$tn.3 { SELECT * FROM z1 WHERE (x, +y) IN (SELECT a, b FROM kk) } {d e f} - + do_execsql_test 2.$tn.4 { SELECT * FROM z1 WHERE (x, +y) IN (SELECT a, b||'x' FROM kk) } {} @@ -132,21 +132,21 @@ foreach {tn idx} { { 3 1 3 2 3 3 2 1 2 2 2 3 1 1 1 2 1 3 } 7 { - SELECT c, d FROM c1 WHERE (c,d) IN (SELECT d, c FROM c1) + SELECT c, d FROM c1 WHERE (c,d) IN (SELECT d, c FROM c1) ORDER BY c DESC, d ASC } { 3 1 3 2 3 3 2 1 2 2 2 3 1 1 1 2 1 3 } 8 { - SELECT c, d FROM c1 WHERE (c,d) IN (SELECT d, c FROM c1) + SELECT c, d FROM c1 WHERE (c,d) IN (SELECT d, c FROM c1) ORDER BY c ASC, d DESC } { 1 3 1 2 1 1 2 3 2 2 2 1 3 3 3 2 3 1 } 9 { - SELECT c, d FROM c1 WHERE (c,d) IN (SELECT d, c FROM c1) + SELECT c, d FROM c1 WHERE (c,d) IN (SELECT d, c FROM c1) ORDER BY c ASC, d ASC } { 1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3 } 10 { - SELECT c, d FROM c1 WHERE (c,d) IN (SELECT d, c FROM c1) + SELECT c, d FROM c1 WHERE (c,d) IN (SELECT d, c FROM c1) ORDER BY c DESC, d DESC } { 3 3 3 2 3 1 2 3 2 2 2 1 1 3 1 2 1 1 } @@ -177,13 +177,13 @@ foreach {tn idx} { 2 { CREATE INDEX h1 ON hh(a, b); } 3 { CREATE UNIQUE INDEX k1idx ON k1(x, y) } 4 { CREATE UNIQUE INDEX k1idx ON k1(x, y DESC) } - 5 { + 5 { CREATE INDEX h1 ON hh(a, b); - CREATE UNIQUE INDEX k1idx ON k1(x, y); + CREATE UNIQUE INDEX k1idx ON k1(x, y); } - 6 { + 6 { CREATE INDEX h1 ON hh(a, b); - CREATE UNIQUE INDEX k1idx ON k1(x, y DESC); + CREATE UNIQUE INDEX k1idx ON k1(x, y DESC); } } { drop_all_indexes diff --git a/third_party/sqlite/src/test/rowvalue4.test b/third_party/sqlite/src/test/rowvalue4.test index 2e6a28c230911..2cd593eeb5f5a 100644 --- a/third_party/sqlite/src/test/rowvalue4.test +++ b/third_party/sqlite/src/test/rowvalue4.test @@ -19,7 +19,7 @@ set ::testprefix rowvalue4 #------------------------------------------------------------------------- # Test some error conditions: -# +# # * row values used where they are not supported, # * row values or sub-selects that contain/return the wrong number # of elements. @@ -42,10 +42,10 @@ foreach {tn s error} { 2 "SELECT * FROM t1 WHERE b = (1, 2)" {row value misused} 3 "SELECT * FROM t1 WHERE NOT (b = (1, 2))" {row value misused} 4 "SELECT * FROM t1 LIMIT (1, 2)" {row value misused} - 5 "SELECT (a, b) IN (SELECT * FROM t1) FROM t1" + 5 "SELECT (a, b) IN (SELECT * FROM t1) FROM t1" {sub-select returns 3 columns - expected 2} - 6 "SELECT * FROM t1 WHERE (a, b) IN (SELECT * FROM t1)" + 6 "SELECT * FROM t1 WHERE (a, b) IN (SELECT * FROM t1)" {sub-select returns 3 columns - expected 2} 7 "SELECT * FROM t1 WHERE (c, c) <= 1" {row value misused} 8 "SELECT * FROM t1 WHERE (b, b) <= 1" {row value misused} @@ -112,7 +112,7 @@ foreach {nm idx} { 7 "(a, b, c) >= (2, NULL, NULL)" {19 20 21 22 23 24 25 26 27} 8 "(a, b, c) <= (2, NULL, NULL)" {1 2 3 4 5 6 7 8 9} - 9 "(a, b, c) < (SELECT a, b, c FROM t2 WHERE d=14)" + 9 "(a, b, c) < (SELECT a, b, c FROM t2 WHERE d=14)" {1 2 3 4 5 6 7 8 9 10 11 12 13} 10 "(a, b, c) = (SELECT a, b, c FROM t2 WHERE d=14)" 14 @@ -230,14 +230,14 @@ do_execsql_test 5.0 { } do_eqp_test 5.1 { - SELECT * FROM d2 WHERE + SELECT * FROM d2 WHERE (a, b) IN (SELECT x, y FROM d1) AND (c) IN (SELECT y FROM d1) } { 0 0 0 {SEARCH TABLE d2 USING INDEX d2ab (a=? AND b=?)} - 0 0 0 {EXECUTE LIST SUBQUERY 1} + 0 0 0 {EXECUTE LIST SUBQUERY 1} 1 0 0 {SCAN TABLE d1} - 0 0 0 {EXECUTE LIST SUBQUERY 2} + 0 0 0 {EXECUTE LIST SUBQUERY 2} 2 0 0 {SCAN TABLE d1} } @@ -271,7 +271,7 @@ do_eqp_test 6.4 { do_eqp_test 6.5 { SELECT * FROM e1 WHERE (d, e) BETWEEN (?, ?) AND (?, ?) AND c = ? } { - 0 0 0 + 0 0 0 {SEARCH TABLE e1 USING INDEX e1cde (c=? AND (d,e)>(?,?) AND (d,e)<(?,?))} } @@ -305,7 +305,7 @@ do_execsql_test 8.1 { CREATE TABLE c3(d); } do_catchsql_test 8.2 { - SELECT * FROM c2 CROSS JOIN c3 WHERE + SELECT * FROM c2 CROSS JOIN c3 WHERE ( (a, b) == (SELECT x, y FROM c1) AND c3.d = c ) OR ( c == (SELECT x, y FROM c1) AND c3.d = c ) } {1 {row value misused}} diff --git a/third_party/sqlite/src/test/rowvalue6.test b/third_party/sqlite/src/test/rowvalue6.test index d90e61c811259..cf1b1e831a349 100644 --- a/third_party/sqlite/src/test/rowvalue6.test +++ b/third_party/sqlite/src/test/rowvalue6.test @@ -28,7 +28,7 @@ do_execsql_test 1.1 { } {} do_execsql_test 1.2 { INSERT INTO t1 VALUES(2,3,400); - INSERT INTO t2 VALUES(2,3,55); + INSERT INTO t2 VALUES(2,3,55); SELECT c FROM t1 WHERE (a,b) IN (SELECT x,y FROM t2 WHERE z==55); } {400} diff --git a/third_party/sqlite/src/test/rowvalue9.test b/third_party/sqlite/src/test/rowvalue9.test index 0fa652f97d688..3b271b04313cf 100644 --- a/third_party/sqlite/src/test/rowvalue9.test +++ b/third_party/sqlite/src/test/rowvalue9.test @@ -33,7 +33,7 @@ set ::testprefix rowvalue9 do_execsql_test 1.0.1 { CREATE TABLE a1(c, b INTEGER, a TEXT, PRIMARY KEY(a, b)); - + INSERT INTO a1 (rowid, c, b, a) VALUES(3, '0x03', 1, 1); INSERT INTO a1 (rowid, c, b, a) VALUES(14, '0x0E', 2, 2); INSERT INTO a1 (rowid, c, b, a) VALUES(15, '0x0F', 3, 3); @@ -46,12 +46,12 @@ do_execsql_test 1.0.1 { INSERT INTO a2(x, y) VALUES('4', '4'); } -do_execsql_test 1.0.2 { +do_execsql_test 1.0.2 { SELECT x, typeof(x), y, typeof(y) FROM a2 ORDER BY rowid } { - 1 integer 1 integer - 2 integer 2 text - 3 text 3 integer + 1 integer 1 integer + 2 integer 2 text + 3 text 3 integer 4 text 4 text } @@ -74,7 +74,7 @@ do_execsql_test 1.3.1 { SELECT a1.rowid FROM a1, a2 WHERE coalesce(NULL,x)=a AND coalesce(NULL,y)=b } {3 14 15 92} do_execsql_test 1.3.2 { - SELECT a1.rowid FROM a1, a2 + SELECT a1.rowid FROM a1, a2 WHERE (coalesce(NULL,x), coalesce(NULL,y)) = (a, b) } {3 14 15 92} @@ -117,7 +117,7 @@ do_execsql_test 2.3 { SELECT * FROM b1 WHERE a IN (SELECT x FROM b2) } {} do_execsql_test 2.4 { CREATE UNIQUE INDEX b1a ON b1(a); } do_execsql_test 2.5 { SELECT * FROM b1 WHERE a IN (SELECT x FROM b2) } {} -# Test that a multi-column version of the query that revealed problem +# Test that a multi-column version of the query that revealed problem # [199df416] also works. # do_execsql_test 3.1 { @@ -169,25 +169,25 @@ foreach {tn idx} { 4 { CREATE INDEX idx ON d1(c) } 5 { CREATE INDEX idx ON d1(c, a) } - 6 { + 6 { CREATE INDEX idx ON d1(c, a) ; CREATE INDEX idx1 ON d2(x, y); } - 7 { + 7 { CREATE INDEX idx ON d1(c, a) ; CREATE UNIQUE INDEX idx2 ON d2(x, y) ; } - 8 { + 8 { CREATE INDEX idx ON d1(c) ; CREATE UNIQUE INDEX idx2 ON d2(x); } } { - execsql { DROP INDEX IF EXISTS idx } - execsql { DROP INDEX IF EXISTS idx2 } - execsql { DROP INDEX IF EXISTS idx3 } + execsql { DROP INDEX IF EXISTS idx } + execsql { DROP INDEX IF EXISTS idx2 } + execsql { DROP INDEX IF EXISTS idx3 } execsql $idx do_execsql_test 4.$tn.1 { @@ -266,7 +266,7 @@ do_execsql_test 6.2 { #------------------------------------------------------------------------- # do_execsql_test 7.0 { - CREATE TABLE g1(a, b); + CREATE TABLE g1(a, b); INSERT INTO g1 VALUES (1, 1), (1, 2), (1, 3), (1, 'i'), (1, 'j'), (1, 6), (1, 7), (1, 8), (1, 9), (1, 10), diff --git a/third_party/sqlite/src/test/rowvaluefault.test b/third_party/sqlite/src/test/rowvaluefault.test index ac1b236ba42c4..e5d4aa4ad0d0a 100644 --- a/third_party/sqlite/src/test/rowvaluefault.test +++ b/third_party/sqlite/src/test/rowvaluefault.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # @@ -30,42 +30,42 @@ do_execsql_test 1.0 { do_faultsim_test 1 -faults oom* -body { execsql { SELECT fou FROM xyz WHERE (one, two, thr) = ('B', 'B', 'B') } } -test { - faultsim_test_result {0 2} + faultsim_test_result {0 2} } do_faultsim_test 2 -faults oom* -body { execsql { SELECT fou FROM xyz WHERE (two, thr) IS ('C', 'C') } } -test { - faultsim_test_result {0 3} + faultsim_test_result {0 3} } do_faultsim_test 3 -faults oom* -body { execsql { SELECT fou FROM xyz WHERE (one, two, thr) > ('B', 'B', 'B') } } -test { - faultsim_test_result {0 {3 4}} + faultsim_test_result {0 {3 4}} } do_faultsim_test 4 -faults oom* -body { execsql { SELECT fou FROM xyz WHERE (one, two) IN (SELECT one, two FROM xyz) } } -test { - faultsim_test_result {0 {1 2 3 4}} + faultsim_test_result {0 {1 2 3 4}} } do_faultsim_test 5 -faults oom* -body { - execsql { - SELECT fou FROM xyz - WHERE (one, two, thr) IN (SELECT one, two, thr FROM xyz) + execsql { + SELECT fou FROM xyz + WHERE (one, two, thr) IN (SELECT one, two, thr FROM xyz) } } -test { - faultsim_test_result {0 {1 2 3 4}} + faultsim_test_result {0 {1 2 3 4}} } do_faultsim_test 6 -faults oom* -body { - execsql { - SELECT fou FROM xyz + execsql { + SELECT fou FROM xyz WHERE (one, two, thr) BETWEEN ('B', 'B', 'B') AND ('C', 'C', 'C') } } -test { - faultsim_test_result {0 {2 3}} + faultsim_test_result {0 {2 3}} } finish_test diff --git a/third_party/sqlite/src/test/savepoint.test b/third_party/sqlite/src/test/savepoint.test index 8055e61d9e3ee..d05b50ad3ecf1 100644 --- a/third_party/sqlite/src/test/savepoint.test +++ b/third_party/sqlite/src/test/savepoint.test @@ -100,7 +100,7 @@ wal_check_journal_mode savepoint-1.7 #------------------------------------------------------------------------ # These tests - savepoint-2.* - test rollbacks and releases of savepoints # with a very simple data set. -# +# do_test savepoint-2.1 { execsql { @@ -187,28 +187,28 @@ wal_check_journal_mode savepoint-2.12 # # These tests do not work in WAL mode. WAL mode does not take RESERVED # locks on the database file. -# +# if {[wal_is_wal_mode]==0} { do_test savepoint-3.1 { execsql { SAVEPOINT "transaction" } execsql { PRAGMA lock_status } } {main unlocked temp closed} - + do_test savepoint-3.2 { execsql { INSERT INTO t1 VALUES(1, 2, 3) } execsql { PRAGMA lock_status } } {main reserved temp closed} - + do_test savepoint-3.3 { execsql { ROLLBACK TO "transaction" } execsql { PRAGMA lock_status } } {main reserved temp closed} - + do_test savepoint-3.4 { execsql { INSERT INTO t1 VALUES(1, 2, 3) } execsql { PRAGMA lock_status } } {main reserved temp closed} - + do_test savepoint-3.5 { execsql { RELEASE "transaction" } execsql { PRAGMA lock_status } @@ -218,7 +218,7 @@ if {[wal_is_wal_mode]==0} { #------------------------------------------------------------------------ # Test that savepoints that include schema modifications are handled # correctly. Test cases savepoint-4.*. -# +# do_test savepoint-4.1 { execsql { CREATE TABLE t2(d, e, f); @@ -277,7 +277,7 @@ wal_check_journal_mode savepoint-4.9 #------------------------------------------------------------------------ # Test some logic errors to do with the savepoint feature. -# +# ifcapable incrblob { do_test savepoint-5.1.1 { @@ -293,12 +293,12 @@ ifcapable incrblob { close $fd catchsql {SAVEPOINT abc} } {0 {}} - + do_test savepoint-5.2 { execsql {RELEASE abc} catchsql {RELEASE abc} } {1 {no such savepoint: abc}} - + do_test savepoint-5.3.1 { execsql {SAVEPOINT abc} catchsql {ROLLBACK TO def} @@ -329,7 +329,7 @@ ifcapable incrblob { close $fd execsql {release abc} } {} - + # Rollback mode: # # Open a savepoint transaction and insert a row into the database. Then, @@ -338,7 +338,7 @@ ifcapable incrblob { # until after the read-only transaction has been closed. # # WAL mode: - # + # # As above, except that the savepoint transaction can be successfully # committed before the read-only transaction has been closed. # @@ -423,7 +423,7 @@ ifcapable {autovacuum && pragma} { } #------------------------------------------------------------------------- -# The following tests, savepoint-7.*, attempt to break the logic +# The following tests, savepoint-7.*, attempt to break the logic # surrounding savepoints by growing and shrinking the database file. # db close @@ -609,9 +609,9 @@ ifcapable auth { } #------------------------------------------------------------------------- -# The following tests - savepoint-10.* - test the interaction of +# The following tests - savepoint-10.* - test the interaction of # savepoints and ATTACH statements. -# +# # First make sure it is not possible to attach or detach a database while # a savepoint is open (it is not possible if any transaction is open). @@ -665,7 +665,7 @@ if {[wal_is_wal_mode]==0} { do_test savepoint-10.2.2 { execsql { PRAGMA lock_status } } [list main unlocked temp $templockstate aux1 unlocked aux2 unlocked] - + do_test savepoint-10.2.3 { execsql { SAVEPOINT one; @@ -704,7 +704,7 @@ if {[wal_is_wal_mode]==0} { INSERT INTO t2 VALUES(5, 6); RELEASE one; } - execsql { + execsql { SELECT * FROM t1; SELECT * FROM t2; SELECT * FROM t3; @@ -713,9 +713,9 @@ if {[wal_is_wal_mode]==0} { do_test savepoint-10.2.9 { execsql { PRAGMA lock_status } } [list main unlocked temp $templockstate aux1 unlocked aux2 unlocked] - + do_test savepoint-10.2.10 { - execsql { + execsql { SAVEPOINT one; INSERT INTO t1 VALUES('a', 'b'); SAVEPOINT two; @@ -723,7 +723,7 @@ if {[wal_is_wal_mode]==0} { SAVEPOINT three; INSERT INTO t3 VALUES('e', 'f'); } - execsql { + execsql { SELECT * FROM t1; SELECT * FROM t2; SELECT * FROM t3; @@ -731,18 +731,18 @@ if {[wal_is_wal_mode]==0} { } {1 2 a b 5 6 c d 3 4 e f} do_test savepoint-10.2.11 { execsql { ROLLBACK TO two } - execsql { + execsql { SELECT * FROM t1; SELECT * FROM t2; SELECT * FROM t3; } } {1 2 a b 5 6 3 4} do_test savepoint-10.2.12 { - execsql { + execsql { INSERT INTO t3 VALUES('g', 'h'); ROLLBACK TO two; } - execsql { + execsql { SELECT * FROM t1; SELECT * FROM t2; SELECT * FROM t3; @@ -750,7 +750,7 @@ if {[wal_is_wal_mode]==0} { } {1 2 a b 5 6 3 4} do_test savepoint-10.2.13 { execsql { ROLLBACK } - execsql { + execsql { SELECT * FROM t1; SELECT * FROM t2; SELECT * FROM t3; @@ -762,10 +762,10 @@ if {[wal_is_wal_mode]==0} { } #------------------------------------------------------------------------- -# The following tests - savepoint-11.* - test the interaction of -# savepoints and creating or dropping tables and indexes in +# The following tests - savepoint-11.* - test the interaction of +# savepoints and creating or dropping tables and indexes in # auto-vacuum mode. -# +# do_test savepoint-11.1 { db close forcedelete test.db @@ -792,7 +792,7 @@ do_test savepoint-11.4 { } {} integrity_check savepoint-11.5 do_test savepoint-11.6 { - execsql { + execsql { CREATE TABLE t3(a, b, UNIQUE(a, b)); ROLLBACK TO one; } @@ -834,9 +834,9 @@ do_test savepoint-11.12 { wal_check_journal_mode savepoint-11.13 #------------------------------------------------------------------------- -# The following tests - savepoint-12.* - test the interaction of +# The following tests - savepoint-12.* - test the interaction of # savepoints and "ON CONFLICT ROLLBACK" clauses. -# +# do_test savepoint-12.1 { execsql { CREATE TABLE t4(a PRIMARY KEY, b); @@ -847,9 +847,9 @@ do_test savepoint-12.2 { # The final statement of the following SQL hits a constraint when the # conflict handling mode is "OR ROLLBACK" and there are a couple of # open savepoints. At one point this would fail to clear the internal - # record of the open savepoints, resulting in an assert() failure + # record of the open savepoints, resulting in an assert() failure # later on. - # + # catchsql { BEGIN; INSERT INTO t4 VALUES(2, 'two'); @@ -868,9 +868,9 @@ do_test savepoint-12.4 { wal_check_journal_mode savepoint-12.5 #------------------------------------------------------------------------- -# The following tests - savepoint-13.* - test the interaction of +# The following tests - savepoint-13.* - test the interaction of # savepoints and "journal_mode = off". -# +# if {[wal_is_wal_mode]==0} { do_test savepoint-13.1 { db close @@ -1029,7 +1029,7 @@ do_multiclient_test tn { # This next block of tests verifies that a problem reported on the mailing # list has been resolved. At one point the second "CREATE TABLE t6" would # fail as table t6 still existed in the internal cache of the db schema -# (even though it had been removed from the database by the ROLLBACK +# (even though it had been removed from the database by the ROLLBACK # command). # sqlite3 db test.db diff --git a/third_party/sqlite/src/test/savepoint2.test b/third_party/sqlite/src/test/savepoint2.test index be1bdbd424539..ae1a32beecdd1 100644 --- a/third_party/sqlite/src/test/savepoint2.test +++ b/third_party/sqlite/src/test/savepoint2.test @@ -61,7 +61,7 @@ set SQL(2) { INSERT INTO t3 SELECT randstr(10,10)||x FROM t3; DELETE FROM t3 WHERE random()%10!=0; INSERT INTO t3 SELECT randstr(10,10)||x FROM t3; -} +} set SQL(3) { UPDATE t3 SET x = randstr(10, 400) WHERE random()%10; INSERT INTO t3 SELECT x FROM t3 WHERE random()%10; @@ -88,7 +88,7 @@ for {set ii 2} {$ii < ($iterations+2)} {incr ii} { # Execute some SQL on the database. Then rollback to savepoint "one". # Check that the database signature is as it was when "one" was opened. - # + # do_test savepoint2-$ii.2 { execsql $SQL(1) execsql "ROLLBACK to one" @@ -105,7 +105,7 @@ for {set ii 2} {$ii < ($iterations+2)} {incr ii} { execsql "SAVEPOINT two" } {} - # More SQL changes. The rollback to savepoint "two". Check that the + # More SQL changes. The rollback to savepoint "two". Check that the # signature is as it was when savepoint "two" was opened. # do_test savepoint2-$ii.4 { @@ -115,7 +115,7 @@ for {set ii 2} {$ii < ($iterations+2)} {incr ii} { } $::sig(two) integrity_check savepoint2-$ii.4.1 - # More SQL changes. The rollback to savepoint "two". Check that the + # More SQL changes. The rollback to savepoint "two". Check that the # signature is as it was when savepoint "two" was opened. # do_test savepoint2-$ii.5 { @@ -127,12 +127,12 @@ for {set ii 2} {$ii < ($iterations+2)} {incr ii} { signature } $::sig(one) - # By this point the database is in the same state as it was at the - # top of the for{} loop (everything having been rolled back by the - # "ROLLBACK TO one" command above). So make a few changes to the + # By this point the database is in the same state as it was at the + # top of the for{} loop (everything having been rolled back by the + # "ROLLBACK TO one" command above). So make a few changes to the # database and COMMIT the open transaction, so that the next iteration # of the for{} loop works on a different dataset. - # + # # The transaction being committed here may have been opened normally using # "BEGIN", or may have been opened using a transaction savepoint created # by the "SAVEPOINT one" statement. diff --git a/third_party/sqlite/src/test/savepoint6.test b/third_party/sqlite/src/test/savepoint6.test index b1d0d46f5c9f3..6604c05434d64 100644 --- a/third_party/sqlite/src/test/savepoint6.test +++ b/third_party/sqlite/src/test/savepoint6.test @@ -42,7 +42,7 @@ if {0==[info exists ::G(savepoint6_iterations)]} { # 2. A serialized Tcl array representing the contents of table t1 at the # start of the savepoint. The keys of the array are the x values. The # values are the y values. -# +# # Array ::aEntry contains the contents of database table t1. Array keys are # x values, the array data values are y values. # @@ -161,17 +161,17 @@ proc random_integers {nRes nRange} { lappend ret [expr int(rand()*$nRange)] } return $ret -} +} #------------------------------------------------------------------------- proc database_op {} { - set i [expr int(rand()*2)] + set i [expr int(rand()*2)] if {$i==0} { insert_rows [random_integers 100 1000] } if {$i==1} { delete_rows [random_integers 100 1000] - set i [expr int(rand()*3)] + set i [expr int(rand()*3)] if {$i==0} { sql {PRAGMA incremental_vacuum} } @@ -203,9 +203,9 @@ do_test savepoint6-1.1 { } {} do_test savepoint6-1.2 { insert_rows { - 497 166 230 355 779 588 394 317 290 475 362 193 805 851 564 - 763 44 930 389 819 765 760 966 280 538 414 500 18 25 287 320 - 30 382 751 87 283 981 429 630 974 421 270 810 405 + 497 166 230 355 779 588 394 317 290 475 362 193 805 851 564 + 763 44 930 389 819 765 760 966 280 538 414 500 18 25 287 320 + 30 382 751 87 283 981 429 630 974 421 270 810 405 } savepoint one @@ -258,13 +258,13 @@ foreach zSetup [list { release one checkdb } {ok} - + for {set i 0} {$i < $::G(savepoint6_iterations)} {incr i} { do_test savepoint6-$testname.$i.1 { savepoint_op checkdb } {ok} - + do_test savepoint6-$testname.$i.2 { database_op database_op diff --git a/third_party/sqlite/src/test/savepointfault.test b/third_party/sqlite/src/test/savepointfault.test index 0329f8caa2783..fe6f4c64d07fb 100644 --- a/third_party/sqlite/src/test/savepointfault.test +++ b/third_party/sqlite/src/test/savepointfault.test @@ -33,21 +33,21 @@ do_malloc_test 2 -sqlprep { PRAGMA cache_size = 10; CREATE TABLE t1(a, b, c); INSERT INTO t1 VALUES(randstr(400,400), randstr(400,400), randstr(400,400)); - INSERT INTO t1 SELECT + INSERT INTO t1 SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; - INSERT INTO t1 + INSERT INTO t1 SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; - INSERT INTO t1 + INSERT INTO t1 SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; - INSERT INTO t1 + INSERT INTO t1 SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; - INSERT INTO t1 + INSERT INTO t1 SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; - INSERT INTO t1 + INSERT INTO t1 SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; - INSERT INTO t1 + INSERT INTO t1 SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; - INSERT INTO t1 + INSERT INTO t1 SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; } -sqlbody { PRAGMA cache_size = 10; diff --git a/third_party/sqlite/src/test/scanstatus.test b/third_party/sqlite/src/test/scanstatus.test index ed24d9743710c..4fbb057b4deab 100644 --- a/third_party/sqlite/src/test/scanstatus.test +++ b/third_party/sqlite/src/test/scanstatus.test @@ -63,7 +63,7 @@ do_execsql_test 1.6 { SELECT count(*) FROM t1, t2 WHERE t2.rowid>1; } 4 do_scanstatus_test 1.7 { - nLoop 1 nVisit 2 nEst 2.0 zName t2 zExplain + nLoop 1 nVisit 2 nEst 2.0 zName t2 zExplain {SEARCH TABLE t2 USING INTEGER PRIMARY KEY (rowid>?)} nLoop 2 nVisit 4 nEst 2.0 zName t1 zExplain {SCAN TABLE t1} } @@ -73,7 +73,7 @@ do_execsql_test 1.8 { } 4 do_scanstatus_test 1.9 { - nLoop 2 nVisit 4 nEst 2.0 zName t2 zExplain + nLoop 2 nVisit 4 nEst 2.0 zName t2 zExplain {SEARCH TABLE t2 USING INTEGER PRIMARY KEY (rowid>?)} nLoop 4 nVisit 8 nEst 2.0 zName t1 zExplain {SCAN TABLE t1} } @@ -83,7 +83,7 @@ do_test 1.9 { } {} do_scanstatus_test 1.10 { - nLoop 0 nVisit 0 nEst 2.0 zName t2 zExplain + nLoop 0 nVisit 0 nEst 2.0 zName t2 zExplain {SEARCH TABLE t2 USING INTEGER PRIMARY KEY (rowid>?)} nLoop 0 nVisit 0 nEst 2.0 zName t1 zExplain {SCAN TABLE t1} } @@ -104,7 +104,7 @@ do_execsql_test 2.1 { } {2 two} do_scanstatus_test 2.2 { - nLoop 1 nVisit 1 nEst 1.0 zName x1 + nLoop 1 nVisit 1 nEst 1.0 zName x1 zExplain {SEARCH TABLE x1 USING INTEGER PRIMARY KEY (rowid=?)} } @@ -112,7 +112,7 @@ do_execsql_test 2.3.1 { SELECT * FROM x1 WHERE j='two' } {2 two} do_scanstatus_test 2.3.2 { - nLoop 1 nVisit 1 nEst 10.0 zName x1j + nLoop 1 nVisit 1 nEst 10.0 zName x1j zExplain {SEARCH TABLE x1 USING COVERING INDEX x1j (j=?)} } @@ -120,7 +120,7 @@ do_execsql_test 2.4.1 { SELECT * FROM x1 WHERE j<'two' } {4 four 1 one 3 three} do_scanstatus_test 2.4.2 { - nLoop 1 nVisit 3 nEst 262144.0 zName x1j + nLoop 1 nVisit 3 nEst 262144.0 zName x1j zExplain {SEARCH TABLE x1 USING COVERING INDEX x1j (j='two' } {2 two} do_scanstatus_test 2.5.2 { - nLoop 1 nVisit 1 nEst 262144.0 zName x1j + nLoop 1 nVisit 1 nEst 262144.0 zName x1j zExplain {SEARCH TABLE x1 USING COVERING INDEX x1j (j>?)} } @@ -136,7 +136,7 @@ do_execsql_test 2.6.1 { SELECT * FROM x1 WHERE j BETWEEN 'three' AND 'two' } {3 three 2 two} do_scanstatus_test 2.6.2 { - nLoop 1 nVisit 2 nEst 16384.0 zName x1j + nLoop 1 nVisit 2 nEst 16384.0 zName x1j zExplain {SEARCH TABLE x1 USING COVERING INDEX x1j (j>? AND j? AND j? AND a? AND b? AND b? AND a10 } 11 { ALTER TABLE t4 ADD COLUMN c } { INSERT INTO t4(a,b,c) VALUES(1,2,3) } 12 { ALTER TABLE t6 ADD COLUMN c } { CREATE INDEX i2 ON t6(c) } - 13 { ALTER TABLE t6 ADD COLUMN d } { + 13 { ALTER TABLE t6 ADD COLUMN d } { CREATE TRIGGER tr1 AFTER UPDATE OF d ON t6 BEGIN SELECT 1, 2, 3; END; @@ -78,7 +78,7 @@ do_multiclient_test tn { } 21 { CREATE TRIGGER tr3 BEFORE DELETE ON t7 BEGIN SELECT 1, 2, 3 ; END } { DROP TRIGGER IF EXISTS tr3; - CREATE TRIGGER tr3 AFTER INSERT ON t7 BEGIN SELECT 1, 2, 3 ; END + CREATE TRIGGER tr3 AFTER INSERT ON t7 BEGIN SELECT 1, 2, 3 ; END } 22 { CREATE TABLE t8(a, b) } { diff --git a/third_party/sqlite/src/test/schema4.test b/third_party/sqlite/src/test/schema4.test index 9b794ee555bd7..7aa03962c5586 100644 --- a/third_party/sqlite/src/test/schema4.test +++ b/third_party/sqlite/src/test/schema4.test @@ -107,11 +107,11 @@ ifcapable altertable { do_execsql_test schema4-2.1 { CREATE TABLE log(x, a, b); CREATE TABLE tbl(a, b); - + CREATE TABLE t1(a, b); CREATE INDEX i1 ON t1(a, b); } {} - + do_execsql_test schema4-2.2 { CREATE TRIGGER t1 AFTER INSERT ON tbl BEGIN INSERT INTO log VALUES('after insert', new.a, new.b); @@ -123,7 +123,7 @@ ifcapable altertable { do_execsql_test schema4-2.3 { ALTER TABLE t1 RENAME TO t2 } {} - do_execsql_test schema4-2.4 { + do_execsql_test schema4-2.4 { INSERT INTO tbl VALUES('a', 'b'); DELETE FROM tbl; SELECT * FROM log; @@ -132,7 +132,7 @@ ifcapable altertable { db close sqlite3 db test.db - do_execsql_test schema4-2.5 { + do_execsql_test schema4-2.5 { DELETE FROM log; INSERT INTO tbl VALUES('c', 'd'); DELETE FROM tbl; @@ -158,7 +158,7 @@ ifcapable altertable { select sql from sqlite_temp_master WHERE type='table'; } {{CREATE TABLE x1(x)}} - do_execsql_test schema4-2.10 { + do_execsql_test schema4-2.10 { DELETE FROM log; INSERT INTO tbl2 VALUES('e', 'f'); UPDATE tbl2 SET a='g', b='h'; diff --git a/third_party/sqlite/src/test/schema5.test b/third_party/sqlite/src/test/schema5.test index 29df3f16f51cc..5e56177945265 100644 --- a/third_party/sqlite/src/test/schema5.test +++ b/third_party/sqlite/src/test/schema5.test @@ -64,6 +64,6 @@ do_test schema5-1.7 { - + finish_test diff --git a/third_party/sqlite/src/test/securedel2.test b/third_party/sqlite/src/test/securedel2.test index 9badc560d4e0c..5a929e15d7971 100644 --- a/third_party/sqlite/src/test/securedel2.test +++ b/third_party/sqlite/src/test/securedel2.test @@ -58,7 +58,7 @@ do_execsql_test 1.4.2 { DELETE FROM t1 WHERE rowid = 1 } do_test 1.4.3 { detect_blob test.db 1 } {0} do_execsql_test 1.5.1 { DELETE FROM t1 WHERE rowid>850 } {} -do_test 1.5.2 { +do_test 1.5.2 { set n 0 detect_blob_prepare test.db for {set i 851} {$i <= 1000} {incr i 5} { @@ -69,7 +69,7 @@ do_test 1.5.2 { db close sqlite3 db test.db -do_test 1.6.1 { +do_test 1.6.1 { execsql { PRAGMA cache_size = 200; PRAGMA secure_delete = 1; @@ -82,7 +82,7 @@ do_test 1.6.1 { execsql { DELETE FROM t1 } } {} -do_test 1.6.2 { +do_test 1.6.2 { set n 0 detect_blob_prepare test.db for {set i 2} {$i <= 850} {incr i 5} { diff --git a/third_party/sqlite/src/test/select1.test b/third_party/sqlite/src/test/select1.test index 4d6c07f2d0c6e..09ed84cfbefa2 100644 --- a/third_party/sqlite/src/test/select1.test +++ b/third_party/sqlite/src/test/select1.test @@ -474,37 +474,37 @@ do_test select1-6.5.1 { lappend v $msg } {0 {test1.f1+F2 33 test1.f1+F2 77}} do_test select1-6.6 { - set v [catch {execsql2 {SELECT test1.f1+F2, t1 FROM test1, test2 + set v [catch {execsql2 {SELECT test1.f1+F2, t1 FROM test1, test2 ORDER BY f2}} msg] lappend v $msg } {0 {test1.f1+F2 33 t1 abc test1.f1+F2 77 t1 abc}} do_test select1-6.7 { - set v [catch {execsql2 {SELECT A.f1, t1 FROM test1 as A, test2 + set v [catch {execsql2 {SELECT A.f1, t1 FROM test1 as A, test2 ORDER BY f2}} msg] lappend v $msg } {0 {f1 11 t1 abc f1 33 t1 abc}} do_test select1-6.8 { - set v [catch {execsql2 {SELECT A.f1, f1 FROM test1 as A, test1 as B + set v [catch {execsql2 {SELECT A.f1, f1 FROM test1 as A, test1 as B ORDER BY f2}} msg] lappend v $msg } {1 {ambiguous column name: f1}} do_test select1-6.8b { - set v [catch {execsql2 {SELECT A.f1, B.f1 FROM test1 as A, test1 as B + set v [catch {execsql2 {SELECT A.f1, B.f1 FROM test1 as A, test1 as B ORDER BY f2}} msg] lappend v $msg } {1 {ambiguous column name: f2}} do_test select1-6.8c { - set v [catch {execsql2 {SELECT A.f1, f1 FROM test1 as A, test1 as A + set v [catch {execsql2 {SELECT A.f1, f1 FROM test1 as A, test1 as A ORDER BY f2}} msg] lappend v $msg } {1 {ambiguous column name: A.f1}} do_test select1-6.9.1 { - set v [catch {execsql {SELECT A.f1, B.f1 FROM test1 as A, test1 as B + set v [catch {execsql {SELECT A.f1, B.f1 FROM test1 as A, test1 as B ORDER BY A.f1, B.f1}} msg] lappend v $msg } {0 {11 11 11 33 33 11 33 33}} do_test select1-6.9.2 { - set v [catch {execsql2 {SELECT A.f1, B.f1 FROM test1 as A, test1 as B + set v [catch {execsql2 {SELECT A.f1, B.f1 FROM test1 as A, test1 as B ORDER BY A.f1, B.f1}} msg] lappend v $msg } {0 {f1 11 f1 11 f1 33 f1 33 f1 11 f1 11 f1 33 f1 33}} @@ -639,21 +639,21 @@ do_test select1-6.20 { INSERT INTO t6 VALUES('b','1'); INSERT INTO t6 VALUES('c','2'); INSERT INTO t6 VALUES('d','3'); - SELECT a FROM t6 WHERE b IN + SELECT a FROM t6 WHERE b IN (SELECT b FROM t6 WHERE a<='b' UNION SELECT '3' AS x ORDER BY 1 LIMIT 1) } } {a} do_test select1-6.21 { execsql { - SELECT a FROM t6 WHERE b IN + SELECT a FROM t6 WHERE b IN (SELECT b FROM t6 WHERE a<='b' UNION SELECT '3' AS x ORDER BY 1 DESC LIMIT 1) } } {d} do_test select1-6.22 { execsql { - SELECT a FROM t6 WHERE b IN + SELECT a FROM t6 WHERE b IN (SELECT b FROM t6 WHERE a<='b' UNION SELECT '3' AS x ORDER BY b LIMIT 2) ORDER BY a; @@ -661,7 +661,7 @@ do_test select1-6.22 { } {a b} do_test select1-6.23 { execsql { - SELECT a FROM t6 WHERE b IN + SELECT a FROM t6 WHERE b IN (SELECT b FROM t6 WHERE a<='b' UNION SELECT '3' AS x ORDER BY x DESC LIMIT 2) ORDER BY a; @@ -1010,16 +1010,16 @@ ifcapable subquery { } for {set i 0} {$i<10} {incr i} { execsql { - INSERT INTO abc SELECT a+(select max(a) FROM abc), + INSERT INTO abc SELECT a+(select max(a) FROM abc), b+(select max(a) FROM abc), c+(select max(a) FROM abc) FROM abc; } } execsql {COMMIT} - + # This used to seg-fault when the problem existed. execsql { SELECT count( - (SELECT a FROM abc WHERE a = NULL AND b >= upper.c) + (SELECT a FROM abc WHERE a = NULL AND b >= upper.c) ) FROM abc AS upper; } } {0} @@ -1032,8 +1032,8 @@ db close sqlite3 db test.db do_test select1-14.1 { - execsql { - SELECT * FROM sqlite_master WHERE rowid>10; + execsql { + SELECT * FROM sqlite_master WHERE rowid>10; SELECT * FROM sqlite_master WHERE rowid=10; SELECT * FROM sqlite_master WHERE rowid<10; SELECT * FROM sqlite_master WHERE rowid<=10; @@ -1042,7 +1042,7 @@ do_test select1-14.1 { } } {} do_test select1-14.2 { - execsql { + execsql { SELECT 10 IN (SELECT rowid FROM sqlite_master); } } {0} @@ -1080,5 +1080,5 @@ do_test select1-16.1 { do_catchsql_test select1-16.2 { SELECT 1 FROM sqlite_master LIMIT 1,#1; } {1 {near "#1": syntax error}} - + finish_test diff --git a/third_party/sqlite/src/test/select3.test b/third_party/sqlite/src/test/select3.test index b5dbef5fb44ce..0a3e5094b1fad 100644 --- a/third_party/sqlite/src/test/select3.test +++ b/third_party/sqlite/src/test/select3.test @@ -131,48 +131,48 @@ do_test select3-4.1 { } {4 8 5 15} do_test select3-4.2 { execsql { - SELECT log, count(*) FROM t1 - GROUP BY log - HAVING count(*)>=4 + SELECT log, count(*) FROM t1 + GROUP BY log + HAVING count(*)>=4 ORDER BY log } } {3 4 4 8 5 15} do_test select3-4.3 { execsql { - SELECT log, count(*) FROM t1 - GROUP BY log - HAVING count(*)>=4 + SELECT log, count(*) FROM t1 + GROUP BY log + HAVING count(*)>=4 ORDER BY max(n)+0 } } {3 4 4 8 5 15} do_test select3-4.4 { execsql { - SELECT log AS x, count(*) AS y FROM t1 + SELECT log AS x, count(*) AS y FROM t1 GROUP BY x - HAVING y>=4 + HAVING y>=4 ORDER BY max(n)+0 } } {3 4 4 8 5 15} do_test select3-4.5 { execsql { - SELECT log AS x FROM t1 + SELECT log AS x FROM t1 GROUP BY x - HAVING count(*)>=4 + HAVING count(*)>=4 ORDER BY max(n)+0 } } {3 4 5} do_test select3-5.1 { execsql { - SELECT log, count(*), avg(n), max(n+log*2) FROM t1 - GROUP BY log + SELECT log, count(*), avg(n), max(n+log*2) FROM t1 + GROUP BY log ORDER BY max(n+log*2)+0, avg(n)+0 } } {0 1 1.0 1 1 1 2.0 4 2 2 3.5 8 3 4 6.5 14 4 8 12.5 24 5 15 24.0 41} do_test select3-5.2 { execsql { - SELECT log, count(*), avg(n), max(n+log*2) FROM t1 - GROUP BY log + SELECT log, count(*), avg(n), max(n+log*2) FROM t1 + GROUP BY log ORDER BY max(n+log*2)+0, min(log,avg(n))+0 } } {0 1 1.0 1 1 1 2.0 4 2 2 3.5 8 3 4 6.5 14 4 8 12.5 24 5 15 24.0 41} diff --git a/third_party/sqlite/src/test/select4.test b/third_party/sqlite/src/test/select4.test index 51a1b1c4c5121..d9d2f884efb75 100644 --- a/third_party/sqlite/src/test/select4.test +++ b/third_party/sqlite/src/test/select4.test @@ -86,7 +86,7 @@ do_test select4-1.1f { } {0 1 2 3 4 5 3 4} do_test select4-1.1g { execsql { - CREATE TABLE t2 AS + CREATE TABLE t2 AS SELECT DISTINCT log FROM t1 UNION ALL SELECT n FROM t1 WHERE log=2; @@ -97,7 +97,7 @@ execsql {DROP TABLE t2} ifcapable subquery { do_test select4-1.2 { execsql { - SELECT log FROM t1 WHERE n IN + SELECT log FROM t1 WHERE n IN (SELECT DISTINCT log FROM t1 UNION ALL SELECT n FROM t1 WHERE log=3) ORDER BY log; @@ -135,7 +135,7 @@ do_test select4-2.1 { ifcapable subquery { do_test select4-2.2 { execsql { - SELECT log FROM t1 WHERE n IN + SELECT log FROM t1 WHERE n IN (SELECT DISTINCT log FROM t1 UNION SELECT n FROM t1 WHERE log=3) ORDER BY log; @@ -173,7 +173,7 @@ do_test select4-3.1.1 { } {0 1 2 3 4} do_test select4-3.1.2 { execsql { - CREATE TABLE t2 AS + CREATE TABLE t2 AS SELECT DISTINCT log FROM t1 EXCEPT SELECT n FROM t1 WHERE log=3 @@ -184,7 +184,7 @@ do_test select4-3.1.2 { execsql {DROP TABLE t2} do_test select4-3.1.3 { execsql { - CREATE TABLE t2 AS + CREATE TABLE t2 AS SELECT DISTINCT log FROM t1 EXCEPT SELECT n FROM t1 WHERE log=3 @@ -196,7 +196,7 @@ execsql {DROP TABLE t2} ifcapable subquery { do_test select4-3.2 { execsql { - SELECT log FROM t1 WHERE n IN + SELECT log FROM t1 WHERE n IN (SELECT DISTINCT log FROM t1 EXCEPT SELECT n FROM t1 WHERE log=3) ORDER BY log; @@ -260,7 +260,7 @@ execsql {DROP TABLE t2} ifcapable subquery { do_test select4-4.2 { execsql { - SELECT log FROM t1 WHERE n IN + SELECT log FROM t1 WHERE n IN (SELECT DISTINCT log FROM t1 INTERSECT SELECT n FROM t1 WHERE log=3) ORDER BY log; @@ -281,7 +281,7 @@ do_catchsql_test select4-4.4 { SELECT 0 ORDER BY 1 INTERSECT SELECT 1 - INTERSECT + INTERSECT SELECT 2 ORDER BY 1 ); @@ -497,7 +497,7 @@ do_test select4-7.1 { CREATE TABLE t2 AS SELECT log AS 'x', count(*) AS 'y' FROM t1 GROUP BY log; SELECT * FROM t2 ORDER BY x; } -} {0 1 1 1 2 2 3 4 4 8 5 15} +} {0 1 1 1 2 2 3 4 4 8 5 15} ifcapable subquery { do_test select4-7.2 { execsql2 { @@ -947,21 +947,21 @@ do_execsql_test select4-16.1 { INSERT INTO t1(a,b,c,d) SELECT x%10, x/10, x, printf('xyz%dabc',x) FROM c; - SELECT t3.c FROM + SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a; } {95 96 97 98 99} do_execsql_test select4-16.2 { - SELECT t3.c FROM + SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 CROSS JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a; } {95 96 97 98 99} do_execsql_test select4-16.3 { - SELECT t3.c FROM + SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 LEFT JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b @@ -974,7 +974,7 @@ do_execsql_test select4-16.3 { # on aggregate subqueries. But if the subquery is a compound where the # last SELECT is non-aggregate but some other SELECT is an aggregate, the # test is incomplete and the optimization is not properly disabled. -# +# # The following test cases verify that the fix works. # do_execsql_test select4-17.1 { diff --git a/third_party/sqlite/src/test/select5.test b/third_party/sqlite/src/test/select5.test index 3a787fc767aff..d6727b4905eac 100644 --- a/third_party/sqlite/src/test/select5.test +++ b/third_party/sqlite/src/test/select5.test @@ -122,7 +122,7 @@ do_test select5-4.5 { # Some tests for queries with a GROUP BY clause but no aggregate functions. # -# Note: The query in test cases 5.1 through 5.5 are not legal SQL. So if the +# Note: The query in test cases 5.1 through 5.5 are not legal SQL. So if the # implementation changes in the future and it returns different results, # this is not such a big deal. # @@ -133,27 +133,27 @@ do_test select5-5.1 { INSERT INTO t2 VALUES(1, 4, 5); INSERT INTO t2 VALUES(6, 4, 7); CREATE INDEX t2_idx ON t2(a); - } + } } {} do_test select5-5.2 { execsql { SELECT a FROM t2 GROUP BY a; - } + } } {1 6} do_test select5-5.3 { execsql { SELECT a FROM t2 WHERE a>2 GROUP BY a; - } + } } {6} do_test select5-5.4 { execsql { SELECT a, b FROM t2 GROUP BY a, b; - } + } } {1 2 1 4 6 4} do_test select5-5.5 { execsql { SELECT a, b FROM t2 GROUP BY a; - } + } } {1 4 6 4} # Test rendering of columns for the GROUP BY clause. @@ -236,7 +236,7 @@ do_test select5-8.5 { } {one 6 two 3} do_test select5-8.6 { execsql { - SELECT a, count(t8a.b) FROM t8a, t8b WHERE b=t8b.rowid + SELECT a, count(t8a.b) FROM t8a, t8b WHERE b=t8b.rowid GROUP BY a ORDER BY 2; } } {two 1 one 2} @@ -253,5 +253,5 @@ do_test select5-8.8 { - + finish_test diff --git a/third_party/sqlite/src/test/select6.test b/third_party/sqlite/src/test/select6.test index 590512a6b0709..2c35cd13da08e 100644 --- a/third_party/sqlite/src/test/select6.test +++ b/third_party/sqlite/src/test/select6.test @@ -71,7 +71,7 @@ do_test select6-1.5 { do_test select6-1.6 { execsql { - SELECT * + SELECT * FROM (SELECT count(*),y FROM t1 GROUP BY y) AS a, (SELECT max(x),y FROM t1 GROUP BY y) as b WHERE a.y=b.y ORDER BY a.y @@ -127,7 +127,7 @@ do_test select6-2.5 { do_test select6-2.6 { execsql { - SELECT * + SELECT * FROM (SELECT count(*),b FROM t2 GROUP BY b) AS a, (SELECT max(a),b FROM t2 GROUP BY b) as b WHERE a.b=b.b ORDER BY a.b @@ -220,21 +220,21 @@ do_test select6-3.10 { } {1.0 1 2.0 2.5 2 4.5 5.5 3 8.5 11.5 4 15.5 18.0 5 23.0} do_test select6-3.11 { execsql { - SELECT a,b,a+b FROM + SELECT a,b,a+b FROM (SELECT avg(x) as 'a', y as 'b' FROM t1 GROUP BY b) WHERE b<4 ORDER BY a } } {1.0 1 2.0 2.5 2 4.5 5.5 3 8.5} do_test select6-3.12 { execsql { - SELECT a,b,a+b FROM + SELECT a,b,a+b FROM (SELECT avg(x) as 'a', y as 'b' FROM t1 GROUP BY b HAVING a>1) WHERE b<4 ORDER BY a } } {2.5 2 4.5 5.5 3 8.5} do_test select6-3.13 { execsql { - SELECT a,b,a+b FROM + SELECT a,b,a+b FROM (SELECT avg(x) as 'a', y as 'b' FROM t1 GROUP BY b HAVING a>1) ORDER BY a } @@ -254,7 +254,7 @@ do_test select6-3.15 { do_test select6-4.1 { execsql { - SELECT a,b,c FROM + SELECT a,b,c FROM (SELECT x AS 'a', y AS 'b', x+y AS 'c' FROM t1 WHERE y=4) WHERE a<10 ORDER BY a; } @@ -409,7 +409,7 @@ do_test select6-8.2 { WHERE y=p } } {1 1 11 111 2 2 22 222 2 2 22 222} -# If view support is omitted from the build, then so is the query +# If view support is omitted from the build, then so is the query # "flattener". So omit this test and test select6-8.6 in that case. ifcapable view { do_test select6-8.3 { @@ -431,7 +431,7 @@ do_test select6-8.4 { } {1 1 11 111 2 2 22 222} do_test select6-8.5 { execsql { - SELECT * FROM + SELECT * FROM (SELECT y, p, q, r FROM (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m, (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n @@ -443,7 +443,7 @@ do_test select6-8.5 { ifcapable view { do_test select6-8.6 { is_flat { - SELECT * FROM + SELECT * FROM (SELECT y, p, q, r FROM (SELECT t1.y AS y, t2.b AS b FROM t1, t2 WHERE t1.x=t2.a) AS m, (SELECT t3.p AS p, t3.q AS q, t4.r AS r FROM t3 NATURAL JOIN t4) as n @@ -516,7 +516,7 @@ do_test select6-9.11 { #------------------------------------------------------------------------- # Test that if a UNION ALL sub-query that would otherwise be eligible for -# flattening consists of two or more SELECT statements that do not all +# flattening consists of two or more SELECT statements that do not all # return the same number of result columns, the error is detected. # do_execsql_test 10.1 { @@ -544,7 +544,7 @@ do_catchsql_test 10.6 { } $err do_catchsql_test 10.7 { SELECT * FROM ( - SELECT * FROM t UNION ALL + SELECT * FROM t UNION ALL SELECT l,m,l FROM j UNION ALL SELECT * FROM k ) @@ -552,14 +552,14 @@ do_catchsql_test 10.7 { do_catchsql_test 10.8 { SELECT * FROM ( SELECT * FROM k UNION ALL - SELECT * FROM t UNION ALL - SELECT l,m,l FROM j + SELECT * FROM t UNION ALL + SELECT l,m,l FROM j ) } $err # 2015-02-09 Ticket [2f7170d73bf9abf80339187aa3677dce3dbcd5ca] # "misuse of aggregate" error if aggregate column from FROM -# subquery is used in correlated subquery +# subquery is used in correlated subquery # do_execsql_test 11.1 { DROP TABLE IF EXISTS t1; @@ -596,7 +596,7 @@ do_execsql_test 11.4 { ORDER BY lower((SELECT y FROM t2 WHERE w=cnt)); } {1 1 | 3 3 | 2 2 |} do_execsql_test 11.5 { - SELECT cnt, xyz, + SELECT cnt, xyz, CASE WHEN (SELECT y FROM t2 WHERE w=cnt)=='two' THEN 'aaa' ELSE 'bbb' END, '|' diff --git a/third_party/sqlite/src/test/select7.test b/third_party/sqlite/src/test/select7.test index d705ebfaf4e02..7a8cc9cdff01c 100644 --- a/third_party/sqlite/src/test/select7.test +++ b/third_party/sqlite/src/test/select7.test @@ -81,10 +81,10 @@ ifcapable {subquery && compound} { execsql { CREATE TABLE IF NOT EXISTS photo(pk integer primary key, x); CREATE TABLE IF NOT EXISTS tag(pk integer primary key, fk int, name); - - SELECT P.pk from PHOTO P WHERE NOT EXISTS ( - SELECT T2.pk from TAG T2 WHERE T2.fk = P.pk - EXCEPT + + SELECT P.pk from PHOTO P WHERE NOT EXISTS ( + SELECT T2.pk from TAG T2 WHERE T2.fk = P.pk + EXCEPT SELECT T3.pk from TAG T3 WHERE T3.fk = P.pk AND T3.name LIKE '%foo%' ); } @@ -97,9 +97,9 @@ ifcapable {subquery && compound} { INSERT INTO tag VALUES(11,1,'one'); INSERT INTO tag VALUES(12,1,'two'); INSERT INTO tag VALUES(21,1,'one-b'); - SELECT P.pk from PHOTO P WHERE NOT EXISTS ( - SELECT T2.pk from TAG T2 WHERE T2.fk = P.pk - EXCEPT + SELECT P.pk from PHOTO P WHERE NOT EXISTS ( + SELECT T2.pk from TAG T2 WHERE T2.fk = P.pk + EXCEPT SELECT T3.pk from TAG T3 WHERE T3.fk = P.pk AND T3.name LIKE '%foo%' ); } @@ -198,7 +198,7 @@ do_test select7-7.7 { } } {text 123} -do_execsql_test 8.0 { +do_execsql_test 8.0 { CREATE TABLE t01(x, y); CREATE TABLE t02(x, y); } diff --git a/third_party/sqlite/src/test/select8.test b/third_party/sqlite/src/test/select8.test index 39b27394993db..22f4bc22ad80a 100644 --- a/third_party/sqlite/src/test/select8.test +++ b/third_party/sqlite/src/test/select8.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # The focus of this file is testing that LIMIT and OFFSET work for # unusual combinations SELECT statements. @@ -28,31 +28,31 @@ execsql { INSERT INTO songs VALUES(6,'two',11); } set result [execsql { - SELECT DISTINCT artist,sum(timesplayed) AS total - FROM songs - GROUP BY LOWER(artist) + SELECT DISTINCT artist,sum(timesplayed) AS total + FROM songs + GROUP BY LOWER(artist) }] do_test select8-1.1 { execsql { - SELECT DISTINCT artist,sum(timesplayed) AS total - FROM songs - GROUP BY LOWER(artist) + SELECT DISTINCT artist,sum(timesplayed) AS total + FROM songs + GROUP BY LOWER(artist) LIMIT 1 OFFSET 1 } } [lrange $result 2 3] do_test select8-1.2 { execsql { - SELECT DISTINCT artist,sum(timesplayed) AS total - FROM songs - GROUP BY LOWER(artist) + SELECT DISTINCT artist,sum(timesplayed) AS total + FROM songs + GROUP BY LOWER(artist) LIMIT 2 OFFSET 1 } } [lrange $result 2 5] do_test select8-1.3 { execsql { - SELECT DISTINCT artist,sum(timesplayed) AS total - FROM songs - GROUP BY LOWER(artist) + SELECT DISTINCT artist,sum(timesplayed) AS total + FROM songs + GROUP BY LOWER(artist) LIMIT -1 OFFSET 2 } } [lrange $result 4 end] diff --git a/third_party/sqlite/src/test/select9.test b/third_party/sqlite/src/test/select9.test index 4c42236dc873e..e8ba1bce9273c 100644 --- a/third_party/sqlite/src/test/select9.test +++ b/third_party/sqlite/src/test/select9.test @@ -8,13 +8,13 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # $Id: select9.test,v 1.4 2008/07/01 14:39:35 danielk1977 Exp $ -# The tests in this file are focused on test compound SELECT statements +# The tests in this file are focused on test compound SELECT statements # that have any or all of an ORDER BY, LIMIT or OFFSET clauses. As of -# version 3.6.0, SQLite contains code to use SQL indexes where possible +# version 3.6.0, SQLite contains code to use SQL indexes where possible # to optimize such statements. # @@ -28,21 +28,21 @@ source $testdir/tester.tcl #------------------------------------------------------------------------- # test_compound_select TESTNAME SELECT RESULT # -# This command is used to run multiple LIMIT/OFFSET test cases based on +# This command is used to run multiple LIMIT/OFFSET test cases based on # the single SELECT statement passed as the second argument. The SELECT # statement may not contain a LIMIT or OFFSET clause. This proc tests # many statements of the form: -# +# # "$SELECT limit $X offset $Y" -# +# # for various values of $X and $Y. -# +# # The third argument, $RESULT, should contain the expected result of # the command [execsql $SELECT]. -# +# # The first argument, $TESTNAME, is used as the base test case name to # pass to [do_test] for each individual LIMIT OFFSET test case. -# +# proc test_compound_select {testname sql result} { set nCol 1 @@ -53,7 +53,7 @@ proc test_compound_select {testname sql result} { set nRow [expr {[llength $result] / $nCol}] set ::compound_sql $sql - do_test $testname { + do_test $testname { execsql $::compound_sql } $result #return @@ -70,16 +70,16 @@ proc test_compound_select {testname sql result} { for {set iOffset 0} {$iOffset < $iOffsetEnd} {incr iOffset $iOffsetIncr} { for {set iLimit 0} {$iLimit < $iLimitEnd} {incr iLimit} { - + set ::compound_sql "$sql LIMIT $iLimit" if {$iOffset != 0} { append ::compound_sql " OFFSET $iOffset" } - + set iStart [expr {$iOffset*$nCol}] set iEnd [expr {($iOffset*$nCol) + ($iLimit*$nCol) -1}] - - do_test $testname.limit=$iLimit.offset=$iOffset { + + do_test $testname.limit=$iLimit.offset=$iOffset { execsql $::compound_sql } [lrange $result $iStart $iEnd] } @@ -151,7 +151,7 @@ do_test select9-1.0 { # Each iteration of this loop runs the same tests with a different set # of indexes present within the database schema. The data returned by -# the compound SELECT statements in the test cases should be the same +# the compound SELECT statements in the test cases should be the same # in each case. # set iOuterLoop 1 @@ -174,13 +174,13 @@ foreach indexes [list { # Test some 2-way UNION ALL queries. No WHERE clauses. # test_compound_select select9-1.$iOuterLoop.2 { - SELECT a, b FROM t1 UNION ALL SELECT d, e FROM t2 + SELECT a, b FROM t1 UNION ALL SELECT d, e FROM t2 } {1 one 3 {} 5 five 7 seven 9 {} 2 two 4 four 6 {} 8 eight 10 ten 1 two 2 four 3 {} 4 eight 5 ten 6 {} 7 fourteen 8 sixteen 9 {} 10 twenty} test_compound_select select9-1.$iOuterLoop.3 { - SELECT a, b FROM t1 UNION ALL SELECT d, e FROM t2 ORDER BY 1 + SELECT a, b FROM t1 UNION ALL SELECT d, e FROM t2 ORDER BY 1 } {1 one 1 two 2 two 2 four 3 {} 3 {} 4 four 4 eight 5 five 5 ten 6 {} 6 {} 7 seven 7 fourteen 8 eight 8 sixteen 9 {} 9 {} 10 ten 10 twenty} test_compound_select select9-1.$iOuterLoop.4 { - SELECT a, b FROM t1 UNION ALL SELECT d, e FROM t2 ORDER BY 2 + SELECT a, b FROM t1 UNION ALL SELECT d, e FROM t2 ORDER BY 2 } {3 {} 9 {} 6 {} 3 {} 6 {} 9 {} 8 eight 4 eight 5 five 4 four 2 four 7 fourteen 1 one 7 seven 8 sixteen 10 ten 5 ten 10 twenty 2 two 1 two} test_compound_select_flippable select9-1.$iOuterLoop.5 { SELECT a, b FROM t1 UNION ALL SELECT d, e FROM t2 ORDER BY 1, 2 @@ -192,15 +192,15 @@ foreach indexes [list { # Test some 2-way UNION queries. # test_compound_select select9-1.$iOuterLoop.7 { - SELECT a, b FROM t1 UNION SELECT d, e FROM t2 + SELECT a, b FROM t1 UNION SELECT d, e FROM t2 } {1 one 1 two 2 four 2 two 3 {} 4 eight 4 four 5 five 5 ten 6 {} 7 fourteen 7 seven 8 eight 8 sixteen 9 {} 10 ten 10 twenty} test_compound_select select9-1.$iOuterLoop.8 { - SELECT a, b FROM t1 UNION SELECT d, e FROM t2 ORDER BY 1 + SELECT a, b FROM t1 UNION SELECT d, e FROM t2 ORDER BY 1 } {1 one 1 two 2 four 2 two 3 {} 4 eight 4 four 5 five 5 ten 6 {} 7 fourteen 7 seven 8 eight 8 sixteen 9 {} 10 ten 10 twenty} test_compound_select select9-1.$iOuterLoop.9 { - SELECT a, b FROM t1 UNION SELECT d, e FROM t2 ORDER BY 2 + SELECT a, b FROM t1 UNION SELECT d, e FROM t2 ORDER BY 2 } {3 {} 6 {} 9 {} 4 eight 8 eight 5 five 2 four 4 four 7 fourteen 1 one 7 seven 8 sixteen 5 ten 10 ten 10 twenty 1 two 2 two} test_compound_select_flippable select9-1.$iOuterLoop.10 { @@ -214,7 +214,7 @@ foreach indexes [list { # Test some 2-way INTERSECT queries. # test_compound_select select9-1.$iOuterLoop.11 { - SELECT a, b FROM t1 INTERSECT SELECT d, e FROM t2 + SELECT a, b FROM t1 INTERSECT SELECT d, e FROM t2 } {3 {} 6 {} 9 {}} test_compound_select_flippable select9-1.$iOuterLoop.12 { SELECT a, b FROM t1 INTERSECT SELECT d, e FROM t2 ORDER BY 1 @@ -232,15 +232,15 @@ foreach indexes [list { # Test some 2-way EXCEPT queries. # test_compound_select select9-1.$iOuterLoop.16 { - SELECT a, b FROM t1 EXCEPT SELECT d, e FROM t2 + SELECT a, b FROM t1 EXCEPT SELECT d, e FROM t2 } {1 one 2 two 4 four 5 five 7 seven 8 eight 10 ten} test_compound_select select9-1.$iOuterLoop.17 { - SELECT a, b FROM t1 EXCEPT SELECT d, e FROM t2 ORDER BY 1 + SELECT a, b FROM t1 EXCEPT SELECT d, e FROM t2 ORDER BY 1 } {1 one 2 two 4 four 5 five 7 seven 8 eight 10 ten} test_compound_select select9-1.$iOuterLoop.18 { - SELECT a, b FROM t1 EXCEPT SELECT d, e FROM t2 ORDER BY 2 + SELECT a, b FROM t1 EXCEPT SELECT d, e FROM t2 ORDER BY 2 } {8 eight 5 five 4 four 1 one 7 seven 10 ten 2 two} test_compound_select select9-1.$iOuterLoop.19 { @@ -268,7 +268,7 @@ proc reverse {lhs rhs} { } db collate reverse reverse -# This loop is similar to the previous one (test cases select9-1.*) +# This loop is similar to the previous one (test cases select9-1.*) # except that the simple select statements have WHERE clauses attached # to them. Sometimes the WHERE clause may be satisfied using the same # index used for ORDER BY, sometimes not. @@ -299,7 +299,7 @@ foreach indexes [list { } {3 {} {} 6 {} {} 9 {} {} 4 four IV 7 fourteen XXVIII 1 one I 8 sixteen XXXII 5 ten XX 10 twenty XL 2 two II} test_compound_select_flippable select9-2.$iOuterLoop.3 { - SELECT * FROM t1 WHERE a<5 UNION SELECT * FROM t2 WHERE d>=5 + SELECT * FROM t1 WHERE a<5 UNION SELECT * FROM t2 WHERE d>=5 ORDER BY 2 COLLATE reverse, 1 } {3 {} {} 6 {} {} 9 {} {} 2 two II 10 twenty XL 5 ten XX 8 sixteen XXXII 1 one I 7 fourteen XXVIII 4 four IV} @@ -312,7 +312,7 @@ foreach indexes [list { } {3 {} {} 6 {} {} 9 {} {} 4 four IV 7 fourteen XXVIII 1 one I 8 sixteen XXXII 5 ten XX 10 twenty XL 2 two II} test_compound_select_flippable select9-2.$iOuterLoop.6 { - SELECT * FROM t1 WHERE a<5 UNION ALL SELECT * FROM t2 WHERE d>=5 + SELECT * FROM t1 WHERE a<5 UNION ALL SELECT * FROM t2 WHERE d>=5 ORDER BY 2 COLLATE reverse, 1 } {3 {} {} 6 {} {} 9 {} {} 2 two II 10 twenty XL 5 ten XX 8 sixteen XXXII 1 one I 7 fourteen XXVIII 4 four IV} @@ -352,7 +352,7 @@ proc cksort {sql} { # SELECT t1.a FROM t1 UNION ALL SELECT t2.d FROM t2 ORDER BY 1 # # can use indexes to run without doing a in-memory sort operation. -# This block of tests (select9-3.*) is used to check if the same +# This block of tests (select9-3.*) is used to check if the same # is possible with: # # CREATE VIEW v1 AS SELECT a FROM t1 UNION ALL SELECT d FROM t2 @@ -450,7 +450,7 @@ do_test select9-5.3 { } } {/SCAN TABLE/} ;# Full table scan if the "+x" prevents index usage. -# 2013-07-09: Ticket [490a4b7235624298]: +# 2013-07-09: Ticket [490a4b7235624298]: # "WHERE 0" on the first element of a UNION causes an assertion fault # do_execsql_test select9-6.1 { diff --git a/third_party/sqlite/src/test/selectA.test b/third_party/sqlite/src/test/selectA.test index 78d04be15d4ad..dc7c968712a6d 100644 --- a/third_party/sqlite/src/test/selectA.test +++ b/third_party/sqlite/src/test/selectA.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # The focus of this file is testing the compound-SELECT merge # optimization. Or, in other words, making sure that all @@ -1331,20 +1331,20 @@ do_execsql_test 4.1.1 { } do_eqp_test 4.1.2 { - SELECT c, d FROM t5 + SELECT c, d FROM t5 UNION ALL SELECT a, b FROM t4 WHERE f()==f() ORDER BY 1,2 } { - 1 0 0 {SCAN TABLE t5 USING INDEX i2} + 1 0 0 {SCAN TABLE t5 USING INDEX i2} 1 0 0 {USE TEMP B-TREE FOR RIGHT PART OF ORDER BY} - 2 0 0 {SCAN TABLE t4 USING INDEX i1} + 2 0 0 {SCAN TABLE t4 USING INDEX i1} 2 0 0 {USE TEMP B-TREE FOR RIGHT PART OF ORDER BY} 0 0 0 {COMPOUND SUBQUERIES 1 AND 2 (UNION ALL)} } do_execsql_test 4.1.3 { - SELECT c, d FROM t5 + SELECT c, d FROM t5 UNION ALL SELECT a, b FROM t4 WHERE f()==f() ORDER BY 1,2 @@ -1370,7 +1370,7 @@ do_execsql_test 4.2.1 { do_execsql_test 4.2.2 { SELECT c, f(d,c,d,c,d) FROM t7 UNION ALL - SELECT a, b FROM t6 + SELECT a, b FROM t6 ORDER BY 1,2 } {/2 . 3 . 4 . 5 . 6 . 7 ./} diff --git a/third_party/sqlite/src/test/selectB.test b/third_party/sqlite/src/test/selectB.test index 05ec9c6bdb0f5..94b5b36c371ca 100644 --- a/third_party/sqlite/src/test/selectB.test +++ b/third_party/sqlite/src/test/selectB.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # $Id: selectB.test,v 1.10 2009/04/02 16:59:47 drh Exp $ @@ -72,52 +72,52 @@ for {set ii 1} {$ii <= 2} {incr ii} { } { SELECT a FROM t1 UNION ALL SELECT d FROM t2 } {2 8 14 3 12 21} - + test_transform selectB-$ii.3 { SELECT * FROM (SELECT a FROM t1 UNION ALL SELECT d FROM t2) ORDER BY 1 } { SELECT a FROM t1 UNION ALL SELECT d FROM t2 ORDER BY 1 } {2 3 8 12 14 21} - + test_transform selectB-$ii.4 { - SELECT * FROM - (SELECT a FROM t1 UNION ALL SELECT d FROM t2) + SELECT * FROM + (SELECT a FROM t1 UNION ALL SELECT d FROM t2) WHERE a>10 ORDER BY 1 } { SELECT a FROM t1 WHERE a>10 UNION ALL SELECT d FROM t2 WHERE d>10 ORDER BY 1 } {12 14 21} - + test_transform selectB-$ii.5 { - SELECT * FROM - (SELECT a FROM t1 UNION ALL SELECT d FROM t2) + SELECT * FROM + (SELECT a FROM t1 UNION ALL SELECT d FROM t2) WHERE a>10 ORDER BY a } { - SELECT a FROM t1 WHERE a>10 - UNION ALL - SELECT d FROM t2 WHERE d>10 + SELECT a FROM t1 WHERE a>10 + UNION ALL + SELECT d FROM t2 WHERE d>10 ORDER BY a } {12 14 21} - + test_transform selectB-$ii.6 { - SELECT * FROM - (SELECT a FROM t1 UNION ALL SELECT d FROM t2 WHERE d > 12) + SELECT * FROM + (SELECT a FROM t1 UNION ALL SELECT d FROM t2 WHERE d > 12) WHERE a>10 ORDER BY a } { SELECT a FROM t1 WHERE a>10 - UNION ALL + UNION ALL SELECT d FROM t2 WHERE d>12 AND d>10 ORDER BY a } {14 21} - + test_transform selectB-$ii.7 { - SELECT * FROM (SELECT a FROM t1 UNION ALL SELECT d FROM t2) ORDER BY 1 + SELECT * FROM (SELECT a FROM t1 UNION ALL SELECT d FROM t2) ORDER BY 1 LIMIT 2 } { SELECT a FROM t1 UNION ALL SELECT d FROM t2 ORDER BY 1 LIMIT 2 } {2 3} - + test_transform selectB-$ii.8 { - SELECT * FROM (SELECT a FROM t1 UNION ALL SELECT d FROM t2) ORDER BY 1 + SELECT * FROM (SELECT a FROM t1 UNION ALL SELECT d FROM t2) ORDER BY 1 LIMIT 2 OFFSET 3 } { SELECT a FROM t1 UNION ALL SELECT d FROM t2 ORDER BY 1 LIMIT 2 OFFSET 3 @@ -126,11 +126,11 @@ for {set ii 1} {$ii <= 2} {incr ii} { test_transform selectB-$ii.9 { SELECT * FROM ( SELECT a FROM t1 UNION ALL SELECT d FROM t2 UNION ALL SELECT c FROM t1 - ) + ) } { SELECT a FROM t1 UNION ALL SELECT d FROM t2 UNION ALL SELECT c FROM t1 } {2 8 14 3 12 21 6 12 18} - + test_transform selectB-$ii.10 { SELECT * FROM ( SELECT a FROM t1 UNION ALL SELECT d FROM t2 UNION ALL SELECT c FROM t1 @@ -139,7 +139,7 @@ for {set ii 1} {$ii <= 2} {incr ii} { SELECT a FROM t1 UNION ALL SELECT d FROM t2 UNION ALL SELECT c FROM t1 ORDER BY 1 } {2 3 6 8 12 12 14 18 21} - + test_transform selectB-$ii.11 { SELECT * FROM ( SELECT a FROM t1 UNION ALL SELECT d FROM t2 UNION ALL SELECT c FROM t1 @@ -162,7 +162,7 @@ for {set ii 1} {$ii <= 2} {incr ii} { # } { # SELECT a FROM t1 UNION ALL SELECT d FROM t2 ORDER BY 1 ASC # } {2 3 8 12 14 21} - # + # # test_transform selectB-$ii.14 { # SELECT * FROM (SELECT a FROM t1 UNION ALL SELECT d FROM t2 ORDER BY a DESC) # } { @@ -220,76 +220,76 @@ for {set ii 3} {$ii <= 6} {incr ii} { do_test selectB-$ii.1 { execsql { - SELECT DISTINCT * FROM - (SELECT c FROM t1 UNION ALL SELECT e FROM t2) + SELECT DISTINCT * FROM + (SELECT c FROM t1 UNION ALL SELECT e FROM t2) ORDER BY 1; } } {6 12 15 18 24} - + do_test selectB-$ii.2 { execsql { - SELECT c, count(*) FROM - (SELECT c FROM t1 UNION ALL SELECT e FROM t2) + SELECT c, count(*) FROM + (SELECT c FROM t1 UNION ALL SELECT e FROM t2) GROUP BY c ORDER BY 1; } } {6 2 12 1 15 1 18 1 24 1} do_test selectB-$ii.3 { execsql { - SELECT c, count(*) FROM - (SELECT c FROM t1 UNION ALL SELECT e FROM t2) + SELECT c, count(*) FROM + (SELECT c FROM t1 UNION ALL SELECT e FROM t2) GROUP BY c HAVING count(*)>1; } } {6 2} do_test selectB-$ii.4 { execsql { - SELECT t4.c, t3.a FROM + SELECT t4.c, t3.a FROM (SELECT c FROM t1 UNION ALL SELECT e FROM t2) AS t4, t1 AS t3 WHERE t3.a=14 ORDER BY 1 } } {6 14 6 14 12 14 15 14 18 14 24 14} - + do_test selectB-$ii.5 { execsql { - SELECT d FROM t2 - EXCEPT + SELECT d FROM t2 + EXCEPT SELECT a FROM (SELECT a FROM t1 UNION ALL SELECT d FROM t2) } } {} do_test selectB-$ii.6 { execsql { SELECT * FROM (SELECT a FROM t1 UNION ALL SELECT d FROM t2) - EXCEPT + EXCEPT SELECT * FROM (SELECT a FROM t1 UNION ALL SELECT d FROM t2) } } {} do_test selectB-$ii.7 { execsql { SELECT c FROM t1 - EXCEPT + EXCEPT SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2) } } {12} do_test selectB-$ii.8 { execsql { SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2) - EXCEPT + EXCEPT SELECT c FROM t1 } } {9 15 24 27} do_test selectB-$ii.9 { execsql { SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2) - EXCEPT + EXCEPT SELECT c FROM t1 ORDER BY c DESC } } {27 24 15 9} - + do_test selectB-$ii.10 { execsql { SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2) - UNION + UNION SELECT c FROM t1 ORDER BY c DESC } @@ -297,7 +297,7 @@ for {set ii 3} {$ii <= 6} {incr ii} { do_test selectB-$ii.11 { execsql { SELECT c FROM t1 - UNION + UNION SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2) ORDER BY c } @@ -311,16 +311,16 @@ for {set ii 3} {$ii <= 6} {incr ii} { do_test selectB-$ii.13 { execsql { SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2) - UNION + UNION SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2) ORDER BY 1 } } {6 9 15 18 24 27} - + do_test selectB-$ii.14 { execsql { SELECT c FROM t1 - INTERSECT + INTERSECT SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2) ORDER BY 1 } @@ -328,7 +328,7 @@ for {set ii 3} {$ii <= 6} {incr ii} { do_test selectB-$ii.15 { execsql { SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2) - INTERSECT + INTERSECT SELECT c FROM t1 ORDER BY 1 } @@ -336,7 +336,7 @@ for {set ii 3} {$ii <= 6} {incr ii} { do_test selectB-$ii.16 { execsql { SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2) - INTERSECT + INTERSECT SELECT * FROM (SELECT e FROM t2 UNION ALL SELECT f FROM t2) ORDER BY 1 } diff --git a/third_party/sqlite/src/test/selectC.test b/third_party/sqlite/src/test/selectC.test index 4d7996300745a..e6d1173b6db10 100644 --- a/third_party/sqlite/src/test/selectC.test +++ b/third_party/sqlite/src/test/selectC.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # $Id: selectC.test,v 1.5 2009/05/17 15:26:21 drh Exp $ @@ -188,11 +188,11 @@ do_test selectC-3.1 { INSERT INTO person VALUES('lakeside', 'amy', NULL); INSERT INTO person VALUES('lake-apts', 'tom', NULL); INSERT INTO person VALUES('acorn', 'hideo', 'CQB421'); - - SELECT - org_id, + + SELECT + org_id, count((NOT (org_id IS NULL)) AND (NOT (nickname IS NULL))) - FROM person + FROM person WHERE (CASE WHEN license != '' THEN 1 ELSE 0 END) GROUP BY 1; } diff --git a/third_party/sqlite/src/test/selectD.test b/third_party/sqlite/src/test/selectD.test index 89f999eb6db97..466cdf9f04d72 100644 --- a/third_party/sqlite/src/test/selectD.test +++ b/third_party/sqlite/src/test/selectD.test @@ -37,7 +37,7 @@ for {set i 1} {$i<=2} {incr i} { db eval { SELECT * FROM (t1), (t2), (t3), (t4) - WHERE t4.a=t3.a+111 + WHERE t4.a=t3.a+111 AND t3.a=t2.a+111 AND t2.a=t1.a+111; } @@ -154,7 +154,7 @@ for {set i 1} {$i<=2} {incr i} { # The following test was added on 2013-04-24 in order to verify that # the datatypes and affinities of sub-sub-queries are set prior to computing -# the datatypes and affinities of the parent sub-queries because the +# the datatypes and affinities of the parent sub-queries because the # latter computation depends on the former. # do_execsql_test selectD-4.1 { @@ -162,7 +162,7 @@ do_execsql_test selectD-4.1 { CREATE TABLE t42(d INTEGER PRIMARY KEY, e INTEGER); CREATE TABLE t43(f INTEGER PRIMARY KEY, g INTEGER); EXPLAIN QUERY PLAN - SELECT * + SELECT * FROM t41 LEFT JOIN (SELECT count(*) AS cnt, x1.d FROM (t42 INNER JOIN t43 ON d=g) AS x1 diff --git a/third_party/sqlite/src/test/selectE.test b/third_party/sqlite/src/test/selectE.test index 1cabeff3702b4..4a3dc01c98919 100644 --- a/third_party/sqlite/src/test/selectE.test +++ b/third_party/sqlite/src/test/selectE.test @@ -11,7 +11,7 @@ # This file implements regression tests for compound SELECT statements # that have ORDER BY clauses with collating sequences that differ # from the collating sequence used for comparison in the compound. -# +# # Ticket 6709574d2a8d8b9be3a9cb1afbf4ff2de48ea4e7: # drh added on 2013-05-06 15:21:16: # @@ -22,22 +22,22 @@ # operator. Note that the ".print" commands are instructions to the # sqlite3.exe shell program to output delimiter lines so that you can more # easily tell where the output of one query ends and the next query -# begins. -# +# begins. +# # CREATE TABLE t1(a); # INSERT INTO t1 VALUES('abc'),('def'); # CREATE TABLE t2(a); # INSERT INTO t2 VALUES('DEF'); -# +# # SELECT a FROM t1 EXCEPT SELECT a FROM t2 ORDER BY a; # .print ----- # SELECT a FROM (SELECT a FROM t1 EXCEPT SELECT a FROM t2) # ORDER BY a COLLATE nocase; # .print ----- # SELECT a FROM t1 EXCEPT SELECT a FROM t2 ORDER BY a COLLATE nocase; -# +# # Bisecting shows that this problem was introduced in SQLite version 3.6.0 -# by check-in [8bbfa97837a74ef] on 2008-06-15. +# by check-in [8bbfa97837a74ef] on 2008-06-15. # set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/selectF.test b/third_party/sqlite/src/test/selectF.test index 3fb226e012fd6..a758d52516d77 100644 --- a/third_party/sqlite/src/test/selectF.test +++ b/third_party/sqlite/src/test/selectF.test @@ -32,18 +32,18 @@ do_execsql_test 1 { #explain_i { # SELECT * FROM t2 -# UNION ALL -# SELECT * FROM t1 WHERE a<5 +# UNION ALL +# SELECT * FROM t1 WHERE a<5 # ORDER BY 2, 1 #} do_execsql_test 2 { SELECT * FROM t2 - UNION ALL - SELECT * FROM t1 WHERE a<5 + UNION ALL + SELECT * FROM t1 WHERE a<5 ORDER BY 2, 1 } {6 {} {} 1 one I 5 ten XX} - + finish_test diff --git a/third_party/sqlite/src/test/selectG.test b/third_party/sqlite/src/test/selectG.test index 86d89b121b658..cd01a31ae0317 100644 --- a/third_party/sqlite/src/test/selectG.test +++ b/third_party/sqlite/src/test/selectG.test @@ -35,5 +35,5 @@ do_test 100 { SELECT count(x), sum(x), avg(x), $microsec<10000000 FROM t1; } } {100000 5000050000 50000.5 1} - + finish_test diff --git a/third_party/sqlite/src/test/server1.test b/third_party/sqlite/src/test/server1.test index 90673ef00011a..52f1089128e7e 100644 --- a/third_party/sqlite/src/test/server1.test +++ b/third_party/sqlite/src/test/server1.test @@ -166,6 +166,6 @@ do_test server1-2.6 { client_result C } SQLITE_OK -client_halt * +client_halt * sqlite3_enable_shared_cache 0 finish_test diff --git a/third_party/sqlite/src/test/shared.test b/third_party/sqlite/src/test/shared.test index 4eab476582c22..207ba1b90c079 100644 --- a/third_party/sqlite/src/test/shared.test +++ b/third_party/sqlite/src/test/shared.test @@ -43,7 +43,7 @@ ifcapable autovacuum { } # if we're using proxy locks, we use 2 filedescriptors for a db -# that is open but NOT yet locked, after a lock is taken we'll have 3, +# that is open but NOT yet locked, after a lock is taken we'll have 3, # normally sqlite uses 1 (proxy locking adds the conch and the local lock) set using_proxy 0 foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] { @@ -54,10 +54,10 @@ set extrafds_postlock 0 if {$using_proxy>0} { set extrafds_prelock 1 set extrafds_postlock 2 -} +} # $av is currently 0 if this loop iteration is to test with auto-vacuum turned -# off, and 1 if it is turned on. Increment it so that (1 -> no auto-vacuum) +# off, and 1 if it is turned on. Increment it so that (1 -> no auto-vacuum) # and (2 -> auto-vacuum). The sole reason for this is so that it looks nicer # when we use this variable as part of test-case names. # @@ -67,8 +67,8 @@ incr av # # shared-1.*: Simple test to verify basic sanity of table level locking when # two connections share a pager cache. -# shared-2.*: Test that a read transaction can co-exist with a -# write-transaction, including a simple test to ensure the +# shared-2.*: Test that a read transaction can co-exist with a +# write-transaction, including a simple test to ensure the # external locking protocol is still working. # shared-3.*: Simple test of read-uncommitted mode. # shared-4.*: Check that the schema is locked and unlocked correctly. @@ -84,14 +84,14 @@ incr av do_test shared-$av.1.1 { # Open a second database on the file test.db. It should use the same pager - # cache and schema as the original connection. Verify that only 1 file is + # cache and schema as the original connection. Verify that only 1 file is # opened. sqlite3 db2 test.db set ::sqlite_open_file_count expr $sqlite_open_file_count-$extrafds_postlock } {1} do_test shared-$av.1.2 { - # Add a table and a single row of data via the first connection. + # Add a table and a single row of data via the first connection. # Ensure that the second connection can see them. execsql { CREATE TABLE abc(a, b, c); @@ -103,7 +103,7 @@ do_test shared-$av.1.2 { } {1 2 3} do_test shared-$av.1.3 { # Have the first connection begin a transaction and obtain a read-lock - # on table abc. This should not prevent the second connection from + # on table abc. This should not prevent the second connection from # querying abc. execsql { BEGIN; @@ -123,7 +123,7 @@ do_test shared-$av.1.4 { } {1 {database table is locked: abc}} do_test shared-$av.1.5 { # Using connection 2 (the one without the open transaction), try to create - # a new table. This should fail because of the open read transaction + # a new table. This should fail because of the open read transaction # held by connection 1. catchsql { CREATE TABLE def(d, e, f); @@ -132,8 +132,8 @@ do_test shared-$av.1.5 { do_test shared-$av.1.6 { # Upgrade connection 1's transaction to a write transaction. Create # a new table - def - and insert a row into it. Because the connection 1 - # transaction modifies the schema, it should not be possible for - # connection 2 to access the database at all until the connection 1 + # transaction modifies the schema, it should not be possible for + # connection 2 to access the database at all until the connection 1 # has finished the transaction. execsql { CREATE TABLE def(d, e, f); @@ -141,9 +141,9 @@ do_test shared-$av.1.6 { } } {} do_test shared-$av.1.7 { - # Read from the sqlite_master table with connection 1 (inside the + # Read from the sqlite_master table with connection 1 (inside the # transaction). Then test that we can not do this with connection 2. This - # is because of the schema-modified lock established by connection 1 + # is because of the schema-modified lock established by connection 1 # in the previous test case. execsql { SELECT * FROM sqlite_master; @@ -192,7 +192,7 @@ do_test shared-$av.2.3 { # db2 should not be able to read def (because of the write-lock). # Todo: The failed "INSERT INTO abc ..." statement in the above test -# has started a write-transaction on db2 (should this be so?). This +# has started a write-transaction on db2 (should this be so?). This # would prevent connection db from starting a write-transaction. So roll the # db2 transaction back and replace it with a new read transaction. execsql { @@ -212,7 +212,7 @@ do_test shared-$av.2.3 { } {0 {IV V VI} 1 {database table is locked: def}} do_test shared-$av.2.4 { # Commit the open transaction on db. db2 still holds a read-transaction. - # This should prevent db3 from writing to the database, but not from + # This should prevent db3 from writing to the database, but not from # reading. execsql { COMMIT; @@ -227,7 +227,7 @@ do_test shared-$av.2.4 { catchsql COMMIT db2 do_test shared-$av.3.1.1 { - # This test case starts a linear scan of table 'seq' using a + # This test case starts a linear scan of table 'seq' using a # read-uncommitted connection. In the middle of the scan, rows are added # to the end of the seq table (ahead of the current cursor position). # The uncommitted rows should be included in the results of the scan. @@ -254,7 +254,7 @@ do_test shared-$av.3.1.1 { do_test shared-$av.3.1.2 { # Another linear scan through table seq using a read-uncommitted connection. # This time, delete each row as it is read. Should not affect the results of - # the scan, but the table should be empty after the scan is concluded + # the scan, but the table should be empty after the scan is concluded # (test 3.1.3 verifies this). set ret [list] db2 eval {SELECT i FROM seq} { @@ -274,14 +274,14 @@ catch {db2 close} catch {db3 close} #-------------------------------------------------------------------------- -# Tests shared-4.* test that the schema locking rules are applied +# Tests shared-4.* test that the schema locking rules are applied # correctly. i.e.: # # 1. All transactions require a read-lock on the schemas of databases they # access. # 2. Transactions that modify a database schema require a write-lock on that # schema. -# 3. It is not possible to compile a statement while another handle has a +# 3. It is not possible to compile a statement while another handle has a # write-lock on the schema. # @@ -364,7 +364,7 @@ do_test shared-$av.4.3.4 { } {} # Open a write-transaction using handle 1 and modify the database schema. -# Then try to execute a compiled statement to read from the same +# Then try to execute a compiled statement to read from the same # database via handle 2 (fails to get the lock on sqlite_master). Also # try to compile a read of the same database using handle 2 (also fails). # Finally, compile a read of the other database using handle 2. This @@ -376,7 +376,7 @@ ifcapable compound { # via handle 1. execsql { CREATE TABLE test2.ghi(g, h, i); - SELECT 'test.db:'||name FROM sqlite_master + SELECT 'test.db:'||name FROM sqlite_master UNION ALL SELECT 'test2.db:'||name FROM test2.sqlite_master; } @@ -385,7 +385,7 @@ ifcapable compound { # Sanity check 2: Check that the schema is what we think it is when viewed # via handle 2. execsql { - SELECT 'test2.db:'||name FROM sqlite_master + SELECT 'test2.db:'||name FROM sqlite_master UNION ALL SELECT 'test.db:'||name FROM test.sqlite_master; } db2 @@ -423,7 +423,7 @@ catch {db2 close} catch {db close} #-------------------------------------------------------------------------- -# Tests shared-5.* +# Tests shared-5.* # foreach db [list test.db test1.db test2.db test3.db] { forcedelete $db ${db}-journal @@ -518,11 +518,11 @@ ifcapable compound { } {1 2 3 4} } do_test shared-$av.6.1.3 { - # Establish a write lock on table t2 via connection db2. Then make a - # UNION all query using connection db1 that first accesses t1, followed - # by t2. If the locks are grabbed at the start of the statement (as + # Establish a write lock on table t2 via connection db2. Then make a + # UNION all query using connection db1 that first accesses t1, followed + # by t2. If the locks are grabbed at the start of the statement (as # they should be), no rows are returned. If (as was previously the case) - # they are grabbed as the tables are accessed, the t1 rows will be + # they are grabbed as the tables are accessed, the t1 rows will be # returned before the query fails. # execsql { @@ -562,14 +562,14 @@ foreach f [list test.db test2.db] { #-------------------------------------------------------------------------- # Tests shared-7.* test auto-vacuum does not invalidate cursors from -# other shared-cache users when it reorganizes the database on +# other shared-cache users when it reorganizes the database on # COMMIT. # do_test shared-$av.7.1 { - # This test case sets up a test database in auto-vacuum mode consisting - # of two tables, t1 and t2. Both have a single index. Table t1 is - # populated first (so consists of pages toward the start of the db file), - # t2 second (pages toward the end of the file). + # This test case sets up a test database in auto-vacuum mode consisting + # of two tables, t1 and t2. Both have a single index. Table t1 is + # populated first (so consists of pages toward the start of the db file), + # t2 second (pages toward the end of the file). sqlite3 db test.db sqlite3 db2 test.db execsql { @@ -746,7 +746,7 @@ do_test shared-$av.9.1 { execsql { CREATE TABLE abc(a, b, c); CREATE TABLE abc_mirror(a, b, c); - CREATE TEMP TRIGGER BEFORE INSERT ON abc BEGIN + CREATE TEMP TRIGGER BEFORE INSERT ON abc BEGIN INSERT INTO abc_mirror(a, b, c) VALUES(new.a, new.b, new.c); END; INSERT INTO abc VALUES(1, 2, 3); @@ -767,8 +767,8 @@ do_test shared-$av.9.3 { } ; # End shared-9.* #--------------------------------------------------------------------------- -# The following tests - shared-10.* - test that the library behaves -# correctly when a connection to a shared-cache is closed. +# The following tests - shared-10.* - test that the library behaves +# correctly when a connection to a shared-cache is closed. # do_test shared-$av.10.1 { # Create a small sample database with two connections to it (db and db2). @@ -833,7 +833,7 @@ do_test shared-$av.10.6 { catchsql {COMMIT} db3 } {1 {database is locked}} do_test shared-$av.10.7 { - # Commit the (read-only) db transaction. Check via db3 to make sure the + # Commit the (read-only) db transaction. Check via db3 to make sure the # contents of table "de" are still as they should be. execsql { COMMIT; @@ -919,7 +919,7 @@ do_test shared-$av.11.11 { # This tests that if it is impossible to free any pages, SQLite will # exceed the limit set by PRAGMA cache_size. forcedelete test.db test.db-journal -sqlite3 db test.db +sqlite3 db test.db ifcapable pager_pragmas { do_test shared-$av.12.1 { execsql { @@ -932,8 +932,8 @@ do_test shared-$av.12.2 { set ::db_handles [list] for {set i 1} {$i < 15} {incr i} { lappend ::db_handles db$i - sqlite3 db$i test.db - execsql "CREATE TABLE db${i}(a, b, c)" db$i + sqlite3 db$i test.db + execsql "CREATE TABLE db${i}(a, b, c)" db$i execsql "INSERT INTO db${i} VALUES(1, 2, 3)" } } {} @@ -953,14 +953,14 @@ do_test shared-$av.12.3 { do_test shared-$av.12.X { db close - foreach h $::db_handles { + foreach h $::db_handles { $h close } } {} # Internally, locks are acquired on shared B-Tree structures in the order # that the structures appear in the virtual memory address space. This -# test case attempts to cause the order of the structures in memory +# test case attempts to cause the order of the structures in memory # to be different from the order in which they are attached to a given # database handle. This covers an extra line or two. # @@ -987,10 +987,10 @@ do_test shared-$av.13.2 { CREATE TABLE aux3.t3(a, b, c); CREATE TABLE aux4.t4(a, b, c); CREATE TABLE aux5.t5(a, b, c); - SELECT count(*) FROM - aux2.sqlite_master, - aux3.sqlite_master, - aux4.sqlite_master, + SELECT count(*) FROM + aux2.sqlite_master, + aux3.sqlite_master, + aux4.sqlite_master, aux5.sqlite_master } } {1} @@ -998,7 +998,7 @@ do_test shared-$av.13.3 { db close } {} -# Test that nothing horrible happens if a connection to a shared B-Tree +# Test that nothing horrible happens if a connection to a shared B-Tree # structure is closed while some other connection has an open cursor. # do_test shared-$av.14.1 { @@ -1023,7 +1023,7 @@ do_test shared-$av.14.3 { # Populate a database schema using connection [db]. Then drop it using # [db2]. This is to try to find any points where shared-schema elements # are allocated using the lookaside buffer of [db]. -# +# # Mutexes are enabled for this test as that activates a couple of useful # assert() statements in the C code. # @@ -1034,10 +1034,10 @@ do_test shared-$av-15.1 { execsql { CREATE TABLE t1(a, b, c); CREATE INDEX i1 ON t1(a, b); - CREATE VIEW v1 AS SELECT * FROM t1; - CREATE VIEW v2 AS SELECT * FROM t1, v1 - WHERE t1.c=v1.c GROUP BY t1.a ORDER BY v1.b; - CREATE TRIGGER tr1 AFTER INSERT ON t1 + CREATE VIEW v1 AS SELECT * FROM t1; + CREATE VIEW v2 AS SELECT * FROM t1, v1 + WHERE t1.c=v1.c GROUP BY t1.a ORDER BY v1.b; + CREATE TRIGGER tr1 AFTER INSERT ON t1 WHEN new.a!=1 BEGIN DELETE FROM t1 WHERE a=5; @@ -1150,28 +1150,28 @@ do_test shared-$av-16.8.1 { db2 close sqlite3 db test1.db - db eval { + db eval { CREATE TABLE yy(a, b); INSERT INTO yy VALUES(77, 88); } db close sqlite3 db1 test1.db -uri 1 -readonly 1 - sqlite3 db2 test2.db -uri 1 + sqlite3 db2 test2.db -uri 1 - db1 eval { - ATTACH 'file:mem?mode=memory&cache=shared' AS shared; + db1 eval { + ATTACH 'file:mem?mode=memory&cache=shared' AS shared; CREATE TABLE shared.xx(a, b); INSERT INTO xx VALUES(55, 66); } - db2 eval { + db2 eval { ATTACH 'file:mem?mode=memory&cache=shared' AS shared; SELECT * FROM xx; } } {55 66} do_test shared-$av-16.8.2 { db1 eval { SELECT * FROM yy } } {77 88} -do_test shared-$av-16.8.3 { +do_test shared-$av-16.8.3 { list [catch {db1 eval { INSERT INTO yy VALUES(1, 2) }} msg] $msg } {1 {attempt to write a readonly database}} diff --git a/third_party/sqlite/src/test/shared2.test b/third_party/sqlite/src/test/shared2.test index 5bde8cfad8437..aae3bb029ffe4 100644 --- a/third_party/sqlite/src/test/shared2.test +++ b/third_party/sqlite/src/test/shared2.test @@ -23,13 +23,13 @@ ifcapable !shared_cache { } set ::enable_shared_cache [sqlite3_enable_shared_cache 1] -# Test that if we delete all rows from a table any read-uncommitted +# Test that if we delete all rows from a table any read-uncommitted # cursors are correctly invalidated. Test on both table and index btrees. do_test shared2-1.1 { sqlite3 db1 test.db sqlite3 db2 test.db - # Set up some data. Table "numbers" has 64 rows after this block + # Set up some data. Table "numbers" has 64 rows after this block # is executed. execsql { BEGIN; @@ -46,7 +46,7 @@ do_test shared2-1.1 { } db1 } {} do_test shared2-1.2 { - # Put connection 2 in read-uncommitted mode and start a SELECT on table + # Put connection 2 in read-uncommitted mode and start a SELECT on table # 'numbers'. Half way through the SELECT, use connection 1 to delete the # contents of this table. execsql { @@ -117,7 +117,7 @@ do_test shared2-5.1 { sqlite3 db test.db sqlite3 db2 test.db execsql { CREATE TABLE t2(a, b, c) } - + # The following statement would crash when attempting to sqlite3_free() # a pointer allocated from a lookaside buffer. execsql { CREATE INDEX i1 ON t2(a) } db2 diff --git a/third_party/sqlite/src/test/shared6.test b/third_party/sqlite/src/test/shared6.test index 499cbb0eb5722..0869079fa0d83 100644 --- a/third_party/sqlite/src/test/shared6.test +++ b/third_party/sqlite/src/test/shared6.test @@ -38,7 +38,7 @@ do_test shared6-1.1.3 { # 1.2.1: If [db1] has an exclusive lock, [db2] cannot read. # 1.2.2: If [db1] has an exclusive lock, [db1] can read. # 1.2.3: If [db1] has a non-exclusive write-lock, [db2] can read. -# +# do_test shared6-1.2.1 { execsql { SELECT * FROM t1 } db2 ;# Cache a compiled statement execsql { BEGIN EXCLUSIVE } db1 @@ -104,7 +104,7 @@ do_test shared6-1.3.X { # For these tests, connection [db2] is in read-uncommitted mode. # # 1.4.1: If [db1] has a write-lock on t1, [db2] can still read from t1. -# 1.4.2: If [db1] has a write-lock on the db schema (sqlite_master table), +# 1.4.2: If [db1] has a write-lock on the db schema (sqlite_master table), # [db2] cannot read from the schema. # 1.4.3: If [db1] has a read-lock on t1, [db2] cannot write to t1. # @@ -178,7 +178,7 @@ if {$::tcl_platform(platform) eq "unix"} { } #------------------------------------------------------------------------- -# Test that it is possible to open an exclusive transaction while +# Test that it is possible to open an exclusive transaction while # already holding a read-lock on the database file. And that it is # not possible if some other connection holds such a lock. # @@ -246,7 +246,7 @@ do_test shared6-4.2 { sqlite3_finalize $::STMT } {SQLITE_OK} do_test shared6-4.X { - + db1 close db2 close } {} diff --git a/third_party/sqlite/src/test/shared8.test b/third_party/sqlite/src/test/shared8.test index 73f0d476277ca..8ac1cda45153d 100644 --- a/third_party/sqlite/src/test/shared8.test +++ b/third_party/sqlite/src/test/shared8.test @@ -46,7 +46,7 @@ proc roman {n} { # # 1.8: Close all database connections (deleting the in-memory schema). # Then open a new connection and check that it cannot read the db. -# +# do_test 1.0 { sqlite3 db1 test.db db1 func roman roman @@ -62,7 +62,7 @@ do_test 1.0 { } {1 i 2 ii 3 iii 4 iv} do_test 1.1 { - execsql { + execsql { PRAGMA writable_schema = 1; DELETE FROM sqlite_master WHERE 1; PRAGMA writable_schema = 0; diff --git a/third_party/sqlite/src/test/shared9.test b/third_party/sqlite/src/test/shared9.test index 1982a593e34db..251e143bd6996 100644 --- a/third_party/sqlite/src/test/shared9.test +++ b/third_party/sqlite/src/test/shared9.test @@ -78,8 +78,8 @@ db1 close db2 close #------------------------------------------------------------------------- -# The following tests attempt to find a similar problem with collation -# sequence names - pointers to database handle specific allocations leaking +# The following tests attempt to find a similar problem with collation +# sequence names - pointers to database handle specific allocations leaking # into schema objects and being used after the original handle has been # closed. # @@ -178,14 +178,14 @@ db2 busy [list busyhandler db2] do_test 3.1 { db1 eval { - BEGIN; + BEGIN; CREATE TABLE t1(a, b); CREATE TABLE t2(a, b); INSERT INTO t1 VALUES(1, 2); INSERT INTO t2 VALUES(1, 2); } # Keep this next COMMIT as a separate statement. This ensures that COMMIT - # has already been compiled and loaded into the tcl interface statement + # has already been compiled and loaded into the tcl interface statement # cache when it is attempted below. db1 eval COMMIT db1 eval { @@ -222,7 +222,7 @@ do_test 3.6 { close $::tf db1 eval COMMIT } {} - + db1 close db2 close diff --git a/third_party/sqlite/src/test/sharedA.test b/third_party/sqlite/src/test/sharedA.test index 146fb26be0ed3..ccc66e77ec09f 100644 --- a/third_party/sqlite/src/test/sharedA.test +++ b/third_party/sqlite/src/test/sharedA.test @@ -66,7 +66,7 @@ do_test 1.1 { CREATE TABLE t1(x); INSERT INTO t1 VALUES(123); } - db1 eval { + db1 eval { SELECT * FROM t1; CREATE INDEX i1 ON t1(x); } @@ -97,11 +97,11 @@ do_test 1.3 { # # The following sequence of tests attempt to verify that the actions # taken by sqlite3RollbackAll() are thread-atomic (that they cannot be -# interrupted by a separate thread.) +# interrupted by a separate thread.) # # Note that a TCL interpreter can only be used within the thread in which -# it was originally created (because it uses thread-local-storage). -# The tvfs callbacks must therefore only run on the main thread. +# it was originally created (because it uses thread-local-storage). +# The tvfs callbacks must therefore only run on the main thread. # There is some trickery in the read_callback procedure to ensure that # this is the case. # @@ -158,7 +158,7 @@ tvfs filter xRead tvfs script read_callback unset -nocomplain ::some_time_laster unset -nocomplain ::thread_result -proc read_callback {call file args} { +proc read_callback {call file args} { if {[string match *test.db2-journal $file]} { tvfs filter {} ;# Ensure that tvfs callbacks to do run on the # child thread @@ -176,8 +176,8 @@ do_test 2.3 { db1 eval ROLLBACK } {} # schema change. # if {[info exists ::thread_result]==0} { vwait ::thread_result } -do_test 2.4 { - list $::thread_result [sqlite3_errmsg db2] +do_test 2.4 { + list $::thread_result [sqlite3_errmsg db2] } {SQLITE_SCHEMA {database schema has changed}} db1 close diff --git a/third_party/sqlite/src/test/sharedB.test b/third_party/sqlite/src/test/sharedB.test index 1b157550762f1..95639a96ddab7 100644 --- a/third_party/sqlite/src/test/sharedB.test +++ b/third_party/sqlite/src/test/sharedB.test @@ -14,7 +14,7 @@ # the second. # # This test is designed to demostrate that the fix for ticket -# [e4a18565a36884b00edf66541f38c693827968ab] works. +# [e4a18565a36884b00edf66541f38c693827968ab] works. # diff --git a/third_party/sqlite/src/test/shared_err.test b/third_party/sqlite/src/test/shared_err.test index 96e5ee454090a..ae49466ab20e2 100644 --- a/third_party/sqlite/src/test/shared_err.test +++ b/third_party/sqlite/src/test/shared_err.test @@ -112,7 +112,7 @@ do_ioerr_test shared_ioerr-2 -tclprep { incr ::residx # When this transaction begins the table contains 512 entries. The - # two statements together add 512+146 more if it succeeds. + # two statements together add 512+146 more if it succeeds. # (1024/7==146) execsql {BEGIN;} execsql {INSERT INTO t1 SELECT a+1, b FROM t1;} @@ -143,8 +143,8 @@ do_ioerr_test shared_ioerr-2 -tclprep { } # This test is designed to provoke an IO error when a cursor position is -# "saved" (because another cursor is going to modify the underlying table). -# +# "saved" (because another cursor is going to modify the underlying table). +# do_ioerr_test shared_ioerr-3 -tclprep { sqlite3 db2 test.db execsql { @@ -180,7 +180,7 @@ do_ioerr_test shared_ioerr-3 -tclprep { # There are three possible outcomes here (assuming persistent IO errors): # # 1. If the [sqlite3_step] did not require any IO (required pages in - # the cache), then the next row ("002...") may be retrieved + # the cache), then the next row ("002...") may be retrieved # successfully. # # 2. If the [sqlite3_step] does require IO, then [sqlite3_step] returns @@ -196,16 +196,16 @@ do_ioerr_test shared_ioerr-3 -tclprep { do_test shared_ioerr-3.$n.cleanup.1 { expr { - $::steprc eq "SQLITE_ROW" || + $::steprc eq "SQLITE_ROW" || $::steprc eq "SQLITE_ERROR" || - $::steprc eq "SQLITE_ABORT" + $::steprc eq "SQLITE_ABORT" } } {1} do_test shared_ioerr-3.$n.cleanup.2 { expr { ($::steprc eq "SQLITE_ROW" && $::column eq "002.002.002.002.002") || ($::steprc eq "SQLITE_ERROR" && $::column eq "") || - ($::steprc eq "SQLITE_ABORT" && $::column eq "001.001.001.001.001") + ($::steprc eq "SQLITE_ABORT" && $::column eq "001.001.001.001.001") } } {1} do_test shared_ioerr-3.$n.cleanup.3 { @@ -223,7 +223,7 @@ do_ioerr_test shared_ioerr-3 -tclprep { # This is a repeat of the previous test except that this time we # are doing a reverse-order scan of the table when the cursor is # "saved". -# +# do_ioerr_test shared_ioerr-3rev -tclprep { sqlite3 db2 test.db execsql { @@ -260,7 +260,7 @@ do_ioerr_test shared_ioerr-3rev -tclprep { # There are three possible outcomes here (assuming persistent IO errors): # # 1. If the [sqlite3_step] did not require any IO (required pages in - # the cache), then the next row ("002...") may be retrieved + # the cache), then the next row ("002...") may be retrieved # successfully. # # 2. If the [sqlite3_step] does require IO, then [sqlite3_step] returns @@ -276,16 +276,16 @@ do_ioerr_test shared_ioerr-3rev -tclprep { do_test shared_ioerr-3rev.$n.cleanup.1 { expr { - $::steprc eq "SQLITE_ROW" || + $::steprc eq "SQLITE_ROW" || $::steprc eq "SQLITE_ERROR" || - $::steprc eq "SQLITE_ABORT" + $::steprc eq "SQLITE_ABORT" } } {1} do_test shared_ioerr-3rev.$n.cleanup.2 { expr { ($::steprc eq "SQLITE_ROW" && $::column eq "197.197.197.197.197") || ($::steprc eq "SQLITE_ERROR" && $::column eq "") || - ($::steprc eq "SQLITE_ABORT" && $::column eq "198.198.198.198.198") + ($::steprc eq "SQLITE_ABORT" && $::column eq "198.198.198.198.198") } } {1} do_test shared_ioerr-3rev.$n.cleanup.3 { @@ -303,12 +303,12 @@ do_ioerr_test shared_ioerr-3rev -tclprep { # Provoke a malloc() failure when a cursor position is being saved. This # only happens with index cursors (because they malloc() space to save the # current key value). It does not happen with tables, because an integer -# key does not require a malloc() to store. +# key does not require a malloc() to store. # # The library should return an SQLITE_NOMEM to the caller. The query that # owns the cursor (the one for which the position is not saved) should # continue unaffected. -# +# do_malloc_test shared_err-4 -tclprep { sqlite3 db2 test.db execsql { @@ -380,13 +380,13 @@ do_malloc_test shared_err-6 -tclbody { # set msg #} {library routine called out of sequence} -# Again provoke a malloc() failure when a cursor position is being saved, -# this time during a ROLLBACK operation by some other handle. +# Again provoke a malloc() failure when a cursor position is being saved, +# this time during a ROLLBACK operation by some other handle. # # The library should return an SQLITE_NOMEM to the caller. The query that # owns the cursor (the one for which the position is not saved) should # be aborted. -# +# set ::aborted 0 do_malloc_test shared_err-8 -tclprep { sqlite3 db2 test.db @@ -413,7 +413,7 @@ do_malloc_test shared_err-8 -tclprep { INSERT INTO t1 VALUES(6, NULL); ROLLBACK} } -cleanup { - # UPDATE: As of [5668], if the rollback fails SQLITE_CORRUPT is returned. + # UPDATE: As of [5668], if the rollback fails SQLITE_CORRUPT is returned. # So these tests have been updated to expect SQLITE_CORRUPT and its # associated English language error message. # @@ -437,7 +437,7 @@ do_malloc_test shared_err-8 -tclprep { incr ::aborted } expr { - ($rc1=="SQLITE_DONE" && $rc2=="SQLITE_OK") || + ($rc1=="SQLITE_DONE" && $rc2=="SQLITE_OK") || ($rc1=="SQLITE_ERROR" && $rc2=="SQLITE_ABORT") || ($rc1=="SQLITE_ERROR" && $rc2=="SQLITE_NOMEM") || ($rc1=="SQLITE_ERROR" && $rc2=="SQLITE_IOERR") || @@ -447,7 +447,7 @@ do_malloc_test shared_err-8 -tclprep { db2 close } -# When this test case was written, OOM errors in write statements would +# When this test case was written, OOM errors in write statements would # cause transaction rollback, which would trip cursors in other statements, # aborting them. This no longer happens. # @@ -475,18 +475,18 @@ do_malloc_test shared_err-9 -tclprep { BEGIN; INSERT INTO abc VALUES(1, 2, 3); ROLLBACK; - } + } db2 close -} +} catch {db close} catch {db2 close} do_malloc_test shared_err-10 -tclprep { sqlite3 db test.db sqlite3 db2 test.db - + db eval { SELECT * FROM sqlite_master } - db2 eval { + db2 eval { BEGIN; CREATE TABLE abc(a, b, c); } @@ -500,9 +500,9 @@ do_malloc_test shared_err-10 -tclprep { do_malloc_test shared_err-11 -tclprep { sqlite3 db test.db sqlite3 db2 test.db - + db eval { SELECT * FROM sqlite_master } - db2 eval { + db2 eval { BEGIN; CREATE TABLE abc(a, b, c); } diff --git a/third_party/sqlite/src/test/sharedlock.test b/third_party/sqlite/src/test/sharedlock.test index caa48f5bbd441..1556d1ed242c5 100644 --- a/third_party/sqlite/src/test/sharedlock.test +++ b/third_party/sqlite/src/test/sharedlock.test @@ -68,8 +68,8 @@ foreach {tn delete_sql} { do_execsql_test 2.3 " BEGIN; $delete_sql; " - do_test 2.4 { - catchsql { SELECT * FROM t2 } db2 + do_test 2.4 { + catchsql { SELECT * FROM t2 } db2 } {1 {database table is locked: t2}} do_execsql_test 2.5 COMMIT diff --git a/third_party/sqlite/src/test/shell2.test b/third_party/sqlite/src/test/shell2.test index 2de6bf7514201..6a815990b38b1 100644 --- a/third_party/sqlite/src/test/shell2.test +++ b/third_party/sqlite/src/test/shell2.test @@ -30,7 +30,7 @@ sqlite3 db test.db # shell2-1.*: Misc. test of various tickets and reported errors. # -# Batch mode not creating databases. +# Batch mode not creating databases. # Reported on mailing list by Ken Zalewski. # Ticket [aeff892c57]. do_test shell2-1.1.1 { @@ -104,7 +104,7 @@ INSERT INTO foo(a) VALUES(1); SELECT * FROM foo; 1}} -# Test with echo on using dot command and +# Test with echo on using dot command and # turning off mid- processing. # NB. whitespace is important do_test shell2-1.4.4 { @@ -118,7 +118,7 @@ SELECT * FROM foo;} .echo OFF 1}} -# Test with echo on using dot command and +# Test with echo on using dot command and # multiple commands per line. # NB. whitespace is important do_test shell2-1.4.5 { @@ -150,7 +150,7 @@ SELECT * FROM foo2; 2 }} -# Test with echo on and headers on using dot command and +# Test with echo on and headers on using dot command and # multiple commands per line. # NB. whitespace is important do_test shell2-1.4.6 { diff --git a/third_party/sqlite/src/test/shell5.test b/third_party/sqlite/src/test/shell5.test index bb2511a5259da..88e4c55169414 100644 --- a/third_party/sqlite/src/test/shell5.test +++ b/third_party/sqlite/src/test/shell5.test @@ -122,7 +122,7 @@ SELECT COUNT(*) FROM t1;}] } {0 1} # import file with 2 rows, 2 columns -# note we end up with 3 rows because of the 1 row +# note we end up with 3 rows because of the 1 row # imported above. do_test shell5-1.4.6 { set in [open shell5.csv w] @@ -306,7 +306,7 @@ do_test shell5-1.11 { db close #---------------------------------------------------------------------------- -# +# reset_db sqlite3 db test.db do_test shell5-2.1 { diff --git a/third_party/sqlite/src/test/shell7.test b/third_party/sqlite/src/test/shell7.test index a06288514029b..4809ad0df5adf 100644 --- a/third_party/sqlite/src/test/shell7.test +++ b/third_party/sqlite/src/test/shell7.test @@ -20,9 +20,9 @@ set testprefix shell7 set CLI [test_find_cli] -do_execsql_test 1.0 { - CREATE TABLE f1(tn INTEGER PRIMARY KEY, x BLOB); - CREATE TABLE f2(tn INTEGER PRIMARY KEY, x BLOB); +do_execsql_test 1.0 { + CREATE TABLE f1(tn INTEGER PRIMARY KEY, x BLOB); + CREATE TABLE f2(tn INTEGER PRIMARY KEY, x BLOB); INSERT INTO f1 VALUES(1, X'01020304'); INSERT INTO f1 VALUES(2, X'01000304'); @@ -38,11 +38,11 @@ foreach {tn l x} [db eval { SELECT tn, length(x) AS l, x FROM f1 }] { close $fd do_test 1.$tn.1 { file size shell7_test.bin } $l - do_test 1.$tn.2 { + do_test 1.$tn.2 { catchcmd test.db "INSERT INTO f2 VALUES($tn, readfile('shell7_test.bin'));" } {0 {}} - do_execsql_test 1.$tn.3 { + do_execsql_test 1.$tn.3 { SELECT (SELECT x FROM f1 WHERE tn=1)==(SELECT x FROM f2 WHERE tn=1) } {1} } diff --git a/third_party/sqlite/src/test/skipscan1.test b/third_party/sqlite/src/test/skipscan1.test index 6cdeed5439400..875dfeec7a538 100644 --- a/third_party/sqlite/src/test/skipscan1.test +++ b/third_party/sqlite/src/test/skipscan1.test @@ -196,7 +196,7 @@ do_execsql_test skipscan1-4.1 { INSERT INTO t4 VALUES(1,2,3,4,5,6,7,8,9); ANALYZE; DELETE FROM sqlite_stat1; - INSERT INTO sqlite_stat1 + INSERT INTO sqlite_stat1 VALUES('t4','t4all','655360 163840 40960 10240 2560 640 160 40 10'); ANALYZE sqlite_master; SELECT i FROM t4 WHERE a=1; diff --git a/third_party/sqlite/src/test/skipscan2.test b/third_party/sqlite/src/test/skipscan2.test index a42ff2d0578de..8754eb14f2aa0 100644 --- a/third_party/sqlite/src/test/skipscan2.test +++ b/third_party/sqlite/src/test/skipscan2.test @@ -101,7 +101,7 @@ do_execsql_test skipscan2-1.7 { } {David Jack Patrick Quiana Xavier} # Add 8 more people, bringing the total to 34. Then the number of -# duplicates in the left-column of the index will be 17 and +# duplicates in the left-column of the index will be 17 and # skip-scan should not be used after an (unfudged) ANALYZE. # do_execsql_test skipscan2-1.8 { @@ -126,7 +126,7 @@ do_execsql_test skipscan2-1.9eqp { } {~/*INDEX people_idx1 */} # Add 2 more people, bringing the total to 36. Then the number of -# duplicates in the left-column of the index will be 18 and +# duplicates in the left-column of the index will be 18 and # skip-scan will be used after an (unfudged) ANALYZE. # do_execsql_test skipscan2-1.10 { diff --git a/third_party/sqlite/src/test/skipscan3.test b/third_party/sqlite/src/test/skipscan3.test index 260d11cac9579..96b16f381ed78 100644 --- a/third_party/sqlite/src/test/skipscan3.test +++ b/third_party/sqlite/src/test/skipscan3.test @@ -69,5 +69,5 @@ do_execsql_test skipscan3-2.3 { SELECT d FROM t2 WHERE a=1 AND c=32; } {x0032} - + finish_test diff --git a/third_party/sqlite/src/test/skipscan5.test b/third_party/sqlite/src/test/skipscan5.test index 7c3b166a8c2f4..7934fa373b296 100644 --- a/third_party/sqlite/src/test/skipscan5.test +++ b/third_party/sqlite/src/test/skipscan5.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file implements tests of the "skip-scan" query strategy. In +# This file implements tests of the "skip-scan" query strategy. In # particular it tests that stat4 data can be used by a range query # that uses the skip-scan approach. # @@ -94,7 +94,7 @@ foreach {tn dbenc coll} { do_test 2.$tn.3 { for {set i 0} {$i < 100} {incr i} { - foreach var {a b c d} { + foreach var {a b c d} { set $var [lindex $vocab($var) [expr $i % [llength $vocab($var)]]] } execsql { INSERT INTO t2 VALUES($a, $b, $c, $d) } @@ -110,7 +110,7 @@ foreach {tn dbenc coll} { 5 { c < 'q' } {/*SCAN TABLE t2*/} 6 { c < 'c' } {/*ANY(a) AND ANY(b) AND c 'zzz'" {/*ANY(a) AND b>?*/} 6 "b < 'zzz'" {/*SCAN TABLE t3*/} } { - set sql "EXPLAIN QUERY PLAN SELECT * FROM t3 WHERE $q" + set sql "EXPLAIN QUERY PLAN SELECT * FROM t3 WHERE $q" do_execsql_test 3.3.$tn $sql $res } diff --git a/third_party/sqlite/src/test/skipscan6.test b/third_party/sqlite/src/test/skipscan6.test index 026c4d7b00473..270aa9d6e4011 100644 --- a/third_party/sqlite/src/test/skipscan6.test +++ b/third_party/sqlite/src/test/skipscan6.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file implements tests of the "skip-scan" query strategy. In +# This file implements tests of the "skip-scan" query strategy. In # particular, this file verifies that use of all columns of an index # is always preferred over the use of a skip-scan on some columns of # the same index. Because of difficulties in scoring a skip-scan, @@ -155,7 +155,7 @@ do_execsql_test 3.0 { CREATE INDEX t3_a ON t3(a); WITH d(a, b) AS ( - SELECT 1, 1 + SELECT 1, 1 UNION ALL SELECT a+1, (a+1) % 5 FROM d WHERE a<100 ) @@ -170,8 +170,8 @@ do_execsql_test 3.0 { SELECT * FROM sqlite_stat1; } { t2 t2_ba {100 20 1 1} - t2 t2_a {100 1} - t3 t3_a {100 1} + t2 t2_a {100 1} + t3 t3_a {100 1} t3 t3_ba {100 20 1 1} } diff --git a/third_party/sqlite/src/test/snapshot.test b/third_party/sqlite/src/test/snapshot.test index 99d3ed47c3663..a7d5c684ae685 100644 --- a/third_party/sqlite/src/test/snapshot.test +++ b/third_party/sqlite/src/test/snapshot.test @@ -266,8 +266,8 @@ foreach {tn tcl} { execsql COMMIT } {} do_test $tn.4.1.2 { - execsql { - INSERT INTO t3 VALUES('f', 's'); + execsql { + INSERT INTO t3 VALUES('f', 's'); BEGIN; } snapshot_open db main $snapshot @@ -275,7 +275,7 @@ foreach {tn tcl} { } {o t t f} do_test $tn.4.1.3 { - execsql { + execsql { COMMIT; PRAGMA wal_checkpoint; BEGIN; @@ -381,14 +381,14 @@ foreach {tn tcl} { } } {} do_test $tn.6.3 { - sqlite3 db2 test.db + sqlite3 db2 test.db db2 eval "PRAGMA user_version ; BEGIN" snapshot_open db2 main $::snapshot db2 eval { SELECT * FROM x1 } } {z zz zzz} do_test $tn.6.4 { db2 close - sqlite3 db2 test.db + sqlite3 db2 test.db db2 eval "PRAGMA application_id" db2 eval "BEGIN" snapshot_open db2 main $::snapshot @@ -397,7 +397,7 @@ foreach {tn tcl} { do_test $tn.6.5 { db2 close - sqlite3 db2 test.db + sqlite3 db2 test.db db2 eval "BEGIN" list [catch {snapshot_open db2 main $::snapshot} msg] $msg } {1 SQLITE_ERROR} @@ -445,7 +445,7 @@ foreach {tn tcl} { INSERT INTO t1 VALUES(11); INSERT INTO t1 VALUES(12); INSERT INTO t1 VALUES(13); - BEGIN; + BEGIN; PRAGMA application_id; } {0} do_test $tn.7.2.2 { diff --git a/third_party/sqlite/src/test/snapshot_fault.test b/third_party/sqlite/src/test/snapshot_fault.test index 5c6cf40a6f1d1..9bf07cb2bf738 100644 --- a/third_party/sqlite/src/test/snapshot_fault.test +++ b/third_party/sqlite/src/test/snapshot_fault.test @@ -19,13 +19,13 @@ set testprefix snapshot_fault #------------------------------------------------------------------------- # Check that an sqlite3_snapshot_open() client cannot be tricked into -# reading a corrupt snapshot even if a second client fails while +# reading a corrupt snapshot even if a second client fails while # checkpointing the db. # do_faultsim_test 1.0 -prep { faultsim_delete_and_reopen sqlite3 db2 test.db - db2 eval { + db2 eval { CREATE TABLE t1(a, b UNIQUE, c UNIQUE); INSERT INTO t1 VALUES(1, randomblob(500), randomblob(500)); INSERT INTO t1 VALUES(2, randomblob(500), randomblob(500)); @@ -34,7 +34,7 @@ do_faultsim_test 1.0 -prep { BEGIN; SELECT a FROM t1; } - set ::snapshot [sqlite3_snapshot_get db2 main] + set ::snapshot [sqlite3_snapshot_get db2 main] db2 eval COMMIT db2 eval { UPDATE t1 SET b=randomblob(501), c=randomblob(501) WHERE a=1; @@ -48,10 +48,10 @@ do_faultsim_test 1.0 -prep { db2 eval BEGIN if {[catch { sqlite3_snapshot_open db2 main $::snapshot } msg]} { if {$msg != "SQLITE_BUSY_SNAPSHOT" && $msg != "SQLITE_BUSY"} { - error "error is $msg" + error "error is $msg" } } else { - set res [db2 eval { + set res [db2 eval { SELECT a FROM t1; PRAGMA integrity_check; }] @@ -62,14 +62,14 @@ do_faultsim_test 1.0 -prep { } #------------------------------------------------------------------------- -# This test is similar to the previous one. Except, after the +# This test is similar to the previous one. Except, after the # "PRAGMA wal_checkpoint" command fails the db is closed and reopened # so as to require wal file recovery. It should not be possible to open # a snapshot that is part of the body of a recovered wal file. # do_faultsim_test 2.0 -prep { faultsim_delete_and_reopen - db eval { + db eval { CREATE TABLE t1(a, b UNIQUE, c UNIQUE); INSERT INTO t1 VALUES(1, randomblob(500), randomblob(500)); INSERT INTO t1 VALUES(2, randomblob(500), randomblob(500)); @@ -78,7 +78,7 @@ do_faultsim_test 2.0 -prep { BEGIN; SELECT a FROM t1; } - set ::snapshot [sqlite3_snapshot_get db main] + set ::snapshot [sqlite3_snapshot_get db main] db eval COMMIT db eval { @@ -95,20 +95,20 @@ do_faultsim_test 2.0 -prep { db close db_restore_and_reopen db eval { SELECT * FROM t1 } - + db eval BEGIN if {[catch { sqlite3_snapshot_open db main $::snapshot } msg]} { if {$msg != "SQLITE_BUSY_SNAPSHOT" && $msg != "SQLITE_BUSY"} { - error "error is $msg" + error "error is $msg" } } else { # This branch should actually never be taken. But it was useful in - # determining whether or not this test was actually working (by + # determining whether or not this test was actually working (by # running a modified version of SQLite that allowed snapshots to be # opened following a recovery). error "TEST HAS FAILED" - set res [db eval { + set res [db eval { SELECT a FROM t1; PRAGMA integrity_check; }] @@ -123,7 +123,7 @@ do_faultsim_test 2.0 -prep { # do_faultsim_test 3.0 -prep { faultsim_delete_and_reopen - db eval { + db eval { CREATE TABLE t1(a, b UNIQUE, c UNIQUE); INSERT INTO t1 VALUES(1, randomblob(500), randomblob(500)); INSERT INTO t1 VALUES(2, randomblob(500), randomblob(500)); @@ -132,7 +132,7 @@ do_faultsim_test 3.0 -prep { BEGIN; SELECT a FROM t1; } - set ::snapshot [sqlite3_snapshot_get db main] + set ::snapshot [sqlite3_snapshot_get db main] db eval COMMIT db eval { UPDATE t1 SET b=randomblob(501), c=randomblob(501) WHERE a=1; @@ -149,7 +149,7 @@ do_faultsim_test 3.0 -prep { faultsim_test_result {0 {}} {1 SQLITE_IOERR} {1 SQLITE_NOMEM} \ {1 SQLITE_IOERR_NOMEM} {1 SQLITE_IOERR_READ} if {$testrc==0} { - set res [db eval { + set res [db eval { SELECT a FROM t1; PRAGMA integrity_check; }] @@ -173,14 +173,14 @@ faultsim_save_and_close do_test 4.0.1 { faultsim_restore_and_reopen - db eval { SELECT * FROM sqlite_master } + db eval { SELECT * FROM sqlite_master } sqlite3_snapshot_recover db main } {} db close do_faultsim_test 4.0 -faults oom* -prep { faultsim_restore_and_reopen - db eval { SELECT * FROM sqlite_master } + db eval { SELECT * FROM sqlite_master } } -body { sqlite3_snapshot_recover db main } -test { @@ -207,11 +207,11 @@ do_test 4.1.1 { faultsim_save_and_close do_faultsim_test 4.1 -faults shm* -prep { - catch { db2 close } - catch { db close } + catch { db2 close } + catch { db close } faultsim_restore_and_reopen sqlite3 db2 test.db - db2 eval { SELECT * FROM sqlite_master } + db2 eval { SELECT * FROM sqlite_master } db eval BEGIN sqlite3_snapshot_get_blob db main db eval COMMIT diff --git a/third_party/sqlite/src/test/soak.test b/third_party/sqlite/src/test/soak.test index c457dec4a957a..ff1e809028b35 100644 --- a/third_party/sqlite/src/test/soak.test +++ b/third_party/sqlite/src/test/soak.test @@ -22,7 +22,7 @@ proc finish_test {} {} # set TIMEOUT 3600 -# Process command-line arguments. +# Process command-line arguments. # if {[llength $argv]>0} { foreach {name value} $argv { @@ -42,9 +42,9 @@ set argv [list] # Test plan: # # The general principle is to run those SQLite tests that use -# pseudo-random data in some way over and over again for a very -# long time. The number of tests run depends on the value of -# global variable $TIMEOUT - tests are run for at least $TIMEOUT +# pseudo-random data in some way over and over again for a very +# long time. The number of tests run depends on the value of +# global variable $TIMEOUT - tests are run for at least $TIMEOUT # seconds. # # fuzz.test (pseudo-random SQL statements) @@ -52,7 +52,7 @@ set argv [list] # fuzz_malloc.test # corruptC.test (pseudo-random corruption to a database) # -# Many database changes maintaining some kind of invariant. +# Many database changes maintaining some kind of invariant. # Storing checksums etc. # diff --git a/third_party/sqlite/src/test/softheap1.test b/third_party/sqlite/src/test/softheap1.test index 07f981e50a710..000d159457cc7 100644 --- a/third_party/sqlite/src/test/softheap1.test +++ b/third_party/sqlite/src/test/softheap1.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This test script reproduces the problem reported by ticket #2565, # A database corruption bug that occurs in auto_vacuum mode when # the soft_heap_limit is set low enough to be triggered. diff --git a/third_party/sqlite/src/test/sort.test b/third_party/sqlite/src/test/sort.test index d73ecea4802d9..33f354c629ac2 100644 --- a/third_party/sqlite/src/test/sort.test +++ b/third_party/sqlite/src/test/sort.test @@ -499,7 +499,7 @@ foreach {tn mmap_limit nWorker tmpstore coremutex fakeheap softheaplimit} { 3 0 0 file true false 0 4 1000000 3 file true false 0 5 0 0 memory false true 0 - 6 0 0 file false true 1000000 + 6 0 0 file false true 1000000 7 0 0 file false true 10000 } { db close @@ -516,8 +516,8 @@ foreach {tn mmap_limit nWorker tmpstore coremutex fakeheap softheaplimit} { reset_db sqlite3_test_control SQLITE_TESTCTRL_SORTER_MMAP db $mmap_limit execsql "PRAGMA temp_store = $tmpstore; PRAGMA threads = $nWorker" - - + + set ten [string repeat X 10300] set one [string repeat y 200] diff --git a/third_party/sqlite/src/test/sort2.test b/third_party/sqlite/src/test/sort2.test index f686654d53a59..306ff9623e1e9 100644 --- a/third_party/sqlite/src/test/sort2.test +++ b/third_party/sqlite/src/test/sort2.test @@ -8,9 +8,9 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # -# Specifically, the tests in this file attempt to verify that +# Specifically, the tests in this file attempt to verify that # multi-threaded sorting works. # @@ -55,17 +55,17 @@ foreach {tn script} { LIMIT 10000 ) INSERT INTO t1 SELECT * FROM r; } - + do_execsql_test $tn.2.2 { CREATE UNIQUE INDEX i1 ON t1(b, a); } - + do_execsql_test $tn.2.3 { CREATE UNIQUE INDEX i2 ON t1(a); } - + do_execsql_test $tn.2.4 { PRAGMA integrity_check } {ok} - + # Because it uses so much data, this test can take 12-13 seconds even on # a modern workstation. So it is omitted from "veryquick" and other # permutations.test tests. diff --git a/third_party/sqlite/src/test/sort3.test b/third_party/sqlite/src/test/sort3.test index 088ae1642d6d6..03ad9b30f530e 100644 --- a/third_party/sqlite/src/test/sort3.test +++ b/third_party/sqlite/src/test/sort3.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # The tests in this file verify that sorting works when the library is # configured to use mmap(), but the temporary files generated by the @@ -82,10 +82,10 @@ foreach {itest limit} { ) SELECT count(*), sum(length(y)) FROM r GROUP BY (x%5); } { - 4000 4000000 - 4000 4000000 - 4000 4000000 - 4000 4000000 + 4000 4000000 + 4000 4000000 + 4000 4000000 + 4000 4000000 4000 4000000 } } @@ -103,10 +103,10 @@ do_execsql_test 3 { ) SELECT count(*), sum(length(y)) FROM r GROUP BY (x%5); } { - 440000 440000000 - 440000 440000000 - 440000 440000000 - 440000 440000000 + 440000 440000000 + 440000 440000000 + 440000 440000000 + 440000 440000000 440000 440000000 } diff --git a/third_party/sqlite/src/test/sort4.test b/third_party/sqlite/src/test/sort4.test index 13d9a5999a8ac..2677fea09541c 100644 --- a/third_party/sqlite/src/test/sort4.test +++ b/third_party/sqlite/src/test/sort4.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # The tests in this file are brute force tests of the multi-threaded # sorter. @@ -48,7 +48,7 @@ if {[permutation] == "multithread"} { set SORT4TIMEOUT 300 } #-------------------------------------------------------------------- # Set up a table "t1" containing $nRow rows. Each row contains also -# contains blob fields that collectively contain at least $nPayload +# contains blob fields that collectively contain at least $nPayload # bytes of content. The table schema is as follows: # # CREATE TABLE t1(a INTEGER, , b INTEGER); @@ -58,13 +58,13 @@ if {[permutation] == "multithread"} { set SORT4TIMEOUT 300 } # are at most eight, are named c0, c1, c2 etc. Column c0 contains a 4 # byte string. Column c1 an 8 byte string. Field c2 16 bytes, and so on. # -# This table is intended to be used for testing queries of the form: +# This table is intended to be used for testing queries of the form: # # SELECT a, , b FROM t1 ORDER BY a; # -# The test code checks that rows are returned in order, and that the +# The test code checks that rows are returned in order, and that the # values of "a" and "b" are the same for each row (the idea being that -# if field "b" at the end of the sorter record has not been corrupted, +# if field "b" at the end of the sorter record has not been corrupted, # the rest of the record is probably Ok as well). # proc populate_table {nRow nPayload} { @@ -102,9 +102,9 @@ proc sorter_test {nRow nRead nPayload} { set nPayload [expr (($nPayload+3)/4) * 4] set cols [list] - foreach {mask col} { - 0x04 c0 0x08 c1 0x10 c2 0x20 c3 - 0x40 c4 0x80 c5 0x100 c6 0x200 c7 + foreach {mask col} { + 0x04 c0 0x08 c1 0x10 c2 0x20 c3 + 0x40 c4 0x80 c5 0x100 c6 0x200 c7 } { if {$nPayload & $mask} { lappend cols $col } } @@ -128,7 +128,7 @@ proc sorter_test {nRow nRead nPayload} { # exception is thrown. # sorter_test_sort4_helper db $sql1 $nRead $sql2 - set {} {} + set {} {} } # Usage: @@ -153,7 +153,7 @@ proc do_sorter_test {tn args} { set a(-fakeheap) 0 foreach {s val} $args { - if {[info exists a($s)]==0} { + if {[info exists a($s)]==0} { unset a(-cachesize) set optlist "[join [array names a] ,] or -cachesize" error "Unknown option $s, expected $optlist" diff --git a/third_party/sqlite/src/test/sort5.test b/third_party/sqlite/src/test/sort5.test index 6ada81c9ccf07..baac6555c7b34 100644 --- a/third_party/sqlite/src/test/sort5.test +++ b/third_party/sqlite/src/test/sort5.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # set testdir [file dirname $argv0] @@ -75,7 +75,7 @@ sqlite3 db test.db -vfs tvfs execsql { CREATE TABLE t1(x) } # Each iteration of the following loop attempts to sort 10001 records -# each a bit over 100 bytes in size. In total a little more than 1MiB +# each a bit over 100 bytes in size. In total a little more than 1MiB # of data. # foreach {tn pgsz cachesz bTemp} { diff --git a/third_party/sqlite/src/test/sortfault.test b/third_party/sqlite/src/test/sortfault.test index f9fe2be48af03..94da31caeac78 100644 --- a/third_party/sqlite/src/test/sortfault.test +++ b/third_party/sqlite/src/test/sortfault.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # Specifically, it tests the effects of fault injection on the sorter # module (code in vdbesort.c). @@ -54,7 +54,7 @@ foreach {tn mmap_limit nWorker tmpstore threadsmode fakeheap lookaside} { sqlite3_test_control SQLITE_TESTCTRL_SORTER_MMAP db $::mmap_limit execsql { PRAGMA cache_size = 5 } } -body { - execsql { + execsql { WITH r(x,y) AS ( SELECT 1, $::str UNION ALL @@ -73,7 +73,7 @@ foreach {tn mmap_limit nWorker tmpstore threadsmode fakeheap lookaside} { add_test_utf16bin_collate db execsql { PRAGMA cache_size = 5 } } -body { - execsql { + execsql { WITH r(x,y) AS ( SELECT 100, $::str UNION ALL @@ -95,7 +95,7 @@ foreach {tn mmap_limit nWorker tmpstore threadsmode fakeheap lookaside} { execsql { PRAGMA cache_size = 5 } do_faultsim_test 3.$tn -faults oom-trans* -body { - execsql { + execsql { WITH r(x,y) AS ( SELECT 300, $::str2 UNION ALL @@ -124,13 +124,13 @@ sqlite3_initialize #------------------------------------------------------------------------- # reset_db -do_execsql_test 4.0 { - CREATE TABLE t1(a, b, c); +do_execsql_test 4.0 { + CREATE TABLE t1(a, b, c); INSERT INTO t1 VALUES(1, 2, 3); } -do_test 4.1 { +do_test 4.1 { for {set i 0} {$i < 256} {incr i} { - execsql { + execsql { INSERT INTO t1 SELECT ((a<<3) + b) & 2147483647, ((b<<3) + c) & 2147483647, @@ -156,10 +156,10 @@ reset_db set a [string repeat a 500] set b [string repeat b 500] set c [string repeat c 500] -do_execsql_test 5.0 { - CREATE TABLE t1(a, b, c); - INSERT INTO t1 VALUES($a, $b, $c); - INSERT INTO t1 VALUES($c, $b, $a); +do_execsql_test 5.0 { + CREATE TABLE t1(a, b, c); + INSERT INTO t1 VALUES($a, $b, $c); + INSERT INTO t1 VALUES($c, $b, $a); } do_faultsim_test 5.1 -faults oom* -body { diff --git a/third_party/sqlite/src/test/speed1.test b/third_party/sqlite/src/test/speed1.test index 86d13ba4aee7d..ff5564df81583 100644 --- a/third_party/sqlite/src/test/speed1.test +++ b/third_party/sqlite/src/test/speed1.test @@ -278,7 +278,7 @@ do_test speed1-1.1 { db one {SELECT count(*) FROM t1} } 30000 - + # Delete 20000 more rows at random from the table. # speed_trial speed1-random-del2 20000 row { diff --git a/third_party/sqlite/src/test/speed1p.explain b/third_party/sqlite/src/test/speed1p.explain index e32feddf304e2..e774e5ade9121 100644 --- a/third_party/sqlite/src/test/speed1p.explain +++ b/third_party/sqlite/src/test/speed1p.explain @@ -9,7 +9,7 @@ # #************************************************************************* # This file implements regression tests for SQLite library. The -# focus of this script is measuring executing speed. +# focus of this script is measuring executing speed. # # This is a copy of speed1.test modified to user prepared statements. # @@ -351,7 +351,7 @@ do_test speed1p-1.1 { db one {SELECT count(*) FROM t1} } 30000 - + # Delete 20000 more rows at random from the table. # speed_trial speed1p-random-del2 20000 row { diff --git a/third_party/sqlite/src/test/speed1p.test b/third_party/sqlite/src/test/speed1p.test index 6bf7b10e1fa87..ad68f3ac580b8 100644 --- a/third_party/sqlite/src/test/speed1p.test +++ b/third_party/sqlite/src/test/speed1p.test @@ -9,7 +9,7 @@ # #************************************************************************* # This file implements regression tests for SQLite library. The -# focus of this script is measuring executing speed. +# focus of this script is measuring executing speed. # # This is a copy of speed1.test modified to user prepared statements. # @@ -327,7 +327,7 @@ speed_trial speed1p-random-del1 20000 row { do_test speed1p-1.1 { db one {SELECT count(*) FROM t1} } 30000 - + # Delete 20000 more rows at random from the table. # speed_trial speed1p-random-del2 20000 row { diff --git a/third_party/sqlite/src/test/speed2.test b/third_party/sqlite/src/test/speed2.test index f6d1a4c8ab6e2..54bb31782093b 100644 --- a/third_party/sqlite/src/test/speed2.test +++ b/third_party/sqlite/src/test/speed2.test @@ -323,7 +323,7 @@ do_test speed2-1.1 { db one {SELECT count(*) FROM t1} } 30000 - + # Delete 20000 more rows at random from the table. # speed_trial speed2-random-del2 20000 row { diff --git a/third_party/sqlite/src/test/speed3.test b/third_party/sqlite/src/test/speed3.test index 4aa90943bad19..279b6e0e9c271 100644 --- a/third_party/sqlite/src/test/speed3.test +++ b/third_party/sqlite/src/test/speed3.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #************************************************************************* -# This file implements regression tests for SQLite library. The +# This file implements regression tests for SQLite library. The # focus of this script is testing that the overflow-page related # enhancements added after version 3.3.17 speed things up. # @@ -23,7 +23,7 @@ # # + When deleting rows that span overflow pages. This is faster # because the overflow pages no longer need to be read before -# they can be moved to the free list (test cases speed3-1.X). +# they can be moved to the free list (test cases speed3-1.X). # # + When reading a column value stored on an overflow page that # is not the first overflow page for the row. The improvement @@ -108,10 +108,10 @@ proc io_log {db} { proc speed3_reset_db {} { db close sqlite3 db test.db - db eval { + db eval { PRAGMA main.cache_size = 200000; PRAGMA main.auto_vacuum = 'incremental'; - ATTACH 'test2.db' AS 'aux'; + ATTACH 'test2.db' AS 'aux'; PRAGMA aux.auto_vacuum = 'none'; } } @@ -159,7 +159,7 @@ speed_trial speed3-1.incrvacuum $::NROW row {DELETE FROM main.t1 WHERE 1} speed_trial speed3-1.normal $::NROW row {DELETE FROM aux.t1 WHERE 1} io_log db -# Select the "C" column (located at the far end of the overflow +# Select the "C" column (located at the far end of the overflow # chain) from each table row. # #db eval {PRAGMA incremental_vacuum(500000)} diff --git a/third_party/sqlite/src/test/speed4.test b/third_party/sqlite/src/test/speed4.test index 2ccdaf5cd3a38..57575b5a2606b 100644 --- a/third_party/sqlite/src/test/speed4.test +++ b/third_party/sqlite/src/test/speed4.test @@ -151,8 +151,8 @@ speed_trial speed4-table1 10000 stmt $sql set sql "" for {set ii 1} {$ii < 10000} {incr ii} { append sql " - SELECT (SELECT t FROM t1 WHERE rowid = [expr {$ii*3}]), - (SELECT t FROM t2 WHERE rowid = [expr {$ii*3}]), + SELECT (SELECT t FROM t1 WHERE rowid = [expr {$ii*3}]), + (SELECT t FROM t2 WHERE rowid = [expr {$ii*3}]), (SELECT t FROM t3 WHERE rowid = [expr {$ii*3}]) ;" } diff --git a/third_party/sqlite/src/test/speed4p.explain b/third_party/sqlite/src/test/speed4p.explain index a713955e618a6..4ef00f04ada9a 100644 --- a/third_party/sqlite/src/test/speed4p.explain +++ b/third_party/sqlite/src/test/speed4p.explain @@ -165,15 +165,15 @@ set script { for {set ii 1} {$ii < 10000} {incr ii} { set v [expr {$ii*3}] db eval { - SELECT (SELECT t FROM t1 WHERE rowid = $v), - (SELECT t FROM t2 WHERE rowid = $v), + SELECT (SELECT t FROM t1 WHERE rowid = $v), + (SELECT t FROM t2 WHERE rowid = $v), (SELECT t FROM t3 WHERE rowid = $v) } } } explain { - SELECT (SELECT t FROM t1 WHERE rowid = $v), - (SELECT t FROM t2 WHERE rowid = $v), + SELECT (SELECT t FROM t1 WHERE rowid = $v), + (SELECT t FROM t2 WHERE rowid = $v), (SELECT t FROM t3 WHERE rowid = $v) } speed_trial_tcl speed4p-subselect1 10000 stmt $script diff --git a/third_party/sqlite/src/test/speed4p.test b/third_party/sqlite/src/test/speed4p.test index 024232e1b8afb..45788c6cdd1d8 100644 --- a/third_party/sqlite/src/test/speed4p.test +++ b/third_party/sqlite/src/test/speed4p.test @@ -155,8 +155,8 @@ set script { for {set ii 1} {$ii < 10000} {incr ii} { set v [expr {$ii*3}] db eval { - SELECT (SELECT t FROM t1 WHERE rowid = $v), - (SELECT t FROM t2 WHERE rowid = $v), + SELECT (SELECT t FROM t1 WHERE rowid = $v), + (SELECT t FROM t2 WHERE rowid = $v), (SELECT t FROM t3 WHERE rowid = $v) } } diff --git a/third_party/sqlite/src/test/speedtest1.c b/third_party/sqlite/src/test/speedtest1.c index f5b79915c87cc..501b268d8a195 100644 --- a/third_party/sqlite/src/test/speedtest1.c +++ b/third_party/sqlite/src/test/speedtest1.c @@ -7,7 +7,7 @@ static const char zHelp[] = "Usage: %s [--options] DATABASE\n" "Options:\n" " --autovacuum Enable AUTOVACUUM mode\n" - " --cachesize N Set the cache size to N\n" + " --cachesize N Set the cache size to N\n" " --exclusive Enable locking_mode=EXCLUSIVE\n" " --explain Like --sqlonly but with added EXPLAIN keywords\n" " --heap SZ MIN Memory allocator uses SZ bytes & min allocation MIN\n" @@ -224,8 +224,8 @@ unsigned roundup_allones(unsigned limit){ ** speedtest1_numbername(123) -> "one hundred twenty three" */ int speedtest1_numbername(unsigned int n, char *zOut, int nOut){ - static const char *ones[] = { "zero", "one", "two", "three", "four", "five", - "six", "seven", "eight", "nine", "ten", "eleven", "twelve", + static const char *ones[] = { "zero", "one", "two", "three", "four", "five", + "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen" }; static const char *tens[] = { "", "ten", "twenty", "thirty", "forty", @@ -334,7 +334,7 @@ static void printSql(const char *zSql){ if( g.bExplain ) printf("EXPLAIN "); printf("%.*s;\n", n, zSql); if( g.bExplain -#if SQLITE_VERSION_NUMBER>=3007017 +#if SQLITE_VERSION_NUMBER>=3007017 && ( sqlite3_strglob("CREATE *", zSql)==0 || sqlite3_strglob("DROP *", zSql)==0 || sqlite3_strglob("ALTER *", zSql)==0 @@ -1236,7 +1236,7 @@ void testset_rtree(int p1, int p2){ } speedtest1_end_test(); } - + n = g.szTest*100; speedtest1_begin_test(120, "%d one-dimensional overlap slice queries", n); speedtest1_prepare("SELECT count(*) FROM rt1 WHERE y1>=?1 AND y0<=?2"); @@ -1265,7 +1265,7 @@ void testset_rtree(int p1, int p2){ } speedtest1_end_test(); } - + n = g.szTest*100; speedtest1_begin_test(125, "%d custom geometry callback queries", n); @@ -1360,7 +1360,7 @@ static void displayLinuxIoStats(FILE *out){ } } fclose(in); -} +} #endif #if SQLITE_VERSION_NUMBER<3006018 @@ -1558,7 +1558,7 @@ int main(int argc, char **argv){ sqlite3_config(SQLITE_CONFIG_LOOKASIDE, 0, 0); } #endif - + /* Open the database and the input file */ if( sqlite3_open(zDbName, &g.db) ){ fatal_error("Cannot open database file: %s\n", zDbName); @@ -1645,12 +1645,12 @@ int main(int argc, char **argv){ printf("-- Page cache misses: %d\n", iCur); #if SQLITE_VERSION_NUMBER>=3007012 sqlite3_db_status(g.db, SQLITE_DBSTATUS_CACHE_WRITE, &iCur, &iHi, 1); - printf("-- Page cache writes: %d\n", iCur); + printf("-- Page cache writes: %d\n", iCur); #endif sqlite3_db_status(g.db, SQLITE_DBSTATUS_SCHEMA_USED, &iCur, &iHi, 0); - printf("-- Schema Heap Usage: %d bytes\n", iCur); + printf("-- Schema Heap Usage: %d bytes\n", iCur); sqlite3_db_status(g.db, SQLITE_DBSTATUS_STMT_USED, &iCur, &iHi, 0); - printf("-- Statement Heap Usage: %d bytes\n", iCur); + printf("-- Statement Heap Usage: %d bytes\n", iCur); } #endif diff --git a/third_party/sqlite/src/test/spellfix.test b/third_party/sqlite/src/test/spellfix.test index 8128bb59d20a3..f9cb79740d654 100644 --- a/third_party/sqlite/src/test/spellfix.test +++ b/third_party/sqlite/src/test/spellfix.test @@ -79,7 +79,7 @@ foreach {tn word res} { 9 renstom* {rainstorm 8 ransom 6 ransomer 6 ransoming 6 ransoms 6} } { do_execsql_test 1.2.$tn { - SELECT word, matchlen FROM t1 WHERE word MATCH $word + SELECT word, matchlen FROM t1 WHERE word MATCH $word ORDER BY score, word LIMIT 5 } $res } @@ -256,7 +256,7 @@ ifcapable trace { lappend ::trace [string range $sql 3 end] } } - + proc do_tracesql_test {tn sql {res {}}} { set ::trace [list] uplevel [list do_test $tn [subst -nocommands { @@ -264,7 +264,7 @@ ifcapable trace { concat [set vals] [set ::trace] }] [list {*}$res]] } - + db trace trace_callback do_tracesql_test 6.2.1 { SELECT word FROM t3 WHERE rowid = 10; @@ -283,19 +283,19 @@ ifcapable trace { } } -#------------------------------------------------------------------------- -# Test that the spellfix1 table supports conflict handling (OR REPLACE +#------------------------------------------------------------------------- +# Test that the spellfix1 table supports conflict handling (OR REPLACE # and so on). # do_execsql_test 7.1 { CREATE VIRTUAL TABLE t4 USING spellfix1; PRAGMA table_info = t4; } { - 0 word {} 0 {} 0 - 1 rank {} 0 {} 0 - 2 distance {} 0 {} 0 - 3 langid {} 0 {} 0 - 4 score {} 0 {} 0 + 0 word {} 0 {} 0 + 1 rank {} 0 {} 0 + 2 distance {} 0 {} 0 + 3 langid {} 0 {} 0 + 4 score {} 0 {} 0 5 matchlen {} 0 {} 0 } diff --git a/third_party/sqlite/src/test/spellfix2.test b/third_party/sqlite/src/test/spellfix2.test index d1a13284ea63d..fc24844886125 100644 --- a/third_party/sqlite/src/test/spellfix2.test +++ b/third_party/sqlite/src/test/spellfix2.test @@ -28,7 +28,7 @@ do_execsql_test 1.0 { } do_execsql_test 1.1 { - SELECT word, distance, matchlen FROM demo + SELECT word, distance, matchlen FROM demo WHERE word MATCH 'amstedam*' AND top=3 ORDER BY +word; } { @@ -38,7 +38,7 @@ do_execsql_test 1.1 { } do_execsql_test 1.2 { - SELECT word, distance, matchlen FROM demo WHERE + SELECT word, distance, matchlen FROM demo WHERE word MATCH 'amstedam*' AND top=3 AND distance <= 100 ORDER BY +word; } { @@ -48,7 +48,7 @@ do_execsql_test 1.2 { } do_execsql_test 1.3 { - SELECT word, distance, matchlen FROM demo WHERE + SELECT word, distance, matchlen FROM demo WHERE word MATCH 'amstedam*' AND distance <= 100 ORDER BY +word; } { @@ -68,14 +68,14 @@ do_test 1.4 { do_execsql_test 1.5 { SELECT count(*) FROM demo WHERE word MATCH 'amstedam*' AND distance <= 100; - SELECT count(*) FROM demo + SELECT count(*) FROM demo WHERE word MATCH 'amstedam*' AND distance <= 100 AND top=20; } { 32 20 } do_execsql_test 1.6 { - SELECT word, distance, matchlen FROM demo + SELECT word, distance, matchlen FROM demo WHERE word MATCH 'amstedam*' AND distance <= 100 ORDER BY distance, word; } { @@ -98,7 +98,7 @@ do_execsql_test 1.6 { } do_execsql_test 1.7 { - SELECT word, distance, matchlen FROM demo + SELECT word, distance, matchlen FROM demo WHERE word MATCH 'amstedam*' AND distance <= 100 AND top=20 ORDER BY distance, word; } { diff --git a/third_party/sqlite/src/test/sqllimits1.test b/third_party/sqlite/src/test/sqllimits1.test index 9508b5233dc7d..0a2e7210c1275 100644 --- a/third_party/sqlite/src/test/sqllimits1.test +++ b/third_party/sqlite/src/test/sqllimits1.test @@ -318,10 +318,10 @@ do_test sqllimits1-5.14.1 { sqlite3_bind_zeroblob $::STMT 1 [expr {$SQLITE_LIMIT_LENGTH + 1}] } {} do_test sqllimits1-5.14.2 { - sqlite3_step $::STMT + sqlite3_step $::STMT } {SQLITE_ERROR} do_test sqllimits1-5.14.3 { - sqlite3_reset $::STMT + sqlite3_reset $::STMT } {SQLITE_TOOBIG} do_test sqllimits1-5.14.4 { set np1 [expr {$SQLITE_LIMIT_LENGTH + 1}] @@ -354,7 +354,7 @@ do_test sqllimits1-5.14.9 { catch {sqlite3_bind_text16 $::STMT 1 $::str1 $n} res set res } {} -sqlite3_finalize $::STMT +sqlite3_finalize $::STMT do_test sqllimits1-5.15 { execsql { @@ -471,7 +471,7 @@ do_test sqllimits1-7.2 { # # Therefore, a single insert adds (N^16 plus some) rows to the database. # A really long loop... - # + # execsql { CREATE TRIGGER update_b BEFORE UPDATE ON trig FOR EACH ROW BEGIN @@ -497,7 +497,7 @@ do_test sqllimits1-7.2 { do_test sqllimits1-7.3 { execsql { - INSERT INTO trig VALUES (1,1); + INSERT INTO trig VALUES (1,1); } } {} @@ -586,7 +586,7 @@ do_test sqllimits1-8.1 { for {set i 0} {$i <= $SQLITE_LIMIT_COLUMN} {incr i} { lappend cols "c$i" } - catchsql "CREATE TABLE t([join $cols ,])" + catchsql "CREATE TABLE t([join $cols ,])" } {1 {too many columns on t}} do_test sqllimits1-8.2 { @@ -682,7 +682,7 @@ do_test sqllimits1-8.11 { #-------------------------------------------------------------------- # These tests - sqllimits1-9.* - test that the SQLITE_LIMIT_EXPR_DEPTH -# limit is enforced. The limit refers to the number of terms in +# limit is enforced. The limit refers to the number of terms in # the expression. # # EVIDENCE-OF: R-12723-08526 SQLITE_LIMIT_EXPR_DEPTH The maximum depth @@ -699,9 +699,9 @@ if {$SQLITE_MAX_EXPR_DEPTH==0} { SELECT $expr }] } "1 {Expression tree is too large (maximum depth $::SQLITE_MAX_EXPR_DEPTH)}" - + # Attempting to beat the expression depth limit using nested SELECT - # queries causes a parser stack overflow. + # queries causes a parser stack overflow. do_test sqllimits1-9.2 { set max $::SQLITE_MAX_EXPR_DEPTH set expr "SELECT 1" @@ -710,8 +710,8 @@ if {$SQLITE_MAX_EXPR_DEPTH==0} { } catchsql [subst { $expr }] } "1 {parser stack overflow}" - -if 0 { + +if 0 { do_test sqllimits1-9.3 { execsql { PRAGMA max_page_count = 1000000; -- 1 GB @@ -727,7 +727,7 @@ if 0 { } } } {} - + do_test sqllimits1-9.4 { catchsql { SELECT a FROM v199 @@ -806,7 +806,7 @@ ifcapable attach { } #-------------------------------------------------------------------- -# Test cases sqllimits1-13.*: Check that the SQLITE_MAX_VARIABLE_NUMBER +# Test cases sqllimits1-13.*: Check that the SQLITE_MAX_VARIABLE_NUMBER # limit works. # # EVIDENCE-OF: R-42363-29104 SQLITE_LIMIT_VARIABLE_NUMBER The maximum @@ -827,9 +827,9 @@ do_test sqllimits1-13.2 { #-------------------------------------------------------------------- -# Test cases sqllimits1-15.* verify that the +# Test cases sqllimits1-15.* verify that the # SQLITE_MAX_LIKE_PATTERN_LENGTH limit is enforced. This limit only -# applies to the built-in LIKE operator, supplying an external +# applies to the built-in LIKE operator, supplying an external # implementation by overriding the like() scalar function bypasses # this limitation. # diff --git a/third_party/sqlite/src/test/stat.test b/third_party/sqlite/src/test/stat.test index 66ca5e2f2b363..f17e4959b3246 100644 --- a/third_party/sqlite/src/test/stat.test +++ b/third_party/sqlite/src/test/stat.test @@ -134,7 +134,7 @@ do_execsql_test stat-2.1 { t3 /00f/ 23 leaf 2 738 268 370 \ ] -# With every index entry overflowing, make sure no pages are missed +# With every index entry overflowing, make sure no pages are missed # (other than the locking page which is 64 in this test build.) # do_execsql_test stat-2.2 { @@ -220,27 +220,27 @@ do_execsql_test 7.1 { do_execsql_test 7.1.1 { SELECT * FROM dbstat('123'); } { - sqlite_master / 1 leaf 1 37 875 37 0 1024 + sqlite_master / 1 leaf 1 37 875 37 0 1024 x1 / 2 leaf 1 4 1008 4 1024 1024 } do_execsql_test 7.1.2 { SELECT * FROM dbstat(123); } { - sqlite_master / 1 leaf 1 37 875 37 0 1024 + sqlite_master / 1 leaf 1 37 875 37 0 1024 x1 / 2 leaf 1 4 1008 4 1024 1024 } do_execsql_test 7.1.3 { CREATE VIRTUAL TABLE x2 USING dbstat('123'); SELECT * FROM x2; } { - sqlite_master / 1 leaf 1 37 875 37 0 1024 + sqlite_master / 1 leaf 1 37 875 37 0 1024 x1 / 2 leaf 1 4 1008 4 1024 1024 } do_execsql_test 7.1.4 { CREATE VIRTUAL TABLE x3 USING dbstat(123); SELECT * FROM x3; } { - sqlite_master / 1 leaf 1 37 875 37 0 1024 + sqlite_master / 1 leaf 1 37 875 37 0 1024 x1 / 2 leaf 1 4 1008 4 1024 1024 } @@ -253,7 +253,7 @@ do_execsql_test 7.2 { do_execsql_test 7.2.1 { SELECT * FROM dbstat('123corp'); } { - sqlite_master / 1 leaf 1 37 875 37 0 1024 + sqlite_master / 1 leaf 1 37 875 37 0 1024 x1 / 2 leaf 1 4 1008 4 1024 1024 } do_catchsql_test 7.2.2 { @@ -263,7 +263,7 @@ do_execsql_test 7.2.3 { CREATE VIRTUAL TABLE x2 USING dbstat('123corp'); SELECT * FROM x2; } { - sqlite_master / 1 leaf 1 37 875 37 0 1024 + sqlite_master / 1 leaf 1 37 875 37 0 1024 x1 / 2 leaf 1 4 1008 4 1024 1024 } do_catchsql_test 7.2.4 { diff --git a/third_party/sqlite/src/test/statfault.test b/third_party/sqlite/src/test/statfault.test index ce79e328d8773..942d0e626dabf 100644 --- a/third_party/sqlite/src/test/statfault.test +++ b/third_party/sqlite/src/test/statfault.test @@ -38,7 +38,7 @@ do_faultsim_test 1 -faults * -prep { } -body { execsql { SELECT count(*) FROM sss } } -test { - faultsim_test_result {0 8} + faultsim_test_result {0 8} } diff --git a/third_party/sqlite/src/test/stmt.test b/third_party/sqlite/src/test/stmt.test index df501f7654702..33545c7239f03 100644 --- a/third_party/sqlite/src/test/stmt.test +++ b/third_party/sqlite/src/test/stmt.test @@ -83,7 +83,7 @@ proc filecount {testname sql expected} { filecount stmt-2.1 { INSERT INTO t1 VALUES(9, 9) } 2 filecount stmt-2.2 { REPLACE INTO t1 VALUES(9, 9) } 2 filecount stmt-2.3 { INSERT INTO t1 SELECT 9, 9 } 2 -filecount stmt-2.4 { +filecount stmt-2.4 { INSERT INTO t1 SELECT 9, 9; INSERT INTO t1 SELECT 10, 10; } 2 @@ -91,9 +91,9 @@ filecount stmt-2.4 { do_test stmt-2.5 { execsql { CREATE INDEX i1 ON t1(b) } } {} -filecount stmt-2.6 { +filecount stmt-2.6 { + REPLACE INTO t1 VALUES(5, 5); REPLACE INTO t1 VALUES(5, 5); - REPLACE INTO t1 VALUES(5, 5); } 2 finish_test diff --git a/third_party/sqlite/src/test/subquery.test b/third_party/sqlite/src/test/subquery.test index 06facbbae0520..7967f48896fd3 100644 --- a/third_party/sqlite/src/test/subquery.test +++ b/third_party/sqlite/src/test/subquery.test @@ -93,7 +93,7 @@ do_test subquery-1.9.1 { } {0 1 1 1} do_test subquery-1.9.2 { execsql { - SELECT a FROM t1 WHERE (SELECT (y*2)>b FROM t2 WHERE a=x); + SELECT a FROM t1 WHERE (SELECT (y*2)>b FROM t2 WHERE a=x); } } {3 5 7} @@ -128,7 +128,7 @@ do_test subquery-1.10.4 { INSERT INTO t5 VALUES(5, '2003-4'); SELECT period, vsum - FROM (SELECT + FROM (SELECT a.period, (select sum(val) from t5 where period between a.period and '2002-4') vsum FROM t5 a where a.period between '2002-1' and '2002-4') @@ -140,7 +140,7 @@ do_test subquery-1.10.5 { SELECT period, vsum from (select a.period, (select sum(val) from t5 where period between a.period and '2002-4') vsum - FROM t5 a where a.period between '2002-1' and '2002-4') + FROM t5 a where a.period between '2002-1' and '2002-4') WHERE vsum < 45 ; } } {2002-2 30 2002-3 25 2002-4 15} @@ -420,8 +420,8 @@ do_test subquery-3.5.7 { #------------------------------------------------------------------ -# These tests - subquery-4.* - use the TCL statement cache to try -# and expose bugs to do with re-using statements that have been +# These tests - subquery-4.* - use the TCL statement cache to try +# and expose bugs to do with re-using statements that have been # passed to sqlite3_reset(). # # One problem was that VDBE memory cells were not being initialized @@ -476,7 +476,7 @@ do_test subquery-5.1 { INSERT INTO t5 VALUES(2,22); INSERT INTO t5 VALUES(3,33); INSERT INTO t5 VALUES(4,44); - SELECT b FROM t5 WHERE a IN + SELECT b FROM t5 WHERE a IN (SELECT callcnt(y)+0 FROM t4 WHERE x="two") } } {22} diff --git a/third_party/sqlite/src/test/subquery2.test b/third_party/sqlite/src/test/subquery2.test index de637d5d25638..eb5a0397b881a 100644 --- a/third_party/sqlite/src/test/subquery2.test +++ b/third_party/sqlite/src/test/subquery2.test @@ -71,14 +71,14 @@ do_test subquery2-1.12 { do_test subquery2-1.21 { execsql { SELECT a FROM t1 - WHERE +b=(SELECT x+1 FROM + WHERE +b=(SELECT x+1 FROM (SELECT DISTINCT f/d AS x FROM t2 JOIN t3 ON d*a=f)) } } {1 3 5 7} do_test subquery2-1.22 { execsql { SELECT a FROM t1 - WHERE b=(SELECT x+1 FROM + WHERE b=(SELECT x+1 FROM (SELECT DISTINCT f/d AS x FROM t2 JOIN t3 ON d*a=f)) } } {1 3 5 7} @@ -98,14 +98,14 @@ do_execsql_test 2.1 { } do_execsql_test 2.2 { - SELECT * - FROM (SELECT * FROM t4 ORDER BY a LIMIT -1 OFFSET 1) + SELECT * + FROM (SELECT * FROM t4 ORDER BY a LIMIT -1 OFFSET 1) LIMIT (SELECT a FROM t5) } {2 3 3 6 4 10} ############################################################################ # Ticket http://www.sqlite.org/src/info/d11a6e908f (2014-09-20) -# Query planner fault on three-way nested join with compound inner SELECT +# Query planner fault on three-way nested join with compound inner SELECT # do_execsql_test 3.0 { DROP TABLE IF EXISTS t1; @@ -118,7 +118,7 @@ do_execsql_test 3.0 { INSERT INTO t2(id,data) VALUES(9,'nine-b'); INSERT INTO t2(id,data) VALUES(10,'ten-b'); INSERT INTO t2(id,data) VALUES(11,'eleven-b'); - + SELECT id FROM ( SELECT id,data FROM ( SELECT * FROM t1 UNION ALL SELECT * FROM t2 diff --git a/third_party/sqlite/src/test/subselect.test b/third_party/sqlite/src/test/subselect.test index 4d0efde47abf9..57673a373ad3e 100644 --- a/third_party/sqlite/src/test/subselect.test +++ b/third_party/sqlite/src/test/subselect.test @@ -83,7 +83,7 @@ do_test subselect-1.5 { INSERT INTO t2 VALUES(4,16); } execsql { - SELECT y from t2 + SELECT y from t2 WHERE x = (SELECT sum(b) FROM t1 where a notnull) - (SELECT sum(a) FROM t1) } } {8} @@ -129,7 +129,7 @@ ifcapable !compound { do_test subselect-3.1 { execsql { CREATE TABLE t3(x int); - INSERT INTO t3 SELECT a FROM t1; + INSERT INTO t3 SELECT a FROM t1; INSERT INTO t3 SELECT b FROM t1; SELECT * FROM t3 ORDER BY x; } diff --git a/third_party/sqlite/src/test/substr.test b/third_party/sqlite/src/test/substr.test index bcd0588d2d3be..d47fbba863537 100644 --- a/third_party/sqlite/src/test/substr.test +++ b/third_party/sqlite/src/test/substr.test @@ -23,7 +23,7 @@ ifcapable !tclvar { # Create a table to work with. # -execsql { +execsql { CREATE TABLE t1(t text, b blob) } proc substr-test {id string i1 i2 result} { @@ -132,7 +132,7 @@ subblob-test 4.2 61E188B462E28D8563E3919663 2 1 E1 subblob-test 4.3 61E188B462E28D8563E3919663 1 2 61E1 subblob-test 4.4 61E188B462E28D8563E3919663 -2 1 96 subblob-test 4.5 61E188B462E28D8563E3919663 -5 4 63E39196 -subblob-test 4.6 61E188B462E28D8563E3919663 -100 98 61E188B462E28D8563E391 +subblob-test 4.6 61E188B462E28D8563E3919663 -100 98 61E188B462E28D8563E391 # Two-argument SUBSTR # diff --git a/third_party/sqlite/src/test/superlock.test b/third_party/sqlite/src/test/superlock.test index 704b0677a144b..f001ab9f76c0f 100644 --- a/third_party/sqlite/src/test/superlock.test +++ b/third_party/sqlite/src/test/superlock.test @@ -29,7 +29,7 @@ do_not_use_codec # # 3.*: As 2.*, for WAL databases with one or more frames in the WAL. # -# 4.*: As 2.*, for WAL databases with one or more checkpointed frames +# 4.*: As 2.*, for WAL databases with one or more checkpointed frames # in the WAL. # # 5.*: Test that a call to sqlite3demo_superlock() uses the busy handler @@ -38,9 +38,9 @@ do_not_use_codec # handler returns 0 before said clients relinquish their locks. # # 6.*: Test that if a superlocked WAL database is overwritten, existing -# clients run the recovery to build the new wal-index after the +# clients run the recovery to build the new wal-index after the # superlock is released. -# +# # do_execsql_test 1.1 { @@ -58,7 +58,7 @@ do_test 1.2 { sqlite3demo_superlock unlock test.db } {unlock} do_catchsql_test 1.3 { SELECT * FROM t1 } {1 {database is locked}} do_test 1.4 { unlock } {} -do_execsql_test 2.1 { +do_execsql_test 2.1 { INSERT INTO t1 VALUES(3, 4); PRAGMA journal_mode = WAL; } {wal} @@ -69,7 +69,7 @@ do_catchsql_test 2.4 { INSERT INTO t1 VALUES(5, 6)} {1 {database is locked}} do_catchsql_test 2.5 { PRAGMA wal_checkpoint } {0 {1 -1 -1}} do_test 2.6 { unlock } {} -do_execsql_test 3.1 { INSERT INTO t1 VALUES(3, 4) } +do_execsql_test 3.1 { INSERT INTO t1 VALUES(3, 4) } do_test 3.2 { sqlite3demo_superlock unlock test.db } {unlock} do_catchsql_test 3.3 { SELECT * FROM t1 } {1 {database is locked}} @@ -122,32 +122,32 @@ do_multiclient_test tn { } {0 1 2 3} do_test 5.$tn.4 { csql2 { SELECT * FROM t1 } } {1 {database is locked}} - do_test 5.$tn.5 { - csql3 { INSERT INTO t1 VALUES(5, 6) } + do_test 5.$tn.5 { + csql3 { INSERT INTO t1 VALUES(5, 6) } } {1 {database is locked}} do_test 5.$tn.6 { csql1 "PRAGMA wal_checkpoint" } {0 {1 -1 -1}} do_test 5.$tn.7 { unlock } {} - + do_test 5.$tn.8 { sql1 { BEGIN ; SELECT * FROM t1 } sql2 { BEGIN ; INSERT INTO t1 VALUES(5, 6) } sql3 { BEGIN ; SELECT * FROM t1 } } {1 2 3 4} - do_test 5.$tn.9 { + do_test 5.$tn.9 { list [catch {sqlite3demo_superlock unlock test.db} msg] $msg } {1 {database is locked}} - do_test 5.$tn.10 { + do_test 5.$tn.10 { sql1 COMMIT list [catch {sqlite3demo_superlock unlock test.db} msg] $msg } {1 {database is locked}} - do_test 5.$tn.11 { + do_test 5.$tn.11 { sql2 COMMIT list [catch {sqlite3demo_superlock unlock test.db} msg] $msg } {1 {database is locked}} - do_test 5.$tn.12 { + do_test 5.$tn.12 { sql3 COMMIT list [catch {sqlite3demo_superlock unlock test.db} msg] $msg } {0 unlock} @@ -179,10 +179,10 @@ proc write_content {file content} { close $fd } -# Both $file1 and $file2 are database files. This function takes a +# Both $file1 and $file2 are database files. This function takes a # superlock on each, then exchanges the content of the two files (i.e. # overwrites $file1 with the initial contents of $file2, and overwrites -# $file2 with the initial contents of $file1). The contents of any WAL +# $file2 with the initial contents of $file1). The contents of any WAL # file is also exchanged. # proc db_swap {file1 file2} { @@ -241,14 +241,14 @@ do_catchsql_test 6.10 { SELECT * FROM t2 } {1 {no such table: t2}} if {[nonzero_reserved_bytes]} { # Vacuum with a size change is not allowed with the codec - do_execsql_test 6.11codec { + do_execsql_test 6.11codec { PRAGMA journal_mode = delete; VACUUM; PRAGMA journal_mode = wal; INSERT INTO t1 VALUES(5, 6); } {delete wal} } else { - do_execsql_test 6.11 { + do_execsql_test 6.11 { PRAGMA journal_mode = delete; PRAGMA page_size = 512; VACUUM; diff --git a/third_party/sqlite/src/test/symlink.test b/third_party/sqlite/src/test/symlink.test index 949102cf8ad24..76ca923d1e137 100644 --- a/third_party/sqlite/src/test/symlink.test +++ b/third_party/sqlite/src/test/symlink.test @@ -176,7 +176,7 @@ do_test 4.3.2 { do_test 4.4.0 { forcedelete w file mkdir w - file link w/test.db [file join [pwd] x/test.db] + file link w/test.db [file join [pwd] x/test.db] set {} {} } {} do_test 4.4.1 { diff --git a/third_party/sqlite/src/test/syscall.test b/third_party/sqlite/src/test/syscall.test index 5716b35a6e890..e17dff43e8e5b 100644 --- a/third_party/sqlite/src/test/syscall.test +++ b/third_party/sqlite/src/test/syscall.test @@ -18,7 +18,7 @@ source $testdir/malloc_common.tcl if {[llength [info commands test_syscall]]==0} { finish_test return -} +} if {[test_syscall defaultvfs] != "unix"} { finish_test @@ -59,7 +59,7 @@ do_test 2.1.2 { test_syscall exists nosuchcall } 0 foreach s { open close access getcwd stat fstat ftruncate fcntl read pread write pwrite fchmod fallocate - pread64 pwrite64 unlink openDirectory mkdir rmdir + pread64 pwrite64 unlink openDirectory mkdir rmdir statvfs fchown geteuid umask mmap munmap mremap getpagesize readlink lstat } { @@ -70,7 +70,7 @@ do_test 3.1 { lsort [test_syscall list] } [lsort $syscall_list] #------------------------------------------------------------------------- # This test verifies that if a call to open() fails and errno is set to # EINTR, the call is retried. If it succeeds, execution continues as if -# nothing happened. +# nothing happened. # test_syscall reset forcedelete test.db2 @@ -89,7 +89,7 @@ foreach jrnl [list wal delete] { db_restore_and_reopen test_syscall fault $i 0 test_syscall errno open EINTR - + do_test 4.2.$jrnl.$i { sqlite3 db test.db execsql { ATTACH 'test.db2' AS aux } @@ -122,8 +122,8 @@ foreach jrnl [list wal delete] { # same file. From the Linux man page: # # close() closes a file descriptor, so that it no longer refers to any file -# and may be reused. Any record locks (see fcntl(2)) held on the file it -# was associated with, and owned by the process, are removed (regardless +# and may be reused. Any record locks (see fcntl(2)) held on the file it +# was associated with, and owned by the process, are removed (regardless # of the file descriptor that was used to obtain the lock). # catch { db close } @@ -145,24 +145,24 @@ do_multiclient_test tn { } {} do_test syscall-5.$tn.2 { sql2 { SELECT * FROM t1 } } {1 2} - do_test syscall-5.$tn.3 { + do_test syscall-5.$tn.3 { csql2 { INSERT INTO t1 VALUES(5, 6) } } {1 {database is locked}} - do_test syscall-5.$tn.4 { + do_test syscall-5.$tn.4 { code1 { dbX1 close dbX2 close } } {} - do_test syscall-5.$tn.5 { + do_test syscall-5.$tn.5 { csql2 { INSERT INTO t1 VALUES(5, 6) } } {1 {database is locked}} do_test syscall-5.$tn.6 { sql1 { COMMIT } } {} - do_test syscall-5.$tn.7 { + do_test syscall-5.$tn.7 { csql2 { INSERT INTO t1 VALUES(5, 6) } } {0 {}} } @@ -232,7 +232,7 @@ foreach {nByte res} { } #------------------------------------------------------------------------- -# +# catch { db close } forcedelete test.db test.db2 @@ -242,11 +242,11 @@ do_test 8.1 { file size test.db } {0} foreach {tn hint size} { - 1 1000 4096 - 2 1000 4096 - 3 3000 4096 - 4 4096 4096 - 5 4197 8192 + 1 1000 4096 + 2 1000 4096 + 3 3000 4096 + 4 4096 4096 + 5 4197 8192 } { do_test 8.2.$tn { file_control_sizehint_test db main $hint @@ -262,11 +262,11 @@ do_test 8.3 { file size test.db } {0} foreach {tn hint size} { - 1 5 16 - 2 13 16 - 3 45 48 - 4 48 48 - 5 49 64 + 1 5 16 + 2 13 16 + 3 45 48 + 4 48 48 + 5 49 64 } { do_test 8.4.$tn { file_control_sizehint_test db main $hint diff --git a/third_party/sqlite/src/test/sysfault.test b/third_party/sqlite/src/test/sysfault.test index 4c3d34dbb95d7..65ef25fa5a2fa 100644 --- a/third_party/sqlite/src/test/sysfault.test +++ b/third_party/sqlite/src/test/sysfault.test @@ -18,7 +18,7 @@ source $testdir/malloc_common.tcl if {[llength [info commands test_syscall]]==0} { finish_test return -} +} set testprefix sysfault @@ -83,14 +83,14 @@ foreach {tn errno errlist} { faultsim_restore } -body " test_syscall errno fstat $errno - $open_and_write_body + $open_and_write_body " -test " faultsim_test_result {0 {wal 1 2 3 4}} $errs " } #------------------------------------------------------------------------- -# Various errors in locking functions. +# Various errors in locking functions. # foreach vfs {unix unix-excl} { foreach {tn errno errlist} { @@ -107,7 +107,7 @@ foreach vfs {unix unix-excl} { proc vfsfault_install {} { test_syscall install fcntl } set errs [list] foreach e $errlist { lappend errs [list 1 $e] } - + set body [string map [list %VFS% $vfs] { sqlite3 db test.db db eval { @@ -122,7 +122,7 @@ foreach vfs {unix unix-excl} { SELECT * FROM t1; } }] - + do_faultsim_test 1.3.$vfs.$tn -faults vfsfault-* -prep { faultsim_restore } -body " @@ -137,7 +137,7 @@ foreach vfs {unix unix-excl} { #------------------------------------------------------------------------- # Check that a single EINTR error does not affect processing. # -proc vfsfault_install {} { +proc vfsfault_install {} { test_syscall reset test_syscall install {open ftruncate close read pread pread64 write fallocate} } @@ -213,12 +213,12 @@ do_faultsim_test 2.2 -faults vfsfault-* -prep { {1 {unable to open database file}} \ {1 {unable to open database: test.db2}} \ {1 {attempt to write a readonly database}} \ - {1 {disk I/O error}} + {1 {disk I/O error}} } #------------------------------------------------------------------------- -proc vfsfault_install {} { +proc vfsfault_install {} { test_syscall reset test_syscall install {fstat fallocate} } @@ -247,7 +247,7 @@ do_faultsim_test 3 -faults vfsfault-* -prep { #------------------------------------------------------------------------- # Test errors in mmap(). # -proc vfsfault_install {} { +proc vfsfault_install {} { test_syscall reset test_syscall install {mmap} } @@ -262,7 +262,7 @@ faultsim_save_and_close do_faultsim_test 4 -faults vfsfault-* -prep { faultsim_restore_and_reopen file_control_chunksize_test db main 8192 - execsql { + execsql { PRAGMA mmap_size = 1000000; } } -body { diff --git a/third_party/sqlite/src/test/tabfunc01.test b/third_party/sqlite/src/test/tabfunc01.test index bb89aec1e7066..e9a928df10a7d 100644 --- a/third_party/sqlite/src/test/tabfunc01.test +++ b/third_party/sqlite/src/test/tabfunc01.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This file implements tests for table-valued-functions implemented using # eponymous virtual tables. # diff --git a/third_party/sqlite/src/test/table.test b/third_party/sqlite/src/test/table.test index e24e3b9ed4045..ed4bbb2c2baae 100644 --- a/third_party/sqlite/src/test/table.test +++ b/third_party/sqlite/src/test/table.test @@ -319,7 +319,7 @@ do_test table-5.4 { #} {testdb/spaces+in+this+name+.tbl} # Try using keywords as table names or column names. -# +# do_test table-7.1 { set v [catch {execsql { CREATE TABLE weird( @@ -590,7 +590,7 @@ do_test table-11.1 { typeof(e), typeof(f), typeof(g), typeof(h) FROM t7 LIMIT 1; } -} {integer null null null null null null null} +} {integer null null null null null null null} do_test table-11.2 { execsql { SELECT typeof(a+b), typeof(a||b), typeof(c+d), typeof(c||d) @@ -657,8 +657,8 @@ set sqlite_current_time 0 # Test cases table-14.* # # Test that a table cannot be created or dropped while other virtual -# machines are active. This is required because otherwise when in -# auto-vacuum mode the btree-layer may need to move the root-pages of +# machines are active. This is required because otherwise when in +# auto-vacuum mode the btree-layer may need to move the root-pages of # a table for which there is an open cursor. # # 2007-05-02: A open btree cursor no longer blocks CREATE TABLE. @@ -690,12 +690,12 @@ do_test table-14.2 { db eval {DROP TABLE t9;} } } msg - ] + ] set result [list $rc $msg] } {1 {database table is locked}} ifcapable attach { - # Now attach a database and ensure that a table can be created in the + # Now attach a database and ensure that a table can be created in the # attached database whilst in a callback from a query on the main database. do_test table-14.3 { forcedelete test2.db @@ -707,8 +707,8 @@ ifcapable attach { db eval {CREATE TABLE aux.t1(a, b, c)} } } {} - - # On the other hand, it should be impossible to drop a table when any VMs + + # On the other hand, it should be impossible to drop a table when any VMs # are active. This is because VerifyCookie instructions may have already # been executed, and btree root-pages may not move after this (which a # delete table might do). @@ -719,7 +719,7 @@ ifcapable attach { db eval {DROP TABLE aux.t1;} } } msg - ] + ] set result [list $rc $msg] } {1 {database table is locked}} } @@ -753,7 +753,7 @@ do_test table-15.2 { # The problem appears to be the use of an aggregate function as part of # the default value for a column. This problem has been in the code since # at least 2006-01-01 and probably before that. This problem was detected -# and reported on the sqlite-users@sqlite.org mailing list by Zsbán Ambrus. +# and reported on the sqlite-users@sqlite.org mailing list by Zsbán Ambrus. # do_execsql_test table-16.1 { CREATE TABLE t16(x DEFAULT(max(1))); diff --git a/third_party/sqlite/src/test/tableopts.test b/third_party/sqlite/src/test/tableopts.test index 0b2457ec4cfc9..f95b66dbe7de7 100644 --- a/third_party/sqlite/src/test/tableopts.test +++ b/third_party/sqlite/src/test/tableopts.test @@ -72,5 +72,5 @@ do_execsql_test tableopt-3.1 { SELECT * FROM without WHERE without='xyzzy'; } {1 xyzzy} - + finish_test diff --git a/third_party/sqlite/src/test/tclsqlite.test b/third_party/sqlite/src/test/tclsqlite.test index bdb0fc56d118b..2eae524a6f3aa 100644 --- a/third_party/sqlite/src/test/tclsqlite.test +++ b/third_party/sqlite/src/test/tclsqlite.test @@ -9,7 +9,7 @@ # #*********************************************************************** # This file implements regression tests for TCL interface to the -# SQLite library. +# SQLite library. # # Actually, all tests are based on the TCL interface, so the main # interface is pretty well tested. This file contains some addition @@ -456,7 +456,7 @@ do_test tcl-10.13 { db eval {SELECT * FROM t4} } {1 2 5 6 7} -# Now test that [db transaction] commands may be nested with +# Now test that [db transaction] commands may be nested with # the expected results. # do_test tcl-10.14 { @@ -466,7 +466,7 @@ do_test tcl-10.14 { INSERT INTO t4 VALUES('one'); } - catch { + catch { db transaction { db eval { INSERT INTO t4 VALUES('two') } db transaction { @@ -538,7 +538,7 @@ do_test tcl-10.19 { } {} # Thwart a [db transaction] command by locking the database using a -# second connection with "BEGIN EXCLUSIVE". Make sure no transaction is +# second connection with "BEGIN EXCLUSIVE". Make sure no transaction is # open after the "database is locked" exception is thrown. # do_test tcl-10.20 { diff --git a/third_party/sqlite/src/test/tempdb2.test b/third_party/sqlite/src/test/tempdb2.test index 5f019bd11722a..6cc169feab92d 100644 --- a/third_party/sqlite/src/test/tempdb2.test +++ b/third_party/sqlite/src/test/tempdb2.test @@ -50,7 +50,7 @@ do_execsql_test 1.1 { INSERT INTO t1 VALUES(3, int2str(1)); CREATE TABLE t2(a INTEGER PRIMARY KEY, b); - WITH c(x) AS ( VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100 ) + WITH c(x) AS ( VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100 ) INSERT INTO t2 SELECT x, int2str(x) FROM c; COMMIT; diff --git a/third_party/sqlite/src/test/tempfault.test b/third_party/sqlite/src/test/tempfault.test index 4eae116a72e12..71d3a919b7a56 100644 --- a/third_party/sqlite/src/test/tempfault.test +++ b/third_party/sqlite/src/test/tempfault.test @@ -71,7 +71,7 @@ do_faultsim_test 2.1 -faults * -prep { WITH x(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM x WHERE i<100) INSERT INTO t1 SELECT randomblob(100), randomblob(100) FROM x; } - } + } } -body { execsql { UPDATE t1 SET a = randomblob(99) } } -test { @@ -90,7 +90,7 @@ do_faultsim_test 3 -faults * -prep { INSERT INTO t1 SELECT randomblob(100), randomblob(100) FROM x; } } -body { - execsql { + execsql { BEGIN; UPDATE t1 SET a = randomblob(99); SAVEPOINT abc; @@ -116,7 +116,7 @@ do_faultsim_test 4 -faults * -prep { INSERT INTO t1 SELECT randomblob(100), randomblob(100) FROM x; } } -body { - execsql { + execsql { BEGIN; UPDATE t1 SET a = randomblob(99); SAVEPOINT abc; diff --git a/third_party/sqlite/src/test/temptable2.test b/third_party/sqlite/src/test/temptable2.test index ffa69b6150037..397f783767281 100644 --- a/third_party/sqlite/src/test/temptable2.test +++ b/third_party/sqlite/src/test/temptable2.test @@ -117,7 +117,7 @@ do_execsql_test 4.1.3 { do_test 4.1.4 { set n [db one { PRAGMA temp.page_count }] - expr ($n >280 && $n < 300) + expr ($n >280 && $n < 300) } 1 do_execsql_test 4.1.4 { PRAGMA temp.integrity_check } {ok} @@ -171,7 +171,7 @@ do_execsql_test 5.1.5 { PRAGMA temp.integrity_check } {ok} # 4. Transaction is rolled back. Is the page now clean or dirty? # # This actually does work. Step 4 marks the page as clean. But it also -# writes to the database file itself. So marking it clean is correct - +# writes to the database file itself. So marking it clean is correct - # the page does match the contents of the db file. # reset_db @@ -261,7 +261,7 @@ do_test 8.4 { } tmp } {100 ok 8192} -do_test 8.5 { +do_test 8.5 { tmp eval { UPDATE t1 SET a=randomblob(100) } } {} @@ -301,14 +301,14 @@ foreach {tn mode} { do_execsql_test 9.$tn.$i.2 { PRAGMA integrity_check } ok - do_execsql_test 9.$tn.$i.3 { + do_execsql_test 9.$tn.$i.3 { WITH x(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM x WHERE i<400 ) INSERT INTO tx SELECT randomblob(100), randomblob(100) FROM x; } do_execsql_test 9.$tn.$i.4 { PRAGMA integrity_check } ok - do_execsql_test 9.$tn.$i.5 { + do_execsql_test 9.$tn.$i.5 { BEGIN; DELETE FROM tx WHERE (random()%3)==0; WITH x(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM x WHERE i<500 ) @@ -321,7 +321,7 @@ foreach {tn mode} { } #------------------------------------------------------------------------- -# When using mmap mode with a temp file, SQLite must search the cache +# When using mmap mode with a temp file, SQLite must search the cache # before using a mapped page even when there is no write transaction # open. For a temp file, the on-disk version may not be up to date. # diff --git a/third_party/sqlite/src/test/temptrigger.test b/third_party/sqlite/src/test/temptrigger.test index e4277adf653b7..1a6d6b3d4d20b 100644 --- a/third_party/sqlite/src/test/temptrigger.test +++ b/third_party/sqlite/src/test/temptrigger.test @@ -31,13 +31,13 @@ ifcapable {!trigger || !shared_cache} { finish_test ; return } # schema. If process 2 reloads the shared-cache schema from disk, then # it does not recreate the temp trigger belonging to process 1. From the # point of view of process 1, the temp trigger just disappeared. -# -# temptrigger-1.1: In shared cache mode, create a table in the main +# +# temptrigger-1.1: In shared cache mode, create a table in the main # database and add a temp trigger to it. # # temptrigger-1.2: Check that the temp trigger is correctly fired. Check # that the temp trigger is not fired by statements -# executed by a second connection connected to the +# executed by a second connection connected to the # same shared cache. # # temptrigger-1.3: Using the second connection to the shared-cache, cause @@ -91,7 +91,7 @@ do_test temptrigger-1.4 { } {1 2 5 6} do_test temptrigger-1.5 { - # Before the bug was fixed, the following 'DROP TRIGGER' hit an + # Before the bug was fixed, the following 'DROP TRIGGER' hit an # assert if executed. #execsql { DROP TRIGGER tr1 } } {} @@ -103,7 +103,7 @@ catch {db2 close} # Tests temptrigger-2.* are similar to temptrigger-1.*, except that # temptrigger-2.3 simply opens and closes a connection to the shared-cache. # It does not do anything special to cause the schema to be reloaded. -# +# do_test temptrigger-2.1 { sqlite3 db test.db execsql { @@ -140,11 +140,11 @@ sqlite3_enable_shared_cache $::enable_shared_cache #------------------------------------------------------------------------- # Test case temptrigger-3.* demonstrates a problem with temp triggers -# on tables located in attached databases. At one point when SQLite reloaded -# the schema of an attached database (because some other connection had -# changed the schema cookie) it was not re-creating temp triggers attached +# on tables located in attached databases. At one point when SQLite reloaded +# the schema of an attached database (because some other connection had +# changed the schema cookie) it was not re-creating temp triggers attached # to tables located within the attached database. -# +# # temptrigger-3.1: Attach database 'test2.db' to connection [db]. Add a # temp trigger to a table in 'test2.db'. # @@ -156,12 +156,12 @@ sqlite3_enable_shared_cache $::enable_shared_cache # correctly. # # temptrigger-3.4: Check that the temp trigger can be dropped without error. -# +# do_test temptrigger-3.1 { catch { forcedelete test2.db test2.db-journal } catch { forcedelete test.db test.db-journal } - sqlite3 db test.db - sqlite3 db2 test2.db + sqlite3 db test.db + sqlite3 db2 test2.db execsql { CREATE TABLE t2(a, b) } db2 execsql { ATTACH 'test2.db' AS aux; @@ -173,7 +173,7 @@ do_test temptrigger-3.1 { } {} do_test temptrigger-3.2.1 { - execsql { + execsql { INSERT INTO aux.t2 VALUES(1, 2); SELECT * FROM aux.t2; } @@ -184,7 +184,7 @@ do_test temptrigger-3.2.2 { do_test temptrigger-3.3.1 { execsql { CREATE TABLE t3(a, b) } db2 - execsql { + execsql { INSERT INTO aux.t2 VALUES(3, 4); SELECT * FROM aux.t2; } @@ -194,7 +194,7 @@ do_test temptrigger-3.3.2 { } {1 2 3 4} do_test temptrigger-3.4 { - # Before the bug was fixed, the following 'DROP TRIGGER' hit an + # Before the bug was fixed, the following 'DROP TRIGGER' hit an # assert if executed. #execsql { DROP TRIGGER tr2 } } {} @@ -238,7 +238,7 @@ do_execsql_test 5.2 { SELECT * FROM sqlite_master; SELECT * FROM temp.sqlite_master; } { - trigger tr1 t1 0 + trigger tr1 t1 0 {CREATE TRIGGER tr1 BEFORE INSERT ON t1 BEGIN SELECT 1,2,3; END} } db2 close @@ -253,8 +253,8 @@ forcedelete test.db2 do_execsql_test 6.0 { CREATE TABLE t1(x); - CREATE TEMP TRIGGER tr1 BEFORE INSERT ON t1 BEGIN - SELECT raise(ABORT, 'error'); + CREATE TEMP TRIGGER tr1 BEFORE INSERT ON t1 BEGIN + SELECT raise(ABORT, 'error'); END; ATTACH 'test.db2' AS aux; } diff --git a/third_party/sqlite/src/test/tester.tcl b/third_party/sqlite/src/test/tester.tcl index 1da89fec26924..2d9b350d28716 100644 --- a/third_party/sqlite/src/test/tester.tcl +++ b/third_party/sqlite/src/test/tester.tcl @@ -700,8 +700,8 @@ proc output2_if_no_verbose {args} { } } -# Override the [puts] command so that if no channel is explicitly -# specified the string is written to both stdout and to the file +# Override the [puts] command so that if no channel is explicitly +# specified the string is written to both stdout and to the file # specified by "--output=", if any. # proc puts_override {args} { @@ -1302,7 +1302,7 @@ proc explain_i {sql {db db}} { # Set up colors for the different opcodes. Scheme is as follows: # # Red: Opcodes that write to a b-tree. - # Blue: Opcodes that reposition or seek a cursor. + # Blue: Opcodes that reposition or seek a cursor. # Green: The ResultRow opcode. # if { [catch {fconfigure stdout -mode}]==0 } { @@ -1346,7 +1346,7 @@ proc explain_i {sql {db db}} { } } - if {$opcode=="Next" || $opcode=="Prev" + if {$opcode=="Next" || $opcode=="Prev" || $opcode=="VNext" || $opcode=="VPrev" || $opcode=="SorterNext" || $opcode=="NextIfOpen" } { @@ -1568,7 +1568,7 @@ proc crashsql {args} { # pages. This is done in case the build is configured to omit # "PRAGMA cache_size". if {$opendb!=""} { - puts $f $opendb + puts $f $opendb puts $f {db eval {SELECT * FROM sqlite_master;}} puts $f {set bt [btree_from_db db]} puts $f {btree_set_cache_size $bt 10} @@ -2192,7 +2192,7 @@ proc db_delete_and_reopen {{file test.db}} { # Close any connections named [db], [db2] or [db3]. Then use sqlite3_config # to configure the size of the PAGECACHE allocation using the parameters -# provided to this command. Save the old PAGECACHE parameters in a global +# provided to this command. Save the old PAGECACHE parameters in a global # variable so that [test_restore_config_pagecache] can restore the previous # configuration. # @@ -2223,7 +2223,7 @@ proc test_restore_config_pagecache {} { sqlite3_shutdown eval sqlite3_config_pagecache $::old_pagecache_config - unset ::old_pagecache_config + unset ::old_pagecache_config sqlite3_initialize autoinstall_test_functions sqlite3 db test.db @@ -2272,7 +2272,7 @@ set AUTOVACUUM $sqlite_options(default_autovacuum) set sqlite_fts3_enable_parentheses 0 # During testing, assume that all database files are well-formed. The -# few test cases that deliberately corrupt database files should rescind +# few test cases that deliberately corrupt database files should rescind # this setting by invoking "database_can_be_corrupt" # database_never_corrupt diff --git a/third_party/sqlite/src/test/thread001.test b/third_party/sqlite/src/test/thread001.test index a796c57b4a13a..038420d731453 100644 --- a/third_party/sqlite/src/test/thread001.test +++ b/third_party/sqlite/src/test/thread001.test @@ -20,8 +20,8 @@ set ::enable_shared_cache [sqlite3_enable_shared_cache] set ::NTHREAD 10 -# Run this test three times: -# +# Run this test three times: +# # 1) All threads use the same database handle. # 2) All threads use their own database handles. # 3) All threads use their own database handles, shared-cache is enabled. @@ -50,7 +50,7 @@ foreach {tn same_db shared_cache} [list \ } # Set up a database and a schema. The database contains a single - # table with two columns. The first column ("a") is an INTEGER PRIMARY + # table with two columns. The first column ("a") is an INTEGER PRIMARY # KEY. The second contains the md5sum of all rows in the table with # a smaller value stored in column "a". # @@ -64,7 +64,7 @@ foreach {tn same_db shared_cache} [list \ } {1} do_test thread001.$tn.2 { execsql { - SELECT + SELECT (SELECT md5sum(a, b) FROM ab WHERE a < (SELECT max(a) FROM ab)) == (SELECT b FROM ab WHERE a = (SELECT max(a) FROM ab)) } @@ -81,37 +81,37 @@ foreach {tn same_db shared_cache} [list \ #sqlthread parent "puts \"OPEN $::DB\"" set needToClose 1 } - + for {set i 0} {$i < 100} {incr i} { # Test that the invariant is true. do_test t1 { execsql { - SELECT + SELECT (SELECT md5sum(a, b) FROM ab WHERE +a < (SELECT max(a) FROM ab)) == (SELECT b FROM ab WHERE a = (SELECT max(a) FROM ab)) } } {1} - + # Add another row to the database. execsql { INSERT INTO ab SELECT NULL, md5sum(a, b) FROM ab } } - + if {$needToClose} { #sqlthread parent "puts \"CLOSE $::DB\"" sqlite3_close $::DB } #sqlthread parent "puts \"DONE\"" - + list OK } - + # Kick off $::NTHREAD threads: # array unset finished for {set i 0} {$i < $::NTHREAD} {incr i} { thread_spawn finished($i) $dbconfig $thread_procs $thread_program } - + # Wait for all threads to finish, then check they all returned "OK". # for {set i 0} {$i < $::NTHREAD} {incr i} { @@ -122,7 +122,7 @@ foreach {tn same_db shared_cache} [list \ set ::finished($i) } OK } - + # Check the database still looks Ok. # do_test thread001.$tn.5 { @@ -130,7 +130,7 @@ foreach {tn same_db shared_cache} [list \ } [expr {1 + $::NTHREAD*100}] do_test thread001.$tn.6 { execsql { - SELECT + SELECT (SELECT md5sum(a, b) FROM ab WHERE +a < (SELECT max(a) FROM ab)) == (SELECT b FROM ab WHERE a = (SELECT max(a) FROM ab)) } diff --git a/third_party/sqlite/src/test/thread002.test b/third_party/sqlite/src/test/thread002.test index b39c9ae7cd261..4a84d5538f99e 100644 --- a/third_party/sqlite/src/test/thread002.test +++ b/third_party/sqlite/src/test/thread002.test @@ -10,7 +10,7 @@ #*********************************************************************** # # This test attempts to deadlock SQLite in shared-cache mode. -# +# # # $Id: thread002.test,v 1.9 2009/03/26 14:48:07 danielk1977 Exp $ @@ -50,10 +50,10 @@ set thread_program { for {set ii 0} {$ii < 100} {incr ii} { execsql { SELECT * FROM aux1.t1 } execsql { INSERT INTO aux1.t1(v) SELECT sum(v) FROM aux2.t1 } - + execsql { SELECT * FROM aux2.t1 } execsql { INSERT INTO aux2.t1(v) SELECT sum(v) FROM aux3.t1 } - + execsql { SELECT * FROM aux3.t1 } execsql { INSERT INTO aux3.t1(v) SELECT sum(v) FROM aux1.t1 } diff --git a/third_party/sqlite/src/test/thread003.test b/third_party/sqlite/src/test/thread003.test index 8c7440c82ee6f..be77bce71cfb0 100644 --- a/third_party/sqlite/src/test/thread003.test +++ b/third_party/sqlite/src/test/thread003.test @@ -11,7 +11,7 @@ # # This file contains tests that attempt to break the pcache module # by bombarding it with simultaneous requests from multiple threads. -# +# # $Id: thread003.test,v 1.8 2009/03/26 14:48:07 danielk1977 Exp $ set testdir [file dirname $argv0] @@ -19,7 +19,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl if {[run_thread_tests]==0} { finish_test ; return } -# Set up a couple of different databases full of pseudo-randomly +# Set up a couple of different databases full of pseudo-randomly # generated data. # do_test thread003.1.1 { @@ -30,8 +30,8 @@ do_test thread003.1.1 { for {set ii 0} {$ii < 5000} {incr ii} { execsql {INSERT INTO t1 VALUES($ii, randomblob(200), randomblob(200))} } - execsql { - CREATE INDEX i1 ON t1(a, b); + execsql { + CREATE INDEX i1 ON t1(a, b); COMMIT; } } {} @@ -51,8 +51,8 @@ do_test thread003.1.4 { for {set ii 0} {$ii < 5000} {incr ii} { execsql {INSERT INTO t1 VALUES($ii, randomblob(200), randomblob(200))} } - execsql { - CREATE INDEX i1 ON t1(a, b); + execsql { + CREATE INDEX i1 ON t1(a, b); COMMIT; } } {} @@ -81,19 +81,19 @@ do_test thread003.2 { set SCRIPT [format { set iEnd [expr {[clock_seconds] + %d}] set ::DB [sqlthread open %s xyzzy] - + # Set the cache size to 15 pages per cache. 30 available globally. execsql { PRAGMA cache_size = 15 } - + while {[clock_seconds] < $iEnd} { set iQuery [expr {int(rand()*5000)}] execsql " SELECT * FROM t1 WHERE a = $iQuery " } - + sqlite3_close $::DB expr 1 } $nSecond $zFile] - + unset -nocomplain finished($zFile) thread_spawn finished($zFile) $thread_procs $SCRIPT } @@ -106,7 +106,7 @@ do_test thread003.2 { } {0} # This test is the same as the test above, except that each thread also -# writes to the database. This causes pages to be moved back and forth +# writes to the database. This causes pages to be moved back and forth # between the caches internal dirty and clean lists, which is another # opportunity for a thread-related bug to present itself. # @@ -118,22 +118,22 @@ do_test thread003.3 { set iStart [clock_seconds] set iEnd [expr {[clock_seconds] + %d}] set ::DB [sqlthread open %s xyzzy] - + # Set the cache size to 15 pages per cache. 30 available globally. execsql { PRAGMA cache_size = 15 } - + while {[clock_seconds] < $iEnd} { set iQuery [expr {int(rand()*5000)}] execsql "SELECT * FROM t1 WHERE a = $iQuery" - execsql "UPDATE t1 SET b = randomblob(200) + execsql "UPDATE t1 SET b = randomblob(200) WHERE a < $iQuery AND a > $iQuery + 20 " } - + sqlite3_close $::DB expr 1 } $nSecond $zFile] - + unset -nocomplain finished($zFile) thread_spawn finished($zFile) $thread_procs $SCRIPT } @@ -168,7 +168,7 @@ do_test thread003.4 { sqlite3_close $::DB expr 1 - } $nSecond] + } $nSecond] thread_spawn finished(2) [format { set iEnd [expr {[clock_seconds] + %d}] @@ -176,7 +176,7 @@ do_test thread003.4 { sqlite3_release_memory 1000 } } $nSecond] - + foreach ii {1 2} { if {![info exists finished($ii)]} { vwait finished($ii) diff --git a/third_party/sqlite/src/test/thread004.test b/third_party/sqlite/src/test/thread004.test index b2adc460d008a..ba75a3a9dc0cb 100644 --- a/third_party/sqlite/src/test/thread004.test +++ b/third_party/sqlite/src/test/thread004.test @@ -25,7 +25,7 @@ if { [info commands sqlite3_table_column_metadata] eq "" } { } # Use shared-cache mode for this test. -# +# db close set ::enable_shared_cache [sqlite3_enable_shared_cache] sqlite3_enable_shared_cache 1 @@ -56,7 +56,7 @@ do_test thread004-1.2 { sqlite3_close $::DB set nErr } - + # Run two threads. The first thread opens and closes database test.db # repeatedly. Each time this happens, the in-memory schema used by # all connections to test.db is discarded. @@ -68,7 +68,7 @@ do_test thread004-1.2 { unset -nocomplain finished thread_spawn finished(1) $thread_procs $ThreadOne thread_spawn finished(2) $thread_procs $ThreadTwo - + foreach t {1 2} { if {![info exists finished($t)]} { vwait finished($t) } } diff --git a/third_party/sqlite/src/test/thread005.test b/third_party/sqlite/src/test/thread005.test index 89cbfe76da8f5..8911a010a030e 100644 --- a/third_party/sqlite/src/test/thread005.test +++ b/third_party/sqlite/src/test/thread005.test @@ -25,7 +25,7 @@ ifcapable !shared_cache { db close # Use shared-cache mode for these tests. -# +# set ::enable_shared_cache [sqlite3_enable_shared_cache] sqlite3_enable_shared_cache 1 @@ -60,7 +60,7 @@ for {set ii 2} {$ii < 500} {incr ii} { # If the race-condition was hit, then $finished(0 and $finished(1) # will not use the same pager cache. In this case the next statement # can be executed succesfully. However, if the race-condition is not - # hit, then $finished(1) will be blocked by the write-lock held by + # hit, then $finished(1) will be blocked by the write-lock held by # $finished(0) on the shared-cache table t1 and the statement will # return SQLITE_LOCKED. # @@ -79,9 +79,9 @@ for {set ii 2} {$ii < 500} {incr ii} { # # CREATE TABLE t1(a INTEGER PRIMARY KEY, b UNIQUE); # -# One thread is a reader and the other thread a reader and a writer. The +# One thread is a reader and the other thread a reader and a writer. The # writer thread repeats the following transaction as fast as possible: -# +# # BEGIN; # DELETE FROM t1 WHERE a = (SELECT max(a) FROM t1); # INSERT INTO t1 VALUES(NULL, NULL); @@ -95,13 +95,13 @@ for {set ii 2} {$ii < 500} {incr ii} { # SELECT count(*) FROM t1 WHERE b IS NULL; # COMMIT; # -# The test runs for 20 seconds or until one of the "SELECT count(*)" +# The test runs for 20 seconds or until one of the "SELECT count(*)" # statements returns a non-zero value. If an SQLITE_LOCKED error occurs, # the connection issues a ROLLBACK immediately to abandon the current # transaction. # -# If everything is working correctly, the "SELECT count(*)" statements -# should never return a value other than 0. The "INSERT" statement +# If everything is working correctly, the "SELECT count(*)" statements +# should never return a value other than 0. The "INSERT" statement # executed by the writer adds a row with "b IS NULL" to the table, but # the subsequent UPDATE statement sets its "b" value to an integer # immediately afterwards. @@ -112,7 +112,7 @@ for {set ii 2} {$ii < 500} {incr ii} { # rollback the statement-transaction belonging to the UPDATE statement. # The UPDATE statement would still be reported as successful to the user, # but it would have no effect on the database contents. -# +# # Note that it has so far only proved possible to hit this race-condition # when using an ATTACHed database. There doesn't seem to be any reason # for this, other than that operating on an ATTACHed database means there diff --git a/third_party/sqlite/src/test/thread1.test b/third_party/sqlite/src/test/thread1.test index 0618f2c66f81c..45a896d8b9415 100644 --- a/third_party/sqlite/src/test/thread1.test +++ b/third_party/sqlite/src/test/thread1.test @@ -47,7 +47,7 @@ do_test thread1-1.1 { # unlock B # write-lock C # -# At one point, the write-lock of C would fail on Linux. +# At one point, the write-lock of C would fail on Linux. # do_test thread1-1.2 { thread_create A test.db @@ -169,5 +169,5 @@ do_test thread1-2.11 { execsql {SELECT * FROM t2} } {98 99} -thread_halt * +thread_halt * finish_test diff --git a/third_party/sqlite/src/test/thread2.test b/third_party/sqlite/src/test/thread2.test index dad2bf2c5f4b1..3528f4af91bdb 100644 --- a/third_party/sqlite/src/test/thread2.test +++ b/third_party/sqlite/src/test/thread2.test @@ -116,5 +116,5 @@ thread_halt B # Also important to halt the worker threads, which are using spin # locks and eating away CPU cycles. # -thread_halt * +thread_halt * finish_test diff --git a/third_party/sqlite/src/test/thread_common.tcl b/third_party/sqlite/src/test/thread_common.tcl index 6b17082ad4508..83aff12db9be2 100644 --- a/third_party/sqlite/src/test/thread_common.tcl +++ b/third_party/sqlite/src/test/thread_common.tcl @@ -15,7 +15,7 @@ if {[info exists ::thread_procs]} { return 0 } -# The following script is sourced by every thread spawned using +# The following script is sourced by every thread spawned using # [sqlthread spawn]: set thread_procs { @@ -24,8 +24,8 @@ set thread_procs { proc execsql {sql} { set rc SQLITE_LOCKED - while {$rc eq "SQLITE_LOCKED" - || $rc eq "SQLITE_BUSY" + while {$rc eq "SQLITE_LOCKED" + || $rc eq "SQLITE_BUSY" || $rc eq "SQLITE_SCHEMA"} { set res [list] @@ -86,10 +86,10 @@ proc thread_spawn {varname args} { # Return true if this build can run the multi-threaded tests. # proc run_thread_tests {{print_warning 0}} { - ifcapable !mutex { + ifcapable !mutex { set zProblem "SQLite build is not threadsafe" } - ifcapable mutex_noop { + ifcapable mutex_noop { set zProblem "SQLite build uses SQLITE_MUTEX_NOOP" } if {[info commands sqlthread] eq ""} { diff --git a/third_party/sqlite/src/test/threadtest1.c b/third_party/sqlite/src/test/threadtest1.c index 56fcce33e8a1c..82117032243e4 100644 --- a/third_party/sqlite/src/test/threadtest1.c +++ b/third_party/sqlite/src/test/threadtest1.c @@ -16,7 +16,7 @@ ** few places in the code that are even potentially unsafe, and those ** places execute for very short periods of time. So even if the library ** is compiled with its mutexes disabled, it is likely to work correctly -** in a multi-threaded program most of the time. +** in a multi-threaded program most of the time. ** ** This file is NOT part of the standard SQLite library. It is used for ** testing only. @@ -90,7 +90,7 @@ static int db_query_callback( if( azArg==0 ) return 0; for(i=0; iazElem[pResult->nElem++] = - sqlite3_mprintf("%s",azArg[i] ? azArg[i] : ""); + sqlite3_mprintf("%s",azArg[i] ? azArg[i] : ""); } return 0; } @@ -217,9 +217,9 @@ static void *worker_bee(void *pArg){ t, i, i*2, i*i); } az = db_query(db, zFilename, "SELECT count(*) FROM t%d", t); - db_check(zFilename, "tX size", az, "100", 0); + db_check(zFilename, "tX size", az, "100", 0); az = db_query(db, zFilename, "SELECT avg(b) FROM t%d", t); - db_check(zFilename, "tX avg", az, "101", 0); + db_check(zFilename, "tX avg", az, "101", 0); db_execute(db, zFilename, "DELETE FROM t%d WHERE a>50", t); az = db_query(db, zFilename, "SELECT avg(b) FROM t%d", t); db_check(zFilename, "tX avg2", az, "51", 0); @@ -271,7 +271,7 @@ int main(int argc, char **argv){ unlink(zJournal); free(zJournal); } - + pthread_create(&id, 0, worker_bee, (void*)zFile); pthread_detach(id); } diff --git a/third_party/sqlite/src/test/threadtest2.c b/third_party/sqlite/src/test/threadtest2.c index b7a67c579b6ea..78a4c0cf3dd7e 100644 --- a/third_party/sqlite/src/test/threadtest2.c +++ b/third_party/sqlite/src/test/threadtest2.c @@ -27,13 +27,13 @@ */ #define DB_FILE "test.db" -/* +/* ** When this variable becomes non-zero, all threads stop ** what they are doing. */ volatile int all_stop = 0; -/* +/* ** Callback from the integrity check. If the result is anything other ** than "ok" it means the integrity check has failed. Set the "all_stop" ** global variable to stop all other activity. Print the error message @@ -105,7 +105,7 @@ int main(int argc, char **argv){ unlink(DB_FILE); unlink(zJournal); sqlite3_free(zJournal); - } + } sqlite3_open(DB_FILE, &db); if( db==0 ){ fprintf(stderr,"unable to initialize database\n"); diff --git a/third_party/sqlite/src/test/threadtest3.c b/third_party/sqlite/src/test/threadtest3.c index 6062b6428577d..28eee28be49c9 100644 --- a/third_party/sqlite/src/test/threadtest3.c +++ b/third_party/sqlite/src/test/threadtest3.c @@ -32,7 +32,7 @@ ** The exit status is non-zero if any test fails. */ -/* +/* ** The "Set Error Line" macro. */ #define SEL(e) ((e)->iLine = ((e)->rc ? (e)->iLine : __LINE__)) @@ -49,7 +49,7 @@ #define execsql(x,y,...) (SEL(x), (void)execsql_i64_x(x,y,__VA_ARGS__)) #define sql_script_printf(x,y,z,...) ( \ SEL(x), sql_script_printf_x(x,y,z,__VA_ARGS__) \ -) +) /* Thread functions */ #define launch_thread(w,x,y,z) (SEL(w), launch_thread_x(w,x,y,z)) @@ -82,8 +82,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -264,7 +264,7 @@ static void MD5Init(MD5Context *ctx){ * Update context to reflect the concatenation of another buffer full * of bytes. */ -static +static void MD5Update(MD5Context *ctx, const unsigned char *buf, unsigned int len){ uint32 t; @@ -310,7 +310,7 @@ void MD5Update(MD5Context *ctx, const unsigned char *buf, unsigned int len){ } /* - * Final wrapup - pad to 64-byte boundary with the bit pattern + * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ static void MD5Final(unsigned char digest[16], MD5Context *ctx){ @@ -477,8 +477,8 @@ static void system_error(Error *pErr, int iSys){ } static void sqlite_error( - Error *pErr, - Sqlite *pDb, + Error *pErr, + Sqlite *pDb, const char *zFunc ){ pErr->rc = sqlite3_errcode(pDb->db); @@ -871,7 +871,7 @@ static void filecopy_x( } } -/* +/* ** Used by setstoptime() and timetostop(). */ static double timelimit = 0.0; @@ -1027,7 +1027,7 @@ static char *walthread2_thread(int iTid, void *pArg){ journal_exists = (filesize(&err, "test.db-journal") >= 0); wal_exists = (filesize(&err, "test.db-wal") >= 0); if( (journal_exists+wal_exists)!=1 ){ - test_error(&err, "File system looks incorrect (%d, %d)", + test_error(&err, "File system looks incorrect (%d, %d)", journal_exists, wal_exists ); } @@ -1084,7 +1084,7 @@ static char *walthread3_thread(int iTid, void *pArg){ sum1 = execsql_i64(&err, &db, "SELECT sum(cnt) FROM t1"); sum2 = execsql_i64(&err, &db, "SELECT sum(sum1) FROM t1"); - execsql_i64(&err, &db, + execsql_i64(&err, &db, "INSERT INTO t1 VALUES(:iNextWrite, :iSum1, :iSum2)", &iNextWrite, &sum1, &sum2 ); @@ -1105,7 +1105,7 @@ static void walthread3(int nMs){ int i; opendb(&err, &db, "test.db", 1); - sql_script(&err, &db, + sql_script(&err, &db, "PRAGMA journal_mode = WAL;" "CREATE TABLE t1(cnt PRIMARY KEY, sum1, sum2);" "CREATE INDEX i1 ON t1(sum1);" @@ -1163,7 +1163,7 @@ static void walthread4(int nMs){ Threadset threads = {0}; opendb(&err, &db, "test.db", 1); - sql_script(&err, &db, + sql_script(&err, &db, "PRAGMA journal_mode = WAL;" "CREATE TABLE t1(a INTEGER PRIMARY KEY, b UNIQUE);" ); @@ -1196,7 +1196,7 @@ static void walthread5(int nMs){ Threadset threads = {0}; opendb(&err, &db, "test.db", 1); - sql_script(&err, &db, + sql_script(&err, &db, "PRAGMA wal_autocheckpoint = 0;" "PRAGMA page_size = 1024;" "PRAGMA journal_mode = WAL;" @@ -1394,7 +1394,7 @@ static void dynamic_triggers(int nMs){ Threadset threads = {0}; opendb(&err, &db, "test.db", 1); - sql_script(&err, &db, + sql_script(&err, &db, "PRAGMA page_size = 1024;" "PRAGMA journal_mode = WAL;" "CREATE TABLE t1(x, y);" @@ -1445,7 +1445,7 @@ int main(int argc, char **argv){ { walthread3, "walthread3", 20000 }, { walthread4, "walthread4", 20000 }, { walthread5, "walthread5", 1000 }, - + { cgt_pager_1, "cgt_pager_1", 0 }, { dynamic_triggers, "dynamic_triggers", 20000 }, @@ -1469,7 +1469,7 @@ int main(int argc, char **argv){ } /* Loop through the command-line arguments to ensure that each argument - ** selects at least one test. If not, assume there is a typo on the + ** selects at least one test. If not, assume there is a typo on the ** command-line and bail out with the usage message. */ for(iArg=1; iArg=sizeof(aTest)/sizeof(aTest[0]) ) goto usage; + if( i>=sizeof(aTest)/sizeof(aTest[0]) ) goto usage; } for(iArg=1; iArgpWrMutex); - run_sql(p, + run_sql(p, "WITH RECURSIVE\n" " c(i) AS (VALUES(%d) UNION ALL SELECT i+1 FROM c WHERE i<%d)\n" "INSERT INTO %s SELECT %d, zeroblob(3000), i, printf('%%d',i), i FROM c;", @@ -400,7 +400,7 @@ int main(int argc, char **argv){ exit(1); } } - if( nWorker==0 ){ + if( nWorker==0 ){ fprintf(stderr, "usage: %s ?OPTIONS? N\n" "N is the number of threads and must be at least 2.\n" diff --git a/third_party/sqlite/src/test/tkt-02a8e81d44.test b/third_party/sqlite/src/test/tkt-02a8e81d44.test index 7ca9866414f2b..0e504985722b1 100644 --- a/third_party/sqlite/src/test/tkt-02a8e81d44.test +++ b/third_party/sqlite/src/test/tkt-02a8e81d44.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket [02a8e81d44] has been -# fixed. +# fixed. # set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/tkt-2a5629202f.test b/third_party/sqlite/src/test/tkt-2a5629202f.test index 8f09c310a14ba..6dd2cca44dc57 100644 --- a/third_party/sqlite/src/test/tkt-2a5629202f.test +++ b/third_party/sqlite/src/test/tkt-2a5629202f.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# The tests in this file were used while developing the SQLite 4 code. +# The tests in this file were used while developing the SQLite 4 code. # set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/tkt-2d1a5c67d.test b/third_party/sqlite/src/test/tkt-2d1a5c67d.test index 0d12a6ec43e80..937b989eaa6a1 100644 --- a/third_party/sqlite/src/test/tkt-2d1a5c67d.test +++ b/third_party/sqlite/src/test/tkt-2d1a5c67d.test @@ -12,7 +12,7 @@ # it tests that ticket [2d1a5c67dfc2363e44f29d9bbd57f7331851390a] has # been resolved. # -# +# # set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/tkt-2ea2425d34.test b/third_party/sqlite/src/test/tkt-2ea2425d34.test index 9793d48bc178a..8485cdcef41d2 100644 --- a/third_party/sqlite/src/test/tkt-2ea2425d34.test +++ b/third_party/sqlite/src/test/tkt-2ea2425d34.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket [2ea2425d34be] has been -# fixed. +# fixed. # set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/tkt-31338dca7e.test b/third_party/sqlite/src/test/tkt-31338dca7e.test index 41dd9d3bf8e9f..7894917266f90 100644 --- a/third_party/sqlite/src/test/tkt-31338dca7e.test +++ b/third_party/sqlite/src/test/tkt-31338dca7e.test @@ -56,7 +56,7 @@ do_test tkt-31338-2.1 { INSERT INTO t4 VALUES(444,555); INSERT INTO t5 VALUES(888); INSERT INTO t5 VALUES(999); - + SELECT * FROM t3, t4, t5 WHERE (v=111 AND x=w AND z!=999) OR (v=333 AND x=444) ORDER BY v, w, x, y, z; @@ -98,37 +98,37 @@ do_test tkt-31338-3.1 { SELECT x FROM (SELECT e+f AS x, e FROM t2 ORDER BY 1 LIMIT 2) GROUP BY e )); - } + } } {4 1 2 3 4 {}} do_test tkt-31338-3.2 { - db eval { + db eval { SELECT * FROM t3 LEFT JOIN t1 ON d=g LEFT JOIN t4 ON c=h WHERE (a=1 AND h=4) OR (b=2 AND b NOT IN ( SELECT x+1 FROM (SELECT e+f AS x, e FROM t2 ORDER BY 1 LIMIT 2) GROUP BY e )); - } + } } {4 1 2 3 4 {}} do_test tkt-31338-3.3 { - db eval { + db eval { SELECT * FROM t3 LEFT JOIN t1 ON d=g LEFT JOIN t4 ON c=h WHERE (+a=1 AND h=4) OR (b IN ( SELECT x FROM (SELECT e+f AS x, e FROM t2 ORDER BY 1 LIMIT 2) GROUP BY e )); - } + } } {4 1 2 3 4 {}} do_test tkt-31338-3.4 { - db eval { + db eval { SELECT * FROM t3 LEFT JOIN t1 ON d=g LEFT JOIN t4 ON c=h WHERE (a=1 AND h=4) OR (+b IN ( SELECT x FROM (SELECT e+f AS x, e FROM t2 ORDER BY 1 LIMIT 2) GROUP BY e )); - } + } } {4 1 2 3 4 {}} do_test tkt-31338-3.5 { @@ -136,7 +136,7 @@ do_test tkt-31338-3.5 { CREATE TABLE t5(a,b,c,d,e,f); CREATE TABLE t6(g,h); CREATE TRIGGER t6r AFTER INSERT ON t6 BEGIN - INSERT INTO t5 + INSERT INTO t5 SELECT * FROM t3 LEFT JOIN t1 ON d=g LEFT JOIN t4 ON c=h WHERE (a=1 AND h=4) OR (b IN ( @@ -146,11 +146,11 @@ do_test tkt-31338-3.5 { END; INSERT INTO t6 VALUES(88,99); SELECT * FROM t5; - } + } } {4 1 2 3 4 {}} do_test tkt-31338-3.6 { - db eval { + db eval { INSERT INTO t1 VALUES(2,4,3,4); INSERT INTO t1 VALUES(99,101,3,4); INSERT INTO t1 VALUES(98,97,3,4); @@ -160,7 +160,7 @@ do_test tkt-31338-3.6 { SELECT x+a FROM (SELECT e+f AS x, e FROM t2 ORDER BY 1 LIMIT 2) GROUP BY e )); - } + } } {4 2 4 3 4 {} 4 99 101 3 4 {}} do_test tkt-31338-3.7 { @@ -171,7 +171,7 @@ do_test tkt-31338-3.7 { SELECT x FROM (SELECT e+f+a AS x, e FROM t2 ORDER BY 1 LIMIT 2) GROUP BY e )); - } + } } {4 2 4 3 4 {} 4 99 101 3 4 {}} diff --git a/third_party/sqlite/src/test/tkt-313723c356.test b/third_party/sqlite/src/test/tkt-313723c356.test index 5325fd229219b..3c6291c85bf65 100644 --- a/third_party/sqlite/src/test/tkt-313723c356.test +++ b/third_party/sqlite/src/test/tkt-313723c356.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket [313723c356] has been -# fixed. +# fixed. # set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/tkt-385a5b56b9.test b/third_party/sqlite/src/test/tkt-385a5b56b9.test index 1338435ed68d6..08bfc2ad9416d 100644 --- a/third_party/sqlite/src/test/tkt-385a5b56b9.test +++ b/third_party/sqlite/src/test/tkt-385a5b56b9.test @@ -8,13 +8,13 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# The tests in this file were used while developing the SQLite 4 code. +# The tests in this file were used while developing the SQLite 4 code. # set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix tkt-385a5b56b9 -do_execsql_test 1.0 { +do_execsql_test 1.0 { CREATE TABLE t1(x, y); INSERT INTO t1 VALUES(1, NULL); INSERT INTO t1 VALUES(2, NULL); diff --git a/third_party/sqlite/src/test/tkt-3a77c9714e.test b/third_party/sqlite/src/test/tkt-3a77c9714e.test index b7d366f36e8bc..bdcddf902fcd4 100644 --- a/third_party/sqlite/src/test/tkt-3a77c9714e.test +++ b/third_party/sqlite/src/test/tkt-3a77c9714e.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket [3a77c9714e] has been -# fixed. +# fixed. set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -55,9 +55,9 @@ do_execsql_test 2.1 { do_execsql_test 2.2 { SELECT SrcWord, Beginnings.Title - FROM + FROM (SELECT 'FACTORING' AS SrcWord UNION SELECT 'SWIMMING' AS SrcWord ) - LEFT JOIN + LEFT JOIN Beginnings WHERE Beginnings.Id= ( SELECT BeginningId FROM ( @@ -66,7 +66,7 @@ do_execsql_test 2.2 { WHERE Connected=SrcWord LIMIT 1 ) ) -} {FACTORING FACTOR SWIMMING SWIMM} +} {FACTORING FACTOR SWIMMING SWIMM} finish_test diff --git a/third_party/sqlite/src/test/tkt-3fe897352e.test b/third_party/sqlite/src/test/tkt-3fe897352e.test index bc2b2033e70c7..95ce66eb79bf6 100644 --- a/third_party/sqlite/src/test/tkt-3fe897352e.test +++ b/third_party/sqlite/src/test/tkt-3fe897352e.test @@ -11,13 +11,13 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket [3fe897352e8d8] has been -# fixed. +# fixed. # set testdir [file dirname $argv0] source $testdir/tester.tcl -# The following tests use hex_to_utf16be() and hex_to_utf16le() which +# The following tests use hex_to_utf16be() and hex_to_utf16le() which # which are only available if SQLite is built with UTF16 support. ifcapable {!utf16} { finish_test diff --git a/third_party/sqlite/src/test/tkt-4a03edc4c8.test b/third_party/sqlite/src/test/tkt-4a03edc4c8.test index 1908bcdf2cb81..45230eda8e213 100644 --- a/third_party/sqlite/src/test/tkt-4a03edc4c8.test +++ b/third_party/sqlite/src/test/tkt-4a03edc4c8.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that -# ticket [4a03edc4c8c028c93e9269f64fc5e97f632c1166] has been fixed. +# ticket [4a03edc4c8c028c93e9269f64fc5e97f632c1166] has been fixed. # set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/tkt-4dd95f6943.test b/third_party/sqlite/src/test/tkt-4dd95f6943.test index 353031e74e3dc..2d092c569c7ad 100644 --- a/third_party/sqlite/src/test/tkt-4dd95f6943.test +++ b/third_party/sqlite/src/test/tkt-4dd95f6943.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # set testdir [file dirname $argv0] @@ -86,40 +86,40 @@ foreach {tn1 idx} { do_execsql_test 2.$tn1.$tn2.4 " SELECT x, y FROM t2 WHERE x = 4 AND y IN $inexpr ORDER BY x DESC, y DESC; " {4 5 4 4 4 2} - + do_execsql_test 2.$tn1.$tn2.5 " - SELECT a, x, y FROM t2, t3 WHERE a = 4 AND x = 1 AND y IN $inexpr + SELECT a, x, y FROM t2, t3 WHERE a = 4 AND x = 1 AND y IN $inexpr ORDER BY a, x ASC, y ASC; " {4 1 2 4 1 4 4 1 5} do_execsql_test 2.$tn1.$tn2.6 " - SELECT a, x, y FROM t2, t3 WHERE a = 2 AND x = 1 AND y IN $inexpr + SELECT a, x, y FROM t2, t3 WHERE a = 2 AND x = 1 AND y IN $inexpr ORDER BY x ASC, y ASC; " {2 1 2 2 1 4 2 1 5} do_execsql_test 2.$tn1.$tn2.7 " - SELECT a, x, y FROM t2, t3 WHERE a = 4 AND x = 1 AND y IN $inexpr + SELECT a, x, y FROM t2, t3 WHERE a = 4 AND x = 1 AND y IN $inexpr ORDER BY a, x ASC, y DESC; " {4 1 5 4 1 4 4 1 2} do_execsql_test 2.$tn1.8 " - SELECT a, x, y FROM t2, t3 WHERE a = 2 AND x = 1 AND y IN $inexpr + SELECT a, x, y FROM t2, t3 WHERE a = 2 AND x = 1 AND y IN $inexpr ORDER BY x ASC, y DESC; " {2 1 5 2 1 4 2 1 2} do_execsql_test 2.$tn1.$tn2.9 " - SELECT a, x, y FROM t2, t3 WHERE a = 4 AND x = 1 AND y IN $inexpr + SELECT a, x, y FROM t2, t3 WHERE a = 4 AND x = 1 AND y IN $inexpr ORDER BY a, x DESC, y ASC; " {4 1 2 4 1 4 4 1 5} do_execsql_test 2.$tn1.10 " - SELECT a, x, y FROM t2, t3 WHERE a = 2 AND x = 1 AND y IN $inexpr + SELECT a, x, y FROM t2, t3 WHERE a = 2 AND x = 1 AND y IN $inexpr ORDER BY x DESC, y ASC; " {2 1 2 2 1 4 2 1 5} do_execsql_test 2.$tn1.$tn2.11 " - SELECT a, x, y FROM t2, t3 WHERE a = 4 AND x = 1 AND y IN $inexpr + SELECT a, x, y FROM t2, t3 WHERE a = 4 AND x = 1 AND y IN $inexpr ORDER BY a, x DESC, y DESC; " {4 1 5 4 1 4 4 1 2} do_execsql_test 2.$tn1.$tn2.12 " - SELECT a, x, y FROM t2, t3 WHERE a = 2 AND x = 1 AND y IN $inexpr + SELECT a, x, y FROM t2, t3 WHERE a = 2 AND x = 1 AND y IN $inexpr ORDER BY x DESC, y DESC; " {2 1 5 2 1 4 2 1 2} } diff --git a/third_party/sqlite/src/test/tkt-54844eea3f.test b/third_party/sqlite/src/test/tkt-54844eea3f.test index 7b04f6935d071..558a861e9d769 100644 --- a/third_party/sqlite/src/test/tkt-54844eea3f.test +++ b/third_party/sqlite/src/test/tkt-54844eea3f.test @@ -41,7 +41,7 @@ do_test 1.0 { do_test 1.1 { execsql { SELECT 'test-2', t3.c, ( - SELECT count(*) + SELECT count(*) FROM t1 JOIN (SELECT DISTINCT t3.c AS p FROM t2) AS x ON t1.a=x.p ) FROM t3; @@ -55,7 +55,7 @@ do_test 1.2 { INSERT INTO t4 VALUES('a', 2, 'two'); INSERT INTO t4 VALUES('b', 1, 'three'); INSERT INTO t4 VALUES('b', 2, 'four'); - SELECT ( + SELECT ( SELECT c FROM ( SELECT * FROM t4 WHERE a=out.a ORDER BY b LIMIT 10 OFFSET 1 ) WHERE b=out.b diff --git a/third_party/sqlite/src/test/tkt-5d863f876e.test b/third_party/sqlite/src/test/tkt-5d863f876e.test index 9a2fa3f470f8b..24ef997e872f9 100644 --- a/third_party/sqlite/src/test/tkt-5d863f876e.test +++ b/third_party/sqlite/src/test/tkt-5d863f876e.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket [5d863f876e] has been -# fixed. +# fixed. # set testdir [file dirname $argv0] @@ -34,7 +34,7 @@ do_multiclient_test tn { } {wal delete} do_test $tn.2 { - sql2 { SELECT * FROM t1 } + sql2 { SELECT * FROM t1 } } {1 2 3 4} do_test $tn.3 { diff --git a/third_party/sqlite/src/test/tkt-5ee23731f.test b/third_party/sqlite/src/test/tkt-5ee23731f.test index 761382a4d1311..06bc422398b54 100644 --- a/third_party/sqlite/src/test/tkt-5ee23731f.test +++ b/third_party/sqlite/src/test/tkt-5ee23731f.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket [5ee23731f15] has been -# fixed. +# fixed. # set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/tkt-6bfb98dfc0.test b/third_party/sqlite/src/test/tkt-6bfb98dfc0.test index 675a3fc2e9fe7..857376862cb25 100644 --- a/third_party/sqlite/src/test/tkt-6bfb98dfc0.test +++ b/third_party/sqlite/src/test/tkt-6bfb98dfc0.test @@ -57,5 +57,5 @@ do_test tkt-6bfb98dfc0.100 { SELECT x, length(y) FROM t1 ORDER BY x; } } {75 400 76 400} - + finish_test diff --git a/third_party/sqlite/src/test/tkt-752e1646fc.test b/third_party/sqlite/src/test/tkt-752e1646fc.test index 3837df8664ead..5a9b4902aacc2 100644 --- a/third_party/sqlite/src/test/tkt-752e1646fc.test +++ b/third_party/sqlite/src/test/tkt-752e1646fc.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket [752e1646fc] has been -# fixed. +# fixed. # set testdir [file dirname $argv0] @@ -20,9 +20,9 @@ source $testdir/tester.tcl do_test tkt-752e1646fc-1.1 { execsql { CREATE TABLE "test" ("letter" VARCHAR(1) PRIMARY KEY, "number" INTEGER NOT NULL); - INSERT INTO "test" ("letter", "number") VALUES('b', 1); - INSERT INTO "test" ("letter", "number") VALUES('a', 2); - INSERT INTO "test" ("letter", "number") VALUES('c', 2); + INSERT INTO "test" ("letter", "number") VALUES('b', 1); + INSERT INTO "test" ("letter", "number") VALUES('a', 2); + INSERT INTO "test" ("letter", "number") VALUES('c', 2); SELECT DISTINCT "number" FROM (SELECT "letter", "number" FROM "test" ORDER BY "letter", "number" LIMIT 1) AS "test"; } } {2} diff --git a/third_party/sqlite/src/test/tkt-7bbfb7d442.test b/third_party/sqlite/src/test/tkt-7bbfb7d442.test index 56d4caeb3e448..8fbee8be2aa0b 100644 --- a/third_party/sqlite/src/test/tkt-7bbfb7d442.test +++ b/third_party/sqlite/src/test/tkt-7bbfb7d442.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket [7bbfb7d442] has been -# fixed. +# fixed. # set testdir [file dirname $argv0] @@ -32,7 +32,7 @@ do_execsql_test 1.1 { CREATE TABLE t3(t3_a PRIMARY KEY, t3_d); CREATE TRIGGER t3t AFTER INSERT ON t3 WHEN new.t3_d IS NULL BEGIN UPDATE t3 SET t3_d = ( - SELECT d FROM + SELECT d FROM (SELECT * FROM t2 WHERE (new.t3_a%2)=(rowid%2) LIMIT 10), (SELECT * FROM t1 WHERE (new.t3_a%2)=(rowid%2) LIMIT 10) WHERE a = new.t3_a AND b = c @@ -59,7 +59,7 @@ ifcapable compound { #------------------------------------------------------------------------- -# The following test case - 2.* - is from the original bug report as +# The following test case - 2.* - is from the original bug report as # posted to the mailing list. # do_execsql_test 2.1 { @@ -71,10 +71,10 @@ do_execsql_test 2.1 { ControlState INTEGER NOT NULL DEFAULT -1, DeliveredQty VARCHAR(30) ); - + CREATE TRIGGER TGR_InventoryControl_AfterInsert - AFTER INSERT ON InventoryControl - FOR EACH ROW WHEN NEW.ControlState=-1 BEGIN + AFTER INSERT ON InventoryControl + FOR EACH ROW WHEN NEW.ControlState=-1 BEGIN INSERT OR REPLACE INTO InventoryControl( InventoryControlId,SKU,Variant,ControlDate,ControlState,DeliveredQty @@ -114,7 +114,7 @@ do_execsql_test 2.1 { ON T2.SKU=T1.SKU AND T2.Variant=T1.Variant; END; - + CREATE TABLE InventoryItem ( SKU INTEGER NOT NULL, Variant INTEGER NOT NULL DEFAULT 0, @@ -123,10 +123,10 @@ do_execsql_test 2.1 { ItemDescription VARCHAR(120) NOT NULL, PRIMARY KEY(SKU, Variant) ); - + INSERT INTO InventoryItem VALUES(220,0,1,170,'Scoth Tampon Recurer'); INSERT INTO InventoryItem VALUES(31,0,1,110,'Fromage'); - + CREATE TABLE TransactionDetail ( TransactionId INTEGER NOT NULL, SKU INTEGER NOT NULL, @@ -134,10 +134,10 @@ do_execsql_test 2.1 { PRIMARY KEY(TransactionId, SKU, Variant) ); INSERT INTO TransactionDetail(TransactionId, SKU, Variant) VALUES(44, 31, 0); - - - INSERT INTO InventoryControl(SKU, Variant, ControlDate) SELECT - II.SKU AS SKU, II.Variant AS Variant, '2011-08-30' AS ControlDate + + + INSERT INTO InventoryControl(SKU, Variant, ControlDate) SELECT + II.SKU AS SKU, II.Variant AS Variant, '2011-08-30' AS ControlDate FROM InventoryItem II; } @@ -146,8 +146,8 @@ do_execsql_test 2.2 { } {31 10} do_execsql_test 2.3 { - SELECT CASE WHEN DeliveredQty=10 THEN "TEST PASSED!" ELSE "TEST FAILED!" END - FROM InventoryControl WHERE SKU=31; + SELECT CASE WHEN DeliveredQty=10 THEN "TEST PASSED!" ELSE "TEST FAILED!" END + FROM InventoryControl WHERE SKU=31; } {{TEST PASSED!}} diff --git a/third_party/sqlite/src/test/tkt-80ba201079.test b/third_party/sqlite/src/test/tkt-80ba201079.test index ea0799b5683c1..4db3e129141a8 100644 --- a/third_party/sqlite/src/test/tkt-80ba201079.test +++ b/third_party/sqlite/src/test/tkt-80ba201079.test @@ -56,13 +56,13 @@ optimization_control db all 1 do_test tkt-80ba2-150 { optimization_control db factor-constants 1 db cache flush - set x1 [db eval {EXPLAIN + set x1 [db eval {EXPLAIN SELECT * FROM t1, t2 WHERE (a='A' AND b='X') OR (a='A' AND EXISTS (SELECT * FROM t3 WHERE c='C'));}] optimization_control db factor-constants 0 db cache flush - set x2 [db eval {EXPLAIN + set x2 [db eval {EXPLAIN SELECT * FROM t1, t2 WHERE (a='A' AND b='X') OR (a='A' AND EXISTS (SELECT * FROM t3 WHERE c='C'));}] diff --git a/third_party/sqlite/src/test/tkt-868145d012.test b/third_party/sqlite/src/test/tkt-868145d012.test index 145d159e540d7..896b3fcce7765 100644 --- a/third_party/sqlite/src/test/tkt-868145d012.test +++ b/third_party/sqlite/src/test/tkt-868145d012.test @@ -21,18 +21,18 @@ do_execsql_test tkt-868145d012.100 { uid VARCHAR(36), t INTEGER ); - + CREATE TABLE pa ( id INTEGER PRIMARY KEY, a_uid VARCHAR(36) ); - + CREATE TABLE a ( id INTEGER PRIMARY KEY, uid VARCHAR(36), t INTEGER ); - + INSERT INTO pa VALUES(1,'1234'); INSERT INTO pa VALUES(2,'2345'); INSERT INTO p VALUES(3,'1234',97); @@ -60,5 +60,5 @@ do_execsql_test tkt-868145d012.120 { ; } {1 3 {} 1 4 5 2 3 {} 2 4 {}} - + finish_test diff --git a/third_party/sqlite/src/test/tkt-8c63ff0ec.test b/third_party/sqlite/src/test/tkt-8c63ff0ec.test index d4aaefd74ad45..3ec73d2e58892 100644 --- a/third_party/sqlite/src/test/tkt-8c63ff0ec.test +++ b/third_party/sqlite/src/test/tkt-8c63ff0ec.test @@ -8,11 +8,11 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # Test cases to show that ticket [8c63ff0eca81a9132d8d67b31cd6ae9712a2cc6f] # "Incorrect query result on a UNION ALL" which was caused by using the same # temporary register in concurrent co-routines, as been fixed. -# +# set testdir [file dirname $argv0] @@ -26,7 +26,7 @@ do_execsql_test 1.1 { INSERT INTO t2 VALUES(2); CREATE TABLE t3(z); INSERT INTO t3 VALUES(2),(2),(2),(2); - + SELECT a, b+c FROM t1 UNION ALL SELECT x, 5 FROM t2 JOIN t3 ON z=x WHERE x=2 diff --git a/third_party/sqlite/src/test/tkt-91e2e8ba6f.test b/third_party/sqlite/src/test/tkt-91e2e8ba6f.test index 57f13740a256d..a6c578f734de6 100644 --- a/third_party/sqlite/src/test/tkt-91e2e8ba6f.test +++ b/third_party/sqlite/src/test/tkt-91e2e8ba6f.test @@ -7,7 +7,7 @@ #*********************************************************************** # # This file contains tests for SQLite. Specifically, it tests that SQLite -# does not crash and an error is returned if localhost() fails. This +# does not crash and an error is returned if localhost() fails. This # is the problem reported by ticket 91e2e8ba6f. # @@ -39,7 +39,7 @@ do_execsql_test 1.5 { } {1 1.1} do_execsql_test 1.6 { - SELECT a.x/10, a.y/10 FROM + SELECT a.x/10, a.y/10 FROM (SELECT * FROM t1 LIMIT 5 OFFSET 0) AS a, t1 AS b WHERE a.x = b.x LIMIT 5 OFFSET 0; } {1 1.1} diff --git a/third_party/sqlite/src/test/tkt-9d68c883.test b/third_party/sqlite/src/test/tkt-9d68c883.test index ba91b39e396dd..f184baa828189 100644 --- a/third_party/sqlite/src/test/tkt-9d68c883.test +++ b/third_party/sqlite/src/test/tkt-9d68c883.test @@ -40,7 +40,7 @@ for {set i 0} {$i < 100} {incr i} { DELETE FROM t5; INSERT INTO t8 VALUES('hello world'); } - + sqlite3_memdebug_fail $i -repeat 0 catchsql { DROP TABLE t7; } sqlite3_memdebug_fail -1 @@ -50,6 +50,6 @@ for {set i 0} {$i < 100} {incr i} { } {ok} } -catch { db close } +catch { db close } unregister_devsim finish_test diff --git a/third_party/sqlite/src/test/tkt-9f2eb3abac.test b/third_party/sqlite/src/test/tkt-9f2eb3abac.test index 8411654cdde56..f5a92e90b89b1 100644 --- a/third_party/sqlite/src/test/tkt-9f2eb3abac.test +++ b/third_party/sqlite/src/test/tkt-9f2eb3abac.test @@ -55,7 +55,7 @@ do_execsql_test 1.2 { INSERT INTO a (b, c) VALUES ( 1, 1 ); INSERT INTO d_to_a VALUES (1, 1, 1, 1, 1, 1, 1, 1); - DELETE FROM d_to_a + DELETE FROM d_to_a WHERE f_g = 1 AND f_e = 1 AND f_h = 1 AND f_f = 1 AND t_b = 1 AND t_c = 1; SELECT * FROM d_to_a; @@ -72,7 +72,7 @@ do_faultsim_test 3 -faults oom* -prep { } -body { execsql { SELECT * FROM t1,t2 WHERE a=? AND b=? AND c=? AND d=? AND e=? } } -test { - faultsim_test_result {0 {}} + faultsim_test_result {0 {}} } finish_test diff --git a/third_party/sqlite/src/test/tkt-a8a0d2996a.test b/third_party/sqlite/src/test/tkt-a8a0d2996a.test index 6b15e410e7e70..8ebca1d35d3e2 100644 --- a/third_party/sqlite/src/test/tkt-a8a0d2996a.test +++ b/third_party/sqlite/src/test/tkt-a8a0d2996a.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # Tests to verify that arithmetic operators do not change the type of # input operands. Ticket [a8a0d2996a] # diff --git a/third_party/sqlite/src/test/tkt-b72787b1.test b/third_party/sqlite/src/test/tkt-b72787b1.test index dea3f49a6409d..e60cf1fb2834d 100644 --- a/third_party/sqlite/src/test/tkt-b72787b1.test +++ b/third_party/sqlite/src/test/tkt-b72787b1.test @@ -25,7 +25,7 @@ # * A will find a bad cookie and cause *all* statements # to be expired including the currently running B by calling # sqlite3ExpirePreparedStatements -# * When control returns to B it will then abort +# * When control returns to B it will then abort # # The bug is that sqlite3ExpirePreparedStatements expires all statements. # Note that B was prepared after the schema change and hence is perfectly diff --git a/third_party/sqlite/src/test/tkt-b75a9ca6b0.test b/third_party/sqlite/src/test/tkt-b75a9ca6b0.test index 0c81a534da500..feb1288130982 100644 --- a/third_party/sqlite/src/test/tkt-b75a9ca6b0.test +++ b/third_party/sqlite/src/test/tkt-b75a9ca6b0.test @@ -23,14 +23,14 @@ set testprefix tkt-b75a9ca6b0 do_execsql_test 1 { CREATE TABLE t1 (x, y); - INSERT INTO t1 VALUES (1, 3); + INSERT INTO t1 VALUES (1, 3); INSERT INTO t1 VALUES (2, 2); INSERT INTO t1 VALUES (3, 1); } do_execsql_test 1.1 { CREATE INDEX i1 ON t1(x, y); -} +} set idxscan {0 0 0 {SCAN TABLE t1 USING COVERING INDEX i1}} set tblscan {0 0 0 {SCAN TABLE t1}} @@ -46,7 +46,7 @@ foreach {tn q res eqp} [subst -nocommands { 3 "SELECT * FROM t1 GROUP BY y, x ORDER BY y, x" {3 1 2 2 1 3} {$idxscan $sort} - + 4 "SELECT * FROM t1 GROUP BY x ORDER BY x" {1 3 2 2 3 1} {$idxscan} diff --git a/third_party/sqlite/src/test/tkt-ba7cbfaedc.test b/third_party/sqlite/src/test/tkt-ba7cbfaedc.test index f83f8a3d178a5..a9ab953f9c2c8 100644 --- a/third_party/sqlite/src/test/tkt-ba7cbfaedc.test +++ b/third_party/sqlite/src/test/tkt-ba7cbfaedc.test @@ -19,11 +19,11 @@ set testprefix tkt-ba7cbfaedc do_execsql_test 1 { CREATE TABLE t1 (x, y); INSERT INTO t1 VALUES (3, 'a'); - INSERT INTO t1 VALUES (1, 'a'); + INSERT INTO t1 VALUES (1, 'a'); INSERT INTO t1 VALUES (2, 'b'); INSERT INTO t1 VALUES (2, 'a'); INSERT INTO t1 VALUES (3, 'b'); - INSERT INTO t1 VALUES (1, 'b'); + INSERT INTO t1 VALUES (1, 'b'); } do_execsql_test 1.1 { diff --git a/third_party/sqlite/src/test/tkt-bd484a090c.test b/third_party/sqlite/src/test/tkt-bd484a090c.test index 3d2b59995857c..7289da1fbfae2 100644 --- a/third_party/sqlite/src/test/tkt-bd484a090c.test +++ b/third_party/sqlite/src/test/tkt-bd484a090c.test @@ -7,7 +7,7 @@ #*********************************************************************** # # This file contains tests for SQLite. Specifically, it tests that SQLite -# does not crash and an error is returned if localhost() fails. This +# does not crash and an error is returned if localhost() fails. This # is the problem reported by ticket bd484a090c. # diff --git a/third_party/sqlite/src/test/tkt-bdc6bbbb38.test b/third_party/sqlite/src/test/tkt-bdc6bbbb38.test index 8b0d55df84c2d..c57096ccc8138 100644 --- a/third_party/sqlite/src/test/tkt-bdc6bbbb38.test +++ b/third_party/sqlite/src/test/tkt-bdc6bbbb38.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket [bdc6bbbb38] has been -# fixed. +# fixed. # set testdir [file dirname $argv0] @@ -34,7 +34,7 @@ foreach {tn idxdir} {1 ASC 2 DESC} { {0 0 0 1 0 2 2 1} } do_execsql_test $tn.1.4 { - SELECT snippet(t2,'[',']') FROM t2 WHERE t2 MATCH 'a AND d OR b' + SELECT snippet(t2,'[',']') FROM t2 WHERE t2 MATCH 'a AND d OR b' ORDER BY docid ASC } { {[a] [b] c} @@ -68,7 +68,7 @@ foreach {tn idxdir} {1 ASC 2 DESC} { } { {[a] c [d]} } - do_execsql_test $tn.2.5 { + do_execsql_test $tn.2.5 { INSERT INTO t3 VALUES('a b c'); } do_execsql_test $tn.2.6 { diff --git a/third_party/sqlite/src/test/tkt-cbd054fa6b.test b/third_party/sqlite/src/test/tkt-cbd054fa6b.test index 2951233a5bb97..5a75b9b72e7ff 100644 --- a/third_party/sqlite/src/test/tkt-cbd054fa6b.test +++ b/third_party/sqlite/src/test/tkt-cbd054fa6b.test @@ -10,7 +10,7 @@ #*********************************************************************** # # This file implements tests to verify that ticket [cbd054fa6b] has been -# fixed. +# fixed. # set testdir [file dirname $argv0] @@ -58,23 +58,23 @@ do_test tkt-cbd05-1.2 { ifcapable stat4 { db eval { PRAGMA writable_schema = 1; - CREATE VIEW vvv AS + CREATE VIEW vvv AS SELECT tbl,idx,neq,nlt,ndlt,test_extract(sample,0) AS sample FROM sqlite_stat4; PRAGMA writable_schema = 0; } } else { db eval { - CREATE VIEW vvv AS + CREATE VIEW vvv AS SELECT tbl,idx,neq,nlt,ndlt,sample FROM sqlite_stat3; } } } {} do_test tkt-cbd05-1.3 { - execsql { - SELECT tbl,idx,group_concat(s(sample),' ') - FROM vvv - WHERE idx = 't1_x' + execsql { + SELECT tbl,idx,group_concat(s(sample),' ') + FROM vvv + WHERE idx = 't1_x' GROUP BY tbl,idx } } {t1 t1_x { A B C D E F G H I}} @@ -103,10 +103,10 @@ do_test tkt-cbd05-2.2 { } } {} do_test tkt-cbd05-2.3 { - execsql { - SELECT tbl,idx,group_concat(s(sample),' ') - FROM vvv - WHERE idx = 't1_x' + execsql { + SELECT tbl,idx,group_concat(s(sample),' ') + FROM vvv + WHERE idx = 't1_x' GROUP BY tbl,idx } } {t1 t1_x { A B C D E F G H I}} diff --git a/third_party/sqlite/src/test/tkt-d82e3f3721.test b/third_party/sqlite/src/test/tkt-d82e3f3721.test index da932d1eaa8a5..b539be72dbe95 100644 --- a/third_party/sqlite/src/test/tkt-d82e3f3721.test +++ b/third_party/sqlite/src/test/tkt-d82e3f3721.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket [d82e3f3721] has been -# fixed. +# fixed. # set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/tkt-f3e5abed55.test b/third_party/sqlite/src/test/tkt-f3e5abed55.test index 3c793d4f4da85..5e8f6eef7f9a3 100644 --- a/third_party/sqlite/src/test/tkt-f3e5abed55.test +++ b/third_party/sqlite/src/test/tkt-f3e5abed55.test @@ -74,7 +74,7 @@ if {[permutation]!="inmemory_journal"} { } return "SQLITE_OK" } - + sqlite3 db test.db sqlite3 db2 test.db do_test tkt-f3e5abed55-2.1 { @@ -91,7 +91,7 @@ if {[permutation]!="inmemory_journal"} { do_test tkt-f3e5abed55-2.3 { catchsql COMMIT } {1 {database is locked}} - + do_test tkt-f3e5abed55-2.4 { execsql COMMIT db2 execsql { diff --git a/third_party/sqlite/src/test/tkt-f777251dc7a.test b/third_party/sqlite/src/test/tkt-f777251dc7a.test index b91e438da5ba2..2e6bfd89f7b0b 100644 --- a/third_party/sqlite/src/test/tkt-f777251dc7a.test +++ b/third_party/sqlite/src/test/tkt-f777251dc7a.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket [f777251dc7a] has been -# fixed. +# fixed. # set testdir [file dirname $argv0] @@ -82,7 +82,7 @@ do_test tkt-f7772-3.1 { CREATE TEMP TABLE t1(x); CREATE TABLE t2(x); CREATE TABLE t3(x); - + INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); INSERT INTO t2 VALUES(1); diff --git a/third_party/sqlite/src/test/tkt-f7b4edec.test b/third_party/sqlite/src/test/tkt-f7b4edec.test index f6d3d5b95a51d..88e9e36146fb5 100644 --- a/third_party/sqlite/src/test/tkt-f7b4edec.test +++ b/third_party/sqlite/src/test/tkt-f7b4edec.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file implements regression tests for SQLite library. # -# This file implements tests to verify that ticket +# This file implements tests to verify that ticket # [f7b4edece25c994857dc139207f55a53c8319fae] has been fixed. # @@ -53,7 +53,7 @@ do_test tkt-f7b4edec-2 { set ::HOOKS } {} -# Rerun the prepared statement that was created prior to the +# Rerun the prepared statement that was created prior to the # schema reparse. Verify that the update-hook gives the correct # output. # diff --git a/third_party/sqlite/src/test/tkt-f973c7ac31.test b/third_party/sqlite/src/test/tkt-f973c7ac31.test index 454309057f7f2..2b709eb89b002 100644 --- a/third_party/sqlite/src/test/tkt-f973c7ac31.test +++ b/third_party/sqlite/src/test/tkt-f973c7ac31.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # set testdir [file dirname $argv0] @@ -30,57 +30,57 @@ foreach {tn sql} { execsql $sql do_test tkt-f973c7ac3-1.$tn.1 { - execsql { - SELECT * FROM t WHERE c1 = 5 AND c2>0 AND c2<='2' ORDER BY c2 DESC + execsql { + SELECT * FROM t WHERE c1 = 5 AND c2>0 AND c2<='2' ORDER BY c2 DESC } } {} do_test tkt-f973c7ac3-1.$tn.2 { - execsql { - SELECT * FROM t WHERE c1 = 5 AND c2>0 AND c2<=5 ORDER BY c2 DESC + execsql { + SELECT * FROM t WHERE c1 = 5 AND c2>0 AND c2<=5 ORDER BY c2 DESC } } {5 5 5 4} do_test tkt-f973c7ac3-1.$tn.3 { - execsql { - SELECT * FROM t WHERE c1 = 5 AND c2>0 AND c2<='5' ORDER BY c2 DESC + execsql { + SELECT * FROM t WHERE c1 = 5 AND c2>0 AND c2<='5' ORDER BY c2 DESC } } {5 5 5 4} do_test tkt-f973c7ac3-1.$tn.4 { - execsql { - SELECT * FROM t WHERE c1 = 5 AND c2>'0' AND c2<=5 ORDER BY c2 DESC + execsql { + SELECT * FROM t WHERE c1 = 5 AND c2>'0' AND c2<=5 ORDER BY c2 DESC } } {5 5 5 4} do_test tkt-f973c7ac3-1.$tn.5 { - execsql { - SELECT * FROM t WHERE c1 = 5 AND c2>'0' AND c2<='5' ORDER BY c2 DESC + execsql { + SELECT * FROM t WHERE c1 = 5 AND c2>'0' AND c2<='5' ORDER BY c2 DESC } } {5 5 5 4} do_test tkt-f973c7ac3-1.$tn.6 { - execsql { - SELECT * FROM t WHERE c1 = 5 AND c2>0 AND c2<='2' ORDER BY c2 ASC + execsql { + SELECT * FROM t WHERE c1 = 5 AND c2>0 AND c2<='2' ORDER BY c2 ASC } } {} do_test tkt-f973c7ac3-1.$tn.7 { - execsql { - SELECT * FROM t WHERE c1 = 5 AND c2>0 AND c2<=5 ORDER BY c2 ASC + execsql { + SELECT * FROM t WHERE c1 = 5 AND c2>0 AND c2<=5 ORDER BY c2 ASC } } {5 4 5 5} do_test tkt-f973c7ac3-1.$tn.8 { - execsql { - SELECT * FROM t WHERE c1 = 5 AND c2>0 AND c2<='5' ORDER BY c2 ASC + execsql { + SELECT * FROM t WHERE c1 = 5 AND c2>0 AND c2<='5' ORDER BY c2 ASC } } {5 4 5 5} do_test tkt-f973c7ac3-1.$tn.9 { - execsql { - SELECT * FROM t WHERE c1 = 5 AND c2>'0' AND c2<=5 ORDER BY c2 ASC + execsql { + SELECT * FROM t WHERE c1 = 5 AND c2>'0' AND c2<=5 ORDER BY c2 ASC } } {5 4 5 5} do_test tkt-f973c7ac3-1.$tn.10 { - execsql { - SELECT * FROM t WHERE c1 = 5 AND c2>'0' AND c2<='5' ORDER BY c2 ASC + execsql { + SELECT * FROM t WHERE c1 = 5 AND c2>'0' AND c2<='5' ORDER BY c2 ASC } } {5 4 5 5} -} +} finish_test diff --git a/third_party/sqlite/src/test/tkt-fa7bf5ec.test b/third_party/sqlite/src/test/tkt-fa7bf5ec.test index 34f12b96773cc..7b9c0a1a16f70 100644 --- a/third_party/sqlite/src/test/tkt-fa7bf5ec.test +++ b/third_party/sqlite/src/test/tkt-fa7bf5ec.test @@ -15,9 +15,9 @@ # The problem described by this ticket was that the sqlite3ExprCompare() # function was saying that expressions (x='a') and (x='A') were identical # because it was using sqlite3StrICmp() instead of strcmp() to compare string -# literals. That was causing the query optimizer for aggregate queries to -# believe that both count() operations were identical, and thus only -# computing the first count() and making a copy of the result for the +# literals. That was causing the query optimizer for aggregate queries to +# believe that both count() operations were identical, and thus only +# computing the first count() and making a copy of the result for the # second count(). # diff --git a/third_party/sqlite/src/test/tkt-fc62af4523.test b/third_party/sqlite/src/test/tkt-fc62af4523.test index ed1497b948cc4..a7f29f90147d4 100644 --- a/third_party/sqlite/src/test/tkt-fc62af4523.test +++ b/third_party/sqlite/src/test/tkt-fc62af4523.test @@ -61,7 +61,7 @@ do_test tkt-fc62af4523.2 { do_test tkt-fc62af4523.3 { execsql { PRAGMA journal_mode = DELETE } } {delete} do_test tkt-fc62af4523.4 { file exists test.db-journal } {1} -# Cause the external process to crash. Since it has already written +# Cause the external process to crash. Since it has already written # uncommitted data into the database file, the next reader will have # to do a hot-journal rollback to recover the database. # diff --git a/third_party/sqlite/src/test/tkt-fc7bd6358f.test b/third_party/sqlite/src/test/tkt-fc7bd6358f.test index a1b13c463c70c..f8cb7302faee8 100644 --- a/third_party/sqlite/src/test/tkt-fc7bd6358f.test +++ b/third_party/sqlite/src/test/tkt-fc7bd6358f.test @@ -28,7 +28,7 @@ # # The correct result should be two rows, one with 12|12|12 and the other # with 34|34|34. With this bug, no rows are returned. Bisecting shows that -# this bug was introduced with check-in [dd4d67a67454] on 2009-04-23. +# this bug was introduced with check-in [dd4d67a67454] on 2009-04-23. # set testdir [file dirname $argv0] @@ -74,5 +74,5 @@ foreach {a from} { } } - + finish_test diff --git a/third_party/sqlite/src/test/tkt1435.test b/third_party/sqlite/src/test/tkt1435.test index 1f62147b44651..bf620cc663ede 100644 --- a/third_party/sqlite/src/test/tkt1435.test +++ b/third_party/sqlite/src/test/tkt1435.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #1435 has been -# fixed. +# fixed. # # # $Id: tkt1435.test,v 1.2 2006/01/17 09:35:02 danielk1977 Exp $ @@ -46,27 +46,27 @@ do_test tkt1435-1.0 { VALUES(3, 'libhello:script', 1, 1, 1126929880.094, 1, 0); INSERT INTO "Instances" VALUES(4, 'libhello', 1, 1, 1126929880.094, 1, 0); - + CREATE TABLE Versions(versionId INTEGER PRIMARY KEY,version STR UNIQUE); INSERT INTO "Versions" VALUES(0, NULL); INSERT INTO "Versions" VALUES(1, '/localhost@rpl:linux/0-1-1'); - + CREATE TABLE Flavors(flavorId integer primary key, flavor str unique); INSERT INTO "Flavors" VALUES(0, NULL); INSERT INTO "Flavors" VALUES(1, '1#x86'); - + CREATE TEMPORARY TABLE tlList ( row INTEGER PRIMARY KEY, name STRING, version STRING, flavor STRING ); - - INSERT INTO tlList + + INSERT INTO tlList values(NULL, 'libhello:script', '/localhost@rpl:linux/0-1-1', '1#x86'); - INSERT INTO tlList + INSERT INTO tlList values(NULL, 'libhello:user', '/localhost@rpl:linux/0-1-1', '1#x86'); - INSERT INTO tlList + INSERT INTO tlList values(NULL, 'libhello:runtime', '/localhost@rpl:linux/0-1-1', '1#x86'); } } {} @@ -87,13 +87,13 @@ do_test tkt1435-1.1 { } } {1 0 2 0 3 1} -# Create a indices, analyze and rerun the query. +# Create a indices, analyze and rerun the query. # Verify that the results are the same # do_test tkt1435-1.2 { execsql { CREATE INDEX InstancesNameIdx ON Instances(troveName); - CREATE UNIQUE INDEX InstancesIdx + CREATE UNIQUE INDEX InstancesIdx ON Instances(troveName, versionId, flavorId); ANALYZE; select row, pinned from tlList, Instances, Versions, Flavors diff --git a/third_party/sqlite/src/test/tkt1443.test b/third_party/sqlite/src/test/tkt1443.test index 0f55437bcaa61..9ea8d8a772c48 100644 --- a/third_party/sqlite/src/test/tkt1443.test +++ b/third_party/sqlite/src/test/tkt1443.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #1433 has been -# fixed. +# fixed. # # The problem in ticket #1433 was that the dependencies on the right-hand # side of an IN operator were not being checked correctly. So in an @@ -21,12 +21,12 @@ # # the optimizer was missing the fact that the right-hand side of the IN # depended on table t2. It was checking dependencies based on the -# Expr.pRight field rather than Expr.pList and Expr.pSelect. +# Expr.pRight field rather than Expr.pList and Expr.pSelect. # # Such a bug could be verifed using a less elaborate test case. But # this test case (from the original bug poster) exercises so many different # parts of the system all at once, that it seemed like a good one to -# include in the test suite. +# include in the test suite. # # NOTE: Yes, in spite of the name of this file (tkt1443.test) this # test is for ticket #1433 not #1443. I mistyped the name when I was @@ -58,7 +58,7 @@ do_test tkt1443-1.0 { INSERT INTO "Items" VALUES(2, 'double'); INSERT INTO "Items" VALUES(3, 'double:runtime'); INSERT INTO "Items" VALUES(4, '.*:runtime'); - + CREATE TABLE Labels( labelId INTEGER PRIMARY KEY, label STR UNIQUE @@ -66,7 +66,7 @@ do_test tkt1443-1.0 { INSERT INTO "Labels" VALUES(0, 'ALL'); INSERT INTO "Labels" VALUES(1, 'localhost@rpl:linux'); INSERT INTO "Labels" VALUES(2, 'localhost@rpl:branch'); - + CREATE TABLE LabelMap( itemId INTEGER, labelId INTEGER, @@ -78,7 +78,7 @@ do_test tkt1443-1.0 { INSERT INTO "LabelMap" VALUES(1, 2, 2); INSERT INTO "LabelMap" VALUES(2, 2, 3); INSERT INTO "LabelMap" VALUES(3, 2, 3); - + CREATE TABLE Users ( userId INTEGER PRIMARY KEY, user STRING UNIQUE, @@ -95,14 +95,14 @@ do_test tkt1443-1.0 { ); INSERT INTO "UserGroups" VALUES(1, 'test'); INSERT INTO "UserGroups" VALUES(2, 'limited'); - + CREATE TABLE UserGroupMembers ( userGroupId INTEGER, userId INTEGER ); INSERT INTO "UserGroupMembers" VALUES(1, 1); INSERT INTO "UserGroupMembers" VALUES(2, 2); - + CREATE TABLE Permissions ( userGroupId INTEGER, labelId INTEGER NOT NULL, @@ -145,7 +145,7 @@ do_test tkt1443-1.1 { } } {double .*:runtime double:runtime .*:runtime double:source .*:runtime} -# Create an index and rerun the query. +# Create an index and rerun the query. # Verify that the results are the same # do_test tkt1443-1.2 { diff --git a/third_party/sqlite/src/test/tkt1444.test b/third_party/sqlite/src/test/tkt1444.test index 13870db8e807c..515b4d4e1331f 100644 --- a/third_party/sqlite/src/test/tkt1444.test +++ b/third_party/sqlite/src/test/tkt1444.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #1444 has been -# fixed. +# fixed. # set testdir [file dirname $argv0] @@ -19,7 +19,7 @@ source $testdir/tester.tcl ifcapable !compound||!view { finish_test - return + return } # The use of a VIEW that contained an ORDER BY clause within a UNION ALL diff --git a/third_party/sqlite/src/test/tkt1449.test b/third_party/sqlite/src/test/tkt1449.test index 5f27ee7a4c6d6..d484636d0f59e 100644 --- a/third_party/sqlite/src/test/tkt1449.test +++ b/third_party/sqlite/src/test/tkt1449.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #1449 has been -# fixed. +# fixed. # set testdir [file dirname $argv0] @@ -71,9 +71,9 @@ do_test tkt1449-1.1 { CREATE TABLE TASKCOMPLETIONS(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, PARENTENTITYID text(50) null, BODY text null, BODYCONTENTTYPE text(100) null, ISOBSOLETE text(1) null, TASKID text(50) not null, DISPOSITION int not null, STATUSID text(50) not null, SHORTNAME text(30) not null, LONGNAME text(200) not null, constraint PK_TASKCOMPLETIONS primary key (ISSUEID, OBJECTID)); CREATE TABLE TASKS(CLASSID int null, SEQNO int not null, LASTMODONNODEID text(50) not null, PREVMODONNODEID text(50) null, ISSUEID text(50) not null, OBJECTID text(50) not null, REVISIONNUM int not null, CONTAINERID text(50) not null, AUTHORID text(50) not null, CREATIONDATE text(25) null, LASTMODIFIEDDATE text(25) null, UPDATENUMBER int null, PREVREVISIONNUM int null, LASTCMD int null, LASTCMDACLVERSION int null, USERDEFINEDFIELD text(300) null, LASTMODIFIEDBYID text(50) null, PARENTENTITYID text(50) null, BODY text null, BODYCONTENTTYPE text(100) null, ISOBSOLETE text(1) null, DUETIME text(25) null, ASSIGNEDTO text(50) not null, TARGETOBJECTIDS text null, RESPONSEID text(50) not null, TYPEID text(50) not null, LABEL text(200) not null, INSTRUCTIONS text not null, ALLOWEDSTATUSES text not null, ISSERIALREVIEW text(1) null, DAYSTOREVIEW int null, REVIEWERIDS text(500) null, REVIEWTYPE int null, REVIEWGROUP text(300) null, constraint PK_TASKS primary key (ISSUEID, OBJECTID)); CREATE TABLE USERS (USERID text(50) not null, USERSID text(100) not null, ENTERPRISEUSER text(1) not null, USEREMAILADDRESS text(200) null, EMAILVALIDATED text(1) null, VALIDATIONCOOKIE text(50) null, CREATETIME text(25) not null, TQUNID text(36) not null, PARTITIONID text(50) null); - CREATE VIEW CRITICALISSUES as - - + CREATE VIEW CRITICALISSUES as + + select USERID, ISSUEID, ISSUENAME, min(DATE1) DATE1 from ( @@ -94,9 +94,9 @@ do_test tkt1449-1.1 { and iset.ISSUESTATUS = 1 ) as CRITICALDATA group by USERID, ISSUEID, ISSUENAME; - CREATE VIEW CURRENTFILES as - - + CREATE VIEW CURRENTFILES as + + select d.ISSUEID as ISSUEID, d.REFERENCEDOCUMENTID as OBJECTID, @@ -104,9 +104,9 @@ do_test tkt1449-1.1 { from DOCREFERENCES d join FILES f on f.OBJECTID = d.REFERENCEDOCUMENTID; - CREATE VIEW ISSUEDATA as - - + CREATE VIEW ISSUEDATA as + + select ISSUES.OBJECTID as ISSUEID, ISSUES.CREATIONDATE as CREATIONDATE, @@ -184,11 +184,11 @@ do_test tkt1449-1.1 { ENTERPRISEDATA.LONGSTRING9 as LONGSTRING9, ENTERPRISEDATA.LONGSTRING10 as LONGSTRING10 from - ISSUES + ISSUES join ISSUESETTINGS on ISSUES.OBJECTID = ISSUESETTINGS.ISSUEID left outer join ENTERPRISEDATA on ISSUES.OBJECTID = ENTERPRISEDATA.ISSUEID; - CREATE VIEW ITEMS as - + CREATE VIEW ITEMS as + select 'FILES' as TABLENAME, CLASSID, SEQNO, LASTMODONNODEID, PREVMODONNODEID, ISSUEID, OBJECTID, REVISIONNUM, CONTAINERID, AUTHORID, CREATIONDATE, LASTMODIFIEDDATE, UPDATENUMBER, PREVREVISIONNUM, LASTCMD, LASTCMDACLVERSION, USERDEFINEDFIELD, LASTMODIFIEDBYID, PARENTENTITYID, BODY, BODYCONTENTTYPE, ISOBSOLETE, FILENAME, VISIBLENAME, VERSIONSTRING, DOCUMENTHASH, ISFINAL, DOCREFERENCEID, NULL as ACTIONTYPE, NULL as ASSOCIATEDOBJECTIDS, NULL as OLDENTITIES, NULL as NEWENTITIES, NULL as OTHERENTITIES, NULL as TQUNID, NULL as TABLEITEMID, NULL as TABLENODEID, NULL as TABLECMD, NULL as TABLECONTAINERID, NULL as TABLESEQNO, NULL as DIRTYCONTENT, NULL as STUBBED, NULL as ENTITYSTUBDATA, NULL as PARTICIPANTSTATE, NULL as PARTICIPANTROLE, NULL as PARTICIPANTTEAM, NULL as ISREQUIREDMEMBER, NULL as USERID, NULL as ISAGENT, NULL as NAME, NULL as EMAILADDRESS, NULL as ISEMAILONLY, NULL as INVITATION, NULL as ACCEPTRESENDCOUNT, NULL as ACCEPTRESENDTIMEOUT, NULL as ACCEPTLASTSENTTONODEID, NULL as TASKID, NULL as DISPOSITION, NULL as STATUSID, NULL as SHORTNAME, NULL as LONGNAME, NULL as DUETIME, NULL as ASSIGNEDTO, NULL as TARGETOBJECTIDS, NULL as RESPONSEID, NULL as TYPEID, NULL as LABEL, NULL as INSTRUCTIONS, NULL as ALLOWEDSTATUSES, NULL as ISSERIALREVIEW, NULL as DAYSTOREVIEW, NULL as REVIEWERIDS, NULL as REVIEWTYPE, NULL as REVIEWGROUP from FILES union all select 'LOGENTRIES' as TABLENAME, CLASSID, SEQNO, LASTMODONNODEID, PREVMODONNODEID, ISSUEID, OBJECTID, REVISIONNUM, CONTAINERID, AUTHORID, CREATIONDATE, LASTMODIFIEDDATE, UPDATENUMBER, PREVREVISIONNUM, LASTCMD, LASTCMDACLVERSION, USERDEFINEDFIELD, LASTMODIFIEDBYID, PARENTENTITYID, BODY, BODYCONTENTTYPE, ISOBSOLETE, NULL as FILENAME, NULL as VISIBLENAME, NULL as VERSIONSTRING, NULL as DOCUMENTHASH, NULL as ISFINAL, NULL as DOCREFERENCEID, ACTIONTYPE, ASSOCIATEDOBJECTIDS, OLDENTITIES, NEWENTITIES, OTHERENTITIES, NULL as TQUNID, NULL as TABLEITEMID, NULL as TABLENODEID, NULL as TABLECMD, NULL as TABLECONTAINERID, NULL as TABLESEQNO, NULL as DIRTYCONTENT, NULL as STUBBED, NULL as ENTITYSTUBDATA, NULL as PARTICIPANTSTATE, NULL as PARTICIPANTROLE, NULL as PARTICIPANTTEAM, NULL as ISREQUIREDMEMBER, NULL as USERID, NULL as ISAGENT, NULL as NAME, NULL as EMAILADDRESS, NULL as ISEMAILONLY, NULL as INVITATION, NULL as ACCEPTRESENDCOUNT, NULL as ACCEPTRESENDTIMEOUT, NULL as ACCEPTLASTSENTTONODEID, NULL as TASKID, NULL as DISPOSITION, NULL as STATUSID, NULL as SHORTNAME, NULL as LONGNAME, NULL as DUETIME, NULL as ASSIGNEDTO, NULL as TARGETOBJECTIDS, NULL as RESPONSEID, NULL as TYPEID, NULL as LABEL, NULL as INSTRUCTIONS, NULL as ALLOWEDSTATUSES, NULL as ISSERIALREVIEW, NULL as DAYSTOREVIEW, NULL as REVIEWERIDS, NULL as REVIEWTYPE, NULL as REVIEWGROUP from LOGENTRIES @@ -200,9 +200,9 @@ do_test tkt1449-1.1 { select 'TASKCOMPLETIONS' as TABLENAME, CLASSID, SEQNO, LASTMODONNODEID, PREVMODONNODEID, ISSUEID, OBJECTID, REVISIONNUM, CONTAINERID, AUTHORID, CREATIONDATE, LASTMODIFIEDDATE, UPDATENUMBER, PREVREVISIONNUM, LASTCMD, LASTCMDACLVERSION, USERDEFINEDFIELD, LASTMODIFIEDBYID, PARENTENTITYID, BODY, BODYCONTENTTYPE, ISOBSOLETE, NULL as FILENAME, NULL as VISIBLENAME, NULL as VERSIONSTRING, NULL as DOCUMENTHASH, NULL as ISFINAL, NULL as DOCREFERENCEID, NULL as ACTIONTYPE, NULL as ASSOCIATEDOBJECTIDS, NULL as OLDENTITIES, NULL as NEWENTITIES, NULL as OTHERENTITIES, NULL as TQUNID, NULL as TABLEITEMID, NULL as TABLENODEID, NULL as TABLECMD, NULL as TABLECONTAINERID, NULL as TABLESEQNO, NULL as DIRTYCONTENT, NULL as STUBBED, NULL as ENTITYSTUBDATA, NULL as PARTICIPANTSTATE, NULL as PARTICIPANTROLE, NULL as PARTICIPANTTEAM, NULL as ISREQUIREDMEMBER, NULL as USERID, NULL as ISAGENT, NULL as NAME, NULL as EMAILADDRESS, NULL as ISEMAILONLY, NULL as INVITATION, NULL as ACCEPTRESENDCOUNT, NULL as ACCEPTRESENDTIMEOUT, NULL as ACCEPTLASTSENTTONODEID, TASKID, DISPOSITION, STATUSID, SHORTNAME, LONGNAME, NULL as DUETIME, NULL as ASSIGNEDTO, NULL as TARGETOBJECTIDS, NULL as RESPONSEID, NULL as TYPEID, NULL as LABEL, NULL as INSTRUCTIONS, NULL as ALLOWEDSTATUSES, NULL as ISSERIALREVIEW, NULL as DAYSTOREVIEW, NULL as REVIEWERIDS, NULL as REVIEWTYPE, NULL as REVIEWGROUP from TASKCOMPLETIONS union all select 'TASKS' as TABLENAME, CLASSID, SEQNO, LASTMODONNODEID, PREVMODONNODEID, ISSUEID, OBJECTID, REVISIONNUM, CONTAINERID, AUTHORID, CREATIONDATE, LASTMODIFIEDDATE, UPDATENUMBER, PREVREVISIONNUM, LASTCMD, LASTCMDACLVERSION, USERDEFINEDFIELD, LASTMODIFIEDBYID, PARENTENTITYID, BODY, BODYCONTENTTYPE, ISOBSOLETE, NULL as FILENAME, NULL as VISIBLENAME, NULL as VERSIONSTRING, NULL as DOCUMENTHASH, NULL as ISFINAL, NULL as DOCREFERENCEID, NULL as ACTIONTYPE, NULL as ASSOCIATEDOBJECTIDS, NULL as OLDENTITIES, NULL as NEWENTITIES, NULL as OTHERENTITIES, NULL as TQUNID, NULL as TABLEITEMID, NULL as TABLENODEID, NULL as TABLECMD, NULL as TABLECONTAINERID, NULL as TABLESEQNO, NULL as DIRTYCONTENT, NULL as STUBBED, NULL as ENTITYSTUBDATA, NULL as PARTICIPANTSTATE, NULL as PARTICIPANTROLE, NULL as PARTICIPANTTEAM, NULL as ISREQUIREDMEMBER, NULL as USERID, NULL as ISAGENT, NULL as NAME, NULL as EMAILADDRESS, NULL as ISEMAILONLY, NULL as INVITATION, NULL as ACCEPTRESENDCOUNT, NULL as ACCEPTRESENDTIMEOUT, NULL as ACCEPTLASTSENTTONODEID, NULL as TASKID, NULL as DISPOSITION, NULL as STATUSID, NULL as SHORTNAME, NULL as LONGNAME, DUETIME, ASSIGNEDTO, TARGETOBJECTIDS, RESPONSEID, TYPEID, LABEL, INSTRUCTIONS, ALLOWEDSTATUSES, ISSERIALREVIEW, DAYSTOREVIEW, REVIEWERIDS, REVIEWTYPE, REVIEWGROUP from TASKS; - CREATE VIEW TASKINFO as - - + CREATE VIEW TASKINFO as + + select t.ISSUEID as ISSUEID, t.OBJECTID as OBJECTID, diff --git a/third_party/sqlite/src/test/tkt1473.test b/third_party/sqlite/src/test/tkt1473.test index 3950272f0498e..509445da9a2a9 100644 --- a/third_party/sqlite/src/test/tkt1473.test +++ b/third_party/sqlite/src/test/tkt1473.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #1473 has been -# fixed. +# fixed. # set testdir [file dirname $argv0] @@ -19,7 +19,7 @@ source $testdir/tester.tcl ifcapable !compound { finish_test - return + return } do_test tkt1473-1.1 { diff --git a/third_party/sqlite/src/test/tkt1501.test b/third_party/sqlite/src/test/tkt1501.test index 19ec7f7e8f629..901c6608b38db 100644 --- a/third_party/sqlite/src/test/tkt1501.test +++ b/third_party/sqlite/src/test/tkt1501.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #1501 is -# fixed. +# fixed. # set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/tkt1512.test b/third_party/sqlite/src/test/tkt1512.test index a2c39dbe48602..5ca6167d8b6e8 100644 --- a/third_party/sqlite/src/test/tkt1512.test +++ b/third_party/sqlite/src/test/tkt1512.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #1512 is -# fixed. +# fixed. # set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/tkt1514.test b/third_party/sqlite/src/test/tkt1514.test index 1dfae1d97a10f..637442142224d 100644 --- a/third_party/sqlite/src/test/tkt1514.test +++ b/third_party/sqlite/src/test/tkt1514.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #1514 is -# fixed. +# fixed. # set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/tkt1536.test b/third_party/sqlite/src/test/tkt1536.test index 46e46192b6108..75aeeef3f3809 100644 --- a/third_party/sqlite/src/test/tkt1536.test +++ b/third_party/sqlite/src/test/tkt1536.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #1536 is -# fixed. +# fixed. # set testdir [file dirname $argv0] @@ -33,6 +33,6 @@ do_test tkt1536-1.2 { SELECT b FROM t1 WHERE rowid=2; } } {01} - + finish_test diff --git a/third_party/sqlite/src/test/tkt1537.test b/third_party/sqlite/src/test/tkt1537.test index 633f91fceef2e..dfcd466d7f649 100644 --- a/third_party/sqlite/src/test/tkt1537.test +++ b/third_party/sqlite/src/test/tkt1537.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #1537 is -# fixed. +# fixed. # set testdir [file dirname $argv0] @@ -113,7 +113,7 @@ do_test tkt1537-3.1 { } } {1 {} {} {} {}} do_test tkt1537-3.2 { - execsql { + execsql { SELECT * FROM t2 LEFT JOIN t1 ON a1 GLOB 'abc*' WHERE t2.id=3; } } {3 1 {} {} {}} diff --git a/third_party/sqlite/src/test/tkt1567.test b/third_party/sqlite/src/test/tkt1567.test index cb1a6be5062fd..67b3de13e422c 100644 --- a/third_party/sqlite/src/test/tkt1567.test +++ b/third_party/sqlite/src/test/tkt1567.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #1567 is -# fixed. +# fixed. # set testdir [file dirname $argv0] diff --git a/third_party/sqlite/src/test/tkt1644.test b/third_party/sqlite/src/test/tkt1644.test index aa26a88d33abb..51f1ea3bacb86 100644 --- a/third_party/sqlite/src/test/tkt1644.test +++ b/third_party/sqlite/src/test/tkt1644.test @@ -22,7 +22,7 @@ source $testdir/tester.tcl ifcapable !tempdb||!view { finish_test return -} +} # Create two tables T1 and T2 and make V1 point to T1. do_test tkt1644-1.1 { @@ -80,7 +80,7 @@ ifcapable view { } list [sqlite3_step $::STMT] [sqlite3_finalize $::STMT] } {SQLITE_ERROR SQLITE_SCHEMA} - + do_test tkt1644-2.2 { execsql { CREATE TABLE real_t1(a, b); diff --git a/third_party/sqlite/src/test/tkt1667.test b/third_party/sqlite/src/test/tkt1667.test index 63815061c0e2f..3ef51fe863ddc 100644 --- a/third_party/sqlite/src/test/tkt1667.test +++ b/third_party/sqlite/src/test/tkt1667.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #1667 has been -# fixed. +# fixed. # # # $Id: tkt1667.test,v 1.4 2009/02/05 17:00:54 drh Exp $ @@ -28,7 +28,7 @@ db close forcedelete test.db test.db-journal # Set the pending byte offset such that the page it is on is -# the first autovacuum pointer map page in the file (assume a page +# the first autovacuum pointer map page in the file (assume a page # size of 1024). set first_ptrmap_page [expr 1024/5 + 3] diff --git a/third_party/sqlite/src/test/tkt1873.test b/third_party/sqlite/src/test/tkt1873.test index 9930790c747d8..0110b578857c7 100644 --- a/third_party/sqlite/src/test/tkt1873.test +++ b/third_party/sqlite/src/test/tkt1873.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #1873 has been -# fixed. +# fixed. # # # $Id: tkt1873.test,v 1.2 2007/10/09 08:29:33 danielk1977 Exp $ diff --git a/third_party/sqlite/src/test/tkt2141.test b/third_party/sqlite/src/test/tkt2141.test index a40659ff84d3f..93d434c855dfe 100644 --- a/third_party/sqlite/src/test/tkt2141.test +++ b/third_party/sqlite/src/test/tkt2141.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #2141 has been -# fixed. +# fixed. # # # $Id: tkt2141.test,v 1.2 2007/09/12 17:01:45 danielk1977 Exp $ diff --git a/third_party/sqlite/src/test/tkt2192.test b/third_party/sqlite/src/test/tkt2192.test index 72ef9a2621d77..f60acf2b5aa3d 100644 --- a/third_party/sqlite/src/test/tkt2192.test +++ b/third_party/sqlite/src/test/tkt2192.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #2192 has been -# fixed. +# fixed. # # # $Id: tkt2192.test,v 1.3 2008/08/04 03:51:24 danielk1977 Exp $ @@ -27,7 +27,7 @@ ifcapable !datetime||!compound { do_test tkt2192-1.1 { execsql { -- Raw data (RBS) -------- - + create table records ( date real, type text, @@ -36,23 +36,23 @@ do_test tkt2192-1.1 { acc_name text, acc_no text ); - + -- Direct Debits ---------------- create view direct_debits as select * from records where type = 'D/D'; - + create view monthly_direct_debits as select strftime('%Y-%m', date) as date, (-1 * sum(value)) as value from direct_debits group by strftime('%Y-%m', date); - + -- Expense Categories --------------- create view energy as select strftime('%Y-%m', date) as date, (-1 * sum(value)) as value from direct_debits where description like '%NPOWER%' group by strftime('%Y-%m', date); - + create view phone_internet as select strftime('%Y-%m', date) as date, (-1 * sum(value)) as value from direct_debits @@ -60,29 +60,29 @@ do_test tkt2192-1.1 { or description like '%SUPANET%' or description like '%ORANGE%' group by strftime('%Y-%m', date); - + create view credit_cards as select strftime('%Y-%m', date) as date, (-1 * sum(value)) as value from direct_debits where description like '%VISA%' group by strftime('%Y-%m', date); - + -- Overview --------------------- - + create view expense_overview as select 'Energy' as expense, date, value from energy union select 'Phone/Internet' as expense, date, value from phone_internet union select 'Credit Card' as expense, date, value from credit_cards; - + create view jan as select 'jan', expense, value from expense_overview where date like '%-01'; - + create view nov as select 'nov', expense, value from expense_overview where date like '%-11'; - + create view summary as select * from jan join nov on (jan.expense = nov.expense); } @@ -111,7 +111,7 @@ do_test tkt2192-2.1 { INSERT INTO t1 VALUES(3,25); INSERT INTO t1 VALUES(4,26); INSERT INTO t1 VALUES(1,27); - + SELECT b FROM v1 ORDER BY b; } } {7 10 14 15 20 21 25} diff --git a/third_party/sqlite/src/test/tkt2213.test b/third_party/sqlite/src/test/tkt2213.test index d5a81ab88c0c8..e77a55892d1fe 100644 --- a/third_party/sqlite/src/test/tkt2213.test +++ b/third_party/sqlite/src/test/tkt2213.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #2213 has been -# fixed. +# fixed. # # # $Id: tkt2213.test,v 1.2 2008/07/12 14:52:20 drh Exp $ diff --git a/third_party/sqlite/src/test/tkt2285.test b/third_party/sqlite/src/test/tkt2285.test index f177c22fec2fb..6281fb330e2e6 100644 --- a/third_party/sqlite/src/test/tkt2285.test +++ b/third_party/sqlite/src/test/tkt2285.test @@ -9,7 +9,7 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. Specifically. -# it contains tests to verify that ticket #2285 has been fixed. +# it contains tests to verify that ticket #2285 has been fixed. # # $Id: tkt2285.test,v 1.2 2008/07/12 14:52:20 drh Exp $ diff --git a/third_party/sqlite/src/test/tkt2339.test b/third_party/sqlite/src/test/tkt2339.test index 41acd377ce64d..6db4277838dca 100644 --- a/third_party/sqlite/src/test/tkt2339.test +++ b/third_party/sqlite/src/test/tkt2339.test @@ -27,13 +27,13 @@ do_test tkt2339.1 { insert into t1 values (2); insert into t1 values (3); insert into t1 values (4); - + create table t2(num int); insert into t2 values (11); insert into t2 values (12); insert into t2 values (13); insert into t2 values (14); - + SELECT * FROM (SELECT * FROM t1 ORDER BY num DESC LIMIT 2) UNION SELECT * FROM (SELECT * FROM t2 ORDER BY num DESC LIMIT 2) diff --git a/third_party/sqlite/src/test/tkt2391.test b/third_party/sqlite/src/test/tkt2391.test index d192b85bd7c65..8263df4b01645 100644 --- a/third_party/sqlite/src/test/tkt2391.test +++ b/third_party/sqlite/src/test/tkt2391.test @@ -36,7 +36,7 @@ do_test tkt2391.3 { } {2} # This demonstrates the bug. Creating the index causes SQLite to ignore -# the "COLLATE nocase" clause and use the default collation sequence +# the "COLLATE nocase" clause and use the default collation sequence # for column "foldername" instead (happens to be BINARY in this case). # do_test tkt2391.4 { diff --git a/third_party/sqlite/src/test/tkt2565.test b/third_party/sqlite/src/test/tkt2565.test index 8df0419c65abd..4dc331fd31262 100644 --- a/third_party/sqlite/src/test/tkt2565.test +++ b/third_party/sqlite/src/test/tkt2565.test @@ -51,7 +51,7 @@ for {set iFail 1} {$iFail<200} {incr iFail} { reopen_database execsql { pragma locking_mode=exclusive } set nRow [db one {SELECT count(*) FROM a}] - + # Dirty (at least) one of the pages in the cache. do_test tkt2565-1.$iFail.1 { execsql { @@ -59,7 +59,7 @@ for {set iFail 1} {$iFail<200} {incr iFail} { INSERT INTO a VALUES(1, 'ABCDEFGHIJKLMNOP'); } } {} - + # Now try to commit the transaction. Cause an IO error to occur # within this operation, which moves the pager into the error state. # diff --git a/third_party/sqlite/src/test/tkt2640.test b/third_party/sqlite/src/test/tkt2640.test index 13a17e095ebbf..1a0695506f43d 100644 --- a/third_party/sqlite/src/test/tkt2640.test +++ b/third_party/sqlite/src/test/tkt2640.test @@ -14,7 +14,7 @@ # $Id: tkt2640.test,v 1.3 2008/08/04 03:51:24 danielk1977 Exp $ # -# The problem in ticket #2640 was that the query optimizer was +# The problem in ticket #2640 was that the query optimizer was # not recognizing all uses of tables within subqueries in the # WHERE clause. If the subquery contained a compound SELECT, # then tables that were used by terms of the compound other than diff --git a/third_party/sqlite/src/test/tkt2686.test b/third_party/sqlite/src/test/tkt2686.test index 20447bbaed0d0..9bf862531bca4 100644 --- a/third_party/sqlite/src/test/tkt2686.test +++ b/third_party/sqlite/src/test/tkt2686.test @@ -40,7 +40,7 @@ for {set i 1} {$i<2000} {incr i} { } {1 {database or disk is full}} do_test tkt2686-$i.2 { execsql { - DELETE FROM filler + DELETE FROM filler WHERE rowid <= (SELECT MAX(rowid) FROM filler LIMIT 20) } } {} @@ -70,7 +70,7 @@ for {set i 10000} {$i<12000} {incr i} { } {1 {database or disk is full}} do_test tkt2686-$i.2 { execsql { - DELETE FROM filler + DELETE FROM filler WHERE rowid <= (SELECT MAX(rowid) FROM filler LIMIT 20) } } {} diff --git a/third_party/sqlite/src/test/tkt2817.test b/third_party/sqlite/src/test/tkt2817.test index 579cf2f7ba62f..5cd514ca4abd8 100644 --- a/third_party/sqlite/src/test/tkt2817.test +++ b/third_party/sqlite/src/test/tkt2817.test @@ -1,4 +1,4 @@ -# 2007 December 02 +# 2007 December 02 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: @@ -26,7 +26,7 @@ do_test tkt2817-1.0 { } {} do_test tkt2817-1.1 { execsql { - CREATE TABLE main.tbl(a, b, c); + CREATE TABLE main.tbl(a, b, c); CREATE INDEX main.tbli ON tbl(a, b, c); INSERT INTO main.tbl SELECT a, b, c FROM temp.tbl; } @@ -59,7 +59,7 @@ do_test tkt2817-2.0 { } {} do_test tkt2817-2.1 { execsql { - CREATE TABLE main.tbl(a, b, c); + CREATE TABLE main.tbl(a, b, c); CREATE INDEX main.tbli ON tbl(a, b, c); INSERT INTO main.tbl SELECT a, b, c FROM temp.tmp; } diff --git a/third_party/sqlite/src/test/tkt2820.test b/third_party/sqlite/src/test/tkt2820.test index 11c4cd3a0f04b..fa7476a1b76cd 100644 --- a/third_party/sqlite/src/test/tkt2820.test +++ b/third_party/sqlite/src/test/tkt2820.test @@ -14,7 +14,7 @@ # occurs while a query is in process will fail with a # "database is locked" error, but the entry in the sqlite_master # table will still be removed. This is incorrect. The -# entry in the sqlite_master table should persist when +# entry in the sqlite_master table should persist when # the DROP fails due to an error. # # $Id: tkt2820.test,v 1.1 2007/12/04 16:54:53 drh Exp $ diff --git a/third_party/sqlite/src/test/tkt2822.test b/third_party/sqlite/src/test/tkt2822.test index d0b16338c6b84..5962ad2cc2b7d 100644 --- a/third_party/sqlite/src/test/tkt2822.test +++ b/third_party/sqlite/src/test/tkt2822.test @@ -25,17 +25,17 @@ ifcapable !compound { } # The ORDER BY matching algorithm is three steps: -# +# # (1) If the ORDER BY term is an integer constant i, then # sort by the i-th column of the result set. -# +# # (2) If the ORDER BY term is an identifier (not x.y or x.y.z # but simply x) then look for a column alias with the same # name. If found, then sort by that column. -# +# # (3) Evaluate the term as an expression and sort by the # value of the expression. -# +# # For a compound SELECT the rules are modified slightly. # In the third rule, the expression must exactly match one # of the result columns. The sequences of three rules is @@ -51,7 +51,7 @@ ifcapable !compound { # # Rule (2) was added by the changes ticket #2822. Prior to # that changes, SQLite did not support rule (2), making it -# technically in violation of standard SQL semantics. +# technically in violation of standard SQL semantics. # No body noticed because rule (3) has the same effect as # rule (2) except in some obscure cases. # @@ -86,9 +86,9 @@ do_test tkt2822-1.1 { } {1 3 9 2 6 18 3 9 27 4 12 36 5 15 45 6 18 54} do_test tkt2822-1.2 { execsql { - SELECT a, CAST (b AS TEXT), c FROM t1 - UNION ALL - SELECT a, b, c FROM t2 + SELECT a, CAST (b AS TEXT), c FROM t1 + UNION ALL + SELECT a, b, c FROM t2 ORDER BY 2; } } {2 6 18 4 12 36 6 18 54 5 15 45 1 3 9 3 9 27} @@ -103,9 +103,9 @@ do_test tkt2822-2.1 { do_test tkt2822-2.2 { execsql { - SELECT a, CAST (b AS TEXT) AS x, c FROM t1 - UNION ALL - SELECT a, b, c FROM t2 + SELECT a, CAST (b AS TEXT) AS x, c FROM t1 + UNION ALL + SELECT a, b, c FROM t2 ORDER BY x; } } {2 6 18 4 12 36 6 18 54 5 15 45 1 3 9 3 9 27} @@ -119,9 +119,9 @@ do_test tkt2822-2.3 { # do_test tkt2822-3.1 { execsql { - SELECT a, CAST (b AS TEXT) AS x, c FROM t1 - UNION ALL - SELECT a, b, c FROM t2 + SELECT a, CAST (b AS TEXT) AS x, c FROM t1 + UNION ALL + SELECT a, b, c FROM t2 ORDER BY CAST (b AS TEXT); } } {2 6 18 4 12 36 6 18 54 5 15 45 1 3 9 3 9 27} @@ -142,17 +142,17 @@ do_test tkt2822-3.3 { do_test tkt2822-3.4 { # But the leftmost SELECT takes precedence. execsql { - SELECT a AS b, CAST (b AS TEXT) AS a, c FROM t1 - UNION ALL - SELECT a, b, c FROM t2 + SELECT a AS b, CAST (b AS TEXT) AS a, c FROM t1 + UNION ALL + SELECT a, b, c FROM t2 ORDER BY a; } } {2 6 18 4 12 36 6 18 54 5 15 45 1 3 9 3 9 27} do_test tkt2822-3.5 { execsql { - SELECT a, b, c FROM t2 - UNION ALL - SELECT a AS b, CAST (b AS TEXT) AS a, c FROM t1 + SELECT a, b, c FROM t2 + UNION ALL + SELECT a AS b, CAST (b AS TEXT) AS a, c FROM t1 ORDER BY a; } } {1 3 9 2 6 18 3 9 27 4 12 36 5 15 45 6 18 54} @@ -166,9 +166,9 @@ do_test tkt2822-4.1 { } {1 {1st ORDER BY term does not match any column in the result set}} do_test tkt2822-4.2 { catchsql { - SELECT a, CAST (b AS TEXT) AS x, c FROM t1 - UNION ALL - SELECT a, b, c FROM t2 + SELECT a, CAST (b AS TEXT) AS x, c FROM t1 + UNION ALL + SELECT a, b, c FROM t2 ORDER BY CAST (b AS INTEGER); } } {1 {1st ORDER BY term does not match any column in the result set}} @@ -176,7 +176,7 @@ do_test tkt2822-4.2 { # Tests for rule (2). # # The "ORDER BY b" should match the column alias (rule 2), not the -# the t3.b value (rule 3). +# the t3.b value (rule 3). # do_test tkt2822-5.1 { execsql { @@ -208,7 +208,7 @@ do_test tkt2822-5.4 { # In "ORDER BY +b" the term is now an expression rather than # a label. It therefore matches by rule (3) instead of rule (2). -# +# do_test tkt2822-5.5 { execsql { SELECT a AS b FROM t3 ORDER BY +b; diff --git a/third_party/sqlite/src/test/tkt2832.test b/third_party/sqlite/src/test/tkt2832.test index f9986990069b3..993b411f64c95 100644 --- a/third_party/sqlite/src/test/tkt2832.test +++ b/third_party/sqlite/src/test/tkt2832.test @@ -45,8 +45,8 @@ do_test tkt2832-2.1 { } } {} do_test tkt2832-2.2 { - execsql { - UPDATE t2 SET b = 5 + execsql { + UPDATE t2 SET b = 5 } } {} diff --git a/third_party/sqlite/src/test/tkt2854.test b/third_party/sqlite/src/test/tkt2854.test index 914ddd1b697c9..5e1d6a8d3821c 100644 --- a/third_party/sqlite/src/test/tkt2854.test +++ b/third_party/sqlite/src/test/tkt2854.test @@ -29,9 +29,9 @@ do_test tkt2854-1.1 { sqlite3 db test.db sqlite3 db2 test.db - # This is taken from shared.test. The Windows VFS expands + # This is taken from shared.test. The Windows VFS expands # ./test.db (and test.db) to be the same thing so the path - # matches and they share a cache. By changing the case + # matches and they share a cache. By changing the case # for Windows platform, we get around this and get a separate # connection. if {$::tcl_platform(platform)=="unix"} { @@ -45,11 +45,11 @@ do_test tkt2854-1.1 { } } {} -# Check that an exclusive lock cannot be obtained if some other +# Check that an exclusive lock cannot be obtained if some other # shared-cache connection has a read-lock on a table. # do_test tkt2854-1.2 { - execsql { + execsql { BEGIN; SELECT * FROM abc; } db2 diff --git a/third_party/sqlite/src/test/tkt2927.test b/third_party/sqlite/src/test/tkt2927.test index fc89a415389e0..55663c55cacbf 100644 --- a/third_party/sqlite/src/test/tkt2927.test +++ b/third_party/sqlite/src/test/tkt2927.test @@ -155,7 +155,7 @@ do_test tkt2927-2.16 { do_test tkt2927-3.1 { db eval { SELECT a, b FROM t1 - UNION + UNION SELECT a, b FROM t1 ORDER BY 1 } @@ -163,7 +163,7 @@ do_test tkt2927-3.1 { do_test tkt2927-3.2 { db eval { SELECT a, b FROM t1 - UNION + UNION SELECT a, abs(b) FROM t1 ORDER BY 1 } @@ -171,7 +171,7 @@ do_test tkt2927-3.2 { do_test tkt2927-3.3 { db eval { SELECT a, b FROM t1 - UNION + UNION SELECT abs(a), b FROM t1 ORDER BY 1 } @@ -179,7 +179,7 @@ do_test tkt2927-3.3 { do_test tkt2927-3.4 { db eval { SELECT a, b FROM t1 - UNION + UNION SELECT abs(a), abs(b) FROM t1 ORDER BY 1 } @@ -187,7 +187,7 @@ do_test tkt2927-3.4 { do_test tkt2927-3.5 { db eval { SELECT a, abs(b) FROM t1 - UNION + UNION SELECT a, b FROM t1 ORDER BY 1 } @@ -195,7 +195,7 @@ do_test tkt2927-3.5 { do_test tkt2927-3.6 { db eval { SELECT a, abs(b) FROM t1 - UNION + UNION SELECT a, abs(b) FROM t1 ORDER BY 1 } @@ -203,7 +203,7 @@ do_test tkt2927-3.6 { do_test tkt2927-3.7 { db eval { SELECT a, abs(b) FROM t1 - UNION + UNION SELECT abs(a), b FROM t1 ORDER BY 1 } @@ -211,7 +211,7 @@ do_test tkt2927-3.7 { do_test tkt2927-3.8 { db eval { SELECT a, abs(b) FROM t1 - UNION + UNION SELECT abs(a), abs(b) FROM t1 ORDER BY 1 } @@ -219,7 +219,7 @@ do_test tkt2927-3.8 { do_test tkt2927-3.9 { db eval { SELECT abs(a), b FROM t1 - UNION + UNION SELECT a, b FROM t1 ORDER BY 1 } @@ -227,7 +227,7 @@ do_test tkt2927-3.9 { do_test tkt2927-3.10 { db eval { SELECT abs(a), b FROM t1 - UNION + UNION SELECT a, abs(b) FROM t1 ORDER BY 1 } @@ -235,7 +235,7 @@ do_test tkt2927-3.10 { do_test tkt2927-3.11 { db eval { SELECT abs(a), b FROM t1 - UNION + UNION SELECT abs(a), b FROM t1 ORDER BY 1 } @@ -243,7 +243,7 @@ do_test tkt2927-3.11 { do_test tkt2927-3.12 { db eval { SELECT abs(a), b FROM t1 - UNION + UNION SELECT abs(a), abs(b) FROM t1 ORDER BY 1 } @@ -251,7 +251,7 @@ do_test tkt2927-3.12 { do_test tkt2927-3.13 { db eval { SELECT abs(a), abs(b) FROM t1 - UNION + UNION SELECT a, b FROM t1 ORDER BY 1 } @@ -259,7 +259,7 @@ do_test tkt2927-3.13 { do_test tkt2927-3.14 { db eval { SELECT abs(a), abs(b) FROM t1 - UNION + UNION SELECT a, abs(b) FROM t1 ORDER BY 1 } @@ -267,7 +267,7 @@ do_test tkt2927-3.14 { do_test tkt2927-3.15 { db eval { SELECT abs(a), abs(b) FROM t1 - UNION + UNION SELECT abs(a), b FROM t1 ORDER BY 1 } @@ -275,7 +275,7 @@ do_test tkt2927-3.15 { do_test tkt2927-3.16 { db eval { SELECT abs(a), abs(b) FROM t1 - UNION + UNION SELECT abs(a), abs(b) FROM t1 ORDER BY 1 } diff --git a/third_party/sqlite/src/test/tkt2942.test b/third_party/sqlite/src/test/tkt2942.test index a7b861c75cd16..4c932781567d6 100644 --- a/third_party/sqlite/src/test/tkt2942.test +++ b/third_party/sqlite/src/test/tkt2942.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# Ticket #2942. +# Ticket #2942. # # Queries of the form: # diff --git a/third_party/sqlite/src/test/tkt3080.test b/third_party/sqlite/src/test/tkt3080.test index bfccaa9b84b17..4838fc5e0656b 100644 --- a/third_party/sqlite/src/test/tkt3080.test +++ b/third_party/sqlite/src/test/tkt3080.test @@ -71,7 +71,7 @@ ifcapable vtab { execsql {SELECT * FROM t2} } {123} } - + finish_test diff --git a/third_party/sqlite/src/test/tkt3201.test b/third_party/sqlite/src/test/tkt3201.test index 47c5ebb5fd6fb..7b2d5e9d749d1 100644 --- a/third_party/sqlite/src/test/tkt3201.test +++ b/third_party/sqlite/src/test/tkt3201.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # Specifically, it tests that bug #3201 has been fixed. # # $Id: tkt3201.test,v 1.3 2008/07/12 14:52:21 drh Exp $ diff --git a/third_party/sqlite/src/test/tkt3292.test b/third_party/sqlite/src/test/tkt3292.test index 0f9524464390b..7d874f2a62de9 100644 --- a/third_party/sqlite/src/test/tkt3292.test +++ b/third_party/sqlite/src/test/tkt3292.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # Specifically, it tests the behavior of the sqlite3VdbeRecordCompare() # routine in cases where the rowid is 0 or 1 in file format 4 # (meaning that the rowid has type code 8 or 9 with zero bytes of diff --git a/third_party/sqlite/src/test/tkt3298.test b/third_party/sqlite/src/test/tkt3298.test index 0e546f7e69641..93da647df94e1 100644 --- a/third_party/sqlite/src/test/tkt3298.test +++ b/third_party/sqlite/src/test/tkt3298.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This file tests changes to the name resolution logic that occurred # in august of 2008 and where associated with tickets #3298 and #3301 # diff --git a/third_party/sqlite/src/test/tkt3334.test b/third_party/sqlite/src/test/tkt3334.test index 5473ab4cf8f29..ecaee892016e3 100644 --- a/third_party/sqlite/src/test/tkt3334.test +++ b/third_party/sqlite/src/test/tkt3334.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # Specifically, it tests that bug #3334 has been fixed by the # addition of restriction (19) to the subquery flattener optimization. # diff --git a/third_party/sqlite/src/test/tkt3346.test b/third_party/sqlite/src/test/tkt3346.test index 806e5e9c70b0e..10b291c3b9e49 100644 --- a/third_party/sqlite/src/test/tkt3346.test +++ b/third_party/sqlite/src/test/tkt3346.test @@ -59,7 +59,7 @@ do_test tkt3346-2.1 { catchsql { CREATE TABLE t2(a); INSERT INTO t2 VALUES(1); - + SELECT * FROM (SELECT * FROM t1 WHERE 1=x.a) AS x; } } {1 {no such column: x.a}} diff --git a/third_party/sqlite/src/test/tkt3357.test b/third_party/sqlite/src/test/tkt3357.test index c3e2a2bc92bdd..3031dbca70d54 100644 --- a/third_party/sqlite/src/test/tkt3357.test +++ b/third_party/sqlite/src/test/tkt3357.test @@ -30,7 +30,7 @@ do_test tkt3357-1.1 { do_test tkt3357-1.2 { execsql { - SELECT cc.id, cc.b_id, cc.myvalue, dd.bvalue + SELECT cc.id, cc.b_id, cc.myvalue, dd.bvalue FROM ( SELECT DISTINCT a.id, a.b_id, a.myvalue FROM a INNER JOIN b ON a.b_id = b.id WHERE b.bvalue = 'btest' @@ -43,7 +43,7 @@ do_test tkt3357-1.3 { execsql { SELECT cc.id, cc.b_id, cc.myvalue FROM ( - SELECT a.id, a.b_id, a.myvalue + SELECT a.id, a.b_id, a.myvalue FROM a, b WHERE a.b_id = b.id ) cc LEFT OUTER JOIN b dd ON cc.b_id = dd.id @@ -54,7 +54,7 @@ do_test tkt3357-1.4 { execsql { SELECT cc.id, cc.b_id, cc.myvalue FROM ( - SELECT DISTINCT a.id, a.b_id, a.myvalue + SELECT DISTINCT a.id, a.b_id, a.myvalue FROM a, b WHERE a.b_id = b.id ) cc LEFT OUTER JOIN b dd ON cc.b_id = dd.id diff --git a/third_party/sqlite/src/test/tkt3419.test b/third_party/sqlite/src/test/tkt3419.test index 4cfd02357c58f..ff2da30481e0d 100644 --- a/third_party/sqlite/src/test/tkt3419.test +++ b/third_party/sqlite/src/test/tkt3419.test @@ -25,22 +25,22 @@ do_test tkt3419-1.1 { create table a(id integer primary key); create table b(id integer primary key, a_id integer); create table c(id integer primary key, b_id integer); - + insert into a values (1); insert into a values (2); - + insert into b values (3, 1); insert into b values (4, 1); insert into b values (5, 1); insert into b values (6, 1); insert into b values (9, 2); - + insert into c values (4, 3); insert into c values (5, 5); insert into c values (6, 4); insert into c values (7, 6); insert into c values (8, 9); - + select * FROM a, b, c WHERE a.id=2 AND b.a_id = a.id AND b.id=c.b_id; } } {2 9 2 8 9} diff --git a/third_party/sqlite/src/test/tkt3424.test b/third_party/sqlite/src/test/tkt3424.test index f38fa5aafa4b7..c40e3667b70cd 100644 --- a/third_party/sqlite/src/test/tkt3424.test +++ b/third_party/sqlite/src/test/tkt3424.test @@ -32,7 +32,7 @@ do_test tkt3424-1.1 { do_test tkt3424-1.2 { execsql { - SELECT * FROM + SELECT * FROM names LEFT OUTER JOIN orig ON names.data = orig.data AND names.code = orig.code; } @@ -44,7 +44,7 @@ do_test tkt3424-1.3 { do_test tkt3424-1.4 { execsql { - SELECT * FROM + SELECT * FROM names LEFT OUTER JOIN orig ON names.data = orig.data AND names.code = orig.code; } diff --git a/third_party/sqlite/src/test/tkt3442.test b/third_party/sqlite/src/test/tkt3442.test index ee9169ce2c4f6..3bb5497ec002c 100644 --- a/third_party/sqlite/src/test/tkt3442.test +++ b/third_party/sqlite/src/test/tkt3442.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #3442 has been -# fixed. +# fixed. # # # $Id: tkt3442.test,v 1.2 2009/06/05 17:09:12 drh Exp $ @@ -42,8 +42,8 @@ proc EQP {sql} { } -# These tests perform an EXPLAIN QUERY PLAN on both versions of the -# SELECT referenced in ticket #3442 (both '5000' and "5000") +# These tests perform an EXPLAIN QUERY PLAN on both versions of the +# SELECT referenced in ticket #3442 (both '5000' and "5000") # and verify that the query plan is the same. # ifcapable explain { diff --git a/third_party/sqlite/src/test/tkt3457.test b/third_party/sqlite/src/test/tkt3457.test index 04757413221c1..c5c10b67bbfa8 100644 --- a/third_party/sqlite/src/test/tkt3457.test +++ b/third_party/sqlite/src/test/tkt3457.test @@ -21,23 +21,23 @@ if {$tcl_platform(platform) != "unix"} { } #----------------------------------------------------------------------- -# To roll back a hot-journal file, the application needs read and write +# To roll back a hot-journal file, the application needs read and write # permission on the journal file in question. The following tests test # the outcome of trying to rollback a hot-journal file when this is not # the case. -# +# # tkt3457-1.2: Application has neither read, nor write permission on # the hot-journal file. Result: SQLITE_CANTOPEN. -# +# # tkt3457-1.3: Application has write but not read permission on # the hot-journal file. Result: SQLITE_CANTOPEN. # # tkt3457-1.4: Application has read but not write permission on # the hot-journal file. Result: SQLITE_CANTOPEN. # -# tkt3457-1.5: Application has read/write permission on the hot-journal +# tkt3457-1.5: Application has read/write permission on the hot-journal # file. Result: SQLITE_OK. -# +# do_test tkt3457-1.1 { execsql { CREATE TABLE t1(a, b, c); diff --git a/third_party/sqlite/src/test/tkt3461.test b/third_party/sqlite/src/test/tkt3461.test index 642980be09435..cd5001ffd7307 100644 --- a/third_party/sqlite/src/test/tkt3461.test +++ b/third_party/sqlite/src/test/tkt3461.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #3461 has been -# fixed. +# fixed. # # $Id: tkt3461.test,v 1.4 2009/06/05 17:09:12 drh Exp $ @@ -44,10 +44,10 @@ do_test tkt3461-1.3 { } {1 3} do_test tkt3461-2.1 { - execsql { - SELECT a, b+1 AS b_plus_one - FROM t1 - WHERE CASE WHEN a=1 THEN 1 ELSE b_plus_one END + execsql { + SELECT a, b+1 AS b_plus_one + FROM t1 + WHERE CASE WHEN a=1 THEN 1 ELSE b_plus_one END } } {1 3} @@ -57,9 +57,9 @@ do_test tkt3461-3.1 { INSERT INTO t2 VALUES(3, 4); } # execsql { PRAGMA vdbe_trace = 1; PRAGMA vdbe_listing=1 } - execsql { - SELECT a, b+1 AS b_plus_one, c, d - FROM t1 LEFT JOIN t2 + execsql { + SELECT a, b+1 AS b_plus_one, c, d + FROM t1 LEFT JOIN t2 ON (a=c AND d=b_plus_one) } } {1 3 {} {}} diff --git a/third_party/sqlite/src/test/tkt3493.test b/third_party/sqlite/src/test/tkt3493.test index 8fe91ddd209b4..0dd8375525073 100644 --- a/third_party/sqlite/src/test/tkt3493.test +++ b/third_party/sqlite/src/test/tkt3493.test @@ -34,13 +34,13 @@ do_test tkt3493-1.1 { } {} do_test tkt3493-1.2 { execsql { - SELECT - CASE - WHEN B.val = 1 THEN 'XYZ' - ELSE A.val + SELECT + CASE + WHEN B.val = 1 THEN 'XYZ' + ELSE A.val END AS Col1 - FROM B - LEFT OUTER JOIN A_B ON B.id = A_B.B_id + FROM B + LEFT OUTER JOIN A_B ON B.id = A_B.B_id LEFT OUTER JOIN A ON A.id = A_B.A_id ORDER BY Col1 ASC; } @@ -48,12 +48,12 @@ do_test tkt3493-1.2 { do_test tkt3493-1.3 { execsql { SELECT DISTINCT - CASE - WHEN B.val = 1 THEN 'XYZ' - ELSE A.val + CASE + WHEN B.val = 1 THEN 'XYZ' + ELSE A.val END AS Col1 - FROM B - LEFT OUTER JOIN A_B ON B.id = A_B.B_id + FROM B + LEFT OUTER JOIN A_B ON B.id = A_B.B_id LEFT OUTER JOIN A ON A.id = A_B.A_id ORDER BY Col1 ASC; } @@ -65,17 +65,17 @@ do_test tkt3493-1.4 { } {1 xyz 2 2} do_test tkt3493-1.5 { execsql { - SELECT DISTINCT - b.val, - CASE WHEN b.val = 1 THEN 'xyz' ELSE b.val END AS col1 + SELECT DISTINCT + b.val, + CASE WHEN b.val = 1 THEN 'xyz' ELSE b.val END AS col1 FROM b; } } {1 xyz 2 2} do_test tkt3493-1.6 { execsql { - SELECT DISTINCT - b.val, - CASE WHEN b.val = '1' THEN 'xyz' ELSE b.val END AS col1 + SELECT DISTINCT + b.val, + CASE WHEN b.val = '1' THEN 'xyz' ELSE b.val END AS col1 FROM b; } } {1 xyz 2 2} diff --git a/third_party/sqlite/src/test/tkt3508.test b/third_party/sqlite/src/test/tkt3508.test index 8275d69987378..a05a5eebe1a4d 100644 --- a/third_party/sqlite/src/test/tkt3508.test +++ b/third_party/sqlite/src/test/tkt3508.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # # $Id: tkt3508.test,v 1.5 2009/05/28 01:00:56 drh Exp $ diff --git a/third_party/sqlite/src/test/tkt3527.test b/third_party/sqlite/src/test/tkt3527.test index da3d05ac46cf1..80b29c808e67f 100644 --- a/third_party/sqlite/src/test/tkt3527.test +++ b/third_party/sqlite/src/test/tkt3527.test @@ -29,13 +29,13 @@ do_test tkt3527-1.1 { Code INTEGER PRIMARY KEY, Name VARCHAR(60) ); - + CREATE TABLE ElemOr ( CodeOr INTEGER NOT NULL, Code INTEGER NOT NULL, PRIMARY KEY(CodeOr,Code) ); - + CREATE TABLE ElemAnd ( CodeAnd INTEGER, Code INTEGER, @@ -44,7 +44,7 @@ do_test tkt3527-1.1 { Attr3 INTEGER, PRIMARY KEY(CodeAnd,Code) ); - + INSERT INTO Element VALUES(1,'Elem1'); INSERT INTO Element VALUES(2,'Elem2'); INSERT INTO Element VALUES(3,'Elem3'); @@ -54,7 +54,7 @@ do_test tkt3527-1.1 { INSERT INTO ElemOr Values(3,5); INSERT INTO ElemAnd VALUES(1,3,'a','b','c'); INSERT INTO ElemAnd VALUES(1,2,'x','y','z'); - + CREATE VIEW ElemView1 AS SELECT CAST(Element.Code AS VARCHAR(50)) AS ElemId, @@ -81,7 +81,7 @@ do_test tkt3527-1.1 { 1 AS IsOrElem FROM ElemOr JOIN Element ON Element.Code=ElemOr.CodeOr ORDER BY ElemId, InnerCode; - + CREATE VIEW ElemView2 AS SELECT ElemId, @@ -109,11 +109,11 @@ do_test tkt3527-1.1 { JOIN ElemView1 AS InnerElem ON Element.Level=0 AND Element.InnerCode=InnerElem.ElemCode ORDER BY ElemId, InnerCode; - + SELECT * FROM ElemView1; } } {1 1 Elem1 2 x y z 0 0 1 1 Elem1 3 a b c 0 0 3 3 Elem3 4 {} {} {} 0 1 3 3 Elem3 5 {} {} {} 0 1} - + do_test tkt3527-1.2 { db eval { SELECT * FROM ElemView2; diff --git a/third_party/sqlite/src/test/tkt3554.test b/third_party/sqlite/src/test/tkt3554.test index a059486d64034..2633aaec02398 100644 --- a/third_party/sqlite/src/test/tkt3554.test +++ b/third_party/sqlite/src/test/tkt3554.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #3554 has been -# fixed. +# fixed. # # $Id: tkt3554.test,v 1.2 2009/06/05 17:09:12 drh Exp $ @@ -26,16 +26,16 @@ ifcapable !trigger { do_test tkt3544-1.1 { execsql { CREATE TABLE test ( obj, t1, t2, PRIMARY KEY(obj, t1, t2) ); - + CREATE TRIGGER test_insert BEFORE INSERT ON test BEGIN - UPDATE test SET t1 = new.t1 + UPDATE test SET t1 = new.t1 WHERE obj = new.obj AND new.t1 < t1 AND new.t2 >= t1; - - UPDATE test SET t2 = new.t2 + + UPDATE test SET t2 = new.t2 WHERE obj = new.obj AND new.t2 > t2 AND new.t1 <= t2; - + SELECT RAISE(IGNORE) WHERE EXISTS ( - SELECT obj FROM test + SELECT obj FROM test WHERE obj = new.obj AND new.t1 >= t1 AND new.t2 <= t2 ); END; diff --git a/third_party/sqlite/src/test/tkt3581.test b/third_party/sqlite/src/test/tkt3581.test index e9b18fd9f496c..5dec27125d8b7 100644 --- a/third_party/sqlite/src/test/tkt3581.test +++ b/third_party/sqlite/src/test/tkt3581.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #3581 has been -# fixed. +# fixed. # # $Id: tkt3581.test,v 1.1 2009/01/14 01:10:40 drh Exp $ diff --git a/third_party/sqlite/src/test/tkt35xx.test b/third_party/sqlite/src/test/tkt35xx.test index 3b911c12472a6..f932c1ef05783 100644 --- a/third_party/sqlite/src/test/tkt35xx.test +++ b/third_party/sqlite/src/test/tkt35xx.test @@ -89,7 +89,7 @@ do_test tkt35xx-1.2.5 { # would be committed. But, the "SELECT count(*)" in tkt35xx-1.2.6 would # return 1, not 5. Data magically disappeared! # - execsql { + execsql { INSERT INTO t3 VALUES(5, $big); COMMIT; } diff --git a/third_party/sqlite/src/test/tkt3630.test b/third_party/sqlite/src/test/tkt3630.test index 1fe7ce70fa5f7..8085a29b8b34f 100644 --- a/third_party/sqlite/src/test/tkt3630.test +++ b/third_party/sqlite/src/test/tkt3630.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #************************************************************************* -# +# # This file checks to make sure the "TEMP" or "TEMPORARY" keyword is # omitted from the schema of a table that is created using that # keyword. Ticket #3630. diff --git a/third_party/sqlite/src/test/tkt3718.test b/third_party/sqlite/src/test/tkt3718.test index e5eb247481310..5f9b1ccd8cbb6 100644 --- a/third_party/sqlite/src/test/tkt3718.test +++ b/third_party/sqlite/src/test/tkt3718.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the execution of SQL statements from -# within callbacks generated by VMs that themselves open statement +# within callbacks generated by VMs that themselves open statement # transactions. # # $Id: tkt3718.test,v 1.2 2009/06/05 17:09:12 drh Exp $ @@ -64,7 +64,7 @@ db func f2 f2 # half-way through the INSERT operation f1() will run an SQL statement # that throws an exception. At one point, before #3718 was fixed, this # caused the statement transaction belonging to the INSERT statement to -# be rolled back. The result was that some (but not all) of the rows that +# be rolled back. The result was that some (but not all) of the rows that # should have been inserted went missing. # do_test tkt3718-1.2 { @@ -87,10 +87,10 @@ do_test tkt3718-1.2 { # exception is run. At one point, before #3718 was fixed, this caused the # statement transaction belonging to the INSERT statement to be rolled back. # The result was that none of the rows were actually inserted. -# +# # do_test tkt3718-1.3 { - execsql { + execsql { DELETE FROM t2 WHERE a > 5; PRAGMA count_changes = 1; BEGIN; @@ -116,8 +116,8 @@ proc sql {doit zSql} { } db func sql [list sql] -# The following tests, tkt3718-2.*, test that a nested statement -# transaction can be successfully committed or reverted without +# The following tests, tkt3718-2.*, test that a nested statement +# transaction can be successfully committed or reverted without # affecting the parent statement transaction. # do_test tkt3718-2.1 { @@ -161,7 +161,7 @@ foreach {tn io ii results} { 4 1 11 {6 7 8 9 10 16 17 18 19 20} } { do_test tkt3718-3.$tn { - execsql { + execsql { DELETE FROM t2; INSERT INTO t2 SELECT a+5, b FROM t1; INSERT INTO t2 SELECT a+15, b FROM t1; @@ -195,7 +195,7 @@ foreach {tn i1 i2 i3 results} { 8 1 11 21 {10 20 30} } { do_test tkt3718-4.$tn { - execsql { + execsql { DELETE FROM t2; INSERT INTO t2 SELECT a+5, b FROM t1; INSERT INTO t2 SELECT a+15, b FROM t1; @@ -205,7 +205,7 @@ foreach {tn i1 i2 i3 results} { catchsql " BEGIN; INSERT INTO t2 SELECT a+$i1, sql(a==3, - 'INSERT INTO t2 SELECT a+$i2, sql(a==3, + 'INSERT INTO t2 SELECT a+$i2, sql(a==3, ''INSERT INTO t2 SELECT a+$i3, b FROM t1'' ) FROM t1' ) FROM t1; @@ -218,7 +218,7 @@ foreach {tn i1 i2 i3 results} { do_test tkt3718-4.$tn.extra { execsql { - SELECT + SELECT (SELECT sum(a) FROM t2)==(SELECT sum(a*5-10) FROM t2 WHERE (a%5)==0) } } {1} diff --git a/third_party/sqlite/src/test/tkt3731.test b/third_party/sqlite/src/test/tkt3731.test index 11e5efd707e66..cc70b6281d407 100644 --- a/third_party/sqlite/src/test/tkt3731.test +++ b/third_party/sqlite/src/test/tkt3731.test @@ -21,7 +21,7 @@ ifcapable {!trigger} { # The tests in this file were written before SQLite supported recursive # trigger invocation, and some tests depend on that to pass. So disable # recursive triggers for this file. -catchsql { pragma recursive_triggers = off } +catchsql { pragma recursive_triggers = off } do_test tkt3731-1.1 { execsql { diff --git a/third_party/sqlite/src/test/tkt3762.test b/third_party/sqlite/src/test/tkt3762.test index 424b1e6487554..ef78b14cf3cb1 100644 --- a/third_party/sqlite/src/test/tkt3762.test +++ b/third_party/sqlite/src/test/tkt3762.test @@ -39,7 +39,7 @@ do_test tkt3762-1.1 { INSERT INTO t1 SELECT x FROM t1; DELETE FROM t1 WHERE rowid>202; VACUUM; - + BEGIN; DELETE FROM t1 WHERE rowid IN (10,11,12) ; PRAGMA incremental_vacuum(10); diff --git a/third_party/sqlite/src/test/tkt3793.test b/third_party/sqlite/src/test/tkt3793.test index 074aab2df0a7a..839aa5a2797c8 100644 --- a/third_party/sqlite/src/test/tkt3793.test +++ b/third_party/sqlite/src/test/tkt3793.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #3793 has been -# fixed. +# fixed. # # $Id: tkt3793.test,v 1.2 2009/06/01 16:42:18 shane Exp $ @@ -26,9 +26,9 @@ ifcapable !shared_cache||!attach { set ::enable_shared_cache [sqlite3_enable_shared_cache 1] do_test tkt3793-1.1 { - # This is taken from shared.test. The Windows VFS expands + # This is taken from shared.test. The Windows VFS expands # ./test.db (and test.db) to be the same thing so the path - # matches and they share a cache. By changing the case + # matches and they share a cache. By changing the case # for Windows platform, we get around this and get a separate # connection. if {$::tcl_platform(platform)=="unix"} { @@ -74,7 +74,7 @@ do_test tkt3793-1.2 { # Set the size of the cache shared by [db1] and [db2] to 10. Then update # more than 10 pages of table t1. At this point the shared-cache will # hold a RESERVED lock on the database file. Even though there are now -# more than 10 dirty pages in memory, it cannot upgrade to an EXCLUSIVE +# more than 10 dirty pages in memory, it cannot upgrade to an EXCLUSIVE # lock because of the read-lock held by [db]. # do_test tkt3793-1.3 { @@ -87,7 +87,7 @@ do_test tkt3793-1.3 { set x 0 -# Run one SELECT query on the shared-cache using [db1], then from within +# Run one SELECT query on the shared-cache using [db1], then from within # the callback run another via [db2]. Because of the large number of dirty # pages within the cache, each time a new page is read from the database # SQLite will attempt to upgrade to an EXCLUSIVE lock, and hence invoke @@ -95,7 +95,7 @@ set x 0 # function is invoked (the busy-handler associated with the database # connection that called sqlite3_step()). When bug #3793 existed, sometimes # the [db2] busy-handler was invoked from within the call to sqlite3_step() -# associated with [db1]. +# associated with [db1]. # # Note: Before the bug was fixed, if [db2] was opened with the "-fullmutex 1" # option, then this test case would cause an assert() to fail. @@ -105,13 +105,13 @@ ifcapable threadsafe { db1 eval {SELECT * FROM t2 ORDER BY a LIMIT 20} { do_test tkt3793-2.[incr x] { set ::busyconnection } db1 set ::busyconnection db2 - + db2 eval { SELECT count(*) FROM t2 } do_test tkt3793-2.[incr x] { set ::busyconnection } db2 set ::busyconnection db1 } } - + do_test tkt3793-3 { db1 close db2 close diff --git a/third_party/sqlite/src/test/tkt3824.test b/third_party/sqlite/src/test/tkt3824.test index 3198abbdd3afb..86319ab33de84 100644 --- a/third_party/sqlite/src/test/tkt3824.test +++ b/third_party/sqlite/src/test/tkt3824.test @@ -1,4 +1,4 @@ -# 2009 April 24 +# 2009 April 24 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: diff --git a/third_party/sqlite/src/test/tkt3832.test b/third_party/sqlite/src/test/tkt3832.test index bb73c8c7d061a..4fea37a83d6d6 100644 --- a/third_party/sqlite/src/test/tkt3832.test +++ b/third_party/sqlite/src/test/tkt3832.test @@ -1,4 +1,4 @@ -# 2009 April 30 +# 2009 April 30 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: diff --git a/third_party/sqlite/src/test/tkt3841.test b/third_party/sqlite/src/test/tkt3841.test index df6de5c2f3972..03405c3040671 100644 --- a/third_party/sqlite/src/test/tkt3841.test +++ b/third_party/sqlite/src/test/tkt3841.test @@ -26,7 +26,7 @@ do_test tkt3841.1 { execsql { CREATE TABLE table2 (key TEXT, x TEXT); CREATE TABLE list (key TEXT, value TEXT); - + INSERT INTO table2 VALUES ("a", "alist"); INSERT INTO table2 VALUES ("b", "blist"); INSERT INTO list VALUES ("a", 1); diff --git a/third_party/sqlite/src/test/tkt3871.test b/third_party/sqlite/src/test/tkt3871.test index d587910d393a6..0ae4a0dc750ae 100644 --- a/third_party/sqlite/src/test/tkt3871.test +++ b/third_party/sqlite/src/test/tkt3871.test @@ -18,7 +18,7 @@ do_test tkt3871-1.1 { execsql { INSERT INTO t1 VALUES($i, $i*$i) } } execsql COMMIT - execsql { + execsql { CREATE VIRTUAL TABLE e USING echo(t1); SELECT count(*) FROM e; } diff --git a/third_party/sqlite/src/test/tkt3879.test b/third_party/sqlite/src/test/tkt3879.test index ed5577f909c86..5917e32edb96f 100644 --- a/third_party/sqlite/src/test/tkt3879.test +++ b/third_party/sqlite/src/test/tkt3879.test @@ -21,7 +21,7 @@ do_test tkt3879.1.1 { CREATE TABLE t1 (a PRIMARY KEY, b); INSERT INTO t1 VALUES ('w', 1); INSERT INTO t1 VALUES ('z', -1); - + CREATE TABLE t2 (m INTEGER PRIMARY KEY, n, a, p); INSERT INTO t2 VALUES (25, 13, 'w', 1); INSERT INTO t2 VALUES (26, 25, 'z', 153); diff --git a/third_party/sqlite/src/test/tkt3918.test b/third_party/sqlite/src/test/tkt3918.test index e20ee152fc17a..6caf7b9f7c3aa 100644 --- a/third_party/sqlite/src/test/tkt3918.test +++ b/third_party/sqlite/src/test/tkt3918.test @@ -49,7 +49,7 @@ do_test tkt3918.4 { execsql { PRAGMA incremental_vacuum = 1 } } {} -# Create another table. This operation will attempt to extract +# Create another table. This operation will attempt to extract # page 4 from the database free-list. Bug 3918 caused sqlite to # incorrectly report corruption here. do_test tkt3918.5 { diff --git a/third_party/sqlite/src/test/tkt3922.test b/third_party/sqlite/src/test/tkt3922.test index 86bf5feceb71f..f2ac293d67cc4 100644 --- a/third_party/sqlite/src/test/tkt3922.test +++ b/third_party/sqlite/src/test/tkt3922.test @@ -24,9 +24,9 @@ if {[working_64bit_int]} { } {-9223372036854775808 integer} } else { # this alternate version of tkt3922.1 doesn't - # really test the same thing as the original, - # but is needed to create the table and - # provided simply as a place holder for + # really test the same thing as the original, + # but is needed to create the table and + # provided simply as a place holder for # platforms without working 64bit support. do_test tkt3922.1 { execsql { @@ -67,8 +67,8 @@ if {[working_64bit_int]} { } {9223372036854775807 integer} } else { # this alternate version of tkt3922.5 doesn't - # really test the same thing as the original, - # but provided simply as a place holder for + # really test the same thing as the original, + # but provided simply as a place holder for # platforms without working 64bit support. do_test tkt3922.5 { execsql { diff --git a/third_party/sqlite/src/test/tkt3992.test b/third_party/sqlite/src/test/tkt3992.test index 0d8a30f94d738..68ec334dcc01f 100644 --- a/third_party/sqlite/src/test/tkt3992.test +++ b/third_party/sqlite/src/test/tkt3992.test @@ -70,7 +70,7 @@ ifcapable trigger { CREATE TRIGGER tr2 BEFORE UPDATE ON t2 BEGIN SELECT tcl('set res', typeof(new.c)); END; - + UPDATE t2 SET a = 'I'; } set res diff --git a/third_party/sqlite/src/test/tkt3997.test b/third_party/sqlite/src/test/tkt3997.test index 85e88db5913d6..fbeba2c175306 100644 --- a/third_party/sqlite/src/test/tkt3997.test +++ b/third_party/sqlite/src/test/tkt3997.test @@ -35,36 +35,36 @@ do_test tkt3997-1.1 { } } {} do_test tkt3997-1.2 { - execsql { - SELECT name - FROM mytext - ORDER BY name COLLATE reverse + execsql { + SELECT name + FROM mytext + ORDER BY name COLLATE reverse } } {afe acd abc} do_test tkt3997-1.3 { - execsql { - SELECT name - FROM (SELECT name FROM mytext) - ORDER BY name COLLATE reverse + execsql { + SELECT name + FROM (SELECT name FROM mytext) + ORDER BY name COLLATE reverse } } {afe acd abc} do_test tkt3997-2.1 { - execsql { + execsql { CREATE TABLE mytext2(name COLLATE reverse); INSERT INTO mytext2 SELECT name FROM mytext; } } {} do_test tkt3997-2.2 { - execsql { - SELECT name - FROM (SELECT name FROM mytext2) + execsql { + SELECT name + FROM (SELECT name FROM mytext2) ORDER BY name } } {afe acd abc} do_test tkt3997-2.3 { - execsql { - SELECT name + execsql { + SELECT name FROM (SELECT name FROM mytext2) ORDER BY name COLLATE usual } diff --git a/third_party/sqlite/src/test/tkt4018.test b/third_party/sqlite/src/test/tkt4018.test index 77582a5c41d88..70bfeb5626365 100644 --- a/third_party/sqlite/src/test/tkt4018.test +++ b/third_party/sqlite/src/test/tkt4018.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. # # This file implements tests to verify that ticket #4018 has been -# fixed. +# fixed. # set testdir [file dirname $argv0] @@ -29,7 +29,7 @@ proc testsql {sql} { exit }] close $fd - set fd [open "| [info nameofexec] ./tf_main.tcl" r] + set fd [open "| [info nameofexec] ./tf_main.tcl" r] set res [read $fd] close $fd return $res @@ -67,7 +67,7 @@ do_test tkt4018-1.4 { testsql {INSERT INTO t1 VALUES(3, 4)} } {0 {}} -# Check that reusing a file descriptor cannot change a read-only +# Check that reusing a file descriptor cannot change a read-only # connection into a read-write connection. do_test tkt4018-2.1 { sqlite3 db2 test.db diff --git a/third_party/sqlite/src/test/tpch01.test b/third_party/sqlite/src/test/tpch01.test index ce48f8ec23d96..9515b74c57d76 100644 --- a/third_party/sqlite/src/test/tpch01.test +++ b/third_party/sqlite/src/test/tpch01.test @@ -58,8 +58,8 @@ do_execsql_test tpch01-1.0 { O_ORDERSTATUS CHAR(1) NOT NULL, O_TOTALPRICE DECIMAL(15,2) NOT NULL, O_ORDERDATE DATE NOT NULL, - O_ORDERPRIORITY CHAR(15) NOT NULL, - O_CLERK CHAR(15) NOT NULL, + O_ORDERPRIORITY CHAR(15) NOT NULL, + O_CLERK CHAR(15) NOT NULL, O_SHIPPRIORITY INTEGER NOT NULL, O_COMMENT VARCHAR(79) NOT NULL); CREATE TABLE LINEITEM ( L_ORDERKEY INTEGER NOT NULL, diff --git a/third_party/sqlite/src/test/trace.test b/third_party/sqlite/src/test/trace.test index fd51d7ab64a9f..cec597fa6f979 100644 --- a/third_party/sqlite/src/test/trace.test +++ b/third_party/sqlite/src/test/trace.test @@ -84,7 +84,7 @@ do_test trace-2.1 { do_test trace-2.2 { set TRACE_OUT {} sqlite3_reset $STMT - set TRACE_OUT + set TRACE_OUT } {} do_test trace-2.3 { sqlite3_step $STMT @@ -106,7 +106,7 @@ do_test trace-2.6 { } {VACUUM} # Similar tests, but this time for profiling. -# +# do_test trace-3.1 { set rc [catch {db profile 1 2 3} msg] lappend rc $msg @@ -154,7 +154,7 @@ do_test trace-4.1 { do_test trace-4.2 { set TRACE_OUT {} sqlite3_reset $STMT - set TRACE_OUT + set TRACE_OUT } {} do_test trace-4.3 { sqlite3_step $STMT diff --git a/third_party/sqlite/src/test/trace2.test b/third_party/sqlite/src/test/trace2.test index a3f0aeb878004..856a766212eed 100644 --- a/third_party/sqlite/src/test/trace2.test +++ b/third_party/sqlite/src/test/trace2.test @@ -70,50 +70,50 @@ do_trace_select_test 1.2 { } do_trace_select_test 1.3 { - SELECT sql('SELECT 1, - 2, + SELECT sql('SELECT 1, + 2, 3' ); } { - "SELECT sql('SELECT 1, - 2, + "SELECT sql('SELECT 1, + 2, 3' );" - "-- SELECT 1, --- 2, + "-- SELECT 1, +-- 2, -- 3" } do_trace_select_test 1.4 { - SELECT sql('SELECT 1, + SELECT sql('SELECT 1, 3' ); } { - "SELECT sql('SELECT 1, + "SELECT sql('SELECT 1, 3' );" - "-- SELECT 1, --- --- + "-- SELECT 1, +-- +-- -- 3" } do_trace_select_test 1.5 { - SELECT $var, sql('SELECT 1, - $var, + SELECT $var, sql('SELECT 1, + $var, 3' ); } { - "SELECT NULL, sql('SELECT 1, - $var, + "SELECT NULL, sql('SELECT 1, + $var, 3' );" - "-- SELECT 1, --- $var, + "-- SELECT 1, +-- $var, -- 3" } @@ -127,13 +127,13 @@ ifcapable fts3 { do_trace_test 2.2 { INSERT INTO x1 VALUES('North northwest wind between 8 and 14 mph'); } { - "INSERT INTO x1 VALUES('North northwest wind between 8 and 14 mph');" + "INSERT INTO x1 VALUES('North northwest wind between 8 and 14 mph');" "-- DELETE FROM 'main'.'x1_segdir' WHERE level = ?" - "-- INSERT INTO 'main'.'x1_content' VALUES(?,(?))" - "-- REPLACE INTO 'main'.'x1_docsize' VALUES(?,?)" - "-- SELECT value FROM 'main'.'x1_stat' WHERE id=?" - "-- REPLACE INTO 'main'.'x1_stat' VALUES(?,?)" - "-- SELECT (SELECT max(idx) FROM 'main'.'x1_segdir' WHERE level = ?) + 1" + "-- INSERT INTO 'main'.'x1_content' VALUES(?,(?))" + "-- REPLACE INTO 'main'.'x1_docsize' VALUES(?,?)" + "-- SELECT value FROM 'main'.'x1_stat' WHERE id=?" + "-- REPLACE INTO 'main'.'x1_stat' VALUES(?,?)" + "-- SELECT (SELECT max(idx) FROM 'main'.'x1_segdir' WHERE level = ?) + 1" "-- SELECT coalesce((SELECT max(blockid) FROM 'main'.'x1_segments') + 1, 1)" "-- REPLACE INTO 'main'.'x1_segdir' VALUES(?,?,?,?,?,?)" "-- SELECT level, idx, end_block FROM 'main'.'x1_segdir' WHERE level BETWEEN ? AND ? ORDER BY level DESC, idx ASC" diff --git a/third_party/sqlite/src/test/trans.test b/third_party/sqlite/src/test/trans.test index bbaedc5450c65..4da5d5af82171 100644 --- a/third_party/sqlite/src/test/trans.test +++ b/third_party/sqlite/src/test/trans.test @@ -279,7 +279,7 @@ do_test trans-5.7 { # do_test trans-5.8 { execsql { - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name } @@ -288,7 +288,7 @@ do_test trans-5.9 { execsql { BEGIN TRANSACTION; CREATE TABLE t1(a int, b int, c int); - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -296,7 +296,7 @@ do_test trans-5.9 { do_test trans-5.10 { execsql { CREATE INDEX i1 ON t1(a); - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -304,7 +304,7 @@ do_test trans-5.10 { do_test trans-5.11 { execsql { COMMIT; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -316,7 +316,7 @@ do_test trans-5.12 { CREATE INDEX i2a ON t2(a); CREATE INDEX i2b ON t2(b); DROP TABLE t1; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -324,7 +324,7 @@ do_test trans-5.12 { do_test trans-5.13 { execsql { ROLLBACK; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -333,7 +333,7 @@ do_test trans-5.14 { execsql { BEGIN TRANSACTION; DROP INDEX i1; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -341,7 +341,7 @@ do_test trans-5.14 { do_test trans-5.15 { execsql { ROLLBACK; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -354,7 +354,7 @@ do_test trans-5.16 { CREATE INDEX i2x ON t2(x); CREATE INDEX i2y ON t2(y); INSERT INTO t2 VALUES(1,2,3); - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -362,7 +362,7 @@ do_test trans-5.16 { do_test trans-5.17 { execsql { COMMIT; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -382,7 +382,7 @@ do_test trans-5.20 { BEGIN TRANSACTION; DROP TABLE t1; DROP TABLE t2; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -396,7 +396,7 @@ do_test trans-5.21 { do_test trans-5.22 { execsql { ROLLBACK; - SELECT name fROM sqlite_master + SELECT name fROM sqlite_master WHERE type='table' OR type='index' ORDER BY name; } @@ -864,7 +864,7 @@ do_test trans-9.1 { wal_check_journal_mode trans-9.1.1 # The following procedure computes a "signature" for table "t3". If -# T3 changes in any way, the signature should change. +# T3 changes in any way, the signature should change. # # This is used to test ROLLBACK. We gather a signature for t3, then # make lots of changes to t3, then rollback and take another signature. @@ -952,5 +952,5 @@ for {set i 2} {$i<=$limit} {incr i} { wal_check_journal_mode trans-9.$i.6-$cnt set ::pager_old_format 0 } - + finish_test diff --git a/third_party/sqlite/src/test/transitive1.test b/third_party/sqlite/src/test/transitive1.test index 97dc5a71a979a..29fdf60a8399d 100644 --- a/third_party/sqlite/src/test/transitive1.test +++ b/third_party/sqlite/src/test/transitive1.test @@ -253,7 +253,7 @@ do_execsql_test transitive1-410 { ON files.idpath = path.idpath LEFT JOIN bookmark ON bookmark.idfile = episode.idfile - AND bookmark.type = 1; + AND bookmark.type = 1; CREATE VIEW tvshowview AS SELECT tvshow.*, @@ -272,7 +272,7 @@ do_execsql_test transitive1-410 { ON episode.idshow = tvshow.idshow LEFT JOIN files ON files.idfile = episode.idfile - GROUP BY tvshow.idshow; + GROUP BY tvshow.idshow; SELECT episodeview.c12, path.strPath, @@ -309,8 +309,8 @@ do_execsql_test transitive1-500 { SELECT * FROM x WHERE x.y>='1' AND x.y<'2' AND x.i=x.y; } {10 10} do_execsql_test transitive1-510 { - CREATE TABLE t1(x TEXT); - CREATE TABLE t2(y TEXT); + CREATE TABLE t1(x TEXT); + CREATE TABLE t2(y TEXT); INSERT INTO t1 VALUES('abc'); INSERT INTO t2 VALUES('ABC'); SELECT * FROM t1 CROSS JOIN t2 WHERE (x=y COLLATE nocase) AND y='ABC'; diff --git a/third_party/sqlite/src/test/trigger1.test b/third_party/sqlite/src/test/trigger1.test index a190efd464357..f1186542fbea6 100644 --- a/third_party/sqlite/src/test/trigger1.test +++ b/third_party/sqlite/src/test/trigger1.test @@ -39,7 +39,7 @@ do_test trigger1-1.1.1 { CREATE TRIGGER trig UPDATE ON no_such_table BEGIN SELECT * from sqlite_master; END; - } + } } {1 {no such table: main.no_such_table}} ifcapable tempdb { @@ -48,7 +48,7 @@ ifcapable tempdb { CREATE TEMP TRIGGER trig UPDATE ON no_such_table BEGIN SELECT * from sqlite_master; END; - } + } } {1 {no such table: no_such_table}} } @@ -154,7 +154,7 @@ ifcapable tempdb { SELECT * from sqlite_master; END; SELECT count(*) FROM sqlite_master WHERE name = 'temp_trig'; - } + } } {0} } @@ -342,7 +342,7 @@ ifcapable tempdb { do_test trigger1-3.8 { execsql { INSERT INTO t1 VALUES(3,4); - SELECT * FROM t1; + SELECT * FROM t1; SELECT * FROM t2; } } {1 2 3 4 3 4} @@ -544,7 +544,7 @@ ifcapable conflict { # # Also verify that references within trigger programs are resolved at # statement compile time, not trigger installation time. This means, for -# example, that you can drop and re-create tables referenced by triggers. +# example, that you can drop and re-create tables referenced by triggers. ifcapable tempdb&&attach { do_test trigger1-10.0 { forcedelete test2.db @@ -563,13 +563,13 @@ ifcapable tempdb&&attach { } {} do_test trigger1-10.2 { execsql { - CREATE TEMP TRIGGER trig1 AFTER INSERT ON main.t4 BEGIN + CREATE TEMP TRIGGER trig1 AFTER INSERT ON main.t4 BEGIN INSERT INTO insert_log VALUES('main', new.a, new.b, new.c); END; - CREATE TEMP TRIGGER trig2 AFTER INSERT ON temp.t4 BEGIN + CREATE TEMP TRIGGER trig2 AFTER INSERT ON temp.t4 BEGIN INSERT INTO insert_log VALUES('temp', new.a, new.b, new.c); END; - CREATE TEMP TRIGGER trig3 AFTER INSERT ON aux.t4 BEGIN + CREATE TEMP TRIGGER trig3 AFTER INSERT ON aux.t4 BEGIN INSERT INTO insert_log VALUES('aux', new.a, new.b, new.c); END; } diff --git a/third_party/sqlite/src/test/trigger2.test b/third_party/sqlite/src/test/trigger2.test index 7b939bdab7c51..b7bab3f0cfbcf 100644 --- a/third_party/sqlite/src/test/trigger2.test +++ b/third_party/sqlite/src/test/trigger2.test @@ -9,9 +9,9 @@ # # Regression testing of FOR EACH ROW table triggers # -# 1. Trigger execution order tests. +# 1. Trigger execution order tests. # These tests ensure that BEFORE and AFTER triggers are fired at the correct -# times relative to each other and the triggering statement. +# times relative to each other and the triggering statement. # # trigger2-1.1.*: ON UPDATE trigger execution model. # trigger2-1.2.*: DELETE trigger execution model. @@ -22,19 +22,19 @@ # trigger program can correctly execute INSERT, UPDATE, DELETE * SELECT # statements, and combinations thereof). # -# 3. Selective trigger execution +# 3. Selective trigger execution # This tests that conditional triggers (ie. UPDATE OF triggers and triggers # with WHEN clauses) are fired only fired when they are supposed to be. # # trigger2-3.1: UPDATE OF triggers # trigger2-3.2: WHEN clause # -# 4. Cascaded trigger execution -# Tests that trigger-programs may cause other triggers to fire. Also that a +# 4. Cascaded trigger execution +# Tests that trigger-programs may cause other triggers to fire. Also that a # trigger-program is never executed recursively. -# +# # trigger2-4.1: Trivial cascading trigger -# trigger2-4.2: Trivial recursive trigger handling +# trigger2-4.2: Trivial recursive trigger handling # # 5. Count changes behaviour. # Verify that rows altered by triggers are not included in the return value @@ -57,7 +57,7 @@ ifcapable {!trigger} { # The tests in this file were written before SQLite supported recursive # trigger invocation, and some tests depend on that to pass. So disable # recursive triggers for this file. -catchsql { pragma recursive_triggers = off } +catchsql { pragma recursive_triggers = off } # 1. ifcapable subquery { @@ -70,7 +70,7 @@ ifcapable subquery { ] ifcapable tempdb { lappend tbl_definitions \ - {CREATE TEMP TABLE tbl (a, b); CREATE INDEX tbl_idx ON tbl(b);} + {CREATE TEMP TABLE tbl (a, b); CREATE INDEX tbl_idx ON tbl(b);} lappend tbl_definitions {CREATE TEMP TABLE tbl (a, b);} lappend tbl_definitions \ {CREATE TEMPORARY TABLE tbl (a INTEGER PRIMARY KEY, b);} @@ -84,48 +84,48 @@ ifcapable subquery { DROP TABLE tbl; DROP TABLE other_tbl; } - + execsql $tbl_defn - + execsql { INSERT INTO tbl VALUES(1, 2); INSERT INTO tbl VALUES(3, 4); - + CREATE TABLE rlog (idx, old_a, old_b, db_sum_a, db_sum_b, new_a, new_b); CREATE TABLE clog (idx, old_a, old_b, db_sum_a, db_sum_b, new_a, new_b); - - CREATE TRIGGER before_update_row BEFORE UPDATE ON tbl FOR EACH ROW + + CREATE TRIGGER before_update_row BEFORE UPDATE ON tbl FOR EACH ROW BEGIN - INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), - old.a, old.b, + INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), + old.a, old.b, (SELECT coalesce(sum(a),0) FROM tbl), - (SELECT coalesce(sum(b),0) FROM tbl), + (SELECT coalesce(sum(b),0) FROM tbl), new.a, new.b); END; - - CREATE TRIGGER after_update_row AFTER UPDATE ON tbl FOR EACH ROW + + CREATE TRIGGER after_update_row AFTER UPDATE ON tbl FOR EACH ROW BEGIN - INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), - old.a, old.b, + INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), + old.a, old.b, (SELECT coalesce(sum(a),0) FROM tbl), - (SELECT coalesce(sum(b),0) FROM tbl), + (SELECT coalesce(sum(b),0) FROM tbl), new.a, new.b); END; - + CREATE TRIGGER conditional_update_row AFTER UPDATE ON tbl FOR EACH ROW WHEN old.a = 1 BEGIN - INSERT INTO clog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM clog), - old.a, old.b, + INSERT INTO clog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM clog), + old.a, old.b, (SELECT coalesce(sum(a),0) FROM tbl), - (SELECT coalesce(sum(b),0) FROM tbl), + (SELECT coalesce(sum(b),0) FROM tbl), new.a, new.b); END; } - + do_test trigger2-1.$ii.1 { set r {} - foreach v [execsql { + foreach v [execsql { UPDATE tbl SET a = a * 10, b = b * 10; SELECT * FROM rlog ORDER BY idx; SELECT * FROM clog ORDER BY idx; @@ -138,7 +138,7 @@ ifcapable subquery { 3 3 4 13 24 30 40 \ 4 3 4 40 60 30 40 \ 1 1 2 13 24 10 20 ] - + execsql { DELETE FROM rlog; DELETE FROM tbl; @@ -146,19 +146,19 @@ ifcapable subquery { INSERT INTO tbl VALUES (300, 200); CREATE TRIGGER delete_before_row BEFORE DELETE ON tbl FOR EACH ROW BEGIN - INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), - old.a, old.b, + INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), + old.a, old.b, (SELECT coalesce(sum(a),0) FROM tbl), - (SELECT coalesce(sum(b),0) FROM tbl), + (SELECT coalesce(sum(b),0) FROM tbl), 0, 0); END; - + CREATE TRIGGER delete_after_row AFTER DELETE ON tbl FOR EACH ROW BEGIN - INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), - old.a, old.b, + INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), + old.a, old.b, (SELECT coalesce(sum(a),0) FROM tbl), - (SELECT coalesce(sum(b),0) FROM tbl), + (SELECT coalesce(sum(b),0) FROM tbl), 0, 0); END; } @@ -175,42 +175,42 @@ ifcapable subquery { 2 100 100 300 200 0 0 \ 3 300 200 300 200 0 0 \ 4 300 200 0 0 0 0 ] - + execsql { DELETE FROM rlog; CREATE TRIGGER insert_before_row BEFORE INSERT ON tbl FOR EACH ROW BEGIN - INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), + INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), 0, 0, (SELECT coalesce(sum(a),0) FROM tbl), - (SELECT coalesce(sum(b),0) FROM tbl), + (SELECT coalesce(sum(b),0) FROM tbl), new.a, new.b); END; - + CREATE TRIGGER insert_after_row AFTER INSERT ON tbl FOR EACH ROW BEGIN - INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), + INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), 0, 0, (SELECT coalesce(sum(a),0) FROM tbl), - (SELECT coalesce(sum(b),0) FROM tbl), + (SELECT coalesce(sum(b),0) FROM tbl), new.a, new.b); END; } do_test trigger2-1.$ii.3 { execsql { - + CREATE TABLE other_tbl(a, b); INSERT INTO other_tbl VALUES(1, 2); INSERT INTO other_tbl VALUES(3, 4); -- INSERT INTO tbl SELECT * FROM other_tbl; INSERT INTO tbl VALUES(5, 6); DROP TABLE other_tbl; - + SELECT * FROM rlog; } } [list 1 0 0 0 0 5 6 \ 2 0 0 5 6 5 6 ] - + integrity_check trigger2-1.$ii.4 } catchsql { @@ -227,14 +227,14 @@ foreach tr_program { {UPDATE tbl SET b = old.b;} {INSERT INTO log VALUES(new.c, 2, 3);} {DELETE FROM log WHERE a = 1;} - {INSERT INTO tbl VALUES(500, new.b * 10, 700); - UPDATE tbl SET c = old.c; + {INSERT INTO tbl VALUES(500, new.b * 10, 700); + UPDATE tbl SET c = old.c; DELETE FROM log;} - {INSERT INTO log select * from tbl;} + {INSERT INTO log select * from tbl;} } { foreach test_varset [ list \ { - set statement {UPDATE tbl SET c = 10 WHERE a = 1;} + set statement {UPDATE tbl SET c = 10 WHERE a = 1;} set prep {INSERT INTO tbl VALUES(1, 2, 3);} set newC 10 set newB 2 @@ -274,24 +274,24 @@ foreach tr_program { set statement_type [string range $statement 0 5] set tr_program_fixed $tr_program if {$statement_type == "DELETE"} { - regsub -all new\.a $tr_program_fixed {''} tr_program_fixed - regsub -all new\.b $tr_program_fixed {''} tr_program_fixed - regsub -all new\.c $tr_program_fixed {''} tr_program_fixed + regsub -all new\.a $tr_program_fixed {''} tr_program_fixed + regsub -all new\.b $tr_program_fixed {''} tr_program_fixed + regsub -all new\.c $tr_program_fixed {''} tr_program_fixed } if {$statement_type == "INSERT"} { - regsub -all old\.a $tr_program_fixed {''} tr_program_fixed - regsub -all old\.b $tr_program_fixed {''} tr_program_fixed - regsub -all old\.c $tr_program_fixed {''} tr_program_fixed + regsub -all old\.a $tr_program_fixed {''} tr_program_fixed + regsub -all old\.b $tr_program_fixed {''} tr_program_fixed + regsub -all old\.c $tr_program_fixed {''} tr_program_fixed } set tr_program_cooked $tr_program - regsub -all new\.a $tr_program_cooked $newA tr_program_cooked - regsub -all new\.b $tr_program_cooked $newB tr_program_cooked - regsub -all new\.c $tr_program_cooked $newC tr_program_cooked - regsub -all old\.a $tr_program_cooked $oldA tr_program_cooked - regsub -all old\.b $tr_program_cooked $oldB tr_program_cooked - regsub -all old\.c $tr_program_cooked $oldC tr_program_cooked + regsub -all new\.a $tr_program_cooked $newA tr_program_cooked + regsub -all new\.b $tr_program_cooked $newB tr_program_cooked + regsub -all new\.c $tr_program_cooked $newC tr_program_cooked + regsub -all old\.a $tr_program_cooked $oldA tr_program_cooked + regsub -all old\.b $tr_program_cooked $oldB tr_program_cooked + regsub -all old\.c $tr_program_cooked $oldC tr_program_cooked catchsql { DROP TABLE tbl; @@ -389,7 +389,7 @@ ifcapable subquery { set t232 {0 0 1} } do_test trigger2-3.2 { - execsql { + execsql { INSERT INTO tbl VALUES(0, 0, 0, 0); -- 1 (ifcapable subquery) SELECT * FROM log; @@ -441,7 +441,7 @@ execsql { # Simple recursive trigger execsql { CREATE TABLE tbl(a, b, c); - CREATE TRIGGER tbl_trig BEFORE INSERT ON tbl + CREATE TRIGGER tbl_trig BEFORE INSERT ON tbl BEGIN INSERT INTO tbl VALUES (new.a, new.b, new.c); END; @@ -459,7 +459,7 @@ execsql { # 5. execsql { CREATE TABLE tbl(a, b, c); - CREATE TRIGGER tbl_trig BEFORE INSERT ON tbl + CREATE TRIGGER tbl_trig BEFORE INSERT ON tbl BEGIN INSERT INTO tbl VALUES (1, 2, 3); INSERT INTO tbl VALUES (2, 2, 3); @@ -530,8 +530,8 @@ ifcapable conflict { } } {} execsql {DELETE FROM tbl} - - + + # Handling of ON CONFLICT by UPDATE statements inside triggers execsql { INSERT INTO tbl values (4, 2, 3); @@ -605,35 +605,35 @@ do_test trigger2-7.1 { INSERT INTO ab VALUES (0, 0); INSERT INTO cd VALUES (3, 4); - CREATE TABLE tlog(ii INTEGER PRIMARY KEY, + CREATE TABLE tlog(ii INTEGER PRIMARY KEY, olda, oldb, oldc, oldd, newa, newb, newc, newd); CREATE VIEW abcd AS SELECT a, b, c, d FROM ab, cd; CREATE TRIGGER before_update INSTEAD OF UPDATE ON abcd BEGIN - INSERT INTO tlog VALUES(NULL, + INSERT INTO tlog VALUES(NULL, old.a, old.b, old.c, old.d, new.a, new.b, new.c, new.d); END; CREATE TRIGGER after_update INSTEAD OF UPDATE ON abcd BEGIN - INSERT INTO tlog VALUES(NULL, + INSERT INTO tlog VALUES(NULL, old.a, old.b, old.c, old.d, new.a, new.b, new.c, new.d); END; CREATE TRIGGER before_delete INSTEAD OF DELETE ON abcd BEGIN - INSERT INTO tlog VALUES(NULL, + INSERT INTO tlog VALUES(NULL, old.a, old.b, old.c, old.d, 0, 0, 0, 0); END; CREATE TRIGGER after_delete INSTEAD OF DELETE ON abcd BEGIN - INSERT INTO tlog VALUES(NULL, + INSERT INTO tlog VALUES(NULL, old.a, old.b, old.c, old.d, 0, 0, 0, 0); END; CREATE TRIGGER before_insert INSTEAD OF INSERT ON abcd BEGIN - INSERT INTO tlog VALUES(NULL, + INSERT INTO tlog VALUES(NULL, 0, 0, 0, 0, new.a, new.b, new.c, new.d); END; CREATE TRIGGER after_insert INSTEAD OF INSERT ON abcd BEGIN - INSERT INTO tlog VALUES(NULL, + INSERT INTO tlog VALUES(NULL, 0, 0, 0, 0, new.a, new.b, new.c, new.d); END; } diff --git a/third_party/sqlite/src/test/trigger3.test b/third_party/sqlite/src/test/trigger3.test index fe91b9dcf8e2a..95a7e55cf6ec3 100644 --- a/third_party/sqlite/src/test/trigger3.test +++ b/third_party/sqlite/src/test/trigger3.test @@ -21,19 +21,19 @@ ifcapable {!trigger} { # The tests in this file were written before SQLite supported recursive } # trigger invocation, and some tests depend on that to pass. So disable # recursive triggers for this file. -catchsql { pragma recursive_triggers = off } +catchsql { pragma recursive_triggers = off } # Test that we can cause ROLLBACK, FAIL and ABORT correctly # catchsql { CREATE TABLE tbl(a, b ,c) } execsql { - CREATE TRIGGER before_tbl_insert BEFORE INSERT ON tbl BEGIN SELECT CASE + CREATE TRIGGER before_tbl_insert BEFORE INSERT ON tbl BEGIN SELECT CASE WHEN (new.a = 4) THEN RAISE(IGNORE) END; END; - CREATE TRIGGER after_tbl_insert AFTER INSERT ON tbl BEGIN SELECT CASE - WHEN (new.a = 1) THEN RAISE(ABORT, 'Trigger abort') - WHEN (new.a = 2) THEN RAISE(FAIL, 'Trigger fail') + CREATE TRIGGER after_tbl_insert AFTER INSERT ON tbl BEGIN SELECT CASE + WHEN (new.a = 1) THEN RAISE(ABORT, 'Trigger abort') + WHEN (new.a = 2) THEN RAISE(FAIL, 'Trigger fail') WHEN (new.a = 3) THEN RAISE(ROLLBACK, 'Trigger rollback') END; END; } @@ -166,7 +166,7 @@ execsql {CREATE VIEW tbl_view AS SELECT * FROM tbl} execsql { CREATE TRIGGER tbl_view_insert INSTEAD OF INSERT ON tbl_view BEGIN SELECT CASE WHEN (new.a = 1) THEN RAISE(ROLLBACK, 'View rollback') - WHEN (new.a = 2) THEN RAISE(IGNORE) + WHEN (new.a = 2) THEN RAISE(IGNORE) WHEN (new.a = 3) THEN RAISE(ABORT, 'View abort') END; END; } @@ -193,8 +193,8 @@ verify_ex_errcode trigger3-7.3b SQLITE_CONSTRAINT_TRIGGER integrity_check trigger3-8.1 -catchsql { DROP TABLE tbl; } -catchsql { DROP TABLE tbl2; } +catchsql { DROP TABLE tbl; } +catchsql { DROP TABLE tbl2; } catchsql { DROP VIEW tbl_view; } finish_test diff --git a/third_party/sqlite/src/test/trigger8.test b/third_party/sqlite/src/test/trigger8.test index 3064ea601489c..f47f7dcacfed8 100644 --- a/third_party/sqlite/src/test/trigger8.test +++ b/third_party/sqlite/src/test/trigger8.test @@ -23,7 +23,7 @@ ifcapable {!trigger} { } # Set variable $nStatement to the number of statements to include in the -# body of the trigger. On a workstation with virtually unlimited memory, +# body of the trigger. On a workstation with virtually unlimited memory, # use 10000. But on symbian, which allows each application at most a 32MB # heap, use 1000. # diff --git a/third_party/sqlite/src/test/trigger9.test b/third_party/sqlite/src/test/trigger9.test index 326fa63d4c6b0..8c9cc4922eea9 100644 --- a/third_party/sqlite/src/test/trigger9.test +++ b/third_party/sqlite/src/test/trigger9.test @@ -18,11 +18,11 @@ # trigger9-1.* - Test that if there are no references to OLD.* cols, or a # reference to only OLD.rowid, the data is not loaded. # -# trigger9-2.* - Test that for NEW.* records populated by UPDATE -# statements, unused fields are populated with NULL values. +# trigger9-2.* - Test that for NEW.* records populated by UPDATE +# statements, unused fields are populated with NULL values. # # trigger9-3.* - Test that the temporary tables used for OLD.* references -# in "INSTEAD OF" triggers have NULL values in unused +# in "INSTEAD OF" triggers have NULL values in unused # fields. # @@ -209,7 +209,7 @@ ifcapable compound { execsql { BEGIN; INSERT INTO t3 VALUES(1, 'zero'); - CREATE VIEW v1 AS + CREATE VIEW v1 AS SELECT sum(a) AS a, max(b) AS b FROM t3 GROUP BY t3.a HAVING b>'two'; CREATE TRIGGER trig1 INSTEAD OF UPDATE ON v1 BEGIN INSERT INTO t2 VALUES(old.a); diff --git a/third_party/sqlite/src/test/triggerA.test b/third_party/sqlite/src/test/triggerA.test index 821e2d90e4775..47cd359a0a431 100644 --- a/third_party/sqlite/src/test/triggerA.test +++ b/third_party/sqlite/src/test/triggerA.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. Specifically, # it tests issues relating to firing an INSTEAD OF trigger on a VIEW # when one tries to UPDATE or DELETE from the view. Does the WHERE -# clause of the UPDATE or DELETE statement get passed down correctly +# clause of the UPDATE or DELETE statement get passed down correctly # into the query that manifests the view? # # Ticket #2938 @@ -223,7 +223,7 @@ do_malloc_test triggerA-3 -tclprep { forcedelete test.db test.db-journal forcecopy test.db-triggerA test.db sqlite3 db test.db - sqlite3_extended_result_codes db 1 + sqlite3_extended_result_codes db 1 db eval {SELECT * FROM v5; -- warm up the cache} } -sqlbody { DELETE FROM v5 WHERE x=5; diff --git a/third_party/sqlite/src/test/triggerB.test b/third_party/sqlite/src/test/triggerB.test index ac4f37bcf4cad..376bfce330265 100644 --- a/third_party/sqlite/src/test/triggerB.test +++ b/third_party/sqlite/src/test/triggerB.test @@ -148,6 +148,6 @@ for {set i 0} {$i<=64} {incr i} { } }] [subst {$i a$i b$i}] } - + finish_test diff --git a/third_party/sqlite/src/test/triggerC.test b/third_party/sqlite/src/test/triggerC.test index 3e47521fd11c7..b57235576f904 100644 --- a/third_party/sqlite/src/test/triggerC.test +++ b/third_party/sqlite/src/test/triggerC.test @@ -23,14 +23,14 @@ ifcapable {!trigger} { # # triggerC-1.*: Haphazardly designed trigger related tests that were useful # during an upgrade of the triggers sub-system. -# +# # triggerC-2.*: # # triggerC-3.*: # # triggerC-4.*: # -# triggerC-5.*: Test that when recursive triggers are enabled DELETE +# triggerC-5.*: Test that when recursive triggers are enabled DELETE # triggers are fired when rows are deleted as part of OR # REPLACE conflict resolution. And that they are not fired # if recursive triggers are not enabled. @@ -140,7 +140,7 @@ do_test triggerC-1.13 { create trigger r1 after update on t6 for each row begin SELECT 1; end; - UPDATE t6 SET a=a; + UPDATE t6 SET a=a; } } {} do_test triggerC-1.14 { @@ -173,10 +173,10 @@ do_test triggerC-2.1.0 { } {} foreach {n tdefn rc} { - 1 { + 1 { CREATE TRIGGER t2_trig AFTER INSERT ON t2 WHEN (new.a>0) BEGIN INSERT INTO t2 VALUES(new.a - 1); - END; + END; } {0 {10 9 8 7 6 5 4 3 2 1 0}} 2 { @@ -186,32 +186,32 @@ foreach {n tdefn rc} { END; } {0 {10 9 8 7 6 5 4 3 2}} - 3 { + 3 { CREATE TRIGGER t2_trig BEFORE INSERT ON t2 WHEN (new.a>0) BEGIN INSERT INTO t2 VALUES(new.a - 1); - END; + END; } {0 {0 1 2 3 4 5 6 7 8 9 10}} - 4 { + 4 { CREATE TRIGGER t2_trig BEFORE INSERT ON t2 BEGIN SELECT CASE WHEN new.a==2 THEN RAISE(IGNORE) ELSE NULL END; INSERT INTO t2 VALUES(new.a - 1); END; } {0 {3 4 5 6 7 8 9 10}} - 5 { + 5 { CREATE TRIGGER t2_trig BEFORE INSERT ON t2 BEGIN INSERT INTO t2 VALUES(new.a - 1); END; } {1 {too many levels of trigger recursion}} - 6 { + 6 { CREATE TRIGGER t2_trig AFTER INSERT ON t2 WHEN (new.a>0) BEGIN INSERT OR IGNORE INTO t2 VALUES(new.a); END; } {0 10} - 7 { + 7 { CREATE TRIGGER t2_trig BEFORE INSERT ON t2 WHEN (new.a>0) BEGIN INSERT OR IGNORE INTO t2 VALUES(new.a); END; @@ -264,7 +264,7 @@ do_test triggerC-2.3 { SELECT count(*) FROM t23; " } [list [expr $SQLITE_MAX_TRIGGER_DEPTH / 2]] - + #----------------------------------------------------------------------- # This block of tests, triggerC-3.*, test that SQLite throws an exception @@ -365,8 +365,8 @@ sqlite3_limit db SQLITE_LIMIT_TRIGGER_DEPTH $SQLITE_MAX_TRIGGER_DEPTH #----------------------------------------------------------------------- -# This next block of tests, triggerC-4.*, checks that affinity -# transformations and constraint processing is performed at the correct +# This next block of tests, triggerC-4.*, checks that affinity +# transformations and constraint processing is performed at the correct # times relative to BEFORE and AFTER triggers. # # For an INSERT statement, for each row to be inserted: @@ -465,17 +465,17 @@ do_test triggerC-4.1.1 { } {} foreach {n insert log} { - 2 { + 2 { INSERT INTO t4 VALUES('1', '1', '1'); DELETE FROM t4; } { - -1 integer 1 text 1 integer 1.0 real + -1 integer 1 text 1 integer 1.0 real + 1 integer 1 text 1 integer 1.0 real 1 integer 1 text 1 integer 1.0 real - 1 integer 1 text 1 integer 1.0 real 1 integer 1 text 1 integer 1.0 real } - 3 { + 3 { INSERT INTO t4(rowid,a,b,c) VALUES(45, 45, 45, 45); DELETE FROM t4; } { @@ -485,17 +485,17 @@ foreach {n insert log} { 45 integer 45 text 45 integer 45.0 real } - 4 { + 4 { INSERT INTO t4(rowid,a,b,c) VALUES(-42.0, -42.0, -42.0, -42.0); DELETE FROM t4; } { - -42 integer -42.0 text -42 integer -42.0 real -42 integer -42.0 text -42 integer -42.0 real - -42 integer -42.0 text -42 integer -42.0 real + -42 integer -42.0 text -42 integer -42.0 real + -42 integer -42.0 text -42 integer -42.0 real -42 integer -42.0 text -42 integer -42.0 real } - 5 { + 5 { INSERT INTO t4(rowid,a,b,c) VALUES(NULL, -42.4, -42.4, -42.4); DELETE FROM t4; } { @@ -505,7 +505,7 @@ foreach {n insert log} { 1 integer -42.4 text -42.4 real -42.4 real } - 6 { + 6 { INSERT INTO t4 VALUES(7, 7, 7); UPDATE t4 SET a=8, b=8, c=8; } { @@ -517,7 +517,7 @@ foreach {n insert log} { 1 integer 8 text 8 integer 8.0 real } - 7 { + 7 { UPDATE t4 SET rowid=2; } { 1 integer 8 text 8 integer 8.0 real @@ -526,7 +526,7 @@ foreach {n insert log} { 2 integer 8 text 8 integer 8.0 real } - 8 { + 8 { UPDATE t4 SET a='9', b='9', c='9'; } { 2 integer 8 text 8 integer 8.0 real @@ -535,7 +535,7 @@ foreach {n insert log} { 2 integer 9 text 9 integer 9.0 real } - 9 { + 9 { UPDATE t4 SET a='9.1', b='9.1', c='9.1'; } { 2 integer 9 text 9 integer 9.0 real @@ -545,13 +545,13 @@ foreach {n insert log} { } } { do_test triggerC-4.1.$n { - eval concat [execsql " + eval concat [execsql " DELETE FROM log; - $insert ; + $insert ; SELECT * FROM log ORDER BY rowid; "] } [join $log " "] -} +} #------------------------------------------------------------------------- # This block of tests, triggerC-5.*, test that DELETE triggers are fired @@ -652,13 +652,13 @@ do_test triggerC-6.1 { execsql { PRAGMA recursive_triggers } } {1} do_test triggerC-6.2 { - execsql { + execsql { PRAGMA recursive_triggers = off; PRAGMA recursive_triggers; } } {0} do_test triggerC-6.3 { - execsql { + execsql { PRAGMA recursive_triggers = on; PRAGMA recursive_triggers; } @@ -666,9 +666,9 @@ do_test triggerC-6.3 { #------------------------------------------------------------------------- # Test some of the "undefined behaviour" associated with triggers. The -# undefined behaviour occurs when a row being updated or deleted is +# undefined behaviour occurs when a row being updated or deleted is # manipulated by a BEFORE trigger. -# +# do_test triggerC-7.1 { execsql { CREATE TABLE t8(x); @@ -763,7 +763,7 @@ do_test triggerC-7.9 { } {2 3 4 3 5 6 8 1 2} # Ticket [e25d9ea771febc9c311928c1c01c3163dcb26643] -# +# do_test triggerC-9.1 { execsql { CREATE TABLE t9(a,b); @@ -786,16 +786,16 @@ do_test triggerC-9.2 { } } {1 2 3 4} -# At one point (between versions 3.6.18 and 3.6.20 inclusive), an UPDATE -# that fired a BEFORE trigger that itself updated the same row as the -# statement causing it to fire was causing a strange side-effect: The -# values updated by the statement within the trigger were being overwritten -# by the values in the new.* array, even if those values were not +# At one point (between versions 3.6.18 and 3.6.20 inclusive), an UPDATE +# that fired a BEFORE trigger that itself updated the same row as the +# statement causing it to fire was causing a strange side-effect: The +# values updated by the statement within the trigger were being overwritten +# by the values in the new.* array, even if those values were not # themselves written by the parent UPDATE statement. # # Technically speaking this was not a bug. The SQLite documentation says # that if a BEFORE UPDATE or BEFORE DELETE trigger modifies or deletes the -# row that the parent statement is operating on the results are undefined. +# row that the parent statement is operating on the results are undefined. # But as of 3.6.21 behaviour is restored to the way it was in versions # 3.6.17 and earlier to avoid causing unnecessary difficulties. # @@ -808,7 +808,7 @@ do_test triggerC-10.1 { INSERT INTO t10(a) VALUES('hello'); } - # Before the problem was fixed, table t10 would contain the tuple + # Before the problem was fixed, table t10 would contain the tuple # (world, 0) after running the following script (because the value # 1 written to column "updatecnt" was clobbered by the old value 0). # @@ -846,14 +846,14 @@ do_test triggerC-10.3 { ); } - # Before the problem was fixed, table t10 would contain the tuple + # Before the problem was fixed, table t10 would contain the tuple # (world, 0) after running the following script (because the value # 1 written to column "updatecnt" was clobbered by the old value 0). # execsql { UPDATE t11 SET c4=35, c33=22, c1=5; SELECT * FROM t11; - } + } } {5 2 3 35 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 32 33 22 34 35 36 37 38 39 40} #------------------------------------------------------------------------- @@ -875,7 +875,7 @@ foreach {testno tbl defaults} { execsql { DELETE FROM log } execsql $tbl execsql { - CREATE TRIGGER tt1 BEFORE INSERT ON t1 BEGIN + CREATE TRIGGER tt1 BEFORE INSERT ON t1 BEGIN INSERT INTO log VALUES(new.a, new.b); END; INSERT INTO t1 DEFAULT VALUES; @@ -886,7 +886,7 @@ foreach {testno tbl defaults} { do_test triggerC-11.$testno.2 { execsql { DELETE FROM log } execsql { - CREATE TRIGGER tt2 AFTER INSERT ON t1 BEGIN + CREATE TRIGGER tt2 AFTER INSERT ON t1 BEGIN INSERT INTO log VALUES(new.a, new.b); END; INSERT INTO t1 DEFAULT VALUES; @@ -902,7 +902,7 @@ foreach {testno tbl defaults} { SELECT * FROM log; } } $defaults -} +} do_test triggerC-11.4 { catchsql { DROP TABLE t2 } execsql { @@ -979,8 +979,8 @@ set SQL { CREATE TABLE t5(g, h, i); CREATE TRIGGER trig BEFORE INSERT ON t4 BEGIN - INSERT INTO t5 SELECT * FROM t1 WHERE - (a IN (SELECT x FROM empty) OR b IN (SELECT x FROM not_empty)) + INSERT INTO t5 SELECT * FROM t1 WHERE + (a IN (SELECT x FROM empty) OR b IN (SELECT x FROM not_empty)) AND c IN (SELECT f FROM t2 WHERE e=1234567); END; @@ -1001,9 +1001,9 @@ do_execsql_test triggerC-14.2 $SQL {1 2 3} do_execsql_test 15.1.1 { PRAGMA recursive_triggers = 1; CREATE TABLE node( - id int not null primary key, + id int not null primary key, pid int not null default 0 references node, - key varchar not null, + key varchar not null, path varchar default '', unique(pid, key) ); diff --git a/third_party/sqlite/src/test/triggerD.test b/third_party/sqlite/src/test/triggerD.test index a5dd4bdd58046..0583d482186f1 100644 --- a/third_party/sqlite/src/test/triggerD.test +++ b/third_party/sqlite/src/test/triggerD.test @@ -147,7 +147,7 @@ do_test triggerD-2.4 { # INSERT INTO main.t1 VALUES(3); # INSERT INTO temp.t1 VALUES(4); # SELECT * FROM t2; -# +# # The r1 trigger fires when the value 4 is inserted into the temp.t1 # table, rather than when value 3 is inserted into main.t1. # @@ -178,7 +178,7 @@ do_test triggerD-3.2 { ############################################################################# -# +# # Ticket [d6ddba6706353915ceedc56b4e3e72ecb4d77ba4] # # The following syntax really should not be allowed: @@ -187,7 +187,7 @@ do_test triggerD-3.2 { # # But a long-standing bug does allow it. And the "xyz.tab" slips into # the sqlite_master table. We cannot fix the bug simply by disallowing -# "xyz.tab" since that could break legacy applications. We have to +# "xyz.tab" since that could break legacy applications. We have to # fix the system so that the "xyz." on "xyz.tab" is ignored. # Verify that this is the case. # diff --git a/third_party/sqlite/src/test/triggerE.test b/third_party/sqlite/src/test/triggerE.test index a82ac9d2a5b53..642eb3e016719 100644 --- a/third_party/sqlite/src/test/triggerE.test +++ b/third_party/sqlite/src/test/triggerE.test @@ -35,12 +35,12 @@ do_execsql_test 1.0 { # ATTACH 'test.db2' AS aux; # CREATE TABLE aux.t4(x); # INSERT INTO aux.t4 VALUES(5); -# +# # CREATE TRIGGER tr1 AFTER INSERT ON t1 WHEN new.a IN (SELECT x FROM aux.t4) # BEGIN # SELECT 1; # END; -# } +# } # do_execsql_test 1.2 { INSERT INTO t1 VALUES(1,1); } # do_execsql_test 1.3 { INSERT INTO t1 VALUES(5,5); } @@ -64,14 +64,14 @@ foreach {tn defn} { } #------------------------------------------------------------------------- -# Test that variable references within trigger definitions loaded from +# Test that variable references within trigger definitions loaded from # the sqlite_master table are automatically converted to NULL. # do_execsql_test 2.1 { PRAGMA writable_schema = 1; INSERT INTO sqlite_master VALUES('trigger', 'tr1', 't1', 0, - 'CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN - INSERT INTO t2 VALUES(?1, ?2); + 'CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN + INSERT INTO t2 VALUES(?1, ?2); END' ); diff --git a/third_party/sqlite/src/test/triggerF.test b/third_party/sqlite/src/test/triggerF.test index d5e3565eddccf..4a1572a1947c9 100644 --- a/third_party/sqlite/src/test/triggerF.test +++ b/third_party/sqlite/src/test/triggerF.test @@ -22,19 +22,19 @@ ifcapable {!trigger} { foreach {tn sql log} { 1 { } { } - 2 { + 2 { CREATE TRIGGER trd AFTER DELETE ON t1 BEGIN INSERT INTO log VALUES(old.a || old.b || (SELECT count(*) FROM t1)); END; } {1one2 2two1 3three1} - 3 { + 3 { CREATE TRIGGER trd BEFORE DELETE ON t1 BEGIN INSERT INTO log VALUES(old.a || old.b || (SELECT count(*) FROM t1)); END; } {1one3 2two2 3three2} - 4 { + 4 { CREATE TRIGGER tr1 AFTER DELETE ON t1 BEGIN INSERT INTO log VALUES(old.a || old.b || (SELECT count(*) FROM t1)); END; @@ -50,7 +50,7 @@ foreach {tn sql log} { CREATE TABLE t1(a INT PRIMARY KEY, b) WITHOUT ROWID; CREATE TABLE log(t); } - + execsql $sql do_execsql_test 1.$tn.1 { diff --git a/third_party/sqlite/src/test/tt3_checkpoint.c b/third_party/sqlite/src/test/tt3_checkpoint.c index 060a698211a1f..5fb674f633d04 100644 --- a/third_party/sqlite/src/test/tt3_checkpoint.c +++ b/third_party/sqlite/src/test/tt3_checkpoint.c @@ -21,19 +21,19 @@ /* ** Both test cases involve 1 writer/checkpointer thread and N reader threads. -** -** Each reader thread performs a series of read transactions, one after +** +** Each reader thread performs a series of read transactions, one after ** another. Each read transaction lasts for 100 ms. ** ** The writer writes transactions as fast as possible. It uses a callback -** registered with sqlite3_wal_hook() to try to keep the WAL-size limited to +** registered with sqlite3_wal_hook() to try to keep the WAL-size limited to ** around 50 pages. ** -** In test case checkpoint_starvation_1, the auto-checkpoint uses +** In test case checkpoint_starvation_1, the auto-checkpoint uses ** SQLITE_CHECKPOINT_PASSIVE. In checkpoint_starvation_2, it uses RESTART. -** The expectation is that in the first case the WAL file will grow very +** The expectation is that in the first case the WAL file will grow very ** large, and in the second will be limited to the 50 pages or thereabouts. -** However, the overall transaction throughput will be lower for +** However, the overall transaction throughput will be lower for ** checkpoint_starvation_2, as every checkpoint will block for up to 200 ms ** waiting for readers to clear. */ @@ -51,9 +51,9 @@ struct CheckpointStarvationCtx { typedef struct CheckpointStarvationCtx CheckpointStarvationCtx; static int checkpoint_starvation_walhook( - void *pCtx, - sqlite3 *db, - const char *zDb, + void *pCtx, + sqlite3 *db, + const char *zDb, int nFrame ){ CheckpointStarvationCtx *p = (CheckpointStarvationCtx *)pCtx; @@ -97,7 +97,7 @@ static void checkpoint_starvation_main(int nMs, CheckpointStarvationCtx *p){ int i; opendb(&err, &db, "test.db", 1); - sql_script(&err, &db, + sql_script(&err, &db, "PRAGMA page_size = 1024;" "PRAGMA journal_mode = WAL;" "CREATE TABLE t1(x);" diff --git a/third_party/sqlite/src/test/tt3_index.c b/third_party/sqlite/src/test/tt3_index.c index 62f06ade4aac1..b9ab1ca17155d 100644 --- a/third_party/sqlite/src/test/tt3_index.c +++ b/third_party/sqlite/src/test/tt3_index.c @@ -21,7 +21,7 @@ static char *create_drop_index_thread(int iTid, void *pArg){ while( !timetostop(&err) ){ opendb(&err, &db, "test.db", 0); - sql_script(&err, &db, + sql_script(&err, &db, "DROP INDEX IF EXISTS i1;" "DROP INDEX IF EXISTS i2;" "DROP INDEX IF EXISTS i3;" @@ -52,7 +52,7 @@ static void create_drop_index_1(int nMs){ Threadset threads = {0}; opendb(&err, &db, "test.db", 1); - sql_script(&err, &db, + sql_script(&err, &db, "CREATE TABLE t11(a, b, c, d);" "WITH data(x) AS (SELECT 1 UNION ALL SELECT x+1 FROM data WHERE x<100) " "INSERT INTO t11 SELECT x,x,x,x FROM data;" diff --git a/third_party/sqlite/src/test/tt3_lookaside1.c b/third_party/sqlite/src/test/tt3_lookaside1.c index e785e7998baa9..2f22f8dd6373a 100644 --- a/third_party/sqlite/src/test/tt3_lookaside1.c +++ b/third_party/sqlite/src/test/tt3_lookaside1.c @@ -50,7 +50,7 @@ static char *lookaside1_thread_writer(int iTid, void *pArg){ opendb(&err, &db, "test.db", 0); do{ - sql_script(&err, &db, + sql_script(&err, &db, "BEGIN;" "UPDATE t3 SET i=i+1 WHERE x=1;" "ROLLBACK;" @@ -69,7 +69,7 @@ static void lookaside1(int nMs){ Threadset threads = {0}; opendb(&err, &db, "test.db", 1); - sql_script(&err, &db, + sql_script(&err, &db, "CREATE TABLE t1(x PRIMARY KEY) WITHOUT ROWID;" "WITH data(x,y) AS (" " SELECT 1, quote(randomblob(750)) UNION ALL " diff --git a/third_party/sqlite/src/test/tt3_stress.c b/third_party/sqlite/src/test/tt3_stress.c index cdfab9c09ccc9..64af8771e347a 100644 --- a/third_party/sqlite/src/test/tt3_stress.c +++ b/third_party/sqlite/src/test/tt3_stress.c @@ -88,7 +88,7 @@ static char *stress_thread_4(int iTid, void *pArg){ closedb(&err, &db); opendb(&err, &db, "test.db", 0); } - sql_script(&err, &db, + sql_script(&err, &db, "WITH loop(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM loop LIMIT 200) " "INSERT INTO t1 VALUES(randomblob(60), randomblob(60));" ); @@ -190,7 +190,7 @@ static void stress1(int nMs){ static void stress2_workload1(Error *pErr, Sqlite *pDb, int i){ int iTab = (i % (STRESS2_TABCNT-1)) + 1; - sql_script_printf(pErr, pDb, + sql_script_printf(pErr, pDb, "CREATE TABLE IF NOT EXISTS t%d(x PRIMARY KEY, y, z);", iTab ); } @@ -255,7 +255,7 @@ static void stress2_workload14(Error *pErr, Sqlite *pDb, int i){ } static void stress2_workload17(Error *pErr, Sqlite *pDb, int i){ - sql_script_printf(pErr, pDb, + sql_script_printf(pErr, pDb, "PRAGMA journal_mode = %q", (i%2) ? "delete" : "wal" ); } @@ -343,7 +343,7 @@ static void stress2(int nMs){ /* To make sure the db file is empty before commencing */ opendb(&err, &db, zDb, 1); - sql_script(&err, &db, + sql_script(&err, &db, "CREATE TABLE IF NOT EXISTS t0(x PRIMARY KEY, y, z);" "CREATE INDEX IF NOT EXISTS i0 ON t0(y);" ); diff --git a/third_party/sqlite/src/test/tt3_vacuum.c b/third_party/sqlite/src/test/tt3_vacuum.c index 023fdfd74d159..dfe2cb8f22ce4 100644 --- a/third_party/sqlite/src/test/tt3_vacuum.c +++ b/third_party/sqlite/src/test/tt3_vacuum.c @@ -10,7 +10,7 @@ ** ************************************************************************* ** -** This file contains multi-threaded tests that use shared-cache and +** This file contains multi-threaded tests that use shared-cache and ** the VACUUM command. ** ** Tests: @@ -30,7 +30,7 @@ static char *vacuum1_thread_writer(int iTid, void *pArg){ i++; /* Insert lots of rows. Then delete some. */ - execsql(&err, &db, + execsql(&err, &db, "WITH loop(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM loop WHERE i<100) " "INSERT INTO t1 SELECT randomblob(50), randomblob(2500) FROM loop" ); @@ -70,7 +70,7 @@ static void vacuum1(int nMs){ Threadset threads = {0}; opendb(&err, &db, "test.db", 1); - sql_script(&err, &db, + sql_script(&err, &db, "CREATE TABLE t1(x PRIMARY KEY, y BLOB);" "CREATE INDEX i1 ON t1(y);" ); diff --git a/third_party/sqlite/src/test/types.test b/third_party/sqlite/src/test/types.test index 62a8efca82d9b..f7667f4a587c4 100644 --- a/third_party/sqlite/src/test/types.test +++ b/third_party/sqlite/src/test/types.test @@ -149,7 +149,7 @@ proc record_sizes {rootpage} { } -# Create a table and insert some 1-byte integers. Make sure they +# Create a table and insert some 1-byte integers. Make sure they # can be read back OK. These should be 3 byte records. do_test types-2.1.1 { execsql { @@ -217,7 +217,7 @@ ifcapable legacyformat { record_sizes $root } {2 3 3 4 4 6 6 10 10} } - + # Insert some reals. These should be 10 byte records. do_test types-2.2.1 { execsql { @@ -245,7 +245,7 @@ ifcapable legacyformat { record_sizes $root } {2 10 10} } - + # Insert a NULL. This should be a two byte record. do_test types-2.3.1 { execsql { diff --git a/third_party/sqlite/src/test/types2.test b/third_party/sqlite/src/test/types2.test index d6d84e65b54b5..ec0104a8c9328 100644 --- a/third_party/sqlite/src/test/types2.test +++ b/third_party/sqlite/src/test/types2.test @@ -198,28 +198,28 @@ test_bool types2-4.28 {o1='500'} {'500.0' > o1} 1 ifcapable subquery { # types2-5.* - The 'IN (x, y....)' operator with no index. - # + # # Compare literals against literals (no affinity applied) test_bool types2-5.1 {} {(NULL IN ('10.0', 20)) ISNULL} 1 test_bool types2-5.2 {} {10 IN ('10.0', 20)} 0 test_bool types2-5.3 {} {'10' IN ('10.0', 20)} 0 test_bool types2-5.4 {} {10 IN (10.0, 20)} 1 test_bool types2-5.5 {} {'10.0' IN (10, 20)} 0 - + # Compare literals against a column with TEXT affinity test_bool types2-5.6 {t1='10.0'} {t1 IN (10.0, 20)} 1 test_bool types2-5.7 {t1='10.0'} {t1 IN (10, 20)} 0 test_bool types2-5.8 {t1='10'} {t1 IN (10.0, 20)} 0 test_bool types2-5.9 {t1='10'} {t1 IN (20, '10.0')} 0 test_bool types2-5.10 {t1=10} {t1 IN (20, '10')} 1 - + # Compare literals against a column with NUMERIC affinity test_bool types2-5.11 {n1='10.0'} {n1 IN (10.0, 20)} 1 test_bool types2-5.12 {n1='10.0'} {n1 IN (10, 20)} 1 test_bool types2-5.13 {n1='10'} {n1 IN (10.0, 20)} 1 test_bool types2-5.14 {n1='10'} {n1 IN (20, '10.0')} 1 test_bool types2-5.15 {n1=10} {n1 IN (20, '10')} 1 - + # Compare literals against a column with affinity NONE test_bool types2-5.16 {o1='10.0'} {o1 IN (10.0, 20)} 0 test_bool types2-5.17 {o1='10.0'} {o1 IN (10, 20)} 0 @@ -248,7 +248,7 @@ ifcapable subquery { test_bool types2-5.35 {t1='10'} {'10' IN ('abc',t1,5)} 1 test_bool types2-5.36 {t1='010'} {'10' IN (5,t1,'abc')} 0 test_bool types2-5.37 {t1='010'} {'10' IN ('abc',t1,5)} 0 - + # Columns on both the left and right of IN(...). Only the column # on the left matters. The all values on the right are treated like # expressions. @@ -259,9 +259,9 @@ ifcapable subquery { } # Tests named types2-6.* use the same infrastructure as the types2-2.* -# tests. The contents of the vals array is repeated here for easy +# tests. The contents of the vals array is repeated here for easy # reference. -# +# # set vals [list 10 10.0 '10' '10.0' 20 20.0 '20' '20.0' 30 30.0 '30' '30.0'] # 1 2 3 4 5 6 7 8 9 10 11 12 @@ -279,7 +279,7 @@ ifcapable subquery { test_boolset types2-6.9 {rowid IN (1, 6, 10)} {1 6 10} } -# Tests types2-7.* concentrate on expressions of the form +# Tests types2-7.* concentrate on expressions of the form # "x IN (SELECT...)" with no index. execsql { CREATE TABLE t3(i INTEGER, n NUMERIC, t TEXT, o BLOB); @@ -296,13 +296,13 @@ ifcapable subquery { test_bool types2-7.3 {i1='2.0'} {i1 IN (SELECT n FROM t3)} 1 test_bool types2-7.4 {i1='2.0'} {i1 IN (SELECT t FROM t3)} 1 test_bool types2-7.5 {i1='2.0'} {i1 IN (SELECT o FROM t3)} 1 - + test_bool types2-7.6 {n1=1} {n1 IN (SELECT n FROM t3)} 1 test_bool types2-7.7 {n1='2.0'} {n1 IN (SELECT i FROM t3)} 1 test_bool types2-7.8 {n1='2.0'} {n1 IN (SELECT n FROM t3)} 1 test_bool types2-7.9 {n1='2.0'} {n1 IN (SELECT t FROM t3)} 1 test_bool types2-7.10 {n1='2.0'} {n1 IN (SELECT o FROM t3)} 1 - + test_bool types2-7.6 {t1=1} {t1 IN (SELECT t FROM t3)} 1 test_bool types2-7.7 {t1='2.0'} {t1 IN (SELECT t FROM t3)} 0 test_bool types2-7.8 {t1='2.0'} {t1 IN (SELECT n FROM t3)} 1 @@ -310,7 +310,7 @@ ifcapable subquery { test_bool types2-7.10 {t1='2.0'} {t1 IN (SELECT o FROM t3)} 0 test_bool types2-7.11 {t1='1.0'} {t1 IN (SELECT t FROM t3)} 1 test_bool types2-7.12 {t1='1.0'} {t1 IN (SELECT o FROM t3)} 1 - + test_bool types2-7.13 {o1=2} {o1 IN (SELECT o FROM t3)} 1 test_bool types2-7.14 {o1='2'} {o1 IN (SELECT o FROM t3)} 0 test_bool types2-7.15 {o1='2'} {o1 IN (SELECT o||'' FROM t3)} 1 diff --git a/third_party/sqlite/src/test/unixexcl.test b/third_party/sqlite/src/test/unixexcl.test index 8e9c4644d154f..bdf3dffcb4374 100644 --- a/third_party/sqlite/src/test/unixexcl.test +++ b/third_party/sqlite/src/test/unixexcl.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# This file contains tests for the "unix-excl" VFS module (part of +# This file contains tests for the "unix-excl" VFS module (part of # os_unix.c). # @@ -21,7 +21,7 @@ source $testdir/malloc_common.tcl if {$::tcl_platform(platform)!="unix" || [info commands test_syscall]==""} { finish_test return -} +} set testprefix unixexcl @@ -47,12 +47,12 @@ do_multiclient_test tn { } } {hello world} if {$tn==1} { - do_test unixexcl-1.$tn.4.multiproc { - csql2 { SELECT * FROM t1 } + do_test unixexcl-1.$tn.4.multiproc { + csql2 { SELECT * FROM t1 } } {1 {database is locked}} } else { - do_test unixexcl-1.$tn.4.singleproc { - csql2 { SELECT * FROM t1 } + do_test unixexcl-1.$tn.4.singleproc { + csql2 { SELECT * FROM t1 } } {0 {hello world}} } } @@ -75,8 +75,8 @@ do_multiclient_test tn { db eval { SELECT * FROM t1 } } } {hello world} - do_test unixexcl-2.$tn.4 { - csql2 { SELECT * FROM t1 } + do_test unixexcl-2.$tn.4 { + csql2 { SELECT * FROM t1 } } {0 {hello world}} } @@ -103,7 +103,7 @@ do_multiclient_test tn { } {1 2} do_test unixexcl-3.$tn.2 { - sql2 { + sql2 { BEGIN; SELECT * FROM t1; } diff --git a/third_party/sqlite/src/test/unordered.test b/third_party/sqlite/src/test/unordered.test index 147e91f0d9731..b0cac2a9c68bc 100644 --- a/third_party/sqlite/src/test/unordered.test +++ b/third_party/sqlite/src/test/unordered.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # set testdir [file dirname $argv0] @@ -47,7 +47,7 @@ foreach idxmode {ordered unordered} { {0 0 0 {SCAN TABLE t1}} 3 "SELECT * FROM t1 WHERE a = ? ORDER BY rowid" {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?)}} - {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?)} + {0 0 0 {SEARCH TABLE t1 USING INDEX i1 (a=?)} 0 0 0 {USE TEMP B-TREE FOR ORDER BY}} 4 "SELECT max(a) FROM t1" {0 0 0 {SEARCH TABLE t1 USING COVERING INDEX i1}} diff --git a/third_party/sqlite/src/test/update.test b/third_party/sqlite/src/test/update.test index d7baf6e702a31..c067c546c12c9 100644 --- a/third_party/sqlite/src/test/update.test +++ b/third_party/sqlite/src/test/update.test @@ -431,7 +431,7 @@ do_test update-10.1 { DROP TABLE test1; CREATE TABLE t1( a integer primary key, - b UNIQUE, + b UNIQUE, c, d, e, f, UNIQUE(c,d) diff --git a/third_party/sqlite/src/test/update2.test b/third_party/sqlite/src/test/update2.test index 6a359d11a95a5..433880fba6ae1 100644 --- a/third_party/sqlite/src/test/update2.test +++ b/third_party/sqlite/src/test/update2.test @@ -84,11 +84,11 @@ do_execsql_test 3.1 { #------------------------------------------------------------------------- # foreach {tn sql} { - 1 { + 1 { CREATE TABLE b1(a INTEGER PRIMARY KEY, b, c); CREATE TABLE c1(a INTEGER PRIMARY KEY, b, c, d) } - 2 { + 2 { CREATE TABLE b1(a INT PRIMARY KEY, b, c) WITHOUT ROWID; CREATE TABLE c1(a INT PRIMARY KEY, b, c, d) WITHOUT ROWID; } diff --git a/third_party/sqlite/src/test/uri.test b/third_party/sqlite/src/test/uri.test index 0931a25e51afe..3e35fc296a25e 100644 --- a/third_party/sqlite/src/test/uri.test +++ b/third_party/sqlite/src/test/uri.test @@ -51,7 +51,7 @@ foreach {tn uri file} { 15 test.db?mork=1#boris test.db?mork=1#boris 16 file://localhostPWD/test.db%3Fhello test.db?hello } { - + ifcapable !curdir { if {$tn==3} break } @@ -233,7 +233,7 @@ do_test 4.3.2 { #------------------------------------------------------------------------- # Test that things work if an ATTACHed database uses a different VFS than -# the main database. The important point is that for all operations +# the main database. The important point is that for all operations # involving the ATTACHed database, the correct versions of the following # VFS are used for all operations involving the attached database. # @@ -249,21 +249,21 @@ do_test 4.3.2 { # methods using "tvfs2" set entries in the global T2 array. # ifcapable wal { - testvfs tvfs1 + testvfs tvfs1 tvfs1 filter {xOpen xDelete xAccess xFullPathname} tvfs1 script tvfs1_callback - proc tvfs1_callback {method filename args} { - set ::T1([file tail $filename]) 1 + proc tvfs1_callback {method filename args} { + set ::T1([file tail $filename]) 1 return SQLITE_OK } - testvfs tvfs2 + testvfs tvfs2 tvfs2 filter {xOpen xDelete xAccess xFullPathname} tvfs2 script tvfs2_callback - proc tvfs2_callback {method filename args} { - set ::T2([file tail $filename]) 1 + proc tvfs2_callback {method filename args} { + set ::T2([file tail $filename]) 1 return SQLITE_OK } - + catch {db close} eval forcedelete [glob test.db*] do_test 5.1.1 { @@ -281,12 +281,12 @@ ifcapable wal { } lsort [array names ::T1] } {test.db1 test.db1-journal test.db1-wal} - + do_test 5.1.2 { lsort [array names ::T2] } {test.db2 test.db2-journal test.db2-wal} db close - + tvfs1 delete tvfs2 delete } @@ -333,11 +333,11 @@ do_test 7.2 { sqlite3 db file:test.db?mode=ro execsql { ATTACH 'file:test.db2?mode=rw' AS aux } } {} -do_execsql_test 7.3 { - INSERT INTO t2 VALUES('c', 'd') +do_execsql_test 7.3 { + INSERT INTO t2 VALUES('c', 'd') } {} -do_catchsql_test 7.4 { - INSERT INTO t1 VALUES(3, 4) +do_catchsql_test 7.4 { + INSERT INTO t1 VALUES(3, 4) } {1 {attempt to write a readonly database}} finish_test diff --git a/third_party/sqlite/src/test/userauth01.test b/third_party/sqlite/src/test/userauth01.test index 644937b1921d6..94820f9166d6e 100644 --- a/third_party/sqlite/src/test/userauth01.test +++ b/third_party/sqlite/src/test/userauth01.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This file implements tests of the SQLITE_USER_AUTHENTICATION extension. # @@ -31,7 +31,7 @@ do_execsql_test userauth01-1.0 { } {NULL 1 2.5 'three' X'4444' t1} # Calling sqlite3_user_authenticate() on a no-authentication-required -# database connection is a harmless no-op. +# database connection is a harmless no-op. # do_test userauth01-1.1 { sqlite3_user_authenticate db alice pw-4-alice @@ -58,7 +58,7 @@ do_test userauth01-1.3 { # database and when A is true, the sqlite3_user_add(D,U,P,N,A) routine # converts the database into an authentication-required database and # logs the database connection D in using user U with password P,N. -# +# do_test userauth01-1.4 { sqlite3_user_add db alice pw-4-alice 1 } {SQLITE_OK} @@ -99,7 +99,7 @@ do_test userauth01-1.8 { } db2 } {1 {no such table: sqlite_user}} -# Any user can change their own password. +# Any user can change their own password. # do_test userauth01-1.9 { sqlite3_user_change db2 cindy xyzzy-cindy 0 @@ -251,7 +251,7 @@ do_test authuser01-2.1 { db auth auth db eval {SELECT x FROM t1} set ::authargs -} {/SQLITE_SELECT {} {} {} {} alice/} +} {/SQLITE_SELECT {} {} {} {} alice/} finish_test diff --git a/third_party/sqlite/src/test/utf16align.test b/third_party/sqlite/src/test/utf16align.test index f026d9575db73..199825f90fe5d 100644 --- a/third_party/sqlite/src/test/utf16align.test +++ b/third_party/sqlite/src/test/utf16align.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This file contains code to verify that the SQLITE_UTF16_ALIGNED # flag passed into the sqlite3_create_collation() function insures # that all strings passed to that function are aligned on an even diff --git a/third_party/sqlite/src/test/vacuum.test b/third_party/sqlite/src/test/vacuum.test index 57429c29ea5f8..6fe8f5526b805 100644 --- a/third_party/sqlite/src/test/vacuum.test +++ b/third_party/sqlite/src/test/vacuum.test @@ -55,7 +55,7 @@ do_test vacuum-1.1 { expr {$::cksum!=""} } {1} -# Create bogus application-defined functions for functions used +# Create bogus application-defined functions for functions used # internally by VACUUM, to ensure that VACUUM falls back # to the built-in functions. # @@ -164,7 +164,7 @@ do_test vacuum-2.5 { execsql { -- The "SELECT * FROM sqlite_master" statement ensures that this test -- works when shared-cache is enabled. If shared-cache is enabled, then - -- db3 shares a cache with db2 (but not db - it was opened as + -- db3 shares a cache with db2 (but not db - it was opened as -- "./test.db"). SELECT * FROM sqlite_master; SELECT * FROM t7 LIMIT 1 @@ -200,7 +200,7 @@ do_test vacuum-2.10 { } 0 integrity_check vacuum-2.11 db3 close - + # Ticket #427. Make sure VACUUM works when the EMPTY_RESULT_CALLBACKS # pragma is turned on. diff --git a/third_party/sqlite/src/test/vacuum2.test b/third_party/sqlite/src/test/vacuum2.test index 0350c8ec42270..0a0ef58ccc593 100644 --- a/third_party/sqlite/src/test/vacuum2.test +++ b/third_party/sqlite/src/test/vacuum2.test @@ -191,7 +191,7 @@ ifcapable autovacuum { #------------------------------------------------------------------------- # The following block of tests verify the behaviour of the library when -# a database is VACUUMed when there are one or more unfinalized SQL +# a database is VACUUMed when there are one or more unfinalized SQL # statements reading the same database using the same db handle. # db close @@ -201,9 +201,9 @@ do_execsql_test vacuum2-5.1 { CREATE TABLE t1(a PRIMARY KEY, b UNIQUE); INSERT INTO t1 VALUES(1, randomblob(500)); INSERT INTO t1 SELECT a+1, randomblob(500) FROM t1; -- 2 - INSERT INTO t1 SELECT a+2, randomblob(500) FROM t1; -- 4 - INSERT INTO t1 SELECT a+4, randomblob(500) FROM t1; -- 8 - INSERT INTO t1 SELECT a+8, randomblob(500) FROM t1; -- 16 + INSERT INTO t1 SELECT a+2, randomblob(500) FROM t1; -- 4 + INSERT INTO t1 SELECT a+4, randomblob(500) FROM t1; -- 8 + INSERT INTO t1 SELECT a+8, randomblob(500) FROM t1; -- 16 } {} do_test vacuum2-5.2 { diff --git a/third_party/sqlite/src/test/vacuum3.test b/third_party/sqlite/src/test/vacuum3.test index 484a7d448a7e7..a46e041649c08 100644 --- a/third_party/sqlite/src/test/vacuum3.test +++ b/third_party/sqlite/src/test/vacuum3.test @@ -9,7 +9,7 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The -# focus of this file is changing the database page size using a +# focus of this file is changing the database page size using a # VACUUM statement. # # $Id: vacuum3.test,v 1.9 2008/08/26 21:07:27 drh Exp $ @@ -27,7 +27,7 @@ ifcapable !vacuum { #------------------------------------------------------------------- -# Test cases vacuum3-1.* convert a simple 2-page database between a +# Test cases vacuum3-1.* convert a simple 2-page database between a # few different page sizes. # do_test vacuum3-1.1 { @@ -56,7 +56,7 @@ foreach {request actual database} [list \ 1024 1024 2048 \ ] { do_test vacuum3-1.$I.1 { - execsql " + execsql " PRAGMA page_size = $request; VACUUM; " @@ -74,7 +74,7 @@ foreach {request actual database} [list \ } #------------------------------------------------------------------- -# Test cases vacuum3-2.* convert a simple 3-page database between a +# Test cases vacuum3-2.* convert a simple 3-page database between a # few different page sizes. # do_test vacuum3-2.1 { @@ -105,7 +105,7 @@ foreach {request actual database} [list \ 1024 1024 3072 \ ] { do_test vacuum3-2.$I.1 { - execsql " + execsql " PRAGMA page_size = $request; VACUUM; " @@ -124,7 +124,7 @@ foreach {request actual database} [list \ #------------------------------------------------------------------- # Test cases vacuum3-3.* converts a database large enough to include -# the locking page (in a test environment) between few different +# the locking page (in a test environment) between few different # page sizes. # proc signature {} { @@ -136,28 +136,28 @@ do_test vacuum3-3.1 { BEGIN; CREATE TABLE abc(a PRIMARY KEY, b, c); INSERT INTO abc VALUES(randomblob(100), randomblob(200), randomblob(1000)); - INSERT INTO abc + INSERT INTO abc SELECT randomblob(1000), randomblob(200), randomblob(100) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randomblob(100), randomblob(200), randomblob(1000) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randomblob(100), randomblob(200), randomblob(1000) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randomblob(100), randomblob(200), randomblob(1000) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randomblob(100), randomblob(200), randomblob(1000) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randomblob(25), randomblob(45), randomblob(9456) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randomblob(100), randomblob(200), randomblob(1000) FROM abc; - INSERT INTO abc + INSERT INTO abc SELECT randomblob(25), randomblob(45), randomblob(9456) FROM abc; COMMIT; @@ -180,7 +180,7 @@ foreach {request actual} [list \ 1024 1024 \ ] { do_test vacuum3-3.$I.1 { - execsql " + execsql " PRAGMA page_size = $request; VACUUM; " @@ -211,7 +211,7 @@ do_test vacuum3-4.2 { execsql { SELECT * FROM abc } db2 } {1 2 3 4 5 6} do_test vacuum3-4.3 { - execsql { + execsql { PRAGMA page_size = 2048; VACUUM; } @@ -254,10 +254,10 @@ do_test vacuum3-5.2 { } {1024} set create_database_sql { - BEGIN; - CREATE TABLE t1(a, b, c); - INSERT INTO t1 VALUES(1, randstr(50,50), randstr(50,50)); - INSERT INTO t1 SELECT a+2, b||'-'||rowid, c||'-'||rowid FROM t1; + BEGIN; + CREATE TABLE t1(a, b, c); + INSERT INTO t1 VALUES(1, randstr(50,50), randstr(50,50)); + INSERT INTO t1 SELECT a+2, b||'-'||rowid, c||'-'||rowid FROM t1; INSERT INTO t1 SELECT a+4, b||'-'||rowid, c||'-'||rowid FROM t1; INSERT INTO t1 SELECT a+8, b||'-'||rowid, c||'-'||rowid FROM t1; INSERT INTO t1 SELECT a+16, b||'-'||rowid, c||'-'||rowid FROM t1; @@ -277,14 +277,14 @@ do_ioerr_test vacuum3-ioerr-1 -cksum true -sqlprep " " -sqlbody { PRAGMA page_size = 4096; VACUUM; -} -do_ioerr_test vacuum3-ioerr-2 -cksum true -sqlprep " +} +do_ioerr_test vacuum3-ioerr-2 -cksum true -sqlprep " PRAGMA page_size = 2048; $create_database_sql " -sqlbody { PRAGMA page_size = 512; VACUUM; -} +} ifcapable autovacuum { do_ioerr_test vacuum3-ioerr-3 -cksum true -sqlprep " @@ -293,24 +293,24 @@ ifcapable autovacuum { " -sqlbody { PRAGMA auto_vacuum = 1; VACUUM; - } + } do_ioerr_test vacuum3-ioerr-4 -cksum true -sqlprep " PRAGMA auto_vacuum = 1; $create_database_sql " -sqlbody { PRAGMA auto_vacuum = 0; VACUUM; - } + } } source $testdir/malloc_common.tcl if {$MEMDEBUG} { - do_malloc_test vacuum3-malloc-1 -sqlprep { + do_malloc_test vacuum3-malloc-1 -sqlprep { PRAGMA page_size = 2048; - BEGIN; - CREATE TABLE t1(a, b, c); - INSERT INTO t1 VALUES(1, randstr(50,50), randstr(50,50)); - INSERT INTO t1 SELECT a+2, b||'-'||rowid, c||'-'||rowid FROM t1; + BEGIN; + CREATE TABLE t1(a, b, c); + INSERT INTO t1 VALUES(1, randstr(50,50), randstr(50,50)); + INSERT INTO t1 SELECT a+2, b||'-'||rowid, c||'-'||rowid FROM t1; INSERT INTO t1 SELECT a+4, b||'-'||rowid, c||'-'||rowid FROM t1; INSERT INTO t1 SELECT a+8, b||'-'||rowid, c||'-'||rowid FROM t1; INSERT INTO t1 SELECT a+16, b||'-'||rowid, c||'-'||rowid FROM t1; @@ -325,8 +325,8 @@ if {$MEMDEBUG} { } -sqlbody { PRAGMA page_size = 512; VACUUM; - } - do_malloc_test vacuum3-malloc-2 -sqlprep { + } + do_malloc_test vacuum3-malloc-2 -sqlprep { PRAGMA encoding=UTF16; CREATE TABLE t1(a, b, c); INSERT INTO t1 VALUES(1, 2, 3); @@ -334,7 +334,7 @@ if {$MEMDEBUG} { INSERT INTO t2 SELECT * FROM t1; } -sqlbody { VACUUM; - } + } } finish_test diff --git a/third_party/sqlite/src/test/vacuum4.test b/third_party/sqlite/src/test/vacuum4.test index 326d0372764cf..fd63bba63c2d7 100644 --- a/third_party/sqlite/src/test/vacuum4.test +++ b/third_party/sqlite/src/test/vacuum4.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This file implements a test of ticket [da1151f97df244a1]: An # assertion fault while VACUUMing an auto_vacuumed database with # large schema. diff --git a/third_party/sqlite/src/test/vacuum5.test b/third_party/sqlite/src/test/vacuum5.test index 8e76a9393c6e6..96dbf46e96046 100644 --- a/third_party/sqlite/src/test/vacuum5.test +++ b/third_party/sqlite/src/test/vacuum5.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This file implements a test for VACUUM on attached databases. # @@ -117,7 +117,7 @@ do_catchsql_test vacuum5-2.0 { # if {$::TEMP_STORE<3 && [permutation]!="inmemory_journal"} { db close - testvfs tvfs + testvfs tvfs tvfs filter xOpen tvfs script open_cb forcedelete test.db @@ -146,7 +146,7 @@ if {$::TEMP_STORE<3 && [permutation]!="inmemory_journal"} { do_test 3.2 { lrange $::openfiles 0 4 } {test.db test.db-journal test.db-journal {} test.db-journal} -} +} diff --git a/third_party/sqlite/src/test/vacuummem.test b/third_party/sqlite/src/test/vacuummem.test index 0f77c1b4007f5..45a937db98553 100644 --- a/third_party/sqlite/src/test/vacuummem.test +++ b/third_party/sqlite/src/test/vacuummem.test @@ -25,7 +25,7 @@ if {[permutation]=="memsubsys1"} { # If ENABLE_MEMORY_MANAGEMENT is defined, when VACUUM is run the temp db # is able to borrow space from the main db (and it does, because the # temp db is configure with a very small cache). When the VACUUM is -# finished and the temp db closed, all the page-cache memory currently +# finished and the temp db closed, all the page-cache memory currently # assigned to the temp db is freed. If ENABLE_MEMORY_MANAGEMENT is defined # this causes the total memory usage to drop much more than expected, # causing tests in this file to fail. @@ -36,8 +36,8 @@ ifcapable memorymanage { } -proc memory_used {} { - set stat [sqlite3_status SQLITE_STATUS_MEMORY_USED 1] +proc memory_used {} { + set stat [sqlite3_status SQLITE_STATUS_MEMORY_USED 1] lindex $stat 1 } diff --git a/third_party/sqlite/src/test/view.test b/third_party/sqlite/src/test/view.test index 694b3c6abd859..07a25d5c42e19 100644 --- a/third_party/sqlite/src/test/view.test +++ b/third_party/sqlite/src/test/view.test @@ -201,8 +201,8 @@ do_test view-3.4 { } {a 2 a 3 a 5 a 6} do_test view-3.5 { execsql2 { - CREATE VIEW v4 AS - SELECT a, b FROM t1 + CREATE VIEW v4 AS + SELECT a, b FROM t1 UNION SELECT b AS 'x', a AS 'y' FROM t1 ORDER BY x, y; @@ -423,7 +423,7 @@ do_test view-9.2 { } {1 2 4} do_test view-9.3 { execsql { - CREATE VIEW v9 AS + CREATE VIEW v9 AS SELECT DISTINCT count(*) FROM t2 GROUP BY a ORDER BY 1 LIMIT 3; SELECT * FROM v9; } @@ -435,7 +435,7 @@ do_test view-9.4 { } {4 2 1} do_test view-9.5 { execsql { - CREATE VIEW v10 AS + CREATE VIEW v10 AS SELECT DISTINCT a, count(*) FROM t2 GROUP BY a ORDER BY 2 LIMIT 3; SELECT * FROM v10; } diff --git a/third_party/sqlite/src/test/vtab1.test b/third_party/sqlite/src/test/vtab1.test index 6b6a0e2683bcb..629644948c334 100644 --- a/third_party/sqlite/src/test/vtab1.test +++ b/third_party/sqlite/src/test/vtab1.test @@ -38,7 +38,7 @@ ifcapable !vtab||!schema_pragmas { # This file uses the "echo" module (see src/test8.c). Refer to comments # in that file for the special behaviour of the Tcl $echo_module variable. # -# TODO: +# TODO: # * How to test the sqlite3_index_constraint_usage.omit field? # * vtab1-5.* # @@ -140,7 +140,7 @@ do_test vtab-1.2152.4 { db eval {DROP TABLE t2152a; DROP TABLE t2152b} } {} -# Test to make sure nothing goes wrong and no memory is leaked if we +# Test to make sure nothing goes wrong and no memory is leaked if we # select an illegal table-name (i.e a reserved name or the name of a # table that already exists). # @@ -273,7 +273,7 @@ do_test vtab1-2.3 { set echo_module } [list xDisconnect] -# Re-open the database. This should not cause any virtual methods to +# Re-open the database. This should not cause any virtual methods to # be called. The invocation of xConnect() is delayed until the virtual # table schema is first required by the compiler. # @@ -308,7 +308,7 @@ do_test vtab1.2.8 { set echo_module } {xConnect echo main t1 template} -# Drop table t1. This should cause the xDestroy (but not xDisconnect) method +# Drop table t1. This should cause the xDestroy (but not xDisconnect) method # to be invoked. do_test vtab1-2.5 { set echo_module "" @@ -319,8 +319,8 @@ do_test vtab1-2.5 { } {xDestroy} do_test vtab1-2.6 { - execsql { - PRAGMA table_info(t1); + execsql { + PRAGMA table_info(t1); } } {} do_test vtab1-2.7 { @@ -330,20 +330,20 @@ do_test vtab1-2.7 { } [list {CREATE TABLE template(a, b, c)}] # Clean up other test artifacts: do_test vtab1-2.8 { - execsql { + execsql { DROP TABLE template; SELECT sql FROM sqlite_master; } } [list] #---------------------------------------------------------------------- -# Test case vtab1-3 test table scans and the echo module's +# Test case vtab1-3 test table scans and the echo module's # xBestIndex/xFilter handling of WHERE conditions. do_test vtab1-3.1 { set echo_module "" execsql { - CREATE TABLE treal(a INTEGER, b INTEGER, c); + CREATE TABLE treal(a INTEGER, b INTEGER, c); CREATE INDEX treal_idx ON treal(b); CREATE VIRTUAL TABLE t1 USING echo(treal); } @@ -362,7 +362,7 @@ do_test vtab1-3.2 { } } {} -# Put some data into the table treal. Then try a few simple SELECT +# Put some data into the table treal. Then try a few simple SELECT # statements on t1. # do_test vtab1-3.3 { @@ -481,7 +481,7 @@ do_test vtab1-3.15 { }; #ifcapable subquery #---------------------------------------------------------------------- -# Test case vtab1-3 test table scans and the echo module's +# Test case vtab1-3 test table scans and the echo module's # xBestIndex/xFilter handling of ORDER BY clauses. # This procedure executes the SQL. Then it checks to see if the OP_Sort @@ -536,7 +536,7 @@ execsql { } #---------------------------------------------------------------------- -# Test cases vtab1-5 test SELECT queries that include joins on virtual +# Test cases vtab1-5 test SELECT queries that include joins on virtual # tables. proc filter {log} { @@ -551,7 +551,7 @@ proc filter {log} { } do_test vtab1-5-1 { - execsql { + execsql { CREATE TABLE t1(a, b, c); CREATE TABLE t2(d, e, f); INSERT INTO t1 VALUES(1, 'red', 'green'); @@ -630,7 +630,7 @@ execsql { } #---------------------------------------------------------------------- -# Test cases vtab1-6 test INSERT, UPDATE and DELETE operations +# Test cases vtab1-6 test INSERT, UPDATE and DELETE operations # on virtual tables. do_test vtab1-6-1 { execsql { SELECT sql FROM sqlite_master } @@ -787,7 +787,7 @@ db2 close #---------------------------------------------------------------------- -# Test cases vtab1-7 tests that the value returned by +# Test cases vtab1-7 tests that the value returned by # sqlite3_last_insert_rowid() is set correctly when rows are inserted # into virtual tables. do_test vtab1.7-1 { @@ -1019,7 +1019,7 @@ do_test vtab1.11-5 { SELECT glob(a,'2') FROM e } } {{2 1} {2 2}} - + #---------------------------------------------------------------------- # Test the outcome if a constraint is encountered half-way through # a multi-row INSERT that is inside a transaction @@ -1068,35 +1068,35 @@ do_test vtab1.12-6 { # data. # do_test vtab1.13-1 { - execsql { - SELECT * FROM echo_c WHERE a IS NULL + execsql { + SELECT * FROM echo_c WHERE a IS NULL } } {} do_test vtab1.13-2 { - execsql { + execsql { INSERT INTO c VALUES(NULL, 15, 16); - SELECT * FROM echo_c WHERE a IS NULL + SELECT * FROM echo_c WHERE a IS NULL } } {{} 15 16} do_test vtab1.13-3 { - execsql { + execsql { INSERT INTO c VALUES(15, NULL, 16); - SELECT * FROM echo_c WHERE b IS NULL + SELECT * FROM echo_c WHERE b IS NULL } } {15 {} 16} do_test vtab1.13-4 { unset -nocomplain null - execsql { + execsql { SELECT * FROM echo_c WHERE b IS $null } } {15 {} 16} do_test vtab1.13-5 { - execsql { + execsql { SELECT * FROM echo_c WHERE b IS NULL AND a = 15; } } {15 {} 16} do_test vtab1.13-6 { - execsql { + execsql { SELECT * FROM echo_c WHERE NULL IS b AND a IS 15; } } {15 {} 16} @@ -1195,10 +1195,10 @@ do_test vtab1-15.4 { } } {1 {datatype mismatch}} -# The following tests - vtab1-16.* - are designed to test that setting -# sqlite3_vtab.zErrMsg variable can be used by the vtab interface to +# The following tests - vtab1-16.* - are designed to test that setting +# sqlite3_vtab.zErrMsg variable can be used by the vtab interface to # return an error message to the user. -# +# do_test vtab1-16.1 { execsql { CREATE TABLE t2(a PRIMARY KEY, b, c); @@ -1253,7 +1253,7 @@ ifcapable altertable { # characters that can be mistaken for printf() formatting directives. # do_test vtab1-17.1 { - execsql { + execsql { PRAGMA writable_schema = 1; INSERT INTO sqlite_master VALUES( 'table', 't3', 't3', 0, 'INSERT INTO "%s%s" VALUES(1)' @@ -1265,7 +1265,7 @@ do_test vtab1-17.1 { # This test verifies that ticket 48f29963 is fixed. # do_test vtab1-17.1 { - execsql { + execsql { CREATE TABLE t5(a, b); CREATE VIRTUAL TABLE e5 USING echo_v2(t5); BEGIN; @@ -1408,14 +1408,14 @@ do_execsql_test 21.3 { } {2 2 2} #------------------------------------------------------------------------- -# At one point executing a CREATE VIRTUAL TABLE statement that specified +# At one point executing a CREATE VIRTUAL TABLE statement that specified # a database name but no virtual table arguments was causing an internal -# buffer overread. Valgrind would report errors while running the following +# buffer overread. Valgrind would report errors while running the following # tests. Specifically: # # CREATE VIRTUAL TABLE t1 USING fts4; -- Ok - no db name. # CREATE VIRTUAL TABLE main.t1 USING fts4(x); -- Ok - has vtab arguments. -# CREATE VIRTUAL TABLE main.t1 USING fts4; -- Had the problem. +# CREATE VIRTUAL TABLE main.t1 USING fts4; -- Had the problem. # ifcapable fts3 { forcedelete test.db2 @@ -1423,27 +1423,27 @@ ifcapable fts3 { do_execsql_test 22.1 { ATTACH 'test.db2' AS $nm } - + execsql "SELECT * FROM sqlite_master" do_execsql_test 22.2 "CREATE VIRTUAL TABLE ${nm}.t1 USING fts4" - + do_test 22.3.1 { set sql "CREATE VIRTUAL TABLE ${nm}.t2 USING fts4" set stmt [sqlite3_prepare_v2 db $sql -1 dummy] sqlite3_step $stmt } {SQLITE_DONE} - + do_test 22.3.2 { sqlite3_finalize $stmt } {SQLITE_OK} - + do_test 22.4.1 { set sql "CREATE VIRTUAL TABLE ${nm}.t3 USING fts4" set n [string length $sql] set stmt [sqlite3_prepare db "${sql}xyz" $n dummy] sqlite3_step $stmt } {SQLITE_DONE} - + do_test 22.4.2 { sqlite3_finalize $stmt } {SQLITE_OK} @@ -1459,7 +1459,7 @@ ifcapable fts3 { # 23.2: Dropping a vtab while a SELECT that will, but has not yet, # open a cursor on the vtab, is running. In this case the # DROP TABLE succeeds and the SELECT hits an error. -# +# # 23.3: Dropping a vtab from within a user-defined-function callback # in the middle of an "INSERT INTO vtab SELECT ..." statement. # @@ -1480,14 +1480,14 @@ do_test 23.1 { } {1 {database table is locked}} do_test 23.2 { - execsql { + execsql { CREATE TABLE t2(value); INSERT INTO t2 VALUES(1), (2), (3); } set res2 [list [catch { db eval { - SELECT value FROM t2 UNION ALL + SELECT value FROM t2 UNION ALL SELECT value FROM t1 WHERE value<10 } { if {$value == 2} { set res1 [catchsql { DROP TABLE t1 }] } @@ -1511,8 +1511,8 @@ do_execsql_test 23.3.2 { SELECT * FROM t1e } {1 2 3 4} # ROLLBACK TO xyz; # RELEASE xyz; # -# was not invoking the xRollbackTo() callback for the ROLLBACK TO -# operation. Which meant that virtual tables like FTS3 would incorrectly +# was not invoking the xRollbackTo() callback for the ROLLBACK TO +# operation. Which meant that virtual tables like FTS3 would incorrectly # commit the results of the INSERT as part of the "RELEASE xyz" command. # # The following tests check that this has been fixed. diff --git a/third_party/sqlite/src/test/vtab2.test b/third_party/sqlite/src/test/vtab2.test index f0616513bd1e8..545a76f4e387d 100644 --- a/third_party/sqlite/src/test/vtab2.test +++ b/third_party/sqlite/src/test/vtab2.test @@ -80,7 +80,7 @@ foreach var [lsort [info vars tcl_*]] { do_test vtab2-2.3 { execsql { SELECT name, value FROM vars - WHERE name MATCH 'tcl_*' AND arrayname = '' + WHERE name MATCH 'tcl_*' AND arrayname = '' ORDER BY name; } } $result @@ -133,7 +133,7 @@ do_test vtab2-4.3 { } {a} do_test vtab2-4.4 { execsql { - UPDATE fkey + UPDATE fkey SET to_col = (SELECT name FROM v_col WHERE tablename = 't1' AND pk); } } {} diff --git a/third_party/sqlite/src/test/vtab3.test b/third_party/sqlite/src/test/vtab3.test index e8c6982a57c41..ead0fc5c886ec 100644 --- a/third_party/sqlite/src/test/vtab3.test +++ b/third_party/sqlite/src/test/vtab3.test @@ -40,9 +40,9 @@ proc auth {code arg1 arg2 arg3 arg4 args} { do_test vtab3-1.1 { execsql { CREATE TABLE elephant( - name VARCHAR(32), - color VARCHAR(16), - age INTEGER, + name VARCHAR(32), + color VARCHAR(16), + age INTEGER, UNIQUE(name, color) ); } diff --git a/third_party/sqlite/src/test/vtab5.test b/third_party/sqlite/src/test/vtab5.test index bb84a5ceec6c6..6f8969307b4b2 100644 --- a/third_party/sqlite/src/test/vtab5.test +++ b/third_party/sqlite/src/test/vtab5.test @@ -73,7 +73,7 @@ do_test vtab5.1.X { } {} # The following tests - vtab5-2.* - ensure that collation sequences -# assigned to virtual table columns via the "CREATE TABLE" statement +# assigned to virtual table columns via the "CREATE TABLE" statement # passed to sqlite3_declare_vtab() are used correctly. # do_test vtab5.2.1 { diff --git a/third_party/sqlite/src/test/vtab6.test b/third_party/sqlite/src/test/vtab6.test index f4504b017ddde..ecac675fb4ae9 100644 --- a/third_party/sqlite/src/test/vtab6.test +++ b/third_party/sqlite/src/test/vtab6.test @@ -53,7 +53,7 @@ do_test vtab6-1.1 { INSERT INTO t1 VALUES(2,3,4); INSERT INTO t1 VALUES(3,4,5); SELECT * FROM t1; - } + } } {1 2 3 2 3 4 3 4 5} do_test vtab6-1.2 { execsql { @@ -61,7 +61,7 @@ do_test vtab6-1.2 { INSERT INTO t2 VALUES(2,3,4); INSERT INTO t2 VALUES(3,4,5); SELECT * FROM t2; - } + } } {1 2 3 2 3 4 3 4 5} do_test vtab6-1.3 { @@ -159,7 +159,7 @@ do_test vtab6-1.12 { ifcapable subquery { do_test vtab6-1.13 { execsql2 { - SELECT * FROM t1 NATURAL JOIN + SELECT * FROM t1 NATURAL JOIN (SELECT b as 'c', c as 'd', d as 'e' FROM t2) as t3 } } {a 1 b 2 c 3 d 4 e 5} @@ -177,7 +177,7 @@ do_test vtab6-1.15 { INSERT INTO t3 VALUES(3,4,5); INSERT INTO t3 VALUES(4,5,6); SELECT * FROM t3; - } + } } {2 3 4 3 4 5 4 5 6} do_test vtab6-1.16 { execsql { @@ -195,7 +195,7 @@ do_test vtab6-1.18 { INSERT INTO t4 VALUES(3,4,5); INSERT INTO t4 VALUES(4,5,6); SELECT * FROM t4; - } + } } {2 3 4 3 4 5 4 5 6} do_test vtab6-1.19.1 { execsql { @@ -381,9 +381,9 @@ do_test vtab6-8.1 { INSERT INTO t9 VALUES(1,11); INSERT INTO t9 VALUES(2,22); INSERT INTO t10 VALUES(1,2); - INSERT INTO t10 VALUES(3,3); + INSERT INTO t10 VALUES(3,3); INSERT INTO t11 VALUES(2,111); - INSERT INTO t11 VALUES(3,333); + INSERT INTO t11 VALUES(3,333); CREATE VIEW v10_11 AS SELECT x, q FROM t10, t11 WHERE t10.y=t11.p; COMMIT; SELECT * FROM t9 LEFT JOIN v10_11 ON( a=x ); @@ -452,7 +452,7 @@ do_test vtab6-10.1 { CREATE INDEX i22 ON real_t22(q); SELECT a FROM t21 LEFT JOIN t22 ON b=p WHERE q= (SELECT max(m.q) FROM t22 m JOIN t21 n ON n.b=m.p WHERE n.c=1); - } + } } {} } ;# ifcapable subquery @@ -461,8 +461,8 @@ do_test vtab6-11.1.0 { CREATE TABLE ab_r(a, b); CREATE TABLE bc_r(b, c); - CREATE VIRTUAL TABLE ab USING echo(ab_r); - CREATE VIRTUAL TABLE bc USING echo(bc_r); + CREATE VIRTUAL TABLE ab USING echo(ab_r); + CREATE VIRTUAL TABLE bc USING echo(bc_r); INSERT INTO ab VALUES(1, 2); INSERT INTO bc VALUES(2, 3); diff --git a/third_party/sqlite/src/test/vtab7.test b/third_party/sqlite/src/test/vtab7.test index 162bab5e879a1..2d9dc06b95fbf 100644 --- a/third_party/sqlite/src/test/vtab7.test +++ b/third_party/sqlite/src/test/vtab7.test @@ -24,7 +24,7 @@ ifcapable !vtab { # Register the echo module. Code inside the echo module appends elements # to the global tcl list variable ::echo_module whenever SQLite invokes -# certain module callbacks. This includes the xSync(), xCommit() and +# certain module callbacks. This includes the xSync(), xCommit() and # xRollback() callbacks. For each of these callback, two elements are # appended to ::echo_module, as follows: # @@ -46,7 +46,7 @@ trace add variable ::echo_module write echo_module_trace # This Tcl proc is invoked whenever the ::echo_module variable is written. # proc echo_module_trace {args} { - # Filter out writes to ::echo_module that are not xSync, xCommit or + # Filter out writes to ::echo_module that are not xSync, xCommit or # xRollback callbacks. if {[llength $::echo_module] < 2} return set x [lindex $::echo_module end-1] @@ -60,7 +60,7 @@ proc echo_module_trace {args} { } } -# The following tests, vtab7-1.*, test that the trace callback on +# The following tests, vtab7-1.*, test that the trace callback on # ::echo_module is providing the expected tcl callbacks. do_test vtab7-1.1 { execsql { @@ -165,7 +165,7 @@ ifcapable attach { # } {1 {library routine called out of sequence}} # These tests, vtab7-4.*, test that an SQLITE_LOCKED error is returned -# if an attempt to write to a virtual module table or create a new +# if an attempt to write to a virtual module table or create a new # virtual table from within an xSync() callback. do_test vtab7-4.1 { execsql { diff --git a/third_party/sqlite/src/test/vtabF.test b/third_party/sqlite/src/test/vtabF.test index 7b11cb8c71acd..3a06a14d6e02b 100644 --- a/third_party/sqlite/src/test/vtabF.test +++ b/third_party/sqlite/src/test/vtabF.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# This file implements regression tests for SQLite library. +# This file implements regression tests for SQLite library. # This file checks to make sure IS NOT NULL constraints work on # virtual tables. # diff --git a/third_party/sqlite/src/test/vtabI.test b/third_party/sqlite/src/test/vtabI.test index 4b5a0a8c32e49..9df09eef0c1d4 100644 --- a/third_party/sqlite/src/test/vtabI.test +++ b/third_party/sqlite/src/test/vtabI.test @@ -29,16 +29,16 @@ do_execsql_test 1.0 { } foreach {tn query filter} { - 1 {SELECT * FROM e1} + 1 {SELECT * FROM e1} {SELECT rowid, a, b, c, d, e FROM 't1'} - 2 {SELECT a, b FROM e1} + 2 {SELECT a, b FROM e1} {SELECT rowid, a, b, NULL, NULL, NULL FROM 't1'} - 3 {SELECT count(*) FROM e1 GROUP BY b} + 3 {SELECT count(*) FROM e1 GROUP BY b} {SELECT rowid, NULL, b, NULL, NULL, NULL FROM 't1'} - 4 {SELECT count(*) FROM e1 GROUP BY b HAVING a=?} + 4 {SELECT count(*) FROM e1 GROUP BY b HAVING a=?} {SELECT rowid, a, b, NULL, NULL, NULL FROM 't1'} 5 {SELECT a FROM e1 WHERE c=?} @@ -69,10 +69,10 @@ proc all_col_list {} { proc part_col_list {cols} { set L [list] - for {set i 1} {$i <= 100} {incr i} { + for {set i 1} {$i <= 100} {incr i} { set c "c$i" if {[lsearch $cols $c]>=0} { - lappend L "c$i" + lappend L "c$i" } else { lappend L NULL } @@ -96,22 +96,22 @@ do_test 2.0 { } {} foreach {tn query filter} { - 1 {SELECT c1, c10, c20 FROM e2} + 1 {SELECT c1, c10, c20 FROM e2} {SELECT rowid, [CL c1 c10 c20] FROM 't2'} - 2 {SELECT c40, c50, c60 FROM e2} + 2 {SELECT c40, c50, c60 FROM e2} {SELECT rowid, [CL c40 c50 c60] FROM 't2'} - 3 {SELECT c7, c80, c90 FROM e2} + 3 {SELECT c7, c80, c90 FROM e2} {SELECT rowid, [CLT c7] FROM 't2'} - 4 {SELECT c64 FROM e2} + 4 {SELECT c64 FROM e2} {SELECT rowid, [CLT c64] FROM 't2'} - 5 {SELECT c63 FROM e2} + 5 {SELECT c63 FROM e2} {SELECT rowid, [CL c63] FROM 't2'} - 6 {SELECT c22 FROM e2 ORDER BY c50, c70} + 6 {SELECT c22 FROM e2 ORDER BY c50, c70} {SELECT rowid, [CLT c22 c50] FROM 't2'} } { diff --git a/third_party/sqlite/src/test/vtab_alter.test b/third_party/sqlite/src/test/vtab_alter.test index eb50a28a5e8d9..cb52d95d1be73 100644 --- a/third_party/sqlite/src/test/vtab_alter.test +++ b/third_party/sqlite/src/test/vtab_alter.test @@ -31,7 +31,7 @@ ifcapable !vtab||!altertable { # when an "ALTER TABLE ... RENAME TO" is executed on the v-table. # For example: # -# sqlite> CREATE TABLE t1_base(a, b, c); +# sqlite> CREATE TABLE t1_base(a, b, c); # sqlite> CREATE VIRTUAL TABLE t1 USING(t1_base); # sqlite> ALTER TABLE t1 RENAME TO t2; # sqlite> SELECT tbl_name FROM sqlite_master; @@ -62,11 +62,11 @@ do_test vtab_alter-1.6 { catchsql { SELECT * FROM new } } {0 {}} -# Try to rename an echo table that renames its base table. Make +# Try to rename an echo table that renames its base table. Make # sure nothing terrible happens. # do_test vtab_alter-2.1 { - execsql { + execsql { DROP TABLE new; DROP TABLE t1; CREATE TABLE t1_base(a, b, c); @@ -74,7 +74,7 @@ do_test vtab_alter-2.1 { } } {} do_test vtab_alter-2.2 { - execsql { + execsql { INSERT INTO t1_base VALUES(1, 2, 3); SELECT * FROM t1; } diff --git a/third_party/sqlite/src/test/vtab_err.test b/third_party/sqlite/src/test/vtab_err.test index 068386eb31e12..1b08847417ff5 100644 --- a/third_party/sqlite/src/test/vtab_err.test +++ b/third_party/sqlite/src/test/vtab_err.test @@ -48,7 +48,7 @@ ifcapable !memdebug { source $testdir/malloc_common.tcl -do_malloc_test vtab_err-2 -tclprep { +do_malloc_test vtab_err-2 -tclprep { register_echo_module [sqlite3_connection_pointer db] } -sqlbody { BEGIN; @@ -64,7 +64,7 @@ do_malloc_test vtab_err-2 -tclprep { INSERT INTO r2 SELECT * FROM e; INSERT INTO e SELECT a||'x', b, c FROM r2; COMMIT; -} +} sqlite3_memdebug_fail -1 diff --git a/third_party/sqlite/src/test/vtab_shared.test b/third_party/sqlite/src/test/vtab_shared.test index a9079eac04e4a..70d3b0cf40f16 100644 --- a/third_party/sqlite/src/test/vtab_shared.test +++ b/third_party/sqlite/src/test/vtab_shared.test @@ -64,7 +64,7 @@ do_test vtab_shared-1.6 { # shows that the correct sqlite3_vtab is being used. # do_test vtab_shared-1.8.1 { - execsql { + execsql { BEGIN; INSERT INTO t1 VALUES(4, 5, 6); SELECT * FROM t1; @@ -84,7 +84,7 @@ do_test vtab_shared-1.8.5 { execsql { SELECT * FROM t1 } db2 } {1 2 3 4 5 6} -# While a SELECT is active on virtual table t1 via connection [db], close +# While a SELECT is active on virtual table t1 via connection [db], close # [db2]. This causes the schema to be reset internally. Verify that this # does not cause a problem. # @@ -127,19 +127,19 @@ do_test vtab_shared-1.11 { ifcapable compound { do_test vtab_shared-1.12.1 { db close - execsql { + execsql { SELECT * FROM t1 UNION ALL SELECT * FROM t2 UNION ALL - SELECT * FROM t3 + SELECT * FROM t3 } db2 } {1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6} do_test vtab_shared-1.12.2 { sqlite3 db test.db register_echo_module [sqlite3_connection_pointer db] - execsql { + execsql { SELECT * FROM t1 UNION ALL SELECT * FROM t2 UNION ALL - SELECT * FROM t3 + SELECT * FROM t3 } db } {1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6} } @@ -169,7 +169,7 @@ do_test vtab_shared_1.14.1 { execsql { SELECT * FROM t3 } } {1 2 3 4 5 6} do_test vtab_shared_1.14.2 { - execsql { + execsql { UPDATE t3 SET c = 'six' WHERE c = 6; SELECT * FROM t3; } db2 @@ -181,7 +181,7 @@ do_test vtab_shared_1.14.3 { execsql { SELECT * FROM t3 } } {1 2 3 4 5 six} do_test vtab_shared_1.14.4 { - execsql { + execsql { DELETE FROM t3 WHERE c = 'six'; SELECT * FROM t3; } db2 @@ -193,7 +193,7 @@ do_test vtab_shared_1.14.5 { execsql { SELECT * FROM t3 } } {1 2 3} do_test vtab_shared_1.14.6 { - execsql { + execsql { INSERT INTO t3 VALUES(4, 5, 6); SELECT * FROM t3; } db2 @@ -203,7 +203,7 @@ do_test vtab_shared_1.15.1 { db2 close sqlite3 db2 test.db register_echo_module [sqlite3_connection_pointer db2] - execsql { + execsql { UPDATE t3 SET c = 'six' WHERE c = 6; SELECT * FROM t3; } db2 @@ -212,7 +212,7 @@ do_test vtab_shared_1.15.2 { db2 close sqlite3 db2 test.db register_echo_module [sqlite3_connection_pointer db2] - execsql { + execsql { DELETE FROM t3 WHERE c = 'six'; SELECT * FROM t3; } db2 @@ -221,7 +221,7 @@ do_test vtab_shared_1.15.3 { db2 close sqlite3 db2 test.db register_echo_module [sqlite3_connection_pointer db2] - execsql { + execsql { INSERT INTO t3 VALUES(4, 5, 6); SELECT * FROM t3; } @@ -238,19 +238,19 @@ ifcapable rtree { do_test 2.1.1 { sqlite3 db test.db sqlite3 db2 test.db - - # Create a virtual table using [db]. + + # Create a virtual table using [db]. execsql { CREATE VIRTUAL TABLE rt USING rtree(id, x1, x2); INSERT INTO rt VALUES(1, 2 ,3); SELECT * FROM rt; } - + # Drop the virtual table using [db2]. The sqlite3_vtab object belonging # to [db] is moved to the sqlite3.pDisconnect list. execsql { DROP TABLE rt } db2 - - # Immediately close [db]. At one point this would fail due to the + + # Immediately close [db]. At one point this would fail due to the # unfinalized statements held by the un-xDisconnect()ed sqlite3_vtab. db close } {} @@ -267,7 +267,7 @@ ifcapable fts3 { CREATE VIRTUAL TABLE ft USING fts3; INSERT INTO ft VALUES('hello world'); SELECT * FROM ft; - } + } execsql { DROP TABLE ft } db2 db close } {} diff --git a/third_party/sqlite/src/test/wal.test b/third_party/sqlite/src/test/wal.test index bb164bb76ad1a..c1236f5f91b63 100644 --- a/third_party/sqlite/src/test/wal.test +++ b/third_party/sqlite/src/test/wal.test @@ -72,9 +72,9 @@ do_test wal-0.2 { } {1024} do_test wal-1.0 { - execsql { + execsql { BEGIN; - CREATE TABLE t1(a, b); + CREATE TABLE t1(a, b); } list [file exists test.db-journal] \ [file exists test.db-wal] \ @@ -146,7 +146,7 @@ do_test wal-3.3 { db2 close #------------------------------------------------------------------------- -# The following tests, wal-4.*, test that savepoints work with WAL +# The following tests, wal-4.*, test that savepoints work with WAL # databases. # do_test wal-4.1 { @@ -350,7 +350,7 @@ foreach sector {512 4096} { db close file size test.db } [expr $pgsz*2] - + do_test wal-6.$sector.$pgsz.2 { log_deleted test.db-wal } {1} @@ -404,7 +404,7 @@ do_test wal-8.2 { file size test.db } [expr 68*1024] do_test wal-8.3 { - execsql { + execsql { DELETE FROM t1 WHERE rowid<54; PRAGMA wal_checkpoint; } @@ -440,7 +440,7 @@ do_test wal-9.3 { forcedelete test2.db test2.db-wal copy_file test.db test2.db copy_file test.db-wal test2.db-wal - sqlite3_wal db3 test2.db + sqlite3_wal db3 test2.db execsql {PRAGMA integrity_check } db3 } {ok} db3 close @@ -456,7 +456,7 @@ foreach handle {db db2 db3} { catch { $handle close } } unset handle #------------------------------------------------------------------------- -# The following block of tests - wal-10.* - test that the WAL locking +# The following block of tests - wal-10.* - test that the WAL locking # scheme works in simple cases. This block of tests is run twice. Once # using multiple connections in the address space of the current process, # and once with all connections except one running in external processes. @@ -483,7 +483,7 @@ do_multiclient_test tn { sql2 {SELECT * FROM t1} } {1 2} - # Have [db] commit the transaction. Check that [db2] is now seeing the + # Have [db] commit the transaction. Check that [db2] is now seeing the # new, updated snapshot. # do_test wal-10.$tn.3 { @@ -509,7 +509,7 @@ do_multiclient_test tn { sql2 COMMIT } {} - # Have [db2] open a write transaction. Then attempt to write to the + # Have [db2] open a write transaction. Then attempt to write to the # database via [db]. This should fail (writer lock cannot be obtained). # # Then open a read-transaction with [db]. Commit the [db2] transaction @@ -546,7 +546,7 @@ do_multiclient_test tn { sql2 { BEGIN; SELECT * FROM t1 } } {1 2 3 4 5 6 7 8 9 10} do_test wal-10.$tn.12 { - catchsql { PRAGMA wal_checkpoint } + catchsql { PRAGMA wal_checkpoint } } {0 {0 7 7}} ;# Reader no longer block checkpoints do_test wal-10.$tn.13 { execsql { INSERT INTO t1 VALUES(11, 12) } @@ -556,7 +556,7 @@ do_multiclient_test tn { # Writers do not block checkpoints any more either. # do_test wal-10.$tn.14 { - catchsql { PRAGMA wal_checkpoint } + catchsql { PRAGMA wal_checkpoint } } {0 {0 8 7}} # The following series of test cases used to verify another blocking @@ -566,10 +566,10 @@ do_multiclient_test tn { sql2 { COMMIT; BEGIN; SELECT * FROM t1; } } {1 2 3 4 5 6 7 8 9 10 11 12} do_test wal-10.$tn.16 { - catchsql { PRAGMA wal_checkpoint } + catchsql { PRAGMA wal_checkpoint } } {0 {0 8 8}} do_test wal-10.$tn.17 { - execsql { PRAGMA wal_checkpoint } + execsql { PRAGMA wal_checkpoint } } {0 8 8} do_test wal-10.$tn.18 { sql3 { BEGIN; SELECT * FROM t1 } @@ -647,7 +647,7 @@ do_multiclient_test tn { # releases all locks before returning a busy error. # do_test wal-10.$tn.35 { - execsql { + execsql { DELETE FROM t1; INSERT INTO t1 VALUES('a', 'b'); INSERT INTO t1 VALUES('c', 'd'); @@ -694,7 +694,7 @@ do_test wal-11.3 { } [list 3 [wal_file_size 4 1024]] do_test wal-11.4 { - execsql { + execsql { BEGIN; INSERT INTO t1 SELECT blob(900) FROM t1; -- 2 INSERT INTO t1 SELECT blob(900) FROM t1; -- 4 @@ -704,7 +704,7 @@ do_test wal-11.4 { list [expr [file size test.db]/1024] [file size test.db-wal] } [list 3 [wal_file_size 32 1024]] do_test wal-11.5 { - execsql { + execsql { SELECT count(*) FROM t1; PRAGMA integrity_check; } @@ -714,7 +714,7 @@ do_test wal-11.6 { list [expr [file size test.db]/1024] [file size test.db-wal] } [list 3 [wal_file_size 40 1024]] do_test wal-11.7 { - execsql { + execsql { SELECT count(*) FROM t1; PRAGMA integrity_check; } @@ -770,8 +770,8 @@ do_test wal-11.14 { #------------------------------------------------------------------------- -# This block of tests, wal-12.*, tests the fix for a problem that -# could occur if a log that is a prefix of an older log is written +# This block of tests, wal-12.*, tests the fix for a problem that +# could occur if a log that is a prefix of an older log is written # into a reused log file. # reopen_db @@ -807,7 +807,7 @@ db2 close do_test wal-12.5 { execsql { PRAGMA wal_checkpoint; - UPDATE t2 SET y = 2 WHERE x = 'B'; + UPDATE t2 SET y = 2 WHERE x = 'B'; PRAGMA wal_checkpoint; UPDATE t1 SET y = 1 WHERE x = 'A'; PRAGMA wal_checkpoint; @@ -848,7 +848,7 @@ do_test wal-14 { INSERT INTO t1 SELECT randomblob(10), randomblob(100) FROM t1; } - db2 eval { + db2 eval { INSERT INTO t1 SELECT randomblob(10), randomblob(100); INSERT INTO t1 SELECT randomblob(10), randomblob(100); INSERT INTO t1 SELECT randomblob(10), randomblob(100); @@ -858,11 +858,11 @@ do_test wal-14 { # After executing the "PRAGMA wal_checkpoint", connection [db] was being # left with an inconsistent cache. Running the CREATE INDEX statement # in this state led to database corruption. - catchsql { + catchsql { PRAGMA wal_checkpoint; CREATE INDEX i1 on t1(b); } - + db2 eval { PRAGMA integrity_check } } {ok} @@ -870,7 +870,7 @@ catch { db close } catch { db2 close } #------------------------------------------------------------------------- -# The following block of tests - wal-15.* - focus on testing the +# The following block of tests - wal-15.* - focus on testing the # implementation of the sqlite3_wal_checkpoint() interface. # forcedelete test.db test.db-wal @@ -916,7 +916,7 @@ do_test wal-15.3.3 { sqlite3_errmsg db } {database table is locked} -# Earlier versions returned an error is returned if the db cannot be +# Earlier versions returned an error is returned if the db cannot be # checkpointed because of locks held by another connection. Check that # this is no longer the case. # @@ -993,15 +993,15 @@ foreach {tn ckpt_cmd ckpt_res ckpt_main ckpt_aux} { INSERT INTO t2 VALUES(2, randomblob(1000)); INSERT INTO t1 SELECT * FROM t2; } - + list [file size test.db] [file size test.db-wal] } [list [expr 1*1024] [wal_file_size 10 1024]] do_test wal-16.$tn.3 { list [file size test2.db] [file size test2.db-wal] } [list [expr 1*1024] [wal_file_size 13 1024]] - + do_test wal-16.$tn.4 [list eval $ckpt_cmd] $ckpt_res - + do_test wal-16.$tn.5 { list [file size test.db] [file size test.db-wal] } [list [expr ($ckpt_main ? 7 : 1)*1024] [wal_file_size 10 1024]] @@ -1017,7 +1017,7 @@ foreach {tn ckpt_cmd ckpt_res ckpt_main ckpt_aux} { # The following tests - wal-17.* - attempt to verify that the correct # number of "padding" frames are appended to the log file when a transaction # is committed in synchronous=FULL mode. -# +# # Do this by creating a database that uses 512 byte pages. Then writing # a transaction that modifies 171 pages. In synchronous=NORMAL mode, this # produces a log file of: @@ -1027,7 +1027,7 @@ foreach {tn ckpt_cmd ckpt_res ckpt_main ckpt_aux} { # Slightly larger than 11*8192 = 90112 bytes. # # Run the test using various different sector-sizes. In each case, the -# WAL code should write the 90300 bytes of log file containing the +# WAL code should write the 90300 bytes of log file containing the # transaction, then append as may frames as are required to extend the # log file so that no part of the next transaction will be written into # a disk-sector used by transaction just committed. @@ -1037,7 +1037,7 @@ catch { db close } foreach {tn sectorsize logsize} " 1 128 [wal_file_size 172 512] 2 256 [wal_file_size 172 512] - 3 512 [wal_file_size 172 512] + 3 512 [wal_file_size 172 512] 4 1024 [wal_file_size 172 512] 5 2048 [wal_file_size 172 512] 6 4096 [wal_file_size 176 512] @@ -1082,7 +1082,7 @@ sqlite3_test_control_pending_byte $old_pending_byte # This test - wal-18.* - verifies a couple of specific conditions that # may be encountered while recovering a log file are handled correctly: # -# wal-18.1.* When the first 32-bits of a frame checksum is correct but +# wal-18.1.* When the first 32-bits of a frame checksum is correct but # the second 32-bits are false, and # # wal-18.2.* When the page-size field that occurs at the start of a log @@ -1129,13 +1129,13 @@ foreach {nFrame result} { hexio_write test.db-wal [expr 24 + $nFrame*(24+1024) + 20] 00000000 sqlite3 db test.db - execsql { + execsql { SELECT * FROM t1; - PRAGMA integrity_check; + PRAGMA integrity_check; } } [concat $result ok] db close -} +} proc randomblob {pgsz} { sqlite3 rbdb :memory: @@ -1151,7 +1151,7 @@ proc logcksum {ckv1 ckv2 blob} { # Since the magic number at the start of the -wal file header is # 931071618 that indicates that the content should always be read as # little-endian. - # + # set scanpattern i* binary scan $blob $scanpattern values @@ -1162,7 +1162,7 @@ proc logcksum {ckv1 ckv2 blob} { } forcecopy test.db testX.db -foreach {tn pgsz works} { +foreach {tn pgsz works} { 1 128 0 2 256 0 3 512 1 @@ -1184,14 +1184,14 @@ foreach {tn pgsz works} { for {set pg 1} {$pg <= 3} {incr pg} { forcecopy testX.db test.db forcedelete test.db-wal - + # Check that the database now exists and consists of three pages. And # that there is no associated wal file. # do_test wal-18.2.$tn.$pg.1 { file exists test.db-wal } 0 do_test wal-18.2.$tn.$pg.2 { file exists test.db } 1 do_test wal-18.2.$tn.$pg.3 { file size test.db } [expr 1024*3] - + do_test wal-18.2.$tn.$pg.4 { # Create a wal file that contains a single frame (database page @@ -1223,16 +1223,16 @@ foreach {tn pgsz works} { puts -nonewline $fd $framehdr puts -nonewline $fd $framebody close $fd - + file size test.db-wal } [wal_file_size 1 $pgsz] - + do_test wal-18.2.$tn.$pg.5 { sqlite3 db test.db set rc [catch { db one {PRAGMA integrity_check} } msg] expr { $rc!=0 || $msg!="ok" } } $works - + db close } } @@ -1245,7 +1245,7 @@ foreach {tn pgsz works} { # EXCLUSIVE lock on the database file. If the lock is obtained, the # connection knows that it is the last connection to disconnect from # the database, so it runs a checkpoint operation. The bug was that -# the connection was not updating its private copy of the wal-index +# the connection was not updating its private copy of the wal-index # header before doing so, meaning that it could checkpoint an old # snapshot. # @@ -1288,7 +1288,7 @@ do_test wal-19.4 { # 1. Using connection 1, create the database schema. # # 2. Using connection 2 (in an external process), add so much -# data to the database without checkpointing that a wal-index +# data to the database without checkpointing that a wal-index # larger than 64KB is required. # # 3. Using connection 1, checkpoint the database. Make sure all @@ -1348,7 +1348,7 @@ catch { db close } do_test wal-21.1 { faultsim_delete_and_reopen - execsql { + execsql { PRAGMA journal_mode = WAL; CREATE TABLE t1(a, b); INSERT INTO t1 VALUES(1, 2); @@ -1360,7 +1360,7 @@ do_test wal-21.1 { } } {wal} do_test wal-21.2 { - execsql { + execsql { PRAGMA cache_size = 10; PRAGMA wal_checkpoint; BEGIN; @@ -1402,7 +1402,7 @@ foreach pgsz {512 1024 2048 4096 8192 16384 32768 65536} { incr ::do_not_use_codec -1 #------------------------------------------------------------------------- -# Test that when 1 or more pages are recovered from a WAL file, +# Test that when 1 or more pages are recovered from a WAL file, # sqlite3_log() is invoked to report this to the user. # ifcapable curdir { @@ -1436,19 +1436,19 @@ do_test wal-23.3 { faultsim_restore_and_reopen execsql { SELECT * FROM t1 } } {1 2 3 4} -do_test wal-23.4 { - set ::log +do_test wal-23.4 { + set ::log } [list SQLITE_NOTICE_RECOVER_WAL \ "recovered 2 frames from WAL file $walfile"] ifcapable autovacuum { - # This block tests that if the size of a database is reduced by a + # This block tests that if the size of a database is reduced by a # transaction (because of an incremental or auto-vacuum), that no # data is written to the WAL file for the truncated pages as part # of the commit. e.g. if a transaction reduces the size of a database - # to N pages, data for page N+1 should not be written to the WAL file - # when committing the transaction. At one point such data was being + # to N pages, data for page N+1 should not be written to the WAL file + # when committing the transaction. At one point such data was being # written. # catch {db close} @@ -1465,7 +1465,7 @@ ifcapable autovacuum { INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; } {wal} - do_test 24.2 { + do_test 24.2 { execsql { DELETE FROM t1; PRAGMA wal_checkpoint; @@ -1478,7 +1478,7 @@ ifcapable autovacuum { file size test.db } [expr 84 * 1024] do_test 24.4 { - execsql { + execsql { PRAGMA cache_size = 200; PRAGMA incremental_vacuum; PRAGMA wal_checkpoint; diff --git a/third_party/sqlite/src/test/wal2.test b/third_party/sqlite/src/test/wal2.test index 0b15b1546170b..3cff676b96edc 100644 --- a/third_party/sqlite/src/test/wal2.test +++ b/third_party/sqlite/src/test/wal2.test @@ -93,9 +93,9 @@ proc incr_tvfs_hdr {file idx incrval} { # database content. # do_test wal2-1.0 { - proc tvfs_cb {method filename args} { + proc tvfs_cb {method filename args} { set ::filename $filename - return SQLITE_OK + return SQLITE_OK } testvfs tvfs @@ -310,7 +310,7 @@ do_test wal2-3.0 { INSERT INTO t1 VALUES(2); INSERT INTO t1 VALUES(3); INSERT INTO t1 VALUES(4); - } + } set ::locked 1 info exists ::locked @@ -433,13 +433,13 @@ tvfs delete # # wal2-6.2.*: Changing to WAL mode after setting locking_mode=exclusive. # -# wal2-6.3.*: Changing back to rollback mode from WAL mode after setting +# wal2-6.3.*: Changing back to rollback mode from WAL mode after setting # locking_mode=exclusive. # # wal2-6.4.*: Check that xShmLock calls are omitted in exclusive locking # mode. # -# wal2-6.5.*: +# wal2-6.5.*: # # wal2-6.6.*: Check that if the xShmLock() to reaquire a WAL read-lock when # exiting exclusive mode fails (i.e. SQLITE_IOERR), then the @@ -469,13 +469,13 @@ do_test wal2-6.1.3 { } } {main exclusive temp closed} do_test wal2-6.1.4 { - execsql { - PRAGMA locking_mode = normal; + execsql { + PRAGMA locking_mode = normal; PRAGMA lock_status; } } {normal main exclusive temp closed} do_test wal2-6.1.5 { - execsql { + execsql { SELECT * FROM t1; PRAGMA lock_status; } @@ -578,7 +578,7 @@ do_test wal2-6.3.3 { execsql { PRAGMA lock_status } } {main exclusive temp closed} do_test wal2-6.3.4 { - execsql { + execsql { BEGIN; INSERT INTO t1 VALUES('Groucho'); } @@ -615,16 +615,16 @@ do_test wal2-6.4.1 { } {} set RECOVERY { - {0 1 lock exclusive} {1 7 lock exclusive} + {0 1 lock exclusive} {1 7 lock exclusive} {1 7 unlock exclusive} {0 1 unlock exclusive} } set READMARK0_READ { {3 1 lock shared} {3 1 unlock shared} } set READMARK0_WRITE { - {3 1 lock shared} - {0 1 lock exclusive} {3 1 unlock shared} - {4 1 lock exclusive} {4 1 unlock exclusive} {4 1 lock shared} + {3 1 lock shared} + {0 1 lock exclusive} {3 1 unlock shared} + {4 1 lock exclusive} {4 1 unlock exclusive} {4 1 lock shared} {0 1 unlock exclusive} {4 1 unlock shared} } set READMARK1_SET { @@ -634,8 +634,8 @@ set READMARK1_READ { {4 1 lock shared} {4 1 unlock shared} } set READMARK1_WRITE { - {4 1 lock shared} - {0 1 lock exclusive} {0 1 unlock exclusive} + {4 1 lock shared} + {0 1 lock exclusive} {0 1 unlock exclusive} {4 1 unlock shared} } @@ -649,12 +649,12 @@ foreach {tn sql res expected_locks} { INSERT INTO t1 VALUES('Arthur'); COMMIT; } {wal} { - $RECOVERY + $RECOVERY $READMARK0_WRITE } 3 { - # This test should do the READMARK1_SET locking to populate the + # This test should do the READMARK1_SET locking to populate the # aReadMark[1] slot with the current mxFrame value. Followed by # READMARK1_READ to read the database. # @@ -669,13 +669,13 @@ foreach {tn sql res expected_locks} { # this time, not READMARK1_SET. # SELECT * FROM t1 ORDER BY x - } {Arthur Leonard} { - $READMARK1_READ + } {Arthur Leonard} { + $READMARK1_READ } 5 { PRAGMA locking_mode = exclusive - } {exclusive} { } + } {exclusive} { } 6 { INSERT INTO t1 VALUES('Julius Henry'); @@ -711,7 +711,7 @@ foreach {tn sql res expected_locks} { foreach el [subst $expected_locks] { lappend L $el } set S "" - foreach sq [split $sql "\n"] { + foreach sq [split $sql "\n"] { set sq [string trim $sq] if {[string match {#*} $sq]==0} {append S "$sq\n"} } @@ -771,7 +771,7 @@ do_test wal2-6.6.2 { do_test wal2-6.6.3 { # At this point the connection should still be in exclusive-mode, even # though it tried to exit exclusive-mode when committing the INSERT - # statement above. To exit exclusive mode, SQLite has to take a read-lock + # statement above. To exit exclusive mode, SQLite has to take a read-lock # on the WAL file using xShmLock(). Since that call failed, it remains # in exclusive mode. # @@ -812,8 +812,8 @@ do_test wal2-7.1.2 { forcecopy test.db test2.db forcecopy test.db-wal test2.db-wal # The first 32 bytes of the WAL file contain the WAL header. Offset 48 - # is the first byte of the checksum for the first frame in the WAL. - # The following three lines replaces the contents of that byte with + # is the first byte of the checksum for the first frame in the WAL. + # The following three lines replaces the contents of that byte with # a different value. set newval FF if {$newval == [hexio_read test2.db-wal 48 1]} { set newval 00 } @@ -875,7 +875,7 @@ db close # Test that even if the checksums for both are valid, if the two copies # of the wal-index header in the wal-index do not match, the client # runs (or at least tries to run) database recovery. -# +# # proc get_name {method args} { set ::filename [lindex $args 0] ; tvfs filter {} } testvfs tvfs @@ -930,9 +930,9 @@ db close #------------------------------------------------------------------------- # This block of tests - wal2-10.* - focus on the libraries response to -# new versions of the wal or wal-index formats. +# new versions of the wal or wal-index formats. # -# wal2-10.1.*: Test that the library refuses to "recover" a new WAL +# wal2-10.1.*: Test that the library refuses to "recover" a new WAL # format. # # wal2-10.2.*: Test that the library refuses to read or write a database @@ -973,13 +973,13 @@ do_test wal2-10.2.1 { faultsim_restore_and_reopen execsql { SELECT * FROM t1 } } {1 2 3 4} -do_test wal2-10.2.2 { - set hdr [set_tvfs_hdr $::filename] - lindex $hdr 0 +do_test wal2-10.2.2 { + set hdr [set_tvfs_hdr $::filename] + lindex $hdr 0 } {3007000} -do_test wal2-10.2.3 { +do_test wal2-10.2.3 { lset hdr 0 3007001 - wal_fix_walindex_cksum hdr + wal_fix_walindex_cksum hdr set_tvfs_hdr $::filename $hdr catchsql { SELECT * FROM t1 } } {1 {unable to open database file}} @@ -989,7 +989,7 @@ tvfs delete #------------------------------------------------------------------------- # This block of tests - wal2-11.* - tests that it is not possible to put # the library into an infinite loop by presenting it with a corrupt -# hash table (one that appears to contain a single chain of infinite +# hash table (one that appears to contain a single chain of infinite # length). # # wal2-11.1.*: While reading the hash-table. @@ -1029,7 +1029,7 @@ if {$::tcl_version>=8.5} { do_test wal2-11.2 { catchsql { INSERT INTO t1 VALUES(10, 11, 12) } } {1 {database disk image is malformed}} - + # Fill up the hash table on the first page of shared memory with 0x55 bytes. # set blob [string range [tvfs shm $::filename] 0 16383] @@ -1045,8 +1045,8 @@ db2 close tvfs delete #------------------------------------------------------------------------- -# If a connection is required to create a WAL or SHM file, it creates -# the new files with the same file-system permissions as the database +# If a connection is required to create a WAL or SHM file, it creates +# the new files with the same file-system permissions as the database # file itself. Test this. # if {$::tcl_platform(platform) == "unix"} { @@ -1054,18 +1054,18 @@ if {$::tcl_platform(platform) == "unix"} { # Changed on 2012-02-13: umask is deliberately ignored for -wal files. #set umask [exec /bin/sh -c umask] set umask 0 - + do_test wal2-12.1 { sqlite3 db test.db - execsql { + execsql { CREATE TABLE tx(y, z); PRAGMA journal_mode = WAL; } db close list [file exists test.db-wal] [file exists test.db-shm] } {0 0} - + foreach {tn permissions} { 1 00644 2 00666 @@ -1160,14 +1160,14 @@ if {$::tcl_platform(platform) == "unix"} { # If $can_read is true, then the client should be able to read from # the database file. If $can_read is false, attempting to read should - # throw the "unable to open database file" exception. + # throw the "unable to open database file" exception. # set a(0) {1 {unable to open database file}} set a(1) {0 {3.14 2.72}} do_test wal2-13.$tn.3 { catchsql { SELECT * FROM t1 } } $a($can_read) - + # Now try to write to the db file. If the client can read but not # write, then it should throw the familiar "unable to open db file" # exception. If it can read but not write, the exception should @@ -1315,7 +1315,7 @@ foreach {tn settings restart_sync commit_sync ckpt_sync} { execsql { PRAGMA wal_checkpoint } list $::sync(normal) $::sync(full) } $ckpt_sync - + db close tvfs delete } diff --git a/third_party/sqlite/src/test/wal3.test b/third_party/sqlite/src/test/wal3.test index 56f40ab539193..1de99d773b9fd 100644 --- a/third_party/sqlite/src/test/wal3.test +++ b/third_party/sqlite/src/test/wal3.test @@ -81,7 +81,7 @@ for {set i 1} {$i < 50} {incr i} { } } {ok} - # Check that everything looks OK from the point of view of an + # Check that everything looks OK from the point of view of an # external connection. # sqlite3 db2 test.db @@ -95,9 +95,9 @@ for {set i 1} {$i < 50} {incr i} { execsql { PRAGMA integrity_check } db2 } {ok} db2 close - + # Check that the file-system in its current state can be recovered. - # + # forcecopy test.db test2.db forcecopy test.db-wal test2.db-wal forcedelete test2.db-journal @@ -126,7 +126,7 @@ do_multiclient_test i { set tn $testname($i) do_test wal3-2.$tn.1 { - sql1 { + sql1 { PRAGMA page_size = 1024; PRAGMA journal_mode = WAL; } @@ -199,26 +199,26 @@ catch {db close} # synchronous=off, synchronous=normal and synchronous=full. # foreach {tn syncmode synccount} { - 1 off + 1 off {} - 2 normal + 2 normal {test.db-wal normal test.db normal} - 3 full + 3 full {test.db-wal normal test.db-wal normal test.db-wal normal test.db normal} } { - proc sync_counter {args} { + proc sync_counter {args} { foreach {method filename id flags} $args break lappend ::syncs [file tail $filename] $flags } do_test wal3-3.$tn { forcedelete test.db test.db-wal test.db-journal - + testvfs T - T filter {} + T filter {} T script sync_counter sqlite3 db test.db -vfs T - + execsql "PRAGMA synchronous = $syncmode" execsql "PRAGMA checkpoint_fullfsync = 0" execsql { PRAGMA journal_mode = WAL } @@ -243,7 +243,7 @@ foreach {tn syncmode synccount} { #------------------------------------------------------------------------- # Only one client may run recovery at a time. Test this mechanism. # -# When client-2 tries to open a read transaction while client-1 is +# When client-2 tries to open a read transaction while client-1 is # running recovery, it fails to obtain a lock on an aReadMark[] slot # (because they are all locked by recovery). It then tries to obtain # a shared lock on the RECOVER lock to see if there really is a @@ -275,7 +275,7 @@ proc method_callback {method args} { if {$::barrier_count == 2} { # This code is executed within the xShmBarrier() callback invoked # by the client running recovery as part of writing the recovered - # wal-index header. If a second client attempts to access the + # wal-index header. If a second client attempts to access the # database now, it reads a corrupt (partially written) wal-index # header. But it cannot even get that far, as the first client # is still holding all the locks (recovery takes an exclusive lock @@ -340,10 +340,10 @@ T delete #------------------------------------------------------------------------- # When opening a read-transaction on a database, if the entire log has # already been copied to the database file, the reader grabs a special -# kind of read lock (on aReadMark[0]). This set of test cases tests the +# kind of read lock (on aReadMark[0]). This set of test cases tests the # outcome of the following: # -# + The reader discovering that between the time when it determined +# + The reader discovering that between the time when it determined # that the log had been completely backfilled and the lock is obtained # that a writer has written to the log. In this case the reader should # acquire a different read-lock (not aReadMark[0]) and read the new @@ -375,7 +375,7 @@ do_test wal3-6.1.3 { execsql { PRAGMA wal_checkpoint } db2 } {0 4 4} -# At this point the log file has been fully checkpointed. However, +# At this point the log file has been fully checkpointed. However, # connection [db3] holds a lock that prevents the log from being wrapped. # Test case 3.6.1.4 has [db] attempt a read-lock on aReadMark[0]. But # as it is obtaining the lock, [db2] appends to the log file. @@ -400,7 +400,7 @@ do_test wal3-6.1.4 { } } {o t t f f s} -# [db] should be left holding a read-lock on some slot other than +# [db] should be left holding a read-lock on some slot other than # aReadMark[0]. Test this by demonstrating that the read-lock is preventing # the log from being wrapped. # @@ -480,7 +480,7 @@ do_test wal3-6.2.5 { set sz2 [file size test.db-wal] expr {$sz2 == $sz1} } {1} - + db2 close db close T delete @@ -492,9 +492,9 @@ T delete # with the outcome of the following: # # + The reader discovering that between the time when it read the -# wal-index header and the lock was obtained that a writer has -# written to the log. In this case the reader should re-read the -# wal-index header and lock a snapshot corresponding to the new +# wal-index header and the lock was obtained that a writer has +# written to the log. In this case the reader should re-read the +# wal-index header and lock a snapshot corresponding to the new # header. # # + The value in the aReadMark[x] slot has been modified since it was @@ -561,7 +561,7 @@ T delete #------------------------------------------------------------------------- # When a connection opens a read-lock on the database, it searches for # an aReadMark[] slot that is already set to the mxFrame value for the -# new transaction. If it cannot find one, it attempts to obtain an +# new transaction. If it cannot find one, it attempts to obtain an # exclusive lock on an aReadMark[] slot for the purposes of modifying # the value, then drops back to a shared-lock for the duration of the # transaction. @@ -604,12 +604,12 @@ for {set i 0} {$i < $nConn} {incr i} { set sz [expr 1024 * (2+$AUTOVACUUM)] do_test wal3-9.3 { for {set i 0} {$i < ($nConn-1)} {incr i} { db$i close } - execsql { PRAGMA wal_checkpoint } + execsql { PRAGMA wal_checkpoint } byte_is_zero test.db [expr $sz-1024] } {1} do_test wal3-9.4 { db[expr $nConn-1] close - execsql { PRAGMA wal_checkpoint } + execsql { PRAGMA wal_checkpoint } set sz2 [file size test.db] byte_is_zero test.db [expr $sz-1024] } {0} diff --git a/third_party/sqlite/src/test/wal4.test b/third_party/sqlite/src/test/wal4.test index c7a4381341741..9973f493cdf26 100644 --- a/third_party/sqlite/src/test/wal4.test +++ b/third_party/sqlite/src/test/wal4.test @@ -28,7 +28,7 @@ do_test wal4-1.1 { } {wal 1 2} do_test wal4-1.2 { - # Save a copy of the file-system containing the wal and wal-index files + # Save a copy of the file-system containing the wal and wal-index files # only (no database file). faultsim_save_and_close forcedelete sv_test.db @@ -53,10 +53,10 @@ do_faultsim_test wal4-2 -prep { # it should still be zero bytes in size regardless of whether or not # a fault was injected. Test these assertions: # - if { $testrc==0 && [file exists test.db-wal] } { + if { $testrc==0 && [file exists test.db-wal] } { error "Wal file was not deleted" } - if { [file size test.db]!=0 } { + if { [file size test.db]!=0 } { error "Db file grew to [file size test.db] bytes" } } diff --git a/third_party/sqlite/src/test/wal5.test b/third_party/sqlite/src/test/wal5.test index 50c517286a9d7..211983614e1e0 100644 --- a/third_party/sqlite/src/test/wal5.test +++ b/third_party/sqlite/src/test/wal5.test @@ -27,7 +27,7 @@ proc wal_page_count {{file test.db}} { wal_frame_count ${file}-wal 1024 } # A checkpoint may be requested either using the C API or by executing -# an SQL PRAGMA command. To test both methods, all tests in this file are +# an SQL PRAGMA command. To test both methods, all tests in this file are # run twice - once using each method to request checkpoints. # foreach {testprefix do_wal_checkpoint} { @@ -74,7 +74,7 @@ foreach {testprefix do_wal_checkpoint} { set ::nBusyHandler 0 set ::busy_handler_script "" proc busyhandler {n} { - incr ::nBusyHandler + incr ::nBusyHandler eval $::busy_handler_script return 0 } @@ -124,7 +124,7 @@ foreach {testprefix do_wal_checkpoint} { # Now do a blocking-checkpoint. Set the busy-handler up so that connection # 2 releases its lock on the 6th invocation. The checkpointer should then - # proceed to checkpoint the entire log file. Next write should go to the + # proceed to checkpoint the entire log file. Next write should go to the # start of the log file. # set ::busy_handler_script { if {$n==5} { sql2 COMMIT } } @@ -150,8 +150,8 @@ foreach {testprefix do_wal_checkpoint} { } [expr {[nonzero_reserved_bytes]?"/# # #/":"7 5 0"}] do_test 1.$tn.10 { sql3 { BEGIN ; SELECT x FROM t1 } } {1 2 3 4 5 6} - set ::busy_handler_script { - if {$n==5} { sql2 COMMIT } + set ::busy_handler_script { + if {$n==5} { sql2 COMMIT } if {$n==6} { set ::db_file_size [db_page_count] } if {$n==7} { sql3 COMMIT } } @@ -163,7 +163,7 @@ foreach {testprefix do_wal_checkpoint} { } #------------------------------------------------------------------------- - # This block of tests explores checkpoint operations on more than one + # This block of tests explores checkpoint operations on more than one # database file. # proc setup_and_attach_aux {} { @@ -187,7 +187,7 @@ foreach {testprefix do_wal_checkpoint} { # Test that executing "PRAGMA wal_checkpoint" checkpoints all attached # databases, not just the main db. In capi mode, check that this is - # true if a NULL pointer is passed to wal_checkpoint_v2() in place of a + # true if a NULL pointer is passed to wal_checkpoint_v2() in place of a # database name. do_multiclient_test tn { setup_and_attach_aux @@ -263,7 +263,7 @@ foreach {testprefix do_wal_checkpoint} { # database file, RESTART checkpoints block until readers using any part # of the log file have finished. # - # This test case involves running a checkpoint while there exist other + # This test case involves running a checkpoint while there exist other # processes holding all three types of locks. # foreach {tn1 checkpoint busy_on ckpt_expected expected} { @@ -324,7 +324,7 @@ foreach {testprefix do_wal_checkpoint} { code1 $do_wal_checkpoint code2 $do_wal_checkpoint code3 $do_wal_checkpoint - + do_test 3.$tn.1 { sql1 { PRAGMA auto_vacuum = 0; @@ -391,7 +391,7 @@ foreach {testprefix do_wal_checkpoint} { } [wal_file_size 2 1024] } - + # Test that FULL, RESTART and TRUNCATE callbacks block on other clients # and truncate the wal file as required even if the entire wal file has # already been checkpointed when they are invoked. @@ -417,13 +417,13 @@ foreach {testprefix do_wal_checkpoint} { file size test.db-wal } [wal_file_size 10 1024] - do_test 5.$tn.2 { + do_test 5.$tn.2 { sql2 { BEGIN; SELECT * FROM t1 } } {1 2 3 4 5 6} do_test 5.$tn.3 { do_wal_checkpoint db -mode passive } {0 10 10} - do_test 5.$tn.4 { + do_test 5.$tn.4 { sql3 { BEGIN; INSERT INTO t1 VALUES(7, 8); } } {} @@ -435,7 +435,7 @@ foreach {testprefix do_wal_checkpoint} { do_test 5.$tn.8 { do_wal_checkpoint db -mode full } {0 10 10} do_test 5.$tn.9 { do_wal_checkpoint db -mode truncate } {1 10 10} - do_test 5.$tn.10 { + do_test 5.$tn.10 { file size test.db-wal } [wal_file_size 10 1024] @@ -453,7 +453,7 @@ foreach {testprefix do_wal_checkpoint} { } } {1 2 3 4 5 6 7 8 9 10} - do_test 5.$tn.14 { + do_test 5.$tn.14 { sql2 { BEGIN; SELECT * FROM t1 } } {1 2 3 4 5 6 7 8 9 10} diff --git a/third_party/sqlite/src/test/wal6.test b/third_party/sqlite/src/test/wal6.test index 9bbc58409d623..d3d82ad377dac 100644 --- a/third_party/sqlite/src/test/wal6.test +++ b/third_party/sqlite/src/test/wal6.test @@ -101,23 +101,23 @@ do_test 2.2 { } db2 } {1 one 2 two} -do_catchsql_test 2.3 { - INSERT INTO t1 VALUES('x', 'x') +do_catchsql_test 2.3 { + INSERT INTO t1 VALUES('x', 'x') } {1 {database is locked}} -do_test 2.4 { +do_test 2.4 { list [sqlite3_errcode db] [sqlite3_extended_errcode db] } {SQLITE_BUSY SQLITE_BUSY_SNAPSHOT} do_execsql_test 2.5 { SELECT * FROM t1; COMMIT; - INSERT INTO t1 VALUES('x', 'x') + INSERT INTO t1 VALUES('x', 'x') } {1 one 2 two} proc test3 {prefix} { do_test $prefix.1 { - execsql { SELECT count(*) FROM t1 } + execsql { SELECT count(*) FROM t1 } } {0} do_test $prefix.2 { execsql { INSERT INTO t1 VALUES('x', 'x') } db2 @@ -126,7 +126,7 @@ proc test3 {prefix} { execsql { INSERT INTO t1 VALUES('y', 'y') } } {} do_test $prefix.4 { - execsql { SELECT count(*) FROM t1 } + execsql { SELECT count(*) FROM t1 } } {2} } @@ -143,7 +143,7 @@ do_test 2.x { #------------------------------------------------------------------------- # Check that if BEGIN IMMEDIATE fails, it does not leave the user with -# an open read-transaction (unless one was already open before the BEGIN +# an open read-transaction (unless one was already open before the BEGIN # IMMEDIATE). Even if there are other active VMs. # @@ -166,13 +166,13 @@ proc test4 {prefix} { reset_db sqlite3 db2 test.db -do_execsql_test 3.1 { +do_execsql_test 3.1 { PRAGMA journal_mode = WAL; CREATE TABLE ab(a PRIMARY KEY, b); } {wal} -do_test 3.2.1 { - execsql { +do_test 3.2.1 { + execsql { BEGIN; INSERT INTO ab VALUES(1, 2); } db2 @@ -181,7 +181,7 @@ test4 3.2.2 db func test4 test4 do_test 3.3.1 { - execsql { + execsql { BEGIN; INSERT INTO ab VALUES(3, 4); } db2 @@ -213,7 +213,7 @@ do_test 4.2 { do_test 4.3 { sqlite3 db2 test.db - execsql { + execsql { BEGIN; INSERT INTO t2 VALUES(3, 4); } @@ -227,11 +227,11 @@ do_test 4.3 { sqlite3 db2 test.db } {} -do_test 4.4.1 { - catchsql { SELECT * FROM t1 } db2 +do_test 4.4.1 { + catchsql { SELECT * FROM t1 } db2 } {0 {1 2}} -do_test 4.4.2 { - catchsql { SELECT * FROM t2 } db2 +do_test 4.4.2 { + catchsql { SELECT * FROM t2 } db2 } {1 {database disk image is malformed}} #------------------------------------------------------------------------- @@ -255,11 +255,11 @@ do_test 5.2 { } { if {$x==1} { db2 eval { INSERT INTO t1 VALUES(5, 6) } - } + } if {$x==3} { set res [catchsql {BEGIN EXCLUSIVE}] lappend res [sqlite3_extended_errcode db] - } + } } set res } {1 {database is locked} SQLITE_BUSY_SNAPSHOT} diff --git a/third_party/sqlite/src/test/wal64k.test b/third_party/sqlite/src/test/wal64k.test index e962da128eb59..4d84d9123575d 100644 --- a/third_party/sqlite/src/test/wal64k.test +++ b/third_party/sqlite/src/test/wal64k.test @@ -28,7 +28,7 @@ db close test_syscall pagesize 65536 sqlite3 db test.db -do_execsql_test 1.0 { +do_execsql_test 1.0 { PRAGMA journal_mode = WAL; CREATE TABLE t1(x); CREATE INDEX i1 ON t1(x); diff --git a/third_party/sqlite/src/test/wal9.test b/third_party/sqlite/src/test/wal9.test index ae2a52bb02a78..7fd952d1f8f32 100644 --- a/third_party/sqlite/src/test/wal9.test +++ b/third_party/sqlite/src/test/wal9.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This test case tests that a problem causing a failing assert() has # been fixed. The problem occurred if a writer process with a subset # of the *shm file mapped rolled back a transaction begun after the @@ -29,7 +29,7 @@ do_execsql_test 1.0 { CREATE TABLE t(x); } {wal 0} -do_test 1.1 { +do_test 1.1 { execsql "SELECT * FROM t" db2 } {} @@ -58,32 +58,32 @@ do_execsql_test 1.2 { COMMIT; } {} -# Check file sizes are as expected. The real requirement here is that +# Check file sizes are as expected. The real requirement here is that # the *shm file is now more than one chunk (>32KiB). # -# The sizes of various files are slightly different in normal and +# The sizes of various files are slightly different in normal and # auto-vacuum mode. do_test 1.3 { file size test.db } {1024} do_test 1.4 { expr {[file size test.db-wal]>(1500*1024)} } {1} do_test 1.5 { expr {[file size test.db-shm]>32768} } {1} -do_test 1.6 { +do_test 1.6 { foreach {a b c} [db eval {PRAGMA wal_checkpoint}] break list [expr {$a==0}] [expr {$b>14500}] [expr {$c>14500}] [expr {$b==$c}] } {1 1 1 1} # At this point connection [db2] has mapped the first 32KB of the *shm file -# only. Because the entire WAL file has been checkpointed, it is not +# only. Because the entire WAL file has been checkpointed, it is not # necessary to map any more of the *-shm file to read or write the database -# (since all data will be read directly from the db file). +# (since all data will be read directly from the db file). # -# However, at one point if a transaction that had not yet written to the -# WAL file was rolled back an assert() attempting to verify that the entire -# *-shm file was mapped would fail. If NDEBUG was defined (and the assert() -# disabled) this bug caused SQLite to ignore the return code of a mmap() +# However, at one point if a transaction that had not yet written to the +# WAL file was rolled back an assert() attempting to verify that the entire +# *-shm file was mapped would fail. If NDEBUG was defined (and the assert() +# disabled) this bug caused SQLite to ignore the return code of a mmap() # call. # do_test 1.7 { - execsql { + execsql { BEGIN; INSERT INTO t VALUES('hello'); ROLLBACK; diff --git a/third_party/sqlite/src/test/wal_common.tcl b/third_party/sqlite/src/test/wal_common.tcl index 917ad598f6307..bad3c460f37d2 100644 --- a/third_party/sqlite/src/test/wal_common.tcl +++ b/third_party/sqlite/src/test/wal_common.tcl @@ -34,7 +34,7 @@ proc wal_cksum_intlist {ckv1 ckv2 intlist} { } -# This proc calculates checksums in the same way as those used by SQLite +# This proc calculates checksums in the same way as those used by SQLite # in WAL files. If the $endian argument is "big", then checksums are # calculated by interpreting data as an array of big-endian integers. If # it is "little", data is interpreted as an array of little-endian integers. diff --git a/third_party/sqlite/src/test/walbak.test b/third_party/sqlite/src/test/walbak.test index 0e0f999534f78..f09128557d38b 100644 --- a/third_party/sqlite/src/test/walbak.test +++ b/third_party/sqlite/src/test/walbak.test @@ -24,19 +24,19 @@ ifcapable !wal {finish_test ; return } # Test organization: -# +# # walback-1.*: Simple tests. # # walback-2.*: Test backups when the source db is modified mid-backup. # -# walback-3.*: Backup of WAL sources into rollback destinations, and +# walback-3.*: Backup of WAL sources into rollback destinations, and # vice-versa. # # Make sure a simple backup from a WAL database works. # do_test walbak-1.0 { - execsql { + execsql { PRAGMA synchronous = NORMAL; PRAGMA page_size = 1024; PRAGMA auto_vacuum = 0; @@ -54,7 +54,7 @@ do_test walbak-1.1 { } [expr 3*1024] do_test walbak-1.2 { sqlite3 db2 bak.db - execsql { + execsql { SELECT * FROM t1; PRAGMA main.journal_mode; } db2 @@ -67,7 +67,7 @@ db2 close # Try a VACUUM on a WAL database. # do_test walbak-1.4 { - execsql { + execsql { VACUUM; PRAGMA main.journal_mode; } @@ -83,7 +83,7 @@ do_test walbak-1.6.1 { hexio_read test.db 18 2 } {0202} do_test walbak-1.7 { - execsql { + execsql { CREATE TABLE t2(a, b); INSERT INTO t2 SELECT * FROM t1; DROP TABLE t1; @@ -103,9 +103,9 @@ do_test walbak-1.9 { # Backups when the source db is modified mid-backup. # proc sig {{db db}} { - $db eval { + $db eval { PRAGMA integrity_check; - SELECT md5sum(a, b) FROM t1; + SELECT md5sum(a, b) FROM t1; } } db close @@ -201,7 +201,7 @@ db close # # walbak-3.3.*: a database in rollback mode. # -# walbak-3.4.*: a database in rollback mode that (initially) uses a +# walbak-3.4.*: a database in rollback mode that (initially) uses a # different page-size. # # Check that this does not confuse any connected clients. @@ -232,7 +232,7 @@ foreach {tn setup} { sqlite3 db test.db sqlite3 db2 test.db2 db eval { PRAGMA page_size = 1024 ; PRAGMA journal_mode = WAL } - db2 eval { + db2 eval { PRAGMA page_size = 2048; PRAGMA journal_mode = PERSIST; CREATE TABLE xx(x); @@ -317,8 +317,8 @@ foreach {tn src dest dest_final} { 3 wal delete wal 4 wal wal wal } { - catch { db close } - catch { db2 close } + catch { db close } + catch { db2 close } forcedelete test.db test.db2 do_test walbak-4.$tn.1 { diff --git a/third_party/sqlite/src/test/walblock.test b/third_party/sqlite/src/test/walblock.test index 23167a8830553..e9628e8270ea3 100644 --- a/third_party/sqlite/src/test/walblock.test +++ b/third_party/sqlite/src/test/walblock.test @@ -34,11 +34,11 @@ do_execsql_test 1.1.0 { INSERT INTO t1 VALUES(7, 8); } {wal} -do_test 1.1.1 { - lsort [glob test.db*] +do_test 1.1.1 { + lsort [glob test.db*] } {test.db test.db-shm test.db-wal} -do_test 1.1.2 { +do_test 1.1.2 { set C [launch_testfixture] testfixture $C { sqlite3 db test.db @@ -46,7 +46,7 @@ do_test 1.1.2 { } } {1 2 3 4 5 6 7 8} -do_test 1.1.3 { +do_test 1.1.3 { set ::out [list] testfixture $C { db eval { SELECT * FROM t1 } @@ -54,7 +54,7 @@ do_test 1.1.3 { set ::out } {} -do_test 1.1.4 { +do_test 1.1.4 { vwait ::out set ::out } {1 2 3 4 5 6 7 8} @@ -93,21 +93,21 @@ proc barrier_callback {method args} { set ::out "" testfixture $::C { db eval { SELECT * FROM t1 } } {set ::out} - do_test "1.2.2.(blocking 10 seconds)" { + do_test "1.2.2.(blocking 10 seconds)" { set ::continue 0 after 10000 {set ::continue 1} vwait ::continue - set ::out + set ::out } {} } execsql COMMIT -do_test "1.2.3.(blocking 0.5 seconds)" { +do_test "1.2.3.(blocking 0.5 seconds)" { set ::continue 0 after 500 {set ::continue 1} vwait ::continue - set ::out + set ::out } {1 2 3 4 5 6 7 8 9 10} diff --git a/third_party/sqlite/src/test/walcksum.test b/third_party/sqlite/src/test/walcksum.test index f3fc427115cc8..ad527d99c834c 100644 --- a/third_party/sqlite/src/test/walcksum.test +++ b/third_party/sqlite/src/test/walcksum.test @@ -48,8 +48,8 @@ proc log_checksum_verify {filename iFrame endian} { } # File $filename must be a WAL file on disk. Compute the checksum for frame -# $iFrame in the file by interpreting data as $endian-endian integers -# ($endian must be either "big" or "little"). Then write the computed +# $iFrame in the file by interpreting data as $endian-endian integers +# ($endian must be either "big" or "little"). Then write the computed # checksum into the file. # proc log_checksum_write {filename iFrame endian} { @@ -72,7 +72,7 @@ proc log_checksum_write {filename iFrame endian} { # # $data Blob containing the entire contents of a WAL. # -# $iFrame Frame number within the $data WAL. Frames are numbered +# $iFrame Frame number within the $data WAL. Frames are numbered # starting at 1. # # $endian One of "big" or "little". @@ -84,7 +84,7 @@ proc log_checksum_write {filename iFrame endian} { # * The second integer in the calculated version of the checksum. # proc log_checksum_calc {data iFrame endian} { - + binary scan [string range $data 8 11] I pgsz if {$iFrame > 1} { set n [wal_file_size [expr $iFrame-2] $pgsz] @@ -122,7 +122,7 @@ proc log_checksum_writemagic {filename endian} { set blob [read $fd 24] set c1 0 set c2 0 - wal_cksum $endian c1 c2 $blob + wal_cksum $endian c1 c2 $blob seek $fd 24 puts -nonewline $fd [binary format II $c1 $c2] @@ -132,10 +132,10 @@ proc log_checksum_writemagic {filename endian} { #------------------------------------------------------------------------- # Test cases walcksum-1.* attempt to verify the following: # -# * That both native and non-native order checksum log files can +# * That both native and non-native order checksum log files can # be recovered. # -# * That when appending to native or non-native checksum log files +# * That when appending to native or non-native checksum log files # SQLite continues to use the right kind of checksums. # # * Test point 2 when the appending process is not one that recovered @@ -143,7 +143,7 @@ proc log_checksum_writemagic {filename endian} { # # * Test that both native and non-native checksum log files can be # checkpointed. And that after doing so the next write to the log -# file occurs using native byte-order checksums. +# file occurs using native byte-order checksums. # set native "big" if {$::tcl_platform(byteOrder) == "littleEndian"} { set native "little" } @@ -205,11 +205,11 @@ foreach endian {big little} { execsql { SELECT a FROM t1 } } {1 2 3 5 8 13 21} - # Following recovery, any frames written to the log should use the same + # Following recovery, any frames written to the log should use the same # endianness as the existing frames. Check that this is the case. # do_test walcksum-1.$endian.5.0 { - execsql { + execsql { PRAGMA synchronous = NORMAL; INSERT INTO t1 VALUES(34, 'thirtyfour'); } @@ -227,13 +227,13 @@ foreach endian {big little} { # do_test walcksum-1.$endian.6 { sqlite3 db2 test.db - execsql { + execsql { PRAGMA integrity_check; SELECT a FROM t1; } db2 } {ok 1 2 3 5 8 13 21 34} do_test walcksum-1.$endian.7.0 { - execsql { + execsql { PRAGMA synchronous = NORMAL; INSERT INTO t1 VALUES(55, 'fiftyfive'); } db2 @@ -252,7 +252,7 @@ foreach endian {big little} { forcecopy test.db-wal test2.db-wal do_test walcksum-1.$endian.7.11 { sqlite3 db3 test2.db - execsql { + execsql { PRAGMA integrity_check; SELECT a FROM t1; } db3 @@ -277,7 +277,7 @@ foreach endian {big little} { } {0} do_test walcksum-1.$endian.9 { - execsql { + execsql { PRAGMA integrity_check; SELECT a FROM t1; } db2 @@ -334,5 +334,5 @@ do_test walcksum-2.1 { catch { db close } catch { db2 close } - + finish_test diff --git a/third_party/sqlite/src/test/walcrash.test b/third_party/sqlite/src/test/walcrash.test index b8ca7fbf34009..c78ced83d6795 100644 --- a/third_party/sqlite/src/test/walcrash.test +++ b/third_party/sqlite/src/test/walcrash.test @@ -10,18 +10,18 @@ #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the operation of the library when -# recovering a database following a simulated system failure in +# recovering a database following a simulated system failure in # "PRAGMA journal_mode=WAL" mode. # # -# These are 'warm-body' tests of database recovery used while developing +# These are 'warm-body' tests of database recovery used while developing # the WAL code. They serve to prove that a few really simple cases work: # # walcrash-1.*: Recover a database. # walcrash-2.*: Recover a database where the failed transaction spanned more # than one page. -# walcrash-3.*: Recover multiple databases where the failed transaction +# walcrash-3.*: Recover multiple databases where the failed transaction # was a multi-file transaction. # @@ -53,7 +53,7 @@ for {set i 1} {$i < $REPEATS} {incr i} { } {1} integrity_check walcrash-1.$i.3 db close - + do_test walcrash-1.$i.4 { crashsql -delay 2 -file test.db-wal -seed [incr seed] { INSERT INTO t1 VALUES(4, (SELECT sum(a) FROM t1) + 4); @@ -90,7 +90,7 @@ for {set i 1} {$i < $REPEATS} {incr i} { } {1} integrity_check walcrash-2.$i.3 db close - + do_test walcrash-2.$i.4 { crashsql -delay 2 -file test.db-wal -seed [incr seed] { INSERT INTO t1 VALUES(6, (SELECT sum(a) FROM t1) + 6); @@ -113,7 +113,7 @@ for {set i 1} {$i < $REPEATS} {incr i} { # for {set i 1} {$i < $REPEATS} {incr i} { # forcedelete test.db test.db-wal # forcedelete test2.db test2.db-wal -# +# # do_test walcrash-3.$i.1 { # crashsql -delay 2 -file test2.db-wal -seed [incr seed] { # PRAGMA journal_mode = WAL; @@ -126,17 +126,17 @@ for {set i 1} {$i < $REPEATS} {incr i} { # COMMIT; # } # } {1 {child process exited abnormally}} -# +# # do_test walcrash-3.$i.2 { # sqlite3_wal db test.db -# execsql { +# execsql { # ATTACH 'test2.db' AS aux; # SELECT * FROM t1 EXCEPT SELECT * FROM t2; # } # } {} # do_test walcrash-3.$i.3 { execsql { PRAGMA main.integrity_check } } {ok} # do_test walcrash-3.$i.4 { execsql { PRAGMA aux.integrity_check } } {ok} -# +# # db close # } @@ -158,7 +158,7 @@ for {set i 1} {$i < $REPEATS} {incr i} { do_test walcrash-4.$i.2 { sqlite3 db test.db - execsql { + execsql { SELECT * FROM t1 WHERE a = 1; } } {1 2} @@ -257,7 +257,7 @@ for {set i 1} {$i < $REPEATS} {incr i} { # case because it means the content of page 1 may be damaged. SQLite will # have to determine: # -# (a) that the database is a WAL database, and +# (a) that the database is a WAL database, and # (b) the database page-size # # based on the log file. diff --git a/third_party/sqlite/src/test/walcrash2.test b/third_party/sqlite/src/test/walcrash2.test index 9c93bcdef38d4..9d456eca3d8a5 100644 --- a/third_party/sqlite/src/test/walcrash2.test +++ b/third_party/sqlite/src/test/walcrash2.test @@ -27,9 +27,9 @@ ifcapable !wal {finish_test ; return } # if the process crashes, the transaction is implicitly rolled back and # the rogue entries remain in the hash table. # -# Normally, this causes no problem - readers can tell the difference +# Normally, this causes no problem - readers can tell the difference # between committed and uncommitted entries in the hash table. However, -# if it happens often enough that all slots in the hash-table become +# if it happens often enough that all slots in the hash-table become # non-zero, the next process that attempts to read or write the hash # table falls into an infinite loop. # @@ -39,7 +39,7 @@ ifcapable !wal {finish_test ; return } # assert() before entering the infinite loop. # # walcrash2-1.1: Create a database. Commit a transaction that adds 8 frames -# to the WAL (and 8 entry to the first hash-table in the +# to the WAL (and 8 entry to the first hash-table in the # wal-index). # # walcrash2-1.2: Have an external process open a transaction, add 8 entries @@ -47,7 +47,7 @@ ifcapable !wal {finish_test ; return } # times (so that the wal-index contains 8192 entries - all # slots are non-zero). # -# walcrash2-1.3: Using a new database connection, attempt to query the +# walcrash2-1.3: Using a new database connection, attempt to query the # database. This should cause the process to go into the # infinite loop. # @@ -68,7 +68,7 @@ do_test walcrash2-1.1 { COMMIT; } file size test.db-wal -} [wal_file_size 8 1024] +} [wal_file_size 8 1024] for {set nEntry 8} {$nEntry < 8192} {incr nEntry 8} { do_test walcrash2-1.2.[expr $nEntry/8] { set C [launch_testfixture] @@ -84,7 +84,7 @@ for {set nEntry 8} {$nEntry < 8192} {incr nEntry 8} { INSERT INTO t1 SELECT * FROM t1; -- 16 rows, 17 pages INSERT INTO t1 SELECT * FROM t1 LIMIT 3; -- 20 rows, 20 pages } - } + } close $C file size test.db-wal } [wal_file_size 16 1024] diff --git a/third_party/sqlite/src/test/walcrash3.test b/third_party/sqlite/src/test/walcrash3.test index 71dfb4555a6c5..58e4f0873a16e 100644 --- a/third_party/sqlite/src/test/walcrash3.test +++ b/third_party/sqlite/src/test/walcrash3.test @@ -51,11 +51,11 @@ proc tvfs_callback {method file arglist} { for {set i 2} {$i<1000} {incr i} { # If the WAL file is truncated within the following, within the following - # xWrite call the [tvfs_callback] makes a copy of the database and WAL + # xWrite call the [tvfs_callback] makes a copy of the database and WAL # files set sets $::state to 2. So that the copied files are in the same - # state as the real database and WAL files would be if an application crash + # state as the real database and WAL files would be if an application crash # occurred immediately following the xTruncate(). - # + # set ::state 0 do_execsql_test 1.$i.1 { INSERT INTO t1 VALUES(randomblob(10), randomblob(1000)); @@ -100,7 +100,7 @@ set nInitialErr [set_test_counter errors] for {set i 2} {$i<10000 && [set_test_counter errors]==$nInitialErr} {incr i} { do_test 2.$i.1 { - catch { db close } + catch { db close } db_restore crashsql -delay 2 -file test.db-wal -seed $i { SELECT * FROM sqlite_master; @@ -121,7 +121,7 @@ for {set i 2} {$i<10000 && [set_test_counter errors]==$nInitialErr} {incr i} { do_test 2.$i.2 { sqlite3 db test.db - execsql { PRAGMA integrity_check } + execsql { PRAGMA integrity_check } } {ok} } diff --git a/third_party/sqlite/src/test/walcrash4.test b/third_party/sqlite/src/test/walcrash4.test index 80839b39e59f2..b38bff143f59e 100644 --- a/third_party/sqlite/src/test/walcrash4.test +++ b/third_party/sqlite/src/test/walcrash4.test @@ -21,9 +21,9 @@ do_not_use_codec #------------------------------------------------------------------------- # At one point, if "PRAGMA synchronous=full" is set and the platform -# does not support POWERSAFE_OVERWRITE, and the last frame written to +# does not support POWERSAFE_OVERWRITE, and the last frame written to # the wal file in a transaction is aligned with a sector boundary, the -# xSync() call was omitted. +# xSync() call was omitted. # # The following test verifies that this has been fixed. # @@ -48,7 +48,7 @@ for {set nExtra 0} {$nExtra < 10} {incr nExtra} { for {set i 0} {$i < 10} {incr i} { do_test 1.nExtra=$nExtra.i=$i.1 { faultsim_restore_and_reopen - + set fd [open crash.tcl w] puts $fd [subst -nocommands { sqlite3_crash_enable 1 @@ -69,16 +69,16 @@ for {set nExtra 0} {$nExtra < 10} {incr nExtra} { sqlite3_crash_now }] close $fd - + set r [catch { exec [info nameofexec] crash.tcl >@stdout } msg] list $r $msg } "1 {$msg}" - - do_execsql_test 1.nExtra=$nExtra.i=$i.2 { + + do_execsql_test 1.nExtra=$nExtra.i=$i.2 { SELECT count(*) FROM t1; PRAGMA integrity_check; } {1 ok} - } + } } diff --git a/third_party/sqlite/src/test/walfault.test b/third_party/sqlite/src/test/walfault.test index 4e7064d53b1a3..11f9d8884af16 100644 --- a/third_party/sqlite/src/test/walfault.test +++ b/third_party/sqlite/src/test/walfault.test @@ -39,15 +39,15 @@ do_faultsim_test walfault-1 -prep { faultsim_test_result {0 wal} - # Test that the connection that encountered an error as part of + # Test that the connection that encountered an error as part of # "PRAGMA journal_mode = WAL" and a new connection use the same # journal mode when accessing the database. # - # If "PRAGMA journal_mode" is executed immediately, connection [db] (the - # one that hit the error in journal_mode="WAL") might return "wal" even - # if it failed to switch the database to WAL mode. This is not considered - # a problem. When it tries to read the database, connection [db] correctly - # recognizes that it is a rollback database and switches back to a + # If "PRAGMA journal_mode" is executed immediately, connection [db] (the + # one that hit the error in journal_mode="WAL") might return "wal" even + # if it failed to switch the database to WAL mode. This is not considered + # a problem. When it tries to read the database, connection [db] correctly + # recognizes that it is a rollback database and switches back to a # rollback compatible journal mode. # if {[permutation] != "inmemory_journal"} { @@ -55,14 +55,14 @@ do_faultsim_test walfault-1 -prep { sqlite3 db2 test.db set jm2 [db2 one {SELECT * FROM sqlite_master ; PRAGMA main.journal_mode}] db2 close - + if { $jm!=$jm2 } { error "Journal modes do not match: $jm $jm2" } if { $testrc==0 && $jm!="wal" } { error "Journal mode is not WAL" } } } #-------------------------------------------------------------------------- -# Test case walfault-2-* tests fault injection during recovery of a +# Test case walfault-2-* tests fault injection during recovery of a # short WAL file (a dozen frames or thereabouts). # do_test walfault-2-pre-1 { @@ -144,7 +144,7 @@ if {[permutation] != "inmemory_journal"} { # of PSOW being set by default. faultsim_test_result {0 {wal 0 5 5 a b}} faultsim_integrity_check - } + } } #-------------------------------------------------------------------------- @@ -305,7 +305,7 @@ do_test walfault-9-pre-1 { do_faultsim_test walfault-9 -prep { #if {$iFail<73} { set iFail 73 } #if {$iFail>73} { exit } - + faultsim_restore_and_reopen execsql { PRAGMA cache_size = 10 } } -body { @@ -372,7 +372,7 @@ do_faultsim_test walfault-10 -prep { } #-------------------------------------------------------------------------- -# Test fault injection while checkpointing a large WAL file, if the +# Test fault injection while checkpointing a large WAL file, if the # checkpoint is the first operation run after opening the database. # This means that some of the required wal-index pages are mapped as part of # the checkpoint process, which means there are a few more opportunities @@ -418,10 +418,10 @@ do_faultsim_test walfault-11 -faults shmerr* -prep { } #------------------------------------------------------------------------- -# Test the handling of the various IO/OOM/SHM errors that may occur during -# a log recovery operation undertaken as part of a call to +# Test the handling of the various IO/OOM/SHM errors that may occur during +# a log recovery operation undertaken as part of a call to # sqlite3_wal_checkpoint(). -# +# do_test walfault-12-pre-1 { faultsim_delete_and_reopen execsql { @@ -451,9 +451,9 @@ do_faultsim_test walfault-12 -prep { } #------------------------------------------------------------------------- -# Test simple recovery, reading and writing a database file using a +# Test simple recovery, reading and writing a database file using a # heap-memory wal-index. -# +# do_test walfault-13-pre-1 { faultsim_delete_and_reopen execsql { @@ -506,7 +506,7 @@ do_test walfault-13-pre-2 { do_faultsim_test walfault-13.3 -prep { faultsim_restore_and_reopen } -body { - db eval { + db eval { PRAGMA locking_mode = exclusive; PRAGMA journal_mode = WAL; INSERT INTO abc VALUES(randomblob(1500)); @@ -538,7 +538,7 @@ do_test walfault-14-pre { do_faultsim_test walfault-14 -prep { faultsim_restore_and_reopen } -body { - db eval { + db eval { PRAGMA wal_checkpoint = full; INSERT INTO abc VALUES(randomblob(1500)); } @@ -575,7 +575,7 @@ do_faultsim_test walfault-14 -prep { COMMIT; } } -body { - db eval { + db eval { PRAGMA locking_mode = normal; BEGIN; INSERT INTO abc VALUES(randomblob(1500)); diff --git a/third_party/sqlite/src/test/walhook.test b/third_party/sqlite/src/test/walhook.test index 631ec834e3873..19424ce4b5e09 100644 --- a/third_party/sqlite/src/test/walhook.test +++ b/third_party/sqlite/src/test/walhook.test @@ -11,8 +11,8 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing the operation of the library in # "PRAGMA journal_mode=WAL" mode. -# -# More specifically, this file contains regression tests for the +# +# More specifically, this file contains regression tests for the # sqlite3_wal_hook() mechanism, including the sqlite3_wal_autocheckpoint() # and "PRAGMA wal_autocheckpoint" convenience interfaces. # @@ -31,7 +31,7 @@ proc wal_hook {zDb nEntry} { db wal_hook wal_hook do_test walhook-1.1 { - execsql { + execsql { PRAGMA page_size = 1024; PRAGMA auto_vacuum = 0; PRAGMA journal_mode = wal; @@ -52,7 +52,7 @@ do_test walhook-1.3 { file size test.db } [expr 3*1024] do_test walhook-1.4 { - proc wal_hook {zDb nEntry} { + proc wal_hook {zDb nEntry} { execsql { PRAGMA wal_checkpoint } return 0 } diff --git a/third_party/sqlite/src/test/walmode.test b/third_party/sqlite/src/test/walmode.test index 4e14d54d4f715..8c975f7bfcf49 100644 --- a/third_party/sqlite/src/test/walmode.test +++ b/third_party/sqlite/src/test/walmode.test @@ -17,7 +17,7 @@ set testdir [file dirname $argv0] source $testdir/tester.tcl source $testdir/malloc_common.tcl -# If the library was compiled without WAL support, check that the +# If the library was compiled without WAL support, check that the # "PRAGMA journal_mode=WAL" treats "WAL" as an unrecognized mode. # ifcapable !wal { @@ -88,7 +88,7 @@ do_test walmode-2.3 { # If the first statement executed is "PRAGMA journal_mode = wal", and # the file is already configured for WAL (read and write versions set -# to 2), then there should be no need to write the database. The +# to 2), then there should be no need to write the database. The # statement should cause the client to connect to the log file. # set sqlite_sync_count 0 @@ -200,7 +200,7 @@ do_test walmode-5.1.4 { execsql { PRAGMA main.journal_mode = wal } } {memory} do_test walmode-5.1.5 { - execsql { + execsql { INSERT INTO t1 VALUES(3, 4); SELECT * FROM t1; PRAGMA main.journal_mode; @@ -233,7 +233,7 @@ do_test walmode-5.2.4 { execsql { PRAGMA main.journal_mode = wal } } $tempJrnlMode do_test walmode-5.2.5 { - execsql { + execsql { INSERT INTO t1 VALUES(3, 4); SELECT * FROM t1; PRAGMA main.journal_mode; @@ -261,7 +261,7 @@ do_test walmode-5.3.4 { execsql { PRAGMA temp.journal_mode = wal } } $tempJrnlMode do_test walmode-5.3.5 { - execsql { + execsql { INSERT INTO t1 VALUES(3, 4); SELECT * FROM t1; PRAGMA temp.journal_mode; @@ -290,7 +290,7 @@ foreach {tn mode} { db close #------------------------------------------------------------------------- -# Test the effect of a "PRAGMA journal_mode" command being the first +# Test the effect of a "PRAGMA journal_mode" command being the first # thing executed by a new connection. This means that the schema is not # loaded when sqlite3_prepare_v2() is called to compile the statement. # @@ -321,7 +321,7 @@ foreach {tn sql result} { 15 "PRAGMA journal_mode" wal 16 "PRAGMA main.journal_mode" wal } { - do_test walmode-7.$tn { + do_test walmode-7.$tn { db close sqlite3 db test.db execsql $sql @@ -330,7 +330,7 @@ foreach {tn sql result} { db close #------------------------------------------------------------------------- -# Test the effect of a "PRAGMA journal_mode" command on an attached +# Test the effect of a "PRAGMA journal_mode" command on an attached # database. # faultsim_delete_and_reopen @@ -356,7 +356,7 @@ do_execsql_test walmode-8.11 { PRAGMA main.journal_mode } {wal} do_execsql_test walmode-8.12 { PRAGMA journal_mode } {wal} # Change to WAL mode on test2.db and make sure (in the tests that follow) -# that this mode change persists. +# that this mode change persists. do_test walmode-8.x1 { execsql { PRAGMA two.journal_mode=WAL; @@ -372,7 +372,7 @@ do_execsql_test walmode-8.15 { PRAGMA main.journal_mode } {wal} do_execsql_test walmode-8.16 { PRAGMA two.journal_mode } {wal} do_execsql_test walmode-8.17 { INSERT INTO two.t2 DEFAULT VALUES } {} do_execsql_test walmode-8.18 { PRAGMA two.journal_mode } {wal} - + sqlite3 db2 test.db2 do_test walmode-8.19 { execsql { PRAGMA main.journal_mode } db2 } {wal} db2 close diff --git a/third_party/sqlite/src/test/walnoshm.test b/third_party/sqlite/src/test/walnoshm.test index d4082178dde26..379c1afe892dd 100644 --- a/third_party/sqlite/src/test/walnoshm.test +++ b/third_party/sqlite/src/test/walnoshm.test @@ -20,7 +20,7 @@ ifcapable !wal {finish_test ; return } db close testvfs tvfsshm -testvfs tvfs -default 1 -iversion 1 +testvfs tvfs -default 1 -iversion 1 sqlite3 db test.db #-------------------------------------------------------------------------- @@ -35,13 +35,13 @@ do_execsql_test 1.1 { INSERT INTO t1 VALUES(1, 2); } -do_execsql_test 1.2 { +do_execsql_test 1.2 { PRAGMA journal_mode = WAL; SELECT * FROM t1; } {delete 1 2} do_test 1.3 { file exists test.db-wal } {0} -do_execsql_test 1.4 { +do_execsql_test 1.4 { PRAGMA locking_mode = exclusive; PRAGMA journal_mode = WAL; SELECT * FROM t1; @@ -96,8 +96,8 @@ do_test 2.1.4 { catchsql { PRAGMA journal_mode = delete } db2 } {1 {unable to open database file}} do_test 2.1.5 { - execsql { - PRAGMA locking_mode = exclusive; + execsql { + PRAGMA locking_mode = exclusive; PRAGMA journal_mode = delete; SELECT * FROM t2; } db2 @@ -117,7 +117,7 @@ do_test 2.2.2 { } {1 {database is locked}} do_test 2.2.3 { - # This is to test that [db2] is not holding a PENDING lock (which can + # This is to test that [db2] is not holding a PENDING lock (which can # happen when an attempt to obtain an EXCLUSIVE lock fails). sqlite3 db4 test2.db -vfs tvfsshm execsql { SELECT * FROM t2 } db4 @@ -152,7 +152,7 @@ db close # do_test 3.1 { sqlite3 db test.db -vfs tvfsshm - execsql { + execsql { SELECT * FROM t1; PRAGMA locking_mode = EXCLUSIVE; INSERT INTO t1 VALUES(5, 6); @@ -166,7 +166,7 @@ db close db2 close do_test 3.2 { sqlite3 db test.db -vfs tvfsshm - execsql { + execsql { PRAGMA locking_mode = EXCLUSIVE; INSERT INTO t1 VALUES(9, 10); PRAGMA locking_mode = NORMAL; diff --git a/third_party/sqlite/src/test/waloverwrite.test b/third_party/sqlite/src/test/waloverwrite.test index ff8bc5ab55f45..ff2f940480b96 100644 --- a/third_party/sqlite/src/test/waloverwrite.test +++ b/third_party/sqlite/src/test/waloverwrite.test @@ -57,26 +57,26 @@ foreach {tn xtra} { CREATE TABLE t1(x, y); CREATE TABLE t2(x, y); CREATE INDEX i1y ON t1(y); - + WITH cnt(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM cnt WHERE i<20 ) INSERT INTO t1 SELECT i, randomblob(800) FROM cnt; } {} - + do_test 1.$tn.1 { set nPg [db one { PRAGMA page_count } ] expr $nPg>40 && $nPg<50 } {1} - + do_test 1.$tn.2 { db close sqlite3 db test.db - + execsql {PRAGMA journal_mode = wal} execsql {PRAGMA cache_size = 5} execsql $xtra - + db transaction { for {set i 0} {$i < 5} {incr i} { foreach x [db eval {SELECT x FROM t1}] { @@ -84,20 +84,20 @@ foreach {tn xtra} { } } } - + set nPg [wal_frame_count test.db-wal 1024] expr $nPg>40 && $nPg<60 } {1} - + do_execsql_test 1.$tn.3 { PRAGMA integrity_check } ok - + do_test 1.$tn.4 { forcedelete test.db2 test.db2-wal forcecopy test.db test.db2 sqlite3 db2 test.db2 execsql { SELECT sum(length(y)) FROM t1 } db2 } [expr 20*800] - + do_test 1.$tn.5 { db2 close forcecopy test.db test.db2 @@ -105,7 +105,7 @@ foreach {tn xtra} { sqlite3 db2 test.db2 execsql { SELECT sum(length(y)) FROM t1 } db2 } [expr 20*799] - + do_test 1.$tn.6 { execsql { PRAGMA integrity_check } db2 } ok diff --git a/third_party/sqlite/src/test/walpersist.test b/third_party/sqlite/src/test/walpersist.test index 692728dda48d2..1ac554e01850e 100644 --- a/third_party/sqlite/src/test/walpersist.test +++ b/third_party/sqlite/src/test/walpersist.test @@ -114,13 +114,13 @@ do_test 3.2 { file_control_persist_wal db 1 db close } {} -do_test walpersist-3.3 { - file size test.db-wal +do_test walpersist-3.3 { + file size test.db-wal } {0} -do_test walpersist-3.4 { +do_test walpersist-3.4 { sqlite3 db test.db execsql { PRAGMA integrity_check } } {ok} - + finish_test diff --git a/third_party/sqlite/src/test/walprotocol.test b/third_party/sqlite/src/test/walprotocol.test index ee8d0b72a5555..a69102a125ba1 100644 --- a/third_party/sqlite/src/test/walprotocol.test +++ b/third_party/sqlite/src/test/walprotocol.test @@ -30,12 +30,12 @@ set testprefix walprotocol # When recovering the contents of a WAL file, a process obtains the WRITER # lock, then locks all other bytes before commencing recovery. If it fails # to lock all other bytes (because some other process is holding a read -# lock) it should retry up to 100 times. Then return SQLITE_PROTOCOL to the +# lock) it should retry up to 100 times. Then return SQLITE_PROTOCOL to the # caller. Test this (test case 1.3). # # Also test the effect of hitting an SQLITE_BUSY while attempting to obtain # the WRITER lock (should be the same). Test case 1.4. -# +# do_execsql_test 1.0 { PRAGMA journal_mode = wal; CREATE TABLE x(y); @@ -47,7 +47,7 @@ proc lock_callback {method filename handle lock} { } do_test 1.1 { testvfs T - T filter xShmLock + T filter xShmLock T script lock_callback set ::locks [list] sqlite3 db test.db -vfs T @@ -94,7 +94,7 @@ db close T delete #------------------------------------------------------------------------- -# +# do_test 2.1 { forcedelete test.db test.db-journal test.db wal sqlite3 db test.db diff --git a/third_party/sqlite/src/test/walro.test b/third_party/sqlite/src/test/walro.test index f46e44d4cbdfc..7b2fc930ddc81 100644 --- a/third_party/sqlite/src/test/walro.test +++ b/third_party/sqlite/src/test/walro.test @@ -32,7 +32,7 @@ ifcapable !wal { } do_multiclient_test tn { - + # Close all connections and delete the database. # code1 { db close } @@ -40,7 +40,7 @@ do_multiclient_test tn { code3 { db3 close } forcedelete test.db forcedelete walro - + # Do not run tests with the connections in the same process. # if {$tn==2} continue @@ -56,7 +56,7 @@ do_multiclient_test tn { do_test 1.1.1 { code2 { sqlite3 db2 test.db } - sql2 { + sql2 { PRAGMA auto_vacuum = 0; PRAGMA journal_mode = WAL; CREATE TABLE t1(x, y); @@ -76,17 +76,17 @@ do_multiclient_test tn { # Check that the read-only connection cannot write or checkpoint the db. # - do_test 1.1.6 { - csql1 "INSERT INTO t1 VALUES('e', 'f')" + do_test 1.1.6 { + csql1 "INSERT INTO t1 VALUES('e', 'f')" } {1 {attempt to write a readonly database}} - do_test 1.1.7 { + do_test 1.1.7 { csql1 "PRAGMA wal_checkpoint" } {1 {attempt to write a readonly database}} do_test 1.1.9 { sql2 "INSERT INTO t1 VALUES('e', 'f')" } {} do_test 1.1.10 { sql1 "SELECT * FROM t1" } {a b c d e f} - do_test 1.1.11 { + do_test 1.1.11 { sql2 { INSERT INTO t1 VALUES('g', 'h'); PRAGMA wal_checkpoint; @@ -109,24 +109,24 @@ do_multiclient_test tn { do_test 1.2.3 { code1 { db close } file attributes test.db-shm -permissions rw-r--r-- - hexio_write test.db-shm 0 01020304 + hexio_write test.db-shm 0 01020304 file attributes test.db-shm -permissions r--r--r-- code1 { sqlite3 db file:test.db?readonly_shm=1 } csql1 { SELECT * FROM t1 } } {1 {attempt to write a readonly database}} do_test 1.2.4 { - code1 { sqlite3_extended_errcode db } + code1 { sqlite3_extended_errcode db } } {SQLITE_READONLY_RECOVERY} do_test 1.2.5 { file attributes test.db-shm -permissions rw-r--r-- code2 { sqlite3 db2 test.db } - sql2 "SELECT * FROM t1" + sql2 "SELECT * FROM t1" } {a b c d e f g h i j} file attributes test.db-shm -permissions r--r--r-- do_test 1.2.6 { sql1 "SELECT * FROM t1" } {a b c d e f g h i j} - do_test 1.2.7 { + do_test 1.2.7 { sql2 { PRAGMA wal_checkpoint; INSERT INTO t1 VALUES('k', 'l'); @@ -163,7 +163,7 @@ do_multiclient_test tn { csql1 { SELECT * FROM t1 } } {1 {attempt to write a readonly database}} do_test 1.3.2.4 { - code1 { sqlite3_extended_errcode db } + code1 { sqlite3_extended_errcode db } } {SQLITE_READONLY_RECOVERY} #----------------------------------------------------------------------- @@ -181,7 +181,7 @@ do_multiclient_test tn { do_test 1.4.2 { code1 { sqlite3 db file:test.db?readonly_shm=1 } code2 { sqlite3 db2 test.db } - csql2 { + csql2 { INSERT INTO t1 VALUES(1, 2); INSERT INTO t1 VALUES(3, 4); INSERT INTO t1 VALUES(5, 6); @@ -191,9 +191,9 @@ do_multiclient_test tn { do_test 1.4.3 { csql1 { SELECT * FROM t1 } } {0 {a b c d e f g h i j k l 1 2 3 4 5 6}} - + # Using the read-write connection, open a transaction and write lots - # of data - causing a cache spill and a log wrap. Then check that the + # of data - causing a cache spill and a log wrap. Then check that the # read-only connection can still read the database. do_test 1.4.4.1 { csql2 { @@ -233,7 +233,7 @@ forcedelete test.db # database file while a checkpoint operation is ongoing. # do_multiclient_test tn { - + # Close all connections and delete the database. # code1 { db close } @@ -241,7 +241,7 @@ do_multiclient_test tn { code3 { db3 close } forcedelete test.db forcedelete walro - + # Do not run tests with the connections in the same process. # if {$tn==2} continue @@ -252,7 +252,7 @@ do_multiclient_test tn { sqlite3_config_uri 1 } } - + proc tv_hook {x file args} { if {[file tail $file]=="test.db-wal"} { do_test 2.1.2 { @@ -262,7 +262,7 @@ do_multiclient_test tn { do_test 2.1.3 { code2 { db2 close } } {} - } + } } do_test 2.1.1 { @@ -270,7 +270,7 @@ do_multiclient_test tn { tv script tv_hook tv filter {} code1 { sqlite3 db test.db } - csql1 { + csql1 { PRAGMA auto_vacuum = 0; PRAGMA journal_mode = WAL; BEGIN; diff --git a/third_party/sqlite/src/test/walslow.test b/third_party/sqlite/src/test/walslow.test index 2a52a225d80e6..3960e6693af17 100644 --- a/third_party/sqlite/src/test/walslow.test +++ b/third_party/sqlite/src/test/walslow.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the operation of the library in -# "PRAGMA journal_mode=WAL" mode. The tests in this file use +# "PRAGMA journal_mode=WAL" mode. The tests in this file use # brute force methods, so may take a while to run. # @@ -60,12 +60,12 @@ for {set seed 1} {$seed<10} {incr seed} { forcedelete testX.db testX.db-wal copy_file test.db testX.db copy_file test.db-wal testX.db-wal - + sqlite3 db2 testX.db execsql { PRAGMA journal_mode = WAL } db2 execsql { PRAGMA integrity_check } db2 } {ok} - + do_test walslow-1.seed=$seed.$iTest.4 { execsql { SELECT count(*) FROM t1 WHERE a!=b } db2 } [execsql { SELECT count(*) FROM t1 WHERE a!=b }] @@ -74,7 +74,7 @@ for {set seed 1} {$seed<10} {incr seed} { } #------------------------------------------------------------------------- -# Test case walslow-3.* tests that the checksum calculation detects single +# Test case walslow-3.* tests that the checksum calculation detects single # byte changes to frame or frame-header data and considers the frame # invalid as a result. # @@ -111,13 +111,13 @@ foreach incr {1 2 3 20 40 60 80 100 120 140 160 180 200 220 240 253 254 255} { set fd [open test2.db-wal r+] fconfigure $fd -encoding binary fconfigure $fd -translation binary - + seek $fd $iOff binary scan [read $fd 1] c x seek $fd $iOff puts -nonewline $fd [binary format c [expr {($x+$incr)&0xFF}]] close $fd - + sqlite3 db2 test2.db if { [execsql { SELECT a FROM t1 } db2] != "1 2" } {set FAIL 1} db2 close @@ -138,7 +138,7 @@ foreach incr {1 2 3 20 40 60 80 100 120 140 160 180 200 220 240 253 254 255} { # 4.1.*: This test case creates a very large log file within the # file-system (around 200MB). The log file does not contain # any valid frames. Test that the database file can still be -# opened and queried, and that the invalid log file causes no +# opened and queried, and that the invalid log file causes no # problems. # # 4.2.*: Test that a process may create a large log file and query diff --git a/third_party/sqlite/src/test/walthread.test b/third_party/sqlite/src/test/walthread.test index 6249ce11af09c..a881d57b01d1c 100644 --- a/third_party/sqlite/src/test/walthread.test +++ b/third_party/sqlite/src/test/walthread.test @@ -47,7 +47,7 @@ proc wait_for_var {varname} { uplevel [list set $varname] } -# The argument is the name of a list variable in the callers context. The +# The argument is the name of a list variable in the callers context. The # first element of the list is removed and returned. For example: # # set L {a b c} @@ -64,8 +64,8 @@ proc lshift {lvar} { #------------------------------------------------------------------------- # do_thread_test TESTNAME OPTIONS... -# -# where OPTIONS are: +# +# where OPTIONS are: # # -seconds SECONDS How many seconds to run the test for # -init SCRIPT Script to run before test. @@ -221,7 +221,7 @@ proc do_thread_test2 {args} { } #-------------------------------------------------------------------------- -# Start 10 threads. Each thread performs both read and write +# Start 10 threads. Each thread performs both read and write # transactions. Each read transaction consists of: # # 1) Reading the md5sum of all but the last table row, @@ -293,7 +293,7 @@ do_thread_test2 walthread-1 -seconds $seconds(walthread-1) -init { set nRun 0 while {[tt_continue]} { read_transaction - write_transaction + write_transaction incr nRun } set nRun @@ -322,7 +322,7 @@ do_thread_test2 walthread-1 -seconds $seconds(walthread-1) -init { # At present, there are 4 clients in total. 2 do "journal_mode = WAL", and # two do "journal_mode = DELETE". # -# Each client returns a string of the form "W w, R r", where W is the +# Each client returns a string of the form "W w, R r", where W is the # number of write-transactions performed using a WAL journal, and D is # the number of write-transactions performed using a rollback journal. # For example, "192 w, 185 r". @@ -395,7 +395,7 @@ do_thread_test walthread-3 -seconds $seconds(walthread-3) -init { set nextwrite $E(pid) proc wal_hook {zDb nEntry} { - if {$nEntry>10} { + if {$nEntry>10} { set rc [catch { db eval {PRAGMA wal_checkpoint} } msg] if {$rc && $msg != "database is locked"} { error $msg } } @@ -443,7 +443,7 @@ do_thread_test2 walthread-4 -seconds $seconds(walthread-4) -init { CREATE TABLE t1(a INTEGER PRIMARY KEY, b UNIQUE); } } -thread r 1 { - # This connection only ever reads the database. Therefore the + # This connection only ever reads the database. Therefore the # busy-handler is not required. Disable it to check that this is true. # # UPDATE: That is no longer entirely true - as we don't use a blocking @@ -473,8 +473,8 @@ do_thread_test2 walthread-4 -seconds $seconds(walthread-4) -init { # This test case attempts to provoke a deadlock condition that existed in -# the unix VFS at one point. The problem occurred only while recovering a -# very large wal file (one that requires a wal-index larger than the +# the unix VFS at one point. The problem occurred only while recovering a +# very large wal file (one that requires a wal-index larger than the # initial default allocation of 64KB). # do_thread_test walthread-5 -seconds $seconds(walthread-5) -init { diff --git a/third_party/sqlite/src/test/where.test b/third_party/sqlite/src/test/where.test index d4f04e806374b..2aefc0985f209 100644 --- a/third_party/sqlite/src/test/where.test +++ b/third_party/sqlite/src/test/where.test @@ -220,7 +220,7 @@ do_test where-1.25 { count {SELECT w FROM t1 WHERE x=3 AND 121<=y AND 196>=y} } {10 11 12 13 9} -# Need to work on optimizing the BETWEEN operator. +# Need to work on optimizing the BETWEEN operator. # # do_test where-1.26 { # count {SELECT w FROM t1 WHERE x=3 AND y BETWEEN 121 AND 196} @@ -435,28 +435,28 @@ ifcapable subquery { } {1 0 4 2 1 9 3 1 16 102} do_test where-5.5 { count { - SELECT * FROM t1 WHERE rowid IN + SELECT * FROM t1 WHERE rowid IN (select rowid from t1 where rowid IN (-1,2,4)) ORDER BY 1; } } {2 1 9 4 2 25 3} do_test where-5.6 { count { - SELECT * FROM t1 WHERE rowid+0 IN + SELECT * FROM t1 WHERE rowid+0 IN (select rowid from t1 where rowid IN (-1,2,4)) ORDER BY 1; } } {2 1 9 4 2 25 103} do_test where-5.7 { count { - SELECT * FROM t1 WHERE w IN + SELECT * FROM t1 WHERE w IN (select rowid from t1 where rowid IN (-1,2,4)) ORDER BY 1; } } {2 1 9 4 2 25 9} do_test where-5.8 { count { - SELECT * FROM t1 WHERE w+0 IN + SELECT * FROM t1 WHERE w+0 IN (select rowid from t1 where rowid IN (-1,2,4)) ORDER BY 1; } @@ -992,13 +992,13 @@ do_test where-11.1 { execsql { CREATE TABLE t99(Dte INT, X INT); DELETE FROM t99 WHERE (Dte = 2451337) OR (Dte = 2451339) OR - (Dte BETWEEN 2451345 AND 2451347) OR (Dte = 2451351) OR + (Dte BETWEEN 2451345 AND 2451347) OR (Dte = 2451351) OR (Dte BETWEEN 2451355 AND 2451356) OR (Dte = 2451358) OR (Dte = 2451362) OR (Dte = 2451365) OR (Dte = 2451367) OR (Dte BETWEEN 2451372 AND 2451376) OR (Dte BETWEEN 2451382 AND 2451384) OR - (Dte = 2451387) OR (Dte BETWEEN 2451389 AND 2451391) OR - (Dte BETWEEN 2451393 AND 2451395) OR (Dte = 2451400) OR - (Dte = 2451402) OR (Dte = 2451404) OR (Dte BETWEEN 2451416 AND 2451418) OR + (Dte = 2451387) OR (Dte BETWEEN 2451389 AND 2451391) OR + (Dte BETWEEN 2451393 AND 2451395) OR (Dte = 2451400) OR + (Dte = 2451402) OR (Dte = 2451404) OR (Dte BETWEEN 2451416 AND 2451418) OR (Dte = 2451422) OR (Dte = 2451426) OR (Dte BETWEEN 2451445 AND 2451446) OR (Dte = 2451456) OR (Dte = 2451458) OR (Dte BETWEEN 2451465 AND 2451467) OR (Dte BETWEEN 2451469 AND 2451471) OR (Dte = 2451474) OR @@ -1008,9 +1008,9 @@ do_test where-11.1 { (Dte BETWEEN 2451539 AND 2451544) OR (Dte BETWEEN 2451546 AND 2451551) OR (Dte BETWEEN 2451553 AND 2451555) OR (Dte = 2451557) OR (Dte BETWEEN 2451559 AND 2451561) OR (Dte = 2451563) OR - (Dte BETWEEN 2451565 AND 2451566) OR (Dte BETWEEN 2451569 AND 2451571) OR + (Dte BETWEEN 2451565 AND 2451566) OR (Dte BETWEEN 2451569 AND 2451571) OR (Dte = 2451573) OR (Dte = 2451575) OR (Dte = 2451577) OR (Dte = 2451581) OR - (Dte BETWEEN 2451583 AND 2451586) OR (Dte BETWEEN 2451588 AND 2451592) OR + (Dte BETWEEN 2451583 AND 2451586) OR (Dte BETWEEN 2451588 AND 2451592) OR (Dte BETWEEN 2451596 AND 2451598) OR (Dte = 2451600) OR (Dte BETWEEN 2451602 AND 2451603) OR (Dte = 2451606) OR (Dte = 2451611); } @@ -1166,74 +1166,74 @@ do_test where-14.1 { } cksort { SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.a, y.b - } + } } {1/4 1/1 4/4 4/1 nosort} do_test where-14.2 { cksort { SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.a, y.b DESC - } + } } {1/1 1/4 4/1 4/4 nosort} do_test where-14.3 { cksort { SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.a, x.b - } + } } {1/4 1/1 4/4 4/1 nosort} do_test where-14.4 { cksort { SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.a, x.b DESC - } + } } {1/4 1/1 4/4 4/1 nosort} do_test where-14.5 { # This test case changed from "nosort" to "sort". See ticket 2a5629202f. cksort { SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, x.a||x.b - } + } } {/4/[14] 4/[14] 1/[14] 1/[14] sort/} do_test where-14.6 { # This test case changed from "nosort" to "sort". See ticket 2a5629202f. cksort { SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, x.a||x.b DESC - } + } } {/4/[14] 4/[14] 1/[14] 1/[14] sort/} do_test where-14.7 { cksort { SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, y.a||y.b - } + } } {4/1 4/4 1/1 1/4 sort} do_test where-14.7.1 { cksort { SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, x.a, y.a||y.b - } + } } {4/1 4/4 1/1 1/4 sort} do_test where-14.7.2 { cksort { SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, x.a, x.a||x.b - } + } } {4/4 4/1 1/4 1/1 nosort} do_test where-14.8 { cksort { SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, y.a||y.b DESC - } + } } {4/4 4/1 1/4 1/1 sort} do_test where-14.9 { cksort { SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, x.a||y.b - } + } } {4/4 4/1 1/4 1/1 sort} do_test where-14.10 { cksort { SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, x.a||y.b DESC - } + } } {4/1 4/4 1/1 1/4 sort} do_test where-14.11 { cksort { SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, y.a||x.b - } + } } {4/1 4/4 1/1 1/4 sort} do_test where-14.12 { cksort { SELECT x.a || '/' || y.a FROM t8 x, t8 y ORDER BY x.b, y.a||x.b DESC - } + } } {4/4 4/1 1/4 1/1 sort} } ;# {permutation != "no_optimization"} @@ -1252,12 +1252,12 @@ do_test where-15.1 { } {} # Ticket #3408. -# +# # The branch of code in where.c that generated rowid lookups was -# incorrectly deallocating a constant register, meaning that if the +# incorrectly deallocating a constant register, meaning that if the # vdbe code ran more than once, the second time around the constant # value may have been clobbered by some other value. -# +# do_test where-16.1 { execsql { CREATE TABLE a1(id INTEGER PRIMARY KEY, v); diff --git a/third_party/sqlite/src/test/where2.test b/third_party/sqlite/src/test/where2.test index 0a0533506ad2b..ebba0ab6bb8f7 100644 --- a/third_party/sqlite/src/test/where2.test +++ b/third_party/sqlite/src/test/where2.test @@ -83,7 +83,7 @@ proc queryplan {sql} { lappend data $tab * } } - return $data + return $data } @@ -681,7 +681,7 @@ ifcapable subquery { AND z IN (SELECT z FROM t1 WHERE +w BETWEEN 10 AND 20) } } {} -} +} # Make sure WHERE clauses of the form A=1 AND (B=2 OR B=3) are optimized # when we have an index on A and B. @@ -766,7 +766,7 @@ do_execsql_test where2-13.1 { } {4 5} # https://www.sqlite.org/src/info/5e3c886796e5512e (2016-03-09) -# Correlated subquery on the RHS of an IN operator +# Correlated subquery on the RHS of an IN operator # do_execsql_test where2-14.1 { CREATE TABLE t14a(x INTEGER PRIMARY KEY); diff --git a/third_party/sqlite/src/test/where3.test b/third_party/sqlite/src/test/where3.test index 6edbe2bcadfdc..55f1a1586c0ed 100644 --- a/third_party/sqlite/src/test/where3.test +++ b/third_party/sqlite/src/test/where3.test @@ -28,19 +28,19 @@ do_test where3-1.1 { CREATE TABLE t1(a, b); CREATE TABLE t2(p, q); CREATE TABLE t3(x, y); - + INSERT INTO t1 VALUES(111,'one'); INSERT INTO t1 VALUES(222,'two'); INSERT INTO t1 VALUES(333,'three'); - + INSERT INTO t2 VALUES(1,111); INSERT INTO t2 VALUES(2,222); INSERT INTO t2 VALUES(4,444); CREATE INDEX t2i1 ON t2(p); - + INSERT INTO t3 VALUES(999,'nine'); CREATE INDEX t3i1 ON t3(x); - + SELECT * FROM t1, t2 LEFT JOIN t3 ON q=x WHERE p=2 AND a=q; } } {222 two 2 222 {} {}} @@ -97,12 +97,12 @@ ifcapable explain&&!cursorhints { } [explain_no_trace { SELECT parent1.parent1key, child1.value, child2.value FROM parent1 - LEFT OUTER JOIN child1 ON parent1.child1key = child1.child1key + LEFT OUTER JOIN child1 ON parent1.child1key = child1.child1key INNER JOIN child2 ON child2.child2key = parent1.child2key; }] } -# This procedure executes the SQL. Then it appends +# This procedure executes the SQL. Then it appends # the names of the table and index used # proc queryplan {sql} { @@ -118,13 +118,13 @@ proc queryplan {sql} { lappend data $tab * } } - return $data + return $data } # If you have a from clause of the form: A B C left join D -# then make sure the query optimizer is able to reorder the -# A B C part anyway it wants. +# then make sure the query optimizer is able to reorder the +# A B C part anyway it wants. # # Following the fix to ticket #1652, there was a time when # the C table would not reorder. So the following reorderings @@ -226,7 +226,7 @@ do_test where3-2.7 { # If the outer loop must be a full table scan, do not let ANALYZE trick # the planner into use a table for the outer loop that might be indexable # if held until an inner loop. -# +# do_execsql_test where3-3.0 { CREATE TABLE t301(a INTEGER PRIMARY KEY,b,c); CREATE INDEX t301c ON t301(c); @@ -237,14 +237,14 @@ do_execsql_test where3-3.0 { ANALYZE; explain query plan SELECT * FROM t302, t301 WHERE t302.x=5 AND t301.a=t302.y; } { - 0 0 0 {SCAN TABLE t302} + 0 0 0 {SCAN TABLE t302} 0 1 1 {SEARCH TABLE t301 USING INTEGER PRIMARY KEY (rowid=?)} } do_execsql_test where3-3.1 { explain query plan SELECT * FROM t301, t302 WHERE t302.x=5 AND t301.a=t302.y; } { - 0 0 1 {SCAN TABLE t302} + 0 0 1 {SCAN TABLE t302} 0 1 0 {SEARCH TABLE t301 USING INTEGER PRIMARY KEY (rowid=?)} } do_execsql_test where3-3.2 { @@ -266,24 +266,24 @@ do_execsql_test where3-4.0 { EXPLAIN QUERY PLAN SELECT * FROM t400, t401, t402 WHERE t402.z GLOB 'abc*'; } { - 0 0 2 {SCAN TABLE t402} - 0 1 0 {SCAN TABLE t400} + 0 0 2 {SCAN TABLE t402} + 0 1 0 {SCAN TABLE t400} 0 2 1 {SCAN TABLE t401} } do_execsql_test where3-4.1 { EXPLAIN QUERY PLAN SELECT * FROM t400, t401, t402 WHERE t401.r GLOB 'abc*'; } { - 0 0 1 {SCAN TABLE t401} - 0 1 0 {SCAN TABLE t400} + 0 0 1 {SCAN TABLE t401} + 0 1 0 {SCAN TABLE t400} 0 2 2 {SCAN TABLE t402} } do_execsql_test where3-4.2 { EXPLAIN QUERY PLAN SELECT * FROM t400, t401, t402 WHERE t400.c GLOB 'abc*'; } { - 0 0 0 {SCAN TABLE t400} - 0 1 1 {SCAN TABLE t401} + 0 0 0 {SCAN TABLE t400} + 0 1 1 {SCAN TABLE t401} 0 2 2 {SCAN TABLE t402} } } ;# endif @@ -310,54 +310,54 @@ do_execsql_test where3-5.0 { CREATE INDEX bbb_333 ON bbb (fk, lastModified); EXPLAIN QUERY PLAN - SELECT bbb.title AS tag_title - FROM aaa JOIN bbb ON bbb.id = aaa.parent + SELECT bbb.title AS tag_title + FROM aaa JOIN bbb ON bbb.id = aaa.parent WHERE aaa.fk = 'constant' AND LENGTH(bbb.title) > 0 AND bbb.parent = 4 ORDER BY bbb.title COLLATE NOCASE ASC; } { - 0 0 0 {SEARCH TABLE aaa USING INDEX aaa_333 (fk=?)} - 0 1 1 {SEARCH TABLE bbb USING INTEGER PRIMARY KEY (rowid=?)} + 0 0 0 {SEARCH TABLE aaa USING INDEX aaa_333 (fk=?)} + 0 1 1 {SEARCH TABLE bbb USING INTEGER PRIMARY KEY (rowid=?)} 0 0 0 {USE TEMP B-TREE FOR ORDER BY} } do_execsql_test where3-5.1 { EXPLAIN QUERY PLAN - SELECT bbb.title AS tag_title - FROM aaa JOIN aaa AS bbb ON bbb.id = aaa.parent + SELECT bbb.title AS tag_title + FROM aaa JOIN aaa AS bbb ON bbb.id = aaa.parent WHERE aaa.fk = 'constant' AND LENGTH(bbb.title) > 0 AND bbb.parent = 4 ORDER BY bbb.title COLLATE NOCASE ASC; } { - 0 0 0 {SEARCH TABLE aaa USING INDEX aaa_333 (fk=?)} - 0 1 1 {SEARCH TABLE aaa AS bbb USING INTEGER PRIMARY KEY (rowid=?)} + 0 0 0 {SEARCH TABLE aaa USING INDEX aaa_333 (fk=?)} + 0 1 1 {SEARCH TABLE aaa AS bbb USING INTEGER PRIMARY KEY (rowid=?)} 0 0 0 {USE TEMP B-TREE FOR ORDER BY} } do_execsql_test where3-5.2 { EXPLAIN QUERY PLAN - SELECT bbb.title AS tag_title - FROM bbb JOIN aaa ON bbb.id = aaa.parent + SELECT bbb.title AS tag_title + FROM bbb JOIN aaa ON bbb.id = aaa.parent WHERE aaa.fk = 'constant' AND LENGTH(bbb.title) > 0 AND bbb.parent = 4 ORDER BY bbb.title COLLATE NOCASE ASC; } { - 0 0 1 {SEARCH TABLE aaa USING INDEX aaa_333 (fk=?)} - 0 1 0 {SEARCH TABLE bbb USING INTEGER PRIMARY KEY (rowid=?)} + 0 0 1 {SEARCH TABLE aaa USING INDEX aaa_333 (fk=?)} + 0 1 0 {SEARCH TABLE bbb USING INTEGER PRIMARY KEY (rowid=?)} 0 0 0 {USE TEMP B-TREE FOR ORDER BY} } do_execsql_test where3-5.3 { EXPLAIN QUERY PLAN - SELECT bbb.title AS tag_title - FROM aaa AS bbb JOIN aaa ON bbb.id = aaa.parent + SELECT bbb.title AS tag_title + FROM aaa AS bbb JOIN aaa ON bbb.id = aaa.parent WHERE aaa.fk = 'constant' AND LENGTH(bbb.title) > 0 AND bbb.parent = 4 ORDER BY bbb.title COLLATE NOCASE ASC; } { - 0 0 1 {SEARCH TABLE aaa USING INDEX aaa_333 (fk=?)} - 0 1 0 {SEARCH TABLE aaa AS bbb USING INTEGER PRIMARY KEY (rowid=?)} + 0 0 1 {SEARCH TABLE aaa USING INDEX aaa_333 (fk=?)} + 0 1 0 {SEARCH TABLE aaa AS bbb USING INTEGER PRIMARY KEY (rowid=?)} 0 0 0 {USE TEMP B-TREE FOR ORDER BY} } diff --git a/third_party/sqlite/src/test/where4.test b/third_party/sqlite/src/test/where4.test index bafc84faef951..25dcf29c6643e 100644 --- a/third_party/sqlite/src/test/where4.test +++ b/third_party/sqlite/src/test/where4.test @@ -139,7 +139,7 @@ do_test where4-3.1 { CREATE TABLE t3(x,y,UNIQUE("x",'y' ASC)); -- Goofy syntax allowed INSERT INTO t3 VALUES(1,11); INSERT INTO t3 VALUES(2,NULL); - + SELECT * FROM t2 LEFT JOIN t3 ON a=x WHERE +y IS NULL; } } {2 2 {} 3 {} {}} @@ -273,7 +273,7 @@ do_test where4-7.1 { } {} # At one point the sub-select inside the aggregate sum() function in the -# following query was leaking a couple of stack entries. This query +# following query was leaking a couple of stack entries. This query # runs the SELECT in a loop enough times that an assert() fails. Or rather, # did fail before the bug was fixed. # diff --git a/third_party/sqlite/src/test/where6.test b/third_party/sqlite/src/test/where6.test index 83e975b7dd6d1..c3c273c1e3aac 100644 --- a/third_party/sqlite/src/test/where6.test +++ b/third_party/sqlite/src/test/where6.test @@ -129,7 +129,7 @@ do_test where6-2.14 { # Ticket [ebdbadade5b]: # If the ON close on a LEFT JOIN is of the form x=y where both x and y -# are indexed columns on tables to left of the join, then do not use that +# are indexed columns on tables to left of the join, then do not use that # term with indices to either table. # do_test where6-3.1 { diff --git a/third_party/sqlite/src/test/where7.test b/third_party/sqlite/src/test/where7.test index 00cf5eb278db3..db8e338a7a4cb 100644 --- a/third_party/sqlite/src/test/where7.test +++ b/third_party/sqlite/src/test/where7.test @@ -23328,7 +23328,7 @@ do_execsql_test where7-3.1 { CREATE INDEX t301_c6 on t301(c6); CREATE INDEX t301_c4 on t301(c4); CREATE INDEX t301_c7 on t301(c7); - + CREATE TABLE t302 ( c1 INTEGER PRIMARY KEY, c8 INTEGER, @@ -23341,9 +23341,9 @@ do_execsql_test where7-3.1 { CREATE INDEX t302_c3 on t302(c3); CREATE INDEX t302_c8_c3 on t302(c8, c3); CREATE INDEX t302_c5 on t302(c5); - + EXPLAIN QUERY PLAN - SELECT t302.c1 + SELECT t302.c1 FROM t302 JOIN t301 ON t302.c8 = +t301.c8 WHERE t302.c2 = 19571 AND t302.c3 > 1287603136 @@ -23351,9 +23351,9 @@ do_execsql_test where7-3.1 { OR t301.c8 = 1407424651264000) ORDER BY t302.c5 LIMIT 200; } { - 0 0 1 {SEARCH TABLE t301 USING COVERING INDEX t301_c4 (c4=?)} - 0 0 1 {SEARCH TABLE t301 USING INTEGER PRIMARY KEY (rowid=?)} - 0 1 0 {SEARCH TABLE t302 USING INDEX t302_c8_c3 (c8=? AND c3>?)} + 0 0 1 {SEARCH TABLE t301 USING COVERING INDEX t301_c4 (c4=?)} + 0 0 1 {SEARCH TABLE t301 USING INTEGER PRIMARY KEY (rowid=?)} + 0 1 0 {SEARCH TABLE t302 USING INDEX t302_c8_c3 (c8=? AND c3>?)} 0 0 0 {USE TEMP B-TREE FOR ORDER BY} } diff --git a/third_party/sqlite/src/test/where8.test b/third_party/sqlite/src/test/where8.test index 38214bc895d38..0efec66ffc15a 100644 --- a/third_party/sqlite/src/test/where8.test +++ b/third_party/sqlite/src/test/where8.test @@ -24,7 +24,7 @@ source $testdir/tester.tcl # where8-2.*: Tests surrounding virtual tables and the OR optimization. # # where8-3.*: Tests with more than one table in the FROM clause. -# +# proc execsql_status {sql {db db}} { set result [uplevel $db eval [list $sql]] @@ -56,35 +56,35 @@ do_test where8-1.1 { } } {} -do_test where8-1.2 { +do_test where8-1.2 { execsql_status2 { SELECT c FROM t1 WHERE a = 1 OR b = 'nine' } } {I IX 0 0 6} -do_test where8-1.3 { +do_test where8-1.3 { execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b = 'two' } } {IX X II 0 0 6} ifcapable like_match_blobs { - do_test where8-1.4a { + do_test where8-1.4a { execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b GLOB 't*' } } {IX X III II 0 0 10} - do_test where8-1.5a { + do_test where8-1.5a { execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b GLOB 'f*' } } {IX X V IV 0 0 10} } else { - do_test where8-1.4b { + do_test where8-1.4b { execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b GLOB 't*' } } {IX X III II 0 0 9} - do_test where8-1.5 { + do_test where8-1.5 { execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b GLOB 'f*' } } {IX X V IV 0 0 9} } -do_test where8-1.6 { +do_test where8-1.6 { execsql_status { SELECT c FROM t1 WHERE a = 1 OR b = 'three' ORDER BY rowid } } {I III 0 1} -do_test where8-1.7 { +do_test where8-1.7 { execsql_status { SELECT c FROM t1 WHERE a = 1 OR b = 'three' ORDER BY a } } {I III 0 1} @@ -98,25 +98,25 @@ do_test where8-1.9 { } {IX X VIII 0 0 7} do_test where8-1.10 { - execsql_status2 { - SELECT c FROM t1 WHERE (a >= 9 AND c != 'X') OR b <= 'eight' + execsql_status2 { + SELECT c FROM t1 WHERE (a >= 9 AND c != 'X') OR b <= 'eight' } } {IX VIII 0 0 7} do_test where8-1.11 { - execsql_status2 { - SELECT c FROM t1 WHERE (a >= 4 AND a <= 6) OR b = 'nine' + execsql_status2 { + SELECT c FROM t1 WHERE (a >= 4 AND a <= 6) OR b = 'nine' } } {IV V VI IX 0 0 10} do_test where8-1.12.1 { - execsql_status2 { + execsql_status2 { SELECT c FROM t1 WHERE a IN(1, 2, 3) OR a = 5 } } {I II III V 0 0 14} do_test where8-1.12.2 { - execsql_status2 { + execsql_status2 { SELECT c FROM t1 WHERE +a IN(1, 2, 3) OR +a = 5 } } {I II III V 9 0 9} @@ -131,7 +131,7 @@ do_test where8-1.13 { do_test where8-1.14 { execsql_status2 { SELECT c FROM t1 - WHERE + WHERE a = 2 OR b = 'three' OR a = 4 OR b = 'five' OR a = 6 OR b = 'seven' OR a = 8 OR b = 'nine' OR a = 10 ORDER BY rowid @@ -140,7 +140,7 @@ do_test where8-1.14 { do_test where8-1.15 { execsql_status2 { - SELECT c FROM t1 WHERE + SELECT c FROM t1 WHERE a BETWEEN 2 AND 4 OR b = 'nine' ORDER BY rowid } @@ -149,7 +149,7 @@ do_test where8-1.15 { #-------------------------------------------------------------------------- # Tests where8-2.*: Virtual tables -# +# if 0 { ifcapable vtab { @@ -178,7 +178,7 @@ ifcapable vtab { #-------------------------------------------------------------------------- # Tests where8-3.*: Cases with multiple tables in the FROM clause. -# +# do_test where8-3.1 { execsql { CREATE TABLE t2(d, e, f); @@ -228,24 +228,24 @@ do_test where8-3.6 { # transformed into "a IN (2, 3)". This is why the sort is required. # execsql_status { - SELECT a, d - FROM t1, t2 + SELECT a, d + FROM t1, t2 WHERE (a = 2 OR a = 3) AND (d = +a OR e = 'sixteen') ORDER BY t1.rowid } } {2 2 2 4 3 3 3 4 0 1} do_test where8-3.7 { execsql_status { - SELECT a, d - FROM t1, t2 + SELECT a, d + FROM t1, t2 WHERE a = 2 AND (d = a OR e = 'sixteen') ORDER BY t1.rowid } } {/2 2 2 4 0 [01]/} do_test where8-3.8 { execsql_status { - SELECT a, d - FROM t1, t2 + SELECT a, d + FROM t1, t2 WHERE (a = 2 OR b = 'three') AND (d = a OR e = 'sixteen') ORDER BY t1.rowid } @@ -254,8 +254,8 @@ do_test where8-3.8 { do_test where8-3.9 { # The "OR c = 'IX'" term forces a linear scan. execsql_status { - SELECT a, d - FROM t1, t2 + SELECT a, d + FROM t1, t2 WHERE (a = 2 OR b = 'three' OR c = 'IX') AND (d = a OR e = 'sixteen') ORDER BY t1.rowid } @@ -331,7 +331,7 @@ do_test where8-3.23 { } #----------------------------------------------------------------------- -# The following tests - where8-4.* - verify that adding or removing +# The following tests - where8-4.* - verify that adding or removing # indexes does not change the results returned by various queries. # do_test where8-4.1 { @@ -453,8 +453,8 @@ catch {unset B} set A 2 foreach idxsql { - { - /* No indexes */ + { + /* No indexes */ } { CREATE INDEX i5 ON t3(a); } { @@ -714,14 +714,14 @@ catch {unset B} # At one point the following tests provoked an invalid write error (writing # to memory that had already been freed). It was not possible to demonstrate # that this bug could cause a query to return bad data. -# +# do_test where8-5.1 { db close sqlite3 db test.db sqlite3_db_config_lookaside db 0 0 0 execsql { CREATE TABLE tA( - a, b, c, d, e, f, g, h, + a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p ); } @@ -742,7 +742,7 @@ do_test where8-5.2 { } {} do_test where8-5.3 { execsql { - INSERT INTO tA VALUES(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8); + INSERT INTO tA VALUES(1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8); CREATE UNIQUE INDEX tAI ON tA(p); CREATE TABLE tB(x); INSERT INTO tB VALUES('x'); diff --git a/third_party/sqlite/src/test/where9.test b/third_party/sqlite/src/test/where9.test index d073074d439bf..4e023dde766af 100644 --- a/third_party/sqlite/src/test/where9.test +++ b/third_party/sqlite/src/test/where9.test @@ -29,8 +29,8 @@ proc count_steps {sql} { } -# Construct test data. -# +# Construct test data. +# do_test where9-1.1 { db eval { CREATE TABLE t1(a INTEGER PRIMARY KEY,b,c,d,e,f,g); @@ -248,7 +248,7 @@ do_test where9-1.4 { } } {87 88 89 90 91 scan 0 sort 1} do_test where9-1.5 { - # When this test was originally written, SQLite used a rowset object + # When this test was originally written, SQLite used a rowset object # to optimize the "ORDER BY a" clause. Now that it is using a rowhash, # this is not possible. So we have to comment out one term of the OR # expression in order to prevent SQLite from deeming a full-table @@ -362,8 +362,8 @@ ifcapable explain { SELECT t2.a FROM t1, t2 WHERE t1.a=80 AND ((t1.c=t2.c AND t1.d=t2.d) OR t1.f=t2.f) } { - 0 0 0 {SEARCH TABLE t1 USING INTEGER PRIMARY KEY (rowid=?)} - 0 1 1 {SEARCH TABLE t2 USING INDEX t2d (d=?)} + 0 0 0 {SEARCH TABLE t1 USING INTEGER PRIMARY KEY (rowid=?)} + 0 1 1 {SEARCH TABLE t2 USING INDEX t2d (d=?)} 0 1 1 {SEARCH TABLE t2 USING COVERING INDEX t2f (f=?)} } do_execsql_test where9-3.2 { @@ -372,11 +372,11 @@ ifcapable explain { FROM t1 LEFT JOIN t2 ON (t1.c+1=t2.c AND t1.d=t2.d) OR (t1.f||'x')=t2.f WHERE t1.a=80 } { - 0 0 0 {SEARCH TABLE t1 USING INTEGER PRIMARY KEY (rowid=?)} - 0 1 1 {SEARCH TABLE t2 USING INDEX t2d (d=?)} + 0 0 0 {SEARCH TABLE t1 USING INTEGER PRIMARY KEY (rowid=?)} + 0 1 1 {SEARCH TABLE t2 USING INDEX t2d (d=?)} 0 1 1 {SEARCH TABLE t2 USING COVERING INDEX t2f (f=?)} } -} +} # Make sure that INDEXED BY and multi-index OR clauses play well with # one another. @@ -453,7 +453,7 @@ ifcapable explain { do_execsql_test where9-5.1 { EXPLAIN QUERY PLAN SELECT a FROM t1 WHERE b>1000 AND (c=31031 OR d IS NULL) } { - 0 0 0 {SEARCH TABLE t1 USING INDEX t1c (c=?)} + 0 0 0 {SEARCH TABLE t1 USING INDEX t1c (c=?)} 0 0 0 {SEARCH TABLE t1 USING INDEX t1d (d=?)} } @@ -663,7 +663,7 @@ do_test where9-6.5.1 { OR b=913 OR c=28028 OR (d>=82 AND d<83) - OR (e>2802 AND e<2803) + OR (e>2802 AND e<2803) OR f='fghijklmn' OR g='hgfedcb' } @@ -684,7 +684,7 @@ do_test where9-6.5.3 { OR b=913 OR c=28028 OR (d>=82 AND d<83) - OR (e>2802 AND e<2803) + OR (e>2802 AND e<2803) OR f='fghijklmn' OR g='hgfedcb' } @@ -911,12 +911,12 @@ do_test where9-8.1 { CREATE TABLE t81(a INTEGER PRIMARY KEY, b, c, d); CREATE TABLE t82(x INTEGER PRIMARY KEY, y); CREATE TABLE t83(p INTEGER PRIMARY KEY, q); - + INSERT INTO t81 VALUES(2,3,4,5); INSERT INTO t81 VALUES(3,4,5,6); INSERT INTO t82 VALUES(2,4); INSERT INTO t83 VALUES(5,55); - + SELECT * FROM t81 LEFT JOIN t82 ON y=b JOIN t83 WHERE c==p OR d==p @@ -941,7 +941,7 @@ do_test where9-8.3 { } {2 3 4 5 {} {} 5 55 3 4 5 6 2 4 5 55} # Fix for ticket [f2369304e47167e3e644e2f1fe9736063391d7b7] -# Incorrect results when OR is used in the ON clause of a LEFT JOIN +# Incorrect results when OR is used in the ON clause of a LEFT JOIN # do_test where9-9.1 { db eval { diff --git a/third_party/sqlite/src/test/whereD.test b/third_party/sqlite/src/test/whereD.test index 8ced0ffc723ac..68e5079335435 100644 --- a/third_party/sqlite/src/test/whereD.test +++ b/third_party/sqlite/src/test/whereD.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing that an index may be used as a covering -# index when there are OR expressions in the WHERE clause. +# index when there are OR expressions in the WHERE clause. # @@ -82,7 +82,7 @@ do_execsql_test 2.0 { CREATE INDEX t1d ON t1(d); CREATE TABLE t2(x,y); CREATE INDEX t2y ON t2(y); - + INSERT INTO t1 VALUES(1,2,3,4); INSERT INTO t1 VALUES(5,6,7,8); INSERT INTO t2 VALUES(1,2); @@ -100,7 +100,7 @@ do_execsql_test 2.2 { # Similar to [do_execsql_test], except that two elements are appended # to the result - the string "search" and the number of times test variable # sqlite3_search_count is incremented by running the supplied SQL. e.g. -# +# # do_searchcount_test 1.0 { SELECT * FROM t1 } {x y search 2} # proc do_searchcount_test {tn sql res} { @@ -109,7 +109,7 @@ proc do_searchcount_test {tn sql res} { set ::sqlite_search_count 0 concat [db eval {$sql}] search [set ::sqlite_search_count] } [list $res] - }] + }] } do_execsql_test 3.0 { @@ -139,19 +139,19 @@ do_searchcount_test 3.4.1 { SELECT y FROM t4 WHERE x='a' } {one search 2} do_searchcount_test 3.4.2 { - SELECT a, b FROM t3 WHERE - (a=1 AND b=(SELECT y FROM t4 WHERE x='a')) + SELECT a, b FROM t3 WHERE + (a=1 AND b=(SELECT y FROM t4 WHERE x='a')) OR (a=2 AND b='two') } {1 one 2 two search 6} do_searchcount_test 3.4.3 { - SELECT a, b FROM t3 WHERE + SELECT a, b FROM t3 WHERE (a=2 AND b='two') - OR (a=1 AND b=(SELECT y FROM t4 WHERE x='a')) + OR (a=1 AND b=(SELECT y FROM t4 WHERE x='a')) } {2 two 1 one search 6} do_searchcount_test 3.4.4 { - SELECT a, b FROM t3 WHERE - (a=2 AND b=(SELECT y FROM t4 WHERE x='b')) - OR (a=1 AND b=(SELECT y FROM t4 WHERE x='a')) + SELECT a, b FROM t3 WHERE + (a=2 AND b=(SELECT y FROM t4 WHERE x='b')) + OR (a=1 AND b=(SELECT y FROM t4 WHERE x='a')) } {2 two 1 one search 8} do_searchcount_test 3.5.1 { @@ -162,7 +162,7 @@ do_searchcount_test 3.5.2 { } {1 i 2 ii search 3} # Ticket [d02e1406a58ea02d] (2012-10-04) -# LEFT JOIN with an OR in the ON clause causes segfault +# LEFT JOIN with an OR in the ON clause causes segfault # do_test 4.1 { db eval { @@ -240,9 +240,9 @@ do_execsql_test 5.1 { CREATE INDEX tc15 ON t(c15); CREATE INDEX tc16 ON t(c16); CREATE INDEX tc17 ON t(c17); - + INSERT INTO t(c0, c16) VALUES (1,1); - + SELECT * FROM t WHERE c0=1 or c1=1 or c2=1 or c3=1 or c4=1 or c5=1 or c6=1 or c7=1 or @@ -321,7 +321,7 @@ do_searchcount_test 6.5.3 { SELECT d FROM x1 WHERE c=11 OR rowid = 2 } {12 8 search 2} do_searchcount_test 6.5.4 { - SELECT a FROM x1 WHERE c=11 OR rowid = 2 + SELECT a FROM x1 WHERE c=11 OR rowid = 2 } {9 5 search 3} do_searchcount_test 6.6.1 { @@ -331,7 +331,7 @@ do_searchcount_test 6.6.2 { SELECT c FROM x1 WHERE a=1 OR b=6 OR c=11 } {3 7 11 search 7} do_searchcount_test 6.6.3 { - SELECT c FROM x1 WHERE c=11 OR a=1 OR b=6 + SELECT c FROM x1 WHERE c=11 OR a=1 OR b=6 } {11 3 7 search 7} do_searchcount_test 6.6.4 { SELECT c FROM x1 WHERE b=6 OR c=11 OR a=1 @@ -352,7 +352,7 @@ do_execsql_test 7.1 { } {1 1 {} {}} do_execsql_test 7.3 { - CREATE TABLE foo (Id INTEGER PRIMARY KEY, fa INTEGER, fb INTEGER); + CREATE TABLE foo (Id INTEGER PRIMARY KEY, fa INTEGER, fb INTEGER); CREATE TABLE bar (Id INTEGER PRIMARY KEY, ba INTEGER, bb INTEGER); INSERT INTO foo VALUES(1, 1, 1); @@ -377,39 +377,39 @@ do_execsql_test 7.3 { } do_execsql_test 7.4 { - SELECT + SELECT bar.Id, bar.ba, bar.bb, foo.fb FROM foo LEFT JOIN bar ON (bar.ba = 1 AND bar.bb = foo.fb) OR (bar.ba = 5 AND bar.bb = foo.fb); } { - 1 1 1 1 - {} {} {} 2 - {} {} {} 3 - 4 1 4 4 - {} {} {} 5 - {} {} {} 6 - 7 1 7 7 - {} {} {} 8 + 1 1 1 1 + {} {} {} 2 + {} {} {} 3 + 4 1 4 4 + {} {} {} 5 + {} {} {} 6 + 7 1 7 7 + {} {} {} 8 {} {} {} 9 } do_execsql_test 7.5 { CREATE INDEX idx_bar ON bar(ba, bb); - SELECT + SELECT bar.Id, bar.ba, bar.bb, foo.fb FROM foo LEFT JOIN bar ON (bar.ba = 1 AND bar.bb = foo.fb) OR (bar.ba = 5 AND bar.bb = foo.fb); } { - 1 1 1 1 - {} {} {} 2 - {} {} {} 3 - 4 1 4 4 - {} {} {} 5 - {} {} {} 6 - 7 1 7 7 - {} {} {} 8 + 1 1 1 1 + {} {} {} 2 + {} {} {} 3 + 4 1 4 4 + {} {} {} 5 + {} {} {} 6 + 7 1 7 7 + {} {} {} 8 {} {} {} 9 } diff --git a/third_party/sqlite/src/test/whereE.test b/third_party/sqlite/src/test/whereE.test index a6b8f481b2e52..404f4292ea3b1 100644 --- a/third_party/sqlite/src/test/whereE.test +++ b/third_party/sqlite/src/test/whereE.test @@ -34,7 +34,7 @@ do_execsql_test 1.1 { ALTER TABLE t1 ADD COLUMN c; UPDATE t1 SET c=a*rowid+10000; CREATE INDEX t1ab ON t1(a,b); - + CREATE TABLE t2(x,y); INSERT INTO t2 VALUES(4,44),(5,55),(6,66),(7,77); INSERT INTO t2 SELECT x+4, (x+4)*11 FROM t2; diff --git a/third_party/sqlite/src/test/whereF.test b/third_party/sqlite/src/test/whereF.test index b9580bb196d20..2a7771d75dc02 100644 --- a/third_party/sqlite/src/test/whereF.test +++ b/third_party/sqlite/src/test/whereF.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # Test cases for query planning decisions. @@ -98,13 +98,13 @@ do_execsql_test 3.0 { } {} foreach {tn sql} { - 1 {SELECT t1.a, t1.b, t2.d, t2.e FROM t1, t2 + 1 {SELECT t1.a, t1.b, t2.d, t2.e FROM t1, t2 WHERE t2.d=t1.b AND t1.a=(t2.d+1) AND t1.b = (t2.e+1)} - 2 {SELECT t1.a, t1.b, t2.d, t2.e FROM t2, t1 + 2 {SELECT t1.a, t1.b, t2.d, t2.e FROM t2, t1 WHERE t2.d=t1.b AND t1.a=(t2.d+1) AND t1.b = (t2.e+1)} - 3 {SELECT t1.a, t1.b, t2.d, t2.e FROM t2 CROSS JOIN t1 + 3 {SELECT t1.a, t1.b, t2.d, t2.e FROM t2 CROSS JOIN t1 WHERE t2.d=t1.b AND t1.a=(t2.d+1) AND t1.b = (t2.e+1)} } { do_test 3.$tn { diff --git a/third_party/sqlite/src/test/whereG.test b/third_party/sqlite/src/test/whereG.test index 110ed5dbd46ca..e816f1ed65c13 100644 --- a/third_party/sqlite/src/test/whereG.test +++ b/third_party/sqlite/src/test/whereG.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # Test cases for query planning decisions and the likely(), unlikely(), and # likelihood() functions. @@ -181,7 +181,7 @@ do_execsql_test whereG-4.0 { } {right} #------------------------------------------------------------------------- -# Test that likelihood() specifications on indexed terms are taken into +# Test that likelihood() specifications on indexed terms are taken into # account by various forms of loops. # # 5.1.*: open ended range scans diff --git a/third_party/sqlite/src/test/whereH.test b/third_party/sqlite/src/test/whereH.test index c252fe1ef73c6..fdbeb1ee322b2 100644 --- a/third_party/sqlite/src/test/whereH.test +++ b/third_party/sqlite/src/test/whereH.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # Test cases for query planning decisions where one candidate index # covers a proper superset of the WHERE clause terms of another # candidate index. diff --git a/third_party/sqlite/src/test/whereI.test b/third_party/sqlite/src/test/whereI.test index 29b08549be57f..5236e40c33cc0 100644 --- a/third_party/sqlite/src/test/whereI.test +++ b/third_party/sqlite/src/test/whereI.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# The focus of this file is testing the OR optimization on WITHOUT ROWID +# The focus of this file is testing the OR optimization on WITHOUT ROWID # tables. # @@ -29,7 +29,7 @@ do_execsql_test 1.0 { do_eqp_test 1.1 { SELECT a FROM t1 WHERE b='b' OR c='x' } { - 0 0 0 {SEARCH TABLE t1 USING INDEX i1 (b=?)} + 0 0 0 {SEARCH TABLE t1 USING INDEX i1 (b=?)} 0 0 0 {SEARCH TABLE t1 USING INDEX i2 (c=?)} } @@ -57,7 +57,7 @@ do_execsql_test 2.0 { do_eqp_test 2.1 { SELECT a FROM t2 WHERE b='b' OR c='x' } { - 0 0 0 {SEARCH TABLE t2 USING INDEX i3 (b=?)} + 0 0 0 {SEARCH TABLE t2 USING INDEX i3 (b=?)} 0 0 0 {SEARCH TABLE t2 USING INDEX i4 (c=?)} } diff --git a/third_party/sqlite/src/test/whereJ.test b/third_party/sqlite/src/test/whereJ.test index 48924d0fcfe30..66685137f3752 100644 --- a/third_party/sqlite/src/test/whereJ.test +++ b/third_party/sqlite/src/test/whereJ.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This file implements regression tests for a complex # query planning case. # @@ -26,7 +26,7 @@ do_execsql_test whereJ-1.0 { CREATE TABLE tx1 ( est, cid, - sid, + sid, fid, aid, edate, @@ -398,7 +398,7 @@ do_execsql_test 3.3 { # This one should use index "idx_c". do_eqp_test 3.4 { - SELECT * FROM t1 WHERE + SELECT * FROM t1 WHERE a = 4 AND b BETWEEN 20 AND 80 -- Matches 80 rows AND c BETWEEN 150 AND 160 -- Matches 10 rows @@ -408,7 +408,7 @@ do_eqp_test 3.4 { # This one should use index "idx_ab". do_eqp_test 3.5 { - SELECT * FROM t1 WHERE + SELECT * FROM t1 WHERE a = 5 AND b BETWEEN 20 AND 80 -- Matches 1 row AND c BETWEEN 150 AND 160 -- Matches 10 rows @@ -660,7 +660,7 @@ do_test 5.1 { ('t1','t1abe','2000000 8000 1600 150'), ('t1','t1abf','2000000 8000 1600 150'); ANALYZE sqlite_master; - + EXPLAIN QUERY PLAN SELECT * FROM t1 WHERE (a=1 OR a=2) diff --git a/third_party/sqlite/src/test/wherefault.test b/third_party/sqlite/src/test/wherefault.test index 60330a92ddfab..ab98cc6a58194 100644 --- a/third_party/sqlite/src/test/wherefault.test +++ b/third_party/sqlite/src/test/wherefault.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file implements regression tests for SQLite library. The focus # is testing of where.c. More specifically, the focus is on handling OOM -# errors within the code that optimizes WHERE clauses that feature the +# errors within the code that optimizes WHERE clauses that feature the # OR operator. # @@ -27,7 +27,7 @@ do_malloc_test 1 -sqlprep { CREATE INDEX i2 ON t1(b); } -sqlbody { SELECT c FROM t1 - WHERE + WHERE a = 2 OR b = 'three' OR a = 4 OR b = 'five' OR a = 6 OR b = 'seven' OR a = 8 OR b = 'nine' OR a = 10 ORDER BY rowid; diff --git a/third_party/sqlite/src/test/wild001.test b/third_party/sqlite/src/test/wild001.test index 7fe1404294285..7e342c6f02809 100644 --- a/third_party/sqlite/src/test/wild001.test +++ b/third_party/sqlite/src/test/wild001.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This is a test case from content taken "from the wild". In this # particular instance, the query was provided with permission by # Elan Feingold on 2013-06-27. His message on the SQLite mailing list @@ -23,9 +23,9 @@ # > query in our test suite, that would be off-the-chain terrific. # # Please find items 1..3 in this file: http://www.plexapp.com/elan/sqlite_bug.txt -# +# # You have our permission to include the query in your test suite. -# +# # Thanks for an amazing product. #----------------------------------------------------------------------------- # @@ -284,7 +284,7 @@ do_execsql_test wild001.01 { INSERT INTO sqlite_stat3 VALUES('items','i_secid',15,25903,2,4); INSERT INTO sqlite_stat3 VALUES('items','i_secid',1398,25918,3,5); ANALYZE sqlite_master; - + explain query plan select items.title from items diff --git a/third_party/sqlite/src/test/with1.test b/third_party/sqlite/src/test/with1.test index 7345c5ceb3782..3f1c9615b4a75 100644 --- a/third_party/sqlite/src/test/with1.test +++ b/third_party/sqlite/src/test/with1.test @@ -41,7 +41,7 @@ do_execsql_test 1.3 { do_execsql_test 1.4 { WITH x(a) AS ( SELECT * FROM t1) UPDATE t1 SET x = y; } {} - + #-------------------------------------------------------------------------- do_execsql_test 2.1 { @@ -168,7 +168,7 @@ do_execsql_test 5.2.1 { INSERT INTO edge VALUES(4, 8, 80); INSERT INTO edge VALUES(7, 8, 80); INSERT INTO edge VALUES(8, 9, 90); - + WITH RECURSIVE ancest(id, mtime) AS (VALUES(0, 0) @@ -285,15 +285,15 @@ do_execsql_test 6.2 { ) SELECT fpath FROM flat WHERE fpath!='' ORDER BY 1; } { - /bin - /bin/false /bin/grep /bin/ls /bin/true - /etc - /etc/rc.d - /etc/rc.d/rc.apache /etc/rc.d/rc.samba - /home - /home/dan - /home/dan/public_html - /home/dan/public_html/index.html + /bin + /bin/false /bin/grep /bin/ls /bin/true + /etc + /etc/rc.d + /etc/rc.d/rc.apache /etc/rc.d/rc.samba + /home + /home/dan + /home/dan/public_html + /home/dan/public_html/index.html /home/dan/public_html/index.html/logo.gif } @@ -332,7 +332,7 @@ do_execsql_test 7.2 { SELECT i, '' FROM tree WHERE p IS NULL UNION ALL SELECT i, path || '/' || i FROM tree, t WHERE p = id - ) + ) SELECT path FROM t; } {{} /2 /3 /2/4 /2/4/5} @@ -341,7 +341,7 @@ do_execsql_test 7.3 { VALUES(2) UNION ALL SELECT i FROM tree, t WHERE p = id - ) + ) SELECT id FROM t; } {2 4 5} @@ -350,7 +350,7 @@ do_catchsql_test 7.4 { VALUES(2) UNION ALL SELECT i FROM tree WHERE p IN (SELECT id FROM t) - ) + ) SELECT id FROM t; } {1 {recursive reference in a subquery: t}} @@ -359,7 +359,7 @@ do_catchsql_test 7.5 { VALUES(2) UNION ALL SELECT i FROM tree, t WHERE p = id AND p IN (SELECT id FROM t) - ) + ) SELECT id FROM t; } {1 {multiple recursive references: t}} @@ -368,7 +368,7 @@ do_catchsql_test 7.6 { SELECT i FROM tree WHERE 2 IN (SELECT id FROM t) UNION ALL SELECT i FROM tree, t WHERE p = id - ) + ) SELECT id FROM t; } {1 {circular reference: t}} @@ -381,14 +381,14 @@ do_execsql_test 8.1-mandelbrot { m(iter, cx, cy, x, y) AS ( SELECT 0, x, y, 0.0, 0.0 FROM xaxis, yaxis UNION ALL - SELECT iter+1, cx, cy, x*x-y*y + cx, 2.0*x*y + cy FROM m + SELECT iter+1, cx, cy, x*x-y*y + cx, 2.0*x*y + cy FROM m WHERE (x*x + y*y) < 4.0 AND iter<28 ), m2(iter, cx, cy) AS ( SELECT max(iter), cx, cy FROM m GROUP BY cx, cy ), a(t) AS ( - SELECT group_concat( substr(' .+*#', 1+min(iter/7,4), 1), '') + SELECT group_concat( substr(' .+*#', 1+min(iter/7,4), 1), '') FROM m2 GROUP BY cy ) SELECT group_concat(rtrim(t),x'0a') FROM a; @@ -422,14 +422,14 @@ do_execsql_test 8.2-soduko { input(sud) AS ( VALUES('53..7....6..195....98....6.8...6...34..8.3..17...2...6.6....28....419..5....8..79') ), - + /* A table filled with digits 1..9, inclusive. */ digits(z, lp) AS ( VALUES('1', 1) UNION ALL SELECT CAST(lp+1 AS TEXT), lp+1 FROM digits WHERE lp<9 ), - + /* The tricky bit. */ x(s, ind) AS ( SELECT sud, instr(sud, '.') FROM input @@ -454,7 +454,7 @@ do_execsql_test 8.2-soduko { #-------------------------------------------------------------------------- # Some tests that use LIMIT and OFFSET in the definition of recursive CTEs. -# +# set I [list 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20] proc limit_test {tn iLimit iOffset} { if {$iOffset < 0} { set iOffset 0 } @@ -466,8 +466,8 @@ proc limit_test {tn iLimit iOffset} { uplevel [list do_execsql_test $tn [subst -nocommands { WITH ii(a) AS ( VALUES(1) - UNION ALL - SELECT a+1 FROM ii WHERE a<20 + UNION ALL + SELECT a+1 FROM ii WHERE a<20 LIMIT $iLimit OFFSET $iOffset ) SELECT * FROM ii @@ -526,7 +526,7 @@ do_execsql_test 10.2 { ) SELECT p FROM flat ORDER BY p; } { - /a /a/a /a/a/a + /a /a/a /a/a/a /a/b /a/b/c /a/b/c/d /a/b/d } @@ -538,10 +538,10 @@ proc scan_tree {bDepthFirst bReverse} { set order "ORDER BY " if {$bDepthFirst==0} { append order "2 ASC," } - if {$bReverse==0} { - append order " 3 ASC" + if {$bReverse==0} { + append order " 3 ASC" } else { - append order " 3 DESC" + append order " 3 DESC" } db eval " @@ -580,7 +580,7 @@ do_test 10.4 { scan_tree 1 0 } [list {*}{ /a /a/b /a/b/c - /a/d /a/d/e + /a/d /a/d/e /a/d/f /g /g/h }] @@ -590,9 +590,9 @@ do_test 10.4 { do_test 10.5 { scan_tree 0 1 } [list {*}{ - /g /a - /g/h /a/d /a/b - /a/d/f /a/d/e /a/b/c + /g /a + /g/h /a/d /a/b + /a/d/f /a/d/e /a/b/c }] # Depth first, siblings in ascending order. @@ -601,8 +601,8 @@ do_test 10.6 { scan_tree 1 1 } [list {*}{ /g /g/h - /a /a/d /a/d/f - /a/d/e + /a /a/d /a/d/f + /a/d/e /a/b /a/b/c }] @@ -612,19 +612,19 @@ do_test 10.6 { do_catchsql_test 10.7.1 { WITH t(a) AS ( SELECT 1 AS b UNION ALL SELECT a+1 AS c FROM t WHERE a<5 ORDER BY a - ) + ) SELECT * FROM t } {1 {1st ORDER BY term does not match any column in the result set}} do_execsql_test 10.7.2 { WITH t(a) AS ( SELECT 1 AS b UNION ALL SELECT a+1 AS c FROM t WHERE a<5 ORDER BY b - ) + ) SELECT * FROM t } {1 2 3 4 5} do_execsql_test 10.7.3 { WITH t(a) AS ( SELECT 1 AS b UNION ALL SELECT a+1 AS c FROM t WHERE a<5 ORDER BY c - ) + ) SELECT * FROM t } {1 2 3 4 5} @@ -656,7 +656,7 @@ do_execsql_test 10.8.1 { } do_execsql_test 10.8.2 { WITH flat(fid, depth, p) AS ( - SELECT id, 1, ('/' || payload) COLLATE nocase + SELECT id, 1, ('/' || payload) COLLATE nocase FROM tree WHERE parentid IS NULL UNION ALL SELECT id, depth+1, (p||'/'||payload) @@ -674,7 +674,7 @@ do_execsql_test 10.8.3 { SELECT id, 1, ('/' || payload) FROM tree WHERE parentid IS NULL UNION ALL - SELECT id, depth+1, (p||'/'||payload) COLLATE nocase + SELECT id, depth+1, (p||'/'||payload) COLLATE nocase FROM flat, tree WHERE parentid=fid ORDER BY 2, 3 ) @@ -727,7 +727,7 @@ do_execsql_test 11.1 { INSERT INTO org VALUES('Xia','Xaviar'); INSERT INTO org VALUES('Xerxes','Xaviar'); INSERT INTO org VALUES('Xena','Xia'); - -- Find all members of Alice's group, breath-first order + -- Find all members of Alice's group, breath-first order WITH RECURSIVE under_alice(name,level) AS ( VALUES('Alice','0') @@ -818,7 +818,7 @@ do_execsql_test 11.3 { #-------------------------------------------------------------------------- # Ticket [31a19d11b97088296ac104aaff113a9790394927] (2014-02-09) -# Name resolution issue with compound SELECTs and Common Table Expressions +# Name resolution issue with compound SELECTs and Common Table Expressions # do_execsql_test 12.1 { WITH RECURSIVE @@ -912,7 +912,7 @@ do_catchsql_test 17.4 { } {1 {no such table: t11}} do_execsql_test 17.5 { - WITH + WITH x1 AS (SELECT 10), x2 AS (SELECT * FROM x1), x3 AS ( @@ -923,7 +923,7 @@ do_execsql_test 17.5 { } {10 10} do_execsql_test 17.6 { - WITH + WITH x1 AS (SELECT 10), x2 AS (SELECT * FROM x1), x3 AS ( @@ -934,11 +934,11 @@ do_execsql_test 17.6 { } {10 11} do_execsql_test 17.7 { - WITH + WITH x1 AS (SELECT 10), x2 AS (SELECT * FROM x1), x3 AS ( - WITH + WITH x1 AS ( SELECT 11 ), x4 AS ( SELECT * FROM x2 ) SELECT * FROM x4 UNION ALL SELECT * FROM x1 @@ -947,11 +947,11 @@ do_execsql_test 17.7 { } {10 11} do_execsql_test 17.8 { - WITH + WITH x1 AS (SELECT 10), x2 AS (SELECT * FROM x1), x3 AS ( - WITH + WITH x1 AS ( SELECT 11 ), x4 AS ( SELECT * FROM x2 ) SELECT * FROM x4 UNION ALL SELECT * FROM x1 @@ -960,14 +960,14 @@ do_execsql_test 17.8 { } {10 11} do_execsql_test 17.9 { - WITH + WITH x1 AS (SELECT 10), x2 AS (SELECT 11), x3 AS ( SELECT * FROM x1 UNION ALL SELECT * FROM x2 ), x4 AS ( - WITH + WITH x1 AS (SELECT 12), x2 AS (SELECT 13) SELECT * FROM x3 @@ -984,7 +984,7 @@ do_execsql_test 18.1 { do_execsql_test 18.2 { WITH xyz(x) AS ( SELECT printf('%d', 5) * NULL - UNION SELECT round(1<1+x) + UNION SELECT round(1<1+x) FROM xyz ORDER BY 1 ) SELECT 1 FROM xyz; diff --git a/third_party/sqlite/src/test/with2.test b/third_party/sqlite/src/test/with2.test index 02d10b5112b10..057945e9edebe 100644 --- a/third_party/sqlite/src/test/with2.test +++ b/third_party/sqlite/src/test/with2.test @@ -59,7 +59,7 @@ do_execsql_test 1.5 { WITH x1 AS (SELECT a FROM t1), x2 AS (SELECT i FROM t2), x3 AS (SELECT * FROM x1, x2 WHERE x1.a IN x2 AND x2.i IN x1) - SELECT * FROM x3 + SELECT * FROM x3 } {2 2} do_execsql_test 1.6 { @@ -101,10 +101,10 @@ do_execsql_test 1.10 { } {3 2 1 3 2 2} do_execsql_test 1.11 { - WITH - i(x) AS ( - WITH - j(x) AS ( SELECT * FROM i ), + WITH + i(x) AS ( + WITH + j(x) AS ( SELECT * FROM i ), i(x) AS ( SELECT * FROM t1 ) SELECT * FROM j ) @@ -137,30 +137,30 @@ do_execsql_test 1.13 { } {.......... ......... ........ ....... ...... ..... .... ... .. .} do_execsql_test 1.14 { - WITH - t4(x) AS ( + WITH + t4(x) AS ( VALUES(4) - UNION ALL + UNION ALL SELECT x+1 FROM t4 WHERE x<10 ) SELECT * FROM t4; } {4 5 6 7 8 9 10} do_execsql_test 1.15 { - WITH - t4(x) AS ( + WITH + t4(x) AS ( VALUES(4) - UNION ALL + UNION ALL SELECT x+1 FROM main.t4 WHERE x<10 ) SELECT * FROM t4; } {4 5} do_catchsql_test 1.16 { - WITH - t4(x) AS ( + WITH + t4(x) AS ( VALUES(4) - UNION ALL + UNION ALL SELECT x+1 FROM t4, main.t4, t4 WHERE x<10 ) SELECT * FROM t4; @@ -195,7 +195,7 @@ do_catchsql_test 3.1 { } {1 {circular reference: i}} do_catchsql_test 3.2 { - WITH + WITH i(x) AS ( SELECT * FROM j ), j(x) AS ( SELECT * FROM k ), k(x) AS ( SELECT * FROM i ) @@ -203,22 +203,22 @@ do_catchsql_test 3.2 { } {1 {circular reference: i}} do_catchsql_test 3.3 { - WITH + WITH i(x) AS ( SELECT * FROM (SELECT * FROM j) ), j(x) AS ( SELECT * FROM (SELECT * FROM i) ) SELECT * FROM i; } {1 {circular reference: i}} do_catchsql_test 3.4 { - WITH + WITH i(x) AS ( SELECT * FROM (SELECT * FROM j) ), j(x) AS ( SELECT * FROM (SELECT * FROM i) ) SELECT * FROM j; } {1 {circular reference: j}} do_catchsql_test 3.5 { - WITH - i(x) AS ( + WITH + i(x) AS ( WITH j(x) AS ( SELECT * FROM i ) SELECT * FROM j ) @@ -254,7 +254,7 @@ do_catchsql_test 4.7 [genstmt [expr $nLimit+1]] \ {1 {too many columns in result set}} #--------------------------------------------------------------------------- -# Check that adding a WITH clause to an INSERT disables the xfer +# Check that adding a WITH clause to an INSERT disables the xfer # optimization. # proc do_xfer_test {tn bXfer sql {res {}}} { @@ -275,16 +275,16 @@ do_execsql_test 5.1 { do_xfer_test 5.2 1 { INSERT INTO t1 SELECT * FROM t2 } do_xfer_test 5.3 0 { INSERT INTO t1 SELECT a, b FROM t2 } do_xfer_test 5.4 0 { INSERT INTO t1 SELECT b, a FROM t2 } -do_xfer_test 5.5 0 { - WITH x AS (SELECT a, b FROM t2) INSERT INTO t1 SELECT * FROM x +do_xfer_test 5.5 0 { + WITH x AS (SELECT a, b FROM t2) INSERT INTO t1 SELECT * FROM x } -do_xfer_test 5.6 0 { - WITH x AS (SELECT a, b FROM t2) INSERT INTO t1 SELECT * FROM t2 +do_xfer_test 5.6 0 { + WITH x AS (SELECT a, b FROM t2) INSERT INTO t1 SELECT * FROM t2 } -do_xfer_test 5.7 0 { +do_xfer_test 5.7 0 { INSERT INTO t1 WITH x AS ( SELECT * FROM t2 ) SELECT * FROM x } -do_xfer_test 5.8 0 { +do_xfer_test 5.8 0 { INSERT INTO t1 WITH x(a,b) AS ( SELECT * FROM t2 ) SELECT * FROM x } @@ -324,19 +324,19 @@ do_catchsql_test 6.5 { DELETE FROM t2 WHERE; } {1 {near ";": syntax error}} -do_catchsql_test 6.6 { +do_catchsql_test 6.6 { WITH x AS (SELECT * FROM t1) DELETE FROM t2 WHERE } {/1 {near .* syntax error}/} -do_catchsql_test 6.7 { +do_catchsql_test 6.7 { WITH x AS (SELECT * FROM t1) DELETE FROM t2 WHRE 1; } {/1 {near .* syntax error}/} -do_catchsql_test 6.8 { +do_catchsql_test 6.8 { WITH x AS (SELECT * FROM t1) UPDATE t2 SET a = 10, b = ; } {/1 {near .* syntax error}/} -do_catchsql_test 6.9 { +do_catchsql_test 6.9 { WITH x AS (SELECT * FROM t1) UPDATE t2 SET a = 10, b = 1 WHERE a===b; } {/1 {near .* syntax error}/} @@ -357,10 +357,10 @@ do_execsql_test 7.1 { CREATE TABLE t6(y INTEGER); WITH s(x) AS ( VALUES(7) UNION ALL SELECT x+7 FROM s WHERE x<49 ) - INSERT INTO t5 + INSERT INTO t5 SELECT * FROM s; - INSERT INTO t6 + INSERT INTO t6 WITH s(x) AS ( VALUES(2) UNION ALL SELECT x+2 FROM s WHERE x<49 ) SELECT * FROM s; } @@ -387,7 +387,7 @@ do_execsql_test 7.5 { } {14 28 42} #------------------------------------------------------------------------- -# At one point the following was causing an assertion failure and a +# At one point the following was causing an assertion failure and a # memory leak. # do_execsql_test 8.1 { @@ -399,7 +399,7 @@ do_execsql_test 8.1 { do_execsql_test 8.2 { WITH q(a) AS ( SELECT 1 - UNION + UNION SELECT a+1 FROM q, v WHERE a<5 ) SELECT * FROM q; diff --git a/third_party/sqlite/src/test/with3.test b/third_party/sqlite/src/test/with3.test index 5540a7fca6de6..06da79634ee18 100644 --- a/third_party/sqlite/src/test/with3.test +++ b/third_party/sqlite/src/test/with3.test @@ -21,7 +21,7 @@ ifcapable {!cte} { return } -# Test problems found by Kostya Serebryany using +# Test problems found by Kostya Serebryany using # LibFuzzer. (http://llvm.org/docs/LibFuzzer.html) # do_catchsql_test 1.0 { @@ -80,9 +80,9 @@ ifcapable analyze { WITH cnt(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM cnt LIMIT 1) SELECT * FROM cnt, y1 WHERE i=a } { - 3 0 0 {SCAN TABLE cnt} + 3 0 0 {SCAN TABLE cnt} 1 0 0 {COMPOUND SUBQUERIES 0 AND 0 (UNION ALL)} - 0 0 0 {SCAN SUBQUERY 1} + 0 0 0 {SCAN SUBQUERY 1} 0 1 1 {SEARCH TABLE y1 USING INDEX y1a (a=?)} } @@ -90,9 +90,9 @@ ifcapable analyze { WITH cnt(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM cnt LIMIT 1000000) SELECT * FROM cnt, y1 WHERE i=a } { - 3 0 0 {SCAN TABLE cnt} + 3 0 0 {SCAN TABLE cnt} 1 0 0 {COMPOUND SUBQUERIES 0 AND 0 (UNION ALL)} - 0 0 1 {SCAN TABLE y1} + 0 0 1 {SCAN TABLE y1} 0 1 0 {SEARCH SUBQUERY 1 USING AUTOMATIC COVERING INDEX (i=?)} } } @@ -108,12 +108,12 @@ do_eqp_test 3.2.2 { SELECT * FROM c, w2, w1 WHERE c.id=w2.pk AND c.id=w1.pk; } { - 2 0 0 {EXECUTE SCALAR SUBQUERY 3} - 3 0 0 {SCAN TABLE w2} + 2 0 0 {EXECUTE SCALAR SUBQUERY 3} + 3 0 0 {SCAN TABLE w2} 4 0 0 {SCAN TABLE w1} - 4 1 1 {SCAN TABLE c} + 4 1 1 {SCAN TABLE c} 1 0 0 {COMPOUND SUBQUERIES 0 AND 0 (UNION ALL)} 0 0 0 {SCAN SUBQUERY 1} - 0 1 1 {SEARCH TABLE w2 USING INTEGER PRIMARY KEY (rowid=?)} + 0 1 1 {SEARCH TABLE w2 USING INTEGER PRIMARY KEY (rowid=?)} 0 2 2 {SEARCH TABLE w1 USING INTEGER PRIMARY KEY (rowid=?)} } diff --git a/third_party/sqlite/src/test/withM.test b/third_party/sqlite/src/test/withM.test index 78b757f4226b4..a504c2cbe9339 100644 --- a/third_party/sqlite/src/test/withM.test +++ b/third_party/sqlite/src/test/withM.test @@ -30,7 +30,7 @@ do_execsql_test 1.0 { do_faultsim_test withM-1.1 -prep { sqlite3 db test.db } -body { - execsql { + execsql { WITH tmp AS ( SELECT * FROM t1 ) SELECT * FROM tmp; } @@ -42,9 +42,9 @@ do_faultsim_test withM-1.1 -prep { do_faultsim_test withM-1.2 -prep { sqlite3 db test.db } -body { - execsql { + execsql { WITH w1 AS ( SELECT * FROM t1 ), - w2 AS ( + w2 AS ( WITH w3 AS ( SELECT * FROM w1 ) SELECT * FROM w3 ) @@ -58,8 +58,8 @@ do_faultsim_test withM-1.2 -prep { do_faultsim_test withM-1.3 -prep { sqlite3 db test.db } -body { - execsql { - WITH w1(a,b) AS ( + execsql { + WITH w1(a,b) AS ( SELECT 1, 1 UNION ALL SELECT a+1, b + 2*a + 1 FROM w1 diff --git a/third_party/sqlite/src/test/without_rowid1.test b/third_party/sqlite/src/test/without_rowid1.test index 0c77773abb3e7..b2d6fb202edf2 100644 --- a/third_party/sqlite/src/test/without_rowid1.test +++ b/third_party/sqlite/src/test/without_rowid1.test @@ -154,7 +154,7 @@ do_execsql_test 2.4.2 { } {ABC def ghi ABC def ghi} #------------------------------------------------------------------------- -# Unless the destination table is completely empty, the xfer optimization +# Unless the destination table is completely empty, the xfer optimization # is disabled for WITHOUT ROWID tables. The following tests check for # some problems that might occur if this were not the case. # @@ -295,9 +295,9 @@ do_execsql_test 6.0 { do_execsql_test 6.1 { CREATE TABLE t48( - a UNIQUE UNIQUE, - b UNIQUE, - PRIMARY KEY(a), + a UNIQUE UNIQUE, + b UNIQUE, + PRIMARY KEY(a), UNIQUE(a) ) WITHOUT ROWID; INSERT INTO t48 VALUES('a', 'b'), ('c', 'd'), ('e', 'f'); @@ -328,5 +328,5 @@ do_catchsql_test 7.3 { ) WITHOUT ROWID; } {1 {no such column: rowid}} - + finish_test diff --git a/third_party/sqlite/src/test/without_rowid3.test b/third_party/sqlite/src/test/without_rowid3.test index 387a213b99e23..272ecf023f0c4 100644 --- a/third_party/sqlite/src/test/without_rowid3.test +++ b/third_party/sqlite/src/test/without_rowid3.test @@ -25,9 +25,9 @@ ifcapable {!foreignkey||!trigger} { #------------------------------------------------------------------------- # Test structure: # -# without_rowid3-1.*: Simple tests to check that immediate and deferred foreign key +# without_rowid3-1.*: Simple tests to check that immediate and deferred foreign key # constraints work when not inside a transaction. -# +# # without_rowid3-2.*: Tests to verify that deferred foreign keys work inside # explicit transactions (i.e that processing really is deferred). # @@ -40,12 +40,12 @@ ifcapable {!foreignkey||!trigger} { # without_rowid3-5.*: Check that if foreign-keys are enabled, it is not possible # to write to an FK column using the incremental blob API. # -# without_rowid3-6.*: Test that FK processing is automatically disabled when +# without_rowid3-6.*: Test that FK processing is automatically disabled when # running VACUUM. # # without_rowid3-7.*: Test using an IPK as the key in the child (referencing) table. # -# without_rowid3-8.*: Test that enabling/disabling foreign key support while a +# without_rowid3-8.*: Test that enabling/disabling foreign key support while a # transaction is active is not possible. # # without_rowid3-9.*: Test SET DEFAULT actions. @@ -61,17 +61,17 @@ ifcapable {!foreignkey||!trigger} { # # without_rowid3-14.*: Test the ALTER TABLE and DROP TABLE commands. # -# without_rowid3-15.*: Test that if there are no (known) outstanding foreign key +# without_rowid3-15.*: Test that if there are no (known) outstanding foreign key # constraint violations in the database, inserting into a parent # table or deleting from a child table does not cause SQLite # to check if this has repaired an outstanding violation. # -# without_rowid3-16.*: Test that rows that refer to themselves may be inserted, +# without_rowid3-16.*: Test that rows that refer to themselves may be inserted, # updated and deleted. # # without_rowid3-17.*: Test that the "count_changes" pragma does not interfere with # FK constraint processing. -# +# # without_rowid3-18.*: Test that the authorization callback is invoked when processing # FK constraints. # @@ -139,7 +139,7 @@ set FkeySimpleTests { 4.17 "UPDATE t7 SET a = 10" {0 {}} 5.1 "INSERT INTO t9 VALUES(1, 3)" {1 {no such table: main.nosuchtable}} - 5.2 "INSERT INTO t10 VALUES(1, 3)" + 5.2 "INSERT INTO t10 VALUES(1, 3)" {1 {foreign key mismatch - "t10" referencing "t9"}} } @@ -333,7 +333,7 @@ without_rowid3-2-test 32 1 "RELEASE save" without_rowid3-2-test 33 1 "DELETE FROM leaf WHERE cellid = 'b'" without_rowid3-2-test 34 0 "DELETE FROM leaf WHERE cellid = 'c'" without_rowid3-2-test 35 0 "COMMIT" -without_rowid3-2-test 36 0 "SELECT * FROM node" {2 {}} +without_rowid3-2-test 36 0 "SELECT * FROM node" {2 {}} without_rowid3-2-test 37 0 "SELECT * FROM leaf" {a 2} without_rowid3-2-test 38 0 "SAVEPOINT outer" @@ -361,10 +361,10 @@ without_rowid3-2-test 58 0 "RELEASE outer" without_rowid3-2-test 59 0 "SELECT * FROM node" {2 {} 3 2 4 {}} without_rowid3-2-test 60 0 "SELECT * FROM leaf" {a 2 d 3 e 3 f 4} -# The following set of tests check that if a statement that affects -# multiple rows violates some foreign key constraints, then strikes a -# constraint that causes the statement-transaction to be rolled back, -# the deferred constraint counter is correctly reset to the value it +# The following set of tests check that if a statement that affects +# multiple rows violates some foreign key constraints, then strikes a +# constraint that causes the statement-transaction to be rolled back, +# the deferred constraint counter is correctly reset to the value it # had before the statement-transaction was opened. # without_rowid3-2-test 61 0 "BEGIN" @@ -399,11 +399,11 @@ do_test without_rowid3-3.1.1 { execsql { CREATE TABLE ab(a PRIMARY KEY, b) WITHOUT rowid; CREATE TABLE cd( - c PRIMARY KEY REFERENCES ab ON UPDATE CASCADE ON DELETE CASCADE, + c PRIMARY KEY REFERENCES ab ON UPDATE CASCADE ON DELETE CASCADE, d ) WITHOUT rowid; CREATE TABLE ef( - e REFERENCES cd ON UPDATE CASCADE, + e REFERENCES cd ON UPDATE CASCADE, f, CHECK (e!=5) ); } @@ -440,14 +440,14 @@ do_test without_rowid3-3.2.2 { } {1 b 1 d 1 e} #------------------------------------------------------------------------- -# Test cases without_rowid3-4.* test that recursive foreign key actions +# Test cases without_rowid3-4.* test that recursive foreign key actions # (i.e. CASCADE) are allowed even if recursive triggers are disabled. # drop_all_tables do_test without_rowid3-4.1 { execsql { CREATE TABLE t1( - node PRIMARY KEY, + node PRIMARY KEY, parent REFERENCES t1 ON DELETE CASCADE ) WITHOUT rowid; CREATE TABLE t2(node PRIMARY KEY, parent) WITHOUT rowid; @@ -466,14 +466,14 @@ do_test without_rowid3-4.1 { } {} do_test without_rowid3-4.2 { execsql { PRAGMA recursive_triggers = off } - execsql { + execsql { BEGIN; DELETE FROM t1 WHERE node = 1; SELECT node FROM t1; } } {} do_test without_rowid3-4.3 { - execsql { + execsql { DELETE FROM t2 WHERE node = 1; SELECT node FROM t2; ROLLBACK; @@ -481,14 +481,14 @@ do_test without_rowid3-4.3 { } {4 5 6 7} do_test without_rowid3-4.4 { execsql { PRAGMA recursive_triggers = on } - execsql { + execsql { BEGIN; DELETE FROM t1 WHERE node = 1; SELECT node FROM t1; } } {} do_test without_rowid3-4.3 { - execsql { + execsql { DELETE FROM t2 WHERE node = 1; SELECT node FROM t2; ROLLBACK; @@ -534,7 +534,7 @@ ifcapable vacuum { #------------------------------------------------------------------------- # Test that it is possible to use an INT PRIMARY KEY as the child key # of a foreign constraint. -# +# drop_all_tables do_test without_rowid3-7.1 { execsql { @@ -546,7 +546,7 @@ do_test without_rowid3-7.2 { catchsql { INSERT INTO t2 VALUES(1, 'A'); } } {1 {FOREIGN KEY constraint failed}} do_test without_rowid3-7.3 { - execsql { + execsql { INSERT INTO t1 VALUES(1, 2); INSERT INTO t1 VALUES(2, 3); INSERT INTO t2 VALUES(1, 'A'); @@ -571,7 +571,7 @@ do_test without_rowid3-7.8 { #------------------------------------------------------------------------- # Test that it is not possible to enable/disable FK support while a # transaction is open. -# +# drop_all_tables proc without_rowid3-8-test {tn zSql value} { do_test without_rowid3-2.8.$tn.1 [list execsql $zSql] {} @@ -637,8 +637,8 @@ do_test without_rowid3-9.2.1 { execsql { CREATE TABLE pp(a, b, c, PRIMARY KEY(b, c)) WITHOUT rowid; CREATE TABLE cc(d DEFAULT 3, e DEFAULT 1, f DEFAULT 2, - FOREIGN KEY(f, d) REFERENCES pp - ON UPDATE SET DEFAULT + FOREIGN KEY(f, d) REFERENCES pp + ON UPDATE SET DEFAULT ON DELETE SET NULL ); INSERT INTO pp VALUES(1, 2, 3); @@ -664,7 +664,7 @@ do_test without_rowid3-9.2.3 { } {{} A {} {} B {} 3 A 2 3 B 2} #------------------------------------------------------------------------- -# The following tests, without_rowid3-10.*, test "foreign key mismatch" and +# The following tests, without_rowid3-10.*, test "foreign key mismatch" and # other errors. # set tn 0 @@ -689,7 +689,7 @@ foreach zSql [list { } {/1 {foreign key mismatch - "c" referencing "."}/} } -# "rowid" cannot be used as part of a child or parent key definition +# "rowid" cannot be used as part of a child or parent key definition # unless it happens to be the name of an explicitly declared column. # do_test without_rowid3-10.2.1 { @@ -750,30 +750,30 @@ do_test without_rowid3-12.1.1 { execsql { CREATE TABLE t1(a, b PRIMARY KEY) WITHOUT rowid; CREATE TABLE t2( - x REFERENCES t1 ON UPDATE RESTRICT DEFERRABLE INITIALLY DEFERRED + x REFERENCES t1 ON UPDATE RESTRICT DEFERRABLE INITIALLY DEFERRED ); INSERT INTO t1 VALUES(1, 'one'); INSERT INTO t1 VALUES(2, 'two'); INSERT INTO t1 VALUES(3, 'three'); } } {} -do_test without_rowid3-12.1.2 { +do_test without_rowid3-12.1.2 { execsql "BEGIN" execsql "INSERT INTO t2 VALUES('two')" } {} -do_test without_rowid3-12.1.3 { +do_test without_rowid3-12.1.3 { execsql "UPDATE t1 SET b = 'four' WHERE b = 'one'" } {} -do_test without_rowid3-12.1.4 { +do_test without_rowid3-12.1.4 { catchsql "UPDATE t1 SET b = 'five' WHERE b = 'two'" } {1 {FOREIGN KEY constraint failed}} -do_test without_rowid3-12.1.5 { +do_test without_rowid3-12.1.5 { execsql "DELETE FROM t1 WHERE b = 'two'" } {} -do_test without_rowid3-12.1.6 { +do_test without_rowid3-12.1.6 { catchsql "COMMIT" } {1 {FOREIGN KEY constraint failed}} -do_test without_rowid3-12.1.7 { +do_test without_rowid3-12.1.7 { execsql { INSERT INTO t1 VALUES(2, 'two'); COMMIT; @@ -784,7 +784,7 @@ drop_all_tables do_test without_rowid3-12.2.1 { execsql { CREATE TABLE t1(x COLLATE NOCASE PRIMARY KEY) WITHOUT rowid; - CREATE TRIGGER tt1 AFTER DELETE ON t1 + CREATE TRIGGER tt1 AFTER DELETE ON t1 WHEN EXISTS ( SELECT 1 FROM t2 WHERE old.x = y ) BEGIN INSERT INTO t1 VALUES(old.x); @@ -854,14 +854,14 @@ do_test without_rowid3-12.3.3 { catchsql { INSERT INTO down(c39, c38) VALUES('yes', 'no') } } {1 {FOREIGN KEY constraint failed}} do_test without_rowid3-12.3.4 { - execsql { + execsql { INSERT INTO up(c34, c35) VALUES('yes', 'no'); INSERT INTO down(c39, c38) VALUES('yes', 'no'); } catchsql { DELETE FROM up WHERE c34 = 'yes' } } {1 {FOREIGN KEY constraint failed}} do_test without_rowid3-12.3.5 { - execsql { + execsql { DELETE FROM up WHERE c34 = 'possibly'; SELECT c34, c35 FROM up; SELECT c39, c38 FROM down; @@ -918,7 +918,7 @@ drop_all_tables ifcapable altertable { do_test without_rowid3-14.1.1 { # Adding a column with a REFERENCES clause is not supported. - execsql { + execsql { CREATE TABLE t1(a PRIMARY KEY) WITHOUT rowid; CREATE TABLE t2(a, b); } @@ -937,15 +937,15 @@ ifcapable altertable { catchsql { ALTER TABLE t2 ADD COLUMN g DEFAULT CURRENT_TIME REFERENCES t1 } } {1 {Cannot add a REFERENCES column with non-NULL default value}} do_test without_rowid3-14.1.6 { - execsql { + execsql { PRAGMA foreign_keys = off; ALTER TABLE t2 ADD COLUMN h DEFAULT 'text' REFERENCES t1; PRAGMA foreign_keys = on; SELECT sql FROM sqlite_master WHERE name='t2'; } } {{CREATE TABLE t2(a, b, c REFERENCES t1, d DEFAULT NULL REFERENCES t1, e REFERENCES t1 DEFAULT NULL, h DEFAULT 'text' REFERENCES t1)}} - - + + # Test the sqlite_rename_parent() function directly. # proc test_rename_parent {zCreate zOld zNew} { @@ -960,7 +960,7 @@ ifcapable altertable { do_test without_rowid3-14.2.1.3 { test_rename_parent {CREATE TABLE t1(a REFERENCES "t2")} t2 t3 } {{CREATE TABLE t1(a REFERENCES "t3")}} - + # Test ALTER TABLE RENAME TABLE a bit. # do_test without_rowid3-14.2.2.1 { @@ -1008,7 +1008,7 @@ ifcapable altertable { drop_all_tables do_test without_rowid3-14.1tmp.1 { # Adding a column with a REFERENCES clause is not supported. - execsql { + execsql { CREATE TEMP TABLE t1(a PRIMARY KEY) WITHOUT rowid; CREATE TEMP TABLE t2(a, b); } @@ -1027,7 +1027,7 @@ ifcapable altertable { catchsql { ALTER TABLE t2 ADD COLUMN g DEFAULT CURRENT_TIME REFERENCES t1 } } {1 {Cannot add a REFERENCES column with non-NULL default value}} do_test without_rowid3-14.1tmp.6 { - execsql { + execsql { PRAGMA foreign_keys = off; ALTER TABLE t2 ADD COLUMN h DEFAULT 'text' REFERENCES t1; PRAGMA foreign_keys = on; @@ -1044,7 +1044,7 @@ ifcapable altertable { do_test without_rowid3-14.2tmp.1.3 { test_rename_parent {CREATE TABLE t1(a REFERENCES "t2")} t2 t3 } {{CREATE TABLE t1(a REFERENCES "t3")}} - + # Test ALTER TABLE RENAME TABLE a bit. # do_test without_rowid3-14.2tmp.2.1 { @@ -1092,7 +1092,7 @@ ifcapable altertable { drop_all_tables do_test without_rowid3-14.1aux.1 { # Adding a column with a REFERENCES clause is not supported. - execsql { + execsql { ATTACH ':memory:' AS aux; CREATE TABLE aux.t1(a PRIMARY KEY) WITHOUT rowid; CREATE TABLE aux.t2(a, b); @@ -1112,7 +1112,7 @@ ifcapable altertable { catchsql { ALTER TABLE t2 ADD COLUMN g DEFAULT CURRENT_TIME REFERENCES t1 } } {1 {Cannot add a REFERENCES column with non-NULL default value}} do_test without_rowid3-14.1aux.6 { - execsql { + execsql { PRAGMA foreign_keys = off; ALTER TABLE t2 ADD COLUMN h DEFAULT 'text' REFERENCES t1; PRAGMA foreign_keys = on; @@ -1129,7 +1129,7 @@ ifcapable altertable { do_test without_rowid3-14.2aux.1.3 { test_rename_parent {CREATE TABLE t1(a REFERENCES "t2")} t2 t3 } {{CREATE TABLE t1(a REFERENCES "t3")}} - + # Test ALTER TABLE RENAME TABLE a bit. # do_test without_rowid3-14.2aux.2.1 { @@ -1228,7 +1228,7 @@ do_test without_rowid3-2.14.3.9 { } {} do_test without_rowid3-2.14.3.10 { execsql { - CREATE TABLE cc(a, b, + CREATE TABLE cc(a, b, FOREIGN KEY(a, b) REFERENCES pp DEFERRABLE INITIALLY DEFERRED ); } @@ -1243,7 +1243,7 @@ do_test without_rowid3-2.14.3.10 { } } {} do_test without_rowid3-2.14.3.11 { - execsql { + execsql { BEGIN; DROP TABLE cc; DROP TABLE pp; @@ -1270,7 +1270,7 @@ do_test without_rowid3-2.14.3.13 { drop_all_tables do_test without_rowid3-2.14.4.1 { execsql { - CREATE TABLE t1(x REFERENCES v); + CREATE TABLE t1(x REFERENCES v); CREATE VIEW v AS SELECT * FROM t1; } } {} @@ -1292,7 +1292,7 @@ ifcapable vtab { } #------------------------------------------------------------------------- -# The following tests, without_rowid3-15.*, test that unnecessary FK related scans +# The following tests, without_rowid3-15.*, test that unnecessary FK related scans # and lookups are avoided when the constraint counters are zero. # drop_all_tables @@ -1337,7 +1337,7 @@ do_test without_rowid3-15.1.6 { } } {1} do_test without_rowid3-15.1.7 { - execsql { + execsql { BEGIN; DELETE FROM pp WHERE a = 2; } @@ -1490,7 +1490,7 @@ do_execsql_test without_rowid3-16.4.2.6 { drop_all_tables do_test without_rowid3-17.1.1 { execsql { PRAGMA count_changes = 1 } - execsql { + execsql { CREATE TABLE one(a, b, c, UNIQUE(b, c)); CREATE TABLE two(d, e, f, FOREIGN KEY(e, f) REFERENCES one(b, c)); INSERT INTO one VALUES(1, 2, 3); @@ -1543,7 +1543,7 @@ do_test without_rowid3-17.1.9 { do_test without_rowid3-17.1.10 { execsql { CREATE TABLE three( - g, h, i, + g, h, i, FOREIGN KEY(h, i) REFERENCES one(b, c) DEFERRABLE INITIALLY DEFERRED ); } @@ -1569,7 +1569,7 @@ do_test without_rowid3-17.2.1 { execsql { CREATE TABLE high("a'b!" PRIMARY KEY, b) WITHOUT rowid; CREATE TABLE low( - c, + c, "d&6" REFERENCES high ON UPDATE CASCADE ON DELETE CASCADE ); } @@ -1639,7 +1639,7 @@ ifcapable auth { execsql { INSERT INTO short VALUES(1, 3, 2) } set authargs } {SQLITE_INSERT short {} main {} SQLITE_READ long b main {}} - + # As must an insert on the child table of a deferred constraint. set authargs {} do_test without_rowid3-18.4 { @@ -1820,9 +1820,9 @@ foreach {tn update} { #------------------------------------------------------------------------- # The following block of tests, those prefixed with "without_rowid3-genfkey.", -# are the same tests that were used to test the ".genfkey" command provided -# by the shell tool. So these tests show that the built-in foreign key -# implementation is more or less compatible with the triggers generated +# are the same tests that were used to test the ".genfkey" command provided +# by the shell tool. So these tests show that the built-in foreign key +# implementation is more or less compatible with the triggers generated # by genfkey. # drop_all_tables @@ -1867,7 +1867,7 @@ do_test without_rowid3-genfkey.1.11 { execsql { UPDATE t2 SET e = NULL } } {} do_test without_rowid3-genfkey.1.12 { - execsql { + execsql { UPDATE t1 SET a = 10; DELETE FROM t1; DELETE FROM t2; @@ -1884,7 +1884,7 @@ do_test without_rowid3-genfkey.1.14 { catchsql { INSERT INTO t3 VALUES(3, 1, 4) } } {1 {FOREIGN KEY constraint failed}} do_test without_rowid3-genfkey.1.15 { - execsql { + execsql { INSERT INTO t1 VALUES(1, 1, 4); INSERT INTO t3 VALUES(3, 1, 4); } @@ -1907,8 +1907,8 @@ do_test without_rowid3-genfkey.2.1 { execsql { CREATE TABLE t1(a INT PRIMARY KEY, b, c, UNIQUE(b, c)) WITHOUT rowid; CREATE TABLE t2(e REFERENCES t1 ON UPDATE CASCADE ON DELETE CASCADE, f); - CREATE TABLE t3(g, h, i, - FOREIGN KEY (h, i) + CREATE TABLE t3(g, h, i, + FOREIGN KEY (h, i) REFERENCES t1(b, c) ON UPDATE CASCADE ON DELETE CASCADE ); } @@ -1953,8 +1953,8 @@ do_test without_rowid3-genfkey.3.1 { execsql { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c, UNIQUE(c, b)) WITHOUT rowid; CREATE TABLE t2(e REFERENCES t1 ON UPDATE SET NULL ON DELETE SET NULL, f); - CREATE TABLE t3(g, h, i, - FOREIGN KEY (h, i) + CREATE TABLE t3(g, h, i, + FOREIGN KEY (h, i) REFERENCES t1(b, c) ON UPDATE SET NULL ON DELETE SET NULL ); } diff --git a/third_party/sqlite/src/test/without_rowid4.test b/third_party/sqlite/src/test/without_rowid4.test index d8c2d69fe9b4e..baeab018c78b8 100644 --- a/third_party/sqlite/src/test/without_rowid4.test +++ b/third_party/sqlite/src/test/without_rowid4.test @@ -12,9 +12,9 @@ # Regression testing of FOR EACH ROW table triggers on WITHOUT ROWID # tables. # -# 1. Trigger execution order tests. +# 1. Trigger execution order tests. # These tests ensure that BEFORE and AFTER triggers are fired at the correct -# times relative to each other and the triggering statement. +# times relative to each other and the triggering statement. # # without_rowid4-1.1.*: ON UPDATE trigger execution model. # without_rowid4-1.2.*: DELETE trigger execution model. @@ -25,19 +25,19 @@ # trigger program can correctly execute INSERT, UPDATE, DELETE * SELECT # statements, and combinations thereof). # -# 3. Selective trigger execution +# 3. Selective trigger execution # This tests that conditional triggers (ie. UPDATE OF triggers and triggers # with WHEN clauses) are fired only fired when they are supposed to be. # # without_rowid4-3.1: UPDATE OF triggers # without_rowid4-3.2: WHEN clause # -# 4. Cascaded trigger execution -# Tests that trigger-programs may cause other triggers to fire. Also that a +# 4. Cascaded trigger execution +# Tests that trigger-programs may cause other triggers to fire. Also that a # trigger-program is never executed recursively. -# +# # without_rowid4-4.1: Trivial cascading trigger -# without_rowid4-4.2: Trivial recursive trigger handling +# without_rowid4-4.2: Trivial recursive trigger handling # # 5. Count changes behaviour. # Verify that rows altered by triggers are not included in the return value @@ -60,7 +60,7 @@ ifcapable {!trigger} { # The tests in this file were written before SQLite supported recursive # trigger invocation, and some tests depend on that to pass. So disable # recursive triggers for this file. -catchsql { pragma recursive_triggers = off } +catchsql { pragma recursive_triggers = off } # 1. ifcapable subquery { @@ -74,7 +74,7 @@ ifcapable subquery { ifcapable tempdb { lappend tbl_definitions \ {CREATE TEMP TABLE tbl (a PRIMARY KEY, b) WITHOUT rowid; - CREATE INDEX tbl_idx ON tbl(b);} + CREATE INDEX tbl_idx ON tbl(b);} lappend tbl_definitions \ {CREATE TEMP TABLE tbl (a PRIMARY KEY, b) WITHOUT rowid} lappend tbl_definitions \ @@ -89,48 +89,48 @@ ifcapable subquery { DROP TABLE tbl; DROP TABLE other_tbl; } - + execsql $tbl_defn - + execsql { INSERT INTO tbl VALUES(1, 2); INSERT INTO tbl VALUES(3, 4); - + CREATE TABLE rlog (idx, old_a, old_b, db_sum_a, db_sum_b, new_a, new_b); CREATE TABLE clog (idx, old_a, old_b, db_sum_a, db_sum_b, new_a, new_b); - - CREATE TRIGGER before_update_row BEFORE UPDATE ON tbl FOR EACH ROW + + CREATE TRIGGER before_update_row BEFORE UPDATE ON tbl FOR EACH ROW BEGIN - INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), - old.a, old.b, + INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), + old.a, old.b, (SELECT coalesce(sum(a),0) FROM tbl), - (SELECT coalesce(sum(b),0) FROM tbl), + (SELECT coalesce(sum(b),0) FROM tbl), new.a, new.b); END; - - CREATE TRIGGER after_update_row AFTER UPDATE ON tbl FOR EACH ROW + + CREATE TRIGGER after_update_row AFTER UPDATE ON tbl FOR EACH ROW BEGIN - INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), - old.a, old.b, + INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), + old.a, old.b, (SELECT coalesce(sum(a),0) FROM tbl), - (SELECT coalesce(sum(b),0) FROM tbl), + (SELECT coalesce(sum(b),0) FROM tbl), new.a, new.b); END; - + CREATE TRIGGER conditional_update_row AFTER UPDATE ON tbl FOR EACH ROW WHEN old.a = 1 BEGIN - INSERT INTO clog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM clog), - old.a, old.b, + INSERT INTO clog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM clog), + old.a, old.b, (SELECT coalesce(sum(a),0) FROM tbl), - (SELECT coalesce(sum(b),0) FROM tbl), + (SELECT coalesce(sum(b),0) FROM tbl), new.a, new.b); END; } - + do_test without_rowid4-1.$ii.1 { set r {} - foreach v [execsql { + foreach v [execsql { UPDATE tbl SET a = a * 10, b = b * 10; SELECT * FROM rlog ORDER BY idx; SELECT * FROM clog ORDER BY idx; @@ -143,7 +143,7 @@ ifcapable subquery { 3 3 4 13 24 30 40 \ 4 3 4 40 60 30 40 \ 1 1 2 13 24 10 20 ] - + execsql { DELETE FROM rlog; DELETE FROM tbl; @@ -151,19 +151,19 @@ ifcapable subquery { INSERT INTO tbl VALUES (300, 200); CREATE TRIGGER delete_before_row BEFORE DELETE ON tbl FOR EACH ROW BEGIN - INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), - old.a, old.b, + INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), + old.a, old.b, (SELECT coalesce(sum(a),0) FROM tbl), - (SELECT coalesce(sum(b),0) FROM tbl), + (SELECT coalesce(sum(b),0) FROM tbl), 0, 0); END; - + CREATE TRIGGER delete_after_row AFTER DELETE ON tbl FOR EACH ROW BEGIN - INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), - old.a, old.b, + INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), + old.a, old.b, (SELECT coalesce(sum(a),0) FROM tbl), - (SELECT coalesce(sum(b),0) FROM tbl), + (SELECT coalesce(sum(b),0) FROM tbl), 0, 0); END; } @@ -180,42 +180,42 @@ ifcapable subquery { 2 100 100 300 200 0 0 \ 3 300 200 300 200 0 0 \ 4 300 200 0 0 0 0 ] - + execsql { DELETE FROM rlog; CREATE TRIGGER insert_before_row BEFORE INSERT ON tbl FOR EACH ROW BEGIN - INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), + INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), 0, 0, (SELECT coalesce(sum(a),0) FROM tbl), - (SELECT coalesce(sum(b),0) FROM tbl), + (SELECT coalesce(sum(b),0) FROM tbl), new.a, new.b); END; - + CREATE TRIGGER insert_after_row AFTER INSERT ON tbl FOR EACH ROW BEGIN - INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), + INSERT INTO rlog VALUES ( (SELECT coalesce(max(idx),0) + 1 FROM rlog), 0, 0, (SELECT coalesce(sum(a),0) FROM tbl), - (SELECT coalesce(sum(b),0) FROM tbl), + (SELECT coalesce(sum(b),0) FROM tbl), new.a, new.b); END; } do_test without_rowid4-1.$ii.3 { execsql { - + CREATE TABLE other_tbl(a, b); INSERT INTO other_tbl VALUES(1, 2); INSERT INTO other_tbl VALUES(3, 4); -- INSERT INTO tbl SELECT * FROM other_tbl; INSERT INTO tbl VALUES(5, 6); DROP TABLE other_tbl; - + SELECT * FROM rlog; } } [list 1 0 0 0 0 5 6 \ 2 0 0 5 6 5 6 ] - + integrity_check without_rowid4-1.$ii.4 } catchsql { @@ -232,14 +232,14 @@ foreach tr_program { {UPDATE tbl SET b = old.b;} {INSERT INTO log VALUES(new.c, 2, 3);} {DELETE FROM log WHERE a = 1;} - {INSERT INTO tbl VALUES(500, new.b * 10, 700); - UPDATE tbl SET c = old.c; + {INSERT INTO tbl VALUES(500, new.b * 10, 700); + UPDATE tbl SET c = old.c; DELETE FROM log;} - {INSERT INTO log select * from tbl;} + {INSERT INTO log select * from tbl;} } { foreach test_varset [ list \ { - set statement {UPDATE tbl SET c = 10 WHERE a = 1;} + set statement {UPDATE tbl SET c = 10 WHERE a = 1;} set prep {INSERT INTO tbl VALUES(1, 2, 3);} set newC 10 set newB 2 @@ -279,24 +279,24 @@ foreach tr_program { set statement_type [string range $statement 0 5] set tr_program_fixed $tr_program if {$statement_type == "DELETE"} { - regsub -all new\.a $tr_program_fixed {''} tr_program_fixed - regsub -all new\.b $tr_program_fixed {''} tr_program_fixed - regsub -all new\.c $tr_program_fixed {''} tr_program_fixed + regsub -all new\.a $tr_program_fixed {''} tr_program_fixed + regsub -all new\.b $tr_program_fixed {''} tr_program_fixed + regsub -all new\.c $tr_program_fixed {''} tr_program_fixed } if {$statement_type == "INSERT"} { - regsub -all old\.a $tr_program_fixed {''} tr_program_fixed - regsub -all old\.b $tr_program_fixed {''} tr_program_fixed - regsub -all old\.c $tr_program_fixed {''} tr_program_fixed + regsub -all old\.a $tr_program_fixed {''} tr_program_fixed + regsub -all old\.b $tr_program_fixed {''} tr_program_fixed + regsub -all old\.c $tr_program_fixed {''} tr_program_fixed } set tr_program_cooked $tr_program - regsub -all new\.a $tr_program_cooked $newA tr_program_cooked - regsub -all new\.b $tr_program_cooked $newB tr_program_cooked - regsub -all new\.c $tr_program_cooked $newC tr_program_cooked - regsub -all old\.a $tr_program_cooked $oldA tr_program_cooked - regsub -all old\.b $tr_program_cooked $oldB tr_program_cooked - regsub -all old\.c $tr_program_cooked $oldC tr_program_cooked + regsub -all new\.a $tr_program_cooked $newA tr_program_cooked + regsub -all new\.b $tr_program_cooked $newB tr_program_cooked + regsub -all new\.c $tr_program_cooked $newC tr_program_cooked + regsub -all old\.a $tr_program_cooked $oldA tr_program_cooked + regsub -all old\.b $tr_program_cooked $oldB tr_program_cooked + regsub -all old\.c $tr_program_cooked $oldC tr_program_cooked catchsql { DROP TABLE tbl; @@ -394,7 +394,7 @@ ifcapable subquery { set t232 {0 0 1} } do_test without_rowid4-3.2 { - execsql { + execsql { INSERT INTO tbl VALUES(0, 0, 0, 0); -- 1 (ifcapable subquery) SELECT * FROM log; @@ -446,7 +446,7 @@ execsql { # Simple recursive trigger execsql { CREATE TABLE tbl(a, b, c, PRIMARY KEY(c,a,b)) WITHOUT rowid; - CREATE TRIGGER tbl_trig BEFORE INSERT ON tbl + CREATE TRIGGER tbl_trig BEFORE INSERT ON tbl BEGIN INSERT INTO tbl VALUES (new.a, new.b, new.c+1); END; @@ -464,7 +464,7 @@ execsql { # 5. execsql { CREATE TABLE tbl(a, b, c, PRIMARY KEY(c,a,b)) WITHOUT rowid; - CREATE TRIGGER tbl_trig BEFORE INSERT ON tbl + CREATE TRIGGER tbl_trig BEFORE INSERT ON tbl BEGIN INSERT INTO tbl VALUES (1, 2, 3); INSERT INTO tbl VALUES (2, 2, 3); @@ -535,8 +535,8 @@ ifcapable conflict { } } {} execsql {DELETE FROM tbl} - - + + # Handling of ON CONFLICT by UPDATE statements inside triggers execsql { INSERT INTO tbl values (4, 2, 3); @@ -610,35 +610,35 @@ do_test without_rowid4-7.1 { INSERT INTO ab VALUES (0, 0); INSERT INTO cd VALUES (3, 4); - CREATE TABLE tlog(ii INTEGER PRIMARY KEY, + CREATE TABLE tlog(ii INTEGER PRIMARY KEY, olda, oldb, oldc, oldd, newa, newb, newc, newd); CREATE VIEW abcd AS SELECT a, b, c, d FROM ab, cd; CREATE TRIGGER before_update INSTEAD OF UPDATE ON abcd BEGIN - INSERT INTO tlog VALUES(NULL, + INSERT INTO tlog VALUES(NULL, old.a, old.b, old.c, old.d, new.a, new.b, new.c, new.d); END; CREATE TRIGGER after_update INSTEAD OF UPDATE ON abcd BEGIN - INSERT INTO tlog VALUES(NULL, + INSERT INTO tlog VALUES(NULL, old.a, old.b, old.c, old.d, new.a, new.b, new.c, new.d); END; CREATE TRIGGER before_delete INSTEAD OF DELETE ON abcd BEGIN - INSERT INTO tlog VALUES(NULL, + INSERT INTO tlog VALUES(NULL, old.a, old.b, old.c, old.d, 0, 0, 0, 0); END; CREATE TRIGGER after_delete INSTEAD OF DELETE ON abcd BEGIN - INSERT INTO tlog VALUES(NULL, + INSERT INTO tlog VALUES(NULL, old.a, old.b, old.c, old.d, 0, 0, 0, 0); END; CREATE TRIGGER before_insert INSTEAD OF INSERT ON abcd BEGIN - INSERT INTO tlog VALUES(NULL, + INSERT INTO tlog VALUES(NULL, 0, 0, 0, 0, new.a, new.b, new.c, new.d); END; CREATE TRIGGER after_insert INSTEAD OF INSERT ON abcd BEGIN - INSERT INTO tlog VALUES(NULL, + INSERT INTO tlog VALUES(NULL, 0, 0, 0, 0, new.a, new.b, new.c, new.d); END; } diff --git a/third_party/sqlite/src/test/without_rowid5.test b/third_party/sqlite/src/test/without_rowid5.test index 31a440ad87a0e..02927814c2d94 100644 --- a/third_party/sqlite/src/test/without_rowid5.test +++ b/third_party/sqlite/src/test/without_rowid5.test @@ -100,13 +100,13 @@ do_catchsql_test without_rowid5-3.1 { word TEXT PRIMARY KEY, cnt INTEGER ) WITHOUT _rowid_; -} {1 {unknown table option: _rowid_}} +} {1 {unknown table option: _rowid_}} do_catchsql_test without_rowid5-3.2 { CREATE TABLE IF NOT EXISTS error2( word TEXT PRIMARY KEY, cnt INTEGER ) WITHOUT oid; -} {1 {unknown table option: oid}} +} {1 {unknown table option: oid}} # EVIDENCE-OF: R-58033-17334 An error is raised if a CREATE TABLE # statement with the WITHOUT ROWID clause lacks a PRIMARY KEY. diff --git a/third_party/sqlite/src/test/wordcount.c b/third_party/sqlite/src/test/wordcount.c index bc1d499f15861..facfb578c2eb4 100644 --- a/third_party/sqlite/src/test/wordcount.c +++ b/third_party/sqlite/src/test/wordcount.c @@ -1,7 +1,7 @@ /* ** This C program extracts all "words" from an input document and adds them ** to an SQLite database. A "word" is any contiguous sequence of alphabetic -** characters. All digits, punctuation, and whitespace characters are +** characters. All digits, punctuation, and whitespace characters are ** word separators. The database stores a single entry for each distinct ** word together with a count of the number of occurrences of that word. ** A fresh database is created automatically on each run. @@ -70,7 +70,7 @@ #endif #define ISALPHA(X) isalpha((unsigned char)(X)) -const char zHelp[] = +const char zHelp[] = "Usage: wordcount [OPTIONS] DATABASE [INPUT]\n" " --all Repeat the test for all test modes\n" " --cachesize NNN Use a cache size of NNN\n" @@ -159,7 +159,7 @@ static void addCharToHash(unsigned int *a, unsigned char x){ a[4] += a[2] + a[3]; a[0] = a[1] = a[2] = 0; } - } + } } /* @@ -399,7 +399,7 @@ int main(int argc, char **argv){ startTime = realTime(); rewind(in); } - + /* Construct the "wordcount" table into which to put the words */ if( sqlite3_exec(db, "BEGIN IMMEDIATE", 0, 0, 0) ){ fatal_error("Could not start a transaction\n"); @@ -417,7 +417,7 @@ int main(int argc, char **argv){ if( rc ) fatal_error("Could not create the wordcount table: %s.\n", sqlite3_errmsg(db)); sqlite3_free(zSql); - + /* Prepare SQL statements that will be needed */ if( iMode2==MODE_QUERY ){ rc = sqlite3_prepare_v2(db, @@ -474,14 +474,14 @@ int main(int argc, char **argv){ if( rc ) fatal_error("Could not prepare the DELETE statement: %s\n", sqlite3_errmsg(db)); } - + /* Process the input file */ while( fgets(zInput, sizeof(zInput), in) ){ for(i=0; zInput[i]; i++){ if( !ISALPHA(zInput[i]) ) continue; for(j=i+1; ISALPHA(zInput[j]); j++){} - - /* Found a new word at zInput[i] that is j-i bytes long. + + /* Found a new word at zInput[i] that is j-i bytes long. ** Process it into the wordcount table. */ if( iMode2==MODE_DELETE ){ sqlite3_bind_text(pDelete, 1, zInput+i, j-i, SQLITE_STATIC); @@ -531,7 +531,7 @@ int main(int argc, char **argv){ } } i = j-1; - + /* Increment the operation counter. Do a COMMIT if it is time. */ nOp++; if( commitInterval>0 && (nOp%commitInterval)==0 ){ @@ -544,7 +544,7 @@ int main(int argc, char **argv){ sqlite3_finalize(pUpdate); pUpdate = 0; sqlite3_finalize(pSelect); pSelect = 0; sqlite3_finalize(pDelete); pDelete = 0; - + if( iMode2==MODE_QUERY && iMode!=MODE_ALL ){ printf("%s sum of cnt: %lld\n", zTag, sumCnt); rc = sqlite3_prepare_v2(db,"SELECT sum(cnt*cnt) FROM wordcount", -1, @@ -554,8 +554,8 @@ int main(int argc, char **argv){ } sqlite3_finalize(pSelect); } - - + + if( showTimer ){ sqlite3_int64 elapseTime = realTime() - startTime; totalTime += elapseTime; @@ -569,11 +569,11 @@ int main(int argc, char **argv){ fprintf(pTimer, "\n"); } } - + if( showSummary ){ sqlite3_create_function(db, "checksum", -1, SQLITE_UTF8, 0, 0, checksumStep, checksumFinalize); - sqlite3_exec(db, + sqlite3_exec(db, "SELECT 'count(*): ', count(*) FROM wordcount;\n" "SELECT 'sum(cnt): ', sum(cnt) FROM wordcount;\n" "SELECT 'max(cnt): ', max(cnt) FROM wordcount;\n" @@ -596,7 +596,7 @@ int main(int argc, char **argv){ fprintf(pTimer, "%3d.%03d wordcount --all\n", (int)(totalTime/1000), (int)(totalTime%1000)); } - + /* Database connection statistics printed after both prepared statements ** have been finalized */ if( showStats ){ @@ -613,13 +613,13 @@ int main(int argc, char **argv){ sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_HIT, &iCur, &iHiwtr, 1); printf("%s Page cache hits: %d\n", zTag, iCur); sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_MISS, &iCur, &iHiwtr, 1); - printf("%s Page cache misses: %d\n", zTag, iCur); + printf("%s Page cache misses: %d\n", zTag, iCur); sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_WRITE, &iCur, &iHiwtr, 1); - printf("%s Page cache writes: %d\n", zTag, iCur); + printf("%s Page cache writes: %d\n", zTag, iCur); sqlite3_db_status(db, SQLITE_DBSTATUS_SCHEMA_USED, &iCur, &iHiwtr, 0); - printf("%s Schema Heap Usage: %d bytes\n", zTag, iCur); + printf("%s Schema Heap Usage: %d bytes\n", zTag, iCur); sqlite3_db_status(db, SQLITE_DBSTATUS_STMT_USED, &iCur, &iHiwtr, 0); - printf("%s Statement Heap Usage: %d bytes\n", zTag, iCur); + printf("%s Statement Heap Usage: %d bytes\n", zTag, iCur); } sqlite3_close(db); diff --git a/third_party/sqlite/src/test/zeroblob.test b/third_party/sqlite/src/test/zeroblob.test index 0514644a28a85..9610db66fcee8 100644 --- a/third_party/sqlite/src/test/zeroblob.test +++ b/third_party/sqlite/src/test/zeroblob.test @@ -165,30 +165,30 @@ do_test zeroblob-5.4 { SELECT CAST(zeroblob(100) AS BLOB); } } [execsql {SELECT zeroblob(100)}] - + # Check for malicious use of zeroblob. Make sure nothing crashes. # -do_test zeroblob-6.1.1 { - execsql {select zeroblob(-1)} -} {{}} -do_test zeroblob-6.1.2 { - execsql {select zeroblob(-10)} -} {{}} -do_test zeroblob-6.1.3 { - execsql {select zeroblob(-100)} -} {{}} -do_test zeroblob-6.2 { - execsql {select length(zeroblob(-1))} -} {0} -do_test zeroblob-6.3 { - execsql {select zeroblob(-1)|1} -} {1} -do_test zeroblob-6.4 { - catchsql {select length(zeroblob(2147483648))} -} {1 {string or blob too big}} -do_test zeroblob-6.5 { - catchsql {select zeroblob(2147483648)} +do_test zeroblob-6.1.1 { + execsql {select zeroblob(-1)} +} {{}} +do_test zeroblob-6.1.2 { + execsql {select zeroblob(-10)} +} {{}} +do_test zeroblob-6.1.3 { + execsql {select zeroblob(-100)} +} {{}} +do_test zeroblob-6.2 { + execsql {select length(zeroblob(-1))} +} {0} +do_test zeroblob-6.3 { + execsql {select zeroblob(-1)|1} +} {1} +do_test zeroblob-6.4 { + catchsql {select length(zeroblob(2147483648))} +} {1 {string or blob too big}} +do_test zeroblob-6.5 { + catchsql {select zeroblob(2147483648)} } {1 {string or blob too big}} do_test zeroblob-6.6 { execsql {select hex(zeroblob(-1))} @@ -269,19 +269,19 @@ do_test zeroblob-10.1 { } {1 {string or blob too big}} #------------------------------------------------------------------------- -# Test the zeroblob() function on its own with negative or oversized +# Test the zeroblob() function on its own with negative or oversized # arguments. # -do_execsql_test 11.0 { +do_execsql_test 11.0 { SELECT length(zeroblob(-1444444444444444)); } {0} -do_catchsql_test 11.1 { +do_catchsql_test 11.1 { SELECT zeroblob(5000 * 1024 * 1024); } {1 {string or blob too big}} -do_catchsql_test 11.2 { +do_catchsql_test 11.2 { SELECT quote(zeroblob(5000 * 1024 * 1024)); } {1 {string or blob too big}} -do_catchsql_test 11.3 { +do_catchsql_test 11.3 { SELECT quote(zeroblob(-1444444444444444)); } {0 X''} do_catchsql_test 11.4 { @@ -304,8 +304,8 @@ do_test 12.1 { bind_and_run $stmt 40 } 40 do_test 12.2 { bind_and_run $stmt 0 } 0 do_test 12.3 { bind_and_run $stmt 1000 } 1000 -do_test 12.4 { - list [catch { bind_and_run $stmt [expr 5000 * 1024 * 1024] } msg] $msg +do_test 12.4 { + list [catch { bind_and_run $stmt [expr 5000 * 1024 * 1024] } msg] $msg } {1 SQLITE_TOOBIG} do_test 12.5 { sqlite3_step $stmt diff --git a/third_party/sqlite/src/test/zerodamage.test b/third_party/sqlite/src/test/zerodamage.test index a87e50b7b5e82..e80a85e7e3bd7 100644 --- a/third_party/sqlite/src/test/zerodamage.test +++ b/third_party/sqlite/src/test/zerodamage.test @@ -8,7 +8,7 @@ # May you share freely, never taking more than you give. # #*********************************************************************** -# +# # This file implements tests of the SQLITE_IOCAP_POWERSAFE_OVERWRITE property # and the SQLITE_FCNTL_POWERSAFE_OVERWRITE file-control for manipulating it. # diff --git a/third_party/sqlite/src/tool/addopcodes.tcl b/third_party/sqlite/src/tool/addopcodes.tcl index a6c58f1a251c8..7af576af29699 100644 --- a/third_party/sqlite/src/tool/addopcodes.tcl +++ b/third_party/sqlite/src/tool/addopcodes.tcl @@ -18,7 +18,7 @@ while {![eof $in]} { } close $in -# The following are the extra token codes to be added. SPACE and +# The following are the extra token codes to be added. SPACE and # ILLEGAL *must* be the last two token codes and they must be in that order. # set extras { diff --git a/third_party/sqlite/src/tool/dbhash.c b/third_party/sqlite/src/tool/dbhash.c index b1c72b3e36f22..0b073f40f8c05 100644 --- a/third_party/sqlite/src/tool/dbhash.c +++ b/third_party/sqlite/src/tool/dbhash.c @@ -232,7 +232,7 @@ static void hash_finish(const char *zName){ } /* End of the hashing logic *******************************************************************************/ - + /* ** Print an error resulting from faulting command-line arguments and ** abort the program. @@ -445,7 +445,7 @@ int main(int argc, char **argv){ if( zLike==0 ) zLike = "%"; for(i=1; i<=nFile; i++){ - static const int openFlags = + static const int openFlags = SQLITE_OPEN_READWRITE | /* Read/write so hot journals can recover */ SQLITE_OPEN_URI ; @@ -465,7 +465,7 @@ int main(int argc, char **argv){ /* Start the hash */ hash_init(); - + /* Hash table content */ if( !omitContent ){ pStmt = db_prepare( @@ -487,7 +487,7 @@ int main(int argc, char **argv){ } sqlite3_finalize(pStmt); } - + /* Hash the database schema */ if( !omitSchema ){ hash_one_query( @@ -497,7 +497,7 @@ int main(int argc, char **argv){ zLike ); } - + /* Finish and output the hash and close the database connection. */ hash_finish(zDb); sqlite3_close(g.db); diff --git a/third_party/sqlite/src/tool/fast_vacuum.c b/third_party/sqlite/src/tool/fast_vacuum.c index 6a50dcc680536..d692d9389306d 100644 --- a/third_party/sqlite/src/tool/fast_vacuum.c +++ b/third_party/sqlite/src/tool/fast_vacuum.c @@ -160,7 +160,7 @@ int main(int argc, char **argv){ /* Query the schema of the main database. Create a mirror schema ** in the temporary database. */ - execExecSql(db, + execExecSql(db, "SELECT 'CREATE TABLE vacuum_db.' || substr(sql,14) " " FROM sqlite_master WHERE type='table' AND name!='sqlite_sequence'" " AND rootpage>0" diff --git a/third_party/sqlite/src/tool/fragck.tcl b/third_party/sqlite/src/tool/fragck.tcl index 35e76f482b674..d8438ddebe451 100644 --- a/third_party/sqlite/src/tool/fragck.tcl +++ b/third_party/sqlite/src/tool/fragck.tcl @@ -35,7 +35,7 @@ set DB [btree_open [lindex $argv 0] 1000 0] # The first argument is the name of an array variable that exists in # the scope of the caller. If the third argument is non-zero, then # info is returned for the page that lies $up entries upwards in the -# tree-structure. (i.e. $up==1 returns the parent page, $up==2 the +# tree-structure. (i.e. $up==1 returns the parent page, $up==2 the # grandparent etc.) # # The following entries in that array are filled in with information retrieved @@ -51,7 +51,7 @@ set DB [btree_open [lindex $argv 0] 1000 0] # $arrayvar(header_bytes) = Header size in bytes # $arrayvar(local_payload_bytes) = Local payload size # $arrayvar(parent) = Parent page number -# +# proc cursor_info {arrayvar csr {up 0}} { upvar $arrayvar a foreach [list a(page_no) \ @@ -94,16 +94,16 @@ if {$objname=="sqlite_master"} { if {![string is integer -strict $rootpage]} { puts stderr "invalid root page for $objname: $rootpage" exit 1 - } + } } # The cursor $csr is pointing to an entry. Print out information # about the page that $up levels above that page that contains # the entry. If $up==0 use the page that contains the entry. -# +# # If information about the page has been printed already, then # this is a no-op. -# +# proc page_info {csr up} { global seen cursor_info ci $csr $up @@ -130,10 +130,10 @@ proc page_info {csr up} { # print the results # puts [format {LEVEL %d: %6d} $depth $pg] -} +} + + - - # Loop through the object and print out page numbers # diff --git a/third_party/sqlite/src/tool/fuzzershell.c b/third_party/sqlite/src/tool/fuzzershell.c index c75beb4d88ea6..5225877c03f2e 100644 --- a/third_party/sqlite/src/tool/fuzzershell.c +++ b/third_party/sqlite/src/tool/fuzzershell.c @@ -29,7 +29,7 @@ ** disk database so that the fuzzer starts with a database containing ** content. ** -** (4) The eval() SQL function is added, allowing the fuzzer to do +** (4) The eval() SQL function is added, allowing the fuzzer to do ** interesting recursive operations. ** ** (5) An error is raised if there is a memory leak. @@ -295,7 +295,7 @@ struct EvalResult { */ static int callback(void *pCtx, int argc, char **argv, char **colnames){ struct EvalResult *p = (struct EvalResult*)pCtx; - int i; + int i; for(i=0; iaConstraintUsage[stepIdx].omit = !SQLITE_SERIES_CONSTRAINT_VERIFY; } if( (idxNum & 3)==3 ){ - /* Both start= and stop= boundaries are available. This is the + /* Both start= and stop= boundaries are available. This is the ** the preferred case */ pIdxInfo->estimatedCost = (double)(2 - ((idxNum&4)!=0)); pIdxInfo->estimatedRows = 1000; @@ -656,7 +656,7 @@ static int seriesBestIndex( } /* -** This following structure defines all the methods for the +** This following structure defines all the methods for the ** generate_series virtual table. */ static sqlite3_module seriesModule = { @@ -697,7 +697,7 @@ static void showHelp(void){ " --database FILE Use database FILE instead of an in-memory database\n" " --disable-lookaside Turn off lookaside memory\n" " --heap SZ MIN Memory allocator uses SZ bytes & min allocation MIN\n" -" --help Show this help text\n" +" --help Show this help text\n" " --lookaside N SZ Configure lookaside for N slots of SZ bytes each\n" " --oom Run each test multiple times in a simulated OOM loop\n" " --pagesize N Set the page size to N\n" @@ -999,7 +999,7 @@ int main(int argc, char **argv){ zPrompt = ""; } while( !feof(in) ){ - got = fread(zIn+nIn, 1, nAlloc-nIn-1, in); + got = fread(zIn+nIn, 1, nAlloc-nIn-1, in); nIn += (int)got; zIn[nIn] = 0; if( got==0 ) break; @@ -1027,7 +1027,7 @@ int main(int argc, char **argv){ char *z = strstr(&zIn[i], ">****/"); if( z ){ z += 6; - sqlite3_snprintf(sizeof(g.zTestName), g.zTestName, "%.*s", + sqlite3_snprintf(sizeof(g.zTestName), g.zTestName, "%.*s", (int)(z-&zIn[i]) - 12, &zIn[i+6]); if( verboseFlag ){ printf("%.*s\n", (int)(z-&zIn[i]), &zIn[i]); diff --git a/third_party/sqlite/src/tool/genfkey.README b/third_party/sqlite/src/tool/genfkey.README index 57cdff87f8b68..40262403a382e 100644 --- a/third_party/sqlite/src/tool/genfkey.README +++ b/third_party/sqlite/src/tool/genfkey.README @@ -1,8 +1,8 @@ OVERVIEW - The SQLite library is capable of parsing SQL foreign key constraints - supplied as part of CREATE TABLE statements, but it does not actually + The SQLite library is capable of parsing SQL foreign key constraints + supplied as part of CREATE TABLE statements, but it does not actually implement them. However, most of the features of foreign keys may be implemented using SQL triggers, which SQLite does support. This text file describes a feature of the SQLite shell tool (sqlite3) that @@ -20,28 +20,28 @@ CAPABILITIES CREATE TABLE child(d, e, f, FOREIGN KEY(d, e) REFERENCES parent(a, b)); implies that for each row in table "child", there must be a row in - "parent" for which the expression (child.d==parent.a AND child.e==parent.b) + "parent" for which the expression (child.d==parent.a AND child.e==parent.b) is true. The columns in the parent table are required to be either the primary key columns or subject to a UNIQUE constraint. There is no such requirement for the columns of the child table. - At this time, all foreign keys are implemented as if they were - "MATCH NONE", even if the declaration specified "MATCH PARTIAL" or + At this time, all foreign keys are implemented as if they were + "MATCH NONE", even if the declaration specified "MATCH PARTIAL" or "MATCH FULL". "MATCH NONE" means that if any of the key columns in the child table are NULL, then there is no requirement for a corresponding row in the parent table. So, taking this into account, the expression that must be true for every row of the child table in the above example is actually: - (child.d IS NULL) OR - (child.e IS NULL) OR + (child.d IS NULL) OR + (child.e IS NULL) OR (child.d==parent.a AND child.e==parent.b) - Attempting to insert or update a row in the child table so that the - affected row violates this constraint results in an exception being + Attempting to insert or update a row in the child table so that the + affected row violates this constraint results in an exception being thrown. - The effect of attempting to delete or update a row in the parent table + The effect of attempting to delete or update a row in the parent table so that the constraint becomes untrue for one or more rows in the child table depends on the "ON DELETE" or "ON UPDATE" actions specified as part of the foreign key definition, respectively. Three different actions @@ -55,7 +55,7 @@ CAPABILITIES CASCADE: Instead of throwing an exception, all corresponding child table rows are either deleted (if the parent row is being deleted) - or updated to match the new parent key values (if the parent + or updated to match the new parent key values (if the parent row is being updated). SET NULL: Instead of throwing an exception, the foreign key fields of @@ -82,7 +82,7 @@ LIMITATIONS error when the program is run (see below). * SQLite does not support recursive triggers, and therefore this program - does not support recursive CASCADE or SET NULL foreign key + does not support recursive CASCADE or SET NULL foreign key relationships. If the parent and the child tables of a CASCADE or SET NULL foreign key are the same table, the generated triggers will malfunction. This is also true if the recursive foreign key constraint @@ -119,7 +119,7 @@ USAGE triggers have already been installed (i.e. after new tables are created or existing tables dropped). - Finally, a series of SQL trigger definitions (CREATE TRIGGER statements) + Finally, a series of SQL trigger definitions (CREATE TRIGGER statements) that implement the foreign key constraints found in the database schema are generated. @@ -130,7 +130,7 @@ USAGE dot-commands (i.e. ".output"). The simplest way to activate the foriegn key definitions in a database - is simply to open it using the shell tool and enter the command + is simply to open it using the shell tool and enter the command ".genfkey --exec": sqlite> .genfkey --exec diff --git a/third_party/sqlite/src/tool/genfkey.test b/third_party/sqlite/src/tool/genfkey.test index 3c0073e953dc0..2c52acdef8b92 100644 --- a/third_party/sqlite/src/tool/genfkey.test +++ b/third_party/sqlite/src/tool/genfkey.test @@ -72,7 +72,7 @@ do_test genfkey-1.11 { execsql { UPDATE t2 SET e = NULL } } {} do_test genfkey-1.12 { - execsql { + execsql { UPDATE t1 SET a = 10 ; DELETE FROM t1; DELETE FROM t2; @@ -90,7 +90,7 @@ do_test genfkey-1.14 { catchsql { INSERT INTO t3 VALUES(3, 1, 4) } } {1 {constraint failed}} do_test genfkey-1.15 { - execsql { + execsql { INSERT INTO t1 VALUES(1, 1, 4); INSERT INTO t3 VALUES(3, 1, 4); } @@ -122,8 +122,8 @@ do_test genfkey-2.1 { execsql { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c, UNIQUE(b, c)); CREATE TABLE t2(e REFERENCES t1 ON UPDATE CASCADE ON DELETE CASCADE, f); - CREATE TABLE t3(g, h, i, - FOREIGN KEY (h, i) + CREATE TABLE t3(g, h, i, + FOREIGN KEY (h, i) REFERENCES t1(b, c) ON UPDATE CASCADE ON DELETE CASCADE ); } @@ -179,8 +179,8 @@ do_test genfkey-3.1 { execsql { CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c, UNIQUE(c, b)); CREATE TABLE t2(e REFERENCES t1 ON UPDATE SET NULL ON DELETE SET NULL, f); - CREATE TABLE t3(g, h, i, - FOREIGN KEY (h, i) + CREATE TABLE t3(g, h, i, + FOREIGN KEY (h, i) REFERENCES t1(b, c) ON UPDATE SET NULL ON DELETE SET NULL ); } @@ -286,7 +286,7 @@ do_test genfkey-5.5 { catchsql { INSERT INTO t13 VALUES(1) } } {1 {constraint failed}} do_test genfkey-5.5 { - catchsql { + catchsql { INSERT INTO "t.3" VALUES(1); INSERT INTO t13 VALUES(1); } @@ -298,12 +298,12 @@ do_test genfkey-6.1 { DROP TABLE "t.3"; DROP TABLE t13; CREATE TABLE p( - "a.1 first", "b.2 second", + "a.1 first", "b.2 second", UNIQUE("a.1 first", "b.2 second") ); CREATE TABLE c( - "c.1 I", "d.2 II", - FOREIGN KEY("c.1 I", "d.2 II") + "c.1 I", "d.2 II", + FOREIGN KEY("c.1 I", "d.2 II") REFERENCES p("a.1 first", "b.2 second") ON UPDATE CASCADE ON DELETE CASCADE ); diff --git a/third_party/sqlite/src/tool/lemon.c b/third_party/sqlite/src/tool/lemon.c index aa0f4e3e9ca39..f55d63b5fe6c2 100644 --- a/third_party/sqlite/src/tool/lemon.c +++ b/third_party/sqlite/src/tool/lemon.c @@ -561,8 +561,8 @@ void Action_add( ** default action for the state_number is returned. ** ** All actions associated with a single state_number are first entered -** into aLookahead[] using multiple calls to acttab_action(). Then the -** actions for that single state_number are placed into the aAction[] +** into aLookahead[] using multiple calls to acttab_action(). Then the +** actions for that single state_number are placed into the aAction[] ** array with a single call to acttab_insert(). The acttab_insert() call ** also resets the aLookahead[] array in preparation for the next ** state number. @@ -612,7 +612,7 @@ acttab *acttab_alloc(void){ return p; } -/* Add a new action to the current transaction set. +/* Add a new action to the current transaction set. ** ** This routine is called once for each lookahead for a particular ** state. @@ -674,7 +674,7 @@ int acttab_insert(acttab *p){ } } - /* Scan the existing action table looking for an offset that is a + /* Scan the existing action table looking for an offset that is a ** duplicate of the current transaction set. Fall out of the loop ** if and when the duplicate is found. ** @@ -752,7 +752,7 @@ int acttab_insert(acttab *p){ */ /* Find a precedence symbol of every rule in the grammar. -** +** ** Those rules which have a precedence symbol coded in the input ** grammar using the "[symbol]" construct will already have the ** rp->precsym field filled. Other rules take as their precedence @@ -1072,7 +1072,7 @@ void FindFollowSets(struct lemon *lemp) cfp->status = INCOMPLETE; } } - + do{ progress = 0; for(i=0; instate; i++){ @@ -1103,7 +1103,7 @@ void FindActions(struct lemon *lemp) struct symbol *sp; struct rule *rp; - /* Add all of the reduce actions + /* Add all of the reduce actions ** A reduce action is added for each element of the followset of ** a configuration which has its dot at the extreme right. */ @@ -1220,7 +1220,7 @@ static int resolve_conflict( apx->type = RD_RESOLVED; } }else{ - assert( + assert( apx->type==SH_RESOLVED || apx->type==RD_RESOLVED || apx->type==SSCONFLICT || @@ -1606,7 +1606,7 @@ int main(int argc, char **argv) OptInit(argv,options,stderr); if( version ){ printf("Lemon version 1.0\n"); - exit(0); + exit(0); } if( OptNArgs()!=1 ){ fprintf(stderr,"Exactly one filename argument is required.\n"); @@ -2307,7 +2307,7 @@ to follow the previous rule."); case IN_RHS: if( x[0]=='.' ){ struct rule *rp; - rp = (struct rule *)calloc( sizeof(struct rule) + + rp = (struct rule *)calloc( sizeof(struct rule) + sizeof(struct symbol*)*psp->nrhs + sizeof(char*)*psp->nrhs, 1); if( rp==0 ){ ErrorMsg(psp->filename,psp->tokenlineno, @@ -2997,7 +2997,7 @@ PRIVATE FILE *file_open( return fp; } -/* Duplicate the input file without comments and without actions +/* Duplicate the input file without comments and without actions ** on rules */ void Reprint(struct lemon *lemp) { @@ -3148,7 +3148,7 @@ int PrintAction( indent,ap->sp->name,ap->x.rp->iRule); break; case SSCONFLICT: - fprintf(fp,"%*s shift %-7d ** Parsing conflict **", + fprintf(fp,"%*s shift %-7d ** Parsing conflict **", indent,ap->sp->name,ap->x.stp->statenum); break; case SH_RESOLVED: @@ -3421,7 +3421,7 @@ PRIVATE void tplt_print(FILE *out, struct lemon *lemp, char *str, int *lineno) (*lineno)++; } if (!lemp->nolinenosflag) { - (*lineno)++; tplt_linedir(out,*lineno,lemp->outname); + (*lineno)++; tplt_linedir(out,*lineno,lemp->outname); } return; } @@ -3466,8 +3466,8 @@ void emit_destructor_code( fputc(*cp,out); } fprintf(out,"\n"); (*lineno)++; - if (!lemp->nolinenosflag) { - (*lineno)++; tplt_linedir(out,*lineno,lemp->outname); + if (!lemp->nolinenosflag) { + (*lineno)++; tplt_linedir(out,*lineno,lemp->outname); } fprintf(out,"}\n"); (*lineno)++; return; @@ -3590,7 +3590,7 @@ PRIVATE int translate_code(struct lemon *lemp, struct rule *rp){ /* There is no LHS value symbol. */ lhsdirect = 1; }else if( strcmp(rp->lhsalias,rp->rhsalias[0])==0 ){ - /* The LHS symbol and the left-most RHS symbol are the same, so + /* The LHS symbol and the left-most RHS symbol are the same, so ** direct writing is allowed */ lhsdirect = 1; lhsused = 1; @@ -3601,7 +3601,7 @@ PRIVATE int translate_code(struct lemon *lemp, struct rule *rp){ "different datatypes.", rp->lhs->name, rp->lhsalias, rp->rhs[0]->name, rp->rhsalias[0]); lemp->errorcnt++; - } + } }else{ lemon_sprintf(zOvwrt, "/*%s-overwrites-%s*/", rp->lhsalias, rp->rhsalias[0]); @@ -3740,7 +3740,7 @@ PRIVATE int translate_code(struct lemon *lemp, struct rule *rp){ return rc; } -/* +/* ** Generate code which executes when the rule "rp" is reduced. Write ** the code to "out". Make sure lineno stays up-to-date. */ @@ -4237,7 +4237,7 @@ void ReportTable( fprintf(out, "#define YY_SHIFT_COUNT (%d)\n", n-1); lineno++; fprintf(out, "#define YY_SHIFT_MIN (%d)\n", mnTknOfst); lineno++; fprintf(out, "#define YY_SHIFT_MAX (%d)\n", mxTknOfst); lineno++; - fprintf(out, "static const %s yy_shift_ofst[] = {\n", + fprintf(out, "static const %s yy_shift_ofst[] = {\n", minimum_size_type(mnTknOfst, lemp->nterminal+lemp->nactiontab, &sz)); lineno++; lemp->tablesize += n*sz; @@ -4264,7 +4264,7 @@ void ReportTable( fprintf(out, "#define YY_REDUCE_COUNT (%d)\n", n-1); lineno++; fprintf(out, "#define YY_REDUCE_MIN (%d)\n", mnNtOfst); lineno++; fprintf(out, "#define YY_REDUCE_MAX (%d)\n", mxNtOfst); lineno++; - fprintf(out, "static const %s yy_reduce_ofst[] = {\n", + fprintf(out, "static const %s yy_reduce_ofst[] = {\n", minimum_size_type(mnNtOfst-1, mxNtOfst, &sz)); lineno++; lemp->tablesize += n*sz; for(i=j=0; iname,in,out,&lineno); /* Generate code which executes every time a symbol is popped from - ** the stack while processing errors or while destroying the parser. + ** the stack while processing errors or while destroying the parser. ** (In other words, generate the %destructor actions) */ if( lemp->tokendest ){ @@ -4409,7 +4409,7 @@ void ReportTable( tplt_print(out,lemp,lemp->overflow,&lineno); tplt_xfer(lemp->name,in,out,&lineno); - /* Generate the table of rule information + /* Generate the table of rule information ** ** Note: This code depends on the fact that rules are number ** sequentually beginning with 0. @@ -4520,7 +4520,7 @@ void ReportHeader(struct lemon *lemp) for(i=1; interminal; i++){ fprintf(out,"#define %s%-30s %3d\n",prefix,lemp->symbols[i]->name,i); } - fclose(out); + fclose(out); } return; } @@ -4567,7 +4567,7 @@ void CompressTables(struct lemon *lemp) rbest = rp; } } - + /* Do not make a default if the number of rules to default ** is not at least 1 or if the wildcard token is a possible ** lookahead. diff --git a/third_party/sqlite/src/tool/lempar.c b/third_party/sqlite/src/tool/lempar.c index 21ed9d79abe3f..4e907caee0525 100644 --- a/third_party/sqlite/src/tool/lempar.c +++ b/third_party/sqlite/src/tool/lempar.c @@ -56,7 +56,7 @@ ** the minor type might be the name of the identifier. ** Each non-terminal can have a different minor type. ** Terminal symbols all have the same minor type, though. -** This macros defines the minor type for terminal +** This macros defines the minor type for terminal ** symbols. ** YYMINORTYPE is the data type used for all minor types. ** This is typically a union of many types, one of @@ -103,7 +103,7 @@ /* Next are the tables used to determine what action to take based on the ** current state and lookahead token. These tables are used to implement ** functions that take a state number and lookahead value and return an -** action integer. +** action integer. ** ** Suppose the action integer is N. Then the action is determined as ** follows @@ -159,9 +159,9 @@ %% /********** End of lemon-generated parsing tables *****************************/ -/* The next table maps tokens (terminal symbols) into fallback tokens. +/* The next table maps tokens (terminal symbols) into fallback tokens. ** If a construct like the following: -** +** ** %fallback ID X Y Z. ** ** appears in the grammar, then ID becomes a fallback token for X, Y, @@ -232,10 +232,10 @@ static char *yyTracePrompt = 0; #endif /* NDEBUG */ #ifndef NDEBUG -/* +/* ** Turn parser tracing on by giving a stream to which to write the trace ** and a prompt to preface each trace message. Tracing is turned off -** by making either argument NULL +** by making either argument NULL ** ** Inputs: **
          @@ -260,7 +260,7 @@ void ParseTrace(FILE *TraceFILE, char *zTracePrompt){ #ifndef NDEBUG /* For tracing shifts, the names of all terminals and nonterminals ** are required. The following table supplies these names */ -static const char *const yyTokenName[] = { +static const char *const yyTokenName[] = { %% }; #endif /* NDEBUG */ @@ -303,7 +303,7 @@ static int yyGrowStack(yyParser *p){ #endif p->yystksz = newSize; } - return pNew==0; + return pNew==0; } #endif @@ -341,7 +341,7 @@ void ParseInit(void *yypParser){ } #ifndef Parse_ENGINEALWAYSONSTACK -/* +/* ** This function allocates a new parser. ** The only argument is a pointer to a function which works like ** malloc. @@ -365,7 +365,7 @@ void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){ /* The following function deletes the "minor type" or semantic value ** associated with a symbol. The symbol can be either a terminal ** or nonterminal. "yymajor" is the symbol code, and "yypminor" is -** a pointer to the value to be deleted. The code used to do the +** a pointer to the value to be deleted. The code used to do the ** deletions is derived from the %destructor and/or %token_destructor ** directives of the input grammar. */ @@ -379,7 +379,7 @@ static void yy_destructor( /* Here is inserted the actions which take place when a ** terminal or non-terminal is destroyed. This can happen ** when the symbol is popped from the stack during a - ** reduce or during error processing or when a parser is + ** reduce or during error processing or when a parser is ** being destroyed before it is finished parsing. ** ** Note: during a reduce, the only symbols destroyed are those @@ -426,7 +426,7 @@ void ParseFinalize(void *p){ } #ifndef Parse_ENGINEALWAYSONSTACK -/* +/* ** Deallocate and destroy a parser. Destructors are called for ** all stack elements before shutting the parser down. ** @@ -466,7 +466,7 @@ static unsigned int yy_find_shift_action( ){ int i; int stateno = pParser->yytos->stateno; - + if( stateno>=YY_MIN_REDUCE ) return stateno; assert( stateno <= YY_SHIFT_COUNT ); do{ @@ -492,7 +492,7 @@ static unsigned int yy_find_shift_action( #ifdef YYWILDCARD { int j = i - iLookAhead + YYWILDCARD; - if( + if( #if YY_SHIFT_MIN+YYWILDCARD<0 j>=0 && #endif @@ -606,7 +606,7 @@ static void yy_shift( assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) ); } #endif -#if YYSTACKDEPTH>0 +#if YYSTACKDEPTH>0 if( yypParser->yytos>=&yypParser->yystack[YYSTACKDEPTH] ){ yypParser->yytos--; yyStackOverflow(yypParser); @@ -675,7 +675,7 @@ static void yy_reduce( assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack)); } #endif -#if YYSTACKDEPTH>0 +#if YYSTACKDEPTH>0 if( yypParser->yytos>=&yypParser->yystack[YYSTACKDEPTH-1] ){ yyStackOverflow(yypParser); return; @@ -859,7 +859,7 @@ void Parse( #ifdef YYERRORSYMBOL /* A syntax error has occurred. ** The response to an error depends upon whether or not the - ** grammar defines an error token "ERROR". + ** grammar defines an error token "ERROR". ** ** This is what we do if the grammar does define ERROR: ** @@ -922,7 +922,7 @@ void Parse( yy_syntax_error(yypParser,yymajor, yyminor); yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); yymajor = YYNOCODE; - + #else /* YYERRORSYMBOL is not defined */ /* This is what we do if the grammar does not define ERROR: ** diff --git a/third_party/sqlite/src/tool/loadfts.c b/third_party/sqlite/src/tool/loadfts.c index 0000797b887ae..9182e87c97b29 100644 --- a/third_party/sqlite/src/tool/loadfts.c +++ b/third_party/sqlite/src/tool/loadfts.c @@ -27,7 +27,7 @@ /* ** Implementation of the "readtext(X)" SQL function. The entire content ** of the file named X is read and returned as a TEXT value. It is assumed -** the file contains UTF-8 text. NULL is returned if the file does not +** the file contains UTF-8 text. NULL is returned if the file does not ** exist or is unreadable. */ static void readfileFunc( @@ -120,15 +120,15 @@ void visit_file(void *pCtx, const char *zPath){ rc = sqlite3_reset(p->pInsert); if( rc!=SQLITE_OK ){ sqlite_error_out("insert", p->db); - }else if( p->nRowPerTrans>0 - && (sqlite3_last_insert_rowid(p->db) % p->nRowPerTrans)==0 + }else if( p->nRowPerTrans>0 + && (sqlite3_last_insert_rowid(p->db) % p->nRowPerTrans)==0 ){ sqlite3_exec(p->db, "COMMIT ; BEGIN", 0, 0, 0); } } /* -** Recursively traverse directory zDir. For each file that is not a +** Recursively traverse directory zDir. For each file that is not a ** directory, invoke the supplied callback with its path. */ static void traverse( @@ -224,7 +224,7 @@ int main(int argc, char **argv){ memset(&sCtx, 0, sizeof(VisitContext)); sCtx.db = db; sCtx.nRowPerTrans = nRowPerTrans; - rc = sqlite3_prepare_v2(db, + rc = sqlite3_prepare_v2(db, "INSERT INTO fts VALUES(readtext(?))", -1, &sCtx.pInsert, 0 ); if( rc!=SQLITE_OK ) sqlite_error_out("sqlite3_prepare_v2(1)", db); diff --git a/third_party/sqlite/src/tool/logest.c b/third_party/sqlite/src/tool/logest.c index e936e02cbeefa..ff0172e1952a4 100644 --- a/third_party/sqlite/src/tool/logest.c +++ b/third_party/sqlite/src/tool/logest.c @@ -21,7 +21,7 @@ ** Examples: ** ** To convert 123 from LogEst to integer: -** +** ** ./LogEst ^123 ** ** To convert 123456 from integer to LogEst: diff --git a/third_party/sqlite/src/tool/max-limits.c b/third_party/sqlite/src/tool/max-limits.c index d019974426d06..21a91a7c3c862 100644 --- a/third_party/sqlite/src/tool/max-limits.c +++ b/third_party/sqlite/src/tool/max-limits.c @@ -37,5 +37,5 @@ int main(int argc, char **argv){ printf("%-35s %10d\n", aLimit[j].zName, maxLimit(db, aLimit[j].eCode)); } sqlite3_close(db); - } + } } diff --git a/third_party/sqlite/src/tool/mkautoconfamal.sh b/third_party/sqlite/src/tool/mkautoconfamal.sh index 4864ee85c3ff6..d7cea6840dc3a 100644 --- a/third_party/sqlite/src/tool/mkautoconfamal.sh +++ b/third_party/sqlite/src/tool/mkautoconfamal.sh @@ -13,7 +13,7 @@ # -# Bail out of the script if any command returns a non-zero exit +# Bail out of the script if any command returns a non-zero exit # status. Or if the script tries to use an unset variable. These # may fail for old /bin/sh interpreters. # @@ -31,7 +31,7 @@ DATETIME=`grep '^D' $TOP/manifest | sed -e 's/[^0-9]//g' -e 's/\(............\). # if test "$#" -ge 1 -a x$1 != x--snapshot then - # Set global variable $ARTIFACT to the "3xxyyzz" string incorporated + # Set global variable $ARTIFACT to the "3xxyyzz" string incorporated # into artifact filenames. And $VERSION2 to the "3.x.y[.z]" form. xx=`echo $VERSION|sed 's/3\.\([0-9]*\)\..*/\1/'` yy=`echo $VERSION|sed 's/3\.[^.]*\.\([0-9]*\).*/\1/'` @@ -67,14 +67,14 @@ autoreconf -i #automake --add-missing mkdir -p tea/generic -echo "#ifdef USE_SYSTEM_SQLITE" > tea/generic/tclsqlite3.c +echo "#ifdef USE_SYSTEM_SQLITE" > tea/generic/tclsqlite3.c echo "# include " >> tea/generic/tclsqlite3.c echo "#else" >> tea/generic/tclsqlite3.c echo "#include \"sqlite3.c\"" >> tea/generic/tclsqlite3.c echo "#endif" >> tea/generic/tclsqlite3.c cat $TOP/src/tclsqlite.c >> tea/generic/tclsqlite3.c -cat tea/configure.ac | +cat tea/configure.ac | sed "s/AC_INIT(\[sqlite\], .*)/AC_INIT([sqlite], [$VERSION])/" > tmp mv tmp tea/configure.ac diff --git a/third_party/sqlite/src/tool/mkkeywordhash.c b/third_party/sqlite/src/tool/mkkeywordhash.c index 7e5287ea5437e..54160d9d2dd56 100644 --- a/third_party/sqlite/src/tool/mkkeywordhash.c +++ b/third_party/sqlite/src/tool/mkkeywordhash.c @@ -11,7 +11,7 @@ /* ** A header comment placed at the beginning of generated code. */ -static const char zHdr[] = +static const char zHdr[] = "/***** This file contains automatically generated code ******\n" "**\n" "** The code in this file has been automatically generated by\n" @@ -517,7 +517,7 @@ int main(int argc, char **argv){ j = 0; } } - printf("%s };\n", j==0 ? "" : "\n"); + printf("%s };\n", j==0 ? "" : "\n"); printf(" static const unsigned char aNext[%d] = {\n", nKeyword); for(i=j=0; i 0} then { puts stdout $error @@ -108,7 +108,7 @@ proc fail { {error ""} {usage false} } { exit 1 } - + proc getEnvironmentVariable { name } { # # NOTE: Returns the value of the specified environment variable or an empty @@ -117,7 +117,7 @@ proc getEnvironmentVariable { name } { # return [expr {[info exists ::env($name)] ? $::env($name) : ""}] } - + proc getTemporaryPath {} { # # NOTE: Returns the normalized path to the first temporary directory found @@ -141,7 +141,7 @@ proc getTemporaryPath {} { return "" } - + proc appendArgs { args } { # # NOTE: Returns all passed arguments joined together as a single string with @@ -149,7 +149,7 @@ proc appendArgs { args } { # eval append result $args } - + proc readFile { fileName } { # # NOTE: Reads and returns the entire contents of the specified file, which @@ -161,7 +161,7 @@ proc readFile { fileName } { close $file_id return $result } - + proc writeFile { fileName data } { # # NOTE: Writes the entire contents of the specified file, which may contain @@ -173,7 +173,7 @@ proc writeFile { fileName data } { close $file_id return "" } - + # # TODO: Modify this procedure when a new version of Visual Studio is released. # @@ -196,7 +196,7 @@ proc getMinVsVersionXmlChunk { vsVersion } { } } } - + # # TODO: Modify this procedure when a new version of Visual Studio is released. # @@ -232,7 +232,7 @@ proc getMaxPlatformVersionXmlChunk { packageFlavor vsVersion } { } } } - + # # TODO: Modify this procedure when a new version of Visual Studio is released. # @@ -270,7 +270,7 @@ proc getExtraFileListXmlChunk { packageFlavor vsVersion } { } } } - + proc replaceFileNameTokens { fileName name buildName platformName } { # # NOTE: Returns the specified file name containing the platform name instead @@ -279,7 +279,7 @@ proc replaceFileNameTokens { fileName name buildName platformName } { return [string map [list $buildName $platformName \ $name] $fileName] } - + proc substFile { fileName } { # # NOTE: Performs all Tcl command, variable, and backslash substitutions in @@ -288,7 +288,7 @@ proc substFile { fileName } { # return [writeFile $fileName [uplevel 1 [list subst [readFile $fileName]]]] } - + # # NOTE: This is the entry point for this script. # diff --git a/third_party/sqlite/src/tool/offsets.c b/third_party/sqlite/src/tool/offsets.c index 8e098e71cb98b..dd62756de42b2 100644 --- a/third_party/sqlite/src/tool/offsets.c +++ b/third_party/sqlite/src/tool/offsets.c @@ -325,5 +325,5 @@ int main(int argc, char **argv){ fprintf(stderr, "%s\n", g.zErr); exit(1); } - return 0; + return 0; } diff --git a/third_party/sqlite/src/tool/omittest.tcl b/third_party/sqlite/src/tool/omittest.tcl index 5437f2eb01e5a..1c3a7f61e7fce 100644 --- a/third_party/sqlite/src/tool/omittest.tcl +++ b/third_party/sqlite/src/tool/omittest.tcl @@ -4,7 +4,7 @@ set rcsid {$Id: omittest.tcl,v 1.8 2008/10/13 15:35:09 drh Exp $} # Documentation for this script. This may be output to stderr # if the script is invoked incorrectly. set ::USAGE_MESSAGE { -This Tcl script is used to test the various compile time options +This Tcl script is used to test the various compile time options available for omitting code (the SQLITE_OMIT_xxx options). It should be invoked as follows: @@ -76,7 +76,7 @@ proc run_quick_test {dir omit_symbol_list} { set fd [open $dir/makefile w] puts $fd $mkfile close $fd - + set rc [catch { exec $::MAKEBIN -C $dir -f makefile clean $::TARGET >& $dir/build.log }] @@ -86,9 +86,9 @@ proc run_quick_test {dir omit_symbol_list} { } else { puts "Ok" } - - # Create an empty file "$dir/sqlite3". This is to trick the makefile out - # of trying to build the sqlite shell. The sqlite shell won't build + + # Create an empty file "$dir/sqlite3". This is to trick the makefile out + # of trying to build the sqlite shell. The sqlite shell won't build # with some of the OMIT options (i.e OMIT_COMPLETE). set sqlite3_dummy $dir/sqlite3 if {$::tcl_platform(platform)=="windows"} { @@ -139,7 +139,7 @@ proc process_options {argv} { incr i set ::MAKEFILE [lindex $argv $i] } - + -nmake { set ::MAKEBIN nmake set ::MAKEFILE ./Makefile.msc @@ -267,7 +267,7 @@ proc main {argv} { set dirname "test_[regsub -nocase {^x*SQLITE_} $sym {}]" run_quick_test $dirname $sym } else { - # First try a test with all OMIT symbols except SQLITE_OMIT_FLOATING_POINT + # First try a test with all OMIT symbols except SQLITE_OMIT_FLOATING_POINT # and SQLITE_OMIT_PRAGMA defined. The former doesn't work (causes segfaults) # and the latter is currently incompatible with the test suite (this should # be fixed, but it will be a lot of work). @@ -278,7 +278,7 @@ proc main {argv} { } } run_quick_test test_OMIT_EVERYTHING $allsyms - + # Now try one quick.test with each of the OMIT symbols defined. Included # are the OMIT_FLOATING_POINT and OMIT_PRAGMA symbols, even though we # know they will fail. It's good to be reminded of this from time to time. @@ -286,8 +286,8 @@ proc main {argv} { set dirname "test_[regsub -nocase {^x*SQLITE_} $sym {}]" run_quick_test $dirname $sym } - - # Try the ENABLE/DISABLE symbols one at a time. + + # Try the ENABLE/DISABLE symbols one at a time. # We don't do them all at once since some are conflicting. foreach sym $::ENABLE_SYMBOLS { set dirname "test_[regsub -nocase {^x*SQLITE_} $sym {}]" diff --git a/third_party/sqlite/src/tool/pagesig.c b/third_party/sqlite/src/tool/pagesig.c index 540c9d722668c..b8fcc6b7ede1d 100644 --- a/third_party/sqlite/src/tool/pagesig.c +++ b/third_party/sqlite/src/tool/pagesig.c @@ -34,7 +34,7 @@ static void vlogSignature(unsigned char *p, int n, char *zCksum){ int i; if( n<=16 ){ for(i=0; i('abcdefghijklmnopqrstuvwxyz' || x)" ); if( strcmp(zReply, "0")!=0 ){ diff --git a/third_party/sqlite/src/tool/run-speed-test.sh b/third_party/sqlite/src/tool/run-speed-test.sh index 0e970ea0f6022..7b0eff196b6e3 100644 --- a/third_party/sqlite/src/tool/run-speed-test.sh +++ b/third_party/sqlite/src/tool/run-speed-test.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# This is a template for a script used for day-to-day size and +# This is a template for a script used for day-to-day size and # performance monitoring of SQLite. Typical usage: # # sh run-speed-test.sh trunk # Baseline measurement of trunk diff --git a/third_party/sqlite/src/tool/showdb.c b/third_party/sqlite/src/tool/showdb.c index d51a2fd83db4b..2594e25ecf67d 100644 --- a/third_party/sqlite/src/tool/showdb.c +++ b/third_party/sqlite/src/tool/showdb.c @@ -104,7 +104,7 @@ static void fileOpen(const char *zPrg, const char *zName){ g.pDb = openDatabase(zPrg, zName); rc = sqlite3_file_control(g.pDb, "main", SQLITE_FCNTL_FILE_POINTER, pArg); if( rc!=SQLITE_OK ){ - fprintf(stderr, + fprintf(stderr, "%s: failed to obtain fd for %s (SQLite too old?)\n", zPrg, zName ); exit(1); @@ -135,7 +135,7 @@ static void fileClose(){ /* ** Read content from the file. ** -** Space to hold the content is obtained from sqlite3_malloc() and needs +** Space to hold the content is obtained from sqlite3_malloc() and needs ** to be freed by the caller. */ static unsigned char *fileRead(sqlite3_int64 ofst, int nByte){ @@ -392,7 +392,7 @@ static i64 localPayload(i64 nPayload, char cType){ } return nLocal; } - + /* ** Create a description for a single cell. @@ -1075,7 +1075,7 @@ int main(int argc, char **argv){ /* Check for the "--uri" or "-uri" switch. */ if( nArg>1 ){ - if( sqlite3_stricmp("-raw", azArg[1])==0 + if( sqlite3_stricmp("-raw", azArg[1])==0 || sqlite3_stricmp("--raw", azArg[1])==0 ){ g.bRaw = 1; diff --git a/third_party/sqlite/src/tool/showlocks.c b/third_party/sqlite/src/tool/showlocks.c index 752c535cc3719..efe03c3a2441c 100644 --- a/third_party/sqlite/src/tool/showlocks.c +++ b/third_party/sqlite/src/tool/showlocks.c @@ -58,7 +58,7 @@ int main(int argc, char **argv){ return 1; } cnt = showLocksInRange(fd, 0, MX_LCK); - if( cnt==0 ) printf("no locks\n"); + if( cnt==0 ) printf("no locks\n"); close(fd); return 0; } diff --git a/third_party/sqlite/src/tool/showwal.c b/third_party/sqlite/src/tool/showwal.c index 33cc21896b4e2..757ad9d090868 100644 --- a/third_party/sqlite/src/tool/showwal.c +++ b/third_party/sqlite/src/tool/showwal.c @@ -233,7 +233,7 @@ static void print_oneline_frame(int iFrame, Cksum *pCksum){ s0 = getInt32(aData+16); s1 = getInt32(aData+20); fprintf(stdout, "Frame %4d: %6d %6d 0x%08x,%08x 0x%08x,%08x %s\n", - iFrame, + iFrame, getInt32(aData), getInt32(aData+4), getInt32(aData+8), @@ -508,7 +508,7 @@ static void decode_btree_page( printf(" %03x: %.64s\n", i, &zMap[i]); } free(zMap); - } + } } int main(int argc, char **argv){ diff --git a/third_party/sqlite/src/tool/spaceanal.tcl b/third_party/sqlite/src/tool/spaceanal.tcl index e7ce846f865b7..e43d30f94a147 100644 --- a/third_party/sqlite/src/tool/spaceanal.tcl +++ b/third_party/sqlite/src/tool/spaceanal.tcl @@ -203,7 +203,7 @@ set tabledef {CREATE TABLE space_used( name clob, -- Name of a table or index in the database file tblname clob, -- Name of associated table is_index boolean, -- TRUE if it is an index, false for a table - is_without_rowid boolean, -- TRUE if WITHOUT ROWID table + is_without_rowid boolean, -- TRUE if WITHOUT ROWID table nentry int, -- Number of entries in the BTree leaf_entries int, -- Number of leaf entries depth int, -- Depth of the b-tree @@ -238,7 +238,7 @@ foreach {name tblname} [concat sqlite_master sqlite_master [db eval $sql]] { set is_index [expr {$name!=$tblname}] set is_without_rowid [is_without_rowid $name] db eval { - SELECT + SELECT sum(ncell) AS nentry, sum((pagetype=='leaf')*ncell) AS leaf_entries, sum(payload) AS payload, @@ -291,14 +291,14 @@ foreach {name tblname} [concat sqlite_master sqlite_master [db eval $sql]] { $nentry, $leaf_entries, $depth, - $payload, + $payload, $ovfl_payload, - $ovfl_cnt, + $ovfl_cnt, $mx_payload, $int_pages, - $leaf_pages, - $ovfl_pages, - $int_unused, + $leaf_pages, + $ovfl_pages, + $int_unused, $leaf_unused, $ovfl_unused, $gap_cnt, @@ -377,19 +377,19 @@ proc divide {num denom} { proc subreport {title where showFrag} { global pageSize file_pgcnt compressOverhead - # Query the in-memory database for the sum of various statistics + # Query the in-memory database for the sum of various statistics # for the subset of tables/indices identified by the WHERE clause in # $where. Note that even if the WHERE clause matches no rows, the # following query returns exactly one row (because it is an aggregate). # - # The results of the query are stored directly by SQLite into local + # The results of the query are stored directly by SQLite into local # variables (i.e. $nentry, $payload etc.). # mem eval " SELECT int(sum( - CASE WHEN (is_without_rowid OR is_index) THEN nentry - ELSE leaf_entries + CASE WHEN (is_without_rowid OR is_index) THEN nentry + ELSE leaf_entries END )) AS nentry, int(sum(payload)) AS payload, @@ -492,9 +492,9 @@ proc subreport {title where showFrag} { return 1 } -# Calculate the overhead in pages caused by auto-vacuum. +# Calculate the overhead in pages caused by auto-vacuum. # -# This procedure calculates and returns the number of pages used by the +# This procedure calculates and returns the number of pages used by the # auto-vacuum 'pointer-map'. If the database does not support auto-vacuum, # then 0 is returned. The two arguments are the size of the database file in # pages and the page size used by the database (in bytes). @@ -539,7 +539,7 @@ proc autovacuum_overhead {filePages pageSize} { # nindex: Number of indices in the db. # nautoindex: Number of indices created automatically. # nmanindex: Number of indices created manually. -# user_payload: Number of bytes of payload in table btrees +# user_payload: Number of bytes of payload in table btrees # (not including sqlite_master) # user_percent: $user_payload as a percentage of total file size. @@ -607,7 +607,7 @@ statline {Bytes of user payload stored} $user_payload $user_percent puts "" titleline "Page counts for all tables with their indices" puts "" -mem eval {SELECT tblname, count(*) AS cnt, +mem eval {SELECT tblname, count(*) AS cnt, int(sum(int_pages+leaf_pages+ovfl_pages)) AS size FROM space_used GROUP BY tblname ORDER BY size+0 DESC, tblname} {} { statline [string toupper $tblname] $size [percent $size $file_pgcnt] @@ -681,7 +681,7 @@ titleline Definitions puts { Page size in bytes - The number of bytes in a single page of the database file. + The number of bytes in a single page of the database file. Usually 1024. Number of pages in the whole file @@ -754,7 +754,7 @@ Bytes of payload The amount of payload stored under this category. Payload is the data part of table entries and the key part of index entries. The percentage - at the right is the bytes of payload divided by the bytes of storage + at the right is the bytes of payload divided by the bytes of storage consumed. Average payload per entry @@ -825,8 +825,8 @@ Unused bytes on overflow pages Unused bytes on all pages - The total number of bytes of unused space on all primary and overflow - pages. The percentage at the right is the number of unused bytes + The total number of bytes of unused space on all primary and overflow + pages. The percentage at the right is the number of unused bytes divided by the total number of bytes. } diff --git a/third_party/sqlite/src/tool/speed-check.sh b/third_party/sqlite/src/tool/speed-check.sh index 1e1389f2fd0b6..3829dc79a1199 100644 --- a/third_party/sqlite/src/tool/speed-check.sh +++ b/third_party/sqlite/src/tool/speed-check.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# This is a template for a script used for day-to-day size and +# This is a template for a script used for day-to-day size and # performance monitoring of SQLite. Typical usage: # # sh run-speed-test.sh trunk # Baseline measurement of trunk diff --git a/third_party/sqlite/src/tool/speedtest16.c b/third_party/sqlite/src/tool/speedtest16.c index 993cc1926840b..2e31ed8352f56 100644 --- a/third_party/sqlite/src/tool/speedtest16.c +++ b/third_party/sqlite/src/tool/speedtest16.c @@ -31,15 +31,15 @@ #define ISSPACE(X) isspace((unsigned char)(X)) -/* -** hwtime.h contains inline assembler code for implementing +/* +** hwtime.h contains inline assembler code for implementing ** high-performance timing routines. */ #include "hwtime.h" /* ** Convert a zero-terminated ASCII string into a zero-terminated -** UTF-16le string. Memory to hold the returned string comes +** UTF-16le string. Memory to hold the returned string comes ** from malloc() and should be freed by the caller. */ static void *asciiToUtf16le(const char *z){ @@ -71,7 +71,7 @@ static void prepareAndRun(sqlite3 *db, const char *zSql){ const void *stmtTail; sqlite_uint64 iStart, iElapse; int rc; - + printf("****************************************************************\n"); printf("SQL statement: [%s]\n", zSql); utf16 = asciiToUtf16le(zSql); diff --git a/third_party/sqlite/src/tool/speedtest8.c b/third_party/sqlite/src/tool/speedtest8.c index 051fc89819638..032b15e3d38e7 100644 --- a/third_party/sqlite/src/tool/speedtest8.c +++ b/third_party/sqlite/src/tool/speedtest8.c @@ -37,8 +37,8 @@ #include "sqlite3.h" -/* -** hwtime.h contains inline assembler code for implementing +/* +** hwtime.h contains inline assembler code for implementing ** high-performance timing routines. */ #include "hwtime.h" @@ -58,7 +58,7 @@ static void prepareAndRun(sqlite3 *db, const char *zSql, int bQuiet){ const char *stmtTail; sqlite_uint64 iStart, iElapse; int rc; - + if (!bQuiet){ printf("***************************************************************\n"); } @@ -135,24 +135,24 @@ int main(int argc, char **argv){ if( argc>4 && (strcmp(argv[1], "-priority")==0) ){ #if defined(_MSC_VER) int new_priority = atoi(argv[2]); - if(!SetPriorityClass(GetCurrentProcess(), - (new_priority<=-5) ? HIGH_PRIORITY_CLASS : - (new_priority<=0) ? ABOVE_NORMAL_PRIORITY_CLASS : - (new_priority==0) ? NORMAL_PRIORITY_CLASS : - (new_priority<5) ? BELOW_NORMAL_PRIORITY_CLASS : + if(!SetPriorityClass(GetCurrentProcess(), + (new_priority<=-5) ? HIGH_PRIORITY_CLASS : + (new_priority<=0) ? ABOVE_NORMAL_PRIORITY_CLASS : + (new_priority==0) ? NORMAL_PRIORITY_CLASS : + (new_priority<5) ? BELOW_NORMAL_PRIORITY_CLASS : IDLE_PRIORITY_CLASS)){ - printf ("error setting priority\n"); - exit(2); + printf ("error setting priority\n"); + exit(2); } #else struct sched_param myParam; sched_getparam(0, &myParam); - printf ("Current process priority is %d.\n", (int)myParam.sched_priority); + printf ("Current process priority is %d.\n", (int)myParam.sched_priority); myParam.sched_priority = atoi(argv[2]); - printf ("Setting process priority to %d.\n", (int)myParam.sched_priority); + printf ("Setting process priority to %d.\n", (int)myParam.sched_priority); if (sched_setparam (0, &myParam) != 0){ - printf ("error setting priority\n"); - exit(2); + printf ("error setting priority\n"); + exit(2); } #endif argv += 2; diff --git a/third_party/sqlite/src/tool/speedtest8inst1.c b/third_party/sqlite/src/tool/speedtest8inst1.c index ceaeca0f167bb..14af2a727aaaa 100644 --- a/third_party/sqlite/src/tool/speedtest8inst1.c +++ b/third_party/sqlite/src/tool/speedtest8inst1.c @@ -122,7 +122,7 @@ error_out: int main(int argc, char **argv){ - const char zUsageMsg[] = + const char zUsageMsg[] = "Usage: %s options...\n" " where available options are:\n" "\n" @@ -208,10 +208,10 @@ int main(int argc, char **argv){ } } } - + sqlite3_instvfs_destroy(pInstVfs); return 0; - + usage: fprintf(stderr, zUsageMsg, argv[0]); return -3; diff --git a/third_party/sqlite/src/tool/sqldiff.c b/third_party/sqlite/src/tool/sqldiff.c index 67f3197bbfeb7..4ca1bb24adc74 100644 --- a/third_party/sqlite/src/tool/sqldiff.c +++ b/third_party/sqlite/src/tool/sqldiff.c @@ -62,7 +62,7 @@ static void strInit(Str *p){ p->nAlloc = 0; p->nUsed = 0; } - + /* ** Print an error resulting from faulting command-line arguments and ** abort the program. @@ -347,7 +347,7 @@ static char **columnNames( sqlite3_finalize(pStmt); if( az ) az[naz] = 0; - /* If it is non-NULL, set *pbRowid to indicate whether or not the PK of + /* If it is non-NULL, set *pbRowid to indicate whether or not the PK of ** this table is an implicit rowid (*pbRowid==1) or not (*pbRowid==0). */ if( pbRowid ) *pbRowid = (az[0]==0); @@ -542,7 +542,7 @@ static void diff_one_table(const char *zTab, FILE *out){ } goto end_diff_one_table; } - + if( sqlite3_table_column_metadata(g.db,"aux",zTab,0,0,0,0,0,0) ){ if( !sqlite3_table_column_metadata(g.db,"main",zTab,0,0,0,0,0,0) ){ @@ -662,7 +662,7 @@ static void diff_one_table(const char *zTab, FILE *out){ } strPrintf(&sql, ";\n"); - if( g.fDebug & DEBUG_DIFF_SQL ){ + if( g.fDebug & DEBUG_DIFF_SQL ){ printf("SQL for %s:\n%s\n", zId, sql.z); goto end_diff_one_table; } @@ -1172,7 +1172,7 @@ static void getRbudiffQuery( ){ int i; - /* First the newly inserted rows: **/ + /* First the newly inserted rows: **/ strPrintf(pSql, "SELECT "); strPrintfArray(pSql, ", ", "%s", azCol, -1); strPrintf(pSql, ", 0, "); /* Set ota_control to 0 for an insert */ @@ -1200,14 +1200,14 @@ static void getRbudiffQuery( strPrintf(pSql, "\n) AND "); strPrintfArray(pSql, " AND ", "(n.%Q IS NOT NULL)", azCol, nPK); - /* Updated rows. If all table columns are part of the primary key, there + /* Updated rows. If all table columns are part of the primary key, there ** can be no updates. In this case this part of the compound SELECT can ** be omitted altogether. */ if( azCol[nPK] ){ strPrintf(pSql, "\nUNION ALL\nSELECT "); strPrintfArray(pSql, ", ", "n.%s", azCol, nPK); strPrintf(pSql, ",\n"); - strPrintfArray(pSql, " ,\n", + strPrintfArray(pSql, " ,\n", " CASE WHEN n.%s IS o.%s THEN NULL ELSE n.%s END", &azCol[nPK], -1 ); @@ -1218,13 +1218,13 @@ static void getRbudiffQuery( }else{ strPrintf(pSql, ",\n"); } - strPrintfArray(pSql, " ||\n", + strPrintfArray(pSql, " ||\n", " CASE WHEN n.%s IS o.%s THEN '.' ELSE 'x' END", &azCol[nPK], -1 ); strPrintf(pSql, "\nAS ota_control, "); strPrintfArray(pSql, ", ", "NULL", azCol, nPK); strPrintf(pSql, ",\n"); - strPrintfArray(pSql, " ,\n", + strPrintfArray(pSql, " ,\n", " CASE WHEN n.%s IS o.%s THEN NULL ELSE o.%s END", &azCol[nPK], -1 ); @@ -1283,9 +1283,9 @@ static void rbudiff_one_table(const char *zTab, FILE *out){ pStmt = db_prepare("%s", sql.z); while( sqlite3_step(pStmt)==SQLITE_ROW ){ - - /* If this is the first row output, print out the CREATE TABLE - ** statement first. And then set ct.z to NULL so that it is not + + /* If this is the first row output, print out the CREATE TABLE + ** statement first. And then set ct.z to NULL so that it is not ** printed again. */ if( ct.z ){ fprintf(out, "%s\n", ct.z); @@ -1310,7 +1310,7 @@ static void rbudiff_one_table(const char *zTab, FILE *out){ for(i=0; i=nPK + if( i>=nPK && sqlite3_column_type(pStmt, i)==SQLITE_BLOB && sqlite3_column_type(pStmt, nCol+1+i)==SQLITE_BLOB ){ @@ -1458,7 +1458,7 @@ static void summarize_one_table(const char *zTab, FILE *out){ } strPrintf(&sql, ")\n ORDER BY 1;\n"); - if( (g.fDebug & DEBUG_DIFF_SQL)!=0 ){ + if( (g.fDebug & DEBUG_DIFF_SQL)!=0 ){ printf("SQL for %s:\n%s\n", zId, sql.z); goto end_summarize_one_table; } @@ -1594,7 +1594,7 @@ static void changeset_one_table(const char *zTab, FILE *out){ } } sqlite3_finalize(pStmt); - if( nPk==0 ) goto end_changeset_one_table; + if( nPk==0 ) goto end_changeset_one_table; strInit(&sql); if( nCol>nPk ){ strPrintf(&sql, "SELECT %d", SQLITE_UPDATE); @@ -1660,7 +1660,7 @@ static void changeset_one_table(const char *zTab, FILE *out){ } strPrintf(&sql, ";\n"); - if( g.fDebug & DEBUG_DIFF_SQL ){ + if( g.fDebug & DEBUG_DIFF_SQL ){ printf("SQL for %s:\n%s\n", zId, sql.z); goto end_changeset_one_table; } @@ -1731,7 +1731,7 @@ static void changeset_one_table(const char *zTab, FILE *out){ } } sqlite3_finalize(pStmt); - + end_changeset_one_table: while( nCol>0 ) sqlite3_free(azCol[--nCol]); sqlite3_free(azCol); @@ -1742,7 +1742,7 @@ end_changeset_one_table: /* ** Extract the next SQL keyword or quoted string from buffer zIn and copy it ** (or a prefix of it if it will not fit) into buffer zBuf, size nBuf bytes. -** Return a pointer to the character within zIn immediately following +** Return a pointer to the character within zIn immediately following ** the token or quoted string just extracted. */ const char *gobble_token(const char *zIn, char *zBuf, int nBuf){ @@ -1792,7 +1792,7 @@ const char *gobble_token(const char *zIn, char *zBuf, int nBuf){ ** uses. Otherwise, if the statement is not a CVT, NULL is returned. */ static void module_name_func( - sqlite3_context *pCtx, + sqlite3_context *pCtx, int nVal, sqlite3_value **apVal ){ const char *zSql; @@ -1812,7 +1812,7 @@ static void module_name_func( zSql = gobble_token(zSql, zToken, sizeof(zToken)); if( zSql==0 || sqlite3_stricmp(zToken, "using") ) return; zSql = gobble_token(zSql, zToken, sizeof(zToken)); - + sqlite3_result_text(pCtx, zToken, -1, SQLITE_TRANSIENT); } @@ -1823,29 +1823,29 @@ static void module_name_func( const char *all_tables_sql(){ if( g.bHandleVtab ){ int rc; - - rc = sqlite3_exec(g.db, + + rc = sqlite3_exec(g.db, "CREATE TEMP TABLE tblmap(module COLLATE nocase, postfix);" "INSERT INTO temp.tblmap VALUES" "('fts3', '_content'), ('fts3', '_segments'), ('fts3', '_segdir')," - + "('fts4', '_content'), ('fts4', '_segments'), ('fts4', '_segdir')," "('fts4', '_docsize'), ('fts4', '_stat')," - + "('fts5', '_data'), ('fts5', '_idx'), ('fts5', '_content')," "('fts5', '_docsize'), ('fts5', '_config')," - + "('rtree', '_node'), ('rtree', '_rowid'), ('rtree', '_parent');" , 0, 0, 0 ); assert( rc==SQLITE_OK ); - + rc = sqlite3_create_function( g.db, "module_name", 1, SQLITE_UTF8, 0, module_name_func, 0, 0 ); assert( rc==SQLITE_OK ); - - return + + return "SELECT name FROM main.sqlite_master\n" " WHERE type='table' AND (\n" " module_name(sql) IS NULL OR \n" @@ -1853,7 +1853,7 @@ const char *all_tables_sql(){ " ) AND name NOT IN (\n" " SELECT a.name || b.postfix \n" "FROM main.sqlite_master AS a, temp.tblmap AS b \n" - "WHERE module_name(a.sql) = b.module\n" + "WHERE module_name(a.sql) = b.module\n" " )\n" "UNION \n" "SELECT name FROM aux.sqlite_master\n" @@ -1863,7 +1863,7 @@ const char *all_tables_sql(){ " ) AND name NOT IN (\n" " SELECT a.name || b.postfix \n" "FROM aux.sqlite_master AS a, temp.tblmap AS b \n" - "WHERE module_name(a.sql) = b.module\n" + "WHERE module_name(a.sql) = b.module\n" " )\n" " ORDER BY name"; }else{ diff --git a/third_party/sqlite/src/tool/srcck1.c b/third_party/sqlite/src/tool/srcck1.c index 20084ac47f1a0..b5074f1bfa5cf 100644 --- a/third_party/sqlite/src/tool/srcck1.c +++ b/third_party/sqlite/src/tool/srcck1.c @@ -43,7 +43,7 @@ static char *readFile(const char *zFilename){ rewind(in); z = malloc( n+1 ); if( z==0 ){ - fprintf(stderr, "cannot allocate %d bytes to store '%s'\n", + fprintf(stderr, "cannot allocate %d bytes to store '%s'\n", (int)(n+1), zFilename); exit(1); } @@ -67,11 +67,11 @@ static char *readFile(const char *zFilename){ ** * '++' ** * '--' ** -** If the code contains the phrase "side-effects-ok" is inside a +** If the code contains the phrase "side-effects-ok" is inside a ** comment, then always return false. This is used to disable checking ** for assert()s with deliberate side-effects, such as used by ** SQLITE_TESTCTRL_ASSERT - a facility that allows applications to -** determine at runtime whether or not assert()s are enabled. +** determine at runtime whether or not assert()s are enabled. ** Obviously, that determination cannot be made unless the assert() ** has some side-effect. ** @@ -154,5 +154,5 @@ int main(int argc, char **argv){ fprintf(stderr, "Found %u undesirable side-effects\n", nErr); return 1; } - return 0; + return 0; } diff --git a/third_party/sqlite/src/tool/stack_usage.tcl b/third_party/sqlite/src/tool/stack_usage.tcl index b3574f026e08b..b43323db7dad3 100644 --- a/third_party/sqlite/src/tool/stack_usage.tcl +++ b/third_party/sqlite/src/tool/stack_usage.tcl @@ -1,6 +1,6 @@ #!/usr/bin/tclsh # -# Parse the output of +# Parse the output of # # objdump -d sqlite3.o # diff --git a/third_party/sqlite/src/tool/varint.c b/third_party/sqlite/src/tool/varint.c index f4a51118b4d6e..9548822833ec8 100644 --- a/third_party/sqlite/src/tool/varint.c +++ b/third_party/sqlite/src/tool/varint.c @@ -36,7 +36,7 @@ static int putVarint(unsigned char *p, u64 v){ v >>= 7; } return 9; - } + } n = 0; do{ buf[n++] = (unsigned char)((v & 0x7f) | 0x80); @@ -59,7 +59,7 @@ int main(int argc, char **argv){ unsigned char zHex[20]; if( argc==1 ){ - fprintf(stderr, + fprintf(stderr, "Usage:\n" " %s HH HH HH ... Convert varint to decimal\n" " %s DDDDD Convert decimal to varint\n" @@ -67,7 +67,7 @@ int main(int argc, char **argv){ argv[0], argv[0]); exit(1); } - if( argc>2 + if( argc>2 || (strlen(argv[1])==2 && hexValue(argv[1][0])>=0 && hexValue(argv[1][1])>=0) ){ /* Hex to decimal */ diff --git a/third_party/sqlite/src/tool/vdbe_profile.tcl b/third_party/sqlite/src/tool/vdbe_profile.tcl index a0dc99ec33a95..48e735580c6df 100644 --- a/third_party/sqlite/src/tool/vdbe_profile.tcl +++ b/third_party/sqlite/src/tool/vdbe_profile.tcl @@ -5,7 +5,7 @@ # This script summarizes the results contained in that file. # # DETAILS: -# Compile SQLite using the -DVDBE_PROFILE option on Linux. This causes +# Compile SQLite using the -DVDBE_PROFILE option on Linux. This causes # performance information about individual VDBE operations to be appended # to the "vdbe_profile.out" file. After content has been accumulated in # vdbe_profile.out, run this script to analyze the output and generate a diff --git a/third_party/sqlite/src/tool/warnings-clang.sh b/third_party/sqlite/src/tool/warnings-clang.sh index 7a0aa4bce7f86..8d1e1943d59c5 100644 --- a/third_party/sqlite/src/tool/warnings-clang.sh +++ b/third_party/sqlite/src/tool/warnings-clang.sh @@ -1,6 +1,6 @@ #/bin/sh # -# Run this script in a directory with a working makefile to check for +# Run this script in a directory with a working makefile to check for # compiler warnings in SQLite. # rm -f sqlite3.c diff --git a/third_party/sqlite/src/tool/warnings.sh b/third_party/sqlite/src/tool/warnings.sh index ae40cfb1aee37..feed72ec9c11c 100644 --- a/third_party/sqlite/src/tool/warnings.sh +++ b/third_party/sqlite/src/tool/warnings.sh @@ -1,6 +1,6 @@ #/bin/sh # -# Run this script in a directory with a working makefile to check for +# Run this script in a directory with a working makefile to check for # compiler warnings in SQLite. # diff --git a/third_party/sqlite/src/vsixtest/vsixtest.tcl b/third_party/sqlite/src/vsixtest/vsixtest.tcl index 5dce821dc4e70..80d2d9966d66d 100644 --- a/third_party/sqlite/src/vsixtest/vsixtest.tcl +++ b/third_party/sqlite/src/vsixtest/vsixtest.tcl @@ -33,7 +33,7 @@ # name of the VSIX file to test. # package require Tcl 8.4 - + proc fail { {error ""} {usage false} } { if {[string length $error] > 0} then { puts stdout $error @@ -46,7 +46,7 @@ proc fail { {error ""} {usage false} } { exit 1 } - + proc isWindows {} { # # NOTE: Returns non-zero only when running on Windows. @@ -54,7 +54,7 @@ proc isWindows {} { return [expr {[info exists ::tcl_platform(platform)] && \ $::tcl_platform(platform) eq "windows"}] } - + proc isAdministrator {} { # # NOTE: Returns non-zero only when running as "elevated administrator". @@ -84,7 +84,7 @@ proc isAdministrator {} { return false } - + proc getEnvironmentVariable { name } { # # NOTE: Returns the value of the specified environment variable or an empty @@ -93,7 +93,7 @@ proc getEnvironmentVariable { name } { # return [expr {[info exists ::env($name)] ? $::env($name) : ""}] } - + proc getTemporaryPath {} { # # NOTE: Returns the normalized path to the first temporary directory found @@ -117,7 +117,7 @@ proc getTemporaryPath {} { return "" } - + proc appendArgs { args } { # # NOTE: Returns all passed arguments joined together as a single string @@ -125,7 +125,7 @@ proc appendArgs { args } { # eval append result $args } - + proc readFile { fileName } { # # NOTE: Reads and returns the entire contents of the specified file, which @@ -137,7 +137,7 @@ proc readFile { fileName } { close $file_id return $result } - + proc writeFile { fileName data } { # # NOTE: Writes the entire contents of the specified file, which may contain @@ -149,7 +149,7 @@ proc writeFile { fileName data } { close $file_id return "" } - + proc putsAndEval { command } { # # NOTE: Outputs a command to the standard output channel and then evaluates @@ -161,7 +161,7 @@ proc putsAndEval { command } { return [uplevel 1 $command] } - + proc isBadDirectory { directory } { # # NOTE: Returns non-zero if the directory is empty, does not exist, -OR- is @@ -174,7 +174,7 @@ proc isBadDirectory { directory } { return [expr {[string length $directory] == 0 || \ ![file exists $directory] || ![file isdirectory $directory]}] } - + proc isBadFile { fileName } { # # NOTE: Returns non-zero if the file name is empty, does not exist, -OR- is @@ -187,7 +187,7 @@ proc isBadFile { fileName } { return [expr {[string length $fileName] == 0 || \ ![file exists $fileName] || ![file isfile $fileName]}] } - + # # NOTE: This is the entry point for this script. # -- GitLab